Doppler Research (#11135)

This commit is contained in:
Geeves
2021-03-19 22:06:24 +01:00
committed by GitHub
parent 123b0e3c3e
commit 987e8e2c2b
6 changed files with 42 additions and 17 deletions
+1
View File
@@ -905,6 +905,7 @@
#include "code\game\objects\items\weapons\paiwire.dm"
#include "code\game\objects\items\weapons\policetape.dm"
#include "code\game\objects\items\weapons\power_cells.dm"
#include "code\game\objects\items\weapons\research_slip.dm"
#include "code\game\objects\items\weapons\RFD.dm"
#include "code\game\objects\items\weapons\scrolls.dm"
#include "code\game\objects\items\weapons\shields.dm"
+19 -10
View File
@@ -2,7 +2,7 @@ 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."
desc = "A highly precise 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."
icon = 'icons/obj/computer.dmi'
icon_state = "computer"
@@ -39,32 +39,41 @@ var/list/doppler_arrays = list()
add_overlay(image(icon, src, "teleport"))
/obj/machinery/doppler_array/proc/sense_explosion(var/x0,var/y0,var/z0,var/devastation_range,var/heavy_impact_range,var/light_impact_range)
if(!active || (stat & NOPOWER) || z != z0)
if(!active)
return
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],[z0]). Epicenter radius: [devastation_range]. Outer radius: [heavy_impact_range]. Shockwave radius: [light_impact_range]."
global_announcer.autosay(message, "Tachyon-Doppler Array", "Science")
var/list/gained_tech
switch(devastation_range)
if(-INFINITY to 1) // minimum
gained_tech = list(TECH_BLUESPACE = 1, TECH_COMBAT = 2, TECH_MATERIAL = 2)
if(1 to 2) // starter bombs
gained_tech = list(TECH_BLUESPACE = 2, TECH_PHORON = 2, TECH_COMBAT = 3, TECH_MATERIAL = 3)
if(2 to 4) // max toxins can get
gained_tech = list(TECH_BLUESPACE = 3, TECH_PHORON = 3, TECH_COMBAT = 3, TECH_MATERIAL = 3, TECH_ENGINEERING = 3)
else
gained_tech = list(TECH_BLUESPACE = 4, TECH_PHORON = 4, TECH_COMBAT = 4, TECH_MATERIAL = 4, TECH_ENGINEERING = 4)
new /obj/item/research_slip(get_turf(src), gained_tech)
/obj/machinery/doppler_array/power_change()
..()
update_icon()
+3 -7
View File
@@ -17,13 +17,9 @@
SSexplosives.queue(data)
//Machines which report explosions.
for(var/i,i<=doppler_arrays.len,i++)
var/obj/machinery/doppler_array/Array = doppler_arrays[i]
if(Array)
var/x0 = epicenter.x
var/y0 = epicenter.y
var/z0 = epicenter.z
Array.sense_explosion(x0,y0,z0,devastation_range,heavy_impact_range,light_impact_range)
for(var/thing in doppler_arrays)
var/obj/machinery/doppler_array/Array = thing
Array.sense_explosion(epicenter.x,epicenter.y,epicenter.z,devastation_range,heavy_impact_range,light_impact_range)
// == Recursive Explosions stuff ==
@@ -0,0 +1,12 @@
/obj/item/research_slip
name = "research slip"
desc = "A small slip of plastic with an embedded chip. It is commonly used to store small amounts of research data."
desc_info = "This item is to be used in the destructive analyzer to gain research points."
icon = 'icons/obj/contained_items/tools/research_slip.dmi'
icon_state = "slip"
contained_sprite = TRUE
/obj/item/research_slip/Initialize(mapload, var/list/research_levels)
. = ..()
if(length(research_levels))
origin_tech = research_levels
+7
View File
@@ -0,0 +1,7 @@
author: Geeves
delete-after: True
changes:
- rscadd: "The Tachyon-Doppler array will now output research slips with research data based on the size of the explosion it detects. You can feed these into a destructive analyzer for research points."
- tweak: "The doppler array is no longer directional, meaning if it happens on its Z-level, it will detect it."
Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B