diff options
author | Colin Noga <Tempus@chronometry.ca> | 2012-03-13 23:17:46 -0500 |
---|---|---|
committer | Colin Noga <Tempus@chronometry.ca> | 2012-03-13 23:17:46 -0500 |
commit | 90024c1ccea34513a80ec07749d12ff56c613ac0 (patch) | |
tree | a3b92783e56ba86a389f4c2d249c6f6461244f1f | |
parent | 3d6a66b86fe5ba0b57f194fa8f80737e95aa6f42 (diff) | |
download | kamek-90024c1ccea34513a80ec07749d12ff56c613ac0.tar.gz kamek-90024c1ccea34513a80ec07749d12ff56c613ac0.zip |
fixed up collisions, added a bunch of boss improvements
-rwxr-xr-x | include/game.h | 1 | ||||
-rw-r--r-- | kamek_pal.x | 1 | ||||
-rw-r--r-- | src/boss.cpp | 4 | ||||
-rw-r--r-- | src/bossBalboaWrench.cpp | 4 | ||||
-rw-r--r-- | src/bossFuzzyBear.cpp | 5 | ||||
-rw-r--r-- | src/bossMegaGoomba.cpp | 6 | ||||
-rw-r--r-- | src/bossPodouble.cpp | 90 | ||||
-rw-r--r-- | src/bossTopman.cpp | 44 | ||||
-rw-r--r-- | src/shyguy.cpp | 6 | ||||
-rw-r--r-- | src/topman.cpp | 8 |
10 files changed, 97 insertions, 72 deletions
diff --git a/include/game.h b/include/game.h index 271b0a5..a75629e 100755 --- a/include/game.h +++ b/include/game.h @@ -2043,6 +2043,7 @@ public: void stuffRelatingToCollisions(float, float, float);
void checkLiquidImmersionAndKillIfTouchingLava(Vec *pos, float effectScale);
+ void checkLiquidImmersion(Vec2 *effectivePosition, float effectScale);
// States
USING_STATES(dEn_c);
diff --git a/kamek_pal.x b/kamek_pal.x index bd8c1d9..c3ad2d7 100644 --- a/kamek_pal.x +++ b/kamek_pal.x @@ -453,6 +453,7 @@ SECTIONS { doSpriteMovement__5dEn_cFv = 0x800955F0; CheckIfPlayerBelow__5dEn_cFff = 0x800978C0; stuffRelatingToCollisions__5dEn_cFfff = 0x800957B0; + checkLiquidImmersion__5dEn_cFP7Point2df = 0x80097250; _vfD8__18dActorMultiState_cFv = 0x80067590; _vfDC__18dActorMultiState_cFv = 0x800675B0; diff --git a/src/boss.cpp b/src/boss.cpp index cea6d8e..b484171 100644 --- a/src/boss.cpp +++ b/src/boss.cpp @@ -12,9 +12,7 @@ void DamagePlayer(dEn_c *actor, ActivePhysics *apThis, ActivePhysics *apOther) { // fix multiple player collisions via megazig actor->isDead = 0; actor->flags_4FC |= (1<<(31-7)); - if(apOther->owner->which_player < 4) { - actor->counter_504[apOther->owner->which_player] = 0; - } + actor->counter_504[apOther->owner->which_player] = 0; OSReport("Player is good and hurt\n"); } diff --git a/src/bossBalboaWrench.cpp b/src/bossBalboaWrench.cpp index b28c99e..a500b0f 100644 --- a/src/bossBalboaWrench.cpp +++ b/src/bossBalboaWrench.cpp @@ -115,9 +115,7 @@ daBalboa_c *daBalboa_c::build() { //FIXME hack to make multiple playerCollisions work this->isDead = 0; this->flags_4FC |= (1<<(31-7)); - if(apOther->owner->which_player < 4) { - this->counter_504[apOther->owner->which_player] = 0; - } + this->counter_504[apOther->owner->which_player] = 0; } void daBalboa_c::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther) { diff --git a/src/bossFuzzyBear.cpp b/src/bossFuzzyBear.cpp index 1661a29..b5b9124 100644 --- a/src/bossFuzzyBear.cpp +++ b/src/bossFuzzyBear.cpp @@ -107,7 +107,8 @@ void daFuzzyBear_c::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhy mario->doSpriteMovement(); } void daFuzzyBear_c::collisionCat7_WMWaggleWaterYoshi(ActivePhysics *apThis, ActivePhysics *apOther) { - this->collisionCat9_RollingObject(apThis, apOther); + this->counter_504[apOther->owner->which_player] = 0; + this->collisionCat9_RollingObject(apThis, apOther); } void daFuzzyBear_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { @@ -220,7 +221,7 @@ int daFuzzyBear_c::onCreate() { HitMeBaby.category1 = 0x3; HitMeBaby.category2 = 0x0; HitMeBaby.bitfield1 = 0x4F; - HitMeBaby.bitfield2 = 0x8828E; + HitMeBaby.bitfield2 = 0x8028E; HitMeBaby.unkShort1C = 0; HitMeBaby.callback = &dEn_c::collisionCallback; diff --git a/src/bossMegaGoomba.cpp b/src/bossMegaGoomba.cpp index 42ff2d4..2bfc681 100644 --- a/src/bossMegaGoomba.cpp +++ b/src/bossMegaGoomba.cpp @@ -249,11 +249,7 @@ void daMegaGoomba_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOth //FIXME hack to make multiple playerCollisions work this->isDead = 0; this->flags_4FC |= (1<<(31-7)); - if(apOther->owner->which_player > 3) { - OSReport("!!!ATTENTION!!!\napOther->owner->which_player > 3\n"); - }else{ - this->counter_504[apOther->owner->which_player] = 0; - } + this->counter_504[apOther->owner->which_player] = 0; } //void daMegaGoomba_c::yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("yoshiCollision\n"); } diff --git a/src/bossPodouble.cpp b/src/bossPodouble.cpp index d2cb3e3..1d105e6 100644 --- a/src/bossPodouble.cpp +++ b/src/bossPodouble.cpp @@ -82,10 +82,6 @@ daPodouble *daPodouble::build() { // Externs and States /////////////////////// extern "C" int SmoothRotation(short* rot, u16 amt, int unk2); - extern "C" void* WaterManager; - extern "C" u32 CheckforLiquid(void*, Vec, int, int, int, int layer); - - CREATE_STATE(daPodouble, Bounce); CREATE_STATE(daPodouble, Spit); @@ -257,7 +253,7 @@ int daPodouble::onCreate() { HitMeBaby.category1 = 0x3; HitMeBaby.category2 = 0x0; HitMeBaby.bitfield1 = 0x4F; - HitMeBaby.bitfield2 = (this->isFire) ? 0x388626 : 0x388626; + HitMeBaby.bitfield2 = (this->isFire) ? 0x380626 : 0x380626; HitMeBaby.unkShort1C = 0; HitMeBaby.callback = &poodleCollisionCallback; @@ -359,17 +355,6 @@ int daPodouble::onDraw() { this->pos.y = this->pos.y + (18/80.0); } - if (timer == 360) { - Vec tempPos = (Vec){this->pos.x - 40.0, this->pos.y + 120.0, 3564.0}; - SpawnEffect("Wm_ob_greencoinkira", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); - SpawnEffect("Wm_mr_yoshiicehit_a", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); - SpawnEffect("Wm_mr_yoshiicehit_b", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); - SpawnEffect("Wm_ob_redringget", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); - SpawnEffect("Wm_ob_keyget01", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); - SpawnEffect("Wm_ob_greencoinkira_a", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); - SpawnEffect("Wm_ob_keyget01_c", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); - } - if (timer > 420) { PlaySound(this, SE_EMY_CS_MOVE_W8_BUBBLE_APP); doStateChange(&StateID_Bounce); @@ -381,6 +366,21 @@ int daPodouble::onDraw() { bool ret; ret = GrowBoss(this, Kameck, 1.0, 3.5, 18, this->timer); + if (this->timer == 380) { + Vec tempPos = (Vec){this->pos.x - 80.0, this->pos.y + 120.0, 3564.0}; + create(AC_YOSHI_EGG, 0x01050000, &tempPos, &(S16Vec){0,0,0}, 0); + } + + if (this->timer == 400) { + Vec tempPos = (Vec){this->pos.x - 120.0, this->pos.y + 120.0, 3564.0}; + create(AC_YOSHI_EGG, 0x02030000, &tempPos, &(S16Vec){0,0,0}, 0); + } + + if (this->timer == 400) { + Vec tempPos = (Vec){this->pos.x - 120.0, this->pos.y + 120.0, 3564.0}; + create(AC_YOSHI_EGG, 0x82050110, &tempPos, &(S16Vec){0,0,0}, 0); + } + if (ret) { PlaySound(this, SE_EMY_CS_MOVE_W8_BUBBLE_APP); doStateChange(&StateID_Bounce); @@ -417,7 +417,7 @@ int daPodouble::onDraw() { doSpriteMovement(); if (this->pos.y < this->Baseline) { - this->speed.y = 8.0; + this->speed.y = 7.5; this->goingUp = 1; } if (-0.1 < this->speed.y < 0.1) { @@ -425,21 +425,7 @@ int daPodouble::onDraw() { // Check for stupid liquid junk - float ydest; - ydest = (this->pos.y > this->last_pos.y) ? this->last_pos.y : this->pos.y; - - int liquid = CheckforLiquid(WaterManager, this->pos, 0, 0, 0, this->currentLayerID); - - OSReport("Liquid type %d", liquid); - - if (liquid == 1) { - SpawnEffect("Wm_mr_magmawave", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){3.0, 3.0, 3.0}); - PlaySoundAsync(this, SE_EMY_BUBBLE_SPLASH); - } - if (liquid == 0) { - SpawnEffect("Wm_mr_waterwave_in", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){3.0, 3.0, 3.0}); - PlaySoundAsync(this, SE_OBJ_CMN_SPLASH); - } + checkLiquidImmersion(&(Vec2){this->pos.x, this->pos.y}, 3.0f); } void daPodouble::endState_Bounce() { @@ -466,11 +452,40 @@ int daPodouble::onDraw() { if (this->isFire == 0) { dStageActor_c *spawner = create(BROS_ICEBALL, 0x10, &this->pos, &(S16Vec){0,0,0}, 0); *((u32 *) (((char *) spawner) + 0x3DC)) = this->id; + + int num; + num = GenerateRandomNumber(20) - 10; + float modifier = (float)(num) / 10.0; + + spawner->max_speed.y += modifier; + spawner->speed.y += modifier; + + num = GenerateRandomNumber(20) - 10; + modifier = (float)(num) / 10.0; + + spawner->max_speed.x += modifier; + spawner->speed.x += modifier; + + PlaySoundAsync(this, SE_EMY_ICE_BROS_ICE); doStateChange(&StateID_Bounce); } else { - create(BROS_FIREBALL, 0, &this->pos, &(S16Vec){0,0,0}, 0); + dStageActor_c *spawner = create(BROS_FIREBALL, 0, &this->pos, &(S16Vec){0,0,0}, 0); + + int num; + num = GenerateRandomNumber(20); + float modifier = (float)(num) / 5.0; + + spawner->max_speed.y += modifier; + spawner->speed.y += modifier; + + num = GenerateRandomNumber(20); + modifier = (float)(num) / 10.0; + + spawner->max_speed.x += modifier; + spawner->speed.x += modifier; + PlaySoundAsync(this, SE_EMY_FIRE_BROS_FIRE); doStateChange(&StateID_Bounce); } @@ -537,7 +552,14 @@ int daPodouble::onDraw() { void daPodouble::beginState_Outro() { daPodouble *other = (daPodouble*)FindActorByType(SHIP_WINDOW, (Actor*)this); - if (other != 0) { other->doStateChange(&StateID_SyncDie); } + if (other != 0) { + other->doStateChange(&StateID_SyncDie); + + if (other->id == this->id) { + other = (daPodouble*)FindActorByType(SHIP_WINDOW, (Actor*)other); + other->doStateChange(&StateID_SyncDie); + } + } OutroSetup(this); this->timer = 0; diff --git a/src/bossTopman.cpp b/src/bossTopman.cpp index 41aac4d..5aec384 100644 --- a/src/bossTopman.cpp +++ b/src/bossTopman.cpp @@ -29,10 +29,7 @@ public: int isInvulnerableCountdown; int isTurningCountdown; char charging; - int pOneHit; - int pTwoHit; - int pThreeHit; - int pFourHit; + int flashing; float dying; @@ -144,6 +141,7 @@ daDreidel *daDreidel::build() { void daDreidel::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { + char hitType; hitType = usedForDeterminingStatePress_or_playerCollision(this, apThis, apOther, 0); @@ -340,6 +338,8 @@ int daDreidel::onCreate() { this->isInSpace = this->settings & 0xF; this->fromBehind = 0; + this->flashing = 0; + ActivePhysics::Info HitMeBaby; @@ -406,9 +406,19 @@ int daDreidel::onExecute() { } int daDreidel::onDraw() { - bodyModel.scheduleForDrawing(); + + if (this->isInvulnerable == 1) { + this->flashing++; + } + + if (this->flashing < 5) { + bodyModel.scheduleForDrawing(); + } + bodyModel._vf1C(); + if (this->flashing > 8) { this->flashing = 0; } + return true; } @@ -461,7 +471,7 @@ void daDreidel::updateModelMatrices() { /////////////// void daDreidel::beginState_Walk() { this->max_speed.x = (this->direction) ? -this->XSpeed : this->XSpeed; - this->speed.x = (direction) ? -0.8f : 0.8f; + this->speed.x = (direction) ? -1.2f : 1.2f; this->max_speed.y = (this->isInSpace) ? -2.0 : -4.0; this->speed.y = (this->isInSpace) ? -2.0 : -4.0; @@ -476,6 +486,7 @@ void daDreidel::updateModelMatrices() { } else { this->isInvulnerable = 0; + this->flashing = 0; } PlaySound(this, SE_BOSS_JR_CROWN_JR_RIDE); // 5 @@ -490,7 +501,7 @@ void daDreidel::updateModelMatrices() { this->isTurningCountdown++; } - if (this->isTurningCountdown > 90) { doStateChange(&StateID_Turn); } + if (this->isTurningCountdown > 60) { doStateChange(&StateID_Turn); } if(this->chrAnimation.isAnimationDone()) { this->chrAnimation.setCurrentFrame(0.0); @@ -529,13 +540,17 @@ void daDreidel::updateModelMatrices() { void daDreidel::beginState_KnockBack() { bindAnimChr_and_setUpdateRate("begoman_damage", 1, 0.0, 0.65); - this->max_speed.x = (this->direction) ? 5.5f : -5.5f; - this->speed.x = (this->direction) ? 5.5f : -5.5f; + this->max_speed.x = (this->direction) ? 6.5f : -6.5f; + this->speed.x = (this->direction) ? 6.5f : -6.5f; } void daDreidel::executeState_KnockBack() { bool ret = calculateTileCollisions(); - this->speed.x = this->speed.x / 1.1; + if (ret) { + this->max_speed.x = -this->max_speed.x; + this->speed.x = -this->speed.x; + } + this->speed.x = this->speed.x / 1.08; bodyModel._vf1C(); if(this->chrAnimation.isAnimationDone()) { @@ -564,7 +579,7 @@ void daDreidel::updateModelMatrices() { // ChargePrep State /////////////// void daDreidel::beginState_ChargePrep() { - bindAnimChr_and_setUpdateRate("begoman_attack", 1, 0.0, 1.0); + bindAnimChr_and_setUpdateRate("begoman_attack", 1, 0.0, 0.9); } void daDreidel::executeState_ChargePrep() { if(this->chrAnimation.isAnimationDone()) { @@ -583,7 +598,7 @@ void daDreidel::updateModelMatrices() { this->isTurningCountdown = 0; this->max_speed.x = (this->direction) ? -this->XSpeed : this->XSpeed; - this->speed.x = (direction) ? -2.2f : 2.2f; + this->speed.x = (direction) ? -2.6f : 2.6f; this->max_speed.y = (this->isInSpace) ? -2.0 : -4.0; this->speed.y = (this->isInSpace) ? -2.0 : -4.0; @@ -598,6 +613,7 @@ void daDreidel::updateModelMatrices() { } else { this->isInvulnerable = 0; + this->flashing = 0; } if(this->chrAnimation.isAnimationDone()) { @@ -646,7 +662,7 @@ void daDreidel::updateModelMatrices() { /////////////// void daDreidel::beginState_Damage() { this->isInvulnerable = 1; - bindAnimChr_and_setUpdateRate("begoman_wait", 1, 0.0, 1.0); + bindAnimChr_and_setUpdateRate("begoman_wait", 1, 0.0, 0.75); this->timer = 0; PlaySound(this, SE_PLY_TOUCH_BIRI); @@ -665,7 +681,7 @@ void daDreidel::updateModelMatrices() { if(this->chrAnimation.isAnimationDone()) { this->timer += 1; - if (this->timer == 3) { + if (this->timer == 1) { u8 dir = dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(this, this->pos); if (dir != this->direction) { diff --git a/src/shyguy.cpp b/src/shyguy.cpp index 73aaa44..ef807f0 100644 --- a/src/shyguy.cpp +++ b/src/shyguy.cpp @@ -251,11 +251,7 @@ daShyGuy *daShyGuy::build() { // fix multiple player collisions via megazig this->isDead = 0; this->flags_4FC |= (1<<(31-7)); - if(apOther->owner->which_player > 3) { - OSReport("!!!ATTENTION!!!\napOther->owner->which_player > 3\n"); - }else{ - this->counter_504[apOther->owner->which_player] = 0; - } + this->counter_504[apOther->owner->which_player] = 0; } void daShyGuy::yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther) { diff --git a/src/topman.cpp b/src/topman.cpp index c9a679d..2f9ae4d 100644 --- a/src/topman.cpp +++ b/src/topman.cpp @@ -127,9 +127,7 @@ daTopman *daTopman::build() { // fix multiple player collisions via megazig this->isDead = 0; this->flags_4FC |= (1<<(31-7)); - if(apOther->owner->which_player < 4) { - this->counter_504[apOther->owner->which_player] = 0; - } + this->counter_504[apOther->owner->which_player] = 0; } void daTopman::yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther) { @@ -142,9 +140,7 @@ daTopman *daTopman::build() { this->isDead = 0; this->flags_4FC |= (1<<(31-7)); - if(apOther->owner->which_player < 4) { - this->counter_504[apOther->owner->which_player] = 0; - } + this->counter_504[apOther->owner->which_player] = 0; } void daTopman::collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther) { |