diff options
Diffstat (limited to 'src/bossTopman.cpp')
-rw-r--r-- | src/bossTopman.cpp | 40 |
1 files changed, 33 insertions, 7 deletions
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); } } |