summaryrefslogtreecommitdiff
path: root/battle
diff options
context:
space:
mode:
Diffstat (limited to 'battle')
-rw-r--r--battle/ai/items.asm5
-rw-r--r--battle/core.asm15
-rw-r--r--battle/effect_commands.asm25
3 files changed, 29 insertions, 16 deletions
diff --git a/battle/ai/items.asm b/battle/ai/items.asm
index 8898fdff5..46f04bf65 100644
--- a/battle/ai/items.asm
+++ b/battle/ai/items.asm
@@ -21,7 +21,7 @@ AI_SwitchOrTryItem: ; 38000
jr nz, DontSwitch
ld hl, TrainerClassAttributes + 5
- ld a, [wcfc0]
+ ld a, [InBattleTowerBattle] ; Load always the first TrainerClass for BattleTower-Trainers
and a
jr nz, .ok
ld a, [TrainerClass]
@@ -157,7 +157,8 @@ CheckSubstatusCantRun: ; 380ff
AI_TryItem: ; 38105
- ld a, [wcfc0]
+ ; items are not allowed in the BattleTower
+ ld a, [InBattleTowerBattle]
and a
ret nz
diff --git a/battle/core.asm b/battle/core.asm
index 3696b2bb5..7e85e996d 100644
--- a/battle/core.asm
+++ b/battle/core.asm
@@ -2462,7 +2462,7 @@ Function3cfa4: ; 3cfa4
ld a, [InLinkBattle]
and a
ret nz
- ld a, [wcfc0]
+ ld a, [InBattleTowerBattle]
bit 0, a
jr nz, .asm_3d006
call Function3ebd8
@@ -3068,7 +3068,7 @@ LostBattle: ; 3d38e
ld a, 1
ld [BattleEnded], a
- ld a, [wcfc0]
+ ld a, [InBattleTowerBattle]
bit 0, a
jr nz, .asm_3d3bd
@@ -5175,7 +5175,7 @@ BattleMenu_Pack: ; 3e1c7
and a
jp nz, ItemsCantBeUsed
- ld a, [wcfc0]
+ ld a, [InBattleTowerBattle]
and a
jp nz, ItemsCantBeUsed
@@ -6214,7 +6214,8 @@ LoadEnemyMon: ; 3e8eb
and a
jp nz, Function3dabd
- ld a, [wcfc0] ; ????
+; and also not in a BattleTower-Battle
+ ld a, [InBattleTowerBattle] ; ????
bit 0, a
jp nz, Function3dabd
@@ -7107,7 +7108,7 @@ BadgeStatBoosts: ; 3ed45
and a
ret nz
- ld a, [wcfc0]
+ ld a, [InBattleTowerBattle]
and a
ret nz
@@ -7329,7 +7330,7 @@ Function3ee3b: ; 3ee3b
and a
ret nz
- ld a, [wcfc0]
+ ld a, [InBattleTowerBattle]
bit 0, a
ret nz
@@ -8716,7 +8717,7 @@ endr
call Function3d0be
ld hl, BattleText_0x80730
call StdBattleTextBox
- ld a, [wcfc0]
+ ld a, [InBattleTowerBattle]
bit 0, a
ret z
call ClearTileMap
diff --git a/battle/effect_commands.asm b/battle/effect_commands.asm
index 4d53eec08..15598120b 100644
--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -700,7 +700,7 @@ BattleCommand02: ; 343db
and a
ret nz
- ld a, [wcfc0]
+ ld a, [InBattleTowerBattle]
and a
ret nz
@@ -3841,7 +3841,7 @@ BattleCommanda1: ; 35461
and a
jr nz, .asm_35532
- ld a, [wcfc0]
+ ld a, [InBattleTowerBattle]
and a
jr nz, .asm_35532
@@ -5544,7 +5544,7 @@ BattleCommand14: ; 35e5c
call AnimateCurrentMove
ld b, $7
- ld a, [wcfc0]
+ ld a, [InBattleTowerBattle]
and a
jr z, .asm_35ea4
ld b, $3
@@ -5587,7 +5587,7 @@ Function35ece: ; 35ece
and a
jr nz, .asm_35eec
- ld a, [wcfc0]
+ ld a, [InBattleTowerBattle]
and a
jr nz, .asm_35eec
@@ -5676,18 +5676,23 @@ BattleCommand2f: ; 35f2c
call GetBattleVar
and a
jr nz, .asm_35fb8
+
ld a, [hBattleTurn]
and a
jr z, .asm_35f89
+
ld a, [InLinkBattle]
and a
jr nz, .asm_35f89
- ld a, [wcfc0]
+
+ ld a, [InBattleTowerBattle]
and a
jr nz, .asm_35f89
+
ld a, [PlayerSubStatus5]
bit SUBSTATUS_LOCK_ON, a
jr nz, .asm_35f89
+
call BattleRandom
cp $40
jr c, .asm_35fb8
@@ -6323,11 +6328,12 @@ BattleCommand1d: ; 362e3
ld a, [hBattleTurn]
and a
jr z, .DidntMiss
+
ld a, [InLinkBattle]
and a
jr nz, .DidntMiss
- ld a, [wcfc0]
+ ld a, [InBattleTowerBattle]
and a
jr nz, .DidntMiss
@@ -8168,18 +8174,23 @@ BattleCommand30: ; 36dc7
ld a, [hBattleTurn]
and a
jr z, .asm_36e0e
+
ld a, [InLinkBattle]
and a
jr nz, .asm_36e0e
- ld a, [wcfc0]
+
+ ld a, [InBattleTowerBattle]
and a
jr nz, .asm_36e0e
+
ld a, [PlayerSubStatus5]
bit SUBSTATUS_LOCK_ON, a
jr nz, .asm_36e0e
+
call BattleRandom
cp $40
jr c, .asm_36e52
+
.asm_36e0e
ld a, BATTLE_VARS_STATUS_OPP
call GetBattleVarAddr