From 2f21d34cd5ceba680d1f0166972614bf768ded40 Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Tue, 31 Dec 2024 01:05:50 +0100 Subject: [PATCH] stripped fire git diff (#9739) --- modular_chomp/code/ZAS/Fire.dm | 19 +++- modular_chomp/code/ZAS/Fire_acts.dm | 143 ++++++++++++++++++---------- 2 files changed, 105 insertions(+), 57 deletions(-) diff --git a/modular_chomp/code/ZAS/Fire.dm b/modular_chomp/code/ZAS/Fire.dm index 7e96a583bc..239fb8578d 100644 --- a/modular_chomp/code/ZAS/Fire.dm +++ b/modular_chomp/code/ZAS/Fire.dm @@ -1,3 +1,5 @@ +#define FIRE_MAX_TEMP 20000 + /turf/proc/lingering_fire(fl) return @@ -80,9 +82,10 @@ air_contents.remove_by_flag(XGM_GAS_OXIDIZER, gas_exchange) air_contents.adjust_gas(GAS_CO2, gas_exchange * 1.5) // Lots of CO2 - var/starting_energy = air_contents.temperature * air_contents.heat_capacity() - - air_contents.temperature = (starting_energy + vsc.fire_fuel_energy_release * (gas_exchange * 1.05)) / air_contents.heat_capacity() + // Limit max lingering fire temp gain, or engines melt + if(air_contents.temperature < FIRE_MAX_TEMP) // May as well limit this + var/starting_energy = air_contents.temperature * air_contents.heat_capacity() + air_contents.temperature = (starting_energy + vsc.fire_fuel_energy_release * (gas_exchange * 1.05)) / air_contents.heat_capacity() air_contents.update_values() // Affect contents @@ -120,8 +123,8 @@ enemy_tile.lingering_fire(firelevel * splitrate) firelevel -= (1 - splitrate) - else if(prob(20)) - enemy_tile.adjacent_fire_act(loc, air_contents, air_contents.temperature, air_contents.volume) + else if(prob(20)) + enemy_tile.adjacent_fire_act(loc, air_contents, air_contents.temperature, air_contents.volume) var/total_oxidizers = 0 for(var/g in air_contents.gas) @@ -145,3 +148,9 @@ if(T) T.fire = null qdel(src) + +/obj/fire/lingering/Destroy() + . = ..() + SSair.lingering_fires-- + +#undef FIRE_MAX_TEMP diff --git a/modular_chomp/code/ZAS/Fire_acts.dm b/modular_chomp/code/ZAS/Fire_acts.dm index af7fdd414a..71983b75e8 100644 --- a/modular_chomp/code/ZAS/Fire_acts.dm +++ b/modular_chomp/code/ZAS/Fire_acts.dm @@ -9,70 +9,104 @@ #define MED_CHANCE 6 #define HIGH_CHANCE 12 +#define BURN_TEMP_PAPER T0C + 150 +#define BURN_TEMP_PLASTIC T0C + 350 +#define BURN_TEMP_METAL T0C + 1400 +#define BURN_TEMP_PHOROFIRE T0C + 5000 + // Additional fire_acts(), macro that assembles a proc that runs every time fire acts on the assigned object path of x. -// If it rolls the prob("c"hance) it will feed the lingering fire a 0 to 1 value as "b"urn. Then ex_act(1) the object while leaving ash behind. +// If it rolls the prob("c"hance) it will feed the lingering fire a 0 to 1 value as "b"urn. +// Then checks if the current turf temp is greater than t, is so it ex_act(1)s the object while leaving ash behind. // With great agony, I wish to report that I feel like I'm coding in C98 with this bullshit - Willbird -#define FIREACT_BURNS(x,c,b) x/fire_act(){if(prob(c)){var/turf/T = get_turf(src);T?.feed_lingering_fire(b);new /obj/effect/decal/cleanable/ash(get_turf(src));ex_act(1);}} +#define FIREACT_BURNS(x,c,b,t) x/fire_act()\ +{\ + if(prob(c))\ + {\ + var/turf/T = get_turf(src);\ + if(T)\ + {\ + var/datum/gas_mixture/G = T.return_air();\ + if(G && G.temperature >= t)\ + {\ + T.feed_lingering_fire(b);\ + new /obj/effect/decal/cleanable/ash(get_turf(src));\ + ex_act(1);\ + }\ + }\ + }\ +}; //////////////////////////// TRASH BURN //////////////////////////// -FIREACT_BURNS(/obj/item/trash,HIGH_CHANCE,TRASH_BURN) -FIREACT_BURNS(/obj/item/paper,HIGH_CHANCE,TRASH_BURN) -FIREACT_BURNS(/obj/item/soap,LOW_CHANCE,TRASH_BURN) -FIREACT_BURNS(/obj/item/storage/pill_bottle,MED_CHANCE,TRASH_BURN) -FIREACT_BURNS(/obj/item/assembly/mousetrap,HIGH_CHANCE,TRASH_BURN) -FIREACT_BURNS(/obj/structure/table/standard,LOW_CHANCE,TRASH_BURN) -FIREACT_BURNS(/obj/item/deck,LOW_CHANCE,TRASH_BURN) +FIREACT_BURNS(/obj/item/trash,HIGH_CHANCE,TRASH_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/item/paper,HIGH_CHANCE,TRASH_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/item/soap,LOW_CHANCE,TRASH_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/item/storage/pill_bottle,MED_CHANCE,TRASH_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/item/assembly/mousetrap,HIGH_CHANCE,TRASH_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/structure/table/,LOW_CHANCE,TRASH_BURN,BURN_TEMP_METAL) +FIREACT_BURNS(/obj/structure/table/standard,LOW_CHANCE,TRASH_BURN,BURN_TEMP_PLASTIC) +FIREACT_BURNS(/obj/item/deck,LOW_CHANCE,TRASH_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/structure/closet,LOW_CHANCE,TRASH_BURN,BURN_TEMP_METAL) +FIREACT_BURNS(/obj/machinery/floodlight,LOW_CHANCE,TRASH_BURN,BURN_TEMP_PHOROFIRE) +FIREACT_BURNS(/obj/machinery/vending,LOW_CHANCE,TRASH_BURN,BURN_TEMP_PHOROFIRE) +FIREACT_BURNS(/obj/structure/loot_pile/mecha,LOW_CHANCE,TRASH_BURN,BURN_TEMP_PHOROFIRE) +FIREACT_BURNS(/obj/structure/table/marble,LOW_CHANCE,TRASH_BURN,BURN_TEMP_PHOROFIRE) +// The following two should be very limited to avoid frustrating crew +FIREACT_BURNS(/obj/structure/cable,LOW_CHANCE,TRASH_BURN,BURN_TEMP_PHOROFIRE) // Comment out if wires shouldn't be destroyed +FIREACT_BURNS(/obj/structure/disposalpipe/segment,LOW_CHANCE,TRASH_BURN,BURN_TEMP_PHOROFIRE) // Comment out if disposals shouldn't be destroyed //////////////////////////// LOW BURN //////////////////////////// -FIREACT_BURNS(/obj/item/stack/material/plastic,LOW_CHANCE,LOW_BURN) -FIREACT_BURNS(/obj/item/paper_bin,HIGH_CHANCE,LOW_BURN) -FIREACT_BURNS(/obj/item/bedsheet,HIGH_CHANCE,LOW_BURN) -FIREACT_BURNS(/obj/item/book,HIGH_CHANCE,LOW_BURN) -FIREACT_BURNS(/obj/item/folder,HIGH_CHANCE,LOW_BURN) -FIREACT_BURNS(/obj/item/storage/fancy/cigar,HIGH_CHANCE,LOW_BURN) -FIREACT_BURNS(/obj/structure/flora/pottedplant,LOW_CHANCE,LOW_BURN) -FIREACT_BURNS(/obj/item/storage/box,MED_CHANCE,LOW_BURN) -FIREACT_BURNS(/obj/item/juke_remote,LOW_CHANCE,LOW_BURN) -FIREACT_BURNS(/obj/item/mop,LOW_CHANCE,LOW_BURN) -FIREACT_BURNS(/obj/item/storage/pouch,LOW_CHANCE,LOW_BURN) -FIREACT_BURNS(/obj/item/storage/backpack,LOW_CHANCE,LOW_BURN) -FIREACT_BURNS(/obj/item/storage/bag/trash,LOW_CHANCE,LOW_BURN) -FIREACT_BURNS(/obj/item/reagent_containers/food,LOW_CHANCE,LOW_BURN) -FIREACT_BURNS(/obj/item/packageWrap,HIGH_CHANCE,LOW_BURN) -FIREACT_BURNS(/obj/item/tape_roll,LOW_CHANCE,LOW_BURN) -FIREACT_BURNS(/obj/structure/sign/christmas,LOW_CHANCE,LOW_BURN) // IT CRIMBO, OH NO IT CRIMBO -FIREACT_BURNS(/obj/structure/table/woodentable,MED_CHANCE,LOW_BURN) -FIREACT_BURNS(/obj/structure/table/gamblingtable,MED_CHANCE,LOW_BURN) +FIREACT_BURNS(/obj/item/stack/material/plastic,LOW_CHANCE,LOW_BURN,BURN_TEMP_PLASTIC) +FIREACT_BURNS(/obj/item/paper_bin,HIGH_CHANCE,LOW_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/item/bedsheet,HIGH_CHANCE,LOW_BURN,BURN_TEMP_PLASTIC) +FIREACT_BURNS(/obj/item/book,HIGH_CHANCE,LOW_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/item/folder,HIGH_CHANCE,LOW_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/item/storage/fancy/cigar,HIGH_CHANCE,LOW_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/structure/flora/pottedplant,LOW_CHANCE,LOW_BURN,BURN_TEMP_PLASTIC) +FIREACT_BURNS(/obj/item/storage/box,MED_CHANCE,LOW_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/item/juke_remote,LOW_CHANCE,LOW_BURN,BURN_TEMP_PLASTIC) +FIREACT_BURNS(/obj/item/mop,LOW_CHANCE,LOW_BURN,BURN_TEMP_PLASTIC) +FIREACT_BURNS(/obj/item/storage/pouch,LOW_CHANCE,LOW_BURN,BURN_TEMP_PLASTIC) +FIREACT_BURNS(/obj/item/storage/backpack,LOW_CHANCE,LOW_BURN,BURN_TEMP_PLASTIC) +FIREACT_BURNS(/obj/item/storage/bag/trash,LOW_CHANCE,LOW_BURN,BURN_TEMP_PLASTIC) +FIREACT_BURNS(/obj/item/reagent_containers/food,LOW_CHANCE,LOW_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/item/packageWrap,HIGH_CHANCE,LOW_BURN,BURN_TEMP_PLASTIC) +FIREACT_BURNS(/obj/item/tape_roll,LOW_CHANCE,LOW_BURN,BURN_TEMP_PLASTIC) +FIREACT_BURNS(/obj/structure/sign/christmas,LOW_CHANCE,LOW_BURN,BURN_TEMP_PLASTIC) // IT CRIMBO, OH NO IT CRIMBO +FIREACT_BURNS(/obj/structure/table/woodentable,MED_CHANCE,LOW_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/structure/table/gamblingtable,MED_CHANCE,LOW_BURN,BURN_TEMP_PAPER) //////////////////////////// GOOD BURN //////////////////////////// -FIREACT_BURNS(/obj/item/stack/material/stick,MED_CHANCE,GOOD_BURN) -FIREACT_BURNS(/obj/item/stack/material/wax,MED_CHANCE,GOOD_BURN) -FIREACT_BURNS(/obj/structure/bookcase,LOW_CHANCE,GOOD_BURN) -FIREACT_BURNS(/obj/structure/simple_door/wood,LOW_CHANCE,GOOD_BURN) -FIREACT_BURNS(/obj/item/instrument,LOW_CHANCE,GOOD_BURN) -FIREACT_BURNS(/obj/item/toy/plushie,MED_CHANCE,GOOD_BURN) -FIREACT_BURNS(/obj/item/towel,HIGH_CHANCE,GOOD_BURN) -FIREACT_BURNS(/obj/structure/closet/crate/wooden,MED_CHANCE,GOOD_BURN) -FIREACT_BURNS(/obj/structure/bed,MED_CHANCE,GOOD_BURN) +FIREACT_BURNS(/obj/item/stack/material/stick,MED_CHANCE,GOOD_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/item/stack/material/wax,MED_CHANCE,GOOD_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/item/stack/material/fur,MED_CHANCE,GOOD_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/structure/closet/crate/laundry,MED_CHANCE,GOOD_BURN,BURN_TEMP_PLASTIC) +FIREACT_BURNS(/obj/structure/bookcase,LOW_CHANCE,GOOD_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/structure/simple_door/wood,LOW_CHANCE,GOOD_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/item/instrument,LOW_CHANCE,GOOD_BURN,BURN_TEMP_METAL) +FIREACT_BURNS(/obj/item/toy/plushie,MED_CHANCE,GOOD_BURN,BURN_TEMP_PLASTIC) +FIREACT_BURNS(/obj/item/towel,HIGH_CHANCE,GOOD_BURN,BURN_TEMP_PLASTIC) +FIREACT_BURNS(/obj/structure/closet/crate/wooden,MED_CHANCE,GOOD_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/structure/bed,MED_CHANCE,GOOD_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/structure/curtain,MED_CHANCE,GOOD_BURN,BURN_TEMP_PLASTIC) +FIREACT_BURNS(/obj/item/clothing,LOW_CHANCE,GOOD_BURN,BURN_TEMP_PLASTIC) //////////////////////////// HIGH BURN //////////////////////////// -FIREACT_BURNS(/obj/item/stack/material/wood,MED_CHANCE,HIGH_BURN) -FIREACT_BURNS(/obj/structure/flora/tree,LOW_CHANCE,HIGH_BURN) +FIREACT_BURNS(/obj/item/stack/material/wood,MED_CHANCE,HIGH_BURN,BURN_TEMP_PAPER) +FIREACT_BURNS(/obj/structure/flora/tree,LOW_CHANCE,HIGH_BURN,BURN_TEMP_METAL) //////////////////////////// MEGA BURN //////////////////////////// -FIREACT_BURNS(/obj/item/stack/material/phoron,MED_CHANCE,MEGA_BURN) +FIREACT_BURNS(/obj/item/stack/material/phoron,MED_CHANCE,MEGA_BURN,PHORON_FLASHPOINT) +FIREACT_BURNS(/obj/structure/trash_pile,LOW_CHANCE,MEGA_BURN,BURN_TEMP_PLASTIC) -// The remaining proc is defined without the macro to give an example of what the macro used above outputs. -/obj/item/clothing/fire_act() - if(prob(LOW_CHANCE)) - var/turf/T = get_turf(src) - T?.feed_lingering_fire(GOOD_BURN) - new /obj/effect/decal/cleanable/ash(get_turf(src)) - ex_act(1) - -// Suits need special handling to avoid fires destroying rigs +// Suits need special handling to avoid fires destroying rigs and such /obj/item/clothing/suit/fire_act() return -// anti-lag ash cleanup -/obj/effect/decal/cleanable/ash/fire_act() - if(prob(2)) +// If cables can burn, do not burn these, no way to make them properly ingame +/obj/structure/cable/heavyduty/fire_act() + return + +// anti-lag ash cleanup, also includes blood and oil fuel sources +/obj/effect/decal/cleanable/fire_act() + if(prob(MED_CHANCE)) + var/turf/T = get_turf(src) + T?.feed_lingering_fire(0.025) qdel(src) #undef FIREACT_BURNS @@ -87,3 +121,8 @@ FIREACT_BURNS(/obj/item/stack/material/phoron,MED_CHANCE,MEGA_BURN) #undef HIGH_BURN #undef SUPER_BURN #undef MEGA_BURN + +#undef BURN_TEMP_PAPER +#undef BURN_TEMP_PLASTIC +#undef BURN_TEMP_METAL +#undef BURN_TEMP_PHOROFIRE