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

Added blitz code for a faster playthrough. #7

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
6 changes: 6 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

Adds Blitz Mode to abyssonym's Lufia 2 Randomizer for a faster playthrough.



Lufia 2 Terror Wave Randomizer
Version: 3
Date: April 1, 2023
Expand Down Expand Up @@ -38,6 +43,7 @@ Secret Codes:
airship Start the game with the airship.
bossy Very random bosses (unbalanced even with scaling)
fourkeys Open World, but there are only four keys
blitz Allows a faster playthrough

OPEN WORLD ENEMY SCALING
scale Scale enemy status in open-world mode
Expand Down
10 changes: 9 additions & 1 deletion randomizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5912,6 +5912,8 @@ def extract_location_boss(findstr):
for capsule_index in range(7):
findstr = '. 81({0:0>2X})'.format(capsule_index)
location, boss = extract_location_boss(findstr)
if location is None or boss is None:
continue
s3 += CapsuleObject.get(capsule_index*5).name + '\n'
s3 += right_justify(location) + '\n'
s3 += right_justify(boss.boss.name) + '\n'
Expand Down Expand Up @@ -6494,6 +6496,10 @@ def make_open_world(custom=None):
path.join(tblpath, 'restrictions_fourkeys.txt'),
linearity=0.8)
make_four_keys()
elif 'blitz' in get_activated_codes():
ir = ItemRouter(path.join(tblpath, 'requirements_blitz.txt'),
path.join(tblpath, 'restrictions_blitz.txt'),
linearity=0.4)
else:
ir = ItemRouter(path.join(tblpath, 'requirements.txt'),
path.join(tblpath, 'restrictions.txt'),
Expand All @@ -6518,7 +6524,8 @@ def make_open_world(custom=None):
if loc.endswith('1'):
other = loc[:-1] + '2'
if other in ir.assignments:
assert not ir.assignments[other].endswith('_key')
print( "Not assigned: {}".format(loc) )
#assert not ir.assignments[other].endswith('_key')

MapEventObject.class_reseed('selecting_characters')
if VERSION == '3.16' and 1682460000 <= get_seed() <= 1682460000 + 172800:
Expand Down Expand Up @@ -7025,6 +7032,7 @@ def run_trials():
'monstermash': ['monstermash'],
'nocap': ['nocap'],
'fourkeys': ['fourkeys'],
'blitz': ['blitz'],
}
run_interface(ALL_OBJECTS, snes=True, codes=codes,
custom_degree=True, custom_difficulty=True)
Expand Down
95 changes: 95 additions & 0 deletions tables/requirements_blitz.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
.def breakable bomb|hammer
.def useless_keys door_key&shrine_key
.def all_keys sky_key&lake_key&ruby_key&wind_key&cloud_key&light_key&sword_key&tree_key&flower_key&magma_key&heart_key&ghost_key&trial_key&dankirk_key&basement_key&narcysus_key&truth_key
.def all_tools arrow&bomb&hook&hammer&fire_arrow
.def all_tools_or_keys all_tools|all_keys
.def arrowlike arrow|hook|fire_arrow

.def all_capsules jelze&flash&gusto&zeppy&darbi&sully&blaze
.def some_capsules jelze|flash|gusto|zeppy|darbi|sully|blaze

.def any_tool arrow|bomb|hook|hammer|fire_arrow
.def any_key sky_key|lake_key|ruby_key|wind_key|cloud_key|light_key|sword_key|tree_key|flower_key|magma_key|heart_key|ghost_key|trial_key|dankirk_key|basement_key|narcysus_key|truth_key
.def party0 any_tool&character0

.def party1 character1|character2|character3|character4

.def party2a character1&character2
.def party2b character1&character3
.def party2c character1&character4
.def party2d character2&character3
.def party2e character2&character4
.def party2f character3&character4
.def party2 party2a|party2b|party2c|party2d|party2e|party2f

.def party3a character1&character2&character3
.def party3b character1&character2&character4
.def party3c character1&character3&character4
.def party3d character2&character3&character4
.def party3 party3a|party3b|party3c|party3d

.def party4 character1&character2&character3&character4&all_capsules

