Files
Paradise/code/modules/mining/equipment/mineral_scanner.dm
T
warriorstar-orionandGitHub 525c68d617 Attack chain, initial setup. (pull *immediately* for *any* TM issues) (#26834)
* refactor: Attack chain, initial setup.

* migrate curtain to make dreamchecker happy

* update thurible

* don't call attacked_by separately for legacy attack chain

* remove duplicate proc

* condense similar code, put allowances for legacy code in new procs

* update docs, include diagram source

* add comment on how to update diagram

* fix admonition

* mindflayer updates

* remove commented out code

* clarify all steps

* after_attack should be overridable

* whoops

* retrofit recent changes

* duh, can't restrict this yet because of tool_acts

* i hate ore bags with the fire of a thousand suns

* return correct value for object attack logic

* Various cleanups.

We don't want to attempt to pull stuff out of `/obj/item/attackby`,
because those pieces are part of the related objects' migrations, not
`/obj/item` itself. Attempting to do this causes knockon effects where
things expected to call e.g. `/obj/item/storage/attackby` in the call
chain were not ferried over to the new item interaction code, because
the related objects hadn't actually been migrated over yet.

I've used refactoring /obj/vehicle as the example for migrating
`attackby` methods instead.

* simplify some argument names

* fuck it

* make it do the thing

* Rename CI module call

* Prove that CI works

* improve test output

* aaand fix it again

* fix curtain tool interactions

* fix compile error

* fix compile error

* Better docs, introduce migration plan tool.
2024-12-02 23:36:36 +00:00

87 lines
3.0 KiB
Plaintext

/**********************Mining Scanner**********************/
/obj/item/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."
name = "manual mining scanner"
icon = 'icons/obj/device.dmi'
icon_state = "mining1"
item_state = "analyzer"
w_class = WEIGHT_CLASS_SMALL
flags = CONDUCT
slot_flags = ITEM_SLOT_BELT
var/cooldown = 35
var/current_cooldown = 0
origin_tech = "engineering=1;magnets=1"
/obj/item/mining_scanner/attack_self__legacy__attackchain(mob/user)
if(!user.client)
return
if(current_cooldown <= world.time)
current_cooldown = world.time + cooldown
mineral_scan_pulse(get_turf(user))
//Debug item to identify all ore spread quickly
/obj/item/mining_scanner/admin
/obj/item/mining_scanner/admin/attack_self__legacy__attackchain(mob/user)
for(var/turf/simulated/mineral/M in world)
if(M.ore?.scan_icon_state)
M.icon_state = M.ore.scan_icon_state
qdel(src)
/obj/item/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."
name = "advanced automatic mining scanner"
icon_state = "mining0"
item_state = "analyzer"
w_class = WEIGHT_CLASS_SMALL
flags = CONDUCT
slot_flags = ITEM_SLOT_BELT
var/cooldown = 35
var/current_cooldown = 0
var/range = 7
origin_tech = "engineering=3;magnets=3"
/obj/item/t_scanner/adv_mining_scanner/cyborg
flags = CONDUCT | NODROP
/obj/item/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."
range = 4
cooldown = 50
/obj/item/t_scanner/adv_mining_scanner/scan()
if(current_cooldown <= world.time)
current_cooldown = world.time + cooldown
var/turf/t = get_turf(src)
mineral_scan_pulse(t, range)
/proc/mineral_scan_pulse(turf/T, range = world.view)
var/list/minerals = list()
for(var/turf/simulated/mineral/M in range(range, T))
if(M.ore?.scan_icon_state)
minerals += M
if(LAZYLEN(minerals))
for(var/turf/simulated/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.ore.scan_icon_state
/obj/effect/temp_visual/mining_overlay
plane = FULLSCREEN_PLANE
layer = FLASH_LAYER
icon = 'icons/effects/ore_visuals.dmi'
icon_state = null
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(mapload)
. = ..()
animate(src, alpha = 0, time = duration, easing = EASE_IN)