diff options
Diffstat (limited to 'src/bossCaptainBowser.cpp')
-rw-r--r-- | src/bossCaptainBowser.cpp | 147 |
1 files changed, 106 insertions, 41 deletions
diff --git a/src/bossCaptainBowser.cpp b/src/bossCaptainBowser.cpp index bb73087..a9c36b4 100644 --- a/src/bossCaptainBowser.cpp +++ b/src/bossCaptainBowser.cpp @@ -7,28 +7,37 @@ -const char* effects_name_list [] = { - "Wm_jr_electricline", // cool - "Wm_jr_fireattack", // cool - "Wm_jr_firehit", // cool - "Wm_jr_fireplace", // cool - "Wm_jr_fireplace_ind", // cool - "Wm_jr_shot", - "Wm_jr_sweat", - "Wm_ko_fireattack", // cool - "Wm_ko_firehit", // cool - "Wm_ko_firehitdie01", // cool - "Wm_ko_firehitdie02", // cool - "Wm_ko_firehitdie03", // cool - "Wm_ko_magmapocha", - "Wm_ko_magmapochabig", - "Wm_ko_shout", // cool - "Wm_ko_shout02", // cool - "Wm_seacloudout", // cool +// const char* effects_name_list [] = { +// "Wm_jr_electricline", // cool +// "Wm_jr_fireattack", // cool +// "Wm_jr_firehit", // cool +// "Wm_jr_fireplace", // cool +// "Wm_jr_fireplace_ind", // cool +// "Wm_jr_shot", +// "Wm_jr_sweat", +// "Wm_ko_fireattack", // cool +// "Wm_ko_firehit", // cool +// "Wm_ko_firehitdie01", // cool +// "Wm_ko_firehitdie02", // cool +// "Wm_ko_firehitdie03", // cool +// "Wm_ko_magmapocha", +// "Wm_ko_magmapochabig", +// "Wm_ko_shout", // cool +// "Wm_ko_shout02", // cool +// "Wm_seacloudout", // cool +// }; + + +const char* CBarcNameList [] = { + "KoopaShip", + "koopa", + "choropoo", + "koopa_clown_bomb", + "dossun", + NULL }; - class daCaptainBowser : public daBoss { public: int onCreate(); @@ -50,13 +59,19 @@ public: ActivePhysics Roar; mEf::es2 effect; + mEf::es2 shipDmgA; + mEf::es2 shipDmgB; + mEf::es2 shipDmgC; + mEf::es2 shipDmgD; + mEf::es2 shipDmgE; + char isAngry; char isInvulnerable; float scaleIncreaser; - // int isInvulnerableCountdown; - // int isTurningCountdown; - // char charging; - // int flashing; + int homingBillCountdown; + int homingBillSlot; + int maxDamage; + int playerCount; static daCaptainBowser *build(); @@ -85,18 +100,18 @@ daCaptainBowser *daCaptainBowser::build() { return new(buffer) daCaptainBowser; } -void ShipPhysicsCallback(daCaptainBowser *self, dStageActor_c *other) { +void ShipPhysicsCallback(daCaptainBowser *self, dEn_c *other) { if (other->name == 657) { OSReport("CANNON COLLISION"); if (self->isInvulnerable) { return; } - self->damage += 1; + self->damage -= 1; - if (self->damage == 10) { self->doStateChange(&daCaptainBowser::StateID_Roar); } - else if (self->damage > 20) { self->doStateChange(&daCaptainBowser::StateID_Outro); } - else { self->doStateChange(&daCaptainBowser::StateID_Damage); } + other->doStateChange(&dEn_c::StateID_DieFumi); + if (self->damage == self->maxDamage/2) { self->doStateChange(&daCaptainBowser::StateID_Roar); } + else if (self->damage < 0) { self->doStateChange(&daCaptainBowser::StateID_Outro); } } } @@ -104,6 +119,8 @@ void ShipPhysicsCallback(daCaptainBowser *self, dStageActor_c *other) { // Externs and States /////////////////////// + extern "C" u32 GetActivePlayerCount(); + CREATE_STATE(daCaptainBowser, Wait); CREATE_STATE(daCaptainBowser, Throw); CREATE_STATE(daCaptainBowser, Fire); @@ -126,11 +143,15 @@ void ShipPhysicsCallback(daCaptainBowser *self, dStageActor_c *other) { if (this->isInvulnerable) { return; } - this->damage += 1; + this->damage -= 1; + + spawnHitEffectAtPosition((Vec2){apOther->owner->pos.x, apOther->owner->pos.y}); + + ((dEn_c*)(apOther->owner))->doStateChange(&dEn_c::StateID_DieFumi); - if (this->damage == 10) { doStateChange(&StateID_Roar); } - else if (this->damage > 20) { doStateChange(&StateID_Outro); } - else { doStateChange(&StateID_Damage); } + if (this->damage == this->maxDamage/2) { doStateChange(&StateID_Roar); } + else if (this->damage < 0) { doStateChange(&StateID_Outro); } + else { doStateChange(&StateID_Damage); } } } @@ -178,8 +199,15 @@ int daCaptainBowser::onCreate() { allocator.unlink(); // Prep the goods + this->playerCount = GetActivePlayerCount(); + this->maxDamage = (10* this->playerCount) +10; + + this->scale = (Vec){0.57, 0.57, 0.57}; - + this->homingBillCountdown = 270; + this->homingBillSlot = 0; + + this->damage = this->maxDamage; // Ship Physics! // Normal rects are { left, top, right, bottom } @@ -253,6 +281,43 @@ int daCaptainBowser::onExecute() { bodyModel._vf1C(); shipModel._vf1C(); + + this->homingBillCountdown--; + + if (this->homingBillCountdown == 0) { + + Vec tempPos; + + switch (this->homingBillSlot) { + case 0: + this->homingBillSlot++; + tempPos.x = this->pos.x - 26.0; + tempPos.y = this->pos.y + 40.0; + tempPos.z = this->pos.z + 2000.0; + break; + + case 1: + this->homingBillSlot++; + tempPos.x = this->pos.x + 22.0; + tempPos.y = this->pos.y + 40.0; + tempPos.z = this->pos.z + 2000.0; + break; + + case 2: + this->homingBillSlot = 0; + tempPos.x = this->pos.x + 70.0; + tempPos.y = this->pos.y + 40.0; + tempPos.z = this->pos.z + 2000.0; + break; + } + + SpawnEffect("Wm_en_killervanish", 0, &tempPos, &(S16Vec){0,0,0}, &(Vec){0.1, 0.1, 0.1}); + PlaySoundAsync(this, SE_EMY_SR_KILLER_SHOT); + CreateActor(EN_SEARCH_KILLER, 0, tempPos, 0, 0); + + this->homingBillCountdown = (isAngry) ? 90: 180; + } + if(this->shipAnm.isAnimationDone()) { this->shipAnm.setCurrentFrame(0.0); } @@ -407,10 +472,10 @@ int daCaptainBowser::onDraw() { this->timer = 0; this->scaleIncreaser = 0.5; - this->Roar.info.xDistToEdge = 70.0 * scaleIncreaser; - this->Roar.info.yDistToEdge = 70.0 * scaleIncreaser; + // this->Roar.info.xDistToEdge = 70.0 * scaleIncreaser; + // this->Roar.info.yDistToEdge = 70.0 * scaleIncreaser; - this->Roar.addToList(); + // this->Roar.addToList(); } void daCaptainBowser::executeState_Roar() { @@ -422,13 +487,13 @@ int daCaptainBowser::onDraw() { scaleIncreaser += 0.014285; effect.spawn("Wm_ko_shout", 0, &(Vec){pos.x-186.0+(scaleIncreaser*16.0), pos.y+138.0+(scaleIncreaser*16.0), pos.z}, &(S16Vec){0,0,0x7000}, &(Vec){scaleIncreaser, scaleIncreaser, scaleIncreaser}); - this->Roar.info.xDistToEdge = 70.0 * scaleIncreaser; - this->Roar.info.yDistToEdge = 70.0 * scaleIncreaser; + // this->Roar.info.xDistToEdge = 70.0 * scaleIncreaser; + // this->Roar.info.yDistToEdge = 70.0 * scaleIncreaser; } - if (this->chrAnimation.getCurrentFrame() == 197.0) { // This is where the smackdown ends - this->Roar.removeFromList(); - } + // if (this->chrAnimation.getCurrentFrame() == 197.0) { // This is where the smackdown ends + // this->Roar.removeFromList(); + // } if (this->chrAnimation.isAnimationDone()) { doStateChange(&StateID_Wait); |