mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +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_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_coin = "/obj/item/toy/waterflower"
|
||||
product_coin_amt = "1"
|
||||
|
||||
/obj/machinery/vending/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.
|
||||
|
||||
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)
|
||||
src.myseed.potency = 0
|
||||
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.
|
||||
|
||||
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)
|
||||
src.myseed.potency = 0
|
||||
else if(src.myseed.potency > 100)
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
var/product_name = "generic"
|
||||
var/product_path = null
|
||||
var/amount = 0
|
||||
var/display_color = "blue"
|
||||
|
||||
/obj/machinery/vending/New()
|
||||
..()
|
||||
@@ -75,7 +74,6 @@
|
||||
var/datum/data/vending_product/R = new /datum/data/vending_product( )
|
||||
R.product_name = capitalize(temp.name)
|
||||
R.product_path = path_list[p]
|
||||
R.display_color = pick("red","blue","green")
|
||||
// R.amount = text2num(amt_list[p])
|
||||
// src.product_records += R
|
||||
|
||||
@@ -103,6 +101,10 @@
|
||||
winset(user, "vendingslot[i].buy", "command=\"skincmd vending;buy[i-1]\"")
|
||||
winset(user, "vendingwindow.title", "text=\"[src.name]\"")
|
||||
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)
|
||||
if (page > pages)
|
||||
page = pages
|
||||
@@ -129,6 +131,10 @@
|
||||
if (get_dist(user, src) > 1)
|
||||
return
|
||||
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)
|
||||
switch(data)
|
||||
if ("pagen")
|
||||
@@ -152,6 +158,24 @@
|
||||
if (!src.vend_ready)
|
||||
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--
|
||||
src.vend_ready = 0
|
||||
|
||||
@@ -173,7 +197,7 @@
|
||||
/obj/machinery/vending/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/card/emag))
|
||||
src.emagged = 1
|
||||
user << "You short out the product lock on [src]"
|
||||
user << "You short out the ID lock on [src]"
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/screwdriver))
|
||||
src.panel_open = !src.panel_open
|
||||
@@ -192,6 +216,7 @@
|
||||
W.loc = src
|
||||
coin = W
|
||||
user << "\blue You insert the [W] into the [src]"
|
||||
updateWindow(user)
|
||||
return
|
||||
else
|
||||
..()
|
||||
@@ -215,6 +240,13 @@
|
||||
winshow(user, "vendingwindow", 1)
|
||||
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)
|
||||
var/list/vendwires = list(
|
||||
"Violet" = 1,
|
||||
@@ -222,7 +254,7 @@
|
||||
"Goldenrod" = 3,
|
||||
"Green" = 4,
|
||||
)
|
||||
var/dat = "<br><hr><br><B>Access Panel</B><br>"
|
||||
dat += "<hr><B>Access Panel</B><br>"
|
||||
for(var/wiredesc in vendwires)
|
||||
var/is_uncut = src.wires & APCWireColorToFlag[vendwires[wiredesc]]
|
||||
dat += "[wiredesc] wire: "
|
||||
@@ -239,12 +271,11 @@
|
||||
dat += "The green light is [src.extended_inventory ? "on" : "off"].<BR>"
|
||||
dat += "The [(src.wires & WIRE_SCANID) ? "purple" : "yellow"] light is on.<BR>"
|
||||
|
||||
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>"
|
||||
user << browse(dat, "")
|
||||
onclose(user, "")
|
||||
|
||||
return
|
||||
user << browse(dat, "")
|
||||
onclose(user, "")
|
||||
|
||||
/obj/machinery/vending/Topic(href, href_list)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
@@ -272,6 +303,8 @@
|
||||
usr.put_in_hand(coin)
|
||||
usr << "\blue You remove the [coin] from the [src]"
|
||||
coin = null
|
||||
updateWindow(usr)
|
||||
usr.skincmds["vending"] = src
|
||||
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
|
||||
@@ -338,6 +371,8 @@
|
||||
src.mend(twire)
|
||||
else
|
||||
src.cut(twire)
|
||||
updateWindow(usr)
|
||||
usr.skincmds["vending"] = src
|
||||
|
||||
else if ((href_list["pulsewire"]) && (src.panel_open))
|
||||
var/twire = text2num(href_list["pulsewire"])
|
||||
@@ -349,6 +384,8 @@
|
||||
return
|
||||
else
|
||||
src.pulse(twire)
|
||||
updateWindow(usr)
|
||||
usr.skincmds["vending"] = src
|
||||
|
||||
else if ((href_list["togglevoice"]) && (src.panel_open))
|
||||
src.shut_up = !src.shut_up
|
||||
|
||||
@@ -4,6 +4,12 @@
|
||||
return 0
|
||||
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)
|
||||
for(var/obj/O in src)
|
||||
O.emp_act(severity)
|
||||
@@ -35,7 +41,8 @@
|
||||
broken = 1
|
||||
locked = 0
|
||||
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))
|
||||
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
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
|
||||
can-scroll = none
|
||||
icon = ""
|
||||
image = 'icons\\vendingslot_bg.png'
|
||||
image = ""
|
||||
image-mode = stretch
|
||||
keep-aspect = false
|
||||
transparent-color = none
|
||||
@@ -1291,8 +1291,8 @@ window "vendingslot"
|
||||
anchor1 = none
|
||||
anchor2 = none
|
||||
font-family = ""
|
||||
font-size = 14
|
||||
font-style = ""
|
||||
font-size = 11
|
||||
font-style = "bold"
|
||||
text-color = #000000
|
||||
background-color = none
|
||||
is-visible = true
|
||||
@@ -1304,12 +1304,12 @@ window "vendingslot"
|
||||
right-click = false
|
||||
saved-params = ""
|
||||
on-size = ""
|
||||
text = "HoNK"
|
||||
text = "Cuban Pete's Double Bearded Wine LOL LINES"
|
||||
image = ""
|
||||
image-mode = center
|
||||
keep-aspect = false
|
||||
align = center
|
||||
text-wrap = false
|
||||
text-wrap = true
|
||||
|
||||
window "vendingwindow"
|
||||
elem "vendingwindow"
|
||||
|
||||
Reference in New Issue
Block a user