mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-25 13:09:11 +01:00
More area flag option fixes (#16740)
* some mor fixes on the block flags * . * fix aghosting * . * add privacy switch * . * ignore bellied * . * . * fix it up
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
/obj/structure/privacyswitch
|
||||
name = "privacy switch"
|
||||
desc = "A special switch to increase the room's privavy. (Blocks ghosts from seeing the area)"
|
||||
icon = 'icons/obj/power_vr.dmi'
|
||||
icon_state = "light0"
|
||||
var/nextUse = 0
|
||||
|
||||
/obj/structure/privacyswitch/Initialize()
|
||||
var/area/A = get_area(src)
|
||||
if(A?.flag_check(AREA_BLOCK_GHOST_SIGHT))
|
||||
icon_state = "light1"
|
||||
. = ..()
|
||||
|
||||
/obj/structure/privacyswitch/attack_ai(mob/user)
|
||||
attack_hand()
|
||||
return
|
||||
|
||||
/obj/structure/privacyswitch/attack_hand(mob/user)
|
||||
if(nextUse - world.time > 0)
|
||||
to_chat(user, span_warning("The area can not be altered so soon again!"))
|
||||
return
|
||||
var/area/A = get_area(src)
|
||||
if(!A)
|
||||
return
|
||||
|
||||
if(tgui_alert(user, "Do you want to toggle ghost vision for this area [A.flag_check(AREA_BLOCK_GHOST_SIGHT) ? "on" : "off"]?", "Toggle ghost vision?", list("Yes", "No")) != "Yes")
|
||||
return
|
||||
|
||||
if(A.flag_check(AREA_BLOCK_GHOST_SIGHT))
|
||||
A.flags ^= AREA_BLOCK_GHOST_SIGHT
|
||||
icon_state = "light0"
|
||||
ghostnet.removeArea(A)
|
||||
to_chat(user, span_notice("The area is no longer protected from ghost vison."))
|
||||
log_and_message_admins("toggled ghost vision in [A] on.", user)
|
||||
else
|
||||
A.flags ^= AREA_BLOCK_GHOST_SIGHT
|
||||
icon_state = "light1"
|
||||
ghostnet.addArea(A)
|
||||
to_chat(user, span_notice("The area is now protected from ghost vison."))
|
||||
log_and_message_admins("toggled ghost vision in [A] off.", user)
|
||||
nextUse = world.time + 5 MINUTES
|
||||
Reference in New Issue
Block a user