1
0
mirror of https://github.com/jummy0/sb2-decomp synced 2025-03-15 04:24:48 +01:00
sb2-decomp/src/decblupi.cpp

4194 lines
98 KiB
C++
Raw Normal View History

// DecBlupi.cpp
//
#include "misc.h"
#include "decor.h"
2024-10-06 01:07:18 -05:00
#include "text.h" // debug
//#include "resource.h"
2024-08-31 23:22:24 -05:00
#include "dectables.h"
2024-09-29 00:58:24 -05:00
// get the graphics channel corresponding to Blupi's team
// (for Personal bomb, etc)
2024-08-31 23:22:24 -05:00
int CDecor::GetBlupiChannelStandard()
{
2024-08-31 23:22:24 -05:00
if (m_bMulti && m_blupiChannel == CHBLUPI && m_team > 0) {
return m_team + CHBLUPI1 - 1;
}
2024-09-29 00:58:24 -05:00
else return m_blupiChannel;
2024-08-31 23:22:24 -05:00
}
2024-09-29 00:58:24 -05:00
// get Blupi's current graphics channel
// (changes for certain effects such as burned or glued)
2024-08-31 23:22:24 -05:00
int CDecor::GetBlupiChannelActual()
{
if (m_bMulti && m_team > 0) {
return m_team + CHBLUPI1 - 1;
}
2024-09-29 00:58:24 -05:00
else return CHBLUPI;
2024-08-31 23:22:24 -05:00
}
2024-09-29 00:58:24 -05:00
// get various flags relating to Blupi's current state
2024-08-31 23:22:24 -05:00
void CDecor::GetBlupiInfo(BOOL* bHelico, BOOL* bJeep, BOOL* bSkate, BOOL* bNage)
{
*bHelico = m_blupiHelico;
*bJeep = m_blupiJeep | m_blupiTank;
*bSkate = m_blupiSkate;
*bNage = m_blupiNage | m_blupiSurf;
}
2024-10-06 01:07:18 -05:00
// set blupi's current graphics icon according to his state
// from ghidra
2024-08-31 23:22:24 -05:00
void CDecor::BlupiSearchIcon()
2024-10-06 01:07:18 -05:00
2024-08-31 23:22:24 -05:00
{
2024-10-06 01:07:18 -05:00
int phase;
int action = m_blupiAction;
int icon = 2;
if (m_blupiVent && !m_blupiHelico && !m_blupiOver)
2024-08-31 23:22:24 -05:00
{
if (action == ACTION_STOP) action = ACTION_VERTIGO;
if (action == ACTION_MARCH) action = ACTION_PUSH;
2024-08-31 23:22:24 -05:00
}
2024-10-06 01:07:18 -05:00
2024-08-31 23:22:24 -05:00
if (m_blupiHelico)
{
if (action == ACTION_STOP) action = ACTION_STOPHELICO;
if (action == ACTION_MARCH) action = ACTION_MARCHHELICO;
if (action == ACTION_TURN) action = ACTION_TURNHELICO;
if (action == ACTION_ADVANCE) action = ACTION_STOPHELICO;
if (action == ACTION_RECEDE) action = ACTION_STOPHELICO;
2024-08-31 23:22:24 -05:00
}
2024-10-06 01:07:18 -05:00
2024-08-31 23:22:24 -05:00
if (m_blupiOver)
{
if (action == ACTION_STOP) action = ACTION_STOPOVER;
if (action == ACTION_MARCH) action = ACTION_MARCHOVER;
if (action == ACTION_TURN) action = ACTION_TURNOVER;
if (action == ACTION_ADVANCE) action = ACTION_STOPOVER;
if (action == ACTION_RECEDE) action = ACTION_STOPOVER;
2024-08-31 23:22:24 -05:00
}
2024-10-06 01:07:18 -05:00
2024-08-31 23:22:24 -05:00
if (m_blupiJeep)
{
if (action == ACTION_STOP) action = ACTION_STOPJEEP;
if (action == ACTION_MARCH) action = ACTION_MARCHJEEP;
if (action == ACTION_ADVANCE) action = ACTION_MARCHJEEP;
if (action == ACTION_TURN) action = ACTION_TURNJEEP;
2024-08-31 23:22:24 -05:00
}
2024-10-06 01:07:18 -05:00
2024-08-31 23:22:24 -05:00
if (m_blupiTank)
{
if (action == ACTION_STOP) action = ACTION_STOPTANK;
if (action == ACTION_MARCH) action = ACTION_MARCHTANK;
if (action == ACTION_ADVANCE) action = ACTION_MARCHTANK;
if (action == ACTION_TURN) action = ACTION_TURNTANK;
2024-10-06 01:07:18 -05:00
}
if (m_blupiSkate)
{
if (action == ACTION_STOP) action = ACTION_STOPSKATE;
if (action == ACTION_MARCH) action = ACTION_MARCHSKATE;
if (action == ACTION_ADVANCE) action = ACTION_MARCHSKATE;
if (action == ACTION_TURN) action = ACTION_TURNSKATE;
if (action == ACTION_TURNAIR) action = ACTION_TURNSKATE;
if (action == ACTION_JUMP) action = ACTION_JUMPSKATE;
if (action == ACTION_AIR) action = ACTION_AIRSKATE;
2024-10-06 01:07:18 -05:00
}
if (m_blupiNage)
{
if (action == ACTION_STOP) action = ACTION_STOPNAGE;
if (action == ACTION_MARCH) action = ACTION_MARCHNAGE;
if (action == ACTION_TURN) action = ACTION_TURNNAGE;
if (m_blupiVitesse.x == 0)
2024-08-31 23:22:24 -05:00
{
if (action == ACTION_STOPNAGE) action = ACTION_STOPSURF;
if (action == ACTION_MARCHNAGE) action = ACTION_MARCHSURF;
2024-08-31 23:22:24 -05:00
}
2024-10-06 01:07:18 -05:00
}
if (m_blupiSurf)
{
if (action == ACTION_STOP) action = ACTION_STOPSURF;
if (action == ACTION_MARCH) action = ACTION_MARCHSURF;
if (action == ACTION_TURN) action = ACTION_TURNSURF;
2024-10-06 01:07:18 -05:00
}
if (m_blupiSuspend)
{
if (action == ACTION_STOP) action = ACTION_STOPSUSPEND;
if (action == ACTION_MARCH) action = ACTION_MARCHSUSPEND;
if (action == ACTION_TURN) action = ACTION_TURNSUSPEND;
if (action == ACTION_JUMP) action = ACTION_JUMPSUSPEND;
2024-10-06 01:07:18 -05:00
}
if (m_blupiBalloon) action = ACTION_BALLOON;
2024-10-06 01:07:18 -05:00
if (m_blupiEcrase)
{
if (action == ACTION_STOP) action = ACTION_STOPECRASE;
if (action == ACTION_MARCH) action = ACTION_MARCHECRASE;
if (action == ACTION_TURN) action = ACTION_MARCHECRASE;
2024-10-06 01:07:18 -05:00
}
if (action == ACTION_STOP)
{
phase = m_blupiPhase % 330;
if (phase == 125 ||
phase == 129 ||
phase == 135 ||
phase == 139 ||
phase == 215 ||
phase == 219 ||
phase == 225 ||
phase == 229 ||
phase == 235 ||
phase == 239 ||
phase == 245 ||
phase == 249 ||
phase == 255 ||
phase == 259 ||
phase == 265 ||
phase == 269)
{
PlaySound(SOUND_PATIENT, m_blupiPos, FALSE);
}
2024-10-06 01:07:18 -05:00
}
if ((action == 0x1f) && (((phase = m_blupiPhase % 328, phase == 0x76 || (phase == 0xe6)) || (phase == 0x116))))
{
PlaySound(SOUND_SINGE, m_blupiPos, FALSE);
}
if ((((action == 0x15) || (action == 0x16)) && (m_blupiPhase % 0xc == 0)) && (m_blupiSurf))
{
MoveObjectTiplouf(m_blupiPos);
}
for (int i = 0; table_blupi[i] != 0; i += table_blupi[i + 1] + 3)
{
if (action == table_blupi[i])
2024-08-31 23:22:24 -05:00
{
phase = table_blupi[i + 2];
if (phase == 0 || m_blupiPhase <= phase)
2024-10-06 01:07:18 -05:00
{
phase = m_blupiPhase % table_blupi[i + 1];
2024-10-06 01:07:18 -05:00
}
icon = table_blupi[i + 3 + phase];
2024-10-06 01:07:18 -05:00
break;
2024-08-31 23:22:24 -05:00
}
2024-10-06 01:07:18 -05:00
}
if ((action == 0xb || action == 0x4b || action == 0x4c || action == 0x36 || action == 0x39) && icon < 0x10a)
{
m_blupiChannel = 10;
}
else
{
m_blupiChannel = 2;
}
if (m_blupiDir == DIR_LEFT || (m_blupiDir == DIR_RIGHT && m_blupiInvert))
{
if (m_blupiChannel == 2)
2024-08-31 23:22:24 -05:00
{
2024-10-06 01:07:18 -05:00
if (action == 0x1f)
{
if (icon == 0x90)
{
icon = 0x9e;
}
if (icon == 0x8f)
{
icon = 0x91;
}
if (icon == 0x97)
{
icon = 0x92;
}
}
if ((-1 < icon) && (icon < 0x14f))
{
icon = table_mirror[icon];
}
2024-08-31 23:22:24 -05:00
}
2024-10-06 01:07:18 -05:00
if (true && m_blupiChannel == 10 && 0xa7 < icon && icon < 0xac)
2024-08-31 23:22:24 -05:00
{
2024-10-06 01:07:18 -05:00
icon = (icon + 4);
2024-08-31 23:22:24 -05:00
}
}
2024-10-06 01:07:18 -05:00
m_blupiIcon = icon;
m_blupiPhase = m_blupiPhase + 1;
2024-08-31 23:22:24 -05:00
}
2024-06-06 10:54:21 -04:00
2024-08-31 23:22:24 -05:00
BOOL CDecor::BlupiIsGround()
{
if (m_blupiTransport == -1)
{
RECT rect = BlupiRect(m_blupiPos);
rect.top = m_blupiPos.y + DIMBLUPIY - 2;
rect.bottom = m_blupiPos.y + DIMBLUPIY - 1;
return DecorDetect(rect, TRUE);
}
else {
return FALSE;
}
}
2024-06-06 10:54:21 -04:00
2024-09-29 00:58:24 -05:00
// get Blupi's hitbox according to his state
2024-08-31 23:22:24 -05:00
RECT CDecor::BlupiRect(POINT pos)
{
RECT result;
if (m_blupiNage || m_blupiSurf)
{
result.left = pos.x + 12;
result.right = pos.x + DIMBLUPIX - 12;
if (m_blupiAction == ACTION_STOP)
{
result.top = pos.y + 5;
result.bottom = pos.y + DIMBLUPIY - 10;
}
else
{
result.top = pos.y + 15;
result.bottom = pos.y + DIMBLUPIY - 10;
}
}
else if (m_blupiJeep)
{
result.left = pos.x + 2;
result.right = pos.x + DIMBLUPIX - 2;
result.top = pos.y + 10;
result.bottom = pos.y + DIMBLUPIY - 2;
}
else if (m_blupiTank)
{
result.left = pos.x + 2;
result.right = pos.x + DIMBLUPIX - 2;
result.top = pos.y + 10;
result.bottom = pos.y + DIMBLUPIY - 2;
}
else if (m_blupiOver)
{
result.left = pos.x + 2;
result.right = pos.x + DIMBLUPIX - 2;
result.top = pos.y + 2;
result.bottom = pos.y + DIMBLUPIY - 2;
}
else if (m_blupiBalloon)
{
result.left = pos.x + 10;
result.right = pos.x + DIMBLUPIX - 10;
result.top = pos.y + 5;
result.bottom = pos.y + DIMBLUPIY - 2;
}
else if (m_blupiEcrase)
{
result.left = pos.x + 5;
result.right = pos.x + DIMBLUPIX - 5;
result.top = pos.y + 39;
result.bottom = pos.y + DIMBLUPIY - 2;
}
else
{
result.left = pos.x + 12;
result.right = pos.x + DIMBLUPIX - 12;
result.top = pos.y + 11;
result.bottom = pos.y + DIMBLUPIY - 2;
}
return result;
}
2024-10-05 17:42:17 -05:00
// prevent blupi from getting stuck in blocks
2024-08-31 23:22:24 -05:00
void CDecor::BlupiAdjust()
{
2024-10-15 13:41:43 -05:00
int i;
2024-08-31 23:22:24 -05:00
RECT tinyRect = BlupiRect(m_blupiPos);
2024-09-29 00:58:24 -05:00
if (!DecorDetect(tinyRect))
2024-08-31 23:22:24 -05:00
{
return;
}
2024-10-15 13:41:43 -05:00
for (i = 0; i < 50; i++)
2024-08-31 23:22:24 -05:00
{
RECT rect = tinyRect;
rect.bottom = rect.top + 2;
rect.left = m_blupiPos.x + 12;
rect.right = m_blupiPos.x + 60 - 12;
2024-09-29 00:58:24 -05:00
if (!DecorDetect(rect))
2024-08-31 23:22:24 -05:00
{
break;
}
tinyRect.top += 2;
tinyRect.bottom += 2;
m_blupiPos.y = m_blupiPos.y + 2;
}
2024-10-15 13:41:43 -05:00
for (i = 0; i < 50; i++)
2024-08-31 23:22:24 -05:00
{
RECT rect = tinyRect;
rect.right = rect.left + 2;
rect.top = m_blupiPos.y + 11;
rect.bottom = m_blupiPos.y + 60 - 2;
2024-09-29 00:58:24 -05:00
if (!DecorDetect(rect))
2024-08-31 23:22:24 -05:00
{
break;
}
tinyRect.left += 2;
tinyRect.right += 2;
m_blupiPos.x = m_blupiPos.x + 2;
}
2024-10-15 13:41:43 -05:00
for (i = 0; i < 50; i++)
2024-08-31 23:22:24 -05:00
{
RECT rect = tinyRect;
rect.left = rect.right - 2;
rect.top = m_blupiPos.y + 11;
rect.bottom = m_blupiPos.y + 60 - 2;
2024-09-29 00:58:24 -05:00
if (!DecorDetect(rect))
2024-08-31 23:22:24 -05:00
{
break;
}
tinyRect.left -= 2;
tinyRect.right -= 2;
m_blupiPos.x = m_blupiPos.x - 2;
}
2024-10-15 13:41:43 -05:00
for (i = 0; i < 50; i++)
2024-08-31 23:22:24 -05:00
{
RECT rect = tinyRect;
rect.right = rect.left + 2;
2024-09-29 00:58:24 -05:00
if (!DecorDetect(rect))
2024-08-31 23:22:24 -05:00
{
break;
}
tinyRect.left += 2;
tinyRect.right += 2;
m_blupiPos.x = m_blupiPos.x + 2;
}
2024-10-15 13:41:43 -05:00
for (i = 0; i < 50; i++)
2024-08-31 23:22:24 -05:00
{
RECT rect = tinyRect;
rect.left = rect.right - 2;
2024-09-29 00:58:24 -05:00
if (!DecorDetect(rect))
2024-08-31 23:22:24 -05:00
{
return;
}
tinyRect.left -= 2;
tinyRect.right -= 2;
m_blupiPos.x = m_blupiPos.x - 2;
}
}
BOOL CDecor::BlupiBloque(POINT pos, int dir)
{
RECT rect = BlupiRect(pos);
rect.top = rect.bottom - 20;
rect.bottom -= 2;
if (dir > 0)
{
rect.left = rect.right - 2;
}
if (dir < 0)
{
rect.right = rect.left + 2;
}
return DecorDetect(rect);
2024-06-06 10:54:21 -04:00
}
2024-08-31 23:22:24 -05:00
2024-09-29 00:58:24 -05:00
// handle Blupi's movement and current state.
2024-08-31 23:22:24 -05:00
void CDecor::BlupiStep()
{
2024-10-05 17:42:17 -05:00
BOOL bNear;
int icon;
2024-08-31 23:22:24 -05:00
POINT tinyPoint;
2024-09-12 12:48:11 -05:00
POINT tinyPoint2 = m_blupiPos; // = m_blupiPos ?
2024-08-31 23:22:24 -05:00
BlupiAdjust();
//m_blupiLastPos = m_blupiPos;
2024-10-05 17:42:17 -05:00
POINT end = m_blupiPos;
int lastBlupiAction = m_blupiAction;
2024-10-06 01:07:18 -05:00
BOOL bLastBlupiAir = m_blupiAir;
BOOL bAirStart = FALSE;
BOOL bIsOpen = FALSE;
BOOL bIsOpen2 = FALSE;
int num;
2024-10-05 17:42:17 -05:00
end.x += m_blupiVector.x;
end.y += m_blupiVector.y;
2024-08-31 23:22:24 -05:00
RECT rect;
if (m_blupiVector.x != 0 || m_blupiVector.y != 0)
{
rect = BlupiRect(m_blupiPos);
rect.top = m_blupiPos.y + 11;
2024-10-05 17:42:17 -05:00
rect.bottom = m_blupiPos.y + DIMBLUPIY - 2;
TestPath(rect, m_blupiPos, &end);
2024-08-31 23:22:24 -05:00
}
m_blupiVent = FALSE;
if (m_blupiTransport == -1 && !m_blupiJeep && !m_blupiTank && !m_blupiSkate
&& m_blupiFocus)
{
2024-10-05 17:42:17 -05:00
num = m_decor[(end.x + DIMBLUPIX / 2) / DIMOBJX][(end.y + DIMBLUPIY / 2) / DIMOBJY].icon;
2024-08-31 23:22:24 -05:00
if (num == 110)
{
2024-10-05 17:42:17 -05:00
end.x -= 9;
2024-08-31 23:22:24 -05:00
}
if (num == 114)
{
2024-10-05 17:42:17 -05:00
end.x += 9;
2024-08-31 23:22:24 -05:00
}
if (num == 118)
{
2024-10-05 17:42:17 -05:00
end.y -= 20;
2024-08-31 23:22:24 -05:00
}
if (num == 122)
{
2024-10-05 17:42:17 -05:00
end.y += 20;
2024-08-31 23:22:24 -05:00
}
if (num >= 110 && num <= 125)
{
m_blupiVent = TRUE;
rect.left = m_blupiPos.x + 12;
2024-10-05 17:42:17 -05:00
rect.right = m_blupiPos.x + DIMBLUPIX - 12;
2024-08-31 23:22:24 -05:00
rect.top = m_blupiPos.y + 11;
2024-10-05 17:42:17 -05:00
rect.bottom = m_blupiPos.y + DIMBLUPIY - 2;
TestPath(rect, m_blupiPos, &end);
2024-08-31 23:22:24 -05:00
}
}
2024-09-23 20:35:15 -05:00
m_blupiVent = FALSE;
2024-08-31 23:22:24 -05:00
if (m_blupiTransport == -1)
{
2024-10-05 17:42:17 -05:00
rect = BlupiRect(end);
rect.top = end.y + DIMBLUPIY - 2;
rect.bottom = end.y + DIMBLUPIY - 1;
2024-10-06 01:07:18 -05:00
bAirStart = !DecorDetect(rect);
2024-08-31 23:22:24 -05:00
}
else
{
2024-10-06 01:07:18 -05:00
bAirStart = FALSE;
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
rect = BlupiRect(end);
rect.top = end.y + 10;
rect.bottom = end.y + 20;
2024-08-31 23:22:24 -05:00
int detectIcon = m_detectIcon;
2024-10-05 17:42:17 -05:00
if (!m_blupiAir &&
!IsBlupiMotorVehicle() &&
!m_blupiBalloon &&
!m_blupiEcrase &&
!m_blupiNage &&
!m_blupiSurf &&
!m_blupiSuspend &&
m_blupiFocus &&
2024-10-06 01:07:18 -05:00
bAirStart)
2024-08-31 23:22:24 -05:00
{
if (m_blupiFocus)
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_AIR;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
m_blupiVitesse.y = 1;
2024-10-05 17:42:17 -05:00
m_blupiAir = TRUE;
2024-10-06 01:07:18 -05:00
bLastBlupiAir = TRUE;
2024-10-05 17:42:17 -05:00
}
if (!m_blupiNage &&
!m_blupiSurf &&
!m_blupiSuspend &&
!m_blupiAir &&
IsRessort(end))
{
if (IsBlupiVehicle() &&
!m_blupiShield &&
!m_blupiHide &&
!m_bSuperBlupi)
{
m_blupiHelico = FALSE;
m_blupiOver = FALSE;
m_blupiJeep = FALSE;
m_blupiTank = FALSE;
m_blupiSkate = FALSE;
tinyPoint.x = end.x - 34;
tinyPoint.y = end.y - 34;
ObjectStart(tinyPoint, TYPE_EXPLO2, 0);
2024-08-31 23:22:24 -05:00
m_decorAction = 1;
m_decorPhase = 0;
2024-10-05 17:42:17 -05:00
StopVehicleSound();
PlaySound(SOUND_BOUM, m_blupiPos);
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_blupiFocus && !IsDeadAction(m_blupiAction))
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_AIR;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
if (m_keyPress & KEY_LEFT && m_blupiFocus) // this is wrong
2024-08-31 23:22:24 -05:00
{
m_blupiVitesse.y = (m_blupiPower ? -25 : -19);
}
else
{
m_blupiVitesse.y = (m_blupiPower ? -16 : -10);
}
2024-10-05 17:42:17 -05:00
m_blupiAir = TRUE;
2024-10-06 01:07:18 -05:00
bLastBlupiAir = TRUE;
2024-10-05 17:42:17 -05:00
PlaySound(SOUND_RESSORT, end);
}
2024-10-06 01:07:18 -05:00
if (m_keyPress & KEY_JUMP &&
2024-10-05 17:42:17 -05:00
!IsBlupiMotorVehicle() &&
!m_blupiBalloon &&
!m_blupiEcrase &&
!m_blupiNage &&
!m_blupiSurf &&
!m_blupiSuspend
&& m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiAction != ACTION_JUMP &&
m_blupiAction != ACTION_TURN &&
!m_blupiAir)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_JUMP;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_JUMP && m_blupiPhase == 3)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_AIR;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
if (m_blupiSkate)
{
2024-10-05 17:42:17 -05:00
PlaySound(SOUND_JUMP1, end);
2024-10-06 01:07:18 -05:00
m_blupiVitesse.y = (m_blupiPower ? -22 : -16);
2024-08-31 23:22:24 -05:00
}
else
2024-10-05 17:42:17 -05:00
{
2024-09-23 20:35:15 -05:00
if (m_keyPress & KEY_UP)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
PlaySound(SOUND_JUMP2, end);
2024-10-06 01:07:18 -05:00
m_blupiVitesse.y = (m_blupiPower ? -26 : -22);
}
else if (m_keyPress & KEY_DOWN)
{
PlaySound(SOUND_JUMP0, end);
m_blupiVitesse.y = (m_blupiPower ? -16 : -12);
2024-08-31 23:22:24 -05:00
}
else
{
2024-10-05 17:42:17 -05:00
PlaySound(SOUND_JUMP1, end);
2024-10-06 01:07:18 -05:00
m_blupiVitesse.y = (m_blupiPower ? -22 : -16);
2024-08-31 23:22:24 -05:00
}
}
2024-10-05 17:42:17 -05:00
m_blupiAir = TRUE;
2024-10-06 01:07:18 -05:00
bLastBlupiAir = TRUE;
2024-08-31 23:22:24 -05:00
}
}
if (m_blupiAir)
{
2024-10-05 17:42:17 -05:00
if (DecorDetect(rect) && m_blupiVitesse.y < 0)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.y < -14 && !IsDeadAction(m_blupiAction) && !m_blupiSkate)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiJumpAie = TRUE;
PlaySound(SOUND_JUMPAIE, end);
2024-08-31 23:22:24 -05:00
}
else
{
2024-10-05 17:42:17 -05:00
PlaySound(SoundEnviron(SOUND_JUMPTOC, detectIcon), end);
2024-08-31 23:22:24 -05:00
}
m_blupiVitesse.y = 1;
}
2024-10-05 17:42:17 -05:00
end.y += m_blupiVitesse.y * 2;
2024-08-31 23:22:24 -05:00
if (m_blupiVitesse.y < 20)
{
m_blupiVitesse.y += 2;
}
2024-10-05 17:42:17 -05:00
rect = BlupiRect(end);
rect.top = end.y + DIMBLUPIY - 30;
rect.bottom = end.y + DIMBLUPIY - 1;
2024-08-31 23:22:24 -05:00
if (m_blupiVitesse.y >= 0 && DecorDetect(rect))
{
2024-10-05 17:42:17 -05:00
end.y = end.y / 32 * 32 + BLUPIOFFY;
if (!IsRessort(end))
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
PlaySound(SoundEnviron(SOUND_JUMPEND, m_detectIcon), end);
2024-08-31 23:22:24 -05:00
}
if (m_blupiFocus)
{
if (m_blupiVitesse.y > 20)
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_STOPJUMP; // ??
2024-08-31 23:22:24 -05:00
}
else
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_STOPJUMP;
2024-08-31 23:22:24 -05:00
}
m_blupiPhase = 0;
}
2024-10-05 17:42:17 -05:00
m_blupiAir = FALSE;
2024-08-31 23:22:24 -05:00
if (m_blupiJumpAie)
{
2024-10-05 17:42:17 -05:00
m_blupiJumpAie = FALSE;
m_blupiAction = ACTION_JUMPAIE;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
}
2024-10-05 17:42:17 -05:00
rect.left = end.x + 20;
rect.right = end.x + DIMBLUPIX - 20;
rect.top = end.y + DIMBLUPIY - 33;
rect.bottom = end.y + DIMBLUPIY - 1;
icon = AscenseurDetect(rect, m_blupiPos, end);
if (m_blupiVitesse.y >= 0 && icon != -1)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiTransport = icon;
2024-10-06 01:07:18 -05:00
bAirStart = FALSE;
PlaySound(SOUND_JUMPEND, end, FALSE);
end.y = m_moveObject[icon].posCurrent.y - DIMOBJY + BLUPIOFFY;
2024-08-31 23:22:24 -05:00
if (m_blupiFocus)
{
if (m_blupiVitesse.y > 20)
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_STOPJUMP; // ???
2024-08-31 23:22:24 -05:00
}
else
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_STOPJUMP;
2024-08-31 23:22:24 -05:00
}
m_blupiPhase = 0;
}
2024-10-05 17:42:17 -05:00
m_blupiAir = FALSE;
2024-08-31 23:22:24 -05:00
if (m_blupiJumpAie)
{
2024-10-05 17:42:17 -05:00
m_blupiJumpAie = FALSE;
m_blupiAction = ACTION_JUMPAIE;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
}
2024-10-05 17:42:17 -05:00
} // if (m_blupiAir)
switch (m_blupiAction)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
case ACTION_JUMPAIE:
if (m_blupiPhase == 30) StopBlupi(TRUE);
break;
case ACTION_CHARGE:
if (m_blupiPhase == 64)
{
StopBlupi(TRUE);
m_blupiCloud = TRUE;
m_blupiTimeShield = 100;
m_jauges[JAUGE_POWER].SetHide(FALSE);
PlaySound(ACTION_DRINK, end);
}
break;
case ACTION_HELICOGLU:
2024-08-31 23:22:24 -05:00
if (m_blupiPhase == 8)
{
tinyPoint.x = m_blupiPos.x;
tinyPoint.y = m_blupiPos.y + 40;
if (m_blupiVitesse.y > 0)
{
2024-10-05 17:42:17 -05:00
tinyPoint.y += m_blupiVitesse.y * 4;
2024-08-31 23:22:24 -05:00
}
m_blupiVitesse.y -= 10;
if (ObjectStart(tinyPoint, 23, 55) != -1)
{
PlaySound(52, m_blupiPos);
m_blupiTimeFire = 10;
m_blupiBullet--;
}
}
2024-10-05 17:42:17 -05:00
if (m_blupiPhase == 14) StopBlupi(TRUE);
break;
case ACTION_OUF1a:
case ACTION_OUF1b:
if (m_blupiPhase == 29) StopBlupi(TRUE);
break;
case ACTION_OUF2:
if (m_blupiPhase == 32) StopBlupi(TRUE);
break;
case ACTION_OUF3:
if (m_blupiPhase == 34) StopBlupi(TRUE);
break;
case ACTION_OUF4:
if (m_blupiPhase == 40)
{
StopBlupi(TRUE);
icon = MoveObjectDetect(end, &bNear);
if (icon != -1 && !bNear && end.y - BLUPIFLOOR == m_moveObject[num].posCurrent.y)
{
if (m_blupiDir == DIR_RIGHT && end.x < m_moveObject[num].posCurrent.x)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
tinyPoint.x = end.x - 16;
tinyPoint.y = end.y;
int num2 = MoveObjectDetect(tinyPoint, &bNear);
if (num2 == -1)
{
m_blupiAction = ACTION_RECEDE;
m_blupiPhase = 0;
}
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_blupiDir == DIR_LEFT && end.x > m_moveObject[num].posCurrent.x)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
tinyPoint.x = end.x + 16;
tinyPoint.y = end.y;
int num2 = MoveObjectDetect(tinyPoint, &bNear);
if (num2 == -1)
{
m_blupiAction = ACTION_RECEDE;
m_blupiPhase = 0;
}
2024-08-31 23:22:24 -05:00
}
}
}
2024-10-05 17:42:17 -05:00
break;
case ACTION_OUF5:
if (m_blupiPhase == 4) PlaySound(SOUND_OUF2, m_blupiPos);
if (m_blupiPhase == 44) StopBlupi(TRUE);
break;
case ACTION_MOCKERY:
2024-08-31 23:22:24 -05:00
if (m_blupiPhase == 1)
{
2024-10-05 17:42:17 -05:00
PlaySound(SOUND_MOCKERY, m_blupiPos);
2024-08-31 23:22:24 -05:00
m_blupiTimeMockery = 300;
}
2024-10-05 17:42:17 -05:00
if (m_blupiPhase == 92) StopBlupi(TRUE);
break;
case ACTION_MOCKERYi:
2024-08-31 23:22:24 -05:00
if (m_blupiPhase == 6)
{
2024-10-05 17:42:17 -05:00
PlaySound(SOUND_MOCKERY, m_blupiPos);
2024-08-31 23:22:24 -05:00
m_blupiTimeMockery = 300;
}
2024-10-05 17:42:17 -05:00
if (m_blupiPhase == 104) StopBlupi(TRUE);
break;
case ACTION_MOCKERYp:
if (m_blupiPhase == 4) PlaySound(SOUND_OUF2, m_blupiPos);
if (m_blupiPhase == 60) StopBlupi(TRUE);
break;
case ACTION_NON:
if (m_blupiPhase == 18) StopBlupi(TRUE);
break;
case ACTION_STOPMARCH:
if (m_blupiPhase == 3) StopBlupi();
break;
case ACTION_STOPJUMP:
if (m_blupiPhase == 5) StopBlupi();
break;
case ACTION_STOPJUMPh:
if (m_blupiPhase == 2)
{
m_blupiAction = ACTION_AIR;
m_blupiPhase = 0;
m_blupiVitesse.y = -12;
m_blupiAir = TRUE;
2024-10-06 01:07:18 -05:00
bLastBlupiAir = TRUE;
2024-10-05 17:42:17 -05:00
}
case ACTION_SUCETTE:
if (m_blupiPhase == 32)
{
//ObjectStart(m_sucettePos, m_sucetteType, 0); // respawn item (winphone behavior)
StopBlupi(TRUE);
m_blupiPower = TRUE;
m_blupiTimeShield = 100;
m_blupiPosMagic = m_blupiPos;
m_jauges[JAUGE_POWER].SetHide(FALSE);
PlaySound(SOUND_STARTPOWER, end);
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
case ACTION_DRINK:
if (m_blupiPhase == 36)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
//ObjectStart(m_sucettePos, m_sucetteType, 0); // respawn item (winphone behavior)
StopBlupi(TRUE);
m_blupiHide = TRUE;
m_blupiTimeShield = 100;
m_blupiPosMagic = m_blupiPos;
m_jauges[JAUGE_POWER].SetHide(FALSE);
PlaySound(SOUND_STARTHIDE, end);
2024-08-31 23:22:24 -05:00
}
}
2024-10-05 17:42:17 -05:00
if (m_keyPress & KEY_UP &&
!(m_lastKeyPress & KEY_UP) &&
IsBlupiStanding() &&
m_blupiAction != ACTION_UP &&
m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_UP;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
2024-10-05 17:42:17 -05:00
if (!(m_keyPress & (KEY_UP | KEY_DOWN)) &&
m_lastKeyPress & KEY_UP &&
IsBlupiStanding() &&
m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_keyPress & KEY_DOWN &&
!(m_lastKeyPress & KEY_DOWN) &&
IsBlupiStanding() &&
m_blupiAction != ACTION_DOWN &&
m_blupiAction != ACTION_STOPPOP &&
m_blupiFocus)
{
m_blupiAction = ACTION_DOWN;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
2024-10-05 17:42:17 -05:00
2024-10-06 01:07:18 -05:00
if (m_keyPress & KEY_DOWN &&
!(m_keyPress & (KEY_JUMP | KEY_LEFT | KEY_RIGHT)) &&
2024-10-05 17:42:17 -05:00
IsBlupiStanding() &&
m_blupiAction != ACTION_DOWN &&
m_blupiAction != ACTION_STOPPOP &&
m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_DOWN;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
2024-10-05 17:42:17 -05:00
if (!(m_keyPress & KEY_DOWN) &&
m_lastKeyPress & KEY_DOWN &&
IsBlupiStanding() &&
m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_UP && m_blupiPhase == 4)
2024-08-31 23:22:24 -05:00
{
m_scrollAdd.y = -150;
2024-10-05 17:42:17 -05:00
PlaySound(SOUND_LOOKUP, end);
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_DOWN && m_blupiPhase == 4)
2024-08-31 23:22:24 -05:00
{
m_scrollAdd.y = 150;
2024-10-05 17:42:17 -05:00
PlaySound(SOUND_DOWN, end);
}
if (!IsBlupiVehicle() &&
!m_blupiBalloon &&
!m_blupiEcrase &&
!m_blupiNage &&
!m_blupiSurf &&
!m_blupiSuspend
&& m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_keyPress & KEY_DOWN &&
!(m_keyPress & (KEY_JUMP | KEY_LEFT | KEY_RIGHT)) &&
m_blupiAction != ACTION_STOPPOP &&
m_blupiDir == DIR_LEFT &&
(num = CaisseInFront()) != -1)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.x = m_moveObject[num].posCurrent.x + 64 - 5;
m_blupiAction = ACTION_STOPPOP;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
m_scrollAdd.y = 0;
2024-10-05 17:42:17 -05:00
PlaySound(SOUND_POP, end);
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_keyPress & (KEY_DOWN | KEY_RIGHT) &&
!(m_keyPress & KEY_JUMP) &&
m_blupiAction != ACTION_POP &&
m_blupiDir == DIR_LEFT &&
CaisseInFront() != -1)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_POP;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
m_scrollAdd.y = 0;
2024-10-05 17:42:17 -05:00
PlaySound(SOUND_POP, end);
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_keyPress & KEY_DOWN &&
!(m_keyPress & (KEY_JUMP | KEY_LEFT | KEY_RIGHT)) &&
m_blupiAction != ACTION_STOPPOP &&
m_blupiDir == DIR_RIGHT &&
(num = CaisseInFront()) != -1)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.x = m_moveObject[num].posCurrent.x - DIMBLUPIX + 5;
m_blupiAction = ACTION_STOPPOP;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
m_scrollAdd.y = 0;
2024-10-05 17:42:17 -05:00
PlaySound(SOUND_POP, end);
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_keyPress & (KEY_DOWN | KEY_LEFT) &&
!(m_keyPress & KEY_JUMP) &&
m_blupiAction != ACTION_POP &&
m_blupiDir == DIR_RIGHT &&
CaisseInFront() != -1)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_POP;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
m_scrollAdd.y = 0;
2024-10-05 17:42:17 -05:00
PlaySound(SOUND_POP, end);
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_POP && m_blupiActionOuf != ACTION_OUF3)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiActionOuf = ACTION_OUF3;
2024-08-31 23:22:24 -05:00
m_blupiTimeOuf = 0;
}
}
2024-10-05 17:42:17 -05:00
if (m_blupiAction != ACTION_STOPPOP &&
m_blupiAction != ACTION_POP &&
m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
2024-10-06 01:07:18 -05:00
if (m_keyPress & KEY_LEFT && !(m_lastKeyPress & (KEY_LEFT | KEY_RIGHT)) && !m_blupiAir && m_keyPress & (KEY_UP | KEY_DOWN))
{
m_blupiAction = 1;
m_blupiPhase = 0;
}
if (!(m_keyPress & (KEY_LEFT | KEY_RIGHT)) && m_lastKeyPress & KEY_LEFT && m_keyPress & (KEY_UP | KEY_DOWN))
{
m_blupiAction = 1;
m_blupiPhase = 0;
}
if (m_keyPress & KEY_RIGHT && !(m_lastKeyPress & (KEY_LEFT | KEY_RIGHT)) && !m_blupiAir && m_keyPress & (KEY_UP | KEY_DOWN))
{
m_blupiAction = 1;
m_blupiPhase = 0;
}
if (!(m_keyPress & (KEY_LEFT | KEY_RIGHT)) && m_lastKeyPress & KEY_RIGHT && m_keyPress & (KEY_UP | KEY_DOWN))
{
m_blupiAction = 1;
m_blupiPhase = 0;
}
2024-08-31 23:22:24 -05:00
}
int num3;
int num4;
2024-10-05 17:42:17 -05:00
if (m_keyPress & KEY_LEFT && m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiDir == DIR_RIGHT &&
m_blupiAction != ACTION_TURN &&
m_blupiAction != ACTION_TURNAIR &&
m_blupiAction != ACTION_UP &&
m_blupiAction != ACTION_DOWN &&
m_blupiAction != ACTION_POP &&
((!m_blupiJeep && !m_blupiTank && !m_blupiSkate) || abs(m_blupiVitesse.x) <= 8))
2024-08-31 23:22:24 -05:00
{
if (m_blupiAir)
{
2024-10-05 17:42:17 -05:00
PlaySound(SOUND_TURN, end);
m_blupiAction = ACTION_TURNAIR;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
2024-10-05 17:42:17 -05:00
m_blupiDir = DIR_LEFT;
2024-08-31 23:22:24 -05:00
}
else
{
2024-10-05 17:42:17 -05:00
PlaySound(SOUND_TURN, end);
m_blupiAction = ACTION_TURN;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
}
2024-10-05 17:42:17 -05:00
if (m_blupiDir == DIR_LEFT &&
m_blupiAction != ACTION_MARCH &&
m_blupiAction != ACTION_PUSH &&
m_blupiAction != ACTION_JUMP &&
m_blupiAction != ACTION_UP &&
m_blupiAction != ACTION_DOWN &&
m_blupiAction != ACTION_POP &&
!m_blupiAir)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_MARCH;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
2024-10-05 17:42:17 -05:00
if (m_blupiDir == DIR_LEFT &&
m_blupiAction != ACTION_TURN &&
m_blupiAction != ACTION_JUMP &&
m_blupiAction != ACTION_UP &&
m_blupiAction != ACTION_DOWN &&
m_blupiAction != ACTION_POP &&
!IsBlupiVehicle() &&
!m_blupiBalloon &&
!m_blupiEcrase &&
!m_blupiNage &&
!m_blupiSurf &&
!m_blupiSuspend)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_PUSH)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.x -= CaisseGetMove(5);
2024-08-31 23:22:24 -05:00
}
else
{
num3 = m_blupiPhase;
2024-10-06 01:07:18 -05:00
if (num3 > 3 || m_blupiAir)
2024-08-31 23:22:24 -05:00
{
2024-10-06 01:07:18 -05:00
num3 = 3;
2024-08-31 23:22:24 -05:00
}
num4 = table_vitesse_march[num3];
if (m_blupiPower)
{
num4 *= 3;
num4 /= 2;
}
2024-10-06 01:07:18 -05:00
end.x -= num4;
2024-08-31 23:22:24 -05:00
}
}
2024-10-05 17:42:17 -05:00
if (m_blupiDir == DIR_RIGHT && m_blupiAction == ACTION_POP)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.x -= CaisseGetMove(3);
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
} // if (m_keyPress & KEY_LEFT && m_blupiFocus)
if (m_keyPress & KEY_RIGHT && m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiDir == DIR_LEFT &&
m_blupiAction != ACTION_TURN &&
m_blupiAction != ACTION_TURNAIR &&
m_blupiAction != ACTION_UP &&
m_blupiAction != ACTION_DOWN &&
m_blupiAction != ACTION_POP &&
((!m_blupiJeep && !m_blupiTank && !m_blupiSkate) || abs(m_blupiVitesse.x) <= 8))
2024-08-31 23:22:24 -05:00
{
if (m_blupiAir)
{
2024-10-05 17:42:17 -05:00
PlaySound(SOUND_TURN, end);
m_blupiAction = ACTION_TURNAIR;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
2024-10-05 17:42:17 -05:00
m_blupiDir = DIR_RIGHT;
2024-08-31 23:22:24 -05:00
}
else
{
2024-10-05 17:42:17 -05:00
PlaySound(SOUND_TURN, end);
m_blupiAction = ACTION_TURN;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
}
2024-10-05 17:42:17 -05:00
if (m_blupiDir == DIR_RIGHT &&
m_blupiAction != ACTION_MARCH &&
m_blupiAction != ACTION_PUSH &&
m_blupiAction != ACTION_JUMP &&
m_blupiAction != ACTION_UP &&
m_blupiAction != ACTION_DOWN &&
m_blupiAction != ACTION_POP &&
!m_blupiAir)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_MARCH;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
2024-10-05 17:42:17 -05:00
if (m_blupiDir == DIR_RIGHT &&
m_blupiAction != ACTION_TURN &&
m_blupiAction != ACTION_JUMP &&
m_blupiAction != ACTION_UP &&
m_blupiAction != ACTION_DOWN &&
m_blupiAction != ACTION_POP &&
!IsBlupiVehicle() &&
!m_blupiBalloon &&
!m_blupiEcrase &&
!m_blupiNage &&
!m_blupiSurf &&
!m_blupiSuspend)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_PUSH)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.x += CaisseGetMove(5);
2024-08-31 23:22:24 -05:00
}
else
{
num3 = m_blupiPhase;
if (num3 > 3 || m_blupiAir)
{
num3 = 3;
}
num4 = table_vitesse_march[num3];
if (m_blupiPower)
{
num4 *= 3;
num4 /= 2;
}
2024-10-05 17:42:17 -05:00
end.x += num4;
2024-08-31 23:22:24 -05:00
}
}
2024-10-05 17:42:17 -05:00
if (m_blupiDir == DIR_LEFT && m_blupiAction == ACTION_POP)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.x += CaisseGetMove(3);
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
} // if (m_keyPress & KEY_RIGHT && m_blupiFocus)
2024-08-31 23:22:24 -05:00
if (m_blupiHelico)
{
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_TURN && m_blupiPhase == 10)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_MARCH;
if (m_blupiDir == DIR_LEFT) m_blupiDir = DIR_RIGHT;
else m_blupiDir = DIR_LEFT;
2024-08-31 23:22:24 -05:00
}
}
else if (m_blupiOver)
{
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_TURN && m_blupiPhase == 7)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_MARCH;
if (m_blupiDir == DIR_LEFT) m_blupiDir = DIR_RIGHT;
else m_blupiDir = DIR_LEFT;
2024-08-31 23:22:24 -05:00
}
}
else if (m_blupiJeep)
{
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_TURN && m_blupiPhase == 7)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
StopBlupi();
if (m_blupiDir == DIR_LEFT) m_blupiDir = DIR_RIGHT;
else m_blupiDir = DIR_LEFT;
2024-08-31 23:22:24 -05:00
}
}
else if (m_blupiTank)
{
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_TURN && m_blupiPhase == 12)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
StopBlupi();
if (m_blupiDir == DIR_LEFT) m_blupiDir = DIR_RIGHT;
else m_blupiDir = DIR_LEFT;
2024-08-31 23:22:24 -05:00
}
}
else if (m_blupiSkate)
{
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_TURN && m_blupiPhase == 14)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
StopBlupi();
if (m_blupiDir == DIR_LEFT) m_blupiDir = DIR_RIGHT;
else m_blupiDir = DIR_LEFT;
2024-08-31 23:22:24 -05:00
}
}
else if (m_blupiNage || m_blupiSurf)
{
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_TURN && m_blupiPhase == 10)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_MARCH;
if (m_blupiDir == DIR_LEFT) m_blupiDir = DIR_RIGHT;
else m_blupiDir = DIR_LEFT;
2024-08-31 23:22:24 -05:00
}
}
else if (m_blupiSuspend)
{
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_TURN && m_blupiPhase == 10)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
StopBlupi();
if (m_blupiDir == DIR_LEFT) m_blupiDir = DIR_RIGHT;
else m_blupiDir = DIR_LEFT;
2024-08-31 23:22:24 -05:00
}
}
else
{
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_TURN && m_blupiPhase == 6)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
StopBlupi();
if (m_blupiDir == DIR_LEFT) m_blupiDir = DIR_RIGHT;
else m_blupiDir = DIR_LEFT;
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_TURNAIR && m_blupiPhase == 6)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_AIR;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
}
2024-10-05 17:42:17 -05:00
if (!m_blupiSuspend && m_blupiAction == ACTION_JUMP && m_blupiPhase == 3)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (!(m_keyPress & (KEY_LEFT | KEY_RIGHT | KEY_UP | KEY_DOWN)) &&
!IsBlupiVehicle() &&
!m_blupiBalloon &&
!m_blupiEcrase &&
!m_blupiNage &&
!m_blupiSurf &&
m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_PUSH || m_blupiAction == ACTION_UP)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_MARCH)
2024-08-31 23:22:24 -05:00
{
if (m_blupiSuspend || m_blupiPhase < 10)
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
}
else
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_STOPMARCH;
m_blupiPhase = 0;
2024-08-31 23:22:24 -05:00
}
}
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_DOWN)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
StopBlupi();
PlaySound(ACTION_UP, end);
2024-08-31 23:22:24 -05:00
}
m_scrollAdd.y = 0;
2024-10-05 17:42:17 -05:00
if (lastBlupiAction == ACTION_PUSH)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
StopSound(SOUND_PUSH);
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (lastBlupiAction == ACTION_POP || lastBlupiAction == ACTION_STOPPOP)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
StopSound(SOUND_POP);
2024-08-31 23:22:24 -05:00
}
}
2024-10-05 17:42:17 -05:00
if (!m_blupiBalloon &&
!m_blupiEcrase &&
!m_blupiJeep &&
!m_blupiTank &&
!m_blupiSkate &&
!m_blupiNage &&
!m_blupiSurf &&
m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_RECEDE && m_blupiDir == DIR_LEFT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.x += 4;
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_RECEDE && m_blupiDir == DIR_RIGHT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.x -= 4;
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_ADVANCE && m_blupiDir == DIR_LEFT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.x -= 4;
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_ADVANCE && m_blupiDir == DIR_RIGHT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.x += 4;
2024-08-31 23:22:24 -05:00
}
}
2024-10-05 17:42:17 -05:00
if (!(m_keyPress & (KEY_LEFT | KEY_RIGHT | KEY_UP | KEY_DOWN | KEY_JUMP)))
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if ((m_blupiJeep || m_blupiTank || m_blupiSkate) && m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiAction == ACTION_ADVANCE && m_blupiDir == DIR_LEFT)
{
end.x -= 5;
}
if (m_blupiAction == ACTION_ADVANCE && m_blupiDir == DIR_RIGHT)
{
end.x += 5;
}
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if ((m_blupiNage || m_blupiSurf) &&
m_blupiFocus &&
m_blupiAction == ACTION_MARCH)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
}
}
2024-10-05 17:42:17 -05:00
if (m_blupiHelico && (m_blupiFocus || m_blupiAction == ACTION_HELICOGLU))
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_keyPress & KEY_FIRE &&
m_blupiTimeFire == 0 &&
m_blupiAction != ACTION_TURN &&
m_blupiAction != ACTION_HELICOGLU &&
2024-10-06 01:07:18 -05:00
bAirStart)
2024-08-31 23:22:24 -05:00
{
if (m_blupiBullet == 0)
{
2024-10-05 17:42:17 -05:00
PlaySound(SOUND_FIREKO, m_blupiPos);
2024-08-31 23:22:24 -05:00
}
else
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_HELICOGLU;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
2024-10-05 17:42:17 -05:00
m_blupiFocus = FALSE;
2024-08-31 23:22:24 -05:00
}
}
2024-10-06 01:07:18 -05:00
////m_blupiMotorHigh = bCanUseLift;
2024-10-05 17:42:17 -05:00
if (m_blupiAction != ACTION_TURN && m_blupiAction != ACTION_HELICOGLU)
2024-08-31 23:22:24 -05:00
{
2024-10-06 01:07:18 -05:00
if (bAirStart)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_MARCH;
2024-08-31 23:22:24 -05:00
}
else
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
m_blupiVitesse.y = 0;
}
}
2024-10-05 17:42:17 -05:00
if (m_keyPress & (KEY_UP | KEY_JUMP))
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.y > -10) m_blupiVitesse.y -= 2;
}
else if (m_keyPress & KEY_DOWN)
{
if (m_blupiVitesse.y < 12) m_blupiVitesse.y += 2;
}
else
{
if (m_blupiVitesse.y > 1) m_blupiVitesse.y -= 1;
if (m_blupiVitesse.y < 1) m_blupiVitesse.y += 1;
}
end.y += m_blupiVitesse.y;
if (m_keyPress & KEY_LEFT)
{
if (m_blupiVitesse.x > -16)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiVitesse.x -= 2;
2024-08-31 23:22:24 -05:00
}
2024-10-15 13:41:43 -05:00
if (BlupiBloque(POINT( end.x + m_blupiVitesse.x, end.y ), -1))
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiVitesse.x = 0;
2024-08-31 23:22:24 -05:00
}
}
2024-10-05 17:42:17 -05:00
else if (m_keyPress & KEY_RIGHT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.x < 16)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiVitesse.x += 2;
2024-08-31 23:22:24 -05:00
}
2024-10-15 13:41:43 -05:00
if (BlupiBloque(POINT( end.x + m_blupiVitesse.x, end.y ), -1))
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiVitesse.x = 0;
2024-08-31 23:22:24 -05:00
}
}
else
{
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.x > 0)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiVitesse.x -= 2;
if (m_blupiVitesse.x < 0) m_blupiVitesse.x = 0;
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.x < 0)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiVitesse.x += 2;
if (m_blupiVitesse.x > 0) m_blupiVitesse.x = 0;
2024-08-31 23:22:24 -05:00
}
}
2024-10-05 17:42:17 -05:00
end.x += m_blupiVitesse.x;
2024-08-31 23:22:24 -05:00
MoveObjectPollution();
2024-10-05 17:42:17 -05:00
2024-10-06 01:07:18 -05:00
if ( m_keyPress & KEY_DOWN && !bAirStart && m_blupiTransport == -1)
2024-08-31 23:22:24 -05:00
{
rect.left = m_blupiPos.x + 20;
rect.right = m_blupiPos.x + 22;
rect.top = m_blupiPos.y + 60 - 2;
rect.bottom = m_blupiPos.y + 60;
2024-10-06 01:07:18 -05:00
bIsOpen = !DecorDetect(rect);
2024-08-31 23:22:24 -05:00
rect.left = m_blupiPos.x + 60 - 22;
rect.right = m_blupiPos.x + 60 - 20;
rect.top = m_blupiPos.y + 60 - 2;
rect.bottom = m_blupiPos.y + 60;
2024-10-06 01:07:18 -05:00
bIsOpen2 = !DecorDetect(rect);
if (!bIsOpen && !bIsOpen2)
2024-08-31 23:22:24 -05:00
{
tinyPoint.x = m_blupiPos.x;
tinyPoint.y = m_blupiPos.y - BLUPIFLOOR;
ObjectStart(tinyPoint, 13, 0);
2024-10-05 17:42:17 -05:00
m_blupiHelico = FALSE;
StopBlupi(TRUE);
2024-08-31 23:22:24 -05:00
m_blupiPosHelico = m_blupiPos;
StopSound(16);
StopSound(18);
PlaySound(17, m_blupiPos);
}
}
}
if (m_blupiOver && (m_blupiFocus || m_blupiAction == 58))
{
2024-10-06 01:07:18 -05:00
////m_blupiMotorHigh = bCanUseLift;
2024-10-05 17:42:17 -05:00
if (m_blupiAction != ACTION_TURN)
2024-08-31 23:22:24 -05:00
{
2024-10-06 01:07:18 -05:00
if (bAirStart)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiAction = ACTION_MARCH;
2024-08-31 23:22:24 -05:00
}
else
{
if (m_blupiAction != 1)
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
}
m_blupiVitesse.y = 0;
}
}
2024-10-05 17:42:17 -05:00
rect = BlupiRect(end);
rect.top = end.y + 60 - 2;
rect.bottom = end.y + 60 + OVERHEIGHT - 1;
2024-10-06 01:07:18 -05:00
bIsOpen = !DecorDetect(rect);
2024-08-31 23:22:24 -05:00
num = MoveAscenseurDetect(m_blupiPos, OVERHEIGHT);
if (num != -1)
{
2024-10-06 01:07:18 -05:00
bIsOpen = FALSE;
2024-08-31 23:22:24 -05:00
}
2024-10-06 01:07:18 -05:00
if (m_keyPress & (KEY_JUMP | KEY_UP) && !bIsOpen)
2024-08-31 23:22:24 -05:00
{
if (m_blupiVitesse.y == 0 && num != -1)
{
m_blupiVitesse.y = -5;
}
else if (m_blupiVitesse.y > -5)
{
m_blupiVitesse.y -= 1;
}
}
2024-10-05 17:42:17 -05:00
else if (m_keyPress & KEY_DOWN)
2024-08-31 23:22:24 -05:00
{
if (m_blupiVitesse.y < 12)
{
m_blupiVitesse.y += 5;
}
}
else if (m_blupiVitesse.y < 12 && m_time % 2 == 0)
{
m_blupiVitesse.y += 1;
}
2024-10-06 01:07:18 -05:00
end.y += m_blupiVitesse.y;
if (m_keyPress & KEY_LEFT && bAirStart)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.x > -12)
2024-08-31 23:22:24 -05:00
{
m_blupiVitesse.x -= 1;
}
2024-10-05 17:42:17 -05:00
tinyPoint.x = end.x + m_blupiVitesse.x;
tinyPoint.y = end.y;
2024-08-31 23:22:24 -05:00
if (BlupiBloque(tinyPoint, -1))
{
m_blupiVitesse.x = 0;
}
}
2024-10-06 01:07:18 -05:00
else if (m_keyPress & KEY_RIGHT && bAirStart)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.x < 12)
2024-08-31 23:22:24 -05:00
{
m_blupiVitesse.x += 1;
}
2024-10-05 17:42:17 -05:00
tinyPoint.x = end.x + m_blupiVitesse.x;
tinyPoint.y = end.y;
2024-08-31 23:22:24 -05:00
if (BlupiBloque(tinyPoint, 1))
{
m_blupiVitesse.x = 0;
}
}
else
{
if (m_blupiVitesse.x > 0)
{
m_blupiVitesse.x -= 1;
}
if (m_blupiVitesse.x < 0)
{
m_blupiVitesse.x += 1;
}
}
2024-10-05 17:42:17 -05:00
end.x += m_blupiVitesse.x;
2024-08-31 23:22:24 -05:00
MoveObjectPollution();
2024-10-05 17:42:17 -05:00
2024-10-06 01:07:18 -05:00
if ( !bAirStart && m_blupiTransport == -1)
2024-08-31 23:22:24 -05:00
{
rect.left = m_blupiPos.x + 20;
rect.right = m_blupiPos.x + 22;
rect.top = m_blupiPos.y + 60 - 2;
rect.bottom = m_blupiPos.y + 60;
2024-10-06 01:07:18 -05:00
bIsOpen = !DecorDetect(rect);
2024-08-31 23:22:24 -05:00
rect.left = m_blupiPos.x + 60 - 22;
rect.right = m_blupiPos.x + 60 - 20;
rect.top = m_blupiPos.y + 60 - 2;
rect.bottom = m_blupiPos.y + 60;
2024-10-06 01:07:18 -05:00
bIsOpen2 = !DecorDetect(rect);
if (!bIsOpen && !bIsOpen2)
2024-08-31 23:22:24 -05:00
{
tinyPoint.x = m_blupiPos.x;
tinyPoint.y = m_blupiPos.y - BLUPIFLOOR;
ObjectStart(tinyPoint, 46, 0);
2024-10-05 17:42:17 -05:00
m_blupiOver = FALSE;
StopBlupi(TRUE);
2024-08-31 23:22:24 -05:00
m_blupiPosHelico = m_blupiPos;
StopSound(16);
StopSound(18);
PlaySound(17, m_blupiPos);
}
}
}
if (m_blupiBalloon && m_blupiFocus)
{
2024-10-06 01:07:18 -05:00
if (m_keyPress & (KEY_JUMP | KEY_UP))
2024-08-31 23:22:24 -05:00
{
if (m_blupiVitesse.y > -5 && m_time % 6 == 0)
{
m_blupiVitesse.y -= 1;
}
}
2024-10-05 17:42:17 -05:00
else if (m_keyPress & KEY_DOWN)
2024-08-31 23:22:24 -05:00
{
if (m_blupiVitesse.y < 0 && m_time % 6 == 0)
{
m_blupiVitesse.y += 1;
}
}
else if (m_blupiVitesse.y > -3 && m_time % 6 == 0)
{
m_blupiVitesse.y -= 1;
}
2024-10-05 17:42:17 -05:00
end.y += (int)m_blupiVitesse.y;
if (m_keyPress & KEY_LEFT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.x > -10)
2024-08-31 23:22:24 -05:00
{
m_blupiVitesse.x -= 1;
}
2024-10-05 17:42:17 -05:00
tinyPoint.x = end.x + m_blupiVitesse.x;
tinyPoint.y = end.y;
2024-08-31 23:22:24 -05:00
if (BlupiBloque(tinyPoint, -1))
{
m_blupiVitesse.x = 0;
}
}
2024-10-05 17:42:17 -05:00
else if (m_keyPress & KEY_RIGHT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.x < 10)
2024-08-31 23:22:24 -05:00
{
m_blupiVitesse.x += 1;
}
2024-10-05 17:42:17 -05:00
tinyPoint.x = end.x + m_blupiVitesse.x;
tinyPoint.y = end.y;
2024-08-31 23:22:24 -05:00
if (BlupiBloque(tinyPoint, 1))
{
m_blupiVitesse.x = 0;
}
}
else
{
if (m_blupiVitesse.x > 0)
{
m_blupiVitesse.x -= 2;
if (m_blupiVitesse.x < 0)
{
m_blupiVitesse.x = 0;
}
}
if (m_blupiVitesse.x < 0)
{
m_blupiVitesse.x += 2;
if (m_blupiVitesse.x > 0)
{
m_blupiVitesse.x = 0;
}
}
}
2024-10-05 17:42:17 -05:00
end.x += (int)m_blupiVitesse.x;
2024-08-31 23:22:24 -05:00
}
if (m_blupiEcrase && m_blupiFocus)
{
2024-10-06 01:07:18 -05:00
if (bAirStart)
2024-08-31 23:22:24 -05:00
{
if (m_blupiVitesse.y < 2)
{
m_blupiVitesse.y += 1;
}
}
else
{
m_blupiVitesse.y = 0;
}
2024-10-05 17:42:17 -05:00
end.y += (int)m_blupiVitesse.y;
2024-10-06 01:07:18 -05:00
if (bAirStart)
2024-08-31 23:22:24 -05:00
{
num3 = 7;
}
else
{
num3 = 4;
}
2024-10-05 17:42:17 -05:00
if (m_keyPress & KEY_LEFT) num3 = -num3;
if (m_keyPress & KEY_LEFT)
2024-08-31 23:22:24 -05:00
{
if (m_blupiVitesse.x > num3)
{
m_blupiVitesse.x -= 1;
}
2024-10-05 17:42:17 -05:00
tinyPoint.x = end.x + (int)m_blupiVitesse.x;
tinyPoint.y = end.y;
2024-08-31 23:22:24 -05:00
if (BlupiBloque(tinyPoint, -1))
{
m_blupiVitesse.x = 0;
}
}
2024-10-05 17:42:17 -05:00
else if (m_keyPress & KEY_RIGHT)
2024-08-31 23:22:24 -05:00
{
if (m_blupiVitesse.x < num3)
{
m_blupiVitesse.x += 1;
}
2024-10-05 17:42:17 -05:00
tinyPoint.x = end.x + (int)m_blupiVitesse.x;
tinyPoint.y = end.y;
2024-08-31 23:22:24 -05:00
if (BlupiBloque(tinyPoint, 1))
{
m_blupiVitesse.x = 0;
}
}
else
{
if (m_blupiVitesse.x > 0)
{
m_blupiVitesse.x -= 2;
if (m_blupiVitesse.x < 0)
{
m_blupiVitesse.x = 0;
}
}
if (m_blupiVitesse.x < 0)
{
m_blupiVitesse.x += 2;
if (m_blupiVitesse.x > 0)
{
m_blupiVitesse.x = 0;
}
}
}
2024-10-06 01:07:18 -05:00
if (m_blupiVitesse.x == 0 && !bAirStart)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
end.x += (int)m_blupiVitesse.x;
2024-08-31 23:22:24 -05:00
}
if (m_blupiJeep && m_blupiFocus)
{
if (m_blupiVitesse.x == 0 && m_blupiAction == 2)
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
}
//m_blupiMotorHigh = (m_blupiAction != 1);
2024-10-05 17:42:17 -05:00
rect = BlupiRect(end);
2024-08-31 23:22:24 -05:00
rect.right -= 40;
2024-10-05 17:42:17 -05:00
rect.top = end.y + 60 - 2;
rect.bottom = end.y + 60 - 1;
2024-10-06 01:07:18 -05:00
bIsOpen = !DecorDetect(rect);
2024-08-31 23:22:24 -05:00
rect.left += 40;
rect.right += 40;
2024-10-06 01:07:18 -05:00
bIsOpen2 = !DecorDetect(rect);
if (bAirStart)
2024-08-31 23:22:24 -05:00
{
if (m_blupiVitesse.y < 50)
{
m_blupiVitesse.y += 5;
}
}
else
{
if (m_blupiVitesse.y != 0)
{
PlaySound(3, m_blupiPos);
}
m_blupiVitesse.y = 0;
}
2024-10-05 17:42:17 -05:00
end.y += (int)m_blupiVitesse.y;
2024-08-31 23:22:24 -05:00
if (m_blupiTransport == -1)
{
2024-10-05 17:42:17 -05:00
rect.left = end.x + 20;
rect.right = end.x + 60 - 20;
rect.top = end.y + 60 - 35;
rect.bottom = end.y + 60 - 1;
num = AscenseurDetect(rect, m_blupiPos, end);
2024-08-31 23:22:24 -05:00
if (m_blupiVitesse.y >= 0 && num != -1)
{
m_blupiTransport = num;
2024-10-06 01:07:18 -05:00
bAirStart = FALSE;
2024-10-05 17:42:17 -05:00
PlaySound(3, end);
end.y = m_moveObject[num].posCurrent.y - 64 + BLUPIOFFY;
2024-08-31 23:22:24 -05:00
}
}
2024-10-06 01:07:18 -05:00
if (bIsOpen && !bIsOpen2)
2024-08-31 23:22:24 -05:00
{
int num13 = -20;
if (m_blupiVitesse.x > num13)
{
m_blupiVitesse.x -= 1;
}
}
2024-10-06 01:07:18 -05:00
else if (!bIsOpen && bIsOpen2)
2024-08-31 23:22:24 -05:00
{
int num14 = 20;
if (m_blupiVitesse.x < num14)
{
m_blupiVitesse.x += 1;
}
}
2024-10-05 17:42:17 -05:00
else if (m_keyPress & KEY_LEFT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.x > -20)
2024-08-31 23:22:24 -05:00
{
m_blupiVitesse.x -= 1;
}
}
2024-10-05 17:42:17 -05:00
else if (m_keyPress & KEY_RIGHT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.x < 20)
2024-08-31 23:22:24 -05:00
{
m_blupiVitesse.x += 1;
}
}
else
{
if (m_blupiVitesse.x > 0)
{
m_blupiVitesse.x -= 2;
if (m_blupiVitesse.x < 0)
{
m_blupiVitesse.x = 0;
}
}
if (m_blupiVitesse.x < 0)
{
m_blupiVitesse.x += 2;
if (m_blupiVitesse.x > 0)
{
m_blupiVitesse.x = 0;
}
}
}
if (m_blupiAction == 3)
{
m_blupiVitesse.x = 0;
}
2024-10-05 17:42:17 -05:00
end.x += (int)m_blupiVitesse.x;
2024-08-31 23:22:24 -05:00
MoveObjectPollution();
2024-10-06 01:07:18 -05:00
if ( !bLastBlupiAir && m_blupiTransport == -1)
2024-08-31 23:22:24 -05:00
{
tinyPoint.x = m_blupiPos.x;
tinyPoint.y = m_blupiPos.y - BLUPIFLOOR;
ObjectStart(tinyPoint, 19, 0);
2024-10-05 17:42:17 -05:00
m_blupiJeep = FALSE;
StopBlupi();
2024-08-31 23:22:24 -05:00
m_blupiPosHelico = m_blupiPos;
StopSound(29);
StopSound(31);
PlaySound(30, m_blupiPos);
}
}
if (m_blupiTank && m_blupiFocus)
{
if (m_blupiAction == 53 && m_blupiPhase == 6)
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
}
2024-10-06 01:07:18 -05:00
if (m_keyPress & KEY_FIRE && m_blupiTimeFire == 0 && m_blupiAction != ACTION_TURN)
2024-08-31 23:22:24 -05:00
{
if (m_blupiBullet == 0)
{
PlaySound(53, m_blupiPos);
}
else
{
2024-10-05 17:42:17 -05:00
if (m_blupiDir == DIR_LEFT)
2024-08-31 23:22:24 -05:00
{
tinyPoint.x = m_blupiPos.x - 35;
tinyPoint.y = m_blupiPos.y;
num4 = -5;
m_blupiVitesse.x += 12;
}
else
{
tinyPoint.x = m_blupiPos.x + 35;
tinyPoint.y = m_blupiPos.y;
num4 = 5;
m_blupiVitesse.x -= 12;
}
if (ObjectStart(tinyPoint, 23, num4) != -1)
{
m_blupiAction = 53;
m_blupiPhase = 0;
PlaySound(52, m_blupiPos);
m_blupiTimeFire = 10;
m_blupiBullet--;
}
}
}
if (m_blupiVitesse.x == 0 && m_blupiAction == 2)
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
}
//m_blupiMotorHigh = (m_blupiAction != 1);
2024-10-06 01:07:18 -05:00
if (bAirStart)
2024-08-31 23:22:24 -05:00
{
if (m_blupiVitesse.y < 50)
{
m_blupiVitesse.y += 5;
}
}
else
{
if (m_blupiVitesse.y != 0)
{
PlaySound(3, m_blupiPos);
}
m_blupiVitesse.y = 0;
}
2024-10-05 17:42:17 -05:00
end.y += (int)m_blupiVitesse.y;
2024-08-31 23:22:24 -05:00
if (m_blupiTransport == -1)
{
2024-10-05 17:42:17 -05:00
rect.left = end.x + 20;
rect.right = end.x + 60 - 20;
rect.top = end.y + 60 - 35;
rect.bottom = end.y + 60 - 1;
num = AscenseurDetect(rect, m_blupiPos, end);
2024-08-31 23:22:24 -05:00
if (m_blupiVitesse.y >= 0 && num != -1)
{
m_blupiTransport = num;
2024-10-06 01:07:18 -05:00
bAirStart = FALSE;
2024-10-05 17:42:17 -05:00
PlaySound(3, end);
end.y = m_moveObject[num].posCurrent.y - 64 + BLUPIOFFY;
2024-08-31 23:22:24 -05:00
}
}
2024-10-05 17:42:17 -05:00
if (m_keyPress & KEY_LEFT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.x > -12)
2024-08-31 23:22:24 -05:00
{
m_blupiVitesse.x -= 1;
}
}
2024-10-05 17:42:17 -05:00
else if (m_keyPress & KEY_RIGHT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.x < 12)
2024-08-31 23:22:24 -05:00
{
m_blupiVitesse.x += 1;
}
}
else
{
if (m_blupiVitesse.x > 0)
{
m_blupiVitesse.x -= 3;
if (m_blupiVitesse.x < 0)
{
m_blupiVitesse.x = 0;
}
}
if (m_blupiVitesse.x < 0)
{
m_blupiVitesse.x += 3;
if (m_blupiVitesse.x > 0)
{
m_blupiVitesse.x = 0;
}
}
}
if (m_blupiAction == 3)
{
m_blupiVitesse.x = 0;
}
2024-10-05 17:42:17 -05:00
end.x += (int)m_blupiVitesse.x;
2024-08-31 23:22:24 -05:00
MoveObjectPollution();
2024-10-06 01:07:18 -05:00
if ( m_keyPress & KEY_DOWN && !bAirStart && m_blupiTransport == -1)
2024-08-31 23:22:24 -05:00
{
tinyPoint.x = m_blupiPos.x;
tinyPoint.y = m_blupiPos.y;
ObjectStart(tinyPoint, 28, 0);
2024-10-05 17:42:17 -05:00
m_blupiTank = FALSE;
StopBlupi();
2024-08-31 23:22:24 -05:00
m_blupiPosHelico = m_blupiPos;
StopSound(29);
StopSound(31);
PlaySound(30, m_blupiPos);
}
}
if (m_blupiSkate && m_blupiFocus)
{
if (m_blupiVitesse.x == 0 && m_blupiAction == 2)
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_keyPress & KEY_LEFT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.x > -15)
2024-08-31 23:22:24 -05:00
{
m_blupiVitesse.x -= 1;
}
}
2024-10-05 17:42:17 -05:00
else if (m_keyPress & KEY_RIGHT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.x < 15)
2024-08-31 23:22:24 -05:00
{
m_blupiVitesse.x += 1;
}
}
else
{
if (m_blupiVitesse.x > 0)
{
m_blupiVitesse.x -= 1;
if (m_blupiVitesse.x < 0)
{
m_blupiVitesse.x = 0;
}
}
if (m_blupiVitesse.x < 0)
{
m_blupiVitesse.x += 1;
if (m_blupiVitesse.x > 0)
{
m_blupiVitesse.x = 0;
}
}
}
if (m_blupiAction == 3)
{
m_blupiVitesse.x = 0;
}
2024-10-05 17:42:17 -05:00
end.x += (int)m_blupiVitesse.x;
2024-10-06 01:07:18 -05:00
if ( m_keyPress & KEY_DOWN && !bAirStart && !m_blupiAir && m_blupiTransport == -1 && m_blupiVitesse.x < 8)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiSkate = FALSE;
2024-08-31 23:22:24 -05:00
m_blupiAction = 43;
m_blupiPhase = 0;
2024-10-05 17:42:17 -05:00
m_blupiFocus = FALSE;
2024-08-31 23:22:24 -05:00
m_blupiPosHelico = m_blupiPos;
}
}
if (m_blupiAction == 42)
{
if (m_blupiPhase == 8)
{
2024-10-05 17:42:17 -05:00
num = MoveObjectDetect(m_blupiPos, &bNear);
2024-08-31 23:22:24 -05:00
if (num != -1)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
}
}
if (m_blupiPhase == 20)
{
2024-10-05 17:42:17 -05:00
StopBlupi(TRUE);
2024-08-31 23:22:24 -05:00
}
}
if (m_blupiAction == 43)
{
if (m_blupiPhase == 12)
{
tinyPoint.x = m_blupiPos.x;
tinyPoint.y = m_blupiPos.y - BLUPIFLOOR + 1;
ObjectStart(tinyPoint, 24, 0);
}
if (m_blupiPhase == 20)
{
2024-10-05 17:42:17 -05:00
StopBlupi(TRUE);
2024-08-31 23:22:24 -05:00
}
}
if (m_blupiNage && m_blupiFocus)
{
if (m_blupiTransport == -1)
{
2024-10-06 01:07:18 -05:00
if (m_keyPress & (KEY_JUMP | KEY_UP))
2024-08-31 23:22:24 -05:00
{
if (m_blupiVitesse.y > -5)
{
m_blupiVitesse.y -= 1;
}
}
2024-10-06 01:07:18 -05:00
else if (m_keyPress & KEY_DOWN)
2024-08-31 23:22:24 -05:00
{
2024-10-06 01:07:18 -05:00
if (m_blupiVitesse.y < 5)
{
m_blupiVitesse.y += 1;
}
2024-08-31 23:22:24 -05:00
}
else
{
if (m_blupiAction == 1)
{
num3 = -1;
}
else
{
num3 = 0;
}
if (m_blupiVitesse.y > num3)
{
m_blupiVitesse.y -= 1;
}
if (m_blupiVitesse.y < num3)
{
m_blupiVitesse.y += 1;
}
}
2024-10-05 17:42:17 -05:00
end.y += (int)m_blupiVitesse.y;
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_keyPress & KEY_LEFT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.x > -8)
2024-08-31 23:22:24 -05:00
{
m_blupiVitesse.x -= 1;
}
}
2024-10-05 17:42:17 -05:00
else if (m_keyPress & KEY_RIGHT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.x < 8)
2024-08-31 23:22:24 -05:00
{
m_blupiVitesse.x += 1;
}
}
else
{
if (m_blupiVitesse.x > 0)
{
m_blupiVitesse.x -= 2;
if (m_blupiVitesse.x < 0)
{
m_blupiVitesse.x = 0;
}
}
if (m_blupiVitesse.x < 0)
{
m_blupiVitesse.x += 2;
if (m_blupiVitesse.x > 0)
{
m_blupiVitesse.x = 0;
}
}
}
num = table_vitesse_nage[m_blupiPhase % 14 / 2];
2024-10-05 17:42:17 -05:00
end.x += (int)(m_blupiVitesse.x * num / 7);
2024-08-31 23:22:24 -05:00
if (m_time % 70 == 0 || m_time % 70 == 28)
{
2024-10-05 17:42:17 -05:00
MoveObjectBlup(end);
2024-08-31 23:22:24 -05:00
}
if (m_time % 5 == 0)
{
if (!m_blupiShield && !m_blupiHide && !m_bSuperBlupi)
{
m_blupiLevel--;
}
if (m_blupiLevel == 25)
{
2024-10-05 17:42:17 -05:00
//m_jauges[JAUGE_AIR].SetMode(1);
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_AIR].SetLevel(m_blupiLevel);
2024-08-31 23:22:24 -05:00
if (m_blupiLevel == 0)
{
m_blupiAction = 24;
m_blupiPhase = 0;
2024-10-05 17:42:17 -05:00
m_blupiFocus = FALSE;
m_blupiHelico = FALSE;
m_blupiOver = FALSE;
m_blupiJeep = FALSE;
m_blupiTank = FALSE;
m_blupiSkate = FALSE;
m_blupiNage = FALSE;
m_blupiSurf = FALSE;
m_blupiSuspend = FALSE;
m_blupiJumpAie = FALSE;
m_blupiShield = FALSE;
m_blupiPower = FALSE;
m_blupiCloud = FALSE;
m_blupiHide = FALSE;
m_blupiInvert = FALSE;
m_blupiBalloon = FALSE;
m_blupiEcrase = FALSE;
m_blupiAir = FALSE;
m_blupiRestart = TRUE;
2024-08-31 23:22:24 -05:00
m_blupiActionOuf = 0;
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_AIR].SetHide(TRUE);
m_jauges[JAUGE_POWER].SetHide(TRUE);
PlaySound(26, end);
2024-08-31 23:22:24 -05:00
}
}
}
if (m_blupiSurf && m_blupiFocus)
{
if (m_blupiTransport == -1)
{
2024-10-06 01:07:18 -05:00
if (m_keyPress & (KEY_JUMP | KEY_UP))
2024-08-31 23:22:24 -05:00
{
if (m_blupiVitesse.y > -5)
{
m_blupiVitesse.y -= 1;
}
}
2024-10-05 17:42:17 -05:00
else if (m_keyPress & KEY_DOWN)
2024-08-31 23:22:24 -05:00
{
if (m_blupiVitesse.y < 5)
{
m_blupiVitesse.y += 1;
}
}
else
{
if (m_blupiVitesse.y > -2)
{
m_blupiVitesse.y -= 1;
}
if (m_blupiVitesse.y < -2)
{
m_blupiVitesse.y += 1;
}
}
2024-10-05 17:42:17 -05:00
end.y += (int)m_blupiVitesse.y;
end.y += BLUPISURF;
if (end.y % 64 > 30)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.y += 64 - end.y % 64;
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
end.y -= BLUPISURF;
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_keyPress & KEY_LEFT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.x > -8)
2024-08-31 23:22:24 -05:00
{
m_blupiVitesse.x -= 1;
}
}
2024-10-05 17:42:17 -05:00
else if (m_keyPress & KEY_RIGHT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
if (m_blupiVitesse.x < 8)
2024-08-31 23:22:24 -05:00
{
m_blupiVitesse.x += 1;
}
}
else
{
if (m_blupiVitesse.x > 0)
{
m_blupiVitesse.x -= 2;
if (m_blupiVitesse.x < 0)
{
m_blupiVitesse.x = 0;
}
}
if (m_blupiVitesse.x < 0)
{
m_blupiVitesse.x += 2;
if (m_blupiVitesse.x > 0)
{
m_blupiVitesse.x = 0;
}
}
}
num = table_vitesse_surf[m_blupiPhase % 12 / 2];
2024-10-05 17:42:17 -05:00
end.x += (int)(m_blupiVitesse.x * num / 10);
2024-08-31 23:22:24 -05:00
}
POINT tinyPoint4;
if (m_blupiSuspend && m_blupiFocus)
{
2024-10-05 17:42:17 -05:00
if (m_keyPress & KEY_LEFT && m_blupiAction == 2)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.x -= 5;
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_keyPress & KEY_RIGHT && m_blupiAction == 2)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.x += 5;
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
num = GetTypeBarre(end);
2024-08-31 23:22:24 -05:00
if (num == 2)
{
2024-10-05 17:42:17 -05:00
tinyPoint4.x = end.x;
tinyPoint4.y = end.y / 64 * 64 + BLUPIOFFY;
2024-08-31 23:22:24 -05:00
rect = BlupiRect(tinyPoint4);
2024-10-05 17:42:17 -05:00
if (!DecorDetect(rect, TRUE))
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiSuspend = FALSE;
StopBlupi();
end = tinyPoint4;
m_blupiPos = end;
2024-08-31 23:22:24 -05:00
}
}
2024-10-05 17:42:17 -05:00
if ((m_keyPress & KEY_DOWN && m_blupiPhase > 5) || num == 0)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiSuspend = FALSE;
m_blupiAir = TRUE;
2024-08-31 23:22:24 -05:00
m_blupiAction = 5;
2024-10-05 17:42:17 -05:00
end.y = end.y;
2024-08-31 23:22:24 -05:00
m_blupiVitesse.y = 0;
m_blupiNoBarre = 5;
m_blupiActionOuf = 65;
m_blupiTimeOuf = 0;
}
2024-10-05 17:42:17 -05:00
if ((m_keyPress & KEY_JUMP || m_keyPress & KEY_UP) && m_blupiAction != ACTION_JUMP && m_blupiAction != ACTION_TURN)
2024-08-31 23:22:24 -05:00
{
m_blupiAction = 4;
m_blupiPhase = 0;
}
2024-10-05 17:42:17 -05:00
if (!(m_keyPress & KEY_JUMP) && !(m_keyPress & (KEY_UP | KEY_DOWN)) && m_blupiAction == 4)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
}
if (m_blupiAction == 4 && m_blupiPhase == 10)
{
2024-10-05 17:42:17 -05:00
m_blupiSuspend = FALSE;
m_blupiAir = TRUE;
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_AIR;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
2024-10-05 17:42:17 -05:00
end.y -= 2;
2024-08-31 23:22:24 -05:00
m_blupiVitesse.y = -11;
m_blupiNoBarre = 5;
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_SUSPENDJUMP, end);
2024-08-31 23:22:24 -05:00
}
}
2024-10-08 11:54:16 -05:00
if (m_keyPress & KEY_FIRE &&
!m_blupiHelico &&
2024-10-06 01:07:18 -05:00
!m_blupiOver &&
!m_blupiBalloon &&
!m_blupiEcrase &&
!m_blupiTank &&
!m_blupiJeep &&
!m_blupiSkate &&
!bAirStart &&
m_blupiTransport == -1 &&
m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
if (m_blupiDynamite > 0)
{
2024-10-05 17:42:17 -05:00
rect.left = end.x + 18;
rect.right = end.x + 20;
rect.top = end.y + 60 - 2;
rect.bottom = end.y + 60;
2024-10-06 01:07:18 -05:00
bIsOpen = !DecorDetect(rect);
2024-10-05 17:42:17 -05:00
rect.left = end.x + 60 - 20;
rect.right = end.x + 60 - 18;
rect.top = end.y + 60 - 2;
rect.bottom = end.y + 60;
2024-10-06 01:07:18 -05:00
bIsOpen2 = !DecorDetect(rect);
if (!bIsOpen && !bIsOpen2 && ObjectStart(end, 56, 0) != -1)
2024-08-31 23:22:24 -05:00
{
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_PUTDYNAMITE;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
2024-10-05 17:42:17 -05:00
m_blupiFocus = FALSE;
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_PERSOPOSE, end);
2024-08-31 23:22:24 -05:00
m_blupiDynamite--;
}
}
else if (m_blupiPerso > 0)
{
2024-10-05 17:42:17 -05:00
num = MoveObjectDetect(end, &bNear);
2024-10-08 11:54:16 -05:00
if (num == -1 || m_moveObject[num].type != TYPE_BOMBEPERSO1)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
rect.left = end.x + 18;
rect.right = end.x + 20;
2024-10-08 11:54:16 -05:00
rect.top = end.y + DIMBLUPIY - 2;
rect.bottom = end.y + DIMBLUPIY;
2024-10-06 01:07:18 -05:00
bIsOpen = !DecorDetect(rect);
2024-10-08 11:54:16 -05:00
rect.left = end.x + DIMBLUPIX - 20;
rect.right = end.x + DIMBLUPIX - 18;
rect.top = end.y + DIMBLUPIY - 2;
rect.bottom = end.y + DIMBLUPIY;
2024-10-06 01:07:18 -05:00
bIsOpen2 = !DecorDetect(rect);
2024-10-05 17:42:17 -05:00
num = MoveChargeDetect(end);
2024-10-08 11:54:16 -05:00
if (num == -1 && !bIsOpen && !bIsOpen2 && ObjectStart(end, TYPE_BOMBEPERSO1, 0) != -1)
2024-08-31 23:22:24 -05:00
{
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_OUF2;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
2024-10-05 17:42:17 -05:00
m_blupiFocus = FALSE;
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_PERSOPOSE, end);
2024-08-31 23:22:24 -05:00
m_blupiPerso--;
}
}
if (m_blupiFocus)
{
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_OUF3;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_ERROR, end);
2024-08-31 23:22:24 -05:00
}
}
}
rect = BlupiRect(m_blupiPos);
2024-10-05 17:42:17 -05:00
tinyPoint4 = end;
TestPath(rect, m_blupiPos, &end);
2024-10-06 01:07:18 -05:00
if (bLastBlupiAir && m_blupiPos.x == end.x && m_blupiPos.x != tinyPoint4.x)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.y = tinyPoint4.y;
TestPath(rect, m_blupiPos, &end);
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_blupiVent && m_blupiPos.y == end.y && m_blupiPos.y != tinyPoint4.y)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.x = tinyPoint4.x;
TestPath(rect, m_blupiPos, &end);
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_blupiTransport != -1 && m_blupiPos.x == end.x && m_blupiPos.x != tinyPoint4.x)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.y = tinyPoint4.y;
TestPath(rect, m_blupiPos, &end);
2024-08-31 23:22:24 -05:00
}
if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase || m_blupiJeep || m_blupiTank || m_blupiSkate || m_blupiNage)
{
2024-10-05 17:42:17 -05:00
if (m_blupiPos.x == end.x && m_blupiPos.x != tinyPoint4.x)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.y = tinyPoint4.y;
TestPath(rect, m_blupiPos, &end);
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
else if (m_blupiPos.y == end.y && m_blupiPos.y != tinyPoint4.y)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.x = tinyPoint4.x;
TestPath(rect, m_blupiPos, &end);
2024-08-31 23:22:24 -05:00
}
}
POINT blupiPos = m_blupiPos;
2024-10-05 17:42:17 -05:00
m_blupiPos = end;
2024-10-08 11:54:16 -05:00
if ((m_blupiAction == ACTION_STOP ||
m_blupiAction == ACTION_STOPMARCH ||
m_blupiAction == ACTION_UP ||
m_blupiAction == ACTION_DOWN) &&
!m_blupiAir &&
!m_blupiBalloon &&
!m_blupiEcrase &&
!m_blupiJeep &&
!m_blupiTank &&
!m_blupiSkate &&
!m_blupiNage &&
!m_blupiSurf &&
!m_blupiSuspend &&
m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
if (m_blupiTransport != -1)
{
2024-10-06 01:07:18 -05:00
AscenseurVertigo(m_blupiTransport, &bIsOpen, &bIsOpen2);
2024-08-31 23:22:24 -05:00
}
else
{
2024-10-05 17:42:17 -05:00
rect.left = end.x + 24;
rect.right = end.x + 26;
2024-10-08 11:54:16 -05:00
rect.top = end.y + DIMBLUPIY - 2;
rect.bottom = end.y + DIMBLUPIY;
2024-10-06 01:07:18 -05:00
bIsOpen = !DecorDetect(rect);
2024-10-08 11:54:16 -05:00
rect.left = end.x + DIMBLUPIX - 26;
rect.right = end.x + DIMBLUPIX - 24;
rect.top = end.y + DIMBLUPIY - 2;
rect.bottom = end.y + DIMBLUPIY;
2024-10-06 01:07:18 -05:00
bIsOpen2 = !DecorDetect(rect);
2024-08-31 23:22:24 -05:00
}
2024-10-06 01:07:18 -05:00
if (m_blupiDir == DIR_LEFT && bIsOpen && !bIsOpen2)
2024-08-31 23:22:24 -05:00
{
if (m_blupiHelico || m_blupiOver || AscenseurShift(m_blupiTransport))
{
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_RECEDE;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
else
{
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_VERTIGO, end);
m_blupiAction = ACTION_VERTIGO;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
}
2024-10-06 01:07:18 -05:00
if (m_blupiDir == DIR_RIGHT && !bIsOpen && bIsOpen2)
2024-08-31 23:22:24 -05:00
{
if (m_blupiHelico || m_blupiOver || AscenseurShift(m_blupiTransport))
{
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_RECEDE;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
else
{
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_VERTIGO, end);
m_blupiAction = ACTION_VERTIGO;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
}
2024-10-08 11:54:16 -05:00
if (m_blupiAction != ACTION_VERTIGO &&
m_blupiAction != ACTION_ADVANCE &&
m_blupiAction != ACTION_RECEDE &&
(bIsOpen || bIsOpen2))
2024-08-31 23:22:24 -05:00
{
if (!m_blupiHelico && !m_blupiOver)
{
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_VERTIGO, end);
2024-08-31 23:22:24 -05:00
}
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_ADVANCE;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
}
2024-10-08 11:54:16 -05:00
if (m_blupiAction == ACTION_STOP &&
m_blupiJeep &&
!m_blupiHelico &&
!m_blupiOver &&
!m_blupiBalloon &&
!m_blupiEcrase &&
!m_blupiNage &&
!m_blupiSurf &&
!m_blupiSuspend &&
m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
if (m_blupiTransport != -1)
{
2024-10-06 01:07:18 -05:00
AscenseurVertigo(m_blupiTransport, &bIsOpen, &bIsOpen2);
2024-08-31 23:22:24 -05:00
}
else
{
2024-10-05 17:42:17 -05:00
rect.left = end.x + 2;
rect.right = end.x + 18;
2024-10-08 11:54:16 -05:00
rect.top = end.y + DIMBLUPIY - 2;
rect.bottom = end.y + DIMBLUPIY;
2024-10-06 01:07:18 -05:00
bIsOpen = !DecorDetect(rect);
2024-10-08 11:54:16 -05:00
rect.left = end.x + DIMBLUPIX - 18;
rect.right = end.x + DIMBLUPIX - 2;
rect.top = end.y + DIMBLUPIY - 2;
rect.bottom = end.y + DIMBLUPIY;
2024-10-06 01:07:18 -05:00
bIsOpen2 = !DecorDetect(rect);
2024-08-31 23:22:24 -05:00
}
2024-10-06 01:07:18 -05:00
if (bIsOpen && !bIsOpen2)
2024-08-31 23:22:24 -05:00
{
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_ADVANCE;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
2024-10-06 01:07:18 -05:00
if (!bIsOpen && bIsOpen2)
2024-08-31 23:22:24 -05:00
{
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_ADVANCE;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
}
2024-10-08 11:54:16 -05:00
if (m_blupiAction == ACTION_STOP &&
m_blupiTank &&
!m_blupiHelico &&
!m_blupiOver &&
!m_blupiBalloon &&
!m_blupiEcrase &&
!m_blupiNage &&
!m_blupiSurf &&
!m_blupiSuspend &&
m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
if (m_blupiTransport != -1)
{
2024-10-06 01:07:18 -05:00
AscenseurVertigo(m_blupiTransport, &bIsOpen, &bIsOpen2);
2024-08-31 23:22:24 -05:00
}
else
{
2024-10-05 17:42:17 -05:00
rect.left = end.x + 2;
rect.right = end.x + 18;
2024-10-08 11:54:16 -05:00
rect.top = end.y + DIMBLUPIY - 2;
rect.bottom = end.y + DIMBLUPIY;
2024-10-06 01:07:18 -05:00
bIsOpen = !DecorDetect(rect);
2024-10-08 11:54:16 -05:00
rect.left = end.x + DIMBLUPIX - 18;
rect.right = end.x + DIMBLUPIX - 2;
rect.top = end.y + DIMBLUPIY - 2;
rect.bottom = end.y + DIMBLUPIY;
2024-10-06 01:07:18 -05:00
bIsOpen2 = !DecorDetect(rect);
2024-08-31 23:22:24 -05:00
}
2024-10-06 01:07:18 -05:00
if (bIsOpen && !bIsOpen2)
2024-08-31 23:22:24 -05:00
{
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_ADVANCE;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
2024-10-06 01:07:18 -05:00
if (!bIsOpen && bIsOpen2)
2024-08-31 23:22:24 -05:00
{
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_ADVANCE;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
}
2024-10-08 11:54:16 -05:00
if (m_blupiAction == ACTION_STOP &&
m_blupiSkate &&
!m_blupiHelico &&
!m_blupiOver &&
!m_blupiBalloon &&
!m_blupiEcrase &&
!m_blupiNage &&
!m_blupiSurf &&
!m_blupiSuspend &&
m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
if (m_blupiTransport != -1)
{
2024-10-06 01:07:18 -05:00
AscenseurVertigo(m_blupiTransport, &bIsOpen, &bIsOpen2);
2024-08-31 23:22:24 -05:00
}
else
{
2024-10-05 17:42:17 -05:00
rect.left = end.x + 12;
rect.right = end.x + 19;
2024-10-08 11:54:16 -05:00
rect.top = end.y + DIMBLUPIY - 2;
rect.bottom = end.y + DIMBLUPIY;
2024-10-06 01:07:18 -05:00
bIsOpen = !DecorDetect(rect);
2024-10-08 11:54:16 -05:00
rect.left = end.x + DIMBLUPIX - 19;
rect.right = end.x + DIMBLUPIX - 12;
rect.top = end.y + DIMBLUPIY - 2;
rect.bottom = end.y + DIMBLUPIY;
2024-10-06 01:07:18 -05:00
bIsOpen2 = !DecorDetect(rect);
2024-08-31 23:22:24 -05:00
}
2024-10-06 01:07:18 -05:00
if (bIsOpen && !bIsOpen2)
2024-08-31 23:22:24 -05:00
{
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_ADVANCE;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
2024-10-06 01:07:18 -05:00
if (!bIsOpen && bIsOpen2)
2024-08-31 23:22:24 -05:00
{
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_ADVANCE;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
}
if (m_blupiFocus)
{
2024-10-08 11:54:16 -05:00
if (m_blupiAction == ACTION_VERTIGO && m_blupiPhase == 16)
2024-08-31 23:22:24 -05:00
{
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_RECEDE;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
}
2024-10-08 11:54:16 -05:00
if (m_blupiAction == ACTION_RECEDE && m_blupiPhase == 3)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
m_blupiActionOuf = 0;
}
num3 = 5;
if (m_blupiJeep)
{
num3 = 10;
}
if (m_blupiTank)
{
num3 = 10;
}
if (m_blupiSkate)
{
num3 = 10;
}
2024-10-08 11:54:16 -05:00
if (m_blupiAction == ACTION_ADVANCE && m_blupiPhase == num3)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
}
}
BlupiSearchIcon();
if (m_blupiShield)
{
if (m_blupiTimeShield == 10)
{
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_STOPSHIELD, m_blupiPos);
2024-08-31 23:22:24 -05:00
}
if (m_blupiTimeShield == 0)
{
2024-10-05 17:42:17 -05:00
m_blupiShield = FALSE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
}
else if (m_time % 5 == 0)
{
m_blupiTimeShield--;
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_POWER].SetLevel(m_blupiTimeShield);
2024-08-31 23:22:24 -05:00
}
}
if (m_blupiPower)
{
if (m_blupiTimeShield == 20)
{
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_STOPPOWER, m_blupiPos);
2024-08-31 23:22:24 -05:00
}
if (m_blupiTimeShield == 0)
{
2024-10-05 17:42:17 -05:00
m_blupiPower = FALSE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
}
else if (m_time % 3 == 0)
{
m_blupiTimeShield--;
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_POWER].SetLevel(m_blupiTimeShield);
2024-08-31 23:22:24 -05:00
}
}
if (m_blupiCloud)
{
if (m_blupiTimeShield == 25)
{
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_STOPCLOUD, m_blupiPos);
2024-08-31 23:22:24 -05:00
}
if (m_blupiTimeShield == 0)
{
2024-10-05 17:42:17 -05:00
m_blupiCloud = FALSE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
}
else if (m_time % 4 == 0)
{
m_blupiTimeShield--;
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_POWER].SetLevel(m_blupiTimeShield);
2024-08-31 23:22:24 -05:00
}
}
if (m_blupiHide)
{
if (m_blupiTimeShield == 20)
{
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_STOPHIDE, m_blupiPos);
2024-08-31 23:22:24 -05:00
}
if (m_blupiTimeShield == 0)
{
2024-10-05 17:42:17 -05:00
m_blupiHide = FALSE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
}
else if (m_time % 4 == 0)
{
m_blupiTimeShield--;
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_POWER].SetLevel(m_blupiTimeShield);
2024-08-31 23:22:24 -05:00
}
}
if (m_blupiInvert)
{
if (m_blupiTimeShield == 0)
{
2024-10-05 17:42:17 -05:00
m_blupiInvert = FALSE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
tinyPoint.x = m_blupiPos.x;
tinyPoint.y = m_blupiPos.y + 100;
2024-10-08 11:54:16 -05:00
ObjectStart(tinyPoint, TYPE_INVERTSTOP, -60);
2024-08-31 23:22:24 -05:00
tinyPoint.x = m_blupiPos.x;
tinyPoint.y = m_blupiPos.y - 100;
2024-10-08 11:54:16 -05:00
ObjectStart(tinyPoint, TYPE_INVERTSTOP, 60);
2024-08-31 23:22:24 -05:00
tinyPoint.x = m_blupiPos.x - 100;
tinyPoint.y = m_blupiPos.y;
2024-10-08 11:54:16 -05:00
ObjectStart(tinyPoint, TYPE_INVERTSTOP, 10);
2024-08-31 23:22:24 -05:00
tinyPoint.x = m_blupiPos.x + 100;
tinyPoint.y = m_blupiPos.y;
2024-10-08 11:54:16 -05:00
ObjectStart(tinyPoint, TYPE_INVERTSTOP, -10);
PlaySound(SOUND_INVERTSTOP, end);
2024-08-31 23:22:24 -05:00
}
else if (m_time % 3 == 0)
{
m_blupiTimeShield--;
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_POWER].SetLevel(m_blupiTimeShield);
2024-08-31 23:22:24 -05:00
}
}
if (m_blupiBalloon)
{
if (m_blupiTimeShield == 0)
{
2024-10-05 17:42:17 -05:00
m_blupiBalloon = FALSE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
tinyPoint.x = m_blupiPos.x - 34;
tinyPoint.y = m_blupiPos.y - 34;
2024-10-08 11:54:16 -05:00
ObjectStart(tinyPoint, TYPE_EXPLO6, 0);
PlaySound(SOUND_RESSORT, m_blupiPos);
2024-08-31 23:22:24 -05:00
}
else if (m_time % 2 == 0)
{
m_blupiTimeShield--;
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_POWER].SetLevel(m_blupiTimeShield);
2024-08-31 23:22:24 -05:00
}
}
if (m_blupiEcrase)
{
if (m_blupiTimeShield == 0)
{
2024-10-05 17:42:17 -05:00
m_blupiEcrase = FALSE;
m_blupiAir = TRUE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
2024-10-08 11:54:16 -05:00
ObjectStart(m_blupiPos, TYPE_INVERTSTART, -60);
ObjectStart(m_blupiPos, TYPE_INVERTSTART, 60);
ObjectStart(m_blupiPos, TYPE_INVERTSTART, 10);
ObjectStart(m_blupiPos, TYPE_INVERTSTART, -10);
2024-08-31 23:22:24 -05:00
tinyPoint.x = m_blupiPos.x - 34;
tinyPoint.y = m_blupiPos.y - 34;
2024-10-08 11:54:16 -05:00
ObjectStart(tinyPoint, TYPE_EXPLO5, 0);
PlaySound(SOUND_RESSORT, m_blupiPos);
2024-08-31 23:22:24 -05:00
}
else if (m_time % 2 == 0)
{
m_blupiTimeShield--;
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_POWER].SetLevel(m_blupiTimeShield);
2024-08-31 23:22:24 -05:00
}
}
if (m_blupiPower && abs(m_blupiPos.x - m_blupiPosMagic.x) + abs(m_blupiPos.y - m_blupiPosMagic.y) >= 40)
{
num = MoveObjectFree();
if (num != -1)
{
2024-10-08 11:54:16 -05:00
m_moveObject[num].type = TYPE_MAGICTRACK;
2024-08-31 23:22:24 -05:00
m_moveObject[num].phase = 0;
m_moveObject[num].posCurrent = m_blupiPos;
m_moveObject[num].posStart = m_moveObject[num].posCurrent;
m_moveObject[num].posEnd = m_moveObject[num].posCurrent;
2024-10-08 11:54:16 -05:00
m_moveObject[num].step = STEP_STOPSTART;
2024-08-31 23:22:24 -05:00
m_moveObject[num].time = 0;
MoveObjectStepIcon(num);
m_blupiPosMagic = m_blupiPos;
}
}
if (m_blupiShield && abs(m_blupiPos.x - m_blupiPosMagic.x) + abs(m_blupiPos.y - m_blupiPosMagic.y) >= 40)
{
num = MoveObjectFree();
if (num != -1)
{
2024-10-08 11:54:16 -05:00
m_moveObject[num].type = TYPE_SHIELDTRACK;
2024-08-31 23:22:24 -05:00
m_moveObject[num].phase = 0;
m_moveObject[num].posCurrent = m_blupiPos;
m_moveObject[num].posStart = m_moveObject[num].posCurrent;
m_moveObject[num].posEnd = m_moveObject[num].posCurrent;
2024-10-08 11:54:16 -05:00
m_moveObject[num].step = STEP_STOPSTART;
2024-08-31 23:22:24 -05:00
m_moveObject[num].time = 0;
MoveObjectStepIcon(num);
m_blupiPosMagic = m_blupiPos;
}
}
2024-10-08 11:54:16 -05:00
/* // winphone
2024-08-31 23:22:24 -05:00
if (m_blupiHide && abs(m_blupiPos.x - m_blupiPosMagic.x) + abs(m_blupiPos.y - m_blupiPosMagic.y) >= 10)
{
num = MoveObjectFree();
if (num != -1)
{
2024-10-08 11:54:16 -05:00
m_moveObject[num].type = TYPE_HIDETRACK;
2024-08-31 23:22:24 -05:00
m_moveObject[num].icon = m_blupiIcon;
2024-10-08 11:54:16 -05:00
m_moveObject[num].channel = CHBLUPI;
2024-08-31 23:22:24 -05:00
m_moveObject[num].phase = 0;
m_moveObject[num].posCurrent = m_blupiPos;
m_moveObject[num].posStart = m_moveObject[num].posCurrent;
m_moveObject[num].posEnd = m_moveObject[num].posCurrent;
2024-10-08 11:54:16 -05:00
m_moveObject[num].step = STEP_STOPSTART;
2024-08-31 23:22:24 -05:00
m_moveObject[num].time = 0;
MoveObjectStepIcon(num);
m_blupiPosMagic = m_blupiPos;
}
}
2024-10-08 11:54:16 -05:00
*/
2024-08-31 23:22:24 -05:00
if (m_blupiTimeNoAsc > 0)
{
m_blupiTimeNoAsc--;
}
if (m_blupiHelico && m_blupiPos.y > 2 && m_blupiFocus && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi)
{
2024-10-05 17:42:17 -05:00
rect = BlupiRect(end);
rect.top = end.y + 4;
rect.bottom = end.y + 20;
2024-08-31 23:22:24 -05:00
if (DecorDetect(rect))
{
2024-10-05 17:42:17 -05:00
StopBlupi();
m_blupiHelico = FALSE;
2024-08-31 23:22:24 -05:00
tinyPoint.x = m_blupiPos.x - 34;
tinyPoint.y = m_blupiPos.y - 34;
2024-10-08 11:54:16 -05:00
ObjectStart(tinyPoint, TYPE_EXPLO2, 0);
2024-08-31 23:22:24 -05:00
m_decorAction = 1;
m_decorPhase = 0;
2024-10-05 17:42:17 -05:00
StopVehicleSound();
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_BOUM, m_blupiPos);
2024-08-31 23:22:24 -05:00
}
}
if (!m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus)
{
if (!m_blupiNage && !m_blupiSurf && IsSurfWater(m_blupiPos))
{
m_scrollAdd.x = 0;
m_scrollAdd.y = 0;
2024-10-05 17:42:17 -05:00
m_blupiAir = FALSE;
m_blupiNage = FALSE;
m_blupiSurf = TRUE;
StopBlupi();
2024-08-31 23:22:24 -05:00
m_blupiVitesse.x = 0;
m_blupiVitesse.y = 0;
MoveObjectPlouf(m_blupiPos);
if (m_blupiTransport != -1)
{
m_blupiPos.y = m_blupiPos.y - 10;
m_blupiTransport = -1;
}
if (m_blupiCloud)
{
2024-10-05 17:42:17 -05:00
m_blupiCloud = FALSE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
}
}
if (!m_blupiNage && !IsSurfWater(m_blupiPos) && IsDeepWater(m_blupiPos))
{
if (!m_blupiSurf)
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
m_blupiVitesse.x = 0;
m_blupiVitesse.y = 0;
MoveObjectPlouf(m_blupiPos);
}
2024-10-05 17:42:17 -05:00
m_blupiAir = FALSE;
m_blupiSurf = FALSE;
m_blupiNage = TRUE;
2024-08-31 23:22:24 -05:00
m_blupiLevel = 100;
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_AIR].SetLevel(m_blupiLevel);
//m_jauges[JAUGE_AIR].SetMode(2);
m_jauges[JAUGE_AIR].SetHide(FALSE);
2024-08-31 23:22:24 -05:00
}
if (m_blupiNage && IsSurfWater(m_blupiPos))
{
2024-10-05 17:42:17 -05:00
m_blupiAir = FALSE;
m_blupiNage = FALSE;
m_blupiSurf = TRUE;
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_DROWN, m_blupiPos);
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_AIR].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
}
tinyPoint4.x = m_blupiPos.x;
2024-10-08 11:54:16 -05:00
tinyPoint4.y = m_blupiPos.y - DIMOBJY;
if ((m_blupiSurf || m_blupiNage) && (m_blupiPos.y % DIMOBJY == DIMOBJY - BLUPISURF || m_blupiPos.y % DIMOBJY == DIMOBJY / 2) && IsOutWater(tinyPoint4) && m_keyPress & KEY_JUMP)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiNage = FALSE;
m_blupiSurf = FALSE;
m_blupiAir = TRUE;
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_AIR;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
m_blupiVitesse.x = 0;
if (m_blupiPower)
{
m_blupiVitesse.y = -16;
}
else
{
m_blupiVitesse.y = -12;
}
MoveObjectTiplouf(m_blupiPos);
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_JUMP0, m_blupiPos);
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_AIR].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
}
if ((m_blupiSurf || m_blupiNage) && IsOutWater(m_blupiPos))
{
if (m_blupiVitesse.y < 0)
{
if (m_blupiTransport == -1)
{
m_blupiPos = blupiPos;
}
else
{
m_blupiTransport = -1;
2024-10-05 17:42:17 -05:00
m_blupiNage = FALSE;
m_blupiSurf = FALSE;
m_blupiAir = TRUE;
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_AIR;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
m_blupiPos.y = m_blupiPos.y - 10;
m_blupiVitesse.x = 0;
m_blupiVitesse.y = -10;
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_JUMP0, m_blupiPos);
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_AIR].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
}
}
else if (m_blupiVitesse.y > 0)
{
2024-10-05 17:42:17 -05:00
m_blupiNage = FALSE;
m_blupiSurf = FALSE;
m_blupiAir = FALSE;
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_AIR;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
m_blupiPos.y = m_blupiPos.y + 30;
m_blupiVitesse.x = 0;
m_blupiVitesse.y = 0;
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_JUMP0, m_blupiPos);
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_AIR].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
}
else
{
2024-10-05 17:42:17 -05:00
m_blupiNage = FALSE;
m_blupiSurf = FALSE;
m_blupiAir = FALSE;
StopBlupi();
2024-08-31 23:22:24 -05:00
m_blupiPos.y = m_blupiPos.y - 10;
m_blupiVitesse.x = 0;
m_blupiVitesse.y = 0;
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_JUMP0, m_blupiPos);
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_AIR].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
}
}
2024-10-08 11:54:16 -05:00
if ((m_blupiSurf || m_blupiNage) && m_blupiActionOuf != ACTION_OUF1a)
2024-08-31 23:22:24 -05:00
{
2024-10-08 11:54:16 -05:00
m_blupiActionOuf = ACTION_OUF1a;
2024-08-31 23:22:24 -05:00
m_blupiTimeOuf = 0;
}
}
if ((m_blupiHelico || m_blupiOver || m_blupiJeep || m_blupiTank || m_blupiSkate) && m_blupiFocus && (IsSurfWater(m_blupiPos) || IsDeepWater(m_blupiPos)))
{
2024-10-05 17:42:17 -05:00
StopBlupi();
m_blupiHelico = FALSE;
m_blupiOver = FALSE;
m_blupiJeep = FALSE;
m_blupiTank = FALSE;
m_blupiSkate = FALSE;
2024-08-31 23:22:24 -05:00
tinyPoint.x = m_blupiPos.x - 34;
tinyPoint.y = m_blupiPos.y - 34;
2024-10-08 11:54:16 -05:00
ObjectStart(tinyPoint, TYPE_EXPLO2, 0);
2024-08-31 23:22:24 -05:00
m_decorAction = 1;
m_decorPhase = 0;
2024-10-05 17:42:17 -05:00
StopVehicleSound();
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_BOUM, m_blupiPos);
2024-08-31 23:22:24 -05:00
}
if (m_blupiFocus && !m_blupiSuspend && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && m_blupiNoBarre == 0 && GetTypeBarre(m_blupiPos) == 1)
{
tinyPoint4.x = m_blupiPos.x;
2024-10-08 11:54:16 -05:00
tinyPoint4.y = (m_blupiPos.y + 22) / DIMOBJY * DIMOBJY + BLUPISUSPEND;
2024-08-31 23:22:24 -05:00
rect = BlupiRect(tinyPoint4);
2024-10-05 17:42:17 -05:00
if (!DecorDetect(rect, TRUE))
2024-08-31 23:22:24 -05:00
{
m_blupiPos = tinyPoint4;
2024-10-05 17:42:17 -05:00
m_blupiSuspend = TRUE;
m_blupiAir = FALSE;
StopBlupi();
2024-08-31 23:22:24 -05:00
m_blupiActionOuf = 0;
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_SUSPENDTOC, m_blupiPos);
2024-08-31 23:22:24 -05:00
}
}
if (m_blupiNoBarre > 0)
{
m_blupiNoBarre--;
}
if (IsVentillo(m_blupiPos))
{
if (m_blupiFocus && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi)
{
2024-10-08 11:54:16 -05:00
BlupiDead(ACTION_CLEAR1, ACTION_CLEAR2);
2024-08-31 23:22:24 -05:00
}
tinyPoint.x = m_blupiPos.x - 34;
tinyPoint.y = m_blupiPos.y - 34;
2024-10-08 11:54:16 -05:00
ObjectStart(tinyPoint, TYPE_EXPLO4, 0);
2024-08-31 23:22:24 -05:00
m_decorAction = 2;
m_decorPhase = 0;
2024-10-05 17:42:17 -05:00
StopVehicleSound();
2024-08-31 23:22:24 -05:00
PlaySound(10, m_blupiPos);
}
2024-10-05 17:42:17 -05:00
if (m_blupiAction != ACTION_STOPTANK && m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
num = IsWorld(m_blupiPos);
if (num != -1)
{
2024-10-05 17:42:17 -05:00
StopVehicleSound();
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_BYE, m_blupiPos);
m_blupiAction = ACTION_BYE;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
2024-10-05 17:42:17 -05:00
m_blupiFocus = FALSE;
m_blupiFront = TRUE;
2024-08-31 23:22:24 -05:00
}
}
2024-10-05 17:42:17 -05:00
int num27 = MoveObjectDetect(m_blupiPos, &bNear);
2024-08-31 23:22:24 -05:00
POINT tinyPoint5;
2024-10-08 11:54:16 -05:00
if (m_blupiAction != ACTION_CLEAR1 &&
m_blupiAction != ACTION_CLEAR2 &&
m_blupiAction != ACTION_CLEAR3 &&
m_blupiAction != ACTION_CLEAR4 &&
m_blupiAction != ACTION_CLEAR5 &&
m_blupiAction != ACTION_CLEAR6 &&
m_blupiAction != ACTION_CLEAR7 &&
m_blupiAction != ACTION_CLEAR8)
2024-08-31 23:22:24 -05:00
{
if (IsLave(m_blupiPos) && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi)
{
2024-10-08 11:54:16 -05:00
BlupiDead(ACTION_CLEAR3, -1);
2024-10-05 17:42:17 -05:00
m_blupiRestart = TRUE;
2024-10-08 11:54:16 -05:00
m_blupiPos.y = m_blupiPos.y / DIMOBJY * DIMOBJY + BLUPIOFFY;
PlaySound(SOUND_FALL, m_blupiPos);
2024-08-31 23:22:24 -05:00
}
if (IsPiege(m_blupiPos) && !m_blupiOver && !m_blupiJeep && !m_blupiTank && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus)
{
2024-10-08 11:54:16 -05:00
BlupiDead(ACTION_GLU, -1);
2024-10-05 17:42:17 -05:00
m_blupiRestart = TRUE;
m_blupiAir = TRUE;
2024-08-31 23:22:24 -05:00
ObjectStart(m_blupiPos, 53, 0);
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_GLU, m_blupiPos);
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (IsGoutte(m_blupiPos, FALSE) && !m_blupiOver && !m_blupiJeep && !m_blupiTank && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
2024-10-08 11:54:16 -05:00
BlupiDead(ACTION_GLU, -1);
2024-10-05 17:42:17 -05:00
m_blupiRestart = TRUE;
m_blupiAir = TRUE;
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_GLU, m_blupiPos);
2024-08-31 23:22:24 -05:00
}
if (IsScie(m_blupiPos) && !m_blupiOver && !m_blupiJeep && !m_blupiTank && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus)
{
2024-10-08 11:54:16 -05:00
BlupiDead(ACTION_CLEAR4, -1);
2024-10-05 17:42:17 -05:00
m_blupiFront = TRUE;
m_blupiRestart = TRUE;
m_blupiAir = TRUE;
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if ( (num27 == -1 || !bNear) && IsSwitch(m_blupiPos, tinyPoint) && !m_blupiOver && !m_blupiBalloon && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
ActiveSwitch(m_decor[tinyPoint.x][tinyPoint.y].icon == 385, tinyPoint);
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_SWITCH;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
2024-10-05 17:42:17 -05:00
m_blupiFocus = FALSE;
2024-08-31 23:22:24 -05:00
m_blupiVitesse.x = 0;
m_blupiVitesse.y = 0;
}
2024-10-05 17:42:17 -05:00
if (IsBlitz(m_blupiPos, FALSE) && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi)
2024-08-31 23:22:24 -05:00
{
2024-10-08 11:54:16 -05:00
BlupiDead(ACTION_CLEAR1, -1);
2024-10-05 17:42:17 -05:00
m_blupiRestart = TRUE;
m_blupiAir = TRUE;
2024-10-08 11:54:16 -05:00
m_blupiPos.y = m_blupiPos.y / DIMOBJY * DIMOBJY + BLUPIOFFY;
PlaySound(SOUND_FALL, m_blupiPos);
2024-08-31 23:22:24 -05:00
}
if (IsEcraseur(m_blupiPos) && !m_blupiEcrase && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiFocus)
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
m_blupiVitesse.x = 0;
m_blupiVitesse.y = 0;
2024-10-05 17:42:17 -05:00
m_blupiEcrase = TRUE;
m_blupiBalloon = FALSE;
m_blupiAir = FALSE;
m_blupiHelico = FALSE;
m_blupiOver = FALSE;
m_blupiJeep = FALSE;
m_blupiTank = FALSE;
m_blupiSkate = FALSE;
m_blupiNage = FALSE;
m_blupiSurf = FALSE;
m_blupiSuspend = FALSE;
m_blupiJumpAie = FALSE;
m_blupiShield = FALSE;
m_blupiPower = FALSE;
m_blupiCloud = FALSE;
m_blupiHide = FALSE;
2024-08-31 23:22:24 -05:00
m_blupiTimeShield = 100;
m_blupiPosMagic = m_blupiPos;
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_POWER].SetHide(FALSE);
2024-08-31 23:22:24 -05:00
if (!m_blupiJeep && !m_blupiTank)
{
2024-10-05 17:42:17 -05:00
StopVehicleSound();
2024-08-31 23:22:24 -05:00
}
2024-10-08 11:54:16 -05:00
PlaySound(SOUND_ECRASE, m_blupiPos);
ObjectStart(m_blupiPos, TYPE_INVERTSTART, -60);
ObjectStart(m_blupiPos, TYPE_INVERTSTART, 60);
ObjectStart(m_blupiPos, TYPE_INVERTSTART, 10);
ObjectStart(m_blupiPos, TYPE_INVERTSTART, -10);
2024-08-31 23:22:24 -05:00
tinyPoint.x = m_blupiPos.x - 34;
tinyPoint.y = m_blupiPos.y - 34;
2024-10-08 11:54:16 -05:00
ObjectStart(tinyPoint, TYPE_EXPLO5, 0);
2024-08-31 23:22:24 -05:00
m_decorAction = 2;
m_decorPhase = 0;
}
if (IsTeleporte(m_blupiPos) != -1 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiAir && m_blupiFocus && m_blupiPosHelico.x == -1)
{
2024-10-08 11:54:16 -05:00
m_blupiAction = ACTION_TELEPORTE;
2024-08-31 23:22:24 -05:00
m_blupiPhase = 0;
m_blupiVitesse.x = 0;
m_blupiVitesse.y = 0;
2024-10-05 17:42:17 -05:00
m_blupiFocus = FALSE;
2024-10-08 11:54:16 -05:00
m_blupiPos.x = m_blupiPos.x / DIMOBJX * DIMOBJX;
PlaySound(SOUND_TELEPORTE, m_blupiPos);
2024-08-31 23:22:24 -05:00
tinyPoint.x = m_blupiPos.x;
tinyPoint.y = m_blupiPos.y - 5;
ObjectStart(tinyPoint, 92, 0);
}
if (IsBridge(m_blupiPos, &tinyPoint2) && m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
2024-10-08 11:54:16 -05:00
tinyPoint2.x *= DIMOBJX;
tinyPoint2.y *= DIMOBJY;
ObjectStart(tinyPoint2, TYPE_BRIDGE, 0);
2024-08-31 23:22:24 -05:00
}
int num2 = IsDoor(m_blupiPos, &tinyPoint2);
2024-08-31 23:22:24 -05:00
if (num2 != -1 && (m_blupiCle & 1 << num2 - 334) != 0)
{
OpenDoor(tinyPoint2);
m_blupiCle &= ~(1 << num2 - 334);
tinyPoint.x = 520;
tinyPoint.y = 418;
tinyPoint5.x = tinyPoint2.x * 64 - m_posDecor.x;
tinyPoint5.y = tinyPoint2.y * 64 - m_posDecor.y;
2024-10-08 11:54:16 -05:00
VoyageInit(tinyPoint, tinyPoint5, 214 + (num2 - 334) * 7, 10);
2024-08-31 23:22:24 -05:00
}
}
if (!m_blupiHelico && !m_blupiSuspend && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiSkate && !m_blupiJeep && !m_blupiTank && !m_blupiJeep && m_blupiFocus)
{
num = MockeryDetect(m_blupiPos);
if (num != 0)
{
m_blupiActionOuf = num;
m_blupiTimeOuf = 0;
}
}
MoveObjectFollow(m_blupiPos);
num = num27;
2024-10-05 17:42:17 -05:00
if (num != -1 && !bNear && m_moveObject[num].type == 2 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && !m_blupiShield && !m_bSuperBlupi && m_blupiFocus)
2024-08-31 23:22:24 -05:00
{
m_blupiActionOuf = 48;
m_blupiTimeOuf = 0;
}
2024-10-05 17:42:17 -05:00
if (num != -1 && bNear)
2024-08-31 23:22:24 -05:00
{
if (m_moveObject[num].type == 13 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
m_scrollAdd.x = 0;
m_scrollAdd.y = 0;
2024-10-05 17:42:17 -05:00
m_blupiAir = FALSE;
m_blupiHelico = TRUE;
2024-08-31 23:22:24 -05:00
m_blupiVitesse.x = 0;
if (m_blupiCloud || m_blupiHide)
{
2024-10-05 17:42:17 -05:00
m_blupiCloud = FALSE;
m_blupiHide = FALSE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
}
}
if (m_moveObject[num].type == 46 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
m_scrollAdd.x = 0;
m_scrollAdd.y = 0;
2024-10-05 17:42:17 -05:00
m_blupiAir = FALSE;
m_blupiOver = TRUE;
2024-08-31 23:22:24 -05:00
m_blupiVitesse.x = 0;
if (m_blupiCloud || m_blupiHide)
{
2024-10-05 17:42:17 -05:00
m_blupiCloud = FALSE;
m_blupiHide = FALSE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
}
}
if (m_moveObject[num].type == 19 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
m_scrollAdd.x = 0;
m_scrollAdd.y = 0;
2024-10-05 17:42:17 -05:00
StopBlupi();
m_blupiAir = FALSE;
m_blupiJeep = TRUE;
2024-08-31 23:22:24 -05:00
m_blupiVitesse.x = 0;
if (m_blupiCloud || m_blupiHide)
{
2024-10-05 17:42:17 -05:00
m_blupiCloud = FALSE;
m_blupiHide = FALSE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
}
}
if ( m_moveObject[num].type == 28 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
m_scrollAdd.x = 0;
m_scrollAdd.y = 0;
2024-10-05 17:42:17 -05:00
StopBlupi();
m_blupiAir = FALSE;
m_blupiTank = TRUE;
2024-08-31 23:22:24 -05:00
m_blupiVitesse.x = 0;
if (m_blupiCloud || m_blupiHide)
{
2024-10-05 17:42:17 -05:00
m_blupiCloud = FALSE;
m_blupiHide = FALSE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
}
}
if (m_moveObject[num].type == 29 && m_blupiFocus && m_blupiBullet < 10)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x;
tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y;
tinyPoint5.x = 570;
tinyPoint5.y = 430;
2024-10-08 11:54:16 -05:00
VoyageInit(tinyPoint, tinyPoint5, 177, 10);
2024-08-31 23:22:24 -05:00
m_blupiBullet += 10;
if (m_blupiBullet > 10)
{
m_blupiBullet = 10;
}
}
if ( m_moveObject[num].type == 24 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus)
{
m_scrollAdd.x = 0;
m_scrollAdd.y = 0;
m_blupiAction = 42;
m_blupiPhase = 0;
2024-10-08 11:54:16 -05:00
m_blupiPos.y = m_moveObject[num].posCurrent.y / DIMOBJY * DIMOBJY + BLUPIOFFY;
2024-10-05 17:42:17 -05:00
m_blupiFocus = FALSE;
m_blupiAir = FALSE;
m_blupiSkate = TRUE;
2024-08-31 23:22:24 -05:00
m_blupiVitesse.x = 0;
if (m_blupiCloud || m_blupiHide)
{
2024-10-05 17:42:17 -05:00
m_blupiCloud = FALSE;
m_blupiHide = FALSE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
}
}
if ((m_moveObject[num].type == 3 || m_moveObject[num].type == 16 || m_moveObject[num].type == 96 || m_moveObject[num].type == 97) && m_blupiBalloon && m_blupiPosHelico.x == -1)
{
2024-10-05 17:42:17 -05:00
m_blupiBalloon = FALSE;
m_blupiAir = TRUE;
2024-08-31 23:22:24 -05:00
m_blupiTimeShield = 0;
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_POWER].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
m_decorAction = 0;
tinyPoint.x = m_blupiPos.x - 34;
tinyPoint.y = m_blupiPos.y - 34;
ObjectStart(tinyPoint, 91, 0);
PlaySound(41, m_blupiPos);
m_blupiPos.y = m_blupiPos.y + 4;
m_blupiVitesse.y = 0;
m_blupiPosHelico = m_blupiPos;
}
else if ((m_moveObject[num].type == 2 || m_moveObject[num].type == 3 || m_moveObject[num].type == 96 || m_moveObject[num].type == 97 || m_moveObject[num].type == 16 || m_moveObject[num].type == 4 || m_moveObject[num].type == 17 || m_moveObject[num].type == 20) && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiPosHelico.x == -1)
{
if (!m_blupiJeep && !m_blupiTank && !m_blupiSkate && (m_blupiFocus || m_blupiAction == 5 || m_blupiAction == 36))
{
if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase)
{
2024-10-05 17:42:17 -05:00
m_blupiAir = TRUE;
2024-08-31 23:22:24 -05:00
}
BlupiDead(11, 75);
}
if (m_moveObject[num].type == 17 || m_moveObject[num].type == 20)
{
tinyPoint = m_moveObject[num].posCurrent;
ObjectDelete(tinyPoint, m_moveObject[num].type);
tinyPoint.x -= 34;
tinyPoint.y -= 34;
ObjectStart(tinyPoint, 10, 0);
m_decorAction = 2;
m_decorPhase = 0;
}
else
{
tinyPoint = m_moveObject[num].posCurrent;
ObjectDelete(tinyPoint, m_moveObject[num].type);
tinyPoint.x -= 34;
tinyPoint.y -= 34;
ObjectStart(tinyPoint, 8, 0);
m_decorAction = 1;
m_decorPhase = 0;
}
if (!m_blupiJeep && !m_blupiTank)
{
2024-10-05 17:42:17 -05:00
StopVehicleSound();
2024-08-31 23:22:24 -05:00
}
PlaySound(10, m_moveObject[num].posCurrent);
}
if (m_moveObject[num].type == 44 && m_blupiFocus && !m_blupiBalloon && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi)
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
m_blupiVitesse.x = 0;
m_blupiVitesse.y = 0;
2024-10-05 17:42:17 -05:00
m_blupiBalloon = TRUE;
m_blupiEcrase = FALSE;
m_blupiAir = FALSE;
m_blupiHelico = FALSE;
m_blupiOver = FALSE;
m_blupiJeep = FALSE;
m_blupiTank = FALSE;
m_blupiSkate = FALSE;
m_blupiNage = FALSE;
m_blupiSurf = FALSE;
m_blupiSuspend = FALSE;
m_blupiJumpAie = FALSE;
m_blupiShield = FALSE;
m_blupiPower = FALSE;
m_blupiCloud = FALSE;
m_blupiHide = FALSE;
2024-08-31 23:22:24 -05:00
m_blupiTimeShield = 100;
m_blupiPosMagic = m_blupiPos;
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_POWER].SetHide(FALSE);
2024-08-31 23:22:24 -05:00
if (!m_blupiJeep && !m_blupiTank)
{
2024-10-05 17:42:17 -05:00
StopVehicleSound();
2024-08-31 23:22:24 -05:00
}
PlaySound(40, m_moveObject[num].posCurrent);
tinyPoint.x = m_blupiPos.x - 34;
tinyPoint.y = m_blupiPos.y - 34;
ObjectStart(tinyPoint, 90, 0);
m_decorAction = 5;
m_decorPhase = 0;
}
if (m_moveObject[num].type == 54 && m_moveObject[num].step != 2 && m_moveObject[num].step != 4 && m_blupiFocus && !m_blupiBalloon && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi)
{
tinyPoint.x = m_blupiPos.x;
tinyPoint.y = (m_blupiPos.y + 64 - 10) / 64 * 64 + 4;
ObjectStart(tinyPoint, 53, 0);
m_blupiAction = 54;
m_blupiPhase = 0;
2024-10-05 17:42:17 -05:00
m_blupiSuspend = FALSE;
m_blupiJumpAie = FALSE;
m_blupiFocus = FALSE;
m_blupiRestart = TRUE;
2024-10-06 01:07:18 -05:00
if (bAirStart)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiAir = TRUE;
2024-08-31 23:22:24 -05:00
}
if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase || m_blupiJeep || m_blupiTank || m_blupiSkate)
{
2024-10-05 17:42:17 -05:00
m_blupiHelico = FALSE;
m_blupiOver = FALSE;
m_blupiBalloon = FALSE;
m_blupiEcrase = FALSE;
m_blupiJeep = FALSE;
m_blupiTank = FALSE;
m_blupiSkate = FALSE;
2024-08-31 23:22:24 -05:00
tinyPoint = m_moveObject[num].posCurrent;
tinyPoint.x -= 34;
tinyPoint.y -= 34;
ObjectStart(tinyPoint, 10, 0);
2024-10-05 17:42:17 -05:00
StopVehicleSound();
2024-08-31 23:22:24 -05:00
PlaySound(10, m_moveObject[num].posCurrent);
m_decorAction = 1;
m_decorPhase = 0;
}
else
{
PlaySound(51, m_moveObject[num].posCurrent);
}
2024-10-05 17:42:17 -05:00
m_blupiCloud = FALSE;
m_blupiHide = FALSE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_moveObject[num].type == 23 && !m_blupiShield && !m_blupiHide && !m_bSuperBlupi && m_blupiAction != 13 && m_blupiAction != ACTION_BYE && m_blupiAction != 11 && m_blupiAction != 75 && m_blupiAction != 76 && m_blupiAction != 77 && m_blupiAction != 78 && m_blupiAction != 79 && m_blupiAction != ACTION_CLEAR7 && m_blupiAction != ACTION_CLEAR8 && m_blupiAction != ACTION_GLU && m_blupiAction != ACTION_ELECTRO && m_blupiAction != ACTION_HIDE)
2024-08-31 23:22:24 -05:00
{
tinyPoint = m_moveObject[num].posCurrent;
ObjectDelete(tinyPoint, m_moveObject[num].type);
m_blupiAction = 54;
m_blupiPhase = 0;
2024-10-05 17:42:17 -05:00
m_blupiSuspend = FALSE;
m_blupiJumpAie = FALSE;
m_blupiFocus = FALSE;
m_blupiRestart = TRUE;
2024-10-06 01:07:18 -05:00
if (bAirStart)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_blupiAir = TRUE;
2024-08-31 23:22:24 -05:00
}
if (m_blupiHelico || m_blupiOver || m_blupiBalloon || m_blupiEcrase || m_blupiJeep || m_blupiTank || m_blupiSkate)
{
2024-10-05 17:42:17 -05:00
m_blupiHelico = FALSE;
m_blupiOver = FALSE;
m_blupiBalloon = FALSE;
m_blupiEcrase = FALSE;
m_blupiJeep = FALSE;
m_blupiTank = FALSE;
m_blupiSkate = FALSE;
2024-08-31 23:22:24 -05:00
}
StartSploutchGlu(m_moveObject[num].posCurrent);
2024-10-05 17:42:17 -05:00
m_blupiCloud = FALSE;
m_blupiHide = FALSE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
}
if (m_moveObject[num].type == 5)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x;
tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y;
POINT end;
end.x = 430;
end.y = 430;
2024-10-08 11:54:16 -05:00
VoyageInit(tinyPoint, end, 6, 10);
2024-08-31 23:22:24 -05:00
ObjectStart(m_moveObject[num].posCurrent, 39, -60);
ObjectStart(m_moveObject[num].posCurrent, 39, 60);
ObjectStart(m_moveObject[num].posCurrent, 39, 10);
ObjectStart(m_moveObject[num].posCurrent, 39, -10);
}
if (m_moveObject[num].type == 49 && (m_voyageIcon != 215 || m_voyageChannel != 10) && (m_blupiCle & 1) == 0)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x;
tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y;
POINT end2;
end2.x = 520;
end2.y = 418;
2024-10-08 11:54:16 -05:00
VoyageInit(tinyPoint, end2, 215, 10);
2024-08-31 23:22:24 -05:00
ObjectStart(m_moveObject[num].posCurrent, 39, -60);
ObjectStart(m_moveObject[num].posCurrent, 39, 60);
ObjectStart(m_moveObject[num].posCurrent, 39, 10);
ObjectStart(m_moveObject[num].posCurrent, 39, -10);
}
if (m_moveObject[num].type == 50 && (m_voyageIcon != 222 || m_voyageChannel != 10) && (m_blupiCle & 2) == 0)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x;
tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y;
POINT end3;
end3.x = 530;
end3.y = 418;
2024-10-08 11:54:16 -05:00
VoyageInit(tinyPoint, end3, 222, 10);
2024-08-31 23:22:24 -05:00
ObjectStart(m_moveObject[num].posCurrent, 39, -60);
ObjectStart(m_moveObject[num].posCurrent, 39, 60);
ObjectStart(m_moveObject[num].posCurrent, 39, 10);
ObjectStart(m_moveObject[num].posCurrent, 39, -10);
}
if (m_moveObject[num].type == 51 && (m_voyageIcon != 229 || m_voyageChannel != 10) && (m_blupiCle & 4) == 0)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x;
tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y;
POINT end4;
end4.x = 540;
end4.y = 418;
2024-10-08 11:54:16 -05:00
VoyageInit(tinyPoint, end4, 229, 10);
2024-08-31 23:22:24 -05:00
ObjectStart(m_moveObject[num].posCurrent, 39, -60);
ObjectStart(m_moveObject[num].posCurrent, 39, 60);
ObjectStart(m_moveObject[num].posCurrent, 39, 10);
ObjectStart(m_moveObject[num].posCurrent, 39, -10);
}
if (m_moveObject[num].type == 6 && m_nbVies < 10 && m_blupiFocus)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x;
tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y;
2024-10-08 11:54:16 -05:00
VoyageInit(tinyPoint, VoyageGetPosVie(m_nbVies + 1), 21, 10);
2024-08-31 23:22:24 -05:00
}
if (m_moveObject[num].type == 25 && !m_blupiShield && !m_blupiHide && !m_blupiPower && m_blupiFocus)
{
PlaySound(42, m_moveObject[num].posCurrent);
2024-10-05 17:42:17 -05:00
m_blupiShield = TRUE;
m_blupiPower = FALSE;
m_blupiCloud = FALSE;
m_blupiHide = FALSE;
2024-08-31 23:22:24 -05:00
m_blupiTimeShield = 100;
m_blupiPosMagic = m_blupiPos;
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_POWER].SetHide(FALSE);
2024-08-31 23:22:24 -05:00
}
if ( m_moveObject[num].type == 26 && !m_blupiShield && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
m_blupiAction = 49;
m_blupiPhase = 0;
2024-10-05 17:42:17 -05:00
m_blupiCloud = FALSE;
m_blupiHide = FALSE;
m_blupiFocus = FALSE;
PlaySound(50, end);
2024-08-31 23:22:24 -05:00
}
if (m_moveObject[num].type == 40 && !m_blupiHide && m_blupiFocus)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
2024-10-05 17:42:17 -05:00
m_blupiInvert = TRUE;
2024-08-31 23:22:24 -05:00
m_blupiTimeShield = 100;
m_blupiPosMagic = m_blupiPos;
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_POWER].SetHide(FALSE);
PlaySound(66, end);
2024-08-31 23:22:24 -05:00
ObjectStart(m_blupiPos, 41, -60);
ObjectStart(m_blupiPos, 41, 60);
ObjectStart(m_blupiPos, 41, 10);
ObjectStart(m_blupiPos, 41, -10);
}
if ( m_moveObject[num].type == 30 && !m_blupiShield && !m_blupiCloud && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
m_blupiAction = 55;
m_blupiPhase = 0;
2024-10-05 17:42:17 -05:00
m_blupiShield = FALSE;
m_blupiPower = FALSE;
m_blupiJumpAie = FALSE;
m_blupiFocus = FALSE;
PlaySound(57, end);
2024-08-31 23:22:24 -05:00
}
if (m_moveObject[num].type == 31 && !m_blupiShield && !m_blupiHide && !m_blupiPower && !m_blupiCloud && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && m_blupiFocus)
{
m_blupiAction = 56;
m_blupiPhase = 0;
2024-10-05 17:42:17 -05:00
m_blupiShield = FALSE;
m_blupiPower = FALSE;
m_blupiJumpAie = FALSE;
m_blupiFocus = FALSE;
m_blupiCloud = TRUE;
2024-08-31 23:22:24 -05:00
m_blupiTimeShield = 100;
2024-10-05 17:42:17 -05:00
PlaySound(58, end);
2024-08-31 23:22:24 -05:00
if (m_blupiHide)
{
2024-10-05 17:42:17 -05:00
m_blupiHide = FALSE;
m_jauges[JAUGE_POWER].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
}
}
if (m_moveObject[num].type >= 200 && m_moveObject[num].type <= 203 && m_blupiFocus)
{
if (m_moveObject[num].type == 200)
{
if (m_blupiPerso < 5 )
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x;
tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y;
tinyPoint5.x = 0;
tinyPoint5.y = 438;
2024-10-08 11:54:16 -05:00
VoyageInit(tinyPoint, tinyPoint5, 108, 4);
2024-08-31 23:22:24 -05:00
}
}
else if (!m_blupiShield && !m_blupiHide && !m_bSuperBlupi)
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
BlupiDead(11, 75);
tinyPoint = m_moveObject[num].posCurrent;
tinyPoint.x -= 34;
tinyPoint.y -= 34;
ObjectStart(tinyPoint, 10, 0);
PlaySound(10, m_moveObject[num].posCurrent);
m_decorAction = 1;
m_decorPhase = 0;
}
}
if (m_moveObject[num].type == 55 && m_blupiFocus && m_blupiDynamite == 0 && (m_voyageIcon != 252 || m_voyageChannel != 10) )
{
ObjectDelete(m_moveObject[num].posCurrent, m_moveObject[num].type);
tinyPoint.x = m_moveObject[num].posCurrent.x - m_posDecor.x;
tinyPoint.y = m_moveObject[num].posCurrent.y - m_posDecor.y;
tinyPoint5.x = 505;
tinyPoint5.y = 414;
2024-10-08 11:54:16 -05:00
VoyageInit(tinyPoint, tinyPoint5, 252, 10);
2024-08-31 23:22:24 -05:00
m_blupiAction = 86;
m_blupiPhase = 0;
2024-10-05 17:42:17 -05:00
m_blupiFocus = FALSE;
2024-08-31 23:22:24 -05:00
}
if (m_moveObject[num].type == 12 && !m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && !m_blupiSuspend && m_blupiFocus && m_blupiAction == 2)
{
2024-10-05 17:42:17 -05:00
end = m_moveObject[num].posCurrent;
if (m_blupiDir == DIR_LEFT && m_blupiPos.x > end.x)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.x = m_blupiPos.x - 59;
PlaySound(38, end);
2024-08-31 23:22:24 -05:00
m_blupiActionOuf = 45;
m_blupiTimeOuf = 0;
m_blupiAction = 14;
m_blupiPhase = 0;
}
2024-10-05 17:42:17 -05:00
if (m_blupiDir == DIR_RIGHT && m_blupiPos.x < end.x)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.x = m_blupiPos.x + 55;
PlaySound(38, end);
2024-08-31 23:22:24 -05:00
m_blupiActionOuf = 45;
m_blupiTimeOuf = 0;
m_blupiAction = 14;
m_blupiPhase = 0;
}
2024-10-05 17:42:17 -05:00
if (!TestPushCaisse(num, end, FALSE))
2024-08-31 23:22:24 -05:00
{
m_blupiPos.x = blupiPos.x;
}
}
if ((m_moveObject[num].type == 7 || m_moveObject[num].type == 21) && m_blupiFocus)
{
if (m_goalPhase == 0)
{
if (m_nbTresor >= m_totalTresor)
{
if (m_moveObject[num].type == 21)
{
2024-10-05 17:42:17 -05:00
m_bFoundCle = TRUE;
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
StopVehicleSound();
2024-08-31 23:22:24 -05:00
PlaySound(14, m_moveObject[num].posCurrent);
m_blupiAction = 13;
m_blupiPhase = 0;
2024-10-05 17:42:17 -05:00
m_blupiFocus = FALSE;
m_blupiFront = TRUE;
2024-08-31 23:22:24 -05:00
m_blupiPos.y = m_moveObject[num].posCurrent.y;
}
else
{
PlaySound(13, m_moveObject[num].posCurrent);
}
m_goalPhase = 50;
}
else
{
m_goalPhase--;
}
}
else
{
m_goalPhase = 0;
}
}
else
{
m_goalPhase = 0;
}
if (m_blupiAction == 14 && m_blupiFocus)
{
num = CaisseInFront();
if (num != -1)
{
2024-10-05 17:42:17 -05:00
end = m_moveObject[num].posCurrent;
if (m_blupiDir == DIR_LEFT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.x = m_blupiPos.x - 59;
2024-08-31 23:22:24 -05:00
}
else
{
2024-10-05 17:42:17 -05:00
end.x = m_blupiPos.x + 55;
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (!TestPushCaisse(num, end, FALSE))
2024-08-31 23:22:24 -05:00
{
m_blupiPos.x = blupiPos.x;
}
}
else
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
}
}
if (m_blupiAction == 29 && m_blupiFocus)
{
num = CaisseInFront();
if (num != -1)
{
2024-10-05 17:42:17 -05:00
end = m_moveObject[num].posCurrent;
if (m_blupiDir == DIR_LEFT)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
end.x = m_blupiPos.x - 59;
2024-08-31 23:22:24 -05:00
}
else
{
2024-10-05 17:42:17 -05:00
end.x = m_blupiPos.x + 55;
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (!TestPushCaisse(num, end, TRUE))
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
}
}
else
{
2024-10-05 17:42:17 -05:00
StopBlupi();
2024-08-31 23:22:24 -05:00
}
}
if (!m_blupiHelico && !m_blupiOver && !m_blupiBalloon && !m_blupiEcrase && !m_blupiJeep && !m_blupiTank && !m_blupiSkate && !m_blupiNage && !m_blupiSurf && m_blupiFocus)
{
if (m_blupiActionOuf == 44 && m_blupiAction == 1)
{
if (m_blupiTimeOuf > 50)
{
m_blupiAction = m_blupiActionOuf;
m_blupiPhase = 0;
PlaySound(46, m_blupiPos);
}
m_blupiActionOuf = 0;
}
if (m_blupiActionOuf == 45 && m_blupiAction == 1)
{
if (m_blupiTimeOuf > 50)
{
m_blupiAction = m_blupiActionOuf;
m_blupiPhase = 0;
}
m_blupiActionOuf = 0;
}
if (m_blupiAction == 45 && m_blupiPhase == 4)
{
PlaySound(46, m_blupiPos);
}
if (m_blupiActionOuf == 65 && m_blupiAction == 1)
{
if (m_blupiTimeOuf > 10 && m_blupiTimeOuf < 50)
{
m_blupiAction = m_blupiActionOuf;
m_blupiPhase = 0;
}
m_blupiActionOuf = 0;
}
if (m_blupiActionOuf == 47 && m_blupiAction == 1)
{
if (m_blupiTimeOuf > 60)
{
m_blupiAction = m_blupiActionOuf;
m_blupiPhase = 0;
PlaySound(48, m_blupiPos);
}
m_blupiActionOuf = 0;
}
if (m_blupiActionOuf == 48 && m_blupiAction == 1)
{
if (m_blupiTimeOuf < 10)
{
m_blupiAction = m_blupiActionOuf;
m_blupiPhase = 0;
PlaySound(49, m_blupiPos);
}
m_blupiActionOuf = 0;
}
if ((m_blupiActionOuf == 63 || m_blupiActionOuf == 64 || m_blupiActionOuf == 83) && m_blupiAction == 1)
{
if (m_blupiTimeOuf < 20)
{
m_blupiAction = m_blupiActionOuf;
m_blupiPhase = 0;
}
m_blupiActionOuf = 0;
}
}
if (m_blupiAction == 2 && m_blupiActionOuf != 63 && m_blupiActionOuf != 64 && m_blupiActionOuf != 83 && !m_blupiSurf && !m_blupiNage)
{
m_blupiActionOuf = 0;
}
if (m_blupiActionOuf != 0)
{
m_blupiTimeOuf++;
}
if (m_blupiTimeMockery > 0)
{
m_blupiTimeMockery--;
}
if (m_blupiAction == 86 && m_blupiPhase == 18)
{
2024-10-05 17:42:17 -05:00
StopBlupi(TRUE);
2024-08-31 23:22:24 -05:00
}
if (m_blupiAction == 87 && m_blupiPhase == 26)
{
2024-10-05 17:42:17 -05:00
StopBlupi(TRUE);
2024-08-31 23:22:24 -05:00
}
if (m_blupiPos.x - 30 > m_blupiPosHelico.x || m_blupiPos.x + 30 < m_blupiPosHelico.x || m_blupiPos.y - 30 > m_blupiPosHelico.y || m_blupiPos.y + 30 < m_blupiPosHelico.y)
{
m_blupiPosHelico.x = -1;
}
if (m_blupiTimeFire > 0)
{
m_blupiTimeFire--;
}
if (m_blupiAction == 74 && m_blupiPhase == 128)
{
2024-10-15 13:41:43 -05:00
POINT blupiPos2 = { 0,0 };
2024-08-31 23:22:24 -05:00
if (SearchTeleporte(m_blupiPos, blupiPos2))
{
m_blupiPos = blupiPos2;
ObjectStart(m_blupiPos, 27, 20);
ObjectStart(m_blupiPos, 27, -20);
}
2024-10-05 17:42:17 -05:00
m_blupiFocus = TRUE;
2024-08-31 23:22:24 -05:00
m_blupiPosHelico = m_blupiPos;
}
if (m_blupiAction == 82 && m_blupiPhase == 10)
{
2024-10-05 17:42:17 -05:00
StopBlupi(TRUE);
2024-08-31 23:22:24 -05:00
}
2024-10-05 17:42:17 -05:00
if (m_keyPress & KEY_FIRE && m_blupiAction == 1)
2024-08-31 23:22:24 -05:00
{
m_blupiAction = 84;
m_blupiPhase = 0;
PlaySound(27, m_blupiPos);
}
if ((m_blupiAction == 11 && m_blupiPhase == 70) || (m_blupiAction == 75 && m_blupiPhase == 100) || (m_blupiAction == 76 && m_blupiPhase == 70) || (m_blupiAction == 77 && m_blupiPhase == 110) || (m_blupiAction == 78 && m_blupiPhase == 90) || (m_blupiAction == 79 && m_blupiPhase == 90) || (m_blupiAction == 80 && m_blupiPhase == 90) || (m_blupiAction == 81 && m_blupiPhase == 90) || (m_blupiAction == 24 && m_blupiPhase == 90) || (m_blupiAction == 54 && m_blupiPhase == 100) || (m_blupiAction == 57 && m_blupiPhase == 90))
{
if (m_nbVies > 0)
{
m_blupiAction = 35;
m_blupiIcon = -1;
m_blupiPhase = 0;
if (m_blupiRestart)
{
m_blupiPos = m_blupiValidPos;
}
POINT posDecor = GetPosDecor(m_blupiPos);
tinyPoint.x = m_blupiPos.x - posDecor.x - 30;
tinyPoint.y = m_blupiPos.y - posDecor.y;
2024-10-08 11:54:16 -05:00
VoyageInit(VoyageGetPosVie(m_nbVies), tinyPoint, 48, 2);
2024-08-31 23:22:24 -05:00
}
else
{
m_nbVies = -1;
m_term = -1;
DoorsLost();
}
2024-10-05 17:42:17 -05:00
m_blupiFront = FALSE;
2024-08-31 23:22:24 -05:00
}
if (m_dimDecor.y == 0)
{
num3 = 480;
}
else
{
num3 = 6400;
}
if (m_blupiPos.y >= num3 + 1 && m_blupiPos.y <= num3 + 40)
{
PlaySound(8, m_blupiPos);
}
if (m_blupiPos.y > num3 + 1000)
{
m_term = -1;
DoorsLost();
}
if (m_blupiAction == 13 && m_blupiPhase == 40)
{
if (m_bPrivate)
{
m_term = 1;
}
else if (m_mission == 1)
{
m_term = 199;
}
else if (m_mission == 199)
{
m_term = -2;
}
else if (m_bFoundCle)
{
OpenGoldsWin();
m_term = 1;
}
else
{
OpenDoorsWin();
m_term = m_mission / 10 * 10;
}
}
2024-10-06 01:07:18 -05:00
if (m_blupiAction == ACTION_BYE && m_blupiPhase == 30)
2024-08-31 23:22:24 -05:00
{
2024-10-06 01:07:18 -05:00
;
2024-08-31 23:22:24 -05:00
num = IsWorld(m_blupiPos);
if (num != -1)
{
if (m_mission == 1)
{
m_term = num * 10;
}
else if (num == 199)
{
m_term = 1;
}
else
{
m_term = m_mission / 10 * 10 + num;
}
}
}
2024-10-05 17:42:17 -05:00
if (lastBlupiAction == 63 && m_blupiAction != 63)
2024-08-31 23:22:24 -05:00
{
StopSound(65);
}
2024-10-05 17:42:17 -05:00
if (lastBlupiAction == 64 && m_blupiAction != 64)
2024-08-31 23:22:24 -05:00
{
StopSound(65);
}
2024-10-05 17:42:17 -05:00
if (lastBlupiAction == 83 && m_blupiAction != ACTION_MOCKERYp)
2024-08-31 23:22:24 -05:00
{
StopSound(47);
}
if (m_blupiFocus && !m_blupiAir && (!m_blupiHelico || BlupiIsGround()) && (!m_blupiOver || BlupiIsGround()) && !m_blupiBalloon && !m_blupiEcrase && !m_blupiShield && !m_blupiHide && !bIsOpen && !bIsOpen2 && m_blupiTransport == -1 && !IsLave(m_blupiPos) && !IsPiege(m_blupiPos) && !IsGoutte(m_blupiPos, TRUE) && !IsScie(m_blupiPos) && !IsBridge(m_blupiPos, &tinyPoint) && IsTeleporte(m_blupiPos) == -1 && !IsBlitz(m_blupiPos, TRUE) && !IsTemp(m_blupiPos) && !IsBalleTraj(m_blupiPos) && !IsMoveTraj(m_blupiPos))
2024-08-31 23:22:24 -05:00
{
if (m_blupiFifoNb > 0)
{
m_blupiValidPos = m_blupiFifoPos[0];
}
BlupiAddFifo(m_blupiPos);
}
2024-10-05 17:42:17 -05:00
end.x = m_blupiPos.x + 30 + m_scrollAdd.x;
end.y = m_blupiPos.y + 30 + m_scrollAdd.y;
int num28 = abs(m_scrollPoint.x - end.x);
int num29 = abs(m_scrollPoint.y - end.y);
2024-08-31 23:22:24 -05:00
num4 = SCROLL_SPEED;
if (num28 > SCROLL_MARGX * 2)
{
num4 += (num28 - SCROLL_MARGX * 2) / 4;
}
if (num29 > SCROLL_MARGY * 2)
{
num4 += (num29 - SCROLL_MARGY * 2) / 4;
}
2024-10-05 17:42:17 -05:00
if (m_scrollPoint.x < end.x)
2024-08-31 23:22:24 -05:00
{
m_scrollPoint.x = m_scrollPoint.x + num4;
2024-10-05 17:42:17 -05:00
if (m_scrollPoint.x >= end.x)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_scrollPoint.x = end.x;
2024-08-31 23:22:24 -05:00
}
}
2024-10-05 17:42:17 -05:00
if (m_scrollPoint.x > end.x)
2024-08-31 23:22:24 -05:00
{
m_scrollPoint.x = m_scrollPoint.x - num4;
2024-10-05 17:42:17 -05:00
if (m_scrollPoint.x <= end.x)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_scrollPoint.x = end.x;
2024-08-31 23:22:24 -05:00
}
}
2024-10-05 17:42:17 -05:00
if (m_scrollPoint.y < end.y)
2024-08-31 23:22:24 -05:00
{
m_scrollPoint.y = m_scrollPoint.y + num4;
2024-10-05 17:42:17 -05:00
if (m_scrollPoint.y >= end.y)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_scrollPoint.y = end.y;
2024-08-31 23:22:24 -05:00
}
}
2024-10-05 17:42:17 -05:00
if (m_scrollPoint.y > end.y)
2024-08-31 23:22:24 -05:00
{
m_scrollPoint.y = m_scrollPoint.y - num4;
2024-10-05 17:42:17 -05:00
if (m_scrollPoint.y <= end.y)
2024-08-31 23:22:24 -05:00
{
2024-10-05 17:42:17 -05:00
m_scrollPoint.y = end.y;
2024-08-31 23:22:24 -05:00
}
}
if (m_blupiAction != 75 && m_blupiAction != 76)
{
m_posDecor = GetPosDecor(m_scrollPoint);
}
if (m_time % 4 == 0)
{
//PosSound(m_blupiPos);
}
VoyageStep();
m_lastKeyPress = m_keyPress;
2024-10-06 01:07:18 -05:00
// DEBUG v
sprintf(m_notifText[0], "blupiAction %d", m_blupiAction);
sprintf(m_notifText[1], "blupiIcon %d", m_blupiIcon);
2024-10-06 01:07:18 -05:00
sprintf(m_notifText[2], "blupiPos { %d, %d }", m_blupiPos.x, m_blupiPos.y);
sprintf(m_notifText[3], "blupiVitesse { %d, %d }", m_blupiVitesse.x, m_blupiVitesse.y);
sprintf(m_notifText[4], "time %d", m_time);
m_notifTime = 200;
// DEBUG ^
2024-08-31 23:22:24 -05:00
}
2024-09-23 20:35:15 -05:00
2024-10-05 17:42:17 -05:00
2024-08-31 23:22:24 -05:00
void CDecor::BlupiDead(int action1, int action2)
{
if (action2 == -1)
{
m_blupiAction = action1;
}
else
{
m_blupiAction = ((rand() % 2 == 0) ? action1 : action2);
}
m_blupiPhase = 0;
m_blupiFocus = FALSE;
m_blupiHelico = FALSE;
m_blupiOver = FALSE;
m_blupiJeep = FALSE;
m_blupiTank = FALSE;
m_blupiSkate = FALSE;
m_blupiNage = FALSE;
m_blupiSurf = FALSE;
m_blupiVent = FALSE;
m_blupiSuspend = FALSE;
m_blupiJumpAie = FALSE;
m_blupiShield = FALSE;
m_blupiPower = FALSE;
m_blupiCloud = FALSE;
m_blupiHide = FALSE;
m_blupiInvert = FALSE;
m_blupiBalloon = FALSE;
m_blupiEcrase = FALSE;
m_blupiRestart = FALSE;
m_blupiActionOuf = 0;
2024-10-05 17:42:17 -05:00
m_jauges[JAUGE_AIR].SetHide(TRUE);
m_jauges[JAUGE_POWER].SetHide(TRUE);
2024-08-31 23:22:24 -05:00
StopSound(SOUND_HELICOHIGH);
StopSound(SOUND_HELICOLOW);
StopSound(SOUND_JEEPHIGH);
StopSound(SOUND_JEEPLOW);
POINT pos;
POINT pos2;
if (m_blupiAction == ACTION_CLEAR2)
{
pos.x = m_blupiPos.x - m_posDecor.x;
pos.y = m_blupiPos.y - m_posDecor.y;
pos2.x = m_blupiPos.x - m_posDecor.x;
pos2.y = m_blupiPos.y - m_posDecor.y - 300;
2024-10-08 11:54:16 -05:00
VoyageInit(pos, pos2, 230, 10);
2024-08-31 23:22:24 -05:00
PlaySound(SOUND_ANGEL, m_blupiPos);
}
if (m_blupiAction == ACTION_CLEAR3)
{
pos.x = m_blupiPos.x - m_posDecor.x;
pos.y = m_blupiPos.y - m_posDecor.y;
pos2.x = m_blupiPos.x - m_posDecor.x;
pos2.y = m_blupiPos.y - m_posDecor.y - 2000;
2024-10-08 11:54:16 -05:00
VoyageInit(pos, pos2, 40, 10);
2024-08-31 23:22:24 -05:00
PlaySound(SOUND_ANGEL, m_blupiPos);
}
if (m_blupiAction == ACTION_CLEAR4)
{
ObjectStart(m_blupiPos, TYPE_INVERTSTART, -70);
ObjectStart(m_blupiPos, TYPE_INVERTSTART, 20);
ObjectStart(m_blupiPos, TYPE_INVERTSTART, -20);
PlaySound(SOUND_SCIE, m_blupiPos);
}
}
POINT CDecor::GetPosDecor(POINT pos)
{
POINT result;
2024-09-29 00:58:24 -05:00
if (this->m_dimDecor.x)
2024-08-31 23:22:24 -05:00
{
result.x = pos.x - LXIMAGE / 2;
2024-09-29 00:58:24 -05:00
if (result.x < 0) result.x = 0;
if (result.x > MAXCELX * DIMOBJX - LXIMAGE) result.x = MAXCELX * DIMOBJX - LXIMAGE;
2024-08-31 23:22:24 -05:00
}
2024-09-29 00:58:24 -05:00
else result.x = 0;
if (this->m_dimDecor.y)
2024-08-31 23:22:24 -05:00
{
result.y = pos.y - LYIMAGE / 2;
2024-09-29 00:58:24 -05:00
if (result.y < 0) result.y = 0;
if (result.y > MAXCELY * DIMOBJY - LYIMAGE) result.y = MAXCELY * DIMOBJY - LYIMAGE;
2024-08-31 23:22:24 -05:00
}
2024-09-29 00:58:24 -05:00
else result.y = 0;
2024-08-31 23:22:24 -05:00
return result;
}
void CDecor::BlupiAddFifo(POINT pos)
{
if (m_blupiFifoNb < 10)
{
if (m_blupiFifoNb > 0 && pos.x == m_blupiFifoPos[m_blupiFifoNb - 1].x && pos.y == m_blupiFifoPos[m_blupiFifoNb - 1].y)
{
return;
}
m_blupiFifoPos[m_blupiFifoNb] = pos;
m_blupiFifoNb++;
return;
}
else
{
if (pos.x == m_blupiFifoPos[9].x && pos.y == m_blupiFifoPos[9].y)
{
return;
}
for (int i = 0; i < 9; i++)
{
m_blupiFifoPos[i] = m_blupiFifoPos[i + 1];
}
m_blupiFifoPos[9] = pos;
return;
}
}
BOOL CDecor::DecorDetect(RECT rect, BOOL bCaisse)
{
m_detectIcon = -1;
if (rect.left < 0 || rect.top < 0)
{
return TRUE;
}
int num;
if (m_dimDecor.x == 0)
{
num = 640;
}
else
{
num = 6400;
}
if (rect.right > num)
{
return TRUE;
}
if (m_blupiHelico ||
m_blupiOver ||
m_blupiBalloon ||
m_blupiEcrase ||
m_blupiNage ||
m_blupiSurf)
{
if (m_dimDecor.y == 0)
{
num = 480;
}
else
{
num = 6400;
}
if (rect.bottom > num)
{
return TRUE;
}
}
int num2 = rect.left / 16;
int num3 = (rect.right + 16 - 1) / 16;
int num4 = rect.top / 16;
int num5 = (rect.bottom + 16 - 1) / 16;
RECT src;
for (int i = num4; i <= num5; i++)
{
for (int j = num2; j <= num3; j++)
{
int num6 = j / 4;
int num7 = i / 4;
if (num6 >= 0 && num6 < 100 && num7 >= 0 && num7 < 100)
{
int icon = m_decor[num6][num7].icon;
if (icon >= 0 && icon < MAXQUART && (!m_blupiHelico || icon != 214) && (m_blupiOver || icon != 214) && (icon != 324 || m_time / 4 % 20 < 18))
{
num6 = j % 4;
num7 = i % 4;
if (table_decor_quart[icon * 16 + num7 * 4 + num6] != 0)
{
src.left = j * 16;
src.right = src.left + 16;
src.top = i * 16;
src.bottom = src.top + 16;
RECT tinyRect;
2024-09-12 12:48:11 -05:00
if (IntersectRect(&tinyRect, &src, &rect))
2024-08-31 23:22:24 -05:00
{
m_detectIcon = icon;
return TRUE;
}
}
}
}
}
}
if (!bCaisse)
{
return FALSE;
}
for (int k = 0; k < m_nbRankCaisse; k++)
{
int num8 = m_rankCaisse[k];
src.left = m_moveObject[num8].posCurrent.x;
src.right = m_moveObject[num8].posCurrent.x + 64;
src.top = m_moveObject[num8].posCurrent.y;
src.bottom = m_moveObject[num8].posCurrent.y + 64;
RECT tinyRect;
2024-09-12 12:48:11 -05:00
if (IntersectRect(&tinyRect, &src, &rect))
2024-08-31 23:22:24 -05:00
{
m_detectIcon = m_moveObject[num8].icon;
return TRUE;
}
}
return FALSE;
}
2024-09-23 20:35:15 -05:00
BOOL CDecor::TestPath(RECT rect, POINT start, POINT *end)
2024-08-31 23:22:24 -05:00
{
2024-09-23 20:35:15 -05:00
int num = abs(end->x - start.x);
int num2 = abs(end->y - start.y);
2024-08-31 23:22:24 -05:00
POINT tinyPoint = start;
if (num > num2)
{
RECT rect2;
2024-09-23 20:35:15 -05:00
if (end->x > start.x)
2024-08-31 23:22:24 -05:00
{
for (int i = 0; i <= num; i++)
{
2024-09-23 20:35:15 -05:00
int j = i * (end->y - start.y) / num;
2024-08-31 23:22:24 -05:00
rect2.left = rect.left + i;
rect2.right = rect.right + i;
rect2.top = rect.top + j;
rect2.bottom = rect.bottom + j;
if (DecorDetect(rect2))
{
2024-09-23 20:35:15 -05:00
*end = tinyPoint;
2024-08-31 23:22:24 -05:00
return FALSE;
}
tinyPoint.x = start.x + i;
tinyPoint.y = start.y + j;
}
}
2024-09-23 20:35:15 -05:00
if (end->x < start.x)
2024-08-31 23:22:24 -05:00
{
for (int i = 0; i >= -num; i--)
{
2024-09-23 20:35:15 -05:00
int j = i * (start.y - end->y) / num;
2024-08-31 23:22:24 -05:00
rect2.left = rect.left + i;
rect2.right = rect.right + i;
rect2.top = rect.top + j;
rect2.bottom = rect.bottom + j;
if (DecorDetect(rect2))
{
2024-09-23 20:35:15 -05:00
*end = tinyPoint;
2024-08-31 23:22:24 -05:00
return FALSE;
}
tinyPoint.x = start.x + i;
tinyPoint.y = start.y + j;
}
}
}
else
{
RECT rect2;
2024-09-23 20:35:15 -05:00
if (end->y > start.y)
2024-08-31 23:22:24 -05:00
{
for (int j = 0; j <= num2; j++)
{
2024-09-23 20:35:15 -05:00
int i = j * (end->x - start.x) / num2;
2024-08-31 23:22:24 -05:00
rect2.left = rect.left + i;
rect2.right = rect.right + i;
rect2.top = rect.top + j;
rect2.bottom = rect.bottom + j;
if (DecorDetect(rect2))
{
2024-09-23 20:35:15 -05:00
*end = tinyPoint;
2024-08-31 23:22:24 -05:00
return FALSE;
}
tinyPoint.x = start.x + i;
tinyPoint.y = start.y + j;
}
}
2024-09-23 20:35:15 -05:00
if (end->y < start.y)
2024-08-31 23:22:24 -05:00
{
for (int j = 0; j >= -num2; j--)
{
2024-09-23 20:35:15 -05:00
int i = j * (start.x - end->x) / num2;
2024-08-31 23:22:24 -05:00
rect2.left = rect.left + i;
rect2.right = rect.right + i;
rect2.top = rect.top + j;
rect2.bottom = rect.bottom + j;
if (DecorDetect(rect2))
{
2024-09-23 20:35:15 -05:00
*end = tinyPoint;
2024-08-31 23:22:24 -05:00
return FALSE;
}
tinyPoint.x = start.x + i;
tinyPoint.y = start.y + j;
}
}
}
return TRUE;
}