QtCraft API C++ classes QML types Handbook

QcBlastDefinition Struct

How a block takes part in explosions (decision E-600). More...

Header: #include <common/content/blockbehaviour/QcBlastDefinition.h>

Public Functions

double effectiveResistance(double hardness, bool liquid) const
bool isExplosive() const

Public Variables

int chainFuseMax
int chainFuseMin
bool fire
int fuseTicks
double power
double resistance

Static Public Members

const double liquidResistance
const int maxFuseTicks
const double maxPower
const double unbreakable

Detailed Description

Server side only.

Member Function Documentation

double QcBlastDefinition::effectiveResistance(double hardness, bool liquid) const

Returns the resistance that counts for a block of hardness (seconds by hand, negative: unbreakable) that is a liquid if liquid is true: the explicit one, else unbreakable blocks never break (a liquid soaks up as much as the reference game's water, 100) and the others resist as much as their hardness.

bool QcBlastDefinition::isExplosive() const

Returns whether the block explodes (it has a power).

Member Variable Documentation

const double QcBlastDefinition::liquidResistance

Resistance of an unbreakable liquid without an explicit one (the reference game's water).

const int QcBlastDefinition::maxFuseTicks

Longest fuse in ticks (fuseTicks, chainFuseMin, chainFuseMax).

const double QcBlastDefinition::maxPower

The strongest explosion a block may set off; the radius of its blast is about 1.3 times that.

double QcBlastDefinition::resistance

"blastResistance": how much of an explosion's force the block soaks up per step of a ray before it breaks, in the units of the reference game (stone 6, dirt 0.5, obsidian 1200). Negative: derived from the block (effectiveResistance).

const double QcBlastDefinition::unbreakable

Resistance of blocks that never break in an explosion (unbreakable ones, decision E-600).