93 for (
int x=
X()-1; x<=
X()+1; ++x)
94 for (
int y=
Y()-1; y<=
Y()+1; ++y) {
150 const Xyz coords[] = {
158 for (
const Xyz xyz : coords) {
159 if ( not world->
InBounds(xyz.X(), xyz.Y()) ) {
162 Block *
const block = world->
GetBlock(xyz.X(), xyz.Y(), xyz.Z());
165 world->
Damage(xyz.X(), xyz.Y(), xyz.Z(),
167 Eat(static_cast<subs>(block->
Sub()));
bool Move(int x, int y, int z, dirs dir)
Check and move.
void ActFrequent() override
void Mend(int plus)
Increase durability, no more than MAX_DURABILITY.
static QString SubName(int sub)
Returns translated substance name.
void DoRareAction() override
World provides global physics and shred connection.
void DoRareAction() override
Block * DropAfterDamage(bool *delete_block) override
Should return dropped block.
virtual bool Get(Block *block, int start=0)
Returns true on success.
static sub_groups GetSubGroup(int sub)
bool Gravitate(int range, int down, int up, int calmness)
virtual Inventory * HasInventory()
void SaveAttributes(QDataStream &out) const override
Deferred Action is used when some action needs to be done at next physics turn.
QString FullName() const override
int DamageKind() const override
DeferredAction * deferredAction
void SetDeferredAction(DeferredAction *)
inner_actions
See Shred::PhysEventsRare() for details.
void ReceiveSignal(QString) override
Receive text signal.
Block * GetBlock(int x, int y, int z) const
Provides declaration for class Inventory for freg.
int Attractive(int sub) const override
inner_actions ActInner() override
void TryDestroy(int x, int y, int z) const
Damages block and destroys it if it is broken.
static Block * NewBlock(int kind, int sub)
Use this to receive a pointer to new not-normal block.
void SaveAttributes(QDataStream &out) const override
void DestroyAndReplace(int x, int y, int z)
Does not check target block durability.
void Damage(int dmg, int dmg_kind) override
int ShouldAct() const override
bool InBounds(int x, int y) const
int Damage(int x, int y, int z, int level, int dmg_kind)
Returns damaged block result durability.
Animal * IsAnimal() override
int GetDurability() const
int NutritionalValue(subs) const override
void ActFrequent() override
int DamageLevel() const override
virtual void ReceiveSignal(QString)
Receive text signal.
Block without special physics and attributes.
bool IsSubAround(int sub) const
Returns true if there is at least 1 block of substance sub around.
virtual int NutritionalValue(subs) const