2012-06-14 09:06:06 -04:00
|
|
|
|
|
|
|
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
|
|
|
|
|
2012-09-23 16:53:08 -04:00
|
|
|
#include "PassiveAggressiveMonster.h"
|
2012-06-14 09:06:06 -04:00
|
|
|
|
2013-08-19 05:39:13 -04:00
|
|
|
#include "../Entities/Player.h"
|
2012-06-14 09:06:06 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-22 11:50:34 -04:00
|
|
|
cPassiveAggressiveMonster::cPassiveAggressiveMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, const AString & a_SoundAmbient, double a_Width, double a_Height) :
|
2020-04-13 12:38:06 -04:00
|
|
|
Super(a_ConfigName, a_MobType, a_SoundHurt, a_SoundDeath, a_SoundAmbient, a_Width, a_Height)
|
2012-06-14 09:06:06 -04:00
|
|
|
{
|
|
|
|
m_EMPersonality = PASSIVE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-12-21 06:04:08 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-25 18:32:30 -04:00
|
|
|
bool cPassiveAggressiveMonster::DoTakeDamage(TakeDamageInfo & a_TDI)
|
2012-06-14 09:06:06 -04:00
|
|
|
{
|
2020-04-13 12:38:06 -04:00
|
|
|
if (!Super::DoTakeDamage(a_TDI))
|
2014-04-25 18:32:30 -04:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2016-01-17 09:09:25 -05:00
|
|
|
|
2016-02-01 15:49:34 -05:00
|
|
|
if ((GetTarget() != nullptr) && (GetTarget()->IsPlayer()))
|
2012-06-14 09:06:06 -04:00
|
|
|
{
|
2016-10-12 08:38:45 -04:00
|
|
|
if (static_cast<cPlayer *>(GetTarget())->CanMobsTarget())
|
2012-06-14 09:06:06 -04:00
|
|
|
{
|
|
|
|
m_EMState = CHASING;
|
|
|
|
}
|
|
|
|
}
|
2014-04-25 18:32:30 -04:00
|
|
|
return true;
|
2012-06-14 09:06:06 -04:00
|
|
|
}
|
|
|
|
|
2012-12-21 06:04:08 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2016-10-12 08:38:45 -04:00
|
|
|
|
|
|
|
void cPassiveAggressiveMonster::EventSeePlayer(cPlayer *, cChunk & a_Chunk)
|
2015-11-08 14:53:32 -05:00
|
|
|
{
|
|
|
|
// don't do anything, neutral mobs don't react to just seeing the player
|
|
|
|
}
|
|
|
|
|
|
|
|
|