Riferimento › Riferimento delle funzioni › Conditions

Conditions.player_state.statePhrase

dipendenza

Chiamala come

Conditions.player_state.statePhrase(state)

Registra la dipendenza Conditions.player_state.statePhrase, poi chiamala con quel nome. Una chiamata con spazio dei nomi non passa self: usa una chiamata con i due punti o passa tu l'oggetto.

Cosa fa

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

Argomenti

NomeTipoCosa fa
statestring | nilThe saved state.

Valori restituiti

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

Edizioni

Le funzioni di supporto integrate sono registrate su ogni edizione. Ciò che cambia è l'API di gioco che leggono; dove ne manca una, la funzione di supporto ripiega su un'alternativa o restituisce nil con un motivo.

Non legge direttamente alcuna API di gioco.

Come la chiama l'addon

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

Sorgente

Conditions/player_state.lua, riga 50. Nel gioco è in sola lettura; Duplica crea una copia modificabile.

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

Torna a Riferimento delle funzioni