Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .thumb
- @in this example, pirouette form is 0xF1, and aria is 0xF0
- @i used the decrypting thing that Doesnt posted so that's why i'm not calling the
- @decrypting function or encrypting function.
- check_pkmn_id:
- push {lr}
- ldr r0, attacking_bank
- ldrb r1, [r0] @which mon did the attack
- ldr r0, ram_pointer
- ldr r0, [r0]
- add r0, r0, #0x60
- cmp r1, #0x0
- beq set_player_singles
- cmp r1, #0x1
- beq set_enemy_singles
- cmp r1, #0x2
- beq set_player_doubles
- cmp r1, #0x3
- beq set_enemy_doubles
- get_battle_struct:
- ldr r0, attacking_bank
- ldrb r1, [r0] @which mon did the attack
- mov r0, #0x58 @length of battle structs
- mul r1, r0, r1 @multiplies length of battle structs with which mon did the attack to get the the battle structure i'm working with
- ldr r0, battle_struct
- add r0, r1, r0 @r0 is the battle struct i'm working with
- check_if_aria:
- add r2, r2, #0x20
- ldrh r1, [r2]
- cmp r1, #0xF0
- bne end
- sub r2, r2, #0x20
- set_pirouette_forme:
- mov r1, #0xF1
- strh r1, [r0] @species in battle struct is now the correct thing
- strh r1, [r2] @species in party is now pirouette's
- push {r0}
- mov r0, r2
- mov r1, r2
- push {r2}
- ldr r3, calc_stats
- bl jump @stats should be calculated
- pop {r2}
- pop {r0} @r2 is the beginning of the party slot, r0 is the beginning of the battle struct
- update_type:
- add r0, #0x22
- mov r1, #0x1
- strb r1, [r0] @second type in battle struct is now fighting
- update_battl_struct:
- sub r0, r0, #0x20
- add r2, r2, #0x5A @r0 is at the attack stat, r2 is at the party attack stat
- mov r3, #0x0
- stat_loop:
- ldrh r1, [r2]
- strh r1, [r0]
- add r0, r0, #0x2
- add r2, r2, #0x2
- add r3, r3, #0x1
- cmp r3, #0x4
- bne stat_loop
- end:
- pop {pc}
- jump:
- mov pc, r3
- set_player_singles:
- ldrb r0, [r0]
- lsr r0, #0x4 @only one digit is left
- mov r1, #0x64 @length of party entry
- ldr r2, player_party
- mul r0, r0, r1
- add r2, r0, r2 @gets r2 to the correct slot
- b get_battle_struct
- set_enemy_singles:
- add r0, r0, #0x3 @gets to party order for enemy
- ldrb r0, [r0]
- lsr r0, #0x4
- mov r1, #0x64
- ldr r2, enemy_party
- mul r0, r0, r1
- add r2, r0, r2
- b get_battle_struct
- set_player_doubles:
- ldrb r0, [r0]
- lsl r0, #0x1C
- lsr r0, #0x1C @gets the second pokemon's location
- mov r1, #0x64
- ldr r2, player_party
- mul r0, r0, r1
- add r2, r0, r2
- b get_battle_struct
- set_enemy_doubles:
- add r0, r0, #0x3
- ldrb r0, [r0]
- lsl r0, #0x1C
- lsr r0, #0x1C
- mov r1, #0x64
- ldr r2, enemy_party
- mul r0, r0, r1
- add r2, r0, r2
- b get_battle_struct
- .align 2
- battle_struct: .word 0x02023BE4
- player_party: .word 0x02024284
- enemy_party: .word 0x0202402C
- order_pointer: .word 0x02023FE8
- attacking_bank: .word 0x02023D6B
- calc_stats: .word 0x0803E47C
- ram_pointer: .word 0x02023FE8
- Battle script
- #org 0x71A2C8
- setbyte 0x2023E85 0x1 // 0x871A2C8
- jumpifhalfword 0x1 0x2023D4A 0x39 0x871A2F6 // 0x871A2CE
- jumpifspecialstatusflag 0x0 0x400C0 0x1 0x871A2F6 // 0x871A2DA
- orword 0x2023DD0 0x400C0 // 0x871A2E5
- setbyte 0x2023FD2 0x2 // 0x871A2EE
- @there's two bytes of FF here, dunno if that's correct or not
- #org 0x71A2F6
- attackcanceler // 0x871A2F6
- accuracycheck 0x81D695E 0x0 // 0x871A2F7
- attackstring // 0x871A2FE
- ppreduce // 0x871A2FF
- critcalc // 0x871A300
- cmd5 // 0x871A301
- cmd6 // 0x871A302
- cmd7 // 0x871A303
- attackanimation // 0x871A304
- waitanimation // 0x871A305
- missmessage // 0x871A306
- cmd5c 0x0 // 0x871A307
- waitstate // 0x871A309
- graphicalhpupdate 0x0 // 0x871A30A
- datahpupdate 0x0 // 0x871A30C
- critmessage // 0x871A30E
- waitmessage 0x40 // 0x871A30F
- seteffectwithchancetarget // 0x871A312
- faintpokemon 0x0 0x0 0x0 // 0x871A313
- callasm 0x8171A331 @where the asm is + 1
- setbyte 0x2023FD8 0x0
- cmd49 0x0 0x0
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement