Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

TUNIC: Logic Rules Redux #3544

Merged
merged 125 commits into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
838f1f2
Clean these functions up, get the hell out of here 5 parameter function
ScipioWright May 21, 2024
3b5ae87
Clean up a bunch of rules that no longer need to be multi-lined since…
ScipioWright May 21, 2024
0b6adf6
Clean up some range functions
ScipioWright May 25, 2024
fdebfa9
Merge branch 'main' into tunc-cleanup-rules
ScipioWright Jun 1, 2024
8a41ac4
Update to use world instead of player like Vi recommended
ScipioWright Jun 1, 2024
987b292
Merge branch 'main' into tunc-cleanup-rules
ScipioWright Jun 4, 2024
fb4ec5e
Fix merge conflict
ScipioWright Jun 4, 2024
4492d46
Merge branch 'main' into tunc-cleanup-rules
ScipioWright Jun 10, 2024
92cd465
Create new options
ScipioWright Jun 11, 2024
383d71b
Slightly revise ls rule
ScipioWright Jun 11, 2024
56557c5
Update options.py
ScipioWright Jun 11, 2024
934c0f3
Update options.py
ScipioWright Jun 11, 2024
3c955d0
Add tedious option for ls
ScipioWright Jun 11, 2024
7bc1744
Update laurels zips description
ScipioWright Jun 11, 2024
f6611f3
Merge branch 'ArchipelagoMW:main' into tunc-logic-rules-redux
ScipioWright Jun 11, 2024
98140e8
Merge branch 'ArchipelagoMW:main' into tunc-cleanup-rules
ScipioWright Jun 11, 2024
b40c132
Create new options
ScipioWright Jun 11, 2024
53389be
Slightly revise ls rule
ScipioWright Jun 11, 2024
39a494d
Update options.py
ScipioWright Jun 11, 2024
ce9d8b6
Update options.py
ScipioWright Jun 11, 2024
8b39268
Add tedious option for ls
ScipioWright Jun 11, 2024
1b95330
Update laurels zips description
ScipioWright Jun 11, 2024
977cd93
Merge remote-tracking branch 'sw/tunc-logic-rules-redux' into tunc-lo…
ScipioWright Jun 11, 2024
411dd55
Creating structures to redo ladder storage rules
ScipioWright Jun 12, 2024
f721926
Put together overworld ladder groups, remove tedious
ScipioWright Jun 12, 2024
10825f8
Write up the rules for the regular rules
ScipioWright Jun 12, 2024
b146b16
Update slot data and UT stuff
ScipioWright Jun 13, 2024
6a70799
Put new ice grapple stuff in er rules
ScipioWright Jun 13, 2024
904d0e9
Ice grapple hard to get to fountain cross room
ScipioWright Jun 13, 2024
20e188a
More ladder data
ScipioWright Jun 13, 2024
a73bf37
Wrote majority of overworld ladder rules
ScipioWright Jun 13, 2024
21e3854
Finish the ladder storage rules
ScipioWright Jun 13, 2024
a4f3f6d
Update notes
ScipioWright Jun 14, 2024
d650ed7
Add note
ScipioWright Jun 14, 2024
e314120
Add well rail to the rules
ScipioWright Jun 14, 2024
1f0dac2
More rules
ScipioWright Jun 14, 2024
c93502c
Comment out logically irrelevant entrances
ScipioWright Jun 14, 2024
aea16aa
Update with laurels_zip helper
ScipioWright Jun 14, 2024
5e67f17
Add parameter to has_ice_grapple_logic for difficulty
ScipioWright Jun 14, 2024
ecde945
Add new parameter to has_ice_grapple_logic
ScipioWright Jun 14, 2024
309afd3
Move ice grapple chest to lower forest in ER/ladders
ScipioWright Jun 14, 2024
f78be22
Fix rule
ScipioWright Jun 14, 2024
985c02d
Finishing out hooking the new rules into the code
ScipioWright Jun 14, 2024
91e6a2f
Fix bugs
ScipioWright Jun 15, 2024
489430c
Add more hard ice grapples
ScipioWright Jun 15, 2024
5d4f46d
Fix more bugs
ScipioWright Jun 15, 2024
f5d8cfb
Shops my beloved
ScipioWright Jun 15, 2024
bdde992
Change victory condition back
ScipioWright Jun 15, 2024
a76d9f8
Remove debug stuff
ScipioWright Jun 15, 2024
4d58597
Update plando connections description
ScipioWright Jun 15, 2024
b8d4bc6
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Jun 15, 2024
e069d64
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Jun 16, 2024
d1a602a
Fix extremely rare bug
ScipioWright Jun 16, 2024
1be8369
Add well front -> back hard ladder storages
ScipioWright Jun 17, 2024
182a42d
Note in ls rules about knocking yourself down with bombs being out of…
ScipioWright Jun 17, 2024
b804c51
Add atoll fuse with wand + hard ls
ScipioWright Jun 17, 2024
d768f0a
Add some nonsense that boils down to activating the fuse in overworld
ScipioWright Jun 17, 2024
e67ffc5
Further update LS description
ScipioWright Jun 17, 2024
5b493f3
Fix missing logic on bridge switch chest in upper zig
ScipioWright Jun 21, 2024
d339770
Revise upper zig rule change to account for ER
ScipioWright Jun 22, 2024
ca669f6
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Jun 27, 2024
bd21a61
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Jun 29, 2024
059c26f
Fix merge conflict
ScipioWright Jun 29, 2024
f9e1d9d
Fix formatting, fix rule for heir access after merge
ScipioWright Jun 30, 2024
0764097
Add the shop sword logic stuff in
ScipioWright Jul 4, 2024
e29313a
Remove todo that was already done
ScipioWright Jul 5, 2024
9b2377e
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Jul 5, 2024
91e1afd
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Jul 5, 2024
b298263
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Jul 5, 2024
d8159be
Fill out a to-do with some cursed nonsense
ScipioWright Jul 5, 2024
1e8636c
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Jul 9, 2024
0021d08
Fix event in wrong region
ScipioWright Jul 11, 2024
056e198
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Jul 11, 2024
8d614a1
Fix missing cathedral -> elevator connection
ScipioWright Jul 12, 2024
7f8f281
Fix missing cathedral -> elevator connection
ScipioWright Jul 12, 2024
efe8a79
Add ER exception to cathedral -> elevator
ScipioWright Jul 12, 2024
2127af6
Fix secret gathering place issue
ScipioWright Jul 15, 2024
3ee2f82
Fix incorrect ls rule
ScipioWright Jul 15, 2024
4e86409
Move 3 locations to Quarry Back since they're easily accessible from …
ScipioWright Jul 17, 2024
28edfd0
Also update non-er region
ScipioWright Jul 17, 2024
a7d5c8a
Remove redundant parentheses
ScipioWright Jul 17, 2024
9fc8743
Add new test for a weird edge case in ER
ScipioWright Jul 17, 2024
6cedd91
Slight option description updates
ScipioWright Jul 19, 2024
8393844
Use has_ladder in spots where it wasn't used for some reason, add a c…
ScipioWright Jul 19, 2024
3c0e900
Fix unit test for ER
ScipioWright Jul 21, 2024
7e9da3a
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Jul 23, 2024
2c0e717
Update per exempt's suggestion
ScipioWright Jul 23, 2024
1d082bc
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Jul 24, 2024
2056db8
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Jul 27, 2024
e7fcd39
Add back LogicRules as an invisible option, to not break old yamls
ScipioWright Jul 28, 2024
8da92b2
Remove unused elevation from portal class
ScipioWright Jul 28, 2024
df52f1b
Update ladder storage without items description
ScipioWright Jul 30, 2024
be9b8d4
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Aug 5, 2024
3362a43
Remove shop_scene stuff since it's no longer relevant in the mod by t…
ScipioWright Aug 5, 2024
79e313e
Remove shop scene stuff from game info since it's no longer relevant …
ScipioWright Aug 5, 2024
250be17
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Aug 7, 2024
aa18a37
Update portal list to match main
ScipioWright Aug 7, 2024
4abb46a
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Aug 7, 2024
ebf3a49
god I love github merging things
ScipioWright Aug 7, 2024
d673b7c
Remove note
ScipioWright Aug 9, 2024
36704cb
Add ice grapple hard path from upper overworld to temple rafters entr…
ScipioWright Aug 12, 2024
214a2b7
Actually that should be medium
ScipioWright Aug 12, 2024
8b2389b
Remove outdated note
ScipioWright Aug 12, 2024
197d421
Add ice grapple hard for swamp mid to the ledge
ScipioWright Aug 12, 2024
f7afa5c
Add missing laurels zip in swamp
ScipioWright Aug 12, 2024
7a37a62
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Aug 13, 2024
a99362c
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Aug 14, 2024
50d0d4b
Some fixes to the ladder storage data while reviewing it
ScipioWright Aug 16, 2024
813d0bd
Merge remote-tracking branch 'refs/remotes/origin/main' into tunc-log…
ScipioWright Aug 16, 2024
5c064e6
Add unit test for weird edge case
ScipioWright Aug 17, 2024
ca7b5fe
Backport outlet region system to fix ls bug
ScipioWright Aug 17, 2024
fc15db4
Fix incorrect ls, add todo
ScipioWright Aug 18, 2024
926c71a
Add missing swamp ladder storage connections
ScipioWright Aug 18, 2024
4787ca0
Add swamp zip to er data
ScipioWright Aug 19, 2024
c61cf00
Add swamp zip to er rules
ScipioWright Aug 19, 2024
5d3f310
Add hard ice grapple for forest grave path main to upper
ScipioWright Aug 19, 2024
4a009ee
Add ice grapple logic for all bomb walls except the east quarry one
ScipioWright Aug 20, 2024
0018648
Add ice grapple logic for frog stairs eye to mouth without the ladder
ScipioWright Aug 20, 2024
2043491
Add hard ice grapple for overworld to the stairs to west garden
ScipioWright Aug 20, 2024
0a9dd2a
Add the ice grapple boss quick kills to medium ice grappling
ScipioWright Aug 21, 2024
123e693
Add the reverse connection for the ice grapple kill on Garden Knight
ScipioWright Aug 23, 2024
560f20e
Add atoll house ice grapple push, and add west garden ice grapple ent…
ScipioWright Aug 23, 2024
1989e42
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Aug 28, 2024
0bca1c2
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Aug 29, 2024
caa22fb
Merge branch 'main' into tunc-logic-rules-redux
ScipioWright Aug 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 41 additions & 14 deletions worlds/tunic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
from .er_rules import set_er_location_rules
from .regions import tunic_regions
from .er_scripts import create_er_regions
from .er_data import portal_mapping
from .options import TunicOptions, EntranceRando, tunic_option_groups, tunic_option_presets, TunicPlandoConnections
from .er_data import portal_mapping, RegionInfo, tunic_er_regions
from .options import (TunicOptions, EntranceRando, tunic_option_groups, tunic_option_presets, TunicPlandoConnections,
LaurelsLocation, LogicRules, LaurelsZips, IceGrappling, LadderStorage)
from worlds.AutoWorld import WebWorld, World
from Options import PlandoConnection
from decimal import Decimal, ROUND_HALF_UP
Expand Down Expand Up @@ -48,10 +49,12 @@ class TunicLocation(Location):


