Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yautja cloak changes #3757

Merged
merged 7 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions code/__DEFINES/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,18 @@
#define DEFAULT_MESSAGE_RANGE 7

#define BAYONET_DRAW_DELAY (1 SECONDS)

//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
2 changes: 1 addition & 1 deletion code/game/turfs/open.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
41 changes: 14 additions & 27 deletions code/modules/cm_preds/yaut_bracers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,6 @@
var/perc = (charge / charge_max * 100)
human.update_power_display(perc)

//Non-Yautja have a chance to get stunned with each power drain
if(!HAS_TRAIT(human, TRAIT_YAUTJA_TECH) && !human.hunter_data.thralled)
if(prob(15))
if(cloaked)
decloak(human)
cloak_timer = world.time + 5 SECONDS
shock_user(human)
return FALSE

return TRUE

/obj/item/clothing/gloves/yautja/proc/shock_user(mob/living/carbon/human/M)
Expand Down Expand Up @@ -242,7 +233,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!"))
Expand Down Expand Up @@ -282,29 +273,25 @@

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((!HAS_TRAIT(human, TRAIT_YAUTJA_TECH) && !human.hunter_data.thralled) && prob(15))
if(cloaked)
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
Expand Down Expand Up @@ -528,7 +515,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."))
Expand All @@ -553,17 +539,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.")
Expand All @@ -573,7 +560,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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down