Reference › Function reference › Conditions

Conditions.player_state.statePhrase

dependency

Call as

Conditions.player_state.statePhrase(state)

Record the dependency Conditions.player_state.statePhrase, then call it by that name. A namespaced call does not pass self: use a colon call or pass the object yourself.

What it does

The readable sentence for one Player State, such as "you are mounted", worded so a Not flips it to "you are not mounted".

Arguments

NameTypeWhat it does
statestring | nilThe saved state.

Returns

1string | nilThe localized sentence template, or nil for an unknown state.

Editions

Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.

It reads no game API directly.

How the addon calls it

  • Player State (print)
    return statePhrase(value.state) or string.format(L["you {{!are|are not}} %s"], L["<state>"])

Source

Conditions/player_state.lua, line 50. Read only in game; Duplicate makes an editable copy.

Conditions.player_state.statePhrase(state)
    if state == "mounted" then return L["you {{!are|are not}} mounted"]
    elseif state == "swimming" then return L["you {{!are|are not}} swimming"]
    elseif state == "flying" then return L["you {{!are|are not}} flying"]
    elseif state == "falling" then return L["you {{!are|are not}} falling"]
    elseif state == "resting" then return L["you {{!are|are not}} in a rested area"]
    elseif state == "dead" then return L["you {{!are|are not}} dead"]
    elseif state == "ghost" then return L["you {{!are|are not}} a ghost"] end

Back to Function reference