Files
Grinch-AP/worlds/yugioh06/options.py
Rensen3 539ee1c5da Yu-Gi-oh! 2006: implement new game (#2795)
* Initial implementation of Yu-Gi-Oh! WC 2006

* Added Opponents and banlists

* Initial implementation of Yu-Gi-Oh! WC 2006

* Added Opponents and banlists

* Added Campaign Logic

* Added Bonuses Logic

* Added challenge logic

* fixed yugioh client

* ygo06 rom cleanup and include lua

* ygo06 patch cleanup

* ygo06 move client to world folder

* lots of small changes

* bug fixes

* implemented filler item for yugioh06

* BizHawkClient: Add client and connector

* BizHawkClient: Add launcher component and inno_setup lines

* BizHawkClient: Misc stability updates and small improvements

Bad commit organization a consequence of working with two different branches and not keeping the commits separated

* BizHawkClient: Add docstrings

* BizHawkClient: Pull in changes from other branch

* BizHawkClient: Fix no handler message not displaying after changed ROMs

* BizHawkClient: Remove extra print statement from lua

* BizHawkClient: Change version command to use raw strings

* BizHawkClient: Change script version to single integer

* YGO06: added logic for "all expect type forbidden" limited duels

* YGO06: Structure Deck choice now affects logic. Fixed a bug with tier 5 campaign opponents. Added logic for TD16 Union.

* BizHawkClient: Add newline to version for lua script

* BizHawkClient: Call send_connect from BizHawkClient's watcher loop

* BizHawkClient: Add handling for failed request getting script version

* BizHawkClient: Have base64.lua check lua version explicitly for bit operations

On 2.9, it would detect LuaJIT and flood the console with deprecation warnings

* BizHawkClient: Update connector script for slightly better errors and address Gambatte frame sync issue

* BizHawkClient: Remove accidentally added print statements

* BizHawkClient: Fix connector server not closing correctly

* BizHawkClient: Move some connector code around, some linting

* BizHawkClient: Small cleanup in lua

* BizHawkClient: Lua linting

* BizHawkClient: Remove outdated sentences in docstrings

* YGO06: Logic additions and bug fixes

* BizHawkClient: Correctly null check patch file arg

* BizHawkClient: Initialize logging

* BizHawkClient: Move code to worlds/_bizhawk

Also splits out BizHawk communication functions to their own file for use outside this client

* BizHawkClient: Add license to connector lua, add types to docs

* BizHawkClient: Add module docstrings

* YGO06: Logic additions

* BizHawkClient: Allow clients to define multiple systems

* BizHawkClient: Better logging and handling of interruptions to connection to script

* YGO06: Logic additions

* YGO06: Added text to options

* YGO06: Ported to bizhawk client

* YGO06: fix goal not being detected

* YGO06: fix access item rule for tier 5 column 1 and 2

* YGO06: docu and bug fixes

* YGO06: change name

* YGO06: some fixes

* YGO06: fix starting opponent and booster not applying

* YGO06: added option to reduce the amount of challenges and remove the no ban list from pool.

* YGO06: added rom being asked for on first use

* YGO06: fix rules for challenges

* YGO06: create proper rules for TD04 Ritual Summon

* YGO06: mark most banlists as usefull instead of progression

* YGO06: reduce the required core boosters across the board

* YGO06: fix client not loading if another game already loaded the bizhawk client

* YGO06: fix client not finding the bizhawk client.

* YGO06: fix TD08 Draw not giving out an item

* YGO06: small text changes

* YGO06: update to version 0.4.4

* YGO06: logic mixin clean-up

* YGO06: added option for campaign opponents as goal

* Pokemon Emerald add encounter table randomization

* Pokemon Emerald: Item ball randomization working

* Pokemon Emerald: Clean up code a little

* Pokemon Emerald: Partial rework of region/location creation

* Pokemon Emerald: Dedupe items and add more readable names

* Refactor region creation to manually defined regions

* Split region json

* Use new data.json with flattened constants and add HM locations

* YGO06: bug fixes

* YGO06: bug fix

* YGO06: changes default options to be more beginner friendly

* YGO06: attempt at universal tracker support. Settings are stored in slot data now.

* YGO06: fix for older python versions

* YGO06: fix slot data

* YGO06: added diiferent opponents to the campaign

* YGO06: fix small bug with opponent icons

* YGO06: fix unwanted changes

* YGO06: repair merge with main

* YGO06: map out all of the opponents

* YGO06: added opponent shuffle

* YGO06: added logic to opponent shuffle

* YGO06: added option to use ocg art

* YGO06: bug_fixes

* YGO06: removed todos, since they are not needed anymore

* YGO06: added draft mode

* YGO06: added logic to draft mode

* YGO06: Added Money multiplier when you lose

* YGO06: Fixed Unit Test errors

* YGO06: Added Random deck option

* YGO06: Bug fix with registering client

* YGO06: client clean-up

* YGO06: fixed card misspellings

* YGO06: removed unused imports and other small changes

* YGO06: small changes

* YGO06: fix generation error when the combination of starting with "No Banlist" and not adding "No Banlist" to the pool is selected

* YGO06: fix ocg art path overwriting Huge Revolution bugfix

* YGO06: added comments and other minor changes

* YGO06: fixed byte length in client for money

* YGO06: fixes for webhost and options

* YGO06: use the proper random function

* YGO06: change settings to options

* YGO06: move to procedure patch

* YGO06: fix imports

* YGO06: fix download link for patch not showing

* YGO06: remove unnecessary Optional

* YGO06: fix universal tracker stuff

* YGO06: add typings

* YGO06: small cleanup

* yugioh06:  small change to setup

Co-authored-by: Scipio Wright <scipiowright@gmail.com>

* YGO06: remove logic mixin

* YGO06: fix create item and implement create filler and get filler item name

* YGO06: remove double lambdas

* YGO06: use pkgutil.get_data instaed pf zipFile

* YGO06: fix starting items being duplicated

* YGO06: lots of small changes

* YGO06: moved functions to match execution order

* YGO06: run ruff

* YGO06: run ruff format

* YGO06: fix ruff errors

* YGO06: undo ruff format for rules

* YGO06: move import to prevent circular dependency

* YGO06: remove unused class

* YGO06: optimizing rules

* YGO06: some optimization and small bug fix

---------

Co-authored-by: Zunawe <gyroscope15@gmail.com>
Co-authored-by: Scipio Wright <scipiowright@gmail.com>
2024-05-17 19:23:05 +02:00

196 lines
5.6 KiB
Python

from dataclasses import dataclass
from Options import Choice, DefaultOnToggle, PerGameCommonOptions, Range, Toggle
class StructureDeck(Choice):
"""Which Structure Deck you start with"""
display_name = "Structure Deck"
option_dragons_roar = 0
option_zombie_madness = 1
option_blazing_destruction = 2
option_fury_from_the_deep = 3
option_warriors_triumph = 4
option_spellcasters_judgement = 5
option_none = 6
option_random_deck = 7
default = 7
class Banlist(Choice):
"""Which Banlist you start with"""
display_name = "Banlist"
option_no_banlist = 0
option_september_2003 = 1
option_march_2004 = 2
option_september_2004 = 3
option_march_2005 = 4
option_september_2005 = 5
default = option_september_2005
class FinalCampaignBossUnlockCondition(Choice):
"""How to unlock the final campaign boss and goal for the world"""
display_name = "Final Campaign Boss unlock Condition"
option_campaign_opponents = 0
option_challenges = 1
class FourthTier5UnlockCondition(Choice):
"""How to unlock the fourth campaign boss"""
display_name = "Fourth Tier 5 Campaign Boss unlock Condition"
option_campaign_opponents = 0
option_challenges = 1
class ThirdTier5UnlockCondition(Choice):
"""How to unlock the third campaign boss"""
display_name = "Third Tier 5 Campaign Boss unlock Condition"
option_campaign_opponents = 0
option_challenges = 1
class FinalCampaignBossChallenges(Range):
"""Number of Limited/Theme Duels completed for the Final Campaign Boss to appear"""
display_name = "Final Campaign Boss challenges unlock amount"
range_start = 0
range_end = 91
default = 10
class FourthTier5CampaignBossChallenges(Range):
"""Number of Limited/Theme Duels completed for the Fourth Level 5 Campaign Opponent to appear"""
display_name = "Fourth Tier 5 Campaign Boss unlock amount"
range_start = 0
range_end = 91
default = 5
class ThirdTier5CampaignBossChallenges(Range):
"""Number of Limited/Theme Duels completed for the Third Level 5 Campaign Opponent to appear"""
display_name = "Third Tier 5 Campaign Boss unlock amount"
range_start = 0
range_end = 91
default = 2
class FinalCampaignBossCampaignOpponents(Range):
"""Number of Campaign Opponents Duels defeated for the Final Campaign Boss to appear"""
display_name = "Final Campaign Boss campaign opponent unlock amount"
range_start = 0
range_end = 24
default = 12
class FourthTier5CampaignBossCampaignOpponents(Range):
"""Number of Campaign Opponents Duels defeated for the Fourth Level 5 Campaign Opponent to appear"""
display_name = "Fourth Tier 5 Campaign Boss campaign opponent unlock amount"
range_start = 0
range_end = 23
default = 7
class ThirdTier5CampaignBossCampaignOpponents(Range):
"""Number of Campaign Opponents Duels defeated for the Third Level 5 Campaign Opponent to appear"""
display_name = "Third Tier 5 Campaign Boss campaign opponent unlock amount"
range_start = 0
range_end = 22
default = 3
class NumberOfChallenges(Range):
"""Number of random Limited/Theme Duels that are included. The rest will be inaccessible."""
display_name = "Number of Challenges"
range_start = 0
range_end = 91
default = 10
class StartingMoney(Range):
"""The amount of money you start with"""
display_name = "Starting Money"
range_start = 0
range_end = 100000
default = 3000
class MoneyRewardMultiplier(Range):
"""By which amount the campaign reward money is multiplied"""
display_name = "Money Reward Multiplier"
range_start = 1
range_end = 255
default = 20
class NormalizeBoostersPacks(DefaultOnToggle):
"""If enabled every booster pack costs the same otherwise vanilla cost is used"""
display_name = "Normalize Booster Packs"
class BoosterPackPrices(Range):
"""
Only Works if normalize booster packs is enabled.
Sets the amount that what every booster pack costs.
"""
display_name = "Booster Pack Prices"
range_start = 1
range_end = 3000
default = 100
class AddEmptyBanList(Toggle):
"""Adds a Ban List where everything is at 3 to the item pool"""
display_name = "Add Empty Ban List"
class CampaignOpponentsShuffle(Toggle):
"""Replaces the campaign with random opponents from the entire game"""
display_name = "Campaign Opponents Shuffle"
class OCGArts(Toggle):
"""Always use the OCG artworks for cards"""
display_name = "OCG Arts"
@dataclass
class Yugioh06Options(PerGameCommonOptions):
structure_deck: StructureDeck
banlist: Banlist
final_campaign_boss_unlock_condition: FinalCampaignBossUnlockCondition
fourth_tier_5_campaign_boss_unlock_condition: FourthTier5UnlockCondition
third_tier_5_campaign_boss_unlock_condition: ThirdTier5UnlockCondition
final_campaign_boss_challenges: FinalCampaignBossChallenges
fourth_tier_5_campaign_boss_challenges: FourthTier5CampaignBossChallenges
third_tier_5_campaign_boss_challenges: ThirdTier5CampaignBossChallenges
final_campaign_boss_campaign_opponents: FinalCampaignBossCampaignOpponents
fourth_tier_5_campaign_boss_campaign_opponents: FourthTier5CampaignBossCampaignOpponents
third_tier_5_campaign_boss_campaign_opponents: ThirdTier5CampaignBossCampaignOpponents
number_of_challenges: NumberOfChallenges
starting_money: StartingMoney
money_reward_multiplier: MoneyRewardMultiplier
normalize_boosters_packs: NormalizeBoostersPacks
booster_pack_prices: BoosterPackPrices
add_empty_banlist: AddEmptyBanList
campaign_opponents_shuffle: CampaignOpponentsShuffle
ocg_arts: OCGArts