class SeedGroup(TypedDict):
logic_rules: int # logic rules value
laurels_zips: bool # laurels_zips value
ice_grappling: int # ice_grappling value
ladder_storage: int # ls value
laurels_at_10_fairies: bool # laurels location value
fixed_shop: bool # fixed shop value
plando: TunicPlandoConnections # consolidated of plando connections for the seed group
plando: TunicPlandoConnections # consolidated plando connections for the seed group


class TunicWorld(World):
Expand All @@ -77,8 +80,17 @@ class TunicWorld(World):
tunic_portal_pairs: Dict[str, str]
er_portal_hints: Dict[int, str]
seed_groups: Dict[str, SeedGroup] = {}
shop_num: int = 1 # need to make it so that you can walk out of shops, but also that they aren't all connected
er_regions: Dict[str, RegionInfo] # absolutely needed so outlet regions work

def generate_early(self) -> None:
if self.options.logic_rules >= LogicRules.option_no_major_glitches:
self.options.laurels_zips.value = LaurelsZips.option_true
self.options.ice_grappling.value = IceGrappling.option_medium
if self.options.logic_rules.value == LogicRules.option_unrestricted:
self.options.ladder_storage.value = LadderStorage.option_medium

self.er_regions = tunic_er_regions.copy()
if self.options.plando_connections:
for index, cxn in enumerate(self.options.plando_connections):
# making shops second to simplify other things later
Expand All @@ -99,7 +111,10 @@ def generate_early(self) -> None:
self.options.keys_behind_bosses.value = passthrough["keys_behind_bosses"]
self.options.sword_progression.value = passthrough["sword_progression"]
self.options.ability_shuffling.value = passthrough["ability_shuffling"]
self.options.logic_rules.value = passthrough["logic_rules"]
self.options.laurels_zips.value = passthrough["laurels_zips"]
self.options.ice_grappling.value = passthrough["ice_grappling"]
self.options.ladder_storage.value = passthrough["ladder_storage"]
self.options.ladder_storage_without_items = passthrough["ladder_storage_without_items"]
self.options.lanternless.value = passthrough["lanternless"]
self.options.maskless.value = passthrough["maskless"]
self.options.hexagon_quest.value = passthrough["hexagon_quest"]
Expand All @@ -118,19 +133,28 @@ def stage_generate_early(cls, multiworld: MultiWorld) -> None:
group = tunic.options.entrance_rando.value
# if this is the first world in the group, set the rules equal to its rules
if group not in cls.seed_groups:
cls.seed_groups[group] = SeedGroup(logic_rules=tunic.options.logic_rules.value,
laurels_at_10_fairies=tunic.options.laurels_location == 3,
fixed_shop=bool(tunic.options.fixed_shop),
plando=tunic.options.plando_connections)
cls.seed_groups[group] = \
SeedGroup(laurels_zips=bool(tunic.options.laurels_zips),
ice_grappling=tunic.options.ice_grappling.value,
ladder_storage=tunic.options.ladder_storage.value,
laurels_at_10_fairies=tunic.options.laurels_location == LaurelsLocation.option_10_fairies,
fixed_shop=bool(tunic.options.fixed_shop),
plando=tunic.options.plando_connections)
continue


