You are viewing a potentially older version of this package. View all versions.
muckers-ShrineOfChance-0.4.2 icon

ShrineOfChance

Adds Shrine of Chance slot machines on grass. Each paid spin draws fresh odds, a boss alerts the whole lobby, and three nukes drop a pickup that kills every enemy and pays every player.

By muckers
Date uploaded 13 hours ago
Version 0.4.2
Download link muckers-ShrineOfChance-0.4.2.zip
Downloads 4
Dependency string muckers-ShrineOfChance-0.4.2

This mod requires the following mods to function

BepInEx-BepInExPack_Muck-5.4.1101 icon
BepInEx-BepInExPack_Muck

BepInEx pack for Muck. Preconfigured and ready to use.

Preferred version: 5.4.1101

README

Shrine of Chance

"The reels stop."

Adds Shrine of Chance slot machines to Muck, inspired by Risk of Rain 2. A few appear on grass at the start of a world. Look at one and press interact.

The first use costs 17 coins. Later prices follow floor(17 × 1.4 ^ uses): 23, then 33, then 46. By default the price also follows the day's chest prices. Paying pulls the lever and spins three reels above the shrine. The reels start as the lever hits the bottom, then stop left to right over about 2.4 seconds. The reward lands when the last reel stops.

Each paid roll draws a new set of odds. Nothing, White, Blue, Legendary, and Boss each get at least 1% and at most 50%, and the five sum to 100%. Then the Nuke takes 5% of every roll and the other five share the remaining 95%. The cabinet shows that roll's odds. The player who paid also gets a short HUD with the same six numbers. Their chat line repeats them each time the reels stop.

Result Reels
Nothing No three of a kind
White powerup $ $ $
Blue powerup BAR BAR BAR
Orange powerup 7 7 7
Boss X X X
Nuke N N N (green)

After two successful item drops the orb turns grey and the shrine is spent. A roll of nothing, and a boss, still raise the price. A boss does not count as one of the two drops. A boss roll sends <name> rolled a BOSS at the Shrine of Chance! to every player in the lobby. Modded clients show a banner for that system line. A player who types the same words does not get the banner. Vanilla clients see the chat line.

Nuke

Inspired by the Call of Duty Zombies Nuke power-up. Three nukes drop a spinning, glowing green bomb next to the shrine. Walk into it to set it off; no button needed. Anyone can grab it, and it fades after 30 seconds, blinking for the last 5.

When someone touches it, every player's screen flashes white and shows KABOOM!. Every enemy alive at that moment dies, the nearest first, rippling out over about two seconds. Bosses and neutral animals survive, and enemies that spawn later are not affected. Nuked enemies drop nothing and count as nobody's kill. When the wave is over, every player gets 400 coins, alive or dead, and a KABOOM! +400 coins. chat line. A nuke counts as one of the shrine's two successes.

In Wave Run, nuked wave enemies count toward the round, so nuking the last ones ends it. Wave Run bosses survive.

Multiplayer

Every player should run this mod, and every copy must use the same config. When a world starts, BepInEx/LogOutput.log shows Shrine of Chance config and an eight-character code. Chat shows it only while the debug ForceOutcome is set. If the codes differ, the shrines and the reels will not agree. Rolls are a hash of the world seed, so anyone with that seed can predict them. Every modded player near the shrine sees the same spin. A powerup from another mod, such as Ukulele, can drop here, and a player who does not have that mod can error when it appears.

  • Both players modded: both see the same shrines, the same price, and the same reels. The player who uses one pays and sees the odds HUD. The drop appears for everyone, and anyone can pick it up. A boss spawns once, and every player gets the boss chat line and banner.
  • Modded host, vanilla client: the vanilla player does not see the shrines. They can still see powerups a modded player earns, and a boss the host spawns, because both use Muck's normal packets. They see enemies die to a nuke, but they never see the nuke and get no coins from it.
  • Vanilla host, modded client: the shrines are visible but inert. Using one does not spend coins.

Config

BepInEx/config/evan.muck.shrineofchance.cfg, created on first launch. Match it across the lobby.

