diff options
-rwxr-xr-x | include/game.h | 34 | ||||
-rw-r--r-- | kamek_pal.x | 4 | ||||
-rw-r--r-- | src/bossPodouble.cpp | 25 |
3 files changed, 62 insertions, 1 deletions
diff --git a/include/game.h b/include/game.h index d706a4c..9e119d5 100755 --- a/include/game.h +++ b/include/game.h @@ -2727,6 +2727,38 @@ public: +struct dWaterInfo_s {
+ float x, y, z, width, height;
+ int isInUse;
+ u8 type, layer;
+};
+
+class dWaterManager_c {
+ private:
+ dWaterInfo_s blocks[80];
+ public:
+ float current;
+
+ static dWaterManager_c *instance;
+
+ dWaterManager_c() { instance = this; }
+ ~dWaterManager_c() { instance = 0; }
+
+ void setup();
+ int addBlock(dWaterInfo_s *block);
+
+ private: // ?
+ int isPointWithinSpecifiedBlock(VEC2 *pos, int blockID);
+ int getAngleOfVector(VEC2 *vec);
+ int isPointWithinBubbleInternal(VEC2 *pos, int blockID, VEC2 *pOutVec, float *pFloat, s16 *pShort);
+
+ public:
+ int queryPosition(VEC2 *pos, VEC2 *pOutBlockPos, float *pOutFloat, s16 *pOutAngle, int layer);
+ int isPositionWithinBubble(VEC2 *pos, VEC2 *pOutBlockPos, int blockID, int layer);
+ void removeBlock(int blockID);
+ void setPosition(VEC3 *pos, int blockID);
+ void setGeometry(VEC3 *pos, float width, float height, int blockID);
+};
class BgGmBase : public dBase_c {
public:
@@ -2736,6 +2768,8 @@ public: // Note: these tile numbers are kinda weird and involve GetTileFromTileTable
void placeTile(u16 x, u16 y, int layer, int tile);
+
+ void makeSplash(float x, float y, int type); // 80078410
};
diff --git a/kamek_pal.x b/kamek_pal.x index 9161ef1..792c1b8 100644 --- a/kamek_pal.x +++ b/kamek_pal.x @@ -2,6 +2,9 @@ SECTIONS { getYoshi__7dAcPy_cFv = 0x80139A90; setFlag__14dPlayerInput_cFQ214dPlayerInput_c5Flags = 0x8005E3B0; + instance__15dWaterManager_c = 0x8042A3E0; + queryPosition__15dWaterManager_cFP7Point2dP7Point2dPfPsi = 0x800EBA40; + OriginalPowBlockActivated = 0x800A0C70; isReplayEnabled = 0x80002EEE; @@ -757,6 +760,7 @@ SECTIONS { getPointerToTile__8BgGmBaseFiiiPib = 0x80077520; placeTile__8BgGmBaseFUsUsii = 0x80077860; + makeSplash__8BgGmBaseFffi = 0x80078410; add__Q212TileRenderer4ListFP12TileRenderer = 0x80014820; remove__Q212TileRenderer4ListFP12TileRenderer = 0x80014860; diff --git a/src/bossPodouble.cpp b/src/bossPodouble.cpp index dae1426..22a3628 100644 --- a/src/bossPodouble.cpp +++ b/src/bossPodouble.cpp @@ -286,7 +286,30 @@ int daPodouble::onDelete() { int daPodouble::onExecute() { acState.execute(); - + + float diff = 8.57f * scale.x; + float checkY = pos.y - diff, checkLastY = last_pos.y - diff; + + VEC2 myPos = {pos.x, checkY}; + VEC2 outBlockPos; + float outFloat; + s16 outAngle; + int result = dWaterManager_c::instance->queryPosition(&myPos, &outBlockPos, &outFloat, &outAngle, currentLayerID); + + if ((!isFire && result == 0) || (isFire && result == 1)) { + if ((checkLastY <= outFloat && outFloat < checkY) || (checkY <= outFloat && outFloat < checkLastY)) { + VEC3 efPos = {pos.x, checkY, 6500.0f}; + VEC3 efScale = {scale.x * 0.7f, scale.y * 0.7f, scale.z * 0.7f}; + SpawnEffect(isFire ? "Wm_en_magmawave" : "Wm_en_waterwave_in", 0, &efPos, 0, &efScale); + + if (checkLastY <= outFloat && outFloat < checkY) { + dBgGm_c::instance->makeSplash(pos.x, checkY, 0x11); + } else { + dBgGm_c::instance->makeSplash(pos.x, checkY, 0x10); + } + } + } + return true; } |