summaryrefslogtreecommitdiff
path: root/src/bossThwompaDomp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bossThwompaDomp.cpp')
-rw-r--r--src/bossThwompaDomp.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/bossThwompaDomp.cpp b/src/bossThwompaDomp.cpp
index 860fb90..1d94744 100644
--- a/src/bossThwompaDomp.cpp
+++ b/src/bossThwompaDomp.cpp
@@ -29,7 +29,7 @@ class daEnMegaDosun_c : public daBoss {
m3d::mdl_c bodyModel; // _544
m3d::anmVis_c anmVis; // _584
- u32 collision_struct[4]; // _5BC
+ lineSensor_s belowSensor;
float shakePosXoffset; // _5CC shakePosXoffset
u16 puruMoveCounter; // _5D8
u16 shakeIndex; // _5DA 0=shake,1=normal
@@ -122,10 +122,12 @@ int daEnMegaDosun_c::onCreate() {
this->pos.y -= 21.0;
this->pos.z = -280.0; // behind layer1 (hides spikes)
- this->collision_struct[0] = 0x11804101;
- this->collision_struct[1] = 0xFFFE1000;
- this->collision_struct[2] = 0x0001F000;
- this->collision_struct[3] = 0x00005000;
+ belowSensor.flags =
+ SENSOR_10000000 | SENSOR_1000000 | SENSOR_BREAK_BRICK |
+ SENSOR_BREAK_BLOCK | SENSOR_100 | SENSOR_LINE;
+ belowSensor.lineA = -31 << 12;
+ belowSensor.lineB = 31 << 12;
+ belowSensor.distanceFromCenter = 5 << 12;
ActivePhysics::Info hm;
hm.xDistToCenter = 0.0;
@@ -140,9 +142,8 @@ int daEnMegaDosun_c::onCreate() {
hm.callback = &dEn_c::collisionCallback;
this->aPhysics.initWithStruct(this, &hm);
- //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};
- this->collMgr.Init(this,(u8*)&this->collision_struct,(u8*)&s3,0);
+ lineSensor_s aboveSensor(-31 << 12, 31 << 12, -31 << 12);
+ this->collMgr.init(this, &belowSensor, &aboveSensor, 0);
this->pos_delta2.x = 0.0;
this->pos_delta2.y = 36.0;
@@ -247,7 +248,9 @@ int daEnMegaDosun_c::onDelete() {
// StateID_UpWait
void daEnMegaDosun_c::beginState_UpWait() {
- this->collision_struct[0] = 0x11804101;
+ belowSensor.flags =
+ SENSOR_10000000 | SENSOR_1000000 | SENSOR_BREAK_BRICK |
+ SENSOR_BREAK_BLOCK | SENSOR_100 | SENSOR_LINE;
this->timer = 0;
}
void daEnMegaDosun_c::executeState_UpWait() {
@@ -337,7 +340,7 @@ int daEnMegaDosun_c::onDelete() {
this->UpdateObjectPosBasedOnSpeedValuesReal();
//FIXME what do I do? - bottom detection
- int ret = this->collMgr.execute();
+ int ret = this->collMgr.calculateBelowCollisionWithSmokeEffect();
if(!ret)
return;
@@ -349,10 +352,10 @@ int daEnMegaDosun_c::onDelete() {
PlaySoundAsync(this, SE_EMY_BIG_DOSSUN);
}
else {
- this->collision_struct[0] = 0x00000001;
+ belowSensor.flags = SENSOR_LINE;
this->speed.y = 0.0;
ShakeScreen(ScreenPositionClass, 0, 1, 0, 0);
- this->collMgr.Clear2();
+ this->collMgr.clear2();
PlaySoundAsync(this, SE_EMY_BIG_DOSSUN);
}
@@ -388,7 +391,7 @@ int daEnMegaDosun_c::onDelete() {
// StateID_UpMove
void daEnMegaDosun_c::beginState_UpMove() {
- this->collMgr.Clear2();
+ this->collMgr.clear2();
}
void daEnMegaDosun_c::executeState_UpMove() {
// this->speed.y = 0.0;