Setting Default
Count 6 How many shrines to place
MinSpacing 60 Minimum meters between shrines
BasePrice 17 Coins for the first use
PriceGrowth 1.4 Multiplier per use
ScaleWithChestPrice true Also apply the day's chest price multiplier
MaxSuccesses 2 Successful item drops before the shrine is spent
RandomizeOdds true Draw fresh odds on every paid roll
MinChance / MaxChance 1 / 50 Percent floor and ceiling for each tier
ChanceNothing / ChanceWhite / ChanceBlue / ChanceOrange / ChanceBoss 42.73 / 34.18 / 17.09 / 5 / 1 Used only when RandomizeOdds is off
[Nuke] Enabled true Let shrines roll the nuke
[Nuke] Chance 5 Percent of every paid roll that gives a nuke (0 to 50)
[Nuke] Gold 400 Coins each player gets after a nuke
[Nuke] KillDelay / KillSpread 0.5 / 1.5 Seconds to the first death, and over which the deaths ripple out
[Nuke] Lifetime 30 Seconds before an untouched nuke fades
ForceOutcome Off Debug only. Forces every roll and changes the config code
VerboseLogging false Log each placement and each roll

The old Weight* keys are ignored. An existing config picks up the chances above.

Credits

Shrine of Chance is Hopoo Games' design (Risk of Rain 2). Muck is Dani's. The Nuke is after Treyarch's Call of Duty Zombies power-up. This mod contains no assets from any of these games. The shrine is primitives plus Arial glyphs, the nuke reuses this repo's own Sticky Bomb model in green, and the icon is original.

CHANGELOG

Changelog

0.5.1

  • Fixed: a client's reels could show one result while the host paid out another, such as three nukes on the client's screen while the host spawned a boss. Each player rolled the reels from their own odds, and the host acted on its own roll, so any difference in odds split them. UFO Abduction made that likely: a player who has it rolls with a 10% UFO share, which moves every other result's band. The host now sends its roll with the shrine's interact packet, and every client shows and commits that roll. A client that lacks a registered outcome the host rolled shows ? ? ?. A client whose own roll differs logs a warning that names both rolls.
  • The odds line and HUD still show each player's own odds, so matching configs still matter. A 0.5.0 host or client still rolls on its own.

0.5.0

  • Other mods can add outcomes to the shrine's roll through ShrineOutcomeRegistry.Register. Each outcome sets its id, label, reel face, colour, chat line, share of each roll and a callback that runs on the host when it wins. It takes exactly its share, and the six built-in tiers, Nuke included, keep their relative weights in what is left. Registered outcomes roll after Nuke, and each gets an odds column after NUKE while it can roll.
  • The odds popup gives every column the 0.4.1 width, and shrinks the cells to fit when that would run past the screen.
  • With no other mod installed, every roll, odds line and config code is the same as in 0.4.2. UFO Abduction is the first mod to use the API.

0.4.2

  • The nuke goes off with a deep KABOOM. It is the game's own rock impact sound, pitched down, and every modded player hears it. No new assets.
  • Nuked enemies still drop no loot. The 0.4.1 playtest counted three extra items near the player after a nuke. They came from trees and rocks that the spared Big Chunk's thrown rocks broke, not from the nuked enemies.

0.4.1

  • The nuke hovers 1.2 m above the ground in front of the shrine. In 0.4.0 it sat 1.2 m above the shrine's base, so on a slope it could sink into the hill where no one could reach it.
  • Walking into the nuke sets it off within 2 m across and 3 m up or down. In 0.4.0 a 2 m sphere missed a player walking straight over a nuke on a slope.
  • The odds HUD keeps each cell as wide as in 0.3.5 and grows with the sixth column, so Legendary no longer wraps to Legendar / y.

