Skip to content

Commit

Permalink
Dump battle scripts to ASM-macro definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
lhearachel committed Jan 24, 2024
1 parent f46a747 commit 13e7b34
Show file tree
Hide file tree
Showing 1,075 changed files with 13,421 additions and 0 deletions.
8 changes: 8 additions & 0 deletions res/battle/scripts/effects/effect_script_0000.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.include "macros/btlcmd.inc"

.data

_000:
CalcCrit
CalcDamage
End
7 changes: 7 additions & 0 deletions res/battle/scripts/effects/effect_script_0001.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_DIRECT, MOVE_SIDE_EFFECT_TO_DEFENDER|MOVE_SUBSCRIPT_PTR_SLEEP
End
9 changes: 9 additions & 0 deletions res/battle/scripts/effects/effect_script_0002.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_INDIRECT, MOVE_SIDE_EFFECT_TO_DEFENDER|MOVE_SUBSCRIPT_PTR_POISON
CalcCrit
CalcDamage
End
9 changes: 9 additions & 0 deletions res/battle/scripts/effects/effect_script_0003.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_INDIRECT, MOVE_SIDE_EFFECT_ON_HIT|MOVE_SUBSCRIPT_PTR_DRAIN_HALF_DAMAGE_DEALT
CalcCrit
CalcDamage
End
9 changes: 9 additions & 0 deletions res/battle/scripts/effects/effect_script_0004.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_INDIRECT, MOVE_SIDE_EFFECT_TO_DEFENDER|MOVE_SUBSCRIPT_PTR_BURN
CalcCrit
CalcDamage
End
9 changes: 9 additions & 0 deletions res/battle/scripts/effects/effect_script_0005.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_INDIRECT, MOVE_SIDE_EFFECT_TO_DEFENDER|MOVE_SUBSCRIPT_PTR_FREEZE
CalcCrit
CalcDamage
End
9 changes: 9 additions & 0 deletions res/battle/scripts/effects/effect_script_0006.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_INDIRECT, MOVE_SIDE_EFFECT_TO_DEFENDER|MOVE_SUBSCRIPT_PTR_PARALYZE
CalcCrit
CalcDamage
End
32 changes: 32 additions & 0 deletions res/battle/scripts/effects/effect_script_0007.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.include "macros/btlcmd.inc"

.data

_000:
CheckIgnorableAbility CHECK_HAVE, BTLSCR_ALL_BATTLERS, ABILITY_DAMP, _038
CompareVarToValue OPCODE_FLAG_SET, BTLVAR_BATTLE_CTX_STATUS, SYSCTL_MON_SELFDESTRUCTED, _035
UpdateVar OPCODE_SET, BTLVAR_CALC_TEMP, 0x10000000
UpdateVarFromVar OPCODE_LEFT_SHIFT, BTLVAR_CALC_TEMP, BTLVAR_ATTACKER
UpdateVarFromVar OPCODE_FLAG_ON, BTLVAR_BATTLE_CTX_STATUS, BTLVAR_CALC_TEMP
UpdateMonData OPCODE_SET, BTLSCR_ATTACKER, BATTLEMON_CUR_HP, 0
UpdateVar OPCODE_SET, BTLVAR_HP_CALC_TEMP, 32767
UpdateHealthBar BTLSCR_ATTACKER
Wait
Call BATTLE_SUBSCRIPT_ATTACK_MESSAGE_AND_ANIMATION

_035:
CalcCrit
CalcDamage
End

_038:
PrintAttackMessage
Wait
WaitButtonABTime 30
// {0}’s {1} prevents {2} from using {3}!
PrintMessage pl_msg_00000368_00628, TAG_NICKNAME_ABILITY_NICKNAME_MOVE, BTLSCR_ABILITY_MON, BTLSCR_ABILITY_MON, BTLSCR_ATTACKER, BTLSCR_ATTACKER
Wait
WaitButtonABTime 30
UpdateVar OPCODE_FLAG_ON, BTLVAR_BATTLE_CTX_STATUS, SYSCTL_CHECK_LOOP_ONLY_ONCE
UpdateVar OPCODE_FLAG_ON, BTLVAR_MOVE_STATUS_FLAGS, MOVE_STATUS_NO_MORE_WORK
End
22 changes: 22 additions & 0 deletions res/battle/scripts/effects/effect_script_0008.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.include "macros/btlcmd.inc"

.data

_000:
CheckSubstitute BTLSCR_DEFENDER, _015
CompareMonDataToValue OPCODE_FLAG_NOT, BTLSCR_DEFENDER, BATTLEMON_STATUS, MON_CONDITION_SLEEP, _015
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_INDIRECT, MOVE_SIDE_EFFECT_ON_HIT|MOVE_SUBSCRIPT_PTR_DREAM_EATER
CalcCrit
CalcDamage
End

