new Resistance()
- Source:
Methods
AddAttacker(attacker) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
attacker |
number | The entity ID of the attacker to add. |
- Source:
Returns:
- Whether the attacker was added sucessfully.
- Type
- boolean
BuildResistanceSchema() → {string}
Builds a RelaxRNG schema of possible attack effects.
- Source:
Returns:
- RelaxNG schema string.
- Type
- string
GetEffectiveResistanceAgainst(effectType) → {Object}
Calculate the effective resistance of an entity to a particular effect.
ToDo: Support resistance against status effects.
Parameters:
Name | Type | Description |
---|---|---|
effectType |
string | The type of attack effect the resistance has to be calculated for (e.g. "Damage", "Capture"). |
- Source:
Returns:
- An object of the type { "Damage": { "Crush": number, "Hack": number }, "Capture": number }.
- Type
- Object
GetFullResistance() → {Object}
Get all separate resistances for showing in the GUI.
- Source:
Returns:
- All resistances ordered by type.
- Type
- Object
GetResistanceOfForm(entityForm) → {Object}
Get the resistance of a particular type, i.e. Foundation or Entity.
Parameters:
Name | Type | Description |
---|---|---|
entityForm |
string | The form of the entity to query. |
- Source:
Returns:
- An object containing the resistances.
- Type
- Object
RemoveAttacker(attacker) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
attacker |
number | The entity ID of the attacker to remove. |
- Source:
Returns:
- Whether the attacker was attacking us previously.
- Type
- boolean