Compare commits

..

108 Commits

Author SHA1 Message Date
NewSoupVi
b350521893 Update docs/apworld_dev_faq.md
Co-authored-by: qwint <qwint.42@gmail.com>
2024-09-05 22:21:51 +02:00
NewSoupVi
a2ba2f3dbf Update docs/apworld_dev_faq.md
Co-authored-by: qwint <qwint.42@gmail.com>
2024-09-05 21:30:30 +02:00
NewSoupVi
ce8d254912 Update apworld_dev_faq.md 2024-09-05 21:23:33 +02:00
NewSoupVi
153f454fb8 Update docs/apworld_dev_faq.md
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-09-05 21:22:36 +02:00
NewSoupVi
df1f3dc730 Update docs/apworld_dev_faq.md
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-09-05 21:21:24 +02:00
NewSoupVi
8cefe85630 Update docs/apworld_dev_faq.md
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-09-05 21:20:51 +02:00
NewSoupVi
a1779c1924 Update apworld_dev_faq.md 2024-09-05 21:20:35 +02:00
NewSoupVi
663b5a28a5 Update docs/apworld_dev_faq.md
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-09-05 21:20:10 +02:00
NewSoupVi
cf3d4ff837 Update apworld_dev_faq.md 2024-09-05 19:04:07 +02:00
NewSoupVi
1d8d04ea03 Update docs/apworld_dev_faq.md
Co-authored-by: qwint <qwint.42@gmail.com>
2024-09-05 18:56:33 +02:00
NewSoupVi
49394bebda Update docs/apworld_dev_faq.md
Co-authored-by: qwint <qwint.42@gmail.com>
2024-09-05 18:55:58 +02:00
NewSoupVi
9ec1f8de6e Update docs/apworld_dev_faq.md
Co-authored-by: Scipio Wright <scipiowright@gmail.com>
2024-08-13 18:19:21 +02:00
NewSoupVi
e74e472e3f Update docs/apworld_dev_faq.md
Co-authored-by: Scipio Wright <scipiowright@gmail.com>
2024-08-13 18:18:55 +02:00
NewSoupVi
850033b311 Update docs/apworld_dev_faq.md
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-07-31 22:34:10 +02:00
NewSoupVi
3a70bf9f4f Update docs/apworld_dev_faq.md
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-07-31 22:33:57 +02:00
NewSoupVi
205fa71cc7 Update docs/apworld_dev_faq.md
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-07-31 22:33:50 +02:00
NewSoupVi
8420c72ec4 Update docs/apworld_dev_faq.md
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-07-31 22:33:44 +02:00
NewSoupVi
f9b07a5b9a Update docs/apworld_dev_faq.md
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2024-07-31 22:33:36 +02:00
NewSoupVi
295e719ef3 Actually copy in the text 2024-07-31 19:34:37 +02:00
NewSoupVi
db5be6a411 Docs: Dev FAQ - About indirect conditions
I wrote up a big effortpost about indirect conditions for nex on the [DS3 3.0 PR](https://github.com/ArchipelagoMW/Archipelago/pull/3128#discussion_r1693843193).

The version I'm [PRing to the world API document](https://github.com/ArchipelagoMW/Archipelago/pull/3552) is very brief and unnuanced, because I'd rather people use too many indirect conditions than too few.
But that might leave some devs wanting to know more.

I think that comment on nex's DS3 PR is probably the best detailed explanation for indirect conditions that exists currently.

So I think it's good if it exists somewhere. And the FAQ doc seems like the best place right now, because I don't want to write an entirely new doc at the moment.
2024-07-27 08:18:00 +02:00
Exempt-Medic
6994f863e5 Core: Make excluded locations and priority locations excluded and remove unreachable code (#3424)
* Make excluded and priority locations excluded

* Only pass on KeyError

* Alternative/Clearer format
2024-07-26 17:51:55 +02:00
Jérémie Bolduc
9d36ad0df2 Stardew Valley: Properly support Universal Tracker (#3630)
* save the seed in slot data to reuse it in UT

* add logging when seed is missing

* add UT test and fix bundle test

* self review

* run UT test on allsanity+mod so it's more meaningfull
2024-07-26 11:33:14 +02:00
Star Rauchenberger
cc22161644 Lingo: Add panels mode door shuffle (#3163)
* Created panels mode door shuffle

* Added some panel door item names

* Remove RUNT TURN panel door

Not really useful.

* Fix logic with First SIX related stuff

* Add group_doors to slot data

* Fix LEVEL 2 behavior with panels mode

* Fixed unit tests

* Fixed duplicate IDs from merge

* Just regenerated new IDs

* Fixed duplication of color and door group items

* Removed unnecessary unit test option

* Fix The Seeker being achievable without entrance door

* Fix The Observant being achievable without locked panels

* Added some more panel doors

* Added Progressive Suits Area

* Lingo: Fix Basement access with THE MASTER

* Added indirect conditions for MASTER-blocked entrances

* Fixed Incomparable achievement access

* Fix STAIRS panel logic

* Fix merge error with good items

* Is this clearer?

* DREAD and TURN LEARN

* Allow a weird edge case for reduced locations

Panels mode door shuffle + grouped doors + color shuffle + pilgrimage enabled is exactly the right number of items for reduced locations. Removing color shuffle also allows for disabling pilgrimage, adding sunwarp locking, or both, with a couple of locations left over.

* Prevent small sphere one on panels mode

* Added shuffle_doors aliases for old options

* Fixed a unit test

* Updated datafile

* Tweaked requirements for reduced locations

* Added player name to OptionError messages

* Update generated.dat
2024-07-26 10:53:11 +02:00
Star Rauchenberger
d030a698a6 Lingo: Changed minimum progression requirement (#3672) 2024-07-25 23:09:37 +02:00
Exempt-Medic
b6e5223aa2 Docs: Expanding on the answers in the FAQ (#3690)
* Expand on some existing answers

* Oops

* Sphere "one"

* Removing while

* Update docs/apworld_dev_faq.md

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

---------

Co-authored-by: Scipio Wright <scipiowright@gmail.com>
2024-07-25 23:02:25 +02:00
qwint
79843803cf Docs: Add header to FAQ doc referencing other relevant docs (#3692)
* Add header to FAQ doc referencing other relevant docs

* Update docs/apworld_dev_faq.md

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

* Update docs/apworld_dev_faq.md

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

---------

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
Co-authored-by: Scipio Wright <scipiowright@gmail.com>
2024-07-25 23:01:22 +02:00
Tsukino
5fb1ebdcfd Docs: Add Swedish Guide for Pokemon Emerald (#3252)
* Docs: Add Swedish Guide for Pokemon Emerald

Swedish Translation

* v2

some proof reading & clarification changes

* v3

* v4

* v5

typo

* v6

* Update worlds/pokemon_emerald/docs/setup_sv.md

Co-authored-by: Bryce Wilson <gyroscope15@gmail.com>

* Update worlds/pokemon_emerald/docs/setup_sv.md

Co-authored-by: Bryce Wilson <gyroscope15@gmail.com>

* v7

Tried to reduce the length of lines, this should still convey the same message/meaning

* typo

* v8

Removed Leading/Trailing Spaces

* typo v2

* Added a couple of full stops.

* lowercase typos

* Update setup_sv.md

* Apply suggestions from code review

Co-authored-by: Bryce Wilson <gyroscope15@gmail.com>

---------

Co-authored-by: Bryce Wilson <gyroscope15@gmail.com>
Co-authored-by: bittersweetrin <chandraherbozo@gmail.com>
2024-07-25 09:30:23 +02:00
CookieCat
b019485944 AHIT: Update Setup Guide (#3647) 2024-07-25 09:27:22 +02:00
Witchybun
205ca7fa37 Stardew Valley: Fix Daggerfish, Cropsanity; Move Some Rules to Content Packs; Add Missing Shipsanity Location (#3626)
* Fix logic bug on daggerfish

* Make new region for pond.

* Fix SVE logic for crops

* Fix Distant Lands Cropsanity

* Fix failing tests.

* Reverting removing these for now.

* Fix bugs, add combat requirement

* convert str into tuple directly

* add ginger island to mod tests

* Move a lot of mod item logic to content pack

* Gut the rules from DL while we're at it.

* Import nuke

* Fix alecto

* Move back some rules for now.

* Move archaeology rules

* Add some comments why its done.

* Clean up archaeology and fix sve

* Moved dulse to water item class

* Remove digging like worms for now

* fix

* Add missing shipsanity location

* Move background names around or something idk

* Revert ArchaeologyTrash for now

---------

Co-authored-by: Jouramie <jouramie@hotmail.com>
2024-07-25 09:22:46 +02:00
black-sliver
8949e21565 settings: safer writing (#3644)
* settings: clean up imports

* settings: try to use atomic rename

* settings: flush, sync and validate new yaml

before replacing the old one

* settings: add test for Settings.save
2024-07-25 09:10:36 +02:00
qwint
deae524e9b Docs: add a living faq document for sharing dev solutions (#3156)
* adding one faq :)

* adding another faq that links to the relevant file

* add lined line breaks between questions and lower the heading size of the question so sub-divisions can be added later

* missed some newlines

* updating best practice filler method

* add note about get_filler_item_name()

* updates to wording from review

* add section to CODEOWNERS for maintainers of this doc

* use underscores to reference the file easier in CODEOWNERS

* update link to be direct and filter to function name
2024-07-25 09:05:04 +02:00
qwint
496f0e09af CommonClient: forget password when disconnecting (#3641)
* makes the kivy connect button do the same username forgetting that /connect does to fix an issue where losing connection would make you unable to connect to a different server

* extract duplicate code

* per request, adds handling on any disconnect to forget the saved password as to not leak it to other servers

---------

Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
2024-07-25 08:21:51 +02:00
agilbert1412
f34da74012 Stardew Valley: Make Fairy Dust a Ginger Island only item and location (#3650) 2024-07-25 06:13:16 +02:00
Alchav
94e6e978f3 Pokémon R/B: Also fix Rt 4 Hidden Item (#3668)
Co-authored-by: alchav <alchav@jalchavware.com>
2024-07-25 06:07:20 +02:00
Silent
697f749518 TUNIC: Missing slot data bugfix (#3628)
* Fix certain items not being added to slot data

* Change where items get added to slot data
2024-07-25 06:06:45 +02:00
qwint
2307694012 HK: fix remove issues failing collect/remove test (#3667) 2024-07-25 03:08:58 +02:00
Exempt-Medic
b23c120258 Subnautica: Fix deprecated option getting (#3685) 2024-07-24 22:17:43 +02:00
Silent
ea1bb8d927 TUNIC: Missing slot data bugfix (#3628)
* Fix certain items not being added to slot data

* Change where items get added to slot data
2024-07-24 14:37:18 +02:00
Star Rauchenberger
e714d2e129 Lingo: Add option to prevent shuffling postgame (#3350)
* Lingo: Add option to prevent shuffling postgame

* Allow roof access on door shuffle

* Fix broken unit test

* Simplified THE END edge case

* Revert unnecessary change

* Review comments

* Fix mastery unit test

* Update generated.dat

* Added player's name to error message
2024-07-24 14:34:51 +02:00
JKLeckr
878d5141ce Project: Add .code-workspace wildcard to gitignore 2024-07-24 14:08:16 +02:00
Ladybunne
1852287c91 LADX: Add an item group for instruments (#3666)
* Add an item group for LADX instruments

* Update worlds/ladx/__init__.py

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

* Fix indent depth

---------

Co-authored-by: Scipio Wright <scipiowright@gmail.com>
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
2024-07-24 14:07:07 +02:00
t3hf1gm3nt
8756f48e46 [TLOZ]: Fix determinism / Add Location Name Groups / Remove Level 9 Junk Fill (#3670)
* [TLOZ]: Fix determinism / Add Location Name Groups / Remove Level 9 Junk Fill

Axing the final uses of world.multiworld.random that were missed before, hopefully fixing the determinism issue brought up in Issue #3664 (at least on TLOZ's end, leaving SMZ3 alone). Also adding location name groups finally, as well as axing the Level 9 Junk Fill because with the new location name groups players can choose to exclude Level 9 with exclude locations instead.

* location name groups

* add take any item and sword cave location name groups

* use sets like you're supposed to, silly
2024-07-24 14:00:16 +02:00
agilbert1412
ff680b26cc DLC Quest: Add options presets to DLC Quest (#3676)
* - Add options presets to DLC Quest

* - Removed unused import

---------

Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
2024-07-24 13:49:28 +02:00
JaredWeakStrike
29a0b013cb KH2: Hotfix update for game verison 1.0.0.9 (#3534)
* update the addresses hopefully

* todo

* update address for steam and epic

* oops

* leftover hard address

* made auto tracking say which version of the game

* not needed anymore since they were updated
2024-07-24 13:47:19 +02:00
Alchav
e7dbfa7fcd FFMQ: Efficiency Improvement and Use New Options Methods (#2767)
* FFMQ Efficiency improvement and use new options methods

* Hard check for 0x01 game status

* Fixes

* Why were Mac's Ship entrance hints excluded?

* Two remaining per_slot_randoms purged

* reformat generate_early

* Utils.parse_yaml
2024-07-24 13:46:14 +02:00
agilbert1412
ad5089b5a3 DLC Quest - Add option groups to DLC Quest (#3677)
* - Add option groups to DLC Quest

* - Slight reorganisation

* - Add type hint
2024-07-24 13:36:41 +02:00
NewSoupVi
dc50444edd The Witness: Small naming inconsistencies (#3618) 2024-07-24 13:13:41 +02:00
Silent
ed4ad386e8 TUNIC: Add setting to disable local spoiler to host yaml (#3661)
* Add TunicSettings class for host yaml options

* Update __init__.py

* Update worlds/tunic/__init__.py

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

* Use self.settings

* Remove unused import

---------

Co-authored-by: Scipio Wright <scipiowright@gmail.com>
2024-07-23 09:04:24 +02:00
Star Rauchenberger
5188375736 Lingo: Add pilgrimage logic through Starting Room (#3654)
* Lingo: Add pilgrimage logic through Starting Room

* Added unit test

* Reverse order of two doors in unit test

* Remove print statements from TestPilgrimage

* Update generated.dat
2024-07-23 08:34:47 +02:00
Star Rauchenberger
9c2933f803 Lingo: Fix Early Color Hallways painting in pilgrimages (#3645) 2024-07-23 00:45:49 +02:00
Scipio Wright
b840c3fe1a TUNIC: Move 3 locations to Quarry Back (#3649)
* Move 3 locations to Quarry Back

* Change the non-er region too
2024-07-23 00:43:41 +02:00
agilbert1412
c12d3dd6ad Stardew valley: Fix Queen of Sauce Cookbook conditions (#3651)
* - Extracted walnut logic to a Mixin so it can be used in content pack requirements

* - Add 100 walnut requirements to the Queen of Sauce Cookbook

* - Woops a file wasn't added to previous commits

* - Make the queen of sauce cookbook a ginger island only thing, due to the walnut requirement

* - Moved the book in the correct content pack

* - Removed an empty class that I'm not sure where it came from
2024-07-23 00:36:42 +02:00
Trevor L
f7989780fa Bomb Rush Cyberfunk: Fix final graffiti location being unobtainable (#3669) 2024-07-22 09:17:34 +02:00
agilbert1412
e59bec36ec Stardew Valley: Add gourmand frog rules for completing his tasks sequentially (#3652) 2024-07-22 08:32:40 +02:00
agilbert1412
48a0fb05a2 Stardew Valley: Removed Stardrop Tea from Full Shipment (#3655) 2024-07-22 01:52:44 +02:00
chandler05
12f1ef873c A Short Hike: Fix Boat Rental purchase being incorrectly calculated (#3639) 2024-07-22 01:47:46 +02:00
Rensen3
d7d4565429 YGO06: fixes non-deterministic bug by changing sets to lists (#3674) 2024-07-22 01:27:10 +02:00
qwint
7039b17bf6 CommonClient: fix bug when using Connect button without a disconnect (#3609)
* makes the kivy connect button do the same username forgetting that /connect does to fix an issue where losing connection would make you unable to connect to a different server

* extract duplicate code
2024-07-22 01:12:11 +02:00
Jérémie Bolduc
34e7748f23 Stardew Valley: Make sure number of month in time logic is a int to improve performance by ~20% (#3665)
* make sure number of month is actually a int

* improve rule explain like in pr

* remove redundant if in can_complete_bundle

* assert number is int so cache is not bloated
2024-07-20 21:24:24 +02:00
gurglemurgle5
e33a9991ef CommonClient: Escape markup sent in chat messages (#3659)
* escape markup in uncolored text

* Fix comment to allign with style guide

Fixes the comment so it follows the style guide, along with making it
better explain the code.

* Make more concise
2024-07-19 08:37:59 +02:00
black-sliver
4d1507cd0e Core: Update cx_freeze to 7.2.0 and freeze it (#3648)
supersedes ArchipelagoMW/Archipelago#3405
2024-07-18 00:49:59 +02:00
Fabian Dill
7b39b23f73 Subnautica: increase minimum client version (#3657) 2024-07-17 22:33:51 +02:00
Sunny Bat
925e02dca7 Raft: Move to new Options API (#3587) 2024-07-15 15:09:02 +02:00
CookieCat
e76d32e908 AHIT: Fix act shuffle test fail (#3522) 2024-07-14 14:17:05 +02:00
dennisw100
08a36ec223 Undertale: Fixed output location of the patched game in UndertaleClient.py (#3418)
* Update UndertaleClient.py Fixed output location of the patched game

Fixed the error that when the client is opened outside of the archipelago folder, the patched folder would be created in there which on windows ends up trying to create it in the system32 folder

Bug Report: https://discord.com/channels/731205301247803413/1148330675452264499/1237412436382973962

* Undertale: removed unnecessary wrapping in UndertaleClient.py

I did not know os.path.join was unnecessary in this case the more you know.
2024-07-14 14:11:52 +02:00
Bryce Wilson
48dc14421e Pokemon Emerald: Fix logic for coin case location (#3631) 2024-07-14 14:05:50 +02:00
black-sliver
948f50f35d customserver: fix minor memory leak (#3636)
Old code keeps ref to last started room's task and thus never fully cleans it up.
2024-07-14 13:56:56 +02:00
black-sliver
187f9dac94 customserver: preemtively run GC before starting room (#3637)
GC seems to be lazy.
2024-07-14 13:56:27 +02:00
Scipio Wright
eaec41d885 TUNIC: Fix event region for Quarry fuse (#3635) 2024-07-11 22:44:29 +02:00
Doug Hoskisson
1e3a4b6db5 Zillion: more rooms added to map_gen option (#3634) 2024-07-10 23:11:47 -07:00
Alchav
8c86139066 ALTTP: Bombable Wall to Crystaroller Room Logic (#3627) 2024-07-10 17:15:29 +02:00
black-sliver
c96c554dfa Tests, WebHost: add tests for host_room and minor cleanup (#3619)
* Tests, WebHost: move out setUp and fix typing in api_generate

Also fixes a typo
and changes client to be per-test rather than a ClassVar

* Tests, WebHost: add tests for display_log endpoint

* Tests, WebHost: add tests for host_room endpoint

* Tests, WebHost: enable Flask DEBUG mode for tests

This provides the actual error if a test raised an exception on the server.

* Tests, WebHost: use user_path for logs

This is what custom_server does now.

* Tests, WebHost: avoid triggering security scans
2024-07-07 16:51:10 +02:00
agilbert1412
9b22458f44 Stardew Valley 6.x.x: The Content Update (#3478)
Focus of the Update: Compatibility with Stardew Valley 1.6 Released on March 19th 2024
This includes randomization for pretty much all of the new content, including but not limited to
- Raccoon Bundles
- Booksanity
- Skill Masteries
- New Recipes, Craftables, Fish, Maps, Farm Type, Festivals and Quests

This also includes a significant reorganisation of the code into "Content Packs", to allow for easier modularity of various game mechanics between the settings and the supported mods. This improves maintainability quite a bit.

In addition to that, a few **very** requested new features have been introduced, although they weren't the focus of this update
- Walnutsanity
- Player Buffs
- More customizability in settings, such as shorter special orders, ER without farmhouse
- New Remixed Bundles
2024-07-07 15:04:25 +02:00
NewSoupVi
f99ee77325 The Witness: Add some unit tests (#3328)
* Add hidden early symbol item option, make some unit tests

* Add early symbol item false to the arrows test

* I guess it's not an issue

* more tests

* assertEqual

* cleanup

* add minimum symbols test for all 3 modes

* Formatting

* Add more minimal beatability tests

* one more for the road

* I HATE THIS AAAAAAAAAAAHHHHHHHHHHH WHY DID WE GO WITH OPTIONS

* loiaqeäsdhgalikSDGHjasDÖKHGASKLDÖGHJASKLJGHJSAÖkfaöslifjasöfASGJÖASDLFGJ'sklgösLGIKsdhJLGÖsdfjälghklDASFJghjladshfgjasdfälkjghasdöLfghasd-kjgjASDLÖGHAESKDLJGJÖsdaLGJHsadöKGjFDSLAkgjölSÄDghbASDFKGjasdLJGhjLÖSDGHLJASKDkgjldafjghjÖLADSFghäasdökgjäsadjlgkjsadkLHGsaDÖLGSADGÖLwSdlgkJLwDSFÄLHBJsaöfdkHweaFGIoeWjvlkdösmVJÄlsafdJKhvjdsJHFGLsdaövhWDsköLV-ksdFJHGVöSEKD

* fix imports (within apworld needs to be relative)

* Update worlds/witness/options.py

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

* Sure

* good suggestion

* subtest

* Add some EP shuffle unit tests, also an explicit event-checking unit test

* add more tests yay

* oops

* mypy

* Update worlds/witness/options.py

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

* Collapse into one test :(

* More efficiency

* line length

* More collapsing

* Cleanup and docstrings

---------

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
2024-07-06 13:40:55 +02:00
jamesbrq
bfac100567 MLSS: Fix for missing cutscene trigger 2024-07-05 22:54:35 +02:00
Scipio Wright
e7a8e195e6 TUNIC: Use fewer parameters in helper functions (#3356)
* Clean these functions up, get the hell out of here 5 parameter function

* Clean up a bunch of rules that no longer need to be multi-lined since the functions are shorter

* Clean up some range functions

* Update to use world instead of player like Vi recommended

* Fix merge conflict

* Fix after merge
2024-07-05 22:50:12 +02:00
Louis M
4054a9f15f Aquaria: Renaming some locations for consistency (#3533)
* Change 'The Body main area' by 'The Body center area' for consistency

* Renaming some locations for consistency

* Adding a line for standard

* Replacing Cathedral by Mithalas Cathedral and addin Blind goal option

* Client option renaming for consistency

* Fix death link not working

* Removing death link from the option to put it client side

* Changing Left to Right
2024-07-05 22:40:26 +02:00
Phaneros
ca76628813 sc2: Fixing typo in itemgroups.py causing spurious item groups with 2 letters chopped off (#3612) 2024-07-05 22:37:32 +02:00
Scipio Wright
d4d0a3e945 TUNIC: Make the shop checks require a sword 2024-07-05 22:36:55 +02:00
Scipio Wright
315e0c89e2 Docs: Lastest -> Latest (#3616) 2024-07-03 18:13:16 +02:00
Remy Jette
f6735745b6 Core: Fix !remaining (#3611) 2024-07-03 15:39:08 +02:00
Doug Hoskisson
50f7a79ea7 Zillion: new map generation feature (#3604) 2024-07-02 19:32:01 -07:00
NewSoupVi
95110c4787 The Witness: Fix door shuffle being completely broken 2024-07-03 00:34:17 +02:00
NewSoupVi
93617fa546 The Witness: mypy compliance (#3112)
* Make witness apworld mostly pass mypy

* Fix all remaining mypy errors except the core ones

* I'm a goofy stupid poopoo head

* Two more fixes

* ruff after merge

* Mypy for new stuff

* Oops

* Stricter ruff rules (that I already comply with :3)

* Deprecated ruff thing

* wait no i lied

* lol super nevermind

* I can actually be slightly more specific

* lint
2024-07-02 23:59:26 +02:00
black-sliver
b6925c593e WebHost: Log: handle FileNotFoundError (#3603) 2024-07-02 01:03:55 +02:00
Emily
401606e8e3 Docs: Clarify docs for create_items stage (#3600)
* Clarify docs re: `create_items` stage

* adjust wording after feedback

* adjust wording after more feedback
2024-07-01 23:34:06 +02:00
black-sliver
e95bb5ea56 WebHost: Better host room (#3496)
* add Range= to log, making responses a lot smaller for massive rooms
* switch xhr to fetch
* post the form using fetch if possible
  * also refresh log faster while waiting for command echo / response
  * do not follow redirect, saving a request
  * do not post empty body
* smooth-scroll the log view
* paste the log into the div when loading the HTML (up to 1MB, rest will be `fetch`ed)
* fix duplicate charset in display_log response
2024-07-01 21:47:49 +02:00
Silvris
52a13d38e9 Tests: fix error reporting in test_default_all_state_can_reach_everything (#3601) 2024-07-01 20:47:40 +02:00
Scipio Wright
31bd5e3ebc OOT: Add keys item_name_group (#3218)
* Add keys item_name_group

* Pep8ify

* Capitalizing Keys cause Bottles is capitalized, also putting it in the clearly marked hint groups area
2024-06-30 01:19:36 +02:00
Sunny Bat
192f1b3fae Update Raft option text, setup guide text (#3272)
* Update Raft option text, setup guide

* Address comments

* Address PR comments

---------

Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
2024-06-30 01:18:09 +02:00
Silent
55cb81d487 TUNIC: Update victory condition (#3579)
* Add hero relics to victory condition

* Update __init__.py

* Remove unneeded local variables for options

* Use has_group_unique

* fix spacing
2024-06-30 01:17:00 +02:00
Justus Lind
2424fb0c5b Muse Dash: 6th Anniversary Song update (#3593)
* 6th Anniversary Update songs.

* Forgot to fix the name of Heartbeat.
2024-06-30 01:15:13 +02:00
Mrks
6191ff4b47 LADX: Fixed Display Names In Options Page (#3584)
* Fixed option group display names.

* Fixed display names for -at the moment- unused options.
2024-06-30 01:14:39 +02:00
Justus Lind
1c817e1eb7 Muse Dash: Update installation guides to recommend installing v0.6.1. (#3594)
* Update installation guides to recommend installing v0.6.1.

* Fix spanish spacing.

* Apply spanish changes.
2024-06-30 01:13:00 +02:00
Fabian Dill
d4c00ed267 CommonClient: fix /received with items from Server (#3597) 2024-06-29 03:00:32 +02:00
Ziktofel
e07a2667ae SC2 Tracker: Migrate icons away from sc2legacy (#3595) 2024-06-27 14:02:03 +02:00
Scipio Wright
b8f78af506 TUNIC: Fix minor logic bug in upper Zig (#3576)
* Add note about bushes to logic section of readme

* Fix missing logic on bridge switch chest in upper zig

* Revise upper zig rule change to account for ER
2024-06-27 14:01:35 +02:00
Scipio Wright
77304a8743 TUNIC: Update game info page with more tips (#3591)
* More minor updates to game info page

* Fix grammar
2024-06-27 13:00:20 +02:00
black-sliver
5882ce7380 Various worlds: Fix more absolute world imports (#3510)
* Adventure: remove absolute imports

* Alttp: remove absolute imports (all but tests)

* Aquaria: remove absolute imports in tests

running tests from apworld may fail (on 3.8 and maybe in the future) otherwise

* DKC3: remove absolute imports

* LADX: remove absolute imports

* Overcooked 2: remove absolute imports in tests

running tests from apworld may fail otherwise

* Rogue Legacy: remove absolute imports in tests

running tests from apworld may fail otherwise

* SC2: remove absolute imports

* SMW: remove absolute imports

* Subnautica: remove absolute imports in tests

running tests from apworld may fail otherwise

* Zillion: remove absolute imports in tests

running tests from apworld may fail otherwise
2024-06-27 08:51:27 +02:00
PinkSwitch
6c54b3596b Yoshi's Island: Fix client giving victory randomly (#3586)
* Create d

* Create d

* Delete worlds/mariomissing/d

* Delete mariomissing directory

* Create d

* Add files via upload

* Delete worlds/mariomissing/d

* Delete worlds/mariomissing directory

* Add files via upload

* Delete worlds/sai2 directory

* fix dumb client bug
2024-06-26 13:19:16 +02:00
Alchav
07dd8f0671 LTTP: Add Missing Blind's Cell rule (#3589) 2024-06-25 20:15:51 +02:00
Remy Jette
935c94dc80 Installer: Fix .apworld registration (#3588) 2024-06-25 20:15:12 +02:00
Fabian Dill
1ab1aeff15 Core: update required_server_version to 0.5.0 (#3580) 2024-06-23 07:50:00 +02:00
Silvris
5ca31533dc Tests: give seed on default tests and fix execnet error (#3520)
* output seed of default tests

* test execnet fix

* try failing with interpolated string

* Update bases.py

* try without tryexcept

* Update bases.py

* Update bases.py

* remove fake exception

* fix indent

* actually fix the execnet issue

---------

Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
2024-06-22 21:00:15 +02:00
Mrks
60a26920e1 LADX: Probably fix generation error that palex had 2024-06-22 19:32:10 +02:00
StripesOO7
d00abe7b8e OOT: Adds Options to slot_data for poptracker-pack (#3570)
* Add imo all needed options to fill_slot_data that are worth tracking in the poptracker pack. This is aimed at providing information for the oot poptracker-pack for autofilling of settings within this pack.

* cap line length at 120 and reorganize list

---------

Co-authored-by: StripesOO7 <54711792+StripeesOO7@users.noreply.github.com>
2024-06-22 13:50:20 +02:00
Mewlif
40c9dfd3bf Undertale: Fixes a major logic bug, and updates Undertale to use the new Options API (#3528)
* Updated the options definitions to the new api

* Fixed the wrong base class being used for UndertaleOptions

* Undertale: Added get_filler_item_name to Undertale, changed multiworld.per_slot_randoms to self.random, removed some unused imports in options.py, and fixed rules.py still using state.multiworld instead of world.options, and simplified the set_completion_rules function in rules.py

* Undertale: Fixed it trying to add strings to the finished item pool

* fixed 1000g item not being in the key items pool for Undertale

* Removed ".copy()" for the junk_weights, reformatted the requested lines to have less new lines, and changed "itempool += [self.create_filler()]" to "itempool.append(self.create_filler())"
2024-06-21 18:21:46 +02:00
Fabian Dill
ce37bed7c6 WebHost: fix accidental robots.txt capture (#3502) 2024-06-21 14:54:19 +02:00
387 changed files with 15046 additions and 12760 deletions

2
.gitignore vendored
View File

@@ -150,7 +150,7 @@ venv/
ENV/
env.bak/
venv.bak/
.code-workspace
*.code-workspace
shell.nix
# Spyder project settings

View File

@@ -190,7 +190,6 @@ class MultiWorld():
self.worlds[new_id] = world_type.create_group(self, new_id, players)
self.worlds[new_id].collect_item = classmethod(AutoWorld.World.collect_item).__get__(self.worlds[new_id])
self.player_name[new_id] = name
self.precollected_items[new_id] = []
new_group = self.groups[new_id] = Group(name=name, game=game, players=players,
world=self.worlds[new_id])

View File

@@ -23,7 +23,7 @@ if __name__ == "__main__":
from MultiServer import CommandProcessor
from NetUtils import (Endpoint, decode, NetworkItem, encode, JSONtoTextParser, ClientStatus, Permission, NetworkSlot,
RawJSONtoTextParser, add_json_text, add_json_location, add_json_item, JSONTypes)
RawJSONtoTextParser, add_json_text, add_json_location, add_json_item, JSONTypes, SlotType)
from Utils import Version, stream_input, async_start
from worlds import network_data_package, AutoWorldRegister
import os
@@ -61,6 +61,7 @@ class ClientCommandProcessor(CommandProcessor):
if address:
self.ctx.server_address = None
self.ctx.username = None
self.ctx.password = None
elif not self.ctx.server_address:
self.output("Please specify an address.")
return False
@@ -514,6 +515,7 @@ class CommonContext:
async def shutdown(self):
self.server_address = ""
self.username = None
self.password = None
self.cancel_autoreconnect()
if self.server and not self.server.socket.closed:
await self.server.socket.close()
@@ -862,7 +864,8 @@ async def process_server_cmd(ctx: CommonContext, args: dict):
ctx.team = args["team"]
ctx.slot = args["slot"]
# int keys get lost in JSON transfer
ctx.slot_info = {int(pid): data for pid, data in args["slot_info"].items()}
ctx.slot_info = {0: NetworkSlot("Archipelago", "Archipelago", SlotType.player)}
ctx.slot_info.update({int(pid): data for pid, data in args["slot_info"].items()})
ctx.hint_points = args.get("hint_points", 0)
ctx.consume_players_package(args["players"])
ctx.stored_data_notification_keys.add(f"_read_hints_{ctx.team}_{ctx.slot}")

30
Main.py
View File

@@ -124,14 +124,19 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No
for player in multiworld.player_ids:
exclusion_rules(multiworld, player, multiworld.worlds[player].options.exclude_locations.value)
multiworld.worlds[player].options.priority_locations.value -= multiworld.worlds[player].options.exclude_locations.value
world_excluded_locations = set()
for location_name in multiworld.worlds[player].options.priority_locations.value:
try:
location = multiworld.get_location(location_name, player)
except KeyError as e: # failed to find the given location. Check if it's a legitimate location
if location_name not in multiworld.worlds[player].location_name_to_id:
raise Exception(f"Unable to prioritize location {location_name} in player {player}'s world.") from e
else:
except KeyError:
continue
if location.progress_type != LocationProgressType.EXCLUDED:
location.progress_type = LocationProgressType.PRIORITY
else:
logger.warning(f"Unable to prioritize location \"{location_name}\" in player {player}'s world because the world excluded it.")
world_excluded_locations.add(location_name)
multiworld.worlds[player].options.priority_locations.value -= world_excluded_locations
# Set local and non-local item rules.
if multiworld.players > 1:
@@ -327,21 +332,8 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No
games[slot] = multiworld.game[slot]
slot_info[slot] = NetUtils.NetworkSlot(group["name"], multiworld.game[slot], multiworld.player_types[slot],
group_members=sorted(group["players"]))
precollected_items = {player: [] for player in multiworld.player_ids}
for player, world_precollected in multiworld.precollected_items.items():
if not world_precollected:
continue
if player in multiworld.groups:
targets = multiworld.groups[player]["players"]
else:
targets = [player]
current_list = [item.code for item in world_precollected if type(item.code) == int]
for target_player in targets:
precollected_items[target_player].extend(current_list)
precollected_items = {player: [item.code for item in world_precollected if type(item.code) == int]
for player, world_precollected in multiworld.precollected_items.items()}
precollected_hints = {player: set() for player in range(1, multiworld.players + 1 + len(multiworld.groups))}
for slot in multiworld.player_ids:

View File

@@ -1352,7 +1352,7 @@ class ClientMessageProcessor(CommonCommandProcessor):
if self.ctx.remaining_mode == "enabled":
remaining_item_ids = get_remaining(self.ctx, self.client.team, self.client.slot)
if remaining_item_ids:
self.output("Remaining items: " + ", ".join(self.ctx.item_names[self.client.slot.game][item_id]
self.output("Remaining items: " + ", ".join(self.ctx.item_names[self.ctx.games[self.client.slot]][item_id]
for item_id in remaining_item_ids))
else:
self.output("No remaining items found.")
@@ -1365,7 +1365,7 @@ class ClientMessageProcessor(CommonCommandProcessor):
if self.ctx.client_game_state[self.client.team, self.client.slot] == ClientStatus.CLIENT_GOAL:
remaining_item_ids = get_remaining(self.ctx, self.client.team, self.client.slot)
if remaining_item_ids:
self.output("Remaining items: " + ", ".join(self.ctx.item_names[self.client.slot.game][item_id]
self.output("Remaining items: " + ", ".join(self.ctx.item_names[self.ctx.games[self.client.slot]][item_id]
for item_id in remaining_item_ids))
else:
self.output("No remaining items found.")

View File

@@ -29,7 +29,7 @@ class UndertaleCommandProcessor(ClientCommandProcessor):
def _cmd_patch(self):
"""Patch the game. Only use this command if /auto_patch fails."""
if isinstance(self.ctx, UndertaleContext):
os.makedirs(name=os.path.join(os.getcwd(), "Undertale"), exist_ok=True)
os.makedirs(name=Utils.user_path("Undertale"), exist_ok=True)
self.ctx.patch_game()
self.output("Patched.")
@@ -43,7 +43,7 @@ class UndertaleCommandProcessor(ClientCommandProcessor):
def _cmd_auto_patch(self, steaminstall: typing.Optional[str] = None):
"""Patch the game automatically."""
if isinstance(self.ctx, UndertaleContext):
os.makedirs(name=os.path.join(os.getcwd(), "Undertale"), exist_ok=True)
os.makedirs(name=Utils.user_path("Undertale"), exist_ok=True)
tempInstall = steaminstall
if not os.path.isfile(os.path.join(tempInstall, "data.win")):
tempInstall = None
@@ -62,7 +62,7 @@ class UndertaleCommandProcessor(ClientCommandProcessor):
for file_name in os.listdir(tempInstall):
if file_name != "steam_api.dll":
shutil.copy(os.path.join(tempInstall, file_name),
os.path.join(os.getcwd(), "Undertale", file_name))
Utils.user_path("Undertale", file_name))
self.ctx.patch_game()
self.output("Patching successful!")
@@ -111,12 +111,12 @@ class UndertaleContext(CommonContext):
self.save_game_folder = os.path.expandvars(r"%localappdata%/UNDERTALE")
def patch_game(self):
with open(os.path.join(os.getcwd(), "Undertale", "data.win"), "rb") as f:
with open(Utils.user_path("Undertale", "data.win"), "rb") as f:
patchedFile = bsdiff4.patch(f.read(), undertale.data_path("patch.bsdiff"))
with open(os.path.join(os.getcwd(), "Undertale", "data.win"), "wb") as f:
with open(Utils.user_path("Undertale", "data.win"), "wb") as f:
f.write(patchedFile)
os.makedirs(name=os.path.join(os.getcwd(), "Undertale", "Custom Sprites"), exist_ok=True)
with open(os.path.expandvars(os.path.join(os.getcwd(), "Undertale", "Custom Sprites",
os.makedirs(name=Utils.user_path("Undertale", "Custom Sprites"), exist_ok=True)
with open(os.path.expandvars(Utils.user_path("Undertale", "Custom Sprites",
"Which Character.txt")), "w") as f:
f.writelines(["// Put the folder name of the sprites you want to play as, make sure it is the only "
"line other than this one.\n", "frisk"])

View File

@@ -325,10 +325,12 @@ def run_server_process(name: str, ponyconfig: dict, static_server_data: dict,
def run(self):
while 1:
next_room = rooms_to_run.get(block=True, timeout=None)
gc.collect(0)
task = asyncio.run_coroutine_threadsafe(start_room(next_room), loop)
self._tasks.append(task)
task.add_done_callback(self._done)
logging.info(f"Starting room {next_room} on {name}.")
del task # delete reference to task object
starter = Starter()
starter.daemon = True

View File

@@ -1,6 +1,6 @@
import datetime
import os
from typing import List, Dict, Union
from typing import Any, IO, Dict, Iterator, List, Tuple, Union
import jinja2.exceptions
from flask import request, redirect, url_for, render_template, Response, session, abort, send_from_directory
@@ -97,25 +97,37 @@ def new_room(seed: UUID):
return redirect(url_for("host_room", room=room.id))
def _read_log(path: str):
if os.path.exists(path):
with open(path, encoding="utf-8-sig") as log:
yield from log
else:
yield f"Logfile {path} does not exist. " \
f"Likely a crash during spinup of multiworld instance or it is still spinning up."
def _read_log(log: IO[Any], offset: int = 0) -> Iterator[bytes]:
marker = log.read(3) # skip optional BOM
if marker != b'\xEF\xBB\xBF':
log.seek(0, os.SEEK_SET)
log.seek(offset, os.SEEK_CUR)
yield from log
log.close() # free file handle as soon as possible
@app.route('/log/<suuid:room>')
def display_log(room: UUID):
def display_log(room: UUID) -> Union[str, Response, Tuple[str, int]]:
room = Room.get(id=room)
if room is None:
return abort(404)
if room.owner == session["_id"]:
file_path = os.path.join("logs", str(room.id) + ".txt")
if os.path.exists(file_path):
return Response(_read_log(file_path), mimetype="text/plain;charset=UTF-8")
return "Log File does not exist."
try:
log = open(file_path, "rb")
range_header = request.headers.get("Range")
if range_header:
range_type, range_values = range_header.split('=')
start, end = map(str.strip, range_values.split('-', 1))
if range_type != "bytes" or end != "":
return "Unsupported range", 500
# NOTE: we skip Content-Range in the response here, which isn't great but works for our JS
return Response(_read_log(log, int(start)), mimetype="text/plain", status=206)
return Response(_read_log(log), mimetype="text/plain")
except FileNotFoundError:
return Response(f"Logfile {file_path} does not exist. "
f"Likely a crash during spinup of multiworld instance or it is still spinning up.",
mimetype="text/plain")
return "Access Denied", 403
@@ -139,7 +151,22 @@ def host_room(room: UUID):
with db_session:
room.last_activity = now # will trigger a spinup, if it's not already running
return render_template("hostRoom.html", room=room, should_refresh=should_refresh)
def get_log(max_size: int = 1024000) -> str:
try:
with open(os.path.join("logs", str(room.id) + ".txt"), "rb") as log:
raw_size = 0
fragments: List[str] = []
for block in _read_log(log):
if raw_size + len(block) > max_size:
fragments.append("")
break
raw_size += len(block)
fragments.append(block.decode("utf-8"))
return "".join(fragments)
except FileNotFoundError:
return ""
return render_template("hostRoom.html", room=room, should_refresh=should_refresh, get_log=get_log)
@app.route('/favicon.ico')

View File

@@ -8,7 +8,8 @@ from . import cache
def robots():
# If this host is not official, do not allow search engine crawling
if not app.config["ASSET_RIGHTS"]:
return app.send_static_file('robots.txt')
# filename changed in case the path is intercepted and served by an outside service
return app.send_static_file('robots_file.txt')
# Send 404 if the host has affirmed this to be the official WebHost
abort(404)

View File

@@ -44,7 +44,7 @@
{{ macros.list_patches_room(room) }}
{% if room.owner == session["_id"] %}
<div style="display: flex; align-items: center;">
<form method=post style="flex-grow: 1; margin-right: 1em;">
<form method="post" id="command-form" style="flex-grow: 1; margin-right: 1em;">
<div class="form-group">
<label for="cmd"></label>
<input class="form-control" type="text" id="cmd" name="cmd"
@@ -55,24 +55,89 @@
Open Log File...
</a>
</div>
<div id="logger"></div>
<script type="application/ecmascript">
let xmlhttp = new XMLHttpRequest();
let url = '{{ url_for('display_log', room = room.id) }}';
{% set log = get_log() -%}
{%- set log_len = log | length - 1 if log.endswith("…") else log | length -%}
<div id="logger" style="white-space: pre">{{ log }}</div>
<script>
let url = '{{ url_for('display_log', room = room.id) }}';
let bytesReceived = {{ log_len }};
let updateLogTimeout;
let awaitingCommandResponse = false;
let logger = document.getElementById("logger");
xmlhttp.onreadystatechange = function () {
if (this.readyState === 4 && this.status === 200) {
document.getElementById("logger").innerText = this.responseText;
}
};
function request_new() {
xmlhttp.open("GET", url, true);
xmlhttp.send();
function scrollToBottom(el) {
let bot = el.scrollHeight - el.clientHeight;
el.scrollTop += Math.ceil((bot - el.scrollTop)/10);
if (bot - el.scrollTop >= 1) {
window.clearTimeout(el.scrollTimer);
el.scrollTimer = window.setTimeout(() => {
scrollToBottom(el)
}, 16);
}
}
window.setTimeout(request_new, 1000);
window.setInterval(request_new, 10000);
async function updateLog() {
try {
let res = await fetch(url, {
headers: {
'Range': `bytes=${bytesReceived}-`,
}
});
if (res.ok) {
let text = await res.text();
if (text.length > 0) {
awaitingCommandResponse = false;
if (bytesReceived === 0 || res.status !== 206) {
logger.innerHTML = '';
}
if (res.status !== 206) {
bytesReceived = 0;
} else {
bytesReceived += new Blob([text]).size;
}
if (logger.innerHTML.endsWith('…')) {
logger.innerHTML = logger.innerHTML.substring(0, logger.innerHTML.length - 1);
}
logger.appendChild(document.createTextNode(text));
scrollToBottom(logger);
}
}
}
finally {
window.clearTimeout(updateLogTimeout);
updateLogTimeout = window.setTimeout(updateLog, awaitingCommandResponse ? 500 : 10000);
}
}
async function postForm(ev) {
/** @type {HTMLInputElement} */
let cmd = document.getElementById("cmd");
if (cmd.value === "") {
ev.preventDefault();
return;
}
/** @type {HTMLFormElement} */
let form = document.getElementById("command-form");
let req = fetch(form.action || window.location.href, {
method: form.method,
body: new FormData(form),
redirect: "manual",
});
ev.preventDefault(); // has to happen before first await
form.reset();
let res = await req;
if (res.ok || res.type === 'opaqueredirect') {
awaitingCommandResponse = true;
window.clearTimeout(updateLogTimeout);
updateLogTimeout = window.setTimeout(updateLog, 100);
} else {
window.alert(res.statusText);
}
}
document.getElementById("command-form").addEventListener("submit", postForm);
updateLogTimeout = window.setTimeout(updateLog, 1000);
logger.scrollTop = logger.scrollHeight;
</script>
{% endif %}
</div>

View File

@@ -1366,28 +1366,28 @@ if "Starcraft 2" in network_data_package["games"]:
organics_icon_base_url = "https://0rganics.org/archipelago/sc2wol/"
icons = {
"Starting Minerals": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/icons/icon-mineral-protoss.png",
"Starting Vespene": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/icons/icon-gas-terran.png",
"Starting Minerals": github_icon_base_url + "blizzard/icon-mineral-nobg.png",
"Starting Vespene": github_icon_base_url + "blizzard/icon-gas-terran-nobg.png",
"Starting Supply": github_icon_base_url + "blizzard/icon-supply-terran_nobg.png",
"Terran Infantry Weapons Level 1": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-infantryweaponslevel1.png",
"Terran Infantry Weapons Level 2": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-infantryweaponslevel2.png",
"Terran Infantry Weapons Level 3": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-infantryweaponslevel3.png",
"Terran Infantry Armor Level 1": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-infantryarmorlevel1.png",
"Terran Infantry Armor Level 2": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-infantryarmorlevel2.png",
"Terran Infantry Armor Level 3": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-infantryarmorlevel3.png",
"Terran Vehicle Weapons Level 1": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-vehicleweaponslevel1.png",
"Terran Vehicle Weapons Level 2": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-vehicleweaponslevel2.png",
"Terran Vehicle Weapons Level 3": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-vehicleweaponslevel3.png",
"Terran Vehicle Armor Level 1": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-vehicleplatinglevel1.png",
"Terran Vehicle Armor Level 2": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-vehicleplatinglevel2.png",
"Terran Vehicle Armor Level 3": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-vehicleplatinglevel3.png",
"Terran Ship Weapons Level 1": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-shipweaponslevel1.png",
"Terran Ship Weapons Level 2": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-shipweaponslevel2.png",
"Terran Ship Weapons Level 3": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-shipweaponslevel3.png",
"Terran Ship Armor Level 1": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-shipplatinglevel1.png",
"Terran Ship Armor Level 2": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-shipplatinglevel2.png",
"Terran Ship Armor Level 3": "https://sclegacy.com/images/uploaded/starcraftii_beta/gamefiles/upgrades/btn-upgrade-terran-shipplatinglevel3.png",
"Terran Infantry Weapons Level 1": github_icon_base_url + "blizzard/btn-upgrade-terran-infantryweaponslevel1.png",
"Terran Infantry Weapons Level 2": github_icon_base_url + "blizzard/btn-upgrade-terran-infantryweaponslevel2.png",
"Terran Infantry Weapons Level 3": github_icon_base_url + "blizzard/btn-upgrade-terran-infantryweaponslevel3.png",
"Terran Infantry Armor Level 1": github_icon_base_url + "blizzard/btn-upgrade-terran-infantryarmorlevel1.png",
"Terran Infantry Armor Level 2": github_icon_base_url + "blizzard/btn-upgrade-terran-infantryarmorlevel2.png",
"Terran Infantry Armor Level 3": github_icon_base_url + "blizzard/btn-upgrade-terran-infantryarmorlevel3.png",
"Terran Vehicle Weapons Level 1": github_icon_base_url + "blizzard/btn-upgrade-terran-vehicleweaponslevel1.png",
"Terran Vehicle Weapons Level 2": github_icon_base_url + "blizzard/btn-upgrade-terran-vehicleweaponslevel2.png",
"Terran Vehicle Weapons Level 3": github_icon_base_url + "blizzard/btn-upgrade-terran-vehicleweaponslevel3.png",
"Terran Vehicle Armor Level 1": github_icon_base_url + "blizzard/btn-upgrade-terran-vehicleplatinglevel1.png",
"Terran Vehicle Armor Level 2": github_icon_base_url + "blizzard/btn-upgrade-terran-vehicleplatinglevel2.png",
"Terran Vehicle Armor Level 3": github_icon_base_url + "blizzard/btn-upgrade-terran-vehicleplatinglevel3.png",
"Terran Ship Weapons Level 1": github_icon_base_url + "blizzard/btn-upgrade-terran-shipweaponslevel1.png",
"Terran Ship Weapons Level 2": github_icon_base_url + "blizzard/btn-upgrade-terran-shipweaponslevel2.png",
"Terran Ship Weapons Level 3": github_icon_base_url + "blizzard/btn-upgrade-terran-shipweaponslevel3.png",
"Terran Ship Armor Level 1": github_icon_base_url + "blizzard/btn-upgrade-terran-shipplatinglevel1.png",
"Terran Ship Armor Level 2": github_icon_base_url + "blizzard/btn-upgrade-terran-shipplatinglevel2.png",
"Terran Ship Armor Level 3": github_icon_base_url + "blizzard/btn-upgrade-terran-shipplatinglevel3.png",
"Bunker": "https://static.wikia.nocookie.net/starcraft/images/c/c5/Bunker_SC2_Icon1.jpg",
"Missile Turret": "https://static.wikia.nocookie.net/starcraft/images/5/5f/MissileTurret_SC2_Icon1.jpg",

View File

@@ -1,8 +1,8 @@
# Archipelago World Code Owners / Maintainers Document
#
# This file is used to notate the current "owners" or "maintainers" of any currently merged world folder. For any pull
# requests that modify these worlds, a code owner must approve the PR in addition to a core maintainer. This is not to
# be used for files/folders outside the /worlds folder, those will always need sign off from a core maintainer.
# This file is used to notate the current "owners" or "maintainers" of any currently merged world folder as well as
# certain documentation. For any pull requests that modify these worlds/docs, a code owner must approve the PR in
# addition to a core maintainer. All other files and folders are owned and maintained by core maintainers directly.
#
# All usernames must be GitHub usernames (and are case sensitive).
@@ -226,3 +226,11 @@
# Ori and the Blind Forest
# /worlds_disabled/oribf/
###################
## Documentation ##
###################
# Apworld Dev Faq
/docs/apworld_dev_faq.md @qwint @ScipioWright

68
docs/apworld_dev_faq.md Normal file
View File

@@ -0,0 +1,68 @@
# APWorld Dev FAQ
This document is meant as a reference tool to show solutions to common problems when developing an apworld.
It is not intended to answer every question about Archipelago and it assumes you have read the other docs,
including [Contributing](contributing.md), [Adding Games](<adding games.md>), and [World API](<world api.md>).
---
### My game has a restrictive start that leads to fill errors
Hint to the Generator that an item needs to be in sphere one with local_early_items. Here, `1` represents the number of "Sword" items to attempt to place in sphere one.
```py
early_item_name = "Sword"
self.multiworld.local_early_items[self.player][early_item_name] = 1
```
Some alternative ways to try to fix this problem are:
* Add more locations to sphere one of your world, potentially only when there would be a restrictive start
* Pre-place items yourself, such as during `create_items`
* Put items into the player's starting inventory using `push_precollected`
* Raise an exception, such as an `OptionError` during `generate_early`, to disallow options that would lead to a restrictive start
---
### I have multiple settings that change the item/location pool counts and need to balance them out
In an ideal situation your system for producing locations and items wouldn't leave any opportunity for them to be unbalanced. But in real, complex situations, that might be unfeasible.
If that's the case, you can create extra filler based on the difference between your unfilled locations and your itempool by comparing [get_unfilled_locations](https://github.com/ArchipelagoMW/Archipelago/blob/main/BaseClasses.py#:~:text=get_unfilled_locations) to your list of items to submit
Note: to use self.create_filler(), self.get_filler_item_name() should be defined to only return valid filler item names
```py
total_locations = len(self.multiworld.get_unfilled_locations(self.player))
item_pool = self.create_non_filler_items()
for _ in range(total_locations - len(item_pool)):
item_pool.append(self.create_filler())
self.multiworld.itempool += item_pool
```
A faster alternative to the `for` loop would be to use a [list comprehension](https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions):
```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

@@ -456,8 +456,9 @@ In addition, the following methods can be implemented and are called in this ord
called to place player's regions and their locations into the MultiWorld's regions list.
If it's hard to separate, this can be done during `generate_early` or `create_items` as well.
* `create_items(self)`
called to place player's items into the MultiWorld's itempool. After this step all regions
and items have to be in the MultiWorld's regions and itempool, and these lists should not be modified afterward.
called to place player's items into the MultiWorld's itempool. By the end of this step all regions, locations and
items have to be in the MultiWorld's regions and itempool. You cannot add or remove items, locations, or regions
after this step. Locations cannot be moved to different regions after this step.
* `set_rules(self)`
called to set access and item rules on locations and entrances.
* `generate_basic(self)`

View File

@@ -219,7 +219,7 @@ Root: HKCR; Subkey: "{#MyAppName}multidata\shell\open\command"; ValueData: """{
Root: HKCR; Subkey: ".apworld"; ValueData: "{#MyAppName}worlddata"; Flags: uninsdeletevalue; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}worlddata"; ValueData: "Archipelago World Data"; Flags: uninsdeletekey; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}worlddata\DefaultIcon"; ValueData: "{app}\ArchipelagoLauncher.exe,0"; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "{#MyAppName}worlddata\shell\open\command"; ValueData: """{app}\ArchipelagoLauncher.exe"" ""%1""";
Root: HKCR; Subkey: "{#MyAppName}worlddata\shell\open\command"; ValueData: """{app}\ArchipelagoLauncher.exe"" ""%1"""; ValueType: string; ValueName: "";
Root: HKCR; Subkey: "archipelago"; ValueType: "string"; ValueData: "Archipegalo Protocol"; Flags: uninsdeletekey;
Root: HKCR; Subkey: "archipelago"; ValueType: "string"; ValueName: "URL Protocol"; ValueData: "";

View File

@@ -595,8 +595,9 @@ class GameManager(App):
"!help for server commands.")
def connect_button_action(self, button):
self.ctx.username = None
self.ctx.password = None
if self.ctx.server:
self.ctx.username = None
async_start(self.ctx.disconnect())
else:
async_start(self.ctx.connect(self.server_connect_bar.text.replace("/connect ", "")))
@@ -836,6 +837,10 @@ class KivyJSONtoTextParser(JSONtoTextParser):
return self._handle_text(node)
def _handle_text(self, node: JSONMessagePart):
# All other text goes through _handle_color, and we don't want to escape markup twice,
# or mess up text that already has intentional markup applied to it
if node.get("type", "text") == "text":
node["text"] = escape_markup(node["text"])
for ref in node.get("refs", []):
node["text"] = f"[ref={self.ref_count}|{ref}]{node['text']}[/ref]"
self.ref_count += 1

View File

@@ -3,6 +3,7 @@ Application settings / host.yaml interface using type hints.
This is different from player options.
"""
import os
import os.path
import shutil
import sys
@@ -11,7 +12,6 @@ import warnings
from enum import IntEnum
from threading import Lock
from typing import cast, Any, BinaryIO, ClassVar, Dict, Iterator, List, Optional, TextIO, Tuple, Union, TypeVar
import os
__all__ = [
"get_settings", "fmt_doc", "no_gui",
@@ -798,6 +798,7 @@ class Settings(Group):
atexit.register(autosave)
def save(self, location: Optional[str] = None) -> None: # as above
from Utils import parse_yaml
location = location or self._filename
assert location, "No file specified"
temp_location = location + ".tmp" # not using tempfile to test expected file access
@@ -807,10 +808,18 @@ class Settings(Group):
# can't use utf-8-sig because it breaks backward compat: pyyaml on Windows with bytes does not strip the BOM
with open(temp_location, "w", encoding="utf-8") as f:
self.dump(f)
# replace old with new
if os.path.exists(location):
f.flush()
if hasattr(os, "fsync"):
os.fsync(f.fileno())
# validate new file is valid yaml
with open(temp_location, encoding="utf-8") as f:
parse_yaml(f.read())
# replace old with new, try atomic operation first
try:
os.rename(temp_location, location)
except (OSError, FileExistsError):
os.unlink(location)
os.rename(temp_location, location)
os.rename(temp_location, location)
self._filename = location
def dump(self, f: TextIO, level: int = 0) -> None:
@@ -832,7 +841,6 @@ def get_settings() -> Settings:
with _lock: # make sure we only have one instance
res = getattr(get_settings, "_cache", None)
if not res:
import os
from Utils import user_path, local_path
filenames = ("options.yaml", "host.yaml")
locations: List[str] = []

View File

@@ -21,7 +21,7 @@ from pathlib import Path
# This is a bit jank. We need cx-Freeze to be able to run anything from this script, so install it
try:
requirement = 'cx-Freeze==7.0.0'
requirement = 'cx-Freeze==7.2.0'
import pkg_resources
try:
pkg_resources.require(requirement)

View File

@@ -292,12 +292,12 @@ class WorldTestBase(unittest.TestCase):
"""Ensure all state can reach everything and complete the game with the defined options"""
if not (self.run_default_tests and self.constructed):
return
with self.subTest("Game", game=self.game):
with self.subTest("Game", game=self.game, seed=self.multiworld.seed):
excluded = self.multiworld.worlds[self.player].options.exclude_locations.value
state = self.multiworld.get_all_state(False)
for location in self.multiworld.get_locations():
if location.name not in excluded:
with self.subTest("Location should be reached", location=location):
with self.subTest("Location should be reached", location=location.name):
reachable = location.can_reach(state)
self.assertTrue(reachable, f"{location.name} unreachable")
with self.subTest("Beatable"):
@@ -308,7 +308,7 @@ class WorldTestBase(unittest.TestCase):
"""Ensure empty state can reach at least one location with the defined options"""
if not (self.run_default_tests and self.constructed):
return
with self.subTest("Game", game=self.game):
with self.subTest("Game", game=self.game, seed=self.multiworld.seed):
state = CollectionState(self.multiworld)
locations = self.multiworld.get_reachable_locations(state, self.player)
self.assertGreater(len(locations), 0,

View File

@@ -1,11 +1,12 @@
import os
import os.path
import unittest
from io import StringIO
from tempfile import TemporaryFile
from tempfile import TemporaryDirectory, TemporaryFile
from typing import Any, Dict, List, cast
import Utils
from settings import Settings, Group
from settings import Group, Settings, ServerOptions
class TestIDs(unittest.TestCase):
@@ -80,3 +81,27 @@ class TestSettingsDumper(unittest.TestCase):
self.assertEqual(value_spaces[2], value_spaces[0]) # start of sub-list
self.assertGreater(value_spaces[3], value_spaces[0],
f"{value_lines[3]} should have more indentation than {value_lines[0]} in {lines}")
class TestSettingsSave(unittest.TestCase):
def test_save(self) -> None:
"""Test that saving and updating works"""
with TemporaryDirectory() as d:
filename = os.path.join(d, "host.yaml")
new_release_mode = ServerOptions.ReleaseMode("enabled")
# create default host.yaml
settings = Settings(None)
settings.save(filename)
self.assertTrue(os.path.exists(filename),
"Default settings could not be saved")
self.assertNotEqual(settings.server_options.release_mode, new_release_mode,
"Unexpected default release mode")
# update host.yaml
settings.server_options.release_mode = new_release_mode
settings.save(filename)
self.assertFalse(os.path.exists(filename + ".tmp"),
"Temp file was not removed during save")
# read back host.yaml
settings = Settings(filename)
self.assertEqual(settings.server_options.release_mode, new_release_mode,
"Settings were not overwritten")

View File

@@ -41,15 +41,15 @@ class TestBase(unittest.TestCase):
state = multiworld.get_all_state(False)
for location in multiworld.get_locations():
if location.name not in excluded:
with self.subTest("Location should be reached", location=location):
with self.subTest("Location should be reached", location=location.name):
self.assertTrue(location.can_reach(state), f"{location.name} unreachable")
for region in multiworld.get_regions():
if region.name in unreachable_regions:
with self.subTest("Region should be unreachable", region=region):
with self.subTest("Region should be unreachable", region=region.name):
self.assertFalse(region.can_reach(state))
else:
with self.subTest("Region should be reached", region=region):
with self.subTest("Region should be reached", region=region.name):
self.assertTrue(region.can_reach(state))
with self.subTest("Completion Condition"):

View File

@@ -0,0 +1,36 @@
import unittest
import typing
from uuid import uuid4
from flask import Flask
from flask.testing import FlaskClient
class TestBase(unittest.TestCase):
app: typing.ClassVar[Flask]
client: FlaskClient
@classmethod
def setUpClass(cls) -> None:
from WebHostLib import app as raw_app
from WebHost import get_app
raw_app.config["PONY"] = {
"provider": "sqlite",
"filename": ":memory:",
"create_db": True,
}
raw_app.config.update({
"TESTING": True,
"DEBUG": True,
})
try:
cls.app = get_app()
except AssertionError as e:
# since we only have 1 global app object, this might fail, but luckily all tests use the same config
if "register_blueprint" not in e.args[0]:
raise
cls.app = raw_app
def setUp(self) -> None:
self.client = self.app.test_client()

View File

@@ -1,31 +1,16 @@
import io
import unittest
import json
import yaml
from . import TestBase
class TestDocs(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None:
from WebHostLib import app as raw_app
from WebHost import get_app
raw_app.config["PONY"] = {
"provider": "sqlite",
"filename": ":memory:",
"create_db": True,
}
raw_app.config.update({
"TESTING": True,
})
app = get_app()
cls.client = app.test_client()
def test_correct_error_empty_request(self):
class TestAPIGenerate(TestBase):
def test_correct_error_empty_request(self) -> None:
response = self.client.post("/api/generate")
self.assertIn("No options found. Expected file attachment or json weights.", response.text)
def test_generation_queued_weights(self):
def test_generation_queued_weights(self) -> None:
options = {
"Tester1":
{
@@ -43,7 +28,7 @@ class TestDocs(unittest.TestCase):
self.assertTrue(json_data["text"].startswith("Generation of seed "))
self.assertTrue(json_data["text"].endswith(" started successfully."))
def test_generation_queued_file(self):
def test_generation_queued_file(self) -> None:
options = {
"game": "Archipelago",
"name": "Tester",

View File

@@ -0,0 +1,192 @@
import os
from uuid import UUID, uuid4, uuid5
from flask import url_for
from . import TestBase
class TestHostFakeRoom(TestBase):
room_id: UUID
log_filename: str
def setUp(self) -> None:
from pony.orm import db_session
from Utils import user_path
from WebHostLib.models import Room, Seed
super().setUp()
with self.client.session_transaction() as session:
session["_id"] = uuid4()
with db_session:
# create an empty seed and a room from it
seed = Seed(multidata=b"", owner=session["_id"])
room = Room(seed=seed, owner=session["_id"], tracker=uuid4())
self.room_id = room.id
self.log_filename = user_path("logs", f"{self.room_id}.txt")
def tearDown(self) -> None:
from pony.orm import db_session, select
from WebHostLib.models import Command, Room
with db_session:
for command in select(command for command in Command if command.room.id == self.room_id): # type: ignore
command.delete()
room: Room = Room.get(id=self.room_id)
room.seed.delete()
room.delete()
try:
os.unlink(self.log_filename)
except FileNotFoundError:
pass
def test_display_log_missing_full(self) -> None:
"""
Verify that we get a 200 response even if log is missing.
This is required to not get an error for fetch.
"""
with self.app.app_context(), self.app.test_request_context():
response = self.client.get(url_for("display_log", room=self.room_id))
self.assertEqual(response.status_code, 200)
def test_display_log_missing_range(self) -> None:
"""
Verify that we get a full response for missing log even if we asked for range.
This is required for the JS logic to differentiate between log update and log error message.
"""
with self.app.app_context(), self.app.test_request_context():
response = self.client.get(url_for("display_log", room=self.room_id), headers={
"Range": "bytes=100-"
})
self.assertEqual(response.status_code, 200)
def test_display_log_denied(self) -> None:
"""Verify that only the owner can see the log."""
other_client = self.app.test_client()
with self.app.app_context(), self.app.test_request_context():
response = other_client.get(url_for("display_log", room=self.room_id))
self.assertEqual(response.status_code, 403)
def test_display_log_missing_room(self) -> None:
"""Verify log for missing room gives an error as opposed to missing log for existing room."""
missing_room_id = uuid5(uuid4(), "") # rooms are always uuid4, so this can't exist
other_client = self.app.test_client()
with self.app.app_context(), self.app.test_request_context():
response = other_client.get(url_for("display_log", room=missing_room_id))
self.assertEqual(response.status_code, 404)
def test_display_log_full(self) -> None:
"""Verify full log response."""
with open(self.log_filename, "w", encoding="utf-8") as f:
text = "x" * 200
f.write(text)
with self.app.app_context(), self.app.test_request_context():
response = self.client.get(url_for("display_log", room=self.room_id))
self.assertEqual(response.status_code, 200)
self.assertEqual(response.get_data(True), text)
def test_display_log_range(self) -> None:
"""Verify that Range header in request gives a range in response."""
with open(self.log_filename, "w", encoding="utf-8") as f:
f.write(" " * 100)
text = "x" * 100
f.write(text)
with self.app.app_context(), self.app.test_request_context():
response = self.client.get(url_for("display_log", room=self.room_id), headers={
"Range": "bytes=100-"
})
self.assertEqual(response.status_code, 206)
self.assertEqual(response.get_data(True), text)
def test_display_log_range_bom(self) -> None:
"""Verify that a BOM in the log file is skipped for range."""
with open(self.log_filename, "w", encoding="utf-8-sig") as f:
f.write(" " * 100)
text = "x" * 100
f.write(text)
self.assertEqual(f.tell(), 203) # including BOM
with self.app.app_context(), self.app.test_request_context():
response = self.client.get(url_for("display_log", room=self.room_id), headers={
"Range": "bytes=100-"
})
self.assertEqual(response.status_code, 206)
self.assertEqual(response.get_data(True), text)
def test_host_room_missing(self) -> None:
"""Verify that missing room gives a 404 response."""
missing_room_id = uuid5(uuid4(), "") # rooms are always uuid4, so this can't exist
with self.app.app_context(), self.app.test_request_context():
response = self.client.get(url_for("host_room", room=missing_room_id))
self.assertEqual(response.status_code, 404)
def test_host_room_own(self) -> None:
"""Verify that own room gives the full output."""
with open(self.log_filename, "w", encoding="utf-8-sig") as f:
text = "* should be visible *"
f.write(text)
with self.app.app_context(), self.app.test_request_context():
response = self.client.get(url_for("host_room", room=self.room_id))
response_text = response.get_data(True)
self.assertEqual(response.status_code, 200)
self.assertIn("href=\"/seed/", response_text)
self.assertIn(text, response_text)
def test_host_room_other(self) -> None:
"""Verify that non-own room gives the reduced output."""
from pony.orm import db_session
from WebHostLib.models import Room
with db_session:
room: Room = Room.get(id=self.room_id)
room.last_port = 12345
with open(self.log_filename, "w", encoding="utf-8-sig") as f:
text = "* should not be visible *"
f.write(text)
other_client = self.app.test_client()
with self.app.app_context(), self.app.test_request_context():
response = other_client.get(url_for("host_room", room=self.room_id))
response_text = response.get_data(True)
self.assertEqual(response.status_code, 200)
self.assertNotIn("href=\"/seed/", response_text)
self.assertNotIn(text, response_text)
self.assertIn("/connect ", response_text)
self.assertIn(":12345", response_text)
def test_host_room_own_post(self) -> None:
"""Verify command from owner gets queued for the server and response is redirect."""
from pony.orm import db_session, select
from WebHostLib.models import Command
with self.app.app_context(), self.app.test_request_context():
response = self.client.post(url_for("host_room", room=self.room_id), data={
"cmd": "/help"
})
self.assertEqual(response.status_code, 302, response.text)\
with db_session:
commands = select(command for command in Command if command.room.id == self.room_id) # type: ignore
self.assertIn("/help", (command.commandtext for command in commands))
def test_host_room_other_post(self) -> None:
"""Verify command from non-owner does not get queued for the server."""
from pony.orm import db_session, select
from WebHostLib.models import Command
other_client = self.app.test_client()
with self.app.app_context(), self.app.test_request_context():
response = other_client.post(url_for("host_room", room=self.room_id), data={
"cmd": "/help"
})
self.assertLess(response.status_code, 500)
with db_session:
commands = select(command for command in Command if command.room.id == self.room_id) # type: ignore
self.assertNotIn("/help", (command.commandtext for command in commands))

View File

@@ -280,7 +280,7 @@ class World(metaclass=AutoWorldRegister):
future. Protocol level compatibility check moved to MultiServer.min_client_version.
"""
required_server_version: Tuple[int, int, int] = (0, 2, 4)
required_server_version: Tuple[int, int, int] = (0, 5, 0)
"""update this if the resulting multidata breaks forward-compatibility of the server"""
hint_blacklist: ClassVar[FrozenSet[str]] = frozenset()

View File

@@ -1,7 +1,5 @@
from worlds.adventure import location_table
from worlds.adventure.Options import BatLogic, DifficultySwitchB, DifficultySwitchA
from .Options import BatLogic, DifficultySwitchB
from worlds.generic.Rules import add_rule, set_rule, forbid_item
from BaseClasses import LocationProgressType
def set_rules(self) -> None:

View File

@@ -292,6 +292,9 @@ blacklisted_combos = {
# See above comment
"Time Rift - Deep Sea": ["Alpine Free Roam", "Nyakuza Free Roam", "Contractual Obligations",
"Murder on the Owl Express"],
# was causing test failures
"Time Rift - Balcony": ["Alpine Free Roam"],
}

View File

@@ -863,6 +863,8 @@ def set_rift_rules(world: "HatInTimeWorld", regions: Dict[str, Region]):
if world.is_dlc1():
for entrance in regions["Time Rift - Balcony"].entrances:
add_rule(entrance, lambda state: can_clear_required_act(state, world, "The Arctic Cruise - Finale"))
reg_act_connection(world, world.multiworld.get_entrance("The Arctic Cruise - Finale",
world.player).connected_region, entrance)
for entrance in regions["Time Rift - Deep Sea"].entrances:
add_rule(entrance, lambda state: has_relic_combo(state, world, "Cake"))
@@ -939,6 +941,7 @@ def set_default_rift_rules(world: "HatInTimeWorld"):
if world.is_dlc1():
for entrance in world.multiworld.get_region("Time Rift - Balcony", world.player).entrances:
add_rule(entrance, lambda state: can_clear_required_act(state, world, "The Arctic Cruise - Finale"))
reg_act_connection(world, "Rock the Boat", entrance.name)
for entrance in world.multiworld.get_region("Time Rift - Deep Sea", world.player).entrances:
add_rule(entrance, lambda state: has_relic_combo(state, world, "Cake"))

View File

@@ -12,41 +12,29 @@
## Instructions
1. Have Steam running. Open the Steam console with this link: [steam://open/console](steam://open/console)
This may not work for some browsers. If that's the case, and you're on Windows, open the Run dialog using Win+R,
paste the link into the box, and hit Enter.
1. **BACK UP YOUR SAVE FILES IN YOUR MAIN INSTALL IF YOU CARE ABOUT THEM!!!**
Go to `steamapps/common/HatinTime/HatinTimeGame/SaveData/` and copy everything inside that folder over to a safe place.
**This is important! Changing the game version CAN and WILL break your existing save files!!!**
2. In the Steam console, enter the following command:
`download_depot 253230 253232 7770543545116491859`. ***Wait for the console to say the download is finished!***
This can take a while to finish (30+ minutes) depending on your connection speed, so please be patient. Additionally,
**try to prevent your connection from being interrupted or slowed while Steam is downloading the depot,**
or else the download may potentially become corrupted (see first FAQ issue below).
2. In your Steam library, right-click on **A Hat in Time** in the list of games and click on **Properties**.
3. Once the download finishes, go to `steamapps/content/app_253230` in Steam's program folder.
3. Click the **Betas** tab. In the **Beta Participation** dropdown, select `tcplink`.
While it downloads, you can subscribe to the [Archipelago workshop mod.]((https://steamcommunity.com/sharedfiles/filedetails/?id=3026842601))
4. There should be a folder named `depot_253232`. Rename it to HatinTime_AP and move it to your `steamapps/common` folder.
4. Once the game finishes downloading, start it up.
In Game Settings, make sure **Enable Developer Console** is checked.
5. In the HatinTime_AP folder, navigate to `Binaries/Win64` and create a new file: `steam_appid.txt`.
In this new text file, input the number **253230** on the first line.
6. Create a shortcut of `HatinTimeGame.exe` from that folder and move it to wherever you'd like.
You will use this shortcut to open the Archipelago-compatible version of A Hat in Time.
7. Start up the game using your new shortcut. To confirm if you are on the correct version,
go to Settings -> Game Settings. If you don't see an option labelled ***Live Game Events*** you should be running
the correct version of the game. In Game Settings, make sure ***Enable Developer Console*** is checked.
5. You should now be good to go. See below for more details on how to use the mod and connect to an Archipelago game.
## Connecting to the Archipelago server
To connect to the multiworld server, simply run the **ArchipelagoAHITClient**
(or run it from the Launcher if you have the apworld installed) and connect it to the Archipelago server.
To connect to the multiworld server, simply run the **Archipelago AHIT Client** from the Launcher
and connect it to the Archipelago server.
The game will connect to the client automatically when you create a new save file.
@@ -61,33 +49,8 @@ make sure ***Enable Developer Console*** is checked in Game Settings and press t
## FAQ/Common Issues
### I followed the setup, but I receive an odd error message upon starting the game or creating a save file!
If you receive an error message such as
**"Failed to find default engine .ini to retrieve My Documents subdirectory to use. Force quitting."** or
**"Failed to load map "hub_spaceship"** after booting up the game or creating a save file respectively, then the depot
download was likely corrupted. The only way to fix this is to start the entire download all over again.
Unfortunately, this appears to be an underlying issue with Steam's depot downloader. The only way to really prevent this
from happening is to ensure that your connection is not interrupted or slowed while downloading.
### The game keeps crashing on startup after the splash screen!
This issue is unfortunately very hard to fix, and the underlying cause is not known. If it does happen however,
try the following:
- Close Steam **entirely**.
- Open the downpatched version of the game (with Steam closed) and allow it to load to the titlescreen.
- Close the game, and then open Steam again.
- After launching the game, the issue should hopefully disappear. If not, repeat the above steps until it does.
### I followed the setup, but "Live Game Events" still shows up in the options menu!
The most common cause of this is the `steam_appid.txt` file. If you're on Windows 10, file extensions are hidden by
default (thanks Microsoft). You likely made the mistake of still naming the file `steam_appid.txt`, which, since file
extensions are hidden, would result in the file being named `steam_appid.txt.txt`, which is incorrect.
To show file extensions in Windows 10, open any folder, click the View tab at the top, and check
"File name extensions". Then you can correct the name of the file. If the name of the file is correct,
and you're still running into the issue, re-read the setup guide again in case you missed a step.
If you still can't get it to work, ask for help in the Discord thread.
### The game is running on the older version, but it's not connecting when starting a new save!
### The game is not connecting when starting a new save!
For unknown reasons, the mod will randomly disable itself in the mod menu. To fix this, go to the Mods menu
(rocket icon) in-game, and re-enable the mod.

View File

@@ -682,7 +682,7 @@ def get_alttp_settings(romfile: str):
if 'yes' in choice:
import LttPAdjuster
from worlds.alttp.Rom import get_base_rom_path
from .Rom import get_base_rom_path
last_settings.rom = romfile
last_settings.baserom = get_base_rom_path()
last_settings.world = None

View File

@@ -1437,7 +1437,7 @@ def connect_mandatory_exits(world, entrances, caves, must_be_exits, player):
invalid_cave_connections = defaultdict(set)
if world.glitches_required[player] in ['overworld_glitches', 'hybrid_major_glitches', 'no_logic']:
from worlds.alttp import OverworldGlitchRules
from . import OverworldGlitchRules
for entrance in OverworldGlitchRules.get_non_mandatory_exits(world.mode[player] == 'inverted'):
invalid_connections[entrance] = set()
if entrance in must_be_exits:

View File

@@ -486,7 +486,7 @@ class LTTPBosses(PlandoBosses):
@classmethod
def can_place_boss(cls, boss: str, location: str) -> bool:
from worlds.alttp.Bosses import can_place_boss
from .Bosses import can_place_boss
level = ''
words = location.split(" ")
if words[-1] in ("top", "middle", "bottom"):

View File

@@ -406,7 +406,7 @@ def create_dungeon_region(world: MultiWorld, player: int, name: str, hint: str,
def _create_region(world: MultiWorld, player: int, name: str, type: LTTPRegionType, hint: str, locations=None,
exits=None):
from worlds.alttp.SubClasses import ALttPLocation
from .SubClasses import ALttPLocation
ret = LTTPRegion(name, type, hint, player, world)
if exits:
for exit in exits:
@@ -760,7 +760,7 @@ location_table: typing.Dict[str,
'Turtle Rock - Prize': (
[0x120A7, 0x53F24, 0x53F25, 0x18005C, 0x180079, 0xC708], None, True, 'Turtle Rock')}
from worlds.alttp.Shops import shop_table_by_location_id, shop_table_by_location
from .Shops import shop_table_by_location_id, shop_table_by_location
lookup_id_to_name = {data[0]: name for name, data in location_table.items() if type(data[0]) == int}
lookup_id_to_name = {**lookup_id_to_name, **{data[1]: name for name, data in key_drop_data.items()}}
lookup_id_to_name.update(shop_table_by_location_id)

View File

@@ -405,16 +405,14 @@ def global_rules(multiworld: MultiWorld, player: int):
set_rule(multiworld.get_location('Swamp Palace - Waterway Pot Key', player), lambda state: can_use_bombs(state, player))
set_rule(multiworld.get_entrance('Thieves Town Big Key Door', player), lambda state: state.has('Big Key (Thieves Town)', player))
if multiworld.worlds[player].dungeons["Thieves Town"].boss.enemizer_name == "Blind":
set_rule(multiworld.get_entrance('Blind Fight', player), lambda state: state._lttp_has_key('Small Key (Thieves Town)', player, 3) and can_use_bombs(state, player))
set_rule(multiworld.get_location('Thieves\' Town - Big Chest', player),
lambda state: ((state._lttp_has_key('Small Key (Thieves Town)', player, 3)) or (location_item_name(state, 'Thieves\' Town - Big Chest', player) == ("Small Key (Thieves Town)", player)) and state._lttp_has_key('Small Key (Thieves Town)', player, 2)) and state.has('Hammer', player))
set_rule(multiworld.get_location('Thieves\' Town - Blind\'s Cell', player),
lambda state: state._lttp_has_key('Small Key (Thieves Town)', player))
if multiworld.accessibility[player] != 'locations' and not multiworld.key_drop_shuffle[player]:
set_always_allow(multiworld.get_location('Thieves\' Town - Big Chest', player), lambda state, item: item.name == 'Small Key (Thieves Town)' and item.player == player)
set_rule(multiworld.get_location('Thieves\' Town - Attic', player), lambda state: state._lttp_has_key('Small Key (Thieves Town)', player, 3))
set_rule(multiworld.get_location('Thieves\' Town - Spike Switch Pot Key', player),
lambda state: state._lttp_has_key('Small Key (Thieves Town)', player))
@@ -490,7 +488,7 @@ def global_rules(multiworld: MultiWorld, player: int):
set_rule(multiworld.get_location('Turtle Rock - Roller Room - Right', player), lambda state: state.has('Cane of Somaria', player) and state.has('Fire Rod', player))
set_rule(multiworld.get_location('Turtle Rock - Big Chest', player), lambda state: state.has('Big Key (Turtle Rock)', player) and (state.has('Cane of Somaria', player) or state.has('Hookshot', player)))
set_rule(multiworld.get_entrance('Turtle Rock (Big Chest) (North)', player), lambda state: state.has('Cane of Somaria', player) or state.has('Hookshot', player))
set_rule(multiworld.get_entrance('Turtle Rock Big Key Door', player), lambda state: state.has('Big Key (Turtle Rock)', player) and can_kill_most_things(state, player, 10))
set_rule(multiworld.get_entrance('Turtle Rock Big Key Door', player), lambda state: state.has('Big Key (Turtle Rock)', player) and can_kill_most_things(state, player, 10) and can_bomb_or_bonk(state, player))
set_rule(multiworld.get_location('Turtle Rock - Chain Chomps', player), lambda state: can_use_bombs(state, player) or can_shoot_arrows(state, player)
or has_beam_sword(state, player) or state.has_any(["Blue Boomerang", "Red Boomerang", "Hookshot", "Cane of Somaria", "Fire Rod", "Ice Rod"], player))
set_rule(multiworld.get_entrance('Turtle Rock (Dark Room) (North)', player), lambda state: state.has('Cane of Somaria', player))

View File

@@ -37,7 +37,8 @@ class TestThievesTown(TestDungeon):
["Thieves' Town - Blind's Cell", False, []],
["Thieves' Town - Blind's Cell", False, [], ['Big Key (Thieves Town)']],
["Thieves' Town - Blind's Cell", True, ['Big Key (Thieves Town)']],
["Thieves' Town - Blind's Cell", False, [], ['Small Key (Thieves Town)']],
["Thieves' Town - Blind's Cell", True, ['Big Key (Thieves Town)', 'Small Key (Thieves Town)']],
["Thieves' Town - Boss", False, []],
["Thieves' Town - Boss", False, [], ['Big Key (Thieves Town)']],

View File

@@ -30,7 +30,7 @@ class AquariaLocations:
locations_verse_cave_r = {
"Verse Cave, bulb in the skeleton room": 698107,
"Verse Cave, bulb in the path left of the skeleton room": 698108,
"Verse Cave, bulb in the path right of the skeleton room": 698108,
"Verse Cave right area, Big Seed": 698175,
}
@@ -122,6 +122,7 @@ class AquariaLocations:
"Open Water top right area, second urn in the Mithalas exit": 698149,
"Open Water top right area, third urn in the Mithalas exit": 698150,
}
locations_openwater_tr_turtle = {
"Open Water top right area, bulb in the turtle room": 698009,
"Open Water top right area, Transturtle": 698211,
@@ -195,7 +196,7 @@ class AquariaLocations:
locations_cathedral_l = {
"Mithalas City Castle, bulb in the flesh hole": 698042,
"Mithalas City Castle, Blue banner": 698165,
"Mithalas City Castle, Blue Banner": 698165,
"Mithalas City Castle, urn in the bedroom": 698130,
"Mithalas City Castle, first urn of the single lamp path": 698131,
"Mithalas City Castle, second urn of the single lamp path": 698132,
@@ -226,7 +227,7 @@ class AquariaLocations:
"Mithalas Cathedral, third urn in the path behind the flesh vein": 698146,
"Mithalas Cathedral, fourth urn in the top right room": 698147,
"Mithalas Cathedral, Mithalan Dress": 698189,
"Mithalas Cathedral right area, urn below the left entrance": 698198,
"Mithalas Cathedral, urn below the left entrance": 698198,
}
locations_cathedral_underground = {
@@ -239,7 +240,7 @@ class AquariaLocations:
}
locations_cathedral_boss = {
"Cathedral boss area, beating Mithalan God": 698202,
"Mithalas boss area, beating Mithalan God": 698202,
}
locations_forest_tl = {
@@ -269,7 +270,7 @@ class AquariaLocations:
locations_forest_bl = {
"Kelp Forest bottom left area, bulb close to the spirit crystals": 698054,
"Kelp Forest bottom left area, Walker baby": 698186,
"Kelp Forest bottom left area, Walker Baby": 698186,
"Kelp Forest bottom left area, Transturtle": 698212,
}
@@ -451,7 +452,7 @@ class AquariaLocations:
locations_body_c = {
"The Body center area, breaking Li's cage": 698201,
"The Body main area, bulb on the main path blocking tube": 698097,
"The Body center area, bulb on the main path blocking tube": 698097,
}
locations_body_l = {

View File

@@ -5,7 +5,7 @@ Description: Manage options in the Aquaria game multiworld randomizer
"""
from dataclasses import dataclass
from Options import Toggle, Choice, Range, DeathLink, PerGameCommonOptions, DefaultOnToggle, StartInventoryPool
from Options import Toggle, Choice, Range, PerGameCommonOptions, DefaultOnToggle, StartInventoryPool
class IngredientRandomizer(Choice):
@@ -111,6 +111,14 @@ class BindSongNeededToGetUnderRockBulb(Toggle):
display_name = "Bind song needed to get sing bulbs under rocks"
class BlindGoal(Toggle):
"""
Hide the goal's requirements from the help page so that you have to go to the last boss door to know
what is needed to access the boss.
"""
display_name = "Hide the goal's requirements"
class UnconfineHomeWater(Choice):
"""
Open the way out of the Home Water area so that Naija can go to open water and beyond without the bind song.
@@ -142,4 +150,4 @@ class AquariaOptions(PerGameCommonOptions):
dish_randomizer: DishRandomizer
aquarian_translation: AquarianTranslation
skip_first_vision: SkipFirstVision
death_link: DeathLink
blind_goal: BlindGoal

View File

@@ -300,7 +300,7 @@ class AquariaRegions:
AquariaLocations.locations_cathedral_l_sc)
self.cathedral_r = self.__add_region("Mithalas Cathedral",
AquariaLocations.locations_cathedral_r)
self.cathedral_underground = self.__add_region("Mithalas Cathedral Underground area",
self.cathedral_underground = self.__add_region("Mithalas Cathedral underground",
AquariaLocations.locations_cathedral_underground)
self.cathedral_boss_r = self.__add_region("Mithalas Cathedral, Mithalan God room",
AquariaLocations.locations_cathedral_boss)
@@ -597,22 +597,22 @@ class AquariaRegions:
lambda state: _has_beast_form(state, self.player) and
_has_energy_form(state, self.player) and
_has_bind_song(state, self.player))
self.__connect_regions("Mithalas castle", "Cathedral underground",
self.__connect_regions("Mithalas castle", "Mithalas Cathedral underground",
self.cathedral_l, self.cathedral_underground,
lambda state: _has_beast_form(state, self.player) and
_has_bind_song(state, self.player))
self.__connect_regions("Mithalas castle", "Cathedral right area",
self.__connect_regions("Mithalas castle", "Mithalas Cathedral",
self.cathedral_l, self.cathedral_r,
lambda state: _has_bind_song(state, self.player) and
_has_energy_form(state, self.player))
self.__connect_regions("Cathedral right area", "Cathedral underground",
self.__connect_regions("Mithalas Cathedral", "Mithalas Cathedral underground",
self.cathedral_r, self.cathedral_underground,
lambda state: _has_energy_form(state, self.player))
self.__connect_one_way_regions("Cathedral underground", "Cathedral boss left area",
self.__connect_one_way_regions("Mithalas Cathedral underground", "Cathedral boss left area",
self.cathedral_underground, self.cathedral_boss_r,
lambda state: _has_energy_form(state, self.player) and
_has_bind_song(state, self.player))
self.__connect_one_way_regions("Cathedral boss left area", "Cathedral underground",
self.__connect_one_way_regions("Cathedral boss left area", "Mithalas Cathedral underground",
self.cathedral_boss_r, self.cathedral_underground,
lambda state: _has_beast_form(state, self.player))
self.__connect_regions("Cathedral boss right area", "Cathedral boss left area",
@@ -1099,7 +1099,7 @@ class AquariaRegions:
lambda state: _has_beast_form(state, self.player))
add_rule(self.multiworld.get_location("Open Water bottom left area, bulb inside the lowest fish pass", self.player),
lambda state: _has_fish_form(state, self.player))
add_rule(self.multiworld.get_location("Kelp Forest bottom left area, Walker baby", self.player),
add_rule(self.multiworld.get_location("Kelp Forest bottom left area, Walker Baby", self.player),
lambda state: _has_spirit_form(state, self.player))
add_rule(self.multiworld.get_location("The Veil top left area, bulb hidden behind the blocking rock", self.player),
lambda state: _has_bind_song(state, self.player))
@@ -1134,7 +1134,7 @@ class AquariaRegions:
self.multiworld.get_location("Energy Temple boss area, Fallen God Tooth",
self.player).item_rule =\
lambda item: item.classification != ItemClassification.progression
self.multiworld.get_location("Cathedral boss area, beating Mithalan God",
self.multiworld.get_location("Mithalas boss area, beating Mithalan God",
self.player).item_rule =\
lambda item: item.classification != ItemClassification.progression
self.multiworld.get_location("Kelp Forest boss area, beating Drunian God",
@@ -1191,7 +1191,7 @@ class AquariaRegions:
self.multiworld.get_location("Kelp Forest bottom left area, bulb close to the spirit crystals",
self.player).item_rule =\
lambda item: item.classification != ItemClassification.progression
self.multiworld.get_location("Kelp Forest bottom left area, Walker baby",
self.multiworld.get_location("Kelp Forest bottom left area, Walker Baby",
self.player).item_rule =\
lambda item: item.classification != ItemClassification.progression
self.multiworld.get_location("Sun Temple, Sun Key",

View File

@@ -204,7 +204,8 @@ class AquariaWorld(World):
def fill_slot_data(self) -> Dict[str, Any]:
return {"ingredientReplacement": self.ingredients_substitution,
"aquarianTranslate": bool(self.options.aquarian_translation.value),
"aquarian_translate": bool(self.options.aquarian_translation.value),
"blind_goal": bool(self.options.blind_goal.value),
"secret_needed": self.options.objective.value > 0,
"minibosses_to_kill": self.options.mini_bosses_to_beat.value,
"bigbosses_to_kill": self.options.big_bosses_to_beat.value,

View File

@@ -60,7 +60,7 @@ after_home_water_locations = [
"Mithalas City, Doll",
"Mithalas City, urn inside a home fish pass",
"Mithalas City Castle, bulb in the flesh hole",
"Mithalas City Castle, Blue banner",
"Mithalas City Castle, Blue Banner",
"Mithalas City Castle, urn in the bedroom",
"Mithalas City Castle, first urn of the single lamp path",
"Mithalas City Castle, second urn of the single lamp path",
@@ -82,14 +82,14 @@ after_home_water_locations = [
"Mithalas Cathedral, third urn in the path behind the flesh vein",
"Mithalas Cathedral, fourth urn in the top right room",
"Mithalas Cathedral, Mithalan Dress",
"Mithalas Cathedral right area, urn below the left entrance",
"Mithalas Cathedral, urn below the left entrance",
"Cathedral Underground, bulb in the center part",
"Cathedral Underground, first bulb in the top left part",
"Cathedral Underground, second bulb in the top left part",
"Cathedral Underground, third bulb in the top left part",
"Cathedral Underground, bulb close to the save crystal",
"Cathedral Underground, bulb in the bottom right path",
"Cathedral boss area, beating Mithalan God",
"Mithalas boss area, beating Mithalan God",
"Kelp Forest top left area, bulb in the bottom left clearing",
"Kelp Forest top left area, bulb in the path down from the top left clearing",
"Kelp Forest top left area, bulb in the top left clearing",
@@ -104,7 +104,7 @@ after_home_water_locations = [
"Kelp Forest top right area, Black Pearl",
"Kelp Forest top right area, bulb in the top fish pass",
"Kelp Forest bottom left area, bulb close to the spirit crystals",
"Kelp Forest bottom left area, Walker baby",
"Kelp Forest bottom left area, Walker Baby",
"Kelp Forest bottom left area, Transturtle",
"Kelp Forest bottom right area, Odd Container",
"Kelp Forest boss area, beating Drunian God",
@@ -175,7 +175,7 @@ after_home_water_locations = [
"Sunken City left area, Girl Costume",
"Sunken City, bulb on top of the boss area",
"The Body center area, breaking Li's cage",
"The Body main area, bulb on the main path blocking tube",
"The Body center area, bulb on the main path blocking tube",
"The Body left area, first bulb in the top face room",
"The Body left area, second bulb in the top face room",
"The Body left area, bulb below the water stream",

View File

@@ -4,7 +4,7 @@ Date: Thu, 18 Apr 2024 18:45:56 +0000
Description: Unit test used to test accessibility of locations with and without the beast form
"""
from worlds.aquaria.test import AquariaTestBase
from . import AquariaTestBase
class BeastFormAccessTest(AquariaTestBase):

View File

@@ -5,7 +5,7 @@ Description: Unit test used to test accessibility of locations with and without
under rock needing bind song option)
"""
from worlds.aquaria.test import AquariaTestBase, after_home_water_locations
from . import AquariaTestBase, after_home_water_locations
class BindSongAccessTest(AquariaTestBase):

View File

@@ -5,8 +5,8 @@ Description: Unit test used to test accessibility of locations with and without
under rock needing bind song option)
"""
from worlds.aquaria.test import AquariaTestBase
from worlds.aquaria.test.test_bind_song_access import after_home_water_locations
from . import AquariaTestBase
from .test_bind_song_access import after_home_water_locations
class BindSongOptionAccessTest(AquariaTestBase):

View File

@@ -4,7 +4,7 @@ Date: Fri, 03 May 2024 14:07:35 +0000
Description: Unit test used to test accessibility of region with the home water confine via option
"""
from worlds.aquaria.test import AquariaTestBase
from . import AquariaTestBase
class ConfinedHomeWaterAccessTest(AquariaTestBase):

View File

@@ -4,7 +4,7 @@ Date: Thu, 18 Apr 2024 18:45:56 +0000
Description: Unit test used to test accessibility of locations with and without the dual song
"""
from worlds.aquaria.test import AquariaTestBase
from . import AquariaTestBase
class LiAccessTest(AquariaTestBase):

View File

@@ -5,7 +5,7 @@ Description: Unit test used to test accessibility of locations with and without
energy form option)
"""
from worlds.aquaria.test import AquariaTestBase
from . import AquariaTestBase
class EnergyFormAccessTest(AquariaTestBase):
@@ -39,8 +39,8 @@ class EnergyFormAccessTest(AquariaTestBase):
"Mithalas Cathedral, third urn in the path behind the flesh vein",
"Mithalas Cathedral, fourth urn in the top right room",
"Mithalas Cathedral, Mithalan Dress",
"Mithalas Cathedral right area, urn below the left entrance",
"Cathedral boss area, beating Mithalan God",
"Mithalas Cathedral, urn below the left entrance",
"Mithalas boss area, beating Mithalan God",
"Kelp Forest top left area, bulb close to the Verse Egg",
"Kelp Forest top left area, Verse Egg",
"Kelp Forest boss area, beating Drunian God",

View File

@@ -4,7 +4,7 @@ Date: Thu, 18 Apr 2024 18:45:56 +0000
Description: Unit test used to test accessibility of locations with and without the fish form
"""
from worlds.aquaria.test import AquariaTestBase
from . import AquariaTestBase
class FishFormAccessTest(AquariaTestBase):

View File

@@ -4,7 +4,7 @@ Date: Thu, 18 Apr 2024 18:45:56 +0000
Description: Unit test used to test accessibility of locations with and without Li
"""
from worlds.aquaria.test import AquariaTestBase
from . import AquariaTestBase
class LiAccessTest(AquariaTestBase):
@@ -24,7 +24,7 @@ class LiAccessTest(AquariaTestBase):
"Sunken City left area, Girl Costume",
"Sunken City, bulb on top of the boss area",
"The Body center area, breaking Li's cage",
"The Body main area, bulb on the main path blocking tube",
"The Body center area, bulb on the main path blocking tube",
"The Body left area, first bulb in the top face room",
"The Body left area, second bulb in the top face room",
"The Body left area, bulb below the water stream",

View File

@@ -4,7 +4,7 @@ Date: Thu, 18 Apr 2024 18:45:56 +0000
Description: Unit test used to test accessibility of locations with and without a light (Dumbo pet or sun form)
"""
from worlds.aquaria.test import AquariaTestBase
from . import AquariaTestBase
class LightAccessTest(AquariaTestBase):

View File

@@ -4,7 +4,7 @@ Date: Thu, 18 Apr 2024 18:45:56 +0000
Description: Unit test used to test accessibility of locations with and without the nature form
"""
from worlds.aquaria.test import AquariaTestBase
from . import AquariaTestBase
class NatureFormAccessTest(AquariaTestBase):
@@ -38,7 +38,7 @@ class NatureFormAccessTest(AquariaTestBase):
"Beating the Golem",
"Sunken City cleared",
"The Body center area, breaking Li's cage",
"The Body main area, bulb on the main path blocking tube",
"The Body center area, bulb on the main path blocking tube",
"The Body left area, first bulb in the top face room",
"The Body left area, second bulb in the top face room",
"The Body left area, bulb below the water stream",

View File

@@ -4,7 +4,7 @@ Date: Fri, 03 May 2024 14:07:35 +0000
Description: Unit test used to test that no progression items can be put in hard or hidden locations when option enabled
"""
from worlds.aquaria.test import AquariaTestBase
from . import AquariaTestBase
from BaseClasses import ItemClassification
@@ -16,7 +16,7 @@ class UNoProgressionHardHiddenTest(AquariaTestBase):
unfillable_locations = [
"Energy Temple boss area, Fallen God Tooth",
"Cathedral boss area, beating Mithalan God",
"Mithalas boss area, beating Mithalan God",
"Kelp Forest boss area, beating Drunian God",
"Sun Temple boss area, beating Sun God",
"Sunken City, bulb on top of the boss area",
@@ -35,7 +35,7 @@ class UNoProgressionHardHiddenTest(AquariaTestBase):
"Bubble Cave, bulb in the right cave wall (behind the ice crystal)",
"Bubble Cave, Verse Egg",
"Kelp Forest bottom left area, bulb close to the spirit crystals",
"Kelp Forest bottom left area, Walker baby",
"Kelp Forest bottom left area, Walker Baby",
"Sun Temple, Sun Key",
"The Body bottom area, Mutant Costume",
"Sun Temple, bulb in the hidden room of the right part",

View File

@@ -4,8 +4,7 @@ Date: Fri, 03 May 2024 14:07:35 +0000
Description: Unit test used to test that progression items can be put in hard or hidden locations when option disabled
"""
from worlds.aquaria.test import AquariaTestBase
from BaseClasses import ItemClassification
from . import AquariaTestBase
class UNoProgressionHardHiddenTest(AquariaTestBase):
@@ -16,7 +15,7 @@ class UNoProgressionHardHiddenTest(AquariaTestBase):
unfillable_locations = [
"Energy Temple boss area, Fallen God Tooth",
"Cathedral boss area, beating Mithalan God",
"Mithalas boss area, beating Mithalan God",
"Kelp Forest boss area, beating Drunian God",
"Sun Temple boss area, beating Sun God",
"Sunken City, bulb on top of the boss area",
@@ -35,7 +34,7 @@ class UNoProgressionHardHiddenTest(AquariaTestBase):
"Bubble Cave, bulb in the right cave wall (behind the ice crystal)",
"Bubble Cave, Verse Egg",
"Kelp Forest bottom left area, bulb close to the spirit crystals",
"Kelp Forest bottom left area, Walker baby",
"Kelp Forest bottom left area, Walker Baby",
"Sun Temple, Sun Key",
"The Body bottom area, Mutant Costume",
"Sun Temple, bulb in the hidden room of the right part",

View File

@@ -4,7 +4,7 @@ Date: Thu, 18 Apr 2024 18:45:56 +0000
Description: Unit test used to test accessibility of locations with and without the spirit form
"""
from worlds.aquaria.test import AquariaTestBase
from . import AquariaTestBase
class SpiritFormAccessTest(AquariaTestBase):
@@ -16,7 +16,7 @@ class SpiritFormAccessTest(AquariaTestBase):
"The Veil bottom area, bulb in the spirit path",
"Mithalas City Castle, Trident Head",
"Open Water skeleton path, King Skull",
"Kelp Forest bottom left area, Walker baby",
"Kelp Forest bottom left area, Walker Baby",
"Abyss right area, bulb behind the rock in the whale room",
"The Whale, Verse Egg",
"Ice Cave, bulb in the room to the right",

View File

@@ -4,7 +4,7 @@ Date: Thu, 18 Apr 2024 18:45:56 +0000
Description: Unit test used to test accessibility of locations with and without the sun form
"""
from worlds.aquaria.test import AquariaTestBase
from . import AquariaTestBase
class SunFormAccessTest(AquariaTestBase):

View File

@@ -5,7 +5,7 @@ Description: Unit test used to test accessibility of region with the unconfined
turtle and energy door
"""
from worlds.aquaria.test import AquariaTestBase
from . import AquariaTestBase
class UnconfineHomeWaterBothAccessTest(AquariaTestBase):

View File

@@ -4,7 +4,7 @@ Date: Fri, 03 May 2024 14:07:35 +0000
Description: Unit test used to test accessibility of region with the unconfined home water option via the energy door
"""
from worlds.aquaria.test import AquariaTestBase
from . import AquariaTestBase
class UnconfineHomeWaterEnergyDoorAccessTest(AquariaTestBase):

View File

@@ -4,7 +4,7 @@ Date: Fri, 03 May 2024 14:07:35 +0000
Description: Unit test used to test accessibility of region with the unconfined home water option via transturtle
"""
from worlds.aquaria.test import AquariaTestBase
from . import AquariaTestBase
class UnconfineHomeWaterTransturtleAccessTest(AquariaTestBase):

View File

@@ -762,7 +762,7 @@ location_table: List[LocationDict] = [
'game_id': "graf385"},
{'name': "Tagged 389 Graffiti Spots",
'stage': Stages.Misc,
'game_id': "graf379"},
'game_id': "graf389"},
]

View File

@@ -60,7 +60,7 @@ class DKC3SNIClient(SNIClient):
return
new_checks = []
from worlds.dkc3.Rom import location_rom_data, item_rom_data, boss_location_ids, level_unlock_map
from .Rom import location_rom_data, item_rom_data, boss_location_ids, level_unlock_map
location_ram_data = await snes_read(ctx, WRAM_START + 0x5FE, 0x81)
for loc_id, loc_data in location_rom_data.items():
if loc_id not in ctx.locations_checked:

View File

@@ -8,11 +8,15 @@ from .Locations import DLCQuestLocation, location_table
from .Options import DLCQuestOptions
from .Regions import create_regions
from .Rules import set_rules
from .presets import dlcq_options_presets
from .option_groups import dlcq_option_groups
client_version = 0
class DLCqwebworld(WebWorld):
options_presets = dlcq_options_presets
option_groups = dlcq_option_groups
setup_en = Tutorial(
"Multiworld Setup Guide",
"A guide to setting up the Archipelago DLCQuest game on your computer.",

View File

@@ -0,0 +1,27 @@
from typing import List
from Options import ProgressionBalancing, Accessibility, OptionGroup
from .Options import (Campaign, ItemShuffle, TimeIsMoney, EndingChoice, PermanentCoins, DoubleJumpGlitch, CoinSanity,
CoinSanityRange, DeathLink)
dlcq_option_groups: List[OptionGroup] = [
OptionGroup("General", [
Campaign,
ItemShuffle,
CoinSanity,
]),
OptionGroup("Customization", [
EndingChoice,
PermanentCoins,
CoinSanityRange,
]),
OptionGroup("Tedious and Grind", [
TimeIsMoney,
DoubleJumpGlitch,
]),
OptionGroup("Advanced Options", [
DeathLink,
ProgressionBalancing,
Accessibility,
]),
]

View File

@@ -0,0 +1,68 @@
from typing import Any, Dict
from .Options import DoubleJumpGlitch, CoinSanity, CoinSanityRange, PermanentCoins, TimeIsMoney, EndingChoice, Campaign, ItemShuffle
all_random_settings = {
DoubleJumpGlitch.internal_name: "random",
CoinSanity.internal_name: "random",
CoinSanityRange.internal_name: "random",
PermanentCoins.internal_name: "random",
TimeIsMoney.internal_name: "random",
EndingChoice.internal_name: "random",
Campaign.internal_name: "random",
ItemShuffle.internal_name: "random",
"death_link": "random",
}
main_campaign_settings = {
DoubleJumpGlitch.internal_name: DoubleJumpGlitch.option_none,
CoinSanity.internal_name: CoinSanity.option_coin,
CoinSanityRange.internal_name: 30,
PermanentCoins.internal_name: PermanentCoins.option_false,
TimeIsMoney.internal_name: TimeIsMoney.option_required,
EndingChoice.internal_name: EndingChoice.option_true,
Campaign.internal_name: Campaign.option_basic,
ItemShuffle.internal_name: ItemShuffle.option_shuffled,
}
lfod_campaign_settings = {
DoubleJumpGlitch.internal_name: DoubleJumpGlitch.option_none,
CoinSanity.internal_name: CoinSanity.option_coin,
CoinSanityRange.internal_name: 30,
PermanentCoins.internal_name: PermanentCoins.option_false,
TimeIsMoney.internal_name: TimeIsMoney.option_required,
EndingChoice.internal_name: EndingChoice.option_true,
Campaign.internal_name: Campaign.option_live_freemium_or_die,
ItemShuffle.internal_name: ItemShuffle.option_shuffled,
}
easy_settings = {
DoubleJumpGlitch.internal_name: DoubleJumpGlitch.option_none,
CoinSanity.internal_name: CoinSanity.option_none,
CoinSanityRange.internal_name: 40,
PermanentCoins.internal_name: PermanentCoins.option_true,
TimeIsMoney.internal_name: TimeIsMoney.option_required,
EndingChoice.internal_name: EndingChoice.option_true,
Campaign.internal_name: Campaign.option_both,
ItemShuffle.internal_name: ItemShuffle.option_shuffled,
}
hard_settings = {
DoubleJumpGlitch.internal_name: DoubleJumpGlitch.option_simple,
CoinSanity.internal_name: CoinSanity.option_coin,
CoinSanityRange.internal_name: 30,
PermanentCoins.internal_name: PermanentCoins.option_false,
TimeIsMoney.internal_name: TimeIsMoney.option_optional,
EndingChoice.internal_name: EndingChoice.option_true,
Campaign.internal_name: Campaign.option_both,
ItemShuffle.internal_name: ItemShuffle.option_shuffled,
}
dlcq_options_presets: Dict[str, Dict[str, Any]] = {
"All random": all_random_settings,
"Main campaign": main_campaign_settings,
"LFOD campaign": lfod_campaign_settings,
"Both easy": easy_settings,
"Both hard": hard_settings,
}

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 in (b'\x00', b'\x55') or check_2 in (b'\x00', b'\x55'):
if check_1 != b'01' or check_2 != b'01':
return
def get_range(data_range):

View File

@@ -222,10 +222,10 @@ for item, data in item_table.items():
def create_items(self) -> None:
items = []
starting_weapon = self.multiworld.starting_weapon[self.player].current_key.title().replace("_", " ")
starting_weapon = self.options.starting_weapon.current_key.title().replace("_", " ")
self.multiworld.push_precollected(self.create_item(starting_weapon))
self.multiworld.push_precollected(self.create_item("Steel Armor"))
if self.multiworld.sky_coin_mode[self.player] == "start_with":
if self.options.sky_coin_mode == "start_with":
self.multiworld.push_precollected(self.create_item("Sky Coin"))
precollected_item_names = {item.name for item in self.multiworld.precollected_items[self.player]}
@@ -233,28 +233,28 @@ def create_items(self) -> None:
def add_item(item_name):
if item_name in ["Steel Armor", "Sky Fragment"] or "Progressive" in item_name:
return
if item_name.lower().replace(" ", "_") == self.multiworld.starting_weapon[self.player].current_key:
if item_name.lower().replace(" ", "_") == self.options.starting_weapon.current_key:
return
if self.multiworld.progressive_gear[self.player]:
if self.options.progressive_gear:
for item_group in prog_map:
if item_name in self.item_name_groups[item_group]:
item_name = prog_map[item_group]
break
if item_name == "Sky Coin":
if self.multiworld.sky_coin_mode[self.player] == "shattered_sky_coin":
if self.options.sky_coin_mode == "shattered_sky_coin":
for _ in range(40):
items.append(self.create_item("Sky Fragment"))
return
elif self.multiworld.sky_coin_mode[self.player] == "save_the_crystals":
elif self.options.sky_coin_mode == "save_the_crystals":
items.append(self.create_filler())
return
if item_name in precollected_item_names:
items.append(self.create_filler())
return
i = self.create_item(item_name)
if self.multiworld.logic[self.player] != "friendly" and item_name in ("Magic Mirror", "Mask"):
if self.options.logic != "friendly" and item_name in ("Magic Mirror", "Mask"):
i.classification = ItemClassification.useful
if (self.multiworld.logic[self.player] == "expert" and self.multiworld.map_shuffle[self.player] == "none" and
if (self.options.logic == "expert" and self.options.map_shuffle == "none" and
item_name == "Exit Book"):
i.classification = ItemClassification.progression
items.append(i)
@@ -263,11 +263,11 @@ def create_items(self) -> None:
for item in self.item_name_groups[item_group]:
add_item(item)
if self.multiworld.brown_boxes[self.player] == "include":
if self.options.brown_boxes == "include":
filler_items = []
for item, count in fillers.items():
filler_items += [self.create_item(item) for _ in range(count)]
if self.multiworld.sky_coin_mode[self.player] == "shattered_sky_coin":
if self.options.sky_coin_mode == "shattered_sky_coin":
self.multiworld.random.shuffle(filler_items)
filler_items = filler_items[39:]
items += filler_items

View File

@@ -1,4 +1,5 @@
from Options import Choice, FreeText, Toggle, Range
from Options import Choice, FreeText, Toggle, Range, PerGameCommonOptions
from dataclasses import dataclass
class Logic(Choice):
@@ -321,36 +322,36 @@ class KaelisMomFightsMinotaur(Toggle):
default = 0
option_definitions = {
"logic": Logic,
"brown_boxes": BrownBoxes,
"sky_coin_mode": SkyCoinMode,
"shattered_sky_coin_quantity": ShatteredSkyCoinQuantity,
"starting_weapon": StartingWeapon,
"progressive_gear": ProgressiveGear,
"leveling_curve": LevelingCurve,
"starting_companion": StartingCompanion,
"available_companions": AvailableCompanions,
"companions_locations": CompanionsLocations,
"kaelis_mom_fight_minotaur": KaelisMomFightsMinotaur,
"companion_leveling_type": CompanionLevelingType,
"companion_spellbook_type": CompanionSpellbookType,
"enemies_density": EnemiesDensity,
"enemies_scaling_lower": EnemiesScalingLower,
"enemies_scaling_upper": EnemiesScalingUpper,
"bosses_scaling_lower": BossesScalingLower,
"bosses_scaling_upper": BossesScalingUpper,
"enemizer_attacks": EnemizerAttacks,
"enemizer_groups": EnemizerGroups,
"shuffle_res_weak_types": ShuffleResWeakType,
"shuffle_enemies_position": ShuffleEnemiesPositions,
"progressive_formations": ProgressiveFormations,
"doom_castle_mode": DoomCastle,
"doom_castle_shortcut": DoomCastleShortcut,
"tweak_frustrating_dungeons": TweakFrustratingDungeons,
"map_shuffle": MapShuffle,
"crest_shuffle": CrestShuffle,
"shuffle_battlefield_rewards": ShuffleBattlefieldRewards,
"map_shuffle_seed": MapShuffleSeed,
"battlefields_battles_quantities": BattlefieldsBattlesQuantities,
}
@dataclass
class FFMQOptions(PerGameCommonOptions):
logic: Logic
brown_boxes: BrownBoxes
sky_coin_mode: SkyCoinMode
shattered_sky_coin_quantity: ShatteredSkyCoinQuantity
starting_weapon: StartingWeapon
progressive_gear: ProgressiveGear
leveling_curve: LevelingCurve
starting_companion: StartingCompanion
available_companions: AvailableCompanions
companions_locations: CompanionsLocations
kaelis_mom_fight_minotaur: KaelisMomFightsMinotaur
companion_leveling_type: CompanionLevelingType
companion_spellbook_type: CompanionSpellbookType
enemies_density: EnemiesDensity
enemies_scaling_lower: EnemiesScalingLower
enemies_scaling_upper: EnemiesScalingUpper
bosses_scaling_lower: BossesScalingLower
bosses_scaling_upper: BossesScalingUpper
enemizer_attacks: EnemizerAttacks
enemizer_groups: EnemizerGroups
shuffle_res_weak_types: ShuffleResWeakType
shuffle_enemies_position: ShuffleEnemiesPositions
progressive_formations: ProgressiveFormations
doom_castle_mode: DoomCastle
doom_castle_shortcut: DoomCastleShortcut
tweak_frustrating_dungeons: TweakFrustratingDungeons
map_shuffle: MapShuffle
crest_shuffle: CrestShuffle
shuffle_battlefield_rewards: ShuffleBattlefieldRewards
map_shuffle_seed: MapShuffleSeed
battlefields_battles_quantities: BattlefieldsBattlesQuantities

View File

@@ -1,13 +1,13 @@
import yaml
import os
import zipfile
import Utils
from copy import deepcopy
from .Regions import object_id_table
from Utils import __version__
from worlds.Files import APPatch
import pkgutil
settings_template = yaml.load(pkgutil.get_data(__name__, "data/settings.yaml"), yaml.Loader)
settings_template = Utils.parse_yaml(pkgutil.get_data(__name__, "data/settings.yaml"))
def generate_output(self, output_directory):
@@ -21,7 +21,7 @@ def generate_output(self, output_directory):
item_name = "".join(item_name.split(" "))
else:
if item.advancement or item.useful or (item.trap and
self.multiworld.per_slot_randoms[self.player].randint(0, 1)):
self.random.randint(0, 1)):
item_name = "APItem"
else:
item_name = "APItemFiller"
@@ -46,60 +46,60 @@ def generate_output(self, output_directory):
options = deepcopy(settings_template)
options["name"] = self.multiworld.player_name[self.player]
option_writes = {
"enemies_density": cc(self.multiworld.enemies_density[self.player]),
"enemies_density": cc(self.options.enemies_density),
"chests_shuffle": "Include",
"shuffle_boxes_content": self.multiworld.brown_boxes[self.player] == "shuffle",
"shuffle_boxes_content": self.options.brown_boxes == "shuffle",
"npcs_shuffle": "Include",
"battlefields_shuffle": "Include",
"logic_options": cc(self.multiworld.logic[self.player]),
"shuffle_enemies_position": tf(self.multiworld.shuffle_enemies_position[self.player]),
"enemies_scaling_lower": cc(self.multiworld.enemies_scaling_lower[self.player]),
"enemies_scaling_upper": cc(self.multiworld.enemies_scaling_upper[self.player]),
"bosses_scaling_lower": cc(self.multiworld.bosses_scaling_lower[self.player]),
"bosses_scaling_upper": cc(self.multiworld.bosses_scaling_upper[self.player]),
"enemizer_attacks": cc(self.multiworld.enemizer_attacks[self.player]),
"leveling_curve": cc(self.multiworld.leveling_curve[self.player]),
"battles_quantity": cc(self.multiworld.battlefields_battles_quantities[self.player]) if
self.multiworld.battlefields_battles_quantities[self.player].value < 5 else
"logic_options": cc(self.options.logic),
"shuffle_enemies_position": tf(self.options.shuffle_enemies_position),
"enemies_scaling_lower": cc(self.options.enemies_scaling_lower),
"enemies_scaling_upper": cc(self.options.enemies_scaling_upper),
"bosses_scaling_lower": cc(self.options.bosses_scaling_lower),
"bosses_scaling_upper": cc(self.options.bosses_scaling_upper),
"enemizer_attacks": cc(self.options.enemizer_attacks),
"leveling_curve": cc(self.options.leveling_curve),
"battles_quantity": cc(self.options.battlefields_battles_quantities) if
self.options.battlefields_battles_quantities.value < 5 else
"RandomLow" if
self.multiworld.battlefields_battles_quantities[self.player].value == 5 else
self.options.battlefields_battles_quantities.value == 5 else
"RandomHigh",
"shuffle_battlefield_rewards": tf(self.multiworld.shuffle_battlefield_rewards[self.player]),
"shuffle_battlefield_rewards": tf(self.options.shuffle_battlefield_rewards),
"random_starting_weapon": True,
"progressive_gear": tf(self.multiworld.progressive_gear[self.player]),
"tweaked_dungeons": tf(self.multiworld.tweak_frustrating_dungeons[self.player]),
"doom_castle_mode": cc(self.multiworld.doom_castle_mode[self.player]),
"doom_castle_shortcut": tf(self.multiworld.doom_castle_shortcut[self.player]),
"sky_coin_mode": cc(self.multiworld.sky_coin_mode[self.player]),
"sky_coin_fragments_qty": cc(self.multiworld.shattered_sky_coin_quantity[self.player]),
"progressive_gear": tf(self.options.progressive_gear),
"tweaked_dungeons": tf(self.options.tweak_frustrating_dungeons),
"doom_castle_mode": cc(self.options.doom_castle_mode),
"doom_castle_shortcut": tf(self.options.doom_castle_shortcut),
"sky_coin_mode": cc(self.options.sky_coin_mode),
"sky_coin_fragments_qty": cc(self.options.shattered_sky_coin_quantity),
"enable_spoilers": False,
"progressive_formations": cc(self.multiworld.progressive_formations[self.player]),
"map_shuffling": cc(self.multiworld.map_shuffle[self.player]),
"crest_shuffle": tf(self.multiworld.crest_shuffle[self.player]),
"enemizer_groups": cc(self.multiworld.enemizer_groups[self.player]),
"shuffle_res_weak_type": tf(self.multiworld.shuffle_res_weak_types[self.player]),
"companion_leveling_type": cc(self.multiworld.companion_leveling_type[self.player]),
"companion_spellbook_type": cc(self.multiworld.companion_spellbook_type[self.player]),
"starting_companion": cc(self.multiworld.starting_companion[self.player]),
"progressive_formations": cc(self.options.progressive_formations),
"map_shuffling": cc(self.options.map_shuffle),
"crest_shuffle": tf(self.options.crest_shuffle),
"enemizer_groups": cc(self.options.enemizer_groups),
"shuffle_res_weak_type": tf(self.options.shuffle_res_weak_types),
"companion_leveling_type": cc(self.options.companion_leveling_type),
"companion_spellbook_type": cc(self.options.companion_spellbook_type),
"starting_companion": cc(self.options.starting_companion),
"available_companions": ["Zero", "One", "Two",
"Three", "Four"][self.multiworld.available_companions[self.player].value],
"companions_locations": cc(self.multiworld.companions_locations[self.player]),
"kaelis_mom_fight_minotaur": tf(self.multiworld.kaelis_mom_fight_minotaur[self.player]),
"Three", "Four"][self.options.available_companions.value],
"companions_locations": cc(self.options.companions_locations),
"kaelis_mom_fight_minotaur": tf(self.options.kaelis_mom_fight_minotaur),
}
for option, data in option_writes.items():
options["Final Fantasy Mystic Quest"][option][data] = 1
rom_name = f'MQ{__version__.replace(".", "")[0:3]}_{self.player}_{self.multiworld.seed_name:11}'[:21]
rom_name = f'MQ{Utils.__version__.replace(".", "")[0:3]}_{self.player}_{self.multiworld.seed_name:11}'[:21]
self.rom_name = bytearray(rom_name,
'utf8')
self.rom_name_available_event.set()
setup = {"version": "1.5", "name": self.multiworld.player_name[self.player], "romname": rom_name, "seed":
hex(self.multiworld.per_slot_randoms[self.player].randint(0, 0xFFFFFFFF)).split("0x")[1].upper()}
hex(self.random.randint(0, 0xFFFFFFFF)).split("0x")[1].upper()}
starting_items = [output_item_name(item) for item in self.multiworld.precollected_items[self.player]]
if self.multiworld.sky_coin_mode[self.player] == "shattered_sky_coin":
if self.options.sky_coin_mode == "shattered_sky_coin":
starting_items.append("SkyCoin")
file_path = os.path.join(output_directory, f"{self.multiworld.get_out_file_name_base(self.player)}.apmq")

View File

@@ -1,11 +1,9 @@
from BaseClasses import Region, MultiWorld, Entrance, Location, LocationProgressType, ItemClassification
from worlds.generic.Rules import add_rule
from .data.rooms import rooms, entrances
from .Items import item_groups, yaml_item
import pkgutil
import yaml
rooms = yaml.load(pkgutil.get_data(__name__, "data/rooms.yaml"), yaml.Loader)
entrance_names = {entrance["id"]: entrance["name"] for entrance in yaml.load(pkgutil.get_data(__name__, "data/entrances.yaml"), yaml.Loader)}
entrance_names = {entrance["id"]: entrance["name"] for entrance in entrances}
object_id_table = {}
object_type_table = {}
@@ -69,7 +67,7 @@ def create_regions(self):
location_table else None, object["type"], object["access"],
self.create_item(yaml_item(object["on_trigger"][0])) if object["type"] == "Trigger" else None) for object in
room["game_objects"] if "Hero Chest" not in object["name"] and object["type"] not in ("BattlefieldGp",
"BattlefieldXp") and (object["type"] != "Box" or self.multiworld.brown_boxes[self.player] == "include") and
"BattlefieldXp") and (object["type"] != "Box" or self.options.brown_boxes == "include") and
not (object["name"] == "Kaeli Companion" and not object["on_trigger"])], room["links"]))
dark_king_room = self.multiworld.get_region("Doom Castle Dark King Room", self.player)
@@ -91,15 +89,13 @@ def create_regions(self):
if "entrance" in link and link["entrance"] != -1:
spoiler = False
if link["entrance"] in crest_warps:
if self.multiworld.crest_shuffle[self.player]:
if self.options.crest_shuffle:
spoiler = True
elif self.multiworld.map_shuffle[self.player] == "everything":
elif self.options.map_shuffle == "everything":
spoiler = True
elif "Subregion" in region.name and self.multiworld.map_shuffle[self.player] not in ("dungeons",
"none"):
elif "Subregion" in region.name and self.options.map_shuffle not in ("dungeons", "none"):
spoiler = True
elif "Subregion" not in region.name and self.multiworld.map_shuffle[self.player] not in ("none",
"overworld"):
elif "Subregion" not in region.name and self.options.map_shuffle not in ("none", "overworld"):
spoiler = True
if spoiler:
@@ -111,6 +107,7 @@ def create_regions(self):
connection.connect(connect_room)
break
non_dead_end_crest_rooms = [
'Libra Temple', 'Aquaria Gemini Room', "GrenadeMan's Mobius Room", 'Fireburg Gemini Room',
'Sealed Temple', 'Alive Forest', 'Kaidge Temple Upper Ledge',
@@ -140,7 +137,7 @@ def set_rules(self) -> None:
add_rule(self.multiworld.get_location("Gidrah", self.player), hard_boss_logic)
add_rule(self.multiworld.get_location("Dullahan", self.player), hard_boss_logic)
if self.multiworld.map_shuffle[self.player]:
if self.options.map_shuffle:
for boss in ("Freezer Crab", "Ice Golem", "Jinn", "Medusa", "Dualhead Hydra"):
loc = self.multiworld.get_location(boss, self.player)
checked_regions = {loc.parent_region}
@@ -158,12 +155,12 @@ def set_rules(self) -> None:
return True
check_foresta(loc.parent_region)
if self.multiworld.logic[self.player] == "friendly":
if self.options.logic == "friendly":
process_rules(self.multiworld.get_entrance("Overworld - Ice Pyramid", self.player),
["MagicMirror"])
process_rules(self.multiworld.get_entrance("Overworld - Volcano", self.player),
["Mask"])
if self.multiworld.map_shuffle[self.player] in ("none", "overworld"):
if self.options.map_shuffle in ("none", "overworld"):
process_rules(self.multiworld.get_entrance("Overworld - Bone Dungeon", self.player),
["Bomb"])
process_rules(self.multiworld.get_entrance("Overworld - Wintry Cave", self.player),
@@ -185,8 +182,8 @@ def set_rules(self) -> None:
process_rules(self.multiworld.get_entrance("Overworld - Mac Ship Doom", self.player),
["DragonClaw", "CaptainCap"])
if self.multiworld.logic[self.player] == "expert":
if self.multiworld.map_shuffle[self.player] == "none" and not self.multiworld.crest_shuffle[self.player]:
if self.options.logic == "expert":
if self.options.map_shuffle == "none" and not self.options.crest_shuffle:
inner_room = self.multiworld.get_region("Wintry Temple Inner Room", self.player)
connection = Entrance(self.player, "Sealed Temple Exit Trick", inner_room)
connection.connect(self.multiworld.get_region("Wintry Temple Outer Room", self.player))
@@ -198,14 +195,14 @@ def set_rules(self) -> None:
if entrance.connected_region.name in non_dead_end_crest_rooms:
entrance.access_rule = lambda state: False
if self.multiworld.sky_coin_mode[self.player] == "shattered_sky_coin":
logic_coins = [16, 24, 32, 32, 38][self.multiworld.shattered_sky_coin_quantity[self.player].value]
if self.options.sky_coin_mode == "shattered_sky_coin":
logic_coins = [16, 24, 32, 32, 38][self.options.shattered_sky_coin_quantity.value]
self.multiworld.get_entrance("Focus Tower 1F - Sky Door", self.player).access_rule = \
lambda state: state.has("Sky Fragment", self.player, logic_coins)
elif self.multiworld.sky_coin_mode[self.player] == "save_the_crystals":
elif self.options.sky_coin_mode == "save_the_crystals":
self.multiworld.get_entrance("Focus Tower 1F - Sky Door", self.player).access_rule = \
lambda state: state.has_all(["Flamerus Rex", "Dualhead Hydra", "Ice Golem", "Pazuzu"], self.player)
elif self.multiworld.sky_coin_mode[self.player] in ("standard", "start_with"):
elif self.options.sky_coin_mode in ("standard", "start_with"):
self.multiworld.get_entrance("Focus Tower 1F - Sky Door", self.player).access_rule = \
lambda state: state.has("Sky Coin", self.player)
@@ -213,26 +210,24 @@ def set_rules(self) -> None:
def stage_set_rules(multiworld):
# If there's no enemies, there's no repeatable income sources
no_enemies_players = [player for player in multiworld.get_game_players("Final Fantasy Mystic Quest")
if multiworld.enemies_density[player] == "none"]
if multiworld.worlds[player].options.enemies_density == "none"]
if (len([item for item in multiworld.itempool if item.classification in (ItemClassification.filler,
ItemClassification.trap)]) > len([player for player in no_enemies_players if
multiworld.accessibility[player] == "minimal"]) * 3):
multiworld.worlds[player].options.accessibility == "minimal"]) * 3):
for player in no_enemies_players:
for location in vendor_locations:
if multiworld.accessibility[player] == "locations":
if multiworld.worlds[player].options.accessibility == "locations":
multiworld.get_location(location, player).progress_type = LocationProgressType.EXCLUDED
else:
multiworld.get_location(location, player).access_rule = lambda state: False
else:
# There are not enough junk items to fill non-minimal players' vendors. Just set an item rule not allowing
# advancement items so that useful items can be placed
# advancement items so that useful items can be placed.
for player in no_enemies_players:
for location in vendor_locations:
multiworld.get_location(location, player).item_rule = lambda item: not item.advancement
class FFMQLocation(Location):
game = "Final Fantasy Mystic Quest"

View File

@@ -10,7 +10,7 @@ from .Regions import create_regions, location_table, set_rules, stage_set_rules,
non_dead_end_crest_warps
from .Items import item_table, item_groups, create_items, FFMQItem, fillers
from .Output import generate_output
from .Options import option_definitions
from .Options import FFMQOptions
from .Client import FFMQClient
@@ -45,7 +45,8 @@ class FFMQWorld(World):
item_name_to_id = {name: data.id for name, data in item_table.items() if data.id is not None}
location_name_to_id = location_table
option_definitions = option_definitions
options_dataclass = FFMQOptions
options: FFMQOptions
topology_present = True
@@ -67,20 +68,14 @@ class FFMQWorld(World):
super().__init__(world, player)
def generate_early(self):
if self.multiworld.sky_coin_mode[self.player] == "shattered_sky_coin":
self.multiworld.brown_boxes[self.player].value = 1
if self.multiworld.enemies_scaling_lower[self.player].value > \
self.multiworld.enemies_scaling_upper[self.player].value:
(self.multiworld.enemies_scaling_lower[self.player].value,
self.multiworld.enemies_scaling_upper[self.player].value) =\
(self.multiworld.enemies_scaling_upper[self.player].value,
self.multiworld.enemies_scaling_lower[self.player].value)
if self.multiworld.bosses_scaling_lower[self.player].value > \
self.multiworld.bosses_scaling_upper[self.player].value:
(self.multiworld.bosses_scaling_lower[self.player].value,
self.multiworld.bosses_scaling_upper[self.player].value) =\
(self.multiworld.bosses_scaling_upper[self.player].value,
self.multiworld.bosses_scaling_lower[self.player].value)
if self.options.sky_coin_mode == "shattered_sky_coin":
self.options.brown_boxes.value = 1
if self.options.enemies_scaling_lower.value > self.options.enemies_scaling_upper.value:
self.options.enemies_scaling_lower.value, self.options.enemies_scaling_upper.value = \
self.options.enemies_scaling_upper.value, self.options.enemies_scaling_lower.value
if self.options.bosses_scaling_lower.value > self.options.bosses_scaling_upper.value:
self.options.bosses_scaling_lower.value, self.options.bosses_scaling_upper.value = \
self.options.bosses_scaling_upper.value, self.options.bosses_scaling_lower.value
@classmethod
def stage_generate_early(cls, multiworld):
@@ -94,20 +89,20 @@ class FFMQWorld(World):
rooms_data = {}
for world in multiworld.get_game_worlds("Final Fantasy Mystic Quest"):
if (world.multiworld.map_shuffle[world.player] or world.multiworld.crest_shuffle[world.player] or
world.multiworld.crest_shuffle[world.player]):
if world.multiworld.map_shuffle_seed[world.player].value.isdigit():
multiworld.random.seed(int(world.multiworld.map_shuffle_seed[world.player].value))
elif world.multiworld.map_shuffle_seed[world.player].value != "random":
multiworld.random.seed(int(hash(world.multiworld.map_shuffle_seed[world.player].value))
+ int(world.multiworld.seed))
if (world.options.map_shuffle or world.options.crest_shuffle or world.options.shuffle_battlefield_rewards
or world.options.companions_locations):
if world.options.map_shuffle_seed.value.isdigit():
multiworld.random.seed(int(world.options.map_shuffle_seed.value))
elif world.options.map_shuffle_seed.value != "random":
multiworld.random.seed(int(hash(world.options.map_shuffle_seed.value))
+ int(world.multiworld.seed))
seed = hex(multiworld.random.randint(0, 0xFFFFFFFF)).split("0x")[1].upper()
map_shuffle = multiworld.map_shuffle[world.player].value
crest_shuffle = multiworld.crest_shuffle[world.player].current_key
battlefield_shuffle = multiworld.shuffle_battlefield_rewards[world.player].current_key
companion_shuffle = multiworld.companions_locations[world.player].value
kaeli_mom = multiworld.kaelis_mom_fight_minotaur[world.player].current_key
map_shuffle = world.options.map_shuffle.value
crest_shuffle = world.options.crest_shuffle.current_key
battlefield_shuffle = world.options.shuffle_battlefield_rewards.current_key
companion_shuffle = world.options.companions_locations.value
kaeli_mom = world.options.kaelis_mom_fight_minotaur.current_key
query = f"s={seed}&m={map_shuffle}&c={crest_shuffle}&b={battlefield_shuffle}&cs={companion_shuffle}&km={kaeli_mom}"
@@ -175,14 +170,14 @@ class FFMQWorld(World):
def extend_hint_information(self, hint_data):
hint_data[self.player] = {}
if self.multiworld.map_shuffle[self.player]:
if self.options.map_shuffle:
single_location_regions = ["Subregion Volcano Battlefield", "Subregion Mac's Ship", "Subregion Doom Castle"]
for subregion in ["Subregion Foresta", "Subregion Aquaria", "Subregion Frozen Fields", "Subregion Fireburg",
"Subregion Volcano Battlefield", "Subregion Windia", "Subregion Mac's Ship",
"Subregion Doom Castle"]:
region = self.multiworld.get_region(subregion, self.player)
for location in region.locations:
if location.address and self.multiworld.map_shuffle[self.player] != "dungeons":
if location.address and self.options.map_shuffle != "dungeons":
hint_data[self.player][location.address] = (subregion.split("Subregion ")[-1]
+ (" Region" if subregion not in
single_location_regions else ""))
@@ -202,14 +197,13 @@ class FFMQWorld(World):
for location in exit_check.connected_region.locations:
if location.address:
hint = []
if self.multiworld.map_shuffle[self.player] != "dungeons":
if self.options.map_shuffle != "dungeons":
hint.append((subregion.split("Subregion ")[-1] + (" Region" if subregion not
in single_location_regions else "")))
if self.multiworld.map_shuffle[self.player] != "overworld" and subregion not in \
("Subregion Mac's Ship", "Subregion Doom Castle"):
if self.options.map_shuffle != "overworld":
hint.append(overworld_spot.name.split("Overworld - ")[-1].replace("Pazuzu",
"Pazuzu's"))
hint = " - ".join(hint)
hint = " - ".join(hint).replace(" - Mac Ship", "")
if location.address in hint_data[self.player]:
hint_data[self.player][location.address] += f"/{hint}"
else:

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -12,7 +12,7 @@ Some steps also assume use of Windows, so may vary with your OS.
## Installing the Archipelago software
The most recent public release of Archipelago can be found on GitHub:
[Archipelago Lastest Release](https://github.com/ArchipelagoMW/Archipelago/releases/latest).
[Archipelago Latest Release](https://github.com/ArchipelagoMW/Archipelago/releases/latest).
Run the exe file, and after accepting the license agreement you will be asked which components you would like to
install.

View File

@@ -554,7 +554,8 @@ class HKWorld(World):
for effect_name, effect_value in item_effects.get(item.name, {}).items():
if state.prog_items[item.player][effect_name] == effect_value:
del state.prog_items[item.player][effect_name]
state.prog_items[item.player][effect_name] -= effect_value
else:
state.prog_items[item.player][effect_name] -= effect_value
return change

View File

@@ -116,12 +116,19 @@ class KH2Context(CommonContext):
# self.inBattle = 0x2A0EAC4 + 0x40
# self.onDeath = 0xAB9078
# PC Address anchors
self.Now = 0x0714DB8
self.Save = 0x09A70B0
# self.Now = 0x0714DB8 old address
# epic addresses
self.Now = 0x0716DF8
self.Save = 0x09A92F0
self.Journal = 0x743260
self.Shop = 0x743350
self.Slot1 = 0x2A22FD8
# self.Sys3 = 0x2A59DF0
# self.Bt10 = 0x2A74880
# self.BtlEnd = 0x2A0D3E0
self.Slot1 = 0x2A20C98
# self.Slot1 = 0x2A20C98 old address
self.kh2_game_version = None # can be egs or steam
self.chest_set = set(exclusion_table["Chests"])
self.keyblade_set = set(CheckDupingItems["Weapons"]["Keyblades"])
@@ -228,6 +235,9 @@ class KH2Context(CommonContext):
def kh2_write_int(self, address, value):
self.kh2.write_int(self.kh2.base_address + address, value)
def kh2_read_string(self, address, length):
return self.kh2.read_string(self.kh2.base_address + address, length)
def on_package(self, cmd: str, args: dict):
if cmd in {"RoomInfo"}:
self.kh2seedname = args['seed_name']
@@ -367,10 +377,26 @@ class KH2Context(CommonContext):
for weapon_location in all_weapon_slot:
all_weapon_location_id.append(self.kh2_loc_name_to_id[weapon_location])
self.all_weapon_location_id = set(all_weapon_location_id)
try:
self.kh2 = pymem.Pymem(process_name="KINGDOM HEARTS II FINAL MIX")
logger.info("You are now auto-tracking")
self.kh2connected = True
if self.kh2_game_version is None:
if self.kh2_read_string(0x09A9830, 4) == "KH2J":
self.kh2_game_version = "STEAM"
self.Now = 0x0717008
self.Save = 0x09A9830
self.Slot1 = 0x2A23518
self.Journal = 0x7434E0
self.Shop = 0x7435D0
elif self.kh2_read_string(0x09A92F0, 4) == "KH2J":
self.kh2_game_version = "EGS"
else:
self.kh2_game_version = None
logger.info("Your game version is out of date. Please update your game via The Epic Games Store or Steam.")
if self.kh2_game_version is not None:
logger.info(f"You are now auto-tracking. {self.kh2_game_version}")
self.kh2connected = True
except Exception as e:
if self.kh2connected:
@@ -589,8 +615,8 @@ class KH2Context(CommonContext):
# if journal=-1 and shop = 5 then in shop
# if journal !=-1 and shop = 10 then journal
journal = self.kh2_read_short(0x741230)
shop = self.kh2_read_short(0x741320)
journal = self.kh2_read_short(self.Journal)
shop = self.kh2_read_short(self.Shop)
if (journal == -1 and shop == 5) or (journal != -1 and shop == 10):
# print("your in the shop")
sellable_dict = {}
@@ -599,8 +625,8 @@ class KH2Context(CommonContext):
amount = self.kh2_read_byte(self.Save + itemdata.memaddr)
sellable_dict[itemName] = amount
while (journal == -1 and shop == 5) or (journal != -1 and shop == 10):
journal = self.kh2_read_short(0x741230)
shop = self.kh2_read_short(0x741320)
journal = self.kh2_read_short(self.Journal)
shop = self.kh2_read_short(self.Shop)
await asyncio.sleep(0.5)
for item, amount in sellable_dict.items():
itemdata = self.item_name_to_data[item]
@@ -750,7 +776,7 @@ class KH2Context(CommonContext):
item_data = self.item_name_to_data[item_name]
amount_of_items = 0
amount_of_items += self.kh2_seed_save_cache["AmountInvo"]["Magic"][item_name]
if self.kh2_read_byte(self.Save + item_data.memaddr) != amount_of_items and self.kh2_read_byte(0x741320) in {10, 8}:
if self.kh2_read_byte(self.Save + item_data.memaddr) != amount_of_items and self.kh2_read_byte(self.Shop) in {10, 8}:
self.kh2_write_byte(self.Save + item_data.memaddr, amount_of_items)
for item_name in master_stat:
@@ -802,7 +828,7 @@ class KH2Context(CommonContext):
self.kh2_write_byte(self.Save + 0x2502, current_item_slots + 1)
elif self.base_item_slots + amount_of_items < 8:
self.kh2_write_byte(self.Save + 0x2502, self.base_item_slots + amount_of_items)
# if self.kh2_read_byte(self.Save + item_data.memaddr) != amount_of_items \
# and self.kh2_read_byte(self.Slot1 + 0x1B2) >= 5 and \
# self.kh2_read_byte(self.Save + 0x23DF) & 0x1 << 3 > 0 and self.kh2_read_byte(0x741320) in {10, 8}:
@@ -905,8 +931,23 @@ async def kh2_watcher(ctx: KH2Context):
await asyncio.sleep(15)
ctx.kh2 = pymem.Pymem(process_name="KINGDOM HEARTS II FINAL MIX")
if ctx.kh2 is not None:
logger.info("You are now auto-tracking")
ctx.kh2connected = True
if ctx.kh2_game_version is None:
if ctx.kh2_read_string(0x09A9830, 4) == "KH2J":
ctx.kh2_game_version = "STEAM"
ctx.Now = 0x0717008
ctx.Save = 0x09A9830
ctx.Slot1 = 0x2A23518
ctx.Journal = 0x7434E0
ctx.Shop = 0x7435D0
elif ctx.kh2_read_string(0x09A92F0, 4) == "KH2J":
ctx.kh2_game_version = "EGS"
else:
ctx.kh2_game_version = None
logger.info("Your game version is out of date. Please update your game via The Epic Games Store or Steam.")
if ctx.kh2_game_version is not None:
logger.info(f"You are now auto-tracking {ctx.kh2_game_version}")
ctx.kh2connected = True
except Exception as e:
if ctx.kh2connected:
ctx.kh2connected = False

View File

@@ -19,7 +19,7 @@ class DroppedKey(ItemInfo):
extra = 0x01F8
super().__init__(room, extra)
def patch(self, rom, option, *, multiworld=None):
if (option.startswith(MAP) and option != MAP) or (option.startswith(COMPASS) and option != COMPASS) or option.startswith(STONE_BEAK) or (option.startswith(NIGHTMARE_KEY) and option != NIGHTMARE_KEY )or (option.startswith(KEY) and option != KEY):
if (option.startswith(MAP) and option != MAP) or (option.startswith(COMPASS) and option != COMPASS) or (option.startswith(STONE_BEAK) and option != STONE_BEAK) or (option.startswith(NIGHTMARE_KEY) and option != NIGHTMARE_KEY) or (option.startswith(KEY) and option != KEY):
if option[-1] == 'P':
print(option)
if self._location.dungeon == int(option[-1]) and multiworld is None and self.room not in {0x166, 0x223}:

View File

@@ -52,6 +52,7 @@ class TextShuffle(DefaultOffToggle):
[On] Shuffles all the text in the game
[Off] (default) doesn't shuffle them.
"""
display_name = "Text Shuffle"
class Rooster(DefaultOnToggle, LADXROption):
@@ -68,7 +69,8 @@ class Boomerang(Choice):
[Normal] requires Magnifying Lens to get the boomerang.
[Gift] The boomerang salesman will give you a random item, and the boomerang is shuffled.
"""
display_name = "Boomerang"
normal = 0
gift = 1
default = gift
@@ -113,6 +115,7 @@ class APTitleScreen(DefaultOnToggle):
class BossShuffle(Choice):
display_name = "Boss Shuffle"
none = 0
shuffle = 1
random = 2
@@ -120,6 +123,7 @@ class BossShuffle(Choice):
class DungeonItemShuffle(Choice):
display_name = "Dungeon Item Shuffle"
option_original_dungeon = 0
option_own_dungeons = 1
option_own_world = 2
@@ -291,6 +295,7 @@ class Bowwow(Choice):
[Normal] BowWow is in the item pool, but can be logically expected as a damage source.
[Swordless] The progressive swords are removed from the item pool.
"""
display_name = "BowWow"
normal = 0
swordless = 1
default = normal
@@ -466,6 +471,7 @@ class Music(Choice, LADXROption):
[Shuffled] Shuffled Music
[Off] No music
"""
display_name = "Music"
ladxr_name = "music"
option_vanilla = 0
option_shuffled = 1
@@ -485,6 +491,7 @@ class WarpImprovements(DefaultOffToggle):
[On] Adds remake style warp screen to the game. Choose your warp destination on the map after jumping in a portal and press B to select.
[Off] No change
"""
display_name = "Warp Improvements"
class AdditionalWarpPoints(DefaultOffToggle):
@@ -492,6 +499,7 @@ class AdditionalWarpPoints(DefaultOffToggle):
[On] (requires warp improvements) Adds a warp point at Crazy Tracy's house (the Mambo teleport spot) and Eagle's Tower
[Off] No change
"""
display_name = "Additional Warp Points"
ladx_option_groups = [
OptionGroup("Goal Options", [

View File

@@ -1,4 +1,4 @@
from worlds.ladx.LADXR.checkMetadata import checkMetadataTable
from .LADXR.checkMetadata import checkMetadataTable
import json
import logging
import websockets

View File

@@ -98,9 +98,12 @@ class LinksAwakeningWorld(World):
# Items can be grouped using their names to allow easy checking if any item
# from that group has been collected. Group names can also be used for !hint
#item_name_groups = {
# "weapons": {"sword", "lance"}
#}
item_name_groups = {
"Instruments": {
"Full Moon Cello", "Conch Horn", "Sea Lily's Bell", "Surf Harp",
"Wind Marimba", "Coral Triangle", "Organ of Evening Calm", "Thunder Drum"
},
}
prefill_dungeon_items = None

View File

@@ -3,13 +3,13 @@ Archipelago init file for Lingo
"""
from logging import warning
from BaseClasses import Item, ItemClassification, Tutorial
from BaseClasses import CollectionState, Item, ItemClassification, Tutorial
from Options import OptionError
from worlds.AutoWorld import WebWorld, World
from .datatypes import Room, RoomEntrance
from .items import ALL_ITEM_TABLE, ITEMS_BY_GROUP, TRAP_ITEMS, LingoItem
from .locations import ALL_LOCATION_TABLE, LOCATIONS_BY_GROUP
from .options import LingoOptions, lingo_option_groups
from .options import LingoOptions, lingo_option_groups, SunwarpAccess, VictoryCondition
from .player_logic import LingoPlayerLogic
from .regions import create_regions
@@ -54,20 +54,54 @@ class LingoWorld(World):
player_logic: LingoPlayerLogic
def generate_early(self):
if not (self.options.shuffle_doors or self.options.shuffle_colors or self.options.shuffle_sunwarps):
if not (self.options.shuffle_doors or self.options.shuffle_colors or
(self.options.sunwarp_access >= SunwarpAccess.option_unlock and
self.options.victory_condition == VictoryCondition.option_pilgrimage)):
if self.multiworld.players == 1:
warning(f"{self.multiworld.get_player_name(self.player)}'s Lingo world doesn't have any progression"
f" items. Please turn on Door Shuffle, Color Shuffle, or Sunwarp Shuffle if that doesn't seem"
f" right.")
warning(f"{self.player_name}'s Lingo world doesn't have any progression items. Please turn on Door"
f" Shuffle or Color Shuffle, or use item-blocked sunwarps with the Pilgrimage victory condition"
f" if that doesn't seem right.")
else:
raise OptionError(f"{self.multiworld.get_player_name(self.player)}'s Lingo world doesn't have any"
f" progression items. Please turn on Door Shuffle, Color Shuffle or Sunwarp Shuffle.")
raise OptionError(f"{self.player_name}'s Lingo world doesn't have any progression items. Please turn on"
f" Door Shuffle or Color Shuffle, or use item-blocked sunwarps with the Pilgrimage"
f" victory condition.")
self.player_logic = LingoPlayerLogic(self)
def create_regions(self):
create_regions(self)
if not self.options.shuffle_postgame:
state = CollectionState(self.multiworld)
state.collect(LingoItem("Prevent Victory", ItemClassification.progression, None, self.player), True)
# Note: relies on the assumption that real_items is a definitive list of real progression items in this
# world, and is not modified after being created.
for item in self.player_logic.real_items:
state.collect(self.create_item(item), True)
# Exception to the above: a forced good item is not considered a "real item", but needs to be here anyway.
if self.player_logic.forced_good_item != "":
state.collect(self.create_item(self.player_logic.forced_good_item), True)
all_locations = self.multiworld.get_locations(self.player)
state.sweep_for_events(locations=all_locations)
unreachable_locations = [location for location in all_locations
if not state.can_reach_location(location.name, self.player)]
for location in unreachable_locations:
if location.name in self.player_logic.event_loc_to_item.keys():
continue
self.player_logic.real_locations.remove(location.name)
location.parent_region.locations.remove(location)
if len(self.player_logic.real_items) > len(self.player_logic.real_locations):
raise OptionError(f"{self.player_name}'s Lingo world does not have enough locations to fit the number"
f" of required items without shuffling the postgame. Either enable postgame"
f" shuffling, or choose different options.")
def create_items(self):
pool = [self.create_item(name) for name in self.player_logic.real_items]
@@ -136,7 +170,8 @@ class LingoWorld(World):
slot_options = [
"death_link", "victory_condition", "shuffle_colors", "shuffle_doors", "shuffle_paintings", "shuffle_panels",
"enable_pilgrimage", "sunwarp_access", "mastery_achievements", "level_2_requirement", "location_checks",
"early_color_hallways", "pilgrimage_allows_roof_access", "pilgrimage_allows_paintings", "shuffle_sunwarps"
"early_color_hallways", "pilgrimage_allows_roof_access", "pilgrimage_allows_paintings", "shuffle_sunwarps",
"group_doors"
]
slot_data = {

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -272,8 +272,9 @@ panels:
PAINTING (4): 445081
PAINTING (5): 445082
ROOM: 445083
Orange Tower Seventh Floor:
Ending Area:
THE END: 444620
Orange Tower Seventh Floor:
THE MASTER: 444621
MASTERY: 444622
Behind A Smile:
@@ -1477,3 +1478,145 @@ progression:
Progressive Art Gallery: 444563
Progressive Colorful: 444580
Progressive Pilgrimage: 444583
Progressive Suits Area: 444602
Progressive Symmetry Room: 444608
Progressive Number Hunt: 444654
panel_doors:
Starting Room:
HIDDEN: 444589
Hidden Room:
OPEN: 444590
Hub Room:
ORDER: 444591
SLAUGHTER: 444592
TRACE: 444594
RAT: 444595
OPEN: 444596
Crossroads:
DECAY: 444597
NOPE: 444598
WE ROT: 444599
WORDS SWORD: 444600
BEND HI: 444601
Lost Area:
LOST: 444603
Amen Name Area:
AMEN NAME: 444604
The Tenacious:
Black Palindromes: 444605
Near Far Area:
NEAR FAR: 444606
Warts Straw Area:
WARTS STRAW: 444609
Leaf Feel Area:
LEAF FEEL: 444610
Outside The Agreeable:
MASSACRED: 444611
BLACK: 444612
CLOSE: 444613
RIGHT: 444614
Compass Room:
Lookout: 444615
Hedge Maze:
DOWN: 444617
The Perceptive:
GAZE: 444618
The Observant:
BACKSIDE: 444619
STAIRS: 444621
The Incomparable:
Giant Sevens: 444622
Orange Tower:
Access: 444623
Orange Tower First Floor:
SECRET: 444624
Orange Tower Fourth Floor:
HOT CRUSTS: 444625
Orange Tower Fifth Floor:
SIZE: 444626
First Second Third Fourth:
FIRST SECOND THIRD FOURTH: 444627
The Colorful (White):
BEGIN: 444628
The Colorful (Black):
FOUND: 444630
The Colorful (Red):
LOAF: 444631
The Colorful (Yellow):
CREAM: 444632
The Colorful (Blue):
SUN: 444633
The Colorful (Purple):
SPOON: 444634
The Colorful (Orange):
LETTERS: 444635
The Colorful (Green):
WALLS: 444636
The Colorful (Brown):
IRON: 444637
The Colorful (Gray):
OBSTACLE: 444638
Owl Hallway:
STRAYS: 444639
Outside The Initiated:
UNCOVER: 444640
OXEN: 444641
Outside The Bold:
UNOPEN: 444642
BEGIN: 444643
Outside The Undeterred:
ZERO: 444644
PEN: 444645
TWO: 444646
THREE: 444647
FOUR: 444648
Number Hunt:
FIVE: 444649
SIX: 444650
SEVEN: 444651
EIGHT: 444652
NINE: 444653
Color Hunt:
EXIT: 444655
RED: 444656
BLUE: 444658
YELLOW: 444659
ORANGE: 444660
PURPLE: 444661
GREEN: 444662
The Bearer:
FARTHER: 444663
MIDDLE: 444664
Knight Night (Final):
TRUSTED: 444665
Outside The Wondrous:
SHRINK: 444666
Hallway Room (1):
CASTLE: 444667
Hallway Room (2):
COUNTERCLOCKWISE: 444669
Hallway Room (3):
TRANSFORMATION: 444670
Hallway Room (4):
WHEELBARROW: 444671
Outside The Wanderer:
WANDERLUST: 444672
Art Gallery:
ORDER: 444673
Room Room:
STAIRS: 444674
Colors: 444676
Outside The Wise:
KITTEN CAT: 444677
Outside The Scientific:
OPEN: 444678
Directional Gallery:
TURN LEARN: 444679
panel_groups:
Tenacious Entrance Panels: 444593
Symmetry Room Panels: 444607
Backside Entrance Panels: 444620
Colorful Panels: 444629
Color Hunt Panels: 444657
Hallway Room Panels: 444668
Room Room Panels: 444675

View File

@@ -12,6 +12,11 @@ class RoomAndPanel(NamedTuple):
panel: str
class RoomAndPanelDoor(NamedTuple):
room: Optional[str]
panel_door: str
class EntranceType(Flag):
NORMAL = auto()
PAINTING = auto()
@@ -63,9 +68,15 @@ class Panel(NamedTuple):
exclude_reduce: bool
achievement: bool
non_counting: bool
panel_door: Optional[RoomAndPanelDoor] # This will always be fully specified.
location_name: Optional[str]
class PanelDoor(NamedTuple):
item_name: str
panel_group: Optional[str]
class Painting(NamedTuple):
id: str
room: str

View File

@@ -3,7 +3,7 @@ from typing import Dict, List, NamedTuple, Set
from BaseClasses import Item, ItemClassification
from .static_logic import DOORS_BY_ROOM, PROGRESSIVE_ITEMS, get_door_group_item_id, get_door_item_id, \
get_progressive_item_id, get_special_item_id
get_progressive_item_id, get_special_item_id, PANEL_DOORS_BY_ROOM, get_panel_door_item_id, get_panel_group_item_id
class ItemType(Enum):
@@ -65,6 +65,21 @@ def load_item_data():
ItemClassification.progression, ItemType.NORMAL, True, [])
ITEMS_BY_GROUP.setdefault("Doors", []).append(group)
panel_groups: Set[str] = set()
for room_name, panel_doors in PANEL_DOORS_BY_ROOM.items():
for panel_door_name, panel_door in panel_doors.items():
if panel_door.panel_group is not None:
panel_groups.add(panel_door.panel_group)
ALL_ITEM_TABLE[panel_door.item_name] = ItemData(get_panel_door_item_id(room_name, panel_door_name),
ItemClassification.progression, ItemType.NORMAL, False, [])
ITEMS_BY_GROUP.setdefault("Panels", []).append(panel_door.item_name)
for group in panel_groups:
ALL_ITEM_TABLE[group] = ItemData(get_panel_group_item_id(group), ItemClassification.progression,
ItemType.NORMAL, False, [])
ITEMS_BY_GROUP.setdefault("Panels", []).append(group)
special_items: Dict[str, ItemClassification] = {
":)": ItemClassification.filler,
"The Feeling of Being Lost": ItemClassification.filler,

View File

@@ -8,21 +8,31 @@ from .items import TRAP_ITEMS
class ShuffleDoors(Choice):
"""If on, opening doors will require their respective "keys".
"""This option specifies how doors open.
- **Simple:** Doors are sorted into logical groups, which are all opened by
receiving an item.
- **Complex:** The items are much more granular, and will usually only open
a single door each.
- **None:** Doors in the game will open the way they do in vanilla.
- **Panels:** Doors still open as in vanilla, but the panels that open the
doors will be locked, and an item will be required to unlock the panels.
- **Doors:** the doors themselves are locked behind items, and will open
automatically without needing to solve a panel once the key is obtained.
"""
display_name = "Shuffle Doors"
option_none = 0
option_simple = 1
option_complex = 2
option_panels = 1
option_doors = 2
alias_simple = 2
alias_complex = 2
class GroupDoors(Toggle):
"""By default, door shuffle in either panels or doors mode will create individual keys for every panel or door to be locked.
When group doors is on, some panels and doors are sorted into logical groups, which are opened together by receiving an item."""
display_name = "Group Doors"
class ProgressiveOrangeTower(DefaultOnToggle):
"""When "Shuffle Doors" is on, this setting governs the manner in which the Orange Tower floors open up.
"""When "Shuffle Doors" is on doors mode, this setting governs the manner in which the Orange Tower floors open up.
- **Off:** There is an item for each floor of the tower, and each floor's
item is the only one needed to access that floor.
@@ -33,7 +43,7 @@ class ProgressiveOrangeTower(DefaultOnToggle):
class ProgressiveColorful(DefaultOnToggle):
"""When "Shuffle Doors" is on "complex", this setting governs the manner in which The Colorful opens up.
"""When "Shuffle Doors" is on either panels or doors mode and "Group Doors" is off, this setting governs the manner in which The Colorful opens up.
- **Off:** There is an item for each room of The Colorful, meaning that
random rooms in the middle of the sequence can open up without giving you
@@ -194,6 +204,11 @@ class EarlyColorHallways(Toggle):
display_name = "Early Color Hallways"
class ShufflePostgame(Toggle):
"""When off, locations that could not be reached without also reaching your victory condition are removed."""
display_name = "Shuffle Postgame"
class TrapPercentage(Range):
"""Replaces junk items with traps, at the specified rate."""
display_name = "Trap Percentage"
@@ -248,6 +263,7 @@ lingo_option_groups = [
@dataclass
class LingoOptions(PerGameCommonOptions):
shuffle_doors: ShuffleDoors
group_doors: GroupDoors
progressive_orange_tower: ProgressiveOrangeTower
progressive_colorful: ProgressiveColorful
location_checks: LocationChecks
@@ -263,6 +279,7 @@ class LingoOptions(PerGameCommonOptions):
mastery_achievements: MasteryAchievements
level_2_requirement: Level2Requirement
early_color_hallways: EarlyColorHallways
shuffle_postgame: ShufflePostgame
trap_percentage: TrapPercentage
trap_weights: TrapWeights
puzzle_skip_percentage: PuzzleSkipPercentage

View File

@@ -7,8 +7,8 @@ from .items import ALL_ITEM_TABLE, ItemType
from .locations import ALL_LOCATION_TABLE, LocationClassification
from .options import LocationChecks, ShuffleDoors, SunwarpAccess, VictoryCondition
from .static_logic import DOORS_BY_ROOM, PAINTINGS, PAINTING_ENTRANCES, PAINTING_EXITS, \
PANELS_BY_ROOM, PROGRESSION_BY_ROOM, REQUIRED_PAINTING_ROOMS, REQUIRED_PAINTING_WHEN_NO_DOORS_ROOMS, \
SUNWARP_ENTRANCES, SUNWARP_EXITS
PANELS_BY_ROOM, REQUIRED_PAINTING_ROOMS, REQUIRED_PAINTING_WHEN_NO_DOORS_ROOMS, PROGRESSIVE_DOORS_BY_ROOM, \
PANEL_DOORS_BY_ROOM, PROGRESSIVE_PANELS_BY_ROOM, SUNWARP_ENTRANCES, SUNWARP_EXITS
if TYPE_CHECKING:
from . import LingoWorld
@@ -18,23 +18,35 @@ class AccessRequirements:
rooms: Set[str]
doors: Set[RoomAndDoor]
colors: Set[str]
items: Set[str]
progression: Dict[str, int]
the_master: bool
postgame: bool
def __init__(self):
self.rooms = set()
self.doors = set()
self.colors = set()
self.items = set()
self.progression = dict()
self.the_master = False
self.postgame = False
def merge(self, other: "AccessRequirements"):
self.rooms |= other.rooms
self.doors |= other.doors
self.colors |= other.colors
self.items |= other.items
self.the_master |= other.the_master
self.postgame |= other.postgame
for progression, index in other.progression.items():
if progression not in self.progression or index > self.progression[progression]:
self.progression[progression] = index
def __str__(self):
return f"AccessRequirements(rooms={self.rooms}, doors={self.doors}, colors={self.colors})," \
f" the_master={self.the_master}"
return f"AccessRequirements(rooms={self.rooms}, doors={self.doors}, colors={self.colors}, items={self.items}," \
f" progression={self.progression}), the_master={self.the_master}, postgame={self.postgame}"
class PlayerLocation(NamedTuple):
@@ -114,15 +126,15 @@ class LingoPlayerLogic:
self.item_by_door.setdefault(room, {})[door] = item
def handle_non_grouped_door(self, room_name: str, door_data: Door, world: "LingoWorld"):
if room_name in PROGRESSION_BY_ROOM and door_data.name in PROGRESSION_BY_ROOM[room_name]:
progression_name = PROGRESSION_BY_ROOM[room_name][door_data.name].item_name
if room_name in PROGRESSIVE_DOORS_BY_ROOM and door_data.name in PROGRESSIVE_DOORS_BY_ROOM[room_name]:
progression_name = PROGRESSIVE_DOORS_BY_ROOM[room_name][door_data.name].item_name
progression_handling = should_split_progression(progression_name, world)
if progression_handling == ProgressiveItemBehavior.SPLIT:
self.set_door_item(room_name, door_data.name, door_data.item_name)
self.real_items.append(door_data.item_name)
elif progression_handling == ProgressiveItemBehavior.PROGRESSIVE:
progressive_item_name = PROGRESSION_BY_ROOM[room_name][door_data.name].item_name
progressive_item_name = PROGRESSIVE_DOORS_BY_ROOM[room_name][door_data.name].item_name
self.set_door_item(room_name, door_data.name, progressive_item_name)
self.real_items.append(progressive_item_name)
else:
@@ -153,17 +165,31 @@ class LingoPlayerLogic:
victory_condition = world.options.victory_condition
early_color_hallways = world.options.early_color_hallways
if location_checks == LocationChecks.option_reduced and door_shuffle != ShuffleDoors.option_none:
raise OptionError("You cannot have reduced location checks when door shuffle is on, because there would not"
" be enough locations for all of the door items.")
if location_checks == LocationChecks.option_reduced:
if door_shuffle == ShuffleDoors.option_doors:
raise OptionError(f"Slot \"{world.player_name}\" cannot have reduced location checks when door shuffle"
f" is on, because there would not be enough locations for all of the door items.")
if door_shuffle == ShuffleDoors.option_panels:
if not world.options.group_doors:
raise OptionError(f"Slot \"{world.player_name}\" cannot have reduced location checks when ungrouped"
f" panels mode door shuffle is on, because there would not be enough locations for"
f" all of the panel items.")
if color_shuffle:
raise OptionError(f"Slot \"{world.player_name}\" cannot have reduced location checks with both"
f" panels mode door shuffle and color shuffle because there would not be enough"
f" locations for all of the items.")
if world.options.sunwarp_access >= SunwarpAccess.option_individual:
raise OptionError(f"Slot \"{world.player_name}\" cannot have reduced location checks with both"
f" panels mode door shuffle and individual or progressive sunwarp access because"
f" there would not be enough locations for all of the items.")
# Create door items, where needed.
door_groups: Set[str] = set()
for room_name, room_data in DOORS_BY_ROOM.items():
for door_name, door_data in room_data.items():
if door_data.skip_item is False and door_data.event is False:
if door_data.type == DoorType.NORMAL and door_shuffle != ShuffleDoors.option_none:
if door_data.door_group is not None and door_shuffle == ShuffleDoors.option_simple:
if door_data.type == DoorType.NORMAL and door_shuffle == ShuffleDoors.option_doors:
if door_data.door_group is not None and world.options.group_doors:
# Grouped doors are handled differently if shuffle doors is on simple.
self.set_door_item(room_name, door_name, door_data.door_group)
door_groups.add(door_data.door_group)
@@ -185,21 +211,33 @@ class LingoPlayerLogic:
self.real_items.append(door_data.item_name)
self.real_items += door_groups
# Create panel items, where needed.
if world.options.shuffle_doors == ShuffleDoors.option_panels:
panel_groups: Set[str] = set()
for room_name, room_data in PANEL_DOORS_BY_ROOM.items():
for panel_door_name, panel_door_data in room_data.items():
if panel_door_data.panel_group is not None and world.options.group_doors:
panel_groups.add(panel_door_data.panel_group)
elif room_name in PROGRESSIVE_PANELS_BY_ROOM \
and panel_door_name in PROGRESSIVE_PANELS_BY_ROOM[room_name]:
progression_obj = PROGRESSIVE_PANELS_BY_ROOM[room_name][panel_door_name]
progression_handling = should_split_progression(progression_obj.item_name, world)
if progression_handling == ProgressiveItemBehavior.SPLIT:
self.real_items.append(panel_door_data.item_name)
elif progression_handling == ProgressiveItemBehavior.PROGRESSIVE:
self.real_items.append(progression_obj.item_name)
else:
self.real_items.append(panel_door_data.item_name)
self.real_items += panel_groups
# Create color items, if needed.
if color_shuffle:
self.real_items += [name for name, item in ALL_ITEM_TABLE.items() if item.type == ItemType.COLOR]
# Create events for each achievement panel, so that we can determine when THE MASTER is accessible.
for room_name, room_data in PANELS_BY_ROOM.items():
for panel_name, panel_data in room_data.items():
if panel_data.achievement:
access_req = AccessRequirements()
access_req.merge(self.calculate_panel_requirements(room_name, panel_name, world))
access_req.rooms.add(room_name)
self.mastery_reqs.append(access_req)
# Handle the victory condition. Victory conditions other than the chosen one become regular checks, so we need
# to prevent the actual victory condition from becoming a check.
self.mastery_location = "Orange Tower Seventh Floor - THE MASTER"
@@ -207,7 +245,7 @@ class LingoPlayerLogic:
if victory_condition == VictoryCondition.option_the_end:
self.victory_condition = "Orange Tower Seventh Floor - THE END"
self.add_location("Orange Tower Seventh Floor", "The End (Solved)", None, [], world)
self.add_location("Ending Area", "The End (Solved)", None, [], world)
self.event_loc_to_item["The End (Solved)"] = "Victory"
elif victory_condition == VictoryCondition.option_the_master:
self.victory_condition = "Orange Tower Seventh Floor - THE MASTER"
@@ -231,6 +269,16 @@ class LingoPlayerLogic:
[RoomAndPanel("Pilgrim Antechamber", "PILGRIM")], world)
self.event_loc_to_item["PILGRIM (Solved)"] = "Victory"
# Create events for each achievement panel, so that we can determine when THE MASTER is accessible.
for room_name, room_data in PANELS_BY_ROOM.items():
for panel_name, panel_data in room_data.items():
if panel_data.achievement:
access_req = AccessRequirements()
access_req.merge(self.calculate_panel_requirements(room_name, panel_name, world))
access_req.rooms.add(room_name)
self.mastery_reqs.append(access_req)
# Create groups of counting panel access requirements for the LEVEL 2 check.
self.create_panel_hunt_events(world)
@@ -241,7 +289,7 @@ class LingoPlayerLogic:
elif location_checks == LocationChecks.option_insanity:
location_classification = LocationClassification.insanity
if door_shuffle != ShuffleDoors.option_none and not early_color_hallways:
if door_shuffle == ShuffleDoors.option_doors and not early_color_hallways:
location_classification |= LocationClassification.small_sphere_one
for location_name, location_data in ALL_LOCATION_TABLE.items():
@@ -283,7 +331,7 @@ class LingoPlayerLogic:
"iterations. This is very unlikely to happen on its own, and probably indicates some "
"kind of logic error.")
if door_shuffle != ShuffleDoors.option_none and location_checks != LocationChecks.option_insanity \
if door_shuffle == ShuffleDoors.option_doors and location_checks != LocationChecks.option_insanity \
and not early_color_hallways and world.multiworld.players > 1:
# Under the combination of door shuffle, normal location checks, and no early color hallways, sphere 1 is
# only three checks. In a multiplayer situation, this can be frustrating for the player because they are
@@ -298,19 +346,19 @@ class LingoPlayerLogic:
# Starting Room - Exit Door gives access to OPEN and TRACE.
good_item_options: List[str] = ["Starting Room - Back Right Door", "Second Room - Exit Door"]
if not color_shuffle and not world.options.enable_pilgrimage:
# HOT CRUST and THIS.
good_item_options.append("Pilgrim Room - Sun Painting")
if not color_shuffle:
if door_shuffle == ShuffleDoors.option_simple:
if not world.options.enable_pilgrimage:
# HOT CRUST and THIS.
good_item_options.append("Pilgrim Room - Sun Painting")
if world.options.group_doors:
# WELCOME BACK, CLOCKWISE, and DRAWL + RUNS.
good_item_options.append("Welcome Back Doors")
else:
# WELCOME BACK and CLOCKWISE.
good_item_options.append("Welcome Back Area - Shortcut to Starting Room")
if door_shuffle == ShuffleDoors.option_simple:
if world.options.group_doors:
# Color hallways access (NOTE: reconsider when sunwarp shuffling exists).
good_item_options.append("Rhyme Room Doors")
@@ -356,13 +404,11 @@ class LingoPlayerLogic:
def randomize_paintings(self, world: "LingoWorld") -> bool:
self.painting_mapping.clear()
door_shuffle = world.options.shuffle_doors
# First, assign mappings to the required-exit paintings. We ensure that req-blocked paintings do not lead to
# required paintings.
req_exits = []
required_painting_rooms = REQUIRED_PAINTING_ROOMS
if door_shuffle == ShuffleDoors.option_none:
if world.options.shuffle_doors != ShuffleDoors.option_doors:
required_painting_rooms += REQUIRED_PAINTING_WHEN_NO_DOORS_ROOMS
req_exits = [painting_id for painting_id, painting in PAINTINGS.items() if painting.required_when_no_doors]
@@ -429,7 +475,7 @@ class LingoPlayerLogic:
for painting_id, painting in PAINTINGS.items():
if painting_id not in self.painting_mapping.values() \
and (painting.required or (painting.required_when_no_doors and
door_shuffle == ShuffleDoors.option_none)):
world.options.shuffle_doors != ShuffleDoors.option_doors)):
return False
return True
@@ -444,12 +490,31 @@ class LingoPlayerLogic:
access_reqs = AccessRequirements()
panel_object = PANELS_BY_ROOM[room][panel]
if world.options.shuffle_doors == ShuffleDoors.option_panels and panel_object.panel_door is not None:
panel_door_room = panel_object.panel_door.room
panel_door_name = panel_object.panel_door.panel_door
panel_door = PANEL_DOORS_BY_ROOM[panel_door_room][panel_door_name]
if panel_door.panel_group is not None and world.options.group_doors:
access_reqs.items.add(panel_door.panel_group)
elif panel_door_room in PROGRESSIVE_PANELS_BY_ROOM\
and panel_door_name in PROGRESSIVE_PANELS_BY_ROOM[panel_door_room]:
progression_obj = PROGRESSIVE_PANELS_BY_ROOM[panel_door_room][panel_door_name]
progression_handling = should_split_progression(progression_obj.item_name, world)
if progression_handling == ProgressiveItemBehavior.SPLIT:
access_reqs.items.add(panel_door.item_name)
elif progression_handling == ProgressiveItemBehavior.PROGRESSIVE:
access_reqs.progression[progression_obj.item_name] = progression_obj.index
else:
access_reqs.items.add(panel_door.item_name)
for req_room in panel_object.required_rooms:
access_reqs.rooms.add(req_room)
for req_door in panel_object.required_doors:
door_object = DOORS_BY_ROOM[room if req_door.room is None else req_door.room][req_door.door]
if door_object.event or world.options.shuffle_doors == ShuffleDoors.option_none:
if door_object.event or world.options.shuffle_doors != ShuffleDoors.option_doors:
sub_access_reqs = self.calculate_door_requirements(
room if req_door.room is None else req_door.room, req_door.door, world)
access_reqs.merge(sub_access_reqs)
@@ -470,6 +535,11 @@ class LingoPlayerLogic:
if panel == "THE MASTER":
access_reqs.the_master = True
# Evil python magic (so sayeth NewSoupVi): this checks victory_condition against the panel's location name
# override if it exists, or the auto-generated location name if it's None.
if self.victory_condition == (panel_object.location_name or f"{room} - {panel}"):
access_reqs.postgame = True
self.panel_reqs[room][panel] = access_reqs
return self.panel_reqs[room][panel]
@@ -514,11 +584,14 @@ class LingoPlayerLogic:
continue
# We won't coalesce any panels that have requirements beyond colors. To simplify things for now, we will
# only coalesce single-color panels. Chains/stacks/combo puzzles will be separate. THE MASTER has
# special access rules and is handled separately.
# only coalesce single-color panels. Chains/stacks/combo puzzles will be separate. Panel door locked
# puzzles will be separate if panels mode is on. THE MASTER has special access rules and is handled
# separately.
if len(panel_data.required_panels) > 0 or len(panel_data.required_doors) > 0\
or len(panel_data.required_rooms) > 0\
or (world.options.shuffle_colors and len(panel_data.colors) > 1)\
or (world.options.shuffle_doors == ShuffleDoors.option_panels
and panel_data.panel_door is not None)\
or panel_name == "THE MASTER":
self.counting_panel_reqs.setdefault(room_name, []).append(
(self.calculate_panel_requirements(room_name, panel_name, world), 1))

View File

@@ -159,7 +159,7 @@ def create_regions(world: "LingoWorld") -> None:
RoomAndDoor("Pilgrim Antechamber", "Sun Painting"), EntranceType.PAINTING, False, world)
if early_color_hallways:
connect_entrance(regions, regions["Starting Room"], regions["Outside The Undeterred"], "Early Color Hallways",
connect_entrance(regions, regions["Starting Room"], regions["Color Hallways"], "Early Color Hallways",
None, EntranceType.PAINTING, False, world)
if painting_shuffle:

View File

@@ -3,7 +3,7 @@ from typing import TYPE_CHECKING
from BaseClasses import CollectionState
from .datatypes import RoomAndDoor
from .player_logic import AccessRequirements, PlayerLocation
from .static_logic import PROGRESSION_BY_ROOM, PROGRESSIVE_ITEMS
from .static_logic import PROGRESSIVE_DOORS_BY_ROOM, PROGRESSIVE_ITEMS
if TYPE_CHECKING:
from . import LingoWorld
@@ -59,9 +59,18 @@ def _lingo_can_satisfy_requirements(state: CollectionState, access: AccessRequir
if not state.has(color.capitalize(), world.player):
return False
if not all(state.has(item, world.player) for item in access.items):
return False
if not all(state.has(item, world.player, index) for item, index in access.progression.items()):
return False
if access.the_master and not lingo_can_use_mastery_location(state, world):
return False
if access.postgame and state.has("Prevent Victory", world.player):
return False
return True
@@ -74,7 +83,7 @@ def _lingo_can_open_door(state: CollectionState, room: str, door: str, world: "L
item_name = world.player_logic.item_by_door[room][door]
if item_name in PROGRESSIVE_ITEMS:
progression = PROGRESSION_BY_ROOM[room][door]
progression = PROGRESSIVE_DOORS_BY_ROOM[room][door]
return state.has(item_name, world.player, progression.index)
return state.has(item_name, world.player)

View File

@@ -4,15 +4,17 @@ import pickle
from io import BytesIO
from typing import Dict, List, Set
from .datatypes import Door, Painting, Panel, Progression, Room
from .datatypes import Door, Painting, Panel, PanelDoor, Progression, Room
ALL_ROOMS: List[Room] = []
DOORS_BY_ROOM: Dict[str, Dict[str, Door]] = {}
PANELS_BY_ROOM: Dict[str, Dict[str, Panel]] = {}
PANEL_DOORS_BY_ROOM: Dict[str, Dict[str, PanelDoor]] = {}
PAINTINGS: Dict[str, Painting] = {}
PROGRESSIVE_ITEMS: List[str] = []
PROGRESSION_BY_ROOM: Dict[str, Dict[str, Progression]] = {}
PROGRESSIVE_ITEMS: Set[str] = set()
PROGRESSIVE_DOORS_BY_ROOM: Dict[str, Dict[str, Progression]] = {}
PROGRESSIVE_PANELS_BY_ROOM: Dict[str, Dict[str, Progression]] = {}
PAINTING_ENTRANCES: int = 0
PAINTING_EXIT_ROOMS: Set[str] = set()
@@ -28,6 +30,8 @@ PANEL_LOCATION_IDS: Dict[str, Dict[str, int]] = {}
DOOR_LOCATION_IDS: Dict[str, Dict[str, int]] = {}
DOOR_ITEM_IDS: Dict[str, Dict[str, int]] = {}
DOOR_GROUP_ITEM_IDS: Dict[str, int] = {}
PANEL_DOOR_ITEM_IDS: Dict[str, Dict[str, int]] = {}
PANEL_GROUP_ITEM_IDS: Dict[str, int] = {}
PROGRESSIVE_ITEM_IDS: Dict[str, int] = {}
HASHES: Dict[str, str] = {}
@@ -68,6 +72,20 @@ def get_door_group_item_id(name: str):
return DOOR_GROUP_ITEM_IDS[name]
def get_panel_door_item_id(room: str, name: str):
if room not in PANEL_DOOR_ITEM_IDS or name not in PANEL_DOOR_ITEM_IDS[room]:
raise Exception(f"Item ID for panel door {room} - {name} not found in ids.yaml.")
return PANEL_DOOR_ITEM_IDS[room][name]
def get_panel_group_item_id(name: str):
if name not in PANEL_GROUP_ITEM_IDS:
raise Exception(f"Item ID for panel group {name} not found in ids.yaml.")
return PANEL_GROUP_ITEM_IDS[name]
def get_progressive_item_id(name: str):
if name not in PROGRESSIVE_ITEM_IDS:
raise Exception(f"Item ID for progressive item {name} not found in ids.yaml.")
@@ -97,8 +115,10 @@ def load_static_data_from_file():
ALL_ROOMS.extend(pickdata["ALL_ROOMS"])
DOORS_BY_ROOM.update(pickdata["DOORS_BY_ROOM"])
PANELS_BY_ROOM.update(pickdata["PANELS_BY_ROOM"])
PROGRESSIVE_ITEMS.extend(pickdata["PROGRESSIVE_ITEMS"])
PROGRESSION_BY_ROOM.update(pickdata["PROGRESSION_BY_ROOM"])
PANEL_DOORS_BY_ROOM.update(pickdata["PANEL_DOORS_BY_ROOM"])
PROGRESSIVE_ITEMS.update(pickdata["PROGRESSIVE_ITEMS"])
PROGRESSIVE_DOORS_BY_ROOM.update(pickdata["PROGRESSIVE_DOORS_BY_ROOM"])
PROGRESSIVE_PANELS_BY_ROOM.update(pickdata["PROGRESSIVE_PANELS_BY_ROOM"])
PAINTING_ENTRANCES = pickdata["PAINTING_ENTRANCES"]
PAINTING_EXIT_ROOMS.update(pickdata["PAINTING_EXIT_ROOMS"])
PAINTING_EXITS = pickdata["PAINTING_EXITS"]
@@ -111,6 +131,8 @@ def load_static_data_from_file():
DOOR_LOCATION_IDS.update(pickdata["DOOR_LOCATION_IDS"])
DOOR_ITEM_IDS.update(pickdata["DOOR_ITEM_IDS"])
DOOR_GROUP_ITEM_IDS.update(pickdata["DOOR_GROUP_ITEM_IDS"])
PANEL_DOOR_ITEM_IDS.update(pickdata["PANEL_DOOR_ITEM_IDS"])
PANEL_GROUP_ITEM_IDS.update(pickdata["PANEL_GROUP_ITEM_IDS"])
PROGRESSIVE_ITEM_IDS.update(pickdata["PROGRESSIVE_ITEM_IDS"])

View File

@@ -3,7 +3,7 @@ from . import LingoTestBase
class TestRequiredRoomLogic(LingoTestBase):
options = {
"shuffle_doors": "complex",
"shuffle_doors": "doors",
"shuffle_colors": "false",
}
@@ -50,7 +50,7 @@ class TestRequiredRoomLogic(LingoTestBase):
class TestRequiredDoorLogic(LingoTestBase):
options = {
"shuffle_doors": "complex",
"shuffle_doors": "doors",
"shuffle_colors": "false",
}
@@ -78,7 +78,8 @@ class TestRequiredDoorLogic(LingoTestBase):
class TestSimpleDoors(LingoTestBase):
options = {
"shuffle_doors": "simple",
"shuffle_doors": "doors",
"group_doors": "true",
"shuffle_colors": "false",
}
@@ -90,3 +91,52 @@ class TestSimpleDoors(LingoTestBase):
self.assertTrue(self.multiworld.state.can_reach("Outside The Wanderer", "Region", self.player))
self.assertTrue(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))
class TestPanels(LingoTestBase):
options = {
"shuffle_doors": "panels"
}
def test_requirement(self):
self.assertFalse(self.can_reach_location("Starting Room - HIDDEN"))
self.assertFalse(self.can_reach_location("Hidden Room - OPEN"))
self.assertFalse(self.can_reach_location("The Seeker - Achievement"))
self.collect_by_name("Starting Room - HIDDEN (Panel)")
self.assertTrue(self.can_reach_location("Starting Room - HIDDEN"))
self.assertFalse(self.can_reach_location("Hidden Room - OPEN"))
self.assertFalse(self.can_reach_location("The Seeker - Achievement"))
self.collect_by_name("Hidden Room - OPEN (Panel)")
self.assertTrue(self.can_reach_location("Starting Room - HIDDEN"))
self.assertTrue(self.can_reach_location("Hidden Room - OPEN"))
self.assertTrue(self.can_reach_location("The Seeker - Achievement"))
class TestGroupedPanels(LingoTestBase):
options = {
"shuffle_doors": "panels",
"group_doors": "true",
"shuffle_colors": "false",
}
def test_requirement(self):
self.assertFalse(self.can_reach_location("Hub Room - SLAUGHTER"))
self.assertFalse(self.can_reach_location("Dread Hallway - DREAD"))
self.assertFalse(self.can_reach_location("The Tenacious - Achievement"))
self.collect_by_name("Tenacious Entrance Panels")
self.assertTrue(self.can_reach_location("Hub Room - SLAUGHTER"))
self.assertFalse(self.can_reach_location("Dread Hallway - DREAD"))
self.assertFalse(self.can_reach_location("The Tenacious - Achievement"))
self.collect_by_name("Outside The Agreeable - BLACK (Panel)")
self.assertTrue(self.can_reach_location("Hub Room - SLAUGHTER"))
self.assertTrue(self.can_reach_location("Dread Hallway - DREAD"))
self.assertFalse(self.can_reach_location("The Tenacious - Achievement"))
self.collect_by_name("The Tenacious - Black Palindromes (Panels)")
self.assertTrue(self.can_reach_location("Hub Room - SLAUGHTER"))
self.assertTrue(self.can_reach_location("Dread Hallway - DREAD"))
self.assertTrue(self.can_reach_location("The Tenacious - Achievement"))

View File

@@ -5,7 +5,8 @@ class TestMasteryWhenVictoryIsTheEnd(LingoTestBase):
options = {
"mastery_achievements": "22",
"victory_condition": "the_end",
"shuffle_colors": "true"
"shuffle_colors": "true",
"shuffle_postgame": "true",
}
def test_requirement(self):
@@ -43,7 +44,8 @@ class TestMasteryBlocksDependents(LingoTestBase):
options = {
"mastery_achievements": "24",
"shuffle_colors": "true",
"location_checks": "insanity"
"location_checks": "insanity",
"victory_condition": "level_2",
}
def test_requirement(self):

View File

@@ -3,7 +3,7 @@ from . import LingoTestBase
class TestMultiShuffleOptions(LingoTestBase):
options = {
"shuffle_doors": "complex",
"shuffle_doors": "doors",
"progressive_orange_tower": "true",
"shuffle_colors": "true",
"shuffle_paintings": "true",
@@ -13,7 +13,7 @@ class TestMultiShuffleOptions(LingoTestBase):
class TestPanelsanity(LingoTestBase):
options = {
"shuffle_doors": "complex",
"shuffle_doors": "doors",
"progressive_orange_tower": "true",
"location_checks": "insanity",
"shuffle_colors": "true"
@@ -22,7 +22,18 @@ class TestPanelsanity(LingoTestBase):
class TestAllPanelHunt(LingoTestBase):
options = {
"shuffle_doors": "complex",
"shuffle_doors": "doors",
"progressive_orange_tower": "true",
"shuffle_colors": "true",
"victory_condition": "level_2",
"level_2_requirement": "800",
"early_color_hallways": "true"
}
class TestAllPanelHuntPanelsMode(LingoTestBase):
options = {
"shuffle_doors": "panels",
"progressive_orange_tower": "true",
"shuffle_colors": "true",
"victory_condition": "level_2",

View File

@@ -3,7 +3,7 @@ from . import LingoTestBase
class TestProgressiveOrangeTower(LingoTestBase):
options = {
"shuffle_doors": "complex",
"shuffle_doors": "doors",
"progressive_orange_tower": "true"
}

View File

@@ -3,7 +3,7 @@ from . import LingoTestBase
class TestPanelHunt(LingoTestBase):
options = {
"shuffle_doors": "complex",
"shuffle_doors": "doors",
"location_checks": "insanity",
"victory_condition": "level_2",
"level_2_requirement": "15"

View File

@@ -18,7 +18,7 @@ class TestPilgrimageWithRoofAndPaintings(LingoTestBase):
options = {
"enable_pilgrimage": "true",
"shuffle_colors": "false",
"shuffle_doors": "complex",
"shuffle_doors": "doors",
"pilgrimage_allows_roof_access": "true",
"pilgrimage_allows_paintings": "true",
"early_color_hallways": "false"
@@ -29,7 +29,6 @@ class TestPilgrimageWithRoofAndPaintings(LingoTestBase):
"Outside The Undeterred - Green Painting"]
for door in doors:
print(door)
self.assertFalse(self.can_reach_location("Pilgrim Antechamber - PILGRIM"))
self.collect_by_name(door)
@@ -40,7 +39,7 @@ class TestPilgrimageNoRoofYesPaintings(LingoTestBase):
options = {
"enable_pilgrimage": "true",
"shuffle_colors": "false",
"shuffle_doors": "complex",
"shuffle_doors": "doors",
"pilgrimage_allows_roof_access": "false",
"pilgrimage_allows_paintings": "true",
"early_color_hallways": "false"
@@ -53,7 +52,6 @@ class TestPilgrimageNoRoofYesPaintings(LingoTestBase):
"Starting Room - Street Painting"]
for door in doors:
print(door)
self.assertFalse(self.can_reach_location("Pilgrim Antechamber - PILGRIM"))
self.collect_by_name(door)
@@ -64,7 +62,7 @@ class TestPilgrimageNoRoofNoPaintings(LingoTestBase):
options = {
"enable_pilgrimage": "true",
"shuffle_colors": "false",
"shuffle_doors": "complex",
"shuffle_doors": "doors",
"pilgrimage_allows_roof_access": "false",
"pilgrimage_allows_paintings": "false",
"early_color_hallways": "false"
@@ -81,18 +79,45 @@ class TestPilgrimageNoRoofNoPaintings(LingoTestBase):
"Orange Tower Fourth Floor - Hot Crusts Door"]
for door in doors:
print(door)
self.assertFalse(self.can_reach_location("Pilgrim Antechamber - PILGRIM"))
self.collect_by_name(door)
self.assertTrue(self.can_reach_location("Pilgrim Antechamber - PILGRIM"))
class TestPilgrimageRequireStartingRoom(LingoTestBase):
options = {
"enable_pilgrimage": "true",
"shuffle_colors": "false",
"shuffle_doors": "complex",
"pilgrimage_allows_roof_access": "false",
"pilgrimage_allows_paintings": "false",
"early_color_hallways": "false"
}
def test_access(self):
doors = ["Second Room - Exit Door", "Crossroads - Roof Access", "Hub Room - Crossroads Entrance",
"Outside The Undeterred - Green Painting", "Outside The Undeterred - Number Hunt",
"Starting Room - Street Painting", "Outside The Initiated - Shortcut to Hub Room",
"Directional Gallery - Shortcut to The Undeterred", "Orange Tower First Floor - Salt Pepper Door",
"Color Hunt - Shortcut to The Steady", "The Bearer - Entrance",
"Orange Tower Fifth Floor - Quadruple Intersection", "The Tenacious - Shortcut to Hub Room",
"Outside The Agreeable - Tenacious Entrance", "Crossroads - Tower Entrance",
"Orange Tower Fourth Floor - Hot Crusts Door", "Challenge Room - Welcome Door",
"Number Hunt - Challenge Entrance", "Welcome Back Area - Shortcut to Starting Room"]
for door in doors:
self.assertFalse(self.can_reach_location("Pilgrim Antechamber - PILGRIM"))
self.collect_by_name(door)
self.assertTrue(self.can_reach_location("Pilgrim Antechamber - PILGRIM"))
class TestPilgrimageYesRoofNoPaintings(LingoTestBase):
options = {
"enable_pilgrimage": "true",
"shuffle_colors": "false",
"shuffle_doors": "complex",
"shuffle_doors": "doors",
"pilgrimage_allows_roof_access": "true",
"pilgrimage_allows_paintings": "false",
"early_color_hallways": "false"
@@ -107,7 +132,6 @@ class TestPilgrimageYesRoofNoPaintings(LingoTestBase):
"Orange Tower Fifth Floor - Quadruple Intersection"]
for door in doors:
print(door)
self.assertFalse(self.can_reach_location("Pilgrim Antechamber - PILGRIM"))
self.collect_by_name(door)

View File

@@ -0,0 +1,62 @@
from . import LingoTestBase
class TestPostgameVanillaTheEnd(LingoTestBase):
options = {
"shuffle_doors": "none",
"victory_condition": "the_end",
"shuffle_postgame": "false",
}
def test_requirement(self):
location_names = [location.name for location in self.multiworld.get_locations(self.player)]
self.assertTrue("The End (Solved)" in location_names)
self.assertTrue("Champion's Rest - YOU" in location_names)
self.assertFalse("Orange Tower Seventh Floor - THE MASTER" in location_names)
self.assertFalse("The Red - Achievement" in location_names)
class TestPostgameComplexDoorsTheEnd(LingoTestBase):
options = {
"shuffle_doors": "complex",
"victory_condition": "the_end",
"shuffle_postgame": "false",
}
def test_requirement(self):
location_names = [location.name for location in self.multiworld.get_locations(self.player)]
self.assertTrue("The End (Solved)" in location_names)
self.assertFalse("Orange Tower Seventh Floor - THE MASTER" in location_names)
self.assertTrue("The Red - Achievement" in location_names)
class TestPostgameLateColorHunt(LingoTestBase):
options = {
"shuffle_doors": "none",
"victory_condition": "the_end",
"sunwarp_access": "disabled",
"shuffle_postgame": "false",
}
def test_requirement(self):
location_names = [location.name for location in self.multiworld.get_locations(self.player)]
self.assertFalse("Champion's Rest - YOU" in location_names)
class TestPostgameVanillaTheMaster(LingoTestBase):
options = {
"shuffle_doors": "none",
"victory_condition": "the_master",
"shuffle_postgame": "false",
}
def test_requirement(self):
location_names = [location.name for location in self.multiworld.get_locations(self.player)]
self.assertTrue("Orange Tower Seventh Floor - THE END" in location_names)
self.assertTrue("Orange Tower Seventh Floor - Mastery Achievements" in location_names)
self.assertTrue("The Red - Achievement" in location_names)
self.assertFalse("Mastery Panels" in location_names)

View File

@@ -3,7 +3,7 @@ from . import LingoTestBase
class TestComplexProgressiveHallwayRoom(LingoTestBase):
options = {
"shuffle_doors": "complex"
"shuffle_doors": "doors"
}
def test_item(self):
@@ -54,7 +54,8 @@ class TestComplexProgressiveHallwayRoom(LingoTestBase):
class TestSimpleHallwayRoom(LingoTestBase):
options = {
"shuffle_doors": "simple"
"shuffle_doors": "doors",
"group_doors": "true",
}
def test_item(self):
@@ -81,7 +82,7 @@ class TestSimpleHallwayRoom(LingoTestBase):
class TestProgressiveArtGallery(LingoTestBase):
options = {
"shuffle_doors": "complex",
"shuffle_doors": "doors",
"shuffle_colors": "false",
}

View File

@@ -19,7 +19,8 @@ class TestVanillaDoorsNormalSunwarps(LingoTestBase):
class TestSimpleDoorsNormalSunwarps(LingoTestBase):
options = {
"shuffle_doors": "simple",
"shuffle_doors": "doors",
"group_doors": "true",
"sunwarp_access": "normal"
}
@@ -37,7 +38,8 @@ class TestSimpleDoorsNormalSunwarps(LingoTestBase):
class TestSimpleDoorsDisabledSunwarps(LingoTestBase):
options = {
"shuffle_doors": "simple",
"shuffle_doors": "doors",
"group_doors": "true",
"sunwarp_access": "disabled"
}
@@ -56,7 +58,8 @@ class TestSimpleDoorsDisabledSunwarps(LingoTestBase):
class TestSimpleDoorsUnlockSunwarps(LingoTestBase):
options = {
"shuffle_doors": "simple",
"shuffle_doors": "doors",
"group_doors": "true",
"sunwarp_access": "unlock"
}
@@ -78,7 +81,8 @@ class TestSimpleDoorsUnlockSunwarps(LingoTestBase):
class TestComplexDoorsNormalSunwarps(LingoTestBase):
options = {
"shuffle_doors": "complex",
"shuffle_doors": "doors",
"group_doors": "false",
"sunwarp_access": "normal"
}
@@ -96,7 +100,8 @@ class TestComplexDoorsNormalSunwarps(LingoTestBase):
class TestComplexDoorsDisabledSunwarps(LingoTestBase):
options = {
"shuffle_doors": "complex",
"shuffle_doors": "doors",
"group_doors": "false",
"sunwarp_access": "disabled"
}
@@ -115,7 +120,8 @@ class TestComplexDoorsDisabledSunwarps(LingoTestBase):
class TestComplexDoorsIndividualSunwarps(LingoTestBase):
options = {
"shuffle_doors": "complex",
"shuffle_doors": "doors",
"group_doors": "false",
"sunwarp_access": "individual"
}
@@ -142,7 +148,8 @@ class TestComplexDoorsIndividualSunwarps(LingoTestBase):
class TestComplexDoorsProgressiveSunwarps(LingoTestBase):
options = {
"shuffle_doors": "complex",
"shuffle_doors": "doors",
"group_doors": "false",
"sunwarp_access": "progressive"
}

View File

@@ -73,6 +73,22 @@ if old_generated.include? "door_groups" then
end
end
end
if old_generated.include? "panel_doors" then
old_generated["panel_doors"].each do |room, panel_doors|
panel_doors.each do |name, id|
if id >= next_item_id then
next_item_id = id + 1
end
end
end
end
if old_generated.include? "panel_groups" then
old_generated["panel_groups"].each do |name, id|
if id >= next_item_id then
next_item_id = id + 1
end
end
end
if old_generated.include? "progression" then
old_generated["progression"].each do |name, id|
if id >= next_item_id then
@@ -82,6 +98,7 @@ if old_generated.include? "progression" then
end
door_groups = Set[]
panel_groups = Set[]
config = YAML.load_file(configpath)
config.each do |room_name, room_data|
@@ -163,6 +180,29 @@ config.each do |room_name, room_data|
end
end
if room_data.include? "panel_doors"
room_data["panel_doors"].each do |panel_door_name, panel_door|
unless old_generated.include? "panel_doors" and old_generated["panel_doors"].include? room_name and old_generated["panel_doors"][room_name].include? panel_door_name then
old_generated["panel_doors"] ||= {}
old_generated["panel_doors"][room_name] ||= {}
old_generated["panel_doors"][room_name][panel_door_name] = next_item_id
next_item_id += 1
end
if panel_door.include? "panel_group" and not panel_groups.include? panel_door["panel_group"] then
panel_groups.add(panel_door["panel_group"])
unless old_generated.include? "panel_groups" and old_generated["panel_groups"].include? panel_door["panel_group"] then
old_generated["panel_groups"] ||= {}
old_generated["panel_groups"][panel_door["panel_group"]] = next_item_id
next_item_id += 1
end
end
end
end
if room_data.include? "progression"
room_data["progression"].each do |progression_name, pdata|
unless old_generated.include? "progression" and old_generated["progression"].include? progression_name then

Some files were not shown because too many files have changed in this diff Show More