QtCraft API C++ classes QML types Handbook

QcBlastBodies Class

What a blast does to players and creatures (decision E-602), like the reference game: a body within twice the power of the centre takes an impact of (1 - distance / (2 × power)) × exposure, the share of points of its box that see the centre past solid blocks (QcExplosionRays::exposure). More...

Header: #include <server/explosions/QcBlastBodies.h>

Public Types

struct Hits

Public Functions

QcBlastBodies::Hits hurt(QcBlastField &field, const QcVec3 &centre, double power)

Static Public Members

const double blastKnockback
double damageOf(double impact, double power)
double impact(double distance, double power, double exposure)

Detailed Description

The damage is (impact² + impact) / 2 × 7 × 2 × power + 1, armour takes its part for players; the push away from the centre grows with the impact (blastKnockback blows' worth at impact 1). Creative players and the dead are left alone; a body behind a wall of stone takes nothing.

Member Function Documentation

[static] double QcBlastBodies::damageOf(double impact, double power)

Returns the damage of impact of a blast of power, before armour.

QcBlastBodies::Hits QcBlastBodies::hurt(QcBlastField &field, const QcVec3 &centre, double power)

Hurts and pushes the players and creatures around a blast of power at centre, their sight read from field. Returns the bodies hurt.

[static] double QcBlastBodies::impact(double distance, double power, double exposure)

Returns the impact on a body distance from the centre of a blast of power that sees it with exposure (0 beyond reach).

Member Variable Documentation

const double QcBlastBodies::blastKnockback

Blows' worth of push (QcMobManager::knockbackVelocity) at impact 1.