mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-06-07 15:20:12 +01:00
c4c447a8dc
Fixes many machines and a few structure not having a cooldown when attacked with an item. Fixes not being able to eat or be facehugged when wearing riot helmet with visor up. Fixes not being able to use child of the tool type for craft recipes requiring tools. Tablecrafting failure message now tells you what caused the failure (missing tool, missing component) Fixes fuego plasma burrito recipe. Fixes being able to grab cups from water cooler with telekinesis, putting the cup directly in your hand. Fixes golem appearing with their old human name for a split second. Some changes to make code more OOP (take_damage() proc for barricade, shieldgen, etc) Some tweaks to light tube building code.
101 lines
3.1 KiB
Plaintext
101 lines
3.1 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.\n<span class='notice'>Alt-click to rotate it clockwise.</span>"
|
|
icon = 'icons/obj/machines/research.dmi'
|
|
icon_state = "tdoppler"
|
|
density = 1
|
|
anchored = 1
|
|
verb_say = "states coldly"
|
|
|
|
/obj/machinery/doppler_array/New()
|
|
..()
|
|
doppler_arrays += src
|
|
|
|
/obj/machinery/doppler_array/Destroy()
|
|
doppler_arrays -= src
|
|
return ..()
|
|
|
|
/obj/machinery/doppler_array/process()
|
|
return PROCESS_KILL
|
|
|
|
/obj/machinery/doppler_array/attackby(obj/item/O, mob/user, params)
|
|
if(istype(O, /obj/item/weapon/wrench))
|
|
if(!anchored && !isinspace())
|
|
anchored = 1
|
|
power_change()
|
|
user << "<span class='notice'>You fasten [src].</span>"
|
|
else if(anchored)
|
|
anchored = 0
|
|
power_change()
|
|
user << "<span class='notice'>You unfasten [src].</span>"
|
|
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
|
|
else
|
|
..()
|
|
|
|
/obj/machinery/doppler_array/verb/rotate()
|
|
set name = "Rotate Tachyon-doppler Dish"
|
|
set category = "Object"
|
|
set src in oview(1)
|
|
|
|
if(!usr || !isturf(usr.loc))
|
|
return
|
|
if(usr.stat || usr.restrained() || !usr.canmove)
|
|
return
|
|
src.dir = turn(src.dir, 90)
|
|
return
|
|
|
|
/obj/machinery/doppler_array/AltClick(mob/user)
|
|
..()
|
|
if(!user.canUseTopic(user))
|
|
user << "<span class='warning'>You can't do that right now!</span>"
|
|
return
|
|
if(!in_range(src, user))
|
|
return
|
|
else
|
|
rotate()
|
|
|
|
/obj/machinery/doppler_array/proc/sense_explosion(x0,y0,z0,devastation_range,heavy_impact_range,light_impact_range,
|
|
took,orig_dev_range,orig_heavy_range,orig_light_range)
|
|
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/list/messages = list("Explosive disturbance detected.", \
|
|
"Epicenter at: grid ([x0],[y0]). Temporal displacement of tachyons: [took] seconds.", \
|
|
"Factual: Epicenter radius: [devastation_range]. Outer radius: [heavy_impact_range]. Shockwave radius: [light_impact_range].")
|
|
|
|
// If the bomb was capped, say it's theoretical size.
|
|
if(devastation_range < orig_dev_range || heavy_impact_range < orig_heavy_range || light_impact_range < orig_light_range)
|
|
messages += "Theoretical: Epicenter radius: [orig_dev_range]. Outer radius: [orig_heavy_range]. Shockwave radius: [orig_light_range]."
|
|
|
|
for(var/message in messages)
|
|
say(message)
|
|
|
|
/obj/machinery/doppler_array/power_change()
|
|
if(stat & BROKEN)
|
|
icon_state = "[initial(icon_state)]-broken"
|
|
else
|
|
if(powered() && anchored)
|
|
icon_state = initial(icon_state)
|
|
stat &= ~NOPOWER
|
|
else
|
|
icon_state = "[initial(icon_state)]-off"
|
|
stat |= NOPOWER |