#include <battle_script.h>
#include <constants/moves.h>

.align 2
.thumb
.text

.global bs_metal_burst_counter
bs_metal_burst_counter:
    jumpifhalfword 0x0 0x02023D4A MOVE_COUNTER 0x081D7433
    attackcanceler
    counterdamagecalculator try_mirror_coat
    accuracycheck 0x81D695E 0x0
    attackstring
    ppreduce
    damagecalc2
    cmd69
    callasm metal_burst_dmg_reduction+1
    goto 0x81D6934

try_mirror_coat:
    mirrorcoatdamagecalculator 0x081D7DF0
    accuracycheck 0x81D695E 0x0
    attackstring
    ppreduce
    damagecalc2
    cmd69
    callasm metal_burst_dmg_reduction+1
    goto 0x81D6934

.align 2
.global as_metal_burst
as_metal_burst:
.byte 0x00, 0x14, 0x28, 0x0A, 0x03, 0x2A, 0x01, 0x03, 0x1D, 0x8B, 0x09, 0x08, 0x02, 0x05, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x0E, 0x16, 0x36, 0x1D, 0x08, 0x0E, 0x16, 0x36, 0x1D, 0x08, 0x0E, 0x16, 0x36, 0x1D, 0x08, 0x0E, 0x16, 0x36, 0x1D, 0x08
.byte 0x05, 0x0B, 0x03, 0x04, 0x00, 0x05, 0x00, 0xD6, 0x27, 0x19, 0xAA, 0x00, 0x3F, 0x04, 0x03, 0x02, 0x94, 0x3F, 0x3E, 0x08, 0x84, 0x04, 0xF0, 0xFF, 0xF1, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x19, 0xAA, 0x00, 0x3F, 0x04, 0x03, 0x02, 0x94, 0x3F, 0x3E, 0x08, 0x84, 0x04, 0x10, 0x00, 0xFB
.byte 0xFF, 0x01, 0x00, 0x00, 0x00, 0x19, 0xAA, 0x00, 0x3F, 0x04, 0x03, 0x02, 0x94, 0x3F, 0x3E, 0x08, 0x84, 0x04, 0xF4, 0xFF, 0x12, 0x00, 0x01, 0x00, 0x00, 0x00, 0x19, 0xAA, 0x00, 0x3F, 0x04, 0x03, 0x02, 0x94, 0x3F, 0x3E, 0x08, 0x84, 0x04, 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00
.byte 0x00, 0x19, 0xAA, 0x00, 0x3F, 0x04, 0x03, 0x05, 0x08
