Skip to content

Commit

Permalink
Various chemthrower fixes (#26697)
Browse files Browse the repository at this point in the history
* Various chemthrower fixes

* Slight tweak

* Fixes extended thrower

* Fixes

* Slight examine tweak

* Name tweak and a fix
  • Loading branch information
DGamerL authored Sep 12, 2024
1 parent f7472de commit 62601ab
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
if(canister.ammo - difference <= 0)
difference -= canister.ammo
canister.ammo = 0
canister.has_filled_reagent = FALSE // We're empty now!
else
canister.ammo -= difference
difference = 0
Expand Down Expand Up @@ -211,7 +212,7 @@
desc = "A simple canister of fuel. Does not accept any pyrotechnics except for welding fuel."
icon = 'icons/obj/chemical_flamethrower.dmi'
icon_state = "normal"
container_type = OPENCONTAINER
container_type = REFILLABLE
/// How much ammo do we have? Empty at 0.
var/ammo = 100
/// Which reagent IDs do we accept
Expand All @@ -230,12 +231,24 @@
var/has_filled_reagent = FALSE
/// Are we silent on the first change of reagents?
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

/obj/item/chemical_canister/Initialize(mapload)
. = ..()
create_reagents(50)

/obj/item/chemical_canister/examine(mob/user)
. = ..()
. += "[src] has [ammo] out of [initial(ammo)] units left!"
if(stored_chemical && ammo != 0)
. += "[src] is currently filled with [stored_chemical]"

/obj/item/chemical_canister/on_reagent_change()
if(!length(reagents.reagent_list))
// Nothing to check. Has to be here because we call `clear_reagents` at the end of this proc.
return

if(has_filled_reagent && ammo != 0)
audible_message("<span class='notice'>[src]'s speaker beeps: no new chemicals are accepted!</span>")
return
Expand All @@ -246,14 +259,14 @@
return

current_reagent_id = reagents.get_master_reagent_id()
stored_chemical = current_reagent_id
reagents.isolate_reagent(current_reagent_id)
var/has_enough_reagents = reagents.total_volume >= required_volume

if(!first_time_silent)
audible_message("<span class='notice'>[src]'s speaker beeps: \
All reagents are removed except for [current_reagent_id]. \
The reservoir has [reagents.total_volume] out of [required_volume] units. \
Reagent effects are [has_enough_reagents ? "in effect" : "not active"].</span>")
Reagents are [has_enough_reagents ? "in effect" : "not active"].</span>")
first_time_silent = FALSE

if(has_enough_reagents)
Expand All @@ -263,6 +276,7 @@
fire_applications = reagent_to_burn.fire_stack_applications
ammo = initial(ammo)
has_filled_reagent = TRUE
reagents.clear_reagents()

/obj/item/chemical_canister/extended
name = "extended capacity chemical canister"
Expand All @@ -272,6 +286,8 @@
required_volume = 20 // Bigger canister? More reagents needed.

/obj/item/chemical_canister/extended/nuclear
name = "\improper Syndicate chemical canister"
desc = "A canister pre-filled with napalm to bring a fiery death to capitalism."
icon_state = "pyro"
accepted_chemicals = list("napalm")
first_time_silent = TRUE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ GLOBAL_LIST_EMPTY(flame_effects)
/obj/effect/fire/Crossed(atom/movable/AM, oldloc)
. = ..()
if(isliving(AM))
damage_mob(AM)
if(!damage_mob(AM))
return
to_chat(AM, "<span class='warning'>[src] burns you!</span>")
return

Expand All @@ -104,7 +105,7 @@ GLOBAL_LIST_EMPTY(flame_effects)
var/mob/living/carbon/human/human_to_burn = mob_to_burn
var/fire_armour = human_to_burn.get_thermal_protection()
if(fire_armour >= FIRE_IMMUNITY_MAX_TEMP_PROTECT)
return
return FALSE

if(fire_armour == FIRE_SUIT_MAX_TEMP_PROTECT) // Good protection but you won't survive infinitely in it
fire_damage /= 4
Expand Down

0 comments on commit 62601ab

Please sign in to comment.