Module:NoitaUtils/doc
This is the documentation page for Module:NoitaUtils
This module exists to support functionality of various templates used on the wiki.
Usage
Invoke functions from this module like so:
{{#invoke:NoitaUtils|functionName|argument}}
Functions
getEnemyGoldValue
Calculates the amount of gold an enemy will drop based on their in-game HP values.
Parameters
hp
- the numeric HP value of the enemy in-game.
Example
Enemy HP: 100; Gold: {{#invoke:NoitaUtils|getEnemyGoldValue|hp = 100}}
Enemy HP: 100; Gold: 40
getUIDamageValue
Calculates the UI value for damage from the internal damage numbers in the XML / lua.
Parameters
damage
- the internal numeric damage value from the lua/xml file.
Example
Internal Damage: 1.0; UI Damage: {{#invoke:NoitaUtils|getUIDamageValue|damage = 1.0}}
Internal Damage: 1.0; UI Damage: 25
getUIHealthValue
Calculates the UI value for HP from the internal HP values in the XML / lua.
Parameters
hp
- the internal numeric hp value from the lua/xml file.
Example
Internal HP: 1.7; UI HP: {{#invoke:NoitaUtils|getUIHealthValue|hp = 1.7}}
Internal HP: 1.7; UI HP: 42.5
getTimeValue
Calculates the time value in seconds from an input value in frames.
Parameters
frames
- the internal numeric frames value from the lua/xml file.
Example
Time in frames: 1600; Time in seconds: {{#invoke:NoitaUtils|getTimeValue|frames = 1600}}
Time in frames: 1600; Time in seconds: 26.667
getFramesInDuration
Calculates the number of frames in a period of time given an input value in seconds.
Parameters
duration
- a period of time in seconds.
Example
There are {{#invoke:NoitaUtils|getFramesInDuration|duration = 1.32}} frames in a period of 1.32s.
There are 79.2 frames in a period of 1.32s.
getRealExplosionDamage
Calculates the 'true' in game UI damage from a given explosion damage UI number value.
Parameters
damage
- the explosion damage shown in the spell tooltip.
Example
Stated spell explosion damage: 400; Real spell explosion damage: {{#invoke:NoitaUtils|getRealExplosionDamage|damage = 400}}
Stated spell explosion damage: 400; Real spell explosion damage: 100
Example
Stated spell explosion damage: 40 (x3); Real spell explosion damage: {{#invoke:NoitaUtils|getRealExplosionDamage|damage = 40 (x3)}}
Stated spell explosion damage: 40 (x3); Real spell explosion damage: 10 (x3)