24 #include <QDataStream>
52 tr(
"Rational creature");
63 const int left_rad = in_left ? in_left ->
LightRadius() : 0;
64 const int right_rad = in_right ? in_right->
LightRadius() : 0;
90 int damage_to_self = dmg;
92 for (
const int i : places) {
93 if (
Number(i) == 0 )
continue;
96 const int damage_divider = (i ==
ON_BODY) ? 2 : 4;
97 armour->
Damage(dmg/damage_divider, dmg_kind);
99 damage_to_self -= dmg/damage_divider;
113 for (
int i=0; i<
Size(); ++i)
114 for (
int j=0; j<
Number(i); ++j) {
131 if ( block ==
nullptr )
return true;
164 if (
Number(slot_number) == 0 ) {
165 switch ( slot_number ) {
166 case ON_HEAD:
return tr(
"-head-");
167 case ON_BODY:
return tr(
"-body-");
168 case ON_LEGS:
return tr(
"-legs-");
169 case IN_RIGHT:
return tr(
"-right hand-");
170 case IN_LEFT:
return tr(
"-left hand-");
187 lightRadius(UpdateLightRadiusInner())
virtual usage_types UseOnShredMove(Block *user)
void SendSignalAround(QString) const
virtual void UpdateLightRadius()
int DamageKind() const override
virtual bool Catchable() const
int UpdateLightRadiusInner() const
World provides global physics and shred connection.
virtual void Damage(int dmg, int dmg_kind)
virtual int DamageKind() const
void Move(dirs dir) override
QString FullName() const override
virtual int Weight() const
int Start() const override
bool GetExact(Block *, int to) override
Returns true if block found its place.
Block * DropAfterDamage(bool *delete_block) override
Should return dropped block.
virtual bool Get(Block *block, int start=0)
Returns true on success.
virtual Inventory * HasInventory()
int ShouldAct() const override
Block * ShowBlock(int slot) const
void SaveAttributes(QDataStream &out) const override
void RemShining(Active *)
Block * DropAfterDamage(bool *delete_block) override
Should return dropped block.
virtual int LightRadius() const
void Shine(int x, int y, int z, int level)
If init is false, light will not spread from non-invisible blocks.
void ReceiveSignal(QString) override
Receive text signal.
void SaveAttributes(QDataStream &out) const override
Block * GetBlock(int x, int y, int z) const
void ReceiveSignal(QString) override
virtual int DamageLevel() const
Block * ShowBlockInSlot(int slot, int index) const
Don't move block shown by this function.
virtual wearable Wearable() const
void Move(dirs direction) override
virtual bool GetExact(Block *block, int num)
Returns true if block found its place.
int LightRadius() const override
static Block * NewBlock(int kind, int sub)
Use this to receive a pointer to new not-normal block.
int NutritionalValue(subs) const override
virtual int Weight() const
void Pull(int num)
Removes block from inventory. Does not delete block.
Provides block ability to contain other blocks inside.
void Damage(int dmg, int dmg_kind) override
Shred * GetShred(int i, int j) const
bool Access() const override
int GetDurability() const
int Weight() const override
void Damage(int dmg, int dmg_kind) override
bool Inscribe(QString str) override
Returns true on success.
void AddShining(Active *)
QString InvFullName(int slot_number) const override
Block without special physics and attributes.
Inventory * HasInventory() override
virtual QString InvFullName(int num) const
virtual void SaveAttributes(QDataStream &out) const
void UpdateLightRadius() override
int DamageLevel() const override
virtual bool Inscribe(QString str)
Returns true on success.
const int MIN_DWARF_LIGHT_RADIUS