mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 01:53:35 +01:00
Moved the tank dispenser define out of defines.
Changed the tank dispenser path from /obj/machinery/dispenser to /obj/structure/dispenser. Fixed a bedsheet bin bug. Updated the map and away missions. Removed assistantChamber.dmm and desert.dmm. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4906 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -152,8 +152,7 @@ LINEN BINS
|
||||
B = sheets[sheets.len]
|
||||
sheets.Remove(B)
|
||||
|
||||
else if(amount >= 1)
|
||||
amount--
|
||||
else
|
||||
B = new /obj/item/weapon/bedsheet(loc)
|
||||
|
||||
B.loc = user.loc
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
/obj/structure/dispenser
|
||||
name = "tank storage unit"
|
||||
desc = "A simple yet bulky storage device for gas tanks. Has room for up to ten oxygen tanks, and ten plasma tanks."
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "dispenser"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/oxygentanks = 10
|
||||
var/plasmatanks = 10
|
||||
var/list/oxytanks = list() //sorry for the similar var names
|
||||
var/list/platanks = list()
|
||||
|
||||
|
||||
/obj/structure/dispenser/oxygen
|
||||
plasmatanks = 0
|
||||
|
||||
/obj/structure/dispenser/plasma
|
||||
oxygentanks = 0
|
||||
|
||||
|
||||
/obj/structure/dispenser/New()
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/structure/dispenser/update_icon()
|
||||
overlays = null
|
||||
switch(oxygentanks)
|
||||
if(1 to 3) overlays += "oxygen-[oxygentanks]"
|
||||
if(4 to INFINITY) overlays += "oxygen-4"
|
||||
switch(plasmatanks)
|
||||
if(1 to 4) overlays += "plasma-[plasmatanks]"
|
||||
if(5 to INFINITY) overlays += "plasma-5"
|
||||
|
||||
|
||||
/obj/structure/dispenser/attack_hand(mob/user as mob)
|
||||
user.machine = src
|
||||
var/dat = "[src]<br><br>"
|
||||
dat += "Oxygen tanks: [oxygentanks] - [oxygentanks ? "<A href='?src=\ref[src];oxygen=1'>Dispense</A>" : "empty"]<br>"
|
||||
dat += "Plasma tanks: [plasmatanks] - [plasmatanks ? "<A href='?src=\ref[src];plasma=1'>Dispense</A>" : "empty"]"
|
||||
user << browse(dat, "window=dispenser")
|
||||
onclose(user, "dispenser")
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/dispenser/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/tank/oxygen) || istype(I, /obj/item/weapon/tank/air) || istype(I, /obj/item/weapon/tank/anesthetic))
|
||||
if(oxygentanks < 10)
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
oxytanks.Add(I)
|
||||
oxygentanks++
|
||||
user << "<span class='notice'>You put [I] in [src].</span>"
|
||||
else
|
||||
user << "<span class='notice'>[src] is full.</span>"
|
||||
if(istype(I, /obj/item/weapon/tank/plasma))
|
||||
if(plasmatanks < 10)
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
platanks.Add(I)
|
||||
plasmatanks++
|
||||
user << "<span class='notice'>You put [I] in [src].</span>"
|
||||
else
|
||||
user << "<span class='notice'>[src] is full.</span>"
|
||||
updateUsrDialog()
|
||||
|
||||
|
||||
/obj/structure/dispenser/Topic(href, href_list)
|
||||
if(usr.stat || usr.restrained())
|
||||
return
|
||||
if(get_dist(src, usr) <= 1)
|
||||
usr.machine = src
|
||||
if(href_list["oxygen"])
|
||||
if(oxygentanks > 0)
|
||||
var/obj/item/weapon/tank/oxygen/O
|
||||
if(oxytanks.len == oxygentanks)
|
||||
O = oxytanks[1]
|
||||
oxytanks.Remove(O)
|
||||
else
|
||||
O = new /obj/item/weapon/tank/oxygen(loc)
|
||||
O.loc = loc
|
||||
usr << "<span class='notice'>You take [O] out of [src].</span>"
|
||||
oxygentanks--
|
||||
update_icon()
|
||||
if(href_list["plasma"])
|
||||
if(plasmatanks > 0)
|
||||
var/obj/item/weapon/tank/plasma/P
|
||||
if(platanks.len == plasmatanks)
|
||||
P = platanks[1]
|
||||
platanks.Remove(P)
|
||||
else
|
||||
P = new /obj/item/weapon/tank/plasma(loc)
|
||||
P.loc = loc
|
||||
usr << "<span class='notice'>You take [P] out of [src].</span>"
|
||||
plasmatanks--
|
||||
update_icon()
|
||||
add_fingerprint(usr)
|
||||
updateUsrDialog()
|
||||
else
|
||||
usr << browse(null, "window=dispenser")
|
||||
return
|
||||
return
|
||||
Reference in New Issue
Block a user