Skip to content

Commit

Permalink
add: Borer sneak mode (ss220-space#4982)
Browse files Browse the repository at this point in the history
* sneak mode

* sneaking check
  • Loading branch information
Antoonij authored Apr 28, 2024
1 parent a93cbe0 commit 206d7f9
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 2 deletions.
2 changes: 1 addition & 1 deletion code/game/data_huds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
holder.icon_state = "huddead"
else if(HAS_TRAIT(src, TRAIT_XENO_HOST))
holder.icon_state = "hudxeno"
else if(B && B.controlling)
else if(B && B.controlling && !B.sneaking)
holder.icon_state = "hudbrainworm"
else if(is_in_crit())
holder.icon_state = "huddefib"
Expand Down
48 changes: 47 additions & 1 deletion code/game/gamemodes/miniantags/borer/borer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
var/docile = FALSE // Sugar can stop borers from acting.
var/bonding = FALSE
var/leaving = FALSE
var/sneaking = FALSE
var/hiding = FALSE
var/datum/action/innate/borer/talk_to_host/talk_to_host_action = new
var/datum/action/innate/borer/toggle_hide/toggle_hide_action = new
Expand All @@ -115,6 +116,7 @@
var/datum/action/innate/borer/make_chems/make_chems_action = new
var/datum/action/innate/borer/make_larvae/make_larvae_action = new
var/datum/action/innate/borer/torment/torment_action = new
var/datum/action/innate/borer/sneak_mode/sneak_mode_action = new

/mob/living/simple_animal/borer/New(atom/newloc, var/gen=1)
..(newloc)
Expand Down Expand Up @@ -280,7 +282,7 @@
to_chat(src, span_notice("Вы приходите в себя, когда сахар покидает кровь вашего носителя."))
docile = FALSE

if(chemicals < max_chems)
if(chemicals < max_chems && !sneaking)
chemicals++
if(controlling)

Expand Down Expand Up @@ -664,6 +666,7 @@
host.verbs += /mob/living/carbon/proc/release_control
host.verbs += /mob/living/carbon/proc/punish_host
host.verbs += /mob/living/carbon/proc/spawn_larvae
host.verbs += /mob/living/carbon/proc/sneak_mode
host.verbs -= /mob/living/proc/borer_comm
host.verbs += /mob/living/proc/trapped_mind_comm

Expand Down Expand Up @@ -739,6 +742,35 @@
to_chat(src, "Вам требуется 100 химикатов для размножения!")
return

/mob/living/carbon/proc/sneak_mode()
set category = "Borer"
set name = "Sneak mode"
set desc = "Hides your status from medical huds."
var/mob/living/simple_animal/borer/B = has_brain_worms()

if(!B)
return

if(B.sneaking)
to_chat(src, span_danger("Вы перестаете скрывать свое присутствие!"))
B.sneaking = FALSE
B.host.med_hud_set_status()
return

if(B.host_brain.ckey)
to_chat(src, span_danger("Душа вашего хозяина не позволяет вам скрыть свое присутствие!"))
return

if(B.chemicals >= 50)
B.sneaking = TRUE
to_chat(src, span_notice("Вы скрываете ваше присутствие внутри хозяина!"))
B.chemicals -= 50
B.host.med_hud_set_status()

else
to_chat(src, "Вам требуется 50 химикатов для сокрытия вашего присутствия!")
return

/mob/living/simple_animal/borer/proc/detach()

if(!host || !controlling)
Expand All @@ -747,10 +779,12 @@
controlling = FALSE
reset_perspective(null)
machine = null
sneaking = FALSE

host.verbs -= /mob/living/carbon/proc/release_control
host.verbs -= /mob/living/carbon/proc/punish_host
host.verbs -= /mob/living/carbon/proc/spawn_larvae
host.verbs -= /mob/living/carbon/proc/sneak_mode
host.verbs += /mob/living/proc/borer_comm
host.verbs -= /mob/living/proc/trapped_mind_comm

Expand Down Expand Up @@ -851,12 +885,14 @@
talk_to_brain_action.Grant(host)
give_back_control_action.Grant(host)
make_larvae_action.Grant(host)
sneak_mode_action.Grant(host)
torment_action.Grant(host)

/mob/living/simple_animal/borer/proc/RemoveControlActions()
talk_to_brain_action.Remove(host)
make_larvae_action.Remove(host)
give_back_control_action.Remove(host)
sneak_mode_action.Remove(host)
torment_action.Remove(host)

/datum/action/innate/borer
Expand Down Expand Up @@ -958,3 +994,13 @@
var/mob/living/simple_animal/borer/B = owner.has_brain_worms()
B.host = owner
B.host.punish_host()

/datum/action/innate/borer/sneak_mode
name = "Sneak mode"
desc = "Hides your status from medical huds."
button_icon_state = "chameleon_skin"

/datum/action/innate/borer/sneak_mode/Activate()
var/mob/living/simple_animal/borer/B = owner.has_brain_worms()
B.host = owner
B.host.sneak_mode()

0 comments on commit 206d7f9

Please sign in to comment.