-Added new buttons to smart fridges which will let you take out more products at once. The buttons are x5, x10 and x25.

-Increased the fridge capacity to 2000.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5149 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2012-11-21 11:29:13 +00:00
parent 83193eaa95
commit fb90b18664
+13 -5
View File
@@ -11,7 +11,7 @@
idle_power_usage = 5
active_power_usage = 100
flags = NOREACT
var/global/max_n_of_items = 200
var/global/max_n_of_items = 2000
var/item_quants = list()
var/ispowered = 1 //starts powered
var/isbroken = 0
@@ -103,7 +103,10 @@
var/N = item_quants[O]
dat += "<FONT color = 'blue'><B>[capitalize(O)]</B>:"
dat += " [N] </font>"
dat += "<a href='byond://?src=\ref[src];vend=[O]'>Vend</A>"
dat += "<a href='byond://?src=\ref[src];vend=[O];amount=1'>Vend</A> "
dat += "(<a href='byond://?src=\ref[src];vend=[O];amount=5'>x5</A>)"
dat += "(<a href='byond://?src=\ref[src];vend=[O];amount=10'>x10</A>)"
dat += "(<a href='byond://?src=\ref[src];vend=[O];amount=25'>x25</A>)"
dat += "<br>"
dat += "</TT>"
@@ -114,18 +117,23 @@
/obj/machinery/smartfridge/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
var/N = href_list["vend"]
var/amount = text2num(href_list["amount"])
if(item_quants[N] <= 0) // Sanity check, there are probably ways to press the button when it shouldn't be possible.
return
item_quants[N] -= 1
item_quants[N] = max(item_quants[N] - amount, 0)
var/i = amount
for(var/obj/O in contents)
if(O.name == N)
O.loc = src.loc
break
i--
if(i <= 0)
break
src.updateUsrDialog()
return