Merge pull request #1164 from Citadel-Station-13/upstream-merge-27578

[MIRROR] Renames a var
This commit is contained in:
LetterJay
2017-05-25 09:40:06 -05:00
committed by GitHub
2 changed files with 22 additions and 38 deletions
@@ -7,18 +7,18 @@
actions_types = list(/datum/action/item_action/toggle_mode)
origin_tech = "materials=3;magnets=3;engineering=3;plasmatech=3"
mode = FALSE //FALSE - regular mesons mode TRUE - t-ray mode
mesons_on = TRUE //if set to FALSE, these goggles work as t-ray scanners.
var/range = 1
/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(T && T.z == ZLEVEL_MINING && !mesons_on)
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
mesons_on = !mesons_on
if(mode)
if(!mesons_on)
vision_flags = 0
darkness_view = 2
invis_view = SEE_INVISIBLE_LIVING
@@ -50,7 +50,7 @@
toggle_mode(user, TRUE)
/obj/item/clothing/glasses/meson/engine/process()
if(!mode)
if(mesons_on)
var/turf/T = get_turf(src)
if(T && T.z == ZLEVEL_MINING)
toggle_mode(loc)
@@ -83,15 +83,8 @@
if(M.client)
flick_overlay(I, list(M.client), 8)
/obj/item/clothing/glasses/meson/engine/proc/t_ray_on()
if(!ishuman(loc))
return 0
var/mob/living/carbon/human/user = loc
return mode & (user.glasses == src)
/obj/item/clothing/glasses/meson/engine/update_icon()
icon_state = mode ? "trayson-tray" : "trayson-meson"
icon_state = mesons_on ? "trayson-meson" : "trayson-tray"
if(istype(loc,/mob/living/carbon/human/))
var/mob/living/carbon/human/user = loc
if(user.glasses == src)
@@ -103,7 +96,7 @@
icon_state = "trayson-tray_off"
origin_tech = "materials=3;magnets=2;engineering=2"
mode = TRUE
mesons_on = FALSE
var/on = FALSE
vision_flags = 0
darkness_view = 2
@@ -135,6 +128,3 @@
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
/obj/item/clothing/glasses/meson/engine/tray/t_ray_on()
return on && ..()
+15 -21
View File
@@ -42,7 +42,7 @@
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.
var/mesons_on = TRUE
/obj/item/clothing/glasses/meson/Initialize()
. = ..()
@@ -56,34 +56,28 @@
/obj/item/clothing/glasses/meson/examine(mob/user)
..()
var/turf/T = get_turf(src)
if(T && T.z == ZLEVEL_MINING && mode && picked_excuse)
if(T && T.z == ZLEVEL_MINING && !mesons_on && 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()
vision_flags ^= SEE_TURFS
mesons_on = (vision_flags & SEE_TURFS)? TRUE : FALSE
if(iscarbon(user)) //only carbons can wear glasses
var/mob/living/carbon/C = user
if(!mesons_on)
to_chat(C, "<span class='notice'>Your Meson Scanners have reactivated.</span>")
else if(picked_excuse)
to_chat(C, "<span class='warning'>Due to [picked_excuse], your Meson Scanners will not be able to display terrain layouts in this area.</span>")
if(C.glasses == src)
C.update_sight()
/obj/item/clothing/glasses/meson/process()
var/turf/T = get_turf(src)
if(T && T.z == ZLEVEL_MINING)
if(!mode)
if(mesons_on) //if we're on mining, turn mesons OFF
toggle_mode(loc)
else if(mode)
else if(!mesons_on) //otherwise, if we're not on mining, turn mesons back ON
toggle_mode(loc)
/obj/item/clothing/glasses/meson/night