QtCraft API C++ classes QML types Handbook

QcTameDefinition Struct

A creature that players tame (wolves, cats; decision E-480), from its data (tameable): each of its taming items used on it tames it with chance (a tame one belongs to that player's identity, follows, sits when its owner uses it and fights for its owner with defends); a wolf becomes a dog. More...

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

Public Functions

std::optional<quint32> collarColor(const QString &name) const
bool hasCollar() const

Public Variables

QString becomes
std::optional<QcCreatureKindId> becomesType
double chance
QList<quint32> collarColors
QString collarDefault
QStringList collarDyes
bool defends
double followDistance
double healAmount
QStringList healItems
QStringList items
double stopDistance
double teleportDistance

Static Public Members

const int maxCollarDyes

Detailed Description

Server side only, except that the client knows a kind is tameable at all (it sends every use of one to the server).

Member Function Documentation

std::optional<quint32> QcTameDefinition::collarColor(const QString &name) const

Returns the colour of the dye name, if the collar takes it.

bool QcTameDefinition::hasCollar() const

Returns whether it wears a collar (it has collar dyes).

Member Variable Documentation

QString QcTameDefinition::becomes

The kind it turns into when tamed (a wolf into a dog); empty: it stays its kind.

std::optional<QcCreatureKindId> QcTameDefinition::becomesType

The kind becomes names among the content's mobs, resolved when the content is finished; none when it stays its kind.

double QcTameDefinition::chance

Chance that one item tames it.

bool QcTameDefinition::defends

It attacks what hurts its owner and what its owner strikes (never its owner, never another pet of the same owner).

QStringList QcTameDefinition::items

Names of the items that tame it; empty for a kind that is only ever tame (the dog).

const int QcTameDefinition::maxCollarDyes

Most dyes a collar may take (collarDyes).