Referencia › Referencia de funciones › Conditions

Conditions.player_state.statePhrase

dependencia

Llamar como

Conditions.player_state.statePhrase(state)

Registra la dependencia Conditions.player_state.statePhrase y luego llámala con ese nombre. Una llamada con espacio de nombres no pasa self: usa una llamada con dos puntos o pasa tú mismo el objeto.

Qué hace

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

Argumentos

NombreTipoQué hace
statestring | nilThe saved state.

Retornos

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

Ediciones

Las funciones auxiliares integradas se registran en todas las ediciones. Lo que cambia es la API del juego que leen; donde falta alguna, la función auxiliar recurre a una alternativa o devuelve nil con un motivo.

No lee directamente ninguna API del juego.

Cómo la llama el addon

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

Código fuente

Conditions/player_state.lua, línea 50. Solo lectura en el juego; Duplicar crea una copia editable.

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

Volver a Referencia de funciones