This commit is contained in:
parent
f3c69806b7
commit
87d561c4ab
19 changed files with 331 additions and 65 deletions
|
@ -283,7 +283,8 @@ player_src := demoplay \
|
||||||
psjump \
|
psjump \
|
||||||
psrun \
|
psrun \
|
||||||
psspring \
|
psspring \
|
||||||
pscart
|
pscart \
|
||||||
|
psfloat
|
||||||
|
|
||||||
script_src := script \
|
script_src := script \
|
||||||
function
|
function
|
||||||
|
@ -335,7 +336,11 @@ triggers_src := trigger \
|
||||||
tldripemit \
|
tldripemit \
|
||||||
tsdownemit \
|
tsdownemit \
|
||||||
tsleftemit \
|
tsleftemit \
|
||||||
tsrightemit
|
tsrightemit \
|
||||||
|
twindup \
|
||||||
|
twinddown \
|
||||||
|
twindleft \
|
||||||
|
twindright
|
||||||
|
|
||||||
utils_src := utils \
|
utils_src := utils \
|
||||||
sincos \
|
sincos \
|
||||||
|
|
|
@ -39,12 +39,16 @@
|
||||||
#include "player\player.h"
|
#include "player\player.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PROJECTL_PROJECTL_H__
|
||||||
|
#include "projectl\projectl.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void CNpcMotherJellyfishEnemy::postInit()
|
void CNpcMotherJellyfishEnemy::postInit()
|
||||||
{
|
{
|
||||||
m_state = MOTHER_JELLYFISH_RETURN_TO_START_1;
|
m_state = MOTHER_JELLYFISH_CYCLE;
|
||||||
m_spawnTimer = 0;
|
m_spawnTimer = 0;
|
||||||
m_meterOn=false;
|
m_meterOn=false;
|
||||||
|
|
||||||
|
@ -72,6 +76,13 @@ void CNpcMotherJellyfishEnemy::postInit()
|
||||||
}
|
}
|
||||||
|
|
||||||
m_RGB = 255 + ( 128 << 8 ) + ( 255 << 16 );
|
m_RGB = 255 + ( 128 << 8 ) + ( 255 << 16 );
|
||||||
|
|
||||||
|
targetPos = Pos;
|
||||||
|
|
||||||
|
m_movementTimer = GameState::getOneSecondInFrames() * 5;
|
||||||
|
m_pulsateTimer = GameState::getOneSecondInFrames();
|
||||||
|
|
||||||
|
m_renderScale = 4096;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -130,7 +141,153 @@ void CNpcMotherJellyfishEnemy::setupWaypoints( sThingActor *ThisActor )
|
||||||
|
|
||||||
void CNpcMotherJellyfishEnemy::processMovement( int _frames )
|
void CNpcMotherJellyfishEnemy::processMovement( int _frames )
|
||||||
{
|
{
|
||||||
s32 xDist, yDist;
|
if ( m_movementTimer <= 0 )
|
||||||
|
{
|
||||||
|
if ( m_pulsateTimer <= 0 )
|
||||||
|
{
|
||||||
|
// fire at player
|
||||||
|
|
||||||
|
s16 heading = ratan2( playerYDist, playerXDist ) & 4095;
|
||||||
|
|
||||||
|
CProjectile *projectile;
|
||||||
|
projectile = CProjectile::Create();
|
||||||
|
DVECTOR newPos = Pos;
|
||||||
|
projectile->init( newPos, heading );
|
||||||
|
projectile->setGraphic( FRM__LIGHTNING2 );
|
||||||
|
|
||||||
|
m_movementTimer = GameState::getOneSecondInFrames() * 5;
|
||||||
|
m_pulsateTimer = GameState::getOneSecondInFrames();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_pulsateTimer -= _frames;
|
||||||
|
|
||||||
|
m_renderScale = 4096 + ( ( 256 * rsin( ( ( m_pulsateTimer << 14 ) / GameState::getOneSecondInFrames() ) & 4095 ) ) >> 12 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_movementTimer -= _frames;
|
||||||
|
|
||||||
|
s32 distX, distY;
|
||||||
|
|
||||||
|
distX = targetPos.vx - Pos.vx;
|
||||||
|
distY = targetPos.vy - Pos.vy;
|
||||||
|
|
||||||
|
if( abs( distX ) < 10 && abs( distY ) < 10 )
|
||||||
|
{
|
||||||
|
s32 minX, maxX, minY, maxY;
|
||||||
|
|
||||||
|
m_npcPath.getPathXExtents( &minX, &maxX );
|
||||||
|
m_npcPath.getPathYExtents( &minY, &maxY );
|
||||||
|
|
||||||
|
targetPos.vx = minX + ( getRnd() % ( maxX - minX + 1 ) );
|
||||||
|
targetPos.vy = minY + ( getRnd() % ( maxY - minY + 1 ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s16 headingToTarget = ratan2( distY, distX );
|
||||||
|
s16 decDir, incDir;
|
||||||
|
s16 moveDist;
|
||||||
|
s16 maxTurnRate = m_data[m_type].turnSpeed;
|
||||||
|
s32 moveX, moveY;
|
||||||
|
|
||||||
|
decDir = m_heading - headingToTarget;
|
||||||
|
|
||||||
|
if ( decDir < 0 )
|
||||||
|
{
|
||||||
|
decDir += ONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
incDir = headingToTarget - m_heading;
|
||||||
|
|
||||||
|
if ( incDir < 0 )
|
||||||
|
{
|
||||||
|
incDir += ONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( decDir < incDir )
|
||||||
|
{
|
||||||
|
moveDist = -decDir;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
moveDist = incDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( moveDist < -maxTurnRate )
|
||||||
|
{
|
||||||
|
moveDist = -maxTurnRate;
|
||||||
|
}
|
||||||
|
else if ( moveDist > maxTurnRate )
|
||||||
|
{
|
||||||
|
moveDist = maxTurnRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_heading += moveDist;
|
||||||
|
m_heading &= 4095;
|
||||||
|
|
||||||
|
s32 preShiftX = _frames * m_speed * rcos( m_heading );
|
||||||
|
s32 preShiftY = _frames * m_speed * rsin( m_heading );
|
||||||
|
|
||||||
|
moveX = preShiftX >> 12;
|
||||||
|
if ( !moveX && preShiftX )
|
||||||
|
{
|
||||||
|
moveX = preShiftX / abs( preShiftX );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( distX > 0 )
|
||||||
|
{
|
||||||
|
if ( moveX > distX )
|
||||||
|
{
|
||||||
|
moveX = distX;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( distX < 0 )
|
||||||
|
{
|
||||||
|
if ( moveX < distX )
|
||||||
|
{
|
||||||
|
moveX = distX;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
moveX = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
moveY = preShiftY >> 12;
|
||||||
|
if ( !moveY && preShiftY )
|
||||||
|
{
|
||||||
|
moveY = preShiftY / abs( preShiftY );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( distY > 0 )
|
||||||
|
{
|
||||||
|
if ( moveY > distY )
|
||||||
|
{
|
||||||
|
moveY = distY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( distY < 0 )
|
||||||
|
{
|
||||||
|
if ( moveY < distY )
|
||||||
|
{
|
||||||
|
moveY = distY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
moveY = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Pos.vx += moveX;
|
||||||
|
Pos.vy += moveY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*s32 xDist, yDist;
|
||||||
s32 xDistSqr, yDistSqr;
|
s32 xDistSqr, yDistSqr;
|
||||||
|
|
||||||
switch( m_state )
|
switch( m_state )
|
||||||
|
@ -225,14 +382,14 @@ void CNpcMotherJellyfishEnemy::processMovement( int _frames )
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void CNpcMotherJellyfishEnemy::processClose( int _frames )
|
void CNpcMotherJellyfishEnemy::processClose( int _frames )
|
||||||
{
|
{
|
||||||
switch( m_state )
|
/*switch( m_state )
|
||||||
{
|
{
|
||||||
case MOTHER_JELLYFISH_ATTACK_PLAYER_SHOCK:
|
case MOTHER_JELLYFISH_ATTACK_PLAYER_SHOCK:
|
||||||
{
|
{
|
||||||
|
@ -286,7 +443,7 @@ void CNpcMotherJellyfishEnemy::processClose( int _frames )
|
||||||
|
|
||||||
m_heading = 0;
|
m_heading = 0;
|
||||||
|
|
||||||
spawnJellyfish( _frames );
|
//spawnJellyfish( _frames );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -307,7 +464,7 @@ void CNpcMotherJellyfishEnemy::processClose( int _frames )
|
||||||
|
|
||||||
m_heading = 2048;
|
m_heading = 2048;
|
||||||
|
|
||||||
spawnJellyfish( _frames );
|
//spawnJellyfish( _frames );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -318,7 +475,7 @@ void CNpcMotherJellyfishEnemy::processClose( int _frames )
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -336,7 +493,7 @@ void CNpcMotherJellyfishEnemy::shutdown()
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void CNpcMotherJellyfishEnemy::spawnJellyfish( int _frames )
|
/*void CNpcMotherJellyfishEnemy::spawnJellyfish( int _frames )
|
||||||
{
|
{
|
||||||
if ( m_jellyfishCount )
|
if ( m_jellyfishCount )
|
||||||
{
|
{
|
||||||
|
@ -361,7 +518,7 @@ void CNpcMotherJellyfishEnemy::spawnJellyfish( int _frames )
|
||||||
m_spawnTimer = 1 * GameState::getOneSecondInFrames();
|
m_spawnTimer = 1 * GameState::getOneSecondInFrames();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -384,11 +541,8 @@ void CNpcMotherJellyfishEnemy::render()
|
||||||
|
|
||||||
DVECTOR &renderPos=getRenderPos();
|
DVECTOR &renderPos=getRenderPos();
|
||||||
|
|
||||||
s16 scale;
|
|
||||||
scale = 2048 + ( ( ( 8192 - 2048 ) * m_health ) / m_data[m_type].initHealth );
|
|
||||||
|
|
||||||
SprFrame = m_actorGfx->Render(renderPos,m_animNo,( m_frame >> 8 ),false);
|
SprFrame = m_actorGfx->Render(renderPos,m_animNo,( m_frame >> 8 ),false);
|
||||||
m_actorGfx->RotateScale( SprFrame, renderPos, 0, scale, scale );
|
m_actorGfx->RotateScale( SprFrame, renderPos, 0, m_renderScale, m_renderScale );
|
||||||
|
|
||||||
sBBox boundingBox = m_actorGfx->GetBBox();
|
sBBox boundingBox = m_actorGfx->GetBBox();
|
||||||
setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) );
|
setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) );
|
||||||
|
@ -406,12 +560,12 @@ void CNpcMotherJellyfishEnemy::render()
|
||||||
void CNpcMotherJellyfishEnemy::processShot( int _frames )
|
void CNpcMotherJellyfishEnemy::processShot( int _frames )
|
||||||
{
|
{
|
||||||
s16 scale;
|
s16 scale;
|
||||||
scale = 2048 + ( ( ( 8192 - 2048 ) * m_health ) / m_data[m_type].initHealth );
|
scale = 2048 + ( ( ( 4096 - 2048 ) * m_health ) / m_data[m_type].initHealth );
|
||||||
|
|
||||||
for ( int i = 0 ; i < 4 ; i++ )
|
for ( int i = 0 ; i < 4 ; i++ )
|
||||||
{
|
{
|
||||||
legs[i]->Setup( ( legsPos[i].vx * scale ) >> 13, legsPos[i].vy, i > 1 );
|
legs[i]->Setup( ( legsPos[i].vx * scale ) >> 12, legsPos[i].vy, i > 1 );
|
||||||
legs[i]->setScale( scale >> 1 );
|
legs[i]->setScale( scale );
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ( m_state )
|
switch ( m_state )
|
||||||
|
@ -423,6 +577,8 @@ void CNpcMotherJellyfishEnemy::processShot( int _frames )
|
||||||
if ( m_health > 0 )
|
if ( m_health > 0 )
|
||||||
{
|
{
|
||||||
m_health -= 5;
|
m_health -= 5;
|
||||||
|
|
||||||
|
m_renderScale = 2048 + ( ( ( 4096 - 2048 ) * m_health ) / m_data[m_type].initHealth );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_state = NPC_GENERIC_HIT_RECOIL;
|
m_state = NPC_GENERIC_HIT_RECOIL;
|
||||||
|
@ -446,18 +602,3 @@ void CNpcMotherJellyfishEnemy::processShot( int _frames )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
u8 CNpcMotherJellyfishEnemy::canBeCaughtByNet()
|
|
||||||
{
|
|
||||||
return( m_isActive && !m_isDying && m_health <= 5 );
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void CNpcMotherJellyfishEnemy::caughtWithNet()
|
|
||||||
{
|
|
||||||
setToShutdown();
|
|
||||||
CGameScene::setBossHasBeenKilled();
|
|
||||||
}
|
|
||||||
|
|
|
@ -25,18 +25,16 @@ public:
|
||||||
void render();
|
void render();
|
||||||
virtual void shutdown();
|
virtual void shutdown();
|
||||||
virtual void setupWaypoints( sThingActor *ThisActor );
|
virtual void setupWaypoints( sThingActor *ThisActor );
|
||||||
virtual u8 canBeCaughtByNet();
|
|
||||||
virtual void caughtWithNet();
|
|
||||||
protected:
|
protected:
|
||||||
virtual void processClose( int _frames );
|
virtual void processClose( int _frames );
|
||||||
virtual void processMovement( int _frames );
|
virtual void processMovement( int _frames );
|
||||||
virtual void processShot( int _frames );
|
virtual void processShot( int _frames );
|
||||||
void spawnJellyfish( int _frames );
|
//void spawnJellyfish( int _frames );
|
||||||
//virtual void processUserCollision( CThing *thisThing );
|
//virtual void processUserCollision( CThing *thisThing );
|
||||||
|
|
||||||
enum NPC_MOTHER_JELLYFISH_STATE
|
enum NPC_MOTHER_JELLYFISH_STATE
|
||||||
{
|
{
|
||||||
MOTHER_JELLYFISH_RETURN_TO_START_1 = 0,
|
/*MOTHER_JELLYFISH_RETURN_TO_START_1 = 0,
|
||||||
MOTHER_JELLYFISH_CYCLE_1 = 1,
|
MOTHER_JELLYFISH_CYCLE_1 = 1,
|
||||||
MOTHER_JELLYFISH_ATTACK_PLAYER_SPAWN_1,
|
MOTHER_JELLYFISH_ATTACK_PLAYER_SPAWN_1,
|
||||||
MOTHER_JELLYFISH_RETURN_TO_START_2,
|
MOTHER_JELLYFISH_RETURN_TO_START_2,
|
||||||
|
@ -44,17 +42,23 @@ protected:
|
||||||
MOTHER_JELLYFISH_ATTACK_PLAYER_SPAWN_2,
|
MOTHER_JELLYFISH_ATTACK_PLAYER_SPAWN_2,
|
||||||
MOTHER_JELLYFISH_RETURN_TO_START_3,
|
MOTHER_JELLYFISH_RETURN_TO_START_3,
|
||||||
MOTHER_JELLYFISH_CYCLE_3,
|
MOTHER_JELLYFISH_CYCLE_3,
|
||||||
MOTHER_JELLYFISH_ATTACK_PLAYER_SHOCK,
|
MOTHER_JELLYFISH_ATTACK_PLAYER_SHOCK,*/
|
||||||
|
MOTHER_JELLYFISH_CYCLE = 0,
|
||||||
|
MOTHER_JELLYFISH_ATTACK_PLAYER = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
int m_jellyfishCount;
|
int m_jellyfishCount;
|
||||||
s32 m_spawnTimer;
|
s32 m_spawnTimer;
|
||||||
|
s32 m_pulsateTimer;
|
||||||
s32 m_cycleWidth;
|
s32 m_cycleWidth;
|
||||||
s32 m_halfCycleWidth;
|
s32 m_halfCycleWidth;
|
||||||
bool m_meterOn;
|
bool m_meterOn;
|
||||||
|
s16 m_renderScale;
|
||||||
|
|
||||||
CFXJellyFishLegs *legs[4];
|
CFXJellyFishLegs *legs[4];
|
||||||
DVECTOR legsPos[4];
|
DVECTOR legsPos[4];
|
||||||
|
|
||||||
|
DVECTOR targetPos;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -123,6 +123,7 @@ public:
|
||||||
virtual void trigger() {;}
|
virtual void trigger() {;}
|
||||||
virtual u8 isCart() {return( false );}
|
virtual u8 isCart() {return( false );}
|
||||||
virtual void jump() {;}
|
virtual void jump() {;}
|
||||||
|
s16 getCollisionAngle() {return m_collisionAngle;}
|
||||||
|
|
||||||
static NPC_PLATFORM_UNIT_TYPE getTypeFromMapEdit( u16 newType );
|
static NPC_PLATFORM_UNIT_TYPE getTypeFromMapEdit( u16 newType );
|
||||||
static CNpcPlatform *Create(int Type);
|
static CNpcPlatform *Create(int Type);
|
||||||
|
@ -240,7 +241,6 @@ protected:
|
||||||
virtual void calculateBoundingBoxSize();
|
virtual void calculateBoundingBoxSize();
|
||||||
|
|
||||||
virtual void setCollisionAngle(int newAngle); // Actually.. this probly doesn't need to be in the base calss anymore.. :/
|
virtual void setCollisionAngle(int newAngle); // Actually.. this probly doesn't need to be in the base calss anymore.. :/
|
||||||
s16 getCollisionAngle() {return m_collisionAngle;}
|
|
||||||
s16 m_collisionAngle;
|
s16 m_collisionAngle;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -814,7 +814,7 @@ if(PadGetDown(0)&PAD_TRIANGLE)
|
||||||
{
|
{
|
||||||
GameScene.GetLevel().destroyMapTile(oldPos);
|
GameScene.GetLevel().destroyMapTile(oldPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Is player stood on any special collision?
|
// Is player stood on any special collision?
|
||||||
if(getHeightFromGroundNoPlatform(Pos.vx,Pos.vy,5)==0)
|
if(getHeightFromGroundNoPlatform(Pos.vx,Pos.vy,5)==0)
|
||||||
|
@ -837,12 +837,12 @@ if(PadGetDown(0)&PAD_TRIANGLE)
|
||||||
block==COLLISION_TYPE_FLAG_DEATH_LIQUID)
|
block==COLLISION_TYPE_FLAG_DEATH_LIQUID)
|
||||||
{
|
{
|
||||||
dieYouPorousFreak(DEATHTYPE__LIQUID);
|
dieYouPorousFreak(DEATHTYPE__LIQUID);
|
||||||
}
|
}
|
||||||
else if(m_currentMode!=PLAYER_MODE_DEAD&&
|
else if(m_currentMode!=PLAYER_MODE_DEAD&&
|
||||||
block==COLLISION_TYPE_FLAG_DEATH_INSTANT)
|
block==COLLISION_TYPE_FLAG_DEATH_INSTANT)
|
||||||
{
|
{
|
||||||
dieYouPorousFreak(DEATHTYPE__NORMAL);
|
dieYouPorousFreak(DEATHTYPE__NORMAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Powerups
|
// Powerups
|
||||||
|
@ -1553,6 +1553,17 @@ void CPlayer::springPlayerUp(int _springHeight)
|
||||||
m_currentPlayerModeClass->springPlayerUp(_springHeight);
|
m_currentPlayerModeClass->springPlayerUp(_springHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CPlayer::setFloating()
|
||||||
|
{
|
||||||
|
m_currentPlayerModeClass->setFloating();
|
||||||
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
|
@ -1814,6 +1825,16 @@ void CPlayer::renderSb(DVECTOR *_pos,int _animNo,int _animFrame)
|
||||||
|
|
||||||
// Render SB
|
// Render SB
|
||||||
ft4=m_actorGfx->Render(*_pos,_animNo,_animFrame,m_facing==FACING_RIGHT?0:1);
|
ft4=m_actorGfx->Render(*_pos,_animNo,_animFrame,m_facing==FACING_RIGHT?0:1);
|
||||||
|
CThing *platform;
|
||||||
|
platform=isOnPlatform();
|
||||||
|
if(platform)
|
||||||
|
{
|
||||||
|
if ( ( (CNpcPlatform *) platform )->isCart() )
|
||||||
|
{
|
||||||
|
m_actorGfx->RotateScale( ft4, *_pos, ( (CNpcPlatform *) platform )->getCollisionAngle(), ONE, ONE );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setSemiTrans(ft4,trans);
|
setSemiTrans(ft4,trans);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2402,7 +2423,7 @@ int CPlayer::moveVertical(int _moveDistance)
|
||||||
_moveDistance=0;
|
_moveDistance=0;
|
||||||
hitGround=true;
|
hitGround=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -85,6 +85,7 @@ typedef enum
|
||||||
STATE_LOOKDOWNRELAX,
|
STATE_LOOKDOWNRELAX,
|
||||||
STATE_JUMPBACK,
|
STATE_JUMPBACK,
|
||||||
STATE_CART,
|
STATE_CART,
|
||||||
|
STATE_FLOAT,
|
||||||
|
|
||||||
NUM_STATES,
|
NUM_STATES,
|
||||||
}PLAYER_STATE;
|
}PLAYER_STATE;
|
||||||
|
@ -398,6 +399,8 @@ public:
|
||||||
|
|
||||||
void justButtBouncedABadGuy(); // Also fugly.. :/
|
void justButtBouncedABadGuy(); // Also fugly.. :/
|
||||||
|
|
||||||
|
void setFloating();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_squeakyBootsTimer;
|
int m_squeakyBootsTimer;
|
||||||
int m_invincibilityRingTimer;
|
int m_invincibilityRingTimer;
|
||||||
|
|
|
@ -83,6 +83,9 @@ void CPlayerModeCart::think()
|
||||||
newPos.vy = platform->getPos().vy;
|
newPos.vy = platform->getPos().vy;
|
||||||
|
|
||||||
int platformOffset = ( ( CNpcPlatform* ) platform )->getHeightFromPlatformAtPosition( newPos.vx, newPos.vy );
|
int platformOffset = ( ( CNpcPlatform* ) platform )->getHeightFromPlatformAtPosition( newPos.vx, newPos.vy );
|
||||||
|
s16 angle = ( ( CNpcPlatform * ) platform )->getCollisionAngle();
|
||||||
|
newPos.vx += ( -platformOffset * rsin( angle ) ) >> 12;
|
||||||
|
platformOffset = ( ( CNpcPlatform* ) platform )->getHeightFromPlatformAtPosition( newPos.vx, newPos.vy );
|
||||||
newPos.vy += platformOffset;
|
newPos.vy += platformOffset;
|
||||||
|
|
||||||
m_player->setPos( newPos );
|
m_player->setPos( newPos );
|
||||||
|
@ -96,23 +99,5 @@ void CPlayerModeCart::think()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
Function:
|
|
||||||
Purpose:
|
|
||||||
Params:
|
|
||||||
Returns:
|
|
||||||
---------------------------------------------------------------------- */
|
|
||||||
/*
|
|
||||||
void CPlayerModeDead::render(DVECTOR *_pos)
|
|
||||||
{
|
|
||||||
DVECTOR deadSbPos;
|
|
||||||
|
|
||||||
deadSbPos=*_pos;
|
|
||||||
deadSbPos.vy-=m_deadTime;
|
|
||||||
|
|
||||||
m_player->renderSb(&deadSbPos,ANIM_SPONGEBOB_DEATHANGLE,0);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
end */
|
end */
|
||||||
|
|
|
@ -74,6 +74,10 @@
|
||||||
#include "player\pscart.h"
|
#include "player\pscart.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PLAYER_PSFLOAT_H__
|
||||||
|
#include "player\psfloat.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __PLATFORM_PLATFORM_H__
|
#ifndef __PLATFORM_PLATFORM_H__
|
||||||
#include "platform\platform.h"
|
#include "platform\platform.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -127,6 +131,7 @@ static CPlayerState *s_stateTable[]=
|
||||||
&s_stateLookDownRelax, // STATE_LOOKDOWNRELAX
|
&s_stateLookDownRelax, // STATE_LOOKDOWNRELAX
|
||||||
&s_stateJumpBack, // STATE_JUMPBACK
|
&s_stateJumpBack, // STATE_JUMPBACK
|
||||||
&s_stateCart, // STATE_CART
|
&s_stateCart, // STATE_CART
|
||||||
|
&s_stateFloat, // STATE_FLOAT
|
||||||
};
|
};
|
||||||
|
|
||||||
static PlayerMetrics s_playerMetrics=
|
static PlayerMetrics s_playerMetrics=
|
||||||
|
@ -316,7 +321,8 @@ void CPlayerModeBase::thinkVerticalMovement()
|
||||||
else if(m_currentState!=STATE_FALL&&m_currentState!=STATE_FALLFAR&& // Hmm.. (pkg)
|
else if(m_currentState!=STATE_FALL&&m_currentState!=STATE_FALLFAR&& // Hmm.. (pkg)
|
||||||
m_currentState!=STATE_BUTTFALL&&m_currentState!=STATE_BUTTBOUNCE&&
|
m_currentState!=STATE_BUTTFALL&&m_currentState!=STATE_BUTTBOUNCE&&
|
||||||
m_currentState!=STATE_JUMP&&m_currentState!=STATE_SPRINGUP&&
|
m_currentState!=STATE_JUMP&&m_currentState!=STATE_SPRINGUP&&
|
||||||
m_currentState!=STATE_JUMPBACK&&m_currentState!=STATE_BUTTBOUNCEUP)
|
m_currentState!=STATE_JUMPBACK&&m_currentState!=STATE_BUTTBOUNCEUP&&
|
||||||
|
m_currentState!=STATE_FLOAT)
|
||||||
{
|
{
|
||||||
DVECTOR pos;
|
DVECTOR pos;
|
||||||
pos=m_player->getPlayerPos();
|
pos=m_player->getPlayerPos();
|
||||||
|
|
|
@ -92,6 +92,7 @@ public:
|
||||||
virtual void renderModeUi() {;} // Ui specific to this mode (eg: ammo)
|
virtual void renderModeUi() {;} // Ui specific to this mode (eg: ammo)
|
||||||
virtual int canDoLookAround() {return false;}
|
virtual int canDoLookAround() {return false;}
|
||||||
virtual void springPlayerUp(int _springHeight) {;}
|
virtual void springPlayerUp(int _springHeight) {;}
|
||||||
|
virtual void setFloating() {;}
|
||||||
void inSoakUpState();
|
void inSoakUpState();
|
||||||
|
|
||||||
virtual int setState(int _state) {return 0;}
|
virtual int setState(int _state) {return 0;}
|
||||||
|
@ -128,6 +129,7 @@ public:
|
||||||
virtual void render() {;}
|
virtual void render() {;}
|
||||||
virtual int canDoLookAround();
|
virtual int canDoLookAround();
|
||||||
virtual void springPlayerUp(int _springHeight) {m_springHeight=_springHeight;setState(STATE_SPRINGUP);}
|
virtual void springPlayerUp(int _springHeight) {m_springHeight=_springHeight;setState(STATE_SPRINGUP);}
|
||||||
|
virtual void setFloating() {setState( STATE_FLOAT );}
|
||||||
|
|
||||||
virtual ATTACK_STATE getAttackState();
|
virtual ATTACK_STATE getAttackState();
|
||||||
|
|
||||||
|
|
|
@ -131,6 +131,22 @@
|
||||||
#include "triggers\tsrightemit.h"
|
#include "triggers\tsrightemit.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __TRIGGERS_TWINDUP_H__
|
||||||
|
#include "triggers\twindup.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __TRIGGERS_TWINDDOWN_H__
|
||||||
|
#include "triggers\twinddown.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __TRIGGERS_TWINDLEFT_H__
|
||||||
|
#include "triggers\twindleft.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __TRIGGERS_TWINDRIGHT_H__
|
||||||
|
#include "triggers\twindright.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __GAME_GAME_H__
|
#ifndef __GAME_GAME_H__
|
||||||
#include "game\game.h"
|
#include "game\game.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -291,6 +307,26 @@ CTrigger *trigger;
|
||||||
trigger=(CSteamSwitchEmitterTrigger*)new("SteamSwitchEmitterTrigger") CSteamSwitchEmitterTrigger();
|
trigger=(CSteamSwitchEmitterTrigger*)new("SteamSwitchEmitterTrigger") CSteamSwitchEmitterTrigger();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Wind up
|
||||||
|
case TRIGGER_WIND_UP:
|
||||||
|
trigger = (CWindUpTrigger*)new("WindUpTrigger") CWindUpTrigger();
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Wind down
|
||||||
|
case TRIGGER_WIND_DOWN:
|
||||||
|
trigger = (CWindDownTrigger*)new("WindDownTrigger") CWindDownTrigger();
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Wind up
|
||||||
|
case TRIGGER_WIND_LEFT:
|
||||||
|
trigger = (CWindLeftTrigger*)new("WindLeftTrigger") CWindLeftTrigger();
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Wind up
|
||||||
|
case TRIGGER_WIND_RIGHT:
|
||||||
|
trigger = (CWindRightTrigger*)new("WindRightTrigger") CWindRightTrigger();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
trigger=NULL;
|
trigger=NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,10 @@ enum TRIGGER_TYPE
|
||||||
TRIGGER_STEAM_DOWN_EMITTER,
|
TRIGGER_STEAM_DOWN_EMITTER,
|
||||||
TRIGGER_STEAM_LEFT_EMITTER,
|
TRIGGER_STEAM_LEFT_EMITTER,
|
||||||
TRIGGER_STEAM_RIGHT_EMITTER,
|
TRIGGER_STEAM_RIGHT_EMITTER,
|
||||||
|
TRIGGER_WIND_UP,
|
||||||
|
TRIGGER_WIND_DOWN,
|
||||||
|
TRIGGER_WIND_LEFT,
|
||||||
|
TRIGGER_WIND_RIGHT,
|
||||||
|
|
||||||
// Code based triggers
|
// Code based triggers
|
||||||
TRIGGER_PLATFORM,
|
TRIGGER_PLATFORM,
|
||||||
|
|
|
@ -37,6 +37,8 @@ void CWindDownTrigger::collidedWith(CThing *_thisThing)
|
||||||
move.vy = 4 * GameState::getFramesSinceLast();
|
move.vy = 4 * GameState::getFramesSinceLast();
|
||||||
|
|
||||||
player->shove( move );
|
player->shove( move );
|
||||||
|
move.vx = player->getMoveVelocity()->vx;
|
||||||
|
player->setMoveVelocity( &move );
|
||||||
player->setFloating();
|
player->setFloating();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -37,6 +37,7 @@ void CWindLeftTrigger::collidedWith(CThing *_thisThing)
|
||||||
move.vy = 0;
|
move.vy = 0;
|
||||||
|
|
||||||
player->shove( move );
|
player->shove( move );
|
||||||
|
player->setMoveVelocity( &move );
|
||||||
player->setFloating();
|
player->setFloating();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -37,6 +37,7 @@ void CWindRightTrigger::collidedWith(CThing *_thisThing)
|
||||||
move.vy = 0;
|
move.vy = 0;
|
||||||
|
|
||||||
player->shove( move );
|
player->shove( move );
|
||||||
|
player->setMoveVelocity( &move );
|
||||||
player->setFloating();
|
player->setFloating();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -33,9 +33,12 @@ void CWindUpTrigger::collidedWith(CThing *_thisThing)
|
||||||
CPlayer *player = (CPlayer *) _thisThing;
|
CPlayer *player = (CPlayer *) _thisThing;
|
||||||
|
|
||||||
DVECTOR move;
|
DVECTOR move;
|
||||||
|
move.vx = 0;
|
||||||
move.vy = -4 * GameState::getFramesSinceLast();
|
move.vy = -4 * GameState::getFramesSinceLast();
|
||||||
|
|
||||||
player->shove( move );
|
player->shove( move );
|
||||||
|
move.vx = player->getMoveVelocity()->vx;
|
||||||
|
player->setMoveVelocity( &move );
|
||||||
player->setFloating();
|
player->setFloating();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
Includes
|
Includes
|
||||||
-------- */
|
-------- */
|
||||||
|
|
||||||
#ifndef __TRIGGERS_THAZARD_H__
|
#ifndef __TRIGGER_TRIGGER_HEADER__
|
||||||
#include "triggers\thazard.h"
|
#include "triggers\trigger.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Std Lib
|
/* Std Lib
|
||||||
|
|
|
@ -157,6 +157,10 @@ LavaBubbleEmitter=24
|
||||||
SteamDownEmitter=25
|
SteamDownEmitter=25
|
||||||
SteamLeftEmitter=26
|
SteamLeftEmitter=26
|
||||||
SteamRightEmitter=27
|
SteamRightEmitter=27
|
||||||
|
WindUp=28
|
||||||
|
WindDown=29
|
||||||
|
WindLeft=30
|
||||||
|
WindRight=31
|
||||||
|
|
||||||
################################################
|
################################################
|
||||||
# FX
|
# FX
|
||||||
|
|
|
@ -61,4 +61,12 @@ HasBox=1
|
||||||
|
|
||||||
[OilDripEmitter]
|
[OilDripEmitter]
|
||||||
|
|
||||||
[LavaDripEmitter]
|
[LavaDripEmitter]
|
||||||
|
|
||||||
|
[WindUp]
|
||||||
|
|
||||||
|
[WindDown]
|
||||||
|
|
||||||
|
[WindLeft]
|
||||||
|
|
||||||
|
[WindRight]
|
|
@ -1743,6 +1743,14 @@ SOURCE=..\..\..\source\player\psfall.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\player\psfloat.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\player\psfloat.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\..\source\player\pshitgnd.cpp
|
SOURCE=..\..\..\source\player\pshitgnd.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@ -2371,6 +2379,38 @@ SOURCE=..\..\..\source\triggers\twdripemit.cpp
|
||||||
|
|
||||||
SOURCE=..\..\..\source\triggers\twdripemit.h
|
SOURCE=..\..\..\source\triggers\twdripemit.h
|
||||||
# End Source File
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\triggers\twinddown.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\triggers\twinddown.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\triggers\twindleft.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\triggers\twindleft.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\triggers\twindright.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\triggers\twindright.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\triggers\twindup.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\triggers\twindup.h
|
||||||
|
# End Source File
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Group "utils"
|
# Begin Group "utils"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue