This commit is contained in:
Charles 2001-05-01 22:06:59 +00:00
parent b061d250d6
commit 5e15b2b759
3 changed files with 39 additions and 0 deletions

View File

@ -250,6 +250,30 @@ void CNpcFriend::render()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFriend::collidedWith( CThing *_thisThing )
{
switch(_thisThing->getThingType())
{
case TYPE_PLAYER:
{
CPlayer *player = (CPlayer *) _thisThing;
if ( player->isTryingToConversateWithFriend() )
{
startConderversation();
}
break;
}
default:
ASSERT(0);
break;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFriend::startConderversation()
{
// I am 'avin a fayg

View File

@ -76,6 +76,8 @@ protected:
void startConderversation();
virtual void collidedWith(CThing *_thisThing);
enum
{
EXTEND_RIGHT = true,

View File

@ -171,6 +171,19 @@ void CThingManager::thinkAllThings(int _frames)
thing1=thing1->m_nextThing;
}
// Player -> Friend collision
thing1=s_thingLists[CThing::TYPE_NPC];
thing2=s_thingLists[CThing::TYPE_PLAYER];
while(thing1&&thing2)
{
if(thing1->canCollide()&&
thing1->checkCollisionAgainst(thing2, _frames))
{
thing1->collidedWith(thing2);
}
thing1=thing1->m_nextThing;
}
// Player -> Hazard collision
thing1=s_thingLists[CThing::TYPE_HAZARD];
thing2=s_thingLists[CThing::TYPE_PLAYER];