diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bossBombDrop.cpp | 6 | ||||
-rw-r--r-- | src/bossBridgeBowser.cpp | 53 | ||||
-rw-r--r-- | src/bossCaptainBowser.cpp | 6 | ||||
-rw-r--r-- | src/bossPodouble.cpp | 8 | ||||
-rw-r--r-- | src/bossThwompaDomp.cpp | 2 | ||||
-rw-r--r-- | src/shyguy.cpp | 53 | ||||
-rwxr-xr-x | src/spritetex.S | 23 |
7 files changed, 112 insertions, 39 deletions
diff --git a/src/bossBombDrop.cpp b/src/bossBombDrop.cpp index 0852501..c12d144 100644 --- a/src/bossBombDrop.cpp +++ b/src/bossBombDrop.cpp @@ -202,8 +202,8 @@ dBombDrop *dBombDrop::build() { int dBombDrop::onCreate() { int t = this->settings & 0xF; - this->eventA = (this->settings >> 16) & 0xFF; - this->eventB = (this->settings >> 24) & 0xFF; + this->eventA = ((this->settings >> 24) & 0xFF) - 1; + this->eventB = ((this->settings >> 16) & 0xFF) - 1; if (t == 0) { @@ -229,7 +229,7 @@ int dBombDrop::onExecute() { bool active; active = dFlagMgr_c::instance->active(eventA); if (active) { - create(WM_SMALLCLOUD, 0, &pos, &rot, 0); + create(WM_SMALLCLOUD, 0, &pos , &rot, 0); dFlagMgr_c::instance->set(eventA, 0, false, false, false); dFlagMgr_c::instance->set(eventA+1, 0, true, false, false); } diff --git a/src/bossBridgeBowser.cpp b/src/bossBridgeBowser.cpp index cafcc98..d0f505a 100644 --- a/src/bossBridgeBowser.cpp +++ b/src/bossBridgeBowser.cpp @@ -10,20 +10,55 @@ extern "C" void *ForceMarioExitDemoMode(void *, unsigned int); extern "C" void *BowserFireballCollision(dEn_c *, ActivePhysics *, ActivePhysics *); extern "C" void *BowserDamageAnmClr(dEn_c *); extern "C" void *BowserDamageStepTwo(dEn_c *); -extern "C" void *BowserDamageStepThree(dEn_c *); +extern "C" void *BowserDamageNormal(dEn_c *); +extern "C" void *BowserDamageKill(dEn_c *); +extern "C" void *BowserDamageEnd(dEn_c *); +int HP = 2; void BowserDoomSpriteCollision(dEn_c *bowser, ActivePhysics *apThis, ActivePhysics *apOther) { // If you collide with something or other, call the fireball collision if (apOther->owner->name == 674) { - OSReport("AnmClr"); - BowserDamageAnmClr(bowser); - OSReport("Damage Step 2"); - BowserDamageStepTwo(bowser); - OSReport("Damage Step 3"); - BowserDamageStepThree(bowser); - OSReport("Damage Done"); + + // void * bowserClass = (void*)(((u32)bowser) + 0x5F8); + // int HP = *(int*)(((u32)bowserClass) + 4); + + OSReport("HP: %d", HP); + + if (HP <= 0) { + HP = 0; + + *(int*)(((u32)bowser) + 0x540) = 0x28; + + BowserDamageAnmClr(bowser); + + BowserDamageStepTwo(bowser); + BowserDamageKill(bowser); + + // WeirdLevelEndClass->sub_8005CB60(*otherActor->returnPtrToField38D()); + + // this->vf300(otherActor); + BowserDamageEnd(bowser); + + // daBossKoopaDemo_c *BowserDemo = (daBossKoopaDemo_c*)FindActorByType(BOSS_KOOPA_DEMO, 0); + daBossKoopaDemo_c *BowserDemo = (daBossKoopaDemo_c*)bowser; + OSReport("Koopa Controller: %x", BowserDemo); + BowserDemo->doStateChange(&daBossKoopaDemo_c::StateID_Struggle); + dFlagMgr_c::instance->set(3, 0, true, false, false); + + HP = 2; + + } + else { + *(int*)(((u32)bowser) + 0x540) = 0x28; + + BowserDamageAnmClr(bowser); + BowserDamageNormal(bowser); + + HP -= 1; + } + dEn_c * bomb = (dEn_c*)apOther->owner; bomb->kill(); } @@ -34,7 +69,7 @@ void BowserDoomSpriteCollision(dEn_c *bowser, ActivePhysics *apThis, ActivePhysi void BowserDoomStart(dStageActor_c *Controller) { OSReport("Here we go!"); - dEn_c *Bowser = (dEn_c*)FindActorByType(EN_BOSS_KOOPA, (Actor*)Controller); + dEn_c *Bowser = (dEn_c*)FindActorByType(EN_BOSS_KOOPA, 0); Bowser->Delete(1); } diff --git a/src/bossCaptainBowser.cpp b/src/bossCaptainBowser.cpp index af02c3c..c3c1b62 100644 --- a/src/bossCaptainBowser.cpp +++ b/src/bossCaptainBowser.cpp @@ -230,7 +230,6 @@ int daCaptainBowser::onCreate() { ShipPhysics.diameter = 12.0 * 16.0; ShipPhysics.isRound = 1; - this->ShipPhysics.addToList(); // Bowser Physics! @@ -249,7 +248,6 @@ int daCaptainBowser::onCreate() { BowserPhysics.callback = &dEn_c::collisionCallback; this->aPhysics.initWithStruct(this, &BowserPhysics); - this->aPhysics.addToList(); @@ -433,6 +431,10 @@ int daCaptainBowser::onDraw() { this->timer++; } void daCaptainBowser::endState_Intro() { + + this->ShipPhysics.addToList(); + this->aPhysics.addToList(); + this->isInvulnerable = 0; this->isIntro = 0; } diff --git a/src/bossPodouble.cpp b/src/bossPodouble.cpp index c6eb99b..5d41a5c 100644 --- a/src/bossPodouble.cpp +++ b/src/bossPodouble.cpp @@ -557,15 +557,11 @@ int daPodouble::onDraw() { /////////////// void daPodouble::beginState_Outro() { - daPodouble *other = (daPodouble*)FindActorByType(SHIP_WINDOW, (Actor*)this); - if (other != 0) { - other->doStateChange(&StateID_SyncDie); - + daPodouble *other = (daPodouble*)FindActorByType(SHIP_WINDOW, 0); if (other->id == this->id) { - other = (daPodouble*)FindActorByType(SHIP_WINDOW, (Actor*)other); + other = (daPodouble*)FindActorByType(SHIP_WINDOW, (Actor*)this); other->doStateChange(&StateID_SyncDie); } - } OutroSetup(this); this->timer = 0; diff --git a/src/bossThwompaDomp.cpp b/src/bossThwompaDomp.cpp index 48d0340..85799c3 100644 --- a/src/bossThwompaDomp.cpp +++ b/src/bossThwompaDomp.cpp @@ -347,12 +347,14 @@ int daEnMegaDosun_c::onDelete() { this->countdownTimer = 0x40; this->speed.y = 0.0; ShakeScreen(ScreenPositionClass, 0, 1, 0, 0); + PlaySoundAsync(this, SE_EMY_BIG_DOSSUN); } else { this->collision_struct[0] = 0x00000001; this->speed.y = 0.0; ShakeScreen(ScreenPositionClass, 0, 1, 0, 0); this->collMgr.Clear2(); + PlaySoundAsync(this, SE_EMY_BIG_DOSSUN); } SpawnThwompEffects(this); diff --git a/src/shyguy.cpp b/src/shyguy.cpp index 8f311de..6ea3567 100644 --- a/src/shyguy.cpp +++ b/src/shyguy.cpp @@ -69,6 +69,7 @@ class daShyGuy : public dEn_c { float balloonSize; char backFire; char spikeTurn; + int directionStore; dStageActor_c *spikeA; dStageActor_c *spikeB; @@ -216,6 +217,12 @@ daShyGuy *daShyGuy::build() { deathState = &StateID_Die; } + // fix multiple player collisions via megazig + this->isDead = 0; + this->flags_4FC |= (1<<(31-7)); + this->counter_504[apOther->owner->which_player] = 0; + + char hitType; if (this->isDown == 0) { hitType = usedForDeterminingStatePress_or_playerCollision(this, apThis, apOther, 2); @@ -231,7 +238,9 @@ daShyGuy *daShyGuy::build() { doStateChange(stateVar); } else { // Shy Guy is in throwy mode - kill it with fire + this->playEnemyDownSound1(); doStateChange(deathState); + this->isDead = 1; } } else if(hitType == 3) { // spinning jump or whatever? @@ -241,7 +250,9 @@ daShyGuy *daShyGuy::build() { doStateChange(stateVar); } else { // Shy Guy is in throwy mode - kill it with fire + this->playEnemyDownSound1(); doStateChange(deathState); + this->isDead = 1; } } else if(hitType == 0) { @@ -251,10 +262,6 @@ daShyGuy *daShyGuy::build() { // else if(hitType == 2) { \\ Minimario? } - // fix multiple player collisions via megazig - this->isDead = 0; - this->flags_4FC |= (1<<(31-7)); - this->counter_504[apOther->owner->which_player] = 0; } void daShyGuy::yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther) { @@ -278,6 +285,7 @@ daShyGuy *daShyGuy::build() { } void daShyGuy::collisionCat3_StarPower(ActivePhysics *apThis, ActivePhysics *apOther){ + dEn_c::collisionCat3_StarPower(apThis, apOther); doStateChange(&StateID_Die); } @@ -296,10 +304,16 @@ daShyGuy *daShyGuy::build() { if (this->type < 6) { // Regular Shy Guys Except Jumper - if (this->pos.x < apOther->owner->pos.x) { this->backFire = 0; } // Fire is to the right - else { this->backFire = 1; } // Fire is to the left + if (this->pos.x < apOther->owner->pos.x) { this->backFire = 0; OSReport("Fire is to the right"); } // Fire is to the right + else { this->backFire = 1; OSReport("Fire is to the left"); } // Fire is to the left - stateVar = &StateID_FireKnockBack; + if (this->isDown == 0) { + stateVar = &StateID_FireKnockBack; + } + else { + doStateChange(&StateID_DieSmoke); + this->_vf14C(); + } } else if (this->type > 8) { // Giants return; @@ -530,7 +544,7 @@ int daShyGuy::onCreate() { this->scale = (Vec){20.0, 20.0, 20.0}; - this->pos.y = this->pos.y + 30.0; // X is vertical axis + this->pos.y = this->pos.y + 40.0; this->rot.x = 0; // X is vertical axis this->rot.y = 0xD800; // Y is horizontal axis this->rot.z = 0; // Z is ... an axis >.> @@ -541,7 +555,7 @@ int daShyGuy::onCreate() { this->max_speed.x = 0.8; this->x_speed_inc = 0.2; this->Baseline = this->pos.y; - this->XSpeed = 0.8; + this->XSpeed = 0.6; this->balloonSize = 1.5; @@ -756,7 +770,7 @@ void daShyGuy::updateModelMatrices() { } void daShyGuy::executeState_Walk() { - this->pos.x += (direction) ? -0.5 : 0.5; + this->pos.x += (direction) ? -0.4 : 0.4; if (this->timer > (this->distance * 32)) { doStateChange(&StateID_Turn); @@ -1173,7 +1187,7 @@ void daShyGuy::updateModelMatrices() { void daShyGuy::beginState_RealWalk() { //inline this piece of code this->max_speed.x = (this->direction) ? -this->XSpeed : this->XSpeed; - this->speed.x = (direction) ? -0.8f : 0.8f; + this->speed.x = (direction) ? -0.6f : 0.6f; this->max_speed.y = -4.0; this->speed.y = -4.0; @@ -1331,15 +1345,17 @@ void daShyGuy::updateModelMatrices() { void daShyGuy::beginState_FireKnockBack() { bindAnimChr_and_setUpdateRate("c18_C_BLOCK_BREAK_R", 1, 0.0, 1.0); - // if (this->backFire == 0) { this->direction ^= 1; } - // else { this->backFire = 0; } - - this->speed.x = (this->backFire) ? this->XSpeed / 6.0f : -this->XSpeed / 6.0f; + // Backfire 0 == Fireball to the right + // Backfire 1 == Fireball to the left + + directionStore = this->direction; + this->speed.x = (this->backFire) ? this->XSpeed : -this->XSpeed; } void daShyGuy::executeState_FireKnockBack() { calculateTileCollisions(); // move backwards here + this->speed.x = this->speed.x / 1.02f; if(this->chrAnimation.isAnimationDone()) { bindAnimChr_and_setUpdateRate("c18_EV_WIN_2_R", 1, 0.0, 1.5); @@ -1347,9 +1363,7 @@ void daShyGuy::updateModelMatrices() { } } void daShyGuy::endState_FireKnockBack() { - // this->direction ^= 1; - speed.x = (direction) ? -1.0f : 1.0f; - this->max_speed.x = (direction) ? -this->XSpeed : this->XSpeed; + this->direction = directionStore; } /////////////// @@ -1398,7 +1412,7 @@ void daShyGuy::updateModelMatrices() { // Die State /////////////// void daShyGuy::beginState_Die() { - dEn_c::dieFall_Begin(); + // dEn_c::dieFall_Begin(); bindAnimChr_and_setUpdateRate("c18_C_BLOCK_BREAK_R", 1, 0.0, 2.0); this->timer = 0; @@ -1426,6 +1440,7 @@ void daShyGuy::updateModelMatrices() { this->dying += 0.5; if (this->timer > 450) { + OSReport("Killing"); this->kill(); this->Delete(this->deleteForever); } diff --git a/src/spritetex.S b/src/spritetex.S index 563d81a..1aeea74 100755 --- a/src/spritetex.S +++ b/src/spritetex.S @@ -556,6 +556,29 @@ SnowmanSandToSnowB: blr + + +SnowmanPokeyRotate: + + lha r3, 0x102(r30) + blr + + +.global TEX_PokeySnowmanRotate +TEX_PokeySnowmanRotate: + + lwz r10, 4(r30) + srwi r10, r10, 24 + andi. r10, r10, 0xF + + cmpwi r10, 0x2 + bne SnowmanPokeyRotate + + li r3, 0 + sth r3, 0x102(r30) + blr + + .global TEX_PokeySnowman TEX_PokeySnowman: |