QtCraft API C++ classes QML types Handbook

QcFamilyDefinition Struct

A parent that splits off children and takes them with it (the Kjut, decision E-839), from its data (family): every fresh hurt it survives that takes health splits off childrenPerHit creatures of kind child while fewer than maxChildren of its children live and it has split fewer than maxSplits children in its life; when it dies, every child of it vanishes with popSound and leaves popDrops (like the children of a QObject on deleteLater), without an explosion. More...

Header: #include <common/content/mobs/QcMobTraits.h>

Public Variables

std::optional<QcCreatureKindId> childType
int childrenPerHit
int maxChildren
int maxSplits
double orbitRadius
double orbitSeconds
QList<QcItemDrop> popDrops
QString popSound
double tetherRange
QString tetherTexture

Static Public Members

const int maxChildrenLimit

Detailed Description

A child killed on its own leaves only its kind's drops. Children without a target of their own orbit the parent (orbitRadius, orbitSeconds). The client draws a thread of tetherTexture from each child to the nearest parent of the kind within tetherRange metres; the rest of the family is server side only.

Member Variable Documentation

std::optional<QcCreatureKindId> QcFamilyDefinition::childType

The kind child names among the creatures, resolved when the content is finished (QcMobTraitsContent::resolve); none before.

int QcFamilyDefinition::childrenPerHit

Children split off by one hurt.

int QcFamilyDefinition::maxChildren

Most of its children alive at once.

const int QcFamilyDefinition::maxChildrenLimit

Highest maxChildren and childrenPerHit the data may set.

int QcFamilyDefinition::maxSplits

Children a parent splits off in its whole life (not saved); the data's 0 or a missing field means twice maxChildren (QcMobReader).

QList<QcItemDrop> QcFamilyDefinition::popDrops

What each child leaves when it vanishes with its parent.

QString QcFamilyDefinition::popSound

Played where a child vanishes with its parent; empty for none.

double QcFamilyDefinition::tetherRange

Metres within which the client looks for the nearest parent to draw the thread to.

QString QcFamilyDefinition::tetherTexture

The thread the client draws between parent and child; empty texture for none.