Files
Bubberstation/code/game/objects/items/vending_items.dm
vuonojenmustaturska 8ddc9677c7 examine-code refactor (#44636)
* 1/4 done? maybe?

* more

* stuff

* incremental stuff

* stuff

* stuff & things

* mostly done but not yet

* stuffing

* stuffing 2: electric boogaloo

* Git Commit and the Kingdom of the Crystal Skull

* make it actually compile

* found more stuff

* fixes

* fix AI laws appearing out of order

* fix windows

* should be the remaining stuff

* this time for real

* i guess it should compile too

* fix sechuds
2019-06-19 22:07:57 +02:00

52 lines
1.5 KiB
Plaintext

/*
Vending machine refills can be found at /code/modules/vending/ within each vending machine's respective file
*/
/obj/item/vending_refill
name = "resupply canister"
var/machine_name = "Generic"
icon = 'icons/obj/vending_restock.dmi'
icon_state = "refill_snack"
item_state = "restock_unit"
desc = "A vending machine restock cart."
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
flags_1 = CONDUCT_1
force = 7
throwforce = 10
throw_speed = 1
throw_range = 7
w_class = WEIGHT_CLASS_BULKY
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 30)
// Built automatically from the corresponding vending machine.
// If null, considered to be full. Otherwise, is list(/typepath = amount).
var/list/products
var/list/contraband
var/list/premium
/obj/item/vending_refill/Initialize(mapload)
. = ..()
name = "\improper [machine_name] restocking unit"
/obj/item/vending_refill/examine(mob/user)
. = ..()
var/num = get_part_rating()
if (num == INFINITY)
. += "It's sealed tight, completely full of supplies."
else if (num == 0)
. += "It's empty!"
else
. += "It can restock [num] item\s."
/obj/item/vending_refill/get_part_rating()
if (!products || !contraband || !premium)
return INFINITY
. = 0
for(var/key in products)
. += products[key]
for(var/key in contraband)
. += contraband[key]
for(var/key in premium)
. += premium[key]