0 of 0

File information

Last updated

Original upload

Created by

Renny

Uploaded by

OfficialRenny

Virus scan

Safe to use

About this mod

Adds a lootbox mechanic to the game using the coins that you receive from the Journey of the Prairie King game as currency.

Requirements
Permissions and credits
This mod adds a lootbox mechanic to the game using the coins that you receive from the Journey of the Prairie King game as currency.

Install


How to use
"Gus has installed a new machine at the Saloon and it looks like some kind of dispenser. The Journey of the Prairie King minigame has also gotten an update and now gives you spendable tokens!
Hmm, it seems like those tokens can only be used in this newfangled machine which seems to give you random items in return."

There are two different tiers of lootboxes, basic and premium. Basic tier costs 10 Prairie King tokens and the Premium costs 50. The Premium Tier has a higher chance of dropping rarer items. This can all be tweaked via the config, and you are able make your own lootboxes and prize lists, more information can be found in the 1.1.0 notes below.


Update Notes
1.2.0
Updated for SDV 1.6 and SMAPI 4.0
Targeting .NET Core 6 now
Made some changes to the Prizes in the config, where the ID is now a string instead of a number
1.1.0
After 5 years on the East Coast, it was time to go home...
Notable changes:
  • Updated the mod to target .NET Core 5 (Apparently SDV 1.5.5 upgraded to this)
  • Overhauled Lootbox System
  • This is now fully customizable
  • Once a config.json is created, you can make changes to any of the Lootboxes (e.g. create new types with their own names, prize pools and costs)
  • A lootbox consists of a "key" (just a simple, unique, name for identification), a name (what it's called in the dialogue menu), cost, and a list of prize pools.
  • A prize pool consists of a name (not currently used anywhere, except for some commands covered later), a chance/weight, and a list of 'Prizes'
  • This chance/weight value is very neat, and is basically the chance for a particular prize pool to be picked compared relatively to the other pools. E.g. the "Basic" lootbox has 5x tiers with the following weights: 0.4, 0.3, 0.2, 0.099, and 0.001. As these all add up to 1, they can be treated as a % to get the tier (e.g. 0.4 = 40%), however these do not need to add up to any value in particular. For example, if you were to add a brand new prize pool with a chance of 1.0 into that list, this new prize pool will have a 50% chance of being picked when a lootbox is rolled.
  • A 'prize' consists of the the item ID, a quantity, and an optional quality value (a 0/1/2/4 value, where 0 = Base Quality, 1 = Silver Star, 2 = Gold Star, 4(!) = Iridium Star, anything else is likely to break)
  • When picking a lootbox, a prize pool is chosen based on the weight, and the prize is picked from the prize pool's list. These prizes have an equal chance to be picked amongst each other, though you can always add duplicate prizes to shift the odds.
  • Added a few utility commands
  •  `gettokens` shows you how many tokens you have. (an old one but still listed here)
  •  `addtokens <value>` adds a <value> of tokens to your total (can be negative to subtract).
  •  `settokens <value>` sets your tokens to a specified value
  •  `lootbox list` lists all of the lootboxes and their costs
  •  `lootbox list <key>` lists all of the prize pools within a lootbox and the prizes within them
  •  `lootbox simulate <key> <times: 1>` rolls a lootbox <times> number of times (once by default), and lists all of the prizes you've won, as well as the stats for how many times a prize pool was picked and how often it was picked as a percentage.
  • Added a way to set the Token Machine's position and the map it appears in
  • By default this is at X: 34, Y: 17, in the "Saloon" map, to fit it between the two game machines in the Saloon.
  • For now, the tile underneath the machine will always be replaced by a similar tile to the ones under the two other machines (wooden boards with a slight shadow at the top), may need to look into this and see how else I can get a similar shadow without replacing the entire tile.

1.0.6 and earlier...
Lost to the ages...


Compatibility
  • Works with Stardew Valley 1.6 on Linux/Mac/Windows.
  • Works in single player, should work in multiplayer (Untested).
  • Would NOT work with major Saloon replacements as the token machine gets created between the two existing arcade machines.
  • Should no longer be relevant, if you run into any issues with Saloon replacements, feel free to tweak to coordinates in the config.

Source code