-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Alien and Cortical Borer hide fix part 2 (#2314)
* 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
Showing
2 changed files
with
17 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 8 additions & 9 deletions
17
monkestation/code/modules/antagonists/borers/code/abilities/toggle_stealth.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
|