mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 02:16:05 +00:00
- Added an areatest verb to debug verbs. This tests areas for whether they have APCs, air alarms, etc. - Added an 'autoname' subtype of obj/machinery/camera. Cameras of this type auto-assign their c_tag, based on which area they're in, followed by a number. For example "Male Dorm #1", "Male Dorm #2", etc. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4806 316c924e-a436-60f5-8080-3fe189b3f50e
296 lines
8.6 KiB
Plaintext
296 lines
8.6 KiB
Plaintext
/obj/structure/bigDelivery
|
|
desc = "A big wrapped package."
|
|
name = "large parcel"
|
|
icon = 'icons/obj/storage.dmi'
|
|
icon_state = "deliverycloset"
|
|
var/obj/wrapped = null
|
|
density = 1
|
|
var/sortTag = 0
|
|
flags = FPRINT
|
|
mouse_drag_pointer = MOUSE_ACTIVE_POINTER
|
|
|
|
attack_hand(mob/user as mob)
|
|
if(wrapped) //sometimes items can disappear. For example, bombs. --rastaf0
|
|
wrapped.loc = (get_turf(src.loc))
|
|
if(istype(wrapped, /obj/structure/closet))
|
|
var/obj/structure/closet/O = wrapped
|
|
O.welded = 0
|
|
del(src)
|
|
return
|
|
|
|
attackby(obj/item/W as obj, mob/user as mob)
|
|
if(istype(W, /obj/item/device/destTagger))
|
|
var/obj/item/device/destTagger/O = W
|
|
|
|
if(src.sortTag != O.currTag)
|
|
var/tag = uppertext(TAGGERLOCATIONS[O.currTag])
|
|
user << "\blue *[tag]*"
|
|
src.sortTag = O.currTag
|
|
playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1)
|
|
|
|
else if(istype(W, /obj/item/weapon/pen))
|
|
var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
|
|
if(!str || !length(str))
|
|
usr << "\red Invalid text."
|
|
return
|
|
for(var/mob/M in viewers())
|
|
M << "\blue [user] labels [src] as [str]."
|
|
src.name = "[src.name] ([str])"
|
|
return
|
|
|
|
/obj/item/smallDelivery
|
|
desc = "A small wrapped package."
|
|
name = "small parcel"
|
|
icon = 'icons/obj/storage.dmi'
|
|
icon_state = "deliverycrateSmall"
|
|
var/obj/item/wrapped = null
|
|
var/sortTag = 0
|
|
flags = FPRINT
|
|
|
|
|
|
attack_self(mob/user as mob)
|
|
if (src.wrapped) //sometimes items can disappear. For example, bombs. --rastaf0
|
|
wrapped.loc = user.loc
|
|
if(ishuman(user))
|
|
user.put_in_hands(wrapped)
|
|
else
|
|
wrapped.loc = get_turf_loc(src)
|
|
|
|
del(src)
|
|
return
|
|
|
|
attackby(obj/item/W as obj, mob/user as mob)
|
|
if(istype(W, /obj/item/device/destTagger))
|
|
var/obj/item/device/destTagger/O = W
|
|
|
|
if(src.sortTag != O.currTag)
|
|
var/tag = uppertext(TAGGERLOCATIONS[O.currTag])
|
|
user << "\blue *[tag]*"
|
|
src.sortTag = O.currTag
|
|
playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1)
|
|
|
|
else if(istype(W, /obj/item/weapon/pen))
|
|
var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
|
|
if(!str || !length(str))
|
|
usr << "\red Invalid text."
|
|
return
|
|
for(var/mob/M in viewers())
|
|
M << "\blue [user] labels [src] as [str]."
|
|
src.name = "[src.name] ([str])"
|
|
return
|
|
|
|
|
|
/obj/item/weapon/packageWrap
|
|
name = "package wrapper"
|
|
icon = 'icons/obj/items.dmi'
|
|
icon_state = "deliveryPaper"
|
|
w_class = 3.0
|
|
var/amount = 25.0
|
|
|
|
|
|
afterattack(var/obj/target as obj, mob/user as mob)
|
|
if(!(istype(target, /obj))) //this really shouldn't be necessary (but it is). -Pete
|
|
return
|
|
if(istype(target, /obj/structure/table) || istype(target, /obj/structure/rack) \
|
|
|| istype(target, /obj/item/smallDelivery) || istype(target,/obj/structure/bigDelivery) \
|
|
|| istype(target, /obj/item/weapon/gift))
|
|
return
|
|
if(target.anchored)
|
|
return
|
|
if(target in user)
|
|
return
|
|
|
|
user.attack_log += text("\[[time_stamp()]\] <font color='blue'>Has used [src.name] on \ref[target]</font>")
|
|
|
|
if (istype(target, /obj/item) && !(istype(target, /obj/item/weapon/storage)))
|
|
var/obj/item/O = target
|
|
if (src.amount > 1)
|
|
var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(get_turf(O.loc)) //Aaannd wrap it up!
|
|
if(!istype(O.loc, /turf))
|
|
if(user.client)
|
|
user.client.screen -= O
|
|
P.wrapped = O
|
|
O.loc = P
|
|
P.add_fingerprint(usr)
|
|
O.add_fingerprint(usr)
|
|
src.add_fingerprint(usr)
|
|
src.amount -= 1
|
|
else if (istype(target, /obj/structure/closet/crate))
|
|
var/obj/structure/closet/crate/O = target
|
|
if (src.amount > 3 && !O.opened)
|
|
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
|
|
P.icon_state = "deliverycrate"
|
|
P.wrapped = O
|
|
O.loc = P
|
|
src.amount -= 3
|
|
else if(src.amount < 3)
|
|
user << "\blue You need more paper."
|
|
else if (istype (target, /obj/structure/closet))
|
|
var/obj/structure/closet/O = target
|
|
if (src.amount > 3 && !O.opened)
|
|
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
|
|
P.wrapped = O
|
|
O.welded = 1
|
|
O.loc = P
|
|
src.amount -= 3
|
|
else if(src.amount < 3)
|
|
user << "\blue You need more paper."
|
|
else
|
|
user << "\blue The object you are trying to wrap is unsuitable for the sorting machinery!"
|
|
if (src.amount <= 0)
|
|
new /obj/item/weapon/c_tube( src.loc )
|
|
del(src)
|
|
return
|
|
return
|
|
|
|
examine()
|
|
if(src in usr)
|
|
usr << "\blue There are [amount] units of package wrap left!"
|
|
..()
|
|
return
|
|
|
|
|
|
/obj/item/device/destTagger
|
|
name = "destination tagger"
|
|
desc = "Used to set the destination of properly wrapped packages."
|
|
icon_state = "forensic0"
|
|
var/currTag = 0
|
|
//The whole system for the sorttype var is determined based on the order of this list,
|
|
//disposals must always be 1, since anything that's untagged will automatically go to disposals, or sorttype = 1 --Superxpdude
|
|
|
|
//If you don't want to fuck up disposals, add to this list, and don't change the order.
|
|
//If you insist on changing the order, you'll have to change every sort junction to reflect the new order. --Pete
|
|
|
|
w_class = 1
|
|
item_state = "electronic"
|
|
flags = FPRINT | TABLEPASS | CONDUCT
|
|
slot_flags = SLOT_BELT
|
|
|
|
proc/openwindow(mob/user as mob)
|
|
var/dat = "<tt><center><h1><b>TagMaster 2.2</b></h1></center>"
|
|
|
|
dat += "<table style='width:100%; padding:4px;'><tr>"
|
|
for (var/i = 1, i <= TAGGERLOCATIONS.len, i++)
|
|
dat += "<td><a href='?src=\ref[src];nextTag=[i]'>[TAGGERLOCATIONS[i]]</a></td>"
|
|
|
|
if (i%4==0)
|
|
dat += "</tr><tr>"
|
|
|
|
dat += "</tr></table><br>Current Selection: [currTag ? TAGGERLOCATIONS[currTag] : "None"]</tt>"
|
|
|
|
user << browse(dat, "window=destTagScreen;size=450x350")
|
|
onclose(user, "destTagScreen")
|
|
|
|
attack_self(mob/user as mob)
|
|
openwindow(user)
|
|
return
|
|
|
|
Topic(href, href_list)
|
|
src.add_fingerprint(usr)
|
|
if(href_list["nextTag"])
|
|
var/n = text2num(href_list["nextTag"])
|
|
src.currTag = n
|
|
openwindow(usr)
|
|
|
|
/obj/machinery/disposal/deliveryChute
|
|
name = "Delivery chute"
|
|
desc = "A chute for big and small packages alike!"
|
|
density = 0
|
|
icon_state = "intake"
|
|
|
|
var/c_mode = 0
|
|
|
|
New()
|
|
..()
|
|
spawn(5)
|
|
trunk = locate() in src.loc
|
|
if(trunk)
|
|
trunk.linked = src // link the pipe trunk to self
|
|
|
|
interact()
|
|
return
|
|
|
|
update()
|
|
return
|
|
|
|
HasEntered(AM as mob|obj) //Go straight into the chute
|
|
if(istype(AM, /obj/item/projectile) || istype(AM, /obj/item/weapon/dummy)) return
|
|
|
|
if(istype(AM, /obj))
|
|
var/obj/O = AM
|
|
O.loc = src
|
|
else if(istype(AM, /mob))
|
|
var/mob/M = AM
|
|
M.loc = src
|
|
src.flush()
|
|
|
|
flush()
|
|
flushing = 1
|
|
flick("intake-closing", src)
|
|
var/deliveryCheck = 0
|
|
var/obj/structure/disposalholder/H = new() // virtual holder object which actually
|
|
// travels through the pipes.
|
|
for(var/obj/structure/bigDelivery/O in src)
|
|
deliveryCheck = 1
|
|
if(O.sortTag == 0)
|
|
O.sortTag = 1
|
|
for(var/obj/item/smallDelivery/O in src)
|
|
deliveryCheck = 1
|
|
if (O.sortTag == 0)
|
|
O.sortTag = 1
|
|
if(deliveryCheck == 0)
|
|
H.destinationTag = 1
|
|
|
|
|
|
H.init(src) // copy the contents of disposer to holder
|
|
|
|
air_contents = new() // new empty gas resv.
|
|
|
|
sleep(10)
|
|
playsound(src, 'sound/machines/disposalflush.ogg', 50, 0, 0)
|
|
sleep(5) // wait for animation to finish
|
|
|
|
|
|
H.start(src) // start the holder processing movement
|
|
flushing = 0
|
|
// now reset disposal state
|
|
flush = 0
|
|
if(mode == 2) // if was ready,
|
|
mode = 1 // switch to charging
|
|
update()
|
|
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, 'sound/items/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, 'sound/items/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, 'sound/items/Welder2.ogg', 100, 1)
|
|
user << "You start slicing the floorweld off the delivery chute."
|
|
if(do_after(user,20))
|
|
if(!src || !W.isOn()) return
|
|
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)
|
|
return
|
|
else
|
|
user << "You need more welding fuel to complete this task."
|
|
return
|