Skip to content

Commit 6acec54

Browse files
committed
fix exception in the spherimorph logic caused by an outdated variable name
1 parent 366e812 commit 6acec54

File tree

2 files changed

+77
-77
lines changed

2 files changed

+77
-77
lines changed

Diff for: battle/boss.py

+42-42
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ def spherimorph():
739739

740740
spell_num = 0
741741
tidus_turns = 0
742-
rikkuturns = 0
742+
rikku_turns = 0
743743
yuna_turn = False
744744
kim_turn = False
745745
while not memory.main.turn_ready():
@@ -748,19 +748,19 @@ def spherimorph():
748748
if memory.main.turn_ready():
749749
if game_vars.use_pause():
750750
memory.main.wait_frames(2)
751-
turnchar = memory.main.get_battle_char_turn()
751+
turn_char = memory.main.get_battle_char_turn()
752752
party_hp = memory.main.get_battle_hp()
753-
if turnchar == 0:
753+
if turn_char == 0:
754754
if tidus_turns == 0:
755755
battle.main.equip_in_battle(equip_type="armor", ability_num=0x8028)
756756
elif tidus_turns == 1:
757757
battle.main.defend()
758758
else:
759759
battle.main.buddy_swap_rikku()
760760
tidus_turns += 1
761-
elif turnchar == 1:
762-
rikkuslotnum = memory.main.get_battle_char_slot(6)
763-
if rikkuslotnum < 3 and party_hp[rikkuslotnum] == 0:
761+
elif turn_char == 1:
762+
rikku_slot_num = memory.main.get_battle_char_slot(6)
763+
if rikku_slot_num < 3 and party_hp[rikku_slot_num] == 0:
764764
battle.main.revive()
765765
yuna_turn = True
766766
elif not yuna_turn:
@@ -778,9 +778,9 @@ def spherimorph():
778778
else:
779779
battle.main.defend()
780780
yuna_turn = True
781-
elif turnchar == 3:
782-
rikkuslotnum = memory.main.get_battle_char_slot(6)
783-
if rikkuslotnum < 3 and party_hp[rikkuslotnum] == 0:
781+
elif turn_char == 3:
782+
rikku_slot_num = memory.main.get_battle_char_slot(6)
783+
if rikku_slot_num < 3 and party_hp[rikku_slot_num] == 0:
784784
battle.main.revive()
785785
kim_turn = True
786786
elif not kim_turn:
@@ -804,7 +804,7 @@ def spherimorph():
804804
battle.main.buddy_swap_lulu()
805805
else:
806806
battle.main.defend()
807-
elif turnchar == 5:
807+
elif turn_char == 5:
808808
if not battle.main.spheri_spell_item_ready():
809809
if spell_num == 1:
810810
battle.main.ice()
@@ -827,32 +827,32 @@ def spherimorph():
827827
battle.main.buddy_swap_rikku()
828828
else:
829829
battle.main.defend()
830-
elif turnchar == 6:
830+
elif turn_char == 6:
831831
mix_dmg_rolls = sum(memory.main.rikku_mix_damage())
832832
logger.debug(f"Mix will do {mix_dmg_rolls} damage.")
833833
if mix_dmg_rolls < memory.main.get_enemy_current_hp()[0]:
834834
logger.debug("Throwing Grenade because of damage rolls")
835-
grenadeslotnum = memory.main.get_use_items_slot(35)
836-
battle.main.use_item(grenadeslotnum, "none")
835+
grenade_slot_num = memory.main.get_use_items_slot(35)
836+
battle.main.use_item(grenade_slot_num, "none")
837837
elif not battle.main.spheri_spell_item_ready():
838838
if 5 not in memory.main.get_active_battle_formation():
839839
battle.main.buddy_swap_lulu()
840840
else:
841841
battle.main.defend()
842-
elif yunaTurn and kimTurn:
842+
elif yuna_turn and kim_turn:
843843
logger.debug("Starting Rikkus overdrive")
844844
logger.debug("Full Damage Values:")
845845
logger.debug(memory.main.rikku_mix_damage())
846-
if spellNum == 1:
846+
if spell_num == 1:
847847
logger.debug("Creating Ice")
848848
battle.main.rikku_full_od("spherimorph1")
849-
elif spellNum == 2:
849+
elif spell_num == 2:
850850
logger.debug("Creating Water")
851851
battle.main.rikku_full_od("spherimorph2")
852-
elif spellNum == 3:
852+
elif spell_num == 3:
853853
logger.debug("Creating Thunder")
854854
battle.main.rikku_full_od("spherimorph3")
855-
elif spellNum == 4:
855+
elif spell_num == 4:
856856
logger.debug("Creating Fire")
857857
battle.main.rikku_full_od("spherimorph4")
858858
else:
@@ -872,7 +872,7 @@ def crawler():
872872
battle.main.negator_with_steal()
873873
else:
874874
tidus_turns = 0
875-
rikkuturns = 0
875+
rikku_turns = 0
876876
kimahriturns = 0
877877
luluturns = 0
878878
yunaturns = 0
@@ -882,37 +882,37 @@ def crawler():
882882
while memory.main.battle_active(): # AKA end of battle screen
883883
FFXC.set_neutral()
884884
if memory.main.turn_ready():
885-
turnchar = memory.main.get_battle_char_turn()
886-
if turnchar == 0:
885+
turn_char = memory.main.get_battle_char_turn()
886+
if turn_char == 0:
887887
if tidus_turns == 0:
888888
logger.debug("Swapping Tidus for Rikku")
889889
battle.main.buddy_swap_rikku()
890890
else:
891891
battle.main.defend()
892892
tidus_turns += 1
893-
elif turnchar == 6:
893+
elif turn_char == 6:
894894
if luluturns < 2:
895895
logger.debug("Using Lightning Marble")
896896
lightningmarbleslot = memory.main.get_use_items_slot(30)
897-
if rikkuturns < 1:
897+
if rikku_turns < 1:
898898
battle.main.use_item(lightningmarbleslot, target=21)
899899
else:
900900
battle.main.use_item(lightningmarbleslot, target=21)
901901
else:
902902
logger.debug("Starting Rikkus overdrive")
903903
battle.main.rikku_full_od("crawler")
904-
rikkuturns += 1
905-
elif turnchar == 3:
904+
rikku_turns += 1
905+
elif turn_char == 3:
906906
if kimahriturns == 0:
907907
lightningmarbleslot = memory.main.get_use_items_slot(30)
908908
battle.main.use_item(lightningmarbleslot, target=21)
909909
else:
910910
battle.main.buddy_swap_yuna()
911911
kimahriturns += 1
912-
elif turnchar == 5:
912+
elif turn_char == 5:
913913
battle.main.revive()
914914
luluturns += 1
915-
elif turnchar == 1:
915+
elif turn_char == 1:
916916
if yunaturns == 0:
917917
battle.main.defend()
918918
else:
@@ -947,7 +947,7 @@ def wendigo():
947947
while memory.main.battle_active(): # AKA end of battle screen
948948
if memory.main.turn_ready():
949949
party_hp = memory.main.get_battle_hp()
950-
turnchar = memory.main.get_battle_char_turn()
950+
turn_char = memory.main.get_battle_char_turn()
951951
tidus_slot = memory.main.get_battle_char_slot(0)
952952

953953
if party_hp[memory.main.get_battle_char_slot(0)] == 0:
@@ -956,15 +956,15 @@ def wendigo():
956956
powerbreak = True
957957
usepowerbreak = powerbreak and not powerbreakused
958958

959-
if turnchar == 1:
959+
if turn_char == 1:
960960
logger.debug("Yunas Turn")
961961
# If Yuna still needs AP:
962962
if not yuna_ap:
963963
logger.debug("Yuna still needs AP")
964964
# If both other characters are dead Mega-Phoenix if available, otherwise PD
965965
if (
966966
battle.main.wendigo_res_heal(
967-
turnchar=turnchar,
967+
turn_char=turn_char,
968968
use_power_break=usepowerbreak,
969969
tidus_max_hp=tidus_max_hp,
970970
)
@@ -981,7 +981,7 @@ def wendigo():
981981
battle.main.buddy_swap_rikku()
982982
else:
983983
xbox.weap_swap(0)
984-
elif turnchar == 0:
984+
elif turn_char == 0:
985985
if not tidushaste:
986986
logger.debug("Tidus Haste self")
987987
battle.main.tidus_haste("none")
@@ -1032,7 +1032,7 @@ def wendigo():
10321032
logger.debug("No need to heal. Ver 2")
10331033
battle.main.attack_by_num(21, "l")
10341034
memory.main.wait_frames(30 * 0.2)
1035-
elif turnchar == 6:
1035+
elif turn_char == 6:
10361036
if phase == 2:
10371037
phase += 1
10381038
lightcurtainslot = memory.main.get_use_items_slot(57)
@@ -1049,7 +1049,7 @@ def wendigo():
10491049
# defend()
10501050
elif (
10511051
battle.main.wendigo_res_heal(
1052-
turnchar=turnchar,
1052+
turn_char=turn_char,
10531053
use_power_break=usepowerbreak,
10541054
tidus_max_hp=tidus_max_hp,
10551055
)
@@ -1065,7 +1065,7 @@ def wendigo():
10651065
# buddy_swap_lulu()
10661066
else:
10671067
battle.main.defend()
1068-
elif turnchar == 2:
1068+
elif turn_char == 2:
10691069
if usepowerbreak:
10701070
logger.debug("Using Power Break")
10711071
battle.main.use_skill(position=0, target=21)
@@ -1075,17 +1075,17 @@ def wendigo():
10751075
# defend()
10761076
elif (
10771077
battle.main.wendigo_res_heal(
1078-
turnchar=turnchar,
1078+
turn_char=turn_char,
10791079
use_power_break=usepowerbreak,
10801080
tidus_max_hp=tidus_max_hp,
10811081
)
10821082
== 0
10831083
):
10841084
battle.main.buddy_swap_kimahri()
1085-
elif turnchar == 5:
1085+
elif turn_char == 5:
10861086
if (
10871087
battle.main.wendigo_res_heal(
1088-
turnchar=turnchar,
1088+
turn_char=turn_char,
10891089
use_power_break=usepowerbreak,
10901090
tidus_max_hp=tidus_max_hp,
10911091
)
@@ -1109,7 +1109,7 @@ def wendigo():
11091109
):
11101110
if (
11111111
battle.main.wendigo_res_heal(
1112-
turnchar=turnchar,
1112+
turn_char=turn_char,
11131113
use_power_break=usepowerbreak,
11141114
tidus_max_hp=tidus_max_hp,
11151115
)
@@ -1139,9 +1139,9 @@ def evrae():
11391139

11401140
while memory.main.battle_active(): # AKA end of battle screen
11411141
if memory.main.turn_ready():
1142-
turnchar = memory.main.get_battle_char_turn()
1142+
turn_char = memory.main.get_battle_char_turn()
11431143
logger.debug(f"Tidus prep turns: {tidus_prep}")
1144-
if turnchar == 0:
1144+
if turn_char == 0:
11451145
logger.debug("Registering Tidus' turn")
11461146
if game_vars.skip_kilika_luck():
11471147
if tidus_prep == 0:
@@ -1194,7 +1194,7 @@ def evrae():
11941194
else:
11951195
tidus_attacks += 1
11961196
battle.main.attack("none")
1197-
elif turnchar == 6:
1197+
elif turn_char == 6:
11981198
logger.debug("Registering Rikkus turn")
11991199
if rikku_turns == 0:
12001200
rikku_turns += 1
@@ -1231,7 +1231,7 @@ def evrae():
12311231
else:
12321232
battle.main.steal()
12331233
steal_count += 1
1234-
elif turnchar == 3:
1234+
elif turn_char == 3:
12351235
logger.debug("Registering Kimahri's turn")
12361236
if not game_vars.get_blitz_win() and not lunar_curtain:
12371237
logger.debug("Use Lunar Curtain")

0 commit comments

Comments
 (0)