2013-07-29 11:13:03 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "PassiveMonster.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class cVillager :
|
|
|
|
public cPassiveMonster
|
|
|
|
{
|
|
|
|
typedef cPassiveMonster super;
|
|
|
|
|
|
|
|
public:
|
2013-10-11 19:57:22 +00:00
|
|
|
|
|
|
|
enum eVillagerType
|
|
|
|
{
|
2013-10-13 11:47:55 +00:00
|
|
|
vtFarmer = 0,
|
|
|
|
vtLibrarian = 1,
|
|
|
|
vtPriest = 2,
|
|
|
|
vtBlacksmith = 3,
|
|
|
|
vtButcher = 4,
|
|
|
|
vtGeneric = 5,
|
|
|
|
vtMax
|
2013-10-11 19:57:22 +00:00
|
|
|
} ;
|
|
|
|
|
|
|
|
cVillager(eVillagerType VillagerType);
|
2013-07-29 11:13:03 +00:00
|
|
|
|
|
|
|
CLASS_PROTODEF(cVillager);
|
2013-10-08 18:20:49 +00:00
|
|
|
|
2014-01-27 17:33:57 +00:00
|
|
|
// Override functions
|
2013-10-08 18:20:49 +00:00
|
|
|
virtual void DoTakeDamage(TakeDamageInfo & a_TDI) override;
|
2014-01-27 13:40:31 +00:00
|
|
|
virtual void Tick (float a_Dt, cChunk & a_Chunk) override;
|
|
|
|
|
2014-01-27 17:33:57 +00:00
|
|
|
// cVillager functions
|
2014-01-27 14:44:55 +00:00
|
|
|
bool IsBlockFarmable(BLOCKTYPE a_BlockType);
|
2014-01-27 17:33:57 +00:00
|
|
|
|
2014-01-27 20:34:22 +00:00
|
|
|
// Farmer functions
|
|
|
|
void HandleFarmerAttemptSpecialAction();
|
|
|
|
void HandleFarmerAction();
|
2014-01-27 20:39:00 +00:00
|
|
|
void HandleFarmerEndCountDown();
|
2014-01-27 20:34:22 +00:00
|
|
|
|
2014-01-27 17:33:57 +00:00
|
|
|
// Get and set functions.
|
2013-10-11 19:57:22 +00:00
|
|
|
int GetVilType(void) const { return m_Type; }
|
2014-01-27 17:33:57 +00:00
|
|
|
Vector3i GetCropsPos(void) const { return m_CropsPos; }
|
2014-01-27 20:34:22 +00:00
|
|
|
bool DoesHaveActionActivated(void) const { return m_VillagerAction; }
|
2013-10-08 18:20:49 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2014-01-27 17:27:57 +00:00
|
|
|
int m_ActionCountDown;
|
2013-10-08 18:20:49 +00:00
|
|
|
int m_Type;
|
2014-01-27 20:34:22 +00:00
|
|
|
bool m_VillagerAction;
|
2014-01-27 13:40:31 +00:00
|
|
|
Vector3i m_CropsPos;
|
2013-10-08 18:20:49 +00:00
|
|
|
|
2013-07-29 11:13:03 +00:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|