summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2012-03-17 18:18:15 -0500
committerColin Noga <Tempus@chronometry.ca>2012-03-17 18:18:15 -0500
commitcb939234c499b337adad657f865deb6e7a2325fd (patch)
treea0a01eacf1a7733581e95f02c0ad6346858f20bf /src
parent3f668ac74d6b4ecdd890ba89560ed1ee84bf1159 (diff)
downloadkamek-cb939234c499b337adad657f865deb6e7a2325fd.tar.gz
kamek-cb939234c499b337adad657f865deb6e7a2325fd.zip
Volley back the EGG:Effect
Diffstat (limited to '')
-rw-r--r--src/bossCaptainBowser.cpp11
-rw-r--r--src/bossKoopaThrow.cpp46
-rw-r--r--src/shyguy.cpp8
3 files changed, 39 insertions, 26 deletions
diff --git a/src/bossCaptainBowser.cpp b/src/bossCaptainBowser.cpp
index ce85f29..710af77 100644
--- a/src/bossCaptainBowser.cpp
+++ b/src/bossCaptainBowser.cpp
@@ -99,7 +99,6 @@ daCaptainBowser *daCaptainBowser::build() {
else if (this->damage > 20) { doStateChange(&StateID_Outro); }
else { doStateChange(&StateID_Damage); }
}
- else { dEn_c::spriteCollision(apThis, apOther); }
}
void daCaptainBowser::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) {
@@ -250,10 +249,10 @@ int daCaptainBowser::onDraw() {
//////////////////
void daCaptainBowser::beginState_Wait() {
if (this->isAngry == 0) {
- bindAnimChr_and_setUpdateRate("kp_wait", 1, 0.0, 1.0);
+ bindAnimChr_and_setUpdateRate("kp_wait", 1, 0.0, 1.5);
}
else {
- bindAnimChr_and_setUpdateRate("kp_wait", 1, 0.0, 1.5);
+ bindAnimChr_and_setUpdateRate("kp_wait", 1, 0.0, 2.0);
}
}
void daCaptainBowser::executeState_Wait() {
@@ -286,12 +285,12 @@ int daCaptainBowser::onDraw() {
if (this->chrAnimation.getCurrentFrame() == 60.0) { // throw back
int num = GenerateRandomNumber(5);
- CreateActor(10, 0x100 + ((num + 1) * 0x10), this->pos, 0, 0);
+ CreateActor(0x29F, 0x101 + ((num + 1) * 0x10), (Vec){pos.x-146.0, pos.y+122.0, pos.z}, 0, 0);
}
if (this->chrAnimation.getCurrentFrame() == 126.0) { // throw front
int num = GenerateRandomNumber(4);
- CreateActor(10, (num + 1) * 0x10, this->pos, 0, 0);
+ CreateActor(0x29F, ((num + 1) * 0x10) + 1, (Vec){pos.x-146.0, pos.y+122.0, pos.z}, 0, 0);
}
if (this->chrAnimation.isAnimationDone()) {
@@ -322,7 +321,7 @@ int daCaptainBowser::onDraw() {
void daCaptainBowser::executeState_Fire() {
if (this->chrAnimation.getCurrentFrame() == 70) { // spit fire
- CreateActor(KOOPA_FIRE, 0, this->pos, 0, 0); // Seems like nyb 5 has a setting, 2 bits long, maybe.
+ CreateActor(KOOPA_FIRE, 0x30, (Vec){pos.x-156.0, pos.y+128.0, pos.z}, 0, 0); // Seems like nyb 5 has a setting, 2 bits long, maybe.
}
if (this->chrAnimation.isAnimationDone()) {
diff --git a/src/bossKoopaThrow.cpp b/src/bossKoopaThrow.cpp
index 8c6d4ee..19beadd 100644
--- a/src/bossKoopaThrow.cpp
+++ b/src/bossKoopaThrow.cpp
@@ -20,12 +20,12 @@ struct TypeInfo {
};
static const TypeInfo types[6] = {
- {"choropoo", "g3d/choropoo.brres", "spanner", "Wm_en_hit", 0, SE_BOSS_JR_FLOOR_BREAK, 0, 8.0f, 2.0f, 0, 0, 0x1000},
- {"choropoo", "g3d/choropoo.brres", "spanner", "Wm_en_burst_s", 0, SE_BOSS_JR_BOMB_BURST, 0, 8.0f, 2.0f, 0, 0, 0x1000},
- {"koopa_clown_bomb", "g3d/koopa_clown_bomb.brres", "koopa_clown_bomb", "Wm_en_burst_s", SE_BOSS_JR_BOMB_BOUND, SE_BOSS_JR_BOMB_BURST, 0, 8.0f, 1.0f, 0x200, 0x800, 0x1000},
- {"bros", "g3d/t00.brres", "bros_hammer", "Wm_en_hit", 0, SE_OBJ_HAMMER_HIT_BOTH, SE_EMY_MEGA_BROS_HAMMER, 8.0f, 2.0f, 0, 0, 0x1000},
- {"dossun", "g3d/t00.brres", "dossun", "Wm_en_hit", SE_EMY_DOSSUN, SE_EMY_DOSSUN_DEAD, 0, 8.0f, 1.0f, 0x100, 0x1000, 0x1000},
- {"KoopaShip", "g3d/present.brres", "PresentBox_penguin", "Wm_dm_presentopen",SE_EMY_DOSSUN, SE_EMY_DOSSUN_DEAD, 0, 8.0f, 1.0f, 0x20, 0x40, 0x200}
+ {"choropoo", "g3d/choropoo.brres", "spanner", "Wm_en_hit", 0, SE_BOSS_JR_FLOOR_BREAK, 0, 8.0f, 2.0f, 0, 0, 0x1000},
+ {"choropoo", "g3d/choropoo.brres", "spanner", "Wm_en_burst_s", 0, SE_BOSS_JR_BOMB_BURST, 0, 8.0f, 2.0f, 0, 0, 0x1000},
+ {"koopa_clown_bomb", "g3d/koopa_clown_bomb.brres", "koopa_clown_bomb", "Wm_en_burst_s", SE_BOSS_JR_BOMB_BOUND, SE_BOSS_JR_BOMB_BURST, 0, 16.0f, 0.8f, 0x200, 0x800, 0x1000},
+ {"bros", "g3d/t00.brres", "bros_hammer", "Wm_en_hit", 0, SE_OBJ_HAMMER_HIT_BOTH, SE_EMY_MEGA_BROS_HAMMER, 16.0f, 2.0f, 0, 0, 0x1000},
+ {"dossun", "g3d/t00.brres", "dossun", "Wm_en_hit", SE_EMY_DOSSUN, SE_EMY_DOSSUN_DEAD, 0, 16.0f, 1.0f, 0x100, 0x100, 0x100},
+ {"KoopaShip", "g3d/present.brres", "PresentBox_penguin", "Wm_dm_presentopen",SE_DEMO_OP_PRESENT_THROW_2400f, SE_DEMO_OP_PRESENT_BOX_BURST, 0, 12.0f, 1.0f, 0x20, 0x40, 0x200}
};
@@ -52,6 +52,7 @@ class daKoopaThrow : public dEn_c {
void updateModelMatrices();
void playerCollision(ActivePhysics *apThis, ActivePhysics *apOther);
+ void spriteCollision(ActivePhysics *apThis, ActivePhysics *apOther);
void collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther);
bool collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther);
@@ -86,9 +87,13 @@ extern "C" void *PlayWrenchSound(dEn_c *);
void daKoopaThrow::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) {
if (Type == 5) {
PlaySoundAsync(this, currentInfo->breakSound);
- SpawnEffect(currentInfo->deathEffect, 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
- CreateActor(EN_HATENA_BALLOON, 0x100, this->pos, 0, 0);
+ SpawnEffect(currentInfo->deathEffect, 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){3.0, 3.0, 3.0});
+ dStageActor_c *spawned = CreateActor(EN_HATENA_BALLOON, 0x100, this->pos, 0, 0);
+ spawned->pos.x = this->pos.x;
+ spawned->pos.y = this->pos.y;
this->Delete(1);
+
+ return;
}
DamagePlayer(this, apThis, apOther);
@@ -102,6 +107,8 @@ void daKoopaThrow::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther
}
}
+void daKoopaThrow::spriteCollision(ActivePhysics *apThis, ActivePhysics *apOther) {}
+
void daKoopaThrow::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { }
bool daKoopaThrow::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) {
return false;
@@ -259,6 +266,7 @@ int daKoopaThrow::onExecute() {
float rect[] = {this->_320, this->_324, this->spriteSomeRectX, this->spriteSomeRectY};
int ret = this->outOfZone(this->pos, (float*)&rect, this->currentZoneID);
if(ret) {
+ OSReport("Deleting");
this->Delete(1);
}
@@ -268,13 +276,13 @@ int daKoopaThrow::onExecute() {
void daKoopaThrow::beginState_Straight() {
- float rand = (float)GenerateRandomNumber(10) * 0.8;
+ float rand = (float)GenerateRandomNumber(10) * 0.4;
if (this->direction == 0) { // directions 1 spins clockwise, fly rightwards
- speed.x = 3.0 + rand;
+ speed.x = 1.5 + rand;
}
else { // directions 0 spins anti-clockwise, fly leftwards
- speed.x = -3.0 - rand;
+ speed.x = -1.5 - rand;
}
speed.y = 9.0;
@@ -290,13 +298,13 @@ void daKoopaThrow::executeState_Straight() {
cmgr_returnValue = collMgr.CollidedWithTile();
collMgr.execute();
- if (collMgr.CollidedWithTile() || (collMgr.bitfield_for_checks & (0x15 << direction))) {
- // hit the ground or wall
- PlaySoundAsync(this, currentInfo->breakSound);
+ // if (collMgr.CollidedWithTile() || (collMgr.bitfield_for_checks & (0x15 << direction))) {
+ // // hit the ground or wall
+ // PlaySoundAsync(this, currentInfo->breakSound);
- SpawnEffect(currentInfo->deathEffect, 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75});
- this->Delete(1);
- }
+ // SpawnEffect(currentInfo->deathEffect, 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75});
+ // this->Delete(1);
+ // }
if (this->direction == 1) { // directions 1 spins clockwise, fly rightwards
this->rot.x -= currentInfo->xrot;
@@ -320,7 +328,9 @@ void daKoopaThrow::executeState_Straight() {
if (this->speed.y < 0.0) {
PlaySoundAsync(this, currentInfo->breakSound);
SpawnEffect(currentInfo->deathEffect, 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
- CreateActor(EN_HATENA_BALLOON, 0x100, this->pos, 0, 0);
+ dStageActor_c *spawned = CreateActor(EN_HATENA_BALLOON, 0x100, this->pos, 0, 0);
+ spawned->pos.x = this->pos.x;
+ spawned->pos.y = this->pos.y;
this->Delete(1);
}
}
diff --git a/src/shyguy.cpp b/src/shyguy.cpp
index 79ed869..acee2f6 100644
--- a/src/shyguy.cpp
+++ b/src/shyguy.cpp
@@ -50,6 +50,8 @@ class daShyGuy : public dEn_c {
m3d::anmChr_c chrAnimation;
// m3d::anmChr_c carryAnm;
+ mEf::es2 effect;
+
int type;
int timer;
int jumpCounter;
@@ -693,7 +695,7 @@ int daShyGuy::onExecute() {
if (type > 8) {
giantRider.update();
}
-
+
return true;
}
@@ -1227,7 +1229,7 @@ void daShyGuy::updateModelMatrices() {
void daShyGuy::beginState_GoDizzy() {
bindAnimChr_and_setUpdateRate("c18_L_DMG_F_1_R", 1, 0.0, 1.0);
- SpawnEffect("Wm_en_spindamage", 0, &(Vec){this->pos.x, this->pos.y + 24.0, 0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
+ // SpawnEffect("Wm_en_spindamage", 0, &(Vec){this->pos.x, this->pos.y + 24.0, 0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
this->max_speed.x = 0;
this->speed.x = 0;
@@ -1245,6 +1247,8 @@ void daShyGuy::updateModelMatrices() {
calculateTileCollisions();
// Needs tile collision shit here, because jumpers can get hit and fall downwards.
+
+ effect.spawn("Wm_en_spindamage", 0, &(Vec){this->pos.x, this->pos.y + 24.0, 0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
if (this->jumpCounter == 0) {
if(this->chrAnimation.isAnimationDone()) {