Skip to content

Commit

Permalink
Yautja cloak changes
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Jun 28, 2023
1 parent 8bfd05b commit 9482ee8
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 21 deletions.
15 changes: 15 additions & 0 deletions code/__DEFINES/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
33 changes: 14 additions & 19 deletions code/modules/cm_preds/yaut_bracers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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!"))
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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."))
Expand All @@ -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.")
Expand All @@ -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)
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

0 comments on commit 9482ee8

Please sign in to comment.