Flamethrowers: Burn 'Em Out (#10736)

This commit is contained in:
Wildkins
2020-12-12 14:47:03 -05:00
committed by GitHub
parent 3be1c465bc
commit 2232bf39f4
4 changed files with 63 additions and 55 deletions

View File

@@ -46,7 +46,6 @@
amount *= 0.75
/obj/effect/decal/cleanable/liquid_fuel/flamethrower_fuel
icon_state = "mustard"
anchored = 0
/obj/effect/decal/cleanable/liquid_fuel/flamethrower_fuel/Initialize(mapload, amt = 1, d = 0)
@@ -55,17 +54,17 @@
/obj/effect/decal/cleanable/liquid_fuel/flamethrower_fuel/Spread()
//The spread for flamethrower fuel is much more precise, to create a wide fire pattern.
if(amount < 0.1) return
if(amount < 1) return
var/turf/simulated/S = loc
if(!istype(S)) return
for(var/d in list(turn(dir,90),turn(dir,-90), dir))
for(var/d in list(turn(dir, 45), turn(dir, -45), dir))
var/turf/simulated/O = get_step(S,d)
if(locate(/obj/effect/decal/cleanable/liquid_fuel/flamethrower_fuel) in O)
continue
if(O.CanPass(null, S, 0, 0) && S.CanPass(null, O, 0, 0))
new/obj/effect/decal/cleanable/liquid_fuel/flamethrower_fuel(O,amount*0.25,d)
O.hotspot_expose((T20C*2) + 380,500) //Light flamethrower fuel on fire immediately.
new/obj/effect/decal/cleanable/liquid_fuel/flamethrower_fuel(O,amount * 0.25,d)
O.hotspot_expose((T20C*2) + 400, 500) //Light flamethrower fuel on fire immediately.
amount *= 0.25
@@ -153,4 +152,4 @@
other_foam.Spread(exclude)
else
new/obj/effect/decal/cleanable/foam(target, amount*0.25,1)
amount *= 0.75
amount *= 0.75

View File

