Compare commits

..

26 Commits

Author SHA1 Message Date
NewSoupVi
29ae9cd91e The simple solution 2024-08-06 20:58:35 +02:00
Exempt-Medic
90446ad175 ChecksFinder: Refactor/Cleaning (#3725)
* Update ChecksFinder

* minor cleanup

* Check for compatible name

* Enable APWorld

* Update setup_en.md

* Update en_ChecksFinder.md

* The client is getting updated instead

* Qwint suggestions, ' -> ", streamline fill_slot_data

* Oops, too many refactors

---------

Co-authored-by: SunCat <suncat.game@ya.ru>
2024-08-06 16:39:56 +02:00
Exempt-Medic
98bb8517e1 Docs: Missed Full Accessibility mention/conversion #3734 2024-08-06 00:00:33 +02:00
Exempt-Medic
203c8f4d89 Pokemon R/B: Removing Floats from NamedRange #3717 2024-08-05 23:40:16 +02:00
Aaron Wagener
c0ef02d6fa Core: fix missing import for MultiWorld.link_items() (#3731) 2024-08-04 12:55:34 +01:00
Exempt-Medic
4620493828 Spire: Convert options, clean up random calls, and add DeathLink (#3704)
* Convert StS options

* probably a bad idea

* Update worlds/spire/Options.py

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

---------

Co-authored-by: Kono Tyran <Kono@koifysh.dev>
Co-authored-by: Scipio Wright <scipiowright@gmail.com>
2024-07-31 18:27:35 +02:00
wildham
75b8c7891c Docs: Add FFMQ French Setup Guide + Minor fixes to English Guide (#3590)
* Add docs

* Fix character

* Configuration

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* ajuster

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* inclure

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* doublon

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* remplissage

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* autre

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* pouvoir

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* mappemonde

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* apostrophes

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* virgule

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* fournir

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* apostrophes 2

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* snes9x

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* apostrophes 3

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* options

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* lien

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* de laquelle

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* Étape de génération

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* apostrophes 4

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* également

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* guillemets

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* guillemets 2

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* adresse

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* Connect

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* seed

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>

* Changer fichier yaml pour de configuration

* Fix capitalization

Co-authored-by: Nicholas Saylor <79181893+nicholassaylor@users.noreply.github.com>

* Fix capitalization 2

Co-authored-by: Nicholas Saylor <79181893+nicholassaylor@users.noreply.github.com>

* Fix typo+Add link to fr/en info page

---------

Co-authored-by: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>
Co-authored-by: Nicholas Saylor <79181893+nicholassaylor@users.noreply.github.com>
2024-07-31 17:40:45 +02:00
Aaron Wagener
53bc4ffa52 Options: Always verify keys for VerifyKeys options (#3280)
* Options: Always verify keys for VerifyKeys options

* fix PlandoTexts

* use OptionError and give a slightly better error message for which option it is

* add the player name to the error

* don't create an unnecessary list

---------

Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
2024-07-31 17:37:52 +02:00
Trevor L
91f7cf16de Bomb Rush Cyberfunk: Fix Coil quest being in glitched logic too early (#3720)
* Update Rules.py

* Update Rules.py
2024-07-31 17:32:51 +02:00
GodlFire
7c8ea34a02 Shivers: New features and removes two missed options using the old options API (#3287)
* Adds an option to have pot pieces placed local/non-local/anywhere

Shivers nearly always finishes last in multiworld games due to the fact you need all 20 pot pieces to win and the pot pieces open very few location checks. This option allows the pieces to be placed locally. This should allow Shivers to be finished earlier.

* New option: Choose how many ixupi captures are needed for goal completion

New option: Choose how many ixupi captures are needed for goal completion

* Fixes rule logic for location 'puzzle solved three floor elevator'

Fixes rule logic for location 'puzzle solved three floor elevator'. Missing a parenthesis caused only the key requirement to be checked for the blue maze region.

* Merge branch 'main' of https://github.com/GodlFire/Shivers

* Revert "Merge branch 'main' of https://github.com/GodlFire/Shivers"

This reverts commit bb08c3f0c2.

* Fixes issue with office elevator rule logic.

* Bug fix, missing logic requirement for location 'Final Riddle: Guillotine Dropped'

Bug fix, missing logic requirement for location 'Final Riddle: Guillotine Dropped'

* Moves plaque location to front for better tracker referencing.

* Tiki should be Shaman.

* Hanging should be Gallows.

* Merrick spelling.

* Clarity change.

* Changes new option to use new option API

Changes new option to use new option API

* Added sub regions for Ixupi

-Added sub regions for Ixupi and moved ixupi capture checks into the sub region.
-Added missing wax capture possible spot in Shaman room

* Adds option for ixupi captures to be priority locations

Adds option for ixupi captures to be priority locations

* Consistency

Consistency

* Changes ixupi captures priority to default on toggle

Changes ixupi captures priority to default on toggle

* Docs update

-Updated link to randomizer
-Update some text to reflect the latest functionality
-Replaced 'setting' with 'option'

* New features/bug fixes

-Adds an option to have completed pots in the item pool
-Moved subterranean world information plaque to maze staircase

* Cleanup

Cleanup

* Fixed name for moved location

When moving a location and renaming it I forgot to fix the name in a second spot.

* Squashed commit of the following:

commit 630a3bdfb9
Merge: 8477d3c8 5e579200
Author: GodlFire <46984098+GodlFire@users.noreply.github.com>
Date:   Mon Apr 1 19:08:48 2024 -0600

    Merge pull request #10 from ArchipelagoMW/main

    Merge main into branch

commit 5e5792009c
Author: Alchav <59858495+Alchav@users.noreply.github.com>
Date:   Mon Apr 1 12:08:21 2024 -0500

    LttP: delete playerSettings.yaml (#3062)

commit 9aeeeb077a
Author: CaitSith2 <d_good@caitsith2.com>
Date:   Mon Apr 1 06:07:56 2024 -0700

    ALttP: Re-mark light/dark world regions after applying plando connections (#2964)

commit 35458380e6
Author: Bryce Wilson <gyroscope15@gmail.com>
Date:   Mon Apr 1 07:07:11 2024 -0600

    Pokemon Emerald: Fix wonder trade race condition (#2983)

commit 4ac1866689
Author: Alchav <59858495+Alchav@users.noreply.github.com>
Date:   Mon Apr 1 08:06:31 2024 -0500

    ALTTP: Skull Woods Inverted fix (#2980)

commit 4aa03da66e
Author: Fabian Dill <Berserker66@users.noreply.github.com>
Date:   Mon Apr 1 15:06:02 2024 +0200

    Factorio: fix attempting to create savegame with not filename safe characters (#2842)

commit 24a03bc8b6
Author: Silvris <58583688+Silvris@users.noreply.github.com>
Date:   Mon Apr 1 08:02:26 2024 -0500

    KDL3: fix shuffled animals not actually being random (#3060)

commit f813a7005f
Author: Aaron Wagener <mmmcheese158@gmail.com>
Date:   Sun Mar 31 11:11:10 2024 -0500

    The Messenger: update docs formatting and fix outdated info (#3033)

    * The Messenger: update docs formatting and fix outdated info

    * address review feedback

    * 120 chars

commit 2a0b7e0def
Author: LiquidCat64 <74896918+LiquidCat64@users.noreply.github.com>
Date:   Sun Mar 31 09:55:55 2024 -0600

    CV64: A couple of very small docs corrections. (#3057)

commit 03d47e460e
Author: Ixrec <ericrhitchcock@gmail.com>
Date:   Sun Mar 31 16:55:08 2024 +0100

    A Short Hike: Clarify installation instructions (#3058)

    * Clarify installation instructions

    * don't mention 'config' folder since it isn't created until the game starts

commit e546c0f7ff
Author: Silvris <58583688+Silvris@users.noreply.github.com>
Date:   Sun Mar 31 10:50:31 2024 -0500

    Yoshi's Island: add patch suffix (#3061)

commit 2ec93ba82a
Author: Bryce Wilson <gyroscope15@gmail.com>
Date:   Sun Mar 31 09:48:59 2024 -0600

    Pokemon Emerald: Fix inconsistent location name (#3065)

commit 4e3d396394
Author: Aaron Wagener <mmmcheese158@gmail.com>
Date:   Sun Mar 31 10:47:11 2024 -0500

    The Messenger: Fix precollected notes not being removed from the itempool (#3066)

    * The Messenger: fix precollected notes not being properly removed from pool

    * The Messenger: bump required client version

commit 72c53513f8
Author: Fabian Dill <Berserker66@users.noreply.github.com>
Date:   Sun Mar 31 03:57:59 2024 +0200

    WebHost: fix /check creating broken yaml files if files don't end with a newline (#3063)

commit b7ac6a4cbd
Author: Aaron Wagener <mmmcheese158@gmail.com>
Date:   Fri Mar 29 20:14:53 2024 -0500

    The Messenger: Fix various portal shuffle issues (#2976)

    * put constants in a bit more sensical order

    * fix accidental incorrect scoping

    * fix plando rules not being respected

    * add docstrings for the plando functions

    * fix the portal output pools being overwritten

    * use shuffle and pop instead of removing by content so plando can go to the same area twice

    * move portal pool rebuilding outside mapping creation

    * remove plando_connection cleansing since it isn't shared with transition shuffle

commit 5f0112e783
Author: Zach Parks <zach@alliware.com>
Date:   Fri Mar 29 19:13:51 2024 -0500

    Tracker: Add starting inventory to trackers and received items table. (#3051)

commit bb481256de
Author: Aaron Wagener <mmmcheese158@gmail.com>
Date:   Thu Mar 28 21:48:40 2024 -0500

    Core: Make fill failure error more human parseable (#3023)

commit 301d9de975
Author: Aaron Wagener <mmmcheese158@gmail.com>
Date:   Thu Mar 28 19:31:59 2024 -0500

    Docs: adding games rework (#2892)

    * Docs: complete adding games.md rework

    * remove all the now unused images

    * review changes

    * address medic's review

    * address more comments

commit 9dc708978b
Author: Trevor L <80716066+TRPG0@users.noreply.github.com>
Date:   Thu Mar 28 18:26:58 2024 -0600

    Hylics 2: Fix invalid multiworld data, use `self.random` instead of `self.multiworld.random` (#3001)

    * Hylics 2: Fixes

    * Rewrite loop

commit 4391d1f4c1
Author: Bryce Wilson <gyroscope15@gmail.com>
Date:   Thu Mar 28 18:05:39 2024 -0600

    Pokemon Emerald: Fix opponents learning non-randomized TMs (#3025)

commit 5d9d4ed9f1
Author: black-sliver <59490463+black-sliver@users.noreply.github.com>
Date:   Fri Mar 29 01:01:31 2024 +0100

    SoE: update to pyevermizer v0.48.0 (#3050)

commit c97215e0e7
Author: Scipio Wright <scipiowright@gmail.com>
Date:   Thu Mar 28 17:23:37 2024 -0400

    TUNIC: Minor refactor of the vanilla_portals function (#3009)

    * Remove unused, change an if to an elif

    * Remove unused import

commit eb66886a90
Author: Alchav <59858495+Alchav@users.noreply.github.com>
Date:   Thu Mar 28 16:23:01 2024 -0500

    SC2: Don't Filter Excluded Victory Locations (#3018)

commit de860623d1
Author: Fabian Dill <Berserker66@users.noreply.github.com>
Date:   Thu Mar 28 22:21:56 2024 +0100

    Core: differentiate between unknown worlds and broken worlds in error message (#2903)

commit 74b2bf5161
Author: Bryce Wilson <gyroscope15@gmail.com>
Date:   Thu Mar 28 15:20:55 2024 -0600

    Pokemon Emerald: Exclude norman trainer location during norman goal (#3038)

commit 74ac66b032
Author: BadMagic100 <dempsey.sean@outlook.com>
Date:   Thu Mar 28 08:49:19 2024 -0700

    Hollow Knight: 0.4.5 doc revamp and default options tweaks (#2982)

    Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

commit 80d7ac4164
Author: Silvris <58583688+Silvris@users.noreply.github.com>
Date:   Thu Mar 28 09:41:32 2024 -0500

    KDL3: RC1 Fixes and Enhancement (#3022)

    * fix cloudy park 4 rule, zero deathlink message

    * remove redundant door_shuffle bool

    when generic ER gets in, this whole function gets rewritten. So just clean it a little now.

    * properly fix deathlink messages, fix fill error

    * update docs

commit 77311719fa
Author: Ziktofel <ziktofel@gmail.com>
Date:   Thu Mar 28 15:38:34 2024 +0100

    SC2: Fix HERC upgrades (#3044)

commit cfc1541be9
Author: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
Date:   Thu Mar 28 15:19:32 2024 +0100

    Docs: Mention the "last received item index" paradigm in the network protocol docs (#2989)

    Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

commit 4d954afd9b
Author: Scipio Wright <scipiowright@gmail.com>
Date:   Thu Mar 28 10:11:20 2024 -0400

    TUNIC: Add link to AP plando guide to connection plando section of game page (#2993)

commit 17748a4bf1
Author: Nicholas Saylor <79181893+nicholassaylor@users.noreply.github.com>
Date:   Thu Mar 28 10:00:10 2024 -0400

    Launcher, Docs: Update UI and Set-Up Guide to Reference Options  (#2950)

commit 9182fe563f
Author: Entropynines <163603868+Entropynines@users.noreply.github.com>
Date:   Thu Mar 28 06:56:35 2024 -0700

    README: Remove outdated information about launchers (#2966)

    Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

commit bcf223081f
Author: t3hf1gm3nt <59876300+t3hf1gm3nt@users.noreply.github.com>
Date:   Thu Mar 28 09:54:56 2024 -0400

    TLOZ: Fix markdown issue with game info page (#2985)

commit fa93488f3f
Author: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
Date:   Thu Mar 28 09:46:00 2024 -0400

    Docs: Consistent naming for "connection plando" (#2994)

commit db15dd4bde
Author: chandler05 <66492208+chandler05@users.noreply.github.com>
Date:   Thu Mar 28 08:45:19 2024 -0500

    A Short Hike: Fix incorrect info in docs (#3016)

commit 01cdb0d761
Author: PoryGone <98504756+PoryGone@users.noreply.github.com>
Date:   Thu Mar 28 09:44:23 2024 -0400

    SMW: Update World Doc for v2.0 Features (#3034)

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

commit d0ac2b744e
Author: panicbit <panicbit@users.noreply.github.com>
Date:   Thu Mar 28 10:11:26 2024 +0100

    LADX: fix local and non-local instrument placement (#2987)

    * LADX: fix local and non-local instrument placement

    * change confusing variable name

commit 14f5f0127e
Author: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>
Date:   Thu Mar 28 04:42:35 2024 -0400

    Stardew Valley: Fix potential soft lock with vanilla tools and entrance randomizer + Performance improvement for vanilla tool/skills (#3002)

    * fix vanilla tool fishing rod requiring metal bars
    fix vanilla skill requiring previous level (it's always the same rule or more restrictive)

    * add test to ensure fishing rod need fish shop

    * fishing rod should be indexed from 0 like a mentally sane person would do.

    * fishing rod 0 isn't real, but it definitely can hurt you.

    * reeeeeeeee

commit cf133dde72
Author: Bryce Wilson <gyroscope15@gmail.com>
Date:   Thu Mar 28 02:32:27 2024 -0600

    Pokemon Emerald: Fix typo (#3020)

commit ca18121811
Author: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>
Date:   Thu Mar 28 04:27:49 2024 -0400

    Stardew Valley: Fix generation fail with SVE and entrance rando when Wizard Tower is in place of Sprite Spring (#2970)

commit 1d4512590e
Author: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
Date:   Wed Mar 27 21:09:09 2024 +0100

    requirements.txt: _ instead of - to make PyCharm happy (#3043)

commit f7b415dab0
Author: agilbert1412 <alexgilbert@yahoo.com>
Date:   Tue Mar 26 19:40:58 2024 +0300

    Stardew valley: Game version documentation (#2990)

    Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

commit 702f006c84
Author: LiquidCat64 <74896918+LiquidCat64@users.noreply.github.com>
Date:   Tue Mar 26 07:31:36 2024 -0600

    CV64: Change all mentions of "settings" to "options" and fix a broken link (#3015)

commit 98ce8f8844
Author: Yussur Mustafa Oraji <N00byKing@hotmail.de>
Date:   Tue Mar 26 14:29:25 2024 +0100

    sm64ex: New Options API and WebHost fix (#2979)

commit ea47b90367
Author: Scipio Wright <scipiowright@gmail.com>
Date:   Tue Mar 26 09:25:41 2024 -0400

    TUNIC: You can grapple down here without the ladder, neat (#3019)

commit bf3856866c
Author: agilbert1412 <alexgilbert@yahoo.com>
Date:   Sun Mar 24 23:53:49 2024 +0300

    Stardew Valley: presets with some of the new available values for existing settings to make them more accurate (#3014)

commit c0368ae0d4
Author: Phaneros <31861583+MatthewMarinets@users.noreply.github.com>
Date:   Sun Mar 24 13:53:20 2024 -0700

    SC2: Fixed missing upgrade from custom tracker (#3013)

commit 36c83073ad
Author: Salzkorn <salzkitty@gmail.com>
Date:   Sun Mar 24 21:52:41 2024 +0100

    SC2 Tracker: Fix grouped items pointing at wrong item IDs (#2992)

commit 2b24539ea5
Author: Ziktofel <ziktofel@gmail.com>
Date:   Sun Mar 24 21:52:16 2024 +0100

    SC2 Tracker: Use level tinting to let the player know which level he has of Replenishable Magazine (#2986)

commit 7e904a1c78
Author: Ziktofel <ziktofel@gmail.com>
Date:   Sun Mar 24 21:51:46 2024 +0100

    SC2: Fix Kerrigan presence resolving when deciding which races should be used (#2978)

commit bdd498db23
Author: Alchav <59858495+Alchav@users.noreply.github.com>
Date:   Fri Mar 22 15:36:27 2024 -0500

    ALTTP: Fix #2290's crashes (#2973)

commit 355223b8f0
Author: PinkSwitch <52474902+PinkSwitch@users.noreply.github.com>
Date:   Fri Mar 22 15:35:00 2024 -0500

    Yoshi's Island: Implement New Game (#2141)

    Co-authored-by: Silvris <58583688+Silvris@users.noreply.github.com>
    Co-authored-by: Alchav <59858495+Alchav@users.noreply.github.com>
    Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
    Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

commit aaa3472d5d
Author: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
Date:   Fri Mar 22 21:30:51 2024 +0100

    The Witness: Fix seed bleed issue (#3008)

commit 96d93c1ae3
Author: chandler05 <66492208+chandler05@users.noreply.github.com>
Date:   Fri Mar 22 15:30:23 2024 -0500

    A Short Hike: Add option to customize filler coin count (#3004)

    Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

commit ca549df20a
Author: Silvris <58583688+Silvris@users.noreply.github.com>
Date:   Fri Mar 22 15:29:24 2024 -0500

    CommonClient: fix hint tab overlapping (#2957)

    Co-authored-by: Remy Jette <remy@remyjette.com>

commit 44988d430d
Author: Star Rauchenberger <fefferburbia@gmail.com>
Date:   Fri Mar 22 15:28:41 2024 -0500

    Lingo: Add trap weights option (#2837)

commit 11b32f17ab
Author: Danaël V <104455676+ReverM@users.noreply.github.com>
Date:   Fri Mar 22 12:46:14 2024 -0400

    Docs: replacing "setting" to "option" in world docs  (#2622)

    * Update contributing.md

    * Update contributing.md

    * Update contributing.md

    * Update contributing.md

    * Update contributing.md

    * Update contributing.md

    Added non-AP World specific information

    * Update contributing.md

    Fixed broken link

    * Some minor touchups

    * Update Contributing.md

    Draft for version with picture

    * Update contributing.md

    Small word change

    * Minor updates for conciseness, mostly

    * Changed all instances of settings to options in info and setup guides

    I combed through all world docs and swapped "setting" to "option" when this was refering to yaml options.
    I also changed a leftover "setting" in option.py

    * Update contributing.md

    * Update contributing.md

    * Update setup_en.md

    Woops I forgot one

    * Update Options.py

    Reverted changes regarding options.py

    * Update worlds/noita/docs/en_Noita.md

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

    * Update worlds/sc2wol/docs/en_Starcraft 2 Wings of Liberty.md

    revert change waiting for that page to be updated

    * Update worlds/witness/docs/setup_en.md

    * Update worlds/witness/docs/en_The Witness.md

    * Update worlds/soe/docs/multiworld_en.md

    Fixed Typo

    Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>

    * Update worlds/witness/docs/en_The Witness.md

    * Update worlds/adventure/docs/en_Adventure.md

    * Update worlds/witness/docs/setup_en.md

    * Updated Stardew valley to hopefully get rid of the merge conflicts

    * Didn't work :dismay:

    * Delete worlds/sc2wol/docs/setup_en.md

    I think this will fix the merge issue

    * Now it should work

    * Woops

    ---------

    Co-authored-by: Scipio Wright <scipiowright@gmail.com>
    Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>

commit 218cd45844
Author: Silvris <58583688+Silvris@users.noreply.github.com>
Date:   Fri Mar 22 03:02:38 2024 -0500

    APProcedurePatch: fix RLE/COPY incorrect sizing (#3006)

    * change class variables to instance variables

    * Update worlds/Files.py

    Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>

    * Update worlds/Files.py

    Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>

    * move required_extensions to tuple

    * fix missing tuple ellipsis

    * fix classvar mixup

    * rename tokens to _tokens. use hasattr

    * type hint cleanup

    * Update Files.py

    * check using isinstance instead

    * Update Files.py

    ---------

    Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>

commit 4196bde597
Author: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
Date:   Thu Mar 21 16:38:36 2024 -0400

    Docs: Fixing special_range_names example (#3005)

commit 40f843f54d
Author: Star Rauchenberger <fefferburbia@gmail.com>
Date:   Thu Mar 21 11:00:53 2024 -0500

    Lingo: Minor game data fixes (#3003)

commit da333fbb0c
Author: GodlFire <46984098+GodlFire@users.noreply.github.com>
Date:   Thu Mar 21 09:52:16 2024 -0600

    Shivers: Adds missing logic rule for skull dial door location (#2997)

commit 43084da23c
Author: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
Date:   Thu Mar 21 16:51:29 2024 +0100

    The Witness: Fix newlines in Witness option tooltips (#2971)

commit 14816743fc
Author: Scipio Wright <scipiowright@gmail.com>
Date:   Thu Mar 21 11:50:07 2024 -0400

    TUNIC: Shuffle Ladders option (#2919)

commit 30a0aa2c85
Author: Star Rauchenberger <fefferburbia@gmail.com>
Date:   Thu Mar 21 10:46:53 2024 -0500

    Lingo: Add item/location groups (#2789)

commit f4b7c28a33
Author: Silvris <58583688+Silvris@users.noreply.github.com>
Date:   Wed Mar 20 17:45:32 2024 -0500

    APProcedurePatch: hotfix changing class variables to instance variables (#2996)

    * change class variables to instance variables

    * Update worlds/Files.py

    Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>

    * Update worlds/Files.py

    Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>

    * move required_extensions to tuple

    * fix missing tuple ellipsis

    * fix classvar mixup

    * rename tokens to _tokens. use hasattr

    * type hint cleanup

    * Update Files.py

    * check using isinstance instead

    ---------

    Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>

commit 12864f7b24
Author: chandler05 <66492208+chandler05@users.noreply.github.com>
Date:   Wed Mar 20 22:44:09 2024 +0100

    A Short Hike: Implement New Game (#2577)

commit db02e9d2aa
Author: LiquidCat64 <74896918+LiquidCat64@users.noreply.github.com>
Date:   Wed Mar 20 15:03:25 2024 -0600

    Castlevania 64: Implement New Game (#2472)

commit 32315776ac
Author: Jérémie Bolduc <16137441+Jouramie@users.noreply.github.com>
Date:   Wed Mar 20 16:57:45 2024 -0400

    Stardew Valley: Fix extended family legendary fishes being locations with fishsanity set to exclude legendary (#2967)

commit e9620bea77
Author: Magnemania <89949176+Magnemania@users.noreply.github.com>
Date:   Wed Mar 20 16:56:00 2024 -0400

    SM64: Goal Logic and Hint Bugfixes (#2886)

commit 183ca35bba
Author: qwint <qwint.42@gmail.com>
Date:   Wed Mar 20 08:39:37 2024 -0500

    CommonClient: Port Casting Bug (#2975)

commit fcaaa197a1
Author: TheLX5 <luisyuregi@gmail.com>
Date:   Wed Mar 20 05:56:19 2024 -0700

    SMW: Fixes for Bowser being defeatable on Egg Hunt and CI2 DC room access (#2981)

commit 8f7b63a787
Author: TheLX5 <luisyuregi@gmail.com>
Date:   Wed Mar 20 05:56:04 2024 -0700

    SMW: Blocksanity logic fixes (#2988)

commit 6f64bb9869
Author: Scipio Wright <scipiowright@gmail.com>
Date:   Wed Mar 20 08:46:31 2024 -0400

    Noita: Remove newline from option description so it doesn't look bad on webhost (#2969)

commit d0a9d0e2d1
Author: Bryce Wilson <gyroscope15@gmail.com>
Date:   Wed Mar 20 06:43:13 2024 -0600

    Pokemon Emerald: Bump required client version (#2963)

commit 94650a02de
Author: Silvris <58583688+Silvris@users.noreply.github.com>
Date:   Tue Mar 19 17:08:29 2024 -0500

    Core: implement APProcedurePatch and APTokenMixin (#2536)

    * initial work on procedure patch

    * more flexibility

    load default procedure for version 5 patches
    add args for procedure
    add default extension for tokens and bsdiff
    allow specifying additional required extensions for generation

    * pushing current changes to go fix tloz bug

    * move tokens into a separate inheritable class

    * forgot the commit to remove token from ProcedurePatch

    * further cleaning from bad commit

    * start on docstrings

    * further work on docstrings and typing

    * improve docstrings

    * fix incorrect docstring

    * cleanup

    * clean defaults and docstring

    * define interface that has only the bare minimum required
    for `Patch.create_rom_file`

    * change to dictionary.get

    * remove unnecessary if statement

    * update to explicitly check for procedure, restore compatible version and manual override

    * Update Files.py

    * remove struct uses

    * ensure returning bytes, add token type checking

    * Apply suggestions from code review

    Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>

    * pep8

    ---------

    Co-authored-by: beauxq <beauxq@yahoo.com>
    Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>

* Changes pot_completed_list to a instance variable instead of global.

Changes pot_completed_list to a instance variable instead of global. The global variable was unintentional and was causing missmatch in pre_fill which would cause generation error.

* Removing deprecated options getter

* Adds back fix from main branch

Adds back fix from main branch

* Removing messenger changes that somehow got on my branch?

Removing messenger changes that somehow got on my branch?

* Removing messenger changes that are somehow on the Shivers branch

Removing messenger changes that are somehow on the Shivers branch

* Still trying to remove Messenger changes on Shivers branch

Still trying to remove Messenger changes on Shivers branch

* Review comments addressed. Early lobby access set as default.

Review comments addressed. Early lobby access set as default.

* Review comments addressed

Review comments addressed

* Review comments addressed. Option for priority locations removed.

Option to have ixupi captures a priority has been removed and can be added again if Priority Fill is changed. See Issues #3467.

* Minor Change

Minor Change

* Fixed ID 10 T Error

Fixed ID 10 T Error

* Front door option added to slot data

Front door option added to slot data

* Add missing .value on slot data

Add missing .value on slot data

* Small change to slot data

Small change to slot data

* Small change to slot data

Why didn't this change get pushed github...

* Forgot list

Forgot list

---------

Co-authored-by: Kory Dondzila <korydondzila@gmail.com>
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-07-31 17:32:17 +02:00
Aaron Wagener
a05dbac55f Core: Rework accessibility (#1481)
* rename locations accessibility to "full" and make old locations accessibility debug only

* fix a bug in oot

* reorder lttp tests to not override its overrides

* changed the wrong word in the dict

* :forehead:

* update the manual lttp yaml

* use __debug__

* update pokemon and messenger

* fix conflicts from 993

* fix stardew presets

* add that locations may be inaccessible to description

* use reST format and make the items description one line so that it renders correctly on webhost

* forgot i renamed that

* add aliases for back compat

* some cleanup

* fix imports

* fix test failure

* only check "items" players when the item is progression

* Revert "only check "items" players when the item is progression"

This reverts commit ecbf986145.

* remove some unnecessary diffs

* CV64: Add ItemsAccessibility

* put items description at the bottom of the docstring since that's it's visual order

* :

* rename accessibility reference in pokemon rb dexsanity

* make the rendered tooltips look nicer
2024-07-31 12:13:14 +02:00
Aaron Wagener
83521e99d9 Core: migrate item links out of main (#2914)
* Core: move item linking out of main

* add a test that item link option correctly validates

* remove unused fluff

---------

Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
2024-07-31 12:04:21 +02:00
Jarno
1d19da0c76 Timespinner: migrate to new options api and correct random (#2485)
* Implemented new options system into Timespinner

* Fixed typo

* Fixed typo

* Fixed slotdata maybe

* Fixes

* more fixes

* Fixed failing unit tests

* Implemented options backwards comnpatibility

* Fixed option fallbacks

* Implemented review results

* Fixed logic bug

* Fixed python 3.8/3.9 compatibility

* Replaced one more multiworld option usage

* Update worlds/timespinner/Options.py

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

* Updated logging of options replacement to include player name and also write it to spoiler
Fixed generation bug
Implemented review results

---------

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-07-31 11:50:04 +02:00
Remy Jette
77e3f9fbef WebHost: Fix NamedRange values clamping to the range (#3613)
If a NamedRange has a `special_range_names` entry outside the
`range_start` and `range_end`, the HTML5 range input will clamp the
submitted value to the closest value in the range.

These means that, for example, Pokemon RB's "HM Compatibility" option's
"Vanilla (-1)" option would instead get posted as "0" rather than "-1".

This change updates NamedRange to behave like TextChoice, where the
select element has a `name` attribute matching the option, and there is
an additional element to be able to provide an option other than the
select element's choices.

This uses a different suffix of `-range` rather than `-custom` that
TextChoice uses. The reason is we need some way to decide whether to use
the custom value or the select value, and that method needs to work
without JavaScript. For TextChoice this is easy, if the custom field is
empty use the select element. For NamedRange this is more difficult as
the browser will always submit *something*. My choice was to only use
the value from the range if the select box is set to "custom". Since
this only happens with JS as "custom' is hidden, I made the range hidden
under no-JS. If it's preferred, I could make the select box hidden
instead. Let me know.

This PR also makes the `js-required` class set `display: none` with
`!important` as otherwise the class wouldn't work on any rule that
had `display: flex` with more specificity than a single class.
2024-07-29 20:13:44 -04:00
Phaneros
954d728005 sc2: Removing unused dependency in requirements.txt (#3697)
* sc2: Removing unused dependency in requirements.txt

* sc2: Add missing newline in requirements.txt

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

---------

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-07-29 23:09:51 +02:00
agilbert1412
80daa092a7 - Take shipsanity moss out of shipsanity crops (#3709) 2024-07-29 19:42:16 +02:00
Alchav
fac72dbc20 FFMQ: Fix reset protection (#3710)
* Revert reset protection

* Fix reset protection

---------

Co-authored-by: alchav <alchav@jalchavware.com>
2024-07-29 19:40:58 +02:00
qwint
e764da3dc6 HK: Options API updates, et al. (#3428)
* updates HK to consistently use world.random, use world.options, don't use world = self.multiworld, and remove some things from the logicMixin

* Update HK to new options dataclass

* Move completion condition helpers to Rules.py

* updates from review
2024-07-28 23:27:39 +02:00
CaitSith2
ab0903679c Factorio: Fix ap-get-technology nil value crashes (#3517) 2024-07-28 20:57:10 +02:00
Star Rauchenberger
67f329b96f Lingo: Add warpless connection between Hedge Maze and The Incomparable (#3703)
These areas are technically connected through The Observant, but the connection between The Observant and The Incomparable is marked as a warp because of the warp hallways leading up to The Observant's achievement panel. Creating separate entrances for The Incomparable is a simple workaround, and allows use of that connection during a pilgrimage.
2024-07-28 17:41:57 +02:00
Scipio Wright
b273852512 Fix obvious typo (#3622) 2024-07-28 00:44:48 -04:00
Fabian Dill
b77805e5ee Fill: remove sweep_for_events(key_only=True) (#2239) 2024-07-28 01:32:25 +02:00
lilDavid
34141f8de0 SMZ3: Classify "nice" items as useful (#3683) 2024-07-27 23:19:09 +02:00
Scipio Wright
e38f5d0a61 TUNIC: Update plando connection option call to use options API #3695 2024-07-27 23:17:59 +02:00
Star Rauchenberger
35ed0d4e19 Lingo: Fix Rhyme Room LEAP panel logic (#3699) 2024-07-27 23:17:34 +02:00
CookieCat
e5c9b8ad0c AHIT: Generation error fixes and some other bug fixes (#3663)
* duh

* Fuck it

* Major fixes

* a

* b

* Even more fixes

* New option - NoFreeRoamFinale

* a

* Hat Logic Fix

* Just to be safe

* multiworld.random to world.random

* KeyError fix

* Update .gitignore

* Update __init__.py

* Zoinks Scoob

* ffs

* Ruh Roh Raggy, more r-r-r-random bugs!

* 0.9b - cleanup + expanded logic difficulty

* Update Rules.py

* Update Regions.py

* AttributeError fix

* 0.10b - New Options

* 1.0 Preparations

* Docs

* Docs 2

* Fixes

* Update __init__.py

* Fixes

* variable capture my beloathed

* Fixes

* a

* 10 Seconds logic fix

* 1.1

* 1.2

* a

* New client

* More client changes

* 1.3

* Final touch-ups for 1.3

* 1.3.1

* 1.3.3

* Zero Jumps gen error fix

* more fixes

* Formatting improvements

* typo

* Update __init__.py

* Revert "Update __init__.py"

This reverts commit e178a7c0a6.

* init

* Update to new options API

* Missed some

* Snatcher Coins fix

* Missed some more

* some slight touch ups

* rewind

* a

* fix things

* Revert "Merge branch 'main' of https://github.com/CookieCat45/Archipelago-ahit"

This reverts commit a2360fe197, reversing
changes made to b8948bc495.

* Update .gitignore

* 1.3.6

* Final touch-ups

* Fix client and leftover old options api

* Delete setup-ahitclient.py

* Update .gitignore

* old python version fix

* proper warnings for invalid act plandos

* Update worlds/ahit/docs/en_A Hat in Time.md

Co-authored-by: Danaël V. <104455676+ReverM@users.noreply.github.com>

* Update worlds/ahit/docs/setup_en.md

Co-authored-by: Danaël V. <104455676+ReverM@users.noreply.github.com>

* 120 char per line

* "settings" to "options"

* Update DeathWishRules.py

* Update worlds/ahit/docs/en_A Hat in Time.md

Co-authored-by: Nicholas Saylor <79181893+nicholassaylor@users.noreply.github.com>

* No more loading the data package

* cleanup + act plando fixes

* almost forgot

* Update Rules.py

* a

* Update worlds/ahit/Options.py

Co-authored-by: Ixrec <ericrhitchcock@gmail.com>

* Options stuff

* oop

* no unnecessary type hints

* warn about depot download length in setup guide

* Update worlds/ahit/Options.py

Co-authored-by: Ixrec <ericrhitchcock@gmail.com>

* typo

Co-authored-by: Ixrec <ericrhitchcock@gmail.com>

* Update worlds/ahit/Rules.py

Co-authored-by: Ixrec <ericrhitchcock@gmail.com>

* review stuff

* More stuff from review

* comment

* 1.5 Update

* link fix?

* link fix 2

* Update setup_en.md

* Update setup_en.md

* Update setup_en.md

* Evil

* Good fucking lord

* Review stuff again + Logic fixes

* More review stuff

* Even more review stuff - we're almost done

* DW review stuff

* Finish up review stuff

* remove leftover stuff

* a

* assert item

* add A Hat in Time to readme/codeowners files

* Fix range options not being corrected properly

* 120 chars per line in docs

* Update worlds/ahit/Regions.py

Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>

* Update worlds/ahit/DeathWishLocations.py

Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>

* Remove some unnecessary option.class.value

* Remove data_version and more option.class.value

* Update worlds/ahit/Items.py

Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>

* Remove the rest of option.class.value

* Update worlds/ahit/DeathWishLocations.py

Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>

* review stuff

* Replace connect_regions with Region.connect

* review stuff

* Remove unnecessary Optional from LocData

* Remove HatType.NONE

* Update worlds/ahit/test/TestActs.py

Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>

* fix so default tests actually don't run

* Improve performance for death wish rules

* rename test file

* change test imports

* 1000 is probably unnecessary

* a

* change state.count to state.has

* stuff

* starting inventory hats fix

* shouldn't have done this lol

* make ship shape task goal equal to number of tasksanity checks if set to 0

* a

* change act shuffle starting acts + logic updates

* dumb

* option groups + lambda capture cringe + typo

* a

* b

* missing option in groups

* c

* Fix Your Contract Has Expired being placed on first level when it shouldn't

* yche fix

* formatting

* major logic bug fix for death wish

* Update Regions.py

* Add missing indirect connections

* Fix generation error from chapter 2 start with act shuffle off

* a

* Revert "a"

This reverts commit df58bbcd99.

* Revert "Fix generation error from chapter 2 start with act shuffle off"

This reverts commit 0f4d441824.

* bunch of fixes

* Update Regions.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update Regions.py

* Update worlds/ahit/__init__.py

Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>

* Update __init__.py

* Update __init__.py

---------

Co-authored-by: Danaël V. <104455676+ReverM@users.noreply.github.com>
Co-authored-by: Nicholas Saylor <79181893+nicholassaylor@users.noreply.github.com>
Co-authored-by: Ixrec <ericrhitchcock@gmail.com>
Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>
Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
2024-07-27 19:16:52 +02:00
75 changed files with 1429 additions and 860 deletions

View File

@@ -1,5 +1,6 @@
from __future__ import annotations
import collections
import copy
import itertools
import functools
@@ -63,7 +64,6 @@ class MultiWorld():
state: CollectionState
plando_options: PlandoOptions
accessibility: Dict[int, Options.Accessibility]
early_items: Dict[int, Dict[str, int]]
local_early_items: Dict[int, Dict[str, int]]
local_items: Dict[int, Options.LocalItems]
@@ -288,6 +288,86 @@ class MultiWorld():
group["non_local_items"] = item_link["non_local_items"]
group["link_replacement"] = replacement_prio[item_link["link_replacement"]]
def link_items(self) -> None:
"""Called to link together items in the itempool related to the registered item link groups."""
from worlds import AutoWorld
for group_id, group in self.groups.items():
def find_common_pool(players: Set[int], shared_pool: Set[str]) -> Tuple[
Optional[Dict[int, Dict[str, int]]], Optional[Dict[str, int]]
]:
classifications: Dict[str, int] = collections.defaultdict(int)
counters = {player: {name: 0 for name in shared_pool} for player in players}
for item in self.itempool:
if item.player in counters and item.name in shared_pool:
counters[item.player][item.name] += 1
classifications[item.name] |= item.classification
for player in players.copy():
if all([counters[player][item] == 0 for item in shared_pool]):
players.remove(player)
del (counters[player])
if not players:
return None, None
for item in shared_pool:
count = min(counters[player][item] for player in players)
if count:
for player in players:
counters[player][item] = count
else:
for player in players:
del (counters[player][item])
return counters, classifications
common_item_count, classifications = find_common_pool(group["players"], group["item_pool"])
if not common_item_count:
continue
new_itempool: List[Item] = []
for item_name, item_count in next(iter(common_item_count.values())).items():
for _ in range(item_count):
new_item = group["world"].create_item(item_name)
# mangle together all original classification bits
new_item.classification |= classifications[item_name]
new_itempool.append(new_item)
region = Region("Menu", group_id, self, "ItemLink")
self.regions.append(region)
locations = region.locations
for item in self.itempool:
count = common_item_count.get(item.player, {}).get(item.name, 0)
if count:
loc = Location(group_id, f"Item Link: {item.name} -> {self.player_name[item.player]} {count}",
None, region)
loc.access_rule = lambda state, item_name = item.name, group_id_ = group_id, count_ = count: \
state.has(item_name, group_id_, count_)
locations.append(loc)
loc.place_locked_item(item)
common_item_count[item.player][item.name] -= 1
else:
new_itempool.append(item)
itemcount = len(self.itempool)
self.itempool = new_itempool
while itemcount > len(self.itempool):
items_to_add = []
for player in group["players"]:
if group["link_replacement"]:
item_player = group_id
else:
item_player = player
if group["replacement_items"][player]:
items_to_add.append(AutoWorld.call_single(self, "create_item", item_player,
group["replacement_items"][player]))
else:
items_to_add.append(AutoWorld.call_single(self, "create_filler", item_player))
self.random.shuffle(items_to_add)
self.itempool.extend(items_to_add[:itemcount - len(self.itempool)])
def secure(self):
self.random = ThreadBarrierProxy(secrets.SystemRandom())
self.is_race = True
@@ -523,26 +603,22 @@ class MultiWorld():
players: Dict[str, Set[int]] = {
"minimal": set(),
"items": set(),
"locations": set()
"full": set()
}
for player, access in self.accessibility.items():
players[access.current_key].add(player)
for player, world in self.worlds.items():
players[world.options.accessibility.current_key].add(player)
beatable_fulfilled = False
def location_condition(location: Location):
def location_condition(location: Location) -> bool:
"""Determine if this location has to be accessible, location is already filtered by location_relevant"""
if location.player in players["locations"] or (location.item and location.item.player not in
players["minimal"]):
return True
return False
return location.player in players["full"] or \
(location.item and location.item.player not in players["minimal"])
def location_relevant(location: Location):
def location_relevant(location: Location) -> bool:
"""Determine if this location is relevant to sweep."""
if location.progress_type != LocationProgressType.EXCLUDED \
and (location.player in players["locations"] or location.advancement):
return True
return False
return location.progress_type != LocationProgressType.EXCLUDED \
and (location.player in players["full"] or location.advancement)
def all_done() -> bool:
"""Check if all access rules are fulfilled"""
@@ -680,13 +756,13 @@ class CollectionState():
def can_reach_region(self, spot: str, player: int) -> bool:
return self.multiworld.get_region(spot, player).can_reach(self)
def sweep_for_events(self, key_only: bool = False, locations: Optional[Iterable[Location]] = None) -> None:
def sweep_for_events(self, locations: Optional[Iterable[Location]] = None) -> None:
if locations is None:
locations = self.multiworld.get_filled_locations()
reachable_events = True
# since the loop has a good chance to run more than once, only filter the events once
locations = {location for location in locations if location.advancement and location not in self.events and
not key_only or getattr(location.item, "locked_dungeon_item", False)}
locations = {location for location in locations if location.advancement and location not in self.events}
while reachable_events:
reachable_events = {location for location in locations if location.can_reach(self)}
locations -= reachable_events
@@ -1291,8 +1367,6 @@ class Spoiler:
state = CollectionState(multiworld)
collection_spheres = []
while required_locations:
state.sweep_for_events(key_only=True)
sphere = set(filter(state.can_reach, required_locations))
for location in sphere:

View File

@@ -227,12 +227,15 @@ def remaining_fill(multiworld: MultiWorld,
swapped_items: typing.Counter[typing.Tuple[int, str]] = Counter()
total = min(len(itempool), len(locations))
placed = 0
state = CollectionState(multiworld)
while locations and itempool:
item_to_place = itempool.pop()
spot_to_fill: typing.Optional[Location] = None
for i, location in enumerate(locations):
if location.item_rule(item_to_place):
if location.can_fill(state, item_to_place, check_access=False):
# popping by index is faster than removing by content,
spot_to_fill = locations.pop(i)
# skipping a scan for the element
@@ -253,7 +256,7 @@ def remaining_fill(multiworld: MultiWorld,
location.item = None
placed_item.location = None
if location.item_rule(item_to_place):
if location.can_fill(state, item_to_place, check_access=False):
# Add this item to the existing placement, and
# add the old item to the back of the queue
spot_to_fill = placements.pop(i)
@@ -646,7 +649,6 @@ def balance_multiworld_progression(multiworld: MultiWorld) -> None:
def get_sphere_locations(sphere_state: CollectionState,
locations: typing.Set[Location]) -> typing.Set[Location]:
sphere_state.sweep_for_events(key_only=True, locations=locations)
return {loc for loc in locations if sphere_state.can_reach(loc)}
def item_percentage(player: int, num: int) -> float:

77
Main.py
View File

@@ -184,82 +184,7 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No
assert len(multiworld.itempool) == len(new_items), "Item Pool amounts should not change."
multiworld.itempool[:] = new_items
# temporary home for item links, should be moved out of Main
for group_id, group in multiworld.groups.items():
def find_common_pool(players: Set[int], shared_pool: Set[str]) -> Tuple[
Optional[Dict[int, Dict[str, int]]], Optional[Dict[str, int]]
]:
classifications: Dict[str, int] = collections.defaultdict(int)
counters = {player: {name: 0 for name in shared_pool} for player in players}
for item in multiworld.itempool:
if item.player in counters and item.name in shared_pool:
counters[item.player][item.name] += 1
classifications[item.name] |= item.classification
for player in players.copy():
if all([counters[player][item] == 0 for item in shared_pool]):
players.remove(player)
del (counters[player])
if not players:
return None, None
for item in shared_pool:
count = min(counters[player][item] for player in players)
if count:
for player in players:
counters[player][item] = count
else:
for player in players:
del (counters[player][item])
return counters, classifications
common_item_count, classifications = find_common_pool(group["players"], group["item_pool"])
if not common_item_count:
continue
new_itempool: List[Item] = []
for item_name, item_count in next(iter(common_item_count.values())).items():
for _ in range(item_count):
new_item = group["world"].create_item(item_name)
# mangle together all original classification bits
new_item.classification |= classifications[item_name]
new_itempool.append(new_item)
region = Region("Menu", group_id, multiworld, "ItemLink")
multiworld.regions.append(region)
locations = region.locations
for item in multiworld.itempool:
count = common_item_count.get(item.player, {}).get(item.name, 0)
if count:
loc = Location(group_id, f"Item Link: {item.name} -> {multiworld.player_name[item.player]} {count}",
None, region)
loc.access_rule = lambda state, item_name = item.name, group_id_ = group_id, count_ = count: \
state.has(item_name, group_id_, count_)
locations.append(loc)
loc.place_locked_item(item)
common_item_count[item.player][item.name] -= 1
else:
new_itempool.append(item)
itemcount = len(multiworld.itempool)
multiworld.itempool = new_itempool
while itemcount > len(multiworld.itempool):
items_to_add = []
for player in group["players"]:
if group["link_replacement"]:
item_player = group_id
else:
item_player = player
if group["replacement_items"][player]:
items_to_add.append(AutoWorld.call_single(multiworld, "create_item", item_player,
group["replacement_items"][player]))
else:
items_to_add.append(AutoWorld.call_single(multiworld, "create_filler", item_player))
multiworld.random.shuffle(items_to_add)
multiworld.itempool.extend(items_to_add[:itemcount - len(multiworld.itempool)])
multiworld.link_items()
if any(multiworld.item_links.values()):
multiworld._all_state = None

View File

@@ -786,17 +786,22 @@ class VerifyKeys(metaclass=FreezeValidKeys):
verify_location_name: bool = False
value: typing.Any
@classmethod
def verify_keys(cls, data: typing.Iterable[str]) -> None:
if cls.valid_keys:
data = set(data)
dataset = set(word.casefold() for word in data) if cls.valid_keys_casefold else set(data)
extra = dataset - cls._valid_keys
def verify_keys(self) -> None:
if self.valid_keys:
data = set(self.value)
dataset = set(word.casefold() for word in data) if self.valid_keys_casefold else set(data)
extra = dataset - self._valid_keys
if extra:
raise Exception(f"Found unexpected key {', '.join(extra)} in {cls}. "
f"Allowed keys: {cls._valid_keys}.")
raise OptionError(
f"Found unexpected key {', '.join(extra)} in {getattr(self, 'display_name', self)}. "
f"Allowed keys: {self._valid_keys}."
)
def verify(self, world: typing.Type[World], player_name: str, plando_options: "PlandoOptions") -> None:
try:
self.verify_keys()
except OptionError as validation_error:
raise OptionError(f"Player {player_name} has invalid option keys:\n{validation_error}")
if self.convert_name_groups and self.verify_item_name:
new_value = type(self.value)() # empty container of whatever value is
for item_name in self.value:
@@ -833,7 +838,6 @@ class OptionDict(Option[typing.Dict[str, typing.Any]], VerifyKeys, typing.Mappin
@classmethod
def from_any(cls, data: typing.Dict[str, typing.Any]) -> OptionDict:
if type(data) == dict:
cls.verify_keys(data)
return cls(data)
else:
raise NotImplementedError(f"Cannot Convert from non-dictionary, got {type(data)}")
@@ -879,7 +883,6 @@ class OptionList(Option[typing.List[typing.Any]], VerifyKeys):
@classmethod
def from_any(cls, data: typing.Any):
if is_iterable_except_str(data):
cls.verify_keys(data)
return cls(data)
return cls.from_text(str(data))
@@ -905,7 +908,6 @@ class OptionSet(Option[typing.Set[str]], VerifyKeys):
@classmethod
def from_any(cls, data: typing.Any):
if is_iterable_except_str(data):
cls.verify_keys(data)
return cls(data)
return cls.from_text(str(data))
@@ -948,6 +950,19 @@ class PlandoTexts(Option[typing.List[PlandoText]], VerifyKeys):
self.value = []
logging.warning(f"The plando texts module is turned off, "
f"so text for {player_name} will be ignored.")
else:
super().verify(world, player_name, plando_options)
def verify_keys(self) -> None:
if self.valid_keys:
data = set(text.at for text in self)
dataset = set(word.casefold() for word in data) if self.valid_keys_casefold else set(data)
extra = dataset - self._valid_keys
if extra:
raise OptionError(
f"Invalid \"at\" placement {', '.join(extra)} in {getattr(self, 'display_name', self)}. "
f"Allowed placements: {self._valid_keys}."
)
@classmethod
def from_any(cls, data: PlandoTextsFromAnyType) -> Self:
@@ -971,7 +986,6 @@ class PlandoTexts(Option[typing.List[PlandoText]], VerifyKeys):
texts.append(text)
else:
raise Exception(f"Cannot create plando text from non-dictionary type, got {type(text)}")
cls.verify_keys([text.at for text in texts])
return cls(texts)
else:
raise NotImplementedError(f"Cannot Convert from non-list, got {type(data)}")
@@ -1144,18 +1158,35 @@ class PlandoConnections(Option[typing.List[PlandoConnection]], metaclass=Connect
class Accessibility(Choice):
"""Set rules for reachability of your items/locations.
"""
Set rules for reachability of your items/locations.
**Full:** ensure everything can be reached and acquired.
- **Locations:** ensure everything can be reached and acquired.
- **Items:** ensure all logically relevant items can be acquired.
- **Minimal:** ensure what is needed to reach your goal can be acquired.
**Minimal:** ensure what is needed to reach your goal can be acquired.
"""
display_name = "Accessibility"
rich_text_doc = True
option_locations = 0
option_items = 1
option_full = 0
option_minimal = 2
alias_none = 2
alias_locations = 0
alias_items = 0
default = 0
class ItemsAccessibility(Accessibility):
"""
Set rules for reachability of your items/locations.
**Full:** ensure everything can be reached and acquired.
**Minimal:** ensure what is needed to reach your goal can be acquired.
**Items:** ensure all logically relevant items can be acquired. Some items, such as keys, may be self-locking, and
some locations may be inaccessible.
"""
option_items = 1
default = 1

View File

@@ -231,6 +231,13 @@ def generate_yaml(game: str):
del options[key]
# Detect keys which end with -range, indicating a NamedRange with a possible custom value
elif key_parts[-1].endswith("-range"):
if options[key_parts[-1][:-6]] == "custom":
options[key_parts[-1][:-6]] = val
del options[key]
# Detect random-* keys and set their options accordingly
for key, val in options.copy().items():
if key.startswith("random-"):

View File

@@ -54,7 +54,7 @@
{% macro NamedRange(option_name, option) %}
{{ OptionTitle(option_name, option) }}
<div class="named-range-container">
<select id="{{ option_name }}-select" data-option-name="{{ option_name }}" {{ "disabled" if option.default == "random" }}>
<select id="{{ option_name }}-select" name="{{ option_name }}" data-option-name="{{ option_name }}" {{ "disabled" if option.default == "random" }}>
{% for key, val in option.special_range_names.items() %}
{% if option.default == val %}
<option value="{{ val }}" selected>{{ key|replace("_", " ")|title }} ({{ val }})</option>
@@ -64,17 +64,17 @@
{% endfor %}
<option value="custom" hidden>Custom</option>
</select>
<div class="named-range-wrapper">
<div class="named-range-wrapper js-required">
<input
type="range"
id="{{ option_name }}"
name="{{ option_name }}"
name="{{ option_name }}-range"
min="{{ option.range_start }}"
max="{{ option.range_end }}"
value="{{ option.default | default(option.range_start) if option.default != "random" else option.range_start }}"
{{ "disabled" if option.default == "random" }}
/>
<span id="{{ option_name }}-value" class="range-value js-required">
<span id="{{ option_name }}-value" class="range-value">
{{ option.default | default(option.range_start) if option.default != "random" else option.range_start }}
</span>
{{ RandomizeButton(option_name, option) }}

View File

@@ -11,7 +11,7 @@
<noscript>
<style>
.js-required{
display: none;
display: none !important;
}
</style>
</noscript>

View File

@@ -79,7 +79,7 @@ class TrackerData:
# Normal lookup tables as well.
self.item_name_to_id[game] = game_package["item_name_to_id"]
self.location_name_to_id[game] = game_package["item_name_to_id"]
self.location_name_to_id[game] = game_package["location_name_to_id"]
def get_seed_name(self) -> str:
"""Retrieves the seed name."""

View File

@@ -43,26 +43,3 @@ A faster alternative to the `for` loop would be to use a [list comprehension](ht
```py
item_pool += [self.create_filler() for _ in range(total_locations - len(item_pool))]
```
---
### I learned about indirect conditions in the world API document, but I want to know more. What are they and why are they necessary?
The world API document mentions indirect conditions and **when** you should use them, but not *how* they work and *why* they are necessary. This is because the explanation is quite complicated.
Region sweep (the algorithm that determines which regions are reachable) is a Breadth-First Search of the region graph from the origin region, checking entrances one by one and adding newly reached nodes (regions) and their entrances to the queue until there is nothing more to check.
For performance reasons, AP only checks every entrance once. However, if an entrance's access condition depends on regions, then it is possible for this to happen:
1. An entrance that depends on a region is checked and determined to be nontraversable because the region hasn't been reached yet during the graph search.
2. After that, the region is reached by the graph search.
The entrance *would* now be determined to be traversable if it were rechecked, but it is not.
To account for this case, AP would have to recheck all entrances every time a new region is reached until no new regions are reached.
However, there is a way to **manually** define that a *specific* entrance needs to be rechecked during region sweep if a *specific* region is reached during it. This is what an indirect condition is.
This keeps almost all of the performance upsides. Even a game making heavy use of indirect conditions (See: The Witness) is still significantly faster than if it just blanket "rechecked all entrances until nothing new is found".
The reason entrance access rules using `location.can_reach` and `entrance.can_reach` are also affected is simple: They call `region.can_reach` on their respective parent/source region.
We recognize it can feel like a trap since it will not alert you when you are missing an indirect condition, and that some games have very complex access rules.
As of [PR #3682 (Core: Region handling customization)](https://github.com/ArchipelagoMW/Archipelago/pull/3682) being merged, it is also possible for a world to opt out of indirect conditions entirely, although it does come at a flat performance cost.
It should only be used by games that *really* need it. For most games, it should be reasonable to know all entrance &rarr; region dependencies, and in this case, indirect conditions are still preferred because they are faster.

View File

@@ -66,7 +66,6 @@ non_apworlds: set = {
"Adventure",
"ArchipIDLE",
"Archipelago",
"ChecksFinder",
"Clique",
"Final Fantasy",
"Lufia II Ancient Cave",

View File

@@ -174,8 +174,8 @@ class TestFillRestrictive(unittest.TestCase):
player1 = generate_player_data(multiworld, 1, 3, 3)
player2 = generate_player_data(multiworld, 2, 3, 3)
multiworld.accessibility[player1.id].value = multiworld.accessibility[player1.id].option_minimal
multiworld.accessibility[player2.id].value = multiworld.accessibility[player2.id].option_locations
multiworld.worlds[player1.id].options.accessibility.value = Accessibility.option_minimal
multiworld.worlds[player2.id].options.accessibility.value = Accessibility.option_full
multiworld.completion_condition[player1.id] = lambda state: True
multiworld.completion_condition[player2.id] = lambda state: state.has(player2.prog_items[2].name, player2.id)

View File

@@ -1,6 +1,6 @@
import unittest
from BaseClasses import PlandoOptions
from BaseClasses import MultiWorld, PlandoOptions
from Options import ItemLinks
from worlds.AutoWorld import AutoWorldRegister
@@ -47,3 +47,15 @@ class TestOptions(unittest.TestCase):
self.assertIn("Bow", link.value[0]["item_pool"])
# TODO test that the group created using these options has the items
def test_item_links_resolve(self):
"""Test item link option resolves correctly."""
item_link_group = [{
"name": "ItemLinkTest",
"item_pool": ["Everything"],
"link_replacement": False,
"replacement_item": None,
}]
item_links = {1: ItemLinks.from_any(item_link_group), 2: ItemLinks.from_any(item_link_group)}
for link in item_links.values():
self.assertEqual(link.value[0], item_link_group[0])

View File

@@ -69,7 +69,7 @@ class TestTwoPlayerMulti(MultiworldTestBase):
for world in AutoWorldRegister.world_types.values():
self.multiworld = setup_multiworld([world, world], ())
for world in self.multiworld.worlds.values():
world.options.accessibility.value = Accessibility.option_locations
world.options.accessibility.value = Accessibility.option_full
self.assertSteps(gen_steps)
with self.subTest("filling multiworld", seed=self.multiworld.seed):
distribute_items_restrictive(self.multiworld)

View File

@@ -39,7 +39,7 @@ def create_itempool(world: "HatInTimeWorld") -> List[Item]:
continue
else:
if name == "Scooter Badge":
if world.options.CTRLogic is CTRLogic.option_scooter or get_difficulty(world) >= Difficulty.MODERATE:
if world.options.CTRLogic == CTRLogic.option_scooter or get_difficulty(world) >= Difficulty.MODERATE:
item_type = ItemClassification.progression
elif name == "No Bonk Badge" and world.is_dw():
item_type = ItemClassification.progression

View File

@@ -659,6 +659,10 @@ def is_valid_act_combo(world: "HatInTimeWorld", entrance_act: Region,
if exit_act.name not in chapter_finales:
return False
exit_chapter: str = act_chapters.get(exit_act.name)
# make sure that certain time rift combinations never happen
always_block: bool = exit_chapter != "Mafia Town" and exit_chapter != "Subcon Forest"
if not ignore_certain_rules or always_block:
if entrance_act.name in rift_access_regions and exit_act.name in rift_access_regions[entrance_act.name]:
return False
@@ -684,9 +688,12 @@ def is_valid_first_act(world: "HatInTimeWorld", act: Region) -> bool:
if act.name not in guaranteed_first_acts:
return False
if world.options.ActRandomizer == ActRandomizer.option_light and "Time Rift" in act.name:
return False
# If there's only a single level in the starting chapter, only allow Mafia Town or Subcon Forest levels
start_chapter = world.options.StartingChapter
if start_chapter is ChapterIndex.ALPINE or start_chapter is ChapterIndex.SUBCON:
if start_chapter == ChapterIndex.ALPINE or start_chapter == ChapterIndex.SUBCON:
if "Time Rift" in act.name:
return False
@@ -723,7 +730,8 @@ def is_valid_first_act(world: "HatInTimeWorld", act: Region) -> bool:
elif act.name == "Contractual Obligations" and world.options.ShuffleSubconPaintings:
return False
if world.options.ShuffleSubconPaintings and act_chapters.get(act.name, "") == "Subcon Forest":
if world.options.ShuffleSubconPaintings and "Time Rift" not in act.name \
and act_chapters.get(act.name, "") == "Subcon Forest":
# Only allow Subcon levels if painting skips are allowed
if diff < Difficulty.MODERATE or world.options.NoPaintingSkips:
return False

View File

@@ -1,7 +1,6 @@
from worlds.AutoWorld import CollectionState
from worlds.generic.Rules import add_rule, set_rule
from .Locations import location_table, zipline_unlocks, is_location_valid, contract_locations, \
shop_locations, event_locs
from .Locations import location_table, zipline_unlocks, is_location_valid, shop_locations, event_locs
from .Types import HatType, ChapterIndex, hat_type_to_item, Difficulty, HitType
from BaseClasses import Location, Entrance, Region
from typing import TYPE_CHECKING, List, Callable, Union, Dict
@@ -148,14 +147,14 @@ def set_rules(world: "HatInTimeWorld"):
if world.is_dlc1():
chapter_list.append(ChapterIndex.CRUISE)
if world.is_dlc2() and final_chapter is not ChapterIndex.METRO:
if world.is_dlc2() and final_chapter != ChapterIndex.METRO:
chapter_list.append(ChapterIndex.METRO)
chapter_list.remove(starting_chapter)
world.random.shuffle(chapter_list)
# Make sure Alpine is unlocked before any DLC chapters are, as the Alpine door needs to be open to access them
if starting_chapter is not ChapterIndex.ALPINE and (world.is_dlc1() or world.is_dlc2()):
if starting_chapter != ChapterIndex.ALPINE and (world.is_dlc1() or world.is_dlc2()):
index1 = 69
index2 = 69
pos: int
@@ -165,7 +164,7 @@ def set_rules(world: "HatInTimeWorld"):
if world.is_dlc1():
index1 = chapter_list.index(ChapterIndex.CRUISE)
if world.is_dlc2() and final_chapter is not ChapterIndex.METRO:
if world.is_dlc2() and final_chapter != ChapterIndex.METRO:
index2 = chapter_list.index(ChapterIndex.METRO)
lowest_index = min(index1, index2)
@@ -242,9 +241,6 @@ def set_rules(world: "HatInTimeWorld"):
if not is_location_valid(world, key):
continue
if key in contract_locations.keys():
continue
loc = world.multiworld.get_location(key, world.player)
for hat in data.required_hats:
@@ -256,7 +252,7 @@ def set_rules(world: "HatInTimeWorld"):
if data.paintings > 0 and world.options.ShuffleSubconPaintings:
add_rule(loc, lambda state, paintings=data.paintings: has_paintings(state, world, paintings))
if data.hit_type is not HitType.none and world.options.UmbrellaLogic:
if data.hit_type != HitType.none and world.options.UmbrellaLogic:
if data.hit_type == HitType.umbrella:
add_rule(loc, lambda state: state.has("Umbrella", world.player))
@@ -518,7 +514,7 @@ def set_hard_rules(world: "HatInTimeWorld"):
lambda state: can_use_hat(state, world, HatType.ICE))
# Hard: clear Rush Hour with Brewing Hat only
if world.options.NoTicketSkips is not NoTicketSkips.option_true:
if world.options.NoTicketSkips != NoTicketSkips.option_true:
set_rule(world.multiworld.get_location("Act Completion (Rush Hour)", world.player),
lambda state: can_use_hat(state, world, HatType.BREWING))
else:

View File

@@ -1,15 +1,16 @@
from BaseClasses import Item, ItemClassification, Tutorial, Location, MultiWorld
from .Items import item_table, create_item, relic_groups, act_contracts, create_itempool, get_shop_trap_name, \
calculate_yarn_costs
calculate_yarn_costs, alps_hooks
from .Regions import create_regions, randomize_act_entrances, chapter_act_info, create_events, get_shuffled_region
from .Locations import location_table, contract_locations, is_location_valid, get_location_names, TASKSANITY_START_ID, \
get_total_locations
from .Rules import set_rules
from .Rules import set_rules, has_paintings
from .Options import AHITOptions, slot_data_options, adjust_options, RandomizeHatOrder, EndGoal, create_option_groups
from .Types import HatType, ChapterIndex, HatInTimeItem, hat_type_to_item
from .Types import HatType, ChapterIndex, HatInTimeItem, hat_type_to_item, Difficulty
from .DeathWishLocations import create_dw_regions, dw_classes, death_wishes
from .DeathWishRules import set_dw_rules, create_enemy_events, hit_list, bosses
from worlds.AutoWorld import World, WebWorld, CollectionState
from worlds.generic.Rules import add_rule
from typing import List, Dict, TextIO
from worlds.LauncherComponents import Component, components, icon_paths, launch_subprocess, Type
from Utils import local_path
@@ -86,19 +87,27 @@ class HatInTimeWorld(World):
if self.is_dw_only():
return
# If our starting chapter is 4 and act rando isn't on, force hookshot into inventory
# If starting chapter is 3 and painting shuffle is enabled, and act rando isn't, give one free painting unlock
start_chapter: ChapterIndex = ChapterIndex(self.options.StartingChapter)
# Take care of some extremely restrictive starts in other chapters with act shuffle off
if not self.options.ActRandomizer:
start_chapter = self.options.StartingChapter
if start_chapter == ChapterIndex.ALPINE:
self.multiworld.push_precollected(self.create_item("Hookshot Badge"))
if self.options.UmbrellaLogic:
self.multiworld.push_precollected(self.create_item("Umbrella"))
if start_chapter == ChapterIndex.ALPINE or start_chapter == ChapterIndex.SUBCON:
if not self.options.ActRandomizer:
if start_chapter == ChapterIndex.ALPINE:
self.multiworld.push_precollected(self.create_item("Hookshot Badge"))
if self.options.UmbrellaLogic:
self.multiworld.push_precollected(self.create_item("Umbrella"))
if start_chapter == ChapterIndex.SUBCON and self.options.ShuffleSubconPaintings:
if self.options.ShuffleAlpineZiplines:
ziplines = list(alps_hooks.keys())
ziplines.remove("Zipline Unlock - The Twilight Bell Path") # not enough checks from this one
self.multiworld.push_precollected(self.create_item(self.random.choice(ziplines)))
elif start_chapter == ChapterIndex.SUBCON:
if self.options.ShuffleSubconPaintings:
self.multiworld.push_precollected(self.create_item("Progressive Painting Unlock"))
elif start_chapter == ChapterIndex.BIRDS:
if self.options.UmbrellaLogic:
if self.options.LogicDifficulty < Difficulty.EXPERT:
self.multiworld.push_precollected(self.create_item("Umbrella"))
elif self.options.LogicDifficulty < Difficulty.MODERATE:
self.multiworld.push_precollected(self.create_item("Umbrella"))
def create_regions(self):
# noinspection PyClassVar
@@ -119,7 +128,10 @@ class HatInTimeWorld(World):
# place vanilla contract locations if contract shuffle is off
if not self.options.ShuffleActContracts:
for name in contract_locations.keys():
self.multiworld.get_location(name, self.player).place_locked_item(create_item(self, name))
loc = self.get_location(name)
loc.place_locked_item(create_item(self, name))
if self.options.ShuffleSubconPaintings and loc.name != "Snatcher's Contract - The Subcon Well":
add_rule(loc, lambda state: has_paintings(state, self, 1))
def create_items(self):
if self.has_yarn():
@@ -317,7 +329,7 @@ class HatInTimeWorld(World):
def remove(self, state: "CollectionState", item: "Item") -> bool:
old_count: int = state.count(item.name, self.player)
change = super().collect(state, item)
change = super().remove(state, item)
if change and old_count == 1:
if "Stamp" in item.name:
if "2 Stamp" in item.name:

View File

@@ -1,8 +1,8 @@
import typing
from BaseClasses import MultiWorld
from Options import Choice, Range, Option, Toggle, DefaultOnToggle, DeathLink, \
StartInventoryPool, PlandoBosses, PlandoConnections, PlandoTexts, FreeText, Removed
from Options import Choice, Range, DeathLink, DefaultOnToggle, FreeText, ItemsAccessibility, Option, \
PlandoBosses, PlandoConnections, PlandoTexts, Removed, StartInventoryPool, Toggle
from .EntranceShuffle import default_connections, default_dungeon_connections, \
inverted_default_connections, inverted_default_dungeon_connections
from .Text import TextTable
@@ -743,6 +743,7 @@ class ALttPPlandoTexts(PlandoTexts):
alttp_options: typing.Dict[str, type(Option)] = {
"accessibility": ItemsAccessibility,
"plando_connections": ALttPPlandoConnections,
"plando_texts": ALttPPlandoTexts,
"start_inventory_from_pool": StartInventoryPool,

View File

@@ -2,6 +2,7 @@ import collections
import logging
from typing import Iterator, Set
from Options import ItemsAccessibility
from BaseClasses import Entrance, MultiWorld
from worlds.generic.Rules import (add_item_rule, add_rule, forbid_item,
item_name_in_location_names, location_item_name, set_rule, allow_self_locking_items)
@@ -39,7 +40,7 @@ def set_rules(world):
else:
# Set access rules according to max glitches for multiworld progression.
# Set accessibility to none, and shuffle assuming the no logic players can always win
world.accessibility[player] = world.accessibility[player].from_text("minimal")
world.accessibility[player].value = ItemsAccessibility.option_minimal
world.progression_balancing[player].value = 0
else:
@@ -377,7 +378,7 @@ def global_rules(multiworld: MultiWorld, player: int):
or state.has("Cane of Somaria", player)))
set_rule(multiworld.get_location('Tower of Hera - Big Chest', player), lambda state: state.has('Big Key (Tower of Hera)', player))
set_rule(multiworld.get_location('Tower of Hera - Big Key Chest', player), lambda state: has_fire_source(state, player))
if multiworld.accessibility[player] != 'locations':
if multiworld.accessibility[player] != 'full':
set_always_allow(multiworld.get_location('Tower of Hera - Big Key Chest', player), lambda state, item: item.name == 'Small Key (Tower of Hera)' and item.player == player)
set_rule(multiworld.get_entrance('Swamp Palace Moat', player), lambda state: state.has('Flippers', player) and state.has('Open Floodgate', player))
@@ -393,7 +394,7 @@ def global_rules(multiworld: MultiWorld, player: int):
if state.has('Hookshot', player)
else state._lttp_has_key('Small Key (Swamp Palace)', player, 4))
set_rule(multiworld.get_location('Swamp Palace - Big Chest', player), lambda state: state.has('Big Key (Swamp Palace)', player))
if multiworld.accessibility[player] != 'locations':
if multiworld.accessibility[player] != 'full':
allow_self_locking_items(multiworld.get_location('Swamp Palace - Big Chest', player), 'Big Key (Swamp Palace)')
set_rule(multiworld.get_entrance('Swamp Palace (North)', player), lambda state: state.has('Hookshot', player) and state._lttp_has_key('Small Key (Swamp Palace)', player, 5))
if not multiworld.small_key_shuffle[player] and multiworld.glitches_required[player] not in ['hybrid_major_glitches', 'no_logic']:
@@ -423,7 +424,7 @@ def global_rules(multiworld: MultiWorld, player: int):
set_rule(multiworld.get_entrance('Skull Woods First Section West Door', player), lambda state: state._lttp_has_key('Small Key (Skull Woods)', player, 5))
set_rule(multiworld.get_entrance('Skull Woods First Section (Left) Door to Exit', player), lambda state: state._lttp_has_key('Small Key (Skull Woods)', player, 5))
set_rule(multiworld.get_location('Skull Woods - Big Chest', player), lambda state: state.has('Big Key (Skull Woods)', player) and can_use_bombs(state, player))
if multiworld.accessibility[player] != 'locations':
if multiworld.accessibility[player] != 'full':
allow_self_locking_items(multiworld.get_location('Skull Woods - Big Chest', player), 'Big Key (Skull Woods)')
set_rule(multiworld.get_entrance('Skull Woods Torch Room', player), lambda state: state._lttp_has_key('Small Key (Skull Woods)', player, 4) and state.has('Fire Rod', player) and has_sword(state, player)) # sword required for curtain
add_rule(multiworld.get_location('Skull Woods - Prize', player), lambda state: state._lttp_has_key('Small Key (Skull Woods)', player, 5))
@@ -522,12 +523,12 @@ def global_rules(multiworld: MultiWorld, player: int):
set_rule(multiworld.get_entrance('Palace of Darkness Big Key Chest Staircase', player), lambda state: can_use_bombs(state, player) and (state._lttp_has_key('Small Key (Palace of Darkness)', player, 6) or (
location_item_name(state, 'Palace of Darkness - Big Key Chest', player) in [('Small Key (Palace of Darkness)', player)] and state._lttp_has_key('Small Key (Palace of Darkness)', player, 3))))
if multiworld.accessibility[player] != 'locations':
if multiworld.accessibility[player] != 'full':
set_always_allow(multiworld.get_location('Palace of Darkness - Big Key Chest', player), lambda state, item: item.name == 'Small Key (Palace of Darkness)' and item.player == player and state._lttp_has_key('Small Key (Palace of Darkness)', player, 5))
set_rule(multiworld.get_entrance('Palace of Darkness Spike Statue Room Door', player), lambda state: state._lttp_has_key('Small Key (Palace of Darkness)', player, 6) or (
location_item_name(state, 'Palace of Darkness - Harmless Hellway', player) in [('Small Key (Palace of Darkness)', player)] and state._lttp_has_key('Small Key (Palace of Darkness)', player, 4)))
if multiworld.accessibility[player] != 'locations':
if multiworld.accessibility[player] != 'full':
set_always_allow(multiworld.get_location('Palace of Darkness - Harmless Hellway', player), lambda state, item: item.name == 'Small Key (Palace of Darkness)' and item.player == player and state._lttp_has_key('Small Key (Palace of Darkness)', player, 5))
set_rule(multiworld.get_entrance('Palace of Darkness Maze Door', player), lambda state: state._lttp_has_key('Small Key (Palace of Darkness)', player, 6))
@@ -1200,7 +1201,7 @@ def set_trock_key_rules(world, player):
# Must not go in the Chain Chomps chest - only 2 other chests available and 3+ keys required for all other chests
forbid_item(world.get_location('Turtle Rock - Chain Chomps', player), 'Big Key (Turtle Rock)', player)
forbid_item(world.get_location('Turtle Rock - Pokey 2 Key Drop', player), 'Big Key (Turtle Rock)', player)
if world.accessibility[player] == 'locations':
if world.accessibility[player] == 'full':
if world.big_key_shuffle[player] and can_reach_big_chest:
# Must not go in the dungeon - all 3 available chests (Chomps, Big Chest, Crystaroller) must be keys to access laser bridge, and the big key is required first
for location in ['Turtle Rock - Chain Chomps', 'Turtle Rock - Compass Chest',
@@ -1214,7 +1215,7 @@ def set_trock_key_rules(world, player):
location.place_locked_item(item)
toss_junk_item(world, player)
if world.accessibility[player] != 'locations':
if world.accessibility[player] != 'full':
set_always_allow(world.get_location('Turtle Rock - Big Key Chest', player), lambda state, item: item.name == 'Small Key (Turtle Rock)' and item.player == player
and state.can_reach(state.multiworld.get_region('Turtle Rock (Second Section)', player)))

View File

@@ -76,10 +76,6 @@ class ALttPItem(Item):
if self.type in {"SmallKey", "BigKey", "Map", "Compass"}:
return self.type
@property
def locked_dungeon_item(self):
return self.location.locked and self.dungeon_item
class LTTPRegionType(IntEnum):
LightWorld = 1

View File

@@ -1,11 +1,11 @@
from worlds.alttp.Dungeons import create_dungeons, get_dungeon_item_pool
from worlds.alttp.Dungeons import get_dungeon_item_pool
from worlds.alttp.EntranceShuffle import link_inverted_entrances
from worlds.alttp.InvertedRegions import create_inverted_regions
from worlds.alttp.ItemPool import difficulties
from worlds.alttp.Items import item_factory
from worlds.alttp.Regions import mark_light_world_regions
from worlds.alttp.Shops import create_shops
from test.TestBase import TestBase
from test.bases import TestBase
from worlds.alttp.test import LTTPTestBase

View File

@@ -6,7 +6,7 @@ from worlds.alttp.Items import item_factory
from worlds.alttp.Options import GlitchesRequired
from worlds.alttp.Regions import mark_light_world_regions
from worlds.alttp.Shops import create_shops
from test.TestBase import TestBase
from test.bases import TestBase
from worlds.alttp.test import LTTPTestBase

View File

@@ -6,7 +6,7 @@ from worlds.alttp.Items import item_factory
from worlds.alttp.Options import GlitchesRequired
from worlds.alttp.Regions import mark_light_world_regions
from worlds.alttp.Shops import create_shops
from test.TestBase import TestBase
from test.bases import TestBase
from worlds.alttp.test import LTTPTestBase

View File

@@ -1006,6 +1006,8 @@ def rules(brcworld):
lambda state: mataan_challenge2(state, player, limit, glitched))
set_rule(multiworld.get_location("Mataan: Score challenge reward", player),
lambda state: mataan_challenge3(state, player))
set_rule(multiworld.get_location("Mataan: Coil joins the crew", player),
lambda state: mataan_deepest(state, player, limit, glitched))
if photos:
set_rule(multiworld.get_location("Mataan: Trash Polo", player),
lambda state: camera(state, player))

View File

@@ -3,8 +3,8 @@ import typing
class ItemData(typing.NamedTuple):
code: typing.Optional[int]
progression: bool
code: int
progression: bool = True
class ChecksFinderItem(Item):
@@ -12,16 +12,9 @@ class ChecksFinderItem(Item):
item_table = {
"Map Width": ItemData(80000, True),
"Map Height": ItemData(80001, True),
"Map Bombs": ItemData(80002, True),
"Map Width": ItemData(80000),
"Map Height": ItemData(80001),
"Map Bombs": ItemData(80002),
}
required_items = {
}
item_frequencies = {
}
lookup_id_to_name: typing.Dict[int, str] = {data.code: item_name for item_name, data in item_table.items() if data.code}
lookup_id_to_name: typing.Dict[int, str] = {data.code: item_name for item_name, data in item_table.items()}

View File

@@ -3,46 +3,14 @@ import typing
class AdvData(typing.NamedTuple):
id: typing.Optional[int]
region: str
id: int
region: str = "Board"
class ChecksFinderAdvancement(Location):
class ChecksFinderLocation(Location):
game: str = "ChecksFinder"
advancement_table = {
"Tile 1": AdvData(81000, 'Board'),
"Tile 2": AdvData(81001, 'Board'),
"Tile 3": AdvData(81002, 'Board'),
"Tile 4": AdvData(81003, 'Board'),
"Tile 5": AdvData(81004, 'Board'),
"Tile 6": AdvData(81005, 'Board'),
"Tile 7": AdvData(81006, 'Board'),
"Tile 8": AdvData(81007, 'Board'),
"Tile 9": AdvData(81008, 'Board'),
"Tile 10": AdvData(81009, 'Board'),
"Tile 11": AdvData(81010, 'Board'),
"Tile 12": AdvData(81011, 'Board'),
"Tile 13": AdvData(81012, 'Board'),
"Tile 14": AdvData(81013, 'Board'),
"Tile 15": AdvData(81014, 'Board'),
"Tile 16": AdvData(81015, 'Board'),
"Tile 17": AdvData(81016, 'Board'),
"Tile 18": AdvData(81017, 'Board'),
"Tile 19": AdvData(81018, 'Board'),
"Tile 20": AdvData(81019, 'Board'),
"Tile 21": AdvData(81020, 'Board'),
"Tile 22": AdvData(81021, 'Board'),
"Tile 23": AdvData(81022, 'Board'),
"Tile 24": AdvData(81023, 'Board'),
"Tile 25": AdvData(81024, 'Board'),
}
exclusion_table = {
}
events_table = {
}
lookup_id_to_name: typing.Dict[int, str] = {data.id: item_name for item_name, data in advancement_table.items() if data.id}
base_id = 81000
advancement_table = {f"Tile {i+1}": AdvData(base_id+i) for i in range(25)}
lookup_id_to_name: typing.Dict[int, str] = {data.id: item_name for item_name, data in advancement_table.items()}

View File

@@ -1,6 +0,0 @@
import typing
from Options import Option
checksfinder_options: typing.Dict[str, type(Option)] = {
}

View File

@@ -1,44 +1,24 @@
from ..generic.Rules import set_rule
from BaseClasses import MultiWorld, CollectionState
from worlds.generic.Rules import set_rule
from BaseClasses import MultiWorld
def _has_total(state: CollectionState, player: int, total: int):
return (state.count('Map Width', player) + state.count('Map Height', player) +
state.count('Map Bombs', player)) >= total
items = ["Map Width", "Map Height", "Map Bombs"]
# Sets rules on entrances and advancements that are always applied
def set_rules(world: MultiWorld, player: int):
set_rule(world.get_location("Tile 6", player), lambda state: _has_total(state, player, 1))
set_rule(world.get_location("Tile 7", player), lambda state: _has_total(state, player, 2))
set_rule(world.get_location("Tile 8", player), lambda state: _has_total(state, player, 3))
set_rule(world.get_location("Tile 9", player), lambda state: _has_total(state, player, 4))
set_rule(world.get_location("Tile 10", player), lambda state: _has_total(state, player, 5))
set_rule(world.get_location("Tile 11", player), lambda state: _has_total(state, player, 6))
set_rule(world.get_location("Tile 12", player), lambda state: _has_total(state, player, 7))
set_rule(world.get_location("Tile 13", player), lambda state: _has_total(state, player, 8))
set_rule(world.get_location("Tile 14", player), lambda state: _has_total(state, player, 9))
set_rule(world.get_location("Tile 15", player), lambda state: _has_total(state, player, 10))
set_rule(world.get_location("Tile 16", player), lambda state: _has_total(state, player, 11))
set_rule(world.get_location("Tile 17", player), lambda state: _has_total(state, player, 12))
set_rule(world.get_location("Tile 18", player), lambda state: _has_total(state, player, 13))
set_rule(world.get_location("Tile 19", player), lambda state: _has_total(state, player, 14))
set_rule(world.get_location("Tile 20", player), lambda state: _has_total(state, player, 15))
set_rule(world.get_location("Tile 21", player), lambda state: _has_total(state, player, 16))
set_rule(world.get_location("Tile 22", player), lambda state: _has_total(state, player, 17))
set_rule(world.get_location("Tile 23", player), lambda state: _has_total(state, player, 18))
set_rule(world.get_location("Tile 24", player), lambda state: _has_total(state, player, 19))
set_rule(world.get_location("Tile 25", player), lambda state: _has_total(state, player, 20))
def set_rules(multiworld: MultiWorld, player: int):
for i in range(20):
set_rule(multiworld.get_location(f"Tile {i+6}", player), lambda state, i=i: state.has_from_list(items, player, i+1))
# Sets rules on completion condition
def set_completion_rules(world: MultiWorld, player: int):
width_req = 10-5
height_req = 10-5
bomb_req = 20-5
completion_requirements = lambda state: \
state.has("Map Width", player, width_req) and \
state.has("Map Height", player, height_req) and \
state.has("Map Bombs", player, bomb_req)
world.completion_condition[player] = lambda state: completion_requirements(state)
def set_completion_rules(multiworld: MultiWorld, player: int):
width_req = 5 # 10 - 5
height_req = 5 # 10 - 5
bomb_req = 15 # 20 - 5
multiworld.completion_condition[player] = lambda state: state.has_all_counts(
{
"Map Width": width_req,
"Map Height": height_req,
"Map Bombs": bomb_req,
}, player)

View File

@@ -1,9 +1,9 @@
from BaseClasses import Region, Entrance, Item, Tutorial, ItemClassification
from .Items import ChecksFinderItem, item_table, required_items
from .Locations import ChecksFinderAdvancement, advancement_table, exclusion_table
from .Options import checksfinder_options
from BaseClasses import Region, Entrance, Tutorial, ItemClassification
from .Items import ChecksFinderItem, item_table
from .Locations import ChecksFinderLocation, advancement_table
from Options import PerGameCommonOptions
from .Rules import set_rules, set_completion_rules
from ..AutoWorld import World, WebWorld
from worlds.AutoWorld import World, WebWorld
client_version = 7
@@ -25,38 +25,34 @@ class ChecksFinderWorld(World):
ChecksFinder is a game where you avoid mines and find checks inside the board
with the mines! You win when you get all your items and beat the board!
"""
game: str = "ChecksFinder"
option_definitions = checksfinder_options
topology_present = True
game = "ChecksFinder"
options_dataclass = PerGameCommonOptions
web = ChecksFinderWeb()
item_name_to_id = {name: data.code for name, data in item_table.items()}
location_name_to_id = {name: data.id for name, data in advancement_table.items()}
def _get_checksfinder_data(self):
return {
'world_seed': self.multiworld.per_slot_randoms[self.player].getrandbits(32),
'seed_name': self.multiworld.seed_name,
'player_name': self.multiworld.get_player_name(self.player),
'player_id': self.player,
'client_version': client_version,
'race': self.multiworld.is_race,
}
def create_regions(self):
menu = Region("Menu", self.player, self.multiworld)
board = Region("Board", self.player, self.multiworld)
board.locations += [ChecksFinderLocation(self.player, loc_name, loc_data.id, board)
for loc_name, loc_data in advancement_table.items()]
connection = Entrance(self.player, "New Board", menu)
menu.exits.append(connection)
connection.connect(board)
self.multiworld.regions += [menu, board]
def create_items(self):
# Generate item pool
itempool = []
# Add all required progression items
for (name, num) in required_items.items():
itempool += [name] * num
# Add the map width and height stuff
itempool += ["Map Width"] * (10-5)
itempool += ["Map Height"] * (10-5)
itempool += ["Map Width"] * 5 # 10 - 5
itempool += ["Map Height"] * 5 # 10 - 5
# Add the map bombs
itempool += ["Map Bombs"] * (20-5)
itempool += ["Map Bombs"] * 15 # 20 - 5
# Convert itempool into real items
itempool = [item for item in map(lambda name: self.create_item(name), itempool)]
itempool = [self.create_item(item) for item in itempool]
self.multiworld.itempool += itempool
@@ -64,28 +60,16 @@ class ChecksFinderWorld(World):
set_rules(self.multiworld, self.player)
set_completion_rules(self.multiworld, self.player)
def create_regions(self):
menu = Region("Menu", self.player, self.multiworld)
board = Region("Board", self.player, self.multiworld)
board.locations += [ChecksFinderAdvancement(self.player, loc_name, loc_data.id, board)
for loc_name, loc_data in advancement_table.items() if loc_data.region == board.name]
connection = Entrance(self.player, "New Board", menu)
menu.exits.append(connection)
connection.connect(board)
self.multiworld.regions += [menu, board]
def fill_slot_data(self):
slot_data = self._get_checksfinder_data()
for option_name in checksfinder_options:
option = getattr(self.multiworld, option_name)[self.player]
if slot_data.get(option_name, None) is None and type(option.value) in {str, int}:
slot_data[option_name] = int(option.value)
return slot_data
return {
"world_seed": self.random.getrandbits(32),
"seed_name": self.multiworld.seed_name,
"player_name": self.player_name,
"player_id": self.player,
"client_version": client_version,
"race": self.multiworld.is_race,
}
def create_item(self, name: str) -> Item:
def create_item(self, name: str) -> ChecksFinderItem:
item_data = item_table[name]
item = ChecksFinderItem(name,
ItemClassification.progression if item_data.progression else ItemClassification.filler,
item_data.code, self.player)
return item
return ChecksFinderItem(name, ItemClassification.progression, item_data.code, self.player)

View File

@@ -24,8 +24,3 @@ next to an icon, the number is how many you have gotten and the icon represents
Victory is achieved when the player wins a board they were given after they have received all of their Map Width, Map
Height, and Map Bomb items. The game will say at the bottom of the screen how many of each you have received.
## Unique Local Commands
The following command is only available when using the ChecksFinderClient to play with Archipelago.
- `/resync` Manually trigger a resync.

View File

@@ -4,7 +4,6 @@
- ChecksFinder from
the [Github releases Page for the game](https://github.com/jonloveslegos/ChecksFinder/releases) (latest version)
- Archipelago from the [Archipelago Releases Page](https://github.com/ArchipelagoMW/Archipelago/releases)
## Configuring your YAML file
@@ -17,28 +16,15 @@ guide: [Basic Multiworld Setup Guide](/tutorial/Archipelago/setup/en)
You can customize your options by visiting the [ChecksFinder Player Options Page](/games/ChecksFinder/player-options)
### Generating a ChecksFinder game
## Joining a MultiWorld Game
**ChecksFinder is meant to be played _alongside_ another game! You may not be playing it for long periods of time if
you play it by itself with another person!**
When you join a multiworld game, you will be asked to provide your YAML file to whoever is hosting. Once that is done,
the host will provide you with either a link to download your data file, or with a zip file containing everyone's data
files. You do not have a file inside that zip though!
You need to start ChecksFinder client yourself, it is located within the Archipelago folder.
### Connect to the MultiServer
First start ChecksFinder.
Once both ChecksFinder and the client are started. In the client at the top type in the spot labeled `Server` type the
`Ip Address` and `Port` separated with a `:` symbol.
The client will then ask for the username you chose, input that in the text box at the bottom of the client.
### Play the game
When the console tells you that you have joined the room, you're all set. Congratulations on successfully joining a
multiworld game!
1. Start ChecksFinder
2. Enter the following information:
- Enter the server url (starting from `wss://` for https connection like archipelago.gg, and starting from `ws://` for http connection and local multiserver)
- Enter server port
- Enter the name of the slot you wish to connect to
- Enter the room password (optional)
- Press `Play Online` to connect
3. Start playing!
Game options and controls are described in the readme on the github repository for the game

View File

@@ -1,5 +1,6 @@
from dataclasses import dataclass
from Options import OptionGroup, Choice, DefaultOnToggle, Range, Toggle, PerGameCommonOptions, StartInventoryPool
from Options import (OptionGroup, Choice, DefaultOnToggle, ItemsAccessibility, PerGameCommonOptions, Range, Toggle,
StartInventoryPool)
class CharacterStages(Choice):
@@ -521,6 +522,7 @@ class DeathLink(Choice):
@dataclass
class CV64Options(PerGameCommonOptions):
accessibility: ItemsAccessibility
start_inventory_from_pool: StartInventoryPool
character_stages: CharacterStages
stage_shuffle: StageShuffle

View File

@@ -660,11 +660,18 @@ commands.add_command("ap-get-technology", "Grant a technology, used by the Archi
end
local tech
local force = game.forces["player"]
if call.parameter == nil then
game.print("ap-get-technology is only to be used by the Archipelago Factorio Client")
return
end
chunks = split(call.parameter, "\t")
local item_name = chunks[1]
local index = chunks[2]
local source = chunks[3] or "Archipelago"
if index == -1 then -- for coop sync and restoring from an older savegame
if index == nil then
game.print("ap-get-technology is only to be used by the Archipelago Factorio Client")
return
elseif index == -1 then -- for coop sync and restoring from an older savegame
tech = force.technologies[item_name]
if tech.researched ~= true then
game.print({"", "Received [technology=" .. tech.name .. "] as it is already checked."})

View File

@@ -71,7 +71,7 @@ class FFMQClient(SNIClient):
received = await snes_read(ctx, RECEIVED_DATA[0], RECEIVED_DATA[1])
data = await snes_read(ctx, READ_DATA_START, READ_DATA_END - READ_DATA_START)
check_2 = await snes_read(ctx, 0xF53749, 1)
if check_1 != b'01' or check_2 != b'01':
if check_1 != b'\x01' or check_2 != b'\x01':
return
def get_range(data_range):

View File

@@ -216,7 +216,7 @@ def stage_set_rules(multiworld):
multiworld.worlds[player].options.accessibility == "minimal"]) * 3):
for player in no_enemies_players:
for location in vendor_locations:
if multiworld.worlds[player].options.accessibility == "locations":
if multiworld.worlds[player].options.accessibility == "full":
multiworld.get_location(location, player).progress_type = LocationProgressType.EXCLUDED
else:
multiworld.get_location(location, player).access_rule = lambda state: False

View File

@@ -25,14 +25,25 @@ from .Client import FFMQClient
class FFMQWebWorld(WebWorld):
tutorials = [Tutorial(
setup_en = Tutorial(
"Multiworld Setup Guide",
"A guide to playing Final Fantasy Mystic Quest with Archipelago.",
"English",
"setup_en.md",
"setup/en",
["Alchav"]
)]
)
setup_fr = Tutorial(
setup_en.tutorial_name,
setup_en.description,
"Français",
"setup_fr.md",
"setup/fr",
["Artea"]
)
tutorials = [setup_en, setup_fr]
class FFMQWorld(World):

View File

@@ -1,5 +1,8 @@
# Final Fantasy Mystic Quest
## Game page in other languages:
* [Français](/games/Final%20Fantasy%20Mystic%20Quest/info/fr)
## Where is the options page?
The [player options page for this game](../player-options) contains all the options you need to configure and export a

View File

@@ -0,0 +1,36 @@
# Final Fantasy Mystic Quest
## Page d'info dans d'autres langues :
* [English](/games/Final%20Fantasy%20Mystic%20Quest/info/en)
## Où se situe la page d'options?
La [page de configuration](../player-options) contient toutes les options nécessaires pour créer un fichier de configuration.
## Qu'est-ce qui est rendu aléatoire dans ce jeu?
Outre les objets mélangés, il y a plusieurs options pour aussi mélanger les villes et donjons, les pièces dans les donjons, les téléporteurs et les champs de bataille.
Il y a aussi plusieurs autres options afin d'ajuster la difficulté du jeu et la vitesse d'une partie.
## Quels objets et emplacements sont mélangés?
Les objets normalement reçus des coffres rouges, des PNJ et des champs de bataille sont mélangés. Vous pouvez aussi
inclure les objets des coffres bruns (qui contiennent normalement des consommables) dans les objets mélangés.
## Quels objets peuvent être dans les mondes des autres joueurs?
Tous les objets qui ont été déterminés mélangés dans les options peuvent être placés dans d'autres mondes.
## À quoi ressemblent les objets des autres joueurs dans Final Fantasy Mystic Quest?
Les emplacements qui étaient à l'origine des coffres (rouges ou bruns si ceux-ci sont inclus) apparaîtront comme des coffres.
Les coffres rouges seront des objets utiles ou de progression, alors que les coffres bruns seront des objets de remplissage.
Les pièges peuvent apparaître comme des coffres rouges ou bruns.
Lorsque vous ouvrirez un coffre contenant un objet d'un autre joueur, vous recevrez l'icône d'Archipelago et
la boîte de dialogue vous indiquera avoir reçu un "Archipelago Item".
## Lorsqu'un joueur reçoit un objet, qu'arrive-t-il?
Une boîte de dialogue apparaîtra pour vous montrer l'objet que vous avez reçu. Vous ne pourrez pas recevoir d'objet si vous êtes
en combat, dans la mappemonde ou dans les menus (à l'exception de lorsque vous fermez le menu).

View File

@@ -17,6 +17,12 @@ The Archipelago community cannot supply you with this.
## Installation Procedures
### Linux Setup
1. Download and install [Archipelago](<https://github.com/ArchipelagoMW/Archipelago/releases/latest>). **The installer
file is located in the assets section at the bottom of the version information. You'll likely be looking for the `.AppImage`.**
2. It is recommended to use either RetroArch or BizHawk if you run on linux, as snes9x-rr isn't compatible.
### Windows Setup
1. Download and install [Archipelago](<https://github.com/ArchipelagoMW/Archipelago/releases/latest>). **The installer
@@ -75,8 +81,7 @@ Manually launch the SNI Client, and run the patched ROM in your chosen software
#### With an emulator
When the client launched automatically, SNI should have also automatically launched in the background. If this is its
first time launching, you may be prompted to allow it to communicate through the Windows Firewall.
If this is the first time SNI launches, you may be prompted to allow it to communicate through the Windows Firewall.
##### snes9x-rr
@@ -133,10 +138,10 @@ page: [usb2snes Supported Platforms Page](http://usb2snes.com/#supported-platfor
### Connect to the Archipelago Server
The patch file which launched your client should have automatically connected you to the AP Server. There are a few
reasons this may not happen however, including if the game is hosted on the website but was generated elsewhere. If the
client window shows "Server Status: Not Connected", simply ask the host for the address of the server, and copy/paste it
into the "Server" input field then press enter.
SNI serves as the interface between your emulator and the server. Since you launched it manually, you need to tell it what server to connect to.
If the server is hosted on Archipelago.gg, get the port the server hosts your game on at the top of the game room (last line before the worlds are listed).
In the SNI client, either type `/connect address` (where `address` is the address of the server, for example `/connect archipelago.gg:12345`), or type the address and port on the "Server" input field, then press `Connect`.
If the server is hosted locally, simply ask the host for the address of the server, and copy/paste it into the "Server" input field then press `Connect`.
The client will attempt to reconnect to the new server address, and should momentarily show "Server Status: Connected".

View File

@@ -0,0 +1,178 @@
# Final Fantasy Mystic Quest Setup Guide
## Logiciels requis
- [Archipelago](https://github.com/ArchipelagoMW/Archipelago/releases)
- Une solution logicielle ou matérielle capable de charger et de lancer des fichiers ROM de SNES
- Un émulateur capable d'éxécuter des scripts Lua
- snes9x-rr de: [snes9x rr](https://github.com/gocha/snes9x-rr/releases),
- BizHawk from: [BizHawk Website](http://tasvideos.org/BizHawk.html),
- RetroArch 1.10.1 or newer from: [RetroArch Website](https://retroarch.com?page=platforms). Ou,
- Un SD2SNES, [FXPak Pro](https://krikzz.com/store/home/54-fxpak-pro.html), ou une autre solution matérielle
compatible
- Le fichier ROM de la v1.0 ou v1.1 NA de Final Fantasy Mystic Quest obtenu légalement, sûrement nommé `Final Fantasy - Mystic Quest (U) (V1.0).sfc` ou `Final Fantasy - Mystic Quest (U) (V1.1).sfc`
La communauté d'Archipelago ne peut vous fournir avec ce fichier.
## Procédure d'installation
### Installation sur Linux
1. Téléchargez et installez [Archipelago](<https://github.com/ArchipelagoMW/Archipelago/releases/latest>).
** Le fichier d'installation est situé dans la section "assets" dans le bas de la fenêtre d'information de la version. Vous voulez probablement le `.AppImage`**
2. L'utilisation de RetroArch ou BizHawk est recommandé pour les utilisateurs linux, puisque snes9x-rr n'est pas compatible.
### Installation sur Windows
1. Téléchargez et installez [Archipelago](<https://github.com/ArchipelagoMW/Archipelago/releases/latest>).
** Le fichier d'installation est situé dans la section "assets" dans le bas de la fenêtre d'information de la version.**
2. Si vous utilisez un émulateur, il est recommandé d'assigner votre émulateur capable d'éxécuter des scripts Lua comme
programme par défaut pour ouvrir vos ROMs.
1. Extrayez votre dossier d'émulateur sur votre Bureau, ou à un endroit dont vous vous souviendrez.
2. Faites un clic droit sur un fichier ROM et sélectionnez **Ouvrir avec...**
3. Cochez la case à côté de **Toujours utiliser cette application pour ouvrir les fichiers `.sfc`**
4. Descendez jusqu'en bas de la liste et sélectionnez **Rechercher une autre application sur ce PC**
5. Naviguez dans les dossiers jusqu'au fichier `.exe` de votre émulateur et choisissez **Ouvrir**. Ce fichier
devrait se trouver dans le dossier que vous avez extrait à la première étape.
## Créer son fichier de configuration (.yaml)
### Qu'est-ce qu'un fichier de configuration et pourquoi en ai-je besoin ?
Votre fichier de configuration contient un ensemble d'options de configuration pour indiquer au générateur
comment il devrait générer votre seed. Chaque joueur d'un multiworld devra fournir son propre fichier de configuration. Cela permet
à chaque joueur d'apprécier une expérience personalisée. Les différents joueurs d'un même multiworld
pouront avoir des options de génération différentes.
Vous pouvez lire le [guide pour créer un YAML de base](/tutorial/Archipelago/setup/en) en anglais.
### Où est-ce que j'obtiens un fichier de configuration ?
La [page d'options sur le site](/games/Final%20Fantasy%20Mystic%20Quest/player-options) vous permet de choisir vos
options de génération et de les exporter vers un fichier de configuration.
Il vous est aussi possible de trouver le fichier de configuration modèle de Mystic Quest dans votre répertoire d'installation d'Archipelago,
dans le dossier Players/Templates.
### Vérifier son fichier de configuration
Si vous voulez valider votre fichier de configuration pour être sûr qu'il fonctionne, vous pouvez le vérifier sur la page du
[Validateur de YAML](/mysterycheck).
## Générer une partie pour un joueur
1. Aller sur la page [Génération de partie](/games/Final%20Fantasy%20Mystic%20Quest/player-options), configurez vos options,
et cliquez sur le bouton "Generate Game".
2. Il vous sera alors présenté une page d'informations sur la seed
3. Cliquez sur le lien "Create New Room".
4. Vous verrez s'afficher la page du server, de laquelle vous pourrez télécharger votre fichier patch `.apmq`.
5. Rendez-vous sur le [site FFMQR](https://ffmqrando.net/Archipelago).
Sur cette page, sélectionnez votre ROM Final Fantasy Mystic Quest original dans le boîte "ROM", puis votre ficher patch `.apmq` dans la boîte "Load Archipelago Config File".
Cliquez sur "Generate". Un téléchargement avec votre ROM aléatoire devrait s'amorcer.
6. Puisque cette partie est à un seul joueur, vous n'avez plus besoin du client Archipelago ni du serveur, sentez-vous libre de les fermer.
## Rejoindre un MultiWorld
### Obtenir son patch et créer sa ROM
Quand vous rejoignez un multiworld, il vous sera demandé de fournir votre fichier de configuration à celui qui héberge la partie ou
s'occupe de la génération. Une fois cela fait, l'hôte vous fournira soit un lien pour télécharger votre patch, soit un
fichier `.zip` contenant les patchs de tous les joueurs. Votre patch devrait avoir l'extension `.apmq`.
Allez au [site FFMQR](https://ffmqrando.net/Archipelago) et sélectionnez votre ROM Final Fantasy Mystic Quest original dans le boîte "ROM", puis votre ficher patch `.apmq` dans la boîte "Load Archipelago Config File".
Cliquez sur "Generate". Un téléchargement avec votre ROM aléatoire devrait s'amorcer.
Ouvrez le client SNI (sur Windows ArchipelagoSNIClient.exe, sur Linux ouvrez le `.appImage` puis cliquez sur SNI Client), puis ouvrez le ROM téléchargé avec votre émulateur choisi.
### Se connecter au client
#### Avec un émulateur
Quand le client se lance automatiquement, QUsb2Snes devrait également se lancer automatiquement en arrière-plan. Si
c'est la première fois qu'il démarre, il vous sera peut-être demandé de l'autoriser à communiquer à travers le pare-feu
Windows.
##### snes9x-rr
1. Chargez votre ROM si ce n'est pas déjà fait.
2. Cliquez sur le menu "File" et survolez l'option **Lua Scripting**
3. Cliquez alors sur **New Lua Script Window...**
4. Dans la nouvelle fenêtre, sélectionnez **Browse...**
5. Sélectionnez le fichier connecteur lua fourni avec votre client
- Regardez dans le dossier Archipelago et cherchez `/SNI/lua/x64` ou `/SNI/lua/x86`, dépendemment de si votre emulateur
est 64-bit ou 32-bit.
6. Si vous obtenez une erreur `socket.dll missing` ou une erreur similaire lorsque vous chargez le script lua, vous devez naviguer dans le dossier
contenant le script lua, puis copier le fichier `socket.dll` dans le dossier d'installation de votre emulateur snes9x.
##### BizHawk
1. Assurez vous d'avoir le coeur BSNES chargé. Cela est possible en cliquant sur le menu "Tools" de BizHawk et suivant
ces options de menu :
`Config --> Cores --> SNES --> BSNES`
Une fois le coeur changé, vous devez redémarrer BizHawk.
2. Chargez votre ROM si ce n'est pas déjà fait.
3. Cliquez sur le menu "Tools" et cliquez sur **Lua Console**
4. Cliquez sur le bouton pour ouvrir un nouveau script Lua, soit par le bouton avec un icône "Ouvrir un dossier",
en cliquant `Open Script...` dans le menu Script ou en appuyant sur `ctrl-O`.
5. Sélectionnez le fichier `Connector.lua` inclus avec le client
- Regardez dans le dossier Archipelago et cherchez `/SNI/lua/x64` ou `/SNI/lua/x86`, dépendemment de si votre emulateur
est 64-bit ou 32-bit. Notez que les versions les plus récentes de BizHawk ne sont que 64-bit.
##### RetroArch 1.10.1 ou plus récent
Vous ne devez faire ces étapes qu'une fois. À noter que RetroArch 1.9.x ne fonctionnera pas puisqu'il s'agit d'une version moins récente que 1.10.1.
1. Entrez dans le menu principal de RetroArch.
2. Allez dans Settings --> User Interface. Activez l'option "Show Advanced Settings".
3. Allez dans Settings --> Network. Activez l'option "Network Commands", qui se trouve sous "Request Device 16".
Laissez le "Network Command Port" à sa valeur par defaut, qui devrait être 55355.
![Capture d'écran du menu Network Commands setting](/static/generated/docs/A%20Link%20to%20the%20Past/retroarch-network-commands-en.png)
4. Allez dans le Menu Principal --> Online Updater --> Core Downloader. Trouvez et sélectionnez "Nintendo - SNES / SFC (bsnes-mercury
Performance)".
Lorsque vous chargez un ROM pour Archipelago, assurez vous de toujours sélectionner le coeur **bsnes-mercury**.
Ce sont les seuls coeurs qui permettent à des outils extérieurs de lire les données du ROM.
#### Avec une solution matérielle
Ce guide suppose que vous avez téléchargé le bon micro-logiciel pour votre appareil. Si ce n'est pas déjà le cas, faites
le maintenant. Les utilisateurs de SD2SNES et de FXPak Pro peuvent télécharger le micro-logiciel approprié
[ici](https://github.com/RedGuyyyy/sd2snes/releases). Pour les autres solutions, de l'aide peut être trouvée
[sur cette page](http://usb2snes.com/#supported-platforms).
1. Fermez votre émulateur, qui s'est potentiellement lancé automatiquement.
2. Ouvrez votre appareil et chargez le ROM.
### Se connecter au MultiServer
Puisque vous avez lancé SNI manuellement, vous devrez probablement lui indiquer l'adresse à laquelle il doit se connecter.
Si le serveur est hébergé sur le site d'Archipelago, vous verrez l'adresse à laquelle vous connecter dans le haut de la page, dernière ligne avant la liste des mondes.
Tapez `/connect adresse` (ou le "adresse" est remplacé par l'adresse archipelago, par exemple `/connect archipelago.gg:12345`) dans la boîte de commande au bas de votre client SNI, ou encore écrivez l'adresse dans la boîte "server" dans le haut du client, puis cliquez `Connect`.
Si le serveur n'est pas hébergé sur le site d'Archipelago, demandez à l'hôte l'adresse du serveur, puis tapez `/connect adresse` (ou "adresse" est remplacé par l'adresse fourni par l'hôte) ou copiez/collez cette adresse dans le champ "Server" puis appuyez sur "Connect".
Le client essaiera de vous reconnecter à la nouvelle adresse du serveur, et devrait mentionner "Server Status:
Connected". Si le client ne se connecte pas après quelques instants, il faudra peut-être rafraîchir la page de
l'interface Web.
### Jouer au jeu
Une fois que l'interface Web affiche que la SNES et le serveur sont connectés, vous êtes prêt à jouer. Félicitations
pour avoir rejoint un multiworld !
## Héberger un MultiWorld
La méthode recommandée pour héberger une partie est d'utiliser le service d'hébergement fourni par
Archipelago. Le processus est relativement simple :
1. Récupérez les fichiers de configuration (.yaml) des joueurs.
2. Créez une archive zip contenant ces fichiers de configuration.
3. Téléversez l'archive zip sur le lien ci-dessous.
- Generate page: [WebHost Seed Generation Page](/generate)
4. Attendez un moment que la seed soit générée.
5. Lorsque la seed est générée, vous serez redirigé vers une page d'informations "Seed Info".
6. Cliquez sur "Create New Room". Cela vous amènera à la page du serveur. Fournissez le lien de cette page aux autres
joueurs afin qu'ils puissent récupérer leurs patchs.
7. Remarquez qu'un lien vers le traqueur du MultiWorld est en haut de la page de la salle. Vous devriez également
fournir ce lien aux joueurs pour qu'ils puissent suivre la progression de la partie. N'importe quelle personne voulant
observer devrait avoir accès à ce lien.
8. Une fois que tous les joueurs ont rejoint, vous pouvez commencer à jouer.

View File

@@ -102,10 +102,10 @@ See the plando guide for more info on plando options. Plando
guide: [Archipelago Plando Guide](/tutorial/Archipelago/plando/en)
* `accessibility` determines the level of access to the game the generation will expect you to have in order to reach
your completion goal. This supports `items`, `locations`, and `minimal` and is set to `locations` by default.
* `locations` will guarantee all locations are accessible in your world.
your completion goal. This supports `full`, `items`, and `minimal` and is set to `full` by default.
* `full` will guarantee all locations are accessible in your world.
* `items` will guarantee you can acquire all logically relevant items in your world. Some items, such as keys, may
be self-locking.
be self-locking. This value only exists in and affects some worlds.
* `minimal` will only guarantee that the seed is beatable. You will be guaranteed able to finish the seed logically
but may not be able to access all locations or acquire all items. A good example of this is having a big key in
the big chest in a dungeon in ALTTP making it impossible to get and finish the dungeon.

View File

@@ -1,10 +1,12 @@
import typing
import re
from dataclasses import dataclass, make_dataclass
from .ExtractedData import logic_options, starts, pool_options
from .Rules import cost_terms
from schema import And, Schema, Optional
from Options import Option, DefaultOnToggle, Toggle, Choice, Range, OptionDict, NamedRange, DeathLink
from Options import Option, DefaultOnToggle, Toggle, Choice, Range, OptionDict, NamedRange, DeathLink, PerGameCommonOptions
from .Charms import vanilla_costs, names as charm_names
if typing.TYPE_CHECKING:
@@ -538,3 +540,5 @@ hollow_knight_options: typing.Dict[str, type(Option)] = {
},
**cost_sanity_weights
}
HKOptions = make_dataclass("HKOptions", [(name, option) for name, option in hollow_knight_options.items()], bases=(PerGameCommonOptions,))

View File

@@ -49,3 +49,42 @@ def set_rules(hk_world: World):
if term == "GEO": # No geo logic!
continue
add_rule(location, lambda state, term=term, amount=amount: state.count(term, player) >= amount)
def _hk_nail_combat(state, player) -> bool:
return state.has_any({'LEFTSLASH', 'RIGHTSLASH', 'UPSLASH'}, player)
def _hk_can_beat_thk(state, player) -> bool:
return (
state.has('Opened_Black_Egg_Temple', player)
and (state.count('FIREBALL', player) + state.count('SCREAM', player) + state.count('QUAKE', player)) > 1
and _hk_nail_combat(state, player)
and (
state.has_any({'LEFTDASH', 'RIGHTDASH'}, player)
or state._hk_option(player, 'ProficientCombat')
)
and state.has('FOCUS', player)
)
def _hk_siblings_ending(state, player) -> bool:
return _hk_can_beat_thk(state, player) and state.has('WHITEFRAGMENT', player, 3)
def _hk_can_beat_radiance(state, player) -> bool:
return (
state.has('Opened_Black_Egg_Temple', player)
and _hk_nail_combat(state, player)
and state.has('WHITEFRAGMENT', player, 3)
and state.has('DREAMNAIL', player)
and (
(state.has('LEFTCLAW', player) and state.has('RIGHTCLAW', player))
or state.has('WINGS', player)
)
and (state.count('FIREBALL', player) + state.count('SCREAM', player) + state.count('QUAKE', player)) > 1
and (
(state.has('LEFTDASH', player, 2) and state.has('RIGHTDASH', player, 2)) # Both Shade Cloaks
or (state._hk_option(player, 'ProficientCombat') and state.has('QUAKE', player)) # or Dive
)
)

View File

@@ -10,9 +10,9 @@ logger = logging.getLogger("Hollow Knight")
from .Items import item_table, lookup_type_to_names, item_name_groups
from .Regions import create_regions
from .Rules import set_rules, cost_terms
from .Rules import set_rules, cost_terms, _hk_can_beat_thk, _hk_siblings_ending, _hk_can_beat_radiance
from .Options import hollow_knight_options, hollow_knight_randomize_options, Goal, WhitePalace, CostSanity, \
shop_to_option
shop_to_option, HKOptions
from .ExtractedData import locations, starts, multi_locations, location_to_region_lookup, \
event_names, item_effects, connectors, one_ways, vanilla_shop_costs, vanilla_location_costs
from .Charms import names as charm_names
@@ -142,7 +142,8 @@ class HKWorld(World):
As the enigmatic Knight, youll traverse the depths, unravel its mysteries and conquer its evils.
""" # from https://www.hollowknight.com
game: str = "Hollow Knight"
option_definitions = hollow_knight_options
options_dataclass = HKOptions
options: HKOptions
web = HKWeb()
@@ -155,8 +156,8 @@ class HKWorld(World):
charm_costs: typing.List[int]
cached_filler_items = {}
def __init__(self, world, player):
super(HKWorld, self).__init__(world, player)
def __init__(self, multiworld, player):
super(HKWorld, self).__init__(multiworld, player)
self.created_multi_locations: typing.Dict[str, typing.List[HKLocation]] = {
location: list() for location in multi_locations
}
@@ -165,29 +166,29 @@ class HKWorld(World):
self.vanilla_shop_costs = deepcopy(vanilla_shop_costs)
def generate_early(self):
world = self.multiworld
charm_costs = world.RandomCharmCosts[self.player].get_costs(world.random)
self.charm_costs = world.PlandoCharmCosts[self.player].get_costs(charm_costs)
# world.exclude_locations[self.player].value.update(white_palace_locations)
options = self.options
charm_costs = options.RandomCharmCosts.get_costs(self.random)
self.charm_costs = options.PlandoCharmCosts.get_costs(charm_costs)
# options.exclude_locations.value.update(white_palace_locations)
for term, data in cost_terms.items():
mini = getattr(world, f"Minimum{data.option}Price")[self.player]
maxi = getattr(world, f"Maximum{data.option}Price")[self.player]
mini = getattr(options, f"Minimum{data.option}Price")
maxi = getattr(options, f"Maximum{data.option}Price")
# if minimum > maximum, set minimum to maximum
mini.value = min(mini.value, maxi.value)
self.ranges[term] = mini.value, maxi.value
world.push_precollected(HKItem(starts[world.StartLocation[self.player].current_key],
self.multiworld.push_precollected(HKItem(starts[options.StartLocation.current_key],
True, None, "Event", self.player))
def white_palace_exclusions(self):
exclusions = set()
wp = self.multiworld.WhitePalace[self.player]
wp = self.options.WhitePalace
if wp <= WhitePalace.option_nopathofpain:
exclusions.update(path_of_pain_locations)
if wp <= WhitePalace.option_kingfragment:
exclusions.update(white_palace_checks)
if wp == WhitePalace.option_exclude:
exclusions.add("King_Fragment")
if self.multiworld.RandomizeCharms[self.player]:
if self.options.RandomizeCharms:
# If charms are randomized, this will be junk-filled -- so transitions and events are not progression
exclusions.update(white_palace_transitions)
exclusions.update(white_palace_events)
@@ -200,7 +201,7 @@ class HKWorld(World):
# check for any goal that godhome events are relevant to
all_event_names = event_names.copy()
if self.multiworld.Goal[self.player] in [Goal.option_godhome, Goal.option_godhome_flower]:
if self.options.Goal in [Goal.option_godhome, Goal.option_godhome_flower]:
from .GodhomeData import godhome_event_names
all_event_names.update(set(godhome_event_names))
@@ -230,12 +231,12 @@ class HKWorld(World):
pool: typing.List[HKItem] = []
wp_exclusions = self.white_palace_exclusions()
junk_replace: typing.Set[str] = set()
if self.multiworld.RemoveSpellUpgrades[self.player]:
if self.options.RemoveSpellUpgrades:
junk_replace.update(("Abyss_Shriek", "Shade_Soul", "Descending_Dark"))
randomized_starting_items = set()
for attr, items in randomizable_starting_items.items():
if getattr(self.multiworld, attr)[self.player]:
if getattr(self.options, attr):
randomized_starting_items.update(items)
# noinspection PyShadowingNames
@@ -257,7 +258,7 @@ class HKWorld(World):
if item_name in junk_replace:
item_name = self.get_filler_item_name()
item = self.create_item(item_name) if not vanilla or location_name == "Start" or self.multiworld.AddUnshuffledLocations[self.player] else self.create_event(item_name)
item = self.create_item(item_name) if not vanilla or location_name == "Start" or self.options.AddUnshuffledLocations else self.create_event(item_name)
if location_name == "Start":
if item_name in randomized_starting_items:
@@ -281,55 +282,55 @@ class HKWorld(World):
location.progress_type = LocationProgressType.EXCLUDED
for option_key, option in hollow_knight_randomize_options.items():
randomized = getattr(self.multiworld, option_key)[self.player]
if all([not randomized, option_key in logicless_options, not self.multiworld.AddUnshuffledLocations[self.player]]):
randomized = getattr(self.options, option_key)
if all([not randomized, option_key in logicless_options, not self.options.AddUnshuffledLocations]):
continue
for item_name, location_name in zip(option.items, option.locations):
if item_name in junk_replace:
item_name = self.get_filler_item_name()
if (item_name == "Crystal_Heart" and self.multiworld.SplitCrystalHeart[self.player]) or \
(item_name == "Mothwing_Cloak" and self.multiworld.SplitMothwingCloak[self.player]):
if (item_name == "Crystal_Heart" and self.options.SplitCrystalHeart) or \
(item_name == "Mothwing_Cloak" and self.options.SplitMothwingCloak):
_add("Left_" + item_name, location_name, randomized)
_add("Right_" + item_name, "Split_" + location_name, randomized)
continue
if item_name == "Mantis_Claw" and self.multiworld.SplitMantisClaw[self.player]:
if item_name == "Mantis_Claw" and self.options.SplitMantisClaw:
_add("Left_" + item_name, "Left_" + location_name, randomized)
_add("Right_" + item_name, "Right_" + location_name, randomized)
continue
if item_name == "Shade_Cloak" and self.multiworld.SplitMothwingCloak[self.player]:
if self.multiworld.random.randint(0, 1):
if item_name == "Shade_Cloak" and self.options.SplitMothwingCloak:
if self.random.randint(0, 1):
item_name = "Left_Mothwing_Cloak"
else:
item_name = "Right_Mothwing_Cloak"
if item_name == "Grimmchild2" and self.multiworld.RandomizeGrimmkinFlames[self.player] and self.multiworld.RandomizeCharms[self.player]:
if item_name == "Grimmchild2" and self.options.RandomizeGrimmkinFlames and self.options.RandomizeCharms:
_add("Grimmchild1", location_name, randomized)
continue
_add(item_name, location_name, randomized)
if self.multiworld.RandomizeElevatorPass[self.player]:
if self.options.RandomizeElevatorPass:
randomized = True
_add("Elevator_Pass", "Elevator_Pass", randomized)
for shop, locations in self.created_multi_locations.items():
for _ in range(len(locations), getattr(self.multiworld, shop_to_option[shop])[self.player].value):
for _ in range(len(locations), getattr(self.options, shop_to_option[shop]).value):
loc = self.create_location(shop)
unfilled_locations += 1
# Balance the pool
item_count = len(pool)
additional_shop_items = max(item_count - unfilled_locations, self.multiworld.ExtraShopSlots[self.player].value)
additional_shop_items = max(item_count - unfilled_locations, self.options.ExtraShopSlots.value)
# Add additional shop items, as needed.
if additional_shop_items > 0:
shops = list(shop for shop, locations in self.created_multi_locations.items() if len(locations) < 16)
if not self.multiworld.EggShopSlots[self.player].value: # No eggshop, so don't place items there
if not self.options.EggShopSlots: # No eggshop, so don't place items there
shops.remove('Egg_Shop')
if shops:
for _ in range(additional_shop_items):
shop = self.multiworld.random.choice(shops)
shop = self.random.choice(shops)
loc = self.create_location(shop)
unfilled_locations += 1
if len(self.created_multi_locations[shop]) >= 16:
@@ -355,7 +356,7 @@ class HKWorld(World):
loc.costs = costs
def apply_costsanity(self):
setting = self.multiworld.CostSanity[self.player].value
setting = self.options.CostSanity.value
if not setting:
return # noop
@@ -369,10 +370,10 @@ class HKWorld(World):
return {k: v for k, v in weights.items() if v}
random = self.multiworld.random
hybrid_chance = getattr(self.multiworld, f"CostSanityHybridChance")[self.player].value
random = self.random
hybrid_chance = getattr(self.options, f"CostSanityHybridChance").value
weights = {
data.term: getattr(self.multiworld, f"CostSanity{data.option}Weight")[self.player].value
data.term: getattr(self.options, f"CostSanity{data.option}Weight").value
for data in cost_terms.values()
}
weights_geoless = dict(weights)
@@ -427,22 +428,22 @@ class HKWorld(World):
location.sort_costs()
def set_rules(self):
world = self.multiworld
multiworld = self.multiworld
player = self.player
goal = world.Goal[player]
goal = self.options.Goal
if goal == Goal.option_hollowknight:
world.completion_condition[player] = lambda state: state._hk_can_beat_thk(player)
multiworld.completion_condition[player] = lambda state: _hk_can_beat_thk(state, player)
elif goal == Goal.option_siblings:
world.completion_condition[player] = lambda state: state._hk_siblings_ending(player)
multiworld.completion_condition[player] = lambda state: _hk_siblings_ending(state, player)
elif goal == Goal.option_radiance:
world.completion_condition[player] = lambda state: state._hk_can_beat_radiance(player)
multiworld.completion_condition[player] = lambda state: _hk_can_beat_radiance(state, player)
elif goal == Goal.option_godhome:
world.completion_condition[player] = lambda state: state.count("Defeated_Pantheon_5", player)
multiworld.completion_condition[player] = lambda state: state.count("Defeated_Pantheon_5", player)
elif goal == Goal.option_godhome_flower:
world.completion_condition[player] = lambda state: state.count("Godhome_Flower_Quest", player)
multiworld.completion_condition[player] = lambda state: state.count("Godhome_Flower_Quest", player)
else:
# Any goal
world.completion_condition[player] = lambda state: state._hk_can_beat_thk(player) or state._hk_can_beat_radiance(player)
multiworld.completion_condition[player] = lambda state: _hk_can_beat_thk(state, player) or _hk_can_beat_radiance(state, player)
set_rules(self)
@@ -450,8 +451,8 @@ class HKWorld(World):
slot_data = {}
options = slot_data["options"] = {}
for option_name in self.option_definitions:
option = getattr(self.multiworld, option_name)[self.player]
for option_name in hollow_knight_options:
option = getattr(self.options, option_name)
try:
optionvalue = int(option.value)
except TypeError:
@@ -460,10 +461,10 @@ class HKWorld(World):
options[option_name] = optionvalue
# 32 bit int
slot_data["seed"] = self.multiworld.per_slot_randoms[self.player].randint(-2147483647, 2147483646)
slot_data["seed"] = self.random.randint(-2147483647, 2147483646)
# Backwards compatibility for shop cost data (HKAP < 0.1.0)
if not self.multiworld.CostSanity[self.player]:
if not self.options.CostSanity:
for shop, terms in shop_cost_types.items():
unit = cost_terms[next(iter(terms))].option
if unit == "Geo":
@@ -498,7 +499,7 @@ class HKWorld(World):
basename = name
if name in shop_cost_types:
costs = {
term: self.multiworld.random.randint(*self.ranges[term])
term: self.random.randint(*self.ranges[term])
for term in shop_cost_types[name]
}
elif name in vanilla_location_costs:
@@ -512,7 +513,7 @@ class HKWorld(World):
region = self.multiworld.get_region("Menu", self.player)
if vanilla and not self.multiworld.AddUnshuffledLocations[self.player]:
if vanilla and not self.options.AddUnshuffledLocations:
loc = HKLocation(self.player, name,
None, region, costs=costs, vanilla=vanilla,
basename=basename)
@@ -560,26 +561,26 @@ class HKWorld(World):
return change
@classmethod
def stage_write_spoiler(cls, world: MultiWorld, spoiler_handle):
hk_players = world.get_game_players(cls.game)
def stage_write_spoiler(cls, multiworld: MultiWorld, spoiler_handle):
hk_players = multiworld.get_game_players(cls.game)
spoiler_handle.write('\n\nCharm Notches:')
for player in hk_players:
name = world.get_player_name(player)
name = multiworld.get_player_name(player)
spoiler_handle.write(f'\n{name}\n')
hk_world: HKWorld = world.worlds[player]
hk_world: HKWorld = multiworld.worlds[player]
for charm_number, cost in enumerate(hk_world.charm_costs):
spoiler_handle.write(f"\n{charm_names[charm_number]}: {cost}")
spoiler_handle.write('\n\nShop Prices:')
for player in hk_players:
name = world.get_player_name(player)
name = multiworld.get_player_name(player)
spoiler_handle.write(f'\n{name}\n')
hk_world: HKWorld = world.worlds[player]
hk_world: HKWorld = multiworld.worlds[player]
if world.CostSanity[player].value:
if hk_world.options.CostSanity:
for loc in sorted(
(
loc for loc in itertools.chain(*(region.locations for region in world.get_regions(player)))
loc for loc in itertools.chain(*(region.locations for region in multiworld.get_regions(player)))
if loc.costs
), key=operator.attrgetter('name')
):
@@ -603,15 +604,15 @@ class HKWorld(World):
'RandomizeGeoRocks', 'RandomizeSoulTotems', 'RandomizeLoreTablets', 'RandomizeJunkPitChests',
'RandomizeRancidEggs'
):
if getattr(self.multiworld, group):
if getattr(self.options, group):
fillers.extend(item for item in hollow_knight_randomize_options[group].items if item not in
exclusions)
self.cached_filler_items[self.player] = fillers
return self.multiworld.random.choice(self.cached_filler_items[self.player])
return self.random.choice(self.cached_filler_items[self.player])
def create_region(world: MultiWorld, player: int, name: str, location_names=None) -> Region:
ret = Region(name, player, world)
def create_region(multiworld: MultiWorld, player: int, name: str, location_names=None) -> Region:
ret = Region(name, player, multiworld)
if location_names:
for location in location_names:
loc_id = HKWorld.location_name_to_id.get(location, None)
@@ -684,42 +685,7 @@ class HKLogicMixin(LogicMixin):
return sum(self.multiworld.worlds[player].charm_costs[notch] for notch in notches)
def _hk_option(self, player: int, option_name: str) -> int:
return getattr(self.multiworld, option_name)[player].value
return getattr(self.multiworld.worlds[player].options, option_name).value
def _hk_start(self, player, start_location: str) -> bool:
return self.multiworld.StartLocation[player] == start_location
def _hk_nail_combat(self, player: int) -> bool:
return self.has_any({'LEFTSLASH', 'RIGHTSLASH', 'UPSLASH'}, player)
def _hk_can_beat_thk(self, player: int) -> bool:
return (
self.has('Opened_Black_Egg_Temple', player)
and (self.count('FIREBALL', player) + self.count('SCREAM', player) + self.count('QUAKE', player)) > 1
and self._hk_nail_combat(player)
and (
self.has_any({'LEFTDASH', 'RIGHTDASH'}, player)
or self._hk_option(player, 'ProficientCombat')
)
and self.has('FOCUS', player)
)
def _hk_siblings_ending(self, player: int) -> bool:
return self._hk_can_beat_thk(player) and self.has('WHITEFRAGMENT', player, 3)
def _hk_can_beat_radiance(self, player: int) -> bool:
return (
self.has('Opened_Black_Egg_Temple', player)
and self._hk_nail_combat(player)
and self.has('WHITEFRAGMENT', player, 3)
and self.has('DREAMNAIL', player)
and (
(self.has('LEFTCLAW', player) and self.has('RIGHTCLAW', player))
or self.has('WINGS', player)
)
and (self.count('FIREBALL', player) + self.count('SCREAM', player) + self.count('QUAKE', player)) > 1
and (
(self.has('LEFTDASH', player, 2) and self.has('RIGHTDASH', player, 2)) # Both Shade Cloaks
or (self._hk_option(player, 'ProficientCombat') and self.has('QUAKE', player)) # or Dive
)
)
return self.multiworld.worlds[player].options.StartLocation == start_location

View File

@@ -1556,6 +1556,8 @@
room: Owl Hallway
door: Shortcut to Hedge Maze
Roof: True
The Incomparable:
door: Observant Entrance
panels:
DOWN:
id: Maze Room/Panel_down_up
@@ -1967,6 +1969,9 @@
door: Eight Door
Orange Tower Sixth Floor:
painting: True
Hedge Maze:
room: Hedge Maze
door: Observant Entrance
panels:
Achievement:
id: Countdown Panels/Panel_incomparable_incomparable
@@ -7649,6 +7654,8 @@
LEAP:
id: Double Room/Panel_leap_leap
tag: midwhite
required_door:
door: Door to Cross
doors:
Door to Cross:
id: Double Room Area Doors/Door_room_4a

Binary file not shown.

View File

@@ -3,15 +3,15 @@ from typing import Dict
from schema import And, Optional, Or, Schema
from Options import Accessibility, Choice, DeathLinkMixin, DefaultOnToggle, OptionDict, PerGameCommonOptions, \
from Options import Choice, DeathLinkMixin, DefaultOnToggle, ItemsAccessibility, OptionDict, PerGameCommonOptions, \
PlandoConnections, Range, StartInventoryPool, Toggle, Visibility
from .portals import CHECKPOINTS, PORTALS, SHOP_POINTS
class MessengerAccessibility(Accessibility):
default = Accessibility.option_locations
class MessengerAccessibility(ItemsAccessibility):
# defaulting to locations accessibility since items makes certain items self-locking
__doc__ = Accessibility.__doc__.replace(f"default {Accessibility.default}", f"default {default}")
default = ItemsAccessibility.option_full
__doc__ = ItemsAccessibility.__doc__
class PortalPlando(PlandoConnections):

View File

@@ -29,7 +29,7 @@ name: TuNombre
game: Minecraft
# Opciones compartidas por todos los juegos:
accessibility: locations
accessibility: full
progression_balancing: 50
# Opciones Especficicas para Minecraft

View File

@@ -79,7 +79,7 @@ description: Template Name
# Ditt spelnamn. Mellanslag kommer bli omplacerad med understräck och det är en 16-karaktärsgräns.
name: YourName
game: Minecraft
accessibility: locations
accessibility: full
progression_balancing: 0
advancement_goal:
few: 0

View File

@@ -443,7 +443,7 @@ class PokemonRedBlueWorld(World):
self.multiworld.elite_four_pokedex_condition[self.player].total = \
int((len(reachable_mons) / 100) * self.multiworld.elite_four_pokedex_condition[self.player].value)
if self.multiworld.accessibility[self.player] == "locations":
if self.multiworld.accessibility[self.player] == "full":
balls = [self.create_item(ball) for ball in ["Poke Ball", "Great Ball", "Ultra Ball"]]
traps = [self.create_item(trap) for trap in item_groups["Traps"]]
locations = [location for location in self.multiworld.get_locations(self.player) if "Pokedex - " in

View File

@@ -1,4 +1,4 @@
from Options import Toggle, Choice, Range, NamedRange, TextChoice, DeathLink
from Options import Toggle, Choice, Range, NamedRange, TextChoice, DeathLink, ItemsAccessibility
class GameVersion(Choice):
@@ -287,7 +287,7 @@ class AllPokemonSeen(Toggle):
class DexSanity(NamedRange):
"""Adds location checks for Pokemon flagged "owned" on your Pokedex. You may specify a percentage of Pokemon to
have checks added. If Accessibility is set to locations, this will be the percentage of all logically reachable
have checks added. If Accessibility is set to full, this will be the percentage of all logically reachable
Pokemon that will get a location check added to it. With items or minimal Accessibility, it will be the percentage
of all 151 Pokemon.
If Pokedex is required, the items for Pokemon acquired before acquiring the Pokedex can be found by talking to
@@ -418,10 +418,10 @@ class ExpModifier(NamedRange):
"""Modifier for EXP gained. When specifying a number, exp is multiplied by this amount and divided by 16."""
display_name = "Exp Modifier"
default = 16
range_start = default / 4
range_start = default // 4
range_end = 255
special_range_names = {
"half": default / 2,
"half": default // 2,
"normal": default,
"double": default * 2,
"triple": default * 3,
@@ -861,6 +861,7 @@ class RandomizePokemonPalettes(Choice):
pokemon_rb_options = {
"accessibility": ItemsAccessibility,
"game_version": GameVersion,
"trainer_name": TrainerName,
"rival_name": RivalName,
@@ -959,4 +960,4 @@ pokemon_rb_options = {
"ice_trap_weight": IceTrapWeight,
"randomize_pokemon_palettes": RandomizePokemonPalettes,
"death_link": DeathLink
}
}

View File

@@ -22,7 +22,7 @@ def set_rules(multiworld, player):
item_rules["Celadon Prize Corner - Item Prize 2"] = prize_rule
item_rules["Celadon Prize Corner - Item Prize 3"] = prize_rule
if multiworld.accessibility[player] != "locations":
if multiworld.accessibility[player] != "full":
multiworld.get_location("Cerulean Bicycle Shop", player).always_allow = (lambda state, item:
item.name == "Bike Voucher"
and item.player == player)

View File

@@ -1,2 +1 @@
nest-asyncio >= 1.5.5
six >= 1.16.0

View File

@@ -33,28 +33,38 @@ item_table = {
"Lightning Pot Top": ItemData(SHIVERS_ITEM_ID_OFFSET + 17, "pot"),
"Sand Pot Top": ItemData(SHIVERS_ITEM_ID_OFFSET + 18, "pot"),
"Metal Pot Top": ItemData(SHIVERS_ITEM_ID_OFFSET + 19, "pot"),
"Water Pot Complete": ItemData(SHIVERS_ITEM_ID_OFFSET + 20, "pot_type2"),
"Wax Pot Complete": ItemData(SHIVERS_ITEM_ID_OFFSET + 21, "pot_type2"),
"Ash Pot Complete": ItemData(SHIVERS_ITEM_ID_OFFSET + 22, "pot_type2"),
"Oil Pot Complete": ItemData(SHIVERS_ITEM_ID_OFFSET + 23, "pot_type2"),
"Cloth Pot Complete": ItemData(SHIVERS_ITEM_ID_OFFSET + 24, "pot_type2"),
"Wood Pot Complete": ItemData(SHIVERS_ITEM_ID_OFFSET + 25, "pot_type2"),
"Crystal Pot Complete": ItemData(SHIVERS_ITEM_ID_OFFSET + 26, "pot_type2"),
"Lightning Pot Complete": ItemData(SHIVERS_ITEM_ID_OFFSET + 27, "pot_type2"),
"Sand Pot Complete": ItemData(SHIVERS_ITEM_ID_OFFSET + 28, "pot_type2"),
"Metal Pot Complete": ItemData(SHIVERS_ITEM_ID_OFFSET + 29, "pot_type2"),
#Keys
"Key for Office Elevator": ItemData(SHIVERS_ITEM_ID_OFFSET + 20, "key"),
"Key for Bedroom Elevator": ItemData(SHIVERS_ITEM_ID_OFFSET + 21, "key"),
"Key for Three Floor Elevator": ItemData(SHIVERS_ITEM_ID_OFFSET + 22, "key"),
"Key for Workshop": ItemData(SHIVERS_ITEM_ID_OFFSET + 23, "key"),
"Key for Office": ItemData(SHIVERS_ITEM_ID_OFFSET + 24, "key"),
"Key for Prehistoric Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 25, "key"),
"Key for Greenhouse Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 26, "key"),
"Key for Ocean Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 27, "key"),
"Key for Projector Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 28, "key"),
"Key for Generator Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 29, "key"),
"Key for Egypt Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 30, "key"),
"Key for Library Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 31, "key"),
"Key for Shaman Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 32, "key"),
"Key for UFO Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 33, "key"),
"Key for Torture Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 34, "key"),
"Key for Puzzle Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 35, "key"),
"Key for Bedroom": ItemData(SHIVERS_ITEM_ID_OFFSET + 36, "key"),
"Key for Underground Lake Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 37, "key"),
"Key for Janitor Closet": ItemData(SHIVERS_ITEM_ID_OFFSET + 38, "key"),
"Key for Front Door": ItemData(SHIVERS_ITEM_ID_OFFSET + 39, "key-optional"),
"Key for Office Elevator": ItemData(SHIVERS_ITEM_ID_OFFSET + 30, "key"),
"Key for Bedroom Elevator": ItemData(SHIVERS_ITEM_ID_OFFSET + 31, "key"),
"Key for Three Floor Elevator": ItemData(SHIVERS_ITEM_ID_OFFSET + 32, "key"),
"Key for Workshop": ItemData(SHIVERS_ITEM_ID_OFFSET + 33, "key"),
"Key for Office": ItemData(SHIVERS_ITEM_ID_OFFSET + 34, "key"),
"Key for Prehistoric Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 35, "key"),
"Key for Greenhouse Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 36, "key"),
"Key for Ocean Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 37, "key"),
"Key for Projector Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 38, "key"),
"Key for Generator Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 39, "key"),
"Key for Egypt Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 40, "key"),
"Key for Library Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 41, "key"),
"Key for Shaman Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 42, "key"),
"Key for UFO Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 43, "key"),
"Key for Torture Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 44, "key"),
"Key for Puzzle Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 45, "key"),
"Key for Bedroom": ItemData(SHIVERS_ITEM_ID_OFFSET + 46, "key"),
"Key for Underground Lake Room": ItemData(SHIVERS_ITEM_ID_OFFSET + 47, "key"),
"Key for Janitor Closet": ItemData(SHIVERS_ITEM_ID_OFFSET + 48, "key"),
"Key for Front Door": ItemData(SHIVERS_ITEM_ID_OFFSET + 49, "key-optional"),
#Abilities
"Crawling": ItemData(SHIVERS_ITEM_ID_OFFSET + 50, "ability"),
@@ -83,6 +93,16 @@ item_table = {
"Lightning Pot Top DUPE": ItemData(SHIVERS_ITEM_ID_OFFSET + 87, "potduplicate"),
"Sand Pot Top DUPE": ItemData(SHIVERS_ITEM_ID_OFFSET + 88, "potduplicate"),
"Metal Pot Top DUPE": ItemData(SHIVERS_ITEM_ID_OFFSET + 89, "potduplicate"),
"Water Pot Complete DUPE": ItemData(SHIVERS_ITEM_ID_OFFSET + 140, "potduplicate_type2"),
"Wax Pot Complete DUPE": ItemData(SHIVERS_ITEM_ID_OFFSET + 141, "potduplicate_type2"),
"Ash Pot Complete DUPE": ItemData(SHIVERS_ITEM_ID_OFFSET + 142, "potduplicate_type2"),
"Oil Pot Complete DUPE": ItemData(SHIVERS_ITEM_ID_OFFSET + 143, "potduplicate_type2"),
"Cloth Pot Complete DUPE": ItemData(SHIVERS_ITEM_ID_OFFSET + 144, "potduplicate_type2"),
"Wood Pot Complete DUPE": ItemData(SHIVERS_ITEM_ID_OFFSET + 145, "potduplicate_type2"),
"Crystal Pot Complete DUPE": ItemData(SHIVERS_ITEM_ID_OFFSET + 146, "potduplicate_type2"),
"Lightning Pot Complete DUPE": ItemData(SHIVERS_ITEM_ID_OFFSET + 147, "potduplicate_type2"),
"Sand Pot Complete DUPE": ItemData(SHIVERS_ITEM_ID_OFFSET + 148, "potduplicate_type2"),
"Metal Pot Complete DUPE": ItemData(SHIVERS_ITEM_ID_OFFSET + 149, "potduplicate_type2"),
#Filler
"Empty": ItemData(SHIVERS_ITEM_ID_OFFSET + 90, "filler"),

View File

@@ -1,21 +1,37 @@
from Options import Choice, DefaultOnToggle, Toggle, PerGameCommonOptions
from Options import Choice, DefaultOnToggle, Toggle, PerGameCommonOptions, Range
from dataclasses import dataclass
class IxupiCapturesNeeded(Range):
"""
Number of Ixupi Captures needed for goal condition.
"""
display_name = "Number of Ixupi Captures Needed"
range_start = 1
range_end = 10
default = 10
class LobbyAccess(Choice):
"""Chooses how keys needed to reach the lobby are placed.
"""
Chooses how keys needed to reach the lobby are placed.
- Normal: Keys are placed anywhere
- Early: Keys are placed early
- Local: Keys are placed locally"""
- Local: Keys are placed locally
"""
display_name = "Lobby Access"
option_normal = 0
option_early = 1
option_local = 2
default = 1
class PuzzleHintsRequired(DefaultOnToggle):
"""If turned on puzzle hints will be available before the corresponding puzzle is required. For example: The Shaman
Drums puzzle will be placed after access to the security cameras which give you the solution. Turning this off
allows for greater randomization."""
"""
If turned on puzzle hints/solutions will be available before the corresponding puzzle is required.
For example: The Red Door puzzle will be logically required only after access to the Beth's Address Book which gives you the solution.
Turning this off allows for greater randomization.
"""
display_name = "Puzzle Hints Required"
class InformationPlaques(Toggle):
@@ -26,7 +42,9 @@ class InformationPlaques(Toggle):
display_name = "Include Information Plaques"
class FrontDoorUsable(Toggle):
"""Adds a key to unlock the front door of the museum."""
"""
Adds a key to unlock the front door of the museum.
"""
display_name = "Front Door Usable"
class ElevatorsStaySolved(DefaultOnToggle):
@@ -37,7 +55,9 @@ class ElevatorsStaySolved(DefaultOnToggle):
display_name = "Elevators Stay Solved"
class EarlyBeth(DefaultOnToggle):
"""Beth's body is open at the start of the game. This allows any pot piece to be placed in the slide and early checks on the second half of the final riddle."""
"""
Beth's body is open at the start of the game. This allows any pot piece to be placed in the slide and early checks on the second half of the final riddle.
"""
display_name = "Early Beth"
class EarlyLightning(Toggle):
@@ -47,9 +67,34 @@ class EarlyLightning(Toggle):
"""
display_name = "Early Lightning"
class LocationPotPieces(Choice):
"""
Chooses where pot pieces will be located within the multiworld.
- Own World: Pot pieces will be located within your own world
- Different World: Pot pieces will be located in another world
- Any World: Pot pieces will be located in any world
"""
display_name = "Location of Pot Pieces"
option_own_world = 0
option_different_world = 1
option_any_world = 2
class FullPots(Choice):
"""
Chooses if pots will be in pieces or already completed
- Pieces: Only pot pieces will be added to the item pool
- Complete: Only completed pots will be added to the item pool
- Mixed: Each pot will be randomly chosen to be pieces or already completed.
"""
display_name = "Full Pots"
option_pieces = 0
option_complete = 1
option_mixed = 2
@dataclass
class ShiversOptions(PerGameCommonOptions):
ixupi_captures_needed: IxupiCapturesNeeded
lobby_access: LobbyAccess
puzzle_hints_required: PuzzleHintsRequired
include_information_plaques: InformationPlaques
@@ -57,3 +102,5 @@ class ShiversOptions(PerGameCommonOptions):
elevators_stay_solved: ElevatorsStaySolved
early_beth: EarlyBeth
early_lightning: EarlyLightning
location_pot_pieces: LocationPotPieces
full_pots: FullPots

View File

@@ -8,58 +8,58 @@ if TYPE_CHECKING:
def water_capturable(state: CollectionState, player: int) -> bool:
return (state.can_reach("Lobby", "Region", player) or (state.can_reach("Janitor Closet", "Region", player) and cloth_capturable(state, player))) \
and state.has_all({"Water Pot Bottom", "Water Pot Top", "Water Pot Bottom DUPE", "Water Pot Top DUPE"}, player)
return state.has_all({"Water Pot Bottom", "Water Pot Top", "Water Pot Bottom DUPE", "Water Pot Top DUPE"}, player) or \
state.has_all({"Water Pot Complete", "Water Pot Complete DUPE"}, player)
def wax_capturable(state: CollectionState, player: int) -> bool:
return (state.can_reach("Library", "Region", player) or state.can_reach("Anansi", "Region", player)) \
and state.has_all({"Wax Pot Bottom", "Wax Pot Top", "Wax Pot Bottom DUPE", "Wax Pot Top DUPE"}, player)
return state.has_all({"Wax Pot Bottom", "Wax Pot Top", "Wax Pot Bottom DUPE", "Wax Pot Top DUPE"}, player) or \
state.has_all({"Wax Pot Complete", "Wax Pot Complete DUPE"}, player)
def ash_capturable(state: CollectionState, player: int) -> bool:
return (state.can_reach("Office", "Region", player) or state.can_reach("Burial", "Region", player)) \
and state.has_all({"Ash Pot Bottom", "Ash Pot Top", "Ash Pot Bottom DUPE", "Ash Pot Top DUPE"}, player)
return state.has_all({"Ash Pot Bottom", "Ash Pot Top", "Ash Pot Bottom DUPE", "Ash Pot Top DUPE"}, player) or \
state.has_all({"Ash Pot Complete", "Ash Pot Complete DUPE"}, player)
def oil_capturable(state: CollectionState, player: int) -> bool:
return (state.can_reach("Prehistoric", "Region", player) or state.can_reach("Tar River", "Region", player)) \
and state.has_all({"Oil Pot Bottom", "Oil Pot Top", "Oil Pot Bottom DUPE", "Oil Pot Top DUPE"}, player)
return state.has_all({"Oil Pot Bottom", "Oil Pot Top", "Oil Pot Bottom DUPE", "Oil Pot Top DUPE"}, player) or \
state.has_all({"Oil Pot Complete", "Oil Pot Complete DUPE"}, player)
def cloth_capturable(state: CollectionState, player: int) -> bool:
return (state.can_reach("Egypt", "Region", player) or state.can_reach("Burial", "Region", player) or state.can_reach("Janitor Closet", "Region", player)) \
and state.has_all({"Cloth Pot Bottom", "Cloth Pot Top", "Cloth Pot Bottom DUPE", "Cloth Pot Top DUPE"}, player)
return state.has_all({"Cloth Pot Bottom", "Cloth Pot Top", "Cloth Pot Bottom DUPE", "Cloth Pot Top DUPE"}, player) or \
state.has_all({"Cloth Pot Complete", "Cloth Pot Complete DUPE"}, player)
def wood_capturable(state: CollectionState, player: int) -> bool:
return (state.can_reach("Workshop", "Region", player) or state.can_reach("Blue Maze", "Region", player) or state.can_reach("Gods Room", "Region", player) or state.can_reach("Anansi", "Region", player)) \
and state.has_all({"Wood Pot Bottom", "Wood Pot Top", "Wood Pot Bottom DUPE", "Wood Pot Top DUPE"}, player)
return state.has_all({"Wood Pot Bottom", "Wood Pot Top", "Wood Pot Bottom DUPE", "Wood Pot Top DUPE"}, player) or \
state.has_all({"Wood Pot Complete", "Wood Pot Complete DUPE"}, player)
def crystal_capturable(state: CollectionState, player: int) -> bool:
return (state.can_reach("Lobby", "Region", player) or state.can_reach("Ocean", "Region", player)) \
and state.has_all({"Crystal Pot Bottom", "Crystal Pot Top", "Crystal Pot Bottom DUPE", "Crystal Pot Top DUPE"}, player)
return state.has_all({"Crystal Pot Bottom", "Crystal Pot Top", "Crystal Pot Bottom DUPE", "Crystal Pot Top DUPE"}, player) or \
state.has_all({"Crystal Pot Complete", "Crystal Pot Complete DUPE"}, player)
def sand_capturable(state: CollectionState, player: int) -> bool:
return (state.can_reach("Greenhouse", "Region", player) or state.can_reach("Ocean", "Region", player)) \
and state.has_all({"Sand Pot Bottom", "Sand Pot Top", "Sand Pot Bottom DUPE", "Sand Pot Top DUPE"}, player)
return state.has_all({"Sand Pot Bottom", "Sand Pot Top", "Sand Pot Bottom DUPE", "Sand Pot Top DUPE"}, player) or \
state.has_all({"Sand Pot Complete", "Sand Pot Complete DUPE"}, player)
def metal_capturable(state: CollectionState, player: int) -> bool:
return (state.can_reach("Projector Room", "Region", player) or state.can_reach("Prehistoric", "Region", player) or state.can_reach("Bedroom", "Region", player)) \
and state.has_all({"Metal Pot Bottom", "Metal Pot Top", "Metal Pot Bottom DUPE", "Metal Pot Top DUPE"}, player)
return state.has_all({"Metal Pot Bottom", "Metal Pot Top", "Metal Pot Bottom DUPE", "Metal Pot Top DUPE"}, player) or \
state.has_all({"Metal Pot Complete", "Metal Pot Complete DUPE"}, player)
def lightning_capturable(state: CollectionState, player: int) -> bool:
return (first_nine_ixupi_capturable or state.multiworld.early_lightning[player].value) \
and state.can_reach("Generator", "Region", player) \
and state.has_all({"Lightning Pot Bottom", "Lightning Pot Top", "Lightning Pot Bottom DUPE", "Lightning Pot Top DUPE"}, player)
return (first_nine_ixupi_capturable(state, player) or state.multiworld.worlds[player].options.early_lightning.value) \
and (state.has_all({"Lightning Pot Bottom", "Lightning Pot Top", "Lightning Pot Bottom DUPE", "Lightning Pot Top DUPE"}, player) or \
state.has_all({"Lightning Pot Complete", "Lightning Pot Complete DUPE"}, player))
def beths_body_available(state: CollectionState, player: int) -> bool:
return (first_nine_ixupi_capturable(state, player) or state.multiworld.early_beth[player].value) \
return (first_nine_ixupi_capturable(state, player) or state.multiworld.worlds[player].options.early_beth.value) \
and state.can_reach("Generator", "Region", player)
@@ -123,7 +123,8 @@ def get_rules_lookup(player: int):
"To Burial From Egypt": lambda state: state.can_reach("Egypt", "Region", player),
"To Gods Room From Anansi": lambda state: state.can_reach("Gods Room", "Region", player),
"To Slide Room": lambda state: all_skull_dials_available(state, player),
"To Lobby From Slide Room": lambda state: (beths_body_available(state, player))
"To Lobby From Slide Room": lambda state: beths_body_available(state, player),
"To Water Capture From Janitor Closet": lambda state: cloth_capturable(state, player)
},
"locations_required": {
"Puzzle Solved Anansi Musicbox": lambda state: state.can_reach("Clock Tower", "Region", player),
@@ -207,8 +208,10 @@ def set_rules(world: "ShiversWorld") -> None:
# forbid cloth in janitor closet and oil in tar river
forbid_item(multiworld.get_location("Accessible: Storage: Janitor Closet", player), "Cloth Pot Bottom DUPE", player)
forbid_item(multiworld.get_location("Accessible: Storage: Janitor Closet", player), "Cloth Pot Top DUPE", player)
forbid_item(multiworld.get_location("Accessible: Storage: Janitor Closet", player), "Cloth Pot Complete DUPE", player)
forbid_item(multiworld.get_location("Accessible: Storage: Tar River", player), "Oil Pot Bottom DUPE", player)
forbid_item(multiworld.get_location("Accessible: Storage: Tar River", player), "Oil Pot Top DUPE", player)
forbid_item(multiworld.get_location("Accessible: Storage: Tar River", player), "Oil Pot Complete DUPE", player)
# Filler Item Forbids
forbid_item(multiworld.get_location("Puzzle Solved Lyre", player), "Easier Lyre", player)
@@ -234,4 +237,8 @@ def set_rules(world: "ShiversWorld") -> None:
forbid_item(multiworld.get_location("Ixupi Captured Metal", player), "Metal Always Available in Prehistoric", player)
# Set completion condition
multiworld.completion_condition[player] = lambda state: (first_nine_ixupi_capturable(state, player) and lightning_capturable(state, player))
multiworld.completion_condition[player] = lambda state: ((
water_capturable(state, player) + wax_capturable(state, player) + ash_capturable(state, player) \
+ oil_capturable(state, player) + cloth_capturable(state, player) + wood_capturable(state, player) \
+ crystal_capturable(state, player) + sand_capturable(state, player) + metal_capturable(state, player) \
+ lightning_capturable(state, player)) >= world.options.ixupi_captures_needed.value)

View File

@@ -1,3 +1,4 @@
from typing import List
from .Items import item_table, ShiversItem
from .Rules import set_rules
from BaseClasses import Item, Tutorial, Region, Location
@@ -22,7 +23,7 @@ class ShiversWorld(World):
Shivers is a horror themed point and click adventure. Explore the mysteries of Windlenot's Museum of the Strange and Unusual.
"""
game: str = "Shivers"
game = "Shivers"
topology_present = False
web = ShiversWeb()
options_dataclass = ShiversOptions
@@ -30,7 +31,13 @@ class ShiversWorld(World):
item_name_to_id = {name: data.code for name, data in item_table.items()}
location_name_to_id = Constants.location_name_to_id
shivers_item_id_offset = 27000
pot_completed_list: List[int]
def generate_early(self):
self.pot_completed_list = []
def create_item(self, name: str) -> Item:
data = item_table[name]
return ShiversItem(name, data.classification, data.code, self.player)
@@ -78,9 +85,28 @@ class ShiversWorld(World):
#Add items to item pool
itempool = []
for name, data in item_table.items():
if data.type in {"pot", "key", "ability", "filler2"}:
if data.type in {"key", "ability", "filler2"}:
itempool.append(self.create_item(name))
# Pot pieces/Completed/Mixed:
for i in range(10):
if self.options.full_pots == "pieces":
itempool.append(self.create_item(self.item_id_to_name[self.shivers_item_id_offset + i]))
itempool.append(self.create_item(self.item_id_to_name[self.shivers_item_id_offset + 10 + i]))
elif self.options.full_pots == "complete":
itempool.append(self.create_item(self.item_id_to_name[self.shivers_item_id_offset + 20 + i]))
else:
# Roll for if pieces or a complete pot will be used.
# Pot Pieces
if self.random.randint(0, 1) == 0:
self.pot_completed_list.append(0)
itempool.append(self.create_item(self.item_id_to_name[self.shivers_item_id_offset + i]))
itempool.append(self.create_item(self.item_id_to_name[self.shivers_item_id_offset + 10 + i]))
# Completed Pot
else:
self.pot_completed_list.append(1)
itempool.append(self.create_item(self.item_id_to_name[self.shivers_item_id_offset + 20 + i]))
#Add Filler
itempool += [self.create_item("Easier Lyre") for i in range(9)]
@@ -88,7 +114,6 @@ class ShiversWorld(World):
filler_needed = len(self.multiworld.get_unfilled_locations(self.player)) - 24 - len(itempool)
itempool += [self.random.choices([self.create_item("Heal"), self.create_item("Easier Lyre")], weights=[95, 5])[0] for i in range(filler_needed)]
#Place library escape items. Choose a location to place the escape item
library_region = self.multiworld.get_region("Library", self.player)
librarylocation = self.random.choice([loc for loc in library_region.locations if not loc.name.startswith("Accessible:")])
@@ -123,14 +148,14 @@ class ShiversWorld(World):
self.multiworld.itempool += itempool
#Lobby acess:
if self.options.lobby_access == 1:
if self.options.lobby_access == "early":
if lobby_access_keys == 1:
self.multiworld.early_items[self.player]["Key for Underground Lake Room"] = 1
self.multiworld.early_items[self.player]["Key for Office Elevator"] = 1
self.multiworld.early_items[self.player]["Key for Office"] = 1
elif lobby_access_keys == 2:
self.multiworld.early_items[self.player]["Key for Front Door"] = 1
if self.options.lobby_access == 2:
if self.options.lobby_access == "local":
if lobby_access_keys == 1:
self.multiworld.local_early_items[self.player]["Key for Underground Lake Room"] = 1
self.multiworld.local_early_items[self.player]["Key for Office Elevator"] = 1
@@ -138,6 +163,12 @@ class ShiversWorld(World):
elif lobby_access_keys == 2:
self.multiworld.local_early_items[self.player]["Key for Front Door"] = 1
#Pot piece shuffle location:
if self.options.location_pot_pieces == "own_world":
self.options.local_items.value |= {name for name, data in item_table.items() if data.type == "pot" or data.type == "pot_type2"}
if self.options.location_pot_pieces == "different_world":
self.options.non_local_items.value |= {name for name, data in item_table.items() if data.type == "pot" or data.type == "pot_type2"}
def pre_fill(self) -> None:
# Prefills event storage locations with duplicate pots
storagelocs = []
@@ -149,7 +180,23 @@ class ShiversWorld(World):
if loc_name.startswith("Accessible: "):
storagelocs.append(self.multiworld.get_location(loc_name, self.player))
storageitems += [self.create_item(name) for name, data in item_table.items() if data.type == 'potduplicate']
#Pot pieces/Completed/Mixed:
if self.options.full_pots == "pieces":
storageitems += [self.create_item(name) for name, data in item_table.items() if data.type == 'potduplicate']
elif self.options.full_pots == "complete":
storageitems += [self.create_item(name) for name, data in item_table.items() if data.type == 'potduplicate_type2']
storageitems += [self.create_item("Empty") for i in range(10)]
else:
for i in range(10):
#Pieces
if self.pot_completed_list[i] == 0:
storageitems += [self.create_item(self.item_id_to_name[self.shivers_item_id_offset + 70 + i])]
storageitems += [self.create_item(self.item_id_to_name[self.shivers_item_id_offset + 80 + i])]
#Complete
else:
storageitems += [self.create_item(self.item_id_to_name[self.shivers_item_id_offset + 140 + i])]
storageitems += [self.create_item("Empty")]
storageitems += [self.create_item("Empty") for i in range(3)]
state = self.multiworld.get_all_state(True)
@@ -166,11 +213,13 @@ class ShiversWorld(World):
def fill_slot_data(self) -> dict:
return {
"storageplacements": self.storage_placements,
"excludedlocations": {str(excluded_location).replace('ExcludeLocations(', '').replace(')', '') for excluded_location in self.multiworld.exclude_locations.values()},
"elevatorsstaysolved": {self.options.elevators_stay_solved.value},
"earlybeth": {self.options.early_beth.value},
"earlylightning": {self.options.early_lightning.value},
"StoragePlacements": self.storage_placements,
"ExcludedLocations": list(self.options.exclude_locations.value),
"IxupiCapturesNeeded": self.options.ixupi_captures_needed.value,
"ElevatorsStaySolved": self.options.elevators_stay_solved.value,
"EarlyBeth": self.options.early_beth.value,
"EarlyLightning": self.options.early_lightning.value,
"FrontDoorUsable": self.options.front_door_usable.value
}

View File

@@ -81,7 +81,7 @@
"Information Plaque: (Ocean) Poseidon",
"Information Plaque: (Ocean) Colossus of Rhodes",
"Information Plaque: (Ocean) Poseidon's Temple",
"Information Plaque: (Underground Maze) Subterranean World",
"Information Plaque: (Underground Maze Staircase) Subterranean World",
"Information Plaque: (Underground Maze) Dero",
"Information Plaque: (Egypt) Tomb of the Ixupi",
"Information Plaque: (Egypt) The Sphinx",
@@ -119,16 +119,6 @@
"Outside": [
"Puzzle Solved Gears",
"Puzzle Solved Stone Henge",
"Ixupi Captured Water",
"Ixupi Captured Wax",
"Ixupi Captured Ash",
"Ixupi Captured Oil",
"Ixupi Captured Cloth",
"Ixupi Captured Wood",
"Ixupi Captured Crystal",
"Ixupi Captured Sand",
"Ixupi Captured Metal",
"Ixupi Captured Lightning",
"Puzzle Solved Office Elevator",
"Puzzle Solved Three Floor Elevator",
"Puzzle Hint Found: Combo Lock in Mailbox",
@@ -182,7 +172,8 @@
"Accessible: Storage: Transforming Mask"
],
"Generator": [
"Final Riddle: Beth's Body Page 17"
"Final Riddle: Beth's Body Page 17",
"Ixupi Captured Lightning"
],
"Theater Back Hallways": [
"Puzzle Solved Clock Tower Door"
@@ -210,6 +201,7 @@
"Information Plaque: (Ocean) Poseidon's Temple"
],
"Maze Staircase": [
"Information Plaque: (Underground Maze Staircase) Subterranean World",
"Puzzle Solved Maze Door"
],
"Egypt": [
@@ -305,7 +297,6 @@
],
"Tar River": [
"Accessible: Storage: Tar River",
"Information Plaque: (Underground Maze) Subterranean World",
"Information Plaque: (Underground Maze) Dero"
],
"Theater": [
@@ -320,6 +311,33 @@
"Skull Dial Bridge": [
"Accessible: Storage: Skull Bridge",
"Puzzle Solved Skull Dial Door"
],
"Water Capture": [
"Ixupi Captured Water"
],
"Wax Capture": [
"Ixupi Captured Wax"
],
"Ash Capture": [
"Ixupi Captured Ash"
],
"Oil Capture": [
"Ixupi Captured Oil"
],
"Cloth Capture": [
"Ixupi Captured Cloth"
],
"Wood Capture": [
"Ixupi Captured Wood"
],
"Crystal Capture": [
"Ixupi Captured Crystal"
],
"Sand Capture": [
"Ixupi Captured Sand"
],
"Metal Capture": [
"Ixupi Captured Metal"
]
}
}
}

View File

@@ -7,35 +7,35 @@
["Underground Lake", ["To Underground Tunnels From Underground Lake", "To Underground Blue Tunnels From Underground Lake"]],
["Underground Blue Tunnels", ["To Underground Lake From Underground Blue Tunnels", "To Office Elevator From Underground Blue Tunnels"]],
["Office Elevator", ["To Underground Blue Tunnels From Office Elevator","To Office From Office Elevator"]],
["Office", ["To Office Elevator From Office", "To Workshop", "To Lobby From Office", "To Bedroom Elevator From Office"]],
["Workshop", ["To Office From Workshop"]],
["Office", ["To Office Elevator From Office", "To Workshop", "To Lobby From Office", "To Bedroom Elevator From Office", "To Ash Capture From Office"]],
["Workshop", ["To Office From Workshop", "To Wood Capture From Workshop"]],
["Bedroom Elevator", ["To Office From Bedroom Elevator", "To Bedroom"]],
["Bedroom", ["To Bedroom Elevator From Bedroom"]],
["Lobby", ["To Office From Lobby", "To Library From Lobby", "To Theater From Lobby", "To Prehistoric From Lobby", "To Egypt From Lobby", "To Tar River From Lobby", "To Outside From Lobby"]],
["Library", ["To Lobby From Library", "To Maintenance Tunnels From Library"]],
["Bedroom", ["To Bedroom Elevator From Bedroom", "To Metal Capture From Bedroom"]],
["Lobby", ["To Office From Lobby", "To Library From Lobby", "To Theater From Lobby", "To Prehistoric From Lobby", "To Egypt From Lobby", "To Tar River From Lobby", "To Outside From Lobby", "To Water Capture From Lobby", "To Crystal Capture From Lobby"]],
["Library", ["To Lobby From Library", "To Maintenance Tunnels From Library", "To Wax Capture From Library"]],
["Maintenance Tunnels", ["To Library From Maintenance Tunnels", "To Three Floor Elevator From Maintenance Tunnels", "To Generator"]],
["Generator", ["To Maintenance Tunnels From Generator"]],
["Theater", ["To Lobby From Theater", "To Theater Back Hallways From Theater"]],
["Theater Back Hallways", ["To Theater From Theater Back Hallways", "To Clock Tower Staircase From Theater Back Hallways", "To Maintenance Tunnels From Theater Back Hallways", "To Projector Room"]],
["Clock Tower Staircase", ["To Theater Back Hallways From Clock Tower Staircase", "To Clock Tower"]],
["Clock Tower", ["To Clock Tower Staircase From Clock Tower"]],
["Projector Room", ["To Theater Back Hallways From Projector Room"]],
["Prehistoric", ["To Lobby From Prehistoric", "To Greenhouse", "To Ocean From Prehistoric"]],
["Greenhouse", ["To Prehistoric From Greenhouse"]],
["Ocean", ["To Prehistoric From Ocean", "To Maze Staircase From Ocean"]],
["Projector Room", ["To Theater Back Hallways From Projector Room", "To Metal Capture From Projector Room"]],
["Prehistoric", ["To Lobby From Prehistoric", "To Greenhouse", "To Ocean From Prehistoric", "To Oil Capture From Prehistoric", "To Metal Capture From Prehistoric"]],
["Greenhouse", ["To Prehistoric From Greenhouse", "To Sand Capture From Greenhouse"]],
["Ocean", ["To Prehistoric From Ocean", "To Maze Staircase From Ocean", "To Crystal Capture From Ocean", "To Sand Capture From Ocean"]],
["Maze Staircase", ["To Ocean From Maze Staircase", "To Maze From Maze Staircase"]],
["Maze", ["To Maze Staircase From Maze", "To Tar River"]],
["Tar River", ["To Maze From Tar River", "To Lobby From Tar River"]],
["Egypt", ["To Lobby From Egypt", "To Burial From Egypt", "To Blue Maze From Egypt"]],
["Burial", ["To Egypt From Burial", "To Shaman From Burial"]],
["Shaman", ["To Burial From Shaman", "To Gods Room"]],
["Gods Room", ["To Shaman From Gods Room", "To Anansi From Gods Room"]],
["Anansi", ["To Gods Room From Anansi", "To Werewolf From Anansi"]],
["Tar River", ["To Maze From Tar River", "To Lobby From Tar River", "To Oil Capture From Tar River"]],
["Egypt", ["To Lobby From Egypt", "To Burial From Egypt", "To Blue Maze From Egypt", "To Cloth Capture From Egypt"]],
["Burial", ["To Egypt From Burial", "To Shaman From Burial", "To Ash Capture From Burial", "To Cloth Capture From Burial"]],
["Shaman", ["To Burial From Shaman", "To Gods Room", "To Wax Capture From Shaman"]],
["Gods Room", ["To Shaman From Gods Room", "To Anansi From Gods Room", "To Wood Capture From Gods Room"]],
["Anansi", ["To Gods Room From Anansi", "To Werewolf From Anansi", "To Wax Capture From Anansi", "To Wood Capture From Anansi"]],
["Werewolf", ["To Anansi From Werewolf", "To Night Staircase From Werewolf"]],
["Night Staircase", ["To Werewolf From Night Staircase", "To Janitor Closet", "To UFO"]],
["Janitor Closet", ["To Night Staircase From Janitor Closet"]],
["Janitor Closet", ["To Night Staircase From Janitor Closet", "To Water Capture From Janitor Closet", "To Cloth Capture From Janitor Closet"]],
["UFO", ["To Night Staircase From UFO", "To Inventions From UFO"]],
["Blue Maze", ["To Egypt From Blue Maze", "To Three Floor Elevator From Blue Maze Bottom", "To Three Floor Elevator From Blue Maze Top", "To Fortune Teller", "To Inventions From Blue Maze"]],
["Blue Maze", ["To Egypt From Blue Maze", "To Three Floor Elevator From Blue Maze Bottom", "To Three Floor Elevator From Blue Maze Top", "To Fortune Teller", "To Inventions From Blue Maze", "To Wood Capture From Blue Maze"]],
["Three Floor Elevator", ["To Maintenance Tunnels From Three Floor Elevator", "To Blue Maze From Three Floor Elevator"]],
["Fortune Teller", ["To Blue Maze From Fortune Teller"]],
["Inventions", ["To Blue Maze From Inventions", "To UFO From Inventions", "To Torture From Inventions"]],
@@ -43,7 +43,16 @@
["Puzzle Room Mastermind", ["To Torture", "To Puzzle Room Marbles From Puzzle Room Mastermind"]],
["Puzzle Room Marbles", ["To Puzzle Room Mastermind From Puzzle Room Marbles", "To Skull Dial Bridge From Puzzle Room Marbles"]],
["Skull Dial Bridge", ["To Puzzle Room Marbles From Skull Dial Bridge", "To Slide Room"]],
["Slide Room", ["To Skull Dial Bridge From Slide Room", "To Lobby From Slide Room"]]
["Slide Room", ["To Skull Dial Bridge From Slide Room", "To Lobby From Slide Room"]],
["Water Capture", []],
["Wax Capture", []],
["Ash Capture", []],
["Oil Capture", []],
["Cloth Capture", []],
["Wood Capture", []],
["Crystal Capture", []],
["Sand Capture", []],
["Metal Capture", []]
],
"mandatory_connections": [
["To Registry", "Registry"],
@@ -140,6 +149,29 @@
["To Puzzle Room Marbles From Skull Dial Bridge", "Puzzle Room Marbles"],
["To Skull Dial Bridge From Puzzle Room Marbles", "Skull Dial Bridge"],
["To Skull Dial Bridge From Slide Room", "Skull Dial Bridge"],
["To Slide Room", "Slide Room"]
["To Slide Room", "Slide Room"],
["To Wax Capture From Library", "Wax Capture"],
["To Wax Capture From Shaman", "Wax Capture"],
["To Wax Capture From Anansi", "Wax Capture"],
["To Water Capture From Lobby", "Water Capture"],
["To Water Capture From Janitor Closet", "Water Capture"],
["To Ash Capture From Office", "Ash Capture"],
["To Ash Capture From Burial", "Ash Capture"],
["To Oil Capture From Prehistoric", "Oil Capture"],
["To Oil Capture From Tar River", "Oil Capture"],
["To Cloth Capture From Egypt", "Cloth Capture"],
["To Cloth Capture From Burial", "Cloth Capture"],
["To Cloth Capture From Janitor Closet", "Cloth Capture"],
["To Wood Capture From Workshop", "Wood Capture"],
["To Wood Capture From Gods Room", "Wood Capture"],
["To Wood Capture From Anansi", "Wood Capture"],
["To Wood Capture From Blue Maze", "Wood Capture"],
["To Crystal Capture From Lobby", "Crystal Capture"],
["To Crystal Capture From Ocean", "Crystal Capture"],
["To Sand Capture From Greenhouse", "Sand Capture"],
["To Sand Capture From Ocean", "Sand Capture"],
["To Metal Capture From Bedroom", "Metal Capture"],
["To Metal Capture From Projector Room", "Metal Capture"],
["To Metal Capture From Prehistoric", "Metal Capture"]
]
}
}

View File

@@ -12,8 +12,8 @@ these are randomized. Crawling has been added and is required to use any crawl s
## What is considered a location check in Shivers?
1. All puzzle solves are location checks excluding elevator puzzles.
2. All Ixupi captures are location checks excluding Lightning.
1. All puzzle solves are location checks.
2. All Ixupi captures are location checks.
3. Puzzle hints/solutions are location checks. For example, looking at the Atlantis map.
4. Optionally information plaques are location checks.
@@ -23,9 +23,9 @@ If the player receives a key then the corresponding door will be unlocked. If th
## What is the victory condition?
Victory is achieved when the player captures Lightning in the generator room.
Victory is achieved when the player has captured the required number Ixupi set in their options.
## Encountered a bug?
Please contact GodlFire on Discord for bugs related to Shivers world generation.\
Please contact GodlFire on Discord for bugs related to Shivers world generation.<br>
Please contact GodlFire or mouse on Discord for bugs related to the Shivers Randomizer.

View File

@@ -5,7 +5,7 @@
- [Shivers (GOG version)](https://www.gog.com/en/game/shivers) or original disc
- [ScummVM](https://www.scummvm.org/downloads/) version 2.7.0 or later
- [Shivers Randomizer](https://www.speedrun.com/shivers/resources)
- [Shivers Randomizer](https://github.com/GodlFire/Shivers-Randomizer-CSharp/releases/latest) Latest release version
## Setup ScummVM for Shivers

View File

@@ -1,5 +1,5 @@
import typing
from Options import Choice, Option, Toggle, DefaultOnToggle, Range
from Options import Choice, Option, Toggle, DefaultOnToggle, Range, ItemsAccessibility
class SMLogic(Choice):
"""This option selects what kind of logic to use for item placement inside
@@ -128,6 +128,7 @@ class EnergyBeep(DefaultOnToggle):
smz3_options: typing.Dict[str, type(Option)] = {
"accessibility": ItemsAccessibility,
"sm_logic": SMLogic,
"sword_location": SwordLocation,
"morph_location": MorphLocation,

View File

@@ -215,7 +215,6 @@ class SMZ3World(World):
niceItems = TotalSMZ3Item.Item.CreateNicePool(self.smz3World)
junkItems = TotalSMZ3Item.Item.CreateJunkPool(self.smz3World)
allJunkItems = niceItems + junkItems
self.junkItemsNames = [item.Type.name for item in junkItems]
if (self.smz3World.Config.Keysanity):
@@ -228,7 +227,8 @@ class SMZ3World(World):
self.multiworld.push_precollected(SMZ3Item(item.Type.name, ItemClassification.filler, item.Type, self.item_name_to_id[item.Type.name], self.player, item))
itemPool = [SMZ3Item(item.Type.name, ItemClassification.progression, item.Type, self.item_name_to_id[item.Type.name], self.player, item) for item in progressionItems] + \
[SMZ3Item(item.Type.name, ItemClassification.filler, item.Type, self.item_name_to_id[item.Type.name], self.player, item) for item in allJunkItems]
[SMZ3Item(item.Type.name, ItemClassification.useful, item.Type, self.item_name_to_id[item.Type.name], self.player, item) for item in niceItems] + \
[SMZ3Item(item.Type.name, ItemClassification.filler, item.Type, self.item_name_to_id[item.Type.name], self.player, item) for item in junkItems]
self.smz3DungeonItems = [SMZ3Item(item.Type.name, ItemClassification.progression, item.Type, self.item_name_to_id[item.Type.name], self.player, item) for item in self.dungeon]
self.multiworld.itempool += itemPool
@@ -244,7 +244,7 @@ class SMZ3World(World):
set_rule(entrance, lambda state, region=region: region.CanEnter(state.smz3state[self.player]))
for loc in region.Locations:
l = self.locations[loc.Name]
if self.multiworld.accessibility[self.player] != 'locations':
if self.multiworld.accessibility[self.player] != 'full':
l.always_allow = lambda state, item, loc=loc: \
item.game == "SMZ3" and \
loc.alwaysAllow(item.item, state.smz3state[self.player])

View File

@@ -1,5 +1,7 @@
import typing
from Options import TextChoice, Option, Range, Toggle
from dataclasses import dataclass
from Options import TextChoice, Range, Toggle, PerGameCommonOptions
class Character(TextChoice):
@@ -55,9 +57,18 @@ class Downfall(Toggle):
default = 0
spire_options: typing.Dict[str, type(Option)] = {
"character": Character,
"ascension": Ascension,
"final_act": FinalAct,
"downfall": Downfall,
}
class DeathLink(Range):
"""Percentage of health to lose when a death link is received."""
display_name = "Death Link %"
range_start = 0
range_end = 100
default = 0
@dataclass
class SpireOptions(PerGameCommonOptions):
character: Character
ascension: Ascension
final_act: FinalAct
downfall: Downfall
death_link: DeathLink

View File

@@ -3,7 +3,7 @@ import string
from BaseClasses import Entrance, Item, ItemClassification, Location, MultiWorld, Region, Tutorial
from .Items import event_item_pairs, item_pool, item_table
from .Locations import location_table
from .Options import spire_options
from .Options import SpireOptions
from .Regions import create_regions
from .Rules import set_rules
from ..AutoWorld import WebWorld, World
@@ -27,7 +27,8 @@ class SpireWorld(World):
immense power, and Slay the Spire!
"""
option_definitions = spire_options
options_dataclass = SpireOptions
options: SpireOptions
game = "Slay the Spire"
topology_present = False
web = SpireWeb()
@@ -63,15 +64,13 @@ class SpireWorld(World):
def fill_slot_data(self) -> dict:
slot_data = {
'seed': "".join(self.multiworld.per_slot_randoms[self.player].choice(string.ascii_letters) for i in range(16))
'seed': "".join(self.random.choice(string.ascii_letters) for i in range(16))
}
for option_name in spire_options:
option = getattr(self.multiworld, option_name)[self.player]
slot_data[option_name] = option.value
slot_data.update(self.options.as_dict("character", "ascension", "final_act", "downfall", "death_link"))
return slot_data
def get_filler_item_name(self) -> str:
return self.multiworld.random.choice(["Card Draw", "Card Draw", "Card Draw", "Relic", "Relic"])
return self.random.choice(["Card Draw", "Card Draw", "Card Draw", "Relic", "Relic"])
def create_region(world: MultiWorld, player: int, name: str, locations=None, exits=None):

View File

@@ -2212,7 +2212,7 @@ id,region,name,tags,mod_name
3808,Shipping,Shipsanity: Mystery Box,"SHIPSANITY",
3809,Shipping,Shipsanity: Golden Tag,"SHIPSANITY",
3810,Shipping,Shipsanity: Deluxe Bait,"SHIPSANITY",
3811,Shipping,Shipsanity: Moss,"SHIPSANITY,SHIPSANITY_CROP,SHIPSANITY_FULL_SHIPMENT",
3811,Shipping,Shipsanity: Moss,"SHIPSANITY,SHIPSANITY_FULL_SHIPMENT",
3812,Shipping,Shipsanity: Mossy Seed,"SHIPSANITY",
3813,Shipping,Shipsanity: Sonar Bobber,"SHIPSANITY",
3814,Shipping,Shipsanity: Tent Kit,"SHIPSANITY",
1 id region name tags mod_name
2212 3808 Shipping Shipsanity: Mystery Box SHIPSANITY
2213 3809 Shipping Shipsanity: Golden Tag SHIPSANITY
2214 3810 Shipping Shipsanity: Deluxe Bait SHIPSANITY
2215 3811 Shipping Shipsanity: Moss SHIPSANITY,SHIPSANITY_CROP,SHIPSANITY_FULL_SHIPMENT SHIPSANITY,SHIPSANITY_FULL_SHIPMENT
2216 3812 Shipping Shipsanity: Mossy Seed SHIPSANITY
2217 3813 Shipping Shipsanity: Sonar Bobber SHIPSANITY
2218 3814 Shipping Shipsanity: Tent Kit SHIPSANITY

View File

@@ -58,7 +58,7 @@ all_random_settings = {
easy_settings = {
"progression_balancing": ProgressionBalancing.default,
"accessibility": Accessibility.option_items,
"accessibility": Accessibility.option_full,
Goal.internal_name: Goal.option_community_center,
FarmType.internal_name: "random",
StartingMoney.internal_name: "very rich",
@@ -104,7 +104,7 @@ easy_settings = {
medium_settings = {
"progression_balancing": 25,
"accessibility": Accessibility.option_locations,
"accessibility": Accessibility.option_full,
Goal.internal_name: Goal.option_community_center,
FarmType.internal_name: "random",
StartingMoney.internal_name: "rich",
@@ -150,7 +150,7 @@ medium_settings = {
hard_settings = {
"progression_balancing": 0,
"accessibility": Accessibility.option_locations,
"accessibility": Accessibility.option_full,
Goal.internal_name: Goal.option_grandpa_evaluation,
FarmType.internal_name: "random",
StartingMoney.internal_name: "extra",
@@ -196,7 +196,7 @@ hard_settings = {
nightmare_settings = {
"progression_balancing": 0,
"accessibility": Accessibility.option_locations,
"accessibility": Accessibility.option_full,
Goal.internal_name: Goal.option_community_center,
FarmType.internal_name: "random",
StartingMoney.internal_name: "vanilla",
@@ -242,7 +242,7 @@ nightmare_settings = {
short_settings = {
"progression_balancing": ProgressionBalancing.default,
"accessibility": Accessibility.option_items,
"accessibility": Accessibility.option_full,
Goal.internal_name: Goal.option_bottom_of_the_mines,
FarmType.internal_name: "random",
StartingMoney.internal_name: "filthy rich",
@@ -334,7 +334,7 @@ minsanity_settings = {
allsanity_settings = {
"progression_balancing": ProgressionBalancing.default,
"accessibility": Accessibility.option_locations,
"accessibility": Accessibility.option_full,
Goal.internal_name: Goal.default,
FarmType.internal_name: "random",
StartingMoney.internal_name: StartingMoney.default,

View File

@@ -6,7 +6,7 @@ from argparse import Namespace
from contextlib import contextmanager
from typing import Dict, ClassVar, Iterable, Tuple, Optional, List, Union, Any
from BaseClasses import MultiWorld, CollectionState, get_seed, Location, Item, ItemClassification
from BaseClasses import MultiWorld, CollectionState, PlandoOptions, get_seed, Location, Item, ItemClassification
from Options import VerifyKeys
from test.bases import WorldTestBase
from test.general import gen_steps, setup_solo_multiworld as setup_base_solo_multiworld
@@ -365,7 +365,7 @@ def setup_solo_multiworld(test_options: Optional[Dict[Union[str, StardewValleyOp
if issubclass(option, VerifyKeys):
# Values should already be verified, but just in case...
option.verify_keys(value.value)
value.verify(StardewValleyWorld, "Tester", PlandoOptions.bosses)
setattr(args, name, {1: value})
multiworld.set_options(args)

View File

@@ -1,6 +1,6 @@
from typing import List, Optional, Callable, NamedTuple
from BaseClasses import MultiWorld, CollectionState
from .Options import is_option_enabled
from BaseClasses import CollectionState
from .Options import TimespinnerOptions
from .PreCalculatedWeights import PreCalculatedWeights
from .LogicExtensions import TimespinnerLogic
@@ -14,11 +14,10 @@ class LocationData(NamedTuple):
rule: Optional[Callable[[CollectionState], bool]] = None
def get_location_datas(world: Optional[MultiWorld], player: Optional[int],
precalculated_weights: PreCalculatedWeights) -> List[LocationData]:
flooded: PreCalculatedWeights = precalculated_weights
logic = TimespinnerLogic(world, player, precalculated_weights)
def get_location_datas(player: Optional[int], options: Optional[TimespinnerOptions],
precalculated_weights: Optional[PreCalculatedWeights]) -> List[LocationData]:
flooded: Optional[PreCalculatedWeights] = precalculated_weights
logic = TimespinnerLogic(player, options, precalculated_weights)
# 1337000 - 1337155 Generic locations
# 1337171 - 1337175 New Pickup checks
@@ -203,7 +202,7 @@ def get_location_datas(world: Optional[MultiWorld], player: Optional[int],
]
# 1337156 - 1337170 Downloads
if not world or is_option_enabled(world, player, "DownloadableItems"):
if not options or options.downloadable_items:
location_table += (
LocationData('Library', 'Library: Terminal 2 (Lachiem)', 1337156, lambda state: state.has('Tablet', player)),
LocationData('Library', 'Library: Terminal 1 (Windaria)', 1337157, lambda state: state.has('Tablet', player)),
@@ -223,13 +222,13 @@ def get_location_datas(world: Optional[MultiWorld], player: Optional[int],
)
# 1337176 - 1337176 Cantoran
if not world or is_option_enabled(world, player, "Cantoran"):
if not options or options.cantoran:
location_table += (
LocationData('Left Side forest Caves', 'Lake Serene: Cantoran', 1337176),
)
# 1337177 - 1337198 Lore Checks
if not world or is_option_enabled(world, player, "LoreChecks"):
if not options or options.lore_checks:
location_table += (
LocationData('Lower lake desolation', 'Lake Desolation: Memory - Coyote Jump (Time Messenger)', 1337177),
LocationData('Library', 'Library: Memory - Waterway (A Message)', 1337178),
@@ -258,7 +257,7 @@ def get_location_datas(world: Optional[MultiWorld], player: Optional[int],
# 1337199 - 1337236 Reserved for future use
# 1337237 - 1337245 GyreArchives
if not world or is_option_enabled(world, player, "GyreArchives"):
if not options or options.gyre_archives:
location_table += (
LocationData('Ravenlord\'s Lair', 'Ravenlord: Post fight (pedestal)', 1337237),
LocationData('Ifrit\'s Lair', 'Ifrit: Post fight (pedestal)', 1337238),

View File

@@ -1,6 +1,6 @@
from typing import Union
from BaseClasses import MultiWorld, CollectionState
from .Options import is_option_enabled
from typing import Union, Optional
from BaseClasses import CollectionState
from .Options import TimespinnerOptions
from .PreCalculatedWeights import PreCalculatedWeights
@@ -10,17 +10,18 @@ class TimespinnerLogic:
flag_unchained_keys: bool
flag_eye_spy: bool
flag_specific_keycards: bool
pyramid_keys_unlock: Union[str, None]
present_keys_unlock: Union[str, None]
past_keys_unlock: Union[str, None]
time_keys_unlock: Union[str, None]
pyramid_keys_unlock: Optional[str]
present_keys_unlock: Optional[str]
past_keys_unlock: Optional[str]
time_keys_unlock: Optional[str]
def __init__(self, world: MultiWorld, player: int, precalculated_weights: PreCalculatedWeights):
def __init__(self, player: int, options: Optional[TimespinnerOptions],
precalculated_weights: Optional[PreCalculatedWeights]):
self.player = player
self.flag_specific_keycards = is_option_enabled(world, player, "SpecificKeycards")
self.flag_eye_spy = is_option_enabled(world, player, "EyeSpy")
self.flag_unchained_keys = is_option_enabled(world, player, "UnchainedKeys")
self.flag_specific_keycards = bool(options and options.specific_keycards)
self.flag_eye_spy = bool(options and options.eye_spy)
self.flag_unchained_keys = bool(options and options.unchained_keys)
if precalculated_weights:
if self.flag_unchained_keys:

View File

@@ -1,59 +1,50 @@
from typing import Dict, Union, List
from BaseClasses import MultiWorld
from Options import Toggle, DefaultOnToggle, DeathLink, Choice, Range, Option, OptionDict, OptionList
from dataclasses import dataclass
from typing import Type, Any
from typing import Dict
from Options import Toggle, DefaultOnToggle, DeathLink, Choice, Range, OptionDict, OptionList, Visibility, Option
from Options import PerGameCommonOptions, DeathLinkMixin, AssembleOptions
from schema import Schema, And, Optional, Or
class StartWithJewelryBox(Toggle):
"Start with Jewelry Box unlocked"
display_name = "Start with Jewelry Box"
class DownloadableItems(DefaultOnToggle):
"With the tablet you will be able to download items at terminals"
display_name = "Downloadable items"
class EyeSpy(Toggle):
"Requires Oculus Ring in inventory to be able to break hidden walls."
display_name = "Eye Spy"
class StartWithMeyef(Toggle):
"Start with Meyef, ideal for when you want to play multiplayer."
display_name = "Start with Meyef"
class QuickSeed(Toggle):
"Start with Talaria Attachment, Nyoom!"
display_name = "Quick seed"
class SpecificKeycards(Toggle):
"Keycards can only open corresponding doors"
display_name = "Specific Keycards"
class Inverted(Toggle):
"Start in the past"
display_name = "Inverted"
class GyreArchives(Toggle):
"Gyre locations are in logic. New warps are gated by Merchant Crow and Kobo"
display_name = "Gyre Archives"
class Cantoran(Toggle):
"Cantoran's fight and check are available upon revisiting his room"
display_name = "Cantoran"
class LoreChecks(Toggle):
"Memories and journal entries contain items."
display_name = "Lore Checks"
class BossRando(Choice):
"Wheter all boss locations are shuffled, and if their damage/hp should be scaled."
display_name = "Boss Randomization"
@@ -62,7 +53,6 @@ class BossRando(Choice):
option_unscaled = 2
alias_true = 1
class EnemyRando(Choice):
"Wheter enemies will be randomized, and if their damage/hp should be scaled."
display_name = "Enemy Randomization"
@@ -72,7 +62,6 @@ class EnemyRando(Choice):
option_ryshia = 3
alias_true = 1
class DamageRando(Choice):
"Randomly nerfs and buffs some orbs and their associated spells as well as some associated rings."
display_name = "Damage Rando"
@@ -85,7 +74,6 @@ class DamageRando(Choice):
option_manual = 6
alias_true = 2
class DamageRandoOverrides(OptionDict):
"""Manual +/-/normal odds for an orb. Put 0 if you don't want a certain nerf or buff to be a possibility. Orbs that
you don't specify will roll with 1/1/1 as odds"""
@@ -191,7 +179,6 @@ class DamageRandoOverrides(OptionDict):
"Radiant": { "MinusOdds": 1, "NormalOdds": 1, "PlusOdds": 1 },
}
class HpCap(Range):
"Sets the number that Lunais's HP maxes out at."
display_name = "HP Cap"
@@ -199,7 +186,6 @@ class HpCap(Range):
range_end = 999
default = 999
class LevelCap(Range):
"""Sets the max level Lunais can achieve."""
display_name = "Level Cap"
@@ -207,20 +193,17 @@ class LevelCap(Range):
range_end = 99
default = 99
class ExtraEarringsXP(Range):
"""Adds additional XP granted by Galaxy Earrings."""
display_name = "Extra Earrings XP"
range_start = 0
range_end = 24
default = 0
class BossHealing(DefaultOnToggle):
"Enables/disables healing after boss fights. NOTE: Currently only applicable when Boss Rando is enabled."
display_name = "Heal After Bosses"
class ShopFill(Choice):
"""Sets the items for sale in Merchant Crow's shops.
Default: No sunglasses or trendy jacket, but sand vials for sale.
@@ -233,12 +216,10 @@ class ShopFill(Choice):
option_vanilla = 2
option_empty = 3
class ShopWarpShards(DefaultOnToggle):
"Shops always sell warp shards (when keys possessed), ignoring inventory setting."
display_name = "Always Sell Warp Shards"
class ShopMultiplier(Range):
"Multiplier for the cost of items in the shop. Set to 0 for free shops."
display_name = "Shop Price Multiplier"
@@ -246,7 +227,6 @@ class ShopMultiplier(Range):
range_end = 10
default = 1
class LootPool(Choice):
"""Sets the items that drop from enemies (does not apply to boss reward checks)
Vanilla: Drops are the same as the base game
@@ -257,7 +237,6 @@ class LootPool(Choice):
option_randomized = 1
option_empty = 2
class DropRateCategory(Choice):
"""Sets the drop rate when 'Loot Pool' is set to 'Random'
Tiered: Based on item rarity/value
@@ -271,7 +250,6 @@ class DropRateCategory(Choice):
option_randomized = 2
option_fixed = 3
class FixedDropRate(Range):
"Base drop rate percentage when 'Drop Rate Category' is set to 'Fixed'"
display_name = "Fixed Drop Rate"
@@ -279,7 +257,6 @@ class FixedDropRate(Range):
range_end = 100
default = 5
class LootTierDistro(Choice):
"""Sets how often items of each rarity tier are placed when 'Loot Pool' is set to 'Random'
Default Weight: Rarer items will be assigned to enemy drop slots less frequently than common items
@@ -291,32 +268,26 @@ class LootTierDistro(Choice):
option_full_random = 1
option_inverted_weight = 2
class ShowBestiary(Toggle):
"All entries in the bestiary are visible, without needing to kill one of a given enemy first"
display_name = "Show Bestiary Entries"
class ShowDrops(Toggle):
"All item drops in the bestiary are visible, without needing an enemy to drop one of a given item first"
display_name = "Show Bestiary Item Drops"
class EnterSandman(Toggle):
"The Ancient Pyramid is unlocked by the Twin Pyramid Keys, but the final boss door opens if you have all 5 Timespinner pieces"
display_name = "Enter Sandman"
class DadPercent(Toggle):
"""The win condition is beating the boss of Emperor's Tower"""
display_name = "Dad Percent"
class RisingTides(Toggle):
"""Random areas are flooded or drained, can be further specified with RisingTidesOverrides"""
display_name = "Rising Tides"
def rising_tide_option(location: str, with_save_point_option: bool = False) -> Dict[Optional, Or]:
if with_save_point_option:
return {
@@ -341,7 +312,6 @@ def rising_tide_option(location: str, with_save_point_option: bool = False) -> D
"Flooded")
}
class RisingTidesOverrides(OptionDict):
"""Odds for specific areas to be flooded or drained, only has effect when RisingTides is on.
Areas that are not specified will roll with the default 33% chance of getting flooded or drained"""
@@ -373,13 +343,11 @@ class RisingTidesOverrides(OptionDict):
"Lab": { "Dry": 67, "Flooded": 33 },
}
class UnchainedKeys(Toggle):
"""Start with Twin Pyramid Key, which does not give free warp;
warp items for Past, Present, (and ??? with Enter Sandman) can be found."""
display_name = "Unchained Keys"
class TrapChance(Range):
"""Chance of traps in the item pool.
Traps will only replace filler items such as potions, vials and antidotes"""
@@ -388,67 +356,256 @@ class TrapChance(Range):
range_end = 100
default = 10
class Traps(OptionList):
"""List of traps that may be in the item pool to find"""
display_name = "Traps Types"
valid_keys = { "Meteor Sparrow Trap", "Poison Trap", "Chaos Trap", "Neurotoxin Trap", "Bee Trap" }
default = [ "Meteor Sparrow Trap", "Poison Trap", "Chaos Trap", "Neurotoxin Trap", "Bee Trap" ]
class PresentAccessWithWheelAndSpindle(Toggle):
"""When inverted, allows using the refugee camp warp when both the Timespinner Wheel and Spindle is acquired."""
display_name = "Past Wheel & Spindle Warp"
display_name = "Back to the future"
@dataclass
class TimespinnerOptions(PerGameCommonOptions, DeathLinkMixin):
start_with_jewelry_box: StartWithJewelryBox
downloadable_items: DownloadableItems
eye_spy: EyeSpy
start_with_meyef: StartWithMeyef
quick_seed: QuickSeed
specific_keycards: SpecificKeycards
inverted: Inverted
gyre_archives: GyreArchives
cantoran: Cantoran
lore_checks: LoreChecks
boss_rando: BossRando
damage_rando: DamageRando
damage_rando_overrides: DamageRandoOverrides
hp_cap: HpCap
level_cap: LevelCap
extra_earrings_xp: ExtraEarringsXP
boss_healing: BossHealing
shop_fill: ShopFill
shop_warp_shards: ShopWarpShards
shop_multiplier: ShopMultiplier
loot_pool: LootPool
drop_rate_category: DropRateCategory
fixed_drop_rate: FixedDropRate
loot_tier_distro: LootTierDistro
show_bestiary: ShowBestiary
show_drops: ShowDrops
enter_sandman: EnterSandman
dad_percent: DadPercent
rising_tides: RisingTides
rising_tides_overrides: RisingTidesOverrides
unchained_keys: UnchainedKeys
back_to_the_future: PresentAccessWithWheelAndSpindle
trap_chance: TrapChance
traps: Traps
# Some options that are available in the timespinner randomizer arent currently implemented
timespinner_options: Dict[str, Option] = {
"StartWithJewelryBox": StartWithJewelryBox,
"DownloadableItems": DownloadableItems,
"EyeSpy": EyeSpy,
"StartWithMeyef": StartWithMeyef,
"QuickSeed": QuickSeed,
"SpecificKeycards": SpecificKeycards,
"Inverted": Inverted,
"GyreArchives": GyreArchives,
"Cantoran": Cantoran,
"LoreChecks": LoreChecks,
"BossRando": BossRando,
"EnemyRando": EnemyRando,
"DamageRando": DamageRando,
"DamageRandoOverrides": DamageRandoOverrides,
"HpCap": HpCap,
"LevelCap": LevelCap,
"ExtraEarringsXP": ExtraEarringsXP,
"BossHealing": BossHealing,
"ShopFill": ShopFill,
"ShopWarpShards": ShopWarpShards,
"ShopMultiplier": ShopMultiplier,
"LootPool": LootPool,
"DropRateCategory": DropRateCategory,
"FixedDropRate": FixedDropRate,
"LootTierDistro": LootTierDistro,
"ShowBestiary": ShowBestiary,
"ShowDrops": ShowDrops,
"EnterSandman": EnterSandman,
"DadPercent": DadPercent,
"RisingTides": RisingTides,
"RisingTidesOverrides": RisingTidesOverrides,
"UnchainedKeys": UnchainedKeys,
"TrapChance": TrapChance,
"Traps": Traps,
"PresentAccessWithWheelAndSpindle": PresentAccessWithWheelAndSpindle,
"DeathLink": DeathLink,
}
class HiddenDamageRandoOverrides(DamageRandoOverrides):
"""Manual +/-/normal odds for an orb. Put 0 if you don't want a certain nerf or buff to be a possibility. Orbs that
you don't specify will roll with 1/1/1 as odds"""
visibility = Visibility.none
class HiddenRisingTidesOverrides(RisingTidesOverrides):
"""Odds for specific areas to be flooded or drained, only has effect when RisingTides is on.
Areas that are not specified will roll with the default 33% chance of getting flooded or drained"""
visibility = Visibility.none
def is_option_enabled(world: MultiWorld, player: int, name: str) -> bool:
return get_option_value(world, player, name) > 0
class HiddenTraps(Traps):
"""List of traps that may be in the item pool to find"""
visibility = Visibility.none
class OptionsHider:
@classmethod
def hidden(cls, option: Type[Option[Any]]) -> Type[Option]:
new_option = AssembleOptions(f"{option}Hidden", option.__bases__, vars(option).copy())
new_option.visibility = Visibility.none
new_option.__doc__ = option.__doc__
return new_option
class HasReplacedCamelCase(Toggle):
"""For internal use will display a warning message if true"""
visibility = Visibility.none
def get_option_value(world: MultiWorld, player: int, name: str) -> Union[int, Dict, List]:
option = getattr(world, name, None)
if option == None:
return 0
@dataclass
class BackwardsCompatiableTimespinnerOptions(TimespinnerOptions):
StartWithJewelryBox: OptionsHider.hidden(StartWithJewelryBox) # type: ignore
DownloadableItems: OptionsHider.hidden(DownloadableItems) # type: ignore
EyeSpy: OptionsHider.hidden(EyeSpy) # type: ignore
StartWithMeyef: OptionsHider.hidden(StartWithMeyef) # type: ignore
QuickSeed: OptionsHider.hidden(QuickSeed) # type: ignore
SpecificKeycards: OptionsHider.hidden(SpecificKeycards) # type: ignore
Inverted: OptionsHider.hidden(Inverted) # type: ignore
GyreArchives: OptionsHider.hidden(GyreArchives) # type: ignore
Cantoran: OptionsHider.hidden(Cantoran) # type: ignore
LoreChecks: OptionsHider.hidden(LoreChecks) # type: ignore
BossRando: OptionsHider.hidden(BossRando) # type: ignore
DamageRando: OptionsHider.hidden(DamageRando) # type: ignore
DamageRandoOverrides: HiddenDamageRandoOverrides
HpCap: OptionsHider.hidden(HpCap) # type: ignore
LevelCap: OptionsHider.hidden(LevelCap) # type: ignore
ExtraEarringsXP: OptionsHider.hidden(ExtraEarringsXP) # type: ignore
BossHealing: OptionsHider.hidden(BossHealing) # type: ignore
ShopFill: OptionsHider.hidden(ShopFill) # type: ignore
ShopWarpShards: OptionsHider.hidden(ShopWarpShards) # type: ignore
ShopMultiplier: OptionsHider.hidden(ShopMultiplier) # type: ignore
LootPool: OptionsHider.hidden(LootPool) # type: ignore
DropRateCategory: OptionsHider.hidden(DropRateCategory) # type: ignore
FixedDropRate: OptionsHider.hidden(FixedDropRate) # type: ignore
LootTierDistro: OptionsHider.hidden(LootTierDistro) # type: ignore
ShowBestiary: OptionsHider.hidden(ShowBestiary) # type: ignore
ShowDrops: OptionsHider.hidden(ShowDrops) # type: ignore
EnterSandman: OptionsHider.hidden(EnterSandman) # type: ignore
DadPercent: OptionsHider.hidden(DadPercent) # type: ignore
RisingTides: OptionsHider.hidden(RisingTides) # type: ignore
RisingTidesOverrides: HiddenRisingTidesOverrides
UnchainedKeys: OptionsHider.hidden(UnchainedKeys) # type: ignore
PresentAccessWithWheelAndSpindle: OptionsHider.hidden(PresentAccessWithWheelAndSpindle) # type: ignore
TrapChance: OptionsHider.hidden(TrapChance) # type: ignore
Traps: HiddenTraps # type: ignore
DeathLink: OptionsHider.hidden(DeathLink) # type: ignore
has_replaced_options: HasReplacedCamelCase
return option[player].value
def handle_backward_compatibility(self) -> None:
if self.StartWithJewelryBox != StartWithJewelryBox.default and \
self.start_with_jewelry_box == StartWithJewelryBox.default:
self.start_with_jewelry_box.value = self.StartWithJewelryBox.value
self.has_replaced_options.value = Toggle.option_true
if self.DownloadableItems != DownloadableItems.default and \
self.downloadable_items == DownloadableItems.default:
self.downloadable_items.value = self.DownloadableItems.value
self.has_replaced_options.value = Toggle.option_true
if self.EyeSpy != EyeSpy.default and \
self.eye_spy == EyeSpy.default:
self.eye_spy.value = self.EyeSpy.value
self.has_replaced_options.value = Toggle.option_true
if self.StartWithMeyef != StartWithMeyef.default and \
self.start_with_meyef == StartWithMeyef.default:
self.start_with_meyef.value = self.StartWithMeyef.value
self.has_replaced_options.value = Toggle.option_true
if self.QuickSeed != QuickSeed.default and \
self.quick_seed == QuickSeed.default:
self.quick_seed.value = self.QuickSeed.value
self.has_replaced_options.value = Toggle.option_true
if self.SpecificKeycards != SpecificKeycards.default and \
self.specific_keycards == SpecificKeycards.default:
self.specific_keycards.value = self.SpecificKeycards.value
self.has_replaced_options.value = Toggle.option_true
if self.Inverted != Inverted.default and \
self.inverted == Inverted.default:
self.inverted.value = self.Inverted.value
self.has_replaced_options.value = Toggle.option_true
if self.GyreArchives != GyreArchives.default and \
self.gyre_archives == GyreArchives.default:
self.gyre_archives.value = self.GyreArchives.value
self.has_replaced_options.value = Toggle.option_true
if self.Cantoran != Cantoran.default and \
self.cantoran == Cantoran.default:
self.cantoran.value = self.Cantoran.value
self.has_replaced_options.value = Toggle.option_true
if self.LoreChecks != LoreChecks.default and \
self.lore_checks == LoreChecks.default:
self.lore_checks.value = self.LoreChecks.value
self.has_replaced_options.value = Toggle.option_true
if self.BossRando != BossRando.default and \
self.boss_rando == BossRando.default:
self.boss_rando.value = self.BossRando.value
self.has_replaced_options.value = Toggle.option_true
if self.DamageRando != DamageRando.default and \
self.damage_rando == DamageRando.default:
self.damage_rando.value = self.DamageRando.value
self.has_replaced_options.value = Toggle.option_true
if self.DamageRandoOverrides != DamageRandoOverrides.default and \
self.damage_rando_overrides == DamageRandoOverrides.default:
self.damage_rando_overrides.value = self.DamageRandoOverrides.value
self.has_replaced_options.value = Toggle.option_true
if self.HpCap != HpCap.default and \
self.hp_cap == HpCap.default:
self.hp_cap.value = self.HpCap.value
self.has_replaced_options.value = Toggle.option_true
if self.LevelCap != LevelCap.default and \
self.level_cap == LevelCap.default:
self.level_cap.value = self.LevelCap.value
self.has_replaced_options.value = Toggle.option_true
if self.ExtraEarringsXP != ExtraEarringsXP.default and \
self.extra_earrings_xp == ExtraEarringsXP.default:
self.extra_earrings_xp.value = self.ExtraEarringsXP.value
self.has_replaced_options.value = Toggle.option_true
if self.BossHealing != BossHealing.default and \
self.boss_healing == BossHealing.default:
self.boss_healing.value = self.BossHealing.value
self.has_replaced_options.value = Toggle.option_true
if self.ShopFill != ShopFill.default and \
self.shop_fill == ShopFill.default:
self.shop_fill.value = self.ShopFill.value
self.has_replaced_options.value = Toggle.option_true
if self.ShopWarpShards != ShopWarpShards.default and \
self.shop_warp_shards == ShopWarpShards.default:
self.shop_warp_shards.value = self.ShopWarpShards.value
self.has_replaced_options.value = Toggle.option_true
if self.ShopMultiplier != ShopMultiplier.default and \
self.shop_multiplier == ShopMultiplier.default:
self.shop_multiplier.value = self.ShopMultiplier.value
self.has_replaced_options.value = Toggle.option_true
if self.LootPool != LootPool.default and \
self.loot_pool == LootPool.default:
self.loot_pool.value = self.LootPool.value
self.has_replaced_options.value = Toggle.option_true
if self.DropRateCategory != DropRateCategory.default and \
self.drop_rate_category == DropRateCategory.default:
self.drop_rate_category.value = self.DropRateCategory.value
self.has_replaced_options.value = Toggle.option_true
if self.FixedDropRate != FixedDropRate.default and \
self.fixed_drop_rate == FixedDropRate.default:
self.fixed_drop_rate.value = self.FixedDropRate.value
self.has_replaced_options.value = Toggle.option_true
if self.LootTierDistro != LootTierDistro.default and \
self.loot_tier_distro == LootTierDistro.default:
self.loot_tier_distro.value = self.LootTierDistro.value
self.has_replaced_options.value = Toggle.option_true
if self.ShowBestiary != ShowBestiary.default and \
self.show_bestiary == ShowBestiary.default:
self.show_bestiary.value = self.ShowBestiary.value
self.has_replaced_options.value = Toggle.option_true
if self.ShowDrops != ShowDrops.default and \
self.show_drops == ShowDrops.default:
self.show_drops.value = self.ShowDrops.value
self.has_replaced_options.value = Toggle.option_true
if self.EnterSandman != EnterSandman.default and \
self.enter_sandman == EnterSandman.default:
self.enter_sandman.value = self.EnterSandman.value
self.has_replaced_options.value = Toggle.option_true
if self.DadPercent != DadPercent.default and \
self.dad_percent == DadPercent.default:
self.dad_percent.value = self.DadPercent.value
self.has_replaced_options.value = Toggle.option_true
if self.RisingTides != RisingTides.default and \
self.rising_tides == RisingTides.default:
self.rising_tides.value = self.RisingTides.value
self.has_replaced_options.value = Toggle.option_true
if self.RisingTidesOverrides != RisingTidesOverrides.default and \
self.rising_tides_overrides == RisingTidesOverrides.default:
self.rising_tides_overrides.value = self.RisingTidesOverrides.value
self.has_replaced_options.value = Toggle.option_true
if self.UnchainedKeys != UnchainedKeys.default and \
self.unchained_keys == UnchainedKeys.default:
self.unchained_keys.value = self.UnchainedKeys.value
self.has_replaced_options.value = Toggle.option_true
if self.PresentAccessWithWheelAndSpindle != PresentAccessWithWheelAndSpindle.default and \
self.back_to_the_future == PresentAccessWithWheelAndSpindle.default:
self.back_to_the_future.value = self.PresentAccessWithWheelAndSpindle.value
self.has_replaced_options.value = Toggle.option_true
if self.TrapChance != TrapChance.default and \
self.trap_chance == TrapChance.default:
self.trap_chance.value = self.TrapChance.value
self.has_replaced_options.value = Toggle.option_true
if self.Traps != Traps.default and \
self.traps == Traps.default:
self.traps.value = self.Traps.value
self.has_replaced_options.value = Toggle.option_true
if self.DeathLink != DeathLink.default and \
self.death_link == DeathLink.default:
self.death_link.value = self.DeathLink.value
self.has_replaced_options.value = Toggle.option_true

View File

@@ -1,6 +1,6 @@
from typing import Tuple, Dict, Union, List
from BaseClasses import MultiWorld
from .Options import timespinner_options, is_option_enabled, get_option_value
from random import Random
from .Options import TimespinnerOptions
class PreCalculatedWeights:
pyramid_keys_unlock: str
@@ -21,22 +21,22 @@ class PreCalculatedWeights:
flood_lake_serene_bridge: bool
flood_lab: bool
def __init__(self, world: MultiWorld, player: int):
if world and is_option_enabled(world, player, "RisingTides"):
weights_overrrides: Dict[str, Union[str, Dict[str, int]]] = self.get_flood_weights_overrides(world, player)
def __init__(self, options: TimespinnerOptions, random: Random):
if options.rising_tides:
weights_overrrides: Dict[str, Union[str, Dict[str, int]]] = self.get_flood_weights_overrides(options)
self.flood_basement, self.flood_basement_high = \
self.roll_flood_setting(world, player, weights_overrrides, "CastleBasement")
self.flood_xarion, _ = self.roll_flood_setting(world, player, weights_overrrides, "Xarion")
self.flood_maw, _ = self.roll_flood_setting(world, player, weights_overrrides, "Maw")
self.flood_pyramid_shaft, _ = self.roll_flood_setting(world, player, weights_overrrides, "AncientPyramidShaft")
self.flood_pyramid_back, _ = self.roll_flood_setting(world, player, weights_overrrides, "Sandman")
self.flood_moat, _ = self.roll_flood_setting(world, player, weights_overrrides, "CastleMoat")
self.flood_courtyard, _ = self.roll_flood_setting(world, player, weights_overrrides, "CastleCourtyard")
self.flood_lake_desolation, _ = self.roll_flood_setting(world, player, weights_overrrides, "LakeDesolation")
self.flood_lake_serene, _ = self.roll_flood_setting(world, player, weights_overrrides, "LakeSerene")
self.flood_lake_serene_bridge, _ = self.roll_flood_setting(world, player, weights_overrrides, "LakeSereneBridge")
self.flood_lab, _ = self.roll_flood_setting(world, player, weights_overrrides, "Lab")
self.roll_flood_setting(random, weights_overrrides, "CastleBasement")
self.flood_xarion, _ = self.roll_flood_setting(random, weights_overrrides, "Xarion")
self.flood_maw, _ = self.roll_flood_setting(random, weights_overrrides, "Maw")
self.flood_pyramid_shaft, _ = self.roll_flood_setting(random, weights_overrrides, "AncientPyramidShaft")
self.flood_pyramid_back, _ = self.roll_flood_setting(random, weights_overrrides, "Sandman")
self.flood_moat, _ = self.roll_flood_setting(random, weights_overrrides, "CastleMoat")
self.flood_courtyard, _ = self.roll_flood_setting(random, weights_overrrides, "CastleCourtyard")
self.flood_lake_desolation, _ = self.roll_flood_setting(random, weights_overrrides, "LakeDesolation")
self.flood_lake_serene, _ = self.roll_flood_setting(random, weights_overrrides, "LakeSerene")
self.flood_lake_serene_bridge, _ = self.roll_flood_setting(random, weights_overrrides, "LakeSereneBridge")
self.flood_lab, _ = self.roll_flood_setting(random, weights_overrrides, "Lab")
else:
self.flood_basement = False
self.flood_basement_high = False
@@ -52,10 +52,12 @@ class PreCalculatedWeights:
self.flood_lab = False
self.pyramid_keys_unlock, self.present_key_unlock, self.past_key_unlock, self.time_key_unlock = \
self.get_pyramid_keys_unlocks(world, player, self.flood_maw, self.flood_xarion)
self.get_pyramid_keys_unlocks(options, random, self.flood_maw, self.flood_xarion)
@staticmethod
def get_pyramid_keys_unlocks(world: MultiWorld, player: int, is_maw_flooded: bool, is_xarion_flooded: bool) -> Tuple[str, str, str, str]:
def get_pyramid_keys_unlocks(options: TimespinnerOptions, random: Random,
is_maw_flooded: bool, is_xarion_flooded: bool) -> Tuple[str, str, str, str]:
present_teleportation_gates: List[str] = [
"GateKittyBoss",
"GateLeftLibrary",
@@ -80,38 +82,30 @@ class PreCalculatedWeights:
"GateRightPyramid"
)
if not world:
return (
present_teleportation_gates[0],
present_teleportation_gates[0],
past_teleportation_gates[0],
ancient_pyramid_teleportation_gates[0]
)
if not is_maw_flooded:
past_teleportation_gates.append("GateMaw")
if not is_xarion_flooded:
present_teleportation_gates.append("GateXarion")
if is_option_enabled(world, player, "Inverted"):
if options.inverted:
all_gates: Tuple[str, ...] = present_teleportation_gates
else:
all_gates: Tuple[str, ...] = past_teleportation_gates + present_teleportation_gates
return (
world.random.choice(all_gates),
world.random.choice(present_teleportation_gates),
world.random.choice(past_teleportation_gates),
world.random.choice(ancient_pyramid_teleportation_gates)
random.choice(all_gates),
random.choice(present_teleportation_gates),
random.choice(past_teleportation_gates),
random.choice(ancient_pyramid_teleportation_gates)
)
@staticmethod
def get_flood_weights_overrides(world: MultiWorld, player: int) -> Dict[str, Union[str, Dict[str, int]]]:
def get_flood_weights_overrides(options: TimespinnerOptions) -> Dict[str, Union[str, Dict[str, int]]]:
weights_overrides_option: Union[int, Dict[str, Union[str, Dict[str, int]]]] = \
get_option_value(world, player, "RisingTidesOverrides")
options.rising_tides_overrides.value
default_weights: Dict[str, Dict[str, int]] = timespinner_options["RisingTidesOverrides"].default
default_weights: Dict[str, Dict[str, int]] = options.rising_tides_overrides.default
if not weights_overrides_option:
weights_overrides_option = default_weights
@@ -123,13 +117,13 @@ class PreCalculatedWeights:
return weights_overrides_option
@staticmethod
def roll_flood_setting(world: MultiWorld, player: int,
all_weights: Dict[str, Union[Dict[str, int], str]], key: str) -> Tuple[bool, bool]:
def roll_flood_setting(random: Random, all_weights: Dict[str, Union[Dict[str, int], str]],
key: str) -> Tuple[bool, bool]:
weights: Union[Dict[str, int], str] = all_weights[key]
if isinstance(weights, dict):
result: str = world.random.choices(list(weights.keys()), weights=list(map(int, weights.values())))[0]
result: str = random.choices(list(weights.keys()), weights=list(map(int, weights.values())))[0]
else:
result: str = weights

View File

@@ -1,14 +1,16 @@
from typing import List, Set, Dict, Optional, Callable
from BaseClasses import CollectionState, MultiWorld, Region, Entrance, Location
from .Options import is_option_enabled
from .Options import TimespinnerOptions
from .Locations import LocationData, get_location_datas
from .PreCalculatedWeights import PreCalculatedWeights
from .LogicExtensions import TimespinnerLogic
def create_regions_and_locations(world: MultiWorld, player: int, precalculated_weights: PreCalculatedWeights):
def create_regions_and_locations(world: MultiWorld, player: int, options: TimespinnerOptions,
precalculated_weights: PreCalculatedWeights):
locations_per_region: Dict[str, List[LocationData]] = split_location_datas_per_region(
get_location_datas(world, player, precalculated_weights))
get_location_datas(player, options, precalculated_weights))
regions = [
create_region(world, player, locations_per_region, 'Menu'),
@@ -53,7 +55,7 @@ def create_regions_and_locations(world: MultiWorld, player: int, precalculated_w
create_region(world, player, locations_per_region, 'Space time continuum')
]
if is_option_enabled(world, player, "GyreArchives"):
if options.gyre_archives:
regions.extend([
create_region(world, player, locations_per_region, 'Ravenlord\'s Lair'),
create_region(world, player, locations_per_region, 'Ifrit\'s Lair'),
@@ -64,10 +66,10 @@ def create_regions_and_locations(world: MultiWorld, player: int, precalculated_w
world.regions += regions
connectStartingRegion(world, player)
connectStartingRegion(world, player, options)
flooded: PreCalculatedWeights = precalculated_weights
logic = TimespinnerLogic(world, player, precalculated_weights)
logic = TimespinnerLogic(player, options, precalculated_weights)
connect(world, player, 'Lake desolation', 'Lower lake desolation', lambda state: flooded.flood_lake_desolation or logic.has_timestop(state) or state.has('Talaria Attachment', player))
connect(world, player, 'Lake desolation', 'Upper lake desolation', lambda state: logic.has_fire(state) and state.can_reach('Upper Lake Serene', 'Region', player), "Upper Lake Serene")
@@ -123,7 +125,7 @@ def create_regions_and_locations(world: MultiWorld, player: int, precalculated_w
connect(world, player, 'Sealed Caves (Xarion)', 'Skeleton Shaft')
connect(world, player, 'Sealed Caves (Xarion)', 'Space time continuum', logic.has_teleport)
connect(world, player, 'Refugee Camp', 'Forest')
connect(world, player, 'Refugee Camp', 'Library', lambda state: is_option_enabled(world, player, "Inverted") and is_option_enabled(world, player, "PresentAccessWithWheelAndSpindle") and state.has_all({'Timespinner Wheel', 'Timespinner Spindle'}, player))
connect(world, player, 'Refugee Camp', 'Library', lambda state: options.inverted and options.back_to_the_future and state.has_all({'Timespinner Wheel', 'Timespinner Spindle'}, player))
connect(world, player, 'Refugee Camp', 'Space time continuum', logic.has_teleport)
connect(world, player, 'Forest', 'Refugee Camp')
connect(world, player, 'Forest', 'Left Side forest Caves', lambda state: flooded.flood_lake_serene_bridge or state.has('Talaria Attachment', player) or logic.has_timestop(state))
@@ -178,11 +180,11 @@ def create_regions_and_locations(world: MultiWorld, player: int, precalculated_w
connect(world, player, 'Space time continuum', 'Royal towers (lower)', lambda state: logic.can_teleport_to(state, "Past", "GateRoyalTowers"))
connect(world, player, 'Space time continuum', 'Caves of Banishment (Maw)', lambda state: logic.can_teleport_to(state, "Past", "GateMaw"))
connect(world, player, 'Space time continuum', 'Caves of Banishment (upper)', lambda state: logic.can_teleport_to(state, "Past", "GateCavesOfBanishment"))
connect(world, player, 'Space time continuum', 'Ancient Pyramid (entrance)', lambda state: logic.can_teleport_to(state, "Time", "GateGyre") or (not is_option_enabled(world, player, "UnchainedKeys") and is_option_enabled(world, player, "EnterSandman")))
connect(world, player, 'Space time continuum', 'Ancient Pyramid (entrance)', lambda state: logic.can_teleport_to(state, "Time", "GateGyre") or (not options.unchained_keys and options.enter_sandman))
connect(world, player, 'Space time continuum', 'Ancient Pyramid (left)', lambda state: logic.can_teleport_to(state, "Time", "GateLeftPyramid"))
connect(world, player, 'Space time continuum', 'Ancient Pyramid (right)', lambda state: logic.can_teleport_to(state, "Time", "GateRightPyramid"))
if is_option_enabled(world, player, "GyreArchives"):
if options.gyre_archives:
connect(world, player, 'The lab (upper)', 'Ravenlord\'s Lair', lambda state: state.has('Merchant Crow', player))
connect(world, player, 'Ravenlord\'s Lair', 'The lab (upper)')
connect(world, player, 'Library top', 'Ifrit\'s Lair', lambda state: state.has('Kobo', player) and state.can_reach('Refugee Camp', 'Region', player), "Refugee Camp")
@@ -220,12 +222,12 @@ def create_region(world: MultiWorld, player: int, locations_per_region: Dict[str
return region
def connectStartingRegion(world: MultiWorld, player: int):
def connectStartingRegion(world: MultiWorld, player: int, options: TimespinnerOptions):
menu = world.get_region('Menu', player)
tutorial = world.get_region('Tutorial', player)
space_time_continuum = world.get_region('Space time continuum', player)
if is_option_enabled(world, player, "Inverted"):
if options.inverted:
starting_region = world.get_region('Refugee Camp', player)
else:
starting_region = world.get_region('Lake desolation', player)

View File

@@ -1,12 +1,13 @@
from typing import Dict, List, Set, Tuple, TextIO, Union
from BaseClasses import Item, MultiWorld, Tutorial, ItemClassification
from typing import Dict, List, Set, Tuple, TextIO
from BaseClasses import Item, Tutorial, ItemClassification
from .Items import get_item_names_per_category
from .Items import item_table, starter_melee_weapons, starter_spells, filler_items, starter_progression_items
from .Locations import get_location_datas, EventId
from .Options import is_option_enabled, get_option_value, timespinner_options
from .Options import BackwardsCompatiableTimespinnerOptions, Toggle
from .PreCalculatedWeights import PreCalculatedWeights
from .Regions import create_regions_and_locations
from worlds.AutoWorld import World, WebWorld
import logging
class TimespinnerWebWorld(WebWorld):
theme = "ice"
@@ -35,32 +36,34 @@ class TimespinnerWorld(World):
Timespinner is a beautiful metroidvania inspired by classic 90s action-platformers.
Travel back in time to change fate itself. Join timekeeper Lunais on her quest for revenge against the empire that killed her family.
"""
option_definitions = timespinner_options
options_dataclass = BackwardsCompatiableTimespinnerOptions
options: BackwardsCompatiableTimespinnerOptions
game = "Timespinner"
topology_present = True
web = TimespinnerWebWorld()
required_client_version = (0, 4, 2)
item_name_to_id = {name: data.code for name, data in item_table.items()}
location_name_to_id = {location.name: location.code for location in get_location_datas(None, None, None)}
location_name_to_id = {location.name: location.code for location in get_location_datas(-1, None, None)}
item_name_groups = get_item_names_per_category()
precalculated_weights: PreCalculatedWeights
def generate_early(self) -> None:
self.precalculated_weights = PreCalculatedWeights(self.multiworld, self.player)
self.options.handle_backward_compatibility()
self.precalculated_weights = PreCalculatedWeights(self.options, self.random)
# in generate_early the start_inventory isnt copied over to precollected_items yet, so we can still modify the options directly
if self.multiworld.start_inventory[self.player].value.pop('Meyef', 0) > 0:
self.multiworld.StartWithMeyef[self.player].value = self.multiworld.StartWithMeyef[self.player].option_true
if self.multiworld.start_inventory[self.player].value.pop('Talaria Attachment', 0) > 0:
self.multiworld.QuickSeed[self.player].value = self.multiworld.QuickSeed[self.player].option_true
if self.multiworld.start_inventory[self.player].value.pop('Jewelry Box', 0) > 0:
self.multiworld.StartWithJewelryBox[self.player].value = self.multiworld.StartWithJewelryBox[self.player].option_true
if self.options.start_inventory.value.pop('Meyef', 0) > 0:
self.options.start_with_meyef.value = Toggle.option_true
if self.options.start_inventory.value.pop('Talaria Attachment', 0) > 0:
self.options.quick_seed.value = Toggle.option_true
if self.options.start_inventory.value.pop('Jewelry Box', 0) > 0:
self.options.start_with_jewelry_box.value = Toggle.option_true
def create_regions(self) -> None:
create_regions_and_locations(self.multiworld, self.player, self.precalculated_weights)
create_regions_and_locations(self.multiworld, self.player, self.options, self.precalculated_weights)
def create_items(self) -> None:
self.create_and_assign_event_items()
@@ -74,7 +77,7 @@ class TimespinnerWorld(World):
def set_rules(self) -> None:
final_boss: str
if self.is_option_enabled("DadPercent"):
if self.options.dad_percent:
final_boss = "Killed Emperor"
else:
final_boss = "Killed Nightmare"
@@ -82,48 +85,74 @@ class TimespinnerWorld(World):
self.multiworld.completion_condition[self.player] = lambda state: state.has(final_boss, self.player)
def fill_slot_data(self) -> Dict[str, object]:
slot_data: Dict[str, object] = {}
ap_specific_settings: Set[str] = {"RisingTidesOverrides", "TrapChance"}
for option_name in timespinner_options:
if (option_name not in ap_specific_settings):
slot_data[option_name] = self.get_option_value(option_name)
slot_data["StinkyMaw"] = True
slot_data["ProgressiveVerticalMovement"] = False
slot_data["ProgressiveKeycards"] = False
slot_data["PersonalItems"] = self.get_personal_items()
slot_data["PyramidKeysGate"] = self.precalculated_weights.pyramid_keys_unlock
slot_data["PresentGate"] = self.precalculated_weights.present_key_unlock
slot_data["PastGate"] = self.precalculated_weights.past_key_unlock
slot_data["TimeGate"] = self.precalculated_weights.time_key_unlock
slot_data["Basement"] = int(self.precalculated_weights.flood_basement) + \
int(self.precalculated_weights.flood_basement_high)
slot_data["Xarion"] = self.precalculated_weights.flood_xarion
slot_data["Maw"] = self.precalculated_weights.flood_maw
slot_data["PyramidShaft"] = self.precalculated_weights.flood_pyramid_shaft
slot_data["BackPyramid"] = self.precalculated_weights.flood_pyramid_back
slot_data["CastleMoat"] = self.precalculated_weights.flood_moat
slot_data["CastleCourtyard"] = self.precalculated_weights.flood_courtyard
slot_data["LakeDesolation"] = self.precalculated_weights.flood_lake_desolation
slot_data["DryLakeSerene"] = not self.precalculated_weights.flood_lake_serene
slot_data["LakeSereneBridge"] = self.precalculated_weights.flood_lake_serene_bridge
slot_data["Lab"] = self.precalculated_weights.flood_lab
return slot_data
return {
# options
"StartWithJewelryBox": self.options.start_with_jewelry_box.value,
"DownloadableItems": self.options.downloadable_items.value,
"EyeSpy": self.options.eye_spy.value,
"StartWithMeyef": self.options.start_with_meyef.value,
"QuickSeed": self.options.quick_seed.value,
"SpecificKeycards": self.options.specific_keycards.value,
"Inverted": self.options.inverted.value,
"GyreArchives": self.options.gyre_archives.value,
"Cantoran": self.options.cantoran.value,
"LoreChecks": self.options.lore_checks.value,
"BossRando": self.options.boss_rando.value,
"DamageRando": self.options.damage_rando.value,
"DamageRandoOverrides": self.options.damage_rando_overrides.value,
"HpCap": self.options.hp_cap.value,
"LevelCap": self.options.level_cap.value,
"ExtraEarringsXP": self.options.extra_earrings_xp.value,
"BossHealing": self.options.boss_healing.value,
"ShopFill": self.options.shop_fill.value,
"ShopWarpShards": self.options.shop_warp_shards.value,
"ShopMultiplier": self.options.shop_multiplier.value,
"LootPool": self.options.loot_pool.value,
"DropRateCategory": self.options.drop_rate_category.value,
"FixedDropRate": self.options.fixed_drop_rate.value,
"LootTierDistro": self.options.loot_tier_distro.value,
"ShowBestiary": self.options.show_bestiary.value,
"ShowDrops": self.options.show_drops.value,
"EnterSandman": self.options.enter_sandman.value,
"DadPercent": self.options.dad_percent.value,
"RisingTides": self.options.rising_tides.value,
"UnchainedKeys": self.options.unchained_keys.value,
"PresentAccessWithWheelAndSpindle": self.options.back_to_the_future.value,
"Traps": self.options.traps.value,
"DeathLink": self.options.death_link.value,
"StinkyMaw": True,
# data
"PersonalItems": self.get_personal_items(),
"PyramidKeysGate": self.precalculated_weights.pyramid_keys_unlock,
"PresentGate": self.precalculated_weights.present_key_unlock,
"PastGate": self.precalculated_weights.past_key_unlock,
"TimeGate": self.precalculated_weights.time_key_unlock,
# rising tides
"Basement": int(self.precalculated_weights.flood_basement) + \
int(self.precalculated_weights.flood_basement_high),
"Xarion": self.precalculated_weights.flood_xarion,
"Maw": self.precalculated_weights.flood_maw,
"PyramidShaft": self.precalculated_weights.flood_pyramid_shaft,
"BackPyramid": self.precalculated_weights.flood_pyramid_back,
"CastleMoat": self.precalculated_weights.flood_moat,
"CastleCourtyard": self.precalculated_weights.flood_courtyard,
"LakeDesolation": self.precalculated_weights.flood_lake_desolation,
"DryLakeSerene": not self.precalculated_weights.flood_lake_serene,
"LakeSereneBridge": self.precalculated_weights.flood_lake_serene_bridge,
"Lab": self.precalculated_weights.flood_lab
}
def write_spoiler_header(self, spoiler_handle: TextIO) -> None:
if self.is_option_enabled("UnchainedKeys"):
if self.options.unchained_keys:
spoiler_handle.write(f'Modern Warp Beacon unlock: {self.precalculated_weights.present_key_unlock}\n')
spoiler_handle.write(f'Timeworn Warp Beacon unlock: {self.precalculated_weights.past_key_unlock}\n')
if self.is_option_enabled("EnterSandman"):
if self.options.enter_sandman:
spoiler_handle.write(f'Mysterious Warp Beacon unlock: {self.precalculated_weights.time_key_unlock}\n')
else:
spoiler_handle.write(f'Twin Pyramid Keys unlock: {self.precalculated_weights.pyramid_keys_unlock}\n')
if self.is_option_enabled("RisingTides"):
if self.options.rising_tides:
flooded_areas: List[str] = []
if self.precalculated_weights.flood_basement:
@@ -159,6 +188,15 @@ class TimespinnerWorld(World):
spoiler_handle.write(f'Flooded Areas: {flooded_areas_string}\n')
if self.options.has_replaced_options:
warning = \
f"NOTICE: Timespinner options for player '{self.player_name}' where renamed from PasCalCase to snake_case, " \
"please update your yaml"
spoiler_handle.write("\n")
spoiler_handle.write(warning)
logging.warning(warning)
def create_item(self, name: str) -> Item:
data = item_table[name]
@@ -176,41 +214,41 @@ class TimespinnerWorld(World):
if not item.advancement:
return item
if (name == 'Tablet' or name == 'Library Keycard V') and not self.is_option_enabled("DownloadableItems"):
if (name == 'Tablet' or name == 'Library Keycard V') and not self.options.downloadable_items:
item.classification = ItemClassification.filler
elif name == 'Oculus Ring' and not self.is_option_enabled("EyeSpy"):
elif name == 'Oculus Ring' and not self.options.eye_spy:
item.classification = ItemClassification.filler
elif (name == 'Kobo' or name == 'Merchant Crow') and not self.is_option_enabled("GyreArchives"):
elif (name == 'Kobo' or name == 'Merchant Crow') and not self.options.gyre_archives:
item.classification = ItemClassification.filler
elif name in {"Timeworn Warp Beacon", "Modern Warp Beacon", "Mysterious Warp Beacon"} \
and not self.is_option_enabled("UnchainedKeys"):
and not self.options.unchained_keys:
item.classification = ItemClassification.filler
return item
def get_filler_item_name(self) -> str:
trap_chance: int = self.get_option_value("TrapChance")
enabled_traps: List[str] = self.get_option_value("Traps")
trap_chance: int = self.options.trap_chance.value
enabled_traps: List[str] = self.options.traps.value
if self.multiworld.random.random() < (trap_chance / 100) and enabled_traps:
return self.multiworld.random.choice(enabled_traps)
if self.random.random() < (trap_chance / 100) and enabled_traps:
return self.random.choice(enabled_traps)
else:
return self.multiworld.random.choice(filler_items)
return self.random.choice(filler_items)
def get_excluded_items(self) -> Set[str]:
excluded_items: Set[str] = set()
if self.is_option_enabled("StartWithJewelryBox"):
if self.options.start_with_jewelry_box:
excluded_items.add('Jewelry Box')
if self.is_option_enabled("StartWithMeyef"):
if self.options.start_with_meyef:
excluded_items.add('Meyef')
if self.is_option_enabled("QuickSeed"):
if self.options.quick_seed:
excluded_items.add('Talaria Attachment')
if self.is_option_enabled("UnchainedKeys"):
if self.options.unchained_keys:
excluded_items.add('Twin Pyramid Key')
if not self.is_option_enabled("EnterSandman"):
if not self.options.enter_sandman:
excluded_items.add('Mysterious Warp Beacon')
else:
excluded_items.add('Timeworn Warp Beacon')
@@ -224,8 +262,8 @@ class TimespinnerWorld(World):
return excluded_items
def assign_starter_items(self, excluded_items: Set[str]) -> None:
non_local_items: Set[str] = self.multiworld.non_local_items[self.player].value
local_items: Set[str] = self.multiworld.local_items[self.player].value
non_local_items: Set[str] = self.options.non_local_items.value
local_items: Set[str] = self.options.local_items.value
local_starter_melee_weapons = tuple(item for item in starter_melee_weapons if
item in local_items or not item in non_local_items)
@@ -247,27 +285,26 @@ class TimespinnerWorld(World):
self.assign_starter_item(excluded_items, 'Tutorial: Yo Momma 2', local_starter_spells)
def assign_starter_item(self, excluded_items: Set[str], location: str, item_list: Tuple[str, ...]) -> None:
item_name = self.multiworld.random.choice(item_list)
item_name = self.random.choice(item_list)
self.place_locked_item(excluded_items, location, item_name)
def place_first_progression_item(self, excluded_items: Set[str]) -> None:
if self.is_option_enabled("QuickSeed") or self.is_option_enabled("Inverted") \
or self.precalculated_weights.flood_lake_desolation:
if self.options.quick_seed or self.options.inverted or self.precalculated_weights.flood_lake_desolation:
return
for item in self.multiworld.precollected_items[self.player]:
if item.name in starter_progression_items and not item.name in excluded_items:
for item_name in self.options.start_inventory.value.keys():
if item_name in starter_progression_items:
return
local_starter_progression_items = tuple(
item for item in starter_progression_items
if item not in excluded_items and item not in self.multiworld.non_local_items[self.player].value)
if item not in excluded_items and item not in self.options.non_local_items.value)
if not local_starter_progression_items:
return
progression_item = self.multiworld.random.choice(local_starter_progression_items)
progression_item = self.random.choice(local_starter_progression_items)
self.multiworld.local_early_items[self.player][progression_item] = 1
@@ -307,9 +344,3 @@ class TimespinnerWorld(World):
personal_items[location.address] = location.item.code
return personal_items
def is_option_enabled(self, option: str) -> bool:
return is_option_enabled(self.multiworld, self.player, option)
def get_option_value(self, option: str) -> Union[int, Dict, List]:
return get_option_value(self.multiworld, self.player, option)

View File

@@ -121,7 +121,7 @@ class TunicWorld(World):
cls.seed_groups[group] = SeedGroup(logic_rules=tunic.options.logic_rules.value,
laurels_at_10_fairies=tunic.options.laurels_location == 3,
fixed_shop=bool(tunic.options.fixed_shop),
plando=multiworld.plando_connections[tunic.player])
plando=tunic.options.plando_connections)
continue
# lower value is more restrictive
@@ -134,9 +134,9 @@ class TunicWorld(World):
if tunic.options.fixed_shop:
cls.seed_groups[group]["fixed_shop"] = True
if multiworld.plando_connections[tunic.player]:
if tunic.options.plando_connections:
# loop through the connections in the player's yaml
for cxn in multiworld.plando_connections[tunic.player]:
for cxn in tunic.options.plando_connections:
new_cxn = True
for group_cxn in cls.seed_groups[group]["plando"]:
# if neither entrance nor exit match anything in the group, add to group