mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-13 08:03:43 +01:00
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:
@@ -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))
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
pressure_resistance = 8
|
||||
max_integrity = 300
|
||||
face_while_pulling = TRUE
|
||||
flags_ricochet = RICOCHET_HARD
|
||||
receive_ricochet_chance_mod = 0.6
|
||||
var/climbable
|
||||
/// Determines if a structure adds the TRAIT_TURF_COVERED to its turf.
|
||||
var/creates_cover = FALSE
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
anchored = TRUE
|
||||
flags = ON_BORDER
|
||||
flags_2 = RAD_PROTECT_CONTENTS_2
|
||||
flags_ricochet = RICOCHET_HARD
|
||||
receive_ricochet_chance_mod = 0.5
|
||||
can_be_unanchored = TRUE
|
||||
max_integrity = 25
|
||||
resistance_flags = ACID_PROOF
|
||||
|
||||
Reference in New Issue
Block a user