Files
CHOMPStation2/code/game/machinery/doppler_array.dm
elly1989@rocketmail.com c81c70bd86 Replaced var/netnum for cables and powered machines with a direct reference to their powernet. The bug which was causing cutting and merging powernets to fail was due to my attempts to fix the powernets slowly becoming filled with null entries. Removing those null entries messed up the indexes and essentially jumbled up the powernets. :( sorry
Fixed the failsafe misreporting how long the MC has been dead.

Lighting initialization no longer 'interrupts' the master_controller setup().

Added updated powernet debugging tools. They're in my WIP folder. They are sexy c: It draws the powernet onto the map so you can see what's going on during debugging.

Added tachyon-doppler arrays. They're gonna be something for scientists to measure their bombs with rather than praying for the figures. Nothing spectacular.

Commented out switches, they aren't used and I've been fixing/testing powernets all day. Sorry. If you need them back  just PM me and I'll fix them.

Known issues: the merging procs behave silly at intersections. I really tried to fix it but I think I'll make more progress just working on some powernet improvements.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4623 316c924e-a436-60f5-8080-3fe189b3f50e
2012-09-05 16:14:24 +00:00

53 lines
1.7 KiB
Plaintext

var/list/doppler_arrays = list()
/obj/machinery/doppler_array
name = "tachyon-doppler array"
desc = "A highly precise directional sensor array which measures the release of quants from decaying tachyons. The doppler shifting of the mirror-image formed by these quants can reveal the size, location and temporal affects of energetic disturbances within a large radius ahead of the array."
/obj/machinery/doppler_array/New()
doppler_arrays += src
/obj/machinery/doppler_array/Del()
doppler_arrays -= src
/obj/machinery/doppler_array/process()
return PROCESS_KILL
/obj/machinery/doppler_array/proc/sense_explosion(var/x0,var/y0,var/z0,var/devastation_range,var/heavy_impact_range,var/light_impact_range,var/took)
if(stat & NOPOWER) return
if(z != z0) return
var/dx = abs(x0-x)
var/dy = abs(y0-y)
var/distance
var/direct
if(dx > dy)
distance = dx
if(x0 > x) direct = EAST
else direct = WEST
else
distance = dy
if(y0 > y) direct = NORTH
else direct = SOUTH
if(distance > 100) return
if(!(direct & dir)) return
var/message = "Explosive disturbance detected - Epicenter at: grid ([x0],[y0]). Epicenter radius: [devastation_range]. Outer radius: [heavy_impact_range]. Shockwave radius: [light_impact_range]. Temporal displacement of tachyons: [took]seconds."
for(var/mob/O in hearers(src, null))
O.show_message("<span class='game say'><span class='name'>[src]</span> states coldly, \"[message]\"",2)
/obj/machinery/doppler_array/power_change()
if(stat & BROKEN)
icon_state = "[initial(icon_state)]-broken"
else
if( powered() )
icon_state = initial(icon_state)
stat &= ~NOPOWER
else
icon_state = "[initial(icon_state)]-off"
stat |= NOPOWER