mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-14 00:23:29 +01:00
Fueltanks leak fuel when wrenched open
Fueltanks now actually leak fuel when wrenched open. The leaking only occurs at the initial wrenching and when tank is moved. Conflicts: code/modules/reagents/reagent_dispenser.dm
This commit is contained in:
@@ -95,54 +95,6 @@
|
||||
..()
|
||||
reagents.add_reagent("fuel",1000)
|
||||
|
||||
examine()
|
||||
set src in view()
|
||||
..()
|
||||
if (!(usr in view(2)) && usr!=src.loc) return
|
||||
if (modded)
|
||||
usr << "\red Fuel faucet is wrenched open, leaking the fuel!"
|
||||
if(rig)
|
||||
usr << "<span class='notice'>There is some kind of device rigged to the tank."
|
||||
|
||||
attack_hand()
|
||||
if (rig)
|
||||
usr.visible_message("[usr] begins to detach [rig] from \the [src].", "You begin to detach [rig] from \the [src]")
|
||||
if(do_after(usr, 20))
|
||||
usr.visible_message("\blue [usr] detaches [rig] from \the [src].", "\blue You detach [rig] from \the [src]")
|
||||
rig.loc = get_turf(usr)
|
||||
rig = null
|
||||
overlays = new/list()
|
||||
|
||||
attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W,/obj/item/weapon/wrench))
|
||||
user.visible_message("[user] wrenches [src]'s faucet [modded ? "closed" : "open"].", \
|
||||
"You wrench [src]'s faucet [modded ? "closed" : "open"]")
|
||||
modded = modded ? 0 : 1
|
||||
if (istype(W,/obj/item/device/assembly_holder))
|
||||
if (rig)
|
||||
user << "\red There is another device in the way."
|
||||
return ..()
|
||||
user.visible_message("[user] begins rigging [W] to \the [src].", "You begin rigging [W] to \the [src]")
|
||||
if(do_after(user, 20))
|
||||
user.visible_message("\blue [user] rigs [W] to \the [src].", "\blue You rig [W] to \the [src]")
|
||||
|
||||
var/obj/item/device/assembly_holder/H = W
|
||||
if (istype(H.a_left,/obj/item/device/assembly/igniter) || istype(H.a_right,/obj/item/device/assembly/igniter))
|
||||
message_admins("[key_name_admin(user)] rigged fueltank at ([loc.x],[loc.y],[loc.z]) for explosion.")
|
||||
log_game("[key_name(user)] rigged fueltank at ([loc.x],[loc.y],[loc.z]) for explosion.")
|
||||
|
||||
rig = W
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
|
||||
var/icon/test = getFlatIcon(W)
|
||||
test.Shift(NORTH,1)
|
||||
test.Shift(EAST,6)
|
||||
overlays += test
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
bullet_act(var/obj/item/projectile/Proj)
|
||||
if(istype(Proj ,/obj/item/projectile/beam)||istype(Proj,/obj/item/projectile/bullet))
|
||||
if(!istype(Proj ,/obj/item/projectile/beam/lastertag) && !istype(Proj ,/obj/item/projectile/beam/practice) )
|
||||
@@ -169,6 +121,68 @@
|
||||
if(src)
|
||||
del(src)
|
||||
|
||||
/obj/structure/reagent_dispensers/fueltank/examine()
|
||||
set src in view()
|
||||
..()
|
||||
if (!(usr in view(2)) && usr!=src.loc) return
|
||||
if (modded)
|
||||
usr << "\red Fuel faucet is wrenched open, leaking the fuel!"
|
||||
if(rig)
|
||||
usr << "<span class='notice'>There is some kind of device rigged to the tank."
|
||||
|
||||
/obj/structure/reagent_dispensers/fueltank/attack_hand()
|
||||
if (rig)
|
||||
usr.visible_message("[usr] begins to detach [rig] from \the [src].", "You begin to detach [rig] from \the [src]")
|
||||
if(do_after(usr, 20))
|
||||
usr.visible_message("\blue [usr] detaches [rig] from \the [src].", "\blue You detach [rig] from \the [src]")
|
||||
rig.loc = get_turf(usr)
|
||||
rig = null
|
||||
overlays = new/list()
|
||||
|
||||
/obj/structure/reagent_dispensers/fueltank/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W,/obj/item/weapon/wrench))
|
||||
user.visible_message("[user] wrenches [src]'s faucet [modded ? "closed" : "open"].", \
|
||||
"You wrench [src]'s faucet [modded ? "closed" : "open"]")
|
||||
modded = modded ? 0 : 1
|
||||
if (modded)
|
||||
leak_fuel(amount_per_transfer_from_this)
|
||||
if (istype(W,/obj/item/device/assembly_holder))
|
||||
if (rig)
|
||||
user << "\red There is another device in the way."
|
||||
return ..()
|
||||
user.visible_message("[user] begins rigging [W] to \the [src].", "You begin rigging [W] to \the [src]")
|
||||
if(do_after(user, 20))
|
||||
user.visible_message("\blue [user] rigs [W] to \the [src].", "\blue You rig [W] to \the [src]")
|
||||
|
||||
var/obj/item/device/assembly_holder/H = W
|
||||
if (istype(H.a_left,/obj/item/device/assembly/igniter) || istype(H.a_right,/obj/item/device/assembly/igniter))
|
||||
message_admins("[key_name_admin(user)] rigged fueltank at ([loc.x],[loc.y],[loc.z]) for explosion.")
|
||||
log_game("[key_name(user)] rigged fueltank at ([loc.x],[loc.y],[loc.z]) for explosion.")
|
||||
|
||||
rig = W
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
|
||||
var/icon/test = getFlatIcon(W)
|
||||
test.Shift(NORTH,1)
|
||||
test.Shift(EAST,6)
|
||||
overlays += test
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/structure/reagent_dispensers/fueltank/Move()
|
||||
if (..() && modded)
|
||||
leak_fuel(amount_per_transfer_from_this)
|
||||
|
||||
/obj/structure/reagent_dispensers/fueltank/proc/leak_fuel(amount)
|
||||
if (reagents.total_volume == 0)
|
||||
return
|
||||
|
||||
amount = min(amount, reagents.total_volume)
|
||||
reagents.remove_reagent("fuel",amount)
|
||||
new /obj/effect/decal/cleanable/liquid_fuel(src.loc, amount)
|
||||
|
||||
/obj/structure/reagent_dispensers/peppertank
|
||||
name = "Pepper Spray Refiller"
|
||||
desc = "Refill pepper spray canisters."
|
||||
|
||||
Reference in New Issue
Block a user