dao::GameModeExplore
class
Explore mode, which combat mode is built on.
It knows what is under the mouse cursor, and it handles the player’s targeting and move orders. Get it with GameModeController::Explore or CClientExoApp::CurrentExplore, and use it on the game thread, for example from a frame callback.
Fifteen times a second the mode works out what is under the cursor; this is the “pick”. The pick is empty while the mouse is over any Flash movie, including a plugin’s, because a movie under the cursor takes the click. A visual effect with a shape counts as an object, and is picked in place of the ground behind it (see SetPickable in dao/Vfx.h).
Declared in dao/GameModes.h.
Functions
CursorGround()
std::optional<Vector> CursorGround() const
Returns the point on the ground under the cursor.
Returns the point, or nullopt if the cursor is over an object, a movie or nothing
CursorGroundWalkable()
bool CursorGroundWalkable() const
Returns whether the controlled creature could walk to the ground point under the cursor.
A move click is refused on a point that is not walkable. Returns false when there is no ground point.
CursorHits()
std::span<const world::Hit> CursorHits() const
Returns everything the ray of the latest pick hit, nearest first.
The object or ground point under the cursor is chosen from these. The span is empty when the cursor is outside the view.
CursorObject()
std::optional<ObjectId> CursorObject() const
Returns the object a click would act on.
Returns the object’s id, or nullopt if the cursor is not over an object
GameModeExplore()
GameModeExplore()=delete
GameModeExplore()
GameModeExplore(const GameModeExplore &)=delete
LastMoveDestination()
Vector LastMoveDestination() const
Returns where the latest move click sent the controlled creature.
MoveTo()
void MoveTo(ObjectId creature, const Vector &point)
Sends a creature to a point, the same as a move click.
It records the point as the latest move’s destination and hands the creature the order. For the player’s other orders, see dao/Orders.h.
operator=()
GameModeExplore & operator=(const GameModeExplore &)=delete
RequestTarget()
void RequestTarget(std::int32_t ability, ObjectId caster)
Asks the player to pick a target for an ability.
It shows the targeting cursor, and uses the ability on whatever the player clicks. Call it on the game thread.
| Parameter | |
|---|---|
ability |
the ability’s id |
caster |
the creature that will use it |
SelectedTarget()
static std::optional<ObjectId> SelectedTarget()
Returns the selected target.
The cycle-target keys choose it, and a quickbar ability is used on it if the ability can target it (see PerformAbilityMessage in dao/Messages.h).
Returns the target’s id, or nullopt if no target is selected
SelectTarget()
void SelectTarget(ObjectId target)
Selects a target, the same as the cycle-target keys.
A PerformAbilityMessage sent next, for an ability that can target it, then uses the ability on it, as a quickbar click would. Not yet tested in the game. Call it on the game thread.
SetCursorObject()
void SetCursorObject(ObjectId object)
Sets the object a click acts on, as if the cursor were over it, ready for a PerformPrimaryActionOnTargetUnderCursorMessage.
The mode re-picks from the cursor 15 times a second, so set the object and send the message in the same frame callback. Every party member selected in the party bar carries out the action; if none is selected, nobody does.
Targeting()
static std::optional<Aim> Targeting()
Returns the ability the player is aiming while the targeting cursor is up.
That happens after a quickbar ability is pressed with no valid target, or after RequestTarget. Not yet tested in the game.
Returns the ability and its caster, or nullopt if no ability is being aimed
~GameModeExplore()
~GameModeExplore()=delete
Fields
| Field | Type | |
|---|---|---|
kCursorGround |
std::size_t = 0xD0 |
offset of the picked ground hit |
kCursorObject |
std::size_t = 0xCC |
offset of the picked object’s id |
kCursorWalkable |
std::size_t = 0xD4 |
whether the ground hit is walkable |
kHitCount |
std::size_t = 0x6E0 |
offset of the number of hits |
kHits |
std::size_t = 0xE0 |
offset of the ray’s hits |
kLastMoveDestination |
std::size_t = 0xA0 |
the latest move’s destination |
kMaxHits |
std::int32_t = 32 |
the most hits a pick keeps |
Aim
An ability the player is aiming, and the creature that will use it.
Fields
| Field | Type | |
|---|---|---|
ability |
std::int32_t = 0 |
the ability’s id |
caster |
ObjectId = kInvalidObject |
the creature that will use it |