diff --git a/data/DataCache.scr b/data/DataCache.scr index 0f4b3b148..9c6d4179a 100644 --- a/data/DataCache.scr +++ b/data/DataCache.scr @@ -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 diff --git a/makefile.gfx b/makefile.gfx index 99831d082..78a7c911e 100644 --- a/makefile.gfx +++ b/makefile.gfx @@ -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 diff --git a/source/enemy/nanemone.cpp b/source/enemy/nanemone.cpp index 5fc66c814..65c770ac3 100644 --- a/source/enemy/nanemone.cpp +++ b/source/enemy/nanemone.cpp @@ -35,6 +35,10 @@ #include #endif +#ifndef __ANIM_ANENOMELVL3_HEADER__ +#include +#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; + } } \ No newline at end of file diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index 4ca6525fa..c50c6475c 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -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); } diff --git a/source/enemy/npc.h b/source/enemy/npc.h index 38af6c94d..4fb2b7876 100644 --- a/source/enemy/npc.h +++ b/source/enemy/npc.h @@ -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 diff --git a/source/enemy/npcdata.cpp b/source/enemy/npcdata.cpp index 3cb7c64ce..931ba02d9 100644 --- a/source/enemy/npcdata.cpp +++ b/source/enemy/npcdata.cpp @@ -31,6 +31,10 @@ #include #endif +#ifndef __ANIM_ANENOMELVL3_HEADER__ +#include +#endif + #ifndef __ANIM_BABYOCTOPUS_HEADER__ #include #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, diff --git a/source/projectl/projectl.cpp b/source/projectl/projectl.cpp index 105606cba..f719215c0 100644 --- a/source/projectl/projectl.cpp +++ b/source/projectl/projectl.cpp @@ -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 ); diff --git a/source/projectl/projectl.h b/source/projectl/projectl.h index 57efd65fe..66912c71e 100644 --- a/source/projectl/projectl.h +++ b/source/projectl/projectl.h @@ -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: diff --git a/tools/Data/bin/MkLevel.ini b/tools/Data/bin/MkLevel.ini index 434ef5ea9..57a209fd7 100644 --- a/tools/Data/bin/MkLevel.ini +++ b/tools/Data/bin/MkLevel.ini @@ -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 diff --git a/tools/MapEdit/actor.ini b/tools/MapEdit/actor.ini index 9cdd55d69..f377814bb 100644 --- a/tools/MapEdit/actor.ini +++ b/tools/MapEdit/actor.ini @@ -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