This commit is contained in:
Charles 2001-02-06 19:29:35 +00:00
parent 47cf9e3071
commit e0d7168d5c
6 changed files with 46 additions and 25 deletions

View File

@ -72,6 +72,7 @@ enemy_src := 2denemy \
nhazard \
nffolk \
nocto \
nfskull \
enemy
projectl_src := projectl

View File

@ -83,7 +83,7 @@ void CNpc::processGenericGotoTarget( int _frames, s32 xDist, s32 yDist, s32 spee
Pos.vy += moveY;
}
void CNpc::processCloseGenericUserSeek( int _frames )
void CNpc::processGenericGetUserDist( int _frames, s32 *distX, s32 *distY )
{
s32 moveX = 0, moveY = 0;
@ -95,21 +95,6 @@ void CNpc::processCloseGenericUserSeek( int _frames )
DVECTOR playerPos = player->getPos();
s32 xDist, yDist;
s32 xDistSqr, yDistSqr;
xDist = playerPos.vx - this->Pos.vx;
xDistSqr = xDist * xDist;
yDist = playerPos.vy - this->Pos.vy;
yDistSqr = yDist * yDist;
//if ( xDistSqr + yDistSqr > 22500 )
//{
//this->m_controlFunc = NPC_CONTROL_MOVEMENT;
//}
//else
{
processGenericGotoTarget( _frames, xDist, yDist, m_data[m_type].speed );
}
*distX = playerPos.vx - this->Pos.vx;
*distY = playerPos.vy - this->Pos.vy;
}

View File

@ -48,7 +48,7 @@
void CNpc::init()
{
m_type = NPC_SMALL_JELLYFISH_1;
m_type = NPC_FLAMING_SKULL;
m_heading = m_fireHeading = 0;
m_movementTimer = 0;
@ -266,6 +266,13 @@ void CNpc::init()
break;
}
case NPC_FLAMING_SKULL:
{
m_state = FLAMING_SKULL_ATTACK;
break;
}
default:
break;
@ -539,6 +546,7 @@ bool CNpc::processSensor()
case NPC_SENSOR_ANEMONE_USER_CLOSE:
case NPC_SENSOR_EYEBALL_USER_CLOSE:
case NPC_SENSOR_FLAMING_SKULL_USER_CLOSE:
{
if ( xDistSqr + yDistSqr < 40000 )
{
@ -849,9 +857,14 @@ void CNpc::processClose(int _frames)
break;
case NPC_CLOSE_GENERIC_USER_SEEK:
processCloseGenericUserSeek( _frames );
{
s32 distX, distY;
processGenericGetUserDist( _frames, &distX, &distY );
processGenericGotoTarget( _frames, distX, distY, m_data[m_type].speed );
break;
}
case NPC_CLOSE_GHOST_PIRATE_ATTACK:
processCloseGhostPirateAttack( _frames );
@ -918,6 +931,11 @@ void CNpc::processClose(int _frames)
break;
case NPC_CLOSE_FLAMING_SKULL_ATTACK:
processCloseFlamingSkullAttack( _frames );
break;
default:
break;
}

View File

@ -97,6 +97,7 @@ protected:
NPC_INIT_FIREBALL,
NPC_INIT_RETURNING_HAZARD,
NPC_INIT_FISH_FOLK,
NPC_INIT_FLAMING_SKULL,
};
enum NPC_CONTROL_FUNC
@ -125,6 +126,7 @@ protected:
NPC_SENSOR_IRON_DOGFISH_USER_CLOSE,
NPC_SENSOR_FALLING_ITEM_USER_CLOSE,
NPC_SENSOR_FISH_HOOK_USER_CLOSE,
NPC_SENSOR_FLAMING_SKULL_USER_CLOSE,
};
enum NPC_CLOSE_FUNC
@ -147,6 +149,7 @@ protected:
NPC_CLOSE_IRON_DOGFISH_ATTACK,
NPC_CLOSE_FALLING_ITEM_FALL,
NPC_CLOSE_FISH_HOOK_RISE,
NPC_CLOSE_FLAMING_SKULL_ATTACK,
};
enum NPC_MOVEMENT_FUNC
@ -208,6 +211,12 @@ protected:
IRON_DOGFISH_LASER_EYE_2,
};
enum NPC_FLAMING_SKULL_STATE
{
FLAMING_SKULL_ATTACK = 0,
FLAMING_SKULL_RETURN = 1,
};
enum
{
NPC_JELLYFISH_RESISTANCE = 64,
@ -244,7 +253,7 @@ protected:
void processTimer( int _frames );
void processGenericGotoTarget( int _frames, s32 xDist, s32 yDist, s32 speed );
void processCloseGenericUserSeek( int _frames );
void processGenericGetUserDist( int _frames, s32 *distX, s32 *distY );
// small jellyfish functions
@ -285,6 +294,10 @@ protected:
void processCloseEyeballAttack( int _frames );
// flaming skull functions
void processCloseFlamingSkullAttack( int _frames );
// skull stomper functions
void processCloseSkullStomperAttack( int _frames );

View File

@ -378,14 +378,14 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
},
{ // NPC_FLAMING_SKULL
NPC_INIT_DEFAULT,
NPC_SENSOR_NONE,
NPC_INIT_FLAMING_SKULL,
NPC_SENSOR_FLAMING_SKULL_USER_CLOSE,
NPC_MOVEMENT_STATIC,
NPC_MOVEMENT_MODIFIER_NONE,
NPC_CLOSE_NONE,
NPC_CLOSE_FLAMING_SKULL_ATTACK,
NPC_TIMER_NONE,
false,
0,
3,
128,
},

View File

@ -153,6 +153,10 @@ SOURCE=..\..\..\source\enemy\nffolk.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\enemy\nfskull.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\enemy\ngeneric.cpp
# End Source File
# Begin Source File