This commit is contained in:
Charles 2001-04-04 15:53:44 +00:00
parent a35c24d46e
commit bb0e21d8d6
10 changed files with 132 additions and 35 deletions

View File

@ -444,6 +444,7 @@ collision/colltab.dat
actors/SPONGEBOB.SBK
actors/ANENOMELVL1.SBK
actors/ANENOMELVL3.SBK
actors/BABYOCTOPUS.SBK
actors/BALLBLOB.SBK
actors/CATERPILLAR.SBK

View File

@ -148,7 +148,7 @@ ACTORS_DIRS_TO_MAKE := $(ACTOR_OUT_DIR)
ACTOR_SPONGEBOB := SPONGEBOB
ACTOR_NPC :=
# BarnacleBoy Gary Krusty MermaidMan Patrick Plankton Sandy Squidward
ACTOR_ENEMY := AnenomeLvl1 BabyOctopus Ballblob Caterpillar clam Dustdevil Eyeball \
ACTOR_ENEMY := AnenomeLvl1 AnenomeLvl3 BabyOctopus Ballblob Caterpillar clam Dustdevil Eyeball \
Flamingskull FlyingDutchman Ghost HermitCrab IronDogFish Jellyfish1 Lrgjellyfish \
PuffaFish Sharkman Skeletalfish SpiderCrab SpikeyAnenome Squiddart Stomper
# Boogermonster GiantWorm Jellyfish2 Motherjellyfish Nautilus Neptune SeaSnake SharkSub

View File

