Skip to content

Commit 03a7465

Browse files
authored
Merge pull request #223 from coderwilson/fix_4x_speed_at_wendigo
Fix 4x speed at wendigo
2 parents 6e856b5 + ea8565a commit 03a7465

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

battle/main.py

-1
Original file line numberDiff line numberDiff line change
@@ -2271,7 +2271,6 @@ def fullheal(target: int, direction: str):
22712271

22722272

22732273
# Process written by CrimsonInferno
2274-
@battle.utils.speedup_decorator
22752274
def wendigo_res_heal(turn_char: int, use_power_break: int, tidus_max_hp: int):
22762275
print("Wendigo Res/Heal function")
22772276
party_hp = memory.main.get_battle_hp()

battle/utils.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,20 @@ def _monitor_battle():
1515
while not memory.main.battle_active():
1616
pass
1717
fast = False
18+
old_game_speed = memory.main.get_game_speed()
1819
while memory.main.battle_active():
1920
if fast and memory.main.auditory_dialog_playing():
2021
memory.main.set_game_speed(0)
2122
fast = False
2223
elif not fast:
2324
memory.main.set_game_speed(2)
2425
fast = True
25-
memory.main.set_game_speed(0)
26+
memory.main.set_game_speed(old_game_speed)
2627

2728
def wrapper(*args, **kwargs):
2829
if game_vars.get_battle_speedup():
2930
logger.debug(f"Speeding battle up: {func.__name__}")
30-
monitor = threading.Thread(target=_monitor_battle)
31+
monitor = threading.Thread(target=_monitor_battle, daemon=True)
3132
monitor.start()
3233
ret_val = func(*args, **kwargs)
3334
monitor.join()

memory/main.py

+4
Original file line numberDiff line numberDiff line change
@@ -2295,6 +2295,10 @@ def set_encounter_rate(set_val):
22952295
process.write_bytes(key, set_val, 1)
22962296

22972297

2298+
def get_game_speed():
2299+
return read_val(0x008E82A4)
2300+
2301+
22982302
def set_game_speed(set_val):
22992303
global base_value
23002304

nemesis/arenaPrep.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -490,23 +490,23 @@ def advanced_battle_logic():
490490
# Double Gemini, two different locations
491491
if memory.main.get_use_items_slot(42) < 100:
492492
battle.main.use_item(
493-
memory.main.get_use_items_slot(42), rikku_flee=False
493+
memory.main.get_use_items_slot(42), rikku_flee=True
494494
)
495495
else:
496496
battle.main.defend()
497497
elif encounter_id == 386:
498498
# Armor bomber guys
499499
if memory.main.get_use_items_slot(41) < 100:
500500
battle.main.use_item(
501-
memory.main.get_use_items_slot(41), rikku_flee=False
501+
memory.main.get_use_items_slot(41), rikku_flee=True
502502
)
503503
else:
504504
battle.main.defend()
505505
elif encounter_id in [430]:
506506
# Demonolith
507507
if memory.main.get_use_items_slot(41) < 100:
508508
battle.main.use_item(
509-
memory.main.get_use_items_slot(41), rikku_flee=False
509+
memory.main.get_use_items_slot(41), rikku_flee=True
510510
)
511511
else:
512512
battle.main.defend()
@@ -517,7 +517,7 @@ def advanced_battle_logic():
517517
)
518518
if memory.main.get_use_items_slot(41) < 100:
519519
battle.main.use_item(
520-
memory.main.get_use_items_slot(41), rikku_flee=False
520+
memory.main.get_use_items_slot(41), rikku_flee=True
521521
)
522522
else:
523523
battle.main.defend()
@@ -533,13 +533,13 @@ def advanced_battle_logic():
533533
# Varuna, use purifying salt to remove haste
534534
# Safety potions are fun.
535535
battle.main.use_item(
536-
memory.main.get_use_items_slot(63), rikku_flee=False
536+
memory.main.get_use_items_slot(63), rikku_flee=True
537537
)
538538
elif encounter_id == 426:
539539
# Master Tonberry
540540
if not sleepPowder:
541541
battle.main.use_item(
542-
memory.main.get_use_items_slot(37), rikku_flee=False
542+
memory.main.get_use_items_slot(37), rikku_flee=True
543543
)
544544
else:
545545
if memory.main.get_use_items_slot(41) < 100:
@@ -556,7 +556,7 @@ def advanced_battle_logic():
556556
):
557557
if not sleepPowder:
558558
battle.main.use_item(
559-
memory.main.get_use_items_slot(37), rikku_flee=False
559+
memory.main.get_use_items_slot(37), rikku_flee=True
560560
)
561561
else:
562562
if memory.main.get_use_items_slot(41) < 100:

tas_saves/ffx_019

26.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)