2012-06-14 13:06:06 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2012-09-23 22:09:57 +00:00
|
|
|
#include "Entity.h"
|
2014-06-06 07:17:49 +00:00
|
|
|
#include "EntityEffects.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:
|
2012-12-21 12:21:20 +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
|
|
|
|
|
|
|
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
|
2014-06-07 23:32:37 +00:00
|
|
|
virtual void KilledBy(cEntity * a_Killer) 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)
|
2014-06-13 17:59:59 +00:00
|
|
|
@param a_Creator The pawn that produced the effect (e.g. threw the potion)
|
2014-06-13 09:41:43 +00:00
|
|
|
@param a_DistanceModifier The scalar multiplied to the potion duration, only applies to splash potions)
|
|
|
|
*/
|
2014-06-13 17:59:59 +00:00
|
|
|
void AddEntityEffect(cEntityEffect::eType a_EffectType, int a_EffectDurationTicks, short a_EffectIntensity, cPawn * a_Creator, 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-07 07:54:03 +00:00
|
|
|
typedef std::map<cEntityEffect::eType, cEntityEffect> tEffectMap;
|
|
|
|
tEffectMap m_EntityEffects;
|
2014-06-07 04:48:20 +00:00
|
|
|
|
2014-06-07 20:45:00 +00:00
|
|
|
/** Applies entity effect effects
|
|
|
|
* @param a_EffectType The selected entity effect
|
|
|
|
* @param a_Effect The parameters of the selected entity effect
|
|
|
|
*/
|
2014-06-13 02:50:02 +00:00
|
|
|
virtual void HandleEntityEffect(cEntityEffect::eType a_EffectType, cEntityEffect a_Effect);
|
2013-07-01 10:39:56 +00:00
|
|
|
} ; // tolua_export
|
2012-06-14 13:06:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|