From cc8bf189afe65a6b618f61948ddc56c2082e5ed2 Mon Sep 17 00:00:00 2001 From: KasparoVy Date: Tue, 13 Mar 2018 23:27:48 -0400 Subject: [PATCH 1/3] Fixes Teshari Hiding Resolves a verb definition conflict and thus gives Teshari the correct hiding behaviours. --- .../mob/living/carbon/human/species/station/station_vr.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/species/station/station_vr.dm b/code/modules/mob/living/carbon/human/species/station/station_vr.dm index e9041e34daa..8674536b6dd 100644 --- a/code/modules/mob/living/carbon/human/species/station/station_vr.dm +++ b/code/modules/mob/living/carbon/human/species/station/station_vr.dm @@ -339,7 +339,7 @@ inherent_verbs = list( /mob/living/carbon/human/proc/sonar_ping, - /mob/living/proc/hide, + /mob/living/carbon/human/proc/hide_humanoid, /mob/living/proc/shred_limb, /mob/living/proc/toggle_pass_table ) From ac837cdc2fce90a41e96c1b42120ff04d886326e Mon Sep 17 00:00:00 2001 From: KasparoVy Date: Tue, 13 Mar 2018 23:29:16 -0400 Subject: [PATCH 2/3] Cleans up Humanoid Hiding Refactors humanoid hiding to use `status_flags` and a define rather than a snowflake variable. Swaps a magic number for a define. Amends the humanoid hiding eligibility check. --- code/__defines/mobs.dm | 1 + code/modules/mob/living/carbon/human/human.dm | 5 ++--- .../mob/living/carbon/human/human_powers.dm | 16 ++++++++-------- code/modules/mob/living/living_powers.dm | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/code/__defines/mobs.dm b/code/__defines/mobs.dm index cd0f68725ae..9343a4590ff 100644 --- a/code/__defines/mobs.dm +++ b/code/__defines/mobs.dm @@ -9,6 +9,7 @@ #define CANPARALYSE 0x4 #define CANPUSH 0x8 #define LEAPING 0x10 +#define HIDING 0x20 #define PASSEMOTES 0x32 // Mob has a cortical borer or holders inside of it that need to see emotes. #define GODMODE 0x1000 #define FAKEDEATH 0x2000 // Replaces stuff like changeling.changeling_fakedeath. diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index d31754bdf0b..f0b406971c6 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -17,7 +17,6 @@ var/last_spit = 0 //Timestamp. var/can_defib = 1 //Horrible damage (like beheadings) will prevent defibbing organics. - var/hiding = 0 // If the mob is hiding or not. Makes them appear under tables and the like. var/active_regen = FALSE //Used for the regenerate proc in human_powers.dm var/active_regen_delay = 300 @@ -1578,9 +1577,9 @@ equip_to_appropriate_slot(permit) // If for some reason it can't find room, it'll still be on the floor. /mob/living/carbon/human/proc/update_icon_special() //For things such as teshari hiding and whatnot. - if(hiding) // Hiding? Carry on. + if(status_flags & HIDING) // Hiding? Carry on. if(stat == DEAD || paralysis || weakened || stunned) //stunned/knocked down by something that isn't the rest verb? Note: This was tried with INCAPACITATION_STUNNED, but that refused to work. - hiding = FALSE //No hiding for you. Mob layer should be updated naturally, but it actually doesn't. + status_flags &= ~HIDING //No hiding for you. Mob layer should be updated naturally, but it actually isn't. else layer = HIDING_LAYER diff --git a/code/modules/mob/living/carbon/human/human_powers.dm b/code/modules/mob/living/carbon/human/human_powers.dm index 630c3658a8b..f4a45746a42 100644 --- a/code/modules/mob/living/carbon/human/human_powers.dm +++ b/code/modules/mob/living/carbon/human/human_powers.dm @@ -282,17 +282,17 @@ /mob/living/carbon/human/proc/hide_humanoid() set name = "Hide" - set desc = "Allows to hide beneath tables or certain items. Toggled on or off." + set desc = "Allows you to hide beneath tables or certain items. Toggled on or off." set category = "Abilities" - if(stat == DEAD || paralysis || weakened || stunned) // No hiding if you're stunned! + if(stat == DEAD || paralysis || weakened || stunned || restrained()) // No hiding if you're stunned! return - if (!hiding) - layer = 2.45 //Just above cables with their 2.44 - hiding = 1 - to_chat(src, "You are now hiding.") - else + if(status_flags & HIDING) layer = MOB_LAYER - hiding = 0 to_chat(src, "You have stopped hiding.") + else + layer = HIDING_LAYER //Just above cables with their 2.44 + to_chat(src, "You are now hiding.") + + status_flags ^= HIDING diff --git a/code/modules/mob/living/living_powers.dm b/code/modules/mob/living/living_powers.dm index a9bb916413f..40bdcb55904 100644 --- a/code/modules/mob/living/living_powers.dm +++ b/code/modules/mob/living/living_powers.dm @@ -6,9 +6,9 @@ if(stat == DEAD || paralysis || weakened || stunned || restrained()) return - if (layer != 2.45) - layer = 2.45 //Just above cables with their 2.44 + if(layer != HIDING_LAYER) + layer = HIDING_LAYER //Just above cables with their 2.44 src << text("You are now hiding.") else layer = MOB_LAYER - src << text("You have stopped hiding.") \ No newline at end of file + src << text("You have stopped hiding.") From 5f6db366b6f770f64011addc1cb56ac204207ec2 Mon Sep 17 00:00:00 2001 From: KasparoVy Date: Wed, 14 Mar 2018 19:37:21 -0400 Subject: [PATCH 3/3] Revises living_powers.dm Hide Logic Now matches the proc in human_powers. --- code/modules/mob/living/living_powers.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/living_powers.dm b/code/modules/mob/living/living_powers.dm index 40bdcb55904..d2c2d72e4e8 100644 --- a/code/modules/mob/living/living_powers.dm +++ b/code/modules/mob/living/living_powers.dm @@ -6,9 +6,9 @@ if(stat == DEAD || paralysis || weakened || stunned || restrained()) return - if(layer != HIDING_LAYER) - layer = HIDING_LAYER //Just above cables with their 2.44 - src << text("You are now hiding.") - else + if(layer == HIDING_LAYER) layer = MOB_LAYER src << text("You have stopped hiding.") + else + layer = HIDING_LAYER //Just above cables with their 2.44 + src << text("You are now hiding.")