QtCraft API C++ classes QML types Handbook

QcInkClouds Class

The clouds of ink that struck squids leave in the water (decision E-974): a creature whose kind has an ink texture (QcMobDefinition::ink) and whose move says a blow struck it (QcMsg::EntityMove::struck: an attack, a projectile, an explosion; not burning, drowning or suffocation) leaves a few dark puffs around the middle of its body as drawn that drift apart, swell and shrink again within about two seconds, drawn as small cubes like the smoke of explosions. More...

Header: #include <clientcore/session/QcInkClouds.h>

Public Types

struct Puff

Public Functions

void add(const QcVec3 &centre, const QString &texture, quint32 id, quint64 tick)
void addStruck(const QcMsg::EntityMoves &moves, const QHash<quint32, QcClientEntity> &entities, const QcContentRegistry &content, quint64 tick)
void prune(quint64 tick)
const QList<QcInkClouds::Puff> &puffs() const

Static Public Members

std::optional<QcEffectPuff> lookAt(const QcInkClouds::Puff &puff, double ticks)
const int maxLifeTicks
const qsizetype maxPuffs
const int minLifeTicks
const int puffsPerCloud

Detailed Description

Only a client effect: the server sends nothing for it, the clouds hide nothing and are not saved. The directions come from the creature's id and the tick, so the same hit looks the same; the number of puffs in all is bounded.

Member Function Documentation

void QcInkClouds::add(const QcVec3 &centre, const QString &texture, quint32 id, quint64 tick)

Adds a cloud of texture around centre for the creature id at client tick.

void QcInkClouds::addStruck(const QcMsg::EntityMoves &moves, const QHash<quint32, QcClientEntity> &entities, const QcContentRegistry &content, quint64 tick)

Adds a cloud for every struck creature of moves whose kind (of entities, kinds from content) leaves ink, around where it is drawn, at client tick.

[static] std::optional<QcEffectPuff> QcInkClouds::lookAt(const QcInkClouds::Puff &puff, double ticks)

Returns how puff looks at ticks (client ticks with the frame's fraction); nothing when it is over or not yet there.

void QcInkClouds::prune(quint64 tick)

Forgets the puffs that are over at tick.

const QList<QcInkClouds::Puff> &QcInkClouds::puffs() const

Returns the puffs not yet pruned.

Member Variable Documentation

const qsizetype QcInkClouds::maxPuffs

Most puffs at a time; a cloud that would exceed it adds none.

const int QcInkClouds::puffsPerCloud

Puffs of one cloud.