Refactors projectile ricochets (#25764)

* same taste, twice the speed

* pulls proc/handle_ricochet() to the atom level. adds var/flags_ricochet and related defines.

* space indentation sneaks its way in yet again

---------

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
chuga-git
2024-06-12 19:08:57 +00:00
committed by GitHub
co-authored by Luc
parent c46630b1ea
commit 438faac253
10 changed files with 86 additions and 37 deletions
+7 -1
View File
@@ -115,7 +115,7 @@
air = environment
if(isnull(air))
return
var/breath_percentage = BREATH_VOLUME / air.return_volume()
return air.remove(air.total_moles() * breath_percentage)
else
@@ -303,6 +303,12 @@
else
C.KnockDown(3 SECONDS)
/obj/handle_ricochet(obj/item/projectile/P)
. = ..()
if(. && receive_ricochet_damage_coeff)
// pass along receive_ricochet_damage_coeff damage to the structure for the ricochet
take_damage(P.damage * receive_ricochet_damage_coeff, P.damage_type, P.flag, 0, REVERSE_DIR(P.dir), P.armour_penetration_flat, P.armour_penetration_percentage)
/obj/proc/return_obj_air()
RETURN_TYPE(/datum/gas_mixture)
if(isobj(loc))