Référence › Référence des fonctions › Platform

Platform.mobinfo2.hitCount

dépendance

Appel

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

Enregistrez la dépendance Platform.mobinfo2.hitCount, puis appelez-la sous ce nom. Un appel par espace de noms ne transmet pas self : utilisez un appel avec deux-points ou passez l'objet vous-même.

Ce qu'elle fait

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).

Arguments

NomTypeCe qu'elle fait
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".

Retours

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

Éditions

Les fonctions utilitaires intégrées sont enregistrées sur toutes les éditions. Ce qui diffère, c'est l'API du jeu qu'elles lisent ; quand l'une manque, la fonction utilitaire se rabat sur une alternative ou renvoie nil avec une raison.

Elle ne lit directement aucune API du jeu.

Comment l'addon l'appelle

Dépendances

Source

Platform/mobinfo2.lua, ligne 62. En lecture seule dans le jeu ; Dupliquer crée une copie modifiable.

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

Retour à Référence des fonctions