Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenRCT2: Implement New Game #3229

Open
wants to merge 180 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 164 commits
Commits
Show all changes
180 commits
Select commit Hold shift + click to select a range
c9c7d24
Man, there's a lot to learn here.
Crazycolbster Jul 3, 2023
626fe45
Did my previous thing commit? If not,
Crazycolbster Jul 3, 2023
a171622
Made Items and locations usable with some glitches
Crazycolbster Jul 9, 2023
dd3ea07
Merge branch 'ArchipelagoMW:main' into General_Killmore
Crazycolbster Aug 18, 2023
c76343b
Openrct2Client initial work
Die4Ever Sep 3, 2023
475ff1d
Merge pull request #1 from Die4Ever/Openrct2Client
Crazycolbster Sep 3, 2023
088b8eb
Minor Changes to OpenRCT2 Items
Crazycolbster Sep 3, 2023
e7955cd
Progress on Networking
Crazycolbster Sep 3, 2023
1e5c837
openrct2 proxy fixes
Die4Ever Sep 3, 2023
aa03cac
Merge branch 'ArchipelagoMW:main' into General_Killmore
Crazycolbster Sep 4, 2023
e463af9
Merge pull request #2 from Die4Ever/openrct2-proxy-fixes
Crazycolbster Sep 4, 2023
2fc5383
Added options for traps and monopoly mode
Crazycolbster Sep 4, 2023
035f306
Improved Generation
Crazycolbster Sep 5, 2023
04278db
Improved the items list
Crazycolbster Sep 5, 2023
01c29a9
Added massive option to select scenario.
Crazycolbster Sep 11, 2023
34c9ea0
New Location Algorithm
Crazycolbster Sep 15, 2023
ce74add
Fixed error in create_regions
Crazycolbster Sep 15, 2023
93d0e15
Added a single "Beauty Contest" item and location
Crazycolbster Sep 15, 2023
208ab63
Added weather based filler items
Crazycolbster Sep 16, 2023
777dbc9
Added filler items to generator
Crazycolbster Sep 17, 2023
6e3b2fb
Added park rules to items
Crazycolbster Sep 17, 2023
30d9986
Created function to find starting ride
Crazycolbster Sep 17, 2023
3a45bbd
Added Victory condition. It's useless right now
Crazycolbster Sep 18, 2023
65cfa3c
Improved prereq code
Crazycolbster Sep 18, 2023
2156c30
Added category prereqs to prereq rules list
Crazycolbster Sep 18, 2023
4b79671
Created unlock shop to pass to OpenRCT2
Crazycolbster Sep 19, 2023
1414e27
Created fill_slot_data and started filling it
Crazycolbster Sep 19, 2023
9710a9e
Added data to be sent to OpenRCT2
Crazycolbster Sep 20, 2023
cffe2f3
Added guests as checks
Crazycolbster Sep 20, 2023
c937d5c
Updates to OpenRCT2Client. Fixed connection issues
Crazycolbster Sep 24, 2023
831563a
Client improvements
Crazycolbster Sep 25, 2023
6b23253
Bugfixes
Crazycolbster Sep 29, 2023
6ff2180
Ensured game is linked before connecting to server
Crazycolbster Sep 29, 2023
7e536bf
Fixed bug where packets were dropped while socket was reconnecting
Crazycolbster Sep 30, 2023
698e17c
Fixed on_package to send game readable PrintJSON's
Crazycolbster Oct 2, 2023
b4b966d
Added support for every scenario
Crazycolbster Oct 8, 2023
7b69b10
receive separated packets
Die4Ever Oct 9, 2023
3ec3c42
Merge pull request #3 from Die4Ever/receive-separated-packets
Crazycolbster Oct 9, 2023
d35ad13
Fixed generation bug with multiple OpenRCT2 Players
Crazycolbster Oct 9, 2023
da64ef6
separated packets fix variable name
Die4Ever Oct 9, 2023
22880bf
Merge pull request #4 from Die4Ever/receive-separated-packets
Crazycolbster Oct 9, 2023
3088cbb
Fixed generation to be legal again
Crazycolbster Oct 9, 2023
4ddb76d
Fix for packets
Crazycolbster Oct 10, 2023
cf56685
Added preferred intensity as an option
Crazycolbster Oct 10, 2023
9a11397
Added functionality to random scenario options
Crazycolbster Oct 10, 2023
abcae99
Added custom title to client
Crazycolbster Oct 10, 2023
5ac433e
Split rules into indiviual settings.
Crazycolbster Oct 13, 2023
be2bfe6
Trap items now correctly identified
Crazycolbster Oct 14, 2023
a90a267
Fixed generation to not skip items when modulus of 8 = 0
Crazycolbster Oct 16, 2023
0dbd28d
Added further rules for generation
Crazycolbster Oct 16, 2023
148bfcb
Merge pull request #5 from ArchipelagoMW/main
Crazycolbster Oct 18, 2023
7d7684f
Fixed Logic Block (Probably)
Crazycolbster Oct 18, 2023
001c1e2
Merge pull request #6 from ArchipelagoMW/main
Crazycolbster Oct 18, 2023
d61cb22
Fixed generation bug by moving rules to generate_early
Crazycolbster Oct 18, 2023
14f19d4
Fixed generation bug. This time for reals
Crazycolbster Oct 22, 2023
24de4a1
Added rules for items that have height/landscaping needs
Crazycolbster Oct 22, 2023
f725c71
Disabled visualize regions since we're done with it
Crazycolbster Oct 23, 2023
ee3a25f
Fixed generation issue where list was incorrectly copying
Crazycolbster Oct 25, 2023
df4e29e
Added rules for First Aid Rooms and Cash Machine
Crazycolbster Oct 29, 2023
39ec59f
Should not have pushed without testing. Reverting previous push
Crazycolbster Oct 29, 2023
f8ee635
Merge branch 'General_Killmore' into main
Crazycolbster Nov 30, 2023
1cb8252
Merge pull request #7 from Crazycolbster/main
Crazycolbster Nov 30, 2023
3045672
Added some balancing for Transport and Water Rides
Crazycolbster Nov 30, 2023
cae7381
Merge branch 'General_Killmore' of https://github.com/Crazycolbster/A…
Crazycolbster Nov 30, 2023
00cc47c
Fixed issue with generator and updated ride prereqs
Crazycolbster Dec 7, 2023
f953495
Removed any prereqs from the first 3 locations to fix generator bugs …
Crazycolbster Dec 7, 2023
97af8b6
Balanced nausea on Roller Coaster Category
Crazycolbster Dec 7, 2023
0f27442
Fixed options to allow disabling objectives
Crazycolbster Dec 11, 2023
47e958b
Balancing Tweaks
Crazycolbster Dec 11, 2023
580ca92
Get Linted
Crazycolbster Dec 11, 2023
bfa6861
Setup guide written
Crazycolbster Dec 11, 2023
08c4782
Added game page (WIP)
Crazycolbster Dec 19, 2023
f25d770
Fixed Typo on Unique Ride Requirement
Crazycolbster Dec 20, 2023
dc764c5
Fixed bug where every ride would be required in unique rides if set to 0
Crazycolbster Dec 26, 2023
722317c
Added game speed as an optional set of progressive items
Crazycolbster Jan 16, 2024
530cb88
Merge branch 'ArchipelagoMW:main' into General_Killmore
Crazycolbster Jan 16, 2024
00dfbdb
Merge branch 'General_Killmore' of https://github.com/Crazycolbster/A…
Crazycolbster Jan 16, 2024
bcacd4b
Updated terminology in options
Crazycolbster Jan 23, 2024
b3e4e02
sockets list
Die4Ever Feb 5, 2024
8cd8dab
Merge pull request #8 from Die4Ever/sockets_list
Crazycolbster Feb 5, 2024
f12a89a
Merge branch 'ArchipelagoMW:main' into General_Killmore
Crazycolbster Feb 5, 2024
76888a1
Added Connection Pool
Crazycolbster Feb 5, 2024
15fe57d
Uncommented package queue
Crazycolbster Feb 5, 2024
cd92c7a
Fixed spelling error
Crazycolbster Feb 10, 2024
ef27e79
Created an .apworld for the game!
Crazycolbster Feb 13, 2024
ce60514
Fixed issue where multiple cars of a ride causes the same ride to app…
Crazycolbster Feb 14, 2024
b470232
Refactored random scenario selection
Crazycolbster Feb 15, 2024
55e5431
Merge branch 'ArchipelagoMW:main' into General_Killmore
Crazycolbster Feb 16, 2024
8ade0b9
Improved random scenario selection
Crazycolbster Feb 16, 2024
f8c1b9b
Merge branch 'General_Killmore' of https://github.com/Crazycolbster/A…
Crazycolbster Feb 16, 2024
60f2d71
Fixed duplicate class names in options
Crazycolbster Feb 16, 2024
84f0a8b
Removed option_definitions and replaced with options_dataclass
Crazycolbster Feb 16, 2024
a1783d7
Fixed game-breaking issue with generated files
Crazycolbster Feb 17, 2024
036548b
Linting fixes
Crazycolbster Feb 17, 2024
dd1d2f5
Updated documents
Crazycolbster Feb 17, 2024
190bd3e
Updated .apworld
Crazycolbster Feb 18, 2024
1e018fa
Added "None" option to randomization range
Crazycolbster Feb 18, 2024
f535e19
Quick fix for a generator breaking typo
Crazycolbster Feb 19, 2024
0238759
Fixed Incorrect list of items on Icarus Park
Crazycolbster Feb 19, 2024
f29e7a1
Did Past Colby actually fix the issue with random parks this time? Wh…
Crazycolbster Feb 19, 2024
c2e3db9
Balancing
Crazycolbster Feb 25, 2024
144a381
It would appear they don't like me not using self.random. Wacky
Crazycolbster Feb 26, 2024
26cdd90
Cleaned up output code
Crazycolbster Feb 26, 2024
7f46998
New Option to ignore ride stat changes
Crazycolbster Feb 26, 2024
fdd73e8
Added Archipelago Madness Scenario to options
Crazycolbster Feb 28, 2024
2dc66eb
Updated openrct2.apworld
Crazycolbster Feb 28, 2024
80e0e45
Nothing. This added nothing
Crazycolbster Feb 29, 2024
7e287ff
Merge branch 'ArchipelagoMW:main' into General_Killmore
Crazycolbster Feb 29, 2024
fae9ef8
Merge branch 'General_Killmore' of https://github.com/Crazycolbster/A…
Crazycolbster Feb 29, 2024
1c1d1fe
Merge branch 'ArchipelagoMW:main' into General_Killmore
Crazycolbster Feb 29, 2024
93fcc20
Use `select` to better handle reading sockets
silasary Feb 29, 2024
16041e1
Merge pull request #9 from silasary/General_Killmore
Crazycolbster Feb 29, 2024
9828676
Fixed bug with time.sleep vs ascynchio.sleep
Crazycolbster Feb 29, 2024
033271f
Merge branch 'General_Killmore' of https://github.com/Crazycolbster/A…
Crazycolbster Feb 29, 2024
8d57c5d
Move reading sockets to separate thread, close aborted connections
silasary Feb 29, 2024
34c2bd5
Merge pull request #10 from silasary/General_Killmore
Crazycolbster Feb 29, 2024
26bb0c3
Balanced first 32 checks to ensure beatability. No prereqs on checks …
Crazycolbster Mar 2, 2024
bdf0151
Added Alpine Coaster to stat exempt
Crazycolbster Mar 5, 2024
4ad3d3b
Write the starting ride to the spoiler log now
Crazycolbster Mar 5, 2024
35770d6
Updated .apworld
Crazycolbster Mar 5, 2024
2bbb392
Limited nausea to a max of 4
Crazycolbster Mar 9, 2024
b6999ae
Added skip options for unlock shop
Crazycolbster Mar 11, 2024
3303a9f
Fixed incorrect items in Crazy Craters
Crazycolbster Mar 12, 2024
de361e3
Added option to include Cash Machine and First Aid Room to parks that…
Crazycolbster Mar 15, 2024
bcc2fa1
Added Classic Stand-up Roller Coaster for compatibilty with new OpenR…
Crazycolbster Apr 28, 2024
78c1196
Merge pull request #11 from ArchipelagoMW/main
Crazycolbster Apr 29, 2024
9af8cee
Various optimizations/refactorings
Crazycolbster Apr 30, 2024
d46b229
Code optimizations
Crazycolbster May 5, 2024
35e08cb
Major refactoring
Crazycolbster May 6, 2024
55e5f18
Further refactoring
Crazycolbster May 6, 2024
551e828
client.py cleanup
Die4Ever May 6, 2024
1eda98a
Merge pull request #12 from Die4Ever/client-cleanup-2024-05-06
Crazycolbster May 6, 2024
b751851
Fixed style in imports
Crazycolbster May 6, 2024
b7e2bb2
Merge branch 'General_Killmore' of https://github.com/Crazycolbster/A…
Crazycolbster May 6, 2024
39f43d7
Networking updates
Crazycolbster May 7, 2024
35c2da1
Client Improvements
Crazycolbster May 13, 2024
fad0c2b
Fixed random scenarios not generating
Crazycolbster May 14, 2024
106eb82
split class OpenRCT2Socket into its own file
Die4Ever May 26, 2024
1d8e04b
automated tests initial work
Die4Ever May 27, 2024
c786326
don't run network tests in GitHub Actions
Die4Ever May 27, 2024
d872f8e
OpenRCT2 tests fix GitHub Actions import
Die4Ever May 27, 2024
d1282cf
OpenRCT2 move tests to xtests because they aren't ready to run yet in…
Die4Ever May 27, 2024
80c4188
OpenRCT2 move xtests to tests
Die4Ever May 27, 2024
027bba5
Merge pull request #13 from Die4Ever/automated-tests
Crazycolbster May 27, 2024
ded6bcf
Added a working test
Crazycolbster May 27, 2024
1def887
openrct2 tests some cleanup
Die4Ever May 27, 2024
43bd786
openrct2 inbound packets queue
Die4Ever May 27, 2024
f5975fc
Added a working test
Crazycolbster May 27, 2024
53a1bde
Merge branch 'General_Killmore' into automated-tests
Die4Ever May 27, 2024
17c1162
openrct2 fix network test
Die4Ever May 27, 2024
a6e844f
Merge pull request #14 from Die4Ever/automated-tests
Crazycolbster May 27, 2024
ce2dd6e
Slight change in import
Crazycolbster May 27, 2024
d792aee
Created test function that fails. Gonna need to fix this
Crazycolbster May 28, 2024
c9155ae
automated tests fixes
Die4Ever May 28, 2024
9d00a65
Merge pull request #15 from Die4Ever/automated-tests-fixes
Crazycolbster May 28, 2024
4c89df2
Updated documentation
Crazycolbster Jun 3, 2024
cb8f18d
Updated Setup Doc to say don't follow setup doc (Until release)
Crazycolbster Jun 10, 2024
e0d509d
Merge branch 'main' into General_Killmore
Crazycolbster Jun 11, 2024
3949f11
Slight balance change for Async games.
Crazycolbster Jun 11, 2024
8d73e6c
Fixed issues with display on the website
Crazycolbster Jun 11, 2024
80a3bd5
Merge branch 'main' into General_Killmore
Crazycolbster Jun 16, 2024
9478a5e
Moved Scenario Options to top of options page.
Crazycolbster Jun 16, 2024
5f2746d
Added code to fetch icon from Github for .apworlds
Crazycolbster Jun 16, 2024
aba50ec
Merge branch 'main' into General_Killmore
Crazycolbster Jun 20, 2024
8ab6774
Merge branch 'main' into General_Killmore
Crazycolbster Jul 2, 2024
a76f03f
P*ck it, we're just going to include the picture in the data folder b…
Crazycolbster Jun 25, 2024
211434e
Merge branch 'main' into General_Killmore
Crazycolbster Jul 9, 2024
635e77b
Merge branch 'main' into General_Killmore
Crazycolbster Jul 22, 2024
88cd162
Merge branch 'main' into General_Killmore
Crazycolbster Aug 23, 2024
304498c
Commented out longest test to save time
Crazycolbster Aug 23, 2024
acae9ae
Typo Fixes
Crazycolbster Aug 23, 2024
81584f8
Removed Location Balancing
Crazycolbster Aug 23, 2024
5090837
Refactored item groups code for better user friendlyness.
Crazycolbster Aug 23, 2024
6cf222a
Improved code readability
Crazycolbster Aug 23, 2024
eda53bf
Bug fixes, implementing suggestions from people better at coding than me
Crazycolbster Sep 2, 2024
9123834
Merge branch 'ArchipelagoMW:main' into General_Killmore
Crazycolbster Sep 29, 2024
5f700be
Added get_filler_item_name.
Crazycolbster Sep 29, 2024
f893e24
Forgot to comment out chatty code before
Crazycolbster Sep 29, 2024
61d62da
Updated park names to reflect RCT2 expansions change in OpenRCT2
Crazycolbster Sep 29, 2024
3741ec7
Updated tests.
Crazycolbster Sep 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .gitignore
Crazycolbster marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,23 @@ minecraft_versions.json
.LSOverride
Thumbs.db
[Dd]esktop.ini
worlds/sm_map_rando.apworld
worlds/marioland2.apworld
worlds/mariomissing.apworld
meta.yaml
worlds/bfbb.apworld
worlds/bloonstd6.apworld
worlds/brotato.apworld
worlds/manual_mk8d_rampantepsilon.apworld
worlds/manual_rhythmpurgatory_fungus.apworld
meta.yaml
worlds/guardianlegend.apworld
worlds/ff6wc.apworld
worlds/ffxiitm.apworld
enemizerDeleteLater.zip
meta.yaml
ubuntu.16.04-x64.zip
worlds/subversion.apworld
worlds/tww.apworld
worlds/openrct2.apworld
worlds/yachtdice.apworld
Binary file added data/openrct2icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
117 changes: 117 additions & 0 deletions worlds/openrct2/Client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@

