Как вызывать
Conditions.player_state.statePhrase(state)
Запишите зависимость Conditions.player_state.statePhrase и вызывайте её по этому имени. Вызов через пространство имён не передаёт self: используйте вызов через двоеточие или передайте объект сами.
Что делает
The readable sentence for one Player State, such as "you are mounted", worded so a Not flips it to "you are not mounted".
Аргументы
| Имя | Тип | Что делает |
|---|---|---|
state | string | nil | The saved state. |
Возвращает
| 1 | string | nil | The localized sentence template, or nil for an unknown state. |
|---|
Издания
Встроенные помощники регистрируются во всех изданиях. Различается игровой API, который они читают; если нужного API нет, помощник использует запасной вариант или возвращает nil с причиной.
Не читает игровой API напрямую.
Как его вызывает аддон
- Состояние игрока (print)
return statePhrase(value.state) or string.format(L["you {{!are|are not}} %s"], L["<state>"])
Исходный код
Conditions/player_state.lua, строка 50. В игре только для чтения; «Дублировать» создаёт редактируемую копию.
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