Skip to content

Commit

Permalink
Replacing decl paths for damage handlers with old single-word defines.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Jan 13, 2024
1 parent d6ec370 commit 26df13a
Show file tree
Hide file tree
Showing 343 changed files with 1,162 additions and 1,114 deletions.
9 changes: 9 additions & 0 deletions code/__defines/damage.dm
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
///The decimal precision for health values. Health will be rounded against this value.
#define HEALTH_ROUNDING 0.01

#define BRUTE /decl/damage_handler/brute
#define BURN /decl/damage_handler/burn
#define TOX /decl/damage_handler/organ
#define CLONE /decl/damage_handler/genetic
#define ELECTROCUTE /decl/damage_handler/electrocute
#define PAIN /decl/damage_handler/pain
#define OXY /decl/damage_handler/suffocation
#define IRRADIATE /decl/damage_handler/radiation
12 changes: 6 additions & 6 deletions code/_helpers/medical_scans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
scan["blood_volume"] = H.vessel.total_volume
scan["blood_volume_max"] = H.vessel.maximum_volume
scan["temperature"] = H.bodytemperature
scan["trauma"] = H.get_damage(/decl/damage_handler/brute)
scan["burn"] = H.get_damage(/decl/damage_handler/burn)
scan["toxin"] = H.get_damage(/decl/damage_handler/organ)
scan["oxygen"] = H.get_damage(/decl/damage_handler/suffocation)
scan["radiation"] = H.get_damage(/decl/damage_handler/radiation)
scan["genetic"] = H.get_damage(/decl/damage_handler/genetic)
scan["trauma"] = H.get_damage(BRUTE)
scan["burn"] = H.get_damage(BURN)
scan["toxin"] = H.get_damage(TOX)
scan["oxygen"] = H.get_damage(OXY)
scan["radiation"] = H.get_damage(IRRADIATE)
scan["genetic"] = H.get_damage(CLONE)
scan["paralysis"] = GET_STATUS(H, STAT_PARA)
scan["immune_system"] = H.get_immunity()
scan["reagents"] = list()
Expand Down
6 changes: 3 additions & 3 deletions code/controllers/subsystems/statistics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ SUBSYSTEM_DEF(statistics)
death.gender = dead.gender
death.time_of_death = time2text(world.realtime, "YYYY-MM-DD hh:mm:ss")
death.coords = "[dead.x], [dead.y], [dead.z]"
death.bruteloss = dead.get_damage(/decl/damage_handler/brute)
death.fireloss = dead.get_damage(/decl/damage_handler/burn)
death.bruteloss = dead.get_damage(BRUTE)
death.fireloss = dead.get_damage(BURN)
death.brainloss = dead.get_brain_damage()
death.oxyloss = dead.get_damage(/decl/damage_handler/suffocation)
death.oxyloss = dead.get_damage(OXY)
death.using_map_name = global.using_map.full_name
var/obj/effect/overmap/visitable/cell = global.overmap_sectors[num2text(dead.z)]
death.overmap_location_name = cell?.name || "Unknown"
Expand Down
2 changes: 1 addition & 1 deletion code/datums/extensions/armor/armor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
if(damage_flags & DAM_LASER)
damage *= FLUIDLOSS_CONC_BURN/FLUIDLOSS_WIDE_BURN
damage_flags &= ~(DAM_SHARP | DAM_EDGE | DAM_LASER)
if(damage_type == /decl/damage_handler/radiation)
if(damage_type == IRRADIATE)
damage = max(0, damage - 100 * blocked)
silent = TRUE
damage *= 1 - blocked
Expand Down
4 changes: 2 additions & 2 deletions code/datums/extensions/assembly/assembly_damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
uninstall_component(null, P)
P.forceMove(H.loc)
if(prob(25))
P.take_damage(rand(10,30), /decl/damage_handler/brute)
P.take_damage(rand(10,30), BRUTE)
H.physically_destroyed()
qdel(src)

Expand All @@ -30,7 +30,7 @@
if(component_probability)
for(var/obj/item/stock_parts/computer/H in get_all_components())
if(prob(component_probability))
H.take_damage(round(amount / 2), /decl/damage_handler/brute)
H.take_damage(round(amount / 2), BRUTE)

