DOCS: expose apply_damage function

This commit is contained in:
marco_a 2024-04-09 22:20:06 +02:00
parent 9337f045e1
commit 1447dbfef2

View File

@ -112,6 +112,9 @@ Weapons communicate their state through players metadata:
* `weapons_lib.refill(p_name, weapon)`: instantly refills the magazine of `weapon` for `p_name`. If the weapon was reloading, it instantly completes the process
* `weapons_lib.deactivate_zoom(p_name)`: disables the zoom state of the player, if any
* `weapons_lib.reset_state(player)`: resets the weapon state of `player`, instantly completing any ongoing action
* `weapons_lib.apply_damage(hitter, targets, weapon, action)`: useful for `"custom"` actions to deal damage
* `targets` is a table of tables, one per target hit. Format of these single tables is `{object = ObjRef, hit_point = intersection_point}`. `hit_point` is optional
* `weapon` is the node representing the weapon
## Getters
* `weapons_lib.get_weapon_by_name(w_name)`: returns the table of the weapon `w_name`, if any