summaryrefslogtreecommitdiff
path: root/src/bossThwompaDomp.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/bossThwompaDomp.cpp179
1 files changed, 176 insertions, 3 deletions
diff --git a/src/bossThwompaDomp.cpp b/src/bossThwompaDomp.cpp
index 70a3d17..1c366b8 100644
--- a/src/bossThwompaDomp.cpp
+++ b/src/bossThwompaDomp.cpp
@@ -2,7 +2,173 @@
#include <game.h>
#include <g3dhax.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
+
+ 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
+
+class daEnMegaDosun_c : public daEnDosun_c {
+ //int onCreate(); // overload for mega
+ //int onExecute();
+ static daEnMegaDosun_c *build();
+
+ //int checkZoneBoundaries(int);
+
+ //FIXME
+ //USING_STATES(daEnMegaDosun_c);
+ //DECLARE_STATE(Wait);
+};
+
+daEnMegaDosun_c *daEnMegaDosun_c::build() {
+ void *buffer = AllocFromGameHeap1(sizeof(daEnMegaDosun_c));
+ return new(buffer) daEnMegaDosun_c;
+}
+
+#if 0
+int daEnMegaDosun_c::onCreate() {
+ //FIXME
+ this->bigOrSmall = 1; // 0=small,1=big,2=mega
+
+ this->setupBodyModel(); // add this for linking/rename
+
+ this->_36D = 0; // byte
+ this->holdsFromSettings = this->settings & 0xf; //0=normal,1=??,2=fall
+
+ this->frzMgr.setSomething(1,1,1); //@0x809f5c5c
+
+ this->pos.y -= 21.0;
+ this->pos.z = -280.0; // behind layer1 (hides spikes)
+
+ //FIXME might be u32 0x11804101
+ /*
+ this->collision_struct[0] = 0x11;
+ this->collision_struct[1] = 0x80;
+ this->collision_struct[2] = 0x41;
+ this->collision_struct[3] = 0x01;
+ */
+ this->collision_struct = 0x11804101;
+ this->_5C0 = 0xFFFE1000;
+ this->_5C4 = 0x1F000;
+ this->_5C8 = 0x5000;
+
+ /*
+ //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;
+ hm.yDistToCenter = 41.0;
+ hm.xDistToEdge = 36.0;
+ hm.yDistToEdge = 38.0;
+ hm.category1 = 0x03;
+ hm.category2 = 0x00;
+ hm.bitfield1 = 0x0000004F;
+ hm.bitfield2 = 0x0000820E;
+ hm.unkShort1C = 0x0100;
+ hm.callback = &dEn_c::collisionCallback;
+ 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};
+ //FIXME 0x80ACF990 + 0x58 = 80acf9e8
+ this->collMgr.Init(this,(u8*)&this->collision_struct,(u8*)&s3,0);
+
+ this->pos_delta2.x = 0.0;
+ this->pos_delta2.y = 36.0;
+ this->pos_delta2.z = 0.0;
+ this->_320 = 0.0;
+ this->_324 = 48.0;
+
+ this->aPhysics.addToList();
+
+ this->scale.x = 1.0;
+ this->scale.y = 1.0;
+ this->scale.z = 1.0;
+ this->max_speed.x = 0.0;
+ this->max_speed.y = -8.0;
+ this->max_speed.z = 0.0;
+ this->y_speed_inc = -0.25;
+ this->rot.x = 0;
+ this->rot.y = 0;
+ this->rot.z = 0;
+
+ // check settings bit
+ if(this->holdsFromSettings == 2) {
+ this->doStateChange(&StateID_DownMove_Kameck);
+ }else{
+ this->doStateChange(&StateID_UpWait);
+ }
+
+ return 1;
+}
+#endif
+
+#if 0
+int daEnMegaDosun_c::onExecute() {
+
+ acState.execute();
+
+ //FIXME change to do outro when leaving screen
+ //this->checkZoneBoundaries(0);
+
+ return 1;
+}
+#endif
+
+//FIXME
+#if 0
+int daEnMegaDosun_c::checkZoneBoundaries(int foo) {
+ if(this->_36C == 2) { // is eaten
+ return 0;
+ }
+
+ if( (0 == (foo&0x8)) && \
+ (this->collMgr.checkBits15and16ofBitfield() != 0) ) {
+ return 0;
+ }
+
+ int ret = 0;
+
+#if 0
+ Rect tempRect = (Rect){this->_320, this->_324,
+ 0.5 * this->spriteSomeRectX, 0.5 * this->spriteSomeRectY};
+ Rect tempRect2 = (Rect){_338, _33C, _340, _344};
+ if(this->s800064da0(pos, &tempRect, currentZoneId) ||
+ (!(foo&0x4) && s_800b56e0(pos, &tempRect, &tempRect2, currentZoneId)) )
+ {
+ ret = 1;
+ }
+#endif
+
+ if(ret && !(foo & 0x2))
+ this->Delete(this->_390);
+
+ return ret;
+}
+#endif
+
+#if 0
extern "C" bool CollidedWithTile(u8 *);
extern "C" void *SomeStrangeModification(dEn_c *);
@@ -14,9 +180,9 @@ void ThwompaDompMoveC(dEn_c *Sprite) {
bool SecondCheck;
// Check for collisions with walls?
- FirstCheck = CollidedWithTile(Sprite->classAt1EC);
+ FirstCheck = CollidedWithTile(Sprite->collMgr);
SomeStrangeModification(Sprite);
- SecondCheck = CollidedWithTile(Sprite->classAt1EC);
+ SecondCheck = CollidedWithTile(Sprite->collMgr);
OSReport("XPos = %f, FirstCheck = %d, SecondCheck = %d", Sprite->pos.x, FirstCheck, SecondCheck);
@@ -42,4 +208,11 @@ void ThwompaDompMoveC(dEn_c *Sprite) {
return;
-} \ No newline at end of file
+}
+#endif
+
+/*
+class daYoshi_c : public dStageActor_c {
+ u32 _1520; // holds actorID of actor eaten
+};
+*/