This commit is contained in:
parent
caacff430d
commit
0c09237ec7
@ -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;
|
||||
|
@ -250,42 +250,15 @@ void CNpcFriend::render()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcFriend::processEvent( GAME_EVENT evt, CThing *sourceThing )
|
||||
void CNpcFriend::startConderversation()
|
||||
{
|
||||
switch( evt )
|
||||
// I am 'avin a fayg
|
||||
|
||||
if ( m_data[this->m_type].canTalk )
|
||||
{
|
||||
case USER_REQUEST_TALK_EVENT:
|
||||
if( !CConversation::isActive() )
|
||||
{
|
||||
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;
|
||||
CConversation::trigger( SCRIPTS_SPEECHTEST_DAT );
|
||||
}
|
||||
|
||||
default:
|
||||
// ignore
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
@ -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,
|
||||
|
@ -7,7 +7,6 @@
|
||||
|
||||
enum GAME_EVENT
|
||||
{
|
||||
USER_REQUEST_TALK_EVENT,
|
||||
PROJECTILE_RETURNED_TO_SOURCE_EVENT,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user