diff options
author | xCrystal <rgr.crystal@gmail.com> | 2019-07-21 18:09:54 +0200 |
---|---|---|
committer | xCrystal <rgr.crystal@gmail.com> | 2019-07-21 18:09:54 +0200 |
commit | 92c2fc50a26eddc1bf0dda5afbe45f355dfdaa8f (patch) | |
tree | b0e7912d7da86e5d13758a3df6b4651934311855 | |
parent | 112777ab450a38ec488dfdc9c2d41bef5a7ddb70 (diff) |
More progress related to move effects
-rw-r--r-- | src/constants/duel_constants.asm | 4 | ||||
-rw-r--r-- | src/data/effect_commands.asm | 22 | ||||
-rw-r--r-- | src/engine/bank01.asm | 13 | ||||
-rw-r--r-- | src/engine/bank02.asm | 40 | ||||
-rw-r--r-- | src/engine/bank06.asm | 4 | ||||
-rw-r--r-- | src/engine/effect_functions.asm | 216 | ||||
-rw-r--r-- | src/engine/home.asm | 16 | ||||
-rw-r--r-- | src/text/text1.asm | 6 | ||||
-rw-r--r-- | src/text/text2.asm | 2 | ||||
-rw-r--r-- | src/text/text_offsets.asm | 8 | ||||
-rw-r--r-- | src/wram.asm | 34 |
11 files changed, 255 insertions, 110 deletions
diff --git a/src/constants/duel_constants.asm b/src/constants/duel_constants.asm index d9b9e9c..943881b 100644 --- a/src/constants/duel_constants.asm +++ b/src/constants/duel_constants.asm @@ -165,6 +165,10 @@ NO_DAMAGE_OR_EFFECT_NSHIELD EQU $05 WEAKNESS EQU 1 RESISTANCE EQU 2 +; wEffectFailed constants +EFFECT_FAILED_NO_EFFECT EQU $01 +EFFECT_FAILED_UNSUCCESSFUL EQU $02 + ; Box message id's const_def const BOXMSG_PLAYERS_TURN diff --git a/src/data/effect_commands.asm b/src/data/effect_commands.asm index 6dc74ee..fa1bc81 100644 --- a/src/data/effect_commands.asm +++ b/src/data/effect_commands.asm @@ -109,8 +109,8 @@ ZubatLeechLifeEffectCommands: db $00 BeedrillTwineedleEffectCommands: - dbw $03, $47f5 - dbw $09, $47ed + dbw $03, Twineedle_MultiplierEffect + dbw $09, Twineedle_AIEffect db $00 BeedrillPoisonStingEffectCommands: @@ -127,8 +127,8 @@ ExeggcuteLeechSeedEffectCommands: db $00 KoffingFoulGasEffectCommands: - dbw $03, $482a - dbw $09, $4822 + dbw $03, FoulGas_PoisonOrConfusionEffect + dbw $09, FoulGas_AIEffect db $00 MetapodStiffenEffectCommands: @@ -158,19 +158,19 @@ ExeggutorTeleportEffectCommands: db $00 ExeggutorBigEggsplosionEffectCommands: - dbw $03, $4944 - dbw $09, $4925 + dbw $03, BigEggsplosion_MultiplierEffect + dbw $09, BigEggsplosion_AIEffect db $00 NidokingThrashEffectCommands: - dbw $03, $4973 - dbw $04, $4982 - dbw $09, $496b + dbw $03, Thrash_ModifierEffect + dbw $04, Func_2c982 + dbw $09, Thrash_AIEffect db $00 NidokingToxicEffectCommands: - dbw $03, $4994 - dbw $09, $498c + dbw $03, Toxic_DoublePoisonEffect + dbw $09, Toxic_AIEffect db $00 NidoqueenBoyfriendsEffectCommands: diff --git a/src/engine/bank01.asm b/src/engine/bank01.asm index 54584af..c7a31d0 100644 --- a/src/engine/bank01.asm +++ b/src/engine/bank01.asm @@ -7191,9 +7191,9 @@ Func_6e49: ; 6e49 (1:6e49) INCROM $6e49, $700a ; print one of the "There was no effect from" texts depending -; on the value at wccf1 ($00 or a status condition constant) +; on the value at wNoEffectFromStatus (NO_STATUS or a status condition constant) PrintThereWasNoEffectFromStatusText: ; 700a (1:700a) - ld a, [wccf1] + ld a, [wNoEffectFromStatus] or a jr nz, .status ld hl, wLoadedMoveName @@ -7415,18 +7415,21 @@ ClearNonTurnTemporaryDuelvars_CopyStatus: ; 7189 (1:7189) ret ; 0x7195 +; update non-turn holder's DUELVARS_ARENA_CARD_LAST_TURN_DAMAGE +; if wccef == 0: set to [wDealtDamage] +; if wceef != 0: set to 0 Func_7195: ; 7195 (1:7195) ld a, DUELVARS_ARENA_CARD_LAST_TURN_DAMAGE call GetNonTurnDuelistVariable ld a, [wccef] or a - jr nz, .asm_71a9 + jr nz, .zero ld a, [wDealtDamage] ld [hli], a - ld a, [wccc0] + ld a, [wDealtDamage + 1] ld [hl], a ret -.asm_71a9 +.zero xor a ld [hli], a ld [hl], a diff --git a/src/engine/bank02.asm b/src/engine/bank02.asm index 30c5299..a4a0f62 100644 --- a/src/engine/bank02.asm +++ b/src/engine/bank02.asm @@ -53,7 +53,7 @@ DuelCheckMenu_YourPlayArea: ; 8047 (2:4047) .draw ld h, a ld l, a - call DrawYourOrOppPlayArea + call DrawYourOrOppPlayAreaScreen ld a, [wCheckMenuCursorYPosition] sla a @@ -93,11 +93,11 @@ DuelCheckMenu_YourPlayArea: ; 8047 (2:4047) jr .draw .table ; 8098 (2:4098) - dw OpenDuelScreen_TurnHolderPlayArea - dw OpenDuelScreen_TurnHolderHand - dw OpenDuelScreen_TurnHolderDiscardPile + dw OpenYourOrOppPlayAreaScreen_TurnHolderPlayArea + dw OpenYourOrOppPlayAreaScreen_TurnHolderHand + dw OpenYourOrOppPlayAreaScreen_TurnHolderDiscardPile -OpenDuelScreen_TurnHolderPlayArea: ; 809e (2:409e) +OpenYourOrOppPlayAreaScreen_TurnHolderPlayArea: ; 809e (2:409e) ldh a, [hWhoseTurn] push af bank1call OpenTurnHolderPlayAreaScreen @@ -105,7 +105,7 @@ OpenDuelScreen_TurnHolderPlayArea: ; 809e (2:409e) ldh [hWhoseTurn], a ret -OpenDuelScreen_NonTurnHolderPlayArea: +OpenYourOrOppPlayAreaScreen_NonTurnHolderPlayArea: ldh a, [hWhoseTurn] push af bank1call OpenNonTurnHolderPlayAreaScreen @@ -113,7 +113,7 @@ OpenDuelScreen_NonTurnHolderPlayArea: ldh [hWhoseTurn], a ret -OpenDuelScreen_TurnHolderHand: +OpenYourOrOppPlayAreaScreen_TurnHolderHand: ldh a, [hWhoseTurn] push af bank1call OpenTurnHolderHandScreen_Simple @@ -121,7 +121,7 @@ OpenDuelScreen_TurnHolderHand: ldh [hWhoseTurn], a ret -OpenDuelScreen_NonTurnHolderHand: +OpenYourOrOppPlayAreaScreen_NonTurnHolderHand: ldh a, [hWhoseTurn] push af bank1call OpenNonTurnHolderHandScreen_Simple @@ -129,7 +129,7 @@ OpenDuelScreen_NonTurnHolderHand: ldh [hWhoseTurn], a ret -OpenDuelScreen_TurnHolderDiscardPile: +OpenYourOrOppPlayAreaScreen_TurnHolderDiscardPile: ldh a, [hWhoseTurn] push af bank1call OpenTurnHolderDiscardPileScreen @@ -137,7 +137,7 @@ OpenDuelScreen_TurnHolderDiscardPile: ldh [hWhoseTurn], a ret -OpenDuelScreen_NonTurnHolderDiscardPile: +OpenYourOrOppPlayAreaScreen_NonTurnHolderDiscardPile: ldh a, [hWhoseTurn] push af bank1call OpenNonTurnHolderDiscardPileScreen @@ -174,7 +174,7 @@ DuelCheckMenu_OppPlayArea: ; 80da (2:40da) ld h, a .cursor - call DrawYourOrOppPlayArea + call DrawYourOrOppPlayAreaScreen ; convert cursor position and ; store it in wYourOrOppPlayAreaLastCursorPosition @@ -230,9 +230,9 @@ DuelCheckMenu_OppPlayArea: ; 80da (2:40da) jr .turns .table - dw OpenDuelScreen_NonTurnHolderPlayArea - dw OpenDuelScreen_NonTurnHolderHand - dw OpenDuelScreen_NonTurnHolderDiscardPile + dw OpenYourOrOppPlayAreaScreen_NonTurnHolderPlayArea + dw OpenYourOrOppPlayAreaScreen_NonTurnHolderHand + dw OpenYourOrOppPlayAreaScreen_NonTurnHolderDiscardPile CheckMenuData: ; (2:4158) textitem 2, 14, InPlayAreaText @@ -387,7 +387,7 @@ YourOrOppPlayAreaArrowPositions_OpponentDiscardPile: ; loads tiles and icons to display Your Play Area / Opp. Play Area screen, ; and draws the screen according to the turn player ; input: h -> [wCheckMenuPlayAreaWhichDuelist] and l -> [wCheckMenuPlayAreaWhichLayout] -DrawYourOrOppPlayArea: ; 8209 (2:4209) +DrawYourOrOppPlayAreaScreen: ; 8209 (2:4209) ; loads the turn holders ld a, h ld [wCheckMenuPlayAreaWhichDuelist], a @@ -398,7 +398,7 @@ DrawYourOrOppPlayArea: ; 8209 (2:4209) ; loads tiles and icons to display Your Play Area / Opp. Play Area screen, ; and draws the screen according to the turn player ; input: [wCheckMenuPlayAreaWhichDuelist] and [wCheckMenuPlayAreaWhichLayout] -_DrawYourOrOppPlayArea: ; 8211 (2:4211) +_DrawYourOrOppPlayAreaScreen: ; 8211 (2:4211) xor a ld [wTileMapFill], a call ZeroObjectPositions @@ -503,7 +503,7 @@ Func_82b6: ; 82b6 (2:42b6) ; loads tiles and icons to display the In Play Area screen, ; and draws the screen -_DrawInPlayArea: ; 82ce (2:42ce) +DrawInPlayAreaScreen: ; 82ce (2:42ce) xor a ld [wTileMapFill], a call ZeroObjectPositions @@ -1387,7 +1387,7 @@ Func_8764: ; 8764 (2:4764) ldh a, [hWhoseTurn] ld h, a ld l, a - call DrawYourOrOppPlayArea + call DrawYourOrOppPlayAreaScreen .swap ld a, [$ce56] @@ -1429,7 +1429,7 @@ Func_8764: ; 8764 (2:4764) ; switch the play area to draw ld h, a ld l, a - call DrawYourOrOppPlayArea + call DrawYourOrOppPlayAreaScreen xor a ld [$ce56], a @@ -1579,7 +1579,7 @@ Func_8883: ; 8883 (2:4883) .draw ld h, a - call DrawYourOrOppPlayArea + call DrawYourOrOppPlayAreaScreen .text call DrawWideTextBox diff --git a/src/engine/bank06.asm b/src/engine/bank06.asm index 90ee100..cb1b0a9 100644 --- a/src/engine/bank06.asm +++ b/src/engine/bank06.asm @@ -158,7 +158,7 @@ Func_180d5: ; 180d5 (6:40d5) .asm_006_40da xor a ld [wCheckMenuCursorBlinkCounter], a - farcall _DrawInPlayArea + farcall DrawInPlayAreaScreen call EnableLCD call IsClairvoyanceActive jr c, .asm_006_40ef @@ -1122,7 +1122,7 @@ Func_006_50fb: ; 190fb (6:50fb) ld a, [wWhoseTurn] ld l, a .asm_006_5127 - call DrawYourOrOppPlayArea_Bank0 + call DrawYourOrOppPlayAreaScreen_Bank0 pop af ld [wDuelDisplayedScreen], a .asm_006_512e diff --git a/src/engine/effect_functions.asm b/src/engine/effect_functions.asm index b3c707b..c8d8f24 100644 --- a/src/engine/effect_functions.asm +++ b/src/engine/effect_functions.asm @@ -7,6 +7,7 @@ PoisonEffect: ; 2c007 (b:4007) lb bc, CNF_SLP_PRZ, POISONED jr ApplyStatusEffect +DoublePoisonEffect: ; 2c00c (b:400c) lb bc, CNF_SLP_PRZ, DOUBLE_POISONED jr ApplyStatusEffect @@ -56,7 +57,7 @@ ApplyStatusEffect: .cant_induce_status ld a, c - ld [wccf1], a + ld [wNoEffectFromStatus], a call SetNoEffectFromStatus or a ret @@ -118,49 +119,50 @@ Func_2c08c: ; 0x2c09c SetNoEffectFromStatus: ; 2c09c (b:409c) - ld a, $1 - ld [wcced], a + ld a, EFFECT_FAILED_NO_EFFECT + ld [wEffectFailed], a ret ; 0x2c0a2 SetWasUnsuccessful: ; 2c0a2 (b:40a2) - ld a, $2 - ld [wcced], a + ld a, EFFECT_FAILED_UNSUCCESSFUL + ld [wEffectFailed], a ret ; 0x2c0a8 INCROM $2c0a8, $2c0d4 ; Sets some flags for AI use -; if target double poisoned -; [wccbb] <- [wDamage] -; [wccbc] <- [wDamage] +; if target poisoned +; [wAIMinDamage] <- [wDamage] +; [wAIMaxDamage] <- [wDamage] ; else -; [wccbb] <- [wDamage] + d -; [wccbc] <- [wDamage] + e -; [wDamage] <- [wDamage] + a +; [wAIMinDamage] <- [wDamage] + d +; [wAIMaxDamage] <- [wDamage] + e +; [wDamage] <- [wDamage] + a Func_2c0d4: ; 2c0d4 (b:40d4) push af ld a, DUELVARS_ARENA_CARD_STATUS call GetNonTurnDuelistVariable - and DOUBLE_POISONED - jr z, .not_double_poisoned + and POISONED | DOUBLE_POISONED + jr z, Func_2c0e9.skip_push_af pop af ld a, [wDamage] - ld [wccbb], a - ld [wccbc], a + ld [wAIMinDamage], a + ld [wAIMaxDamage], a ret +Func_2c0e9: ; 2c0e9 (b:40e9) push af -.not_double_poisoned +.skip_push_af ld hl, wDamage ld a, [hl] add d - ld [wccbb], a + ld [wAIMinDamage], a ld a, [hl] add e - ld [wccbc], a + ld [wAIMaxDamage], a pop af add [hl] ld [hl], a @@ -168,17 +170,17 @@ Func_2c0d4: ; 2c0d4 (b:40d4) ; 0x2c0fb ; Sets some flags for AI use -; [wDamage] <- a -; [wccbb] <- d -; [wccbc] <- e +; [wDamage] <- a +; [wAIMinDamage] <- d +; [wAIMaxDamage] <- e Func_2c0fb: ; 2c0fb (b:40fb) ld [wDamage], a xor a ld [wDamage + 1], a ld a, d - ld [wccbb], a + ld [wAIMinDamage], a ld a, e - ld [wccbc], a + ld [wAIMaxDamage], a ret ; 0x2c10b @@ -219,14 +221,24 @@ ApplySubstatus2ToDefendingCard: ; 2c149 (b:4149) ret ; 0x2c166 - INCROM $2c166, $2c6f0 +Func_2c166: ; 2c166 (b:4166) + ld [wDamage], a + ld [wAIMinDamage], a + ld [wAIMaxDamage], a + xor a + ld [wDamage + 1], a + ret +; 0x2c174 + + INCROM $2c174, $2c6f0 SpitPoison_AIEffect: ; 2c6f0 (b:46f0) - ld a, $5 - lb de, $0, $a + ld a, 5 + lb de, 0, 10 jp Func_2c0fb ; 0x2c6f8 +; If heads, defending Pokemon becomes poisoned SpitPoison_Poison50PercentEffect: ; 2c6f8 (b:46f8) ldtx de, PoisonCheckText call TossCoin_BankB @@ -240,19 +252,20 @@ SpitPoison_Poison50PercentEffect: ; 2c6f8 (b:46f8) INCROM $2c70a, $2c730 PoisonFang_AIEffect: ; 2c730 (b:4730) - ld a, $a - lb de, $a, $a + ld a, 10 + lb de, 10, 10 jp Func_2c0d4 ; 0x2c738 WeepinbellPoisonPowder_AIEffect: ; 2c738 (b:4738) - ld a, $5 - lb de, $0, $a + ld a, 5 + lb de, 0, 10 jp Func_2c0d4 ; 0x2c740 INCROM $2c740, $2c77e +; If heads, defending Pokemon can't retreat next turn AcidEffect: ; 2c77e (b:477e) ldtx de, AcidCheckText call TossCoin_BankB @@ -263,12 +276,12 @@ AcidEffect: ; 2c77e (b:477e) ; 0x2c78b GloomPoisonPowder_AIEffect: ; 2c78b (b:478b) - ld a, $a - lb de, $a, $a + ld a, 10 + lb de, 10, 10 jp Func_2c0d4 ; 0x2c793 -; confuses both the target and the user +; Defending Pokemon and user become confused FoulOdorEffect: ; 2c793 (b:4793) call ConfusionEffect call SwapTurn @@ -277,6 +290,7 @@ FoulOdorEffect: ; 2c793 (b:4793) ret ; 0x2c7a0 +; If heads, prevent all damage done to user next turn KakunaStiffenEffect: ; 2c7a0 (b:47a0) ldtx de, IfHeadsNoDamageNextTurnText call TossCoin_BankB @@ -289,13 +303,14 @@ KakunaStiffenEffect: ; 2c7a0 (b:47a0) ; 0x2c7b4 KakunaPoisonPowder_AIEffect: ; 2c7b4 (b:47b4) - ld a, $5 - lb de, $0, $a + ld a, 5 + lb de, 0, 10 jp Func_2c0d4 ; 0x2c7bc INCROM $2c7bc, $2c7d0 +; During your next turn, double damage SwordsDanceEffect: ; 2c7d0 (b:47d0) ld a, [wTempTurnDuelistCardID] cp SCYTHER @@ -305,15 +320,54 @@ SwordsDanceEffect: ; 2c7d0 (b:47d0) ret ; 0x2c7dc +; If heads, defending Pokemon becomes confused ZubatSupersonicEffect: ; 2c7dc (b:47dc) call Confusion50PercentEffect call nc, SetNoEffectFromStatus ret ; 0x2c7e3 - INCROM $2c7e3, $2c836 + INCROM $2c7e3, $2c7ed + +Twineedle_AIEffect: ; 2c7ed (b:47ed) + ld a, 30 + lb de, 0, 60 + jp Func_2c0fb +; 0x2c7f5 + +; Flip 2 coins; deal 30x number of heads +Twineedle_MultiplierEffect: ; 2c7f5 (b:47f5) + ld hl, 30 + call LoadTxRam3 + ldtx de, DamageCheckIfHeadsXDamageText + ld a, 2 + call TossCoinATimes_BankB + ld e, a + add a + add e + call ATimes10 + call Func_2c166 + ret +; 0x2c80d + + INCROM $2c80d, $2c822 + +FoulGas_AIEffect: ; 2c822 (b:4822) + ld a, 5 + lb de, 0, 10 + jp Func_2c0e9 +; 0x2c82a + +; If heads, defending Pokemon becomes poisoned. If tails, defending Pokemon becomes confused +FoulGas_PoisonOrConfusionEffect: ; 2c82a (b:482a) + ldtx de, PoisonedIfHeadsConfusedIfTailsText + call TossCoin_BankB + jp c, PoisonEffect + jp ConfusionEffect +; 0x2c836 ; an exact copy of KakunaStiffenEffect +; If heads, prevent all damage done to user next turn MetapodStiffenEffect: ; 2c836 (b:4836) ldtx de, IfHeadsNoDamageNextTurnText call TossCoin_BankB @@ -325,4 +379,92 @@ MetapodStiffenEffect: ; 2c836 (b:4836) ret ; 0x2c84a - INCROM $2c84a, $30000 + INCROM $2c84a, $2c925 + +BigEggsplosion_AIEffect: ; 2c925 (b:4925) + ldh a, [hTempPlayAreaLocation_ff9d] + ld e, a + call GetPlayAreaCardAttachedEnergies + ld a, [wTotalAttachedEnergies] + call SetDamageToATimes20 + inc h + jr nz, .capped + ld l, 255 +.capped + ld a, l + ld [wAIMaxDamage], a + srl a + ld [wDamage], a + xor a + ld [wAIMinDamage], a + ret +; 0x2c944 + +; Flip coins equal to attached energies; deal 20x number of heads +BigEggsplosion_MultiplierEffect: ; 2c944 (b:4944) + ld e, PLAY_AREA_ARENA + call GetPlayAreaCardAttachedEnergies + ld hl, 20 + call LoadTxRam3 + ld a, [wTotalAttachedEnergies] + ldtx de, DamageCheckIfHeadsXDamageText + call TossCoinATimes_BankB +; fallthrough + +; set damage to 20*a. Also return result in hl +SetDamageToATimes20: ; 2c958 (b:4958) + ld l, a + ld h, $00 + ld e, l + ld d, h + add hl, hl + add hl, hl + add hl, de + add hl, hl + add hl, hl + ld a, l + ld [wDamage], a + ld a, h + ld [wDamage + 1], a + ret +; 0x2c96b + +Thrash_AIEffect: ; 2c96b (b:496b) + ld a, 35 + lb de, 30, 40 + jp Func_2c0fb +; 0x2c973 + +; If heads 10 more damage; if tails, 10 damage to itself +Thrash_ModifierEffect: ; 2c973 (b:4973) + ldtx de, IfHeadPlus10IfTails10ToYourselfText + call TossCoin_BankB + ldh [hTemp_ffa0], a + ret nc + ld a, 10 + call AddToDamage + ret +; 0x2c982 + +Func_2c982: ; 2c982 (b:4982) + ldh a, [hTemp_ffa0] + or a + ret nz + ld a, 10 + call Func_1955 + ret +; 0x2c98c + +Toxic_AIEffect: ; 2c98c (b:498c) + ld a, 20 + lb de, 20, 20 + jp Func_2c0e9 +; 0x2c994 + +; Defending Pokémon becomes poisoned, but takes 20 damage (double poisoned) +Toxic_DoublePoisonEffect: ; 2c994 (b:4994) + call DoublePoisonEffect + ret +; 0x2c998 + + INCROM $2c998, $30000 diff --git a/src/engine/home.asm b/src/engine/home.asm index 1425359..ff07a17 100644 --- a/src/engine/home.asm +++ b/src/engine/home.asm @@ -4453,11 +4453,11 @@ Func_16f6: ; 16f6 (0:16f6) xor a ld [wccec], a ld [wEffectFunctionsFeedbackIndex], a - ld [wcced], a + ld [wEffectFailed], a ld [wIsDamageToSelf], a ld [wccef], a ld [wccf0], a - ld [wccf1], a + ld [wNoEffectFromStatus], a bank1call ClearNonTurnTemporaryDuelvars_CopyStatus ret @@ -5175,10 +5175,10 @@ Func_1bb4: ; 1bb4 (0:1bb4) call ExchangeRNG ret -; prints one of the ThereWasNoEffectFrom*Text if wcced contains $1, -; and WasUnsuccessfulText if wcced contains $2 +; prints one of the ThereWasNoEffectFrom*Text if wEffectFailed contains EFFECT_FAILED_NO_EFFECT, +; and prints WasUnsuccessfulText if wEffectFailed contains EFFECT_FAILED_UNSUCCESSFUL Func_1bca: ; 1bca (0:1bca) - ld a, [wcced] + ld a, [wEffectFailed] or a ret z cp $1 @@ -9309,16 +9309,16 @@ Func_30a6: ; 30a6 (0:30a6) ; similar to DrawYourOrOppPlayArea (bank 2) except it also draws a wide text box. ; this is because bank 2's DrawYourOrOppPlayArea is supposed to come from the Check Menu, ; so the text box is always already there. -DrawYourOrOppPlayArea_Bank0: ; 30bc (0:30bc) +DrawYourOrOppPlayAreaScreen_Bank0: ; 30bc (0:30bc) ld a, h ld [wCheckMenuPlayAreaWhichDuelist], a ld a, l ld [wCheckMenuPlayAreaWhichLayout], a ldh a, [hBankROM] push af - ld a, BANK(_DrawYourOrOppPlayArea) + ld a, BANK(_DrawYourOrOppPlayAreaScreen) call BankswitchROM - call _DrawYourOrOppPlayArea + call _DrawYourOrOppPlayAreaScreen call DrawWideTextBox pop af call BankswitchROM diff --git a/src/text/text1.asm b/src/text/text1.asm index e7b0fe4..8789758 100644 --- a/src/text/text1.asm +++ b/src/text/text1.asm @@ -1093,7 +1093,7 @@ Text00e8: ; 37d92 (d:7d92) line "10 damage for each Heads!!!" done -Text00e9: ; 37dc9 (d:7dc9) +IfHeadPlus10IfTails10ToYourselfText: ; 37dc9 (d:7dc9) text "If Heads, + 10 damage!" line "If Tails, +10 damage to yourself!" done @@ -1142,12 +1142,12 @@ Text00f2: ; 37f9a (d:7f9a) text "Damage check" done -Text00f3: ; 37fa8 (d:7fa8) +DamageCheckIfHeadsPlusDamageText: ; 37fa8 (d:7fa8) text "Damage check!" line "If Heads, +<RAMNUM> damage!!" done -Text00f4: ; 37fcd (d:7fcd) +DamageCheckIfHeadsXDamageText: ; 37fcd (d:7fcd) text "Damage check!" line "If Heads, x <RAMNUM> damage!!" done diff --git a/src/text/text2.asm b/src/text/text2.asm index 78fb6f9..8dac791 100644 --- a/src/text/text2.asm +++ b/src/text/text2.asm @@ -22,7 +22,7 @@ PokemonsSleepCheckText: ; 380db (e:40db) text "<RAMTEXT>'s Sleep check." done -Text00fa: ; 380ed (e:40ed) +PoisonedIfHeadsConfusedIfTailsText: ; 380ed (e:40ed) text "Opponent is Poisoned if Heads," line "and Confused if Tails." done diff --git a/src/text/text_offsets.asm b/src/text/text_offsets.asm index f1ca193..6e03ba2 100644 --- a/src/text/text_offsets.asm +++ b/src/text/text_offsets.asm @@ -234,7 +234,7 @@ TextOffsets:: ; 34000 (d:4000) textpointer Text00e6 ; 0x00e6 textpointer Text00e7 ; 0x00e7 textpointer Text00e8 ; 0x00e8 - textpointer Text00e9 ; 0x00e9 + textpointer IfHeadPlus10IfTails10ToYourselfText ; 0x00e9 textpointer Text00ea ; 0x00ea textpointer Text00eb ; 0x00eb textpointer Text00ec ; 0x00ec @@ -244,14 +244,14 @@ TextOffsets:: ; 34000 (d:4000) textpointer Text00f0 ; 0x00f0 textpointer IfHeadsNoDamageNextTurnText ; 0x00f1 textpointer Text00f2 ; 0x00f2 - textpointer Text00f3 ; 0x00f3 - textpointer Text00f4 ; 0x00f4 + textpointer DamageCheckIfHeadsPlusDamageText ; 0x00f3 + textpointer DamageCheckIfHeadsXDamageText ; 0x00f4 textpointer AcidCheckText ; 0x00f5 textpointer TransparencyCheckText ; 0x00f6 textpointer ConfusionCheckDamageText ; 0x00f7 textpointer ConfusionCheckRetreatText ; 0x00f8 textpointer PokemonsSleepCheckText ; 0x00f9 - textpointer Text00fa ; 0x00fa + textpointer PoisonedIfHeadsConfusedIfTailsText ; 0x00fa textpointer Text00fb ; 0x00fb textpointer Text00fc ; 0x00fc textpointer AttackUnsuccessfulText ; 0x00fd diff --git a/src/wram.asm b/src/wram.asm index fbeb907..d2821b2 100644 --- a/src/wram.asm +++ b/src/wram.asm @@ -190,9 +190,7 @@ wPlayerArenaCardDisabledMoveIndex:: ; c2f2 ; damage taken the last time the opponent attacked (0 if no damage) wPlayerArenaCardLastTurnDamage:: ; c2f3 - ds $1 - - ds $1 + ds $2 ; status condition received the last time the opponent attacked (0 if none) wPlayerArenaCardLastTurnStatus:: ; c2f5 @@ -333,9 +331,7 @@ wOpponentArenaCardDisabledMoveIndex:: ; c3f2 ds $1 wOpponentArenaCardLastTurnDamage:: ; c3f3 - ds $1 - - ds $1 + ds $2 wOpponentArenaCardLastTurnStatus:: ; c3f5 ds $1 @@ -919,24 +915,25 @@ wLoadedMove:: ; cca6 move_data_struct wLoadedMove ; the damage field of an used move is loaded here +; doubles as "wAIAverageDamage" when complementing wAIMinDamage and wAIMaxDamage +; little-endian wDamage:: ; ccb9 ds $2 -; wccbb and wccbc appear to be used for AI scoring -wccbb:: ; ccbb +; wAIMinDamage and wAIMaxDamage appear to be used for AI scoring +; they are updated with the minimum (or floor) damage of the current move +; and with the maximum (or ceiling) damage of the current move +wAIMinDamage:: ; ccbb ds $1 -wccbc:: ; ccbc +wAIMaxDamage:: ; ccbc ds $1 ds $2 ; damage dealt by an attack to a target wDealtDamage:: ; ccbf - ds $1 - -wccc0:: ; ccc0 - ds $1 + ds $2 ; WEAKNESS and RESISTANCE flags for a damaging attack wDamageEffectiveness:: ; ccc1 @@ -999,16 +996,15 @@ wccec:: ; ccec ds $1 ; used by the effect functions to return the cause of an effect to fail -; $01: was not affected by a status condition -; $02: prints WasUnsuccessfulText -wcced:: ; cced +; in order print the appropriate text +wEffectFailed:: ; cced ds $1 wccee:: ; ccee ds $1 -; when this is non-0, DUELVARS_ARENA_CARD_LAST_TURN_DAMAGE and the -; next duelvar are always set to 0 after an attack +; flag to determine whether DUELVARS_ARENA_CARD_LAST_TURN_DAMAGE +; gets zeroed or gets updated with wDealtDamage wccef:: ; ccef ds $1 @@ -1017,7 +1013,7 @@ wccf0:: ; ccf0 ; effect functions return a status condition constant here when it had no effect ; on the target, in order to print one of the ThereWasNoEffectFrom* texts -wccf1:: ; ccf1 +wNoEffectFromStatus:: ; ccf1 ds $1 ; when non-0, allows the player to skip some delays during a duel by pressing B. |