Skip to content

Commit 716b8dc

Browse files
committed
Minor tweaks
If Yuna is not in the party in Kilika for any reason, she will swap in. Maybe fixes a Kilika bug. New feature to set RNG by its index number and desired value. Load Game updates, used for testing Kilika bugs. Improvement to the Defend logic.
1 parent d93cfc6 commit 716b8dc

File tree

5 files changed

+19
-2
lines changed

5 files changed

+19
-2
lines changed

battle/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,8 @@ def kilika_woods(valefor_charge=True, best_charge: int = 99, next_battle=[]):
419419
break
420420
elif screen.faint_check():
421421
revive()
422+
elif not 1 in memory.main.get_active_battle_formation():
423+
buddy_swap(Yuna)
422424
elif Kimahri.is_turn() or Lulu.is_turn():
423425
if memory.main.get_battle_char_slot(4) >= 3:
424426
buddy_swap(Wakka)

json_ai_files/save_load_details.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"end_game_version_val": "0",
6666
"nea_zone": "0",
6767
"nem_ap_val": "1",
68-
"special_movement": "none"
68+
"special_movement": "Kilika_rng_manip"
6969
}
7070
}
7171
},

load_game.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ def move_after_load(spec_move: str):
3434
load_miihen_start()
3535
elif spec_move == "MRR":
3636
load_mrr()
37+
elif spec_move == "Kilika_rng_manip":
38+
kilika_rng_manip()
3739

3840

3941
def load_into_game(gamestate: str, step_counter: str):
@@ -547,6 +549,11 @@ def load_baaj():
547549
FFXC.set_neutral()
548550
memory.main.wait_frames(30 * 0.04)
549551

552+
def kilika_rng_manip():
553+
# Kilika start, RNG01
554+
# 1904657448
555+
logger.warning("==== Hard setting value for testing")
556+
memory.main.set_rng_by_index(value=1904657448, index=1)
550557

551558
def besaid_trials():
552559
# Exit Tent

memory/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2406,6 +2406,12 @@ def reset_battle_end():
24062406
process.write_bytes(key, 1, 1)
24072407

24082408

2409+
def set_rng_by_index(value:int=0, index:int=1):
2410+
global base_value
2411+
global process
2412+
key = base_value + 0x00D35ED8 + (index * 4)
2413+
process.write_bytes(key, 0x7E9F20D2, 4)
2414+
24092415
def set_rng_2():
24102416
global base_value
24112417
global process

players/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,9 @@ def escaped(self) -> bool:
359359

360360
def is_defending(self) -> bool:
361361
defend_byte = self._read_char_battle_state_address(offset=PlayerMagicNumbers.DEFENDING)
362-
return (defend_byte >> 3) == 1
362+
result = (defend_byte >> 3) & 1 == 1
363+
logger.warning(f"Character is defending: {result}")
364+
return result
363365

364366
def hp(self, combat=False) -> int:
365367
if not combat:

0 commit comments

Comments
 (0)