summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2012-03-03 15:41:03 -0600
committerColin Noga <Tempus@chronometry.ca>2012-03-03 15:41:03 -0600
commitb8b1efc008e5ca2c455b8ab225b5d005449de851 (patch)
tree4f9a65ccf18a8b38bbe7144b3de34deed7e3dfb9
parent5dece655469940b4752cb0dc81328c8171e2b5e7 (diff)
downloadkamek-b8b1efc008e5ca2c455b8ab225b5d005449de851.tar.gz
kamek-b8b1efc008e5ca2c455b8ab225b5d005449de851.zip
Lots of boss fixes, working on thwomp - linking error
Diffstat (limited to '')
-rw-r--r--kamek_pal.x9
-rw-r--r--meteor.yaml7
-rw-r--r--shyguy.yaml6
-rw-r--r--src/bossFuzzyBear.cpp8
-rw-r--r--src/bossThwompaDomp.cpp703
-rw-r--r--src/effectvideo.cpp4
-rw-r--r--src/shyguy.cpp77
7 files changed, 443 insertions, 371 deletions
diff --git a/kamek_pal.x b/kamek_pal.x
index 67ed990..0e02ed7 100644
--- a/kamek_pal.x
+++ b/kamek_pal.x
@@ -1380,9 +1380,9 @@ SECTIONS {
SmoothRotation = 0x8015f630;
ClassAt1EC_Init = 0x8006D090;
HandlesOverallScale = 0x8009ea50;
- s_800b56e0 = 0x800b5730;
- unk_8042A008 = 0x8042a2e8;
- UnknownBullshit = 0x800d8d50;
+ posIsInZone = 0x800b5730;
+ ScreenPositionClass = 0x8042a2e8;
+ ShakeScreen = 0x800d8d50;
/* daEnemy_c */
/*FIXME bad vtable address :( */
@@ -1439,6 +1439,9 @@ SECTIONS {
StateID_DieFall__11daEnDosun_c = 0x80b1450c;
StateID_Ice__11daEnDosun_c = 0x80b1454c;
+ SpawnThwompEffects = 0x809f6660;
+
+
.text : {
FILL (0)
diff --git a/meteor.yaml b/meteor.yaml
index 765d350..b2be96d 100644
--- a/meteor.yaml
+++ b/meteor.yaml
@@ -8,3 +8,10 @@ hooks:
src_addr_pal: 0x80B0A940
target_func: 'dMeteor::build(void)'
+ - name: UpdateMeteorSpriteInfo
+ type: patch
+ # 0x8030A340 + sprite num * 0x28 == offset
+ addr_pal: 0x8030BFD8
+ # -ID- ---- -X Offs- -Y Offs- -RectX1- -RectY1- -RectX2- -RectY2- -1C- -1E- -20- -22- Flag ----
+ # Orig 01FC 0000 00000008 00000000 00000000 FFFFFFC0 00000010 00000040 0030 0030 0000 0000 0008 0000
+ data: '01FC 0000 00000008 00000000 00000008 00000000 00000200 00000200 0030 0030 0000 0000 0008 0000'
diff --git a/shyguy.yaml b/shyguy.yaml
index 385c934..427d295 100644
--- a/shyguy.yaml
+++ b/shyguy.yaml
@@ -8,3 +8,9 @@ hooks:
src_addr_pal: 0x80958C88
target_func: 'daShyGuy::build(void)'
+ - name: UpdateShyGuySpriteInfo
+ type: patch
+ addr_pal: 0x8030DA3C #0x8030DA18
+ # [204] ( 16, 48) ( 0, -24 16: 24) 64? 64? 0? 0? | [8:Environment?]
+ # 00CC 0000 00000010 00000030 00000000 FFFFFFE8 00000010 00000018 0040 0040 0000 0000 0008 0000
+ data: '0000 0000'
diff --git a/src/bossFuzzyBear.cpp b/src/bossFuzzyBear.cpp
index 97fc893..3fe4085 100644
--- a/src/bossFuzzyBear.cpp
+++ b/src/bossFuzzyBear.cpp
@@ -267,11 +267,11 @@ int daFuzzyBear_c::onCreate() {
this->direction = 0; // Heading left.
this->speed.x = 0;
- this->LaunchSpeedShort = ((this->settings >> 20) && 0xF) * 10.0;
- this->LaunchSpeedHigh = ((this->settings >> 24) && 0xF) * 10.0;
+ this->LaunchSpeedShort = ((this->settings >> 20) & 0xF) * 10.0;
+ this->LaunchSpeedHigh = ((this->settings >> 24) & 0xF) * 10.0;
- this->AreaWidthRight = this->settings && 0xFF;
- this->AreaWidthLeft = (this->settings >> 8) && 0xFF;
+ this->AreaWidthRight = this->settings & 0xFF;
+ this->AreaWidthLeft = (this->settings >> 8) & 0xFF;
this->initialPos = this->pos;
this->storeSpeed = 0;
diff --git a/src/bossThwompaDomp.cpp b/src/bossThwompaDomp.cpp
index e84867d..75aafdd 100644
--- a/src/bossThwompaDomp.cpp
+++ b/src/bossThwompaDomp.cpp
@@ -2,50 +2,74 @@
#include <game.h>
#include <g3dhax.h>
#include <sfx.h>
+#include <stage.h>
+#include "effects.h"
-#include "daEnDosun_c.h"
-#if 0
-/* called from _vf228 */
-/* handles overall scale */
-void sub_8009ea50( _464_struct* data ) {
- u32 ctr = data->ctr; // _0x14
- dEn_c* en = data->en; // _0x18
+extern "C" int posIsInZone(Vec,float*,float*,u8 zone);
+extern "C" void* ScreenPositionClass;
+extern "C" void ShakeScreen(void*,int,int,int,int); // (ScreenPositionClass, some other ints - set the second one to 1 to shake it)
+extern "C" int SpawnThwompEffects(dEn_c *);
- if(!ctr) {
- en->scale.x = en->scale.y = en->scale.z = 1.0;
- data->x = data->y = data->z = data->_0xC = 1.0
- return;
- }
- data->ctr--;
-
- /*FIXME continue */
-}
-#endif
-
-
-//FIXME find if needed
-extern "C" int s_800b56e0(Vec,float*,float*,u8 zone);
-//FIXME
-extern "C" void* unk_8042A008;
-extern "C" void UnknownBullshit(void*,int,int,int,int);
-//FIXME
extern "C" void* SoundRelatedClass;
extern "C" Vec ConvertStagePositionIntoScreenPosition__Maybe(Vec);
extern "C" void AnotherSoundRelatedFunction(void*,SFX,Vec,int);
-#define OLD 0
-#define STATES_NEEDED 1
-#define SETTINGS1CHANGE 1
-class daEnMegaDosun_c : public daEnDosun_c {
- int onCreate(); // overload for mega
+extern "C" void *PlaySound(dEn_c *, int soundID);
+extern "C" void *PlaySoundAsync(dEn_c *, int soundID);
+extern "C" dStageActor_c *GetSpecificPlayerActor(int number);
+
+extern "C" void *StopBGMMusic();
+extern "C" void *StartBGMMusic();
+
+extern "C" void *MakeMarioEnterDemoMode();
+extern "C" void *MakeMarioExitDemoMode();
+extern "C" void *UpdateGameMgr();
+
+
+class daEnMegaDosun_c : public dEn_c {
+ int onCreate();
int onExecute();
+ int onDraw();
+
static daEnMegaDosun_c *build();
- //int checkZoneBoundaries(int);
+ mHeapAllocator_c allocator; // _524
+
+ nw4r::g3d::ResFile resFile; // _540
+ m3d::mdl_c bodyModel; // _544
+ m3d::anmVis_c anmVis; // _584
+
+ u32 collision_struct[4]; // _5BC
+ float shakePosXoffset; // _5CC shakePosXoffset
+ u16 puruMoveCounter; // _5D8
+ u16 shakeIndex; // _5DA 0=shake,1=normal
+ u32 countdownTimer; // _5DC
+
+ int timer;
+ char notFalling;
+ char dying;
+ float leftBuffer;
+ float rightBuffer;
+ float topBuffer;
+
+ dEn_c *Kameck;
+
+ void setupBodyModel();
+ void updateModelMatrices();
+
+ void playerCollision(ActivePhysics *apThis, ActivePhysics *apOther);
+ void yoshiCollision(ActivePhysics *apThis, ActivePhysics *apOther);
+
+ void collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther);
+ bool collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther);
+ void collisionCat7_WMWaggleWater(ActivePhysics *apThis, ActivePhysics *apOther);
+ void collisionCat7_WMWaggleWaterYoshi(ActivePhysics *apThis, ActivePhysics *apOther);
+ void collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther);
+ void collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther);
+ void collisionCat14_YoshiFire(ActivePhysics *apThis, ActivePhysics *apOther);
+ void collisionCatA_PenguinMario(ActivePhysics *apThis, ActivePhysics *apOther);
-#if STATES_NEEDED
- //FIXME
USING_STATES(daEnMegaDosun_c);
DECLARE_STATE(UpWait);
DECLARE_STATE(DownMoveWait);
@@ -54,10 +78,10 @@ class daEnMegaDosun_c : public daEnDosun_c {
DECLARE_STATE(DownMove);
DECLARE_STATE(DownWait);
DECLARE_STATE(UpMove);
-#endif
+ DECLARE_STATE(Grow);
+ DECLARE_STATE(Outro);
};
-#if STATES_NEEDED
CREATE_STATE(daEnMegaDosun_c, UpWait);
CREATE_STATE(daEnMegaDosun_c, DownMoveWait);
CREATE_STATE(daEnMegaDosun_c, PuruMove);
@@ -65,25 +89,35 @@ CREATE_STATE(daEnMegaDosun_c, DownMoveKameck);
CREATE_STATE(daEnMegaDosun_c, DownMove);
CREATE_STATE(daEnMegaDosun_c, DownWait);
CREATE_STATE(daEnMegaDosun_c, UpMove);
-#endif
+CREATE_STATE(daEnMegaDosun_c, Grow);
+CREATE_STATE(daEnMegaDosun_c, Outro);
daEnMegaDosun_c *daEnMegaDosun_c::build() {
- OSReport("Building MegaThwomp\n");
void *buffer = AllocFromGameHeap1(sizeof(daEnMegaDosun_c));
return new(buffer) daEnMegaDosun_c;
}
-#if 1
-//FIXME stops halfway up
+void daEnMegaDosun_c::setupBodyModel() {
+ allocator.link(-1, GameHeaps[0], 0, 0x20);
+
+ this->resFile.data = getResource("dossun", "g3d/dossun.brres");
+ nw4r::g3d::ResMdl mdl = this->resFile.GetResMdl("dossun_big");
+ bodyModel.setup(mdl, &allocator, 0x224, 1, 0);
+ SetupTextures_Enemy(&bodyModel, 0);
+
+ nw4r::g3d::ResAnmVis anmRes = this->resFile.GetResAnmVis("dossun_big");
+ this->anmVis.setup(mdl, anmRes, &this->allocator, 0);
+ this->anmVis.bind(&bodyModel, anmRes, 1);
+
+ allocator.unlink();
+}
+
int daEnMegaDosun_c::onCreate() {
OSReport("daEnMegaDosun::onCreate()\n");
- this->bigOrSmall = 1; // 0=small,1=big,2=mega
-
- this->setupBodyModel(); // add this for linking/rename
+ this->setupBodyModel();
this->_36D = 0; // byte
- this->holdsFromSettings = this->settings & 0xf; //0=normal,1=??,2=fall
this->frzMgr.setSomething(1,1,1); //@0x809f5c5c
@@ -95,15 +129,8 @@ int daEnMegaDosun_c::onCreate() {
this->collision_struct[2] = 0x0001F000;
this->collision_struct[3] = 0x00005000;
- /*
- //0x80ACF990 + 0x8C = 80acfa1C
- 0.0,41.0,36.0,38.0,
- 0x03, 0x00, 0x0000,0x0000004F,0x0000820E,0x0100,0x0000
- dEn_c::collisionCallback (0x80095950)
- */
ActivePhysics::Info hm;
hm.xDistToCenter = 0.0;
- //FIXME find the missing link
hm.yDistToCenter = 41.0;
hm.xDistToEdge = 36.0;
hm.yDistToEdge = 38.0;
@@ -113,14 +140,8 @@ int daEnMegaDosun_c::onCreate() {
hm.bitfield2 = 0x0000820E;
hm.unkShort1C = 0x0100;
hm.callback = &dEn_c::collisionCallback;
- OSReport("this->aPhysiscs.initWithStruct(this,&hm);\n");
this->aPhysics.initWithStruct(this, &hm);
- /* 0x00000001,0xfffe1000,0x0001f000,0x00055000,
- * 0.0,20.0,16.0,19.0
- * 0x03000000,0x0000004f,0x0000820e,0x01000000,
- * dEn_c::collisionCallback
- */
//u8 s3[] = {0,0,0,1,0xff,0xfe,0x10,0,0,1,0xf0,0,0,5,0x50,0};
u8 s3[] = {0,0,0,1,0xff,0xfe,0x10,0,0,1,0xf0,0,0xff,0xfe,0x10,0};
OSReport("this->collMgr.Init(this,(u8*)&this->collision_struct,(u8*)&s3,0);\n");
@@ -145,314 +166,366 @@ int daEnMegaDosun_c::onCreate() {
this->rot.x = 0;
this->rot.y = 0;
this->rot.z = 0;
+ this->notFalling = 0;
+ this->direction = 0;
+ this->countdownTimer = 0;
- OSReport("this->doStateChange(FOO): %d\n", this->holdsFromSettings);
- // check settings bit
- if(this->holdsFromSettings == 2) {
- this->doStateChange(&StateID_DownMove_Kameck);
- }else{
- this->doStateChange(&StateID_UpWait);
- }
+ // Measured in half tiles
+ this->leftBuffer = this->pos.x - ((float)((this->settings >> 24) & 0xFF) * 8.0); //nyb 5-6 LEFT
+ this->rightBuffer = this->pos.x + ((float)((this->settings >> 16) & 0xFF) * 8.0); //nyb 7-8 RIGHT
+ this->topBuffer = this->pos.y + ((float)((this->settings >> 8) & 0xFF) * 8.0); //nyb 9-10 TOP
+
+
+ this->doStateChange(&StateID_Grow);
return 1;
}
-#endif
+
int daEnMegaDosun_c::onExecute() {
acState.execute();
- /*
- float tempRect[4] = {this->_320,this->_324,0.5*this->spriteSomeRectX,0.5*this->spriteSomeRectY};
- int foo = this->outOfZone(this->pos, tempRect, this->currentZoneID);
- //float tempRect2[4] = {this->_338, this->_33C, this->_340, this->_344};
- //OSReport("s_800b56e0()\n");
- //int bar = s_800b56e0(this->pos, tempRect, tempRect2, this->currentZoneID);
- //OSReport("foo: %d, bar: %d\n", foo, bar);
- if(foo) {
- OSReport("this->outOfZone(%d) : %d\n", this->currentZoneID, foo);
- OSReport("daEnMegaDosun_c has left the building\n");
- this->Delete(this->_390);
- //FIXME change to do outro when leaving screen
- }else{
- OSReport("this->outOfZone(%d) : %d\n", this->currentZoneID, foo);
- }
- */
int ret = this->checkZoneBoundaries(0);
if(ret) {
OSReport("daEnMegaDosun_c has left the building\n");
+ doStateChange(&StateID_Outro);
}
return 1;
}
-#if STATES_NEEDED
-//FIXME add sideways moving
-//StateID_UpWait
-void daEnMegaDosun_c::beginState_UpWait() {
- OSReport("beginState_UpWait()\n");
- this->countdownTimer = 0;
- if(!this->bigOrSmall)
- return;
- this->collision_struct[0] = 0x11804101;
-}
-void daEnMegaDosun_c::executeState_UpWait() {
- OSReport("executeState_UpWait()\n");
- if(this->countdownTimer != 0) {
- this->countdownTimer--;
- return;
- }
-
- //FIXME need megasized - also needs to be less leeway
- float _array[] = { 48.0, 80.0 }; // small, big
- //CheckIfPlayerBelow(xDelta, yDelta);
- //if(this->CheckIfPlayerBelow(80.0, 256.0)) {
- if(this->CheckIfPlayerBelow(40.0, 256.0)) {
- this->doStateChange(&StateID_DownMoveWait);
- this->speed.y = 0.0;
- }
-}
-void daEnMegaDosun_c::endState_UpWait() {
- OSReport("endState_UpWait()\n");
- return;
-}
-//StateID_DownMoveWait
-void daEnMegaDosun_c::beginState_DownMoveWait() {
- OSReport("beginState_DownMoveWait()\n");
- this->anmVis.playState = 1;
- this->bodyModel.bindAnim(&this->anmVis, 0.5);
-}
-void daEnMegaDosun_c::executeState_DownMoveWait() {
- OSReport("executeState_DownMoveWait()\n");
- if(this->anmVis.isAnimationDone())
- this->doStateChange(&StateID_PuruMove);
- this->anmVis.process();
-}
-void daEnMegaDosun_c::endState_DownMoveWait() {
- OSReport("endState_DownMoveWait()\n");
- return;
+int daEnMegaDosun_c::onDraw() {
+ bodyModel.scheduleForDrawing();
+ return true;
}
-//StateID_PuruMove
-void daEnMegaDosun_c::beginState_PuruMove() {
- OSReport("beginState_PuruMove()\n");
- this->puruMoveCounter = 8;
- this->shakeIndex = 0;
-}
-void daEnMegaDosun_c::executeState_PuruMove() {
- OSReport("executeState_PuruMove()\n");
- if(this->puruMoveCounter == 0) {
- this->shakePosXoffset = 0.0;
- this->doStateChange(&StateID_DownMove);
- return;
- }
- this->puruMoveCounter--;
- if(this->puruMoveCounter & 2 == 0)
- return;
+void daEnMegaDosun_c::updateModelMatrices() {
+ // This won't work with wrap because I'm lazy.
+ matrix.translation(pos.x, pos.y, pos.z);
+ matrix.applyRotationYXZ(&rot.x, &rot.y, &rot.z);
- float _array[] = {2.0, 0.0};
- this->shakeIndex ^= 1;
- this->shakePosXoffset = _array[this->shakeIndex];
-}
-void daEnMegaDosun_c::endState_PuruMove() {
- OSReport("endState_PuruMove()\n");
- return;
+ bodyModel.setDrawMatrix(matrix);
+ bodyModel.setScale(&scale);
+ bodyModel.calcWorld(false);
}
-//StateID_DownMoveKameck
-void daEnMegaDosun_c::beginState_DownMoveKameck() {
- OSReport("beginState_DownMoveKameck()\n");
- this->anmVis.playState = 1;
- this->bodyModel.bindAnim(&this->anmVis, 0.5);
-}
-void daEnMegaDosun_c::executeState_DownMoveKameck() {
- OSReport("executeState_DownMoveKameck()\n");
- if(this->anmVis.isAnimationDone())
- this->doStateChange(&StateID_DownMove);
- this->anmVis.process();
-}
-void daEnMegaDosun_c::endState_DownMoveKameck() {
- OSReport("endState_DownMoveKameck()\n");
- return;
-}
-//StateID_DownMove
-void daEnMegaDosun_c::beginState_DownMove() {
- OSReport("beginState_DownMove()\n");
- this->speed.y = 0.0;
-}
-void daEnMegaDosun_c::executeState_DownMove() {
- OSReport("executeState_DownMove()\n");
- this->HandleYSpeed();
- this->UpdateObjectPosBasedOnSpeedValuesReal();
-
- //FIXME what do I do? - bottom detection
- int ret = this->collMgr.execute();
- OSReport("s_80072BC0(): %08x\n", ret);
- if(!ret)
- return;
+// Grow State
-#if SETTINGS1CHANGE
- if((this->holdsFromSettings == 1) && (ret & 0x8000)) {
- OSReport("this->speed.y = 0.0;\n");
- this->speed.y = 0.0;
- }
+ void daEnMegaDosun_c::beginState_Grow() {
+ this->scale = (Vec){0.5, 0.5, 0.5};
- if(this->holdsFromSettings == 2) {
- OSReport("ret |= 0x400000\n");
- ret |= 0x400000;
- }
-#else
- if(this->holdsFromSettings == 1) {
- OSReport("ret |= 0x400000\n");
- ret |= 0x400000;
- }
-#endif
+ this->timer = 0;
- if(!(ret & 0x400000)) {
- OSReport("doStateChange(&StateID_DownWait)\n");
- this->doStateChange(&StateID_DownWait);
- this->countdownTimer = 0x40;
- this->speed.y = 0.0;
- UnknownBullshit(unk_8042A008, 0, 1, 0, 0);
- }else{
- this->collision_struct[0] = 0x00000001;
- this->speed.y = 0.0;
- OSReport("UnknownBullshit(%x,%d,%d,%d,%d)\n", unk_8042A008,0,1,0,0);
- UnknownBullshit(unk_8042A008, 0, 1, 0, 0);
- this->collMgr.Clear2();
- }
+ // Stop the BGM Music
+ StopBGMMusic();
- this->spawnEffects();
- Vec p = ConvertStagePositionIntoScreenPosition__Maybe(this->pos);
- AnotherSoundRelatedFunction(SoundRelatedClass, SE_EMY_BIG_DOSSUN, p, 0);
- //SoundRelatedClass.AnotherSoundRelatedFunction(SE_EMY_BIG_DOSSUN, p, 0);
-}
-void daEnMegaDosun_c::endState_DownMove() {
- OSReport("endState_DownMove()\n");
- return;
-}
+ // Set the necessary Flags and make Mario enter Demo Mode
+ dStage32C_c::instance->freezeMarioBossFlag = 1;
+ WLClass::instance->_4 = 4;
+ WLClass::instance->_8 = 0;
-//StateID_DownWait
-void daEnMegaDosun_c::beginState_DownWait() {
- OSReport("beginState_DownWait()\n");
- return;
-}
-void daEnMegaDosun_c::executeState_DownWait() {
- OSReport("executeState_DownWait()\n");
- if(this->countdownTimer == 0) {
- this->doStateChange(&StateID_UpMove);
- }else{
- this->countdownTimer--;
- if(this->countdownTimer & 0xff == 0x20)
- this->anmVis.playState = 3;
- }
+ MakeMarioEnterDemoMode();
- this->anmVis.process();
-}
-void daEnMegaDosun_c::endState_DownWait() {
- OSReport("endState_DownWait()\n");
- return;
-}
+ // Make sure to use the correct position
+ Vec pos = (Vec){this->pos.x - 124.0, this->pos.y + 104.0, 3564.0};
+ S16Vec rot = (S16Vec){0, 0, 0};
-//StateID_UpMove
-void daEnMegaDosun_c::beginState_UpMove() {
- OSReport("beginState_UpMove()\n");
- this->collMgr.Clear2();
-}
-void daEnMegaDosun_c::executeState_UpMove() {
- OSReport("executeState_UpMove()\n");
- this->speed.y = 0.875;
- this->UpdateObjectPosBasedOnSpeedValuesReal();
- int ret = this->collMgr.SomethingSemiImportant(0);
- OSReport("this->collMgr.SomethingSemiImportant(0): %08x\n", ret);
- if(ret != 0) { // at top
- this->doStateChange(&StateID_UpWait);
- this->countdownTimer = 0xc;
+ // Create And use Kameck
+ Kameck = (daKameckDemo*)createChild(KAMECK_FOR_CASTLE_DEMO, (dStageActor_c*)this, 0, &pos, &rot, 0);
+ Kameck->doStateChange(&daKameckDemo::StateID_DemoWait);
}
-}
-void daEnMegaDosun_c::endState_UpMove() {
- OSReport("endState_UpMove()\n");
- return;
-}
-#endif
-#if 0
-int daEnMegaDosun_c::checkZoneBoundaries(int foo) {
- if(this->eatenState == 2) { // is eaten
- return 0;
+ void daEnMegaDosun_c::executeState_Grow() {
+
+ if (this->timer == 130) { Kameck->doStateChange(&daKameckDemo::StateID_DemoSt); }
+ if (this->timer == 400) { Kameck->doStateChange(&daKameckDemo::StateID_DemoSt2); }
+
+ this->timer = this->timer + 1;
+
+ float scaleSpeed, yPosScaling;
+
+ if (this->timer == 150) { PlaySound(this, SE_BOSS_IGGY_WANWAN_TO_L); }
+
+ if ((this->timer > 150) && (this->timer < 230)) {
+
+ scaleSpeed = 0.00625;
+
+ float modifier;
+
+ modifier = 0.5 + ((this->timer - 150) * scaleSpeed);
+
+ this->scale = (Vec){modifier, modifier, modifier};
+
+ }
+
+ if (this->timer == 360) {
+ Vec tempPos = (Vec){this->pos.x - 40.0, this->pos.y + 120.0, 3564.0};
+ CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 175); // 400 & 401 // 564 // 583 // 754 // 958
+ CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 400); // 400 & 401 // 564 // 583 // 754 // 958
+ CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 401); // 400 & 401 // 564 // 583 // 754 // 958
+ CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 564); // 400 & 401 // 564 // 583 // 754 // 958
+ CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 583); // 400 & 401 // 564 // 583 // 754 // 958
+ CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 754); // 400 & 401 // 564 // 583 // 754 // 958
+ CreateEffect(&tempPos, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 958); // 400 & 401 // 564 // 583 // 754 // 958
+ }
+
+ if (this->timer > 420) {
+ PlaySound(this, SE_EMY_BIG_DOSSUN);
+ doStateChange(&StateID_UpMove);
+ }
}
+ void daEnMegaDosun_c::endState_Grow() {
- if( (0 == (foo&0x8)) && \
- (this->collMgr.checkBits15and16ofBitfield() != 0) ) {
- return 0;
- }
+ // Clean up the flags and Kameck
+ dStage32C_c::instance->freezeMarioBossFlag = 0;
+ WLClass::instance->_8 = 1;
- int ret = 0;
+ MakeMarioExitDemoMode();
+ StartBGMMusic();
- Rect tempRect = (Rect){this->_320, this->_324,
- 0.5 * this->spriteSomeRectX, 0.5 * this->spriteSomeRectY};
- Rect tempRect2 = (Rect){_338, _33C, _340, _344};
- if(this->outOfZone(this->pos, &tempRect, currentZoneId) ||
- (!(foo&0x4) && s_800b56e0(pos, &tempRect, &tempRect2, currentZoneId)) )
- {
- ret = 1;
+ Kameck->Delete(1);
}
- if(ret && !(foo & 0x2))
- this->Delete(this->_390);
-
- return ret;
-}
-#endif
+// StateID_UpWait
+ void daEnMegaDosun_c::beginState_UpWait() {
+ this->collision_struct[0] = 0x11804101;
+ this->timer = 0;
+ }
+ void daEnMegaDosun_c::executeState_UpWait() {
+ if(this->countdownTimer != 0) {
+ this->countdownTimer--;
+ return;
+ }
+
+ if (this->pos.x > this->rightBuffer) {
+ this->direction = 0;
+ }
+
+ if (this->pos.x < this->leftBuffer) {
+ this->direction = 1;
+ }
+
+ this->pos.x += (direction) ? -0.5 : 0.5;
+
+ if (this->notFalling == 0) {
+ if(this->CheckIfPlayerBelow(40.0, 256.0)) {
+ this->doStateChange(&StateID_DownMoveWait);
+ this->speed.y = 0.0;
+ }
+ }
+
+ if (this->timer == 60) {
+ this->notFalling = 0;
+ }
+
+ this->timer += 1;
+ }
+ void daEnMegaDosun_c::endState_UpWait() {
+ this->notFalling = 1;
+ return;
+ }
-#if 0
-extern "C" bool CollidedWithTile(u8 *);
-extern "C" void *SomeStrangeModification(dEn_c *);
+// StateID_DownMoveWait
+ void daEnMegaDosun_c::beginState_DownMoveWait() {
+ this->anmVis.playState = 1;
+ this->bodyModel.bindAnim(&this->anmVis, 0.5);
+ }
+ void daEnMegaDosun_c::executeState_DownMoveWait() {
+ if(this->anmVis.isAnimationDone())
+ this->doStateChange(&StateID_PuruMove);
+ this->anmVis.process();
+ }
+ void daEnMegaDosun_c::endState_DownMoveWait() {
+ return;
+ }
-void ThwompaDompMoveC(dEn_c *Sprite) {
+// StateID_PuruMove
+ void daEnMegaDosun_c::beginState_PuruMove() {
+ this->puruMoveCounter = 8;
+ this->shakeIndex = 0;
+ }
+ void daEnMegaDosun_c::executeState_PuruMove() {
+ if(this->puruMoveCounter == 0) {
+ this->shakePosXoffset = 0.0;
+ this->doStateChange(&StateID_DownMove);
+ return;
+ }
+
+ this->puruMoveCounter--;
+ if(this->puruMoveCounter & 2 == 0)
+ return;
+
+ float _array[] = {2.0, 0.0};
+ this->shakeIndex ^= 1;
+ this->shakePosXoffset = _array[this->shakeIndex];
+ }
+ void daEnMegaDosun_c::endState_PuruMove() {
+ return;
+ }
+//StateID_DownMove
+ void daEnMegaDosun_c::beginState_DownMove() {
+ OSReport("beginState_DownMove()\n");
+ this->speed.y = 0.0;
+ }
+ void daEnMegaDosun_c::executeState_DownMove() {
+ OSReport("executeState_DownMove()\n");
+ this->HandleYSpeed();
+ this->UpdateObjectPosBasedOnSpeedValuesReal();
+
+ //FIXME what do I do? - bottom detection
+ int ret = this->collMgr.execute();
+ OSReport("collMgr Returns(): %08x\n", ret);
+ if(!ret)
+ return;
+
+ if(!(ret & 0x400000)) {
+ OSReport("doStateChange(&StateID_DownWait)\n");
+ this->doStateChange(&StateID_DownWait);
+ this->countdownTimer = 0x40;
+ this->speed.y = 0.0;
+ ShakeScreen(ScreenPositionClass, 0, 1, 0, 0);
+ }
+ else {
+ this->collision_struct[0] = 0x00000001;
+ this->speed.y = 0.0;
+ OSReport("ShakeScreen(%x,%d,%d,%d,%d)\n", ScreenPositionClass,0,1,0,0);
+ ShakeScreen(ScreenPositionClass, 0, 1, 0, 0);
+ this->collMgr.Clear2();
+ }
+
+ SpawnThwompEffects(this);
+ Vec p = ConvertStagePositionIntoScreenPosition__Maybe(this->pos);
+ AnotherSoundRelatedFunction(SoundRelatedClass, SE_EMY_BIG_DOSSUN, p, 0);
+ //SoundRelatedClass.AnotherSoundRelatedFunction(SE_EMY_BIG_DOSSUN, p, 0);
+ }
+ void daEnMegaDosun_c::endState_DownMove() {
+ OSReport("endState_DownMove()\n");
+ return;
+ }
+// StateID_DownWait
+ void daEnMegaDosun_c::beginState_DownWait() {
+ return;
+ }
+ void daEnMegaDosun_c::executeState_DownWait() {
+ if(this->countdownTimer == 0) {
+ this->doStateChange(&StateID_UpMove);
+ }
+ else{
+ this->countdownTimer--;
+ if(this->countdownTimer & 0xff == 0x20)
+ this->anmVis.playState = 3;
+ }
+
+ this->anmVis.process();
+ }
+ void daEnMegaDosun_c::endState_DownWait() {
+ return;
+ }
- bool FirstCheck;
- bool SecondCheck;
+// StateID_UpMove
+ void daEnMegaDosun_c::beginState_UpMove() {
+ this->collMgr.Clear2();
+ }
+ void daEnMegaDosun_c::executeState_UpMove() {
+ // this->speed.y = 0.0;
+ // this->UpdateObjectPosBasedOnSpeedValuesReal();
+
+ if (this->pos.y > this->topBuffer) {
+ this->doStateChange(&StateID_UpWait);
+ this->countdownTimer = 0xc;
+ }
+ else {
+ this->pos.y += 0.5;
+ }
+ }
+ void daEnMegaDosun_c::endState_UpMove() {
+ return;
+ }
- // Check for collisions with walls?
- FirstCheck = CollidedWithTile(Sprite->collMgr);
- SomeStrangeModification(Sprite);
- SecondCheck = CollidedWithTile(Sprite->collMgr);
+// Outro
+ void daEnMegaDosun_c::beginState_Outro() {
- OSReport("XPos = %f, FirstCheck = %d, SecondCheck = %d", Sprite->pos.x, FirstCheck, SecondCheck);
+ WLClass::instance->_4 = 5;
+ WLClass::instance->_8 = 0;
- if ((FirstCheck != 0) && (SecondCheck != 0)) {
- OSReport("Actually doing something, I swear");
+ this->removeMyActivePhysics();
+ this->timer = 0;
+ StopBGMMusic();
- Sprite->pos.y = Sprite->pos.y + 16.0;
- Sprite->pos.x = Sprite->pos.x - 180.0;
+ dStage32C_c::instance->freezeMarioBossFlag = 1;
- if (Sprite->direction == 0) {
- Sprite->direction = 1;
- Sprite->pos.x = Sprite->pos.x - 80.0; }
- else {
- Sprite->direction = 0;
- Sprite->pos.x = Sprite->pos.x + 80.0; }
}
- else {
- if (Sprite->direction == 0) {
- Sprite->pos.x = Sprite->pos.x + 1.0; }
+ void daEnMegaDosun_c::executeState_Outro() {
+
+ if (this->dying == 1) {
+ if (this->timer > 180) {
+ ExitStage(WORLD_MAP, 0, BEAT_LEVEL, MARIO_WIPE);
+ }
+
+ if (this->timer == 60) {
+
+ UpdateGameMgr();
+
+ if (GetSpecificPlayerActor(0) != 0) {
+ PlaySound(this, SE_VOC_MA_CLEAR_BOSS);
+ // Send PlBase into DemoGoal State here, kthxbai
+ }
+
+ if (GetSpecificPlayerActor(1) != 0) {
+ PlaySound(this, SE_VOC_LU_CLEAR_BOSS);
+ // Send PlBase into DemoGoal State here, kthxbai
+ }
+
+ if (GetSpecificPlayerActor(2) != 0) {
+ PlaySound(this, SE_VOC_KO_CLEAR_BOSS);
+ // Send PlBase into DemoGoal State here, kthxbai
+ }
+
+ if (GetSpecificPlayerActor(3) != 0) {
+ PlaySound(this, SE_VOC_KO2_CLEAR_BOSS);
+ // Send PlBase into DemoGoal State here, kthxbai
+ }
+ }
+
+ this->timer += 1;
+ return;
+ }
+
+ if (this->scale.x > 0.1) {
+
+ PlaySound(this, SE_EMY_BIG_DOSSUN_DEAD);
+
+ // Adjust this to equal the scale of your boss / 80.
+ this->scale.x -= 0.015;
+ this->scale.y -= 0.015;
+ this->scale.z -= 0.015;
+
+ if (this->timer == 30) {
+ CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 756);
+ CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 801);
+ CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 957);
+ this->timer = 0;
+ }
+
+ this->timer += 1;
+ }
else {
- Sprite->pos.x = Sprite->pos.x - 1.0; }
- }
-
-
- return;
-}
-#endif
-
-/*
-class daYoshi_c : public dStageActor_c {
- u32 _1520; // holds actorID of actor eaten
-};
-*/
+ this->scale.x = 0.0;
+ this->scale.y = 0.0;
+ this->scale.z = 0.0;
+
+ CreateEffect(&this->pos, &(S16Vec){0,0,0}, &(Vec){2.0, 2.0, 2.0}, 588);
+ this->dying = 1;
+ this->timer = 0;
+
+ PlaySound(this, STRM_BGM_SHIRO_BOSS_CLEAR);
+ MakeMarioEnterDemoMode();
+ }
+ }
+ void daEnMegaDosun_c::endState_Outro() { }
diff --git a/src/effectvideo.cpp b/src/effectvideo.cpp
index 38a7686..3aa43fb 100644
--- a/src/effectvideo.cpp
+++ b/src/effectvideo.cpp
@@ -6,7 +6,7 @@
#include <sfx.h>
-extern "C" void *PlaySound(dEn_c *, int soundID);
+extern "C" void *PlaySoundAsync(dEn_c *, int soundID);
class EffectVideo : public dEn_c {
@@ -72,7 +72,7 @@ int EffectVideo::onExecute() {
if (this->timer == this->delay) {
if (this->type == 0) { // Plays a sound
- PlaySound(this, this->effect);
+ PlaySoundAsync(this, this->effect);
}
else { // Plays an Effect
diff --git a/src/shyguy.cpp b/src/shyguy.cpp
index bf54c64..36072b8 100644
--- a/src/shyguy.cpp
+++ b/src/shyguy.cpp
@@ -617,6 +617,7 @@ int daShyGuy::onCreate() {
doStateChange(&StateID_RealWalk);
}
else if (type == 1) {
+ bindAnimChr_and_setUpdateRate("c18_EV_WIN_2_R", 1, 0.0, 1.5);
doStateChange(&StateID_Walk);
}
else if (type == 2) {
@@ -668,6 +669,7 @@ int daShyGuy::onCreate() {
doStateChange(&StateID_RealWalk);
}
else if (type == 10) {
+ bindAnimChr_and_setUpdateRate("c18_EV_WIN_2_R", 1, 0.0, 1.5);
doStateChange(&StateID_Walk);
}
@@ -747,7 +749,6 @@ void daShyGuy::updateModelMatrices() {
// Walk State
///////////////
void daShyGuy::beginState_Walk() {
- bindAnimChr_and_setUpdateRate("c18_EV_WIN_2_R", 1, 0.0, 1.5);
this->timer = 0;
this->rot.y = (direction) ? 0xD800 : 0x2800;
@@ -759,13 +760,12 @@ void daShyGuy::updateModelMatrices() {
this->pos.x += (direction) ? -0.5 : 0.5;
+ if (this->timer > (this->distance * 32)) {
+ doStateChange(&StateID_Turn);
+ }
+
if(this->chrAnimation.isAnimationDone())
- if (this->timer > (this->distance * 32)) {
- doStateChange(&StateID_Turn);
- }
- else {
- this->chrAnimation.setCurrentFrame(0.0);
- }
+ this->chrAnimation.setCurrentFrame(0.0);
this->timer = this->timer + 1;
}
@@ -776,12 +776,15 @@ void daShyGuy::updateModelMatrices() {
// Turn State
///////////////
void daShyGuy::beginState_Turn() {
- bindAnimChr_and_setUpdateRate("c18_IDLE_R", 1, 0.0, 1.0);
+ // bindAnimChr_and_setUpdateRate("c18_IDLE_R", 1, 0.0, 1.0);
this->direction ^= 1;
this->speed.x = 0.0;
}
void daShyGuy::executeState_Turn() {
+ if(this->chrAnimation.isAnimationDone())
+ this->chrAnimation.setCurrentFrame(0.0);
+
u16 amt = (this->direction == 0) ? 0x2800 : 0xD800;
int done = SmoothRotation(&this->rot.y, amt, 0x800);
@@ -1109,24 +1112,24 @@ void daShyGuy::updateModelMatrices() {
spawned->speed.y = 2.0;
}
- if (spikeTurn == 0) {
- if (this->spikeA != 0) {
- PlaySound(spikeA, SE_OBJ_ROCK_S_CRASH);
- CreateEffect(&(Vec){this->spikeA->pos.x, this->spikeA->pos.y, 5500.0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 9);
- this->spikeA->Delete(this->spikeA->_390);
- }
- this->spikeA = spawned;
- spikeTurn = 1;
- }
- else {
- if (this->spikeB != 0) {
- PlaySound(spikeB, SE_OBJ_ROCK_S_CRASH);
- CreateEffect(&(Vec){this->spikeB->pos.x, this->spikeB->pos.y, 5500.0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 9);
- this->spikeB->Delete(this->spikeB->_390);
- }
- this->spikeB = spawned;
- spikeTurn = 0;
- }
+ // if (spikeTurn == 0) {
+ // if (this->spikeA != 0) {
+ // PlaySound(spikeA, SE_OBJ_ROCK_S_CRASH);
+ // CreateEffect(&(Vec){this->spikeA->pos.x, this->spikeA->pos.y, 5500.0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 9);
+ // this->spikeA->Delete(this->spikeA->_390);
+ // }
+ // this->spikeA = spawned;
+ // spikeTurn = 1;
+ // }
+ // else {
+ // if (this->spikeB != 0) {
+ // PlaySound(spikeB, SE_OBJ_ROCK_S_CRASH);
+ // CreateEffect(&(Vec){this->spikeB->pos.x, this->spikeB->pos.y, 5500.0}, &(S16Vec){0,0,0}, &(Vec){1.0, 1.0, 1.0}, 9);
+ // this->spikeB->Delete(this->spikeB->_390);
+ // }
+ // this->spikeB = spawned;
+ // spikeTurn = 0;
+ // }
// spawned->_320 = 0.0f;
// spawned->_324 = 8.0f;
@@ -1400,27 +1403,7 @@ void daShyGuy::updateModelMatrices() {
calculateTileCollisions();
if(this->chrAnimation.isAnimationDone()) {
- if (type == 0) {
- doStateChange(&StateID_RealWalk);
- }
- else if (type == 1) {
- doStateChange(&StateID_Walk);
- }
- else if (type == 2) {
- doStateChange(&StateID_RealWalk);
- }
- else if (type == 3) {
- doStateChange(&StateID_Jump);
- }
- else if (type == 4) {
- doStateChange(&StateID_Judo);
- }
- else if (type == 5) {
- doStateChange(&StateID_Spike);
- }
- else {
- doStateChange(&StateID_RealWalk);
- }
+ doStateChange(&StateID_RealWalk);
}
}
void daShyGuy::endState_Recover() {