Aufruf als
Platform.mobinfo2.hitCount(self, resists, school)
Erfassen Sie die Abhängigkeit Platform.mobinfo2.hitCount und rufen Sie sie dann unter diesem Namen auf. Ein Aufruf über den Namensraum übergibt kein self: Verwenden Sie einen Doppelpunkt-Aufruf oder übergeben Sie das Objekt selbst.
Was sie bewirkt
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).
Argumente
| Name | Typ | Was sie bewirkt |
|---|---|---|
self | RMPlatform | Rotation Master platform adapter (normally addon.Platform), used for its CanReadValue check. |
resists | table | The resists table from a MobInfo2 mob record. |
school | string | School key used in the resists table; the field read is school.."Hits". |
Rückgabewerte
| 1 | number | nil | Recorded hit count, 1 when none is recorded, or nil when unavailable. |
|---|---|---|
| 2 | string | nil | Reason when the count is nil. |
Editionen
Integrierte Hilfsfunktionen werden auf jeder Edition registriert. Unterschiedlich ist die Spiel-API, die sie lesen; fehlt eine, weicht die Hilfsfunktion aus oder gibt nil mit einem Grund zurück.
Sie liest keine Spiel-API direkt.
Wie das Addon sie aufruft
Platform.mobinfo2.GetMobInfo2Observationlocal hits,hitsReason=hitCount(self,resists,school)
Abhängigkeiten
finite→Platform.mobinfo2.finitereadField→Platform.mobinfo2.readField
Quelle
Platform/mobinfo2.lua, Zeile 62. Im Spiel schreibgeschützt; Duplizieren erstellt eine bearbeitbare Kopie.
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