6 #include "../BlockInfo.h"
8 #include "../Entities/ThrownSnowballEntity.h"
15 Super(
"SnowGolem",
mtSnowGolem,
"entity.snowman.hurt",
"entity.snowman.death",
"entity.snowman.ambient", 0.7f, 1.9f)
52 else if (
const auto Below = Rel.addedY(-1); Below.y >= 0)
75 Vector3d Inaccuracy =
Vector3d(Random.RandReal<
double>(-0.75, 0.75), Random.RandReal<
double>(-0.75, 0.75), Random.RandReal<
double>(-0.75, 0.75));
82 const auto Speed = (TargetPos + Inaccuracy - HeadPos) * 5;
84 auto Snowball = std::make_unique<cThrownSnowballEntity>(
this, HeadPos, Speed);
bool IsBiomeNoDownfall(EMCSBiome a_Biome)
Returns true if the biome has no downfall - deserts and savannas.
#define PREPARE_REL_AND_CHUNK(Position, OriginalChunk)
MTRand & GetRandomProvider()
Returns the current thread's random number source.
Vector3< double > Vector3d
static bool IsSolid(BLOCKTYPE Block)
Is this block solid (player cannot walk through)?
virtual double GetKnockbackAmountAgainst(const cEntity &a_Receiver)
Returns the knockback amount that the currently equipped items would cause to a_Receiver on a hit.
bool IsTicking(void) const
Returns true if the entity is valid and ticking.
void TakeDamage(cEntity &a_Attacker)
Makes this pawn take damage from an attack by a_Attacker.
float GetHeight(void) const
const Vector3d & GetPosition(void) const
Exported in ManualBindings.
virtual int GetRawDamageAgainst(const cEntity &a_Receiver)
Returns the hitpoints that this pawn can deal to a_Receiver using its equipped items.
cWorld * GetWorld(void) const
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()
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.
int m_AttackCoolDownTicksLeft
void StopMovingToPosition()
Stops pathfinding.
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 GetDrops(cItems &a_Drops, cEntity *a_Killer=nullptr) override
Returns the list of drops for this pawn when it is killed.
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
Vector3< T > addedY(T a_AddY) const
Returns a copy of this vector moved by the specified amount on the y axis.