summaryrefslogtreecommitdiff
path: root/macros/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'macros/scripts')
-rw-r--r--macros/scripts/battle_anims.asm4
-rw-r--r--macros/scripts/battle_commands.asm13
-rw-r--r--macros/scripts/events.asm136
-rw-r--r--macros/scripts/gfx_anims.asm2
-rw-r--r--macros/scripts/maps.asm43
-rw-r--r--macros/scripts/movement.asm2
-rw-r--r--macros/scripts/text.asm8
-rw-r--r--macros/scripts/trade_anims.asm15
8 files changed, 107 insertions, 116 deletions
diff --git a/macros/scripts/battle_anims.asm b/macros/scripts/battle_anims.asm
index 5c7aabed3..f25b6da22 100644
--- a/macros/scripts/battle_anims.asm
+++ b/macros/scripts/battle_anims.asm
@@ -1,6 +1,6 @@
anim_wait: MACRO
if \1 >= $d0
- flip out
+ fail "anim_wait argument must be less than $d0."
endc
db \1
ENDM
@@ -295,7 +295,7 @@ anim_call: MACRO
dw \1 ; address
ENDM
- enum anim_ret_command ; $ff
+anim_ret_command EQU -1 ; $ff
anim_ret: MACRO
db anim_ret_command
ENDM
diff --git a/macros/scripts/battle_commands.asm b/macros/scripts/battle_commands.asm
index 4ae8dbaf4..48e034bdf 100644
--- a/macros/scripts/battle_commands.asm
+++ b/macros/scripts/battle_commands.asm
@@ -15,10 +15,10 @@ ENDM
command damagevariation ; 08
command checkhit ; 09
command lowersub ; 0a
- command hittargetnosub ; 0b
+ command moveanimnosub ; 0b
command raisesub ; 0c
command failuretext ; 0d
- command checkfaint ; 0e
+ command applydamage ; 0e
command criticaltext ; 0f
command supereffectivetext ; 10
command checkdestinybond ; 11
@@ -169,19 +169,18 @@ ENDM
command ragedamage ; a2
command resettypematchup ; a3
command allstatsup ; a4
- command effect0xa5 ; a5
+ command bidefailtext ; a5
command raisesubnoanim ; a6
command lowersubnoanim ; a7
- command effect0xa8 ; a8
+ command beatupfailtext ; a8
command clearmissdamage ; a9
command movedelay ; aa
- command hittarget ; ab
+ command moveanim ; ab
command tristatuschance ; ac
command supereffectivelooptext ; ad
command startloop ; ae
command curl ; af
-__enum__ set $fe
-
+ enum_start $fe
command endturn ; fe
command endmove ; ff
diff --git a/macros/scripts/events.asm b/macros/scripts/events.asm
index 9bca1c004..a8f6c2015 100644
--- a/macros/scripts/events.asm
+++ b/macros/scripts/events.asm
@@ -1,4 +1,4 @@
-; ScriptCommandTable indexes (see engine/scripting.asm)
+; ScriptCommandTable indexes (see engine/overworld/scripting.asm)
enum_start
enum scall_command ; $00
@@ -37,16 +37,16 @@ ptjump: MACRO
dw \1 ; pointer
ENDM
- enum if_equal_command ; $06
-if_equal: MACRO
- db if_equal_command
+ enum ifequal_command ; $06
+ifequal: MACRO
+ db ifequal_command
db \1 ; byte
dw \2 ; pointer
ENDM
- enum if_not_equal_command ; $07
-if_not_equal: MACRO
- db if_not_equal_command
+ enum ifnotequal_command ; $07
+ifnotequal: MACRO
+ db ifnotequal_command
db \1 ; byte
dw \2 ; pointer
ENDM
@@ -63,16 +63,16 @@ iftrue: MACRO
dw \1 ; pointer
ENDM
- enum if_greater_than_command ; $0a
-if_greater_than: MACRO
- db if_greater_than_command
+ enum ifgreater_command ; $0a
+ifgreater: MACRO
+ db ifgreater_command
db \1 ; byte
dw \2 ; pointer
ENDM
- enum if_less_than_command ; $0b
-if_less_than: MACRO
- db if_less_than_command
+ enum ifless_command ; $0b
+ifless: MACRO
+ db ifless_command
db \1 ; byte
dw \2 ; pointer
ENDM
@@ -110,13 +110,13 @@ ENDM
enum checkmapscene_command ; $11
checkmapscene: MACRO
db checkmapscene_command
- map \1 ; map
+ map_id \1 ; map
ENDM
enum setmapscene_command ; $12
setmapscene: MACRO
db setmapscene_command
- map \1 ; map
+ map_id \1 ; map
db \2 ; scene_id
ENDM
@@ -194,23 +194,23 @@ ENDM
enum giveitem_command ; $1f
giveitem: MACRO
+if _NARG == 1
+ giveitem \1, 1
+else
db giveitem_command
db \1 ; item
-if _NARG == 2
db \2 ; quantity
-else
- db 1
endc
ENDM
enum takeitem_command ; $20
takeitem: MACRO
+if _NARG == 1
+ takeitem \1, 1
+else
db takeitem_command
db \1 ; item
-if _NARG == 2
db \2 ; quantity
-else
- db 1
endc
ENDM
@@ -283,10 +283,6 @@ checktime: MACRO
db \1 ; time
ENDM
-checkmorn EQUS "checktime MORN"
-checkday EQUS "checktime DAY"
-checknite EQUS "checktime NITE"
-
enum checkpoke_command ; $2c
checkpoke: MACRO
db checkpoke_command
@@ -295,23 +291,21 @@ ENDM
enum givepoke_command ; $2d
givepoke: MACRO
+if _NARG == 2
+ givepoke \1, \2, NO_ITEM, FALSE
+elif _NARG == 3
+ givepoke \1, \2, \3, FALSE
+else
db givepoke_command
db \1 ; pokemon
db \2 ; level
- if _NARG >= 3
db \3 ; item
- if _NARG >= 4
db \4 ; trainer
- if \4
+if \4
dw \5 ; trainer_name_pointer
dw \6 ; pkmn_nickname
- endc
- else
- db 0
- endc
- else
- db 0, 0
- endc
+endc
+endc
ENDM
enum giveegg_command ; $2e
@@ -321,15 +315,15 @@ giveegg: MACRO
db \2 ; level
ENDM
- enum givepokeitem_command ; $2f
-givepokeitem: MACRO
- db givepokeitem_command
+ enum givepokemail_command ; $2f
+givepokemail: MACRO
+ db givepokemail_command
dw \1 ; pointer
ENDM
- enum checkpokeitem_command ; $30
-checkpokeitem: MACRO
- db checkpokeitem_command
+ enum checkpokemail_command ; $30
+checkpokemail: MACRO
+ db checkpokemail_command
dw \1 ; pointer
ENDM
@@ -389,19 +383,19 @@ ENDM
warpmod: MACRO
db warpmod_command
db \1 ; warp_id
- map \2 ; map
+ map_id \2 ; map
ENDM
enum blackoutmod_command ; $3b
blackoutmod: MACRO
db blackoutmod_command
- map \1 ; map
+ map_id \1 ; map
ENDM
enum warp_command ; $3c
warp: MACRO
db warp_command
- map \1 ; map
+ map_id \1 ; map
db \2 ; x
db \3 ; y
ENDM
@@ -477,11 +471,11 @@ ENDM
enum refreshscreen_command ; $48
refreshscreen: MACRO
+if _NARG == 0
+ refreshscreen 0
+else
db refreshscreen_command
-if _NARG == 1
db \1 ; dummy
-else
- db 0
endc
ENDM
@@ -520,10 +514,10 @@ yesorno: MACRO
db yesorno_command
ENDM
- enum loadmenudata_command ; $4f
-loadmenudata: MACRO
- db loadmenudata_command
- dw \1 ; data
+ enum loadmenu_command ; $4f
+loadmenu: MACRO
+ db loadmenu_command
+ dw \1 ; menu_header
ENDM
enum closewindow_command ; $50
@@ -651,14 +645,14 @@ scripttalkafter: MACRO
db scripttalkafter_command
ENDM
- enum end_if_just_battled_command ; $66
-end_if_just_battled: MACRO
- db end_if_just_battled_command
+ enum endifjustbattled_command ; $66
+endifjustbattled: MACRO
+ db endifjustbattled_command
ENDM
- enum check_just_battled_command ; $67
-check_just_battled: MACRO
- db check_just_battled_command
+ enum checkjustbattled_command ; $67
+checkjustbattled: MACRO
+ db checkjustbattled_command
ENDM
enum setlasttalked_command ; $68
@@ -751,9 +745,9 @@ showemote: MACRO
db \3 ; time
ENDM
- enum spriteface_command ; $76
-spriteface: MACRO
- db spriteface_command
+ enum turnobject_command ; $76
+turnobject: MACRO
+ db turnobject_command
db \1 ; object id
db \2 ; facing
ENDM
@@ -920,9 +914,9 @@ reloadandreturn: MACRO
db \1 ; which_method
ENDM
- enum end_all_command ; $93
-end_all: MACRO
- db end_all_command
+ enum endall_command ; $93
+endall: MACRO
+ db endall_command
ENDM
enum pokemart_command ; $94
@@ -986,12 +980,12 @@ ENDM
enum verbosegiveitem_command ; $9e
verbosegiveitem: MACRO
+if _NARG == 1
+ verbosegiveitem \1, 1
+else
db verbosegiveitem_command
db \1 ; item
-if _NARG == 2
db \2 ; quantity
-else
- db 1
endc
ENDM
@@ -1006,7 +1000,7 @@ ENDM
swarm: MACRO
db swarm_command
db \1 ; flag
- map \2 ; map
+ map_id \2 ; map
ENDM
enum halloffame_command ; $a1
@@ -1023,7 +1017,7 @@ ENDM
warpfacing: MACRO
db warpfacing_command
db \1 ; facing
- map \2 ; map
+ map_id \2 ; map
db \3 ; x
db \4 ; y
ENDM
@@ -1062,7 +1056,7 @@ wait: MACRO
db \1 ; duration
ENDM
- enum check_save_command ; $a9
-check_save: MACRO
- db check_save_command
+ enum checksave_command ; $a9
+checksave: MACRO
+ db checksave_command
ENDM
diff --git a/macros/scripts/gfx_anims.asm b/macros/scripts/gfx_anims.asm
index 943a000a9..8f33512ec 100644
--- a/macros/scripts/gfx_anims.asm
+++ b/macros/scripts/gfx_anims.asm
@@ -4,7 +4,7 @@ frame: MACRO
db \1
x = \2
if _NARG > 2
-rept _NARG +- 2
+rept _NARG + -2
x = x | (1 << (\3 + 1))
shift
endr
diff --git a/macros/scripts/maps.asm b/macros/scripts/maps.asm
index 31a1f16d9..7f5947a55 100644
--- a/macros/scripts/maps.asm
+++ b/macros/scripts/maps.asm
@@ -1,12 +1,12 @@
-map: MACRO
+map_id: MACRO
;\1: map id
db GROUP_\1, MAP_\1
ENDM
-
scene_script: MACRO
;\1: script pointer
- dw \1, 0
+ dw \1
+ dw 0 ; filler
ENDM
callback: MACRO
@@ -15,19 +15,19 @@ callback: MACRO
dbw \1, \2
ENDM
-warp_def: MACRO
+warp_event: MACRO
;\1: x: left to right, starts at 0
;\2: y: top to bottom, starts at 0
-;\3: warp destination: starts at 1
-;\4: map id: from constants/map_constants.asm
- db \2, \1, \3
- map \4
+;\3: map id: from constants/map_constants.asm
+;\4: warp destination: starts at 1
+ db \2, \1, \4
+ map_id \3
ENDM
coord_event: MACRO
;\1: x: left to right, starts at 0
;\2: y: top to bottom, starts at 0
-;\3: scene id: controlled by setscene/setmapscene
+;\3: scene id: a SCENE_* constant; controlled by setscene/setmapscene
;\4: script pointer
db \3, \2, \1
db 0 ; filler
@@ -74,34 +74,33 @@ object_event: MACRO
dw \9
ENDM
-
trainer: MACRO
-;\1: flag: an EVENT_BEAT_* constant
-;\2: trainer group
-;\3: trainer id
+;\1: trainer group
+;\2: trainer id
+;\3: flag: an EVENT_BEAT_* constant
;\4: seen text
;\5: win text
;\6: loss text
;\7: after-battle text
- dw \1
- db \2, \3
+ dw \3
+ db \1, \2
dw \4, \5, \6, \7
ENDM
itemball: MACRO
;\1: item: from constants/item_constants.asm
;\2: quantity: default 1
-if _NARG == 2
- db \1, \2
+if _NARG == 1
+ itemball \1, 1
else
- db \1, 1
+ db \1, \2
endc
ENDM
hiddenitem: MACRO
-;\1: flag: an EVENT_* constant
-;\2: item: from constants/item_constants.asm
- dwb \1, \2
+;\1: item: from constants/item_constants.asm
+;\2: flag: an EVENT_* constant
+ dwb \2, \1
ENDM
elevfloor: MACRO
@@ -109,7 +108,7 @@ elevfloor: MACRO
;\2: warp destination: starts at 1
;\3: map id
db \1, \2
- map \3
+ map_id \3
ENDM
conditional_event: MACRO
diff --git a/macros/scripts/movement.asm b/macros/scripts/movement.asm
index 451608723..83d1ad0e6 100644
--- a/macros/scripts/movement.asm
+++ b/macros/scripts/movement.asm
@@ -1,4 +1,4 @@
-; MovementPointers indexes (see engine/movement.asm)
+; MovementPointers indexes (see engine/overworld/movement.asm)
enum_start
; Directional movements
diff --git a/macros/scripts/text.asm b/macros/scripts/text.asm
index bff18c7ea..d1fec35db 100644
--- a/macros/scripts/text.asm
+++ b/macros/scripts/text.asm
@@ -46,9 +46,9 @@ text_low: MACRO
db TX_LOW
ENDM
- enum WAIT_BUTTON ; $06
+ enum TX_WAIT_BUTTON ; $06
text_waitbutton: MACRO
- db WAIT_BUTTON
+ db TX_WAIT_BUTTON
ENDM
enum TX_SCROLL ; $07
@@ -56,9 +56,9 @@ text_scroll: MACRO
db TX_SCROLL
ENDM
- enum START_ASM ; $08
+ enum TX_START_ASM ; $08
start_asm: MACRO
- db START_ASM
+ db TX_START_ASM
ENDM
enum TX_NUM ; $09
diff --git a/macros/scripts/trade_anims.asm b/macros/scripts/trade_anims.asm
index 94c9070aa..6227f2022 100644
--- a/macros/scripts/trade_anims.asm
+++ b/macros/scripts/trade_anims.asm
@@ -21,7 +21,7 @@ tradeanim_enter_link_tube: MACRO
db tradeanim_enter_link_tube_command
ENDM
-__enum__ set $5
+ enum_start $05
enum tradeanim_exit_link_tube_command ; $05
tradeanim_exit_link_tube: MACRO
@@ -33,14 +33,14 @@ tradeanim_tube_to_ot: MACRO
db tradeanim_tube_to_ot_command
ENDM
-__enum__ set $0e
+ enum_start $0e
enum tradeanim_tube_to_player_command ; $0e
tradeanim_tube_to_player: MACRO
db tradeanim_tube_to_player_command
ENDM
-__enum__ set $16
+ enum_start $16
enum tradeanim_sent_to_ot_text_command ; $16
tradeanim_sent_to_ot_text: MACRO
@@ -92,7 +92,7 @@ tradeanim_scroll_out_right: MACRO
db tradeanim_scroll_out_right_command
ENDM
-__enum__ set $21
+ enum_start $21
enum tradeanim_wait_80_command ; $21
tradeanim_wait_80: MACRO
@@ -119,7 +119,7 @@ tradeanim_wait_anim: MACRO
db tradeanim_wait_anim_command
ENDM
-__enum__ set $27
+ enum_start $27
enum tradeanim_poof_command ; $27
tradeanim_poof: MACRO
@@ -166,7 +166,6 @@ tradeanim_wait_180_if_ot_egg: MACRO
db tradeanim_wait_180_if_ot_egg_command
ENDM
-
; Mobile
enum_start $01
@@ -185,7 +184,7 @@ mobiletradeanim_sendmon: MACRO
db mobiletradeanim_sendmon_command
ENDM
-__enum__ set $05
+ enum_start $05
enum mobiletradeanim_05_command ; $05
mobiletradeanim_05: MACRO
@@ -207,7 +206,7 @@ mobiletradeanim_receivemon: MACRO
db mobiletradeanim_receivemon_command
ENDM
-__enum__ set $0b
+ enum_start $0b
enum mobiletradeanim_showgetmon_command ; $0b
mobiletradeanim_showgetmon: MACRO