mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Revolutionary update!
You can now dispense Disposal Bins, Outlets and Chutes from the disposal dispenser. These are movable and you can attach them above open trunks with a wrench, then weld them to attach them completely. You can remove Bins by turning off their pump, then screwdriver, then weld, then wrench. Same with outlet and chute except for the pump part. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3690 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -119,6 +119,9 @@
|
||||
<A href='?src=\ref[src];dmake=2'>Junction</A><BR>
|
||||
<A href='?src=\ref[src];dmake=3'>Y-Junction</A><BR>
|
||||
<A href='?src=\ref[src];dmake=4'>Trunk</A><BR>
|
||||
<A href='?src=\ref[src];dmake=5'>Bin</A><BR>
|
||||
<A href='?src=\ref[src];dmake=6'>Outlet</A><BR>
|
||||
<A href='?src=\ref[src];dmake=7'>Chute</A><BR>
|
||||
"}
|
||||
|
||||
user << browse("<HEAD><TITLE>[src]</TITLE></HEAD><TT>[dat]</TT>", "window=pipedispenser")
|
||||
@@ -150,6 +153,15 @@
|
||||
C.ptype = 4
|
||||
if(4)
|
||||
C.ptype = 5
|
||||
if(5)
|
||||
C.ptype = 6
|
||||
C.density = 1
|
||||
if(6)
|
||||
C.ptype = 7
|
||||
C.density = 1
|
||||
if(7)
|
||||
C.ptype = 8
|
||||
C.density = 1
|
||||
|
||||
C.update()
|
||||
wait = 1
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Disposal pipe construction
|
||||
// This is the pipe that you drag around, not the attached ones.
|
||||
|
||||
/obj/structure/disposalconstruct
|
||||
|
||||
@@ -12,7 +13,7 @@
|
||||
m_amt = 1850
|
||||
level = 2
|
||||
var/ptype = 0
|
||||
// 0=straight, 1=bent, 2=junction-j1, 3=junction-j2, 4=junction-y, 5=trunk
|
||||
// 0=straight, 1=bent, 2=junction-j1, 3=junction-j2, 4=junction-y, 5=trunk, 6=disposal bin, 7=outlet, 8=inlet
|
||||
|
||||
var/dpdir = 0 // directions as disposalpipe
|
||||
var/base_state = "pipe-s"
|
||||
@@ -42,9 +43,26 @@
|
||||
if(5)
|
||||
base_state = "pipe-t"
|
||||
dpdir = dir
|
||||
// disposal bin has only one dir, thus we don't need to care about setting it
|
||||
if(6)
|
||||
if(anchored)
|
||||
base_state = "disposal"
|
||||
else
|
||||
base_state = "condisposal"
|
||||
|
||||
if(7)
|
||||
base_state = "outlet"
|
||||
dpdir = dir
|
||||
|
||||
if(8)
|
||||
base_state = "intake"
|
||||
dpdir = dir
|
||||
|
||||
|
||||
icon_state = "con[base_state]"
|
||||
if(ptype<6)
|
||||
icon_state = "con[base_state]"
|
||||
else
|
||||
icon_state = base_state
|
||||
|
||||
if(invisibility) // if invisible, fade icon
|
||||
icon -= rgb(0,0,0,128)
|
||||
@@ -93,6 +111,12 @@
|
||||
return /obj/structure/disposalpipe/junction
|
||||
if(5)
|
||||
return /obj/structure/disposalpipe/trunk
|
||||
if(6)
|
||||
return /obj/machinery/disposal
|
||||
if(7)
|
||||
return /obj/structure/disposaloutlet
|
||||
if(8)
|
||||
return /obj/machinery/disposal/deliveryChute
|
||||
return
|
||||
|
||||
|
||||
@@ -102,48 +126,98 @@
|
||||
// weldingtool: convert to real pipe
|
||||
|
||||
attackby(var/obj/item/I, var/mob/user)
|
||||
var/nicetype = "pipe"
|
||||
var/ispipe = 0 // Indicates if we should change the level of this pipe
|
||||
switch(ptype)
|
||||
if(6)
|
||||
nicetype = "disposal bin"
|
||||
if(7)
|
||||
nicetype = "disposal outlet"
|
||||
if(8)
|
||||
nicetype = "delivery chute"
|
||||
else
|
||||
nicetype = "pipe"
|
||||
ispipe = 1
|
||||
|
||||
var/turf/T = src.loc
|
||||
if(T.intact)
|
||||
user << "You can only attach the pipe if the floor plating is removed."
|
||||
user << "You can only attach the [nicetype] if the floor plating is removed."
|
||||
return
|
||||
|
||||
var/obj/structure/disposalpipe/CP = locate() in T
|
||||
if(CP)
|
||||
update()
|
||||
var/pdir = CP.dpdir
|
||||
if(istype(CP, /obj/structure/disposalpipe/broken))
|
||||
pdir = CP.dir
|
||||
if(pdir & dpdir)
|
||||
user << "There is already a pipe at that location."
|
||||
if(ptype>=6) // Disposal or outlet
|
||||
if(CP) // There's something there
|
||||
if(!istype(CP,/obj/structure/disposalpipe/trunk))
|
||||
user << "The [nicetype] requires a trunk underneath it in order to work."
|
||||
return
|
||||
else // Nothing under, fuck.
|
||||
user << "The [nicetype] requires a trunk underneath it in order to work."
|
||||
return
|
||||
else
|
||||
if(CP)
|
||||
update()
|
||||
var/pdir = CP.dpdir
|
||||
if(istype(CP, /obj/structure/disposalpipe/broken))
|
||||
pdir = CP.dir
|
||||
if(pdir & dpdir)
|
||||
user << "There is already a [nicetype] at that location."
|
||||
return
|
||||
|
||||
var/obj/structure/disposalpipe/trunk/Trunk = CP
|
||||
|
||||
if(istype(I, /obj/item/weapon/wrench))
|
||||
if(anchored)
|
||||
anchored = 0
|
||||
level = 2
|
||||
density = 1
|
||||
user << "You detach the pipe from the underfloor."
|
||||
if(ispipe)
|
||||
level = 2
|
||||
density = 0
|
||||
else
|
||||
density = 1
|
||||
user << "You detach the [nicetype] from the underfloor."
|
||||
else
|
||||
anchored = 1
|
||||
level = 1
|
||||
density = 0
|
||||
user << "You attach the pipe to the underfloor."
|
||||
if(ispipe)
|
||||
level = 1 // We don't want disposal bins to disappear under the floors
|
||||
density = 0
|
||||
else
|
||||
density = 1 // We don't want disposal bins or outlets to go density 0
|
||||
user << "You attach the [nicetype] to the underfloor."
|
||||
playsound(src.loc, 'Ratchet.ogg', 100, 1)
|
||||
update()
|
||||
|
||||
else if(istype(I, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/W = I
|
||||
if(W.remove_fuel(0,user))
|
||||
playsound(src.loc, 'Welder2.ogg', 100, 1)
|
||||
user << "Welding the pipe in place."
|
||||
user << "Welding the [nicetype] in place."
|
||||
W:welding = 2
|
||||
if(do_after(user, 20))
|
||||
update()
|
||||
var/pipetype = dpipetype()
|
||||
var/obj/structure/disposalpipe/P = new pipetype(src.loc)
|
||||
P.base_icon_state = base_state
|
||||
P.dir = dir
|
||||
P.dpdir = dpdir
|
||||
P.updateicon()
|
||||
user << "The [nicetype] has been welded in place!"
|
||||
update() // TODO: Make this neat
|
||||
if(ispipe) // Pipe
|
||||
|
||||
var/pipetype = dpipetype()
|
||||
var/obj/structure/disposalpipe/P = new pipetype(src.loc)
|
||||
P.base_icon_state = base_state
|
||||
P.dir = dir
|
||||
P.dpdir = dpdir
|
||||
P.updateicon()
|
||||
|
||||
else if(ptype==6) // Disposal bin
|
||||
var/obj/machinery/disposal/P = new /obj/machinery/disposal(src.loc)
|
||||
P.mode = 0 // start with pump off
|
||||
|
||||
else if(ptype==7) // Disposal outlet
|
||||
|
||||
var/obj/structure/disposaloutlet/P = new /obj/structure/disposaloutlet(src.loc)
|
||||
P.dir = dir
|
||||
Trunk.linked = P
|
||||
|
||||
else if(ptype==8) // Disposal outlet
|
||||
|
||||
var/obj/machinery/disposal/deliveryChute/P = new /obj/machinery/disposal/deliveryChute(src.loc)
|
||||
P.dir = dir
|
||||
|
||||
del(src)
|
||||
return
|
||||
W:welding = 1
|
||||
|
||||
@@ -46,6 +46,37 @@
|
||||
|
||||
if(isrobot(user) && !istype(I, /obj/item/weapon/trashbag))
|
||||
return
|
||||
if(mode<=0) // It's off
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
if(mode==0) // It's off but still not unscrewed
|
||||
mode=-1 // Set it to doubleoff l0l
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
user << "You remove the screws around the power connection."
|
||||
return
|
||||
else if(mode==-1)
|
||||
mode=0
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
user << "You attach the screws around the power connection."
|
||||
return
|
||||
else if(istype(I,/obj/item/weapon/weldingtool) && mode==-1)
|
||||
var/obj/item/weapon/weldingtool/W = I
|
||||
if(W.remove_fuel(0,user))
|
||||
playsound(src.loc, 'Welder2.ogg', 100, 1)
|
||||
user << "You start slicing the floorweld off the disposal unit."
|
||||
W:welding = 2
|
||||
if(do_after(user,20))
|
||||
user << "You sliced the floorweld off the disposal unit."
|
||||
var/obj/structure/disposalconstruct/C = new (src.loc)
|
||||
C.ptype = 6 // 6 = disposal unit
|
||||
C.anchored = 1
|
||||
C.density = 1
|
||||
C.update()
|
||||
del(src)
|
||||
W:welding = 1
|
||||
return
|
||||
else
|
||||
user << "You need more welding fuel to complete this task."
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/weapon/melee/energy/blade))
|
||||
user << "You can't place that item inside the disposal unit."
|
||||
@@ -167,6 +198,11 @@
|
||||
if(user && user.loc == src)
|
||||
usr << "\red You cannot reach the controls from inside."
|
||||
return
|
||||
/*
|
||||
if(mode==-1)
|
||||
usr << "\red The disposal units power is disabled."
|
||||
return
|
||||
*/
|
||||
interact(user, 0)
|
||||
|
||||
// user interaction
|
||||
@@ -187,7 +223,7 @@
|
||||
|
||||
dat += "<BR><HR><A href='?src=\ref[src];eject=1'>Eject contents</A><HR>"
|
||||
|
||||
if(mode == 0)
|
||||
if(mode <= 0)
|
||||
dat += "Pump: <B>Off</B> <A href='?src=\ref[src];pump=1'>On</A><BR>"
|
||||
else if(mode == 1)
|
||||
dat += "Pump: <A href='?src=\ref[src];pump=0'>Off</A> <B>On</B> (pressurizing)<BR>"
|
||||
@@ -209,6 +245,10 @@
|
||||
if(usr.loc == src)
|
||||
usr << "\red You cannot reach the controls from inside."
|
||||
return
|
||||
|
||||
if(mode==-1 && !href_list["eject"]) // only allow ejecting if mode is -1
|
||||
usr << "\red The disposal units power is disabled."
|
||||
return
|
||||
..()
|
||||
src.add_fingerprint(usr)
|
||||
if(stat & BROKEN)
|
||||
@@ -264,7 +304,7 @@
|
||||
overlays += image('disposal.dmi', "dispover-handle")
|
||||
|
||||
// only handle is shown if no power
|
||||
if(stat & NOPOWER)
|
||||
if(stat & NOPOWER || mode == -1)
|
||||
return
|
||||
|
||||
// check for items in disposal - occupied light
|
||||
@@ -283,6 +323,9 @@
|
||||
if(stat & BROKEN) // nothing can happen if broken
|
||||
return
|
||||
|
||||
if(!air_contents) // Potentially causes a runtime otherwise (if this is really shitty, blame pete //Donkie)
|
||||
return
|
||||
|
||||
flush_count++
|
||||
if( flush_count >= flush_every_ticks )
|
||||
if( contents.len )
|
||||
@@ -803,6 +846,8 @@
|
||||
C.ptype = 5
|
||||
|
||||
C.dir = dir
|
||||
C.density = 0
|
||||
C.anchored = 1
|
||||
C.update()
|
||||
|
||||
del(src)
|
||||
@@ -1030,6 +1075,37 @@
|
||||
update()
|
||||
return
|
||||
|
||||
// Override attackby so we disallow trunkremoval when somethings ontop
|
||||
attackby(var/obj/item/I, var/mob/user)
|
||||
|
||||
if(linked != null)
|
||||
return
|
||||
|
||||
var/turf/T = src.loc
|
||||
if(T.intact)
|
||||
return // prevent interaction with T-scanner revealed pipes
|
||||
|
||||
if(istype(I, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/W = I
|
||||
|
||||
if(W.welding)
|
||||
if(W.remove_fuel(0,user))
|
||||
W:welding = 2
|
||||
playsound(src.loc, 'Welder2.ogg', 100, 1)
|
||||
// check if anything changed over 2 seconds
|
||||
var/turf/uloc = user.loc
|
||||
var/atom/wloc = W.loc
|
||||
user << "Slicing the disposal pipe."
|
||||
sleep(30)
|
||||
if(user.loc == uloc && wloc == W.loc)
|
||||
welded()
|
||||
else
|
||||
user << "You must stay still while welding the pipe."
|
||||
W:welding = 1
|
||||
else
|
||||
user << "You need more welding fuel to cut the pipe."
|
||||
return
|
||||
|
||||
// would transfer to next pipe segment, but we are in a trunk
|
||||
// if not entering from disposal bin,
|
||||
// transfer to linked object (outlet or bin)
|
||||
@@ -1091,6 +1167,7 @@
|
||||
anchored = 1
|
||||
var/active = 0
|
||||
var/turf/target // this will be where the output objects are 'thrown' to.
|
||||
var/mode = 0
|
||||
|
||||
New()
|
||||
..()
|
||||
@@ -1111,13 +1188,47 @@
|
||||
for(var/atom/movable/AM in H)
|
||||
AM.loc = src.loc
|
||||
AM.pipe_eject(dir)
|
||||
spawn(1)
|
||||
spawn(5)
|
||||
AM.throw_at(target, 3, 1)
|
||||
H.vent_gas(src.loc)
|
||||
del(H)
|
||||
|
||||
return
|
||||
|
||||
attackby(var/obj/item/I, var/mob/user)
|
||||
if(!I || !user)
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
if(mode==0)
|
||||
mode=1
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
user << "You remove the screws around the power connection."
|
||||
return
|
||||
else if(mode==1)
|
||||
mode=0
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
user << "You attach the screws around the power connection."
|
||||
return
|
||||
else if(istype(I,/obj/item/weapon/weldingtool) && mode==1)
|
||||
var/obj/item/weapon/weldingtool/W = I
|
||||
if(W.remove_fuel(0,user))
|
||||
playsound(src.loc, 'Welder2.ogg', 100, 1)
|
||||
user << "You start slicing the floorweld off the disposal outlet."
|
||||
W:welding = 2
|
||||
if(do_after(user,20))
|
||||
user << "You sliced the floorweld off the disposal outlet."
|
||||
var/obj/structure/disposalconstruct/C = new (src.loc)
|
||||
C.ptype = 7 // 7 = outlet
|
||||
C.update()
|
||||
C.anchored = 1
|
||||
C.density = 1
|
||||
del(src)
|
||||
W:welding = 1
|
||||
return
|
||||
else
|
||||
user << "You need more welding fuel to complete this task."
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -208,9 +208,13 @@
|
||||
density = 0
|
||||
icon_state = "intake"
|
||||
|
||||
var/c_mode = 0
|
||||
interact()
|
||||
return
|
||||
|
||||
update()
|
||||
return
|
||||
|
||||
HasEntered(AM as mob|obj) //Go straight into the chute
|
||||
if (istype(AM, /obj))
|
||||
var/obj/O = AM
|
||||
@@ -254,4 +258,39 @@
|
||||
if(mode == 2) // if was ready,
|
||||
mode = 1 // switch to charging
|
||||
update()
|
||||
return
|
||||
return
|
||||
|
||||
attackby(var/obj/item/I, var/mob/user)
|
||||
if(!I || !user)
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
if(c_mode==0)
|
||||
c_mode=1
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
user << "You remove the screws around the power connection."
|
||||
return
|
||||
else if(c_mode==1)
|
||||
c_mode=0
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
user << "You attach the screws around the power connection."
|
||||
return
|
||||
else if(istype(I,/obj/item/weapon/weldingtool) && c_mode==1)
|
||||
var/obj/item/weapon/weldingtool/W = I
|
||||
if(W.remove_fuel(0,user))
|
||||
playsound(src.loc, 'Welder2.ogg', 100, 1)
|
||||
user << "You start slicing the floorweld off the delivery chute."
|
||||
W:welding = 2
|
||||
if(do_after(user,20))
|
||||
user << "You sliced the floorweld off the delivery chute."
|
||||
var/obj/structure/disposalconstruct/C = new (src.loc)
|
||||
C.ptype = 8 // 8 = Delivery chute
|
||||
C.update()
|
||||
C.anchored = 1
|
||||
C.density = 1
|
||||
del(src)
|
||||
W:welding = 1
|
||||
return
|
||||
else
|
||||
user << "You need more welding fuel to complete this task."
|
||||
return
|
||||
@@ -46,6 +46,14 @@ Stuff which is in development and not yet visible to players or just code relate
|
||||
should be listed in the changelog upon commit tho. Thanks. -->
|
||||
|
||||
<!-- To take advantage of the pretty new format (well it was new when I wrote this anyway), open the "add-to-changelog.html" file in any browser and add the stuff and then generate the html code and paste it here -->
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">Monday, May 28th</h2>
|
||||
<h3 class="author">Donkie updated:</h3>
|
||||
<ul class="changes bgimages16">
|
||||
<li class="rscadd">You can now dispense Disposal Bins, Outlets and Chutes from the disposal dispenser. These are movable and you can attach them above open trunks with a wrench, then weld them to attach them completely. You can remove Bins by turning off their pump, then screwdriver, then weld, then wrench. Same with outlet and chute except for the pump part.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">Saturday, May 26th</h2>
|
||||
<h3 class="author">Icarus updated:</h3>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
Reference in New Issue
Block a user