2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
|
|
|
|
|
|
|
|
#include "Villager.h"
|
2013-10-08 14:20:49 -04:00
|
|
|
#include "../World.h"
|
2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-11 15:57:22 -04:00
|
|
|
cVillager::cVillager(eVillagerType VillagerType) :
|
2013-10-20 04:23:30 -04:00
|
|
|
super("Villager", mtVillager, "", "", 0.6, 1.8),
|
2013-10-11 15:57:22 -04:00
|
|
|
m_Type(VillagerType)
|
2013-07-29 07:13:03 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-08 14:20:49 -04:00
|
|
|
|
|
|
|
void cVillager::DoTakeDamage(TakeDamageInfo & a_TDI)
|
|
|
|
{
|
|
|
|
super::DoTakeDamage(a_TDI);
|
|
|
|
if (a_TDI.Attacker->IsPlayer())
|
|
|
|
{
|
|
|
|
if (m_World->GetTickRandomNumber(5) == 3)
|
|
|
|
{
|
|
|
|
m_World->BroadcastEntityStatus(*this, ENTITY_STATUS_VILLAGER_ANGRY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|