QcMobTeleport Namespace
How creatures teleport (QcMobDefinition::teleport, decision E-460): to a random safe place (QcSafeSpot::randomAround) within the kind's range around them or around a point (an angry one next to its target), at most once per cooldown, never when confined or without a mind (decision E-510). More...
| Header: | #include <server/mobbrains/QcMobTeleport.h> |
Variables
| const double | towardsRange |
Functions
| void | land(QcCreature &mob, const QcVec3 &target) |
| bool | teleport(QcCreature &mob, const QcMobDefinition &definition, const QcBlockAccess &world, QRandomGenerator &random, const std::optional<QcVec3> &around = std::nullopt) |
Detailed Description
The creature lands there at rest with no path; QcCreature::teleportedFrom tells the server to announce it.
Variable Documentation
const double QcMobTeleport::towardsRange
How close to a target an angry creature teleports (metres around the target).
Function Documentation
void QcMobTeleport::land(QcCreature &mob, const QcVec3 &target)
Puts mob at target at rest without a path, to be announced as a teleport (QcCreature:: teleportedFrom), whatever its kind (also a pet next to its owner, decision E-480).
bool QcMobTeleport::teleport(QcCreature &mob, const QcMobDefinition &definition, const QcBlockAccess &world, QRandomGenerator &random, const std::optional<QcVec3> &around = std::nullopt)
Teleports mob of the kind definition near around (its own place when none) in world, the place drawn from random; returns false when its kind does not teleport, it is confined or without a mind, still cooling down or finds no safe place.