Referencia › Referencia de funciones › Platform

Platform.mobinfo2.hitCount

dependencia

Llamar como

Platform.mobinfo2.hitCount(self, resists, school)

Registra la dependencia Platform.mobinfo2.hitCount 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

Reads the hit count for a spell school from a MobInfo2 resists table (the field named school.."Hits"). A missing (nil or false) count defaults to 1; otherwise it returns a readable finite number, or nil with a reason from readField or finite (restricted-value, invalid-mobinfo2-data, mobinfo2-data-error, invalid-mobinfo2-number).

Argumentos

NombreTipoQué hace
selfRMPlatformRotation Master platform adapter (normally addon.Platform), used for its CanReadValue check.
resiststableThe resists table from a MobInfo2 mob record.
schoolstringSchool key used in the resists table; the field read is school.."Hits".

Retornos

1number | nilRecorded hit count, 1 when none is recorded, or nil when unavailable.
2string | nilReason when the count is nil.

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

Dependencias

Código fuente

Platform/mobinfo2.lua, línea 62. Solo lectura en el juego; Duplicar crea una copia editable.

Platform.mobinfo2.hitCount(self, resists, school)
    local hits,reason=readField(self,resists,school..'Hits')
    if reason then return nil,reason end
    if hits==nil or hits==false then return 1 end
    local valid,why=finite(self,hits)
    if not valid then return nil,why end
    return hits

Volver a Referencia de funciones