This commit is contained in:
Charles 2001-05-10 22:19:55 +00:00
parent 30f38c3c45
commit 09bf0f7421
7 changed files with 141 additions and 39 deletions

View File

@ -83,7 +83,8 @@ enemy_src := npc \
nprojjf \
nmjback \
nsjback \
nsj2back
nsj2back \
nbuttfly
friend_src := friend \
fdata \

View File

@ -117,7 +117,7 @@ ACTOR_ENEMY := Anenome BabyOctopus Ballblob Caterpillar clam Dustdevil Eyeball
# Boogermonster GiantWorm Jellyfish2 Motherjellyfish Nautilus Neptune SeaSnake SharkSub
ACTOR_SPRITES := Jellyfish1 Squiddart Plankton
ACTOR_SPRITES := Jellyfish1 Squiddart Plankton Butterfly
ACTOR_SPR_LIST := $(foreach ACTOR,$(ACTOR_SPRITES), $(ACTOR_IN_DIR)/$(ACTOR)/$(ACTOR_SPRITE_DIR)/$(ACTOR)_*.bmp)
ACTOR_SPR_DEP := $(foreach ACTOR,$(ACTOR_SPRITES), $(ACTOR_IN_DIR)/$(ACTOR)/$(ACTOR_SPRITE_DIR)/*)

View File

@ -638,6 +638,10 @@ void CNpcEnemy::init()
m_isCaught = false;
m_isBlowerOn = false;
m_speed = m_data[m_type].speed;
setCollisionSize( 100, 100 );
updateCollisionArea();
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -84,6 +84,7 @@ public:
NPC_MOTHER_JELLYFISH_BACKGROUND,
NPC_SMALL_JELLYFISH_BACKGROUND,
NPC_SMALL_JELLYFISH_2_BACKGROUND,
NPC_BUTTERFLY_BACKGROUND,
NPC_UNIT_TYPE_MAX,
};

View File

@ -111,6 +111,10 @@
#include <ACTOR_SEASNAKE_ANIM.h>
#endif
#ifndef __ANIM_BUTTERFLY_HEADER__
#include <ACTOR_BUTTERFLY_ANIM.h>
#endif
CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{
@ -1079,6 +1083,29 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
false,
false,
},
{ // NPC_BUTTERFLY_BACKGROUND
0,//ACTORS_BUTTERFLY_SBK,
FRM_JELLYFISH1_SWIM1,
NPC_SENSOR_USER_CLOSE,
NPC_MOVEMENT_FIXED_PATH,
NPC_CLOSE_NONE,
NPC_TIMER_NONE,
false,
2,
128,
DETECT_ALL_COLLISION,
DAMAGE__NONE,
16,
FRM_JELLYFISH1_SWIM1,
NPC_SHOT_GENERIC,
0,
FRM_JELLYFISH1_SWIM1,
true,
false,
false,
false,
},
};
CNpcEnemy::NPC_UNIT_TYPE CNpcEnemy::mapEditConvertTable[NPC_UNIT_TYPE_MAX] =

View File

@ -27,6 +27,10 @@
#include "enemy\nsj2back.h"
#endif
#ifndef __ENEMY_NBUTTFLY_H__
#include "enemy\nbuttfly.h"
#endif
#ifndef __ENEMY_NPC_H__
#include "enemy\npc.h"
#endif
@ -65,7 +69,7 @@ void CJellyfishGenerator::init()
{
case 2:
{
m_on = false;
m_level = 3;
break;
}
@ -99,26 +103,56 @@ void CJellyfishGenerator::think( int _frames, CLevel *level )
m_jellyfishCount++;
CNpcEnemy *enemy;
CNpcEnemy *enemy = NULL;
if ( m_level == 1 )
switch( m_level )
{
enemy = new( "jellyfish" ) CNpcSmallJellyfishBackgroundEnemy;
}
else
{
enemy = new( "jellyfish" ) CNpcSmallJellyfish2BackgroundEnemy;
case 1:
{
enemy = new( "jellyfish" ) CNpcSmallJellyfishBackgroundEnemy;
break;
}
case 2:
{
enemy = new( "jellyfish" ) CNpcSmallJellyfish2BackgroundEnemy;
break;
}
case 3:
{
enemy = new( "butterfly" ) CNpcButterflyBackgroundEnemy;
break;
}
}
ASSERT(enemy);
if ( m_level == 1 )
switch( m_level )
{
enemy->setType( CNpcEnemy::NPC_SMALL_JELLYFISH_BACKGROUND );
}
else
{
enemy->setType( CNpcEnemy::NPC_SMALL_JELLYFISH_2_BACKGROUND );
case 1:
{
enemy->setType( CNpcEnemy::NPC_SMALL_JELLYFISH_BACKGROUND );
break;
}
case 2:
{
enemy->setType( CNpcEnemy::NPC_SMALL_JELLYFISH_2_BACKGROUND );
break;
}
case 3:
{
enemy->setType( CNpcEnemy::NPC_BUTTERFLY_BACKGROUND );
break;
}
}
enemy->init();
@ -127,34 +161,61 @@ void CJellyfishGenerator::think( int _frames, CLevel *level )
DVECTOR offset = CLevel::getCameraPos();
DVECTOR startPos;
if ( m_level == 1 )
{
CNpcSmallJellyfishBackgroundEnemy *jfish = ( CNpcSmallJellyfishBackgroundEnemy * ) enemy;
if ( ( getRnd() % 10 ) > 4 )
{
jfish->setTargetHeading( 0 );
startPos.vx = offset.vx - 20;
}
else
{
jfish->setTargetHeading( 2048 );
startPos.vx = offset.vx + VidGetScrW() + 20;
}
}
else
switch( m_level )
{
CNpcSmallJellyfish2BackgroundEnemy *jfish = ( CNpcSmallJellyfish2BackgroundEnemy * ) enemy;
case 1:
{
CNpcSmallJellyfishBackgroundEnemy *jfish = ( CNpcSmallJellyfishBackgroundEnemy * ) enemy;
if ( ( getRnd() % 10 ) > 4 )
{
jfish->setTargetHeading( 0 );
startPos.vx = offset.vx - 20;
if ( ( getRnd() % 10 ) > 4 )
{
jfish->setTargetHeading( 0 );
startPos.vx = offset.vx - 20;
}
else
{
jfish->setTargetHeading( 2048 );
startPos.vx = offset.vx + VidGetScrW() + 20;
}
break;
}
else
case 2:
{
jfish->setTargetHeading( 2048 );
startPos.vx = offset.vx + VidGetScrW() + 20;
CNpcSmallJellyfish2BackgroundEnemy *jfish = ( CNpcSmallJellyfish2BackgroundEnemy * ) enemy;
if ( ( getRnd() % 10 ) > 4 )
{
jfish->setTargetHeading( 0 );
startPos.vx = offset.vx - 20;
}
else
{
jfish->setTargetHeading( 2048 );
startPos.vx = offset.vx + VidGetScrW() + 20;
}
break;
}
case 3:
{
CNpcButterflyBackgroundEnemy *jfish = ( CNpcButterflyBackgroundEnemy * ) enemy;
if ( ( getRnd() % 10 ) > 4 )
{
jfish->setTargetHeading( 0 );
startPos.vx = offset.vx - 20;
}
else
{
jfish->setTargetHeading( 2048 );
startPos.vx = offset.vx + VidGetScrW() + 20;
}
break;
}
}

View File

@ -137,6 +137,14 @@ SOURCE=..\..\..\source\enemy\nbooger.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\enemy\nbuttfly.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\enemy\nbuttfly.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\enemy\nclam.cpp
# End Source File
# Begin Source File