@@ -15,13 +15,19 @@
matter = list(DEFAULT_WALL_MATERIAL = 500)
var/status = 0
var/throw_amount = 100
var/lit = 0 //on or off
var/operating = 0//cooldown
var/lit = FALSE //on or off
var/operating = FALSE //cooldown
var/turf/previousturf = null
var/obj/item/weldingtool/weldtool = null
var/obj/item/device/assembly/igniter/igniter = null
var/obj/item/tank/phoron/ptank = null
/obj/item/flamethrower/examine(mob/user)
..()
if(ptank)
to_chat(user, SPAN_NOTICE("Release pressure is set to [throw_amount] kPa. The tank has about [round(ptank.air_contents.return_pressure(), 10)] kPa left in it."))
else
to_chat(user, SPAN_WARNING("There's no phoron tank [igniter ? "" : "or igniter"] installed!"))
/obj/item/flamethrower/Destroy()
if(weldtool)
@@ -62,7 +68,7 @@
return
/obj/item/flamethrower/afterattack(atom/target, mob/user, proximity)
if(!proximity) return
if(proximity) return
// Make sure our user is still holding us
if(user && user.get_active_hand() == src)
var/turf/target_turf = get_turf(target)
@@ -120,52 +126,54 @@
/obj/item/flamethrower/attack_self(mob/user as mob)
if(user.stat || user.restrained() || user.lying) return
user.set_machine(src)
if(use_check_and_message(user))
return
if(!ptank)
to_chat(user, "<span class='notice'>Attach a phoron tank first!</span>")
to_chat(user, SPAN_WARNING("Attach a phoron tank first!"))
return
var/dat = text("<TT><B>Flamethrower (<A HREF='?src=\ref[src];light=1'>[lit ? "<span class='warning'>Lit</span>" : "Unlit"]</a>)</B><BR>\n Tank Pressure: [ptank.air_contents.return_pressure()]<BR>\nAmount to throw: <A HREF='?src=\ref[src];amount=-100'>-</A> <A HREF='?src=\ref[src];amount=-10'>-</A> <A HREF='?src=\ref[src];amount=-1'>-</A> [throw_amount] <A HREF='?src=\ref[src];amount=1'>+</A> <A HREF='?src=\ref[src];amount=10'>+</A> <A HREF='?src=\ref[src];amount=100'>+</A><BR>\n<A HREF='?src=\ref[src];remove=1'>Remove phorontank</A> - <A HREF='?src=\ref[src];close=1'>Close</A></TT>")
user << browse(dat, "window=flamethrower;size=600x300")
onclose(user, "flamethrower")
return
/obj/item/flamethrower/Topic(href,href_list[])
if(href_list["close"])
usr.unset_machine()
usr << browse(null, "window=flamethrower")
var/list/options = list(
"Eject Tank" = image('icons/obj/tank.dmi', "phoron"),
"Light" = image('icons/effects/effects.dmi', "exhaust"),
"Lower Pressure" = image('icons/mob/screen/radial.dmi', "radial_sub"),
"Raise Pressure" = image('icons/mob/screen/radial.dmi', "radial_add")
)
var/handle = show_radial_menu(user, user, options, radius = 42, tooltips=TRUE)
if(!handle)
return
if(usr.stat || usr.restrained() || usr.lying) return
usr.set_machine(src)
if(href_list["light"])
if(!ptank) return
if(ptank.air_contents.gas[GAS_PHORON] < 1) return
if(!status) return
lit = !lit
if(lit)
START_PROCESSING(SSprocessing, src)
if(href_list["amount"])
throw_amount = throw_amount + text2num(href_list["amount"])
throw_amount = max(50, min(5000, throw_amount))
if(href_list["remove"])
if(!ptank) return
usr.put_in_hands(ptank)
ptank = null
lit = 0
usr.unset_machine()
usr << browse(null, "window=flamethrower")
for(var/mob/M in viewers(1, loc))
if((M.client && M.machine == src))
attack_self(M)
switch(handle)
if("Eject Tank")
if(!ptank)
return
user.put_in_hands(ptank)
ptank = null
lit = FALSE
if("Light")
if(!ptank || !status || ptank.air_contents.gas[GAS_PHORON] < 1)
return
lit = !lit
to_chat(user, SPAN_NOTICE("You [lit ? "light" : "extinguish"] \the [src]."))
if(lit)
START_PROCESSING(SSprocessing, src)
if("Lower Pressure")
change_pressure(-50, user)
if("Raise Pressure")
change_pressure(50, user)
else return
update_icon()
return
/obj/item/flamethrower/proc/change_pressure(var/pressure, var/mob/user)
if(!pressure)
return
throw_amount += pressure
throw_amount = Clamp(50, throw_amount, 5000)
if(ismob(user))
to_chat(user, SPAN_NOTICE("Pressure has been adjusted to [throw_amount] kPa."))
//Called from turf.dm turf/dblclick
/obj/item/flamethrower/proc/flame_turf(turflist)
if(!lit || operating) return
operating = 1
operating = TRUE
playsound(src, fire_sound, 70, 1)
for(var/turf/T in turflist)
if(T.density || istype(T, /turf/space))
@@ -178,11 +186,7 @@
ignite_turf(T)
sleep(1)
previousturf = null
operating = 0
for(var/mob/M in viewers(1, loc))
if((M.client && M.machine == src))
attack_self(M)
return
operating = FALSE
/obj/item/flamethrower/proc/ignite_turf(turf/target)
@@ -192,10 +196,7 @@
new/obj/effect/decal/cleanable/liquid_fuel/flamethrower_fuel(target,air_transfer.gas[GAS_PHORON]*15,get_dir(loc,target))
air_transfer.gas[GAS_PHORON] = 0
target.assume_air(air_transfer)
//Burn it based on transfered gas
//target.hotspot_expose(part4.air_contents.temperature*2,300)
target.hotspot_expose((ptank.air_contents.temperature*2) + 380,500) // -- More of my "how do I shot fire?" dickery. -- TLE
//location.hotspot_expose(1000,500,1)
target.hotspot_expose((ptank.air_contents.temperature*2) + 400, 500)
return
/obj/item/flamethrower/full/New(var/loc)

View File

@@ -0,0 +1,8 @@
author: JohnWildkins
delete-after: True
changes:
- bugfix: "Flamethrowers can now launch fire more than one tile away from the user."
- tweak: "The cone of the flamethrower has been narrowed somewhat, and its spread pattern somewhat randomized."
- rscadd: "Flamethrowers now use a radial menu system rather than a basic HTML UI."

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB