Merge pull request #1662 from Giacom/doppler_array_tweak

The doppler array will now state the theoretical size of the explosion if it was uncapped.
This commit is contained in:
Aranclanos
2013-10-30 09:08:52 -07:00
2 changed files with 17 additions and 4 deletions
+11 -3
View File
@@ -39,7 +39,8 @@ var/list/doppler_arrays = list()
src.dir = turn(src.dir, 90)
return
/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)
/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,var/orig_dev_range,var/orig_heavy_range,var/orig_light_range)
if(stat & NOPOWER) return
if(z != z0) return
@@ -60,10 +61,17 @@ var/list/doppler_arrays = list()
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."
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/mob/O in hearers(src, null))
O.show_message("<span class='game say'><span class='name'>[src]</span> states coldly, \"[message]\"",2)
for(var/message in messages)
O.show_message("<span class='game say'><span class='name'>[src]</span> states coldly, \"[message]\"",2)
/obj/machinery/doppler_array/power_change()
+6 -1
View File
@@ -11,6 +11,11 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
src = null //so we don't abort once src is deleted
epicenter = get_turf(epicenter)
// Archive the uncapped explosion for the doppler array
var/orig_dev_range = devastation_range
var/orig_heavy_range = heavy_impact_range
var/orig_light_range = light_impact_range
if(!ignorecap)
// Clamp all values to MAX_EXPLOSION_RANGE
devastation_range = min (MAX_EX_DEVESTATION_RANGE, devastation_range)
@@ -91,7 +96,7 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
for(var/i,i<=doppler_arrays.len,i++)
var/obj/machinery/doppler_array/Array = doppler_arrays[i]
if(Array)
Array.sense_explosion(x0,y0,z0,devastation_range,heavy_impact_range,light_impact_range,took)
Array.sense_explosion(x0,y0,z0,devastation_range,heavy_impact_range,light_impact_range,took,orig_dev_range,orig_heavy_range,orig_light_range)
sleep(8)