_015:
PrintAttackMessage
Wait
WaitButtonABTime 30
// {0} wasn’t affected!
PrintMessage pl_msg_00000368_00060, TAG_NICKNAME, BTLSCR_DEFENDER
Wait
WaitButtonABTime 30
UpdateVar OPCODE_FLAG_ON, BTLVAR_MOVE_STATUS_FLAGS, MOVE_STATUS_NO_MORE_WORK
End
15 changes: 15 additions & 0 deletions res/battle/scripts/effects/effect_script_0009.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.include "macros/btlcmd.inc"

.data

_000:
PrintAttackMessage
Wait
WaitButtonABTime 30
SetMirrorMove
// Mirror Move failed!
PrintMessage pl_msg_00000368_00798, TAG_NONE
Wait
WaitButtonABTime 30
UpdateVar OPCODE_FLAG_ON, BTLVAR_MOVE_STATUS_FLAGS, MOVE_STATUS_NO_MORE_WORK
End
7 changes: 7 additions & 0 deletions res/battle/scripts/effects/effect_script_0010.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_DIRECT, MOVE_SIDE_EFFECT_TO_ATTACKER|MOVE_SUBSCRIPT_PTR_ATTACK_UP_1_STAGE
End
7 changes: 7 additions & 0 deletions res/battle/scripts/effects/effect_script_0011.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_DIRECT, MOVE_SIDE_EFFECT_TO_ATTACKER|MOVE_SUBSCRIPT_PTR_DEFENSE_UP_1_STAGE
End
8 changes: 8 additions & 0 deletions res/battle/scripts/effects/effect_script_0012.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.include "macros/btlcmd.inc"

.data

_000:
CalcCrit
CalcDamage
End
7 changes: 7 additions & 0 deletions res/battle/scripts/effects/effect_script_0013.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_DIRECT, MOVE_SIDE_EFFECT_TO_ATTACKER|MOVE_SUBSCRIPT_PTR_SP_ATTACK_UP_1_STAGE
End
8 changes: 8 additions & 0 deletions res/battle/scripts/effects/effect_script_0014.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.include "macros/btlcmd.inc"

.data

_000:
CalcCrit
CalcDamage
End
8 changes: 8 additions & 0 deletions res/battle/scripts/effects/effect_script_0015.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.include "macros/btlcmd.inc"

.data

_000:
CalcCrit
CalcDamage
End
7 changes: 7 additions & 0 deletions res/battle/scripts/effects/effect_script_0016.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_DIRECT, MOVE_SIDE_EFFECT_TO_ATTACKER|MOVE_SUBSCRIPT_PTR_EVASION_UP_1_STAGE
End
8 changes: 8 additions & 0 deletions res/battle/scripts/effects/effect_script_0017.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.include "macros/btlcmd.inc"

.data

_000:
CalcCrit
CalcDamage
End
7 changes: 7 additions & 0 deletions res/battle/scripts/effects/effect_script_0018.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_DIRECT, MOVE_SIDE_EFFECT_TO_DEFENDER|MOVE_SUBSCRIPT_PTR_ATTACK_DOWN_1_STAGE
End
7 changes: 7 additions & 0 deletions res/battle/scripts/effects/effect_script_0019.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_DIRECT, MOVE_SIDE_EFFECT_TO_DEFENDER|MOVE_SUBSCRIPT_PTR_DEFENSE_DOWN_1_STAGE
End
7 changes: 7 additions & 0 deletions res/battle/scripts/effects/effect_script_0020.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_DIRECT, MOVE_SIDE_EFFECT_TO_DEFENDER|MOVE_SUBSCRIPT_PTR_SPEED_DOWN_1_STAGE
End
8 changes: 8 additions & 0 deletions res/battle/scripts/effects/effect_script_0021.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.include "macros/btlcmd.inc"

.data

_000:
CalcCrit
CalcDamage
End
8 changes: 8 additions & 0 deletions res/battle/scripts/effects/effect_script_0022.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.include "macros/btlcmd.inc"

.data

_000:
CalcCrit
CalcDamage
End
7 changes: 7 additions & 0 deletions res/battle/scripts/effects/effect_script_0023.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_DIRECT, MOVE_SIDE_EFFECT_TO_DEFENDER|MOVE_SUBSCRIPT_PTR_ACCURACY_DOWN_1_STAGE
End
7 changes: 7 additions & 0 deletions res/battle/scripts/effects/effect_script_0024.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_DIRECT, MOVE_SIDE_EFFECT_TO_DEFENDER|MOVE_SUBSCRIPT_PTR_EVASION_DOWN_1_STAGE
End
7 changes: 7 additions & 0 deletions res/battle/scripts/effects/effect_script_0025.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_INDIRECT, MOVE_SIDE_EFFECT_ON_HIT|MOVE_SUBSCRIPT_PTR_RESET_ALL_STAT_STAGES
End
13 changes: 13 additions & 0 deletions res/battle/scripts/effects/effect_script_0026.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.include "macros/btlcmd.inc"

