Skip to content

Commit

Permalink
[MIRROR] Golems cannot turn into Plasmamen [MDB IGNORE] (#765)
Browse files Browse the repository at this point in the history
* Golems cannot turn into Plasmamen

* Diffs

---------

Co-authored-by: SkyratBot <[email protected]>
Co-authored-by: Jacquerel <[email protected]>
Co-authored-by: Giz <[email protected]>
Co-authored-by: Iajret <[email protected]>
  • Loading branch information
5 people authored Nov 23, 2023
1 parent e3744ec commit 9d0cae5
Show file tree
Hide file tree
Showing 18 changed files with 104 additions and 55 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/surgery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
#define BODYPART_PSEUDOPART (1<<1)
/// Bodypart did not match the owner's default bodypart limb_id when surgically implanted
#define BODYPART_IMPLANTED (1<<2)
/// Bodypart never displays as a husk
#define BODYPART_UNHUSKABLE (1<<3)

// Bodypart change blocking flags
///Bodypart does not get replaced during set_species()
Expand Down
5 changes: 5 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_NUKEIMMUNE "nuke_immunity"
/// Can't be given viruses
#define TRAIT_VIRUSIMMUNE "virus_immunity"
/// Won't become a husk under any circumstances
#define TRAIT_UNHUSKABLE "trait_unhuskable"
/// Reduces the chance viruses will spread to this mob, and if the mob has a virus, slows its advancement
#define TRAIT_VIRUS_RESISTANCE "virus_resistance"
#define TRAIT_GENELESS "geneless"
Expand Down Expand Up @@ -536,6 +538,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
/// Disables the floating animation. See above.
#define TRAIT_NO_FLOATING_ANIM "no-floating-animation"

/// Cannot be turned into a funny skeleton by the plasma river
#define TRAIT_NO_PLASMA_TRANSFORM "no_plasma_transform"

/// Weather immunities, also protect mobs inside them.
#define TRAIT_LAVA_IMMUNE "lava_immune" //Used by lava turfs and The Floor Is Lava.
#define TRAIT_ASHSTORM_IMMUNE "ashstorm_immune"
Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_NO_DNA_SCRAMBLE" = TRAIT_NO_DNA_SCRAMBLE,
"TRAIT_NO_FLOATING_ANIM" = TRAIT_NO_FLOATING_ANIM,
"TRAIT_NO_GLIDE" = TRAIT_NO_GLIDE,
"TRAIT_NO_PLASMA_TRANSFORM" = TRAIT_NO_PLASMA_TRANSFORM,
"TRAIT_NO_GUN_AKIMBO" = TRAIT_NO_GUN_AKIMBO,
"TRAIT_NO_IMMOBILIZE" = TRAIT_NO_IMMOBILIZE,
"TRAIT_NO_JUMPSUIT" = TRAIT_NO_JUMPSUIT,
Expand Down Expand Up @@ -422,6 +423,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_UNBREAKABLE" = TRAIT_UNBREAKABLE,
"TRAIT_UNDENSE" = TRAIT_UNDENSE,
"TRAIT_UNDERWATER_BASKETWEAVING_KNOWLEDGE" = TRAIT_UNDERWATER_BASKETWEAVING_KNOWLEDGE,
"TRAIT_UNHUSKABLE" = TRAIT_UNHUSKABLE,
"TRAIT_UNINTELLIGIBLE_SPEECH" = TRAIT_UNINTELLIGIBLE_SPEECH,
"TRAIT_UNKNOWN" = TRAIT_UNKNOWN,
"TRAIT_UNNATURAL_RED_GLOWY_EYES" = TRAIT_UNNATURAL_RED_GLOWY_EYES,
Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/traits/admin_tooling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list(
"TRAIT_NO_BLOOD_OVERLAY" = TRAIT_NO_BLOOD_OVERLAY,
"TRAIT_NO_DNA_COPY" = TRAIT_NO_DNA_COPY,
"TRAIT_NO_GLIDE" = TRAIT_NO_GLIDE,
"TRAIT_NO_PLASMA_TRANSFORM" = TRAIT_NO_PLASMA_TRANSFORM,
"TRAIT_NO_SLIP_ALL" = TRAIT_NO_SLIP_ALL,
"TRAIT_NO_SLIP_ICE" = TRAIT_NO_SLIP_ICE,
"TRAIT_NO_SLIP_SLIDE" = TRAIT_NO_SLIP_SLIDE,
Expand Down Expand Up @@ -214,6 +215,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list(
"TRAIT_UI_BLOCKED" = TRAIT_UI_BLOCKED,
"TRAIT_UNDENSE" = TRAIT_UNDENSE,
"TRAIT_UNDERWATER_BASKETWEAVING_KNOWLEDGE" = TRAIT_UNDERWATER_BASKETWEAVING_KNOWLEDGE,
"TRAIT_UNHUSKABLE" = TRAIT_UNHUSKABLE,
"TRAIT_UNINTELLIGIBLE_SPEECH" = TRAIT_UNINTELLIGIBLE_SPEECH,
"TRAIT_UNKNOWN" = TRAIT_UNKNOWN,
"TRAIT_UNNATURAL_RED_GLOWY_EYES" = TRAIT_UNNATURAL_RED_GLOWY_EYES,
Expand Down
67 changes: 37 additions & 30 deletions code/game/turfs/open/lava.dm
Original file line number Diff line number Diff line change
Expand Up @@ -368,37 +368,40 @@

/turf/open/lava/plasma/do_burn(atom/movable/burn_target, seconds_per_tick = 1)
. = TRUE
if(isobj(burn_target))
return FALSE // Does nothing against objects. Old code.
if(!isliving(burn_target))
return FALSE

var/mob/living/burn_living = burn_target
burn_living.adjustFireLoss(2)
if(QDELETED(burn_living))
return
burn_living.adjust_fire_stacks(20) //dipping into a stream of plasma would probably make you more flammable than usual
burn_living.adjust_bodytemperature(-rand(50,65)) //its cold, man
if(!ishuman(burn_living) || SPT_PROB(65, seconds_per_tick))
var/need_mob_update
// This is from plasma, so it should obey plasma biotype requirements
need_mob_update += burn_living.adjustToxLoss(15, updating_health = FALSE, required_biotype = MOB_ORGANIC)
need_mob_update += burn_living.adjustFireLoss(25, updating_health = FALSE)
if(need_mob_update)
burn_living.updatehealth()

if(QDELETED(burn_living) \
|| !ishuman(burn_living) \
|| HAS_TRAIT(burn_living, TRAIT_NODISMEMBER) \
|| HAS_TRAIT(burn_living, TRAIT_NO_PLASMA_TRANSFORM) \
|| SPT_PROB(65, seconds_per_tick) \
)
return

var/mob/living/carbon/human/burn_human = burn_living
var/datum/species/burn_species = burn_human.dna.species
if(istype(burn_species, /datum/species/plasmaman) || istype(burn_species, /datum/species/android)) //ignore plasmamen/robotic species
return

var/list/plasma_parts = list()//a list of the organic parts to be turned into plasma limbs
var/list/robo_parts = list()//keep a reference of robotic parts so we know if we can turn them into a plasmaman
var/list/immune_parts = list() // Parts we can't transform because they're not organic or can't be dismembered
var/list/transform_parts = list() // Parts we want to transform

for(var/obj/item/bodypart/burn_limb as anything in burn_human.bodyparts)
if(IS_ORGANIC_LIMB(burn_limb) && burn_limb.limb_id != SPECIES_PLASMAMAN) //getting every organic, non-plasmaman limb (augments/androids are immune to this)
plasma_parts += burn_limb
if(IS_ROBOTIC_LIMB(burn_limb))
robo_parts += burn_limb
if(!IS_ORGANIC_LIMB(burn_limb) || !burn_limb.can_dismember())
immune_parts += burn_limb
continue
if(burn_limb.limb_id == SPECIES_PLASMAMAN)
continue
transform_parts += burn_limb

var/need_mob_update
need_mob_update += burn_human.adjustToxLoss(15, updating_health = FALSE, required_biotype = MOB_ORGANIC) // This is from plasma, so it should obey plasma biotype requirements
need_mob_update += burn_human.adjustFireLoss(25, updating_health = FALSE)
if(need_mob_update)
burn_human.updatehealth()
if(plasma_parts.len)
var/obj/item/bodypart/burn_limb = pick(plasma_parts) //using the above-mentioned list to get a choice of limbs
if(length(transform_parts))
var/obj/item/bodypart/burn_limb = pick_n_take(transform_parts)
burn_human.emote("scream")
var/obj/item/bodypart/plasmalimb
switch(burn_limb.body_zone) //get plasmaman limb to swap in
Expand All @@ -414,16 +417,20 @@
plasmalimb = new /obj/item/bodypart/chest/plasmaman
if(BODY_ZONE_HEAD)
plasmalimb = new /obj/item/bodypart/head/plasmaman

burn_human.del_and_replace_bodypart(plasmalimb)
burn_human.update_body_parts()
burn_human.emote("scream")
burn_human.visible_message(span_warning("[burn_human]'s [burn_limb.plaintext_zone] melts down to the bone!"), \
span_userdanger("You scream out in pain as your [burn_limb.plaintext_zone] 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
burn_human.ignite_mob()
burn_human.set_species(/datum/species/plasmaman)
burn_human.visible_message(span_warning("[burn_human] bursts into a brilliant purple flame as [burn_human.p_their()] entire body is that of a skeleton!"), \
span_userdanger("Your senses numb as all of your remaining flesh is turned into a purple slurry, sloshing off your body and leaving only your bones to show in a vibrant purple!"))
span_userdanger("You scream out in pain as your [burn_limb.plaintext_zone] melts down to the bone, held together only by strands of purple fungus!"))

// If all of your limbs are plasma then congrats: you are plasma man
if(length(immune_parts) || length(transform_parts))
return
burn_human.ignite_mob()
burn_human.set_species(/datum/species/plasmaman)
burn_human.visible_message(span_warning("[burn_human] bursts into flame as the last of [burn_human.p_their()] body is coated in fungus!"), \
span_userdanger("Your senses numb as what remains of your flesh sloughs off, revealing the plasma-encrusted bone beneath!"))

//mafia specific tame happy plasma (normal atmos, no slowdown)
/turf/open/lava/plasma/mafia
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/basic/lavaland/legion/legion_brood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,9 @@
icon_living = "snowlegion_head"
icon_dead = "snowlegion_head"

/mob/living/basic/legion_brood/snow/Initialize(mapload)
. = ..()
ADD_TRAIT(src, TRAIT_SNOWSTORM_IMMUNE, INNATE_TRAIT)

/mob/living/basic/legion_brood/snow/get_legion_type(mob/living/target)
return /mob/living/basic/mining/legion/snow
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

/mob/living/basic/mining/lobstrosity/Initialize(mapload)
. = ..()
ADD_TRAIT(src, TRAIT_SNOWSTORM_IMMUNE, INNATE_TRAIT)
AddElement(/datum/element/mob_grabber)
AddElement(/datum/element/footstep, FOOTSTEP_MOB_CLAW)
AddElement(/datum/element/basic_eating, food_types = target_foods)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/basic/lavaland/mining.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

/mob/living/basic/mining/Initialize(mapload)
. = ..()
add_traits(list(TRAIT_LAVA_IMMUNE, TRAIT_ASHSTORM_IMMUNE), INNATE_TRAIT)
add_traits(list(TRAIT_LAVA_IMMUNE, TRAIT_ASHSTORM_IMMUNE, TRAIT_SNOWSTORM_IMMUNE), INNATE_TRAIT)
AddElement(/datum/element/mob_killed_tally, "mobs_killed_mining")
var/static/list/vulnerable_projectiles
if(!vulnerable_projectiles)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
TRAIT_NOBLOOD,
TRAIT_NOBREATH,
TRAIT_NOCLONELOSS,
TRAIT_NOCRITDAMAGE,
TRAIT_NOFIRE,
TRAIT_NOHUNGER,
TRAIT_NO_DNA_COPY,
TRAIT_NO_PLASMA_TRANSFORM,
TRAIT_NO_UNDERWEAR,
TRAIT_PIERCEIMMUNE,
TRAIT_RADIMMUNE,
Expand All @@ -20,7 +22,6 @@
TRAIT_RESISTHIGHPRESSURE,
TRAIT_RESISTLOWPRESSURE,
TRAIT_TOXIMMUNE,
TRAIT_NOCRITDAMAGE,
)

inherent_biotypes = MOB_ROBOTIC|MOB_HUMANOID
Expand Down
3 changes: 3 additions & 0 deletions code/modules/mob/living/carbon/human/species_types/golems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
TRAIT_NOFIRE,
TRAIT_NO_AUGMENTS,
TRAIT_NO_DNA_COPY,
TRAIT_NO_PLASMA_TRANSFORM,
TRAIT_NO_UNDERWEAR,
TRAIT_PIERCEIMMUNE,
TRAIT_RADIMMUNE,
TRAIT_SNOWSTORM_IMMUNE, // Shared with plasma river... but I guess if you can survive a plasma river a blizzard isn't a big deal
TRAIT_UNHUSKABLE,
)
mutantheart = null
mutantlungs = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
TRAIT_HARDLY_WOUNDED,
TRAIT_NOBLOOD,
TRAIT_NO_DNA_COPY,
TRAIT_NO_PLASMA_TRANSFORM,
TRAIT_RADIMMUNE,
TRAIT_RESISTCOLD,
TRAIT_UNHUSKABLE,
)


inherent_biotypes = MOB_HUMANOID|MOB_MINERAL
inherent_respiration_type = RESPIRATION_PLASMA
mutantlungs = /obj/item/organ/internal/lungs/plasmaman
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
TRAIT_RESISTHIGHPRESSURE,
TRAIT_RESISTLOWPRESSURE,
TRAIT_TOXIMMUNE,
TRAIT_UNHUSKABLE,
TRAIT_XENO_IMMUNE,
)
inherent_biotypes = MOB_UNDEAD|MOB_HUMANOID
Expand Down
8 changes: 0 additions & 8 deletions code/modules/mob/living/carbon/human/status_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,3 @@
. = ..()
if(.)
update_body_parts()