# off is more restrictive
if not tunic.options.laurels_zips:
cls.seed_groups[group]["laurels_zips"] = False
# lower value is more restrictive
if tunic.options.ice_grappling < cls.seed_groups[group]["ice_grappling"]:
cls.seed_groups[group]["ice_grappling"] = tunic.options.ice_grappling.value
# lower value is more restrictive
if tunic.options.logic_rules.value < cls.seed_groups[group]["logic_rules"]:
cls.seed_groups[group]["logic_rules"] = tunic.options.logic_rules.value
if tunic.options.ladder_storage.value < cls.seed_groups[group]["ladder_storage"]:
cls.seed_groups[group]["ladder_storage"] = tunic.options.ladder_storage.value
# laurels at 10 fairies changes logic for secret gathering place placement
if tunic.options.laurels_location == 3:
cls.seed_groups[group]["laurels_at_10_fairies"] = True
# fewer shops, one at windmill
# more restrictive, overrides the option for others in the same group, which is better than failing imo
if tunic.options.fixed_shop:
cls.seed_groups[group]["fixed_shop"] = True

Expand Down Expand Up @@ -366,7 +390,10 @@ def fill_slot_data(self) -> Dict[str, Any]:
"ability_shuffling": self.options.ability_shuffling.value,
"hexagon_quest": self.options.hexagon_quest.value,
"fool_traps": self.options.fool_traps.value,
"logic_rules": self.options.logic_rules.value,
"laurels_zips": self.options.laurels_zips.value,
"ice_grappling": self.options.ice_grappling.value,
"ladder_storage": self.options.ladder_storage.value,
"ladder_storage_without_items": self.options.ladder_storage_without_items.value,
"lanternless": self.options.lanternless.value,
"maskless": self.options.maskless.value,
"entrance_rando": int(bool(self.options.entrance_rando.value)),
Expand Down
2 changes: 0 additions & 2 deletions worlds/tunic/docs/en_TUNIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ Notes:
- The `direction` field is not supported. Connections are always coupled.
- For a list of entrance names, check `er_data.py` in the TUNIC world folder or generate a game with the Entrance Randomizer option enabled and check the spoiler log.
- There is no limit to the number of Shops you can plando.
- If you have more than one shop in a scene, you may be wrong warped when exiting a shop.
- If you have a shop in every scene, and you have an odd number of shops, it will error out.

See the [Archipelago Plando Guide](../../../tutorial/Archipelago/plando/en) for more information on Plando and Connection Plando.

Expand Down
Loading
Loading