From 8085d681ff8f9a6cf9bbbb76f0a821b11dcbfb76 Mon Sep 17 00:00:00 2001 From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> Date: Wed, 8 Jun 2022 18:25:27 -0400 Subject: [PATCH] Robotic lungs can now be configured for vox and plasmamen (#17923) * Robotic lungs can now be configured for vox and plasmamen * removes vox_oxygen_bonus variable * Apply suggestions from code review Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> --- code/modules/surgery/organs/lungs.dm | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index 2d2e9a420d7..7c402761d73 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -345,6 +345,38 @@ icon_state = "lungs-c" origin_tech = "biotech=4" status = ORGAN_ROBOT + var/species_state = "human" + +/obj/item/organ/internal/lungs/cybernetic/examine(mob/user) + . = ..() + . += "[src] is configured for [species_state] standards of atmosphere." + +/obj/item/organ/internal/lungs/cybernetic/multitool_act(mob/user, obj/item/I) + . = TRUE + if(!I.use_tool(src, user, 0, volume = I.tool_volume)) + return + switch(species_state) + if("human") // from human to vox + safe_oxygen_min = 0 + safe_oxygen_max = safe_toxins_max + safe_nitro_min = 16 + oxy_damage_type = TOX + to_chat(user, "You configure [src] to replace vox lungs.") + species_state = "vox" + if("vox") // from vox to plasmamen + safe_oxygen_max = initial(safe_oxygen_max) + safe_toxins_min = 16 + safe_toxins_max = 0 + safe_nitro_min = initial(safe_nitro_min) + oxy_damage_type = OXY + to_chat(user, "You configure [src] to replace plasmamen lungs.") + species_state = "plasmamen" + if("plasmamen") // from plasmamen to human + safe_oxygen_min = initial(safe_oxygen_min) + safe_toxins_min = initial(safe_toxins_min) + safe_toxins_max = initial(safe_toxins_max) + to_chat(user, "You configure [src] back to default settings.") + species_state = "human" /obj/item/organ/internal/lungs/cybernetic/upgraded name = "upgraded cybernetic lungs"