mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 16:38:22 +01:00
Flamethrower Fix (#10794)
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
origin_tech = list(TECH_COMBAT = 1, TECH_PHORON = 1)
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 500)
|
||||
var/status = 0
|
||||
var/secured = 0
|
||||
var/throw_amount = 100
|
||||
var/lit = FALSE //on or off
|
||||
var/operating = FALSE //cooldown
|
||||
@@ -57,7 +57,7 @@
|
||||
/obj/item/flamethrower/update_icon()
|
||||
cut_overlays()
|
||||
if(igniter)
|
||||
add_overlay("+igniter[status]")
|
||||
add_overlay("+igniter[secured]")
|
||||
if(ptank)
|
||||
add_overlay("+ptank")
|
||||
if(lit)
|
||||
@@ -68,7 +68,13 @@
|
||||
return
|
||||
|
||||
/obj/item/flamethrower/afterattack(atom/target, mob/user, proximity)
|
||||
if(proximity) return
|
||||
if(proximity)
|
||||
return
|
||||
if(!ptank)
|
||||
return
|
||||
if(ptank.air_contents.get_by_flag(XGM_GAS_FUEL) < 10)
|
||||
to_chat(user, SPAN_WARNING("\The [src] doesn't have enough fuel left to throw!"))
|
||||
return
|
||||
// Make sure our user is still holding us
|
||||
if(user && user.get_active_hand() == src)
|
||||
var/turf/target_turf = get_turf(target)
|
||||
@@ -78,7 +84,7 @@
|
||||
|
||||
/obj/item/flamethrower/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(user.stat || user.restrained() || user.lying) return
|
||||
if(W.iswrench() && !status)//Taking this apart
|
||||
if(W.iswrench() && !secured)//Taking this apart
|
||||
var/turf/T = get_turf(src)
|
||||
if(weldtool)
|
||||
weldtool.forceMove(T)
|
||||
@@ -94,8 +100,8 @@
|
||||
return
|
||||
|
||||
if(W.isscrewdriver() && igniter && !lit)
|
||||
status = !status
|
||||
to_chat(user, "<span class='notice'>[igniter] is now [status ? "secured" : "unsecured"]!</span>")
|
||||
secured = !secured
|
||||
to_chat(user, "<span class='notice'>[igniter] is now [secured ? "secured" : "unsecured"]!</span>")
|
||||
update_icon()
|
||||
return
|
||||
|
||||
@@ -148,7 +154,10 @@
|
||||
ptank = null
|
||||
lit = FALSE
|
||||
if("Light")
|
||||
if(!ptank || !status || ptank.air_contents.gas[GAS_PHORON] < 1)
|
||||
if(!ptank || !secured)
|
||||
return
|
||||
if(ptank.air_contents.get_by_flag(XGM_GAS_FUEL) < 1)
|
||||
to_chat(user, SPAN_WARNING("\The [src] doesn't have any flammable fuel to light!"))
|
||||
return
|
||||
lit = !lit
|
||||
to_chat(user, SPAN_NOTICE("You [lit ? "light" : "extinguish"] \the [src]."))
|
||||
@@ -190,21 +199,19 @@
|
||||
|
||||
|
||||
/obj/item/flamethrower/proc/ignite_turf(turf/target)
|
||||
//TODO: DEFERRED Consider checking to make sure tank pressure is high enough before doing this...
|
||||
//Transfer 5% of current tank air contents to turf
|
||||
var/datum/gas_mixture/air_transfer = ptank.air_contents.remove_ratio(0.02*(throw_amount/100))
|
||||
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
|
||||
var/datum/gas_mixture/air_transfer = ptank.air_contents.remove_ratio(0.02 * (throw_amount / 100))
|
||||
new /obj/effect/decal/cleanable/liquid_fuel/flamethrower_fuel(target, air_transfer.get_by_flag(XGM_GAS_FUEL) * 15, get_dir(loc, target))
|
||||
for(var/g in air_transfer.gas)
|
||||
if(gas_data.flags[g] & XGM_GAS_FUEL)
|
||||
air_transfer.gas[g] = 0
|
||||
target.assume_air(air_transfer)
|
||||
target.hotspot_expose((ptank.air_contents.temperature*2) + 400, 500)
|
||||
return
|
||||
|
||||
/obj/item/flamethrower/full/New(var/loc)
|
||||
..()
|
||||
/obj/item/flamethrower/full/Initialize()
|
||||
. = ..()
|
||||
weldtool = new /obj/item/weldingtool(src)
|
||||
weldtool.status = 0
|
||||
weldtool.status = FALSE
|
||||
igniter = new /obj/item/device/assembly/igniter(src)
|
||||
igniter.secured = 0
|
||||
status = 1
|
||||
update_icon()
|
||||
return
|
||||
igniter.secured = FALSE
|
||||
secured = TRUE
|
||||
update_icon()
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
if (istype(W, /obj/item/flamethrower))
|
||||
var/obj/item/flamethrower/F = W
|
||||
if ((!F.status)||(F.ptank)) return
|
||||
if ((!F.secured)||(F.ptank)) return
|
||||
src.master = F
|
||||
F.ptank = src
|
||||
user.remove_from_mob(src)
|
||||
|
||||
Reference in New Issue
Block a user