diff options
-rw-r--r-- | src/boss.h | 1 | ||||
-rw-r--r-- | src/bossBalboaWrench.cpp | 8 | ||||
-rw-r--r-- | src/bossMegaGoomba.cpp | 186 | ||||
-rw-r--r-- | src/bossPodouble.cpp | 37 | ||||
-rw-r--r-- | src/bossRamboo.cpp | 1 | ||||
-rw-r--r-- | src/bossThwompaDomp.cpp | 2 | ||||
-rw-r--r-- | src/bossTopman.cpp | 40 | ||||
-rw-r--r-- | src/electricLine.cpp | 4 |
8 files changed, 203 insertions, 76 deletions
@@ -31,6 +31,7 @@ class daBoss : public dEn_c { public: u32 timer; char dying; + u32 damage; daKameckDemo *Kameck; }; diff --git a/src/bossBalboaWrench.cpp b/src/bossBalboaWrench.cpp index ccff19b..b28c99e 100644 --- a/src/bossBalboaWrench.cpp +++ b/src/bossBalboaWrench.cpp @@ -351,12 +351,12 @@ void daBalboa_c::updateModelMatrices() { else if (randChoice == 2) { // In the Center! char Pdir = dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(this, this->pos); - if (Pdir) { - this->rot.y = 0x2000; - this->direction = 1; } - else { + if (Pdir == 1) { this->rot.y = 0xE000; this->direction = 0; } + else { + this->rot.y = 0x2000; + this->direction = 1; } } PlaySound(this, 0x21F); diff --git a/src/bossMegaGoomba.cpp b/src/bossMegaGoomba.cpp index e353c23..42ff2d4 100644 --- a/src/bossMegaGoomba.cpp +++ b/src/bossMegaGoomba.cpp @@ -2,32 +2,33 @@ #include <game.h> #include <g3dhax.h> #include <sfx.h> +#include "boss.h" //Enable this if you're fixing it -// void setNewActivePhysicsRect(dStageActor_c* actor, Vec* scale) { -// float amtX = scale->x; -// float amtY = scale->y; - -// ActivePhysics::Info info; -// info.xDistToCenter = 0.0; -// info.yDistToCenter = 7.65 * amtY; -// info.xDistToEdge = 4.0 * amtX; -// info.yDistToEdge = 7.7 * amtY; - -// info.category1 = actor->aPhysics.info.category1; -// info.category2 = actor->aPhysics.info.category2; -// info.bitfield1 = actor->aPhysics.info.bitfield1; -// info.bitfield2 = actor->aPhysics.info.bitfield2; -// info.unkShort1C = actor->aPhysics.info.unkShort1C; -// info.callback = actor->aPhysics.info.callback; - -// //OSReport("Making new Physics Class and adding to the list\n"); -// actor->aPhysics.removeFromList(); -// actor->aPhysics.initWithStruct(actor, &info); -// actor->aPhysics.addToList(); -// } - -class daMegaGoomba_c : public dEn_c { +void setNewActivePhysicsRect(dStageActor_c* actor, Vec* scale) { + float amtX = scale->x; + float amtY = scale->y; + + ActivePhysics::Info info; + info.xDistToCenter = 0.0; + info.yDistToCenter = 7.65 * amtY; + info.xDistToEdge = 4.0 * amtX; + info.yDistToEdge = 7.7 * amtY; + + info.category1 = actor->aPhysics.info.category1; + info.category2 = actor->aPhysics.info.category2; + info.bitfield1 = actor->aPhysics.info.bitfield1; + info.bitfield2 = actor->aPhysics.info.bitfield2; + info.unkShort1C = actor->aPhysics.info.unkShort1C; + info.callback = actor->aPhysics.info.callback; + + //OSReport("Making new Physics Class and adding to the list\n"); + actor->aPhysics.removeFromList(); + actor->aPhysics.initWithStruct(actor, &info); + actor->aPhysics.addToList(); +} + +class daMegaGoomba_c : public daBoss { int onCreate(); int onDelete(); int onExecute(); @@ -99,6 +100,9 @@ class daMegaGoomba_c : public dEn_c { DECLARE_STATE(Turn); DECLARE_STATE(Jump); DECLARE_STATE(Launch); + + DECLARE_STATE(Kameck); + DECLARE_STATE(Outro); }; u8 struct_1[] = { 0, 0, 0, 1, 0xff, 0xff, 0x40, 0, 0, 0, 0xc0, 0, 0, 0, 0, 0 }; @@ -137,15 +141,8 @@ void HexDump(char* address, u32 length) { } -extern "C" void *PlaySound(daMegaGoomba_c *, int soundID); - -extern "C" u32 GenerateRandomNumber(int max); -extern "C" u8 dSprite_c__getXDirectionOfFurthestPlayerRelativeToVEC3(daMegaGoomba_c *, Vec pos); -extern "C" dStageActor_c *CreateActor(u16 classID, int settings, Vec pos, char rot, char layer); -extern "C" dStageActor_c *GetSpecificPlayerActor(int number); //FIXME make this dEn_c->used... -extern "C" char usedForDeterminingStatePress_or_playerCollision(dEn_c* t, ActivePhysics *apThis, ActivePhysics *apOther, int unk1); extern "C" int SomeStrangeModification(dStageActor_c* actor); extern "C" void DoStuffAndMarkDead(dStageActor_c *actor, Vec vector, float unk); extern "C" int SmoothRotation(short* rot, u16 amt, int unk2); @@ -459,44 +456,70 @@ void daMegaGoomba_c::updateModelMatrices() { bodyModel.calcWorld(false); } - +/////////////// // Grow State -void daMegaGoomba_c::beginState_Grow() { - this->timer = 1.0; +/////////////// + void daMegaGoomba_c::beginState_Grow() { + this->timer = 0; + + SetupKameck(this, Kameck); + } + + void daMegaGoomba_c::executeState_Grow() { + this->timer += 1; + + bool ret; + ret = GrowBoss(this, Kameck, 1.0, 7.0, 0, this->timer); + + if (ret) { + PlaySound(this, SE_EMY_KURI_CHANGE_BIG); + doStateChange(&StateID_Walk); + } + } + void daMegaGoomba_c::endState_Grow() { + CleanupKameck(this, Kameck); + } - float start, end, shift1, shift2; - start = 59.0; - shift1 = 90.0; - shift2 = 120.0; - end = 139.0; - /* keysX[i] = { frame, value, slope }; */ - Xkey_count = 7; - keysX[0] = (HermiteKey){ start, 1.0, 1.0 }; - keysX[1] = (HermiteKey){ (start+shift1)/2, 2.0, 1.0 }; - keysX[2] = (HermiteKey){ shift1, 4.0, 1.0 }; - keysX[3] = (HermiteKey){ (shift1+shift2)/2, 3.0, 1.0 }; - keysX[3] = (HermiteKey){ shift2, 6.0, 1.0 }; - keysX[3] = (HermiteKey){ (shift2+end)/2, 5.0, 1.0 }; - keysX[6] = (HermiteKey){ end, 7.0, 1.0 }; -} -void daMegaGoomba_c::executeState_Grow() { + +// Grow State +// void daMegaGoomba_c::beginState_Grow() { +// this->timer = 1.0; + +// float start, end, shift1, shift2; +// start = 59.0; +// shift1 = 90.0; +// shift2 = 120.0; +// end = 139.0; +// /* keysX[i] = { frame, value, slope }; */ +// Xkey_count = 7; +// keysX[0] = (HermiteKey){ start, 1.0, 1.0 }; +// keysX[1] = (HermiteKey){ (start+shift1)/2, 2.0, 1.0 }; +// keysX[2] = (HermiteKey){ shift1, 4.0, 1.0 }; +// keysX[3] = (HermiteKey){ (shift1+shift2)/2, 3.0, 1.0 }; +// keysX[3] = (HermiteKey){ shift2, 6.0, 1.0 }; +// keysX[3] = (HermiteKey){ (shift2+end)/2, 5.0, 1.0 }; +// keysX[6] = (HermiteKey){ end, 7.0, 1.0 }; +// } +// void daMegaGoomba_c::executeState_Grow() { - this->timer += 1.0; +// this->timer += 1.0; - if ((this->timer > 60.0) && (this->timer < 140.0)) { +// if ((this->timer > 60.0) && (this->timer < 140.0)) { - float modifier = GetHermiteCurveValue(this->timer, this->keysX, Xkey_count); - this->scale = (Vec){modifier, modifier, modifier}; - // setNewActivePhysicsRect(this, &this->scale); +// float modifier = GetHermiteCurveValue(this->timer, this->keysX, Xkey_count); +// this->scale = (Vec){modifier, modifier, modifier}; +// setNewActivePhysicsRect(this, &this->scale); - } - if(this->timer == 60.0) - PlaySound(this, SE_EMY_KURI_CHANGE_BIG); +// } +// if(this->timer == 60.0) +// PlaySound(this, SE_EMY_KURI_CHANGE_BIG); - if (this->timer > 170.0) { doStateChange(&StateID_Walk); } +// if (this->timer > 170.0) { doStateChange(&StateID_Walk); } -} -void daMegaGoomba_c::endState_Grow() { } +// } +// void daMegaGoomba_c::endState_Grow() { } + + // Shrink State @@ -510,7 +533,7 @@ void daMegaGoomba_c::beginState_Shrink() { // disable being hit Vec tempVec = (Vec){0.0, 0.0, 0.0}; - // setNewActivePhysicsRect(this, &tempVec ); + setNewActivePhysicsRect(this, &tempVec ); } void daMegaGoomba_c::executeState_Shrink() { this->timer += 1.0; @@ -525,7 +548,7 @@ void daMegaGoomba_c::executeState_Shrink() { } void daMegaGoomba_c::endState_Shrink() { // enable being hit - // setNewActivePhysicsRect(this, &this->scale); + setNewActivePhysicsRect(this, &this->scale); this->already_hit = false; } @@ -718,3 +741,40 @@ void daMegaGoomba_c::executeState_Walk() { } void daMegaGoomba_c::endState_Walk() { } + + + + + + + +/////////////// +// Outro State +/////////////// + void daMegaGoomba_c::beginState_Outro() { + OutroSetup(this); + } + void daMegaGoomba_c::executeState_Outro() { + + if (this->dying == 1) { + if (this->timer > 180) { ExitStage(WORLD_MAP, 0, BEAT_LEVEL, MARIO_WIPE); } + if (this->timer == 60) { PlayerVictoryCries(this); } + + this->timer += 1; + return; + } + + bool ret; + ret = ShrinkBoss(this, &this->pos, 0.5, this->timer); + + if (ret == true) { + BossExplode(this, &this->pos); + this->dying = 1; + this->timer = 0; + } + else { PlaySound(this, SE_EMY_BIG_KURIBO_DOWN); } + + this->timer += 1; + } + void daMegaGoomba_c::endState_Outro() { } + diff --git a/src/bossPodouble.cpp b/src/bossPodouble.cpp index 26c20a9..d2cb3e3 100644 --- a/src/bossPodouble.cpp +++ b/src/bossPodouble.cpp @@ -340,8 +340,43 @@ int daPodouble::onDraw() { } void daPodouble::executeState_Grow() { - + this->timer += 1; + + if (isFire) { + float scaleSpeed; + + if (timer == 150) { PlaySound(this, SE_BOSS_IGGY_WANWAN_TO_L); OSReport("Timer = 150\n"); } + + if ((timer > 150) && (timer < 230)) { + scaleSpeed = (3.5 - 1.0) / 80.0; + + float modifier; + + modifier = 1.0 + ((timer - 150) * scaleSpeed); + + this->scale = (Vec){modifier, modifier, modifier}; + 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); + } + + return; + } bool ret; ret = GrowBoss(this, Kameck, 1.0, 3.5, 18, this->timer); diff --git a/src/bossRamboo.cpp b/src/bossRamboo.cpp index c20194e..4195884 100644 --- a/src/bossRamboo.cpp +++ b/src/bossRamboo.cpp @@ -296,6 +296,7 @@ void daRamboo_c::beginState_Grow() { } void daRamboo_c::executeState_Grow() { + this->timer += 1; bool ret; ret = GrowBoss(this, Kameck, 1.0, 15.0, 0, this->timer); diff --git a/src/bossThwompaDomp.cpp b/src/bossThwompaDomp.cpp index 98ca361..37d986a 100644 --- a/src/bossThwompaDomp.cpp +++ b/src/bossThwompaDomp.cpp @@ -137,7 +137,7 @@ int daEnMegaDosun_c::onCreate() { hm.category1 = 0x03; hm.category2 = 0x00; hm.bitfield1 = 0x0000004F; - hm.bitfield2 = 0x0000820E; + hm.bitfield2 = 0x0008820E; hm.unkShort1C = 0x0100; hm.callback = &dEn_c::collisionCallback; this->aPhysics.initWithStruct(this, &hm); diff --git a/src/bossTopman.cpp b/src/bossTopman.cpp index b538131..67052f3 100644 --- a/src/bossTopman.cpp +++ b/src/bossTopman.cpp @@ -6,6 +6,7 @@ #include "boss.h" class daDreidel : public daBoss { +public: int onCreate(); int onDelete(); int onExecute(); @@ -18,8 +19,6 @@ class daDreidel : public daBoss { m3d::anmChr_c chrAnimation; - int timer; - int damage; char isDown; float XSpeed; u32 cmgr_returnValue; @@ -104,9 +103,24 @@ daDreidel *daDreidel::build() { //////////////////////// // Collision Functions //////////////////////// + // void topCollisionCallback(ActivePhysics *apThis, ActivePhysics *apOther); + + // void topCollisionCallback(ActivePhysics *apThis, ActivePhysics *apOther) { + // OSReport("Collided with %d", apOther->owner->name); + // if (apOther->owner->name != 041) { + // dEn_c::collisionCallback(apThis, apOther); + // } + // else { + // daDreidel *actor = (daDreidel*)apThis->owner; + // actor->damage += 1; + // actor->doStateChange(&daDreidel::StateID_Damage); + + // if (actor->damage > 2) { actor->doStateChange(&daDreidel::StateID_Outro); } + // } + // } void daDreidel::spriteCollision(ActivePhysics *apThis, ActivePhysics *apOther) { - if (apOther->owner->name == 250) { //time to get hurt + if (apOther->owner->name == 390) { //time to get hurt this->damage += 1; doStateChange(&StateID_Damage); @@ -278,10 +292,10 @@ int daDreidel::onCreate() { ActivePhysics::Info HitMeBaby; HitMeBaby.xDistToCenter = 0.0; - HitMeBaby.yDistToCenter = 12.0; + HitMeBaby.yDistToCenter = 24.0; - HitMeBaby.xDistToEdge = 14.0; - HitMeBaby.yDistToEdge = 12.0; + HitMeBaby.xDistToEdge = 28.0; + HitMeBaby.yDistToEdge = 24.0; HitMeBaby.category1 = 0x3; HitMeBaby.category2 = 0x0; @@ -455,7 +469,7 @@ void daDreidel::updateModelMatrices() { bodyModel._vf1C(); if(this->chrAnimation.isAnimationDone()) { - doStateChange(&StateID_Walk); + doStateChange(&StateID_Damage); } } @@ -494,11 +508,18 @@ void daDreidel::updateModelMatrices() { /////////////// void daDreidel::beginState_Charge() { bindAnimChr_and_setUpdateRate("begoman_attack3", 1, 0.0, 1.0); + this->timer = 0; } void daDreidel::executeState_Charge() { if(this->chrAnimation.isAnimationDone()) { this->chrAnimation.setCurrentFrame(0.0); } + this->timer += 1; + + if (this->timer == 120) { + doStateChange(&StateID_ChargePrep); + } + } void daDreidel::endState_Charge() { } @@ -522,9 +543,14 @@ void daDreidel::updateModelMatrices() { /////////////// void daDreidel::beginState_Damage() { bindAnimChr_and_setUpdateRate("begoman_wait", 1, 0.0, 1.0); + this->timer = 0; } void daDreidel::executeState_Damage() { if(this->chrAnimation.isAnimationDone()) { + this->timer += 1; + if (this->timer == 3) { + doStateChange(&StateID_ChargePrep); + } this->chrAnimation.setCurrentFrame(0.0); } } diff --git a/src/electricLine.cpp b/src/electricLine.cpp index d8a72e2..af8c7ea 100644 --- a/src/electricLine.cpp +++ b/src/electricLine.cpp @@ -61,6 +61,10 @@ int daElectricLine::onCreate() { Needles = (daNeedles*)create(NEEDLE_FOR_KOOPA_JR_B, settings, &temppos, &this->rot, 0); Needles->doStateChange(&daNeedles::StateID_DemoWait); + // Needles->aPhysics.info.category1 = 0x3; + // Needles->aPhysics.info.bitfield1 = 0x4F; + // Needles->aPhysics.info.bitfield2 = 0xffbafffe; + // Delay in 1/6ths of a second this->delay = (this->settings >> 16) * 10; this->loops = (this->settings >> 4); |