This commit is contained in:
Charles 2001-05-01 21:05:14 +00:00
parent caacff430d
commit 0c09237ec7
4 changed files with 9 additions and 65 deletions

View File

@ -1314,35 +1314,6 @@ void CNpcEnemy::processEvent( GAME_EVENT evt, CThing *sourceThing )
{
switch( evt )
{
case USER_REQUEST_TALK_EVENT:
{
if ( m_data[this->m_type].canTalk )
{
DVECTOR sourcePos;
s32 xDiffSqr, yDiffSqr;
// check talk distance
sourcePos = sourceThing->getPos();
xDiffSqr = this->Pos.vx - sourcePos.vx;
xDiffSqr *= xDiffSqr;
yDiffSqr = this->Pos.vy - sourcePos.vy;
yDiffSqr *= yDiffSqr;
if ( xDiffSqr + yDiffSqr < 10000 )
{
if( !CConversation::isActive() )
{
CConversation::trigger( SCRIPTS_SPEECHTEST_DAT );
}
}
}
break;
}
case PROJECTILE_RETURNED_TO_SOURCE_EVENT:
{
m_controlFunc = NPC_CONTROL_MOVEMENT;

View File

@ -250,28 +250,11 @@ void CNpcFriend::render()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFriend::processEvent( GAME_EVENT evt, CThing *sourceThing )
{
switch( evt )
{
case USER_REQUEST_TALK_EVENT:
void CNpcFriend::startConderversation()
{
// I am 'avin a fayg
if ( m_data[this->m_type].canTalk )
{
DVECTOR sourcePos;
s32 xDiffSqr, yDiffSqr;
// check talk distance
sourcePos = sourceThing->getPos();
xDiffSqr = this->Pos.vx - sourcePos.vx;
xDiffSqr *= xDiffSqr;
yDiffSqr = this->Pos.vy - sourcePos.vy;
yDiffSqr *= yDiffSqr;
if ( xDiffSqr + yDiffSqr < 10000 )
{
if( !CConversation::isActive() )
{
@ -279,13 +262,3 @@ void CNpcFriend::processEvent( GAME_EVENT evt, CThing *sourceThing )
}
}
}
break;
}
default:
// ignore
break;
}
}

View File

@ -42,7 +42,6 @@ public:
void shutdown();
virtual void think(int _frames);
void render();
void processEvent( GAME_EVENT evt, CThing *sourceThing );
void setLayerCollision( class CLayerCollision *_layer ) {m_layerCollision=_layer;}
void setType( NPC_FRIEND_UNIT_TYPE newType ) {m_type = newType;}
@ -75,6 +74,8 @@ protected:
static NPC_FRIEND_UNIT_TYPE mapEditConvertTable[NPC_FRIEND_UNIT_TYPE_MAX];
void startConderversation();
enum
{
EXTEND_RIGHT = true,

View File

@ -7,7 +7,6 @@
enum GAME_EVENT
{
USER_REQUEST_TALK_EVENT,
PROJECTILE_RETURNED_TO_SOURCE_EVENT,
};