React optimization + event based processing for tanks, canisters and pipelines (#5352)

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
This commit is contained in:
SkyratBot
2021-05-01 14:08:53 +01:00
committed by GitHub
co-authored by LemonInTheDark Gandalf
parent 023369d59b
commit d8ee087d8d
39 changed files with 1855 additions and 552 deletions
+11 -6
View File
@@ -58,7 +58,8 @@
return
if(I.use_tool(src, user, 0, volume=40))
status = TRUE
log_bomber(user, "welded a single tank bomb,", src, "| Temp: [bombtank.air_contents.temperature-T0C]")
var/datum/gas_mixture/bomb_mix = bombtank.return_air()
log_bomber(user, "welded a single tank bomb,", src, "| Temp: [bomb_mix.temperature-T0C]")
to_chat(user, "<span class='notice'>A pressure hole has been bored to [bombtank] valve. \The [bombtank] can now be ignited.</span>")
add_fingerprint(user)
return TRUE
@@ -145,10 +146,13 @@
return
/obj/item/tank/proc/ignite() //This happens when a bomb is told to explode
air_contents.assert_gases(/datum/gas/plasma, /datum/gas/oxygen)
var/fuel_moles = air_contents.gases[/datum/gas/plasma][MOLES] + air_contents.gases[/datum/gas/oxygen][MOLES]/6
air_contents.garbage_collect()
var/datum/gas_mixture/bomb_mixture = air_contents.copy()
START_PROCESSING(SSobj, src)
var/datum/gas_mixture/our_mix = return_air()
our_mix.assert_gases(/datum/gas/plasma, /datum/gas/oxygen)
var/fuel_moles = our_mix.gases[/datum/gas/plasma][MOLES] + our_mix.gases[/datum/gas/oxygen][MOLES]/6
our_mix.garbage_collect()
var/datum/gas_mixture/bomb_mixture = our_mix.copy()
var/strength = 1
var/turf/ground_zero = get_turf(loc)
@@ -199,7 +203,8 @@
ground_zero.air_update_turf(FALSE, FALSE)
/obj/item/tank/proc/release() //This happens when the bomb is not welded. Tank contents are just spat out.
var/datum/gas_mixture/removed = air_contents.remove(air_contents.total_moles())
var/datum/gas_mixture/our_mix = return_air()
var/datum/gas_mixture/removed = remove_air(our_mix.total_moles())
var/turf/T = get_turf(src)
if(!T)
return