Files
Bubberstation/code/__HELPERS/randoms.dm
SkyratBot bac3001826 [MIRROR] Makes industrial gold and regenerative gold spawn random coins. Also adds chococoin to coin spawner. [MDB IGNORE] (#21031)
* Makes industrial gold and regenerative gold spawn random coins. Also adds chococoin to coin spawner. (#75199)

<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## 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.
<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
Random is funny.
<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

🆑
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)
/🆑

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Co-authored-by: Fikou <23585223+Fikou@ users.noreply.github.com>

* Makes industrial gold and regenerative gold spawn random coins. Also adds chococoin to coin spawner.

---------

Co-authored-by: Helg2 <93882977+Helg2@users.noreply.github.com>
Co-authored-by: Fikou <23585223+Fikou@ users.noreply.github.com>
2023-05-09 03:54:49 +01:00

71 lines
2.3 KiB
Plaintext

///Get a random food item exluding the blocked ones
/proc/get_random_food()
var/static/list/allowed_food = list()
if(!LAZYLEN(allowed_food)) //it's static so we only ever do this once
var/list/blocked = list(
/obj/item/food/bowled,
/obj/item/food/bread,
/obj/item/food/breadslice,
/obj/item/food/cake,
/obj/item/food/cakeslice,
/obj/item/food/clothing,
/obj/item/food/drug,
/obj/item/food/grown,
/obj/item/food/grown/ash_flora,
/obj/item/food/grown/mushroom,
/obj/item/food/grown/nettle,
/obj/item/food/grown/shell,
/obj/item/food/kebab,
/obj/item/food/meat,
/obj/item/food/meat/slab,
/obj/item/food/meat/slab/human/mutant,
/obj/item/food/pie,
/obj/item/food/pieslice,
/obj/item/food/pizza,
/obj/item/food/pizzaslice,
/obj/item/food/salad,
/obj/item/food/spaghetti,
)
var/list/unfiltered_allowed_food = subtypesof(/obj/item/food) - blocked
for(var/obj/item/food/food as anything in unfiltered_allowed_food)
if(!initial(food.icon_state)) //food with no icon_state should probably not be spawned
continue
allowed_food.Add(food)
return pick(allowed_food)
///Gets a random drink excluding the blocked type
/proc/get_random_drink()
var/list/blocked = list(
/obj/item/reagent_containers/cup/soda_cans,
/obj/item/reagent_containers/cup/glass/bottle
)
return pick(subtypesof(/obj/item/reagent_containers/cup/glass) - blocked)
///Picks a string of symbols to display as the law number for hacked or ion laws
/proc/ion_num() //! is at the start to prevent us from changing say modes via get_message_mode()
return "![pick("!","@","#","$","%","^","&")][pick("!","@","#","$","%","^","&","*")][pick("!","@","#","$","%","^","&","*")][pick("!","@","#","$","%","^","&","*")]"
///Returns a string for a random nuke code
/proc/random_nukecode()
var/val = rand(0, 99999)
var/str = "[val]"
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)