2013-07-29 12:13:03 +01:00
|
|
|
|
|
|
|
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
|
|
|
|
|
|
|
|
#include "Villager.h"
|
2013-10-08 19:20:49 +01:00
|
|
|
#include "../World.h"
|
2013-07-29 12:13:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-11 20:57:22 +01:00
|
|
|
cVillager::cVillager(eVillagerType VillagerType) :
|
2013-10-20 10:23:30 +02:00
|
|
|
super("Villager", mtVillager, "", "", 0.6, 1.8),
|
2013-10-11 20:57:22 +01:00
|
|
|
m_Type(VillagerType)
|
2013-07-29 12:13:03 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-08 19:20:49 +01: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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|