diff options
Diffstat (limited to '')
-rw-r--r-- | src/shyguy.cpp | 78 |
1 files changed, 35 insertions, 43 deletions
diff --git a/src/shyguy.cpp b/src/shyguy.cpp index bc889f8..f78cb4d 100644 --- a/src/shyguy.cpp +++ b/src/shyguy.cpp @@ -58,7 +58,7 @@ class daShyGuy : public dEn_c { mEf::es2 effect; - int type; + int timer; int jumpCounter; int baln; @@ -106,15 +106,12 @@ class daShyGuy : public dEn_c { void collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther); void collisionCat5_Mario(ActivePhysics *apThis, ActivePhysics *apOther); - void _vf108(ActivePhysics *apThis, ActivePhysics *apOther); - void _vf110(ActivePhysics *apThis, ActivePhysics *apOther); - void collisionCat8_FencePunch(ActivePhysics *apThis, ActivePhysics *apOther); - void _vf120(ActivePhysics *apThis, ActivePhysics *apOther); void collisionCat11_PipeCannon(ActivePhysics *apThis, ActivePhysics *apOther); void _vf148(); void _vf14C(); bool CreateIceActors(); + void addScoreWhenHit(void *other); USING_STATES(daShyGuy); DECLARE_STATE(Walk); @@ -138,6 +135,7 @@ class daShyGuy : public dEn_c { DECLARE_STATE(Die); public: void popBalloon(); + int type; }; daShyGuy *daShyGuy::build() { @@ -185,9 +183,15 @@ daShyGuy *daShyGuy::build() { // Collision callback to help shy guy not die at inappropriate times and ruin the dinner void shyCollisionCallback(ActivePhysics *apThis, ActivePhysics *apOther) { - if (apOther->owner->name != 89) { - dEn_c::collisionCallback(apThis, apOther); + int t = ((daShyGuy*)apThis->owner)->type; + if (t == 6 || t == 7 || t == 8) { + // Should I do something about ice blocks here? + ((daShyGuy*)apThis->owner)->popBalloon(); } + + if ((apOther->owner->name == 89) && (t == 5)) { return; } + + dEn_c::collisionCallback(apThis, apOther); } void ChucklesAndKnuckles(ActivePhysics *apThis, ActivePhysics *apOther) { @@ -231,9 +235,6 @@ daShyGuy *daShyGuy::build() { this->dEn_c::playerCollision(apThis, apOther); this->_vf220(apOther->owner); } - deathInfo.isDead = 0; - this->flags_4FC |= (1<<(31-7)); - this->counter_504[apOther->owner->which_player] = 0; return; } else { // Ballooneers @@ -241,11 +242,6 @@ daShyGuy *daShyGuy::build() { deathState = &StateID_Die; } - // fix multiple player collisions via megazig - deathInfo.isDead = 0; - this->flags_4FC |= (1<<(31-7)); - this->counter_504[apOther->owner->which_player] = 0; - if (this->isDown == 0) { hitType = usedForDeterminingStatePress_or_playerCollision(this, apThis, apOther, 2); @@ -263,7 +259,6 @@ daShyGuy *daShyGuy::build() { else { // Shy Guy is in throwy mode - kill it with fire this->playEnemyDownSound1(); doStateChange(deathState); - deathInfo.isDead = 1; } } else if(hitType == 3) { // spinning jump or whatever? @@ -275,7 +270,6 @@ daShyGuy *daShyGuy::build() { else { // Shy Guy is in throwy mode - kill it with fire this->playEnemyDownSound1(); doStateChange(deathState); - deathInfo.isDead = 1; } } else if(hitType == 0) { @@ -286,26 +280,26 @@ daShyGuy *daShyGuy::build() { } void daShyGuy::yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther) { this->playerCollision(apThis, apOther); } - void daShyGuy::collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) { PlaySound(this, SE_EMY_DOWN); doStateChange(&StateID_Die); } - void daShyGuy::collisionCat7_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) { PlaySound(this, SE_EMY_DOWN); doStateChange(&StateID_Die); } - void daShyGuy::collisionCat7_GroundPoundYoshi(ActivePhysics *apThis, ActivePhysics *apOther) { PlaySound(this, SE_EMY_DOWN); doStateChange(&StateID_Die); } - void daShyGuy::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { doStateChange(&StateID_Die); } - - void daShyGuy::collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther){ doStateChange(&StateID_Die); } - void daShyGuy::collisionCat5_Mario(ActivePhysics *apThis, ActivePhysics *apOther){ doStateChange(&StateID_Die); } - void daShyGuy::_vf108(ActivePhysics *apThis, ActivePhysics *apOther){ doStateChange(&StateID_Die); } - void daShyGuy::_vf110(ActivePhysics *apThis, ActivePhysics *apOther){ doStateChange(&StateID_Die); } - void daShyGuy::collisionCat8_FencePunch(ActivePhysics *apThis, ActivePhysics *apOther){ doStateChange(&StateID_Die); } - void daShyGuy::_vf120(ActivePhysics *apThis, ActivePhysics *apOther){ doStateChange(&StateID_Die); } - void daShyGuy::collisionCat11_PipeCannon(ActivePhysics *apThis, ActivePhysics *apOther){ doStateChange(&StateID_Die); } - - void daShyGuy::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther){ doStateChange(&StateID_DieSmoke); } + void daShyGuy::collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) { + PlaySound(this, SE_EMY_DOWN); + SpawnEffect("Wm_mr_hardhit", 0, &pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}); + this->addScoreWhenHit(this); + doStateChange(&StateID_Die); + } + void daShyGuy::collisionCat7_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) { this->collisionCatD_GroundPound(apThis, apOther); } + void daShyGuy::collisionCat7_GroundPoundYoshi(ActivePhysics *apThis, ActivePhysics *apOther) { this->collisionCatD_GroundPound(apThis, apOther); } + void daShyGuy::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) { this->collisionCatD_GroundPound(apThis, apOther); } + void daShyGuy::collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther){ this->collisionCatD_GroundPound(apThis, apOther); } + void daShyGuy::collisionCat5_Mario(ActivePhysics *apThis, ActivePhysics *apOther){ this->collisionCatD_GroundPound(apThis, apOther); } + void daShyGuy::collisionCat11_PipeCannon(ActivePhysics *apThis, ActivePhysics *apOther){ this->collisionCatD_GroundPound(apThis, apOther); } + void daShyGuy::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) { this->collisionCatD_GroundPound(apThis, apOther); } void daShyGuy::collisionCat3_StarPower(ActivePhysics *apThis, ActivePhysics *apOther){ dEn_c::collisionCat3_StarPower(apThis, apOther); doStateChange(&StateID_Die); } + void daShyGuy::collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther){ doStateChange(&StateID_DieSmoke); } void daShyGuy::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { this->damage += 1; @@ -359,18 +353,16 @@ daShyGuy *daShyGuy::build() { extern "C" void __destroy_arr(void*, void(*)(void), int, int); //extern "C" __destroy_arr(struct DoSomethingCool, void(*)(void), int cnt, int bar); - bool daShyGuy::CreateIceActors() - { - struct DoSomethingCool my_struct = { 0, this->pos, {1.0, 1.5, 1.5}, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + bool daShyGuy::CreateIceActors() { + struct DoSomethingCool my_struct = { 0, this->pos, {1.2, 1.5, 1.5}, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; + if (type > 8) { my_struct.scale = (Vec3){2.4, 3.0, 3.0}; } this->frzMgr.Create_ICEACTORs( (void*)&my_struct, 1 ); __destroy_arr( (void*)&my_struct, sub_80024C20, 0x3C, 1 ); return true; } - - - void daShyGuy::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) { - doStateChange(&StateID_Die); + void daShyGuy::addScoreWhenHit(void *other) { + if (type < 9) { dEn_c::addScoreWhenHit(other); } } bool daShyGuy::calculateTileCollisions() { @@ -471,9 +463,9 @@ int daShyGuy::onCreate() { ActivePhysics::Info iballoonPhysics; iballoonPhysics.xDistToCenter = 0.0; - iballoonPhysics.yDistToCenter = -24.0; - iballoonPhysics.xDistToEdge = 20.0; - iballoonPhysics.yDistToEdge = 12.0; + iballoonPhysics.yDistToCenter = -18.0; + iballoonPhysics.xDistToEdge = 16.0; + iballoonPhysics.yDistToEdge = 15.0; iballoonPhysics.category1 = 0x3; iballoonPhysics.category2 = 0x0; @@ -591,7 +583,7 @@ int daShyGuy::onCreate() { HitMeBaby.xDistToCenter = 0.0; HitMeBaby.yDistToCenter = 24.0; - HitMeBaby.xDistToEdge = 28.0; + HitMeBaby.xDistToEdge = 20.0; HitMeBaby.yDistToEdge = 24.0; // giantRider.init(this, -19.5f, 18.0f, 19.5f, 18.0f); @@ -607,7 +599,7 @@ int daShyGuy::onCreate() { HitMeBaby.xDistToCenter = 0.0; HitMeBaby.yDistToCenter = 12.0; - HitMeBaby.xDistToEdge = 14.0; + HitMeBaby.xDistToEdge = 10.0; HitMeBaby.yDistToEdge = 12.0; } |