More fixes

Moves logging around
Refactor of code
This commit is contained in:
joep van der velden
2021-05-05 22:17:09 +02:00
parent 590ca6cd5d
commit 277c8e2ca6
3 changed files with 23 additions and 19 deletions
@@ -205,10 +205,10 @@
var/turf/T = get_turf(holder.my_atom)
holder.my_atom.visible_message("<b>The oil burns!</b>")
var/datum/reagents/old_holder = holder
fire_flash_log(holder, id)
if(holder)
holder.del_reagent(id) // Remove first. Else fireflash triggers a reaction again
fire_flash_log(old_holder, id)
fireflash(T, min(max(0, volume / 40), 8))
var/datum/effect_system/smoke_spread/bad/BS = new
BS.set_up(1, 0, T)
@@ -15,8 +15,8 @@
if(holder.chem_temp <= T0C - 50)
return
var/radius = min(max(0, volume / size_divisor), 8)
fireflash_sm(T, radius, rand(temp_fire - temp_deviance, temp_fire + temp_deviance), 500)
fire_flash_log(holder, id)
fireflash_sm(T, radius, rand(temp_fire - temp_deviance, temp_fire + temp_deviance), 500)
/datum/reagent/phlogiston/reaction_mob(mob/living/M, method = REAGENT_TOUCH, volume)
if(holder.chem_temp <= T0C - 50)
@@ -56,10 +56,11 @@
/datum/reagent/napalm/reaction_temperature(exposed_temperature, exposed_volume)
if(exposed_temperature > T0C + 100)
var/radius = min(max(0, volume * 0.15), 8)
fireflash_sm(get_turf(holder.my_atom), radius, rand(3000, 6000), 500)
var/turf/T = get_turf(holder.my_atom)
fire_flash_log(holder, id)
if(holder)
holder.del_reagent(id)
fireflash_sm(T, radius, rand(3000, 6000), 500)
/datum/reagent/napalm/reaction_turf(turf/T, volume)
if(isspaceturf(T))
@@ -112,19 +113,22 @@
if(holder)
holder.del_reagent(id)
return
var/datum/reagents/old_holder = holder
var/will_explode = volume >= explosion_threshold
if(will_explode && holder.my_atom)
// Log beforehand
holder.my_atom.visible_message("<span class='danger'>[holder.my_atom] explodes!</span>")
message_admins("Fuel explosion ([holder.my_atom], reagent type: [id]) at [COORD(holder.my_atom.loc)]. Last touched by: [holder.my_atom.fingerprintslast ? "[holder.my_atom.fingerprintslast]" : "*null*"].")
log_game("Fuel explosion ([holder.my_atom], reagent type: [id]) at [COORD(holder.my_atom.loc)]. Last touched by: [holder.my_atom.fingerprintslast ? "[holder.my_atom.fingerprintslast]" : "*null*"].")
holder.my_atom.investigate_log("A fuel explosion, last touched by [holder.my_atom.fingerprintslast ? "[holder.my_atom.fingerprintslast]" : "*null*"], triggered at [COORD(holder.my_atom.loc)].", INVESTIGATE_BOMB)
var/turf/T = get_turf(holder.my_atom)
if(holder) // Delete the fuel from the holder before we trigger the fireball
holder.del_reagent(id)
var/turf/T = get_turf(old_holder.my_atom)
var/radius = min(max(min_radius, volume * volume_radius_multiplier + volume_radius_modifier), max_radius)
fireflash_sm(T, radius, 2200 + radius * 250, radius * 50)
if(old_holder && volume >= explosion_threshold)
if(old_holder.my_atom)
old_holder.my_atom.visible_message("<span class='danger'>[old_holder.my_atom] explodes!</span>")
message_admins("Fuel explosion ([old_holder.my_atom], reagent type: [id]) at [COORD(old_holder.my_atom.loc)]. Last touched by: [old_holder.my_atom.fingerprintslast ? "[old_holder.my_atom.fingerprintslast]" : "*null*"].")
log_game("Fuel explosion ([old_holder.my_atom], reagent type: [id]) at [COORD(old_holder.my_atom.loc)]. Last touched by: [old_holder.my_atom.fingerprintslast ? "[old_holder.my_atom.fingerprintslast]" : "*null*"].")
old_holder.my_atom.investigate_log("A fuel explosion, last touched by [old_holder.my_atom.fingerprintslast ? "[old_holder.my_atom.fingerprintslast]" : "*null*"], triggered at [COORD(old_holder.my_atom.loc)].", INVESTIGATE_BOMB)
if(will_explode)
var/boomrange = min(max(min_explosion_radius, round(volume * volume_explosion_radius_multiplier + volume_explosion_radius_modifier)), max_explosion_radius)
explosion(T, -1, -1, boomrange, 1)
@@ -151,11 +155,11 @@
/datum/reagent/plasma/reaction_temperature(exposed_temperature, exposed_volume)
if(exposed_temperature >= T0C + 100)
var/datum/reagents/old_holder = holder
var/turf/T = get_turf(holder.my_atom)
fire_flash_log(holder, id)
if(holder)
holder.del_reagent(id) // Remove first. Else fireflash triggers a reaction again
fire_flash_log(old_holder, id)
fireflash(get_turf(old_holder.my_atom), min(max(0, volume / 10), 8))
fireflash(T, min(max(0, volume / 10), 8))
/datum/reagent/plasma/on_mob_life(mob/living/M)
var/update_flags = STATUS_UPDATE_NONE
@@ -244,8 +248,8 @@
if(volume < 3)
return
var/radius = min((volume - 3) * 0.15, 3)
fireflash_sm(T, radius, 4500 + volume * 500, 350)
fire_flash_log(holder, id)
fireflash_sm(T, radius, 4500 + volume * 500, 350)
/datum/reagent/clf3/reaction_mob(mob/living/M, method = REAGENT_TOUCH, volume)
if(method == REAGENT_TOUCH || method == REAGENT_INGEST)
@@ -442,11 +446,11 @@
/datum/reagent/plasma_dust/reaction_temperature(exposed_temperature, exposed_volume)
if(exposed_temperature >= T0C + 100)
var/datum/reagents/old_holder = holder
var/turf/T = get_turf(holder.my_atom)
fire_flash_log(holder, id)
if(holder)
holder.del_reagent(id) // Remove first. Else fireflash triggers a reaction again
fire_flash_log(old_holder, id)
fireflash(get_turf(old_holder.my_atom), min(max(0, volume / 10), 8))
fireflash(T, min(max(0, volume / 10), 8))
/datum/reagent/plasma_dust/on_mob_life(mob/living/M)
var/update_flags = STATUS_UPDATE_NONE