mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 19:44:58 +01:00
[MIRROR] Made assembly bombs unable to multignite [MDB IGNORE] (#19387)
* Made assembly bombs unable to multignite (#73446) Added stack traces for multignition events Also moves the tank procs into the tanks file from bomb because I can and I hate the previous organisation * Made assembly bombs unable to multignite --------- Co-authored-by: oranges <email@oranges.net.nz>
This commit is contained in:
@@ -28,6 +28,8 @@
|
||||
actions_types = list(/datum/action/item_action/set_internals)
|
||||
armor_type = /datum/armor/item_tank
|
||||
integrity_failure = 0.5
|
||||
/// If we are in the process of exploding, stops multi explosions
|
||||
var/igniting = FALSE
|
||||
/// The gases this tank contains. Don't modify this directly, use return_air() to get it instead
|
||||
var/datum/gas_mixture/air_contents = null
|
||||
/// The volume of this tank. Among other things gas tank explosions (including TTVs) scale off of this. Be sure to account for that if you change this or you will break ~~toxins~~ordinance.
|
||||
@@ -119,8 +121,8 @@
|
||||
return
|
||||
|
||||
/obj/item/tank/Destroy()
|
||||
air_contents = null
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
air_contents = null
|
||||
return ..()
|
||||
|
||||
/obj/item/tank/examine(mob/user)
|
||||
@@ -359,4 +361,72 @@
|
||||
/obj/item/tank/proc/explosion_information()
|
||||
return list(TANK_RESULTS_REACTION = reaction_info, TANK_RESULTS_MISC = explosion_info)
|
||||
|
||||
/obj/item/tank/proc/ignite() //This happens when a bomb is told to explode
|
||||
if(igniting)
|
||||
stack_trace("Attempted to ignite a /obj/item/tank multiple times")
|
||||
return //no double ignite
|
||||
igniting = TRUE
|
||||
// This is done in return_air call, but even then it actually makes zero sense, this tank is going to be deleted
|
||||
// before ever getting a chance to process.
|
||||
//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)
|
||||
|
||||
if(bomb_mixture.temperature > (T0C + 400))
|
||||
strength = (fuel_moles/15)
|
||||
|
||||
if(strength >= 2)
|
||||
explosion(ground_zero, devastation_range = round(strength,1), heavy_impact_range = round(strength*2,1), light_impact_range = round(strength*3,1), flash_range = round(strength*4,1), explosion_cause = src)
|
||||
else if(strength >= 1)
|
||||
explosion(ground_zero, devastation_range = round(strength,1), heavy_impact_range = round(strength*2,1), light_impact_range = round(strength*2,1), flash_range = round(strength*3,1), explosion_cause = src)
|
||||
else if(strength >= 0.5)
|
||||
explosion(ground_zero, heavy_impact_range = 1, light_impact_range = 2, flash_range = 4, explosion_cause = src)
|
||||
else if(strength >= 0.2)
|
||||
explosion(ground_zero, devastation_range = -1, light_impact_range = 1, flash_range = 2, explosion_cause = src)
|
||||
else
|
||||
ground_zero.assume_air(bomb_mixture)
|
||||
ground_zero.hotspot_expose(1000, 125)
|
||||
|
||||
else if(bomb_mixture.temperature > (T0C + 250))
|
||||
strength = (fuel_moles/20)
|
||||
|
||||
if(strength >= 1)
|
||||
explosion(ground_zero, heavy_impact_range = round(strength,1), light_impact_range = round(strength*2,1), flash_range = round(strength*3,1), explosion_cause = src)
|
||||
else if(strength >= 0.5)
|
||||
explosion(ground_zero, devastation_range = -1, light_impact_range = 1, flash_range = 2, explosion_cause = src)
|
||||
else
|
||||
ground_zero.assume_air(bomb_mixture)
|
||||
ground_zero.hotspot_expose(1000, 125)
|
||||
|
||||
else if(bomb_mixture.temperature > (T0C + 100))
|
||||
strength = (fuel_moles/25)
|
||||
|
||||
if(strength >= 1)
|
||||
explosion(ground_zero, devastation_range = -1, light_impact_range = round(strength,1), flash_range = round(strength*3,1), explosion_cause = src)
|
||||
else
|
||||
ground_zero.assume_air(bomb_mixture)
|
||||
ground_zero.hotspot_expose(1000, 125)
|
||||
|
||||
else
|
||||
ground_zero.assume_air(bomb_mixture)
|
||||
ground_zero.hotspot_expose(1000, 125)
|
||||
|
||||
if(master)
|
||||
qdel(master)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/tank/proc/release() //This happens when the bomb is not welded. Tank contents are just spat out.
|
||||
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
|
||||
T.assume_air(removed)
|
||||
#undef ASSUME_AIR_DT_FACTOR
|
||||
|
||||
Reference in New Issue
Block a user