/mob/living/carbon/human/become_husk(source)
if(istype(dna.species, /datum/species/skeleton)) //skeletons shouldn't be husks.
cure_husk()
return
. = ..()
if(.)
update_body_parts()
30 changes: 20 additions & 10 deletions code/modules/mob/living/status_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -497,18 +497,28 @@

/mob/living/proc/cure_husk(source)
REMOVE_TRAIT(src, TRAIT_HUSK, source)
if(!HAS_TRAIT(src, TRAIT_HUSK))
REMOVE_TRAIT(src, TRAIT_DISFIGURED, "husk")
update_body()
return TRUE
if(HAS_TRAIT(src, TRAIT_HUSK))
return FALSE
REMOVE_TRAIT(src, TRAIT_DISFIGURED, "husk")
update_body()
UnregisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_UNHUSKABLE))
return TRUE

/mob/living/proc/become_husk(source)
if(!HAS_TRAIT(src, TRAIT_HUSK))
ADD_TRAIT(src, TRAIT_HUSK, source)
ADD_TRAIT(src, TRAIT_DISFIGURED, "husk")
update_body()
else
ADD_TRAIT(src, TRAIT_HUSK, source)
if(HAS_TRAIT(src, TRAIT_UNHUSKABLE))
return
var/was_husk = HAS_TRAIT(src, TRAIT_HUSK)
ADD_TRAIT(src, TRAIT_HUSK, source)
if (was_husk)
return
ADD_TRAIT(src, TRAIT_DISFIGURED, "husk")
update_body()
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_UNHUSKABLE), PROC_REF(became_unhuskable))

/// Called when we become unhuskable while already husked
/mob/living/proc/became_unhuskable()
SIGNAL_HANDLER
cure_husk()

/mob/living/proc/cure_fakedeath(source)
remove_traits(list(TRAIT_FAKEDEATH, TRAIT_DEATHCOMA), source)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/surgery/bodyparts/_bodyparts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@
SHOULD_CALL_PARENT(TRUE)

if(IS_ORGANIC_LIMB(src))
if(owner && HAS_TRAIT(owner, TRAIT_HUSK))
if(!(bodypart_flags & BODYPART_UNHUSKABLE) && owner && HAS_TRAIT(owner, TRAIT_HUSK))
dmg_overlay_type = "" //no damage overlay shown when husked
is_husked = TRUE
else if(owner && HAS_TRAIT(owner, TRAIT_INVISIBLE_MAN))
Expand Down
12 changes: 9 additions & 3 deletions code/modules/surgery/bodyparts/robot_bodyparts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

damage_examines = list(BRUTE = ROBOTIC_BRUTE_EXAMINE_TEXT, BURN = ROBOTIC_BURN_EXAMINE_TEXT, CLONE = DEFAULT_CLONE_EXAMINE_TEXT)
disabling_threshold_percentage = 1
bodypart_flags = BODYPART_UNHUSKABLE

