6 #include "../Entities/ArrowEntity.h"
7 #include "../ClientHandle.h"
13 Super(
"Skeleton",
mtSkeleton,
"entity.skeleton.hurt",
"entity.skeleton.death",
"entity.skeleton.ambient", 0.6f, 1.99f),
24 unsigned int LootingLevel = 0;
25 if (a_Killer !=
nullptr)
76 Vector3d Inaccuracy =
Vector3d(Random.RandReal<
double>(-0.25, 0.25), Random.RandReal<
double>(-0.25, 0.25), Random.RandReal<
double>(-0.25, 0.25));
78 Speed.
y += Random.RandInt(-1, 1);
80 auto Arrow = std::make_unique<cArrowEntity>(
this,
GetPosition().addedY(1), Speed);
81 auto ArrowPtr =
Arrow.get();
MTRand & GetRandomProvider()
Returns the current thread's random number source.
Vector3< double > Vector3d
void SendEntityEquipment(const cEntity &a_Entity, short a_SlotNum, const cItem &a_Item)
unsigned int GetLevel(int a_EnchantmentID) const
Returns the level for the specified enchantment; 0 if not stored.
bool IsTicking(void) const
Returns true if the entity is valid and ticking.
virtual cItem GetEquippedWeapon(void) const
Returns the curently equipped weapon; empty item if none.
const Vector3d & GetPosition(void) const
Exported in ManualBindings.
cEnchantments m_Enchantments
This class bridges a vector of cItem for safe access via Lua.
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
void ResetAttackCooldown()
virtual void SpawnOn(cClientHandle &a_ClientHandle) override
Descendants override this function to send a command to the specified client to spawn the entity on t...
void AddRandomDropItem(cItems &a_Drops, unsigned int a_Min, unsigned int a_Max, short a_Item, short a_ItemHealth=0)
Adds a random number of a_Item between a_Min and a_Max to itemdrops a_Drops.
cPawn * GetTarget()
Returns the current target.
void AddRandomWeaponDropItem(cItems &a_Drops, unsigned int a_LootingLevel)
Adds weapon that is equipped with the chance saved in m_DropChance... to the drop.
void AddRandomArmorDropItem(cItems &a_Drops, unsigned int a_LootingLevel)
Adds armor that is equipped with the chance saved in m_DropChance... to the drop.
enum cMonster::MState m_EMState
int m_AttackCoolDownTicksLeft
void StopMovingToPosition()
Stops pathfinding.
virtual void GetDrops(cItems &a_Drops, cEntity *a_Killer=nullptr) override
Returns the list of drops for this pawn when it is killed.
virtual bool Attack(std::chrono::milliseconds a_Dt) override
Try to perform attack returns true if attack was deemed successful (hit player, fired projectile,...
virtual void SpawnOn(cClientHandle &a_ClientHandle) override
Descendants override this function to send a command to the specified client to spawn the entity on t...
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
virtual void BroadcastEntityMetadata(const cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override