Po Lu 4b96fd9b4b Record floating-point damage
* mods/CORE/mcl_damage/init.lua (damage_player, heal_player)
(get_hp): New functions.
(register_on_hpchange): Do not apply modifiers to damage
inflicted by damage_player and heal_player.  Otherwise, first
apply the difference to internal damage and compute the engine
hp difference from thence.
(register_on_punchplayer): Inflict punch damage by means of
damage_player.
(register_on_joinplayer): Synchronize player engine health with
internal health counter if nonexistent.
(register_on_dieplayer): Reset internal health counter.

* mods/CORE/mcl_util/init.lua (deal_damage): If dealing damage
to player, invoke mcl_damage.damage_player.
(get_hp): Return fractional health gauge if player.

* mods/ITEMS/mcl_totems/init.lua (register_modifier):

* mods/HUD/mcl_death_messages/init.lua (register_on_damage):
Derive whether damage is lethal from the fractional health gauge
rather than `obj:get_hp'.

* mods/ITEMS/mcl_armor/damage.lua (register_modifier): Do not
compute ceiling of modified damage; return the floating point
value as-is.

* mods/ITEMS/mcl_potions/functions.lua (healing_func)
(register_globalstep): Use heal_player rather than set_hp.

* mods/ITEMS/mcl_throwing/register.lua (pearl_tp):

* mods/MISC/mcl_commands/kill.lua (damage_player):

* mods/PLAYER/mcl_hunger/hunger.lua:

* mods/PLAYER/mcl_hunger/init.lua: As above.
2024-08-31 12:27:17 +00:00
..
2024-05-22 00:05:34 +02:00
2024-08-31 12:27:17 +00:00
2024-08-17 19:15:07 +02:00
2024-08-17 19:15:07 +02:00