Commit Graph

109 Commits

Author SHA1 Message Date
Doug Hoskisson f12b73f487
Tests: world test base class (#1116)
* world test base class

* game not instance property

* I would have guessed that this only collected 1.

* game property

* move SoE tests into worlds

* don't force auto world setup
2022-10-18 18:54:41 +02:00
alwaysintreble f909576813
core: Generic boss plando handler (#1044)
* fix some blunders i made when implementing this

* move generic functions to core class

* move lttp specific stuff out and split up from_text a bit for more modularity

* slightly optimize from_text call order

* don't make changes on github apparently. reading hard

* Metaclass Magic

* do a check against the base class

* copy paste strikes again

* use option default instead of hardcoded "none". check locations and bosses aren't reused.

* throw dupe location error for lttp

* generic singularity support with a bool

* forgot to enable it for lttp

* better error handling

* PlandoBosses: fix inheritance of singularity

* Tests: PlandoBosses

* fix case insensitive tests

* Tests: cleanup PlandoBosses tests

* f in the chat

* oop

* split location into a different variable

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

* pass the list of options as `option_list`

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

Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
2022-10-12 20:28:32 +02:00
Doug Hoskisson c96b6d7b95
Core: some typing and docs in various parts of the interface (#1060)
* some typing and docs in various parts of the interface

* fix whitespace in docstring

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

* suggested changes from discussion

* remove redundant import

* adjust type for json messages

* for options module detection:
 module.lower().endswith("options")

Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
2022-09-28 23:54:10 +02:00
alwaysintreble 267d9234e5
core: fix options with "random" as default value not generating (#1033)
* core: fix options with "random" as default value not generating

when option is missing from the player yaml,

Using this in #893 and tested there.

* remove if

* OptionSets default to frozenset so handle that

* range had some specific instances of assuming default as a valid value so change this here to call the from_any

* isinstance instead of type

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

Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
2022-09-19 22:40:15 +02:00
alwaysintreble 332dde154f
core: new freetext and textchoice options (#728)
* add freetext and freetextchoice options

* fix textchoice. create plando_bosses bool so worlds can check if boss plando is enabled

* remove strange unneccessary \ escapes

* lttp: rip boss plando out of core

* fix broken text methods so they read the data correctly

* revert `None` key in boss_shuffle_options. fix failing tests

* lttp: rewrite boss plando

* lttp: rewrite boss shuffle

* add generic verification step and allow options to set a plando module

* add default typing to plando_options set

* use PlandoSettings intflag for lttp boss plando

* fix plandosettings boss flag check

* minor lttp init cleanup

* make suggested changes. account for "random" existing within plando boss options

* override eq operator

* Please document me!

* Forgot to mention it supports plando

* remove auto_display_name

* Throw warning alerting user to which shuffle is being used if plando is off. Set the remaining boss shuffle in init and boss placement cleanup

* move the convoluted string matching to `from_text`

* remove unneccessary text lowering and actually turn off plando option when it's disabled

* typing

* strong typing for verify method and reorder

* typing is your friend

* log warning correctly

* 3.8 support :(

* also list apparently

* rip out old boss shuffle spoiler code

* verification step for plando bosses and locations

* update plando guide to reference new supported behavior

* empty string is not `None`. remove unneccessary error throw

* Fix bad ordering

* validate boss_shuffle only contains a normal boss option at the end

* get random choice from a list dummy

* >:(

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

* minor textchoice cleanup

Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
2022-09-17 02:55:33 +02:00
Fabian Dill af11fa5150
Core: auto alias (#1022)
* Test: check that default templates can be parsed into Option objects
2022-09-16 00:32:30 +02:00
Fabian Dill cc8ce32c61 Options: fix corner case where Toggle.value and Toggle.__int__ would be bool
Which lead to a connect failure in Raft
2022-08-27 11:12:28 +02:00
Fabian Dill 6c525e1fe6
Core: move multiple Item properties into a single Flag (#638) 2022-06-17 03:23:27 +02:00
Fabian Dill 70d510dff8 Options: fix all games templates breaking due to invalid progression balancing 2022-06-14 03:56:02 +02:00
Fabian Dill e7ea827f02
Options: introduce SpecialRange (#630)
* Options: introduce SpecialRange

* Include SpecialRange data in player-settings and weighted-settings JSON files

* Add support for SpecialRange to player-settings pages

* Add support for SpecialRange options to weighted-settings. Also fixed a bug which would cause the page to crash if an unknown setting was detected.

Co-authored-by: Chris Wilson <chris@legendserver.info>
2022-06-12 17:33:14 -04:00
CaitSith2 d82d70ac97 Fix the possibility of manually assigning 'random' via alias_random 2022-06-11 23:20:56 +02:00
Fabian Dill 86013328d6
Factorio: fix crude-oil related crashes (#552) 2022-05-21 20:57:26 +02:00
CaitSith2 cb9db5dff1 Verify start location hint 2022-05-20 18:42:36 +02:00
CaitSith2 c0fb7d9f9a
Add local and non_local items to item_links (#506)
* Add local and non_local items to item_links

* Whoops, don't pass list of list to verify_items.

* Give a did you mean result in the exception.
2022-05-15 07:41:11 -07:00
beauxq 2b6fc6dd3a only accept true and false for a range if they make sense 2022-05-15 16:31:26 +02:00
CaitSith2 98ca001da6 Fix for variable progression balancing when yaml has progression on/off. 2022-05-14 11:52:57 +02:00
CaitSith2 3f691d6977
Add "exclude" to item links (#497) 2022-05-11 16:37:18 -07:00
Doug Hoskisson c085ee47ed
variable-progression-balancing (#356) 2022-05-11 09:13:21 +02:00
Fabian Dill aa9f43dea1 Fuzzy: switch to damerau_levenshtein_distance with ignored case 2022-05-10 19:09:07 -07:00
Fabian Dill 513ab62ce7 Fuzzy: replace thefuzz with jellyfish
GPL -> BSD2Clause and should be faster though I haven't tested it myself and just trusted people on the internet.
Jellyfish also allows us access to many more algorithms should they be any better. Trying out Jaro distance now instead of Levenshtein.
2022-05-10 19:09:07 -07:00
CaitSith2 c326566bd2
Show "did you mean 'item/location_name'" in invalid item/location error. (#469) 2022-04-26 02:28:43 -07:00
Doug Hoskisson 0acca6dd64
Options.py typing (#412)
* Options.py typing
use NumericOption class inheriting from numbers.Integral instead of int
also can sometimes take text like:
"high": high end of range
"low": low end of range
"true", "on": default if it exists, otherwise high end of range
"false", "off": zero if zero is the low end

* just low, high, and default for range text

Co-authored-by: Doug Hoskisson <doughoskisson@novuslabs.com>
2022-04-07 13:42:30 -04:00
Fabian Dill ed1c11267c
Options: loudly crash if random text is not recognized, instead of de… (#401)
* Options: loudly crash if random text is not recognized, instead of defaulting to full "random"

* Update Options.py

Co-authored-by: Hussein Farran <hmfarran@gmail.com>

Co-authored-by: Hussein Farran <hmfarran@gmail.com>
2022-04-03 19:37:57 -04:00
Fabian Dill ae163319e0 More bug fixes 2022-04-01 03:54:30 +02:00
Fabian Dill eddc5d6524 Options: some more typing 2022-04-01 03:21:31 +02:00
Fabian Dill 1f16310797 Options: fix "toggle: random" always being True 2022-03-31 22:57:19 +02:00
Fabian Dill 8337689640
Options: more feedback on bad compares (#362) 2022-03-30 21:29:45 -04:00
Doug Hoskisson 2b138ac940
some typing and cleaning, mostly in Fill.py (#349)
* some typing and cleaning, mostly in Fill.py

* address missing Option types

* resolve a few TODOs discussed in pull request
2022-03-27 19:47:47 -04:00
Fabian Dill 64ac619b46
Core: use assert correctly (#345)
Core: add some more types to State and add count() method
2022-03-25 20:12:54 -04:00
Fabian Dill 171c297d1b
Options: implement additional assert checking for duplicate option ID (#332)
Options: change "random" prevention to assert, so it doesn't get checked in compiled version, as it's a source-code-time issue.
2022-03-22 21:28:15 -04:00
Fabian Dill cf2e37f92d
Options: sort values when displaying OptionSet (#326) 2022-03-22 10:25:34 -04:00
Fabian Dill 92319b0e31
Options: implement item name groups for item sets options (#325)
* Options: implement item name groups for item sets options

* Options: update outdated comments; verify is done by the verify mixin parent class nowadays
2022-03-21 15:49:54 -04:00
CaitSith2 11a13967d5 Report precisely what item link is invalid instead of ALL of them. 2022-02-23 16:21:53 -08:00
CaitSith2 6e0165986f Move duplicate name item link check to verify. 2022-02-23 15:17:24 -08:00
Fabian Dill 34b9344084
ItemLink; correct validation to allow for None replacement item 2022-02-13 20:19:17 +01:00
Fabian Dill f98063b97a Options: move name verification into class methods, out of Generate.py 2022-02-06 16:37:21 +01:00
Fabian Dill 28201a6c38 Core: implement first version of ItemLinks 2022-02-05 15:49:19 +01:00
Fabian Dill dc4b064c73 Options: change displayname to display_name 2022-02-02 16:29:29 +01:00
Fabian Dill 0f20888563 Options: allow yaml access to Priority Locations 2022-02-01 16:36:14 +01:00
Alchav 6a7e1d920a
User-specified random range (#203)
* Add user-specified random range for yaml options
2022-01-16 01:59:40 +01:00
Fabian Dill 0dc714f947 Options: fix verify_keys breaking options containing lists of dicts 2022-01-15 21:20:34 +01:00
Fabian Dill 3acd966241 Options: add "VerifyKeys" Mixin and showcase it for OoT Logic Tricks 2022-01-11 22:01:54 +01:00
Fabian Dill 9894d0672f Options: allow Choices to be hashed 2022-01-06 17:03:47 +01:00
Fabian Dill d2e884b1d9 Options: allow Toggles to be hashed 2022-01-06 06:18:54 +01:00
Fabian Dill 6e4b255be5 Options: make common options overridable in a game section
WebHost: add prog balancing and accessibility to settings page
2021-12-28 18:43:52 +01:00
espeon65536 75625b143c Core: better pretty-print for OptionList when the list is of non-strings 2021-12-03 18:15:10 +00:00
espeon65536 3fa253bac5
MC: 1.17 support (#120)
* MC: add death_link option

* Minecraft: 1.17 advancements and logic support

* Update Minecraft tracker to 1.17

* Minecraft: add tests for new advancements

* removed jdk/forge download install out of iss and into MinecraftClient.py using flag --install

* Add required_bosses option
choices are none, ender_dragon, wither, both
postgame advancements are set according to the required boss for completion

* fix docstring for PostgameAdvancements

* Minecraft: add starting_items
List of dicts: item, amount, nbt

* Update descriptions for AdvancementGoal and EggShardsRequired

* Minecraft: fix tests for required_bosses attribute

* Minecraft: updated logic for various dragon-related advancements
Split the logic into can_respawn and can_kill dragon
Free the End, Monsters Hunted, The End Again still require both respawn and kill, since the player needs to kill and be credited with the kill
You Need a Mint and Is It a Plane now require only respawn, since the dragon need only be alive; if killed out of logic, it's ok
The Next Generation only requires kill, since the egg spawns regardless of whether the player was credited with the kill or not

* Minecraft client: ignore prereleases unless --prerelease flag is on

* explicitly state all defaults
change structure shuffle and structure compass defaults to true
update install tutorial to point to player-settings page, as well as removing instructions for manual install

* Minecraft client: add Minecraft version check
Adds a minecraft_version field in the apmc, and downloads only mods which contain that version in the name of the .jar file.
This ensures that the client remains compatible even if new mods are released for later versions, since they won't download a mod for a later version than the apmc says.

Co-authored-by: Kono Tyran <Kono.Tyran@gmail.com>
2021-12-01 02:37:11 +01:00
Fabian Dill a5ca4f1611 Options: document exclude locations and start location hints 2021-11-17 16:45:13 +01:00
Fabian Dill 0e0cc0ad16 LttP: Implement DeathLink 2021-11-01 19:37:47 +01:00
Fabian Dill 375a0ff208 Options: verify starting inventory counts are positive for more than just Factorio 2021-10-25 04:13:25 +02:00