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
- 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
- sub r2, r2, #0x20 @makes r2 go to the beginning of the party again
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement