/
machine_vending.dm
126 lines (112 loc) · 5.32 KB
/
machine_vending.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/* Mining Points Equipment Vendor */
/obj/machinery/vending/mining_equipment
name = "frontier equipment vendor"
desc = "An equipment vendor for miners, prospectors, and all manner of far reach scroungers. Ore Redemption Points can be spent here to purchase rough-and-tumble goods. Sold by EXOCON."
icon_state = "mining"
icon_deny = "mining-deny"
max_integrity = 500 // A bit more durable than your average snack vendor
integrity_failure = 0.15
armor = list("melee" = 25, "bullet" = 10, "laser" = 5, "energy" = 5, "bomb" = 5, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 70)
tiltable = FALSE
shoot_inventory_chance = 0
circuit = /obj/item/circuitboard/machine/vending/mining_equipment
refill_canister = /obj/item/vending_refill/mining_equipment
vend_ready = "Good luck, you're going to need it."
mining_point_vendor = TRUE
default_price = 100
extra_price = 200
all_items_free = FALSE
// Mining products are handled differently, because I am too lazy to convert this list stolen from the old vendor.
products = list( //if you add something to this, please, for the love of god, sort it by price/type. use tabs and not spaces.
/obj/item/stack/marker_beacon/thirty = 3,
/obj/item/mining_scanner = 2,
/obj/item/t_scanner/adv_mining_scanner = 2,
/obj/item/hivelordstabilizer = 3,
/obj/item/clothing/glasses/meson/gar = 2,
/obj/item/kinetic_crusher = 1,
/obj/item/gun/energy/kinetic_accelerator = 2,
/obj/item/pickaxe/silver = 1,
/obj/item/borg/upgrade/modkit/range = 2,
/obj/item/borg/upgrade/modkit/damage = 2,
/obj/item/borg/upgrade/modkit/cooldown = 2,
/obj/item/borg/upgrade/modkit/aoe/mobs = 1,
/obj/item/lazarus_injector = 1,
/obj/item/survivalcapsule = 2,
/obj/item/survivalcapsule/luxury = 1,
/obj/item/survivalcapsule/luxuryelite = 1
)
var/voucher_items = list(
"Survival Capsule and Explorer's Webbing" = /obj/item/storage/belt/mining/vendor,
"Resonator Kit" = /obj/item/resonator,
"Minebot Kit" = /mob/living/simple_animal/hostile/mining_drone,
"Extraction and Rescue Kit" = /obj/item/extraction_pack,
"Crusher Kit" = /obj/item/kinetic_crusher,
"Mining Conscription Kit" = /obj/item/storage/backpack/duffelbag/mining_conscript,
)
/obj/machinery/vending/mining_equipment/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/mining_voucher))
RedeemVoucher(I, user)
return
return ..()
/obj/machinery/vending/mining_equipment/freebie(mob/fatty, freebies)
message_admins("proc freebie was called on [src] which should never happen. I am causing a runtime to print the stack trace. inform a maintainer")
CRASH("freebie called on [src]")
/obj/machinery/vending/mining_equipment/proc/RedeemVoucher(obj/item/mining_voucher/voucher, mob/redeemer)
var/selection = show_radial_menu(redeemer, src, voucher_items, require_near = TRUE, tooltips = TRUE)
if(!selection || !Adjacent(redeemer) || QDELETED(voucher) || voucher.loc != redeemer)
return
if(voucher_items[selection])
var/drop_location = drop_location()
switch(selection)
if("Survival Capsule and Explorer's Webbing")
new /obj/item/storage/belt/mining/vendor(drop_location)
if("Resonator Kit")
new /obj/item/extinguisher/mini(drop_location)
new /obj/item/resonator(drop_location)
if("Minebot Kit")
new /mob/living/simple_animal/hostile/mining_drone(drop_location)
new /obj/item/weldingtool/hugetank(drop_location)
new /obj/item/clothing/head/welding(drop_location)
new /obj/item/borg/upgrade/modkit/minebot_passthrough(drop_location)
if("Extraction and Rescue Kit")
new /obj/item/extraction_pack(drop_location)
new /obj/item/fulton_core(drop_location)
new /obj/item/stack/marker_beacon/thirty(drop_location)
if("Crusher Kit")
new /obj/item/extinguisher/mini(drop_location)
new /obj/item/kinetic_crusher(drop_location)
if("Mining Conscription Kit")
new /obj/item/storage/backpack/duffelbag/mining_conscript(drop_location)
SSblackbox.record_feedback("tally", "mining_voucher_redeemed", 1, selection)
qdel(voucher)
/obj/item/circuitboard/machine/vending/mining_equipment
name = "mining equipment vendor (Machine Board)"
build_path = /obj/machinery/vending/mining_equipment
req_components = list(
/obj/item/stack/sheet/rglass = 1,
/obj/item/vending_refill/mining_equipment = 1)
/obj/item/vending_refill/mining_equipment
machine_name = "mining equipment vendor"
icon_state = "mining-refill"
/**********************Mining Equipment Voucher**********************/
/obj/item/mining_voucher
name = "mining voucher"
desc = "A token used by EXOCOM associates to redeem a piece of free starter equipment. Use it on a mining equipment vendor."
icon = 'icons/obj/mining.dmi'
icon_state = "mining_voucher"
w_class = WEIGHT_CLASS_TINY
///Conscript kit
/obj/item/storage/backpack/duffelbag/mining_conscript
name = "EXOCOM rapid deployment kit"
desc = "A kit containing everything an aspiring explorer needs to start up a local operation."
custom_price = 1500
/obj/item/storage/backpack/duffelbag/mining_conscript/PopulateContents()
new /obj/item/clothing/glasses/meson(src)
new /obj/item/mining_scanner(src)
new /obj/item/storage/bag/ore(src)
new /obj/item/clothing/suit/hooded/explorer(src)
new /obj/item/clothing/mask/gas/explorer(src)
new /obj/item/gun/energy/kinetic_accelerator(src)
new /obj/item/kitchen/knife/combat/survival(src)
new /obj/item/flashlight/seclite(src)
new /obj/item/clothing/gloves/explorer(src)