Skip to content

Commit

Permalink
Alien and Cortical Borer hide fix part 2 (#2314)
Browse files Browse the repository at this point in the history
* Re-addded all edited files to branch

* Fixed Larvae hiding on multi-Z maps

* Fixed Cortical Borers Hiding ability to be independant of Z level plane offset
  • Loading branch information
ThePooba authored Jun 22, 2024
1 parent 644ecaf commit 705159a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
19 changes: 9 additions & 10 deletions code/modules/mob/living/carbon/alien/larva/powers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,28 @@
desc = "Allows you to hide beneath tables and certain objects."
button_icon_state = "alien_hide"
plasma_cost = 0
/// The layer we are on while hiding
var/hide_layer = ABOVE_NORMAL_TURF_LAYER
var/hide_plane = WALL_PLANE
var/hidden = FALSE
//the status of our hide
// var/hide_layer = ABOVE_NORMAL_TURF_LAYER
// var/hide_plane = WALL_PLANE

/datum/action/cooldown/alien/hide/Activate(atom/target)
if(owner.layer == hide_layer)
owner.layer = initial(owner.layer)
owner.plane = initial(owner.plane)
if(hidden == TRUE)
owner.plane += 2
owner.visible_message(
span_notice("[owner] slowly peeks up from the ground..."),
span_noticealien("You stop hiding."),
)

hidden = FALSE
REMOVE_TRAIT(owner, TRAIT_IGNORE_ELEVATION, ACTION_TRAIT)
else
owner.layer = hide_layer
owner.plane = hide_plane
owner.plane -= 2
owner.visible_message(
span_name("[owner] scurries to the ground!"),
span_noticealien("You are now hiding."),
)
ADD_TRAIT(owner, TRAIT_IGNORE_ELEVATION, ACTION_TRAIT)

hidden = TRUE
return TRUE

/datum/action/cooldown/alien/larva_evolve
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
/datum/action/cooldown/borer/toggle_hiding
name = "Toggle Hiding"
button_icon_state = "hide"
var/hide_layer = ABOVE_NORMAL_TURF_LAYER
var/hide_plane = WALL_PLANE
var/hidden = FALSE
ability_explanation = "\
Turns your hiding abilities on/off\n\
Whilst on, you will hide under most objects, like tables.\n\
If you are a diveworm, you will bore into hosts twice as fast whilst not hidden\n\
"
// WALL_PLANE lets the borer hide under tables
// -2 plane to make the borer move into or out of the WALL_PLANE and its original plane irrespective of level offset
/datum/action/cooldown/borer/toggle_hiding/Trigger(trigger_flags, atom/target)
. = ..()
if(!.)
return FALSE
var/mob/living/basic/cortical_borer/cortical_owner = owner
if(owner.layer != hide_layer)
if(hidden == FALSE)
cortical_owner.upgrade_flags |= BORER_HIDING
owner.balloon_alert(owner, "started hiding")
owner.layer = hide_layer
owner.plane = WALL_PLANE

owner.plane -= 2
hidden = TRUE
ADD_TRAIT(owner, TRAIT_IGNORE_ELEVATION, ACTION_TRAIT)
else
cortical_owner.upgrade_flags &= ~BORER_HIDING
owner.balloon_alert(owner, "stopped hiding")
owner.layer = BELOW_MOB_LAYER
owner.plane = initial(owner.plane)
owner.plane +=2
hidden = FALSE
REMOVE_TRAIT(owner, TRAIT_IGNORE_ELEVATION, ACTION_TRAIT)
StartCooldown()

0 comments on commit 705159a

Please sign in to comment.