@ -35,6 +35,10 @@
#include <ACTOR_SPIKEYANENOME_ANIM.h>
#endif
#ifndef __ANIM_ANENOMELVL3_HEADER__
#include <ACTOR_ANENOMELVL3_ANIM.h>
#endif
void CNpcEnemy::processCloseAnemone1Attack( int _frames )
{
@ -156,13 +160,46 @@ void CNpcEnemy::processCloseAnemone2Attack( int _frames )
}
else
{
CProjectile *projectile;
s16 heading;
// fire off attached spikes
CThing *nextThing = Next;
while ( nextThing )
{
CProjectile *projectile;
projectile = (CProjectile *) nextThing;
if ( projectile->getMovementType() == CProjectile::PROJECTILE_FIXED )
{
projectile->setMovementType( CProjectile::PROJECTILE_DUMBFIRE );
projectile->setLifeTime( CProjectile::PROJECTILE_FINITE_LIFE );
projectile->setState( CProjectile::PROJECTILE_ATTACK );
}
nextThing = nextThing->getNext();
}
// attach new spikes
for ( fireLoop = 0 ; fireLoop < 5 ; fireLoop++ )
{
DVECTOR spikePos;
heading = m_heading - 1024 + ( fireLoop * 512 );
heading %= 4096;
projectile = new( "test projectile" ) CProjectile;
projectile->init( Pos, heading );
spikePos = Pos;
spikePos.vx += ( 10 * rcos( heading ) ) >> 12;
spikePos.vy += ( 10 * rsin( heading ) ) >> 12;
projectile = new( "anemone lev2 projectile" ) CProjectile;
projectile->init( spikePos, heading, CProjectile::PROJECTILE_FIXED, CProjectile::PROJECTILE_INFINITE_LIFE );
addChild( projectile );
}
m_controlFunc = NPC_CONTROL_MOVEMENT;
@ -174,18 +211,31 @@ void CNpcEnemy::processCloseAnemone2Attack( int _frames )
void CNpcEnemy::processCloseAnemone3Attack( int _frames )
{
CProjectile *projectile;
u8 lifetime = 8;
if ( m_animNo != ANIM_ANENOMELVL3_FIRE )
{
m_animPlaying = true;
m_animNo = ANIM_ANENOMELVL3_FIRE;
m_frame = 0;
}
else if ( !m_animPlaying )
{
CProjectile *projectile;
u8 lifetime = 8;
projectile = new( "test projectile" ) CProjectile;
projectile->init( Pos,
m_fireHeading,
CProjectile::PROJECTILE_GAS_CLOUD,
CProjectile::PROJECTILE_FINITE_LIFE,
lifetime * GameState::getOneSecondInFrames() );
projectile = new( "test projectile" ) CProjectile;
projectile->init( Pos,
m_fireHeading,
CProjectile::PROJECTILE_GAS_CLOUD,
CProjectile::PROJECTILE_FINITE_LIFE,
lifetime * GameState::getOneSecondInFrames() );
m_controlFunc = NPC_CONTROL_MOVEMENT;
m_timerFunc = NPC_TIMER_ATTACK_DONE;
m_timerTimer = ( lifetime + 4 ) * GameState::getOneSecondInFrames();
m_sensorFunc = NPC_SENSOR_NONE;
m_controlFunc = NPC_CONTROL_MOVEMENT;
m_timerFunc = NPC_TIMER_ATTACK_DONE;
m_timerTimer = ( lifetime + 4 ) * GameState::getOneSecondInFrames();
m_sensorFunc = NPC_SENSOR_NONE;
m_animPlaying = true;
m_animNo = ANIM_ANENOMELVL3_BEND;
m_frame = 0;
}
}

View File

@ -250,7 +250,7 @@ void CNpcEnemy::init()
m_animNo = m_data[m_type].initAnim;
m_frame = 0;
m_heading = m_fireHeading = 128;
m_heading = m_fireHeading = 0;
m_movementTimer = 0;
m_timerTimer = 0;
m_velocity = 0;
@ -273,9 +273,9 @@ void CNpcEnemy::init()
DVECTOR ofs = getCollisionSize();
m_drawOffset.vx = 0;
m_drawOffset.vy = -( ofs.vy >> 1 );
m_drawOffset.vy = 0;
setCollisionCentreOffset( m_drawOffset.vx, m_drawOffset.vy );
setCollisionCentreOffset( 0, -( ofs.vy >> 1 ) );
m_positionHistory = NULL;
}
@ -293,6 +293,15 @@ void CNpcEnemy::postInit()
break;
}
case NPC_INIT_BALL_BLOB:
{
m_heading = m_fireHeading = 128;
m_npcPath.setPathType( CNpcPath::PONG_PATH );
break;
}
case NPC_INIT_HERMIT_CRAB:
{
m_npcPath.setPathType( CNpcPath::PONG_PATH );
@ -446,6 +455,31 @@ void CNpcEnemy::postInit()
break;
}
case NPC_INIT_ANEMONE_2:
{
CProjectile *projectile;
s16 heading;
for ( int fireLoop = 0 ; fireLoop < 5 ; fireLoop++ )
{
DVECTOR spikePos;
heading = m_heading - 1024 + ( fireLoop * 512 );
heading %= 4096;
spikePos = Pos;
spikePos.vx += ( 10 * rcos( heading ) ) >> 12;
spikePos.vy += ( 10 * rsin( heading ) ) >> 12;
projectile = new( "anemone lev2 projectile" ) CProjectile;
projectile->init( spikePos, heading, CProjectile::PROJECTILE_FIXED, CProjectile::PROJECTILE_INFINITE_LIFE );
addChild( projectile );
}
break;
}
case NPC_INIT_CIRCULAR_PLATFORM:
{
Pos.vx = 300;
@ -1372,8 +1406,8 @@ void CNpcEnemy::render()
//renderPos.vx = ( Pos.vx + m_drawOffset.vx - offset.vx - ( VidGetScrW() >> 1 ) );// * 20;
//renderPos.vy = ( Pos.vy + m_drawOffset.vy - offset.vy - ( VidGetScrH() >> 1 ) );// * 20;
renderPos.vx = Pos.vx + m_drawOffset.vx - offset.vx;
renderPos.vy = Pos.vy + m_drawOffset.vy - offset.vy;
renderPos.vx = Pos.vx - offset.vx;
renderPos.vy = Pos.vy - offset.vy;
m_actorGfx->Render(renderPos,m_animNo,m_frame,m_reversed);
}

View File