.def airship engine
.def submarine mermaid_jade
.def submarine_or_airship submarine|airship
.def victory victory

.def dankirk hook&bomb&dankirk_key&party3
.def gratze dankirk|submarine_or_airship

starting_character *
starting_item *
hidden_item *
skill_cave arrowlike&party0
foomy_woods party0
darbi_shrine party0
zeppy_cave submarine&party0
sundletan_cave party0
catfish_cave arrowlike&lake_key&party0
alunze_cave breakable&party0
alunze_basement breakable&party0
tanbel_tower1 sky_key&party1
tanbel_tower2 sky_key&party1
ruby_cave ruby_key&party1
ruby_capsule breakable&party0
tsword_shrine1 bomb&sword_key&party1
tsword_shrine2 bomb&sword_key&party1
gordovan_tower1 hook&bomb&wind_key&party1
gordovan_tower2 hook&bomb&wind_key&party1
cave_bridge breakable&hook&party0
north_dungeon hook&bomb&party1
north_capsule hook&party1
ancient_tower1 hook&bomb&cloud_key&party1
ancient_tower2 hook&bomb&cloud_key&party1
lighthouse1 light_key&party1
lighthouse2 light_key&party1
phantom_mountain hook&bomb&fire_arrow&tree_key&party2
sacrifice_tower1 hook&bomb&narcysus_key&party2
sacrifice_tower2 hook&bomb&narcysus_key&party2
sacrifice_capsule hook&breakable&narcysus_key&party2
karlloon_shrine1 hook&bomb&party2
karlloon_shrine2 hook&bomb&party2
lexis_lab party0
flower_mountain hammer&flower_key&party2
flower_capsule hammer&hook&party2
dankirk_dungeon dankirk
northeast_tower1 hook&hammer&trial_key&party2
northeast_tower2 hook&hammer&trial_key&party2
no_return_mountain party0
divine_shrine1 hook&hammer&heart_key&party2
divine_shrine2 hook&hammer&heart_key&party2
vengeance_shrine1 submarine&bomb&hammer&ghost_key&party2
vengeance_shrine2 submarine&bomb&hammer&ghost_key&party2
truth_tower1 breakable&hook&truth_key&party2
truth_tower2 breakable&hook&truth_key&party2
dragon_mountain submarine_or_airship&hook&hammer&fire_arrow&magma_key&party2
underwater_shrine submarine&party0
gratze_basement gratze&arrowlike&basement_key&party2
shuman airship&party3
stradha airship&party3
kamirno airship&party3
lisa arrowlike
marie breakable
clare party1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what is achieved by creating "lisa", "marie", and "clare" as locations. I don't know what your intent is for these lines, but I suspect that a required item might end up at one of these locations, which will make the seed unbeatable. For example, what if the bombs end up at the "lisa" location, which are then required to unlock the rest of the seed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assumed that file defines routing requirements, so I added those maides. Also somewhere in your code* it tests the seed, so I did not assume any problems there. Also several people tested these requirements and had no problems. I will try to find such a "dead lock" you mentioned.

*itemrouter.py:703: success = self.try_unlock_locations(self.goal_requirements)

daos_shrine lisa&marie&clare&any_key
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not possible to fly to Doom Island without the engine; you should either add the engine back as a requirement to reach Daos Shrine, or create a modified event that does not require the engine.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assumed that was just a cutscene. sorry, my bad. I will try to create a modified event.

17 changes: 17 additions & 0 deletions tables/restrictions_blitz.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.def keys sky_key,lake_key,ruby_key,wind_key,cloud_key,light_key,sword_key,tree_key,flower_key,magma_key,heart_key,ghost_key,trial_key,dankirk_key,basement_key,narcysus_key,truth_key

starting_character character0
starting_item arrow,bomb,hammer
hidden_item nothing
tanbel_tower1 keys
tsword_shrine1 keys
gordovan_tower1 keys
ancient_tower1 keys
lighthouse1 keys
sacrifice_tower1 keys
karlloon_shrine1 keys
northeast_tower1 keys
divine_shrine1 keys
vengeance_shrine1 keys
truth_tower1 keys
daos_shrine victory