diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm
index f45c5d438d1..f8609bf2908 100644
--- a/code/datums/supplypacks.dm
+++ b/code/datums/supplypacks.dm
@@ -987,3 +987,10 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
cost = 30
containername = "crate" //let's keep it subtle, eh?
contraband = 1
+
+/datum/supply_packs/misc/autodrobe
+ name = "Autodrobe Supply crate"
+ contains = list(/obj/item/weapon/vending_refill/autodrobe,
+ /obj/item/weapon/vending_refill/autodrobe)
+ cost = 15
+ containername = "autodrobe supply crate"
diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm
index ad463093184..7285681f5dd 100644
--- a/code/game/machinery/vending.dm
+++ b/code/game/machinery/vending.dm
@@ -112,11 +112,8 @@
var/to_restock = 0
for(var/datum/data/vending_product/machine_content in machine)
- //first pass we count how many items are missing
to_restock += machine_content.max_amount - machine_content.amount
-
- //we attempt to go on the "fast lane" (restock all to max)
if(to_restock <= refill.charges)
for(var/datum/data/vending_product/machine_content in machine)
if(machine_content.amount != machine_content.max_amount)
@@ -125,23 +122,17 @@
refill.charges -= to_restock
total = to_restock
else
- //We need to stock items equally in each categories based on the amount of items missing.
- //This algorithm will restock each category by percentage, the more items being missing, the larger the
- //amount of refills it will get, keeps stocks even.
- var/tmp_charges = refill.charges //we need to cache the charges to keep the equation from changing
+ var/tmp_charges = refill.charges
for(var/datum/data/vending_product/machine_content in machine)
var/restock = Ceiling(((machine_content.max_amount - machine_content.amount)/to_restock)*tmp_charges)
-
- //we cannot restock more than what we have, might happen since we are rounding up.
if(restock > refill.charges)
restock = refill.charges
-
machine_content.amount += restock
refill.charges -= restock
total += restock
if(restock)
usr << "[restock] of [machine_content.product_name]"
- if(refill.charges == 0)//due to rounding, we ran out of refill charges, exit.
+ if(refill.charges == 0) //due to rounding, we ran out of refill charges, exit.
break
return total
@@ -171,24 +162,20 @@
return
else if(istype(W, refill_canister) && refill_canister != null)
if(stat & (BROKEN|NOPOWER))
- //we do nothing if the machine is unpowered.
user << "It does nothing."
else if(panel_open)
- //if the panel is open
- //we attempt to refill the machine
+ //if the panel is open we attempt to refill the machine
var/obj/item/weapon/vending_refill/canister = W
if(canister.charges == 0)
- //there is no charge left in this canister.
user << "This [canister.name] is empty!"
else
var/transfered = refill_inventory(canister,product_records,user)
if(transfered)
- user << "You loaded [transfered] items in [name]."
+ user << "You loaded [transfered] items in \the [name]."
else
- user << "[name] is fully stocked."
+ user << "The [name] is fully stocked."
return;
else
- //the service panel is closed, lets "subtly" hint at opening it.
user << "You should probably unscrew the service panel first."
else
..()
@@ -694,6 +681,7 @@
/obj/item/clothing/head/rabbitears =1) //Pretty much everything that had a chance to spawn.
contraband = list(/obj/item/clothing/suit/cardborg = 1,/obj/item/clothing/head/cardborg = 1,/obj/item/clothing/suit/judgerobe = 1,/obj/item/clothing/head/powdered_wig = 1)
premium = list(/obj/item/clothing/suit/hgpirate = 1, /obj/item/clothing/head/hgpiratecap = 1, /obj/item/clothing/head/helmet/roman = 1, /obj/item/clothing/head/helmet/roman/legionaire = 1, /obj/item/clothing/under/roman = 1, /obj/item/clothing/shoes/roman = 1, /obj/item/weapon/shield/riot/roman = 1)
+ refill_canister = /obj/item/weapon/vending_refill/autodrobe
/obj/machinery/vending/dinnerware
name = "dinnerware"
diff --git a/code/game/objects/items/weapons/vending_items.dm b/code/game/objects/items/weapons/vending_items.dm
index 783e48b99ec..3f44e648641 100644
--- a/code/game/objects/items/weapons/vending_items.dm
+++ b/code/game/objects/items/weapons/vending_items.dm
@@ -15,6 +15,7 @@
var/charges = 0 //how many restocking "charges" the refill has
/obj/item/weapon/vending_refill/New()
+ ..()
name = "\improper [machine_name] restocking unit"
/obj/item/weapon/vending_refill/examine()
@@ -23,36 +24,35 @@
if(charges)
usr << "It can restock [charges] item(s)."
else
- usr << "it is empty!"
+ usr << "It's empty!"
//NOTE I decided to go for about 1/3 of a machine's capacity
/obj/item/weapon/vending_refill/boozeomat
machine_name = "Booze-O-Mat"
icon_state = "refill_booze"
- //machine contains max 138 items
- charges = 50
+ charges = 50//of 138
/obj/item/weapon/vending_refill/coffee
machine_name = "hot drinks"
icon_state = "refill_joe"
- //machine contains max 85 items
- charges = 30
+ charges = 30//of 85
/obj/item/weapon/vending_refill/snack
machine_name = "Getmore Chocolate Corp"
- //machine contains max 48 items
- charges = 15
+ charges = 15//of 48
/obj/item/weapon/vending_refill/cola
machine_name = "Robust Softdrinks"
icon_state = "refill_cola"
- //machine contains max 65 items
- charges = 20
+ charges = 20//of 65
/obj/item/weapon/vending_refill/cigarette
machine_name = "cigarette"
icon_state = "refill_smoke"
- //machine contains max 30 items
- charges = 10
+ charges = 10// of 30
+/obj/item/weapon/vending_refill/autodrobe
+ machine_name = "AutoDrobe"
+ icon_state = "refill_costume"
+ charges = 28// of 58
diff --git a/icons/obj/vending_restock.dmi b/icons/obj/vending_restock.dmi
index d9c8ef765c2..ec37cad94c5 100644
Binary files a/icons/obj/vending_restock.dmi and b/icons/obj/vending_restock.dmi differ