-
Notifications
You must be signed in to change notification settings - Fork 28
Damage System
tpan496 edited this page Apr 1, 2021
·
14 revisions
Horde has a built-in damage system that provides more depth to damage dealing in Gmod. Although you can use ScaleNPCDamage/EntityTakeDamage
, if you want a more consistent result I highly recommend using Horde damage hooks.
damage = (more1 * more2 * ...) * (1 + increase1 + increase2 + ...) * base_damage
"Horde_OnPlayerDamage", ply, npc, bonus, hitgroup, dmginfo.
"Horde_OnPlayerMinionDamage", ply, npc, bonus, hitgroup, dmginfo.
bonus = {increase=custom_increase, more=custom_more}
Evasion is first calculated and rolled. No damage is taken if evasion is successful.
damage taken = (less1 * less2 * ...) * (1 - (resistance1 + resistance2 + ...)) * base_damage_taken
"Horde_OnPlayerDamageTaken", ply, dmginfo, bonus
bonus = {resistance=custom_resistance, less=custom_less, evasion=custom_evasion}
See https://github.com/tpan496/Horde/tree/main/gamemode/perks