[MIRROR] fake coins and coin/mint refactors (#10324)

Co-authored-by: Killian <49700375+KillianKirilenko@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-03-06 18:06:37 -07:00
committed by GitHub
parent ab171de574
commit c6483dba4f
12 changed files with 248 additions and 38 deletions

View File

@@ -0,0 +1,117 @@
/*****************************Coin********************************/
// fake "toy" version that allows people to have them as trinkets
// without letting them easily get stuff from vending machines
/obj/item/fake_coin
icon = 'icons/obj/coins.dmi'
name = "Coin"
desc = "A simple coin you can flip. The weight doesn't seem quite right..."
description_fluff = "This isn't a real coin; you can't use it on vending machines."
icon_state = "coin"
randpixel = 8
force = 0.0
throwforce = 0.0
w_class = ITEMSIZE_TINY
slot_flags = SLOT_EARS
var/sides = 2
drop_sound = 'sound/items/drop/ring.ogg'
pickup_sound = 'sound/items/pickup/ring.ogg'
/obj/item/fake_coin/Initialize(mapload)
. = ..()
randpixel_xy()
/obj/item/fake_coin/gold
name = MAT_GOLD + " coin"
desc = "A shiny " + MAT_GOLD + " coin. Just like in the old movies with pirates!"
icon_state = "coin_gold"
/obj/item/fake_coin/silver
name = MAT_SILVER + " coin"
desc = "A shiny " + MAT_SILVER + " coin. You can almost see your reflection in it. Unless you're a vampire."
icon_state = "coin_silver"
/obj/item/fake_coin/copper
name = MAT_COPPER + " coin"
desc = "A sturdy " + MAT_COPPER + " coin. The preferred tender of people who like to make other people count a lot."
icon_state = "coin_copper"
/obj/item/fake_coin/diamond
name = MAT_DIAMOND + " coin"
desc = "A coin made of solid " + MAT_DIAMOND + ". Carbon, really, but who's counting?" // me, I'm counting
icon_state = "coin_diamond"
/obj/item/fake_coin/graphite
name = MAT_GRAPHITE + " coin"
desc = "A small pressed plaque of " + MAT_GRAPHITE + ". This seems... impractical. Maybe you could use it as a pencil in a pinch?"
icon_state = "coin_graphite"
/obj/item/fake_coin/iron
name = MAT_IRON + " coin"
desc = "A dull " + MAT_IRON + " coin. Not that it's boring, it's just a bit plain."
icon_state = "coin_iron"
/obj/item/fake_coin/steel
name = MAT_STEEL + " coin"
desc = "A plain " + MAT_STEEL + " coin. You'd think they'd make more coins out of this, considering how plentiful it is."
icon_state = "coin_steel"
/obj/item/fake_coin/durasteel
name = MAT_DURASTEEL + " coin"
desc = "A shiny " + MAT_DURASTEEL + " coin. Keep it in your breast pocket, maybe it'll stop a bullet someday."
icon_state = "coin_durasteel"
/obj/item/fake_coin/plasteel
name = MAT_PLASTEEL + " coin"
desc = "Someone made a coin out of " + MAT_PLASTEEL + ". Now why would they do that?"
icon_state = "coin_plasteel"
/obj/item/fake_coin/titanium
name = MAT_TITANIUM + " coin"
desc = "A shiny " + MAT_TITANIUM + " coin with some commemorative markings."
icon_state = "coin_titanium"
/obj/item/fake_coin/lead
name = MAT_LEAD + " coin"
desc = "A heavy coin indeed. Shame it's worthless as anything other than a paperweight."
icon_state = "coin_lead"
/obj/item/fake_coin/phoron
name = "solid " + MAT_PHORON + " coin"
desc = "Solid " + MAT_PHORON + ", pressed into a coin and laminated for safety. Go ahead, lick it."
icon_state = "coin_phoron"
/obj/item/fake_coin/uranium
name = MAT_URANIUM + " coin"
desc = "A " + MAT_URANIUM + " coin. You probably don't want to store this in your pants pocket..."
icon_state = "coin_uranium"
/obj/item/fake_coin/platinum
name = MAT_PLATINUM + " coin"
desc = "A shiny " + MAT_PLATINUM + " coin. Truth is, the game was rigged from the start."
icon_state = "coin_platinum"
/obj/item/fake_coin/morphium
name = MAT_MORPHIUM + " coin"
desc = "Solid " + MAT_MORPHIUM + ", made into a coin. Extravagant is putting it lightly."
icon_state = "coin_morphium"
/obj/item/fake_coin/aluminium
name = MAT_ALUMINIUM + " coin"
desc = "Someone decided to make a coin out of" + MAT_ALUMINIUM + ". Now your wallet can be lighter than ever."
icon_state = "coin_aluminium"
/obj/item/fake_coin/verdantium
name = MAT_VERDANTIUM + " coin"
desc = "Shiny green " + MAT_VERDANTIUM + ", pressed into a coin. It almost seems to glimmer under starlight."
icon_state = "coin_verdantium"
/obj/item/fake_coin/attack_self(mob/user as mob)
var/result = rand(1, sides)
var/comment = ""
if(result == 1)
comment = "tails"
else if(result == 2)
comment = "heads"
user.visible_message(span_notice("[user] has thrown \the [src]. It lands on [comment]!"), \
span_notice("You throw \the [src]. It lands on [comment]!"))

View File

@@ -656,12 +656,16 @@
icon_state = "rup"
/obj/random/coin/item_to_spawn()
return pick(prob(5);/obj/item/coin/silver,
return pick(prob(7);/obj/item/coin/copper,
prob(5);/obj/item/coin/silver,
prob(5);/obj/item/coin/steel,
prob(3);/obj/item/coin/iron,
prob(4);/obj/item/coin/gold,
prob(3);/obj/item/coin/titanium,
prob(3);/obj/item/coin/phoron,
prob(1);/obj/item/coin/uranium,
prob(2);/obj/item/coin/platinum,
prob(2);/obj/item/coin/lead,
prob(1);/obj/item/coin/diamond)
//VOREStation Add Start

View File

@@ -30,6 +30,33 @@
display_name = "deck of cards"
path = /obj/item/deck/cards
/datum/gear/fake_coin
display_name = "coin selection"
description = "A small piece of metal often exchanged for goods and services, but no longer considered legal tender in most jurisdictions. Doesn't look like it'll go in the coin slot of vending machines."
path = /obj/item/fake_coin/silver
/datum/gear/fake_coin/New()
..()
var/cointype = list()
cointype["gold"] = /obj/item/fake_coin/gold
cointype["silver"] = /obj/item/fake_coin/silver
cointype["copper"] = /obj/item/fake_coin/copper
cointype["diamond"] = /obj/item/fake_coin/diamond
cointype["graphite"] = /obj/item/fake_coin/graphite
cointype["iron"] = /obj/item/fake_coin/iron
cointype["steel"] = /obj/item/fake_coin/steel
cointype["durasteel"] = /obj/item/fake_coin/durasteel
cointype["plasteel"] = /obj/item/fake_coin/plasteel
cointype["titanium"] = /obj/item/fake_coin/titanium
cointype["lead"] = /obj/item/fake_coin/lead
cointype["phoron"] = /obj/item/fake_coin/phoron
cointype["uranium"] = /obj/item/fake_coin/uranium
cointype["platinum"] = /obj/item/fake_coin/platinum
cointype["morphium"] = /obj/item/fake_coin/morphium
cointype["aluminium"] = /obj/item/fake_coin/aluminium
cointype["verdantium"] = /obj/item/fake_coin/verdantium
gear_tweaks += new/datum/gear_tweak/path(cointype)
/datum/gear/tarot
display_name = "deck of tarot cards"
path = /obj/item/deck/tarot

View File

@@ -1,7 +1,7 @@
/*****************************Coin********************************/
/obj/item/coin
icon = 'icons/obj/items.dmi'
icon = 'icons/obj/coins.dmi'
name = "Coin"
desc = "A simple coin you can flip."
icon_state = "coin"
@@ -15,56 +15,109 @@
drop_sound = 'sound/items/drop/ring.ogg'
pickup_sound = 'sound/items/pickup/ring.ogg'
/obj/item/coin/New()
/obj/item/coin/Initialize(mapload)
. = ..()
randpixel_xy()
/obj/item/coin/gold
name = "gold coin"
name = MAT_GOLD + " coin"
desc = "A shiny " + MAT_GOLD + " coin. Just like in the old movies with pirates!"
icon_state = "coin_gold"
matter = list(MAT_GOLD = 250)
/obj/item/coin/silver
name = "silver coin"
name = MAT_SILVER + " coin"
desc = "A shiny " + MAT_SILVER + " coin. You can almost see your reflection in it. Unless you're a vampire."
icon_state = "coin_silver"
matter = list(MAT_SILVER = 250)
/obj/item/coin/copper
name = MAT_COPPER + " coin"
desc = "A sturdy " + MAT_COPPER + " coin. The preferred tender of people who like to make other people count a lot."
icon_state = "coin_copper"
matter = list(MAT_COPPER = 250)
/obj/item/coin/diamond
name = "diamond coin"
name = MAT_DIAMOND + " coin"
desc = "A coin made of solid " + MAT_DIAMOND + ". Carbon, really, but who's counting?" // me, I'm counting
icon_state = "coin_diamond"
matter = list(MAT_DIAMOND = 250)
/obj/item/coin/graphite
name = MAT_GRAPHITE + " coin"
desc = "A small pressed plaque of " + MAT_GRAPHITE + ". This seems... impractical. Maybe you could use it as a pencil in a pinch?"
icon_state = "coin_graphite"
matter = list(MAT_GRAPHITE = 250)
/obj/item/coin/iron
name = "iron coin"
name = MAT_IRON + " coin"
desc = "A dull " + MAT_IRON + " coin. Not that it's boring, it's just a bit plain."
icon_state = "coin_iron"
matter = list(MAT_IRON = 250)
/obj/item/coin/steel
name = MAT_STEEL + " coin"
desc = "A plain " + MAT_STEEL + " coin. You'd think they'd make more coins out of this, considering how plentiful it is."
icon_state = "coin_steel"
matter = list(MAT_STEEL = 250)
/obj/item/coin/durasteel
name = MAT_DURASTEEL + " coin"
desc = "A shiny " + MAT_DURASTEEL + " coin. Keep it in your breast pocket, maybe it'll stop a bullet someday."
icon_state = "coin_durasteel"
matter = list(MAT_DURASTEEL = 250)
/obj/item/coin/plasteel
name = MAT_PLASTEEL + " coin"
desc = "Someone made a coin out of " + MAT_PLASTEEL + ". Now why would they do that?"
icon_state = "coin_plasteel"
matter = list(MAT_PLASTEEL = 250)
/obj/item/coin/titanium
name = MAT_TITANIUM + " coin"
desc = "A shiny " + MAT_TITANIUM + " coin with some commemorative markings."
icon_state = "coin_titanium"
matter = list(MAT_TITANIUM = 250)
/obj/item/coin/lead
name = MAT_LEAD + " coin"
desc = "A heavy coin indeed. Shame it's worthless as anything other than a paperweight."
icon_state = "coin_lead"
matter = list(MAT_LEAD = 250)
/obj/item/coin/phoron
name = "solid phoron coin"
name = "solid " + MAT_PHORON + " coin"
desc = "Solid " + MAT_PHORON + ", pressed into a coin and laminated for safety. Go ahead, lick it."
icon_state = "coin_phoron"
matter = list(MAT_PHORON = 250)
/obj/item/coin/uranium
name = "uranium coin"
name = MAT_URANIUM + " coin"
desc = "A " + MAT_URANIUM + " coin. You probably don't want to store this in your pants pocket..."
icon_state = "coin_uranium"
matter = list(MAT_URANIUM = 250)
/obj/item/coin/platinum
name = "platinum coin"
icon_state = "coin_adamantine"
name = MAT_PLATINUM + " coin"
desc = "A shiny " + MAT_PLATINUM + " coin. Truth is, the game was rigged from the start."
icon_state = "coin_platinum"
matter = list(MAT_GOLD = 250)
/obj/item/coin/morphium
name = "morphium coin"
name = MAT_MORPHIUM + " coin"
desc = "Solid " + MAT_MORPHIUM + ", made into a coin. Extravagant is putting it lightly."
icon_state = "coin_morphium"
matter = list(MAT_MORPHIUM = 250)
/obj/item/coin/aluminium
name = "aluminium coin"
name = MAT_ALUMINIUM + " coin"
desc = "Someone decided to make a coin out of" + MAT_ALUMINIUM + ". Now your wallet can be lighter than ever."
icon_state = "coin_aluminium"
matter = list(MAT_ALUMINIUM = 250)
/obj/item/coin/verdantium
name = "verdantium coin"
name = MAT_VERDANTIUM + " coin"
desc = "Shiny green " + MAT_VERDANTIUM + ", pressed into a coin. It almost seems to glimmer under starlight."
icon_state = "coin_verdantium"
matter = list(MAT_VERDANTIUM = 250)

View File

@@ -1,39 +1,28 @@
/**********************Mint**************************/
/obj/machinery/mineral/mint
name = "Coin press"
desc = "A relatively crude hand-operated coin press that turns sheets (or ingots, as the case may be) of materials into fresh coins. They're <i>probably</i> not going to be considered legal tender in most polities, but you might fool a vending machine with one..?<br><br><i>It looks like it'll accept silver, gold, diamond, iron, solid phoron, and uranium.</i>"
name = "coin press"
desc = "A relatively crude hand-operated coin press that turns sheets (or ingots, as the case may be) of materials into fresh coins. They're <i>probably</i> not going to be considered legal tender in most polities, but you might fool a vending machine with one..?"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "coinpress0"
density = TRUE
anchored = TRUE
var/coinsToProduce = 6 //how many coins do we make per sheet? a sheet is 2000 units whilst a coin is 250, and some material should be lost in the process
var/list/validMats = list(MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_IRON, MAT_PHORON, MAT_URANIUM) //what's valid stuff to make coins out of?
/obj/machinery/mineral/mint/attackby(obj/item/stack/material/M, mob/user)
if(M.default_type in validMats)
if(!anchored)
user.visible_message(span_warning("\The [src] must be properly secured to operate!"))
return
if(!M.coin_type)
user.visible_message(span_notice("You can't make coins out of that."))
return
else if(M.coin_type)
user.visible_message("[user] starts to feed a sheet of [M.default_type] into \the [src].")
while(M.amount > 0)
icon_state = "coinpress1"
if(do_after(user, 2 SECONDS, src))
M.amount--
if(M.default_type == MAT_SILVER)
while(coinsToProduce-- > 0)
new /obj/item/coin/silver(user.loc)
else if(M.default_type == MAT_GOLD)
while(coinsToProduce-- > 0)
new /obj/item/coin/gold(user.loc)
else if(M.default_type == MAT_DIAMOND)
while(coinsToProduce-- > 0)
new /obj/item/coin/diamond(user.loc)
else if(M.default_type == MAT_IRON)
while(coinsToProduce-- > 0)
new /obj/item/coin/iron(user.loc)
else if(M.default_type == MAT_PHORON)
while(coinsToProduce-- > 0)
new /obj/item/coin/phoron(user.loc)
else if(M.default_type == MAT_URANIUM)
while(coinsToProduce-- > 0)
new /obj/item/coin/uranium(user.loc)
while(coinsToProduce-- > 0)
new M.coin_type(user.loc)
src.visible_message(span_notice("\The [src] rattles and dispenses several [M.default_type] coins!"))
coinsToProduce = initial(coinsToProduce)
if(M.amount == 0)
@@ -45,5 +34,3 @@
to_chat(user,span_warning("\The [src] is hand-operated and requires your full attention!"))
icon_state = "coinpress0"
break
else
src.visible_message(span_notice("\The [src] doesn't look like it'll accept that material."))

View File

@@ -231,6 +231,9 @@ GLOBAL_LIST_EMPTY(vending_products)
if(panel_open)
attack_hand(user)
return
else if(istype(W, /obj/item/fake_coin) && has_premium)
to_chat(user, span_notice("\The [W] doesn't fit into the coin slot on \the [src]."))
return
else if(istype(W, /obj/item/coin) && has_premium)
user.drop_item()
W.forceMove(src)

View File

@@ -16,6 +16,7 @@
var/default_type = MAT_STEEL
var/datum/material/material
var/coin_type = null
var/perunit = SHEET_MATERIAL_AMOUNT
var/apply_colour //temp pending icon rewrite
drop_sound = 'sound/items/drop/axe.ogg'

View File

@@ -5,6 +5,7 @@
no_variants = FALSE
drop_sound = 'sound/items/drop/glass.ogg'
pickup_sound = 'sound/items/pickup/glass.ogg'
coin_type = /obj/item/coin/phoron
/obj/item/stack/material/diamond
name = MAT_DIAMOND
@@ -13,6 +14,7 @@
no_variants = FALSE //CHOMPedit - Variants added
drop_sound = 'sound/items/drop/glass.ogg'
pickup_sound = 'sound/items/pickup/glass.ogg'
coin_type = /obj/item/coin/diamond
/obj/item/stack/material/painite
name = MAT_PAINITE
@@ -54,6 +56,7 @@
default_type = MAT_VERDANTIUM
no_variants = FALSE
apply_colour = TRUE
coin_type = /obj/item/coin/verdantium
/obj/item/stack/material/morphium
name = MAT_MORPHIUM
@@ -62,6 +65,7 @@
default_type = MAT_MORPHIUM
no_variants = FALSE
apply_colour = TRUE
coin_type = /obj/item/coin/morphium
/obj/item/stack/material/glamour
name = MAT_GLAMOUR

View File

@@ -4,6 +4,7 @@
default_type = MAT_STEEL
no_variants = FALSE
apply_colour = TRUE
coin_type = /obj/item/coin/steel
/obj/item/stack/material/plasteel
name = MAT_PLASTEEL
@@ -11,6 +12,7 @@
default_type = MAT_PLASTEEL
no_variants = FALSE
apply_colour = TRUE
coin_type = /obj/item/coin/plasteel
/obj/item/stack/material/plasteel/rebar
name = MAT_PLASTEELREBAR
@@ -32,6 +34,7 @@
default_type = MAT_DURASTEEL
no_variants = FALSE
apply_colour = TRUE
coin_type = /obj/item/coin/durasteel
/obj/item/stack/material/titanium
name = MAT_TITANIUM
@@ -40,6 +43,7 @@
item_state = "sheet-silver"
default_type = MAT_TITANIUM
no_variants = FALSE
coin_type = /obj/item/coin/titanium
/obj/item/stack/material/iron
name = MAT_IRON
@@ -47,6 +51,7 @@
default_type = MAT_IRON
apply_colour = 1
no_variants = FALSE
coin_type = /obj/item/coin/iron
/obj/item/stack/material/lead
name = MAT_LEAD
@@ -54,6 +59,7 @@
default_type = MAT_LEAD
apply_colour = 1
no_variants = FALSE
coin_type = /obj/item/coin/lead
/obj/item/stack/material/gold
name = MAT_GOLD
@@ -61,6 +67,7 @@
default_type = MAT_GOLD
no_variants = FALSE
apply_colour = TRUE
coin_type = /obj/item/coin/gold
/obj/item/stack/material/silver
name = MAT_SILVER
@@ -68,6 +75,7 @@
default_type = MAT_SILVER
no_variants = FALSE
apply_colour = TRUE
coin_type = /obj/item/coin/silver
//Valuable resource, cargo can sell it.
/obj/item/stack/material/platinum
@@ -76,12 +84,14 @@
default_type = MAT_PLATINUM
no_variants = FALSE
apply_colour = TRUE
coin_type = /obj/item/coin/platinum
/obj/item/stack/material/uranium
name = MAT_URANIUM
icon_state = "sheet-uranium"
default_type = MAT_URANIUM
no_variants = FALSE
coin_type = /obj/item/coin/uranium
//Extremely valuable to Research.
/obj/item/stack/material/mhydrogen
@@ -119,6 +129,7 @@
default_type = MAT_GRAPHITE
apply_colour = 1
no_variants = FALSE
coin_type = /obj/item/coin/graphite
/obj/item/stack/material/bronze
name = MAT_BRONZE
@@ -143,6 +154,7 @@
default_type = MAT_COPPER
apply_colour = 1
no_variants = FALSE
coin_type = /obj/item/coin/copper
/obj/item/stack/material/aluminium
name = MAT_ALUMINIUM
@@ -151,3 +163,4 @@
default_type = MAT_ALUMINIUM
apply_colour = 1
no_variants = FALSE
coin_type = /obj/item/coin/aluminium

BIN
icons/obj/coins.dmi Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 89 KiB

View File

@@ -1509,6 +1509,7 @@
#include "code\game\objects\items\stacks\tiles\fifty_spawner_tiles_yw.dm"
#include "code\game\objects\items\stacks\tiles\tile_types.dm"
#include "code\game\objects\items\toys\balls_vr.dm"
#include "code\game\objects\items\toys\fake_coin.dm"
#include "code\game\objects\items\toys\godfigures.dm"
#include "code\game\objects\items\toys\mech_toys.dm"
#include "code\game\objects\items\toys\target_toy.dm"