@ -202,6 +202,8 @@ protected:
NPC_INIT_PARASITIC_WORM_SEGMENT,
NPC_INIT_HERMIT_CRAB,
NPC_INIT_EYEBALL,
NPC_INIT_BALL_BLOB,
NPC_INIT_ANEMONE_2,
};
enum NPC_CONTROL_FUNC

View File

@ -31,6 +31,10 @@
#include <ACTOR_ANENOMELVL1_ANIM.h>
#endif
#ifndef __ANIM_ANENOMELVL3_HEADER__
#include <ACTOR_ANENOMELVL3_ANIM.h>
#endif
#ifndef __ANIM_BABYOCTOPUS_HEADER__
#include <ACTOR_BABYOCTOPUS_ANIM.h>
#endif
@ -346,9 +350,9 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_ANEMONE_2
ACTORS_SPIKEYANENOME_SBK,
ANIM_SPIKEYANENOME_BODY,
NPC_INIT_DEFAULT,
NPC_INIT_ANEMONE_2,
NPC_SENSOR_ANEMONE_USER_CLOSE,
NPC_MOVEMENT_STATIC,
NPC_MOVEMENT_STATIC_CYCLE_ANIM,
NPC_MOVEMENT_MODIFIER_NONE,
NPC_CLOSE_ANEMONE_2_ATTACK,
NPC_TIMER_NONE,
@ -362,11 +366,11 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
},
{ // NPC_ANEMONE_3
ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP,
ACTORS_ANENOMELVL3_SBK,
ANIM_ANENOMELVL3_BEND,
NPC_INIT_DEFAULT,
NPC_SENSOR_ANEMONE_USER_CLOSE,
NPC_MOVEMENT_STATIC,
NPC_MOVEMENT_STATIC_CYCLE_ANIM,
NPC_MOVEMENT_MODIFIER_NONE,
NPC_CLOSE_ANEMONE_3_ATTACK,
NPC_TIMER_NONE,
@ -904,7 +908,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_BALL_BLOB
ACTORS_BALLBLOB_SBK,
ANIM_BALLBLOB_WOBBLE,
NPC_INIT_DEFAULT,
NPC_INIT_BALL_BLOB,
NPC_SENSOR_NONE,
NPC_MOVEMENT_BALL_BLOB,
NPC_MOVEMENT_MODIFIER_NONE,

View File

@ -210,6 +210,11 @@ void CProjectile::setPosition( DVECTOR newPos )
Pos = newPos;
}
void CProjectile::setLifeTime( PROJECTILE_LIFETIME_TYPE lifeType )
{
m_lifetimeType = lifeType;
}
void CProjectile::think(int _frames)
{
CEnemyProjectileThing::think( _frames );

View File

@ -54,6 +54,7 @@ public:
void setMovementType( PROJECTILE_MOVEMENT_TYPE moveType );
PROJECTILE_MOVEMENT_TYPE getMovementType();
void setState( PROJECTILE_STATE newState );
void setLifeTime( PROJECTILE_LIFETIME_TYPE lifeType );
void setPosition( DVECTOR newPos );
protected:

View File

@ -20,7 +20,7 @@ SmallJellyfish-Level1=10
SmallJellyfish-Level2=11
Motherjellyfish=12
Anenome-Level1=13
Anenome-Level2=14
SpikeyAnenome=14
Anenome-Level3=15
BabyOctopus=16
Ballblob=17

View File

@ -135,14 +135,14 @@ Collision=0
Health=16
AttackStrength=20
#[Anenome-Level2]
#Gfx=..\..\graphics\characters\
#WayPoints=1
#Speed=0
#TurnRate=128
#Collision=0
#Health=32
#AttackStrength=20
[SpikeyAnenome]
Gfx=..\..\graphics\characters\SpikeyAnenome\render\psx\spikeyanenome_body0001.bmp
WayPoints=1
Speed=5
TurnRate=0
Collision=0
Health=0
AttackStrength=20
[Anenome-Level3]
Gfx=..\..\graphics\characters\AnenomeLvl3\Render\PSX\AnenomeLvl3_Fire0001.bmp