import logging
import sys
import asyncio
import typing
from CommonClient import CommonContext, get_base_parser, server_loop
import Utils
import re
from .OpenRCT2Socket import OpenRCT2Socket

if __name__ == "__main__":
print("\n\n\n\n\n\n==================================\n")
Utils.init_logging("TextClient", exception_logger="Client")
# without terminal, we have to use gui mode
gui_enabled = not sys.stdout or "--nogui" not in sys.argv

logger = logging.getLogger("Client")

class OpenRCT2Context(CommonContext):
tags = {"DeathLink"}
game = "OpenRCT2"
items_handling = 0b111 # receive all items for /received
want_slot_data = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you pass along quite a bit of info into slot data, and are set to ask for it in the connection here, but i don't see you actually saving or passing on the slot data. it it just buried in all the _send communications?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The game-side plugin passes all of the communication calls once connected, and the client simply mirrors that. One of the first things the game does when starting is retrieve the list of prices for the unlock shop saved in the slot data


def __init__(self, server_address: typing.Optional[str], password: typing.Optional[str]) -> None:
super().__init__(server_address, password)
self.gamesock = OpenRCT2Socket(self)
self.game_connection_established = False
#kivy.set_title("OpenRCT2 Client")

async def server_auth(self, password_requested: bool = False):
if not self.game_connection_established:
logger.info('Awaiting connection to OpenRCT2')
await self.gamesock.connected_to_game.wait()


if password_requested and not self.password:
await super(OpenRCT2Context, self).server_auth(password_requested)


await self.get_username()
await self.send_connect()

def on_package(self, cmd: str, args: dict):
# if cmd == "Connected":
# self.game = self.game#slot_info[self.slot].game
print("PACKAGE!!!")
if cmd == "PrintJSON":
for index, item in enumerate(args['data']):
match = re.search(r'\[color=[^\]]+\](.*?)\[/color\]', args['data'][index]['text'])
if match:
args['data'][index]['text'] = match.group(1)
print(args)
self.gamesock.sendobj(args)

# async def disconnect(self, allow_autoreconnect: bool = False):
# # self.game = ""
# await super().disconnect(allow_autoreconnect)

# async def shutdown(self):
# await super().shutdown()


# DeathLink hooks
def on_deathlink(self, data: typing.Dict[str, typing.Any]) -> None:
"""Gets dispatched when a new DeathLink is triggered by another linked player."""
super().on_deathlink(data)
self.gamesock.sendobj({'cmd': 'DeathLink'})

def run_gui(self): #Sets the title of the client
"""Import kivy UI system and start running it as self.ui_task."""
from kvui import GameManager

class TextManager(GameManager):
logging_pairs = [
("Client", "Archipelago")
]
base_title = "OpenRCT2 Client"

