This commit is contained in:
parent
dec3ff76ef
commit
fd97883718
7 changed files with 145 additions and 12 deletions
|
@ -241,13 +241,30 @@ void CNpcFlyingDutchmanEnemy::processClose( int _frames )
|
|||
}
|
||||
else
|
||||
{
|
||||
if ( getRnd() % 2 )
|
||||
int val = getRnd() % 3;
|
||||
|
||||
switch( val )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_state = FLYING_DUTCHMAN_ATTACK_PLAYER;
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
|
||||
case 1:
|
||||
{
|
||||
m_state = FLYING_DUTCHMAN_CHARGE_PLAYER_START;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
{
|
||||
m_state = FLYING_DUTCHMAN_LEVEL_SHAKE;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_fadeDown = false;
|
||||
|
@ -392,6 +409,54 @@ void CNpcFlyingDutchmanEnemy::processClose( int _frames )
|
|||
break;
|
||||
}
|
||||
|
||||
case FLYING_DUTCHMAN_LEVEL_SHAKE:
|
||||
{
|
||||
if ( m_fadeVal == 128 )
|
||||
{
|
||||
CThingManager::shakePlatformLoose();
|
||||
|
||||
m_timerTimer = 5 * GameState::getOneSecondInFrames();
|
||||
|
||||
m_state = FLYING_DUTCHMAN_LEVEL_SHAKE_WAIT;
|
||||
|
||||
CGameScene::setCameraShake(0,8);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !m_animPlaying )
|
||||
{
|
||||
m_animPlaying = true;
|
||||
m_animNo = m_data[m_type].moveAnim;
|
||||
m_frame = 0;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case FLYING_DUTCHMAN_LEVEL_SHAKE_WAIT:
|
||||
{
|
||||
if ( m_timerTimer > 0 )
|
||||
{
|
||||
if ( !m_animPlaying )
|
||||
{
|
||||
m_animNo = m_data[m_type].moveAnim;
|
||||
m_animPlaying = true;
|
||||
m_frame = 0;
|
||||
|
||||
CGameScene::setCameraShake(0,8);
|
||||
}
|
||||
|
||||
m_timerTimer -= _frames;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_state = FLYING_DUTCHMAN_RETURN;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case FLYING_DUTCHMAN_RETURN:
|
||||
{
|
||||
if ( m_timerTimer > 0 )
|
||||
|
@ -610,6 +675,7 @@ void CNpcFlyingDutchmanEnemy::render()
|
|||
|
||||
SprFrame = m_actorGfx->Render(renderPos,m_animNo,( m_frame >> 8 ),m_reversed);
|
||||
setSemiTrans( SprFrame, true );
|
||||
SprFrame->tpage|=1<<5;
|
||||
m_actorGfx->RotateScale( SprFrame, renderPos, 0, 4096, 4096 );
|
||||
setRGB0( SprFrame, m_fadeVal, m_fadeVal, m_fadeVal );
|
||||
|
||||
|
@ -731,3 +797,9 @@ u8 CNpcFlyingDutchmanEnemy::hasBeenAttacked()
|
|||
|
||||
return( true );
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcFlyingDutchmanEnemy::shakePlatformLoose()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ protected:
|
|||
void processShotRecoil( int _frames );
|
||||
void processShotDeathEnd( int _frames );
|
||||
void collidedWith(CThing *_thisThing);
|
||||
void shakePlatformLoose();
|
||||
|
||||
enum NPC_FLYING_DUTCHMAN_STATE
|
||||
{
|
||||
|
@ -43,6 +44,8 @@ protected:
|
|||
FLYING_DUTCHMAN_ATTACK_PLAYER = 1,
|
||||
FLYING_DUTCHMAN_CHARGE_PLAYER_START,
|
||||
FLYING_DUTCHMAN_CHARGE_PLAYER,
|
||||
FLYING_DUTCHMAN_LEVEL_SHAKE,
|
||||
FLYING_DUTCHMAN_LEVEL_SHAKE_WAIT,
|
||||
FLYING_DUTCHMAN_RETURN,
|
||||
};
|
||||
|
||||
|
|
|
@ -40,6 +40,14 @@ void CNpcFallingBlockPlatform::postInit()
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcFallingBlockPlatform::trigger()
|
||||
{
|
||||
m_isTriggered = true;
|
||||
m_timer = GameState::getOneSecondInFrames();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcFallingBlockPlatform::processMovement( int _frames )
|
||||
{
|
||||
if ( m_isTriggered )
|
||||
|
@ -80,11 +88,6 @@ void CNpcFallingBlockPlatform::processMovement( int _frames )
|
|||
Pos.vy += moveY;
|
||||
}
|
||||
}
|
||||
else if ( m_contact )
|
||||
{
|
||||
m_isTriggered = true;
|
||||
m_timer = GameState::getOneSecondInFrames();
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -24,6 +24,7 @@ public:
|
|||
void postInit();
|
||||
CRECT const *getThinkBBox() {return( CThing::getThinkBBox() );}
|
||||
int checkCollisionAgainst(CThing *_thisThing, int _frames);
|
||||
void trigger();
|
||||
protected:
|
||||
void processMovement( int _frames );
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
|
||||
#include "gfx\otpos.h"
|
||||
#include "fx\fx.h"
|
||||
#include "fx\fxbaseanim.h"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -405,7 +406,9 @@ void CProjectile::think(int _frames)
|
|||
|
||||
if ( m_movementType == PROJECTILE_MINE )
|
||||
{
|
||||
CFX::Create( CFX::FX_TYPE_EXPLODE, Pos );
|
||||
CFX *newFX = CFX::Create( CFX::FX_TYPE_EXPLODE, Pos );
|
||||
((CFXBaseAnim*)newFX)->SetScale(ONE*2);
|
||||
|
||||
CGameScene::setCameraShake(0,8);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,6 +66,10 @@
|
|||
#include "triggers\tgarygo.h"
|
||||
#endif
|
||||
|
||||
#ifndef __PLATFORM_PFBLOCK_H__
|
||||
#include "platform\pfblock.h"
|
||||
#endif
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
|
||||
|
@ -377,6 +381,52 @@ void CThingManager::matchGaryTriggers()
|
|||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
|
||||
void CThingManager::shakePlatformLoose()
|
||||
{
|
||||
CNpcPlatform *platform;
|
||||
|
||||
int platformCount = getRnd() % 30;
|
||||
|
||||
int platformTest = 0;
|
||||
|
||||
while( platformCount )
|
||||
{
|
||||
platform = (CNpcPlatform *) s_thingLists[CThing::TYPE_PLATFORM];
|
||||
|
||||
while( platform )
|
||||
{
|
||||
if ( platform->getThingSubType() == CNpcPlatform::NPC_FALLING_BLOCK_PLATFORM )
|
||||
{
|
||||
platformCount--;
|
||||
platformTest++;
|
||||
|
||||
if ( !platformCount )
|
||||
{
|
||||
CNpcFallingBlockPlatform *block = (CNpcFallingBlockPlatform *) platform;
|
||||
|
||||
block->trigger();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
platform = (CNpcPlatform *) platform->m_nextListThing;
|
||||
}
|
||||
|
||||
if ( !platformTest )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
|
|
|
@ -65,6 +65,7 @@ static void initCollision();
|
|||
static void matchWheelsAndWeights();
|
||||
static void matchPressureSwitches();
|
||||
static void matchGaryTriggers();
|
||||
static void shakePlatformLoose();
|
||||
|
||||
static sBBox &getRenderBBox() {return(m_RenderBBox);}
|
||||
static sBBox &getThinkBBox() {return(m_ThinkBBox);}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue