QtCraft API C++ classes QML types Handbook

QcGuardianBrain Class

The brain of guardians (QcMobDefinition::Ai::Guardian, decision E-594; the sand golem): a mix of the reference's iron golem and its guardians. More...

Header: #include <server/guardians/QcGuardianBrain.h>
Inherits: QcHostileBrain

Reimplemented Public Functions

virtual QcPhysics::Steering think(QcCreature &mob, const QcMobDefinition &definition, const QcMobBrain::Context &context, int thinkTicks) override

Static Public Members

const double homeSlack

Detailed Description

It keeps to the zone it guards (QcCreature::guards) and attacks only players who come close to it: the nearest player it sees within its sight range and within the kind's guardLeash of the zone, chased along a path and struck in melee. A player who leaves the leash is let go; without a target it strolls inside the zone and walks back into it when it stands outside. A guardian without a zone (summoned) is an ordinary hostile creature.

Member Function Documentation

[override virtual] QcPhysics::Steering QcGuardianBrain::think(QcCreature &mob, const QcMobDefinition &definition, const QcMobBrain::Context &context, int thinkTicks)

Reimplements: QcPassiveBrain::think(QcCreature &mob, const QcMobDefinition &definition, const QcMobBrain::Context &context, int thinkTicks).

Member Variable Documentation

const double QcGuardianBrain::homeSlack

A guardian more than this many blocks outside its zone walks back into it.