self.ui = TextManager(self)
self.ui_task = asyncio.create_task(self.ui.async_run(), name="UI")

# Replacing this with code from Serpent.ai to make a .apworld
# async def main(args):
# ctx = OpenRCT2Context(args.connect, args.password)
# ctx.auth = args.name
# ctx.server_task = asyncio.create_task(server_loop(ctx), name="server loop")

# if gui_enabled:
# ctx.run_gui()
# ctx.run_cli()

# await ctx.exit_event.wait()
# await ctx.shutdown()

def main():
Utils.init_logging("OpenRCT2Client", exception_logger="Client")

async def _main():
ctx = OpenRCT2Context(None, None)
ctx.server_task = asyncio.create_task(server_loop(ctx), name="server loop")

if gui_enabled:
ctx.run_gui()

ctx.run_cli()

await ctx.exit_event.wait()
await ctx.shutdown()

import colorama

colorama.init()

asyncio.run(_main())

colorama.deinit()
165 changes: 165 additions & 0 deletions worlds/openrct2/Constants.py

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions worlds/openrct2/Items.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
from BaseClasses import Item
import typing
Crazycolbster marked this conversation as resolved.
Show resolved Hide resolved
import copy
from .Constants import item_info, Scenario_Items
from .Options import *
Crazycolbster marked this conversation as resolved.
Show resolved Hide resolved


class OpenRCT2Item(Item):
game: str = "OpenRCT2"

Crazycolbster marked this conversation as resolved.
Show resolved Hide resolved


def set_openRCT2_items(world):
# print("\nThis is the selected scenario:")
# print(scenario)
# print("And these items will be randomized:")
# print(Scenario_Items[scenario])
openRCT2_items = copy.deepcopy(Scenario_Items[world.options.scenario.value])
rules = [world.options.difficult_guest_generation.value,
world.options.difficult_park_rating.value,
world.options.forbid_high_construction.value,
world.options.forbid_landscape_changes.value,
world.options.forbid_marketing_campaigns.value,
world.options.forbid_tree_removal.value]

if world.options.include_atm:
if "Cash Machine" not in openRCT2_items:
openRCT2_items.append("Cash Machine")

if world.options.include_first_aid:
if "First Aid" not in openRCT2_items:
openRCT2_items.append("First Aid")

if world.options.monopoly_mode.value:
for each in range(20):
openRCT2_items.append("Land Discount")
openRCT2_items.append("Construction Rights Discount")

if world.options.include_gamespeed_items.value:
for each in range(4):
openRCT2_items.append("Progressive Speed")

for each in range(world.options.furry_convention_traps.value):
openRCT2_items.append("Furry Convention Trap")