.data

_000:
CompareMonDataToValue OPCODE_FLAG_SET, BTLSCR_ATTACKER, BATTLEMON_VOLATILE_STATUS, VOLATILE_CONDITION_MOVE_LOCKED, _015
CompareVarToValue OPCODE_FLAG_SET, BTLVAR_BATTLE_CTX_STATUS, SYSCTL_LAST_OF_MULTI_TURN, _015
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_DIRECT, MOVE_SIDE_EFFECT_TO_ATTACKER|MOVE_SUBSCRIPT_PTR_BIDE_START
End

_015:
UpdateVar OPCODE_FLAG_ON, BTLVAR_BATTLE_CTX_STATUS, SYSCTL_SKIP_ATTACK_MESSAGE
End
12 changes: 12 additions & 0 deletions res/battle/scripts/effects/effect_script_0027.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.include "macros/btlcmd.inc"

.data

_000:
CompareMonDataToValue OPCODE_FLAG_SET, BTLSCR_ATTACKER, BATTLEMON_VOLATILE_STATUS, VOLATILE_CONDITION_THRASH, _009
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_INDIRECT, MOVE_SIDE_EFFECT_ON_HIT|MOVE_SUBSCRIPT_PTR_THRASH

_009:
CalcCrit
CalcDamage
End
7 changes: 7 additions & 0 deletions res/battle/scripts/effects/effect_script_0028.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_DIRECT, MOVE_SIDE_EFFECT_ON_HIT|MOVE_SUBSCRIPT_PTR_FORCE_TARGET_TO_SWITCH_OR_FLEE
End
10 changes: 10 additions & 0 deletions res/battle/scripts/effects/effect_script_0029.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.include "macros/btlcmd.inc"

.data

_000:
SetMultiHit 0, SYSCTL_MULTI_HIT_MOVE
UpdateVar OPCODE_SET, BTLVAR_AFTER_MOVE_MESSAGE_TYPE, AFTER_MOVE_MESSAGE_MULTI_HIT
CalcCrit
CalcDamage
End
7 changes: 7 additions & 0 deletions res/battle/scripts/effects/effect_script_0030.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_DIRECT, MOVE_SIDE_EFFECT_ON_HIT|MOVE_SUBSCRIPT_PTR_CONVERSION
End
9 changes: 9 additions & 0 deletions res/battle/scripts/effects/effect_script_0031.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_INDIRECT, MOVE_SIDE_EFFECT_TO_DEFENDER|MOVE_SUBSCRIPT_PTR_FLINCH
CalcCrit
CalcDamage
End
7 changes: 7 additions & 0 deletions res/battle/scripts/effects/effect_script_0032.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_DIRECT, MOVE_SIDE_EFFECT_ON_HIT|MOVE_SUBSCRIPT_PTR_RECOVER_HALF_MAX_HP
End
7 changes: 7 additions & 0 deletions res/battle/scripts/effects/effect_script_0033.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_DIRECT, MOVE_SIDE_EFFECT_TO_DEFENDER|MOVE_SUBSCRIPT_PTR_BADLY_POISON
End
9 changes: 9 additions & 0 deletions res/battle/scripts/effects/effect_script_0034.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_INDIRECT, MOVE_SIDE_EFFECT_CHECK_SUBSTITUTE|MOVE_SIDE_EFFECT_TO_DEFENDER|MOVE_SUBSCRIPT_PTR_PAY_DAY
CalcCrit
CalcDamage
End
7 changes: 7 additions & 0 deletions res/battle/scripts/effects/effect_script_0035.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_DIRECT, MOVE_SIDE_EFFECT_ON_HIT|MOVE_SUBSCRIPT_PTR_LIGHT_SCREEN
End
11 changes: 11 additions & 0 deletions res/battle/scripts/effects/effect_script_0036.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.include "macros/btlcmd.inc"

.data

_000:
Random 2, 3
UpdateVar OPCODE_ADD, BTLVAR_CALC_TEMP, 0x80000000
UpdateVarFromVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_INDIRECT, BTLVAR_CALC_TEMP
CalcCrit
CalcDamage
End
7 changes: 7 additions & 0 deletions res/battle/scripts/effects/effect_script_0037.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.include "macros/btlcmd.inc"

.data

_000:
UpdateVar OPCODE_SET, BTLVAR_SIDE_EFFECT_FLAGS_DIRECT, MOVE_SIDE_EFFECT_ON_HIT|MOVE_SUBSCRIPT_PTR_REST
End
7 changes: 7 additions & 0 deletions res/battle/scripts/effects/effect_script_0038.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.include "macros/btlcmd.inc"

.data

_000:
TryOHKOMove
End
Loading

0 comments on commit 13e7b34

Please sign in to comment.