0.4.0

  • A sixth result, Nuke, modelled on the Call of Duty Zombies power-up. Three green N faces drop a glowing nuke pickup next to the shrine. Any player who walks into it sets it off. The screen flashes white, KABOOM! fills the banner, and the camera shakes. Every enemy alive at that moment dies, nearest first, over about two seconds. Bosses and neutral animals are spared, and enemies that spawn afterwards are not affected. Nuked enemies drop no loot and give no kill credit. Then every player, alive or dead, gets 400 coins.
  • A nuke counts as one of the shrine's two successes.
  • New [Nuke] config section: Enabled (default on), Chance (5% of every paid roll; the other five tiers share the rest), Gold, KillDelay, KillSpread, Lifetime (30 s, blinking for the last 5). Enabled, Chance, Gold and Lifetime are part of the config code, so the code changes from 0.3.5.
  • The odds line, chat line and HUD show a NUKE column only while a nuke can roll. With [Nuke] Enabled = false they look exactly as before, and every roll lands where 0.3.5 put it.
  • ForceOutcome = Nuke forces the nuke for testing.

0.3.5

Shrines are placed again when the world's seed changes inside one scene, which Wave Run 0.4.0 does at every map switch. A vanilla world is unchanged. The log line names the seed: Placed 6 Shrines of Chance (seed 123456).

0.3.4

The world-start config code goes to the log only. Chat shows it only while the debug ForceOutcome is set, so a normal game no longer opens with a hex code. Compare codes in BepInEx/LogOutput.log.

0.3.3

A winning shrine drops its powerup in the second game of a session. Muck wakes a new ItemManager on every Menu load, and from the second game of a session ItemManager.Instance is an object Unity has destroyed but vanilla keeps using. Unity's == null calls it null. The payout logged rolled ... but the pool has nothing to drop instead. It is now compared by reference.

0.3.2

  • The player who paid gets the result chat line on every spin. In 0.3.0 and 0.3.1 it only appeared on their first spin of each shrine.
  • The odds HUD shows the roll that actually ran. If another player's spin landed first, it used to show the odds of the roll you were offered.
  • The two Harmony hooks load separately. If a game update breaks the boss banner hook, shrines still appear and the log says the banner is off. If the placement hook breaks, the log says no shrines will appear.
  • Pressing a spinning shrine says "The reels are still spinning."

0.3.1

  • The boss banner accepts the host's system line for any player name, including spaces and punctuation. A player chat line still cannot open it.
  • The cabinet odds line is 2.25 times taller, and its bottom stays above the reels.

0.3.0

  • Each paid roll draws a fresh set of odds. Every tier is at least 1% and at most 50%, and the five sum to 100. MinChance and MaxChance change those limits. RandomizeOdds (default on) ignores the old Chance* values. Turn it off to use them again.
  • The roll's odds appear on the cabinet, in the purchaser's chat line, and on a short HUD for the player who paid.
  • Paying pulls the lever. The reels start when the lever hits the bottom.
  • A boss roll sends a chat line to every player, including vanilla clients. Modded clients show a lobby banner for that system line. A player chat line cannot open the banner.
  • The cabinet odds sit above the reels. After the spin they are labeled last roll. The lever is visible at rest and pulls toward the player.

0.2.1

  • Reel symbols are large enough to read. In 0.2.0 they were about 3 cm tall on a 0.7 m face.
  • A single symbol is about 0.36 m tall. BAR is smaller so three letters stay inside the face.
  • Glyphs are white on the gray, blue, and red faces, and black on the white and orange faces.

0.2.0

  • The shrine is now a slot machine. Paying spins three reels above it, and every modded player sees the same spin. The reward lands when the last reel stops.
  • New odds: 5% Orange (was 1%) and a new 1% chance to summon a boss next to the shrine. Nothing, White, and Blue keep their old proportions inside the remaining 94% (42.73 / 34.18 / 17.09).
  • Odds are now percentages under new keys ChanceNothing, ChanceWhite, ChanceBlue, ChanceOrange, ChanceBoss. The old Weight* keys are ignored, so existing configs pick up the new defaults. Values that do not sum to 100 are scaled to 100 and logged.
  • New Debug.ForceOutcome (default Off) forces every roll, for testing. It changes the config code.
  • A boss roll uses a shrine use but does not count toward the two successful drops.

0.1.0

  • First release: Shrines of Chance on grass. Pay coins for a chance at a White, Blue, or Orange powerup. The shrine is spent after two successful drops.