for each in range(world.options.spam_traps.value):
openRCT2_items.append("Spam Trap")
for each in range(world.options.bathroom_traps.value):
openRCT2_items.append("Bathroom Trap")
for each in range(world.options.skips.value):
openRCT2_items.append("Skip")
Crazycolbster marked this conversation as resolved.
Show resolved Hide resolved

for number, rule in enumerate(item_info["park_rules"]): # Check every rule type
if rules[number] == 1: # If it's enabled and can be disabled
Crazycolbster marked this conversation as resolved.
Show resolved Hide resolved
openRCT2_items.append(rule) # Add an item to disable

filler = world.options.filler.value

filler_count = len(openRCT2_items) * (filler * .01) - 1
count = 0
while count < filler_count:
Crazycolbster marked this conversation as resolved.
Show resolved Hide resolved
rarity = world.random.random()
if rarity < .6:
openRCT2_items.append(world.random.choice(item_info["filler_common"]))
elif rarity < .9:
openRCT2_items.append(world.random.choice(item_info["filler_uncommon"]))
else:
openRCT2_items.append(world.random.choice(item_info["filler_rare"]))
count += 1

openRCT2_items.append("Beauty Contest")

# print(openRCT2_items)

# handles the starting ride
found_starter = False
while not found_starter:
candidate_list = [item for item in openRCT2_items if item in item_info["rides"] and item not in item_info["non_starters"]]
candidate = world.random.choice(candidate_list)
starting_ride = candidate
openRCT2_items.remove(candidate)
found_starter = True

# print("Here's the starting ride!")
# print(starting_ride)

return openRCT2_items, starting_ride
Loading