/obj/item/bodypart/arm/right/robot
name = "cyborg right arm"
Expand Down Expand Up @@ -75,6 +76,7 @@
biological_state = (BIO_ROBOTIC|BIO_JOINTED)

damage_examines = list(BRUTE = ROBOTIC_BRUTE_EXAMINE_TEXT, BURN = ROBOTIC_BURN_EXAMINE_TEXT, CLONE = DEFAULT_CLONE_EXAMINE_TEXT)
bodypart_flags = BODYPART_UNHUSKABLE

/obj/item/bodypart/leg/left/robot
name = "cyborg left leg"
Expand Down Expand Up @@ -108,6 +110,7 @@
biological_state = (BIO_ROBOTIC|BIO_JOINTED)

damage_examines = list(BRUTE = ROBOTIC_BRUTE_EXAMINE_TEXT, BURN = ROBOTIC_BURN_EXAMINE_TEXT, CLONE = DEFAULT_CLONE_EXAMINE_TEXT)
bodypart_flags = BODYPART_UNHUSKABLE

/obj/item/bodypart/leg/left/robot/emp_act(severity)
. = ..()
Expand Down Expand Up @@ -154,6 +157,7 @@
biological_state = (BIO_ROBOTIC|BIO_JOINTED)

damage_examines = list(BRUTE = ROBOTIC_BRUTE_EXAMINE_TEXT, BURN = ROBOTIC_BURN_EXAMINE_TEXT, CLONE = DEFAULT_CLONE_EXAMINE_TEXT)
bodypart_flags = BODYPART_UNHUSKABLE

/obj/item/bodypart/leg/right/robot/emp_act(severity)
. = ..()
Expand Down Expand Up @@ -197,14 +201,15 @@
biological_state = (BIO_ROBOTIC)

damage_examines = list(BRUTE = ROBOTIC_BRUTE_EXAMINE_TEXT, BURN = ROBOTIC_BURN_EXAMINE_TEXT, CLONE = DEFAULT_CLONE_EXAMINE_TEXT)

var/wired = FALSE
var/obj/item/stock_parts/cell/cell = null
bodypart_flags = BODYPART_UNHUSKABLE

robotic_emp_paralyze_damage_percent_threshold = 0.6

wing_types = list(/obj/item/organ/external/wings/functional/robotic)

var/wired = FALSE
var/obj/item/stock_parts/cell/cell = null

/obj/item/bodypart/chest/robot/emp_act(severity)
. = ..()
if(!. || isnull(owner))
Expand Down Expand Up @@ -376,6 +381,7 @@
damage_examines = list(BRUTE = ROBOTIC_BRUTE_EXAMINE_TEXT, BURN = ROBOTIC_BURN_EXAMINE_TEXT, CLONE = DEFAULT_CLONE_EXAMINE_TEXT)

head_flags = HEAD_EYESPRITES
bodypart_flags = BODYPART_UNHUSKABLE

var/obj/item/assembly/flash/handheld/flash1 = null
var/obj/item/assembly/flash/handheld/flash2 = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,38 +331,44 @@
should_draw_greyscale = FALSE
dmg_overlay_type = null
head_flags = NONE
bodypart_flags = BODYPART_UNHUSKABLE

/obj/item/bodypart/chest/skeleton
biological_state = BIO_BONE
limb_id = SPECIES_SKELETON
is_dimorphic = FALSE
should_draw_greyscale = FALSE
dmg_overlay_type = null
bodypart_flags = BODYPART_UNHUSKABLE
wing_types = list(/obj/item/organ/external/wings/functional/skeleton)

/obj/item/bodypart/arm/left/skeleton
biological_state = (BIO_BONE|BIO_JOINTED)
limb_id = SPECIES_SKELETON
should_draw_greyscale = FALSE
dmg_overlay_type = null
bodypart_flags = BODYPART_UNHUSKABLE

/obj/item/bodypart/arm/right/skeleton
biological_state = (BIO_BONE|BIO_JOINTED)
limb_id = SPECIES_SKELETON
should_draw_greyscale = FALSE
dmg_overlay_type = null
bodypart_flags = BODYPART_UNHUSKABLE

/obj/item/bodypart/leg/left/skeleton
biological_state = (BIO_BONE|BIO_JOINTED)
limb_id = SPECIES_SKELETON
should_draw_greyscale = FALSE
dmg_overlay_type = null
bodypart_flags = BODYPART_UNHUSKABLE

/obj/item/bodypart/leg/right/skeleton
biological_state = (BIO_BONE|BIO_JOINTED)
limb_id = SPECIES_SKELETON
should_draw_greyscale = FALSE
dmg_overlay_type = null
bodypart_flags = BODYPART_UNHUSKABLE

///MUSHROOM
/obj/item/bodypart/head/mushroom
Expand Down
Loading

0 comments on commit 9d0cae5

Please sign in to comment.