From c47ea136a9f62bf31b9d91e659946945bce1e9f7 Mon Sep 17 00:00:00 2001
From: ArcaneDefence <51932756+ArcaneDefence@users.noreply.github.com>
Date: Sat, 20 Feb 2021 00:18:18 -0700
Subject: [PATCH] Fixes plasma lava limb conversion bug (#57031)
---
code/__DEFINES/traits.dm | 2 ++
code/_globalvars/traits.dm | 3 ++-
code/modules/awaymissions/mission_code/snowdin.dm | 7 +++----
code/modules/mob/living/carbon/human/human_update_icons.dm | 2 ++
code/modules/surgery/bodyparts/_bodyparts.dm | 7 +++++++
5 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm
index e6f9f7bc7c3..2e750703a8f 100644
--- a/code/__DEFINES/traits.dm
+++ b/code/__DEFINES/traits.dm
@@ -246,6 +246,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_ANTENNAE "antennae"
/// Blowing kisses actually does damage to the victim
#define TRAIT_KISS_OF_DEATH "kiss_of_death"
+/// Used on limbs in the process of turning a human into a plasmaman while in plasma lava
+#define TRAIT_PLASMABURNT "plasma_burnt"
#define TRAIT_NOBLEED "nobleed" //This carbon doesn't bleed
diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm
index 2d0697ccaeb..7d7b4952cb7 100644
--- a/code/_globalvars/traits.dm
+++ b/code/_globalvars/traits.dm
@@ -162,7 +162,8 @@ GLOBAL_LIST_INIT(traits_by_type, list(
),
/obj/item/bodypart = list(
- "TRAIT_PARALYSIS" = TRAIT_PARALYSIS
+ "TRAIT_PARALYSIS" = TRAIT_PARALYSIS,
+ "TRAIT_PLASMABURNT" = TRAIT_PLASMABURNT
),
/obj/item = list(
"TRAIT_NODROP" = TRAIT_NODROP,
diff --git a/code/modules/awaymissions/mission_code/snowdin.dm b/code/modules/awaymissions/mission_code/snowdin.dm
index 570366b6254..45c506162a7 100644
--- a/code/modules/awaymissions/mission_code/snowdin.dm
+++ b/code/modules/awaymissions/mission_code/snowdin.dm
@@ -231,11 +231,10 @@
PP.adjustToxLoss(15)
PP.adjustFireLoss(25)
if(plasma_parts.len)
- var/obj/item/bodypart/NB = pick(plasma_parts) //using the above-mentioned list to get a choice of limbs for dismember() to use
+ var/obj/item/bodypart/NB = pick(plasma_parts) //using the above-mentioned list to get a choice of limbs
PP.emote("scream")
- NB.species_id = "plasmaman"//change the species_id of the limb to that of a plasmaman
- NB.no_update = TRUE
- NB.change_bodypart_status()
+ ADD_TRAIT(NB, TRAIT_PLASMABURNT, src)
+ PP.update_body_parts()
PP.visible_message("[L] screams in pain as [L.p_their()] [NB] melts down to the bone!", \
"You scream out in pain as your [NB] melts down to the bone, leaving an eerie plasma-like glow where flesh used to be!")
if(!plasma_parts.len && !robo_parts.len) //a person with no potential organic limbs left AND no robotic limbs, time to turn them into a plasmaman
diff --git a/code/modules/mob/living/carbon/human/human_update_icons.dm b/code/modules/mob/living/carbon/human/human_update_icons.dm
index 68287528e3c..69e8b043e66 100644
--- a/code/modules/mob/living/carbon/human/human_update_icons.dm
+++ b/code/modules/mob/living/carbon/human/human_update_icons.dm
@@ -577,6 +577,8 @@ generate/load female uniform sprites matching all previously decided variables
. += "-digitigrade[BP.use_digitigrade]"
if(BP.dmg_overlay_type)
. += "-[BP.dmg_overlay_type]"
+ if(HAS_TRAIT(BP, TRAIT_PLASMABURNT))
+ . += "-plasmaburnt"
if(HAS_TRAIT(src, TRAIT_HUSK))
. += "-husk"
diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm
index 5501d221d70..5d1fb8d72ba 100644
--- a/code/modules/surgery/bodyparts/_bodyparts.dm
+++ b/code/modules/surgery/bodyparts/_bodyparts.dm
@@ -739,6 +739,13 @@
should_draw_greyscale = FALSE
no_update = TRUE
+ if(HAS_TRAIT(src, TRAIT_PLASMABURNT) && is_organic_limb())
+ species_id = "plasmaman"
+ dmg_overlay_type = ""
+ should_draw_gender = FALSE
+ should_draw_greyscale = FALSE
+ no_update = TRUE
+
if(no_update)
return