summaryrefslogtreecommitdiff
path: root/src/bossKoopaThrow.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/bossKoopaThrow.cpp31
1 files changed, 26 insertions, 5 deletions
diff --git a/src/bossKoopaThrow.cpp b/src/bossKoopaThrow.cpp
index 3b07d98..d330651 100644
--- a/src/bossKoopaThrow.cpp
+++ b/src/bossKoopaThrow.cpp
@@ -21,10 +21,10 @@ 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},
+ {"choropoo", "g3d/choropoo.brres", "spanner", "Wm_en_burst_s", 0, SE_BOSS_JR_BOMB_BURST, 0, 12.0f, 2.0f, 0, 0, 0x1000},
{"koopa_clown_bomb", "g3d/koopa_clown_bomb.brres", "koopa_clown_bomb", "Wm_en_burst_s", SE_EMY_ELCJ_THROW, 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},
+ {"dossun", "g3d/t02.brres", "dossun", "Wm_en_hit", SE_EMY_DOSSUN, SE_EMY_DOSSUN_DEAD, 0, 14.0f, 1.0f, 0, 0, 0},
{"KoopaShip", "g3d/present.brres", "PresentBox_penguin", "Wm_dm_presentopen",SE_DEMO_OP_PRESENT_THROW_2400f, SE_DEMO_OP_PRESENT_BOX_BURST, 0, 20.0f, 1.0f, 0x20, 0x40, 0x200}
};
@@ -55,6 +55,9 @@ class daKoopaThrow : public dEn_c {
int lifespan;
u32 cmgr_returnValue;
+ bool playsAnim;
+ m3d::anmChr_c chrAnim;
+
const TypeInfo *currentInfo;
static daKoopaThrow *build();
@@ -181,16 +184,29 @@ int daKoopaThrow::onCreate() {
allocator.link(-1, GameHeaps[0], 0, 0x20);
nw4r::g3d::ResFile rf(getResource(currentInfo->arcName, currentInfo->brresName));
- bodyModel.setup(rf.GetResMdl(currentInfo->modelName), &allocator, 0x224, 1, 0);
+ nw4r::g3d::ResMdl resMdl = rf.GetResMdl(currentInfo->modelName);
+
+ bodyModel.setup(resMdl, &allocator, (Type == 4 ? 0x224 : 0), 1, 0);
SetupTextures_Enemy(&bodyModel, 0);
+ if (Type == 4) {
+ // Thwomp
+ playsAnim = true;
+
+ nw4r::g3d::ResAnmChr anmChr = rf.GetResAnmChr("boss_throw");
+ chrAnim.setup(resMdl, anmChr, &allocator, 0);
+ chrAnim.bind(&bodyModel, anmChr, 1);
+ bodyModel.bindAnim(&chrAnim, 0.0);
+ chrAnim.setUpdateRate(1.0);
+ }
+
allocator.unlink();
ActivePhysics::Info KoopaJunk;
- KoopaJunk.xDistToCenter = -currentInfo->size;
- KoopaJunk.yDistToCenter = 0.0;
+ KoopaJunk.xDistToCenter = 0.0f;
+ KoopaJunk.yDistToCenter = (Type == 4) ? currentInfo->size : 0.0;
KoopaJunk.xDistToEdge = currentInfo->size;
KoopaJunk.yDistToEdge = currentInfo->size;
@@ -273,6 +289,11 @@ void daKoopaThrow::updateModelMatrices() {
int daKoopaThrow::onExecute() {
acState.execute();
updateModelMatrices();
+ if (playsAnim) {
+ if (chrAnim.isAnimationDone())
+ chrAnim.setCurrentFrame(0.0f);
+ bodyModel._vf1C();
+ }
float rect[] = {this->_320, this->_324, this->spriteSomeRectX, this->spriteSomeRectY};
int ret = this->outOfZone(this->pos, (float*)&rect, this->currentZoneID);