From 9482ee8435ee1fb09b8f9cf865874a4738f8db32 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Wed, 28 Jun 2023 16:38:15 +0100 Subject: [PATCH] Yautja cloak changes --- code/__DEFINES/combat.dm | 15 +++++++++ code/game/turfs/open.dm | 2 +- code/modules/cm_preds/yaut_bracers.dm | 33 ++++++++----------- .../abilities/predalien/predalien_powers.dm | 2 +- 4 files changed, 31 insertions(+), 21 deletions(-) diff --git a/code/__DEFINES/combat.dm b/code/__DEFINES/combat.dm index 71c659054952..7dc5a3652dc5 100644 --- a/code/__DEFINES/combat.dm +++ b/code/__DEFINES/combat.dm @@ -18,3 +18,18 @@ //the define for visible message range in combat #define COMBAT_MESSAGE_RANGE 3 #define DEFAULT_MESSAGE_RANGE 7 + +//Predator decloak multpliers based on the standard. +#define DECLOAK_STANDARD 10 SECONDS +/// Forced for any unspecified reason. +#define DECLOAK_FORCED 1 +/// Caused by being worn by non humans. +#define DECLOAK_SPECIES 0.75 +/// Caused by fire extinguisher. +#define DECLOAK_EXTINGUISHER 1.5 +/// Caused by predalien screech. +#define DECLOAK_PREDALIEN 2 +/// Caused by being in a body of water. +#define DECLOAK_SUBMERGED 2 +/// Caused by an EMP. +#define DECLOAK_EMP 3 diff --git a/code/game/turfs/open.dm b/code/game/turfs/open.dm index 3f7192b0090b..41ac80bfdc58 100644 --- a/code/game/turfs/open.dm +++ b/code/game/turfs/open.dm @@ -517,7 +517,7 @@ var/obj/item/clothing/gloves/yautja/hunter/Y = H.gloves if(Y && istype(Y) && Y.cloaked) to_chat(H, SPAN_WARNING(" Your bracers hiss and spark as they short out!")) - Y.decloak(H, TRUE) + Y.decloak(H, TRUE, DECLOAK_SUBMERGED) else if(isxeno(C)) river_slowdown -= 0.7 diff --git a/code/modules/cm_preds/yaut_bracers.dm b/code/modules/cm_preds/yaut_bracers.dm index 1b98ef402b90..41a927c2b8a6 100644 --- a/code/modules/cm_preds/yaut_bracers.dm +++ b/code/modules/cm_preds/yaut_bracers.dm @@ -105,7 +105,7 @@ if(!HAS_TRAIT(human, TRAIT_YAUTJA_TECH) && !human.hunter_data.thralled) if(prob(15)) if(cloaked) - decloak(human) + decloak(human, TRUE, DECLOAK_SPECIES) cloak_timer = world.time + 5 SECONDS shock_user(human) return FALSE @@ -242,7 +242,7 @@ if(wearer.gloves == src) wearer.visible_message(SPAN_DANGER("You hear a hiss and crackle!"), SPAN_DANGER("Your bracers hiss and spark!"), SPAN_DANGER("You hear a hiss and crackle!")) if(cloaked) - decloak(wearer) + decloak(wearer, TRUE, DECLOAK_EMP) else var/turf/our_turf = get_turf(src) our_turf.visible_message(SPAN_DANGER("You hear a hiss and crackle!"), SPAN_DANGER("You hear a hiss and crackle!")) @@ -282,29 +282,24 @@ var/mob/living/carbon/human/human = loc - if(cloaked) - charge = max(charge - 10, 0) - if(charge <= 0) - decloak(loc) - //Non-Yautja have a chance to get stunned with each power drain - if(!isyautja(human)) - if(prob(15)) - decloak(human) - shock_user(human) - return + //Non-Yautja have a chance to get stunned with each power drain + if(cloaked && !isyautja(human)) + if(prob(15)) + decloak(human, TRUE, DECLOAK_SPECIES) + shock_user(human) return ..() /obj/item/clothing/gloves/yautja/hunter/dropped(mob/user) move_chip_to_bracer() if(cloaked) - decloak(user) + decloak(user, TRUE) ..() /obj/item/clothing/gloves/yautja/hunter/on_enter_storage(obj/item/storage/S) if(ishuman(loc)) var/mob/living/carbon/human/human = loc if(cloaked) - decloak(human) + decloak(human, TRUE) . = ..() //We use this to activate random verbs for non-Yautja @@ -532,7 +527,6 @@ if(true_cloak) M.invisibility = INVISIBILITY_LEVEL_ONE M.see_invisible = SEE_INVISIBLE_LEVEL_ONE - new_alpha = 75 log_game("[key_name_admin(usr)] has enabled their cloaking device.") M.visible_message(SPAN_WARNING("[M] vanishes into thin air!"), SPAN_NOTICE("You are now invisible to normal detection.")) @@ -557,17 +551,18 @@ sparks.set_up(5, 4, src) sparks.start() - decloak(wearer, TRUE) + decloak(wearer, TRUE, DECLOAK_EXTINGUISHER) -/obj/item/clothing/gloves/yautja/hunter/decloak(mob/user, forced) +/obj/item/clothing/gloves/yautja/hunter/decloak(mob/user, forced, force_multipler = DECLOAK_FORCED) if(!user) return UnregisterSignal(user, COMSIG_HUMAN_EXTINGUISH) UnregisterSignal(user, COMSIG_HUMAN_PRE_BULLET_ACT) + var/decloak_timer = (DECLOAK_STANDARD * force_multipler) if(forced) - cloak_malfunction = world.time + 10 SECONDS + cloak_malfunction = world.time + decloak_timer cloaked = FALSE log_game("[key_name_admin(usr)] has disabled their cloaking device.") @@ -577,7 +572,7 @@ if(true_cloak) user.invisibility = initial(user.invisibility) user.see_invisible = initial(user.see_invisible) - cloak_timer = world.time + 5 SECONDS + cloak_timer = world.time + (DECLOAK_STANDARD / 2) var/datum/mob_hud/security/advanced/SA = huds[MOB_HUD_SECURITY_ADVANCED] SA.add_to_hud(user) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm index 058e643f5c64..5c1584c565c6 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm @@ -25,7 +25,7 @@ var/obj/item/clothing/gloves/yautja/hunter/YG = locate(/obj/item/clothing/gloves/yautja/hunter) in human if(isyautja(human) && YG) if(YG.cloaked) - YG.decloak(human) + YG.decloak(human, TRUE, DECLOAK_PREDALIEN) YG.cloak_timer = xeno_cooldown * 0.1 else if(isxeno(carbon) && xeno.can_not_harm(carbon))