2012-06-14 13:06:06 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2012-09-23 22:09:57 +00:00
|
|
|
#include "Entity.h"
|
2014-06-17 03:22:17 +00:00
|
|
|
#include "EntityEffect.h"
|
2012-06-14 13:06:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-21 11:04:08 +00:00
|
|
|
// tolua_begin
|
|
|
|
class cPawn :
|
|
|
|
public cEntity
|
2012-12-21 12:21:20 +00:00
|
|
|
{
|
2012-12-21 11:04:08 +00:00
|
|
|
// tolua_end
|
2012-12-21 12:21:20 +00:00
|
|
|
typedef cEntity super;
|
|
|
|
|
2012-06-14 13:06:06 +00:00
|
|
|
public:
|
2014-07-22 22:36:13 +00:00
|
|
|
CLASS_PROTODEF(cPawn)
|
2012-06-14 13:06:06 +00:00
|
|
|
|
2013-07-01 10:39:56 +00:00
|
|
|
cPawn(eEntityType a_EntityType, double a_Width, double a_Height);
|
2014-06-06 07:17:49 +00:00
|
|
|
|
2015-01-11 21:12:26 +00:00
|
|
|
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
|
2014-07-17 09:07:10 +00:00
|
|
|
virtual void KilledBy(TakeDamageInfo & a_TDI) override;
|
2014-06-06 07:17:49 +00:00
|
|
|
|
2014-06-13 02:50:02 +00:00
|
|
|
// tolua_begin
|
2014-06-13 09:04:16 +00:00
|
|
|
|
2014-06-13 09:41:43 +00:00
|
|
|
/** Applies an entity effect
|
2014-06-13 10:47:01 +00:00
|
|
|
Checks with plugins if they allow the addition.
|
2014-06-13 09:41:43 +00:00
|
|
|
@param a_EffectType The entity effect to apply
|
|
|
|
@param a_EffectDurationTicks The duration of the effect
|
|
|
|
@param a_EffectIntensity The level of the effect (0 = Potion I, 1 = Potion II, etc)
|
|
|
|
@param a_DistanceModifier The scalar multiplied to the potion duration, only applies to splash potions)
|
|
|
|
*/
|
2014-07-12 00:27:29 +00:00
|
|
|
void AddEntityEffect(cEntityEffect::eType a_EffectType, int a_EffectDurationTicks, short a_EffectIntensity, double a_DistanceModifier = 1);
|
2014-06-07 20:45:00 +00:00
|
|
|
|
|
|
|
/** Removes a currently applied entity effect
|
2014-06-13 09:04:16 +00:00
|
|
|
@param a_EffectType The entity effect to remove
|
|
|
|
*/
|
2014-06-06 07:17:49 +00:00
|
|
|
void RemoveEntityEffect(cEntityEffect::eType a_EffectType);
|
2014-06-07 20:45:00 +00:00
|
|
|
|
|
|
|
/** Removes all currently applied entity effects (used when drinking milk) */
|
2014-06-13 09:04:16 +00:00
|
|
|
void ClearEntityEffects(void);
|
|
|
|
|
2014-06-13 02:50:02 +00:00
|
|
|
// tolua_end
|
2012-06-14 13:06:06 +00:00
|
|
|
|
|
|
|
protected:
|
2014-06-17 03:22:17 +00:00
|
|
|
typedef std::map<cEntityEffect::eType, cEntityEffect *> tEffectMap;
|
2014-06-07 07:54:03 +00:00
|
|
|
tEffectMap m_EntityEffects;
|
2013-07-01 10:39:56 +00:00
|
|
|
} ; // tolua_export
|
2012-06-14 13:06:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|