diff options
Diffstat (limited to 'src/bossPodouble.cpp')
-rw-r--r-- | src/bossPodouble.cpp | 90 |
1 files changed, 56 insertions, 34 deletions
diff --git a/src/bossPodouble.cpp b/src/bossPodouble.cpp index d2cb3e3..1d105e6 100644 --- a/src/bossPodouble.cpp +++ b/src/bossPodouble.cpp @@ -82,10 +82,6 @@ daPodouble *daPodouble::build() { // Externs and States /////////////////////// extern "C" int SmoothRotation(short* rot, u16 amt, int unk2); - extern "C" void* WaterManager; - extern "C" u32 CheckforLiquid(void*, Vec, int, int, int, int layer); - - CREATE_STATE(daPodouble, Bounce); CREATE_STATE(daPodouble, Spit); @@ -257,7 +253,7 @@ int daPodouble::onCreate() { HitMeBaby.category1 = 0x3; HitMeBaby.category2 = 0x0; HitMeBaby.bitfield1 = 0x4F; - HitMeBaby.bitfield2 = (this->isFire) ? 0x388626 : 0x388626; + HitMeBaby.bitfield2 = (this->isFire) ? 0x380626 : 0x380626; HitMeBaby.unkShort1C = 0; HitMeBaby.callback = &poodleCollisionCallback; @@ -359,17 +355,6 @@ int daPodouble::onDraw() { 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); @@ -381,6 +366,21 @@ int daPodouble::onDraw() { bool ret; ret = GrowBoss(this, Kameck, 1.0, 3.5, 18, this->timer); + if (this->timer == 380) { + Vec tempPos = (Vec){this->pos.x - 80.0, this->pos.y + 120.0, 3564.0}; + create(AC_YOSHI_EGG, 0x01050000, &tempPos, &(S16Vec){0,0,0}, 0); + } + + if (this->timer == 400) { + Vec tempPos = (Vec){this->pos.x - 120.0, this->pos.y + 120.0, 3564.0}; + create(AC_YOSHI_EGG, 0x02030000, &tempPos, &(S16Vec){0,0,0}, 0); + } + + if (this->timer == 400) { + Vec tempPos = (Vec){this->pos.x - 120.0, this->pos.y + 120.0, 3564.0}; + create(AC_YOSHI_EGG, 0x82050110, &tempPos, &(S16Vec){0,0,0}, 0); + } + if (ret) { PlaySound(this, SE_EMY_CS_MOVE_W8_BUBBLE_APP); doStateChange(&StateID_Bounce); @@ -417,7 +417,7 @@ int daPodouble::onDraw() { doSpriteMovement(); if (this->pos.y < this->Baseline) { - this->speed.y = 8.0; + this->speed.y = 7.5; this->goingUp = 1; } if (-0.1 < this->speed.y < 0.1) { @@ -425,21 +425,7 @@ int daPodouble::onDraw() { // Check for stupid liquid junk - float ydest; - ydest = (this->pos.y > this->last_pos.y) ? this->last_pos.y : this->pos.y; - - int liquid = CheckforLiquid(WaterManager, this->pos, 0, 0, 0, this->currentLayerID); - - OSReport("Liquid type %d", liquid); - - if (liquid == 1) { - SpawnEffect("Wm_mr_magmawave", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){3.0, 3.0, 3.0}); - PlaySoundAsync(this, SE_EMY_BUBBLE_SPLASH); - } - if (liquid == 0) { - SpawnEffect("Wm_mr_waterwave_in", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){3.0, 3.0, 3.0}); - PlaySoundAsync(this, SE_OBJ_CMN_SPLASH); - } + checkLiquidImmersion(&(Vec2){this->pos.x, this->pos.y}, 3.0f); } void daPodouble::endState_Bounce() { @@ -466,11 +452,40 @@ int daPodouble::onDraw() { if (this->isFire == 0) { dStageActor_c *spawner = create(BROS_ICEBALL, 0x10, &this->pos, &(S16Vec){0,0,0}, 0); *((u32 *) (((char *) spawner) + 0x3DC)) = this->id; + + int num; + num = GenerateRandomNumber(20) - 10; + float modifier = (float)(num) / 10.0; + + spawner->max_speed.y += modifier; + spawner->speed.y += modifier; + + num = GenerateRandomNumber(20) - 10; + modifier = (float)(num) / 10.0; + + spawner->max_speed.x += modifier; + spawner->speed.x += modifier; + + PlaySoundAsync(this, SE_EMY_ICE_BROS_ICE); doStateChange(&StateID_Bounce); } else { - create(BROS_FIREBALL, 0, &this->pos, &(S16Vec){0,0,0}, 0); + dStageActor_c *spawner = create(BROS_FIREBALL, 0, &this->pos, &(S16Vec){0,0,0}, 0); + + int num; + num = GenerateRandomNumber(20); + float modifier = (float)(num) / 5.0; + + spawner->max_speed.y += modifier; + spawner->speed.y += modifier; + + num = GenerateRandomNumber(20); + modifier = (float)(num) / 10.0; + + spawner->max_speed.x += modifier; + spawner->speed.x += modifier; + PlaySoundAsync(this, SE_EMY_FIRE_BROS_FIRE); doStateChange(&StateID_Bounce); } @@ -537,7 +552,14 @@ int daPodouble::onDraw() { void daPodouble::beginState_Outro() { daPodouble *other = (daPodouble*)FindActorByType(SHIP_WINDOW, (Actor*)this); - if (other != 0) { other->doStateChange(&StateID_SyncDie); } + if (other != 0) { + other->doStateChange(&StateID_SyncDie); + + if (other->id == this->id) { + other = (daPodouble*)FindActorByType(SHIP_WINDOW, (Actor*)other); + other->doStateChange(&StateID_SyncDie); + } + } OutroSetup(this); this->timer = 0; |