Projectile refactoring madness (#19878)

Refactored the projectile code, mostly in line with TG's now.
Refactored various procs that are used or depends on it.
Projectiles can now ricochet if enabled to.
Damage falloffs with distance.
Homing projectiles can now have accuracy falloff with distance.
Projectiles have a maximum range.
Muzzle flash is configurable per projectile.
Impact effect of the projectile is configurable per projectile.
Accuracy decreases with distance.
Projectiles work with signals and emits them, for easy hooking up from
other parts of the code.
Meatshielding is now less effective .
Impact sound is now configurable per projectile.

High risk.
This commit is contained in:
Fluffy
2024-09-23 12:12:57 +02:00
committed by GitHub
parent 914f69dcc8
commit c24b4c7097
203 changed files with 2925 additions and 1590 deletions
@@ -52,11 +52,15 @@
// "Stun" weapons can cause minor damage to components (short-circuits?)
// "Burn" damage is equally strong against internal components and exterior casing
// "Brute" damage mostly damages the casing.
/obj/item/modular_computer/bullet_act(var/obj/projectile/Proj)
switch(Proj.damage_type)
/obj/item/modular_computer/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit)
. = ..()
if(. != BULLET_ACT_HIT)
return .
switch(hitting_projectile.damage_type)
if(DAMAGE_BRUTE)
take_damage(Proj.damage, Proj.damage / 2)
take_damage(hitting_projectile.damage, hitting_projectile.damage / 2)
if(DAMAGE_PAIN)
take_damage(Proj.damage, Proj.damage / 3, 0)
take_damage(hitting_projectile.damage, hitting_projectile.damage / 3, 0)
if(DAMAGE_BURN)
take_damage(Proj.damage, Proj.damage / 1.5)
take_damage(hitting_projectile.damage, hitting_projectile.damage / 1.5)
@@ -1,4 +1,6 @@
/obj/item/modular_computer/console/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(mover?.movement_type & PHASING)
return TRUE
if(istype(mover,/obj/projectile))
if(prob(80))
//Holoscreens are non solid, and the frames of the computers are thin. So projectiles will usually