Files
Bubberstation/code/modules/lost_crew/damages/projectile.dm
SmArtKar a2d463cdd8 Guncode Agony 4.4: Armor as an argument (#88143)
## About The Pull Request
Lil cleanup/tweak I couldn't do in the main PR because it conflicted
before and i forgot after. Yes this works with overrides that don't have
the arg, yes I tested it.

## Why It's Good For The Game
Don't run armor code thrice please thank you

## Changelog
🆑
code: Projectile impacts no longer fetch mobs' armor values thrice
/🆑
2024-11-25 03:59:21 -08:00

26 lines
879 B
Plaintext

/// Simulates being shot by a projectile
/datum/corpse_damage/cause_of_death/projectile
/// The projectile to simulate shooting
var/obj/projectile/projectile
/// The minimal projectile hits
var/min_hits = 6
/// The maximum projectile hits
var/max_hits = 12
/datum/corpse_damage/cause_of_death/projectile/apply_to_body(mob/living/carbon/human/body, severity, list/storage)
projectile = new projectile()
var/hits = ((max_hits - min_hits) * severity + min_hits)
for(var/i in 1 to hits)
body.projectile_hit(projectile, def_zone = pick(GLOB.all_body_zones), piercing_hit = TRUE)
/datum/corpse_damage/cause_of_death/projectile/laser
projectile = /obj/projectile/beam/laser
cause_of_death = "when I got shot with lasers!"
/datum/corpse_damage/cause_of_death/projectile/bullet
projectile = /obj/projectile/bullet/c45
cause_of_death = "when I got shot with bullets!"