summaryrefslogtreecommitdiff
path: root/src/bossKoopaThrow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bossKoopaThrow.cpp')
-rw-r--r--src/bossKoopaThrow.cpp46
1 files changed, 28 insertions, 18 deletions
diff --git a/src/bossKoopaThrow.cpp b/src/bossKoopaThrow.cpp
index 8c6d4ee..19beadd 100644
--- a/src/bossKoopaThrow.cpp
+++ b/src/bossKoopaThrow.cpp
@@ -20,12 +20,12 @@ struct TypeInfo {
};
static const TypeInfo types[6] = {
- {"choropoo", "g3d/choropoo.brres", "spanner", "Wm_en_hit", 0, SE_BOSS_JR_FLOOR_BREAK, 0, 8.0f, 2.0f, 0, 0, 0x1000},
- {"choropoo", "g3d/choropoo.brres", "spanner", "Wm_en_burst_s", 0, SE_BOSS_JR_BOMB_BURST, 0, 8.0f, 2.0f, 0, 0, 0x1000},
- {"koopa_clown_bomb", "g3d/koopa_clown_bomb.brres", "koopa_clown_bomb", "Wm_en_burst_s", SE_BOSS_JR_BOMB_BOUND, SE_BOSS_JR_BOMB_BURST, 0, 8.0f, 1.0f, 0x200, 0x800, 0x1000},
- {"bros", "g3d/t00.brres", "bros_hammer", "Wm_en_hit", 0, SE_OBJ_HAMMER_HIT_BOTH, SE_EMY_MEGA_BROS_HAMMER, 8.0f, 2.0f, 0, 0, 0x1000},
- {"dossun", "g3d/t00.brres", "dossun", "Wm_en_hit", SE_EMY_DOSSUN, SE_EMY_DOSSUN_DEAD, 0, 8.0f, 1.0f, 0x100, 0x1000, 0x1000},
- {"KoopaShip", "g3d/present.brres", "PresentBox_penguin", "Wm_dm_presentopen",SE_EMY_DOSSUN, SE_EMY_DOSSUN_DEAD, 0, 8.0f, 1.0f, 0x20, 0x40, 0x200}
+ {"choropoo", "g3d/choropoo.brres", "spanner", "Wm_en_hit", 0, SE_BOSS_JR_FLOOR_BREAK, 0, 8.0f, 2.0f, 0, 0, 0x1000},
+ {"choropoo", "g3d/choropoo.brres", "spanner", "Wm_en_burst_s", 0, SE_BOSS_JR_BOMB_BURST, 0, 8.0f, 2.0f, 0, 0, 0x1000},
+ {"koopa_clown_bomb", "g3d/koopa_clown_bomb.brres", "koopa_clown_bomb", "Wm_en_burst_s", SE_BOSS_JR_BOMB_BOUND, SE_BOSS_JR_BOMB_BURST, 0, 16.0f, 0.8f, 0x200, 0x800, 0x1000},
+ {"bros", "g3d/t00.brres", "bros_hammer", "Wm_en_hit", 0, SE_OBJ_HAMMER_HIT_BOTH, SE_EMY_MEGA_BROS_HAMMER, 16.0f, 2.0f, 0, 0, 0x1000},
+ {"dossun", "g3d/t00.brres", "dossun", "Wm_en_hit", SE_EMY_DOSSUN, SE_EMY_DOSSUN_DEAD, 0, 16.0f, 1.0f, 0x100, 0x100, 0x100},
+ {"KoopaShip", "g3d/present.brres", "PresentBox_penguin", "Wm_dm_presentopen",SE_DEMO_OP_PRESENT_THROW_2400f, SE_DEMO_OP_PRESENT_BOX_BURST, 0, 12.0f, 1.0f, 0x20, 0x40, 0x200}
};
@@ -52,6 +52,7 @@ class daKoopaThrow : public dEn_c {
void updateModelMatrices();
void playerCollision(ActivePhysics *apThis, ActivePhysics *apOther);
+ void spriteCollision(ActivePhysics *apThis, ActivePhysics *apOther);
void collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther);
bool collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther);
@@ -86,9 +87,13 @@ extern "C" void *PlayWrenchSound(dEn_c *);
void daKoopaThrow::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) {
if (Type == 5) {
PlaySoundAsync(this, currentInfo->breakSound);
- SpawnEffect(currentInfo->deathEffect, 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
- CreateActor(EN_HATENA_BALLOON, 0x100, this->pos, 0, 0);
+ SpawnEffect(currentInfo->deathEffect, 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){3.0, 3.0, 3.0});
+ dStageActor_c *spawned = CreateActor(EN_HATENA_BALLOON, 0x100, this->pos, 0, 0);
+ spawned->pos.x = this->pos.x;
+ spawned->pos.y = this->pos.y;
this->Delete(1);
+
+ return;
}
DamagePlayer(this, apThis, apOther);
@@ -102,6 +107,8 @@ void daKoopaThrow::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther
}
}
+void daKoopaThrow::spriteCollision(ActivePhysics *apThis, ActivePhysics *apOther) {}
+
void daKoopaThrow::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { }
bool daKoopaThrow::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) {
return false;
@@ -259,6 +266,7 @@ int daKoopaThrow::onExecute() {
float rect[] = {this->_320, this->_324, this->spriteSomeRectX, this->spriteSomeRectY};
int ret = this->outOfZone(this->pos, (float*)&rect, this->currentZoneID);
if(ret) {
+ OSReport("Deleting");
this->Delete(1);
}
@@ -268,13 +276,13 @@ int daKoopaThrow::onExecute() {
void daKoopaThrow::beginState_Straight() {
- float rand = (float)GenerateRandomNumber(10) * 0.8;
+ float rand = (float)GenerateRandomNumber(10) * 0.4;
if (this->direction == 0) { // directions 1 spins clockwise, fly rightwards
- speed.x = 3.0 + rand;
+ speed.x = 1.5 + rand;
}
else { // directions 0 spins anti-clockwise, fly leftwards
- speed.x = -3.0 - rand;
+ speed.x = -1.5 - rand;
}
speed.y = 9.0;
@@ -290,13 +298,13 @@ void daKoopaThrow::executeState_Straight() {
cmgr_returnValue = collMgr.CollidedWithTile();
collMgr.execute();
- if (collMgr.CollidedWithTile() || (collMgr.bitfield_for_checks & (0x15 << direction))) {
- // hit the ground or wall
- PlaySoundAsync(this, currentInfo->breakSound);
+ // if (collMgr.CollidedWithTile() || (collMgr.bitfield_for_checks & (0x15 << direction))) {
+ // // hit the ground or wall
+ // PlaySoundAsync(this, currentInfo->breakSound);
- SpawnEffect(currentInfo->deathEffect, 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75});
- this->Delete(1);
- }
+ // SpawnEffect(currentInfo->deathEffect, 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){0.75, 0.75, 0.75});
+ // this->Delete(1);
+ // }
if (this->direction == 1) { // directions 1 spins clockwise, fly rightwards
this->rot.x -= currentInfo->xrot;
@@ -320,7 +328,9 @@ void daKoopaThrow::executeState_Straight() {
if (this->speed.y < 0.0) {
PlaySoundAsync(this, currentInfo->breakSound);
SpawnEffect(currentInfo->deathEffect, 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0});
- CreateActor(EN_HATENA_BALLOON, 0x100, this->pos, 0, 0);
+ dStageActor_c *spawned = CreateActor(EN_HATENA_BALLOON, 0x100, this->pos, 0, 0);
+ spawned->pos.x = this->pos.x;
+ spawned->pos.y = this->pos.y;
this->Delete(1);
}
}