Merge pull request #1121 from Citadel-Station-13/upstream-merge-27409
[MIRROR] 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:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -345,28 +345,23 @@
|
||||
/**********************Mining Scanners**********************/
|
||||
|
||||
/obj/item/device/mining_scanner
|
||||
desc = "A scanner that checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. Wear material scanners for optimal results."
|
||||
desc = "A scanner that checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations."
|
||||
name = "manual mining scanner"
|
||||
icon_state = "mining1"
|
||||
item_state = "analyzer"
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
var/cooldown = 0
|
||||
var/cooldown = 35
|
||||
var/current_cooldown = 0
|
||||
origin_tech = "engineering=1;magnets=1"
|
||||
|
||||
/obj/item/device/mining_scanner/attack_self(mob/user)
|
||||
if(!user.client)
|
||||
return
|
||||
if(!cooldown)
|
||||
cooldown = TRUE
|
||||
addtimer(CALLBACK(src, .proc/clear_cooldown), 40)
|
||||
var/list/mobs = list()
|
||||
mobs |= user
|
||||
mineral_scan_pulse(mobs, get_turf(user))
|
||||
|
||||
/obj/item/device/mining_scanner/proc/clear_cooldown()
|
||||
cooldown = FALSE
|
||||
if(current_cooldown <= world.time)
|
||||
current_cooldown = world.time + cooldown
|
||||
mineral_scan_pulse(get_turf(user))
|
||||
|
||||
|
||||
//Debug item to identify all ore spread quickly
|
||||
@@ -379,7 +374,7 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/item/device/t_scanner/adv_mining_scanner
|
||||
desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. Wear meson scanners for optimal results. This one has an extended range."
|
||||
desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. This one has an extended range."
|
||||
name = "advanced automatic mining scanner"
|
||||
icon_state = "mining0"
|
||||
item_state = "analyzer"
|
||||
@@ -387,77 +382,47 @@
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
var/cooldown = 35
|
||||
var/on_cooldown = 0
|
||||
var/current_cooldown = 0
|
||||
var/range = 7
|
||||
var/meson = TRUE
|
||||
origin_tech = "engineering=3;magnets=3"
|
||||
|
||||
/obj/item/device/t_scanner/adv_mining_scanner/material
|
||||
meson = FALSE
|
||||
desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. Wear material scanners for optimal results. This one has an extended range."
|
||||
|
||||
/obj/item/device/t_scanner/adv_mining_scanner/lesser
|
||||
name = "automatic mining scanner"
|
||||
desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. Wear meson scanners for optimal results."
|
||||
desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations."
|
||||
range = 4
|
||||
cooldown = 50
|
||||
|
||||
/obj/item/device/t_scanner/adv_mining_scanner/lesser/material
|
||||
desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. Wear material scanners for optimal results."
|
||||
meson = FALSE
|
||||
|
||||
/obj/item/device/t_scanner/adv_mining_scanner/scan()
|
||||
if(!on_cooldown)
|
||||
on_cooldown = 1
|
||||
spawn(cooldown)
|
||||
on_cooldown = 0
|
||||
if(current_cooldown <= world.time)
|
||||
current_cooldown = world.time + cooldown
|
||||
var/turf/t = get_turf(src)
|
||||
var/list/mobs = recursive_mob_check(t, 1,0,0)
|
||||
if(!mobs.len)
|
||||
return
|
||||
if(meson)
|
||||
mineral_scan_pulse(mobs, t, range)
|
||||
else
|
||||
mineral_scan_pulse_material(mobs, t, range)
|
||||
mineral_scan_pulse(t, range)
|
||||
|
||||
//For use with mesons
|
||||
/proc/mineral_scan_pulse(list/mobs, turf/T, range = world.view)
|
||||
/proc/mineral_scan_pulse(turf/T, range = world.view)
|
||||
var/list/minerals = list()
|
||||
for(var/turf/closed/mineral/M in range(range, T))
|
||||
if(M.scan_state)
|
||||
minerals += M
|
||||
if(minerals.len)
|
||||
for(var/mob/user in mobs)
|
||||
if(user.client)
|
||||
var/client/C = user.client
|
||||
for(var/turf/closed/mineral/M in minerals)
|
||||
var/turf/F = get_turf(M)
|
||||
var/image/I = image('icons/turf/smoothrocks.dmi', loc = F, icon_state = M.scan_state, layer = FLASH_LAYER)
|
||||
I.plane = FULLSCREEN_PLANE
|
||||
C.images += I
|
||||
spawn(30)
|
||||
if(C)
|
||||
C.images -= I
|
||||
|
||||
//For use with material scanners
|
||||
/proc/mineral_scan_pulse_material(list/mobs, turf/T, range = world.view)
|
||||
var/list/minerals = list()
|
||||
for(var/turf/closed/mineral/M in range(range, T))
|
||||
if(M.scan_state)
|
||||
minerals += M
|
||||
if(minerals.len)
|
||||
if(LAZYLEN(minerals))
|
||||
for(var/turf/closed/mineral/M in minerals)
|
||||
var/obj/effect/temp_visual/mining_overlay/oldC = locate(/obj/effect/temp_visual/mining_overlay) in M
|
||||
if(oldC)
|
||||
qdel(oldC)
|
||||
var/obj/effect/temp_visual/mining_overlay/C = new /obj/effect/temp_visual/mining_overlay(M)
|
||||
C.icon_state = M.scan_state
|
||||
|
||||
/obj/effect/temp_visual/mining_overlay
|
||||
plane = FULLSCREEN_PLANE
|
||||
layer = FLASH_LAYER
|
||||
icon = 'icons/turf/smoothrocks.dmi'
|
||||
anchored = 1
|
||||
mouse_opacity = 0
|
||||
duration = 30
|
||||
pixel_x = -4
|
||||
pixel_y = -4
|
||||
icon = 'icons/effects/ore_visuals.dmi'
|
||||
appearance_flags = 0 //to avoid having TILE_BOUND in the flags, so that the 480x480 icon states let you see it no matter where you are
|
||||
duration = 35
|
||||
pixel_x = -224
|
||||
pixel_y = -224
|
||||
|
||||
/obj/effect/temp_visual/mining_overlay/Initialize()
|
||||
. = ..()
|
||||
animate(src, alpha = 0, time = duration, easing = EASE_IN)
|
||||
|
||||
|
||||
/**********************Xeno Warning Sign**********************/
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
new /datum/data/mining_equipment("Stabilizing Serum", /obj/item/weapon/hivelordstabilizer, 400),
|
||||
new /datum/data/mining_equipment("Fulton Beacon", /obj/item/fulton_core, 400),
|
||||
new /datum/data/mining_equipment("Shelter Capsule", /obj/item/weapon/survivalcapsule, 400),
|
||||
new /datum/data/mining_equipment("GAR scanners", /obj/item/clothing/glasses/meson/gar, 500),
|
||||
new /datum/data/mining_equipment("GAR Meson Scanners", /obj/item/clothing/glasses/meson/gar, 500),
|
||||
new /datum/data/mining_equipment("Explorer's Webbing", /obj/item/weapon/storage/belt/mining, 500),
|
||||
new /datum/data/mining_equipment("Survival Medipen", /obj/item/weapon/reagent_containers/hypospray/medipen/survival, 500),
|
||||
new /datum/data/mining_equipment("Brute First-Aid Kit", /obj/item/weapon/storage/firstaid/brute, 600),
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
var/light_on = 0
|
||||
|
||||
var/datum/action/innate/minedrone/toggle_light/toggle_light_action
|
||||
var/datum/action/innate/minedrone/toggle_meson_vision/toggle_meson_vision_action
|
||||
var/datum/action/innate/minedrone/toggle_mode/toggle_mode_action
|
||||
var/datum/action/innate/minedrone/dump_ore/dump_ore_action
|
||||
|
||||
@@ -52,8 +51,6 @@
|
||||
..()
|
||||
toggle_light_action = new()
|
||||
toggle_light_action.Grant(src)
|
||||
toggle_meson_vision_action = new()
|
||||
toggle_meson_vision_action.Grant(src)
|
||||
toggle_mode_action = new()
|
||||
toggle_mode_action.Grant(src)
|
||||
dump_ore_action = new()
|
||||
@@ -189,23 +186,6 @@
|
||||
user.light_on = !user.light_on
|
||||
to_chat(user, "<span class='notice'>You toggle your light [user.light_on ? "on" : "off"].</span>")
|
||||
|
||||
/datum/action/innate/minedrone/toggle_meson_vision
|
||||
name = "Toggle Meson Vision"
|
||||
button_icon_state = "meson"
|
||||
|
||||
/datum/action/innate/minedrone/toggle_meson_vision/Activate()
|
||||
var/mob/living/simple_animal/hostile/mining_drone/user = owner
|
||||
if(user.sight & SEE_TURFS)
|
||||
user.sight &= ~SEE_TURFS
|
||||
user.lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE
|
||||
else
|
||||
user.sight |= SEE_TURFS
|
||||
user.lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE
|
||||
|
||||
user.sync_lighting_plane_alpha()
|
||||
|
||||
to_chat(user, "<span class='notice'>You toggle your meson vision [(user.sight & SEE_TURFS) ? "on" : "off"].</span>")
|
||||
|
||||
/datum/action/innate/minedrone/toggle_mode
|
||||
name = "Toggle Mode"
|
||||
button_icon_state = "mech_cycle_equip_off"
|
||||
|
||||
@@ -526,7 +526,6 @@
|
||||
name = "Miner"
|
||||
basic_modules = list(
|
||||
/obj/item/device/assembly/flash/cyborg,
|
||||
/obj/item/borg/sight/meson,
|
||||
/obj/item/weapon/storage/bag/ore/cyborg,
|
||||
/obj/item/weapon/pickaxe/drill/cyborg,
|
||||
/obj/item/weapon/shovel,
|
||||
|
||||
Reference in New Issue
Block a user