Mesons no longer show turfs on lavaland, but miners no longer need mesons to see minerals scanned by a mineral scanner through walls

This commit is contained in:
CitadelStationBot
2017-05-22 22:21:20 -05:00
parent 3cf30f3a6b
commit 6b4b6ee70d
11 changed files with 112 additions and 124 deletions
+29 -16
View File
@@ -7,25 +7,34 @@
actions_types = list(/datum/action/item_action/toggle_mode)
origin_tech = "materials=3;magnets=3;engineering=3;plasmatech=3"
var/mode = 0 //0 - regular mesons mode 1 - t-ray mode
mode = FALSE //FALSE - regular mesons mode TRUE - t-ray mode
var/range = 1
/obj/item/clothing/glasses/meson/engine/attack_self(mob/user)
/obj/item/clothing/glasses/meson/engine/toggle_mode(mob/user, voluntary)
var/turf/T = get_turf(src)
if(T && T.z == ZLEVEL_MINING && mode)
if(picked_excuse)
to_chat(user, "<span class='warning'>Due to [picked_excuse], the [name] cannot currently be swapped to \[Meson] mode.</span>")
return
mode = !mode
if(mode)
START_PROCESSING(SSobj, src)
vision_flags = 0
darkness_view = 2
invis_view = SEE_INVISIBLE_LIVING
lighting_alpha = null
to_chat(user, "<span class='notice'>You toggle the goggles' scanning mode to \[T-Ray].</span>")
if(voluntary)
to_chat(user, "<span class='notice'>You toggle the goggles' scanning mode to \[T-Ray].</span>")
else
to_chat(user, "<span class='warning'>The goggles abruptly toggle to \[T-Ray] mode!</span>")
else
STOP_PROCESSING(SSobj, src)
vision_flags = SEE_TURFS
darkness_view = 1
lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE
to_chat(loc, "<span class='notice'>You toggle the goggles' scanning mode to \[Meson].</span>")
if(voluntary)
to_chat(user, "<span class='notice'>You toggle the goggles' scanning mode to \[Meson].</span>")
else
to_chat(user, "<span class='warning'>The goggles abruptly toggle to \[Meson] mode!</span>")
if(ishuman(user))
var/mob/living/carbon/human/H = user
@@ -37,8 +46,14 @@
var/datum/action/A = X
A.UpdateButtonIcon()
/obj/item/clothing/glasses/meson/engine/attack_self(mob/user)
toggle_mode(user, TRUE)
/obj/item/clothing/glasses/meson/engine/process()
if(!mode)
var/turf/T = get_turf(src)
if(T && T.z == ZLEVEL_MINING)
toggle_mode(loc)
return
if(!ishuman(loc))
@@ -47,7 +62,6 @@
var/mob/living/carbon/human/user = loc
if(user.glasses != src)
return
scan()
/obj/item/clothing/glasses/meson/engine/proc/scan()
@@ -89,13 +103,17 @@
icon_state = "trayson-tray_off"
origin_tech = "materials=3;magnets=2;engineering=2"
mode = 1
var/on = 0
mode = TRUE
var/on = FALSE
vision_flags = 0
darkness_view = 2
invis_view = SEE_INVISIBLE_LIVING
range = 2
/obj/item/clothing/glasses/meson/engine/tray/Initialize()
. = ..()
picked_excuse = null
/obj/item/clothing/glasses/meson/engine/tray/process()
if(!on)
return
@@ -108,15 +126,10 @@
if(user.glasses == src)
user.update_inv_glasses()
/obj/item/clothing/glasses/meson/engine/tray/attack_self(mob/user)
/obj/item/clothing/glasses/meson/engine/tray/toggle_mode(mob/user, voluntary)
on = !on
if(on)
START_PROCESSING(SSobj, src)
to_chat(user, "<span class='notice'>You turn the goggles on.</span>")
else
STOP_PROCESSING(SSobj, src)
to_chat(user, "<span class='notice'>You turn the goggles off.</span>")
to_chat(user, "<span class='[voluntary ? "notice":"warning"]'>[voluntary ? "You turn the goggles":"The goggles turn"] [on ? "on":"off"][voluntary ? ".":"!"]</span>")
update_icon()
for(var/X in actions)
+49 -3
View File
@@ -31,14 +31,60 @@
/obj/item/clothing/glasses/meson
name = "Optical Meson Scanner"
desc = "Used by engineering and mining staff to see basic structural and terrain layouts through walls, regardless of lighting condition."
desc = "Used by engineering and mining staff to see basic structural and terrain layouts through walls, regardless of lighting conditions."
icon_state = "meson"
item_state = "meson"
origin_tech = "magnets=1;engineering=2"
darkness_view = 2
vision_flags = SEE_TURFS
lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
glass_colour_type = /datum/client_colour/glass_colour/lightgreen
var/static/list/meson_mining_failure_excuses = list("seismic activity", "excessive lava", "ambient radiation", "electromagnetic storms", "bluespace disruption", \
"gravity", "dust", "dense rock", "ash", "badly understood science", "radiant heat")
var/picked_excuse
var/mode = FALSE //if FALSE, is in normal meson mode.
/obj/item/clothing/glasses/meson/Initialize()
. = ..()
picked_excuse = pick(meson_mining_failure_excuses)
START_PROCESSING(SSobj, src)
/obj/item/clothing/glasses/meson/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/clothing/glasses/meson/examine(mob/user)
..()
var/turf/T = get_turf(src)
if(T && T.z == ZLEVEL_MINING && mode && picked_excuse)
to_chat(user, "<span class='warning'>Due to [picked_excuse], these Meson Scanners will not be able to display terrain layouts in this area.</span>")
/obj/item/clothing/glasses/meson/proc/toggle_mode(mob/user)
if(vision_flags & SEE_TURFS)
mode = TRUE
vision_flags &= ~SEE_TURFS
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(picked_excuse)
to_chat(H, "<span class='warning'>Due to [picked_excuse], your Meson Scanners will not be able to display terrain layouts in this area.</span>")
if(H.glasses == src)
H.update_sight()
else if(!(vision_flags & SEE_TURFS))
mode = FALSE
vision_flags |= SEE_TURFS
if(ishuman(user))
var/mob/living/carbon/human/H = user
to_chat(H, "<span class='notice'>Your Meson Scanners have reactivated.</span>")
if(H.glasses == src)
H.update_sight()
/obj/item/clothing/glasses/meson/process()
var/turf/T = get_turf(src)
if(T && T.z == ZLEVEL_MINING)
if(!mode)
toggle_mode(loc)
else if(mode)
toggle_mode(loc)
/obj/item/clothing/glasses/meson/night
name = "Night Vision Optical Meson Scanner"
@@ -47,7 +93,7 @@
item_state = "nvgmeson"
origin_tech = "magnets=4;engineering=5;plasmatech=4"
darkness_view = 8
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
glass_colour_type = /datum/client_colour/glass_colour/green
/obj/item/clothing/glasses/meson/gar