Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Nov 29, 2023
1 parent ddc2087 commit 4b3484c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
8 changes: 4 additions & 4 deletions code/__DEFINES/vendors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
#define VEND_LOAD_AMMO_BOXES (1<<9)

// Redemption Tokens
#define TOKEN_ENGINEER "Engineer"
#define TOKEN_SPEC "Specialist"
#define TOKEN_SYNTH "Synthetic"
#define VEND_TOKEN_ENGINEER "Engineer"
#define VEND_TOKEN_SPEC "Specialist"
#define VEND_TOKEN_SYNTH "Synthetic"
/// Token invalid/unrecognised.
#define TOKEN_VOID "Void"
#define VEND_TOKEN_VOID "Void"
14 changes: 5 additions & 9 deletions code/game/machinery/vending/cm_vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -449,21 +449,17 @@ GLOBAL_LIST_EMPTY(vending_products)
redeem_token(attacking_item, user)

/obj/structure/machinery/cm_vending/proc/get_token_type(obj/item/coin/marine/token)
if(istype(token, /obj/item/coin/marine/engineer))
return TOKEN_ENGINEER
if(istype(token, /obj/item/coin/marine/specialist))
return TOKEN_SPEC
if(istype(token, /obj/item/coin/marine/synth))
return TOKEN_SYNTH
return TOKEN_VOID
if(!istype(token))
return VEND_TOKEN_VOID
return token.token_type

/obj/structure/machinery/cm_vending/proc/redeem_token(obj/item/token, mob/user)
var/reward_typepath
switch(get_token_type(token))
if(TOKEN_VOID)
if(VEND_TOKEN_VOID)
to_chat(user, SPAN_WARNING("ERROR: TOKEN NOT RECOGNISED."))
return FALSE
if(TOKEN_SPEC)
if(VEND_TOKEN_SPEC)
reward_typepath = /obj/item/spec_kit/rifleman
else
to_chat(user, SPAN_WARNING("ERROR: INCORRECT TOKEN."))
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/vending/vendor_types/crew/synthetic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ GLOBAL_LIST_INIT(cm_vending_clothing_synth_snowflake, list(
vendor_role = list(JOB_SYNTH)

/obj/structure/machinery/cm_vending/own_points/experimental_tools/redeem_token(obj/item/token, mob/user)
if(get_token_type(token) == TOKEN_SYNTH)
if(get_token_type(token) == VEND_TOKEN_SYNTH)
if(user.drop_inv_item_to_loc(token, src))
available_points = 30
available_points_to_display = available_points
Expand Down
7 changes: 6 additions & 1 deletion code/game/objects/items/devices/coins.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
name = "marine equipment token"
desc = "I wonder what it does?"
icon_state = "coin_copper"
black_market_value = 0
/// What is the token for?
var/token_type = VEND_TOKEN_VOID

/obj/item/coin/marine/attackby(obj/item/W as obj, mob/user as mob) //To remove attaching a string functionality
return
Expand All @@ -129,14 +132,16 @@
name = "marine engineer support token"
desc = "Insert this into an engineer vendor in order to access a support weapon."
icon_state = "coin_gold"
token_type = VEND_TOKEN_ENGINEER

/obj/item/coin/marine/specialist
name = "marine specialist weapon token"
desc = "Insert this into a USCM equipment vendor in order to access a single highly dangerous weapon."
icon_state = "coin_diamond"
token_type = VEND_TOKEN_SPEC

/obj/item/coin/marine/synth
name = "synthetic experimental tool redemption token"
desc = "Insert this into a synthetic experimental tools vendor in order to access a variety of experimental support tools."
icon_state = "coin_synth"
black_market_value = 0
token_type = VEND_TOKEN_SYNTH

0 comments on commit 4b3484c

Please sign in to comment.