From 8f4edaa7abf19844bf93a369750486428c370384 Mon Sep 17 00:00:00 2001 From: Treeki Date: Sun, 10 Feb 2013 01:04:31 +0100 Subject: podouble splashes --- src/bossPodouble.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src') 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; } -- cgit v1.2.3