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