mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
Fixed all known problems with vending machines.
Fixed a minor visual bug with emagged lockers. Minor botany rebalance by Numbers. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2595 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -163,6 +163,8 @@
|
|||||||
product_slogans = "THIS'S WHERE TH' SEEDS LIVE! GIT YOU SOME!;Hands down the best seed selection on the station!;Also certain mushroom varieties available, more for experts! Get certified today!"
|
product_slogans = "THIS'S WHERE TH' SEEDS LIVE! GIT YOU SOME!;Hands down the best seed selection on the station!;Also certain mushroom varieties available, more for experts! Get certified today!"
|
||||||
product_hidden = "/obj/item/seeds/amanitamycelium;/obj/item/seeds/glowshroom;/obj/item/seeds/libertymycelium;/obj/item/seeds/nettleseed;/obj/item/seeds/plumpmycelium"
|
product_hidden = "/obj/item/seeds/amanitamycelium;/obj/item/seeds/glowshroom;/obj/item/seeds/libertymycelium;/obj/item/seeds/nettleseed;/obj/item/seeds/plumpmycelium"
|
||||||
product_hideamt = "2;2;2;2;2"
|
product_hideamt = "2;2;2;2;2"
|
||||||
|
product_coin = "/obj/item/toy/waterflower"
|
||||||
|
product_coin_amt = "1"
|
||||||
|
|
||||||
/obj/machinery/vending/magivend
|
/obj/machinery/vending/magivend
|
||||||
name = "MagiVend"
|
name = "MagiVend"
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ obj/machinery/hydroponics/proc/mutate() // Mutates the current seed
|
|||||||
src.myseed.yield = 1 // Mushrooms always have a minimum yield of 1.
|
src.myseed.yield = 1 // Mushrooms always have a minimum yield of 1.
|
||||||
|
|
||||||
if(src.myseed.potency != -1) //Not all plants have a potency
|
if(src.myseed.potency != -1) //Not all plants have a potency
|
||||||
src.myseed.potency += rand(-10,10)
|
src.myseed.potency += rand(-25,25)
|
||||||
if(src.myseed.potency < 0)
|
if(src.myseed.potency < 0)
|
||||||
src.myseed.potency = 0
|
src.myseed.potency = 0
|
||||||
else if(src.myseed.potency > 100)
|
else if(src.myseed.potency > 100)
|
||||||
@@ -282,7 +282,7 @@ obj/machinery/hydroponics/proc/hardmutate() // Strongly mutates the current seed
|
|||||||
src.myseed.yield = 1 // Mushrooms always have a minimum yield of 1.
|
src.myseed.yield = 1 // Mushrooms always have a minimum yield of 1.
|
||||||
|
|
||||||
if(src.myseed.potency != -1) //Not all plants have a potency
|
if(src.myseed.potency != -1) //Not all plants have a potency
|
||||||
src.myseed.potency += rand(-20,20)
|
src.myseed.potency += rand(-50,50)
|
||||||
if(src.myseed.potency < 0)
|
if(src.myseed.potency < 0)
|
||||||
src.myseed.potency = 0
|
src.myseed.potency = 0
|
||||||
else if(src.myseed.potency > 100)
|
else if(src.myseed.potency > 100)
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
var/product_name = "generic"
|
var/product_name = "generic"
|
||||||
var/product_path = null
|
var/product_path = null
|
||||||
var/amount = 0
|
var/amount = 0
|
||||||
var/display_color = "blue"
|
|
||||||
|
|
||||||
/obj/machinery/vending/New()
|
/obj/machinery/vending/New()
|
||||||
..()
|
..()
|
||||||
@@ -75,7 +74,6 @@
|
|||||||
var/datum/data/vending_product/R = new /datum/data/vending_product( )
|
var/datum/data/vending_product/R = new /datum/data/vending_product( )
|
||||||
R.product_name = capitalize(temp.name)
|
R.product_name = capitalize(temp.name)
|
||||||
R.product_path = path_list[p]
|
R.product_path = path_list[p]
|
||||||
R.display_color = pick("red","blue","green")
|
|
||||||
// R.amount = text2num(amt_list[p])
|
// R.amount = text2num(amt_list[p])
|
||||||
// src.product_records += R
|
// src.product_records += R
|
||||||
|
|
||||||
@@ -103,6 +101,10 @@
|
|||||||
winset(user, "vendingslot[i].buy", "command=\"skincmd vending;buy[i-1]\"")
|
winset(user, "vendingslot[i].buy", "command=\"skincmd vending;buy[i-1]\"")
|
||||||
winset(user, "vendingwindow.title", "text=\"[src.name]\"")
|
winset(user, "vendingwindow.title", "text=\"[src.name]\"")
|
||||||
var/list/products = src.product_records
|
var/list/products = src.product_records
|
||||||
|
if(extended_inventory)
|
||||||
|
products |= src.hidden_records
|
||||||
|
if(coin)
|
||||||
|
products |= src.coin_records
|
||||||
var/pages = -round(-products.len / 6)
|
var/pages = -round(-products.len / 6)
|
||||||
if (page > pages)
|
if (page > pages)
|
||||||
page = pages
|
page = pages
|
||||||
@@ -129,6 +131,10 @@
|
|||||||
if (get_dist(user, src) > 1)
|
if (get_dist(user, src) > 1)
|
||||||
return
|
return
|
||||||
var/list/products = src.product_records
|
var/list/products = src.product_records
|
||||||
|
if(extended_inventory)
|
||||||
|
products |= src.hidden_records
|
||||||
|
if(coin)
|
||||||
|
products |= src.coin_records
|
||||||
var/pages = -round(-products.len / 6)
|
var/pages = -round(-products.len / 6)
|
||||||
switch(data)
|
switch(data)
|
||||||
if ("pagen")
|
if ("pagen")
|
||||||
@@ -152,6 +158,24 @@
|
|||||||
if (!src.vend_ready)
|
if (!src.vend_ready)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if ((!src.allowed(usr)) && (!src.emagged) && (src.wires & WIRE_SCANID)) //For SECURE VENDING MACHINES YEAH
|
||||||
|
usr << "\red Access denied." //Unless emagged of course
|
||||||
|
flick(src.icon_deny,src)
|
||||||
|
return
|
||||||
|
|
||||||
|
if (R in coin_records)
|
||||||
|
if(!coin)
|
||||||
|
usr << "\blue You need to insert a coin to get this item."
|
||||||
|
return
|
||||||
|
if(coin.string_attached)
|
||||||
|
if(prob(50))
|
||||||
|
usr << "\blue You successfully pull the coin out before the [src] could swallow it."
|
||||||
|
else
|
||||||
|
usr << "\blue You weren't able to pull the coin out fast enough, the machine ate it, string and all."
|
||||||
|
del(coin)
|
||||||
|
else
|
||||||
|
del(coin)
|
||||||
|
|
||||||
R.amount--
|
R.amount--
|
||||||
src.vend_ready = 0
|
src.vend_ready = 0
|
||||||
|
|
||||||
@@ -173,7 +197,7 @@
|
|||||||
/obj/machinery/vending/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
/obj/machinery/vending/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||||
if (istype(W, /obj/item/weapon/card/emag))
|
if (istype(W, /obj/item/weapon/card/emag))
|
||||||
src.emagged = 1
|
src.emagged = 1
|
||||||
user << "You short out the product lock on [src]"
|
user << "You short out the ID lock on [src]"
|
||||||
return
|
return
|
||||||
else if(istype(W, /obj/item/weapon/screwdriver))
|
else if(istype(W, /obj/item/weapon/screwdriver))
|
||||||
src.panel_open = !src.panel_open
|
src.panel_open = !src.panel_open
|
||||||
@@ -192,6 +216,7 @@
|
|||||||
W.loc = src
|
W.loc = src
|
||||||
coin = W
|
coin = W
|
||||||
user << "\blue You insert the [W] into the [src]"
|
user << "\blue You insert the [W] into the [src]"
|
||||||
|
updateWindow(user)
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
..()
|
..()
|
||||||
@@ -215,6 +240,13 @@
|
|||||||
winshow(user, "vendingwindow", 1)
|
winshow(user, "vendingwindow", 1)
|
||||||
user.skincmds["vending"] = src
|
user.skincmds["vending"] = src
|
||||||
|
|
||||||
|
var/dat = "<B>[src.name]</B>"
|
||||||
|
|
||||||
|
if(coin)
|
||||||
|
dat += "<br>There is a <a href='?src=\ref[src];remove_coin=1'>[coin.name]</a> in the slot!"
|
||||||
|
else
|
||||||
|
dat += "<br>The coin slot is empty."
|
||||||
|
|
||||||
if(panel_open)
|
if(panel_open)
|
||||||
var/list/vendwires = list(
|
var/list/vendwires = list(
|
||||||
"Violet" = 1,
|
"Violet" = 1,
|
||||||
@@ -222,7 +254,7 @@
|
|||||||
"Goldenrod" = 3,
|
"Goldenrod" = 3,
|
||||||
"Green" = 4,
|
"Green" = 4,
|
||||||
)
|
)
|
||||||
var/dat = "<br><hr><br><B>Access Panel</B><br>"
|
dat += "<hr><B>Access Panel</B><br>"
|
||||||
for(var/wiredesc in vendwires)
|
for(var/wiredesc in vendwires)
|
||||||
var/is_uncut = src.wires & APCWireColorToFlag[vendwires[wiredesc]]
|
var/is_uncut = src.wires & APCWireColorToFlag[vendwires[wiredesc]]
|
||||||
dat += "[wiredesc] wire: "
|
dat += "[wiredesc] wire: "
|
||||||
@@ -241,11 +273,10 @@
|
|||||||
|
|
||||||
if(product_slogans != "")
|
if(product_slogans != "")
|
||||||
dat += "The speaker switch is [src.shut_up ? "off" : "on"]. <a href='?src=\ref[src];togglevoice=[1]'>Toggle</a>"
|
dat += "The speaker switch is [src.shut_up ? "off" : "on"]. <a href='?src=\ref[src];togglevoice=[1]'>Toggle</a>"
|
||||||
|
|
||||||
user << browse(dat, "")
|
user << browse(dat, "")
|
||||||
onclose(user, "")
|
onclose(user, "")
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
/obj/machinery/vending/Topic(href, href_list)
|
/obj/machinery/vending/Topic(href, href_list)
|
||||||
if(stat & (BROKEN|NOPOWER))
|
if(stat & (BROKEN|NOPOWER))
|
||||||
return
|
return
|
||||||
@@ -272,6 +303,8 @@
|
|||||||
usr.put_in_hand(coin)
|
usr.put_in_hand(coin)
|
||||||
usr << "\blue You remove the [coin] from the [src]"
|
usr << "\blue You remove the [coin] from the [src]"
|
||||||
coin = null
|
coin = null
|
||||||
|
updateWindow(usr)
|
||||||
|
usr.skincmds["vending"] = src
|
||||||
|
|
||||||
|
|
||||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
|
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
|
||||||
@@ -338,6 +371,8 @@
|
|||||||
src.mend(twire)
|
src.mend(twire)
|
||||||
else
|
else
|
||||||
src.cut(twire)
|
src.cut(twire)
|
||||||
|
updateWindow(usr)
|
||||||
|
usr.skincmds["vending"] = src
|
||||||
|
|
||||||
else if ((href_list["pulsewire"]) && (src.panel_open))
|
else if ((href_list["pulsewire"]) && (src.panel_open))
|
||||||
var/twire = text2num(href_list["pulsewire"])
|
var/twire = text2num(href_list["pulsewire"])
|
||||||
@@ -349,6 +384,8 @@
|
|||||||
return
|
return
|
||||||
else
|
else
|
||||||
src.pulse(twire)
|
src.pulse(twire)
|
||||||
|
updateWindow(usr)
|
||||||
|
usr.skincmds["vending"] = src
|
||||||
|
|
||||||
else if ((href_list["togglevoice"]) && (src.panel_open))
|
else if ((href_list["togglevoice"]) && (src.panel_open))
|
||||||
src.shut_up = !src.shut_up
|
src.shut_up = !src.shut_up
|
||||||
|
|||||||
@@ -4,6 +4,12 @@
|
|||||||
return 0
|
return 0
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
/obj/structure/closet/secure_closet/close()
|
||||||
|
..()
|
||||||
|
if(broken)
|
||||||
|
icon_state = src.icon_off
|
||||||
|
return 1
|
||||||
|
|
||||||
/obj/structure/closet/secure_closet/emp_act(severity)
|
/obj/structure/closet/secure_closet/emp_act(severity)
|
||||||
for(var/obj/O in src)
|
for(var/obj/O in src)
|
||||||
O.emp_act(severity)
|
O.emp_act(severity)
|
||||||
@@ -35,7 +41,8 @@
|
|||||||
broken = 1
|
broken = 1
|
||||||
locked = 0
|
locked = 0
|
||||||
desc = "It appears to be broken."
|
desc = "It appears to be broken."
|
||||||
icon_state = src.icon_broken
|
icon_state = icon_off
|
||||||
|
flick(icon_broken, src)
|
||||||
if(istype(W, /obj/item/weapon/melee/energy/blade))
|
if(istype(W, /obj/item/weapon/melee/energy/blade))
|
||||||
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
||||||
spark_system.set_up(5, 0, src.loc)
|
spark_system.set_up(5, 0, src.loc)
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
@@ -1222,7 +1222,7 @@ window "vendingslot"
|
|||||||
is-maximized = false
|
is-maximized = false
|
||||||
can-scroll = none
|
can-scroll = none
|
||||||
icon = ""
|
icon = ""
|
||||||
image = 'icons\\vendingslot_bg.png'
|
image = ""
|
||||||
image-mode = stretch
|
image-mode = stretch
|
||||||
keep-aspect = false
|
keep-aspect = false
|
||||||
transparent-color = none
|
transparent-color = none
|
||||||
@@ -1291,8 +1291,8 @@ window "vendingslot"
|
|||||||
anchor1 = none
|
anchor1 = none
|
||||||
anchor2 = none
|
anchor2 = none
|
||||||
font-family = ""
|
font-family = ""
|
||||||
font-size = 14
|
font-size = 11
|
||||||
font-style = ""
|
font-style = "bold"
|
||||||
text-color = #000000
|
text-color = #000000
|
||||||
background-color = none
|
background-color = none
|
||||||
is-visible = true
|
is-visible = true
|
||||||
@@ -1304,12 +1304,12 @@ window "vendingslot"
|
|||||||
right-click = false
|
right-click = false
|
||||||
saved-params = ""
|
saved-params = ""
|
||||||
on-size = ""
|
on-size = ""
|
||||||
text = "HoNK"
|
text = "Cuban Pete's Double Bearded Wine LOL LINES"
|
||||||
image = ""
|
image = ""
|
||||||
image-mode = center
|
image-mode = center
|
||||||
keep-aspect = false
|
keep-aspect = false
|
||||||
align = center
|
align = center
|
||||||
text-wrap = false
|
text-wrap = true
|
||||||
|
|
||||||
window "vendingwindow"
|
window "vendingwindow"
|
||||||
elem "vendingwindow"
|
elem "vendingwindow"
|
||||||
|
|||||||
Reference in New Issue
Block a user