diff --git a/asm/battle_3.s b/asm/battle_3.s index 56a77e658..646eba2d5 100644 --- a/asm/battle_3.s +++ b/asm/battle_3.s @@ -6,3561 +6,6 @@ .text - thumb_func_start sub_80423F4 -sub_80423F4: @ 80423F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08042424 - movs r0, 0 - b _080426A0 - .pool -_08042424: - movs r0, 0x80 - lsls r0, 15 - ands r0, r1 - cmp r0, 0 - beq _0804249C - adds r0, r4, 0 - bl GetBankSide - lsls r0, 24 - ldr r1, =gEnemyParty - mov r8, r1 - cmp r0, 0 - bne _08042442 - ldr r2, =gPlayerParty - mov r8, r2 -_08042442: - movs r0, 0x2 - ands r0, r4 - lsls r0, 24 - lsrs r6, r0, 25 - lsls r0, r6, 1 - adds r4, r0, r6 - adds r0, r4, 0x3 - cmp r4, r0 - bge _0804248C - adds r7, r0, 0 -_08042456: - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _08042486 - adds r0, r5, 0 - movs r1, 0x41 - bl GetMonData - cmp r0, 0 - beq _08042486 - adds r0, r5, 0 - movs r1, 0x41 - bl GetMonData - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _0804248C -_08042486: - adds r4, 0x1 - cmp r4, r7 - blt _08042456 -_0804248C: - movs r1, 0 - lsls r0, r6, 1 - adds r0, r6 - b _08042556 - .pool -_0804249C: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0804256C - movs r0, 0x80 - lsls r0, 16 - ands r1, r0 - cmp r1, 0 - beq _080424E4 - adds r0, r4, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _080424D0 - ldr r2, =gPlayerParty - mov r8, r2 - adds r0, r4, 0 - bl sub_806D864 - lsls r0, 24 - lsrs r7, r0, 24 - b _08042502 - .pool -_080424D0: - ldr r0, =gEnemyParty - mov r8, r0 - movs r1, 0x1 - eors r1, r4 - negs r0, r1 - orrs r0, r1 - lsrs r6, r0, 31 - b _0804250C - .pool -_080424E4: - adds r0, r4, 0 - bl sub_806D864 - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r4, 0 - bl GetBankSide - lsls r0, 24 - ldr r1, =gEnemyParty - mov r8, r1 - cmp r0, 0 - bne _08042502 - ldr r2, =gPlayerParty - mov r8, r2 -_08042502: - adds r0, r7, 0 - bl sub_806D82C - lsls r0, 24 - lsrs r6, r0, 24 -_0804250C: - lsls r0, r6, 1 - adds r4, r0, r6 - adds r1, r4, 0x3 - mov r9, r0 - cmp r4, r1 - bge _08042550 - adds r7, r1, 0 -_0804251A: - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _0804254A - adds r0, r5, 0 - movs r1, 0x41 - bl GetMonData - cmp r0, 0 - beq _0804254A - adds r0, r5, 0 - movs r1, 0x41 - bl GetMonData - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _08042550 -_0804254A: - adds r4, 0x1 - cmp r4, r7 - blt _0804251A -_08042550: - movs r1, 0 - mov r2, r9 - adds r0, r2, r6 -_08042556: - adds r0, 0x3 - cmp r4, r0 - bne _0804255E - movs r1, 0x1 -_0804255E: - adds r0, r1, 0 - b _080426A0 - .pool -_0804256C: - movs r0, 0x80 - lsls r0, 8 - ands r1, r0 - cmp r1, 0 - beq _080425DA - adds r0, r4, 0 - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080425DA - ldr r0, =gEnemyParty - mov r8, r0 - movs r6, 0x3 - cmp r4, 0x1 - bne _08042590 - movs r6, 0 -_08042590: - adds r4, r6, 0 - adds r6, r4, 0x3 - b _0804259E - .pool -_0804259C: - adds r4, 0x1 -_0804259E: - cmp r4, r6 - bge _080425D2 - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _0804259C - adds r0, r5, 0 - movs r1, 0x41 - bl GetMonData - cmp r0, 0 - beq _0804259C - adds r0, r5, 0 - movs r1, 0x41 - bl GetMonData - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _0804259C -_080425D2: - movs r0, 0 - cmp r4, r6 - bne _080426A0 - b _0804269E -_080425DA: - adds r0, r4, 0 - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08042608 - movs r0, 0x1 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0x3 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r6, r0, 24 - ldr r2, =gEnemyParty - mov r8, r2 - b _08042620 - .pool -_08042608: - movs r0, 0 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0x2 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gPlayerParty - mov r8, r0 -_08042620: - mov r1, r10 - cmp r1, 0x6 - bne _08042630 - ldr r1, =gBattlePartyID - lsls r0, r7, 1 - adds r0, r1 - ldrb r0, [r0] - mov r10, r0 -_08042630: - mov r2, r9 - cmp r2, 0x6 - bne _08042640 - ldr r1, =gBattlePartyID - lsls r0, r6, 1 - adds r0, r1 - ldrb r0, [r0] - mov r9, r0 -_08042640: - movs r4, 0 -_08042642: - movs r0, 0x64 - muls r0, r4 - mov r1, r8 - adds r5, r1, r0 - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _08042692 - adds r0, r5, 0 - movs r1, 0x41 - bl GetMonData - cmp r0, 0 - beq _08042692 - adds r0, r5, 0 - movs r1, 0x41 - bl GetMonData - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _08042692 - cmp r4, r10 - beq _08042692 - cmp r4, r9 - beq _08042692 - ldr r0, =gBattleStruct - ldr r1, [r0] - adds r0, r7, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r4, r0 - beq _08042692 - adds r0, r6, r1 - adds r0, 0x5C - ldrb r0, [r0] - cmp r4, r0 - bne _08042698 -_08042692: - adds r4, 0x1 - cmp r4, 0x5 - ble _08042642 -_08042698: - movs r0, 0 - cmp r4, 0x6 - bne _080426A0 -_0804269E: - movs r0, 0x1 -_080426A0: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80423F4 - - thumb_func_start castform_switch -castform_switch: @ 80426BC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r1, =gBattleMons - movs r0, 0x58 - muls r0, r6 - adds r4, r0, r1 - ldrh r1, [r4] - ldr r0, =0x00000181 - cmp r1, r0 - bne _08042760 - adds r0, r4, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x3B - bne _08042760 - ldrh r0, [r4, 0x28] - cmp r0, 0 - beq _08042760 - str r5, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - cmp r0, 0 - bne _0804270E - str r5, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - cmp r0, 0 - beq _08042734 -_0804270E: - adds r2, r4, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0 - beq _08042734 - adds r1, r4, 0 - adds r1, 0x22 - ldrb r0, [r1] - cmp r0, 0 - beq _08042734 - strb r5, [r2] - strb r5, [r1] - movs r0, 0x1 - b _08042818 - .pool -_08042734: - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08042760 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - cmp r0, 0 - beq _08042764 -_08042760: - movs r0, 0 - b _08042818 -_08042764: - ldr r1, =gBattleWeather - ldrh r0, [r1] - movs r2, 0xE7 - ands r2, r0 - adds r4, r1, 0 - cmp r2, 0 - bne _08042792 - ldr r1, =gBattleMons - movs r0, 0x58 - muls r0, r6 - adds r1, r0, r1 - adds r3, r1, 0 - adds r3, 0x21 - ldrb r0, [r3] - cmp r0, 0 - beq _08042792 - adds r1, 0x22 - ldrb r0, [r1] - cmp r0, 0 - beq _08042792 - strb r2, [r3] - strb r2, [r1] - movs r5, 0x1 -_08042792: - ldrh r1, [r4] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _080427BE - ldr r1, =gBattleMons - movs r0, 0x58 - muls r0, r6 - adds r1, r0, r1 - adds r2, r1, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0xA - beq _080427BE - adds r1, 0x22 - ldrb r0, [r1] - cmp r0, 0xA - beq _080427BE - movs r0, 0xA - strb r0, [r2] - strb r0, [r1] - movs r5, 0x2 -_080427BE: - ldrh r1, [r4] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - beq _080427EA - ldr r1, =gBattleMons - movs r0, 0x58 - muls r0, r6 - adds r1, r0, r1 - adds r2, r1, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0xB - beq _080427EA - adds r1, 0x22 - ldrb r0, [r1] - cmp r0, 0xB - beq _080427EA - movs r0, 0xB - strb r0, [r2] - strb r0, [r1] - movs r5, 0x3 -_080427EA: - ldrh r1, [r4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08042816 - ldr r1, =gBattleMons - movs r0, 0x58 - muls r0, r6 - adds r1, r0, r1 - adds r2, r1, 0 - adds r2, 0x21 - ldrb r0, [r2] - cmp r0, 0xF - beq _08042816 - adds r1, 0x22 - ldrb r0, [r1] - cmp r0, 0xF - beq _08042816 - movs r0, 0xF - strb r0, [r2] - strb r0, [r1] - movs r5, 0x4 -_08042816: - adds r0, r5, 0 -_08042818: - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end castform_switch - - thumb_func_start AbilityBattleEffects -AbilityBattleEffects: @ 8042828 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - ldr r4, [sp, 0x48] - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r6, r2, 24 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0 - mov r9, r0 - ldr r5, =gBankAttacker - ldr r1, =gNoOfAllBanks - ldrb r0, [r5] - ldrb r1, [r1] - cmp r0, r1 - bcc _08042864 - mov r1, r10 - strb r1, [r5] -_08042864: - ldrb r0, [r5] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _08042894 - ldr r1, =gBattlePartyID - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - b _080428A4 - .pool -_08042894: - ldr r1, =gBattlePartyID - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gEnemyParty -_080428A4: - adds r7, r1, r0 - ldr r5, =gBankTarget - ldr r1, =gNoOfAllBanks - ldrb r0, [r5] - ldrb r1, [r1] - cmp r0, r1 - bcc _080428B6 - mov r2, r10 - strb r2, [r5] -_080428B6: - ldrb r0, [r5] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _080428E8 - ldr r1, =gBattlePartyID - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gPlayerParty - b _080428F8 - .pool -_080428E8: - ldr r1, =gBattlePartyID - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r1, r0 - ldr r0, =gEnemyParty -_080428F8: - adds r5, r1, r0 - adds r0, r7, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0 - bl GetMonData - str r0, [sp, 0x10] - adds r0, r5, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0xC] - adds r0, r5, 0 - movs r1, 0 - bl GetMonData - str r0, [sp, 0x14] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0804293A - bl _0804443A -_0804293A: - mov r3, r8 - cmp r3, 0 - beq _08042958 - ldr r0, =gLastUsedAbility - strb r3, [r0] - adds r7, r0, 0 - b _0804296E - .pool -_08042958: - ldr r2, =gLastUsedAbility - ldr r1, =gBattleMons - movs r0, 0x58 - mov r5, r10 - muls r5, r0 - adds r0, r5, 0 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - strb r0, [r2] - adds r7, r2, 0 -_0804296E: - cmp r4, 0 - beq _08042980 - adds r5, r4, 0 - b _08042984 - .pool -_08042980: - ldr r0, =gCurrentMove - ldrh r5, [r0] -_08042984: - ldr r1, =gBattleStruct - ldr r0, [r1] - ldrb r0, [r0, 0x13] - mov r8, r1 - cmp r0, 0 - beq _080429A0 - movs r3, 0x3F - ands r3, r0 - b _080429AC - .pool -_080429A0: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r3, [r0, 0x2] -_080429AC: - ldr r0, [sp, 0x4] - cmp r0, 0x13 - bls _080429B6 - bl _0804441E -_080429B6: - lsls r0, 2 - ldr r1, =_080429C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080429C8: - .4byte _08042A18 - .4byte _08042CDC - .4byte _08042EF8 - .4byte _08042F8C - .4byte _080431AC - .4byte _08043908 - .4byte _08043C6C - .4byte _08043CBC - .4byte _08043D40 - .4byte _08043DC4 - .4byte _08043FE4 - .4byte _08043E08 - .4byte _08044028 - .4byte _08044084 - .4byte _080440E0 - .4byte _080441DC - .4byte _08044220 - .4byte _0804427C - .4byte _080443EC - .4byte _08044196 -_08042A18: - ldr r2, =gBankAttacker - ldr r0, =gNoOfAllBanks - ldrb r1, [r2] - adds r5, r0, 0 - ldrb r3, [r5] - cmp r1, r3 - bcc _08042A2A - mov r0, r10 - strb r0, [r2] -_08042A2A: - ldrb r0, [r7] - cmp r0, 0x2D - bne _08042A32 - b _08042BA8 -_08042A32: - cmp r0, 0x2D - bgt _08042A64 - cmp r0, 0xD - bne _08042A3C - b _08042CA4 -_08042A3C: - cmp r0, 0xD - bgt _08042A54 - cmp r0, 0x2 - bne _08042A46 - b _08042B78 -_08042A46: - bl _0804441E - .pool -_08042A54: - cmp r0, 0x16 - bne _08042A5A - b _08042C08 -_08042A5A: - cmp r0, 0x24 - bne _08042A60 - b _08042C68 -_08042A60: - bl _0804441E -_08042A64: - cmp r0, 0x46 - bne _08042A6A - b _08042BD8 -_08042A6A: - cmp r0, 0x46 - bgt _08042A78 - cmp r0, 0x3B - bne _08042A74 - b _08042C3C -_08042A74: - bl _0804441E -_08042A78: - cmp r0, 0x4D - bne _08042A7E - b _08042CA4 -_08042A7E: - cmp r0, 0xFF - beq _08042A86 - bl _0804441E -_08042A86: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - bne _08042B4C - bl weather_get_current - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x3 - cmp r0, 0xA - bhi _08042B4C - lsls r0, 2 - ldr r1, =_08042AB4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08042AB4: - .4byte _08042AE0 - .4byte _08042B4C - .4byte _08042AE0 - .4byte _08042B4C - .4byte _08042B4C - .4byte _08042B04 - .4byte _08042B4C - .4byte _08042B4C - .4byte _08042B4C - .4byte _08042B28 - .4byte _08042AE0 -_08042AE0: - ldr r2, =gBattleWeather - ldrh r1, [r2] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _08042B4C - movs r0, 0x5 - strh r0, [r2] - ldr r1, =gBattleScripting - movs r0, 0xA - strb r0, [r1, 0x10] - mov r2, r10 - strb r2, [r1, 0x17] - b _08042B42 - .pool -_08042B04: - ldr r3, =gBattleWeather - ldrh r1, [r3] - movs r2, 0x18 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _08042B4C - strh r2, [r3] - ldr r1, =gBattleScripting - movs r0, 0xC - strb r0, [r1, 0x10] - mov r3, r10 - strb r3, [r1, 0x17] - b _08042B42 - .pool -_08042B28: - ldr r3, =gBattleWeather - ldrh r1, [r3] - movs r2, 0x60 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _08042B4C - strh r2, [r3] - ldr r1, =gBattleScripting - movs r0, 0xB - strb r0, [r1, 0x10] - mov r5, r10 - strb r5, [r1, 0x17] -_08042B42: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_08042B4C: - mov r0, r9 - cmp r0, 0 - bne _08042B56 - bl _0804443A -_08042B56: - bl weather_get_current - ldr r1, =gBattleCommunication - strb r0, [r1, 0x5] - ldr r0, =gUnknown_082DACE7 - bl b_push_move_exec - bl _0804441E - .pool -_08042B78: - ldr r2, =gBattleWeather - ldrh r1, [r2] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _08042B88 - bl _0804441E -_08042B88: - movs r0, 0x5 - strh r0, [r2] - ldr r0, =gUnknown_082DB430 - bl b_push_move_exec - ldr r0, =gBattleScripting - mov r1, r10 - strb r1, [r0, 0x17] - bl _080443D0 - .pool -_08042BA8: - ldr r2, =gBattleWeather - ldrh r1, [r2] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08042BB8 - bl _0804441E -_08042BB8: - movs r0, 0x18 - strh r0, [r2] - ldr r0, =gUnknown_082DB470 - bl b_push_move_exec - ldr r0, =gBattleScripting - mov r2, r10 - strb r2, [r0, 0x17] - bl _080443D0 - .pool -_08042BD8: - ldr r2, =gBattleWeather - ldrh r1, [r2] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08042BE8 - bl _0804441E -_08042BE8: - movs r0, 0x60 - strh r0, [r2] - ldr r0, =gUnknown_082DB52A - bl b_push_move_exec - ldr r0, =gBattleScripting - mov r3, r10 - strb r3, [r0, 0x17] - bl _080443D0 - .pool -_08042C08: - ldr r0, =gSpecialStatuses - mov r5, r10 - lsls r2, r5, 2 - adds r1, r2, r5 - lsls r1, 2 - adds r3, r1, r0 - ldrb r0, [r3] - lsls r0, 28 - cmp r0, 0 - bge _08042C20 - bl _0804441E -_08042C20: - ldr r1, =gStatuses3 - adds r1, r2, r1 - ldr r0, [r1] - movs r2, 0x80 - lsls r2, 12 - orrs r0, r2 - str r0, [r1] - ldrb r0, [r3] - movs r1, 0x8 - b _08042C92 - .pool -_08042C3C: - mov r0, r10 - bl castform_switch - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - cmp r0, 0 - bne _08042C50 - bl _0804443A -_08042C50: - ldr r0, =gUnknown_082DB4A9 - bl b_push_move_exec - ldr r0, =gBattleScripting - mov r1, r10 - strb r1, [r0, 0x17] - bl _080442E2 - .pool -_08042C68: - ldr r0, =gSpecialStatuses - mov r3, r10 - lsls r2, r3, 2 - adds r1, r2, r3 - lsls r1, 2 - adds r3, r1, r0 - ldrb r0, [r3] - lsls r0, 27 - cmp r0, 0 - bge _08042C80 - bl _0804441E -_08042C80: - ldr r1, =gStatuses3 - adds r1, r2, r1 - ldr r0, [r1] - movs r2, 0x80 - lsls r2, 13 - orrs r0, r2 - str r0, [r1] - ldrb r0, [r3] - movs r1, 0x10 -_08042C92: - orrs r0, r1 - strb r0, [r3] - bl _0804441E - .pool -_08042CA4: - movs r6, 0 - ldrb r5, [r5] - cmp r6, r5 - bcc _08042CB0 - bl _0804441E -_08042CB0: - adds r0, r6, 0 - bl castform_switch - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - cmp r0, 0 - beq _08042CC4 - bl _080442D8 -_08042CC4: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r6, r0 - bcc _08042CB0 - bl _0804441E - .pool -_08042CDC: - ldr r5, =gBattleMons - mov r8, r5 - movs r0, 0x58 - mov r6, r10 - muls r6, r0 - adds r4, r6, r5 - ldrh r0, [r4, 0x28] - cmp r0, 0 - bne _08042CF2 - bl _0804441E -_08042CF2: - ldr r0, =gBankAttacker - mov r1, r10 - strb r1, [r0] - ldrb r5, [r7] - cmp r5, 0x2C - beq _08042D22 - cmp r5, 0x2C - bgt _08042D14 - cmp r5, 0x3 - bne _08042D08 - b _08042E84 -_08042D08: - bl _0804441E - .pool -_08042D14: - cmp r5, 0x36 - bne _08042D1A - b _08042ED0 -_08042D1A: - cmp r5, 0x3D - beq _08042DA0 - bl _0804441E -_08042D22: - movs r0, 0 - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0xD - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08042D3E - bl _0804441E -_08042D3E: - str r0, [sp] - movs r0, 0x13 - movs r1, 0 - movs r2, 0x4D - movs r3, 0 - bl AbilityBattleEffects - lsls r0, 24 - cmp r0, 0 - beq _08042D56 - bl _0804441E -_08042D56: - ldr r0, =gBattleWeather - ldrh r1, [r0] - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - bne _08042D66 - bl _0804441E -_08042D66: - ldrh r0, [r4, 0x2C] - ldrh r2, [r4, 0x28] - cmp r0, r2 - bhi _08042D72 - bl _0804441E -_08042D72: - strb r5, [r7] - ldr r0, =gUnknown_082DB45C - bl b_push_move_exec - ldr r1, =gBattleMoveDamage - ldrh r0, [r4, 0x2C] - lsrs r0, 4 - str r0, [r1] - cmp r0, 0 - bne _08042D8A - movs r0, 0x1 - str r0, [r1] -_08042D8A: - ldr r0, [r1] - negs r0, r0 - str r0, [r1] - bl _080443D0 - .pool -_08042DA0: - mov r0, r8 - adds r0, 0x4C - adds r5, r6, r0 - ldrb r0, [r5] - cmp r0, 0 - bne _08042DB0 - bl _0804441E -_08042DB0: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0 - beq _08042DCA - bl _0804441E -_08042DCA: - ldr r0, [r5] - movs r1, 0x88 - ands r0, r1 - cmp r0, 0 - beq _08042DDC - ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC70 - bl StringCopy -_08042DDC: - ldr r0, [r5] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08042DEE - ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC78 - bl StringCopy -_08042DEE: - ldr r0, [r5] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08042E00 - ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC80 - bl StringCopy -_08042E00: - ldr r0, [r5] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08042E12 - ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC88 - bl StringCopy -_08042E12: - ldr r0, [r5] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08042E24 - ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC90 - bl StringCopy -_08042E24: - str r4, [r5] - mov r1, r8 - adds r1, 0x50 - adds r1, r6, r1 - ldr r0, [r1] - ldr r2, =0xf7ffffff - ands r0, r2 - str r0, [r1] - ldr r0, =gBattleScripting - ldr r4, =gActiveBank - mov r3, r10 - strb r3, [r4] - strb r3, [r0, 0x17] - ldr r0, =gUnknown_082DB484 - bl b_push_move_exec - str r5, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl EmitSetAttributes - ldrb r0, [r4] - bl MarkBufferBankForExecution - bl _080443D0 - .pool -_08042E84: - ldrb r2, [r4, 0x1B] - movs r0, 0x1B - ldrsb r0, [r4, r0] - cmp r0, 0xB - ble _08042E92 - bl _0804441E -_08042E92: - ldr r0, =gDisableStructs - mov r5, r10 - lsls r1, r5, 3 - subs r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x16] - cmp r0, 0x2 - bne _08042EA8 - bl _0804441E -_08042EA8: - adds r0, r2, 0x1 - movs r1, 0 - strb r0, [r4, 0x1B] - ldr r4, =gBattleScripting - movs r0, 0x11 - strb r0, [r4, 0x10] - strb r1, [r4, 0x11] - ldr r0, =gUnknown_082DB444 - bl b_push_move_exec - strb r5, [r4, 0x17] - bl _080443D0 - .pool -_08042ED0: - ldr r2, =gDisableStructs - ldrb r0, [r0] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r3, [r1, 0x18] - lsls r0, r3, 31 - lsrs r0, 31 - movs r2, 0x1 - eors r2, r0 - movs r0, 0x2 - negs r0, r0 - ands r0, r3 - orrs r0, r2 - strb r0, [r1, 0x18] - bl _0804441E - .pool -_08042EF8: - ldrb r0, [r7] - cmp r0, 0x2B - beq _08042F02 - bl _0804441E -_08042F02: - movs r4, 0 - ldr r0, =gUnknown_0831BCF8 - ldrh r2, [r0] - ldr r3, =0x0000ffff - adds r1, r0, 0 - cmp r2, r3 - bne _08042F14 - bl _0804441E -_08042F14: - cmp r2, r5 - beq _08042F2C - adds r2, r1, 0 -_08042F1A: - adds r2, 0x2 - adds r4, 0x1 - ldrh r0, [r2] - cmp r0, r3 - bne _08042F28 - bl _0804441E -_08042F28: - cmp r0, r5 - bne _08042F1A -_08042F2C: - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08042F3C - bl _0804441E -_08042F3C: - ldr r1, =gBattleMons - ldr r0, =gBankAttacker - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 5 - ands r0, r1 - cmp r0, 0 - beq _08042F62 - ldr r0, =gHitMarker - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 4 - orrs r1, r2 - str r1, [r0] -_08042F62: - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB61F - str r0, [r1] - movs r0, 0x1 - mov r9, r0 - bl _08044424 - .pool -_08042F8C: - cmp r5, 0 - bne _08042F94 - bl _0804441E -_08042F94: - ldrb r0, [r7] - cmp r0, 0xB - beq _08043004 - cmp r0, 0xB - bgt _08042FA4 - cmp r0, 0xA - beq _08042FAA - b _08043126 -_08042FA4: - cmp r0, 0x12 - beq _0804305C - b _08043126 -_08042FAA: - cmp r3, 0xD - beq _08042FB0 - b _08043126 -_08042FB0: - ldr r0, =gBattleMoves - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _08042FC2 - b _08043126 -_08042FC2: - ldr r1, =gProtectStructs - ldr r0, =gBankAttacker - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsls r0, 28 - cmp r0, 0 - bge _08042FF0 - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB56F - b _08042FF4 - .pool -_08042FF0: - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB56E -_08042FF4: - str r0, [r1] - movs r1, 0x1 - b _08043124 - .pool -_08043004: - cmp r3, 0xB - beq _0804300A - b _08043126 -_0804300A: - ldr r0, =gBattleMoves - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _0804301C - b _08043126 -_0804301C: - ldr r1, =gProtectStructs - ldr r0, =gBankAttacker - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsls r0, 28 - cmp r0, 0 - bge _08043048 - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB56F - b _0804304C - .pool -_08043048: - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB56E -_0804304C: - str r0, [r1] - movs r2, 0x1 - mov r9, r2 - b _08043126 - .pool -_0804305C: - cmp r3, 0xA - bne _08043126 - ldr r1, =gBattleMons - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - bne _08043126 - ldr r2, =gBattleResources - ldr r0, [r2] - ldr r0, [r0, 0x4] - mov r5, r10 - lsls r1, r5, 2 - adds r0, r1 - ldr r3, [r0] - movs r4, 0x1 - ands r3, r4 - adds r5, r1, 0 - cmp r3, 0 - bne _080430EC - ldr r0, =gBattleCommunication - strb r3, [r0, 0x5] - ldr r1, =gProtectStructs - ldr r0, =gBankAttacker - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsls r0, 28 - cmp r0, 0 - bge _080430C8 - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB5A8 - b _080430CC - .pool -_080430C8: - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB5A7 -_080430CC: - str r0, [r1] - ldr r0, [r2] - ldr r1, [r0, 0x4] - adds r1, r5 - ldr r0, [r1] - movs r2, 0x1 - orrs r0, r2 - str r0, [r1] - movs r0, 0x2 - mov r9, r0 - b _08043126 - .pool -_080430EC: - ldr r0, =gBattleCommunication - strb r4, [r0, 0x5] - ldr r1, =gProtectStructs - ldr r0, =gBankAttacker - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsls r0, 28 - cmp r0, 0 - bge _0804311C - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB5A8 - b _08043120 - .pool -_0804311C: - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB5A7 -_08043120: - str r0, [r1] - movs r1, 0x2 -_08043124: - mov r9, r1 -_08043126: - mov r2, r9 - cmp r2, 0x1 - beq _08043130 - bl _0804441E -_08043130: - ldr r1, =gBattleMons - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - adds r1, r0, r1 - ldrh r0, [r1, 0x2C] - ldrh r5, [r1, 0x28] - cmp r0, r5 - bne _0804318C - ldr r1, =gProtectStructs - ldr r0, =gBankAttacker - ldrb r0, [r0] - lsls r0, 4 - adds r0, r1 - ldrb r0, [r0, 0x2] - lsls r0, 28 - cmp r0, 0 - bge _08043178 - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB592 - str r0, [r1] - bl _0804441E - .pool -_08043178: - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB591 - str r0, [r1] - bl _0804441E - .pool -_0804318C: - ldr r2, =gBattleMoveDamage - ldrh r0, [r1, 0x2C] - lsrs r0, 2 - str r0, [r2] - cmp r0, 0 - bne _0804319C - mov r0, r9 - str r0, [r2] -_0804319C: - ldr r0, [r2] - negs r0, r0 - str r0, [r2] - bl _0804441E - .pool -_080431AC: - ldrb r0, [r7] - subs r0, 0x9 - cmp r0, 0x2F - bls _080431B8 - bl _0804441E -_080431B8: - lsls r0, 2 - ldr r1, =_080431C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080431C8: - .4byte _080435E4 - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _08043288 - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _08043350 - .4byte _0804441E - .4byte _0804441E - .4byte _08043410 - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _08043508 - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _080436C0 - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804441E - .4byte _0804379C -_08043288: - ldr r0, =gBattleMoveFlags - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08043298 - bl _0804441E -_08043298: - cmp r5, 0xA5 - bne _080432A0 - bl _0804441E -_080432A0: - ldr r0, =gBattleMoves - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrb r0, [r1, 0x1] - cmp r0, 0 - bne _080432B4 - bl _0804441E -_080432B4: - ldr r2, =gSpecialStatuses - ldr r0, =gBankTarget - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _080432DC - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _080432DC - bl _0804441E -_080432DC: - ldr r1, =gBattleMons - movs r0, 0x58 - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - adds r1, r0, r1 - adds r4, r1, 0 - adds r4, 0x21 - ldrb r0, [r4] - cmp r0, r3 - bne _080432F6 - bl _0804441E -_080432F6: - adds r2, r1, 0 - adds r2, 0x22 - ldrb r0, [r2] - cmp r0, r3 - bne _08043304 - bl _0804441E -_08043304: - ldrh r0, [r1, 0x28] - cmp r0, 0 - bne _0804330E - bl _0804441E -_0804330E: - strb r3, [r4] - strb r3, [r2] - ldr r1, =gBattleTextBuff1 - movs r0, 0xFD - strb r0, [r1] - movs r0, 0x3 - strb r0, [r1, 0x1] - strb r3, [r1, 0x2] - movs r0, 0xFF - strb r0, [r1, 0x3] - bl b_movescr_stack_push_cursor - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB64D - str r0, [r1] - bl _080443D0 - .pool -_08043350: - ldr r0, =gBattleMoveFlags - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08043360 - bl _0804441E -_08043360: - ldr r1, =gBattleMons - ldr r0, =gBankAttacker - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r3, r0, r1 - ldrh r0, [r3, 0x28] - cmp r0, 0 - bne _08043376 - bl _0804441E -_08043376: - ldr r0, =gProtectStructs - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 31 - cmp r0, 0 - beq _08043388 - bl _0804441E -_08043388: - ldr r2, =gSpecialStatuses - ldr r0, =gBankTarget - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _080433B0 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _080433B0 - bl _0804441E -_080433B0: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r2, 0x1 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _080433CA - bl _0804441E -_080433CA: - ldr r1, =gBattleMoveDamage - ldrh r0, [r3, 0x2C] - lsrs r0, 4 - str r0, [r1] - cmp r0, 0 - bne _080433D8 - str r2, [r1] -_080433D8: - bl b_movescr_stack_push_cursor - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB654 - str r0, [r1] - bl _080443D0 - .pool -_08043410: - ldr r0, =gBattleMoveFlags - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08043420 - bl _0804441E -_08043420: - ldr r1, =gBattleMons - ldr r0, =gBankAttacker - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08043436 - bl _0804441E -_08043436: - ldr r0, =gProtectStructs - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 31 - cmp r0, 0 - beq _08043448 - bl _0804441E -_08043448: - ldr r2, =gSpecialStatuses - ldr r0, =gBankTarget - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043470 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043470 - bl _0804441E -_08043470: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08043488 - bl _0804441E -_08043488: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _080434A0 - bl _0804441E -_080434A0: - ldr r5, =gBattleCommunication - movs r4, 0x3 -_080434A4: - bl Random - ands r0, r4 - strb r0, [r5, 0x3] - cmp r0, 0 - beq _080434A4 - ldr r1, =gBattleCommunication - ldrb r0, [r1, 0x3] - cmp r0, 0x3 - bne _080434BC - adds r0, 0x2 - strb r0, [r1, 0x3] -_080434BC: - ldrb r0, [r1, 0x3] - adds r0, 0x40 - strb r0, [r1, 0x3] - bl b_movescr_stack_push_cursor - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB67C - str r0, [r1] - ldr r2, =gHitMarker - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 6 - orrs r0, r1 - str r0, [r2] - bl _080443D0 - .pool -_08043508: - ldr r0, =gBattleMoveFlags - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _08043518 - bl _0804441E -_08043518: - ldr r1, =gBattleMons - ldr r0, =gBankAttacker - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _0804352E - bl _0804441E -_0804352E: - ldr r0, =gProtectStructs - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 31 - cmp r0, 0 - beq _08043540 - bl _0804441E -_08043540: - ldr r2, =gSpecialStatuses - ldr r0, =gBankTarget - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043568 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043568 - bl _0804441E -_08043568: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08043580 - bl _0804441E -_08043580: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _08043598 - bl _0804441E -_08043598: - ldr r1, =gBattleCommunication - movs r0, 0x42 - strb r0, [r1, 0x3] - bl b_movescr_stack_push_cursor - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB67C - str r0, [r1] - ldr r2, =gHitMarker - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 6 - orrs r0, r1 - str r0, [r2] - bl _080443D0 - .pool -_080435E4: - ldr r0, =gBattleMoveFlags - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _080435F4 - bl _0804441E -_080435F4: - ldr r1, =gBattleMons - ldr r0, =gBankAttacker - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _0804360A - bl _0804441E -_0804360A: - ldr r0, =gProtectStructs - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 31 - cmp r0, 0 - beq _0804361C - bl _0804441E -_0804361C: - ldr r2, =gSpecialStatuses - ldr r0, =gBankTarget - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043644 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043644 - bl _0804441E -_08043644: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0804365C - bl _0804441E -_0804365C: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _08043674 - bl _0804441E -_08043674: - ldr r1, =gBattleCommunication - movs r0, 0x45 - strb r0, [r1, 0x3] - bl b_movescr_stack_push_cursor - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB67C - str r0, [r1] - ldr r2, =gHitMarker - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 6 - orrs r0, r1 - str r0, [r2] - bl _080443D0 - .pool -_080436C0: - ldr r0, =gBattleMoveFlags - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _080436D0 - bl _0804441E -_080436D0: - ldr r1, =gBattleMons - ldr r0, =gBankAttacker - ldrb r2, [r0] - movs r0, 0x58 - muls r0, r2 - adds r0, r1 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _080436E6 - bl _0804441E -_080436E6: - ldr r0, =gProtectStructs - lsls r1, r2, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 31 - cmp r0, 0 - beq _080436F8 - bl _0804441E -_080436F8: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08043710 - bl _0804441E -_08043710: - ldr r2, =gSpecialStatuses - ldr r0, =gBankTarget - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r1, r0, 2 - adds r0, r2, 0 - adds r0, 0x8 - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043738 - adds r0, r2, 0 - adds r0, 0xC - adds r0, r1, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043738 - bl _0804441E -_08043738: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _08043750 - bl _0804441E -_08043750: - ldr r1, =gBattleCommunication - movs r0, 0x43 - strb r0, [r1, 0x3] - bl b_movescr_stack_push_cursor - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB67C - str r0, [r1] - ldr r2, =gHitMarker - ldr r0, [r2] - movs r1, 0x80 - lsls r1, 6 - orrs r0, r1 - str r0, [r2] - bl _080443D0 - .pool -_0804379C: - ldr r0, =gBattleMoveFlags - ldrb r1, [r0] - movs r0, 0x29 - ands r0, r1 - cmp r0, 0 - beq _080437AC - bl _0804441E -_080437AC: - ldr r6, =gBattleMons - ldr r3, =gBankAttacker - mov r8, r3 - ldrb r1, [r3] - movs r7, 0x58 - adds r0, r1, 0 - muls r0, r7 - adds r0, r6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _080437C6 - bl _0804441E -_080437C6: - ldr r0, =gProtectStructs - lsls r1, 4 - adds r1, r0 - ldrb r0, [r1, 0x1] - lsls r0, 31 - cmp r0, 0 - beq _080437D8 - bl _0804441E -_080437D8: - ldr r1, =gBattleMoves - lsls r0, r5, 1 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080437F0 - bl _0804441E -_080437F0: - ldr r3, =gSpecialStatuses - ldr r5, =gBankTarget - ldrb r1, [r5] - lsls r0, r1, 2 - adds r0, r1 - lsls r2, r0, 2 - adds r0, r3, 0 - adds r0, 0x8 - adds r0, r2, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043818 - adds r0, r3, 0 - adds r0, 0xC - adds r0, r2, r0 - ldr r0, [r0] - cmp r0, 0 - bne _08043818 - bl _0804441E -_08043818: - adds r0, r1, 0 - muls r0, r7 - adds r0, r6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - bne _08043828 - bl _0804441E -_08043828: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - beq _08043840 - bl _0804441E -_08043840: - mov r1, r8 - ldrb r0, [r1] - muls r0, r7 - adds r0, r6 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0xC - bne _08043854 - bl _0804441E -_08043854: - ldr r0, [sp, 0x8] - ldr r1, [sp, 0x10] - bl GetGenderFromSpeciesAndPersonality - adds r4, r0, 0 - ldr r0, [sp, 0xC] - ldr r1, [sp, 0x14] - bl GetGenderFromSpeciesAndPersonality - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _08043872 - bl _0804441E -_08043872: - mov r2, r8 - ldrb r0, [r2] - muls r0, r7 - adds r4, r6, 0 - adds r4, 0x50 - adds r0, r4 - ldr r0, [r0] - movs r1, 0xF0 - lsls r1, 12 - ands r0, r1 - cmp r0, 0 - beq _0804388E - bl _0804441E -_0804388E: - ldr r0, [sp, 0x8] - ldr r1, [sp, 0x10] - bl GetGenderFromSpeciesAndPersonality - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080438A2 - bl _0804441E -_080438A2: - ldr r0, [sp, 0xC] - ldr r1, [sp, 0x14] - bl GetGenderFromSpeciesAndPersonality - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _080438B6 - bl _0804441E -_080438B6: - mov r3, r8 - ldrb r0, [r3] - adds r2, r0, 0 - muls r2, r7 - adds r2, r4 - ldr r1, =gBitTable - ldrb r0, [r5] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - lsls r1, 16 - ldr r0, [r2] - orrs r0, r1 - str r0, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB66F - str r0, [r1] - bl _080443D0 - .pool -_08043908: - movs r5, 0 - mov r10, r5 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r10, r0 - bcc _08043918 - bl _0804441E -_08043918: - ldr r1, =gBattleMons - movs r0, 0x58 - mov r2, r10 - muls r2, r0 - adds r0, r2, 0 - adds r0, r1 - adds r0, 0x20 - ldrb r0, [r0] - subs r0, 0x7 - adds r2, r1, 0 - cmp r0, 0x41 - bls _08043932 - b _08043B96 -_08043932: - lsls r0, 2 - ldr r1, =_08043948 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08043948: - .4byte _08043AAC - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B70 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043AD4 - .4byte _08043B96 - .4byte _08043A50 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043A7C - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B40 - .4byte _08043B10 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043B96 - .4byte _08043AD4 -_08043A50: - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - adds r1, r2, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - ldr r1, =0x00000f88 - ands r0, r1 - cmp r0, 0 - bne _08043A6A - b _08043B96 -_08043A6A: - ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC70 - b _08043B5C - .pool -_08043A7C: - movs r0, 0x58 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - adds r1, r2, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _08043A96 - b _08043B96 -_08043A96: - ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC98 - bl StringCopy - movs r2, 0x2 - mov r9, r2 - b _08043B9C - .pool -_08043AAC: - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - adds r1, r2, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08043B96 - ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC80 - b _08043B5C - .pool -_08043AD4: - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r3, r0 - ldr r0, [r0] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08043B96 - adds r2, 0x50 - adds r2, r3, r2 - ldr r0, [r2] - ldr r1, =0xf7ffffff - ands r0, r1 - str r0, [r2] - ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC78 - bl StringCopy - movs r0, 0x1 - mov r9, r0 - b _08043B9C - .pool -_08043B10: - movs r0, 0x58 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - adds r1, r2, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08043B96 - ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC88 - bl StringCopy - movs r2, 0x1 - mov r9, r2 - b _08043B9C - .pool -_08043B40: - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - adds r1, r2, 0 - adds r1, 0x4C - adds r0, r1 - ldr r0, [r0] - movs r1, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08043B96 - ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC90 -_08043B5C: - bl StringCopy - movs r5, 0x1 - mov r9, r5 - b _08043B9C - .pool -_08043B70: - movs r0, 0x58 - mov r1, r10 - muls r1, r0 - adds r0, r1, 0 - adds r1, r2, 0 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0xF0 - lsls r1, 12 - ands r0, r1 - cmp r0, 0 - beq _08043B96 - ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BCA0 - bl StringCopy - movs r2, 0x3 - mov r9, r2 -_08043B96: - mov r3, r9 - cmp r3, 0 - beq _08043C50 -_08043B9C: - mov r5, r9 - cmp r5, 0x2 - beq _08043BD0 - cmp r5, 0x2 - bgt _08043BB4 - cmp r5, 0x1 - beq _08043BBC - b _08043BFC - .pool -_08043BB4: - mov r0, r9 - cmp r0, 0x3 - beq _08043BE8 - b _08043BFC -_08043BBC: - ldr r1, =gBattleMons - movs r0, 0x58 - mov r2, r10 - muls r2, r0 - adds r1, 0x4C - adds r2, r1 - movs r0, 0 - b _08043BFA - .pool -_08043BD0: - ldr r1, =gBattleMons - movs r0, 0x58 - mov r2, r10 - muls r2, r0 - adds r1, 0x50 - adds r2, r1 - ldr r0, [r2] - movs r1, 0x8 - negs r1, r1 - b _08043BF8 - .pool -_08043BE8: - ldr r1, =gBattleMons - movs r0, 0x58 - mov r2, r10 - muls r2, r0 - adds r1, 0x50 - adds r2, r1 - ldr r0, [r2] - ldr r1, =0xfff0ffff -_08043BF8: - ands r0, r1 -_08043BFA: - str r0, [r2] -_08043BFC: - bl b_movescr_stack_push_cursor - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB68C - str r0, [r1] - ldr r0, =gBattleScripting - mov r1, r10 - strb r1, [r0, 0x17] - ldr r4, =gActiveBank - strb r1, [r4] - ldrb r1, [r4] - movs r0, 0x58 - muls r0, r1 - ldr r1, =gBattleMons + 0x4C - adds r0, r1 - str r0, [sp] - movs r0, 0 - movs r1, 0x28 - movs r2, 0 - movs r3, 0x4 - bl EmitSetAttributes - ldrb r0, [r4] - bl MarkBufferBankForExecution - bl _0804443A - .pool -_08043C50: - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r10, r0 - bcs _08043C64 - b _08043918 -_08043C64: - bl _0804441E - .pool -_08043C6C: - movs r2, 0 - mov r10, r2 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r10, r0 - bcc _08043C7A - b _0804441E -_08043C7A: - ldr r4, =gBattleMons -_08043C7C: - movs r0, 0x58 - mov r3, r10 - muls r3, r0 - adds r0, r3, 0 - adds r0, r4 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0x3B - bne _08043CA0 - mov r0, r10 - bl castform_switch - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - cmp r0, 0 - beq _08043CA0 - b _080442FC -_08043CA0: - mov r0, r10 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r10, r0 - bcc _08043C7C - b _0804441E - .pool -_08043CBC: - ldrb r0, [r7] - cmp r0, 0x1C - beq _08043CC4 - b _0804441E -_08043CC4: - ldr r4, =gHitMarker - ldr r1, [r4] - movs r0, 0x80 - lsls r0, 7 - ands r0, r1 - cmp r0, 0 - bne _08043CD4 - b _0804441E -_08043CD4: - ldr r0, =0xffffbfff - ands r1, r0 - str r1, [r4] - mov r5, r8 - ldr r1, [r5] - adds r1, 0xB2 - ldrb r2, [r1] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1] - ldr r0, [r5] - adds r1, r0, 0 - adds r1, 0xB2 - ldrb r0, [r1] - cmp r0, 0x6 - bne _08043CF8 - movs r0, 0x2 - strb r0, [r1] -_08043CF8: - ldr r1, =gBattleCommunication - mov r2, r8 - ldr r0, [r2] - adds r0, 0xB2 - ldrb r0, [r0] - adds r0, 0x40 - strb r0, [r1, 0x3] - ldr r1, =gBattleScripting - ldr r0, =gBankTarget - ldrb r0, [r0] - strb r0, [r1, 0x17] - bl b_movescr_stack_push_cursor - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB67F - str r0, [r1] - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 6 - orrs r0, r1 - str r0, [r4] - b _080443D0 - .pool -_08043D40: - ldrb r0, [r7] - cmp r0, 0x1C - beq _08043D48 - b _0804441E -_08043D48: - ldr r4, =gHitMarker - ldr r1, [r4] - movs r0, 0x80 - lsls r0, 7 - ands r0, r1 - cmp r0, 0 - bne _08043D58 - b _0804441E -_08043D58: - ldr r0, =0xffffbfff - ands r1, r0 - str r1, [r4] - mov r3, r8 - ldr r1, [r3] - adds r1, 0xB2 - ldrb r2, [r1] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1] - ldr r0, [r3] - adds r1, r0, 0 - adds r1, 0xB2 - ldrb r0, [r1] - cmp r0, 0x6 - bne _08043D7C - movs r0, 0x2 - strb r0, [r1] -_08043D7C: - ldr r1, =gBattleCommunication - mov r3, r8 - ldr r0, [r3] - adds r0, 0xB2 - ldrb r0, [r0] - strb r0, [r1, 0x3] - ldr r1, =gBattleScripting - ldr r0, =gBankAttacker - ldrb r0, [r0] - strb r0, [r1, 0x17] - bl b_movescr_stack_push_cursor - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB67F - str r0, [r1] - ldr r0, [r4] - movs r1, 0x80 - lsls r1, 6 - orrs r0, r1 - str r0, [r4] - b _080443D0 - .pool -_08043DC4: - movs r4, 0 - ldr r0, =gNoOfAllBanks - ldrb r1, [r0] - cmp r4, r1 - blt _08043DD0 - b _0804441E -_08043DD0: - ldr r0, =gBattleMons - adds r5, r1, 0 - ldr r2, =gStatuses3 - adds r3, r0, 0 - adds r3, 0x20 - movs r6, 0x80 - lsls r6, 12 -_08043DDE: - ldrb r1, [r3] - cmp r1, 0x16 - bne _08043DEE - ldr r0, [r2] - ands r0, r6 - cmp r0, 0 - beq _08043DEE - b _08044324 -_08043DEE: - adds r2, 0x4 - adds r3, 0x58 - adds r4, 0x1 - cmp r4, r5 - blt _08043DDE - b _0804441E - .pool -_08043E08: - movs r4, 0 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - blt _08043E14 - b _0804441E -_08043E14: - ldr r5, =gActiveBank - mov r8, r5 - ldr r0, =gBattleMons - adds r0, 0x20 - str r0, [sp, 0x1C] - movs r1, 0 - str r1, [sp, 0x20] -_08043E22: - ldr r2, [sp, 0x1C] - ldrb r0, [r2] - cmp r0, 0x24 - beq _08043E2C - b _08043FBE -_08043E2C: - ldr r0, =gStatuses3 - ldr r3, [sp, 0x20] - adds r0, r3, r0 - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 13 - ands r1, r0 - str r3, [sp, 0x18] - cmp r1, 0 - bne _08043E42 - b _08043FBE -_08043E42: - lsls r0, r4, 24 - lsrs r0, 24 - bl GetBankIdentity - movs r1, 0x1 - adds r5, r0, 0 - eors r5, r1 - ands r5, r1 - adds r0, r5, 0 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r5, 0x2 - bl GetBankByPlayerAI - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r2, 0x1 - ands r0, r2 - cmp r0, 0 - bne _08043E74 - b _08043F84 -_08043E74: - movs r1, 0x58 - adds r0, r6, 0 - muls r0, r1 - ldr r3, =gBattleMons - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0 - beq _08043F40 - ldrh r0, [r1, 0x28] - cmp r0, 0 - beq _08043EFC - movs r1, 0x58 - adds r0, r7, 0 - muls r0, r1 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0 - beq _08043EFC - ldrh r0, [r1, 0x28] - cmp r0, 0 - beq _08043EFC - str r2, [sp, 0x24] - bl Random - ldr r2, [sp, 0x24] - adds r1, r2, 0 - ands r1, r0 - lsls r1, 1 - orrs r5, r1 - adds r0, r5, 0 - bl GetBankByPlayerAI - mov r2, r8 - strb r0, [r2] - ldrb r0, [r2] - movs r3, 0x58 - muls r0, r3 - ldr r5, =gBattleMons - adds r0, r5 - adds r0, 0x20 - ldrb r0, [r0] - ldr r1, [sp, 0x1C] - strb r0, [r1] - ldrb r0, [r2] - muls r0, r3 - adds r0, r5 - adds r0, 0x20 - ldrb r0, [r0] - ldr r2, =gLastUsedAbility - strb r0, [r2] - b _08043FAC - .pool -_08043EFC: - ldr r3, =gBattleMons - movs r2, 0x58 - adds r0, r6, 0 - muls r0, r2 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0 - beq _08043F40 - ldrh r0, [r1, 0x28] - cmp r0, 0 - beq _08043F40 - mov r5, r8 - strb r6, [r5] - adds r1, r4, 0 - muls r1, r2 - adds r1, r3 - ldrb r0, [r5] - muls r0, r2 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - adds r1, 0x20 - strb r0, [r1] - ldrb r0, [r5] - muls r0, r2 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - b _08043FA8 - .pool -_08043F40: - ldr r3, =gBattleMons - movs r2, 0x58 - adds r0, r7, 0 - muls r0, r2 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, 0 - beq _08043FB6 - ldrh r0, [r1, 0x28] - cmp r0, 0 - beq _08043FB6 - mov r5, r8 - strb r7, [r5] - adds r1, r4, 0 - muls r1, r2 - adds r1, r3 - ldrb r0, [r5] - muls r0, r2 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - adds r1, 0x20 - strb r0, [r1] - ldrb r0, [r5] - muls r0, r2 - adds r0, r3 - adds r0, 0x20 - ldrb r0, [r0] - b _08043FA8 - .pool -_08043F84: - mov r2, r8 - strb r6, [r2] - movs r3, 0x58 - adds r0, r6, 0 - muls r0, r3 - ldr r5, =gBattleMons - adds r0, r5 - adds r2, r0, 0 - adds r2, 0x20 - ldrb r1, [r2] - cmp r1, 0 - beq _08043FB6 - ldrh r0, [r0, 0x28] - cmp r0, 0 - beq _08043FB6 - ldr r0, [sp, 0x1C] - strb r1, [r0] - ldrb r0, [r2] -_08043FA8: - ldr r1, =gLastUsedAbility - strb r0, [r1] -_08043FAC: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_08043FB6: - mov r2, r9 - cmp r2, 0 - beq _08043FBE - b _08044340 -_08043FBE: - ldr r3, [sp, 0x1C] - adds r3, 0x58 - str r3, [sp, 0x1C] - ldr r5, [sp, 0x20] - adds r5, 0x4 - str r5, [sp, 0x20] - adds r4, 0x1 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - bge _08043FD6 - b _08043E22 -_08043FD6: - b _0804441E - .pool -_08043FE4: - movs r4, 0 - ldr r0, =gNoOfAllBanks - ldrb r1, [r0] - cmp r4, r1 - blt _08043FF0 - b _0804441E -_08043FF0: - ldr r0, =gBattleMons - adds r5, r1, 0 - ldr r2, =gStatuses3 - adds r3, r0, 0 - adds r3, 0x20 - movs r6, 0x80 - lsls r6, 12 -_08043FFE: - ldrb r1, [r3] - cmp r1, 0x16 - bne _0804400E - ldr r0, [r2] - ands r0, r6 - cmp r0, 0 - beq _0804400E - b _080443B4 -_0804400E: - adds r2, 0x4 - adds r3, 0x58 - adds r4, 0x1 - cmp r4, r5 - blt _08043FFE - b _0804441E - .pool -_08044028: - mov r0, r10 - bl GetBankSide - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - blt _0804403E - b _0804441E -_0804403E: - ldr r7, =gBattleMons -_08044040: - lsls r0, r4, 24 - lsrs r0, 24 - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - adds r3, r4, 0x1 - cmp r0, r5 - beq _0804406A - movs r0, 0x58 - muls r0, r4 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, r6 - bne _0804406A - ldr r0, =gLastUsedAbility - strb r6, [r0] - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_0804406A: - adds r4, r3, 0 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - blt _08044040 - b _0804441E - .pool -_08044084: - mov r0, r10 - bl GetBankSide - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - blt _0804409A - b _0804441E -_0804409A: - ldr r7, =gBattleMons -_0804409C: - lsls r0, r4, 24 - lsrs r0, 24 - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - adds r3, r4, 0x1 - cmp r0, r5 - bne _080440C6 - movs r0, 0x58 - muls r0, r4 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, r6 - bne _080440C6 - ldr r0, =gLastUsedAbility - strb r6, [r0] - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_080440C6: - adds r4, r3, 0 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - blt _0804409C - b _0804441E - .pool -_080440E0: - ldrb r0, [r7] - cmp r0, 0xFD - beq _08044104 - cmp r0, 0xFE - beq _0804413C - movs r4, 0 - ldr r0, =gNoOfAllBanks - adds r5, r0, 0 - ldrb r0, [r5] - cmp r4, r0 - blt _080440F8 - b _0804441E -_080440F8: - ldr r2, =gBattleMons - b _08044174 - .pool -_08044104: - movs r4, 0 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - blt _08044110 - b _0804441E -_08044110: - ldr r5, =gStatuses3 - movs r2, 0x80 - lsls r2, 9 - adds r1, r0, 0 -_08044118: - lsls r0, r4, 2 - adds r0, r5 - ldr r0, [r0] - ands r0, r2 - adds r3, r4, 0x1 - cmp r0, 0 - beq _0804412C - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_0804412C: - adds r4, r3, 0 - cmp r4, r1 - blt _08044118 - b _0804441E - .pool -_0804413C: - movs r4, 0 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - blt _08044148 - b _0804441E -_08044148: - ldr r5, =gStatuses3 - movs r2, 0x80 - lsls r2, 10 - adds r1, r0, 0 -_08044150: - lsls r0, r4, 2 - adds r0, r5 - ldr r0, [r0] - ands r0, r2 - adds r3, r4, 0x1 - cmp r0, 0 - beq _08044164 - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_08044164: - adds r4, r3, 0 - cmp r4, r1 - blt _08044150 - b _0804441E - .pool -_08044174: - movs r0, 0x58 - muls r0, r4 - adds r0, r2 - adds r0, 0x20 - ldrb r0, [r0] - adds r3, r4, 0x1 - cmp r0, r6 - bne _0804418C - strb r6, [r7] - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_0804418C: - adds r4, r3, 0 - ldrb r1, [r5] - cmp r4, r1 - blt _08044174 - b _0804441E -_08044196: - movs r4, 0 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - blt _080441A2 - b _0804441E -_080441A2: - ldr r2, =gBattleMons - mov r8, r2 - adds r2, r0, 0 - movs r5, 0x58 -_080441AA: - adds r0, r4, 0 - muls r0, r5 - mov r3, r8 - adds r1, r0, r3 - adds r0, r1, 0 - adds r0, 0x20 - ldrb r0, [r0] - adds r3, r4, 0x1 - cmp r0, r6 - bne _080441CC - ldrh r0, [r1, 0x28] - cmp r0, 0 - beq _080441CC - strb r6, [r7] - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_080441CC: - adds r4, r3, 0 - cmp r4, r2 - blt _080441AA - b _0804441E - .pool -_080441DC: - movs r4, 0 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - blt _080441E8 - b _0804441E -_080441E8: - ldr r7, =gBattleMons - adds r1, r0, 0 - movs r5, 0x58 - ldr r2, =gLastUsedAbility -_080441F0: - adds r0, r4, 0 - muls r0, r5 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - adds r3, r4, 0x1 - cmp r0, r6 - bne _0804420C - cmp r4, r10 - beq _0804420C - strb r6, [r2] - lsls r0, r3, 24 - lsrs r0, 24 - mov r9, r0 -_0804420C: - adds r4, r3, 0 - cmp r4, r1 - blt _080441F0 - b _0804441E - .pool -_08044220: - mov r0, r10 - bl GetBankSide - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - blt _08044236 - b _0804441E -_08044236: - ldr r7, =gBattleMons -_08044238: - lsls r0, r4, 24 - lsrs r0, 24 - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - beq _08044264 - movs r0, 0x58 - muls r0, r4 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, r6 - bne _08044264 - ldr r0, =gLastUsedAbility - strb r6, [r0] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_08044264: - adds r4, 0x1 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - blt _08044238 - b _0804441E - .pool -_0804427C: - mov r0, r10 - bl GetBankSide - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - blt _08044292 - b _0804441E -_08044292: - ldr r7, =gBattleMons -_08044294: - lsls r0, r4, 24 - lsrs r0, 24 - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, r5 - bne _080442C0 - movs r0, 0x58 - muls r0, r4 - adds r0, r7 - adds r0, 0x20 - ldrb r0, [r0] - cmp r0, r6 - bne _080442C0 - ldr r0, =gLastUsedAbility - strb r6, [r0] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_080442C0: - adds r4, 0x1 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r4, r0 - blt _08044294 - b _0804441E - .pool -_080442D8: - ldr r0, =gUnknown_082DB4A9 - bl b_push_move_exec - ldr r0, =gBattleScripting - strb r6, [r0, 0x17] -_080442E2: - ldr r0, =gBattleStruct - ldr r0, [r0] - adds r0, 0x7F - mov r1, r9 - subs r1, 0x1 - strb r1, [r0] - b _0804441E - .pool -_080442FC: - ldr r0, =gUnknown_082DB4A9 - bl b_push_move_exec - ldr r0, =gBattleScripting - mov r5, r10 - strb r5, [r0, 0x17] - ldr r0, =gBattleStruct - ldr r0, [r0] - adds r0, 0x7F - mov r1, r9 - subs r1, 0x1 - strb r1, [r0] - b _0804443A - .pool -_08044324: - strb r1, [r7] - ldr r0, [r2] - ldr r1, =0xfff7ffff - ands r0, r1 - str r0, [r2] - ldr r0, =gUnknown_082DB4B8 - bl b_push_move_exec - b _080443C8 - .pool -_08044340: - ldr r0, =gUnknown_082DB452 - bl b_push_move_exec - ldr r1, =gStatuses3 - ldr r0, [sp, 0x18] - adds r1, r0, r1 - ldr r0, [r1] - ldr r2, =0xffefffff - ands r0, r2 - str r0, [r1] - ldr r0, =gBattleScripting - strb r4, [r0, 0x17] - ldr r1, =gBattleTextBuff1 - movs r4, 0xFD - strb r4, [r1] - movs r0, 0x4 - strb r0, [r1, 0x1] - ldr r2, =gActiveBank - ldrb r0, [r2] - strb r0, [r1, 0x2] - ldr r3, =gBattlePartyID - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strb r0, [r1, 0x3] - movs r0, 0xFF - strb r0, [r1, 0x4] - ldr r1, =gBattleTextBuff2 - strb r4, [r1] - movs r0, 0x9 - strb r0, [r1, 0x1] - ldr r0, =gLastUsedAbility - ldrb r0, [r0] - strb r0, [r1, 0x2] - movs r0, 0x1 - negs r0, r0 - strb r0, [r1, 0x3] - b _0804441E - .pool -_080443B4: - strb r1, [r7] - ldr r0, [r2] - ldr r1, =0xfff7ffff - ands r0, r1 - str r0, [r2] - bl b_movescr_stack_push_cursor - ldr r1, =gBattlescriptCurrInstr - ldr r0, =gUnknown_082DB4C1 - str r0, [r1] -_080443C8: - ldr r0, =gBattleStruct - ldr r0, [r0] - adds r0, 0xD8 - strb r4, [r0] -_080443D0: - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - b _0804441E - .pool -_080443EC: - movs r4, 0 - ldr r0, =gNoOfAllBanks - ldrb r1, [r0] - cmp r4, r1 - bge _0804441E - ldr r0, =gBattleMons - adds r2, r1, 0 - adds r1, r0, 0 - adds r1, 0x20 - ldr r3, =gLastUsedAbility -_08044400: - ldrb r0, [r1] - cmp r0, r6 - bne _08044416 - cmp r4, r10 - beq _08044416 - strb r6, [r3] - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_08044416: - adds r1, 0x58 - adds r4, 0x1 - cmp r4, r2 - blt _08044400 -_0804441E: - mov r1, r9 - cmp r1, 0 - beq _0804443A -_08044424: - ldr r2, [sp, 0x4] - cmp r2, 0xB - bhi _0804443A - ldr r1, =gLastUsedAbility - ldrb r0, [r1] - cmp r0, 0xFF - beq _0804443A - adds r1, r0, 0 - mov r0, r10 - bl RecordAbilityBattle -_0804443A: - mov r0, r9 - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end AbilityBattleEffects - thumb_func_start b_call_bc_move_exec b_call_bc_move_exec: @ 8044458 ldr r1, =gBattlescriptCurrInstr @@ -4983,7 +1428,7 @@ _0804509A: cmp r2, 0 beq _080450B2 ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC70 + ldr r1, =gStatusConditionString_PoisonJpn bl StringCopy movs r0, 0x1 mov r10, r0 @@ -5002,7 +1447,7 @@ _080450B2: ands r0, r1 str r0, [r2] ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC78 + ldr r1, =gStatusConditionString_SleepJpn bl StringCopy movs r2, 0x1 add r10, r2 @@ -5013,7 +1458,7 @@ _080450D8: cmp r0, 0 beq _080450EE ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC80 + ldr r1, =gStatusConditionString_ParalysisJpn bl StringCopy movs r3, 0x1 add r10, r3 @@ -5024,7 +1469,7 @@ _080450EE: cmp r0, 0 beq _08045104 ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC88 + ldr r1, =gStatusConditionString_BurnJpn bl StringCopy movs r0, 0x1 add r10, r0 @@ -5035,7 +1480,7 @@ _08045104: cmp r0, 0 beq _0804511A ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC90 + ldr r1, =gStatusConditionString_IceJpn bl StringCopy movs r1, 0x1 add r10, r1 @@ -5047,7 +1492,7 @@ _0804511A: cmp r0, 0 beq _08045132 ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC98 + ldr r1, =gStatusConditionString_ConfusionJpn bl StringCopy movs r3, 0x1 add r10, r3 @@ -5103,7 +1548,7 @@ _080451A0: ands r2, r0 str r2, [r1] ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BCA0 + ldr r1, =gStatusConditionString_LoveJpn bl StringCopy ldr r0, =gUnknown_082DB794 bl b_call_bc_move_exec @@ -5426,7 +1871,7 @@ _080454E0: ands r1, r0 str r1, [r2] ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BCA0 + ldr r1, =gStatusConditionString_LoveJpn bl StringCopy bl b_movescr_stack_push_cursor ldr r1, =gBattleCommunication @@ -5466,7 +1911,7 @@ _08045548: cmp r2, 0 beq _08045558 ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC70 + ldr r1, =gStatusConditionString_PoisonJpn bl StringCopy _08045558: ldr r0, [r6] @@ -5482,7 +1927,7 @@ _08045558: ands r0, r1 str r0, [r2] ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC78 + ldr r1, =gStatusConditionString_SleepJpn bl StringCopy _08045578: ldr r0, [r6] @@ -5491,7 +1936,7 @@ _08045578: cmp r0, 0 beq _0804558A ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC80 + ldr r1, =gStatusConditionString_ParalysisJpn bl StringCopy _0804558A: ldr r0, [r6] @@ -5500,7 +1945,7 @@ _0804558A: cmp r0, 0 beq _0804559C ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC88 + ldr r1, =gStatusConditionString_BurnJpn bl StringCopy _0804559C: ldr r0, [r6] @@ -5509,7 +1954,7 @@ _0804559C: cmp r0, 0 beq _080455AE ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC90 + ldr r1, =gStatusConditionString_IceJpn bl StringCopy _080455AE: adds r5, r4 @@ -5519,7 +1964,7 @@ _080455AE: cmp r0, 0 beq _080455C2 ldr r0, =gBattleTextBuff1 - ldr r1, =gUnknown_0831BC98 + ldr r1, =gStatusConditionString_ConfusionJpn bl StringCopy _080455C2: movs r4, 0 diff --git a/asm/battle_4.s b/asm/battle_4.s index 38430bac1..094bf868e 100644 --- a/asm/battle_4.s +++ b/asm/battle_4.s @@ -29296,12 +29296,12 @@ atkE7_castform_data_change: @ 8055E64 str r0, [r1] ldr r0, =gBattleScripting ldrb r0, [r0, 0x17] - bl castform_switch + bl CastformDataTypeChange lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 beq _08055E8E - ldr r0, =gUnknown_082DB4A9 + ldr r0, =BattleScript_CastformChange bl b_push_move_exec ldr r0, =gBattleStruct ldr r0, [r0] diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 48669befb..73b2d2cb9 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -330,25 +330,25 @@ BattleScript_YawnMakesAsleep:: @ 82DB378 gUnknown_082DB422:: @ 82DB422 .incbin "baserom.gba", 0x2db422, 0xe -gUnknown_082DB430:: @ 82DB430 +BattleScript_DrizzleActivates:: @ 82DB430 .incbin "baserom.gba", 0x2db430, 0x14 -gUnknown_082DB444:: @ 82DB444 +BattleScript_SpeedBoostActivates:: @ 82DB444 .incbin "baserom.gba", 0x2db444, 0xe -gUnknown_082DB452:: @ 82DB452 +BattleScript_TraceActivates:: @ 82DB452 .incbin "baserom.gba", 0x2db452, 0xa -gUnknown_082DB45C:: @ 82DB45C +BattleScript_RainDishActivates:: @ 82DB45C .incbin "baserom.gba", 0x2db45c, 0x14 -gUnknown_082DB470:: @ 82DB470 +BattleScript_SandstreamActivates:: @ 82DB470 .incbin "baserom.gba", 0x2db470, 0x14 -gUnknown_082DB484:: @ 82DB484 +BattleScript_ShedSkinActivates:: @ 82DB484 .incbin "baserom.gba", 0x2db484, 0x25 -gUnknown_082DB4A9:: @ 82DB4A9 +BattleScript_CastformChange:: @ 82DB4A9 .incbin "baserom.gba", 0x2db4a9, 0xf gUnknown_082DB4B8:: @ 82DB4B8 @@ -357,7 +357,7 @@ gUnknown_082DB4B8:: @ 82DB4B8 gUnknown_082DB4C1:: @ 82DB4C1 .incbin "baserom.gba", 0x2db4c1, 0x69 -gUnknown_082DB52A:: @ 82DB52A +BattleScript_DroughtActivates:: @ 82DB52A .incbin "baserom.gba", 0x2db52a, 0x14 gUnknown_082DB53E:: @ 82DB53E @@ -369,10 +369,10 @@ gUnknown_082DB552:: @ 82DB552 gUnknown_082DB560:: @ 82DB560 .incbin "baserom.gba", 0x2db560, 0xe -gUnknown_082DB56E:: @ 82DB56E +BattleScript_MoveHPDrain_PPLoss:: @ 82DB56E .incbin "baserom.gba", 0x2db56e, 0x1 -gUnknown_082DB56F:: @ 82DB56F +BattleScript_MoveHPDrain:: @ 82DB56F .incbin "baserom.gba", 0x2db56f, 0x22 gUnknown_082DB591:: @ 82DB591 @@ -381,10 +381,10 @@ gUnknown_082DB591:: @ 82DB591 gUnknown_082DB592:: @ 82DB592 .incbin "baserom.gba", 0x2db592, 0x15 -gUnknown_082DB5A7:: @ 82DB5A7 +BattleScript_FlashFireBoost_PPLoss:: @ 82DB5A7 .incbin "baserom.gba", 0x2db5a7, 0x1 -gUnknown_082DB5A8:: @ 82DB5A8 +BattleScript_FlashFireBoost:: @ 82DB5A8 .incbin "baserom.gba", 0x2db5a8, 0x1f gUnknown_082DB5C7:: @ 82DB5C7 @@ -405,7 +405,7 @@ gUnknown_082DB5F5:: @ 82DB5F5 gUnknown_082DB603:: @ 82DB603 .incbin "baserom.gba", 0x2db603, 0x1c -gUnknown_082DB61F:: @ 82DB61F +BattleScript_SoundproofProtected:: @ 82DB61F .incbin "baserom.gba", 0x2db61f, 0x10 gUnknown_082DB62F:: @ 82DB62F @@ -414,19 +414,19 @@ gUnknown_082DB62F:: @ 82DB62F gUnknown_082DB63F:: @ 82DB63F .incbin "baserom.gba", 0x2db63f, 0xe -gUnknown_082DB64D:: @ 82DB64D +BattleScript_ColorChangeActivates:: @ 82DB64D .incbin "baserom.gba", 0x2db64d, 0x7 -gUnknown_082DB654:: @ 82DB654 +BattleScript_RoughSkinActivates:: @ 82DB654 .incbin "baserom.gba", 0x2db654, 0x1b -gUnknown_082DB66F:: @ 82DB66F +BattleScript_CuteCharmActivates:: @ 82DB66F .incbin "baserom.gba", 0x2db66f, 0xd -gUnknown_082DB67C:: @ 82DB67C +BattleScript_ApplySecondaryEffect:: @ 82DB67C .incbin "baserom.gba", 0x2db67c, 0x3 -gUnknown_082DB67F:: @ 82DB67F +BattleScript_SynchronizeActivates:: @ 82DB67F .incbin "baserom.gba", 0x2db67f, 0x3 gUnknown_082DB682:: @ 82DB682 diff --git a/data/data2b.s b/data/data2b.s index 28d34f79b..1499c51fe 100644 --- a/data/data2b.s +++ b/data/data2b.s @@ -227,25 +227,25 @@ gUnknown_0831BC0C:: @ 831BC0C gUnknown_0831BC44:: @ 831BC44 .incbin "baserom.gba", 0x31bc44, 0x2c -gUnknown_0831BC70:: @ 831BC70 +gStatusConditionString_PoisonJpn:: @ 831BC70 .incbin "baserom.gba", 0x31bc70, 0x8 -gUnknown_0831BC78:: @ 831BC78 +gStatusConditionString_SleepJpn:: @ 831BC78 .incbin "baserom.gba", 0x31bc78, 0x8 -gUnknown_0831BC80:: @ 831BC80 +gStatusConditionString_ParalysisJpn:: @ 831BC80 .incbin "baserom.gba", 0x31bc80, 0x8 -gUnknown_0831BC88:: @ 831BC88 +gStatusConditionString_BurnJpn:: @ 831BC88 .incbin "baserom.gba", 0x31bc88, 0x8 -gUnknown_0831BC90:: @ 831BC90 +gStatusConditionString_IceJpn:: @ 831BC90 .incbin "baserom.gba", 0x31bc90, 0x8 -gUnknown_0831BC98:: @ 831BC98 +gStatusConditionString_ConfusionJpn:: @ 831BC98 .incbin "baserom.gba", 0x31bc98, 0x8 -gUnknown_0831BCA0:: @ 831BCA0 +gStatusConditionString_LoveJpn:: @ 831BCA0 .incbin "baserom.gba", 0x31bca0, 0x8 gUnknown_0831BCA8:: @ 831BCA8 @@ -260,6 +260,6 @@ gUnknown_0831BCEF:: @ 831BCEF gUnknown_0831BCF3:: @ 831BCF3 .incbin "baserom.gba", 0x31bcf3, 0x5 -gUnknown_0831BCF8:: @ 831BCF8 +gSoundMovesTable:: @ 831BCF8 .incbin "baserom.gba", 0x31bcf8, 0x18 diff --git a/include/battle.h b/include/battle.h index 4def33967..c31aff6e8 100644 --- a/include/battle.h +++ b/include/battle.h @@ -26,6 +26,7 @@ #define BATTLE_TYPE_x100000 0x100000 #define BATTLE_TYPE_PYRAMID 0x200000 #define BATTLE_TYPE_INGAME_PARTNER 0x400000 +#define BATTLE_TYPE_x800000 0x800000 #define BATTLE_TYPE_RECORDED 0x1000000 #define BATTLE_TYPE_x2000000 0x2000000 #define BATTLE_TYPE_x4000000 0x4000000 @@ -137,26 +138,26 @@ #define SIDE_STATUS_MIST (1 << 8) #define SIDE_STATUS_SPIKES_DAMAGED (1 << 9) -#define ABILITYEFFECT_ON_SWITCHIN 0x0 -#define ABILITYEFFECT_ENDTURN 0x1 -#define ABILITYEFFECT_MOVES_BLOCK 0x2 -#define ABILITYEFFECT_ABSORBING 0x3 -#define ABILITYEFFECT_CONTACT 0x4 -#define ABILITYEFFECT_IMMUNITY 0x5 -#define ABILITYEFFECT_FORECAST 0x6 -#define ABILITYEFFECT_SYNCHRONIZE 0x7 -#define ABILITYEFFECT_ATK_SYNCHRONIZE 0x8 -#define ABILITYEFFECT_INTIMIDATE1 0x9 -#define ABILITYEFFECT_INTIMIDATE2 0xA -#define ABILITYEFFECT_TRACE 0xB -#define ABILITYEFFECT_CHECK_OTHER_SIDE 0xC -#define ABILITYEFFECT_CHECK_BANK_SIDE 0xD -#define ABILITYEFFECT_FIELD_SPORT 0xE +#define ABILITYEFFECT_ON_SWITCHIN 0x0 +#define ABILITYEFFECT_ENDTURN 0x1 +#define ABILITYEFFECT_MOVES_BLOCK 0x2 +#define ABILITYEFFECT_ABSORBING 0x3 +#define ABILITYEFFECT_CONTACT 0x4 +#define ABILITYEFFECT_IMMUNITY 0x5 +#define ABILITYEFFECT_FORECAST 0x6 +#define ABILITYEFFECT_SYNCHRONIZE 0x7 +#define ABILITYEFFECT_ATK_SYNCHRONIZE 0x8 +#define ABILITYEFFECT_INTIMIDATE1 0x9 +#define ABILITYEFFECT_INTIMIDATE2 0xA +#define ABILITYEFFECT_TRACE 0xB +#define ABILITYEFFECT_CHECK_OTHER_SIDE 0xC +#define ABILITYEFFECT_CHECK_BANK_SIDE 0xD +#define ABILITYEFFECT_FIELD_SPORT 0xE #define ABILITYEFFECT_CHECK_FIELD_EXCEPT_BANK 0xF -#define ABILITYEFFECT_COUNT_OTHER_SIZE 0x10 -#define ABILITYEFFECT_COUNT_BANK_SIDE 0x11 -#define ABILITYEFFECT_COUNT_ON_FIELD 0x12 -#define ABILITYEFFECT_CHECK_ON_FIELD 0x13 +#define ABILITYEFFECT_COUNT_OTHER_SIZE 0x10 +#define ABILITYEFFECT_COUNT_BANK_SIDE 0x11 +#define ABILITYEFFECT_COUNT_ON_FIELD 0x12 +#define ABILITYEFFECT_CHECK_ON_FIELD 0x13 #define WEATHER_HAS_EFFECT ((!AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_CLOUD_NINE, 0, 0) && !AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_AIR_LOCK, 0, 0))) @@ -523,10 +524,7 @@ struct BattleStruct u8 field_59; u8 field_5A; u8 field_5B; - u8 field_5C; - u8 field_5D; - u8 field_5E; - u8 field_5F; + u8 field_5C[4]; u8 field_60; u8 field_61; u8 field_62; @@ -611,13 +609,13 @@ struct BattleStruct u8 field_D0[8]; u8 intimidateBank; u8 fillerD9[0xDA-0xD9]; - u8 unkDA; + u8 field_DA; u8 turnSideTracker; u8 fillerDC[0xDF-0xDC]; - u8 unkDF; + u8 field_DF; u8 fillerE0[0x1A0-0xE0]; - u8 unk1A0; - u8 unk1A1; + u8 field_1A0; + u8 field_1A1; u8 filler1A2; u8 atkCancellerTracker; }; diff --git a/include/pokemon.h b/include/pokemon.h index fefe2bd28..595ec38fd 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -439,6 +439,12 @@ struct BattleMove u8 flags; }; +#define FLAG_MAKES_CONTACT 0x1 +#define FLAG_PROTECT_AFFECTED 0x2 +#define FLAG_MAGICCOAT_AFFECTED 0x4 +#define FLAG_SNATCH_AFFECTED 0x8 +#define FLAG_KINGSROCK_AFFECTED 0x20 + struct SpindaSpot { u8 x, y; diff --git a/src/battle_3.c b/src/battle_3.c index 34e45ca74..09c401a5c 100644 --- a/src/battle_3.c +++ b/src/battle_3.c @@ -13,6 +13,7 @@ #include "text.h" #include "string_util.h" #include "battle_message.h" +#include "battle_ai.h" extern const u8* gBattlescriptCurrInstr; extern const u8* gUnknown_02024220[BATTLE_BANKS_COUNT]; @@ -45,6 +46,7 @@ extern u16 gChosenMovesByBanks[]; extern u8 gBattleMoveFlags; extern s32 gTakenDmg[BATTLE_BANKS_COUNT]; extern u8 gTakenDmgBanks[BATTLE_BANKS_COUNT]; +extern u8 gLastUsedAbility; extern const struct BattleMove gBattleMoves[]; @@ -107,6 +109,37 @@ extern const u8 BattleScript_MoveUsedIsInLove[]; extern const u8 BattleScript_BideStoringEnergy[]; extern const u8 BattleScript_BideAttack[]; extern const u8 BattleScript_BideNoEnergyToAttack[]; +extern const u8 gUnknown_082DACE7[]; +extern const u8 BattleScript_DrizzleActivates[]; +extern const u8 BattleScript_SandstreamActivates[]; +extern const u8 BattleScript_DroughtActivates[]; +extern const u8 BattleScript_CastformChange[]; +extern const u8 BattleScript_RainDishActivates[]; +extern const u8 BattleScript_ShedSkinActivates[]; +extern const u8 BattleScript_SpeedBoostActivates[]; +extern const u8 BattleScript_SoundproofProtected[]; +extern const u8 BattleScript_MoveHPDrain[]; +extern const u8 BattleScript_MoveHPDrain_PPLoss[]; +extern const u8 BattleScript_FlashFireBoost[]; +extern const u8 BattleScript_FlashFireBoost_PPLoss[]; +extern const u8 BattleScript_ColorChangeActivates[]; +extern const u8 BattleScript_RoughSkinActivates[]; +extern const u8 BattleScript_ApplySecondaryEffect[]; +extern const u8 BattleScript_CuteCharmActivates[]; +extern const u8 gUnknown_082DB68C[]; +extern const u8 BattleScript_SynchronizeActivates[]; +extern const u8 gUnknown_082DB4B8[]; +extern const u8 gUnknown_082DB4C1[]; +extern const u8 BattleScript_TraceActivates[]; + +extern const u8 gStatusConditionString_PoisonJpn[]; +extern const u8 gStatusConditionString_SleepJpn[]; +extern const u8 gStatusConditionString_ParalysisJpn[]; +extern const u8 gStatusConditionString_BurnJpn[]; +extern const u8 gStatusConditionString_IceJpn[]; +extern const u8 gStatusConditionString_ConfusionJpn[]; +extern const u8 gStatusConditionString_LoveJpn[]; +extern const u16 gSoundMovesTable[]; extern void CancelMultiTurnMoves(u8 bank); extern u8 b_first_side(u8, u8, u8); @@ -122,10 +155,15 @@ extern u8 GetBankIdentity(u8); extern void sub_803F9EC(); extern bool8 sub_80423F4(u8 bank, u8, u8); extern s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *defender, u32 move, u16 sideFlags, u16 powerOverride, u8 typeOverride, u8 bankAtk, u8 bankDef); +extern u8 GetBankByPlayerAI(u8); +extern u8 sub_806D864(u8); +extern u8 sub_806D82C(u8); +extern u8 weather_get_current(void); u8 IsImprisoned(u8 bank, u16 move); u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn); u8 GetMoveTarget(u16 move, u8 useMoveTarget); +void b_push_move_exec(const u8* BS_ptr); void b_movescr_stack_push(const u8* bsPtr) { @@ -916,19 +954,19 @@ bool8 sub_8041364(void) { gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_x20); - switch (gBattleStruct->unk1A0) + switch (gBattleStruct->field_1A0) { case 0: - while (gBattleStruct->unk1A1 < gNoOfAllBanks) + while (gBattleStruct->field_1A1 < gNoOfAllBanks) { - gActiveBank = gBattleStruct->unk1A1; + gActiveBank = gBattleStruct->field_1A1; if (gAbsentBankFlags & gBitTable[gActiveBank]) { - gBattleStruct->unk1A1++; + gBattleStruct->field_1A1++; continue; } - gBattleStruct->unk1A1++; + gBattleStruct->field_1A1++; if (gWishFutureKnock.futureSightCounter[gActiveBank] != 0 && --gWishFutureKnock.futureSightCounter[gActiveBank] == 0 && gBattleMons[gActiveBank].hp != 0) @@ -959,21 +997,21 @@ bool8 sub_8041364(void) } // Why do I have to keep doing this to match? { - u8* var = &gBattleStruct->unk1A0; + u8* var = &gBattleStruct->field_1A0; *var = 1; - gBattleStruct->unk1A1 = 0; + gBattleStruct->field_1A1 = 0; } // fall through case 1: - while (gBattleStruct->unk1A1 < gNoOfAllBanks) + while (gBattleStruct->field_1A1 < gNoOfAllBanks) { - gActiveBank = gBankAttacker = gTurnOrder[gBattleStruct->unk1A1]; + gActiveBank = gBankAttacker = gTurnOrder[gBattleStruct->field_1A1]; if (gAbsentBankFlags & gBitTable[gActiveBank]) { - gBattleStruct->unk1A1++; + gBattleStruct->field_1A1++; continue; } - gBattleStruct->unk1A1++; + gBattleStruct->field_1A1++; if (gStatuses3[gActiveBank] & STATUS3_PERISH_SONG) { gBattleTextBuff1[0] = 0xFD; @@ -999,14 +1037,14 @@ bool8 sub_8041364(void) } // Hm... { - u8* var = &gBattleStruct->unk1A0; + u8* var = &gBattleStruct->field_1A0; *var = 2; - gBattleStruct->unk1A1 = 0; + gBattleStruct->field_1A1 = 0; } // fall through case 2: if ((gBattleTypeFlags & BATTLE_TYPE_ARENA) - && gBattleStruct->unkDA == 2 + && gBattleStruct->field_DA == 2 && gBattleMons[0].hp != 0 && gBattleMons[1].hp != 0) { s32 i; @@ -1016,7 +1054,7 @@ bool8 sub_8041364(void) gBattlescriptCurrInstr = gUnknown_082DB8F3; b_call_bc_move_exec(gUnknown_082DB8F3); - gBattleStruct->unk1A0++; + gBattleStruct->field_1A0++; return 1; } break; @@ -1052,7 +1090,7 @@ bool8 sub_8041728(void) { gBank1 = gBankTarget = gBattleStruct->field_4E; if (gBattleMons[gBattleStruct->field_4E].hp == 0 - && !(gBattleStruct->unkDF & gBitTable[gBattlePartyID[gBattleStruct->field_4E]]) + && !(gBattleStruct->field_DF & gBitTable[gBattlePartyID[gBattleStruct->field_4E]]) && !(gAbsentBankFlags & gBitTable[gBattleStruct->field_4E])) { b_call_bc_move_exec(gUnknown_082DA7C4); @@ -1094,7 +1132,7 @@ bool8 sub_8041728(void) gBattleStruct->field_4D = 4; break; case 6: - if (AbilityBattleEffects(9, 0, 0, 0, 0) || AbilityBattleEffects(0xB, 0, 0, 0, 0) || ItemBattleEffects(1, 0, 1) || AbilityBattleEffects(6, 0, 0, 0, 0)) + if (AbilityBattleEffects(ABILITYEFFECT_INTIMIDATE1, 0, 0, 0, 0) || AbilityBattleEffects(ABILITYEFFECT_TRACE, 0, 0, 0, 0) || ItemBattleEffects(1, 0, 1) || AbilityBattleEffects(ABILITYEFFECT_FORECAST, 0, 0, 0, 0)) return TRUE; gBattleStruct->field_4D++; break; @@ -1385,3 +1423,4003 @@ u8 AtkCanceller_UnableToUseMove(void) } return effect; } + +bool8 sub_80423F4(u8 bank, u8 r1, u8 r2) +{ + struct Pokemon* party; + u8 r7; + u8 r6; + s32 i; + if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) + return FALSE; + if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) + { + if (GetBankSide(bank) == 0) + party = gPlayerParty; + else + party = gEnemyParty; + r6 = ((bank & 2) >> 1); + for (i = r6 * 3; i < r6 * 3 + 3; i++) + { + if (GetMonData(&party[i], MON_DATA_HP) != 0 + && GetMonData(&party[i], MON_DATA_SPECIES2) != 0 + && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG) + break; + } + return (i == r6 * 3 + 3); + } + else if (gBattleTypeFlags & BATTLE_TYPE_MULTI) + { + if (gBattleTypeFlags & BATTLE_TYPE_x800000) + { + if (GetBankSide(bank) == SIDE_PLAYER) + { + party = gPlayerParty; + r7 = sub_806D864(bank); + r6 = sub_806D82C(r7); + } + else + { + // FIXME: Compiler insists on moving r4 into r1 before doing the eor + #ifndef NONMATCHING + register u32 var asm("r1"); + #else + u32 var; + #endif // NONMATCHING + + party = gEnemyParty; + var = bank ^ 1; + r6 = (var == 0) ? 0 : 1; + } + } + else + { + r7 = sub_806D864(bank); + if (GetBankSide(bank) == 0) + party = gPlayerParty; + else + party = gEnemyParty; + r6 = sub_806D82C(r7); + } + for (i = r6 * 3; i < r6 * 3 + 3; i++) + { + if (GetMonData(&party[i], MON_DATA_HP) != 0 + && GetMonData(&party[i], MON_DATA_SPECIES2) != 0 + && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG) + break; + } + return (i == r6 * 3 + 3); + } + else if ((gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) && GetBankSide(bank) == 1) + { + party = gEnemyParty; + + if (bank == 1) + r6 = 0; + else + r6 = 3; + for (i = r6; i < r6 + 3; i++) + { + if (GetMonData(&party[i], MON_DATA_HP) != 0 + && GetMonData(&party[i], MON_DATA_SPECIES2) != 0 + && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG) + break; + } + return (i == r6 + 3); + } + else + { + if (GetBankSide(bank) == 1) + { + r7 = GetBankByPlayerAI(1); + r6 = GetBankByPlayerAI(3); + party = gEnemyParty; + } + else + { + r7 = GetBankByPlayerAI(0); + r6 = GetBankByPlayerAI(2); + party = gPlayerParty; + } + if (r1 == 6) + r1 = gBattlePartyID[r7]; + if (r2 == 6) + r2 = gBattlePartyID[r6]; + for (i = 0; i < 6; i++) + { + if (GetMonData(&party[i], MON_DATA_HP) != 0 + && GetMonData(&party[i], MON_DATA_SPECIES2) != 0 + && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG + // FIXME: Using index[array] instead of array[index] is BAD! + && i != r1 && i != r2 && i != r7[gBattleStruct->field_5C] && i != r6[gBattleStruct->field_5C]) + break; + } + return (i == 6); + } +} + +enum +{ + CASTFORM_NO_CHANGE, //0 + CASTFORM_TO_NORMAL, //1 + CASTFORM_TO_FIRE, //2 + CASTFORM_TO_WATER, //3 + CASTFORM_TO_ICE, //4 +}; + +u8 CastformDataTypeChange(u8 bank) +{ + u8 formChange = 0; + if (gBattleMons[bank].species != SPECIES_CASTFORM || gBattleMons[bank].ability != ABILITY_FORECAST || gBattleMons[bank].hp == 0) + return CASTFORM_NO_CHANGE; + if (!WEATHER_HAS_EFFECT && gBattleMons[bank].type1 != TYPE_NORMAL && gBattleMons[bank].type2 != TYPE_NORMAL) + { + gBattleMons[bank].type1 = TYPE_NORMAL; + gBattleMons[bank].type2 = TYPE_NORMAL; + return CASTFORM_TO_NORMAL; + } + if (!WEATHER_HAS_EFFECT) + return CASTFORM_NO_CHANGE; + if (!(gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SUN_ANY | WEATHER_HAIL)) && gBattleMons[bank].type1 != TYPE_NORMAL && gBattleMons[bank].type2 != TYPE_NORMAL) + { + gBattleMons[bank].type1 = TYPE_NORMAL; + gBattleMons[bank].type2 = TYPE_NORMAL; + formChange = CASTFORM_TO_NORMAL; + } + if (gBattleWeather & WEATHER_SUN_ANY && gBattleMons[bank].type1 != TYPE_FIRE && gBattleMons[bank].type2 != TYPE_FIRE) + { + gBattleMons[bank].type1 = TYPE_FIRE; + gBattleMons[bank].type2 = TYPE_FIRE; + formChange = CASTFORM_TO_FIRE; + } + if (gBattleWeather & WEATHER_RAIN_ANY && gBattleMons[bank].type1 != TYPE_WATER && gBattleMons[bank].type2 != TYPE_WATER) + { + gBattleMons[bank].type1 = TYPE_WATER; + gBattleMons[bank].type2 = TYPE_WATER; + formChange = CASTFORM_TO_WATER; + } + if (gBattleWeather & WEATHER_HAIL && gBattleMons[bank].type1 != TYPE_ICE && gBattleMons[bank].type2 != TYPE_ICE) + { + gBattleMons[bank].type1 = TYPE_ICE; + gBattleMons[bank].type2 = TYPE_ICE; + formChange = CASTFORM_TO_ICE; + } + return formChange; +} + +// We meet again, ABE. +#ifdef NONMATCHING +u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg) +{ + u8 effect = 0; + struct Pokemon* pokeAtk; + struct Pokemon* pokeDef; + u16 speciesAtk; + u16 speciesDef; + u32 pidAtk; + u32 pidDef; + + if (gBankAttacker >= gNoOfAllBanks) + gBankAttacker = bank; + if (GetBankSide(gBankAttacker) == SIDE_PLAYER) + pokeAtk = &gPlayerParty[gBattlePartyID[gBankAttacker]]; + else + pokeAtk = &gEnemyParty[gBattlePartyID[gBankAttacker]]; + + if (gBankTarget >= gNoOfAllBanks) + gBankTarget = bank; + if (GetBankSide(gBankTarget) == SIDE_PLAYER) + pokeDef = &gPlayerParty[gBattlePartyID[gBankTarget]]; + else + pokeDef = &gEnemyParty[gBattlePartyID[gBankTarget]]; + + speciesAtk = GetMonData(pokeAtk, MON_DATA_SPECIES); + pidAtk = GetMonData(pokeAtk, MON_DATA_PERSONALITY); + + speciesDef = GetMonData(pokeDef, MON_DATA_SPECIES); + pidDef = GetMonData(pokeDef, MON_DATA_PERSONALITY); + + if (!(gBattleTypeFlags & BATTLE_TYPE_SAFARI)) // why isn't that check done at the beginning? + { + int i; // r4 + u16 move; + // Hmm... + #define moveType moveArg + //u16 moveType; + u8 side; + + if (special) + gLastUsedAbility = special; + else + gLastUsedAbility = gBattleMons[bank].ability; + + if (moveArg) + move = moveArg; + else + move = gCurrentMove; + + if (gBattleStruct->dynamicMoveType) + moveType = gBattleStruct->dynamicMoveType & 0x3F; + else + moveType = gBattleMoves[move].type; + + switch (caseID) + { + case ABILITYEFFECT_ON_SWITCHIN: // 0 + //_08042A18 + if (gBankAttacker >= gNoOfAllBanks) + gBankAttacker = bank; + switch (gLastUsedAbility) + { + case 0xFF: //weather from overworld + //_08042A86 + switch (weather_get_current()) + { + case 3: + case 5: + case 13: + if (!(gBattleWeather & WEATHER_RAIN_ANY)) + { + gBattleWeather = (WEATHER_RAIN_TEMPORARY | WEATHER_RAIN_PERMANENT); + gBattleScripting.animArg1 = 0xA; + gBattleScripting.bank = bank; + effect++; + } + break; + case 8: + if (!(gBattleWeather & WEATHER_SANDSTORM_ANY)) + { + gBattleWeather = (WEATHER_SANDSTORM_PERMANENT | WEATHER_SANDSTORM_TEMPORARY); + gBattleScripting.animArg1 = 0xC; + gBattleScripting.bank = bank; + effect++; + } + break; + case 12: + if (!(gBattleWeather & WEATHER_SUN_ANY)) + { + gBattleWeather = (WEATHER_SUN_PERMANENT | WEATHER_SUN_TEMPORARY); + gBattleScripting.animArg1 = 0xB; + gBattleScripting.bank = bank; + effect++; + } + break; + } + if (effect) + { + gBattleCommunication[MULTISTRING_CHOOSER] = weather_get_current(); + b_push_move_exec(gUnknown_082DACE7); + } + break; + case ABILITY_DRIZZLE: + //_08042B78 + if (!(gBattleWeather & WEATHER_RAIN_PERMANENT)) + { + gBattleWeather = (WEATHER_RAIN_PERMANENT | WEATHER_RAIN_TEMPORARY); + b_push_move_exec(BattleScript_DrizzleActivates); + gBattleScripting.bank = bank; + effect++; + } + break; + case ABILITY_SAND_STREAM: + //_08042BA8 + if (!(gBattleWeather & WEATHER_SANDSTORM_PERMANENT)) + { + gBattleWeather = (WEATHER_SANDSTORM_PERMANENT | WEATHER_SANDSTORM_TEMPORARY); + b_push_move_exec(BattleScript_SandstreamActivates); + gBattleScripting.bank = bank; + effect++; + } + break; + case ABILITY_DROUGHT: + //_08042BD8 + if (!(gBattleWeather & WEATHER_SUN_PERMANENT)) + { + gBattleWeather = (WEATHER_SUN_PERMANENT | WEATHER_SUN_TEMPORARY); + b_push_move_exec(BattleScript_DroughtActivates); + gBattleScripting.bank = bank; + effect++; + } + break; + case ABILITY_INTIMIDATE: + //_08042C08 + if (!(gSpecialStatuses[bank].intimidatedPoke)) + { + gStatuses3[bank] |= STATUS3_INTIMIDATE_POKES; + gSpecialStatuses[bank].intimidatedPoke = 1; + } + break; + case ABILITY_FORECAST: + //_08042C3C + effect = CastformDataTypeChange(bank); + if (effect != 0) + { + b_push_move_exec(BattleScript_CastformChange); + gBattleScripting.bank = bank; + gBattleStruct->formToChangeInto = effect - 1; + } + break; + case ABILITY_TRACE: + if (!(gSpecialStatuses[bank].traced)) + { + gStatuses3[bank] |= STATUS3_TRACE; + gSpecialStatuses[bank].traced = 1; + } + break; + case ABILITY_CLOUD_NINE: + case ABILITY_AIR_LOCK: + { + u8 i; + + for (i = 0; i < gNoOfAllBanks; i++) + { + // TODO: i should be in r6 here + //asm("":::"r4","r5"); + effect = CastformDataTypeChange(i); + if (effect != 0) + { + b_push_move_exec(BattleScript_CastformChange); + gBattleScripting.bank = i; + gBattleStruct->formToChangeInto = effect - 1; + break; + } + } + } + break; + } + break; + case ABILITYEFFECT_ENDTURN: // 1 + //_08042CDC + if (gBattleMons[bank].hp != 0) + { + gBankAttacker = bank; + switch (gLastUsedAbility) + { + case ABILITY_RAIN_DISH: + //_08042D22 + if (WEATHER_HAS_EFFECT && (gBattleWeather & WEATHER_RAIN_ANY) + && gBattleMons[bank].maxHP > gBattleMons[bank].hp) + { + gLastUsedAbility = ABILITY_RAIN_DISH; //why + b_push_move_exec(BattleScript_RainDishActivates); + gBattleMoveDamage = gBattleMons[bank].maxHP / 16; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + gBattleMoveDamage *= -1; + effect++; + } + break; + case ABILITY_SHED_SKIN: + //_08042DA0 + if ((gBattleMons[bank].status1 & STATUS_ANY) && (Random() % 3) == 0) + { + if (gBattleMons[bank].status1 & (STATUS_POISON | STATUS_TOXIC_POISON)) + StringCopy(gBattleTextBuff1, gStatusConditionString_PoisonJpn); + if (gBattleMons[bank].status1 & STATUS_SLEEP) + StringCopy(gBattleTextBuff1, gStatusConditionString_SleepJpn); + if (gBattleMons[bank].status1 & STATUS_PARALYSIS) + StringCopy(gBattleTextBuff1, gStatusConditionString_ParalysisJpn); + if (gBattleMons[bank].status1 & STATUS_BURN) + StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn); + if (gBattleMons[bank].status1 & STATUS_FREEZE) + StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn); + gBattleMons[bank].status1 = 0; + gBattleMons[bank].status2 &= ~(STATUS2_NIGHTMARE); // fix nighmare glitch + gBattleScripting.bank = gActiveBank = bank; + b_push_move_exec(BattleScript_ShedSkinActivates); + EmitSetAttributes(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[bank].status1); + MarkBufferBankForExecution(gActiveBank); + effect++; + } + break; + case ABILITY_SPEED_BOOST: + //_08042E84 + if (gBattleMons[bank].statStages[STAT_STAGE_SPEED] < 0xC && gDisableStructs[bank].isFirstTurn != 2) + { + gBattleMons[bank].statStages[STAT_STAGE_SPEED]++; + gBattleScripting.animArg1 = 0x11; + gBattleScripting.animArg2 = 0; + b_push_move_exec(BattleScript_SpeedBoostActivates); + gBattleScripting.bank = bank; + effect++; + } + break; + case ABILITY_TRUANT: + gDisableStructs[gBankAttacker].truantCounter ^= 1; + break; + } + } + break; + case ABILITYEFFECT_MOVES_BLOCK: // 2 + //_08042EF8 + if (gLastUsedAbility == ABILITY_SOUNDPROOF) + { + for (i = 0; gSoundMovesTable[i] != 0xFFFF; i++) + { + if (gSoundMovesTable[i] == move) + break; + } + if (gSoundMovesTable[i] != 0xFFFF) + { + if (gBattleMons[gBankAttacker].status2 & STATUS2_MULTIPLETURNS) + gHitMarker |= HITMARKER_NO_PPDEDUCT; + gBattlescriptCurrInstr = BattleScript_SoundproofProtected; + effect = 1; + } + } + break; + case ABILITYEFFECT_ABSORBING: // 3 + if (move) + { + switch (gLastUsedAbility) + { + case ABILITY_VOLT_ABSORB: + if (moveType == TYPE_ELECTRIC && gBattleMoves[move].power != 0) + { + if (gProtectStructs[gBankAttacker].notFirstStrike) + gBattlescriptCurrInstr = BattleScript_MoveHPDrain; + else + gBattlescriptCurrInstr = BattleScript_MoveHPDrain_PPLoss; + effect = 1; + } + break; + case ABILITY_WATER_ABSORB: + if (moveType == TYPE_WATER && gBattleMoves[move].power != 0) + { + if (gProtectStructs[gBankAttacker].notFirstStrike) + gBattlescriptCurrInstr = BattleScript_MoveHPDrain; + else + gBattlescriptCurrInstr = BattleScript_MoveHPDrain_PPLoss; + effect = 1; + } + break; + case ABILITY_FLASH_FIRE: + //_0804305C + if (moveType == TYPE_FIRE && !(gBattleMons[bank].status1 & STATUS_FREEZE)) + { + if (!(gBattleResources->flags->flags[bank] & UNKNOWN_FLAG_FLASH_FIRE)) + { + gBattleCommunication[MULTISTRING_CHOOSER] = 0; + if (gProtectStructs[gBankAttacker].notFirstStrike) + gBattlescriptCurrInstr = BattleScript_FlashFireBoost; + else + gBattlescriptCurrInstr = BattleScript_FlashFireBoost_PPLoss; + gBattleResources->flags->flags[bank] |= UNKNOWN_FLAG_FLASH_FIRE; + effect = 2; + } + else + { + gBattleCommunication[MULTISTRING_CHOOSER] = 1; + if (gProtectStructs[gBankAttacker].notFirstStrike) + gBattlescriptCurrInstr = BattleScript_FlashFireBoost; + else + gBattlescriptCurrInstr = BattleScript_FlashFireBoost_PPLoss; + effect = 2; + } + } + break; + } + if (effect == 1) + { + if (gBattleMons[bank].maxHP == gBattleMons[bank].hp) + { + if ((gProtectStructs[gBankAttacker].notFirstStrike)) + gBattlescriptCurrInstr = BattleScript_MoveHPDrain; + else + gBattlescriptCurrInstr = BattleScript_MoveHPDrain_PPLoss; + } + else + { + gBattleMoveDamage = gBattleMons[bank].maxHP / 4; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + gBattleMoveDamage *= -1; + } + } + } + break; + case ABILITYEFFECT_CONTACT: // 4 + //_080431AC + switch (gLastUsedAbility) + { + case ABILITY_COLOR_CHANGE: + //_08043288 + if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT) + && move != MOVE_STRUGGLE + && gBattleMoves[move].power != 0 + && (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special) + && gBattleMons[bank].type1 != moveType + && gBattleMons[bank].type2 != moveType + && gBattleMons[bank].hp != 0) + { + gBattleMons[bank].type1 = moveType; + gBattleMons[bank].type2 = moveType; + gBattleTextBuff1[0] = 0xFD; + gBattleTextBuff1[1] = 3; + gBattleTextBuff1[2] = moveType; + gBattleTextBuff1[3] = 0xFF; + b_movescr_stack_push_cursor(); + gBattlescriptCurrInstr = BattleScript_ColorChangeActivates; + effect++; + } + break; + case ABILITY_ROUGH_SKIN: + //_08043350 + if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT) + && gBattleMons[gBankAttacker].hp != 0 + && !gProtectStructs[gBankAttacker].confusionSelfDmg + && (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special) + && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)) + { + gBattleMoveDamage = gBattleMons[gBankAttacker].maxHP / 16; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + b_movescr_stack_push_cursor(); + gBattlescriptCurrInstr = BattleScript_RoughSkinActivates; + effect++; + } + break; + case ABILITY_EFFECT_SPORE: + //_08043410 + if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT) + && gBattleMons[gBankAttacker].hp != 0 + && !gProtectStructs[gBankAttacker].confusionSelfDmg + && (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special) + && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) + && (Random() % 10) == 0) + { + do + { + gBattleCommunication[MOVE_EFFECT_BYTE] = Random() & 3; + } while (gBattleCommunication[MOVE_EFFECT_BYTE] == 0); + if (gBattleCommunication[MOVE_EFFECT_BYTE] == 3) + gBattleCommunication[MOVE_EFFECT_BYTE] += 2; + gBattleCommunication[MOVE_EFFECT_BYTE] += 0x40; + b_movescr_stack_push_cursor(); + gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect; + gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; + effect++; + } + break; + case ABILITY_POISON_POINT: + if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT) + && gBattleMons[gBankAttacker].hp != 0 + && !gProtectStructs[gBankAttacker].confusionSelfDmg + && (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special) + && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) + && (Random() % 3) == 0) + { + gBattleCommunication[MOVE_EFFECT_BYTE] = 0x42; + b_movescr_stack_push_cursor(); + gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect; + gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; + effect++; + } + break; + case ABILITY_STATIC: + if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT) + && gBattleMons[gBankAttacker].hp != 0 + && !gProtectStructs[gBankAttacker].confusionSelfDmg + && (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special) + && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) + && (Random() % 3) == 0) + { + gBattleCommunication[MOVE_EFFECT_BYTE] = 0x45; + b_movescr_stack_push_cursor(); + gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect; + gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; + effect++; + } + break; + case ABILITY_FLAME_BODY: + if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT) + && gBattleMons[gBankAttacker].hp != 0 + && !gProtectStructs[gBankAttacker].confusionSelfDmg + && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) + && (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special) + && (Random() % 3) == 0) + { + gBattleCommunication[MOVE_EFFECT_BYTE] = 0x43; + b_movescr_stack_push_cursor(); + gBattlescriptCurrInstr = BattleScript_ApplySecondaryEffect; + gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; + effect++; + } + break; + case ABILITY_CUTE_CHARM: + //_0804379C + if (!(gBattleMoveFlags & MOVESTATUS_NOEFFECT) + && gBattleMons[gBankAttacker].hp != 0 + && !gProtectStructs[gBankAttacker].confusionSelfDmg + && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) + && (gSpecialStatuses[gBankTarget].moveturnLostHP_physical || gSpecialStatuses[gBankTarget].moveturnLostHP_special) + && gBattleMons[gBankTarget].hp != 0 + && (Random() % 3) == 0 + && gBattleMons[gBankAttacker].ability != ABILITY_OBLIVIOUS + && GetGenderFromSpeciesAndPersonality(speciesAtk, pidAtk) != GetGenderFromSpeciesAndPersonality(speciesDef, pidDef) + && !(gBattleMons[gBankAttacker].status2 & STATUS2_INFATUATION) + && GetGenderFromSpeciesAndPersonality(speciesAtk, pidAtk) != 0xFF + && GetGenderFromSpeciesAndPersonality(speciesDef, pidDef) != 0xFF) + { + gBattleMons[gBankAttacker].status2 |= (gBitTable[gBankTarget] << 0x10); + b_movescr_stack_push_cursor(); + gBattlescriptCurrInstr = BattleScript_CuteCharmActivates; + effect++; + } + break; + } + break; + case ABILITYEFFECT_IMMUNITY: // 5 + { + #define i bank + for (i = 0; i < gNoOfAllBanks; i++) + { + switch (gBattleMons[i].ability) + { + case ABILITY_IMMUNITY: + if (gBattleMons[i].status1 & (STATUS_POISON | STATUS_TOXIC_POISON | 0xF00)) // TODO: what is 0xF00? + { + StringCopy(gBattleTextBuff1, gStatusConditionString_PoisonJpn); + effect = 1; + } + break; + case ABILITY_OWN_TEMPO: + //_08043A7C + if (gBattleMons[i].status2 & STATUS2_CONFUSION) + { + StringCopy(gBattleTextBuff1, gStatusConditionString_ConfusionJpn); + effect = 2; + } + break; + case ABILITY_LIMBER: + if (gBattleMons[i].status1 & STATUS_PARALYSIS) + { + StringCopy(gBattleTextBuff1, gStatusConditionString_ParalysisJpn); + effect = 1; + } + break; + case ABILITY_INSOMNIA: + case ABILITY_VITAL_SPIRIT: + if (gBattleMons[i].status1 & STATUS_SLEEP) + { + gBattleMons[i].status2 &= ~(STATUS2_NIGHTMARE); + StringCopy(gBattleTextBuff1, gStatusConditionString_SleepJpn); + effect = 1; + } + break; + case ABILITY_WATER_VEIL: + if (gBattleMons[i].status1 & STATUS_BURN) + { + StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn); + effect = 1; + } + break; + case ABILITY_MAGMA_ARMOR: + if (gBattleMons[i].status1 & STATUS_FREEZE) + { + StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn); + effect = 1; + } + break; + case ABILITY_OBLIVIOUS: + //_08043B70 + if (gBattleMons[i].status2 & STATUS2_INFATUATION) + { + StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn); + effect = 3; + } + break; + } + if (effect) + { + switch (effect) + { + case 1: // status cleared + gBattleMons[i].status1 = 0; + break; + case 2: // get rid of confusion + gBattleMons[i].status2 &= ~(STATUS2_CONFUSION); + break; + case 3: // get rid of infatuation + gBattleMons[i].status2 &= ~(STATUS2_INFATUATION); + break; + } + b_movescr_stack_push_cursor(); + gBattlescriptCurrInstr = gUnknown_082DB68C; + gBattleScripting.bank = i; + gActiveBank = i; + EmitSetAttributes(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBank].status1); + MarkBufferBankForExecution(gActiveBank); + return effect; + } + } + #undef i + } + break; + case ABILITYEFFECT_FORECAST: // 6 + { + #define i bank + for (i = 0; i < gNoOfAllBanks; i++) + { + if (gBattleMons[i].ability == ABILITY_FORECAST) + { + effect = CastformDataTypeChange(i); + if (effect) + { + b_push_move_exec(BattleScript_CastformChange); + gBattleScripting.bank = i; + gBattleStruct->formToChangeInto = effect - 1; + return effect; + } + } + } + #undef i + } + break; + case ABILITYEFFECT_SYNCHRONIZE: // 7 + //_08043CBC + if (gLastUsedAbility == ABILITY_SYNCHRONIZE && (gHitMarker & HITMARKER_SYNCHRONISE_EFFECT)) + { + gHitMarker &= ~(HITMARKER_SYNCHRONISE_EFFECT); + gBattleStruct->synchronizeMoveEffect &= 0x3F; + if (gBattleStruct->synchronizeMoveEffect == 6) + gBattleStruct->synchronizeMoveEffect = 2; + gBattleCommunication[MOVE_EFFECT_BYTE] = gBattleStruct->synchronizeMoveEffect + 0x40; + gBattleScripting.bank = gBankTarget; + b_movescr_stack_push_cursor(); + gBattlescriptCurrInstr = BattleScript_SynchronizeActivates; + gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; + effect++; + } + break; + case ABILITYEFFECT_ATK_SYNCHRONIZE: // 8 + if (gLastUsedAbility == ABILITY_SYNCHRONIZE && (gHitMarker & HITMARKER_SYNCHRONISE_EFFECT)) + { + gHitMarker &= ~(HITMARKER_SYNCHRONISE_EFFECT); + gBattleStruct->synchronizeMoveEffect &= 0x3F; + if (gBattleStruct->synchronizeMoveEffect == 6) + gBattleStruct->synchronizeMoveEffect = 2; + gBattleCommunication[MOVE_EFFECT_BYTE] = gBattleStruct->synchronizeMoveEffect; + gBattleScripting.bank = gBankAttacker; + b_movescr_stack_push_cursor(); + gBattlescriptCurrInstr = BattleScript_SynchronizeActivates; + gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; + effect++; + } + break; + case ABILITYEFFECT_INTIMIDATE1: // 9 + for (i = 0; i < gNoOfAllBanks; i++) + { + if (gBattleMons[i].ability == ABILITY_INTIMIDATE && gStatuses3[i] & STATUS3_INTIMIDATE_POKES) + { + gLastUsedAbility = ABILITY_INTIMIDATE; + gStatuses3[i] &= ~(STATUS3_INTIMIDATE_POKES); + b_push_move_exec(gUnknown_082DB4B8); + gBattleStruct->intimidateBank = i; + effect++; + break; + } + } + break; + case ABILITYEFFECT_TRACE: // 11 + for (i = 0; i < gNoOfAllBanks; i++) + { + if (gBattleMons[i].ability == ABILITY_TRACE && (gStatuses3[i] & STATUS3_TRACE)) + { + u8 opposite = (GetBankIdentity(i) ^ 1) & 1; + u8 target1 = GetBankByPlayerAI(opposite); + u8 target2 = GetBankByPlayerAI(opposite + 2); + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + if (gBattleMons[target1].ability != 0 && gBattleMons[target1].hp != 0 + && gBattleMons[target2].ability != 0 && gBattleMons[target2].hp != 0) + { + gActiveBank = GetBankByPlayerAI(((Random() & 1) * 2) | opposite); + gBattleMons[i].ability = gBattleMons[gActiveBank].ability; + gLastUsedAbility = gBattleMons[gActiveBank].ability; + effect++; + } + else if (gBattleMons[target1].ability != 0 && gBattleMons[target1].hp != 0) + { + gActiveBank = target1; + gBattleMons[i].ability = gBattleMons[gActiveBank].ability; + gLastUsedAbility = gBattleMons[gActiveBank].ability; + effect++; + } + else if (gBattleMons[target2].ability != 0 && gBattleMons[target2].hp != 0) + { + gActiveBank = target2; + gBattleMons[i].ability = gBattleMons[gActiveBank].ability; + gLastUsedAbility = gBattleMons[gActiveBank].ability; + effect++; + } + } + else + { + gActiveBank = target1; + if (gBattleMons[target1].ability && gBattleMons[target1].hp) + { + gBattleMons[i].ability = gBattleMons[target1].ability; + gLastUsedAbility = gBattleMons[target1].ability; + effect++; + } + } + if (effect) + { + b_push_move_exec(BattleScript_TraceActivates); + gStatuses3[i] &= ~(STATUS3_TRACE); + gBattleScripting.bank = i; + + gBattleTextBuff1[0] = 0xFD; + gBattleTextBuff1[1] = 4; + gBattleTextBuff1[2] = gActiveBank; + gBattleTextBuff1[3] = gBattlePartyID[gActiveBank]; + gBattleTextBuff1[4] = EOS; + + gBattleTextBuff2[0] = 0xFD; + gBattleTextBuff2[1] = 9; + gBattleTextBuff2[2] = gLastUsedAbility; + gBattleTextBuff2[3] = EOS; + break; + } + } + } + break; + case ABILITYEFFECT_INTIMIDATE2: // 10 + for (i = 0; i < gNoOfAllBanks; i++) + { + if (gBattleMons[i].ability == ABILITY_INTIMIDATE && (gStatuses3[i] & STATUS3_INTIMIDATE_POKES)) + { + gLastUsedAbility = ABILITY_INTIMIDATE; + gStatuses3[i] &= ~(STATUS3_INTIMIDATE_POKES); + b_movescr_stack_push_cursor(); + gBattlescriptCurrInstr = gUnknown_082DB4C1; + gBattleStruct->intimidateBank = i; + effect++; + break; + } + } + break; + case ABILITYEFFECT_CHECK_OTHER_SIDE: // 12 + side = GetBankSide(bank); + for (i = 0; i < gNoOfAllBanks; i++) + { + if (GetBankSide(i) != side && gBattleMons[i].ability == ability) + { + gLastUsedAbility = ability; + effect = i + 1; + } + } + break; + case ABILITYEFFECT_CHECK_BANK_SIDE: // 13 + side = GetBankSide(bank); + for (i = 0; i < gNoOfAllBanks; i++) + { + if (GetBankSide(i) == side && gBattleMons[i].ability == ability) + { + gLastUsedAbility = ability; + effect = i + 1; + } + } + break; + case ABILITYEFFECT_FIELD_SPORT: // 14 + switch (gLastUsedAbility) + { + case 0xFD: + for (i = 0; i < gNoOfAllBanks; i++) + { + if (gStatuses3[i] & STATUS3_MUDSPORT) + effect = i + 1; + } + break; + case 0xFE: + for (i = 0; i < gNoOfAllBanks; i++) + { + if (gStatuses3[i] & STATUS3_WATERSPORT) + effect = i + 1; + } + break; + default: + for (i = 0; i < gNoOfAllBanks; i++) + { + if (gBattleMons[i].ability == ability) + { + gLastUsedAbility = ability; + effect = i + 1; + } + } + break; + } + break; + case ABILITYEFFECT_CHECK_ON_FIELD: // 19 + for (i = 0; i < gNoOfAllBanks; i++) + { + if (gBattleMons[i].ability == ability && gBattleMons[i].hp != 0) + { + gLastUsedAbility = ability; + effect = i + 1; + } + } + break; + case ABILITYEFFECT_CHECK_FIELD_EXCEPT_BANK: // 15 + for (i = 0; i < gNoOfAllBanks; i++) + { + if (gBattleMons[i].ability == ability && i != bank) + { + gLastUsedAbility = ability; + effect = i + 1; + } + } + break; + case ABILITYEFFECT_COUNT_OTHER_SIZE: // 16 + side = GetBankSide(bank); + for (i = 0; i < gNoOfAllBanks; i++) + { + if (GetBankSide(i) != side && gBattleMons[i].ability == ability) + { + gLastUsedAbility = ability; + effect++; + } + } + break; + case ABILITYEFFECT_COUNT_BANK_SIDE: // 17 + side = GetBankSide(bank); + for (i = 0; i < gNoOfAllBanks; i++) + { + if (GetBankSide(i) == side && gBattleMons[i].ability == ability) + { + gLastUsedAbility = ability; + effect++; + } + } + break; + case ABILITYEFFECT_COUNT_ON_FIELD: // 18 + for (i = 0; i < gNoOfAllBanks; i++) + { + if (gBattleMons[i].ability == ability && i != bank) + { + gLastUsedAbility = ability; + effect++; + } + } + break; + } + if (effect && caseID < 0xC && gLastUsedAbility != 0xFF) + RecordAbilityBattle(bank, gLastUsedAbility); + } + + return effect; +} +#else +__attribute__((naked)) +u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg) +{ + asm( + "\n\ + .syntax unified\n\ + push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0x28\n\ + ldr r4, [sp, 0x48]\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + str r0, [sp, 0x4]\n\ + lsls r1, 24\n\ + lsrs r1, 24\n\ + mov r10, r1\n\ + lsls r2, 24\n\ + lsrs r6, r2, 24\n\ + lsls r3, 24\n\ + lsrs r3, 24\n\ + mov r8, r3\n\ + lsls r4, 16\n\ + lsrs r4, 16\n\ + movs r0, 0\n\ + mov r9, r0\n\ + ldr r5, =gBankAttacker\n\ + ldr r1, =gNoOfAllBanks\n\ + ldrb r0, [r5]\n\ + ldrb r1, [r1]\n\ + cmp r0, r1\n\ + bcc _08042864\n\ + mov r1, r10\n\ + strb r1, [r5]\n\ +_08042864:\n\ + ldrb r0, [r5]\n\ + bl GetBankSide\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + bne _08042894\n\ + ldr r1, =gBattlePartyID\n\ + ldrb r0, [r5]\n\ + lsls r0, 1\n\ + adds r0, r1\n\ + ldrh r1, [r0]\n\ + movs r0, 0x64\n\ + muls r1, r0\n\ + ldr r0, =gPlayerParty\n\ + b _080428A4\n\ + .pool\n\ +_08042894:\n\ + ldr r1, =gBattlePartyID\n\ + ldrb r0, [r5]\n\ + lsls r0, 1\n\ + adds r0, r1\n\ + ldrh r1, [r0]\n\ + movs r0, 0x64\n\ + muls r1, r0\n\ + ldr r0, =gEnemyParty\n\ +_080428A4:\n\ + adds r7, r1, r0\n\ + ldr r5, =gBankTarget\n\ + ldr r1, =gNoOfAllBanks\n\ + ldrb r0, [r5]\n\ + ldrb r1, [r1]\n\ + cmp r0, r1\n\ + bcc _080428B6\n\ + mov r2, r10\n\ + strb r2, [r5]\n\ +_080428B6:\n\ + ldrb r0, [r5]\n\ + bl GetBankSide\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + bne _080428E8\n\ + ldr r1, =gBattlePartyID\n\ + ldrb r0, [r5]\n\ + lsls r0, 1\n\ + adds r0, r1\n\ + ldrh r1, [r0]\n\ + movs r0, 0x64\n\ + muls r1, r0\n\ + ldr r0, =gPlayerParty\n\ + b _080428F8\n\ + .pool\n\ +_080428E8:\n\ + ldr r1, =gBattlePartyID\n\ + ldrb r0, [r5]\n\ + lsls r0, 1\n\ + adds r0, r1\n\ + ldrh r1, [r0]\n\ + movs r0, 0x64\n\ + muls r1, r0\n\ + ldr r0, =gEnemyParty\n\ +_080428F8:\n\ + adds r5, r1, r0\n\ + adds r0, r7, 0\n\ + movs r1, 0xB\n\ + bl GetMonData\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + str r0, [sp, 0x8]\n\ + adds r0, r7, 0\n\ + movs r1, 0\n\ + bl GetMonData\n\ + str r0, [sp, 0x10]\n\ + adds r0, r5, 0\n\ + movs r1, 0xB\n\ + bl GetMonData\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + str r0, [sp, 0xC]\n\ + adds r0, r5, 0\n\ + movs r1, 0\n\ + bl GetMonData\n\ + str r0, [sp, 0x14]\n\ + ldr r0, =gBattleTypeFlags\n\ + ldr r0, [r0]\n\ + movs r1, 0x80\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _0804293A\n\ + bl _0804443A\n\ +_0804293A:\n\ + mov r3, r8\n\ + cmp r3, 0\n\ + beq _08042958\n\ + ldr r0, =gLastUsedAbility\n\ + strb r3, [r0]\n\ + adds r7, r0, 0\n\ + b _0804296E\n\ + .pool\n\ +_08042958:\n\ + ldr r2, =gLastUsedAbility\n\ + ldr r1, =gBattleMons\n\ + movs r0, 0x58\n\ + mov r5, r10\n\ + muls r5, r0\n\ + adds r0, r5, 0\n\ + adds r0, r1\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + strb r0, [r2]\n\ + adds r7, r2, 0\n\ +_0804296E:\n\ + cmp r4, 0\n\ + beq _08042980\n\ + adds r5, r4, 0\n\ + b _08042984\n\ + .pool\n\ +_08042980:\n\ + ldr r0, =gCurrentMove\n\ + ldrh r5, [r0]\n\ +_08042984:\n\ + ldr r1, =gBattleStruct\n\ + ldr r0, [r1]\n\ + ldrb r0, [r0, 0x13]\n\ + mov r8, r1\n\ + cmp r0, 0\n\ + beq _080429A0\n\ + movs r3, 0x3F\n\ + ands r3, r0\n\ + b _080429AC\n\ + .pool\n\ +_080429A0:\n\ + ldr r1, =gBattleMoves\n\ + lsls r0, r5, 1\n\ + adds r0, r5\n\ + lsls r0, 2\n\ + adds r0, r1\n\ + ldrb r3, [r0, 0x2]\n\ +_080429AC:\n\ + ldr r0, [sp, 0x4]\n\ + cmp r0, 0x13\n\ + bls _080429B6\n\ + bl _0804441E\n\ +_080429B6:\n\ + lsls r0, 2\n\ + ldr r1, =_080429C8\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + mov pc, r0\n\ + .pool\n\ + .align 2, 0\n\ +_080429C8:\n\ + .4byte _08042A18\n\ + .4byte _08042CDC\n\ + .4byte _08042EF8\n\ + .4byte _08042F8C\n\ + .4byte _080431AC\n\ + .4byte _08043908\n\ + .4byte _08043C6C\n\ + .4byte _08043CBC\n\ + .4byte _08043D40\n\ + .4byte _08043DC4\n\ + .4byte _08043FE4\n\ + .4byte _08043E08\n\ + .4byte _08044028\n\ + .4byte _08044084\n\ + .4byte _080440E0\n\ + .4byte _080441DC\n\ + .4byte _08044220\n\ + .4byte _0804427C\n\ + .4byte _080443EC\n\ + .4byte _08044196\n\ +_08042A18:\n\ + ldr r2, =gBankAttacker\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r1, [r2]\n\ + adds r5, r0, 0\n\ + ldrb r3, [r5]\n\ + cmp r1, r3\n\ + bcc _08042A2A\n\ + mov r0, r10\n\ + strb r0, [r2]\n\ +_08042A2A:\n\ + ldrb r0, [r7]\n\ + cmp r0, 0x2D\n\ + bne _08042A32\n\ + b _08042BA8\n\ +_08042A32:\n\ + cmp r0, 0x2D\n\ + bgt _08042A64\n\ + cmp r0, 0xD\n\ + bne _08042A3C\n\ + b _08042CA4\n\ +_08042A3C:\n\ + cmp r0, 0xD\n\ + bgt _08042A54\n\ + cmp r0, 0x2\n\ + bne _08042A46\n\ + b _08042B78\n\ +_08042A46:\n\ + bl _0804441E\n\ + .pool\n\ +_08042A54:\n\ + cmp r0, 0x16\n\ + bne _08042A5A\n\ + b _08042C08\n\ +_08042A5A:\n\ + cmp r0, 0x24\n\ + bne _08042A60\n\ + b _08042C68\n\ +_08042A60:\n\ + bl _0804441E\n\ +_08042A64:\n\ + cmp r0, 0x46\n\ + bne _08042A6A\n\ + b _08042BD8\n\ +_08042A6A:\n\ + cmp r0, 0x46\n\ + bgt _08042A78\n\ + cmp r0, 0x3B\n\ + bne _08042A74\n\ + b _08042C3C\n\ +_08042A74:\n\ + bl _0804441E\n\ +_08042A78:\n\ + cmp r0, 0x4D\n\ + bne _08042A7E\n\ + b _08042CA4\n\ +_08042A7E:\n\ + cmp r0, 0xFF\n\ + beq _08042A86\n\ + bl _0804441E\n\ +_08042A86:\n\ + ldr r0, =gBattleTypeFlags\n\ + ldr r0, [r0]\n\ + movs r1, 0x80\n\ + lsls r1, 17\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _08042B4C\n\ + bl weather_get_current\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + subs r0, 0x3\n\ + cmp r0, 0xA\n\ + bhi _08042B4C\n\ + lsls r0, 2\n\ + ldr r1, =_08042AB4\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + mov pc, r0\n\ + .pool\n\ + .align 2, 0\n\ +_08042AB4:\n\ + .4byte _08042AE0\n\ + .4byte _08042B4C\n\ + .4byte _08042AE0\n\ + .4byte _08042B4C\n\ + .4byte _08042B4C\n\ + .4byte _08042B04\n\ + .4byte _08042B4C\n\ + .4byte _08042B4C\n\ + .4byte _08042B4C\n\ + .4byte _08042B28\n\ + .4byte _08042AE0\n\ +_08042AE0:\n\ + ldr r2, =gBattleWeather\n\ + ldrh r1, [r2]\n\ + movs r0, 0x7\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _08042B4C\n\ + movs r0, 0x5\n\ + strh r0, [r2]\n\ + ldr r1, =gBattleScripting\n\ + movs r0, 0xA\n\ + strb r0, [r1, 0x10]\n\ + mov r2, r10\n\ + strb r2, [r1, 0x17]\n\ + b _08042B42\n\ + .pool\n\ +_08042B04:\n\ + ldr r3, =gBattleWeather\n\ + ldrh r1, [r3]\n\ + movs r2, 0x18\n\ + adds r0, r2, 0\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _08042B4C\n\ + strh r2, [r3]\n\ + ldr r1, =gBattleScripting\n\ + movs r0, 0xC\n\ + strb r0, [r1, 0x10]\n\ + mov r3, r10\n\ + strb r3, [r1, 0x17]\n\ + b _08042B42\n\ + .pool\n\ +_08042B28:\n\ + ldr r3, =gBattleWeather\n\ + ldrh r1, [r3]\n\ + movs r2, 0x60\n\ + adds r0, r2, 0\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _08042B4C\n\ + strh r2, [r3]\n\ + ldr r1, =gBattleScripting\n\ + movs r0, 0xB\n\ + strb r0, [r1, 0x10]\n\ + mov r5, r10\n\ + strb r5, [r1, 0x17]\n\ +_08042B42:\n\ + mov r0, r9\n\ + adds r0, 0x1\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r9, r0\n\ +_08042B4C:\n\ + mov r0, r9\n\ + cmp r0, 0\n\ + bne _08042B56\n\ + bl _0804443A\n\ +_08042B56:\n\ + bl weather_get_current\n\ + ldr r1, =gBattleCommunication\n\ + strb r0, [r1, 0x5]\n\ + ldr r0, =gUnknown_082DACE7\n\ + bl b_push_move_exec\n\ + bl _0804441E\n\ + .pool\n\ +_08042B78:\n\ + ldr r2, =gBattleWeather\n\ + ldrh r1, [r2]\n\ + movs r0, 0x4\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08042B88\n\ + bl _0804441E\n\ +_08042B88:\n\ + movs r0, 0x5\n\ + strh r0, [r2]\n\ + ldr r0, =BattleScript_DrizzleActivates\n\ + bl b_push_move_exec\n\ + ldr r0, =gBattleScripting\n\ + mov r1, r10\n\ + strb r1, [r0, 0x17]\n\ + bl _080443D0\n\ + .pool\n\ +_08042BA8:\n\ + ldr r2, =gBattleWeather\n\ + ldrh r1, [r2]\n\ + movs r0, 0x10\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08042BB8\n\ + bl _0804441E\n\ +_08042BB8:\n\ + movs r0, 0x18\n\ + strh r0, [r2]\n\ + ldr r0, =BattleScript_SandstreamActivates\n\ + bl b_push_move_exec\n\ + ldr r0, =gBattleScripting\n\ + mov r2, r10\n\ + strb r2, [r0, 0x17]\n\ + bl _080443D0\n\ + .pool\n\ +_08042BD8:\n\ + ldr r2, =gBattleWeather\n\ + ldrh r1, [r2]\n\ + movs r0, 0x40\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08042BE8\n\ + bl _0804441E\n\ +_08042BE8:\n\ + movs r0, 0x60\n\ + strh r0, [r2]\n\ + ldr r0, =BattleScript_DroughtActivates\n\ + bl b_push_move_exec\n\ + ldr r0, =gBattleScripting\n\ + mov r3, r10\n\ + strb r3, [r0, 0x17]\n\ + bl _080443D0\n\ + .pool\n\ +_08042C08:\n\ + ldr r0, =gSpecialStatuses\n\ + mov r5, r10\n\ + lsls r2, r5, 2\n\ + adds r1, r2, r5\n\ + lsls r1, 2\n\ + adds r3, r1, r0\n\ + ldrb r0, [r3]\n\ + lsls r0, 28\n\ + cmp r0, 0\n\ + bge _08042C20\n\ + bl _0804441E\n\ +_08042C20:\n\ + ldr r1, =gStatuses3\n\ + adds r1, r2, r1\n\ + ldr r0, [r1]\n\ + movs r2, 0x80\n\ + lsls r2, 12\n\ + orrs r0, r2\n\ + str r0, [r1]\n\ + ldrb r0, [r3]\n\ + movs r1, 0x8\n\ + b _08042C92\n\ + .pool\n\ +_08042C3C:\n\ + mov r0, r10\n\ + bl CastformDataTypeChange\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r9, r0\n\ + cmp r0, 0\n\ + bne _08042C50\n\ + bl _0804443A\n\ +_08042C50:\n\ + ldr r0, =BattleScript_CastformChange\n\ + bl b_push_move_exec\n\ + ldr r0, =gBattleScripting\n\ + mov r1, r10\n\ + strb r1, [r0, 0x17]\n\ + bl _080442E2\n\ + .pool\n\ +_08042C68:\n\ + ldr r0, =gSpecialStatuses\n\ + mov r3, r10\n\ + lsls r2, r3, 2\n\ + adds r1, r2, r3\n\ + lsls r1, 2\n\ + adds r3, r1, r0\n\ + ldrb r0, [r3]\n\ + lsls r0, 27\n\ + cmp r0, 0\n\ + bge _08042C80\n\ + bl _0804441E\n\ +_08042C80:\n\ + ldr r1, =gStatuses3\n\ + adds r1, r2, r1\n\ + ldr r0, [r1]\n\ + movs r2, 0x80\n\ + lsls r2, 13\n\ + orrs r0, r2\n\ + str r0, [r1]\n\ + ldrb r0, [r3]\n\ + movs r1, 0x10\n\ +_08042C92:\n\ + orrs r0, r1\n\ + strb r0, [r3]\n\ + bl _0804441E\n\ + .pool\n\ +_08042CA4:\n\ + movs r6, 0\n\ + ldrb r5, [r5]\n\ + cmp r6, r5\n\ + bcc _08042CB0\n\ + bl _0804441E\n\ +_08042CB0:\n\ + adds r0, r6, 0\n\ + bl CastformDataTypeChange\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r9, r0\n\ + cmp r0, 0\n\ + beq _08042CC4\n\ + bl _080442D8\n\ +_08042CC4:\n\ + adds r0, r6, 0x1\n\ + lsls r0, 24\n\ + lsrs r6, r0, 24\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r6, r0\n\ + bcc _08042CB0\n\ + bl _0804441E\n\ + .pool\n\ +_08042CDC:\n\ + ldr r5, =gBattleMons\n\ + mov r8, r5\n\ + movs r0, 0x58\n\ + mov r6, r10\n\ + muls r6, r0\n\ + adds r4, r6, r5\n\ + ldrh r0, [r4, 0x28]\n\ + cmp r0, 0\n\ + bne _08042CF2\n\ + bl _0804441E\n\ +_08042CF2:\n\ + ldr r0, =gBankAttacker\n\ + mov r1, r10\n\ + strb r1, [r0]\n\ + ldrb r5, [r7]\n\ + cmp r5, 0x2C\n\ + beq _08042D22\n\ + cmp r5, 0x2C\n\ + bgt _08042D14\n\ + cmp r5, 0x3\n\ + bne _08042D08\n\ + b _08042E84\n\ +_08042D08:\n\ + bl _0804441E\n\ + .pool\n\ +_08042D14:\n\ + cmp r5, 0x36\n\ + bne _08042D1A\n\ + b _08042ED0\n\ +_08042D1A:\n\ + cmp r5, 0x3D\n\ + beq _08042DA0\n\ + bl _0804441E\n\ +_08042D22:\n\ + movs r0, 0\n\ + str r0, [sp]\n\ + movs r0, 0x13\n\ + movs r1, 0\n\ + movs r2, 0xD\n\ + movs r3, 0\n\ + bl AbilityBattleEffects\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + cmp r0, 0\n\ + beq _08042D3E\n\ + bl _0804441E\n\ +_08042D3E:\n\ + str r0, [sp]\n\ + movs r0, 0x13\n\ + movs r1, 0\n\ + movs r2, 0x4D\n\ + movs r3, 0\n\ + bl AbilityBattleEffects\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + beq _08042D56\n\ + bl _0804441E\n\ +_08042D56:\n\ + ldr r0, =gBattleWeather\n\ + ldrh r1, [r0]\n\ + movs r0, 0x7\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _08042D66\n\ + bl _0804441E\n\ +_08042D66:\n\ + ldrh r0, [r4, 0x2C]\n\ + ldrh r2, [r4, 0x28]\n\ + cmp r0, r2\n\ + bhi _08042D72\n\ + bl _0804441E\n\ +_08042D72:\n\ + strb r5, [r7]\n\ + ldr r0, =BattleScript_RainDishActivates\n\ + bl b_push_move_exec\n\ + ldr r1, =gBattleMoveDamage\n\ + ldrh r0, [r4, 0x2C]\n\ + lsrs r0, 4\n\ + str r0, [r1]\n\ + cmp r0, 0\n\ + bne _08042D8A\n\ + movs r0, 0x1\n\ + str r0, [r1]\n\ +_08042D8A:\n\ + ldr r0, [r1]\n\ + negs r0, r0\n\ + str r0, [r1]\n\ + bl _080443D0\n\ + .pool\n\ +_08042DA0:\n\ + mov r0, r8\n\ + adds r0, 0x4C\n\ + adds r5, r6, r0\n\ + ldrb r0, [r5]\n\ + cmp r0, 0\n\ + bne _08042DB0\n\ + bl _0804441E\n\ +_08042DB0:\n\ + bl Random\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + movs r1, 0x3\n\ + bl __umodsi3\n\ + lsls r0, 16\n\ + lsrs r4, r0, 16\n\ + cmp r4, 0\n\ + beq _08042DCA\n\ + bl _0804441E\n\ +_08042DCA:\n\ + ldr r0, [r5]\n\ + movs r1, 0x88\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08042DDC\n\ + ldr r0, =gBattleTextBuff1\n\ + ldr r1, =gStatusConditionString_PoisonJpn\n\ + bl StringCopy\n\ +_08042DDC:\n\ + ldr r0, [r5]\n\ + movs r1, 0x7\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08042DEE\n\ + ldr r0, =gBattleTextBuff1\n\ + ldr r1, =gStatusConditionString_SleepJpn\n\ + bl StringCopy\n\ +_08042DEE:\n\ + ldr r0, [r5]\n\ + movs r1, 0x40\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08042E00\n\ + ldr r0, =gBattleTextBuff1\n\ + ldr r1, =gStatusConditionString_ParalysisJpn\n\ + bl StringCopy\n\ +_08042E00:\n\ + ldr r0, [r5]\n\ + movs r1, 0x10\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08042E12\n\ + ldr r0, =gBattleTextBuff1\n\ + ldr r1, =gStatusConditionString_BurnJpn\n\ + bl StringCopy\n\ +_08042E12:\n\ + ldr r0, [r5]\n\ + movs r1, 0x20\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08042E24\n\ + ldr r0, =gBattleTextBuff1\n\ + ldr r1, =gStatusConditionString_IceJpn\n\ + bl StringCopy\n\ +_08042E24:\n\ + str r4, [r5]\n\ + mov r1, r8\n\ + adds r1, 0x50\n\ + adds r1, r6, r1\n\ + ldr r0, [r1]\n\ + ldr r2, =0xf7ffffff\n\ + ands r0, r2\n\ + str r0, [r1]\n\ + ldr r0, =gBattleScripting\n\ + ldr r4, =gActiveBank\n\ + mov r3, r10\n\ + strb r3, [r4]\n\ + strb r3, [r0, 0x17]\n\ + ldr r0, =BattleScript_ShedSkinActivates\n\ + bl b_push_move_exec\n\ + str r5, [sp]\n\ + movs r0, 0\n\ + movs r1, 0x28\n\ + movs r2, 0\n\ + movs r3, 0x4\n\ + bl EmitSetAttributes\n\ + ldrb r0, [r4]\n\ + bl MarkBufferBankForExecution\n\ + bl _080443D0\n\ + .pool\n\ +_08042E84:\n\ + ldrb r2, [r4, 0x1B]\n\ + movs r0, 0x1B\n\ + ldrsb r0, [r4, r0]\n\ + cmp r0, 0xB\n\ + ble _08042E92\n\ + bl _0804441E\n\ +_08042E92:\n\ + ldr r0, =gDisableStructs\n\ + mov r5, r10\n\ + lsls r1, r5, 3\n\ + subs r1, r5\n\ + lsls r1, 2\n\ + adds r1, r0\n\ + ldrb r0, [r1, 0x16]\n\ + cmp r0, 0x2\n\ + bne _08042EA8\n\ + bl _0804441E\n\ +_08042EA8:\n\ + adds r0, r2, 0x1\n\ + movs r1, 0\n\ + strb r0, [r4, 0x1B]\n\ + ldr r4, =gBattleScripting\n\ + movs r0, 0x11\n\ + strb r0, [r4, 0x10]\n\ + strb r1, [r4, 0x11]\n\ + ldr r0, =BattleScript_SpeedBoostActivates\n\ + bl b_push_move_exec\n\ + strb r5, [r4, 0x17]\n\ + bl _080443D0\n\ + .pool\n\ +_08042ED0:\n\ + ldr r2, =gDisableStructs\n\ + ldrb r0, [r0]\n\ + lsls r1, r0, 3\n\ + subs r1, r0\n\ + lsls r1, 2\n\ + adds r1, r2\n\ + ldrb r3, [r1, 0x18]\n\ + lsls r0, r3, 31\n\ + lsrs r0, 31\n\ + movs r2, 0x1\n\ + eors r2, r0\n\ + movs r0, 0x2\n\ + negs r0, r0\n\ + ands r0, r3\n\ + orrs r0, r2\n\ + strb r0, [r1, 0x18]\n\ + bl _0804441E\n\ + .pool\n\ +_08042EF8:\n\ + ldrb r0, [r7]\n\ + cmp r0, 0x2B\n\ + beq _08042F02\n\ + bl _0804441E\n\ +_08042F02:\n\ + movs r4, 0\n\ + ldr r0, =gSoundMovesTable\n\ + ldrh r2, [r0]\n\ + ldr r3, =0x0000ffff\n\ + adds r1, r0, 0\n\ + cmp r2, r3\n\ + bne _08042F14\n\ + bl _0804441E\n\ +_08042F14:\n\ + cmp r2, r5\n\ + beq _08042F2C\n\ + adds r2, r1, 0\n\ +_08042F1A:\n\ + adds r2, 0x2\n\ + adds r4, 0x1\n\ + ldrh r0, [r2]\n\ + cmp r0, r3\n\ + bne _08042F28\n\ + bl _0804441E\n\ +_08042F28:\n\ + cmp r0, r5\n\ + bne _08042F1A\n\ +_08042F2C:\n\ + lsls r0, r4, 1\n\ + adds r0, r1\n\ + ldrh r1, [r0]\n\ + ldr r0, =0x0000ffff\n\ + cmp r1, r0\n\ + bne _08042F3C\n\ + bl _0804441E\n\ +_08042F3C:\n\ + ldr r1, =gBattleMons\n\ + ldr r0, =gBankAttacker\n\ + ldrb r2, [r0]\n\ + movs r0, 0x58\n\ + muls r0, r2\n\ + adds r1, 0x50\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + movs r1, 0x80\n\ + lsls r1, 5\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08042F62\n\ + ldr r0, =gHitMarker\n\ + ldr r1, [r0]\n\ + movs r2, 0x80\n\ + lsls r2, 4\n\ + orrs r1, r2\n\ + str r1, [r0]\n\ +_08042F62:\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =BattleScript_SoundproofProtected\n\ + str r0, [r1]\n\ + movs r0, 0x1\n\ + mov r9, r0\n\ + bl _08044424\n\ + .pool\n\ +_08042F8C:\n\ + cmp r5, 0\n\ + bne _08042F94\n\ + bl _0804441E\n\ +_08042F94:\n\ + ldrb r0, [r7]\n\ + cmp r0, 0xB\n\ + beq _08043004\n\ + cmp r0, 0xB\n\ + bgt _08042FA4\n\ + cmp r0, 0xA\n\ + beq _08042FAA\n\ + b _08043126\n\ +_08042FA4:\n\ + cmp r0, 0x12\n\ + beq _0804305C\n\ + b _08043126\n\ +_08042FAA:\n\ + cmp r3, 0xD\n\ + beq _08042FB0\n\ + b _08043126\n\ +_08042FB0:\n\ + ldr r0, =gBattleMoves\n\ + lsls r1, r5, 1\n\ + adds r1, r5\n\ + lsls r1, 2\n\ + adds r1, r0\n\ + ldrb r0, [r1, 0x1]\n\ + cmp r0, 0\n\ + bne _08042FC2\n\ + b _08043126\n\ +_08042FC2:\n\ + ldr r1, =gProtectStructs\n\ + ldr r0, =gBankAttacker\n\ + ldrb r0, [r0]\n\ + lsls r0, 4\n\ + adds r0, r1\n\ + ldrb r0, [r0, 0x2]\n\ + lsls r0, 28\n\ + cmp r0, 0\n\ + bge _08042FF0\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =BattleScript_MoveHPDrain\n\ + b _08042FF4\n\ + .pool\n\ +_08042FF0:\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =BattleScript_MoveHPDrain_PPLoss\n\ +_08042FF4:\n\ + str r0, [r1]\n\ + movs r1, 0x1\n\ + b _08043124\n\ + .pool\n\ +_08043004:\n\ + cmp r3, 0xB\n\ + beq _0804300A\n\ + b _08043126\n\ +_0804300A:\n\ + ldr r0, =gBattleMoves\n\ + lsls r1, r5, 1\n\ + adds r1, r5\n\ + lsls r1, 2\n\ + adds r1, r0\n\ + ldrb r0, [r1, 0x1]\n\ + cmp r0, 0\n\ + bne _0804301C\n\ + b _08043126\n\ +_0804301C:\n\ + ldr r1, =gProtectStructs\n\ + ldr r0, =gBankAttacker\n\ + ldrb r0, [r0]\n\ + lsls r0, 4\n\ + adds r0, r1\n\ + ldrb r0, [r0, 0x2]\n\ + lsls r0, 28\n\ + cmp r0, 0\n\ + bge _08043048\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =BattleScript_MoveHPDrain\n\ + b _0804304C\n\ + .pool\n\ +_08043048:\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =BattleScript_MoveHPDrain_PPLoss\n\ +_0804304C:\n\ + str r0, [r1]\n\ + movs r2, 0x1\n\ + mov r9, r2\n\ + b _08043126\n\ + .pool\n\ +_0804305C:\n\ + cmp r3, 0xA\n\ + bne _08043126\n\ + ldr r1, =gBattleMons\n\ + movs r0, 0x58\n\ + mov r3, r10\n\ + muls r3, r0\n\ + adds r0, r3, 0\n\ + adds r1, 0x4C\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + movs r1, 0x20\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _08043126\n\ + ldr r2, =gBattleResources\n\ + ldr r0, [r2]\n\ + ldr r0, [r0, 0x4]\n\ + mov r5, r10\n\ + lsls r1, r5, 2\n\ + adds r0, r1\n\ + ldr r3, [r0]\n\ + movs r4, 0x1\n\ + ands r3, r4\n\ + adds r5, r1, 0\n\ + cmp r3, 0\n\ + bne _080430EC\n\ + ldr r0, =gBattleCommunication\n\ + strb r3, [r0, 0x5]\n\ + ldr r1, =gProtectStructs\n\ + ldr r0, =gBankAttacker\n\ + ldrb r0, [r0]\n\ + lsls r0, 4\n\ + adds r0, r1\n\ + ldrb r0, [r0, 0x2]\n\ + lsls r0, 28\n\ + cmp r0, 0\n\ + bge _080430C8\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =BattleScript_FlashFireBoost\n\ + b _080430CC\n\ + .pool\n\ +_080430C8:\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =BattleScript_FlashFireBoost_PPLoss\n\ +_080430CC:\n\ + str r0, [r1]\n\ + ldr r0, [r2]\n\ + ldr r1, [r0, 0x4]\n\ + adds r1, r5\n\ + ldr r0, [r1]\n\ + movs r2, 0x1\n\ + orrs r0, r2\n\ + str r0, [r1]\n\ + movs r0, 0x2\n\ + mov r9, r0\n\ + b _08043126\n\ + .pool\n\ +_080430EC:\n\ + ldr r0, =gBattleCommunication\n\ + strb r4, [r0, 0x5]\n\ + ldr r1, =gProtectStructs\n\ + ldr r0, =gBankAttacker\n\ + ldrb r0, [r0]\n\ + lsls r0, 4\n\ + adds r0, r1\n\ + ldrb r0, [r0, 0x2]\n\ + lsls r0, 28\n\ + cmp r0, 0\n\ + bge _0804311C\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =BattleScript_FlashFireBoost\n\ + b _08043120\n\ + .pool\n\ +_0804311C:\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =BattleScript_FlashFireBoost_PPLoss\n\ +_08043120:\n\ + str r0, [r1]\n\ + movs r1, 0x2\n\ +_08043124:\n\ + mov r9, r1\n\ +_08043126:\n\ + mov r2, r9\n\ + cmp r2, 0x1\n\ + beq _08043130\n\ + bl _0804441E\n\ +_08043130:\n\ + ldr r1, =gBattleMons\n\ + movs r0, 0x58\n\ + mov r3, r10\n\ + muls r3, r0\n\ + adds r0, r3, 0\n\ + adds r1, r0, r1\n\ + ldrh r0, [r1, 0x2C]\n\ + ldrh r5, [r1, 0x28]\n\ + cmp r0, r5\n\ + bne _0804318C\n\ + ldr r1, =gProtectStructs\n\ + ldr r0, =gBankAttacker\n\ + ldrb r0, [r0]\n\ + lsls r0, 4\n\ + adds r0, r1\n\ + ldrb r0, [r0, 0x2]\n\ + lsls r0, 28\n\ + cmp r0, 0\n\ + bge _08043178\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =gUnknown_082DB592\n\ + str r0, [r1]\n\ + bl _0804441E\n\ + .pool\n\ +_08043178:\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =gUnknown_082DB591\n\ + str r0, [r1]\n\ + bl _0804441E\n\ + .pool\n\ +_0804318C:\n\ + ldr r2, =gBattleMoveDamage\n\ + ldrh r0, [r1, 0x2C]\n\ + lsrs r0, 2\n\ + str r0, [r2]\n\ + cmp r0, 0\n\ + bne _0804319C\n\ + mov r0, r9\n\ + str r0, [r2]\n\ +_0804319C:\n\ + ldr r0, [r2]\n\ + negs r0, r0\n\ + str r0, [r2]\n\ + bl _0804441E\n\ + .pool\n\ +_080431AC:\n\ + ldrb r0, [r7]\n\ + subs r0, 0x9\n\ + cmp r0, 0x2F\n\ + bls _080431B8\n\ + bl _0804441E\n\ +_080431B8:\n\ + lsls r0, 2\n\ + ldr r1, =_080431C8\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + mov pc, r0\n\ + .pool\n\ + .align 2, 0\n\ +_080431C8:\n\ + .4byte _080435E4\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _08043288\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _08043350\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _08043410\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _08043508\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _080436C0\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804441E\n\ + .4byte _0804379C\n\ +_08043288:\n\ + ldr r0, =gBattleMoveFlags\n\ + ldrb r1, [r0]\n\ + movs r0, 0x29\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08043298\n\ + bl _0804441E\n\ +_08043298:\n\ + cmp r5, 0xA5\n\ + bne _080432A0\n\ + bl _0804441E\n\ +_080432A0:\n\ + ldr r0, =gBattleMoves\n\ + lsls r1, r5, 1\n\ + adds r1, r5\n\ + lsls r1, 2\n\ + adds r1, r0\n\ + ldrb r0, [r1, 0x1]\n\ + cmp r0, 0\n\ + bne _080432B4\n\ + bl _0804441E\n\ +_080432B4:\n\ + ldr r2, =gSpecialStatuses\n\ + ldr r0, =gBankTarget\n\ + ldrb r1, [r0]\n\ + lsls r0, r1, 2\n\ + adds r0, r1\n\ + lsls r1, r0, 2\n\ + adds r0, r2, 0\n\ + adds r0, 0x8\n\ + adds r0, r1, r0\n\ + ldr r0, [r0]\n\ + cmp r0, 0\n\ + bne _080432DC\n\ + adds r0, r2, 0\n\ + adds r0, 0xC\n\ + adds r0, r1, r0\n\ + ldr r0, [r0]\n\ + cmp r0, 0\n\ + bne _080432DC\n\ + bl _0804441E\n\ +_080432DC:\n\ + ldr r1, =gBattleMons\n\ + movs r0, 0x58\n\ + mov r2, r10\n\ + muls r2, r0\n\ + adds r0, r2, 0\n\ + adds r1, r0, r1\n\ + adds r4, r1, 0\n\ + adds r4, 0x21\n\ + ldrb r0, [r4]\n\ + cmp r0, r3\n\ + bne _080432F6\n\ + bl _0804441E\n\ +_080432F6:\n\ + adds r2, r1, 0\n\ + adds r2, 0x22\n\ + ldrb r0, [r2]\n\ + cmp r0, r3\n\ + bne _08043304\n\ + bl _0804441E\n\ +_08043304:\n\ + ldrh r0, [r1, 0x28]\n\ + cmp r0, 0\n\ + bne _0804330E\n\ + bl _0804441E\n\ +_0804330E:\n\ + strb r3, [r4]\n\ + strb r3, [r2]\n\ + ldr r1, =gBattleTextBuff1\n\ + movs r0, 0xFD\n\ + strb r0, [r1]\n\ + movs r0, 0x3\n\ + strb r0, [r1, 0x1]\n\ + strb r3, [r1, 0x2]\n\ + movs r0, 0xFF\n\ + strb r0, [r1, 0x3]\n\ + bl b_movescr_stack_push_cursor\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =BattleScript_ColorChangeActivates\n\ + str r0, [r1]\n\ + bl _080443D0\n\ + .pool\n\ +_08043350:\n\ + ldr r0, =gBattleMoveFlags\n\ + ldrb r1, [r0]\n\ + movs r0, 0x29\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08043360\n\ + bl _0804441E\n\ +_08043360:\n\ + ldr r1, =gBattleMons\n\ + ldr r0, =gBankAttacker\n\ + ldrb r2, [r0]\n\ + movs r0, 0x58\n\ + muls r0, r2\n\ + adds r3, r0, r1\n\ + ldrh r0, [r3, 0x28]\n\ + cmp r0, 0\n\ + bne _08043376\n\ + bl _0804441E\n\ +_08043376:\n\ + ldr r0, =gProtectStructs\n\ + lsls r1, r2, 4\n\ + adds r1, r0\n\ + ldrb r0, [r1, 0x1]\n\ + lsls r0, 31\n\ + cmp r0, 0\n\ + beq _08043388\n\ + bl _0804441E\n\ +_08043388:\n\ + ldr r2, =gSpecialStatuses\n\ + ldr r0, =gBankTarget\n\ + ldrb r1, [r0]\n\ + lsls r0, r1, 2\n\ + adds r0, r1\n\ + lsls r1, r0, 2\n\ + adds r0, r2, 0\n\ + adds r0, 0x8\n\ + adds r0, r1, r0\n\ + ldr r0, [r0]\n\ + cmp r0, 0\n\ + bne _080433B0\n\ + adds r0, r2, 0\n\ + adds r0, 0xC\n\ + adds r0, r1, r0\n\ + ldr r0, [r0]\n\ + cmp r0, 0\n\ + bne _080433B0\n\ + bl _0804441E\n\ +_080433B0:\n\ + ldr r1, =gBattleMoves\n\ + lsls r0, r5, 1\n\ + adds r0, r5\n\ + lsls r0, 2\n\ + adds r0, r1\n\ + ldrb r1, [r0, 0x8]\n\ + movs r2, 0x1\n\ + adds r0, r2, 0\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _080433CA\n\ + bl _0804441E\n\ +_080433CA:\n\ + ldr r1, =gBattleMoveDamage\n\ + ldrh r0, [r3, 0x2C]\n\ + lsrs r0, 4\n\ + str r0, [r1]\n\ + cmp r0, 0\n\ + bne _080433D8\n\ + str r2, [r1]\n\ +_080433D8:\n\ + bl b_movescr_stack_push_cursor\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =BattleScript_RoughSkinActivates\n\ + str r0, [r1]\n\ + bl _080443D0\n\ + .pool\n\ +_08043410:\n\ + ldr r0, =gBattleMoveFlags\n\ + ldrb r1, [r0]\n\ + movs r0, 0x29\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08043420\n\ + bl _0804441E\n\ +_08043420:\n\ + ldr r1, =gBattleMons\n\ + ldr r0, =gBankAttacker\n\ + ldrb r2, [r0]\n\ + movs r0, 0x58\n\ + muls r0, r2\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x28]\n\ + cmp r0, 0\n\ + bne _08043436\n\ + bl _0804441E\n\ +_08043436:\n\ + ldr r0, =gProtectStructs\n\ + lsls r1, r2, 4\n\ + adds r1, r0\n\ + ldrb r0, [r1, 0x1]\n\ + lsls r0, 31\n\ + cmp r0, 0\n\ + beq _08043448\n\ + bl _0804441E\n\ +_08043448:\n\ + ldr r2, =gSpecialStatuses\n\ + ldr r0, =gBankTarget\n\ + ldrb r1, [r0]\n\ + lsls r0, r1, 2\n\ + adds r0, r1\n\ + lsls r1, r0, 2\n\ + adds r0, r2, 0\n\ + adds r0, 0x8\n\ + adds r0, r1, r0\n\ + ldr r0, [r0]\n\ + cmp r0, 0\n\ + bne _08043470\n\ + adds r0, r2, 0\n\ + adds r0, 0xC\n\ + adds r0, r1, r0\n\ + ldr r0, [r0]\n\ + cmp r0, 0\n\ + bne _08043470\n\ + bl _0804441E\n\ +_08043470:\n\ + ldr r1, =gBattleMoves\n\ + lsls r0, r5, 1\n\ + adds r0, r5\n\ + lsls r0, 2\n\ + adds r0, r1\n\ + ldrb r1, [r0, 0x8]\n\ + movs r0, 0x1\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _08043488\n\ + bl _0804441E\n\ +_08043488:\n\ + bl Random\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + movs r1, 0xA\n\ + bl __umodsi3\n\ + lsls r0, 16\n\ + cmp r0, 0\n\ + beq _080434A0\n\ + bl _0804441E\n\ +_080434A0:\n\ + ldr r5, =gBattleCommunication\n\ + movs r4, 0x3\n\ +_080434A4:\n\ + bl Random\n\ + ands r0, r4\n\ + strb r0, [r5, 0x3]\n\ + cmp r0, 0\n\ + beq _080434A4\n\ + ldr r1, =gBattleCommunication\n\ + ldrb r0, [r1, 0x3]\n\ + cmp r0, 0x3\n\ + bne _080434BC\n\ + adds r0, 0x2\n\ + strb r0, [r1, 0x3]\n\ +_080434BC:\n\ + ldrb r0, [r1, 0x3]\n\ + adds r0, 0x40\n\ + strb r0, [r1, 0x3]\n\ + bl b_movescr_stack_push_cursor\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =BattleScript_ApplySecondaryEffect\n\ + str r0, [r1]\n\ + ldr r2, =gHitMarker\n\ + ldr r0, [r2]\n\ + movs r1, 0x80\n\ + lsls r1, 6\n\ + orrs r0, r1\n\ + str r0, [r2]\n\ + bl _080443D0\n\ + .pool\n\ +_08043508:\n\ + ldr r0, =gBattleMoveFlags\n\ + ldrb r1, [r0]\n\ + movs r0, 0x29\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08043518\n\ + bl _0804441E\n\ +_08043518:\n\ + ldr r1, =gBattleMons\n\ + ldr r0, =gBankAttacker\n\ + ldrb r2, [r0]\n\ + movs r0, 0x58\n\ + muls r0, r2\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x28]\n\ + cmp r0, 0\n\ + bne _0804352E\n\ + bl _0804441E\n\ +_0804352E:\n\ + ldr r0, =gProtectStructs\n\ + lsls r1, r2, 4\n\ + adds r1, r0\n\ + ldrb r0, [r1, 0x1]\n\ + lsls r0, 31\n\ + cmp r0, 0\n\ + beq _08043540\n\ + bl _0804441E\n\ +_08043540:\n\ + ldr r2, =gSpecialStatuses\n\ + ldr r0, =gBankTarget\n\ + ldrb r1, [r0]\n\ + lsls r0, r1, 2\n\ + adds r0, r1\n\ + lsls r1, r0, 2\n\ + adds r0, r2, 0\n\ + adds r0, 0x8\n\ + adds r0, r1, r0\n\ + ldr r0, [r0]\n\ + cmp r0, 0\n\ + bne _08043568\n\ + adds r0, r2, 0\n\ + adds r0, 0xC\n\ + adds r0, r1, r0\n\ + ldr r0, [r0]\n\ + cmp r0, 0\n\ + bne _08043568\n\ + bl _0804441E\n\ +_08043568:\n\ + ldr r1, =gBattleMoves\n\ + lsls r0, r5, 1\n\ + adds r0, r5\n\ + lsls r0, 2\n\ + adds r0, r1\n\ + ldrb r1, [r0, 0x8]\n\ + movs r0, 0x1\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _08043580\n\ + bl _0804441E\n\ +_08043580:\n\ + bl Random\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + movs r1, 0x3\n\ + bl __umodsi3\n\ + lsls r0, 16\n\ + cmp r0, 0\n\ + beq _08043598\n\ + bl _0804441E\n\ +_08043598:\n\ + ldr r1, =gBattleCommunication\n\ + movs r0, 0x42\n\ + strb r0, [r1, 0x3]\n\ + bl b_movescr_stack_push_cursor\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =BattleScript_ApplySecondaryEffect\n\ + str r0, [r1]\n\ + ldr r2, =gHitMarker\n\ + ldr r0, [r2]\n\ + movs r1, 0x80\n\ + lsls r1, 6\n\ + orrs r0, r1\n\ + str r0, [r2]\n\ + bl _080443D0\n\ + .pool\n\ +_080435E4:\n\ + ldr r0, =gBattleMoveFlags\n\ + ldrb r1, [r0]\n\ + movs r0, 0x29\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080435F4\n\ + bl _0804441E\n\ +_080435F4:\n\ + ldr r1, =gBattleMons\n\ + ldr r0, =gBankAttacker\n\ + ldrb r2, [r0]\n\ + movs r0, 0x58\n\ + muls r0, r2\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x28]\n\ + cmp r0, 0\n\ + bne _0804360A\n\ + bl _0804441E\n\ +_0804360A:\n\ + ldr r0, =gProtectStructs\n\ + lsls r1, r2, 4\n\ + adds r1, r0\n\ + ldrb r0, [r1, 0x1]\n\ + lsls r0, 31\n\ + cmp r0, 0\n\ + beq _0804361C\n\ + bl _0804441E\n\ +_0804361C:\n\ + ldr r2, =gSpecialStatuses\n\ + ldr r0, =gBankTarget\n\ + ldrb r1, [r0]\n\ + lsls r0, r1, 2\n\ + adds r0, r1\n\ + lsls r1, r0, 2\n\ + adds r0, r2, 0\n\ + adds r0, 0x8\n\ + adds r0, r1, r0\n\ + ldr r0, [r0]\n\ + cmp r0, 0\n\ + bne _08043644\n\ + adds r0, r2, 0\n\ + adds r0, 0xC\n\ + adds r0, r1, r0\n\ + ldr r0, [r0]\n\ + cmp r0, 0\n\ + bne _08043644\n\ + bl _0804441E\n\ +_08043644:\n\ + ldr r1, =gBattleMoves\n\ + lsls r0, r5, 1\n\ + adds r0, r5\n\ + lsls r0, 2\n\ + adds r0, r1\n\ + ldrb r1, [r0, 0x8]\n\ + movs r0, 0x1\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _0804365C\n\ + bl _0804441E\n\ +_0804365C:\n\ + bl Random\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + movs r1, 0x3\n\ + bl __umodsi3\n\ + lsls r0, 16\n\ + cmp r0, 0\n\ + beq _08043674\n\ + bl _0804441E\n\ +_08043674:\n\ + ldr r1, =gBattleCommunication\n\ + movs r0, 0x45\n\ + strb r0, [r1, 0x3]\n\ + bl b_movescr_stack_push_cursor\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =BattleScript_ApplySecondaryEffect\n\ + str r0, [r1]\n\ + ldr r2, =gHitMarker\n\ + ldr r0, [r2]\n\ + movs r1, 0x80\n\ + lsls r1, 6\n\ + orrs r0, r1\n\ + str r0, [r2]\n\ + bl _080443D0\n\ + .pool\n\ +_080436C0:\n\ + ldr r0, =gBattleMoveFlags\n\ + ldrb r1, [r0]\n\ + movs r0, 0x29\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080436D0\n\ + bl _0804441E\n\ +_080436D0:\n\ + ldr r1, =gBattleMons\n\ + ldr r0, =gBankAttacker\n\ + ldrb r2, [r0]\n\ + movs r0, 0x58\n\ + muls r0, r2\n\ + adds r0, r1\n\ + ldrh r0, [r0, 0x28]\n\ + cmp r0, 0\n\ + bne _080436E6\n\ + bl _0804441E\n\ +_080436E6:\n\ + ldr r0, =gProtectStructs\n\ + lsls r1, r2, 4\n\ + adds r1, r0\n\ + ldrb r0, [r1, 0x1]\n\ + lsls r0, 31\n\ + cmp r0, 0\n\ + beq _080436F8\n\ + bl _0804441E\n\ +_080436F8:\n\ + ldr r1, =gBattleMoves\n\ + lsls r0, r5, 1\n\ + adds r0, r5\n\ + lsls r0, 2\n\ + adds r0, r1\n\ + ldrb r1, [r0, 0x8]\n\ + movs r0, 0x1\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _08043710\n\ + bl _0804441E\n\ +_08043710:\n\ + ldr r2, =gSpecialStatuses\n\ + ldr r0, =gBankTarget\n\ + ldrb r1, [r0]\n\ + lsls r0, r1, 2\n\ + adds r0, r1\n\ + lsls r1, r0, 2\n\ + adds r0, r2, 0\n\ + adds r0, 0x8\n\ + adds r0, r1, r0\n\ + ldr r0, [r0]\n\ + cmp r0, 0\n\ + bne _08043738\n\ + adds r0, r2, 0\n\ + adds r0, 0xC\n\ + adds r0, r1, r0\n\ + ldr r0, [r0]\n\ + cmp r0, 0\n\ + bne _08043738\n\ + bl _0804441E\n\ +_08043738:\n\ + bl Random\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + movs r1, 0x3\n\ + bl __umodsi3\n\ + lsls r0, 16\n\ + cmp r0, 0\n\ + beq _08043750\n\ + bl _0804441E\n\ +_08043750:\n\ + ldr r1, =gBattleCommunication\n\ + movs r0, 0x43\n\ + strb r0, [r1, 0x3]\n\ + bl b_movescr_stack_push_cursor\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =BattleScript_ApplySecondaryEffect\n\ + str r0, [r1]\n\ + ldr r2, =gHitMarker\n\ + ldr r0, [r2]\n\ + movs r1, 0x80\n\ + lsls r1, 6\n\ + orrs r0, r1\n\ + str r0, [r2]\n\ + bl _080443D0\n\ + .pool\n\ +_0804379C:\n\ + ldr r0, =gBattleMoveFlags\n\ + ldrb r1, [r0]\n\ + movs r0, 0x29\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _080437AC\n\ + bl _0804441E\n\ +_080437AC:\n\ + ldr r6, =gBattleMons\n\ + ldr r3, =gBankAttacker\n\ + mov r8, r3\n\ + ldrb r1, [r3]\n\ + movs r7, 0x58\n\ + adds r0, r1, 0\n\ + muls r0, r7\n\ + adds r0, r6\n\ + ldrh r0, [r0, 0x28]\n\ + cmp r0, 0\n\ + bne _080437C6\n\ + bl _0804441E\n\ +_080437C6:\n\ + ldr r0, =gProtectStructs\n\ + lsls r1, 4\n\ + adds r1, r0\n\ + ldrb r0, [r1, 0x1]\n\ + lsls r0, 31\n\ + cmp r0, 0\n\ + beq _080437D8\n\ + bl _0804441E\n\ +_080437D8:\n\ + ldr r1, =gBattleMoves\n\ + lsls r0, r5, 1\n\ + adds r0, r5\n\ + lsls r0, 2\n\ + adds r0, r1\n\ + ldrb r1, [r0, 0x8]\n\ + movs r0, 0x1\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _080437F0\n\ + bl _0804441E\n\ +_080437F0:\n\ + ldr r3, =gSpecialStatuses\n\ + ldr r5, =gBankTarget\n\ + ldrb r1, [r5]\n\ + lsls r0, r1, 2\n\ + adds r0, r1\n\ + lsls r2, r0, 2\n\ + adds r0, r3, 0\n\ + adds r0, 0x8\n\ + adds r0, r2, r0\n\ + ldr r0, [r0]\n\ + cmp r0, 0\n\ + bne _08043818\n\ + adds r0, r3, 0\n\ + adds r0, 0xC\n\ + adds r0, r2, r0\n\ + ldr r0, [r0]\n\ + cmp r0, 0\n\ + bne _08043818\n\ + bl _0804441E\n\ +_08043818:\n\ + adds r0, r1, 0\n\ + muls r0, r7\n\ + adds r0, r6\n\ + ldrh r0, [r0, 0x28]\n\ + cmp r0, 0\n\ + bne _08043828\n\ + bl _0804441E\n\ +_08043828:\n\ + bl Random\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + movs r1, 0x3\n\ + bl __umodsi3\n\ + lsls r0, 16\n\ + cmp r0, 0\n\ + beq _08043840\n\ + bl _0804441E\n\ +_08043840:\n\ + mov r1, r8\n\ + ldrb r0, [r1]\n\ + muls r0, r7\n\ + adds r0, r6\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + cmp r0, 0xC\n\ + bne _08043854\n\ + bl _0804441E\n\ +_08043854:\n\ + ldr r0, [sp, 0x8]\n\ + ldr r1, [sp, 0x10]\n\ + bl GetGenderFromSpeciesAndPersonality\n\ + adds r4, r0, 0\n\ + ldr r0, [sp, 0xC]\n\ + ldr r1, [sp, 0x14]\n\ + bl GetGenderFromSpeciesAndPersonality\n\ + lsls r4, 24\n\ + lsls r0, 24\n\ + cmp r4, r0\n\ + bne _08043872\n\ + bl _0804441E\n\ +_08043872:\n\ + mov r2, r8\n\ + ldrb r0, [r2]\n\ + muls r0, r7\n\ + adds r4, r6, 0\n\ + adds r4, 0x50\n\ + adds r0, r4\n\ + ldr r0, [r0]\n\ + movs r1, 0xF0\n\ + lsls r1, 12\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _0804388E\n\ + bl _0804441E\n\ +_0804388E:\n\ + ldr r0, [sp, 0x8]\n\ + ldr r1, [sp, 0x10]\n\ + bl GetGenderFromSpeciesAndPersonality\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + cmp r0, 0xFF\n\ + bne _080438A2\n\ + bl _0804441E\n\ +_080438A2:\n\ + ldr r0, [sp, 0xC]\n\ + ldr r1, [sp, 0x14]\n\ + bl GetGenderFromSpeciesAndPersonality\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + cmp r0, 0xFF\n\ + bne _080438B6\n\ + bl _0804441E\n\ +_080438B6:\n\ + mov r3, r8\n\ + ldrb r0, [r3]\n\ + adds r2, r0, 0\n\ + muls r2, r7\n\ + adds r2, r4\n\ + ldr r1, =gBitTable\n\ + ldrb r0, [r5]\n\ + lsls r0, 2\n\ + adds r0, r1\n\ + ldr r1, [r0]\n\ + lsls r1, 16\n\ + ldr r0, [r2]\n\ + orrs r0, r1\n\ + str r0, [r2]\n\ + bl b_movescr_stack_push_cursor\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =BattleScript_CuteCharmActivates\n\ + str r0, [r1]\n\ + bl _080443D0\n\ + .pool\n\ +_08043908:\n\ + movs r5, 0\n\ + mov r10, r5\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r10, r0\n\ + bcc _08043918\n\ + bl _0804441E\n\ +_08043918:\n\ + ldr r1, =gBattleMons\n\ + movs r0, 0x58\n\ + mov r2, r10\n\ + muls r2, r0\n\ + adds r0, r2, 0\n\ + adds r0, r1\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + subs r0, 0x7\n\ + adds r2, r1, 0\n\ + cmp r0, 0x41\n\ + bls _08043932\n\ + b _08043B96\n\ +_08043932:\n\ + lsls r0, 2\n\ + ldr r1, =_08043948\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + mov pc, r0\n\ + .pool\n\ + .align 2, 0\n\ +_08043948:\n\ + .4byte _08043AAC\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B70\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043AD4\n\ + .4byte _08043B96\n\ + .4byte _08043A50\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043A7C\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B40\n\ + .4byte _08043B10\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043B96\n\ + .4byte _08043AD4\n\ +_08043A50:\n\ + movs r0, 0x58\n\ + mov r3, r10\n\ + muls r3, r0\n\ + adds r0, r3, 0\n\ + adds r1, r2, 0\n\ + adds r1, 0x4C\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + ldr r1, =0x00000f88\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _08043A6A\n\ + b _08043B96\n\ +_08043A6A:\n\ + ldr r0, =gBattleTextBuff1\n\ + ldr r1, =gStatusConditionString_PoisonJpn\n\ + b _08043B5C\n\ + .pool\n\ +_08043A7C:\n\ + movs r0, 0x58\n\ + mov r1, r10\n\ + muls r1, r0\n\ + adds r0, r1, 0\n\ + adds r1, r2, 0\n\ + adds r1, 0x50\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + movs r1, 0x7\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _08043A96\n\ + b _08043B96\n\ +_08043A96:\n\ + ldr r0, =gBattleTextBuff1\n\ + ldr r1, =gStatusConditionString_ConfusionJpn\n\ + bl StringCopy\n\ + movs r2, 0x2\n\ + mov r9, r2\n\ + b _08043B9C\n\ + .pool\n\ +_08043AAC:\n\ + movs r0, 0x58\n\ + mov r3, r10\n\ + muls r3, r0\n\ + adds r0, r3, 0\n\ + adds r1, r2, 0\n\ + adds r1, 0x4C\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + movs r1, 0x40\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08043B96\n\ + ldr r0, =gBattleTextBuff1\n\ + ldr r1, =gStatusConditionString_ParalysisJpn\n\ + b _08043B5C\n\ + .pool\n\ +_08043AD4:\n\ + movs r0, 0x58\n\ + mov r3, r10\n\ + muls r3, r0\n\ + adds r0, r2, 0\n\ + adds r0, 0x4C\n\ + adds r0, r3, r0\n\ + ldr r0, [r0]\n\ + movs r1, 0x7\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08043B96\n\ + adds r2, 0x50\n\ + adds r2, r3, r2\n\ + ldr r0, [r2]\n\ + ldr r1, =0xf7ffffff\n\ + ands r0, r1\n\ + str r0, [r2]\n\ + ldr r0, =gBattleTextBuff1\n\ + ldr r1, =gStatusConditionString_SleepJpn\n\ + bl StringCopy\n\ + movs r0, 0x1\n\ + mov r9, r0\n\ + b _08043B9C\n\ + .pool\n\ +_08043B10:\n\ + movs r0, 0x58\n\ + mov r1, r10\n\ + muls r1, r0\n\ + adds r0, r1, 0\n\ + adds r1, r2, 0\n\ + adds r1, 0x4C\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + movs r1, 0x10\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08043B96\n\ + ldr r0, =gBattleTextBuff1\n\ + ldr r1, =gStatusConditionString_BurnJpn\n\ + bl StringCopy\n\ + movs r2, 0x1\n\ + mov r9, r2\n\ + b _08043B9C\n\ + .pool\n\ +_08043B40:\n\ + movs r0, 0x58\n\ + mov r3, r10\n\ + muls r3, r0\n\ + adds r0, r3, 0\n\ + adds r1, r2, 0\n\ + adds r1, 0x4C\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + movs r1, 0x20\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08043B96\n\ + ldr r0, =gBattleTextBuff1\n\ + ldr r1, =gStatusConditionString_IceJpn\n\ +_08043B5C:\n\ + bl StringCopy\n\ + movs r5, 0x1\n\ + mov r9, r5\n\ + b _08043B9C\n\ + .pool\n\ +_08043B70:\n\ + movs r0, 0x58\n\ + mov r1, r10\n\ + muls r1, r0\n\ + adds r0, r1, 0\n\ + adds r1, r2, 0\n\ + adds r1, 0x50\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + movs r1, 0xF0\n\ + lsls r1, 12\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _08043B96\n\ + ldr r0, =gBattleTextBuff1\n\ + ldr r1, =gStatusConditionString_LoveJpn\n\ + bl StringCopy\n\ + movs r2, 0x3\n\ + mov r9, r2\n\ +_08043B96:\n\ + mov r3, r9\n\ + cmp r3, 0\n\ + beq _08043C50\n\ +_08043B9C:\n\ + mov r5, r9\n\ + cmp r5, 0x2\n\ + beq _08043BD0\n\ + cmp r5, 0x2\n\ + bgt _08043BB4\n\ + cmp r5, 0x1\n\ + beq _08043BBC\n\ + b _08043BFC\n\ + .pool\n\ +_08043BB4:\n\ + mov r0, r9\n\ + cmp r0, 0x3\n\ + beq _08043BE8\n\ + b _08043BFC\n\ +_08043BBC:\n\ + ldr r1, =gBattleMons\n\ + movs r0, 0x58\n\ + mov r2, r10\n\ + muls r2, r0\n\ + adds r1, 0x4C\n\ + adds r2, r1\n\ + movs r0, 0\n\ + b _08043BFA\n\ + .pool\n\ +_08043BD0:\n\ + ldr r1, =gBattleMons\n\ + movs r0, 0x58\n\ + mov r2, r10\n\ + muls r2, r0\n\ + adds r1, 0x50\n\ + adds r2, r1\n\ + ldr r0, [r2]\n\ + movs r1, 0x8\n\ + negs r1, r1\n\ + b _08043BF8\n\ + .pool\n\ +_08043BE8:\n\ + ldr r1, =gBattleMons\n\ + movs r0, 0x58\n\ + mov r2, r10\n\ + muls r2, r0\n\ + adds r1, 0x50\n\ + adds r2, r1\n\ + ldr r0, [r2]\n\ + ldr r1, =0xfff0ffff\n\ +_08043BF8:\n\ + ands r0, r1\n\ +_08043BFA:\n\ + str r0, [r2]\n\ +_08043BFC:\n\ + bl b_movescr_stack_push_cursor\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =gUnknown_082DB68C\n\ + str r0, [r1]\n\ + ldr r0, =gBattleScripting\n\ + mov r1, r10\n\ + strb r1, [r0, 0x17]\n\ + ldr r4, =gActiveBank\n\ + strb r1, [r4]\n\ + ldrb r1, [r4]\n\ + movs r0, 0x58\n\ + muls r0, r1\n\ + ldr r1, =gBattleMons + 0x4C\n\ + adds r0, r1\n\ + str r0, [sp]\n\ + movs r0, 0\n\ + movs r1, 0x28\n\ + movs r2, 0\n\ + movs r3, 0x4\n\ + bl EmitSetAttributes\n\ + ldrb r0, [r4]\n\ + bl MarkBufferBankForExecution\n\ + bl _0804443A\n\ + .pool\n\ +_08043C50:\n\ + mov r0, r10\n\ + adds r0, 0x1\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r10, r0\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r10, r0\n\ + bcs _08043C64\n\ + b _08043918\n\ +_08043C64:\n\ + bl _0804441E\n\ + .pool\n\ +_08043C6C:\n\ + movs r2, 0\n\ + mov r10, r2\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r10, r0\n\ + bcc _08043C7A\n\ + b _0804441E\n\ +_08043C7A:\n\ + ldr r4, =gBattleMons\n\ +_08043C7C:\n\ + movs r0, 0x58\n\ + mov r3, r10\n\ + muls r3, r0\n\ + adds r0, r3, 0\n\ + adds r0, r4\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + cmp r0, 0x3B\n\ + bne _08043CA0\n\ + mov r0, r10\n\ + bl CastformDataTypeChange\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r9, r0\n\ + cmp r0, 0\n\ + beq _08043CA0\n\ + b _080442FC\n\ +_08043CA0:\n\ + mov r0, r10\n\ + adds r0, 0x1\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r10, r0\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r10, r0\n\ + bcc _08043C7C\n\ + b _0804441E\n\ + .pool\n\ +_08043CBC:\n\ + ldrb r0, [r7]\n\ + cmp r0, 0x1C\n\ + beq _08043CC4\n\ + b _0804441E\n\ +_08043CC4:\n\ + ldr r4, =gHitMarker\n\ + ldr r1, [r4]\n\ + movs r0, 0x80\n\ + lsls r0, 7\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _08043CD4\n\ + b _0804441E\n\ +_08043CD4:\n\ + ldr r0, =0xffffbfff\n\ + ands r1, r0\n\ + str r1, [r4]\n\ + mov r5, r8\n\ + ldr r1, [r5]\n\ + adds r1, 0xB2\n\ + ldrb r2, [r1]\n\ + movs r0, 0x3F\n\ + ands r0, r2\n\ + strb r0, [r1]\n\ + ldr r0, [r5]\n\ + adds r1, r0, 0\n\ + adds r1, 0xB2\n\ + ldrb r0, [r1]\n\ + cmp r0, 0x6\n\ + bne _08043CF8\n\ + movs r0, 0x2\n\ + strb r0, [r1]\n\ +_08043CF8:\n\ + ldr r1, =gBattleCommunication\n\ + mov r2, r8\n\ + ldr r0, [r2]\n\ + adds r0, 0xB2\n\ + ldrb r0, [r0]\n\ + adds r0, 0x40\n\ + strb r0, [r1, 0x3]\n\ + ldr r1, =gBattleScripting\n\ + ldr r0, =gBankTarget\n\ + ldrb r0, [r0]\n\ + strb r0, [r1, 0x17]\n\ + bl b_movescr_stack_push_cursor\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =BattleScript_SynchronizeActivates\n\ + str r0, [r1]\n\ + ldr r0, [r4]\n\ + movs r1, 0x80\n\ + lsls r1, 6\n\ + orrs r0, r1\n\ + str r0, [r4]\n\ + b _080443D0\n\ + .pool\n\ +_08043D40:\n\ + ldrb r0, [r7]\n\ + cmp r0, 0x1C\n\ + beq _08043D48\n\ + b _0804441E\n\ +_08043D48:\n\ + ldr r4, =gHitMarker\n\ + ldr r1, [r4]\n\ + movs r0, 0x80\n\ + lsls r0, 7\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _08043D58\n\ + b _0804441E\n\ +_08043D58:\n\ + ldr r0, =0xffffbfff\n\ + ands r1, r0\n\ + str r1, [r4]\n\ + mov r3, r8\n\ + ldr r1, [r3]\n\ + adds r1, 0xB2\n\ + ldrb r2, [r1]\n\ + movs r0, 0x3F\n\ + ands r0, r2\n\ + strb r0, [r1]\n\ + ldr r0, [r3]\n\ + adds r1, r0, 0\n\ + adds r1, 0xB2\n\ + ldrb r0, [r1]\n\ + cmp r0, 0x6\n\ + bne _08043D7C\n\ + movs r0, 0x2\n\ + strb r0, [r1]\n\ +_08043D7C:\n\ + ldr r1, =gBattleCommunication\n\ + mov r3, r8\n\ + ldr r0, [r3]\n\ + adds r0, 0xB2\n\ + ldrb r0, [r0]\n\ + strb r0, [r1, 0x3]\n\ + ldr r1, =gBattleScripting\n\ + ldr r0, =gBankAttacker\n\ + ldrb r0, [r0]\n\ + strb r0, [r1, 0x17]\n\ + bl b_movescr_stack_push_cursor\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =BattleScript_SynchronizeActivates\n\ + str r0, [r1]\n\ + ldr r0, [r4]\n\ + movs r1, 0x80\n\ + lsls r1, 6\n\ + orrs r0, r1\n\ + str r0, [r4]\n\ + b _080443D0\n\ + .pool\n\ +_08043DC4:\n\ + movs r4, 0\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r1, [r0]\n\ + cmp r4, r1\n\ + blt _08043DD0\n\ + b _0804441E\n\ +_08043DD0:\n\ + ldr r0, =gBattleMons\n\ + adds r5, r1, 0\n\ + ldr r2, =gStatuses3\n\ + adds r3, r0, 0\n\ + adds r3, 0x20\n\ + movs r6, 0x80\n\ + lsls r6, 12\n\ +_08043DDE:\n\ + ldrb r1, [r3]\n\ + cmp r1, 0x16\n\ + bne _08043DEE\n\ + ldr r0, [r2]\n\ + ands r0, r6\n\ + cmp r0, 0\n\ + beq _08043DEE\n\ + b _08044324\n\ +_08043DEE:\n\ + adds r2, 0x4\n\ + adds r3, 0x58\n\ + adds r4, 0x1\n\ + cmp r4, r5\n\ + blt _08043DDE\n\ + b _0804441E\n\ + .pool\n\ +_08043E08:\n\ + movs r4, 0\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r4, r0\n\ + blt _08043E14\n\ + b _0804441E\n\ +_08043E14:\n\ + ldr r5, =gActiveBank\n\ + mov r8, r5\n\ + ldr r0, =gBattleMons\n\ + adds r0, 0x20\n\ + str r0, [sp, 0x1C]\n\ + movs r1, 0\n\ + str r1, [sp, 0x20]\n\ +_08043E22:\n\ + ldr r2, [sp, 0x1C]\n\ + ldrb r0, [r2]\n\ + cmp r0, 0x24\n\ + beq _08043E2C\n\ + b _08043FBE\n\ +_08043E2C:\n\ + ldr r0, =gStatuses3\n\ + ldr r3, [sp, 0x20]\n\ + adds r0, r3, r0\n\ + ldr r1, [r0]\n\ + movs r0, 0x80\n\ + lsls r0, 13\n\ + ands r1, r0\n\ + str r3, [sp, 0x18]\n\ + cmp r1, 0\n\ + bne _08043E42\n\ + b _08043FBE\n\ +_08043E42:\n\ + lsls r0, r4, 24\n\ + lsrs r0, 24\n\ + bl GetBankIdentity\n\ + movs r1, 0x1\n\ + adds r5, r0, 0\n\ + eors r5, r1\n\ + ands r5, r1\n\ + adds r0, r5, 0\n\ + bl GetBankByPlayerAI\n\ + lsls r0, 24\n\ + lsrs r6, r0, 24\n\ + adds r0, r5, 0x2\n\ + bl GetBankByPlayerAI\n\ + lsls r0, 24\n\ + lsrs r7, r0, 24\n\ + ldr r0, =gBattleTypeFlags\n\ + ldr r0, [r0]\n\ + movs r2, 0x1\n\ + ands r0, r2\n\ + cmp r0, 0\n\ + bne _08043E74\n\ + b _08043F84\n\ +_08043E74:\n\ + movs r1, 0x58\n\ + adds r0, r6, 0\n\ + muls r0, r1\n\ + ldr r3, =gBattleMons\n\ + adds r1, r0, r3\n\ + adds r0, r1, 0\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + cmp r0, 0\n\ + beq _08043F40\n\ + ldrh r0, [r1, 0x28]\n\ + cmp r0, 0\n\ + beq _08043EFC\n\ + movs r1, 0x58\n\ + adds r0, r7, 0\n\ + muls r0, r1\n\ + adds r1, r0, r3\n\ + adds r0, r1, 0\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + cmp r0, 0\n\ + beq _08043EFC\n\ + ldrh r0, [r1, 0x28]\n\ + cmp r0, 0\n\ + beq _08043EFC\n\ + str r2, [sp, 0x24]\n\ + bl Random\n\ + ldr r2, [sp, 0x24]\n\ + adds r1, r2, 0\n\ + ands r1, r0\n\ + lsls r1, 1\n\ + orrs r5, r1\n\ + adds r0, r5, 0\n\ + bl GetBankByPlayerAI\n\ + mov r2, r8\n\ + strb r0, [r2]\n\ + ldrb r0, [r2]\n\ + movs r3, 0x58\n\ + muls r0, r3\n\ + ldr r5, =gBattleMons\n\ + adds r0, r5\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + ldr r1, [sp, 0x1C]\n\ + strb r0, [r1]\n\ + ldrb r0, [r2]\n\ + muls r0, r3\n\ + adds r0, r5\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + ldr r2, =gLastUsedAbility\n\ + strb r0, [r2]\n\ + b _08043FAC\n\ + .pool\n\ +_08043EFC:\n\ + ldr r3, =gBattleMons\n\ + movs r2, 0x58\n\ + adds r0, r6, 0\n\ + muls r0, r2\n\ + adds r1, r0, r3\n\ + adds r0, r1, 0\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + cmp r0, 0\n\ + beq _08043F40\n\ + ldrh r0, [r1, 0x28]\n\ + cmp r0, 0\n\ + beq _08043F40\n\ + mov r5, r8\n\ + strb r6, [r5]\n\ + adds r1, r4, 0\n\ + muls r1, r2\n\ + adds r1, r3\n\ + ldrb r0, [r5]\n\ + muls r0, r2\n\ + adds r0, r3\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + adds r1, 0x20\n\ + strb r0, [r1]\n\ + ldrb r0, [r5]\n\ + muls r0, r2\n\ + adds r0, r3\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + b _08043FA8\n\ + .pool\n\ +_08043F40:\n\ + ldr r3, =gBattleMons\n\ + movs r2, 0x58\n\ + adds r0, r7, 0\n\ + muls r0, r2\n\ + adds r1, r0, r3\n\ + adds r0, r1, 0\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + cmp r0, 0\n\ + beq _08043FB6\n\ + ldrh r0, [r1, 0x28]\n\ + cmp r0, 0\n\ + beq _08043FB6\n\ + mov r5, r8\n\ + strb r7, [r5]\n\ + adds r1, r4, 0\n\ + muls r1, r2\n\ + adds r1, r3\n\ + ldrb r0, [r5]\n\ + muls r0, r2\n\ + adds r0, r3\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + adds r1, 0x20\n\ + strb r0, [r1]\n\ + ldrb r0, [r5]\n\ + muls r0, r2\n\ + adds r0, r3\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + b _08043FA8\n\ + .pool\n\ +_08043F84:\n\ + mov r2, r8\n\ + strb r6, [r2]\n\ + movs r3, 0x58\n\ + adds r0, r6, 0\n\ + muls r0, r3\n\ + ldr r5, =gBattleMons\n\ + adds r0, r5\n\ + adds r2, r0, 0\n\ + adds r2, 0x20\n\ + ldrb r1, [r2]\n\ + cmp r1, 0\n\ + beq _08043FB6\n\ + ldrh r0, [r0, 0x28]\n\ + cmp r0, 0\n\ + beq _08043FB6\n\ + ldr r0, [sp, 0x1C]\n\ + strb r1, [r0]\n\ + ldrb r0, [r2]\n\ +_08043FA8:\n\ + ldr r1, =gLastUsedAbility\n\ + strb r0, [r1]\n\ +_08043FAC:\n\ + mov r0, r9\n\ + adds r0, 0x1\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r9, r0\n\ +_08043FB6:\n\ + mov r2, r9\n\ + cmp r2, 0\n\ + beq _08043FBE\n\ + b _08044340\n\ +_08043FBE:\n\ + ldr r3, [sp, 0x1C]\n\ + adds r3, 0x58\n\ + str r3, [sp, 0x1C]\n\ + ldr r5, [sp, 0x20]\n\ + adds r5, 0x4\n\ + str r5, [sp, 0x20]\n\ + adds r4, 0x1\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r4, r0\n\ + bge _08043FD6\n\ + b _08043E22\n\ +_08043FD6:\n\ + b _0804441E\n\ + .pool\n\ +_08043FE4:\n\ + movs r4, 0\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r1, [r0]\n\ + cmp r4, r1\n\ + blt _08043FF0\n\ + b _0804441E\n\ +_08043FF0:\n\ + ldr r0, =gBattleMons\n\ + adds r5, r1, 0\n\ + ldr r2, =gStatuses3\n\ + adds r3, r0, 0\n\ + adds r3, 0x20\n\ + movs r6, 0x80\n\ + lsls r6, 12\n\ +_08043FFE:\n\ + ldrb r1, [r3]\n\ + cmp r1, 0x16\n\ + bne _0804400E\n\ + ldr r0, [r2]\n\ + ands r0, r6\n\ + cmp r0, 0\n\ + beq _0804400E\n\ + b _080443B4\n\ +_0804400E:\n\ + adds r2, 0x4\n\ + adds r3, 0x58\n\ + adds r4, 0x1\n\ + cmp r4, r5\n\ + blt _08043FFE\n\ + b _0804441E\n\ + .pool\n\ +_08044028:\n\ + mov r0, r10\n\ + bl GetBankSide\n\ + lsls r0, 24\n\ + lsrs r5, r0, 24\n\ + movs r4, 0\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r4, r0\n\ + blt _0804403E\n\ + b _0804441E\n\ +_0804403E:\n\ + ldr r7, =gBattleMons\n\ +_08044040:\n\ + lsls r0, r4, 24\n\ + lsrs r0, 24\n\ + bl GetBankSide\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + adds r3, r4, 0x1\n\ + cmp r0, r5\n\ + beq _0804406A\n\ + movs r0, 0x58\n\ + muls r0, r4\n\ + adds r0, r7\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + cmp r0, r6\n\ + bne _0804406A\n\ + ldr r0, =gLastUsedAbility\n\ + strb r6, [r0]\n\ + lsls r0, r3, 24\n\ + lsrs r0, 24\n\ + mov r9, r0\n\ +_0804406A:\n\ + adds r4, r3, 0\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r4, r0\n\ + blt _08044040\n\ + b _0804441E\n\ + .pool\n\ +_08044084:\n\ + mov r0, r10\n\ + bl GetBankSide\n\ + lsls r0, 24\n\ + lsrs r5, r0, 24\n\ + movs r4, 0\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r4, r0\n\ + blt _0804409A\n\ + b _0804441E\n\ +_0804409A:\n\ + ldr r7, =gBattleMons\n\ +_0804409C:\n\ + lsls r0, r4, 24\n\ + lsrs r0, 24\n\ + bl GetBankSide\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + adds r3, r4, 0x1\n\ + cmp r0, r5\n\ + bne _080440C6\n\ + movs r0, 0x58\n\ + muls r0, r4\n\ + adds r0, r7\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + cmp r0, r6\n\ + bne _080440C6\n\ + ldr r0, =gLastUsedAbility\n\ + strb r6, [r0]\n\ + lsls r0, r3, 24\n\ + lsrs r0, 24\n\ + mov r9, r0\n\ +_080440C6:\n\ + adds r4, r3, 0\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r4, r0\n\ + blt _0804409C\n\ + b _0804441E\n\ + .pool\n\ +_080440E0:\n\ + ldrb r0, [r7]\n\ + cmp r0, 0xFD\n\ + beq _08044104\n\ + cmp r0, 0xFE\n\ + beq _0804413C\n\ + movs r4, 0\n\ + ldr r0, =gNoOfAllBanks\n\ + adds r5, r0, 0\n\ + ldrb r0, [r5]\n\ + cmp r4, r0\n\ + blt _080440F8\n\ + b _0804441E\n\ +_080440F8:\n\ + ldr r2, =gBattleMons\n\ + b _08044174\n\ + .pool\n\ +_08044104:\n\ + movs r4, 0\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r4, r0\n\ + blt _08044110\n\ + b _0804441E\n\ +_08044110:\n\ + ldr r5, =gStatuses3\n\ + movs r2, 0x80\n\ + lsls r2, 9\n\ + adds r1, r0, 0\n\ +_08044118:\n\ + lsls r0, r4, 2\n\ + adds r0, r5\n\ + ldr r0, [r0]\n\ + ands r0, r2\n\ + adds r3, r4, 0x1\n\ + cmp r0, 0\n\ + beq _0804412C\n\ + lsls r0, r3, 24\n\ + lsrs r0, 24\n\ + mov r9, r0\n\ +_0804412C:\n\ + adds r4, r3, 0\n\ + cmp r4, r1\n\ + blt _08044118\n\ + b _0804441E\n\ + .pool\n\ +_0804413C:\n\ + movs r4, 0\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r4, r0\n\ + blt _08044148\n\ + b _0804441E\n\ +_08044148:\n\ + ldr r5, =gStatuses3\n\ + movs r2, 0x80\n\ + lsls r2, 10\n\ + adds r1, r0, 0\n\ +_08044150:\n\ + lsls r0, r4, 2\n\ + adds r0, r5\n\ + ldr r0, [r0]\n\ + ands r0, r2\n\ + adds r3, r4, 0x1\n\ + cmp r0, 0\n\ + beq _08044164\n\ + lsls r0, r3, 24\n\ + lsrs r0, 24\n\ + mov r9, r0\n\ +_08044164:\n\ + adds r4, r3, 0\n\ + cmp r4, r1\n\ + blt _08044150\n\ + b _0804441E\n\ + .pool\n\ +_08044174:\n\ + movs r0, 0x58\n\ + muls r0, r4\n\ + adds r0, r2\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + adds r3, r4, 0x1\n\ + cmp r0, r6\n\ + bne _0804418C\n\ + strb r6, [r7]\n\ + lsls r0, r3, 24\n\ + lsrs r0, 24\n\ + mov r9, r0\n\ +_0804418C:\n\ + adds r4, r3, 0\n\ + ldrb r1, [r5]\n\ + cmp r4, r1\n\ + blt _08044174\n\ + b _0804441E\n\ +_08044196:\n\ + movs r4, 0\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r4, r0\n\ + blt _080441A2\n\ + b _0804441E\n\ +_080441A2:\n\ + ldr r2, =gBattleMons\n\ + mov r8, r2\n\ + adds r2, r0, 0\n\ + movs r5, 0x58\n\ +_080441AA:\n\ + adds r0, r4, 0\n\ + muls r0, r5\n\ + mov r3, r8\n\ + adds r1, r0, r3\n\ + adds r0, r1, 0\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + adds r3, r4, 0x1\n\ + cmp r0, r6\n\ + bne _080441CC\n\ + ldrh r0, [r1, 0x28]\n\ + cmp r0, 0\n\ + beq _080441CC\n\ + strb r6, [r7]\n\ + lsls r0, r3, 24\n\ + lsrs r0, 24\n\ + mov r9, r0\n\ +_080441CC:\n\ + adds r4, r3, 0\n\ + cmp r4, r2\n\ + blt _080441AA\n\ + b _0804441E\n\ + .pool\n\ +_080441DC:\n\ + movs r4, 0\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r4, r0\n\ + blt _080441E8\n\ + b _0804441E\n\ +_080441E8:\n\ + ldr r7, =gBattleMons\n\ + adds r1, r0, 0\n\ + movs r5, 0x58\n\ + ldr r2, =gLastUsedAbility\n\ +_080441F0:\n\ + adds r0, r4, 0\n\ + muls r0, r5\n\ + adds r0, r7\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + adds r3, r4, 0x1\n\ + cmp r0, r6\n\ + bne _0804420C\n\ + cmp r4, r10\n\ + beq _0804420C\n\ + strb r6, [r2]\n\ + lsls r0, r3, 24\n\ + lsrs r0, 24\n\ + mov r9, r0\n\ +_0804420C:\n\ + adds r4, r3, 0\n\ + cmp r4, r1\n\ + blt _080441F0\n\ + b _0804441E\n\ + .pool\n\ +_08044220:\n\ + mov r0, r10\n\ + bl GetBankSide\n\ + lsls r0, 24\n\ + lsrs r5, r0, 24\n\ + movs r4, 0\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r4, r0\n\ + blt _08044236\n\ + b _0804441E\n\ +_08044236:\n\ + ldr r7, =gBattleMons\n\ +_08044238:\n\ + lsls r0, r4, 24\n\ + lsrs r0, 24\n\ + bl GetBankSide\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + cmp r0, r5\n\ + beq _08044264\n\ + movs r0, 0x58\n\ + muls r0, r4\n\ + adds r0, r7\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + cmp r0, r6\n\ + bne _08044264\n\ + ldr r0, =gLastUsedAbility\n\ + strb r6, [r0]\n\ + mov r0, r9\n\ + adds r0, 0x1\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r9, r0\n\ +_08044264:\n\ + adds r4, 0x1\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r4, r0\n\ + blt _08044238\n\ + b _0804441E\n\ + .pool\n\ +_0804427C:\n\ + mov r0, r10\n\ + bl GetBankSide\n\ + lsls r0, 24\n\ + lsrs r5, r0, 24\n\ + movs r4, 0\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r4, r0\n\ + blt _08044292\n\ + b _0804441E\n\ +_08044292:\n\ + ldr r7, =gBattleMons\n\ +_08044294:\n\ + lsls r0, r4, 24\n\ + lsrs r0, 24\n\ + bl GetBankSide\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + cmp r0, r5\n\ + bne _080442C0\n\ + movs r0, 0x58\n\ + muls r0, r4\n\ + adds r0, r7\n\ + adds r0, 0x20\n\ + ldrb r0, [r0]\n\ + cmp r0, r6\n\ + bne _080442C0\n\ + ldr r0, =gLastUsedAbility\n\ + strb r6, [r0]\n\ + mov r0, r9\n\ + adds r0, 0x1\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r9, r0\n\ +_080442C0:\n\ + adds r4, 0x1\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r0, [r0]\n\ + cmp r4, r0\n\ + blt _08044294\n\ + b _0804441E\n\ + .pool\n\ +_080442D8:\n\ + ldr r0, =BattleScript_CastformChange\n\ + bl b_push_move_exec\n\ + ldr r0, =gBattleScripting\n\ + strb r6, [r0, 0x17]\n\ +_080442E2:\n\ + ldr r0, =gBattleStruct\n\ + ldr r0, [r0]\n\ + adds r0, 0x7F\n\ + mov r1, r9\n\ + subs r1, 0x1\n\ + strb r1, [r0]\n\ + b _0804441E\n\ + .pool\n\ +_080442FC:\n\ + ldr r0, =BattleScript_CastformChange\n\ + bl b_push_move_exec\n\ + ldr r0, =gBattleScripting\n\ + mov r5, r10\n\ + strb r5, [r0, 0x17]\n\ + ldr r0, =gBattleStruct\n\ + ldr r0, [r0]\n\ + adds r0, 0x7F\n\ + mov r1, r9\n\ + subs r1, 0x1\n\ + strb r1, [r0]\n\ + b _0804443A\n\ + .pool\n\ +_08044324:\n\ + strb r1, [r7]\n\ + ldr r0, [r2]\n\ + ldr r1, =0xfff7ffff\n\ + ands r0, r1\n\ + str r0, [r2]\n\ + ldr r0, =gUnknown_082DB4B8\n\ + bl b_push_move_exec\n\ + b _080443C8\n\ + .pool\n\ +_08044340:\n\ + ldr r0, =BattleScript_TraceActivates\n\ + bl b_push_move_exec\n\ + ldr r1, =gStatuses3\n\ + ldr r0, [sp, 0x18]\n\ + adds r1, r0, r1\n\ + ldr r0, [r1]\n\ + ldr r2, =0xffefffff\n\ + ands r0, r2\n\ + str r0, [r1]\n\ + ldr r0, =gBattleScripting\n\ + strb r4, [r0, 0x17]\n\ + ldr r1, =gBattleTextBuff1\n\ + movs r4, 0xFD\n\ + strb r4, [r1]\n\ + movs r0, 0x4\n\ + strb r0, [r1, 0x1]\n\ + ldr r2, =gActiveBank\n\ + ldrb r0, [r2]\n\ + strb r0, [r1, 0x2]\n\ + ldr r3, =gBattlePartyID\n\ + ldrb r0, [r2]\n\ + lsls r0, 1\n\ + adds r0, r3\n\ + ldrh r0, [r0]\n\ + strb r0, [r1, 0x3]\n\ + movs r0, 0xFF\n\ + strb r0, [r1, 0x4]\n\ + ldr r1, =gBattleTextBuff2\n\ + strb r4, [r1]\n\ + movs r0, 0x9\n\ + strb r0, [r1, 0x1]\n\ + ldr r0, =gLastUsedAbility\n\ + ldrb r0, [r0]\n\ + strb r0, [r1, 0x2]\n\ + movs r0, 0x1\n\ + negs r0, r0\n\ + strb r0, [r1, 0x3]\n\ + b _0804441E\n\ + .pool\n\ +_080443B4:\n\ + strb r1, [r7]\n\ + ldr r0, [r2]\n\ + ldr r1, =0xfff7ffff\n\ + ands r0, r1\n\ + str r0, [r2]\n\ + bl b_movescr_stack_push_cursor\n\ + ldr r1, =gBattlescriptCurrInstr\n\ + ldr r0, =gUnknown_082DB4C1\n\ + str r0, [r1]\n\ +_080443C8:\n\ + ldr r0, =gBattleStruct\n\ + ldr r0, [r0]\n\ + adds r0, 0xD8\n\ + strb r4, [r0]\n\ +_080443D0:\n\ + mov r0, r9\n\ + adds r0, 0x1\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r9, r0\n\ + b _0804441E\n\ + .pool\n\ +_080443EC:\n\ + movs r4, 0\n\ + ldr r0, =gNoOfAllBanks\n\ + ldrb r1, [r0]\n\ + cmp r4, r1\n\ + bge _0804441E\n\ + ldr r0, =gBattleMons\n\ + adds r2, r1, 0\n\ + adds r1, r0, 0\n\ + adds r1, 0x20\n\ + ldr r3, =gLastUsedAbility\n\ +_08044400:\n\ + ldrb r0, [r1]\n\ + cmp r0, r6\n\ + bne _08044416\n\ + cmp r4, r10\n\ + beq _08044416\n\ + strb r6, [r3]\n\ + mov r0, r9\n\ + adds r0, 0x1\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r9, r0\n\ +_08044416:\n\ + adds r1, 0x58\n\ + adds r4, 0x1\n\ + cmp r4, r2\n\ + blt _08044400\n\ +_0804441E:\n\ + mov r1, r9\n\ + cmp r1, 0\n\ + beq _0804443A\n\ +_08044424:\n\ + ldr r2, [sp, 0x4]\n\ + cmp r2, 0xB\n\ + bhi _0804443A\n\ + ldr r1, =gLastUsedAbility\n\ + ldrb r0, [r1]\n\ + cmp r0, 0xFF\n\ + beq _0804443A\n\ + adds r1, r0, 0\n\ + mov r0, r10\n\ + bl RecordAbilityBattle\n\ +_0804443A:\n\ + mov r0, r9\n\ + add sp, 0x28\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r1}\n\ + bx r1\n\ + .pool\n\ + .syntax divided"); +} +#endif // NONMATCHING