From bf880f553a3b0d8b7d9e232c6e185b2b31cecb87 Mon Sep 17 00:00:00 2001 From: Helg2 <93882977+Helg2@users.noreply.github.com> Date: Tue, 9 May 2023 03:40:13 +0300 Subject: [PATCH] Makes industrial gold and regenerative gold spawn random coins. Also adds chococoin to coin spawner. (#75199) ## About The Pull Request So they just had list from 6 coins and not random picking of coins, so now its random. It will also spawn chococoin because it's a coin too. But won't spawn `coin/gold/debug` because it's debug and eldritch coin because comxy asked about it. Added chococoin to `/obj/effect/spawner/random/entertainment/coin` and holdables list of wallet. ## Why It's Good For The Game Random is funny. ## Changelog :cl: add: Indusrial Gold and Regenerative Gold extracts now spawn random coins and not just list of 6 coins. But no mythril as it has miserable chance to have summoning effect which have even more miserable chance to spawn something dangerous and not just mice. add: Chococoin now has a chance to spawn wherever the coins are used to spawn (wallets, greed ruins, deltastation bar) /:cl: --------- Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com> --- code/__HELPERS/randoms.dm | 13 +++++++++++++ .../effects/spawners/random/entertainment.dm | 1 + code/game/objects/items/storage/wallets.dm | 1 + code/modules/mining/ores_coins.dm | 2 +- .../xenobiology/crossbreeding/industrial.dm | 2 +- .../xenobiology/crossbreeding/regenerative.dm | 2 +- 6 files changed, 18 insertions(+), 3 deletions(-) diff --git a/code/__HELPERS/randoms.dm b/code/__HELPERS/randoms.dm index de94471d7ff..beb30e3c372 100644 --- a/code/__HELPERS/randoms.dm +++ b/code/__HELPERS/randoms.dm @@ -55,3 +55,16 @@ while(length(str) < 5) str = "0" + str . = str + +///Gets a random coin excluding the blocked type and including extra coins which aren't pathed like coins. +/proc/get_random_coin() + var/list/blocked = list( + /obj/item/coin/gold/debug, + /obj/item/coin/eldritch, + /obj/item/coin/mythril, + ) + var/list/extra_coins = list( + /obj/item/food/chococoin, + ) + var/list/allowed_coins = subtypesof(/obj/item/coin) - blocked + extra_coins + return pick(allowed_coins) diff --git a/code/game/objects/effects/spawners/random/entertainment.dm b/code/game/objects/effects/spawners/random/entertainment.dm index d7378314636..2ec5b978210 100644 --- a/code/game/objects/effects/spawners/random/entertainment.dm +++ b/code/game/objects/effects/spawners/random/entertainment.dm @@ -60,6 +60,7 @@ /obj/item/coin/adamantine = 2, /obj/item/coin/mythril = 2, /obj/item/coin/runite = 2, + /obj/item/food/chococoin = 2, /obj/item/coin/twoheaded = 1, /obj/item/coin/antagtoken = 1, ) diff --git a/code/game/objects/items/storage/wallets.dm b/code/game/objects/items/storage/wallets.dm index 848282a383e..64a69c53928 100644 --- a/code/game/objects/items/storage/wallets.dm +++ b/code/game/objects/items/storage/wallets.dm @@ -25,6 +25,7 @@ /obj/item/stack/medical, /obj/item/toy/crayon, /obj/item/coin, + /obj/item/food/chococoin, /obj/item/dice, /obj/item/disk, /obj/item/implanter, diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm index 00bb1f7a922..8ad06edb849 100644 --- a/code/modules/mining/ores_coins.dm +++ b/code/modules/mining/ores_coins.dm @@ -609,7 +609,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\ return if(istype(target_atom, /obj/machinery/door/airlock)) var/obj/machinery/door/airlock/target_airlock = target_atom - to_chat(user, span_warning("You put insert the [src] into the airlock.")) + to_chat(user, span_warning("You insert [src] into the airlock.")) target_airlock.emag_act(user, src) qdel(src) diff --git a/code/modules/research/xenobiology/crossbreeding/industrial.dm b/code/modules/research/xenobiology/crossbreeding/industrial.dm index 710cf90dd71..a5cdb181e2b 100644 --- a/code/modules/research/xenobiology/crossbreeding/industrial.dm +++ b/code/modules/research/xenobiology/crossbreeding/industrial.dm @@ -170,7 +170,7 @@ Industrial extracts: plasmarequired = 10 /obj/item/slimecross/industrial/gold/process() - itempath = pick(/obj/item/coin/silver, /obj/item/coin/iron, /obj/item/coin/gold, /obj/item/coin/diamond, /obj/item/coin/plasma, /obj/item/coin/uranium) + itempath = get_random_coin() ..() /obj/item/slimecross/industrial/oil diff --git a/code/modules/research/xenobiology/crossbreeding/regenerative.dm b/code/modules/research/xenobiology/crossbreeding/regenerative.dm index 6460b3a849f..3e073191e5b 100644 --- a/code/modules/research/xenobiology/crossbreeding/regenerative.dm +++ b/code/modules/research/xenobiology/crossbreeding/regenerative.dm @@ -216,7 +216,7 @@ Regenerative extracts: effect_desc = "Fully heals the target and produces a random coin." /obj/item/slimecross/regenerative/gold/core_effect(mob/living/target, mob/user) - var/newcoin = pick(/obj/item/coin/silver, /obj/item/coin/iron, /obj/item/coin/gold, /obj/item/coin/diamond, /obj/item/coin/plasma, /obj/item/coin/uranium) + var/newcoin = get_random_coin() var/obj/item/coin/C = new newcoin(target.loc) playsound(C, 'sound/items/coinflip.ogg', 50, TRUE) target.put_in_hand(C)