diff options
author | Treeki <treeki@gmail.com> | 2013-02-03 00:31:46 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2013-02-03 00:31:46 +0100 |
commit | 06828e3a02a0ca2eaf56d804bb6845659cfa59e7 (patch) | |
tree | bb28c665445fc622958b9614d014ba791cad2d0f /src/bossSamurshai.cpp | |
parent | 012efaa6343cd2bec2f728d0bec6243263712a45 (diff) | |
download | kamek-06828e3a02a0ca2eaf56d804bb6845659cfa59e7.tar.gz kamek-06828e3a02a0ca2eaf56d804bb6845659cfa59e7.zip |
fix a bug in the collision headers, and assorted collision bugs
Diffstat (limited to 'src/bossSamurshai.cpp')
-rw-r--r-- | src/bossSamurshai.cpp | 83 |
1 files changed, 49 insertions, 34 deletions
diff --git a/src/bossSamurshai.cpp b/src/bossSamurshai.cpp index 3afd72b..6e09561 100644 --- a/src/bossSamurshai.cpp +++ b/src/bossSamurshai.cpp @@ -51,16 +51,16 @@ class daSamurshai : public daBoss { void playerCollision(ActivePhysics *apThis, ActivePhysics *apOther); void yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther); - void collisionCat3_StarPower(ActivePhysics *apThis, ActivePhysics *apOther); - void collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther); - void collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther); - void collisionCat7_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther); - void collisionCat7_GroundPoundYoshi(ActivePhysics *apThis, ActivePhysics *apOther); - void collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther); - void collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther); + bool collisionCat3_StarPower(ActivePhysics *apThis, ActivePhysics *apOther); + bool collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther); + bool collisionCatD_Drill(ActivePhysics *apThis, ActivePhysics *apOther); + bool collisionCat7_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther); + bool collisionCat7_GroundPoundYoshi(ActivePhysics *apThis, ActivePhysics *apOther); + bool collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther); + bool collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther); bool collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther); - void collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther); - void collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther); + bool collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther); + bool collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther); void addScoreWhenHit(void *other); int randomPlayer(); @@ -131,8 +131,10 @@ daSamurshai *daSamurshai::build() { } void daSamurshai::yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther) { this->playerCollision(apThis, apOther); } - void daSamurshai::collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) { } - void daSamurshai::collisionCat7_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) { + bool daSamurshai::collisionCatD_Drill(ActivePhysics *apThis, ActivePhysics *apOther) { + return collisionCat7_GroundPound(apThis, apOther); + } + bool daSamurshai::collisionCat7_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) { apOther->someFlagByte |= 2; if (this->isDown == 0) { @@ -143,18 +145,25 @@ daSamurshai *daSamurshai::build() { deathInfo.isDead = 0; this->flags_4FC |= (1<<(31-7)); - this->counter_504[apOther->owner->which_player] = 0; + this->counter_504[apOther->owner->which_player] = 5; + bouncePlayerWhenJumpedOn(apOther->owner); + return true; + } + bool daSamurshai::collisionCat7_GroundPoundYoshi(ActivePhysics *apThis, ActivePhysics *apOther) { + return this->collisionCat7_GroundPound(apThis, apOther); } - void daSamurshai::collisionCat7_GroundPoundYoshi(ActivePhysics *apThis, ActivePhysics *apOther) { this->collisionCat7_GroundPound(apThis, apOther); } - void daSamurshai::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { + bool daSamurshai::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { if (this->isDown == 0) { damage += 3; if (damage >= 15) { doStateChange(&StateID_Outro); } else { doStateChange(&StateID_Damage); } } + return true; } - void daSamurshai::collisionCat3_StarPower(ActivePhysics *apThis, ActivePhysics *apOther){ } - void daSamurshai::collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther){ + bool daSamurshai::collisionCat3_StarPower(ActivePhysics *apThis, ActivePhysics *apOther){ + return true; + } + bool daSamurshai::collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther){ if (this->isDown == 0) { damage += 3; if (damage >= 15) { doStateChange(&StateID_Outro); } @@ -164,24 +173,30 @@ daSamurshai *daSamurshai::build() { deathInfo.isDead = 0; this->flags_4FC |= (1<<(31-7)); this->counter_504[apOther->owner->which_player] = 0; - } - void daSamurshai::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther){ - damage += 4; - SpawnEffect("Wm_mr_fireball_hit", 0, &apOther->owner->pos, &apOther->owner->rot, &apOther->owner->scale); - PlaySoundAsync(this, SE_OBJ_FIREBALL_DISAPP); - if (damage >= 15) { doStateChange(&StateID_Outro); } - } - void daSamurshai::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { - damage += 1; - SpawnEffect("Wm_mr_fireball_hit", 0, &apOther->owner->pos, &apOther->owner->rot, &apOther->owner->scale); - PlaySoundAsync(this, SE_OBJ_FIREBALL_DISAPP); - if (damage >= 15) { doStateChange(&StateID_Outro); } - } - bool daSamurshai::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { return true; } - void daSamurshai::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) { - damage += 2; - this->spawnHitEffectAtPosition((Vec2){apOther->owner->pos.x, apOther->owner->pos.y}); - if (damage >= 15) { doStateChange(&StateID_Outro); } + return true; + } + bool daSamurshai::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther){ + //damage += 4; + //SpawnEffect("Wm_mr_fireball_hit", 0, &apOther->owner->pos, &apOther->owner->rot, &apOther->owner->scale); + //PlaySoundAsync(this, SE_OBJ_FIREBALL_DISAPP); + //if (damage >= 15) { doStateChange(&StateID_Outro); } + return true; + } + bool daSamurshai::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { + //damage += 1; + //SpawnEffect("Wm_mr_fireball_hit", 0, &apOther->owner->pos, &apOther->owner->rot, &apOther->owner->scale); + //PlaySoundAsync(this, SE_OBJ_FIREBALL_DISAPP); + //if (damage >= 15) { doStateChange(&StateID_Outro); } + return true; + } + bool daSamurshai::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) { + return true; + } + bool daSamurshai::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) { + //damage += 2; + //this->spawnHitEffectAtPosition((Vec2){apOther->owner->pos.x, apOther->owner->pos.y}); + //if (damage >= 15) { doStateChange(&StateID_Outro); } + return true; } |