This commit is contained in:
parent
d242868b13
commit
2b7bbbf467
@ -568,7 +568,6 @@ void CNpcEnemy::shutdown()
|
||||
|
||||
m_positionHistory = NULL;
|
||||
|
||||
// temporary
|
||||
CEnemyThing::shutdown();
|
||||
}
|
||||
|
||||
@ -682,6 +681,16 @@ void CNpcEnemy::collidedWith( CThing *_thisThing )
|
||||
|
||||
bool CNpcEnemy::processSensor()
|
||||
{
|
||||
// temporary
|
||||
if ( playerXDistSqr + playerYDistSqr < 10000 )
|
||||
{
|
||||
m_controlFunc = NPC_CONTROL_SHOT;
|
||||
m_state = NPC_GENERIC_DEATH_START;
|
||||
|
||||
return( true );
|
||||
}
|
||||
// temporary
|
||||
|
||||
switch( m_sensorFunc )
|
||||
{
|
||||
case NPC_SENSOR_NONE:
|
||||
@ -1207,6 +1216,43 @@ void CNpcEnemy::hasBeenAttacked()
|
||||
|
||||
void CNpcEnemy::processShot()
|
||||
{
|
||||
switch( m_data[m_type].shotFunc )
|
||||
{
|
||||
case NPC_SHOT_NONE:
|
||||
{
|
||||
// do nothing
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case NPC_SHOT_GENERIC_DIE:
|
||||
{
|
||||
switch ( m_state )
|
||||
{
|
||||
case NPC_GENERIC_DEATH_START:
|
||||
{
|
||||
m_animPlaying = true;
|
||||
m_animNo = m_data[m_type].dieAnim;
|
||||
m_frame = 0;
|
||||
m_state = NPC_GENERIC_DEATH_END;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case NPC_GENERIC_DEATH_END:
|
||||
{
|
||||
if ( !m_animPlaying )
|
||||
{
|
||||
this->shutdown();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -304,6 +304,12 @@ protected:
|
||||
NPC_TIMER_ATTACK_DONE,
|
||||
};
|
||||
|
||||
enum NPC_SHOT_FUNC
|
||||
{
|
||||
NPC_SHOT_NONE = 0,
|
||||
NPC_SHOT_GENERIC_DIE = 1,
|
||||
};
|
||||
|
||||
enum NPC_MOTHER_JELLYFISH_STATE
|
||||
{
|
||||
MOTHER_JELLYFISH_RETURN_TO_START_1 = 0,
|
||||
@ -361,6 +367,12 @@ protected:
|
||||
PUFFA_FISH_INFLATE,
|
||||
};
|
||||
|
||||
enum NPC_GENERIC_DEATH_STATE
|
||||
{
|
||||
NPC_GENERIC_DEATH_START = 100,
|
||||
NPC_GENERIC_DEATH_END = 101,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
NPC_JELLYFISH_RESISTANCE = 64,
|
||||
@ -396,6 +408,8 @@ protected:
|
||||
DAMAGE_TYPE damageToUserType;
|
||||
u16 initHealth;
|
||||
u16 moveAnim;
|
||||
NPC_SHOT_FUNC shotFunc;
|
||||
u16 dieAnim;
|
||||
}
|
||||
NPC_DATA;
|
||||
|
||||
|
@ -202,6 +202,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__SQUASH_ENEMY,
|
||||
0,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_FISH_HOOK
|
||||
@ -220,6 +222,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__NONE,
|
||||
0,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_DUST_DEVIL
|
||||
@ -238,6 +242,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__NONE,
|
||||
0,
|
||||
ANIM_DUSTDEVIL_TWIST,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_PENDULUM
|
||||
@ -256,6 +262,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
0,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_FIREBALL
|
||||
@ -274,6 +282,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__BURN_ENEMY,
|
||||
0,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_SAW_BLADE
|
||||
@ -292,6 +302,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
0,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_SMALL_JELLYFISH_1
|
||||
@ -310,6 +322,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__SHOCK_ENEMY,
|
||||
16,
|
||||
ANIM_JELLYFISH1_SWIM,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_SMALL_JELLYFISH_2
|
||||
@ -328,6 +342,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__SHOCK_ENEMY,
|
||||
32,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_ANEMONE_1
|
||||
@ -346,6 +362,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__NONE,
|
||||
16,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_ANEMONE_2
|
||||
@ -364,6 +382,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__NONE,
|
||||
32,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_ANEMONE_3
|
||||
@ -382,6 +402,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__NONE,
|
||||
48,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_SKELETAL_FISH
|
||||
@ -400,6 +422,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__BITE_ENEMY,
|
||||
0,
|
||||
ANIM_SKELETALFISH_SWIM,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
ANIM_SKELETALFISH_DIE,
|
||||
},
|
||||
|
||||
{ // NPC_CLAM_JUMP
|
||||
@ -418,6 +442,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
0,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_CLAM_STATIC
|
||||
@ -436,6 +462,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
0,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_SQUID_DART
|
||||
@ -454,6 +482,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
16,
|
||||
ANIM_SQUIDDART_SWIM,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_FISH_FOLK
|
||||
@ -472,6 +502,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__NONE,
|
||||
0,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_PRICKLY_BUG
|
||||
@ -490,6 +522,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__POISON_ENEMY,
|
||||
48,
|
||||
ANIM_CATERPILLAR_CRAWL,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
ANIM_CATERPILLAR_DIE,
|
||||
},
|
||||
|
||||
{ // NPC_SEA_SNAKE
|
||||
@ -508,6 +542,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__SHOCK_ENEMY,
|
||||
56,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_PUFFA_FISH
|
||||
@ -526,6 +562,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
64,
|
||||
ANIM_PUFFAFISH_SWIM,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_ANGLER_FISH
|
||||
@ -544,6 +582,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__NONE,
|
||||
0,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_HERMIT_CRAB
|
||||
@ -562,6 +602,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
0,
|
||||
ANIM_HERMITCRAB_SCUTTLE,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
ANIM_HERMITCRAB_DIE,
|
||||
},
|
||||
|
||||
{ // NPC_MINE
|
||||
@ -580,6 +622,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
0,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_BOOGER_MONSTER
|
||||
@ -598,6 +642,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__BITE_ENEMY,
|
||||
0,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_SPIDER_CRAB
|
||||
@ -616,6 +662,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__PINCH_ENEMY,
|
||||
0,
|
||||
ANIM_SPIDERCRAB_RUN,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
ANIM_SPIDERCRAB_DIE,
|
||||
},
|
||||
|
||||
{ // NPC_EYEBALL
|
||||
@ -634,6 +682,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
32,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_BABY_OCTOPUS
|
||||
@ -652,6 +702,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
0,
|
||||
ANIM_BABYOCTOPUS_SWIM,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
ANIM_BABYOCTOPUS_DIE,
|
||||
},
|
||||
|
||||
{ // NPC_ZOMBIE_FISH_FOLK
|
||||
@ -670,6 +722,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
16,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_NINJA_STARFISH
|
||||
@ -688,6 +742,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
16,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_GHOST
|
||||
@ -706,6 +762,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
0,
|
||||
ANIM_GHOST_MOVE,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_GHOST_PIRATE
|
||||
@ -724,6 +782,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
160,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_FLAMING_SKULL
|
||||
@ -742,6 +802,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__BURN_ENEMY,
|
||||
16,
|
||||
ANIM_FLAMINGSKULL_MOVE,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_SHARK_MAN
|
||||
@ -760,6 +822,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__BITE_ENEMY,
|
||||
16,
|
||||
ANIM_SHARKMAN_RUN,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
ANIM_SHARKMAN_DIE,
|
||||
},
|
||||
|
||||
{ // NPC_OIL_BLOB
|
||||
@ -778,6 +842,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
0,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_SKULL_STOMPER
|
||||
@ -796,6 +862,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__SQUASH_ENEMY,
|
||||
0,
|
||||
ANIM_STOMPER_CRUSH,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_MOTHER_JELLYFISH
|
||||
@ -814,6 +882,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__SHOCK_ENEMY,
|
||||
256,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_SUB_SHARK
|
||||
@ -832,6 +902,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
256,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_PARASITIC_WORM
|
||||
@ -850,6 +922,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
256,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_FLYING_DUTCHMAN
|
||||
@ -868,6 +942,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
256,
|
||||
ANIM_FLYINGDUTCHMAN_FLY,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_IRON_DOGFISH
|
||||
@ -886,6 +962,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
256,
|
||||
ANIM_IRONDOGFISH_WALK,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_PARASITIC_WORM_SEGMENT
|
||||
@ -904,6 +982,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__HIT_ENEMY,
|
||||
256,
|
||||
0,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
|
||||
{ // NPC_BALL_BLOB
|
||||
@ -922,6 +1002,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||
DAMAGE__BURN_ENEMY,
|
||||
16,
|
||||
ANIM_BALLBLOB_WOBBLE,
|
||||
NPC_SHOT_GENERIC_DIE,
|
||||
0,
|
||||
},
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user