mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Added ability to rig fueltanks
To make your very own ghetto explosive: 1.Wrench faucet open on tank. 2.Add assembly of your choice (only timers and radios work as triggers here) To unmake it simply remove assembly with hands and wrench faucet back. Rigging tank with igniter logs for admins. Also explosion size depends on amount of fuel left in tank.
This commit is contained in:
@@ -13,7 +13,14 @@
|
||||
activate()
|
||||
if(!..()) return 0//Cooldown check
|
||||
var/turf/location = get_turf(loc)
|
||||
if(location) location.hotspot_expose(1000,1000)
|
||||
if(location)
|
||||
location.hotspot_expose(1000,1000)
|
||||
if (istype(src.loc,/obj/item/device/assembly_holder))
|
||||
if (istype(src.loc.loc, /obj/structure/reagent_dispensers/fueltank/))
|
||||
var/obj/structure/reagent_dispensers/fueltank/tank = src.loc.loc
|
||||
if (tank && tank.modded)
|
||||
tank.explode()
|
||||
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(3, 1, src)
|
||||
s.start()
|
||||
|
||||
@@ -89,10 +89,60 @@
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "weldtank"
|
||||
amount_per_transfer_from_this = 10
|
||||
var/modded = 0
|
||||
var/obj/item/device/assembly_holder/rig = null
|
||||
New()
|
||||
..()
|
||||
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))
|
||||
explode()
|
||||
@@ -104,7 +154,12 @@
|
||||
explode()
|
||||
|
||||
proc/explode()
|
||||
explosion(src.loc,1,2,4)
|
||||
if (reagents.total_volume > 500)
|
||||
explosion(src.loc,1,2,4)
|
||||
else if (reagents.total_volume > 100)
|
||||
explosion(src.loc,0,1,3)
|
||||
else
|
||||
explosion(src.loc,-1,1,2)
|
||||
if(src)
|
||||
del(src)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user