37 QObject::tr(
"nullstone"),
40 QObject::tr(
"diamond"),
42 QObject::tr(
"meat of rational"),
46 QObject::tr(
"different"),
49 QObject::tr(
"greenery"),
51 QObject::tr(
"hazelnut"),
59 QObject::tr(
"adamantine"),
62 QObject::tr(
"explosive"),
66 QObject::tr(
"plastic"),
71 "invalid number of strings in sub_names");
79 result.replace(0, 1, result.at(0).toUpper());
91 case WATER:
return QObject::tr(
"Ice");
92 case SAND:
return QObject::tr(
"Sandstone");
93 case CLAY:
return QObject::tr(
"Clay brick");
94 case ACID:
return QObject::tr(
"Acid concentrate");
102 if (
UNDEF == transp ) {
133 switch ( dmg_kind ) {
163 case STONE:
switch ( dmg_kind ) {
170 case H_MEAT:
switch ( dmg_kind ) {
195 *delete_block =
false;
217 if (
Sub() ==
AIR )
return false;
253 case WOOD:
return WEIGHT_WATER-1;
260 case H_MEAT:
return WEIGHT_WATER+10;
316 <<= 1 ) |= (
noteId != 0) );
317 if ( Q_UNLIKELY(
noteId != 0) ) {
325 out << quint8( 0x80 |
sub );
333 transparent(Transparency(transp, sub_)),
344 transparent(Transparency(transp, sub_)),
351 if ( Q_UNLIKELY(durability & 1) ) {
virtual usage_types UseOnShredMove(Block *user)
const int MAX_DURABILITY
10 bits to store durability in file, signed.
virtual QString FullName() const
virtual void SaveAttributes(QDataStream &) const
quint16 noteId
To convert DAMAGE_PUSH_UP...WEST to corresponding direction.
void Mend(int plus)
Increase durability, no more than MAX_DURABILITY.
void SaveNormalToFile(QDataStream &out) const
int Transparency(int transp, int sub) const
virtual bool Catchable() const
BlockManager block_manager
static QString SubName(int sub)
Returns translated substance name.
static QString SubNameUpper(int sub)
Returns translated substance name with first upper letter.
void RestoreDurabilityAfterSave()
Importart! Use it if block won't be deleted after SaveToFile.
virtual void Damage(int dmg, int dmg_kind)
virtual int DamageKind() const
Block * Normal(int sub) const
Use this to receive a pointer to normal block.
virtual int Weight() const
virtual push_reaction PushResult(dirs) const
virtual bool Get(Block *block, int start=0)
Returns true on success.
int SetNote(QString note)
static sub_groups GetSubGroup(int sub)
void Restore()
Set maximum durability.
virtual Inventory * HasInventory()
bool operator==(const Block &) const
QString GetNote(int note_id) const
weights in measures - mz (mezuro)
virtual int LightRadius() const
static dirs MakeDirFromDamage(int damage_kind)
bool operator!=(const Block &) const
virtual int DamageLevel() const
Provides declaration for class Inventory for freg.
virtual Falling * ShouldFall()
static const QString sub_names[]
virtual Animal * IsAnimal()
static QString DirString(dirs)
virtual wearable Wearable() const
virtual usage_types Use(Block *user)
static Block * NewBlock(int kind, int sub)
Use this to receive a pointer to new not-normal block.
Block(int sub, int kind, int transp=UNDEF)
virtual Block * DropAfterDamage(bool *delete_self)
Should return dropped block.
int GetId() const
Determines kind and sub, unique for every kind-sub pair.
virtual Active * ActiveBlock()
Provides block ability to contain other blocks inside.
static const QString dir_strings[]
int GetDurability() const
const int MAX_NOTE_LENGTH
void Break()
Set durability to null.
void SaveToFile(QDataStream &out)
virtual void Move(dirs direction)
virtual void ReceiveSignal(QString)
Receive text signal.
int ChangeNote(QString note, int note_id)
Block without special physics and attributes.
Provides definition for class Block.
static constexpr int MakeId(const int kind, const int sub)
virtual bool Inscribe(QString str)
Returns true on success.