if(damage >= max_damage)
break_apart()
Expand Down
6 changes: 3 additions & 3 deletions code/datums/extensions/deity_be_near.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@
return TRUE

/datum/extension/deity_be_near/champion/deal_damage(var/mob/living/victim,var/mult)
victim.take_damage(3 * mult, /decl/damage_handler/suffocation)
victim.take_damage(3 * mult, OXY)

/datum/extension/deity_be_near/oracle/deal_damage(var/mob/living/victim, var/mult)
victim.take_damage(mult, /decl/damage_handler/burn)
victim.take_damage(mult, BURN)

/datum/extension/deity_be_near/traitor/deal_damage(var/mob/living/victim, var/mult)
victim.take_damage(5 * mult, /decl/damage_handler/pain)
victim.take_damage(5 * mult, PAIN)
4 changes: 2 additions & 2 deletions code/game/atom_damage.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/atom/proc/take_damage(damage, damage_type = /decl/damage_handler/brute, def_zone, damage_flags = 0, used_weapon, armor_pen, silent = FALSE, override_droplimb, skip_update_health = FALSE)
/atom/proc/take_damage(damage, damage_type = BRUTE, def_zone, damage_flags = 0, used_weapon, armor_pen, silent = FALSE, override_droplimb, skip_update_health = FALSE)

Check failure on line 1 in code/game/atom_damage.dm

View workflow job for this annotation

GitHub Actions / DreamChecker

an override of /atom/proc/take_damage is missing keyword args
return FALSE

/atom/proc/heal_damage(var/damage, var/damage_type = /decl/damage_handler/brute, var/def_zone = null, var/damage_flags = 0, skip_update_health = FALSE)
/atom/proc/heal_damage(var/damage, var/damage_type = BRUTE, var/def_zone = null, var/damage_flags = 0, skip_update_health = FALSE)
return take_damage(-(damage), damage_type, def_zone, damage_flags, skip_update_health = skip_update_health)
6 changes: 3 additions & 3 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@
SHOULD_CALL_PARENT(TRUE)
if(isliving(AM))
var/mob/living/M = AM
M.take_damage(TT.speed*5, /decl/damage_handler/brute)
M.take_damage(TT.speed*5, BRUTE)

/**
Attempt to add blood to this atom
Expand Down Expand Up @@ -732,10 +732,10 @@
var/obj/item/organ/external/affecting = SAFEPICK(M.get_external_organs())
if(!affecting)
to_chat(M, SPAN_DANGER("You land heavily!"))
M.take_damage(damage, /decl/damage_handler/brute)
M.take_damage(damage, BRUTE)
else
to_chat(M, SPAN_DANGER("You land heavily on your [affecting.name]!"))
affecting.take_damage(damage, /decl/damage_handler/brute)
affecting.take_damage(damage, BRUTE)
if(affecting.parent)
affecting.parent.add_autopsy_data("Misadventure", damage)

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/cult/cult_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
to_chat(user, "<span class='danger'>An unexplicable force rips through you, tearing the sword from your grasp!</span>")

//random amount of damage between half of the blade's force and the full force of the blade.
user.take_damage(rand(force/2, force), /decl/damage_handler/brute, zone, (DAM_SHARP|DAM_EDGE), armor_pen = 100)
user.take_damage(rand(force/2, force), BRUTE, zone, (DAM_SHARP|DAM_EDGE), armor_pen = 100)
SET_STATUS_MAX(user, STAT_WEAK, 5)

if(user.try_unequip(src))
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/cult/ghosts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@

var/method = pick("bit", "scratched")
to_chat(choice, "<span class='danger'>Something invisible [method] you!</span>")
choice.take_damage(5, /decl/damage_handler/pain, 0)
choice.take_damage(5, PAIN, 0)
to_chat(src, "<span class='notice'>You [method] \the [choice].</span>")

log_and_message_admins("used ghost magic to bite \the [choice] - [x]-[y]-[z]")
Expand Down
44 changes: 22 additions & 22 deletions code/game/gamemodes/cult/runes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,19 @@
spamcheck = 0
if(!iscultist(target) && target.loc == get_turf(src)) // They hesitated, resisted, or can't join, and they are still on the rune - burn them
if(target.stat == CONSCIOUS)
target.take_damage(10, /decl/damage_handler/burn)
switch(target.get_damage(/decl/damage_handler/burn))
target.take_damage(10, BURN)
switch(target.get_damage(BURN))
if(0 to 25)
to_chat(target, "<span class='danger'>Your blood boils as you force yourself to resist the corruption invading every corner of your mind.</span>")
if(25 to 45)
to_chat(target, "<span class='danger'>Your blood boils and your body burns as the corruption further forces itself into your body and mind.</span>")
target.take_damage(3, /decl/damage_handler/burn)
target.take_damage(3, BURN)
if(45 to 75)
to_chat(target, "<span class='danger'>You begin to hallucinate images of a dark and incomprehensible being and your entire body feels like its engulfed in flame as your mental defenses crumble.</span>")
target.take_damage(5, /decl/damage_handler/burn)
target.take_damage(5, BURN)
if(75 to 100)
to_chat(target, "<span class='cult'>Your mind turns to ash as the burning flames engulf your very soul and images of an unspeakable horror begin to bombard the last remnants of mental resistance.</span>")
target.take_damage(10, /decl/damage_handler/burn)
target.take_damage(10, BURN)

/obj/effect/rune/convert/Topic(href, href_list)
if(href_list["join"] && usr.loc == loc && !iscultist(usr))
Expand Down Expand Up @@ -179,18 +179,18 @@
showOptions(user)
var/warning = 0
while(user.loc == src)
user.take_damage(2, /decl/damage_handler/burn)
if(user.get_damage(/decl/damage_handler/burn) > 50)
user.take_damage(2, BURN)
if(user.get_damage(BURN) > 50)
to_chat(user, "<span class='danger'>Your body can't handle the heat anymore!</span>")
leaveRune(user)
return
if(warning == 0)
to_chat(user, "<span class='warning'>You feel the immerse heat of the realm of Nar-Sie...</span>")
++warning
if(warning == 1 && user.get_damage(/decl/damage_handler/burn) > 15)
if(warning == 1 && user.get_damage(BURN) > 15)
to_chat(user, "<span class='warning'>Your burns are getting worse. You should return to your realm soon...</span>")
++warning
if(warning == 2 && user.get_damage(/decl/damage_handler/burn) > 35)
if(warning == 2 && user.get_damage(BURN) > 35)
to_chat(user, "<span class='warning'>The heat! It burns!</span>")
++warning
sleep(10)
Expand Down Expand Up @@ -315,7 +315,7 @@
take_damage(Proj.damage, Proj.damage_type, damage_flags = Proj.damage_flags)
..()

/obj/effect/cultwall/take_damage(damage, damage_type = /decl/damage_handler/brute, def_zone, damage_flags = 0, used_weapon, armor_pen, silent = FALSE, override_droplimb, skip_update_health = FALSE)
/obj/effect/cultwall/take_damage(var/damage, var/damage_type = BRUTE, var/def_zone = null, var/damage_flags = 0, var/used_weapon = null, var/armor_pen, var/silent = FALSE, var/override_droplimb)
health -= damage
if(health <= 0)
visible_message("<span class='warning'>\The [src] dissipates.</span>")
Expand Down Expand Up @@ -350,7 +350,7 @@
else if(user.loc != get_turf(src) && soul)
soul.reenter_corpse()
else
user.take_damage(1, /decl/damage_handler/burn)
user.take_damage(1, BURN)
sleep(20)
fizzle(user)

Expand Down Expand Up @@ -465,8 +465,8 @@
// This is to speed up the process and also damage mobs that
// don't take damage from being on fire, e.g. borgs
var/dam_amt = 2 + length(casters)
victim.take_damage(dam_amt, /decl/damage_handler/brute)
victim.take_damage(dam_amt, /decl/damage_handler/burn)
victim.take_damage(dam_amt, BRUTE, skip_update_health = TRUE)
victim.take_damage(dam_amt, BURN)
if(ishuman(victim))
var/mob/living/carbon/human/H = victim
if(H.is_asystole())
Expand Down Expand Up @@ -545,8 +545,8 @@
statuses += "you regain lost blood"
if(!charges)
return statuses
var/healbrute = user.get_damage(/decl/damage_handler/brute)
var/healburn = user.get_damage(/decl/damage_handler/burn)
var/healbrute = user.get_damage(BRUTE)
var/healburn = user.get_damage(BURN)
if(healbrute || healburn)
if(healbrute < healburn)
healbrute = min(healbrute, charges / 2)
Expand All @@ -558,14 +558,14 @@
charges -= healburn
healbrute = min(healbrute, charges)
charges -= healbrute
user.heal_damage(healbrute, /decl/damage_handler/brute) // todo readd robo heal check
user.heal_damage(healburn, /decl/damage_handler/burn) // todo readd robo heal check
user.heal_damage(healbrute, BRUTE) // todo readd robo heal check
user.heal_damage(healburn, BURN) // todo readd robo heal check
statuses += "your wounds mend"
if(!charges)
return statuses
if(user.get_damage(/decl/damage_handler/organ))
use = min(user.get_damage(/decl/damage_handler/organ), charges)
user.heal_damage(use, /decl/damage_handler/organ)
if(user.get_damage(TOX))
use = min(user.get_damage(TOX), charges)
user.heal_damage(use, TOX)
charges -= use
statuses += "your body stings less"
if(!charges)
Expand Down Expand Up @@ -746,8 +746,8 @@
var/obj/item/nullrod/N = locate() in M
if(N)
continue
M.take_damage(5, /decl/damage_handler/brute)
M.take_damage(5, /decl/damage_handler/burn)
M.take_damage(5, BRUTE, skip_update_health = TRUE)
M.take_damage(5, BURN)
if(!(M in previous))
if(M.should_have_organ(BP_HEART))
to_chat(M, "<span class='danger'>Your blood boils!</span>")
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/godmode/form_items/narsie_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
if(!do_after(user,200, L))
return
user.visible_message("<span class='danger'>\The [user] plunges the knife down into \the [a]!</span>")
L.take_damage(20, /decl/damage_handler/brute)
L.take_damage(20, BRUTE)
if(altar.linked_god)
altar.linked_god.adjust_power_min(2 * multiplier,0,"from a delicious sacrifice!")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@
if(H.should_have_organ(BP_HEART))
H.drip(5,get_turf(src))
else
H.take_damage(5, /decl/damage_handler/brute)
H.take_damage(5, BRUTE)
linked_god.adjust_power_min(1,1)
return TRUE
6 changes: 3 additions & 3 deletions code/game/gamemodes/godmode/form_items/starlight_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@
/obj/item/knife/ritual/shadow/apply_hit_effect(var/mob/living/target, var/mob/living/user, var/hit_zone)
. = ..()
if(charge)
if(target.get_damage(/decl/damage_handler/brute) > 15)
if(target.get_damage(BRUTE) > 15)
var/datum/reagents/R = target.reagents
if(!R)
return
R.add_reagent(/decl/material/liquid/venom, 5)
new /obj/effect/temporary(get_turf(target),3, 'icons/effects/effects.dmi', "fire_goon")
charge--
else
user.take_damage(5, /decl/damage_handler/burn)
user.take_damage(5, BURN)
if(prob(5))
to_chat(user, "<span class='warning'>\The [src] appears to be out of power!</span>")
new /obj/effect/temporary(get_turf(user),3, 'icons/effects/effects.dmi', "fire_goon")
Expand All @@ -126,7 +126,7 @@
/obj/item/sword/blazing
name = "blazing blade"
icon = 'icons/obj/items/weapon/swords/flaming.dmi'
damtype = /decl/damage_handler/burn
damtype = BURN
material_alteration = MAT_FLAG_ALTERATION_NONE
var/last_near_structure = 0
var/mob/living/deity/linked
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
if(followers.len)
for(var/m in followers)
var/mob/living/L = m
L.heal_damage(5, /decl/damage_handler/burn)
L.heal_damage(5, BURN)
if(prob(5))
to_chat(L, "<span class='notice'>You feel a pleasant warmth spread throughout your body...</span>")
for(var/s in L.mind.learned_spells)
Expand Down
4 changes: 2 additions & 2 deletions code/game/gamemodes/godmode/god_altar.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@
cycles_before_converted++
if(prob(50))
to_chat(M, "<span class='danger'>The mental strain is too much for you! You feel your body weakening!</span>")
M.take_damage(15, /decl/damage_handler/organ, skip_update_health = TRUE)
M.take_damage(30, /decl/damage_handler/pain)
M.take_damage(15, TOX, skip_update_health = TRUE)
M.take_damage(30, PAIN)
return TOPIC_REFRESH

/obj/structure/deity/altar/on_update_icon()
Expand Down
4 changes: 2 additions & 2 deletions code/game/gamemodes/wizard/servant_items/champion.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
var/obj/item/organ/external/E = GET_EXTERNAL_ORGAN(H, H.get_active_held_item_slot())
E?.take_damage(2, /decl/damage_handler/burn, used_weapon = "stovetop")
E?.take_damage(2, BURN, used_weapon = "stovetop")
else
var/mob/living/M = loc
M.take_damage(2, /decl/damage_handler/burn)
M.take_damage(2, BURN)
if(prob(2))
to_chat(loc,"<span class='danger'>\The [src] is burning you!</span>")
return 1
Expand Down
8 changes: 4 additions & 4 deletions code/game/machinery/_machines_base/machinery_damage.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/obj/machinery/take_damage(damage, damage_type = /decl/damage_handler/brute, def_zone, damage_flags = 0, used_weapon, armor_pen, silent = FALSE, override_droplimb, skip_update_health = FALSE)
/obj/machinery/take_damage(damage, damage_type = BRUTE, def_zone, damage_flags = 0, used_weapon, armor_pen, silent = FALSE, override_droplimb, skip_update_health = FALSE)
//Let's not bother initializing all the components for nothing
if(damage <= 0)
return
Expand Down Expand Up @@ -30,7 +30,7 @@
if(victim?.can_take_damage() && victim.is_functional())
damage -= victim.take_damage(damage, damtype)

if(damage && (damtype == /decl/damage_handler/brute || damtype == /decl/damage_handler/burn))
if(damage && (damtype == BRUTE || damtype == BURN))
dismantle()

/obj/machinery/proc/get_damageable_component(var/damage_type)
Expand Down Expand Up @@ -64,7 +64,7 @@
if(use_power && stat == 0)
new /obj/effect/temp_visual/emp_burst(loc)
use_power_oneoff(7500/severity)
take_damage(100/severity, /decl/damage_handler/electrocute)
take_damage(100/severity, ELECTROCUTE)
..()

/obj/machinery/explosion_act(severity)
Expand All @@ -73,7 +73,7 @@
if((severity == 1 || (severity == 2 && prob(25))))
physically_destroyed()
else
take_damage(100/severity, /decl/damage_handler/brute, silent = TRUE)
take_damage(100/severity, BRUTE, silent = TRUE)

/obj/machinery/bullet_act(obj/item/projectile/P, def_zone)
. = ..()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
// RefreshParts has been called, likely meaning other componenets were added/removed.
/obj/item/stock_parts/proc/on_refresh(var/obj/machinery/machine)

/obj/item/stock_parts/take_damage(damage, damage_type = /decl/damage_handler/brute, def_zone, damage_flags = 0, used_weapon, armor_pen, silent = FALSE, override_droplimb, skip_update_health = FALSE)
/obj/item/stock_parts/take_damage(damage, damage_type = BRUTE, def_zone, damage_flags = 0, used_weapon, armor_pen, silent = FALSE, override_droplimb, skip_update_health = FALSE)
if(damage_type in ignore_damage_types)
return
. = ..()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
/obj/item/stock_parts/power/battery/check_health(lastdamage, lastdamtype, lastdamflags, consumed)
if(can_take_damage() && lastdamage > 0)
switch(lastdamtype)
if(/decl/damage_handler/electrocute)
if(ELECTROCUTE)
if(prob(50) && cell && (get_percent_health() < 50))
cell.emp_act(3)
if(/decl/damage_handler/brute)
if(BRUTE)
if(prob(20) && cell && (get_percent_health() < 50))
cell.explosion_act(3)
. = ..()
Expand Down
Loading

0 comments on commit 26df13a

Please sign in to comment.