diff --git a/code/game/objects/items/weapons/chemical_flamethrower/chemical_flamethrower.dm b/code/game/objects/items/weapons/chemical_flamethrower/chemical_flamethrower.dm index 9e57dc47933..21a830842d9 100644 --- a/code/game/objects/items/weapons/chemical_flamethrower/chemical_flamethrower.dm +++ b/code/game/objects/items/weapons/chemical_flamethrower/chemical_flamethrower.dm @@ -29,6 +29,8 @@ var/canister_burn_duration = 10 SECONDS /// How many firestacks will our reagent apply var/canister_fire_applications = 1 + /// Does our chemical have any special color? + var/canister_fire_color /// How much ammo do we use per tile? var/ammo_usage = 1 /// Is this a syndicate flamethrower @@ -90,12 +92,14 @@ canister_burn_temp = null canister_burn_duration = null canister_fire_applications = null + canister_fire_color = null return var/burn_temp var/burn_duration var/fire_applications var/how_many_canisters = length(canisters) + var/list/colors = list() for(var/obj/item/chemical_canister/canister as anything in canisters) if(!canister.ammo) @@ -103,10 +107,13 @@ burn_temp += canister.chem_burn_temp burn_duration += canister.chem_burn_duration fire_applications += canister.fire_applications + colors += canister.chem_color canister_burn_temp = round(burn_temp / how_many_canisters, 1) canister_burn_duration = round(burn_duration / how_many_canisters, 1) canister_fire_applications = round(fire_applications / how_many_canisters, 1) + if(length(colors)) + canister_fire_color = pick(colors) update_icon(UPDATE_OVERLAYS) /obj/item/chemical_flamethrower/afterattack__legacy__attackchain(atom/target, mob/user, flag) @@ -159,7 +166,8 @@ previousturf = T /obj/item/chemical_flamethrower/proc/make_flame(turf/spawn_turf) - new /obj/effect/fire(spawn_turf, canister_burn_temp, (canister_burn_duration + rand(1, 3) SECONDS), canister_fire_applications) // For that spicy randomness (and to save your ears from all fires extinguishing at the same time) + // For that spicy randomness (and to save your ears from all fires extinguishing at the same time) + new /obj/effect/fire(spawn_turf, canister_burn_temp, (canister_burn_duration + rand(1, 3) SECONDS), canister_fire_applications, canister_fire_color) /* * Uses `amount` ammo from the flamethrower. @@ -232,6 +240,8 @@ var/first_time_silent = FALSE // The reason for this is so we can have canisters that spawn with reagents but don't announce it on `Initialize()` /// What chemical do we have? This will be the chemical ID, so a string var/stored_chemical + /// What color will our fire burn + var/chem_color /obj/item/chemical_canister/Initialize(mapload) . = ..() @@ -273,6 +283,8 @@ chem_burn_duration = reagent_to_burn.burn_duration chem_burn_temp = reagent_to_burn.burn_temperature fire_applications = reagent_to_burn.fire_stack_applications + if(reagent_to_burn.burn_color) + chem_color = reagent_to_burn.burn_color ammo = initial(ammo) has_filled_reagent = TRUE reagents.clear_reagents() diff --git a/code/game/objects/items/weapons/chemical_flamethrower/fire_effect.dm b/code/game/objects/items/weapons/chemical_flamethrower/fire_effect.dm index 1cdf4e1630b..158816ca4cc 100644 --- a/code/game/objects/items/weapons/chemical_flamethrower/fire_effect.dm +++ b/code/game/objects/items/weapons/chemical_flamethrower/fire_effect.dm @@ -5,8 +5,8 @@ GLOBAL_LIST_EMPTY(flame_effects) name = "fire" desc = "You don't think you should touch this." icon = 'icons/effects/chemical_fire.dmi' - icon_state = "fire1" - + icon_state = "red_small" + base_icon_state = "red" /// How hot is our fire? var/temperature /// How long will our fire last @@ -14,7 +14,7 @@ GLOBAL_LIST_EMPTY(flame_effects) /// How many firestacks does the fire give to mobs var/application_stacks = 1 -/obj/effect/fire/Initialize(mapload, reagent_temperature, reagent_duration, fire_applications) +/obj/effect/fire/Initialize(mapload, reagent_temperature, reagent_duration, fire_applications, color) . = ..() if(reagent_duration < 0 || reagent_temperature <= 0) // There is no reason for this thing to exist @@ -24,6 +24,9 @@ GLOBAL_LIST_EMPTY(flame_effects) duration = reagent_duration temperature = reagent_temperature application_stacks = max(application_stacks, fire_applications) + if(color) + base_icon_state = color + update_icon() for(var/obj/effect/fire/flame in get_turf(src)) if(!istype(flame) || flame == src) @@ -48,6 +51,7 @@ GLOBAL_LIST_EMPTY(flame_effects) fizzle() return duration -= 2 SECONDS + update_icon(UPDATE_ICON_STATE) for(var/atom/movable/thing_to_burn in get_turf(src)) if(isliving(thing_to_burn)) @@ -68,6 +72,14 @@ GLOBAL_LIST_EMPTY(flame_effects) var/datum/milla_safe/fire_heat_air/milla = new() milla.invoke_async(src, location) +/obj/effect/fire/update_icon_state() + var/suffix = "small" + if(duration >= 30 SECONDS) + suffix = "big" + else if(duration >= 10 SECONDS) + suffix = "medium" + icon_state = "[base_icon_state]_[suffix]" + /datum/milla_safe/fire_heat_air /datum/milla_safe/fire_heat_air/on_run(obj/effect/fire/fire, turf/T) @@ -79,6 +91,7 @@ GLOBAL_LIST_EMPTY(flame_effects) duration -= 10 SECONDS if(duration <= 0) fizzle() + update_icon(UPDATE_ICON_STATE) /obj/effect/fire/proc/on_atom_entered(datum/source, atom/movable/entered, old_loc) SIGNAL_HANDLER // COMSIG_ATOM_ENTERED diff --git a/code/modules/reagents/chemistry/reagents/pyrotechnic.dm b/code/modules/reagents/chemistry/reagents/pyrotechnic.dm index ec1b87f2da3..a7f4361161d 100644 --- a/code/modules/reagents/chemistry/reagents/pyrotechnic.dm +++ b/code/modules/reagents/chemistry/reagents/pyrotechnic.dm @@ -8,6 +8,7 @@ taste_description = "burning" burn_temperature = T0C + 500 burn_duration = 20 SECONDS + burn_color = "white" var/temp_fire = 4000 var/temp_deviance = 1000 var/size_divisor = 40 @@ -46,6 +47,7 @@ size_divisor = 80 mob_burning = 3 // 15 burn_temperature = T0C + 700 + burn_color = "white" /datum/reagent/napalm name = "Napalm" @@ -198,6 +200,7 @@ taste_description = "rust" burn_temperature = T0C + 1500 // hahahahHAHAHAHAH LET IT BURN burn_duration = 5 SECONDS // Not for long though + burn_color = "blue" // too hot! /datum/reagent/thermite/reaction_mob(mob/living/M, method= REAGENT_TOUCH, volume) if(method == REAGENT_TOUCH) @@ -253,6 +256,7 @@ burn_temperature = T0C + 700 burn_duration = 15 SECONDS fire_stack_applications = 3 + burn_color = "green" /datum/reagent/clf3/on_mob_life(mob/living/M) if(M.on_fire) diff --git a/code/modules/reagents/chemistry/reagents_datum.dm b/code/modules/reagents/chemistry/reagents_datum.dm index e51056cbbea..b2affb2821a 100644 --- a/code/modules/reagents/chemistry/reagents_datum.dm +++ b/code/modules/reagents/chemistry/reagents_datum.dm @@ -51,6 +51,8 @@ var/burn_duration = 30 SECONDS /// How many firestacks will the reagent apply when it is burning? Currently only used for chemical flamethrowers var/fire_stack_applications = 1 + /// If we burn in a fire, what color do we have? + var/burn_color /datum/reagent/Destroy() . = ..() diff --git a/icons/effects/chemical_fire.dmi b/icons/effects/chemical_fire.dmi index 9b9118cfc15..c36026c1464 100644 Binary files a/icons/effects/chemical_fire.dmi and b/icons/effects/chemical_fire.dmi differ