Ports the radiation subsystem and cleans up damage flags. (#15715)

This commit is contained in:
Matt Atlas
2023-02-07 13:22:47 +01:00
committed by GitHub
parent 5527fc0810
commit 31c73ead85
198 changed files with 981 additions and 649 deletions
+6 -6
View File
@@ -28,8 +28,8 @@
//Effects
var/damage = 10
var/damage_type = BRUTE //BRUTE, BURN, TOX, OXY, CLONE, PAIN are the only things that should be in here
var/damage_flags = DAM_BULLET
var/damage_type = DAMAGE_BRUTE //DAMAGE_BRUTE, DAMAGE_BURN, DAMAGE_TOXIN, DAMAGE_OXY, DAMAGE_CLONE, DAMAGE_PAIN are the only things that should be in here
var/damage_flags = DAMAGE_FLAG_BULLET
var/nodamage = FALSE //Determines if the projectile will skip any damage inflictions
var/check_armor = "bullet" //Defines what armor to use when it hits things. Must be set to bullet, laser, energy,or bomb //Cael - bio and rad are also valid
var/list/impact_sounds //for different categories, IMPACT_MEAT etc
@@ -114,7 +114,7 @@
if(isanimal(target))
return FALSE
var/mob/living/L = target
if(damage_type == BRUTE && damage > 5) //weak hits shouldn't make you gush blood
if(damage_type == DAMAGE_BRUTE && damage > 5) //weak hits shouldn't make you gush blood
var/splatter_color = "#A10808"
var/mob/living/carbon/human/H = target
if (istype(H) && H.species && H.species.blood_color)
@@ -126,7 +126,7 @@
L.apply_effects(0, weaken, paralyze, 0, stutter, eyeblur, drowsy, 0, incinerate, blocked)
L.stun_effect_act(stun, agony, def_zone, src, damage_flags)
L.apply_damage(irradiate, IRRADIATE, damage_flags = DAM_DISPERSED) //radiation protection is handled separately from other armor types.
L.apply_damage(irradiate, DAMAGE_RADIATION, damage_flags = DAMAGE_FLAG_DISPERSED) //radiation protection is handled separately from other armor types.
return 1
//called when the projectile stops flying because it collided with something
@@ -136,7 +136,7 @@
//Checks if the projectile is eligible for embedding. Not that it necessarily will.
/obj/item/projectile/proc/can_embed()
//embed must be enabled and damage type must be brute
if(!embed || damage_type != BRUTE)
if(!embed || damage_type != DAMAGE_BRUTE)
return FALSE
return TRUE
@@ -151,7 +151,7 @@
return SP
/obj/item/projectile/proc/get_structure_damage()
if(damage_type == BRUTE || damage_type == BURN)
if(damage_type == DAMAGE_BRUTE || damage_type == DAMAGE_BURN)
return damage * anti_materiel_potential
return FALSE