mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 09:08:30 +01:00
All camelCase (Brute|Burn|Fire|Tox|Oxy|Organ|Stamina)(Loss) procs now use snake_case. UNDERSCORES RULE! (#94111)
## About The Pull Request It's just a partial cleanup of anti-[STYLE](https://github.com/tgstation/tgstation/blob/master/.github/guides/STYLE.md) code from /tg/'s ancient history. I compiled & tested with my helpful assistant and damage is still working. <img width="1920" height="1040" alt="image" src="https://github.com/user-attachments/assets/26dabc17-088f-4008-b299-3ff4c27142c3" /> I'll upload the .cs script I used to do it shortly. ## Why It's Good For The Game Just minor code cleanup. Script used is located at https://metek.tech/camelTo-Snake.7z EDIT 11/23/25: Updated the script to use multithreading and sequential scan so it works a hell of a lot faster ``` /* // Copyright 2025 Joshua 'Joan Metekillot' Kidder This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. // */ using System.Text.RegularExpressions; class Program { static async Task Main(string[] args) { var readFile = new FileStreamOptions { Access = FileAccess.Read, Share = FileShare.ReadWrite, Options = FileOptions.Asynchronous | FileOptions.SequentialScan }; FileStreamOptions writeFile = new FileStreamOptions { Share = FileShare.ReadWrite, Access = FileAccess.ReadWrite, Mode = FileMode.Truncate, Options = FileOptions.Asynchronous }; RegexOptions regexOptions = RegexOptions.Multiline | RegexOptions.Compiled; Dictionary<string, int> changedProcs = new(); string regexPattern = @"(?<=\P{L})([a-z]+)([A-Z]{1,2}[a-z]+)*(Brute|Burn|Fire|Tox|Oxy|Organ|Stamina)(Loss)([A-Z]{1,2}[a-z]+)*"; Regex camelCaseProcRegex = new(regexPattern, regexOptions); string snakeify(Match matchingRegex) { var vals = matchingRegex.Groups.Cast<Group>().SelectMany(_ => _.Captures).Select(_ => _.Value).ToArray(); var newVal = string.Join("_", vals.Skip(1).ToArray()).ToLower(); string logString = $"{vals[0]} => {newVal}"; if (changedProcs.TryGetValue(logString, out int value)) { changedProcs[logString] = value + 1; } else { changedProcs.Add(logString, 1); } return newVal; } var dmFiles = Directory.EnumerateFiles(".", "*.dm", SearchOption.AllDirectories).ToAsyncEnumerable<string>(); // uses default ParallelOptions // https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.paralleloptions?view=net-10.0#main await Parallel.ForEachAsync(dmFiles, async (filePath, UnusedCancellationToken) => { var reader = new StreamReader(filePath, readFile); string oldContent = await reader.ReadToEndAsync(); string newContent = camelCaseProcRegex.Replace(oldContent, new MatchEvaluator((Func<Match, string>)snakeify)); if (oldContent != newContent) { var writer = new StreamWriter(filePath, writeFile); await writer.WriteAsync(newContent); await writer.DisposeAsync(); } reader.Dispose(); }); var logToList = changedProcs.Cast<KeyValuePair<string, int>>().ToList(); foreach (var pair in logToList) { Console.WriteLine($"{pair.Key}: {pair.Value} locations"); } } } ``` ## Changelog 🆑 Bisar code: All (Brute|Burn|Fire|Tox|Oxy|Organ|Stamina)(Loss) procs now use snake_case, in-line with the STYLE guide. Underscores rule! /🆑
This commit is contained in:
@@ -73,7 +73,7 @@
|
||||
span_notice("[user] completes the surgery on [target]'s brain."),
|
||||
)
|
||||
display_pain(target, "Your brain throbs with intense pain; thinking hurts!")
|
||||
target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 60)
|
||||
target.adjust_organ_loss(ORGAN_SLOT_BRAIN, 60)
|
||||
target.gain_trauma_type(BRAIN_TRAUMA_SEVERE, TRAUMA_RESILIENCE_LOBOTOMY)
|
||||
else
|
||||
user.visible_message(span_warning("[user] suddenly notices that the brain [user.p_they()] [user.p_were()] working on is not there anymore."), span_warning("You suddenly notice that the brain you were working on is not there anymore."))
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
span_notice("[user] completes the surgery on [target]'s brain."),
|
||||
)
|
||||
display_pain(target, "Your brain throbs with intense pain; Thinking hurts!")
|
||||
target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 60)
|
||||
target.adjust_organ_loss(ORGAN_SLOT_BRAIN, 60)
|
||||
target.gain_trauma_type(BRAIN_TRAUMA_SEVERE, TRAUMA_RESILIENCE_LOBOTOMY)
|
||||
else
|
||||
user.visible_message(span_warning("[user] suddenly notices that the brain [user.p_they()] [user.p_were()] working on is not there anymore."), span_warning("You suddenly notice that the brain you were working on is not there anymore."))
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
span_notice("[user] completes the surgery on [target]'s brain."),
|
||||
)
|
||||
display_pain(target, "Your head throbs with horrible pain!")
|
||||
target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 40)
|
||||
target.adjust_organ_loss(ORGAN_SLOT_BRAIN, 40)
|
||||
else
|
||||
user.visible_message(span_warning("[user] suddenly notices that the brain [user.p_they()] [user.p_were()] working on is not there anymore."), span_warning("You suddenly notice that the brain you were working on is not there anymore."))
|
||||
return FALSE
|
||||
|
||||
@@ -63,4 +63,4 @@
|
||||
span_warning("[user] screws up, brusing [target]'s chest!"),
|
||||
span_warning("[user] screws up!"),
|
||||
)
|
||||
target.adjustBruteLoss(5)
|
||||
target.adjust_brute_loss(5)
|
||||
|
||||
@@ -103,4 +103,4 @@
|
||||
span_warning("[user] screws up, brusing [target]'s chest!"),
|
||||
span_warning("[user] screws up!"),
|
||||
)
|
||||
target.adjustBruteLoss(5)
|
||||
target.adjust_brute_loss(5)
|
||||
|
||||
@@ -104,8 +104,8 @@
|
||||
var/need_mob_update = FALSE
|
||||
need_mob_update += owner.heal_overall_damage(brute = 0.5 * bodypart_coefficient, \
|
||||
burn = 0.5 * bodypart_coefficient, updating_health = FALSE, required_bodytype = BODYTYPE_PLANT)
|
||||
need_mob_update += owner.adjustToxLoss(-0.5 * bodypart_coefficient, updating_health = FALSE)
|
||||
need_mob_update += owner.adjustOxyLoss(-0.5 * bodypart_coefficient, updating_health = FALSE)
|
||||
need_mob_update += owner.adjust_tox_loss(-0.5 * bodypart_coefficient, updating_health = FALSE)
|
||||
need_mob_update += owner.adjust_oxy_loss(-0.5 * bodypart_coefficient, updating_health = FALSE)
|
||||
if(need_mob_update)
|
||||
owner.updatehealth()
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
display_pain(target, "The pain in your head receeds, thinking becomes a bit easier!")
|
||||
if(target.mind?.has_antag_datum(/datum/antagonist/brainwashed))
|
||||
target.mind.remove_antag_datum(/datum/antagonist/brainwashed)
|
||||
target.setOrganLoss(ORGAN_SLOT_BRAIN, target.get_organ_loss(ORGAN_SLOT_BRAIN) - 50) //we set damage in this case in order to clear the "failing" flag
|
||||
target.set_organ_loss(ORGAN_SLOT_BRAIN, target.get_organ_loss(ORGAN_SLOT_BRAIN) - 50) //we set damage in this case in order to clear the "failing" flag
|
||||
target.cure_all_traumas(TRAUMA_RESILIENCE_SURGERY)
|
||||
if(target.get_organ_loss(ORGAN_SLOT_BRAIN) > 0)
|
||||
to_chat(user, "[target]'s brain looks like it could be fixed further.")
|
||||
@@ -85,7 +85,7 @@
|
||||
span_notice("[user] completes the surgery on [target]'s brain."),
|
||||
)
|
||||
display_pain(target, "Your head throbs with horrible pain; thinking hurts!")
|
||||
target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 60)
|
||||
target.adjust_organ_loss(ORGAN_SLOT_BRAIN, 60)
|
||||
target.gain_trauma_type(BRAIN_TRAUMA_SEVERE, TRAUMA_RESILIENCE_LOBOTOMY)
|
||||
else
|
||||
user.visible_message(span_warning("[user] suddenly notices that the brain [user.p_they()] [user.p_were()] working on is not there anymore."), span_warning("You suddenly notice that the brain you were working on is not there anymore."))
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
)
|
||||
var/obj/item/bodypart/target_bodypart = target_human.get_bodypart(target_zone)
|
||||
target_bodypart.adjustBleedStacks(10)
|
||||
target_human.adjustBruteLoss(10)
|
||||
target_human.adjust_brute_loss(10)
|
||||
return ..()
|
||||
|
||||
/datum/surgery_step/incise_heart/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
@@ -97,8 +97,8 @@
|
||||
)
|
||||
var/obj/item/bodypart/target_bodypart = target_human.get_bodypart(target_zone)
|
||||
target_bodypart.adjustBleedStacks(10)
|
||||
target_human.adjustOrganLoss(ORGAN_SLOT_HEART, 10)
|
||||
target_human.adjustBruteLoss(10)
|
||||
target_human.adjust_organ_loss(ORGAN_SLOT_HEART, 10)
|
||||
target_human.adjust_brute_loss(10)
|
||||
|
||||
//grafts a coronary bypass onto the individual's heart, success chance is 90% base again
|
||||
/datum/surgery_step/coronary_bypass
|
||||
@@ -135,7 +135,7 @@
|
||||
display_pain(target, "The pain in your chest is unbearable! You can barely take it anymore!")
|
||||
|
||||
/datum/surgery_step/coronary_bypass/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
|
||||
target.setOrganLoss(ORGAN_SLOT_HEART, 60)
|
||||
target.set_organ_loss(ORGAN_SLOT_HEART, 60)
|
||||
var/obj/item/organ/heart/target_heart = target.get_organ_slot(ORGAN_SLOT_HEART)
|
||||
if(target_heart) //slightly worrying if we lost our heart mid-operation, but that's life
|
||||
target_heart.operated = TRUE
|
||||
@@ -162,7 +162,7 @@
|
||||
span_warning("[user] screws up, causing blood to spurt out of [target_human]'s chest profusely!"),
|
||||
)
|
||||
display_pain(target, "Your chest burns; you feel like you're going insane!")
|
||||
target_human.adjustOrganLoss(ORGAN_SLOT_HEART, 20)
|
||||
target_human.adjust_organ_loss(ORGAN_SLOT_HEART, 20)
|
||||
var/obj/item/bodypart/target_bodypart = target_human.get_bodypart(target_zone)
|
||||
target_bodypart.adjustBleedStacks(30)
|
||||
return FALSE
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
span_warning("[user] accidentally stabs [target] right in the brain!"),
|
||||
)
|
||||
display_pain(target, "You feel a visceral stabbing pain right through your head, into your brain!")
|
||||
target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 70)
|
||||
target.adjust_organ_loss(ORGAN_SLOT_BRAIN, 70)
|
||||
else
|
||||
display_results(
|
||||
user,
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
span_warning("[user] accidentally stabs [target] right in the brain!"),
|
||||
)
|
||||
display_pain(target, "You feel a visceral stabbing pain right through your head, into your brain!")
|
||||
target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 70)
|
||||
target.adjust_organ_loss(ORGAN_SLOT_BRAIN, 70)
|
||||
else
|
||||
display_results(
|
||||
user,
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
/datum/surgery_step/gastrectomy/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
|
||||
var/mob/living/carbon/human/target_human = target
|
||||
var/obj/item/organ/stomach/target_stomach = target.get_organ_slot(ORGAN_SLOT_STOMACH)
|
||||
target_human.setOrganLoss(ORGAN_SLOT_STOMACH, 20) // Stomachs have a threshold for being able to even digest food, so I might tweak this number
|
||||
target_human.set_organ_loss(ORGAN_SLOT_STOMACH, 20) // Stomachs have a threshold for being able to even digest food, so I might tweak this number
|
||||
if(target_stomach)
|
||||
target_stomach.operated = TRUE
|
||||
if(target_stomach.organ_flags & ORGAN_EMP) //If our organ is failing due to an EMP, fix that
|
||||
@@ -88,7 +88,7 @@
|
||||
|
||||
/datum/surgery_step/gastrectomy/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery)
|
||||
var/mob/living/carbon/human/target_human = target
|
||||
target_human.adjustOrganLoss(ORGAN_SLOT_STOMACH, 15)
|
||||
target_human.adjust_organ_loss(ORGAN_SLOT_STOMACH, 15)
|
||||
display_results(
|
||||
user,
|
||||
target,
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
/datum/surgery_step/heal/initiate(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE)
|
||||
if(!..())
|
||||
return
|
||||
while((brutehealing && target.getBruteLoss()) || (burnhealing && target.getFireLoss()))
|
||||
while((brutehealing && target.get_brute_loss()) || (burnhealing && target.get_fire_loss()))
|
||||
if(!..())
|
||||
break
|
||||
|
||||
@@ -87,12 +87,12 @@
|
||||
var/burn_healed = burnhealing
|
||||
var/dead_patient = FALSE
|
||||
if(target.stat == DEAD) //dead patients get way less additional heal from the damage they have.
|
||||
brute_healed += round((target.getBruteLoss() * (brute_multiplier * 0.2)),0.1)
|
||||
burn_healed += round((target.getFireLoss() * (burn_multiplier * 0.2)),0.1)
|
||||
brute_healed += round((target.get_brute_loss() * (brute_multiplier * 0.2)),0.1)
|
||||
burn_healed += round((target.get_fire_loss() * (burn_multiplier * 0.2)),0.1)
|
||||
dead_patient = TRUE
|
||||
else
|
||||
brute_healed += round((target.getBruteLoss() * brute_multiplier),0.1)
|
||||
burn_healed += round((target.getFireLoss() * burn_multiplier),0.1)
|
||||
brute_healed += round((target.get_brute_loss() * brute_multiplier),0.1)
|
||||
burn_healed += round((target.get_fire_loss() * burn_multiplier),0.1)
|
||||
dead_patient = FALSE
|
||||
if(!get_location_accessible(target, target_zone))
|
||||
brute_healed *= 0.55
|
||||
@@ -130,8 +130,8 @@
|
||||
)
|
||||
var/brute_dealt = brutehealing * 0.8
|
||||
var/burn_dealt = burnhealing * 0.8
|
||||
brute_dealt += round((target.getBruteLoss() * (brute_multiplier * 0.5)),0.1)
|
||||
burn_dealt += round((target.getFireLoss() * (burn_multiplier * 0.5)),0.1)
|
||||
brute_dealt += round((target.get_brute_loss() * (brute_multiplier * 0.5)),0.1)
|
||||
burn_dealt += round((target.get_fire_loss() * (burn_multiplier * 0.5)),0.1)
|
||||
target.take_bodypart_damage(brute_dealt, burn_dealt, wound_bonus=CANT_WOUND)
|
||||
return FALSE
|
||||
|
||||
@@ -164,11 +164,11 @@
|
||||
if(!brute_healed)
|
||||
return
|
||||
|
||||
var/estimated_remaining_steps = target.getBruteLoss() / brute_healed
|
||||
var/estimated_remaining_steps = target.get_brute_loss() / brute_healed
|
||||
var/progress_text
|
||||
|
||||
if(locate(/obj/item/healthanalyzer) in user.held_items)
|
||||
progress_text = ". Remaining brute: <font color='#ff3333'>[target.getBruteLoss()]</font>"
|
||||
progress_text = ". Remaining brute: <font color='#ff3333'>[target.get_brute_loss()]</font>"
|
||||
else
|
||||
switch(estimated_remaining_steps)
|
||||
if(-INFINITY to 1)
|
||||
@@ -229,11 +229,11 @@
|
||||
/datum/surgery_step/heal/burn/get_progress(mob/user, mob/living/carbon/target, brute_healed, burn_healed)
|
||||
if(!burn_healed)
|
||||
return
|
||||
var/estimated_remaining_steps = target.getFireLoss() / burn_healed
|
||||
var/estimated_remaining_steps = target.get_fire_loss() / burn_healed
|
||||
var/progress_text
|
||||
|
||||
if(locate(/obj/item/healthanalyzer) in user.held_items)
|
||||
progress_text = ". Remaining burn: <font color='#ff9933'>[target.getFireLoss()]</font>"
|
||||
progress_text = ". Remaining burn: <font color='#ff9933'>[target.get_fire_loss()]</font>"
|
||||
else
|
||||
switch(estimated_remaining_steps)
|
||||
if(-INFINITY to 1)
|
||||
@@ -294,17 +294,17 @@
|
||||
/datum/surgery_step/heal/combo/get_progress(mob/user, mob/living/carbon/target, brute_healed, burn_healed)
|
||||
var/estimated_remaining_steps = 0
|
||||
if(brute_healed > 0)
|
||||
estimated_remaining_steps = max(0, (target.getBruteLoss() / brute_healed))
|
||||
estimated_remaining_steps = max(0, (target.get_brute_loss() / brute_healed))
|
||||
if(burn_healed > 0)
|
||||
estimated_remaining_steps = max(estimated_remaining_steps, (target.getFireLoss() / burn_healed)) // whichever is higher between brute or burn steps
|
||||
estimated_remaining_steps = max(estimated_remaining_steps, (target.get_fire_loss() / burn_healed)) // whichever is higher between brute or burn steps
|
||||
|
||||
var/progress_text
|
||||
|
||||
if(locate(/obj/item/healthanalyzer) in user.held_items)
|
||||
if(target.getBruteLoss())
|
||||
progress_text = ". Remaining brute: <font color='#ff3333'>[target.getBruteLoss()]</font>"
|
||||
if(target.getFireLoss())
|
||||
progress_text += ". Remaining burn: <font color='#ff9933'>[target.getFireLoss()]</font>"
|
||||
if(target.get_brute_loss())
|
||||
progress_text = ". Remaining brute: <font color='#ff3333'>[target.get_brute_loss()]</font>"
|
||||
if(target.get_fire_loss())
|
||||
progress_text += ". Remaining burn: <font color='#ff9933'>[target.get_fire_loss()]</font>"
|
||||
else
|
||||
switch(estimated_remaining_steps)
|
||||
if(-INFINITY to 1)
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
/datum/surgery_step/hepatectomy/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
|
||||
var/mob/living/carbon/human/human_target = target
|
||||
var/obj/item/organ/liver/target_liver = target.get_organ_slot(ORGAN_SLOT_LIVER)
|
||||
human_target.setOrganLoss(ORGAN_SLOT_LIVER, 10) //not bad, not great
|
||||
human_target.set_organ_loss(ORGAN_SLOT_LIVER, 10) //not bad, not great
|
||||
if(target_liver)
|
||||
target_liver.operated = TRUE
|
||||
if(target_liver.organ_flags & ORGAN_EMP) //If our organ is failing due to an EMP, fix that
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
/datum/surgery_step/hepatectomy/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery)
|
||||
var/mob/living/carbon/human/human_target = target
|
||||
human_target.adjustOrganLoss(ORGAN_SLOT_LIVER, 15)
|
||||
human_target.adjust_organ_loss(ORGAN_SLOT_LIVER, 15)
|
||||
display_results(
|
||||
user,
|
||||
target,
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/human_target = target
|
||||
var/obj/item/organ/lungs/target_lungs = human_target.get_organ_slot(ORGAN_SLOT_LUNGS)
|
||||
human_target.setOrganLoss(ORGAN_SLOT_LUNGS, 60)
|
||||
human_target.set_organ_loss(ORGAN_SLOT_LUNGS, 60)
|
||||
if(target_lungs)
|
||||
target_lungs.operated = TRUE
|
||||
if(target_lungs.organ_flags & ORGAN_EMP) //If our organ is failing due to an EMP, fix that
|
||||
@@ -95,5 +95,5 @@
|
||||
)
|
||||
display_pain(target, "You feel a sharp stab in your chest; the wind is knocked out of you and it hurts to catch your breath!")
|
||||
human_target.losebreath += 4
|
||||
human_target.adjustOrganLoss(ORGAN_SLOT_LUNGS, 10)
|
||||
human_target.adjust_organ_loss(ORGAN_SLOT_LUNGS, 10)
|
||||
return FALSE
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
if(organ_flags & ORGAN_FAILING)
|
||||
// forced to ensure people don't use it to gain tox as slime person
|
||||
owner.adjustToxLoss(2 * seconds_per_tick, forced = TRUE)
|
||||
owner.adjust_tox_loss(2 * seconds_per_tick, forced = TRUE)
|
||||
else if(inflamation_stage)
|
||||
inflamation(seconds_per_tick)
|
||||
else if(SPT_PROB(APPENDICITIS_PROB, seconds_per_tick) && !HAS_TRAIT(owner, TRAIT_TEMPORARY_BODY))
|
||||
@@ -68,13 +68,13 @@
|
||||
if(2)
|
||||
if(SPT_PROB(1.5, seconds_per_tick))
|
||||
to_chat(organ_owner, span_warning("You feel a stabbing pain in your abdomen!"))
|
||||
organ_owner.adjustOrganLoss(ORGAN_SLOT_APPENDIX, 5)
|
||||
organ_owner.adjust_organ_loss(ORGAN_SLOT_APPENDIX, 5)
|
||||
organ_owner.Stun(rand(40, 60))
|
||||
organ_owner.adjustToxLoss(1, forced = TRUE)
|
||||
organ_owner.adjust_tox_loss(1, forced = TRUE)
|
||||
if(3)
|
||||
if(SPT_PROB(0.5, seconds_per_tick))
|
||||
organ_owner.vomit(VOMIT_CATEGORY_DEFAULT, lost_nutrition = 95)
|
||||
organ_owner.adjustOrganLoss(ORGAN_SLOT_APPENDIX, 15)
|
||||
organ_owner.adjust_organ_loss(ORGAN_SLOT_APPENDIX, 15)
|
||||
|
||||
/obj/item/organ/appendix/feel_for_damage(self_aware)
|
||||
var/effective_stage = floor(inflamation_stage + (damage / maxHealth))
|
||||
|
||||
@@ -244,7 +244,7 @@
|
||||
to_chat(owner, span_userdanger("You feel an explosion erupt inside your [parse_zone(zone)] as your implant breaks!"))
|
||||
owner.adjust_fire_stacks(20)
|
||||
owner.ignite_mob()
|
||||
owner.adjustFireLoss(25)
|
||||
owner.adjust_fire_loss(25)
|
||||
organ_flags |= ORGAN_FAILING
|
||||
|
||||
/obj/item/organ/cyberimp/arm/toolkit/gun/laser
|
||||
|
||||
@@ -90,19 +90,19 @@
|
||||
/// boolean that stands for if PHYSICAL damage being patched
|
||||
var/body_damage_patched = FALSE
|
||||
var/need_mob_update = FALSE
|
||||
if(owner.getOxyLoss())
|
||||
need_mob_update += owner.adjustOxyLoss(-5, updating_health = FALSE)
|
||||
if(owner.get_oxy_loss())
|
||||
need_mob_update += owner.adjust_oxy_loss(-5, updating_health = FALSE)
|
||||
revive_cost += 5
|
||||
if(owner.getBruteLoss())
|
||||
need_mob_update += owner.adjustBruteLoss(-2, updating_health = FALSE)
|
||||
if(owner.get_brute_loss())
|
||||
need_mob_update += owner.adjust_brute_loss(-2, updating_health = FALSE)
|
||||
revive_cost += 40
|
||||
body_damage_patched = TRUE
|
||||
if(owner.getFireLoss())
|
||||
need_mob_update += owner.adjustFireLoss(-2, updating_health = FALSE)
|
||||
if(owner.get_fire_loss())
|
||||
need_mob_update += owner.adjust_fire_loss(-2, updating_health = FALSE)
|
||||
revive_cost += 40
|
||||
body_damage_patched = TRUE
|
||||
if(owner.getToxLoss())
|
||||
need_mob_update += owner.adjustToxLoss(-1, updating_health = FALSE)
|
||||
if(owner.get_tox_loss())
|
||||
need_mob_update += owner.adjust_tox_loss(-1, updating_health = FALSE)
|
||||
revive_cost += 40
|
||||
if(need_mob_update)
|
||||
owner.updatehealth()
|
||||
|
||||
@@ -202,8 +202,8 @@
|
||||
owner.SetKnockdown(0)
|
||||
owner.SetImmobilized(0)
|
||||
owner.SetParalyzed(0)
|
||||
owner.setStaminaLoss(0)
|
||||
addtimer(CALLBACK(owner, TYPE_PROC_REF(/mob/living, setStaminaLoss), 0), stun_resistance_time)
|
||||
owner.set_stamina_loss(0)
|
||||
addtimer(CALLBACK(owner, TYPE_PROC_REF(/mob/living, set_stamina_loss), 0), stun_resistance_time)
|
||||
|
||||
var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread
|
||||
sparks.set_up(5, 1, src)
|
||||
|
||||
@@ -254,7 +254,7 @@
|
||||
wounded_owner.adjust_blood_volume(2 * seconds_per_tick)
|
||||
|
||||
if(toxification_probability && prob(toxification_probability))
|
||||
wounded_owner.adjustToxLoss(1 * seconds_per_tick, updating_health = FALSE)
|
||||
wounded_owner.adjust_tox_loss(1 * seconds_per_tick, updating_health = FALSE)
|
||||
|
||||
var/datum/wound/bloodiest_wound
|
||||
|
||||
|
||||
@@ -188,8 +188,8 @@
|
||||
|
||||
if(owner.health <= owner.crit_threshold)
|
||||
owner.heal_overall_damage(5, 5)
|
||||
owner.adjustOxyLoss(-5)
|
||||
owner.adjustToxLoss(-5)
|
||||
owner.adjust_oxy_loss(-5)
|
||||
owner.adjust_tox_loss(-5)
|
||||
|
||||
/datum/status_effect/voltaic_overdrive/on_apply()
|
||||
. = ..()
|
||||
|
||||
@@ -165,17 +165,17 @@
|
||||
switch(failure_time)
|
||||
//After 60 seconds we begin to feel the effects
|
||||
if(1 * LIVER_FAILURE_STAGE_SECONDS to 2 * LIVER_FAILURE_STAGE_SECONDS - 1)
|
||||
owner.adjustToxLoss(0.2 * seconds_per_tick,forced = TRUE)
|
||||
owner.adjust_tox_loss(0.2 * seconds_per_tick,forced = TRUE)
|
||||
owner.adjust_disgust(0.1 * seconds_per_tick)
|
||||
|
||||
if(2 * LIVER_FAILURE_STAGE_SECONDS to 3 * LIVER_FAILURE_STAGE_SECONDS - 1)
|
||||
owner.adjustToxLoss(0.4 * seconds_per_tick,forced = TRUE)
|
||||
owner.adjust_tox_loss(0.4 * seconds_per_tick,forced = TRUE)
|
||||
owner.adjust_drowsiness(0.5 SECONDS * seconds_per_tick)
|
||||
owner.adjust_disgust(0.3 * seconds_per_tick)
|
||||
|
||||
if(3 * LIVER_FAILURE_STAGE_SECONDS to 4 * LIVER_FAILURE_STAGE_SECONDS - 1)
|
||||
owner.adjustToxLoss(0.6 * seconds_per_tick,forced = TRUE)
|
||||
owner.adjustOrganLoss(pick(ORGAN_SLOT_HEART,ORGAN_SLOT_LUNGS,ORGAN_SLOT_STOMACH,ORGAN_SLOT_EYES,ORGAN_SLOT_EARS),0.2 * seconds_per_tick)
|
||||
owner.adjust_tox_loss(0.6 * seconds_per_tick,forced = TRUE)
|
||||
owner.adjust_organ_loss(pick(ORGAN_SLOT_HEART,ORGAN_SLOT_LUNGS,ORGAN_SLOT_STOMACH,ORGAN_SLOT_EYES,ORGAN_SLOT_EARS),0.2 * seconds_per_tick)
|
||||
owner.adjust_drowsiness(1 SECONDS * seconds_per_tick)
|
||||
owner.adjust_disgust(0.6 * seconds_per_tick)
|
||||
|
||||
@@ -183,8 +183,8 @@
|
||||
owner.emote("drool")
|
||||
|
||||
if(4 * LIVER_FAILURE_STAGE_SECONDS to INFINITY)
|
||||
owner.adjustToxLoss(0.8 * seconds_per_tick,forced = TRUE)
|
||||
owner.adjustOrganLoss(pick(ORGAN_SLOT_HEART,ORGAN_SLOT_LUNGS,ORGAN_SLOT_STOMACH,ORGAN_SLOT_EYES,ORGAN_SLOT_EARS),0.5 * seconds_per_tick)
|
||||
owner.adjust_tox_loss(0.8 * seconds_per_tick,forced = TRUE)
|
||||
owner.adjust_organ_loss(pick(ORGAN_SLOT_HEART,ORGAN_SLOT_LUNGS,ORGAN_SLOT_STOMACH,ORGAN_SLOT_EYES,ORGAN_SLOT_EARS),0.5 * seconds_per_tick)
|
||||
owner.adjust_drowsiness(1.6 SECONDS * seconds_per_tick)
|
||||
owner.adjust_disgust(1.2 * seconds_per_tick)
|
||||
|
||||
@@ -247,7 +247,7 @@
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
if(!COOLDOWN_FINISHED(src, severe_cooldown)) //So we cant just spam emp to kill people.
|
||||
owner.adjustToxLoss(10)
|
||||
owner.adjust_tox_loss(10)
|
||||
COOLDOWN_START(src, severe_cooldown, 10 SECONDS)
|
||||
if(prob(emp_vulnerability/severity)) //Chance of permanent effects
|
||||
organ_flags |= ORGAN_EMP //Starts organ faliure - gonna need replacing soon.
|
||||
@@ -302,7 +302,7 @@
|
||||
if(!(organ_owner.mob_biotypes & MOB_PLANT))
|
||||
return
|
||||
if(chem.type == /datum/reagent/toxin/plantbgone)
|
||||
organ_owner.adjustToxLoss(3 * REM * seconds_per_tick)
|
||||
organ_owner.adjust_tox_loss(3 * REM * seconds_per_tick)
|
||||
|
||||
/obj/item/organ/liver/snail
|
||||
name = "snail liver"
|
||||
@@ -328,7 +328,7 @@
|
||||
return
|
||||
if(istype(chem, /datum/reagent/consumable/salt))
|
||||
playsound(organ_owner, SFX_SEAR, 30, TRUE)
|
||||
organ_owner.adjustFireLoss(2 * REM * seconds_per_tick)
|
||||
organ_owner.adjust_fire_loss(2 * REM * seconds_per_tick)
|
||||
organ_owner.reagents.remove_reagent(chem.type, REAGENTS_METABOLISM * seconds_per_tick)
|
||||
return COMSIG_MOB_STOP_REAGENT_TICK
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
if((. & COMSIG_MOB_STOP_REAGENT_TICK) || (organ_flags & ORGAN_FAILING))
|
||||
return
|
||||
if(istype(chem, /datum/reagent/toxin/bonehurtingjuice))
|
||||
organ_owner.adjustStaminaLoss(7.5 * REM * seconds_per_tick, updating_stamina = FALSE)
|
||||
organ_owner.adjustBruteLoss(0.5 * REM * seconds_per_tick, updating_health = FALSE)
|
||||
organ_owner.adjust_stamina_loss(7.5 * REM * seconds_per_tick, updating_stamina = FALSE)
|
||||
organ_owner.adjust_brute_loss(0.5 * REM * seconds_per_tick, updating_health = FALSE)
|
||||
if(SPT_PROB(10, seconds_per_tick))
|
||||
switch(rand(1, 3))
|
||||
if(1)
|
||||
|
||||
@@ -263,7 +263,7 @@
|
||||
breathe_gas_volume(breath, /datum/gas/oxygen, /datum/gas/carbon_dioxide)
|
||||
// Heal mob if not in crit.
|
||||
if(breather.health >= breather.crit_threshold && breather.oxyloss)
|
||||
breather.adjustOxyLoss(-5)
|
||||
breather.adjust_oxy_loss(-5)
|
||||
|
||||
/// Maximum Oxygen effects. "Too much O2!"
|
||||
/obj/item/organ/lungs/proc/too_much_oxygen(mob/living/carbon/breather, datum/gas_mixture/breath, o2_pp, old_o2_pp)
|
||||
@@ -310,7 +310,7 @@
|
||||
breathe_gas_volume(breath, /datum/gas/nitrogen, /datum/gas/carbon_dioxide)
|
||||
// Heal mob if not in crit.
|
||||
if(breather.health >= breather.crit_threshold && breather.oxyloss)
|
||||
breather.adjustOxyLoss(-5)
|
||||
breather.adjust_oxy_loss(-5)
|
||||
|
||||
/// Maximum CO2 effects. "Too much CO2!"
|
||||
/obj/item/organ/lungs/proc/too_much_co2(mob/living/carbon/breather, datum/gas_mixture/breath, co2_pp, old_co2_pp)
|
||||
@@ -364,7 +364,7 @@
|
||||
breathe_gas_volume(breath, /datum/gas/plasma, /datum/gas/carbon_dioxide)
|
||||
// Heal mob if not in crit.
|
||||
if(breather.health >= breather.crit_threshold && breather.oxyloss)
|
||||
breather.adjustOxyLoss(-5)
|
||||
breather.adjust_oxy_loss(-5)
|
||||
|
||||
/// Maximum Plasma effects. "Too much Plasma!"
|
||||
/obj/item/organ/lungs/proc/too_much_plasma(mob/living/carbon/breather, datum/gas_mixture/breath, plasma_pp, old_plasma_pp)
|
||||
@@ -390,7 +390,7 @@
|
||||
if(bz_pp > BZ_trip_balls_min)
|
||||
breather.reagents.add_reagent(/datum/reagent/bz_metabolites, clamp(bz_pp, 1, 5))
|
||||
if(bz_pp > BZ_brain_damage_min && prob(33))
|
||||
breather.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3, 150, ORGAN_ORGANIC)
|
||||
breather.adjust_organ_loss(ORGAN_SLOT_BRAIN, 3, 150, ORGAN_ORGANIC)
|
||||
|
||||
/// Breathing in refridgerator coolent, shit's caustic
|
||||
/obj/item/organ/lungs/proc/too_much_freon(mob/living/carbon/breather, datum/gas_mixture/breath, freon_pp, old_freon_pp)
|
||||
@@ -402,12 +402,12 @@
|
||||
to_chat(breather, span_alert("Your mouth feels like it's burning!"))
|
||||
if (freon_pp > 40)
|
||||
breather.emote("gasp")
|
||||
breather.adjustFireLoss(15)
|
||||
breather.adjust_fire_loss(15)
|
||||
if (prob(freon_pp / 2))
|
||||
to_chat(breather, span_alert("Your throat closes up!"))
|
||||
breather.set_silence_if_lower(6 SECONDS)
|
||||
else
|
||||
breather.adjustFireLoss(freon_pp / 4)
|
||||
breather.adjust_fire_loss(freon_pp / 4)
|
||||
|
||||
/// Breathing in halon, convert it to a reagent
|
||||
/obj/item/organ/lungs/proc/too_much_halon(mob/living/carbon/breather, datum/gas_mixture/breath, halon_pp, old_halon_pp)
|
||||
@@ -415,7 +415,7 @@
|
||||
breathe_gas_volume(breath, /datum/gas/halon)
|
||||
// Metabolize to reagent.
|
||||
if(halon_pp > gas_stimulation_min)
|
||||
breather.adjustOxyLoss(5)
|
||||
breather.adjust_oxy_loss(5)
|
||||
breather.reagents.add_reagent(/datum/reagent/halon, max(0, 1 - breather.reagents.get_reagent_amount(/datum/reagent/halon)))
|
||||
|
||||
/// Sleeping gas with healing properties.
|
||||
@@ -555,7 +555,7 @@
|
||||
// Random chance to inflict side effects increases with pressure.
|
||||
if((prob(nitrium_pp) && (nitrium_pp > 15)))
|
||||
// Nitrium side-effect.
|
||||
breather.adjustOrganLoss(ORGAN_SLOT_LUNGS, nitrium_pp * 0.1)
|
||||
breather.adjust_organ_loss(ORGAN_SLOT_LUNGS, nitrium_pp * 0.1)
|
||||
to_chat(breather, span_notice("You feel a burning sensation in your chest"))
|
||||
// Metabolize to reagents.
|
||||
if (nitrium_pp > 5)
|
||||
@@ -572,7 +572,7 @@
|
||||
// Tritium side-effects.
|
||||
if(gas_breathed > moles_visible)
|
||||
var/ratio = gas_breathed * 15
|
||||
breather.adjustToxLoss(clamp(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE))
|
||||
breather.adjust_tox_loss(clamp(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE))
|
||||
// If you're breathing in half an atmosphere of radioactive gas, you fucked up.
|
||||
if((trit_pp > tritium_irradiation_moles_min) && SSradiation.can_irradiate_basic(breather))
|
||||
var/lerp_scale = min(tritium_irradiation_moles_max, trit_pp - tritium_irradiation_moles_min) / (tritium_irradiation_moles_max - tritium_irradiation_moles_min)
|
||||
@@ -629,7 +629,7 @@
|
||||
breather.failed_last_breath = FALSE
|
||||
// Vacuum-adapted lungs regenerate oxyloss even when breathing nothing.
|
||||
if(breather.health >= breather.crit_threshold && breather.oxyloss)
|
||||
breather.adjustOxyLoss(-5)
|
||||
breather.adjust_oxy_loss(-5)
|
||||
else
|
||||
// Can't breathe!
|
||||
breather.failed_last_breath = TRUE
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
if(bodypart_to_attach.check_for_frankenstein(target))
|
||||
bodypart_to_attach.bodypart_flags |= BODYPART_IMPLANTED
|
||||
if(organ_rejection_dam)
|
||||
target.adjustToxLoss(organ_rejection_dam)
|
||||
target.adjust_tox_loss(organ_rejection_dam)
|
||||
display_results(
|
||||
user, target,
|
||||
span_notice("You succeed in replacing [target]'s [target.parse_zone_with_bodypart(target_zone)]."),
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
span_notice("[user] send a powerful shock to [target]'s brain with [tool]..."),
|
||||
)
|
||||
target.grab_ghost()
|
||||
target.adjustOxyLoss(-50)
|
||||
target.adjust_oxy_loss(-50)
|
||||
if(iscarbon(target))
|
||||
var/mob/living/carbon/carbon_target = target
|
||||
carbon_target.set_heartattack(FALSE)
|
||||
@@ -154,8 +154,8 @@
|
||||
|
||||
/datum/surgery_step/revive/carbon/on_revived(mob/surgeon, mob/living/patient)
|
||||
. = ..()
|
||||
patient.adjustOrganLoss(ORGAN_SLOT_BRAIN, 50, 199) // MAD SCIENCE
|
||||
patient.adjust_organ_loss(ORGAN_SLOT_BRAIN, 50, 199) // MAD SCIENCE
|
||||
|
||||
/datum/surgery_step/revive/carbon/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
. = ..()
|
||||
target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 15, 180)
|
||||
target.adjust_organ_loss(ORGAN_SLOT_BRAIN, 15, 180)
|
||||
|
||||
@@ -71,5 +71,5 @@
|
||||
span_warning("[user] screws up, brusing [target_human]'s chest!"),
|
||||
span_warning("[user] screws up!"),
|
||||
)
|
||||
target_human.adjustOrganLoss(ORGAN_SLOT_STOMACH, 5)
|
||||
target_human.adjustBruteLoss(5)
|
||||
target_human.adjust_organ_loss(ORGAN_SLOT_STOMACH, 5)
|
||||
target_human.adjust_brute_loss(5)
|
||||
|
||||
Reference in New Issue
Block a user