Merge pull request #9296 from PsiOmegaDelta/TurfProcessing

Turf processing
This commit is contained in:
Zuhayr
2015-05-17 22:51:45 +09:30
6 changed files with 37 additions and 33 deletions
+1 -1
View File
@@ -59,4 +59,4 @@
/datum/controller/process/machinery/getStatName()
return ..()+"([machines.len])"
return ..()+"([machines.len])"
+8 -3
View File
@@ -1,9 +1,14 @@
var/global/list/processing_turfs = list()
var/global/list/turf/processing_turfs = list()
/datum/controller/process/turf/setup()
name = "turf"
schedule_interval = 20 // every 2 seconds
/datum/controller/process/turf/doWork()
for(var/turf/unsimulated/wall/supermatter/SM in processing_turfs)
SM.process()
for(var/turf/T in processing_turfs)
if(T.process() == PROCESS_KILL)
processing_turfs.Remove(T)
scheck()
/datum/controller/process/turf/getStatName()
return ..()+"([processing_turfs.len])"
@@ -23,7 +23,7 @@
processing_turfs.Remove(src)
..()
/turf/unsimulated/wall/supermatter/proc/process()
/turf/unsimulated/wall/supermatter/process()
// Only check infrequently.
if(next_check>world.time) return
+20 -28
View File
@@ -15,7 +15,6 @@ var/list/global/wall_cache = list()
var/damage_overlay
var/global/damage_overlays[8]
var/active
var/last_event
var/can_open = 0
var/material/material
var/material/reinf_material
@@ -32,9 +31,20 @@ var/list/global/wall_cache = list()
reinf_material = name_to_material[rmaterialtype]
update_material()
/turf/simulated/wall/bullet_act(var/obj/item/projectile/Proj)
processing_turfs |= src
radiate()
/turf/simulated/wall/Destroy()
processing_turfs -= src
dismantle_wall(null,null,1)
..()
/turf/simulated/wall/process()
// Calling parent will kill processing
if(!radiate())
return PROCESS_KILL
/turf/simulated/wall/bullet_act(var/obj/item/projectile/Proj)
if(istype(Proj,/obj/item/projectile/beam))
ignite(2500)
else if(istype(Proj,/obj/item/projectile/ion))
@@ -234,21 +244,13 @@ var/list/global/wall_cache = list()
return 0
/turf/simulated/wall/proc/radiate()
var/material/M = name_to_material[material]
if(!istype(M) || !M.radioactivity)
var/total_radiation = material.radioactivity + (reinf_material ? reinf_material.radioactivity / 2 : 0)
if(!total_radiation)
return
if(!active)
if(world.time > last_event+15)
active = 1
for(var/mob/living/L in range(3,src))
L.apply_effect(M.radioactivity,IRRADIATE,0)
for(var/turf/simulated/wall/T in range(3,src))
T.radiate()
last_event = world.time
active = null
return
return
for(var/mob/living/L in range(3,src))
L.apply_effect(total_radiation, IRRADIATE,0)
return total_radiation
/turf/simulated/wall/proc/burn(temperature)
spawn(2)
@@ -264,19 +266,9 @@ var/list/global/wall_cache = list()
D.ignite(temperature/4)
/turf/simulated/wall/proc/ignite(var/exposed_temperature)
var/material/M = name_to_material[material]
if(!istype(M) || !isnull(M.ignition_point))
if(isnull(material.ignition_point))
return
if(exposed_temperature > M.ignition_point)//If the temperature of the object is over 300, then ignite
if(exposed_temperature > material.ignition_point)//If the temperature of the object is over 300, then ignite
burn(exposed_temperature)
return
..()
/turf/simulated/wall/Bumped(AM as mob|obj)
radiate()
..()
/turf/simulated/wall/Destroy()
dismantle_wall(null,null,1)
..()
+3
View File
@@ -378,3 +378,6 @@
if(!LinkBlocked(src, t) && !TurfBlockedNonWindow(t))
L.Add(t)
return L
/turf/proc/process()
return PROCESS_KILL
@@ -0,0 +1,4 @@
author: PsiOmegaDelta
delete-after: True
changes:
- rscadd: "Turf are now processed. This, for example, causes radioactive walls to regularly irradiate nearby mobs."