This commit is contained in:
Charles 2001-07-05 21:50:02 +00:00
parent dec3ff76ef
commit fd97883718
7 changed files with 145 additions and 12 deletions

View File

@ -241,13 +241,30 @@ void CNpcFlyingDutchmanEnemy::processClose( int _frames )
} }
else else
{ {
if ( getRnd() % 2 ) int val = getRnd() % 3;
switch( val )
{ {
m_state = FLYING_DUTCHMAN_ATTACK_PLAYER; case 0:
} {
else m_state = FLYING_DUTCHMAN_ATTACK_PLAYER;
{
m_state = FLYING_DUTCHMAN_CHARGE_PLAYER_START; break;
}
case 1:
{
m_state = FLYING_DUTCHMAN_CHARGE_PLAYER_START;
break;
}
case 2:
{
m_state = FLYING_DUTCHMAN_LEVEL_SHAKE;
break;
}
} }
m_fadeDown = false; m_fadeDown = false;
@ -392,6 +409,54 @@ void CNpcFlyingDutchmanEnemy::processClose( int _frames )
break; 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: case FLYING_DUTCHMAN_RETURN:
{ {
if ( m_timerTimer > 0 ) if ( m_timerTimer > 0 )
@ -610,6 +675,7 @@ void CNpcFlyingDutchmanEnemy::render()
SprFrame = m_actorGfx->Render(renderPos,m_animNo,( m_frame >> 8 ),m_reversed); SprFrame = m_actorGfx->Render(renderPos,m_animNo,( m_frame >> 8 ),m_reversed);
setSemiTrans( SprFrame, true ); setSemiTrans( SprFrame, true );
SprFrame->tpage|=1<<5;
m_actorGfx->RotateScale( SprFrame, renderPos, 0, 4096, 4096 ); m_actorGfx->RotateScale( SprFrame, renderPos, 0, 4096, 4096 );
setRGB0( SprFrame, m_fadeVal, m_fadeVal, m_fadeVal ); setRGB0( SprFrame, m_fadeVal, m_fadeVal, m_fadeVal );
@ -731,3 +797,9 @@ u8 CNpcFlyingDutchmanEnemy::hasBeenAttacked()
return( true ); return( true );
} }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFlyingDutchmanEnemy::shakePlatformLoose()
{
}

View File

@ -33,6 +33,7 @@ protected:
void processShotRecoil( int _frames ); void processShotRecoil( int _frames );
void processShotDeathEnd( int _frames ); void processShotDeathEnd( int _frames );
void collidedWith(CThing *_thisThing); void collidedWith(CThing *_thisThing);
void shakePlatformLoose();
enum NPC_FLYING_DUTCHMAN_STATE enum NPC_FLYING_DUTCHMAN_STATE
{ {
@ -43,6 +44,8 @@ protected:
FLYING_DUTCHMAN_ATTACK_PLAYER = 1, FLYING_DUTCHMAN_ATTACK_PLAYER = 1,
FLYING_DUTCHMAN_CHARGE_PLAYER_START, FLYING_DUTCHMAN_CHARGE_PLAYER_START,
FLYING_DUTCHMAN_CHARGE_PLAYER, FLYING_DUTCHMAN_CHARGE_PLAYER,
FLYING_DUTCHMAN_LEVEL_SHAKE,
FLYING_DUTCHMAN_LEVEL_SHAKE_WAIT,
FLYING_DUTCHMAN_RETURN, FLYING_DUTCHMAN_RETURN,
}; };

View File

@ -40,6 +40,14 @@ void CNpcFallingBlockPlatform::postInit()
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFallingBlockPlatform::trigger()
{
m_isTriggered = true;
m_timer = GameState::getOneSecondInFrames();
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFallingBlockPlatform::processMovement( int _frames ) void CNpcFallingBlockPlatform::processMovement( int _frames )
{ {
if ( m_isTriggered ) if ( m_isTriggered )
@ -80,11 +88,6 @@ void CNpcFallingBlockPlatform::processMovement( int _frames )
Pos.vy += moveY; Pos.vy += moveY;
} }
} }
else if ( m_contact )
{
m_isTriggered = true;
m_timer = GameState::getOneSecondInFrames();
}
} }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -24,6 +24,7 @@ public:
void postInit(); void postInit();
CRECT const *getThinkBBox() {return( CThing::getThinkBBox() );} CRECT const *getThinkBBox() {return( CThing::getThinkBBox() );}
int checkCollisionAgainst(CThing *_thisThing, int _frames); int checkCollisionAgainst(CThing *_thisThing, int _frames);
void trigger();
protected: protected:
void processMovement( int _frames ); void processMovement( int _frames );

View File

@ -49,6 +49,7 @@
#include "gfx\otpos.h" #include "gfx\otpos.h"
#include "fx\fx.h" #include "fx\fx.h"
#include "fx\fxbaseanim.h"
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -405,7 +406,9 @@ void CProjectile::think(int _frames)
if ( m_movementType == PROJECTILE_MINE ) 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); CGameScene::setCameraShake(0,8);
} }
} }

View File

@ -66,6 +66,10 @@
#include "triggers\tgarygo.h" #include "triggers\tgarygo.h"
#endif #endif
#ifndef __PLATFORM_PFBLOCK_H__
#include "platform\pfblock.h"
#endif
/* Std Lib /* 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: Function:
Purpose: Purpose:

View File

@ -65,6 +65,7 @@ static void initCollision();
static void matchWheelsAndWeights(); static void matchWheelsAndWeights();
static void matchPressureSwitches(); static void matchPressureSwitches();
static void matchGaryTriggers(); static void matchGaryTriggers();
static void shakePlatformLoose();
static sBBox &getRenderBBox() {return(m_RenderBBox);} static sBBox &getRenderBBox() {return(m_RenderBBox);}
static sBBox &getThinkBBox() {return(m_ThinkBBox);} static sBBox &getThinkBBox() {return(m_ThinkBBox);}