From 948b270a83dce5f985cf347e88cd3ed0b110e1c1 Mon Sep 17 00:00:00 2001 From: Andrew Martinek Date: Thu, 12 Sep 2019 12:29:47 -0400 Subject: Script reversing --- src/constants/npc_constants.asm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/constants') diff --git a/src/constants/npc_constants.asm b/src/constants/npc_constants.asm index f4972dc..c023a58 100644 --- a/src/constants/npc_constants.asm +++ b/src/constants/npc_constants.asm @@ -1,3 +1,20 @@ +; npc_struct constants + const_def + const NPC_TRAINER_ID + const NPC_DATA_FIELD_01 + const NPC_DATA_FIELD_02 + const NPC_DATA_FIELD_03 + const NPC_DATA_FIELD_04 + const NPC_DATA_OWSEQUENCE_PTR + const NPC_DATA_OWSEQUENCE_PTR_2 + const NPC_DATA_NAME_TEXT + const NPC_DATA_NAME_TEXT_2 + const NPC_DATA_BATTLE_PICTURE + const NPC_DATA_FIELD_0A + const NPC_DATA_FIELD_0B + const NPC_DATA_FIELD_0C +NPC_DATA_LENGTH EQU const_value + const_def 1 const PLAYER_PIC ; $01 const RONALD_PIC ; $02 @@ -41,5 +58,6 @@ const STEPHANIE_PIC ; $28 const AARON_PIC ; $29 +DRMASON EQU $01 SARA EQU $1F AMANDA EQU $20 -- cgit v1.2.3 From 751b28d4fee472af4d0de83ef22a1f11ec6fade6 Mon Sep 17 00:00:00 2001 From: Andrew Martinek Date: Sun, 15 Sep 2019 21:55:11 -0400 Subject: Lots of NPC data, some temp. comments on mapdatapointers --- src/constants/npc_constants.asm | 124 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 119 insertions(+), 5 deletions(-) (limited to 'src/constants') diff --git a/src/constants/npc_constants.asm b/src/constants/npc_constants.asm index c023a58..d7eeaa8 100644 --- a/src/constants/npc_constants.asm +++ b/src/constants/npc_constants.asm @@ -6,9 +6,9 @@ const NPC_DATA_FIELD_03 const NPC_DATA_FIELD_04 const NPC_DATA_OWSEQUENCE_PTR - const NPC_DATA_OWSEQUENCE_PTR_2 +const_value = const_value+1 const NPC_DATA_NAME_TEXT - const NPC_DATA_NAME_TEXT_2 +const_value = const_value+1 const NPC_DATA_BATTLE_PICTURE const NPC_DATA_FIELD_0A const NPC_DATA_FIELD_0B @@ -58,6 +58,120 @@ NPC_DATA_LENGTH EQU const_value const STEPHANIE_PIC ; $28 const AARON_PIC ; $29 -DRMASON EQU $01 -SARA EQU $1F -AMANDA EQU $20 + const_def 1 + const DRMASON ; $01 + const RONALD1 ; $02 + const ISHIHARA ; $03 + const IMAKUNI ; $04 +const_value = const_value+1 ; DRMASON duplicate +const_value = const_value+1 ; DRMASON duplicate + const SAM ; $07 + const TECH1 ; $08 + const TECH2 ; $09 + const TECH3 ; $0a + const TECH4 ; $0b + const TECH5 ; $0c + const TECH6 ; $0d + const CLERK1 ; $0e + const CLERK2 ; $0f + const CLERK3 ; $10 + const CLERK4 ; $11 + const CLERK5 ; $12 + const CLERK6 ; $13 + const CLERK7 ; $14 + const CLERK8 ; $15 + const CLERK9 ; $16 + const CHRIS ; $17 + const MICHAEL ; $18 + const JESSICA ; $19 + const MITCH ; $1a + const MATTHEW ; $1b + const RYAN ; $1c + const ANDREW ; $1d + const GENE ; $1e + const SARA ; $1f + const AMANDA ; $20 + const JOSHUA ; $21 + const AMY ; $22 + const JENNIFER ; $23 + const NICHOLAS ; $24 + const BRANDON ; $25 + const ISAAC ; $26 + const BRITTANY ; $27 + const KRISTIN ; $28 + const HEATHER ; $29 + const NIKKI ; $2a + const ROBERT ; $2b + const DANIEL ; $2c + const STEPHANIE ; $2d + const MURRAY1 ; $2e + const JOSEPH ; $2f + const DAVID ; $30 + const ERIK ; $31 + const RICK ; $32 + const JOHN ; $33 + const ADAM ; $34 + const JONATHAN ; $35 + const KEN ; $36 + const COURTNEY ; $37 + const STEVE ; $38 + const JACK ; $39 + const ROD ; $3a + const CLERK10 ; $3b + const CLERK11 ; $3c + const MAN1 ; $3d + const WOMAN1 ; $3e + const CHAP1 ; $3f + const GAL1 ; $40 + const LASS1 ; $41 + const CHAP2 ; $42 + const LASS2 ; $43 + const PAPPY1 ; $44 + const LAD1 ; $45 + const LAD2 ; $46 + const CHAP3 ; $47 + const CLERK12 ; $48 + const CLERK13 ; $49 + const HOST ; $4a + const SPECS1 ; $4b + const BUTCH ; $4c + const GRANNY1 ; $4d + const LASS3 ; $4e + const MAN2 ; $4f + const PAPPY2 ; $50 + const LASS4 ; $51 + const HOOD1 ; $52 + const GRANNY2 ; $53 + const GAL2 ; $54 + const LAD3 ; $55 + const GAL3 ; $56 + const CHAP4 ; $57 + const MAN3 ; $58 + const SPECS2 ; $59 + const SPECS3 ; $5a + const WOMAN2 ; $5b + const MANIA ; $5c + const PAPPY3 ; $5d + const GAL4 ; $5e + const CHAMP ; $5f + const HOOD2 ; $60 + const LASS5 ; $61 + const CHAP5 ; $62 + const AARON ; $63 + const GUIDE ; $64 + const TECH7 ; $65 + const TECH8 ; $66 + const _11F18 ; $67 + const _11F1F ; $68 + const _11F26 ; $69 + const _11F2D ; $6a + const _11F34 ; $6b + const _11F3B ; $6c + const _11F42 ; $6d + const _11F49 ; $6e +const_value = const_value+1 ; _11F49 duplicate + const MURRAY2 ; $70 + const RONALD2 ; $71 + const RONALD3 ; $72 +const_value = const_value+1 ; _11f49 duplicate + -- cgit v1.2.3 From f3f374e6b7e26bc93c8428c8cb7b8c210223b2f4 Mon Sep 17 00:00:00 2001 From: Andrew Martinek Date: Mon, 23 Sep 2019 12:27:12 -0400 Subject: Fleshed out flags a lot --- src/constants/duel_constants.asm | 7 +++++++ src/constants/event_constants.asm | 6 +++--- src/constants/misc_constants.asm | 3 +++ 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src/constants') diff --git a/src/constants/duel_constants.asm b/src/constants/duel_constants.asm index f3e2912..044b888 100644 --- a/src/constants/duel_constants.asm +++ b/src/constants/duel_constants.asm @@ -224,3 +224,10 @@ EFFECT_FAILED_UNSUCCESSFUL EQU $02 ; wAnimationQueue length ANIMATION_QUEUE_LENGTH EQU 7 + +PRIZES_1 EQU $01 +PRIZES_2 EQU $02 +PRIZES_3 EQU $03 +PRIZES_4 EQU $04 +PRIZES_5 EQU $05 +PRIZES_6 EQU $06 diff --git a/src/constants/event_constants.asm b/src/constants/event_constants.asm index 496f5a3..f6ac803 100644 --- a/src/constants/event_constants.asm +++ b/src/constants/event_constants.asm @@ -1,3 +1,3 @@ -; Event Flags -EVENT_BEAT_SARA EQU $15 -EVENT_BEAT_AMANDA EQU $16 +; EVENT_JOSHUA_STATE ; $33 +JOSHUA_TALKED EQU 1 +JOSHUA_BEATEN EQU 2 diff --git a/src/constants/misc_constants.asm b/src/constants/misc_constants.asm index b31631a..c513111 100644 --- a/src/constants/misc_constants.asm +++ b/src/constants/misc_constants.asm @@ -44,3 +44,6 @@ FLUSH_ALL_PALS_F EQU 6 const GAME_EVENT_CONTINUE_DUEL ; $5 const GAME_EVENT_CHALLENGE_MACHINE ; $6 NUM_GAME_EVENTS EQU const_value + +; Script constant +NO_JUMP EQU $0000 -- cgit v1.2.3 From fda59356c20813bb57d59de8d9b2b100f0fe275d Mon Sep 17 00:00:00 2001 From: Andrew Martinek Date: Sun, 6 Oct 2019 11:24:18 -0400 Subject: Uncovered a lot of NPC map data and loading functions. --- src/constants/map_constants.asm | 14 ++++++++++++++ src/constants/misc_constants.asm | 5 +++++ src/constants/npc_constants.asm | 6 +++--- 3 files changed, 22 insertions(+), 3 deletions(-) (limited to 'src/constants') diff --git a/src/constants/map_constants.asm b/src/constants/map_constants.asm index 4b74a29..5e01d0a 100644 --- a/src/constants/map_constants.asm +++ b/src/constants/map_constants.asm @@ -33,3 +33,17 @@ const POKEMON_DOME_ENTRANCE ; $1F const POKEMON_DOME ; $20 const HALL_OF_HONOR ; $21 + + +NPC_MAP_SIZE EQU $06 + +; Most of these aren't fully understood so the names aren't great +MAP_SCRIPT_SIZE EQU $0f +MAP_SCRIPT_NPCS EQU $00 +MAP_SCRIPT_POST_NPC EQU $02 +MAP_SCRIPT_PRESSED_A_1 EQU $04 +MAP_SCRIPT_PRESSED_A_2 EQU $06 +MAP_SCRIPT_LOAD_MAP EQU $08 +MAP_SCRIPT_AFTER_DUEL EQU $0a +MAP_SCRIPT_MOVED_PLAYER EQU $0c +MAP_SCRIPT_CLOSE_TEXTBOX EQU $0e diff --git a/src/constants/misc_constants.asm b/src/constants/misc_constants.asm index c513111..53b2be4 100644 --- a/src/constants/misc_constants.asm +++ b/src/constants/misc_constants.asm @@ -47,3 +47,8 @@ NUM_GAME_EVENTS EQU const_value ; Script constant NO_JUMP EQU $0000 + +NORTH EQU $00 +EAST EQU $01 +SOUTH EQU $02 +WEST EQU $03 diff --git a/src/constants/npc_constants.asm b/src/constants/npc_constants.asm index d7eeaa8..f85dc1c 100644 --- a/src/constants/npc_constants.asm +++ b/src/constants/npc_constants.asm @@ -1,9 +1,9 @@ ; npc_struct constants const_def const NPC_TRAINER_ID - const NPC_DATA_FIELD_01 - const NPC_DATA_FIELD_02 - const NPC_DATA_FIELD_03 + const NPC_DATA_FIELD_01 ; Sprite + const NPC_DATA_FIELD_02 ; DMG/SGB pal + const NPC_DATA_FIELD_03 ; CGB pal const NPC_DATA_FIELD_04 const NPC_DATA_OWSEQUENCE_PTR const_value = const_value+1 -- cgit v1.2.3 From a44f17b9a15cf1a572d5e8056a69c368265729f2 Mon Sep 17 00:00:00 2001 From: Andrew Martinek Date: Sun, 6 Oct 2019 23:00:27 -0400 Subject: Fixed a few macros that were giving weird code. Updated tcgdisasm --- src/constants/misc_constants.asm | 8 --- src/constants/npc_constants.asm | 18 ++++++ src/constants/script_constants.asm | 128 +++++++++++++++++++++++++++++++++++++ 3 files changed, 146 insertions(+), 8 deletions(-) create mode 100644 src/constants/script_constants.asm (limited to 'src/constants') diff --git a/src/constants/misc_constants.asm b/src/constants/misc_constants.asm index 53b2be4..b31631a 100644 --- a/src/constants/misc_constants.asm +++ b/src/constants/misc_constants.asm @@ -44,11 +44,3 @@ FLUSH_ALL_PALS_F EQU 6 const GAME_EVENT_CONTINUE_DUEL ; $5 const GAME_EVENT_CHALLENGE_MACHINE ; $6 NUM_GAME_EVENTS EQU const_value - -; Script constant -NO_JUMP EQU $0000 - -NORTH EQU $00 -EAST EQU $01 -SOUTH EQU $02 -WEST EQU $03 diff --git a/src/constants/npc_constants.asm b/src/constants/npc_constants.asm index f85dc1c..9e3911c 100644 --- a/src/constants/npc_constants.asm +++ b/src/constants/npc_constants.asm @@ -1,3 +1,21 @@ +LOADED_NPC_MAX EQU $08 + +; wLoadedNPCs structure + const_def + const LOADED_NPC_ID + const LOADED_NPC_SPRITE + const LOADED_NPC_COORD_X + const LOADED_NPC_COORD_Y + const LOADED_NPC_DIRECTION + const LOADED_NPC_FIELD_05 + const LOADED_NPC_FIELD_06 + const LOADED_NPC_FIELD_07 + const LOADED_NPC_FIELD_08 + const LOADED_NPC_FIELD_09 + const LOADED_NPC_FIELD_0A + const LOADED_NPC_FIELD_0B +LOADED_NPC_LENGTH EQU const_value + ; npc_struct constants const_def const NPC_TRAINER_ID diff --git a/src/constants/script_constants.asm b/src/constants/script_constants.asm new file mode 100644 index 0000000..398eeb3 --- /dev/null +++ b/src/constants/script_constants.asm @@ -0,0 +1,128 @@ + const_def + const EVENT_FLAG_00 + const EVENT_FLAG_01 + const EVENT_FLAG_02 + const EVENT_FLAG_03 + const EVENT_FLAG_04 + const EVENT_FLAG_05 + const EVENT_FLAG_06 + const EVENT_FLAG_07 + const EVENT_FLAG_08 + const EVENT_FLAG_09 + const EVENT_FLAG_0A + const EVENT_BEAT_AMY + const EVENT_FLAG_0C + const EVENT_FLAG_0D + const EVENT_FLAG_0E + const EVENT_FLAG_0F + const EVENT_FLAG_10 + const EVENT_FLAG_11 + const EVENT_FLAG_12 + const EVENT_FLAG_13 + const EVENT_FLAG_14 + const EVENT_BEAT_SARA + const EVENT_BEAT_AMANDA + const EVENT_FLAG_17 + const EVENT_FLAG_18 + const EVENT_FLAG_19 + const EVENT_FLAG_1A + const EVENT_FLAG_1B + const EVENT_FLAG_1C + const EVENT_FLAG_1D + const EVENT_FLAG_1E + const EVENT_FLAG_1F + const EVENT_FLAG_20 + const EVENT_FLAG_21 + const EVENT_FLAG_22 + const EVENT_FLAG_23 + const EVENT_FLAG_24 + const EVENT_FLAG_25 + const EVENT_FLAG_26 + const EVENT_FLAG_27 + const EVENT_FLAG_28 + const EVENT_FLAG_29 + const EVENT_FLAG_2A + const EVENT_FLAG_2B + const EVENT_FLAG_2C + const EVENT_FLAG_2D + const EVENT_FLAG_2E + const EVENT_FLAG_2F + const EVENT_FLAG_30 + const EVENT_FLAG_31 + const EVENT_FLAG_32 + const EVENT_JOSHUA_STATE + const EVENT_FLAG_34 + const EVENT_FLAG_35 + const EVENT_FLAG_36 + const EVENT_FLAG_37 + const EVENT_FLAG_38 + const EVENT_FLAG_39 + const EVENT_FLAG_3A + const EVENT_FLAG_3B + const FLAG_BEAT_BRITTANY + const EVENT_FLAG_3D + const EVENT_FLAG_3E + const EVENT_FLAG_3F + const EVENT_FLAG_40 + const EVENT_FLAG_41 + const EVENT_FLAG_42 + const EVENT_FLAG_43 + const EVENT_FLAG_44 + const EVENT_FLAG_45 + const EVENT_FLAG_46 + const EVENT_FLAG_47 + const EVENT_FLAG_48 + const EVENT_FLAG_49 + const EVENT_FLAG_4A + const EVENT_FLAG_4B + const EVENT_FLAG_4C + const EVENT_FLAG_4D + const EVENT_FLAG_4E + const EVENT_FLAG_4F + const EVENT_FLAG_50 + const EVENT_FLAG_51 + const EVENT_FLAG_52 + const EVENT_FLAG_53 + const EVENT_FLAG_54 + const EVENT_FLAG_55 + const EVENT_FLAG_56 + const EVENT_FLAG_57 + const EVENT_FLAG_58 + const EVENT_FLAG_59 + const EVENT_FLAG_5A + const EVENT_FLAG_5B + const EVENT_FLAG_5C + const EVENT_FLAG_5D + const EVENT_FLAG_5E + const EVENT_FLAG_5F + const EVENT_FLAG_60 + const EVENT_FLAG_61 + const EVENT_FLAG_62 + const EVENT_FLAG_63 + const EVENT_FLAG_64 + const EVENT_FLAG_65 + const EVENT_FLAG_66 + const EVENT_FLAG_67 + const EVENT_FLAG_68 + const EVENT_FLAG_69 + const EVENT_FLAG_6A + const EVENT_FLAG_6B + const EVENT_FLAG_6C + const EVENT_FLAG_6D + const EVENT_FLAG_6E + const EVENT_FLAG_6F + const EVENT_FLAG_70 + const EVENT_FLAG_71 + const EVENT_FLAG_72 + const EVENT_FLAG_73 + const EVENT_FLAG_74 + const EVENT_FLAG_75 + const EVENT_FLAG_76 +EVENT_FLAG_AMOUNT EQU const_value + +NO_JUMP EQU $0000 + +NORTH EQU $00 +EAST EQU $01 +SOUTH EQU $02 +WEST EQU $03 -- cgit v1.2.3 From 299f013b8b14184b9f06da3b89ba87ce2ba9e0f3 Mon Sep 17 00:00:00 2001 From: Andrew Martinek Date: Sun, 13 Oct 2019 19:39:13 -0400 Subject: More scripts, start to figure out mapscripts --- src/constants/event_constants.asm | 3 - src/constants/npc_constants.asm | 222 ++++++++++++++++---------------- src/constants/script_constants.asm | 256 ++++++++++++++++++++----------------- 3 files changed, 248 insertions(+), 233 deletions(-) delete mode 100644 src/constants/event_constants.asm (limited to 'src/constants') diff --git a/src/constants/event_constants.asm b/src/constants/event_constants.asm deleted file mode 100644 index f6ac803..0000000 --- a/src/constants/event_constants.asm +++ /dev/null @@ -1,3 +0,0 @@ -; EVENT_JOSHUA_STATE ; $33 -JOSHUA_TALKED EQU 1 -JOSHUA_BEATEN EQU 2 diff --git a/src/constants/npc_constants.asm b/src/constants/npc_constants.asm index 9e3911c..5ae8f99 100644 --- a/src/constants/npc_constants.asm +++ b/src/constants/npc_constants.asm @@ -77,119 +77,119 @@ NPC_DATA_LENGTH EQU const_value const AARON_PIC ; $29 const_def 1 - const DRMASON ; $01 - const RONALD1 ; $02 - const ISHIHARA ; $03 - const IMAKUNI ; $04 + const DRMASON ; $01 + const RONALD1 ; $02 + const ISHIHARA ; $03 + const IMAKUNI ; $04 const_value = const_value+1 ; DRMASON duplicate const_value = const_value+1 ; DRMASON duplicate - const SAM ; $07 - const TECH1 ; $08 - const TECH2 ; $09 - const TECH3 ; $0a - const TECH4 ; $0b - const TECH5 ; $0c - const TECH6 ; $0d - const CLERK1 ; $0e - const CLERK2 ; $0f - const CLERK3 ; $10 - const CLERK4 ; $11 - const CLERK5 ; $12 - const CLERK6 ; $13 - const CLERK7 ; $14 - const CLERK8 ; $15 - const CLERK9 ; $16 - const CHRIS ; $17 - const MICHAEL ; $18 - const JESSICA ; $19 - const MITCH ; $1a - const MATTHEW ; $1b - const RYAN ; $1c - const ANDREW ; $1d - const GENE ; $1e - const SARA ; $1f - const AMANDA ; $20 - const JOSHUA ; $21 - const AMY ; $22 - const JENNIFER ; $23 - const NICHOLAS ; $24 - const BRANDON ; $25 - const ISAAC ; $26 - const BRITTANY ; $27 - const KRISTIN ; $28 - const HEATHER ; $29 - const NIKKI ; $2a - const ROBERT ; $2b - const DANIEL ; $2c - const STEPHANIE ; $2d - const MURRAY1 ; $2e - const JOSEPH ; $2f - const DAVID ; $30 - const ERIK ; $31 - const RICK ; $32 - const JOHN ; $33 - const ADAM ; $34 - const JONATHAN ; $35 - const KEN ; $36 - const COURTNEY ; $37 - const STEVE ; $38 - const JACK ; $39 - const ROD ; $3a - const CLERK10 ; $3b - const CLERK11 ; $3c - const MAN1 ; $3d - const WOMAN1 ; $3e - const CHAP1 ; $3f - const GAL1 ; $40 - const LASS1 ; $41 - const CHAP2 ; $42 - const LASS2 ; $43 - const PAPPY1 ; $44 - const LAD1 ; $45 - const LAD2 ; $46 - const CHAP3 ; $47 - const CLERK12 ; $48 - const CLERK13 ; $49 - const HOST ; $4a - const SPECS1 ; $4b - const BUTCH ; $4c - const GRANNY1 ; $4d - const LASS3 ; $4e - const MAN2 ; $4f - const PAPPY2 ; $50 - const LASS4 ; $51 - const HOOD1 ; $52 - const GRANNY2 ; $53 - const GAL2 ; $54 - const LAD3 ; $55 - const GAL3 ; $56 - const CHAP4 ; $57 - const MAN3 ; $58 - const SPECS2 ; $59 - const SPECS3 ; $5a - const WOMAN2 ; $5b - const MANIA ; $5c - const PAPPY3 ; $5d - const GAL4 ; $5e - const CHAMP ; $5f - const HOOD2 ; $60 - const LASS5 ; $61 - const CHAP5 ; $62 - const AARON ; $63 - const GUIDE ; $64 - const TECH7 ; $65 - const TECH8 ; $66 - const _11F18 ; $67 - const _11F1F ; $68 - const _11F26 ; $69 - const _11F2D ; $6a - const _11F34 ; $6b - const _11F3B ; $6c - const _11F42 ; $6d - const _11F49 ; $6e + const SAM ; $07 + const TECH1 ; $08 + const TECH2 ; $09 + const TECH3 ; $0a + const TECH4 ; $0b + const TECH5 ; $0c + const TECH6 ; $0d + const CLERK1 ; $0e + const CLERK2 ; $0f + const CLERK3 ; $10 + const CLERK4 ; $11 + const CLERK5 ; $12 + const CLERK6 ; $13 + const CLERK7 ; $14 + const CLERK8 ; $15 + const CLERK9 ; $16 + const CHRIS ; $17 + const MICHAEL ; $18 + const JESSICA ; $19 + const MITCH ; $1a + const MATTHEW ; $1b + const RYAN ; $1c + const ANDREW ; $1d + const GENE ; $1e + const SARA ; $1f + const AMANDA ; $20 + const JOSHUA ; $21 + const AMY ; $22 + const JENNIFER ; $23 + const NICHOLAS ; $24 + const BRANDON ; $25 + const ISAAC ; $26 + const BRITTANY ; $27 + const KRISTIN ; $28 + const HEATHER ; $29 + const NIKKI ; $2a + const ROBERT ; $2b + const DANIEL ; $2c + const STEPHANIE ; $2d + const MURRAY1 ; $2e + const JOSEPH ; $2f + const DAVID ; $30 + const ERIK ; $31 + const RICK ; $32 + const JOHN ; $33 + const ADAM ; $34 + const JONATHAN ; $35 + const KEN ; $36 + const COURTNEY ; $37 + const STEVE ; $38 + const JACK ; $39 + const ROD ; $3a + const CLERK10 ; $3b + const GIFT_CENTER_CLERK ; $3c + const MAN1 ; $3d + const WOMAN1 ; $3e + const CHAP1 ; $3f + const GAL1 ; $40 + const LASS1 ; $41 + const CHAP2 ; $42 + const LASS2 ; $43 + const PAPPY1 ; $44 + const LAD1 ; $45 + const LAD2 ; $46 + const CHAP3 ; $47 + const CLERK12 ; $48 + const CLERK13 ; $49 + const HOST ; $4a + const SPECS1 ; $4b + const BUTCH ; $4c + const GRANNY1 ; $4d + const LASS3 ; $4e + const MAN2 ; $4f + const PAPPY2 ; $50 + const LASS4 ; $51 + const HOOD1 ; $52 + const GRANNY2 ; $53 + const GAL2 ; $54 + const LAD3 ; $55 + const GAL3 ; $56 + const CHAP4 ; $57 + const MAN3 ; $58 + const SPECS2 ; $59 + const SPECS3 ; $5a + const WOMAN2 ; $5b + const MANIA ; $5c + const PAPPY3 ; $5d + const GAL4 ; $5e + const CHAMP ; $5f + const HOOD2 ; $60 + const LASS5 ; $61 + const CHAP5 ; $62 + const AARON ; $63 + const GUIDE ; $64 + const TECH7 ; $65 + const TECH8 ; $66 + const _11F18 ; $67 + const LEGEND_CARDS_TOP_LEFT ; $68 + const LEGEND_CARDS_TOP_RIGHT ; $69 + const LEGEND_CARDS_LEFT_SPARK ; $6a + const LEGEND_CARDS_BOTTOM_LEFT ; $6b + const LEGEND_CARDS_BOTTOM_RIGHT ; $6c + const LEGEND_CARDS_RIGHT_SPARK ; $6d + const _11F49 ; $6e const_value = const_value+1 ; _11F49 duplicate - const MURRAY2 ; $70 - const RONALD2 ; $71 - const RONALD3 ; $72 + const MURRAY2 ; $70 + const RONALD2 ; $71 + const RONALD3 ; $72 const_value = const_value+1 ; _11f49 duplicate diff --git a/src/constants/script_constants.asm b/src/constants/script_constants.asm index 398eeb3..2ce9a54 100644 --- a/src/constants/script_constants.asm +++ b/src/constants/script_constants.asm @@ -1,125 +1,143 @@ const_def - const EVENT_FLAG_00 - const EVENT_FLAG_01 - const EVENT_FLAG_02 - const EVENT_FLAG_03 - const EVENT_FLAG_04 - const EVENT_FLAG_05 - const EVENT_FLAG_06 - const EVENT_FLAG_07 - const EVENT_FLAG_08 - const EVENT_FLAG_09 - const EVENT_FLAG_0A - const EVENT_BEAT_AMY - const EVENT_FLAG_0C - const EVENT_FLAG_0D - const EVENT_FLAG_0E - const EVENT_FLAG_0F - const EVENT_FLAG_10 - const EVENT_FLAG_11 - const EVENT_FLAG_12 - const EVENT_FLAG_13 - const EVENT_FLAG_14 - const EVENT_BEAT_SARA - const EVENT_BEAT_AMANDA - const EVENT_FLAG_17 - const EVENT_FLAG_18 - const EVENT_FLAG_19 - const EVENT_FLAG_1A - const EVENT_FLAG_1B - const EVENT_FLAG_1C - const EVENT_FLAG_1D - const EVENT_FLAG_1E - const EVENT_FLAG_1F - const EVENT_FLAG_20 - const EVENT_FLAG_21 - const EVENT_FLAG_22 - const EVENT_FLAG_23 - const EVENT_FLAG_24 - const EVENT_FLAG_25 - const EVENT_FLAG_26 - const EVENT_FLAG_27 - const EVENT_FLAG_28 - const EVENT_FLAG_29 - const EVENT_FLAG_2A - const EVENT_FLAG_2B - const EVENT_FLAG_2C - const EVENT_FLAG_2D - const EVENT_FLAG_2E - const EVENT_FLAG_2F - const EVENT_FLAG_30 - const EVENT_FLAG_31 - const EVENT_FLAG_32 - const EVENT_JOSHUA_STATE - const EVENT_FLAG_34 - const EVENT_FLAG_35 - const EVENT_FLAG_36 - const EVENT_FLAG_37 - const EVENT_FLAG_38 - const EVENT_FLAG_39 - const EVENT_FLAG_3A - const EVENT_FLAG_3B - const FLAG_BEAT_BRITTANY - const EVENT_FLAG_3D - const EVENT_FLAG_3E - const EVENT_FLAG_3F - const EVENT_FLAG_40 - const EVENT_FLAG_41 - const EVENT_FLAG_42 - const EVENT_FLAG_43 - const EVENT_FLAG_44 - const EVENT_FLAG_45 - const EVENT_FLAG_46 - const EVENT_FLAG_47 - const EVENT_FLAG_48 - const EVENT_FLAG_49 - const EVENT_FLAG_4A - const EVENT_FLAG_4B - const EVENT_FLAG_4C - const EVENT_FLAG_4D - const EVENT_FLAG_4E - const EVENT_FLAG_4F - const EVENT_FLAG_50 - const EVENT_FLAG_51 - const EVENT_FLAG_52 - const EVENT_FLAG_53 - const EVENT_FLAG_54 - const EVENT_FLAG_55 - const EVENT_FLAG_56 - const EVENT_FLAG_57 - const EVENT_FLAG_58 - const EVENT_FLAG_59 - const EVENT_FLAG_5A - const EVENT_FLAG_5B - const EVENT_FLAG_5C - const EVENT_FLAG_5D - const EVENT_FLAG_5E - const EVENT_FLAG_5F - const EVENT_FLAG_60 - const EVENT_FLAG_61 - const EVENT_FLAG_62 - const EVENT_FLAG_63 - const EVENT_FLAG_64 - const EVENT_FLAG_65 - const EVENT_FLAG_66 - const EVENT_FLAG_67 - const EVENT_FLAG_68 - const EVENT_FLAG_69 - const EVENT_FLAG_6A - const EVENT_FLAG_6B - const EVENT_FLAG_6C - const EVENT_FLAG_6D - const EVENT_FLAG_6E - const EVENT_FLAG_6F - const EVENT_FLAG_70 - const EVENT_FLAG_71 - const EVENT_FLAG_72 - const EVENT_FLAG_73 - const EVENT_FLAG_74 - const EVENT_FLAG_75 - const EVENT_FLAG_76 + const EVENT_FLAG_00 ; $00 + const EVENT_FLAG_01 ; $01 + const EVENT_TEMP_TALKED_TO_IMAKUNI ; $02 + const EVENT_TEMP_BATTLED_IMAKUNI ; $03 + const EVENT_FLAG_04 ; $04 + const EVENT_FLAG_05 ; $05 + const EVENT_FLAG_06 ; $06 + const EVENT_FLAG_07 ; $07 + const EVENT_FLAG_08 ; $08 + const EVENT_FLAG_09 ; $09 + const EVENT_FLAG_0A ; $0a + const EVENT_BEAT_AMY ; $0b + const EVENT_FLAG_0C ; $0c + const EVENT_FLAG_0D ; $0d + const EVENT_FLAG_0E ; $0e + const EVENT_FLAG_0F ; $0f + const EVENT_FLAG_10 ; $10 + const EVENT_FLAG_11 ; $11 + const EVENT_FLAG_12 ; $12 + const EVENT_IMAKUNI_STATE ; $13 + const EVENT_FLAG_14 ; $14 + const EVENT_BEAT_SARA ; $15 + const EVENT_BEAT_AMANDA ; $16 + const EVENT_FLAG_17 ; $17 + const EVENT_FLAG_18 ; $18 + const EVENT_FLAG_19 ; $19 + const EVENT_FLAG_1A ; $1a + const EVENT_FLAG_1B ; $1b + const EVENT_FLAG_1C ; $1c + const EVENT_FLAG_1D ; $1d + const EVENT_FLAG_1E ; $1e + const EVENT_FLAG_1F ; $1f + const EVENT_FLAG_20 ; $20 + const EVENT_FLAG_21 ; $21 + const EVENT_FLAG_22 ; $22 + const EVENT_FLAG_23 ; $23 + const EVENT_FLAG_24 ; $24 + const EVENT_FLAG_25 ; $25 + const EVENT_FLAG_26 ; $26 + const EVENT_FLAG_27 ; $27 + const EVENT_FLAG_28 ; $28 + const EVENT_FLAG_29 ; $29 + const EVENT_FLAG_2A ; $2a + const EVENT_FLAG_2B ; $2b + const EVENT_FLAG_2C ; $2c + const EVENT_FLAG_2D ; $2d + const EVENT_MEDAL_COUNT ; $2e + const EVENT_FLAG_2F ; $2f + const EVENT_FLAG_30 ; $30 + const EVENT_FLAG_31 ; $31 + const EVENT_FLAG_32 ; $32 + const EVENT_JOSHUA_STATE ; $33 + const EVENT_IMAKUNI_ROOM ; $34 + const EVENT_FLAG_35 ; $35 + const EVENT_IMAKUNI_WIN_COUNT ; $36 + const EVENT_FLAG_37 ; $37 + const EVENT_FLAG_38 ; $38 + const EVENT_FLAG_39 ; $39 + const EVENT_FLAG_3A ; $3a + const EVENT_FLAG_3B ; $3b + const FLAG_BEAT_BRITTANY ; $3c + const EVENT_FLAG_3D ; $3d + const EVENT_FLAG_3E ; $3e + const EVENT_FLAG_3F ; $3f + const EVENT_FLAG_40 ; $40 + const EVENT_FLAG_41 ; $41 + const EVENT_FLAG_42 ; $42 + const EVENT_FLAG_43 ; $43 + const EVENT_FLAG_44 ; $44 + const EVENT_FLAG_45 ; $45 + const EVENT_FLAG_46 ; $46 + const EVENT_FLAG_47 ; $47 + const EVENT_FLAG_48 ; $48 + const EVENT_FLAG_49 ; $49 + const EVENT_FLAG_4A ; $4a + const EVENT_FLAG_4B ; $4b + const EVENT_FLAG_4C ; $4c + const EVENT_FLAG_4D ; $4d + const EVENT_FLAG_4E ; $4e + const EVENT_FLAG_4F ; $4f + const EVENT_FLAG_50 ; $50 + const EVENT_FLAG_51 ; $51 + const EVENT_FLAG_52 ; $52 + const EVENT_FLAG_53 ; $53 + const EVENT_FLAG_54 ; $54 + const EVENT_FLAG_55 ; $55 + const EVENT_FLAG_56 ; $56 + const EVENT_FLAG_57 ; $57 + const EVENT_FLAG_58 ; $58 + const EVENT_FLAG_59 ; $59 + const EVENT_FLAG_5A ; $5a + const EVENT_FLAG_5B ; $5b + const EVENT_FLAG_5C ; $5c + const EVENT_FLAG_5D ; $5d + const EVENT_FLAG_5E ; $5e + const EVENT_FLAG_5F ; $5f + const EVENT_FLAG_60 ; $60 + const EVENT_FLAG_61 ; $61 + const EVENT_FLAG_62 ; $62 + const EVENT_FLAG_63 ; $63 + const EVENT_FLAG_64 ; $64 + const EVENT_FLAG_65 ; $65 + const EVENT_FLAG_66 ; $66 + const EVENT_FLAG_67 ; $67 + const EVENT_FLAG_68 ; $68 + const EVENT_FLAG_69 ; $69 + const EVENT_FLAG_6A ; $6a + const EVENT_FLAG_6B ; $6b + const EVENT_FLAG_6C ; $6c + const EVENT_FLAG_6D ; $6d + const EVENT_FLAG_6E ; $6e + const EVENT_FLAG_6F ; $6f + const EVENT_FLAG_70 ; $70 + const EVENT_FLAG_71 ; $71 + const EVENT_FLAG_72 ; $72 + const EVENT_FLAG_73 ; $73 + const EVENT_FLAG_74 ; $74 + const EVENT_FLAG_75 ; $75 + const EVENT_FLAG_76 ; $76 EVENT_FLAG_AMOUNT EQU const_value +EVENT_FLAG_BYTES EQU $40 + +; EVENT_IMAKUNI_STATE +; Starts at 0, Talking to lass moves it to MENTIONED (1), then +; talking to Imakuni at least once sets it to TALKED (2) +IMAKUNI_MENTIONED EQU 1 +IMAKUNI_TALKED EQU 2 + +; EVENT_JOSHUA_STATE +JOSHUA_TALKED EQU 1 +JOSHUA_BEATEN EQU 2 + +; EVENT_IMAKUNI_ROOM +IMAKUNI_FIGHTING_CLUB EQU 0 +IMAKUNI_SCIENCE_CLUB EQU 1 +IMAKUNI_LIGHTNING_CLUB EQU 2 +IMAKUNI_WATER_CLUB EQU 3 + NO_JUMP EQU $0000 NORTH EQU $00 -- cgit v1.2.3 From 3ac91a513dc9351734927182e46b0acd010053cf Mon Sep 17 00:00:00 2001 From: Andrew Martinek Date: Thu, 24 Oct 2019 17:45:50 -0400 Subject: Uncovered NPC Movement and named OWObjects --- src/constants/map_constants.asm | 7 +++++-- src/constants/misc_constants.asm | 5 +++++ src/constants/script_constants.asm | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src/constants') diff --git a/src/constants/map_constants.asm b/src/constants/map_constants.asm index 5e01d0a..92eaf4c 100644 --- a/src/constants/map_constants.asm +++ b/src/constants/map_constants.asm @@ -35,14 +35,17 @@ const HALL_OF_HONOR ; $21 +; Size of map data. See data/npc_map_data.asm and data/level_objects.asm +; for more info on what these represent NPC_MAP_SIZE EQU $06 +LEVEL_OBJECT_SIZE EQU $09 ; Most of these aren't fully understood so the names aren't great MAP_SCRIPT_SIZE EQU $0f MAP_SCRIPT_NPCS EQU $00 MAP_SCRIPT_POST_NPC EQU $02 -MAP_SCRIPT_PRESSED_A_1 EQU $04 -MAP_SCRIPT_PRESSED_A_2 EQU $06 +MAP_SCRIPT_OBJECTS EQU $04 +MAP_SCRIPT_PRESSED_A EQU $06 MAP_SCRIPT_LOAD_MAP EQU $08 MAP_SCRIPT_AFTER_DUEL EQU $0a MAP_SCRIPT_MOVED_PLAYER EQU $0c diff --git a/src/constants/misc_constants.asm b/src/constants/misc_constants.asm index b31631a..47b9bf6 100644 --- a/src/constants/misc_constants.asm +++ b/src/constants/misc_constants.asm @@ -44,3 +44,8 @@ FLUSH_ALL_PALS_F EQU 6 const GAME_EVENT_CONTINUE_DUEL ; $5 const GAME_EVENT_CHALLENGE_MACHINE ; $6 NUM_GAME_EVENTS EQU const_value + +OWMODE_MAP EQU 0 +OWMODE_MOVE EQU 1 +OWMODE_START_SCRIPT EQU 2 +OWMODE_SCRIPT EQU 3 diff --git a/src/constants/script_constants.asm b/src/constants/script_constants.asm index 2ce9a54..05aaf57 100644 --- a/src/constants/script_constants.asm +++ b/src/constants/script_constants.asm @@ -33,7 +33,7 @@ const EVENT_FLAG_1F ; $1f const EVENT_FLAG_20 ; $20 const EVENT_FLAG_21 ; $21 - const EVENT_FLAG_22 ; $22 + const EVENT_RECEIVED_LEGEND_CARDS ; $22 const EVENT_FLAG_23 ; $23 const EVENT_FLAG_24 ; $24 const EVENT_FLAG_25 ; $25 @@ -144,3 +144,4 @@ NORTH EQU $00 EAST EQU $01 SOUTH EQU $02 WEST EQU $03 +NO_MOVE EQU %10000000 ; For rotations without movement -- cgit v1.2.3 From 7d9ea8a30d19fae6a39bb36981e27db6edbea5e7 Mon Sep 17 00:00:00 2001 From: ElectroDeoxys Date: Tue, 28 Apr 2020 20:20:20 +0100 Subject: AI routines and Energy Trans logic --- src/constants/duel_constants.asm | 41 +++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) (limited to 'src/constants') diff --git a/src/constants/duel_constants.asm b/src/constants/duel_constants.asm index 65f58e3..b667c50 100644 --- a/src/constants/duel_constants.asm +++ b/src/constants/duel_constants.asm @@ -232,21 +232,32 @@ AI_FLAG_USED_PROFESSOR_OAK EQU 1 << 2 AI_FLAG_MODIFIED_HAND EQU 1 << 3 AI_FLAG_USED_GUST_OF_WIND EQU 1 << 4 +; used as input for AIProcessEnergyCards to determine what to check +; and whether to play card after the routine is over. +; I suspect AI_ENERGY_FLAG_DONT_PLAY to be a flag to signal the routine +; not to actually play the energy card after it's finished, +; but AIProcessEnergyCards checks whether ANY flag is set in order +; to decide not to play it, so it's redundant in the presence of another flag. +AI_ENERGY_FLAG_DONT_PLAY EQU 1 << 0 ; whether to play energy card (?) +AI_ENERGY_FLAG_SKIP_EVOLUTION EQU 1 << 1 ; whether to check if card has evolutions +AI_ENERGY_FLAG_SKIP_ARENA_CARD EQU 1 << 7 ; whether to include Arena card in determining which card to attach energy + ; used to determine which Trainer cards for AI ; to process in AIProcessHandTrainerCards. ; aside from a few exceptions, these go in chronological order. -AI_TRAINER_CARD_PHASE_01 EQU $1 -AI_TRAINER_CARD_PHASE_02 EQU $2 -AI_TRAINER_CARD_PHASE_03 EQU $3 -AI_TRAINER_CARD_PHASE_04 EQU $4 -AI_TRAINER_CARD_PHASE_05 EQU $5 -AI_TRAINER_CARD_PHASE_06 EQU $6 -AI_TRAINER_CARD_PHASE_07 EQU $7 -AI_TRAINER_CARD_PHASE_08 EQU $8 -AI_TRAINER_CARD_PHASE_09 EQU $9 -AI_TRAINER_CARD_PHASE_10 EQU $a -AI_TRAINER_CARD_PHASE_11 EQU $b -AI_TRAINER_CARD_PHASE_12 EQU $c -AI_TRAINER_CARD_PHASE_13 EQU $d -AI_TRAINER_CARD_PHASE_14 EQU $e -AI_TRAINER_CARD_PHASE_15 EQU $f + const_def 1 + const AI_TRAINER_CARD_PHASE_01 ; $1 + const AI_TRAINER_CARD_PHASE_02 ; $2 + const AI_TRAINER_CARD_PHASE_03 ; $3 + const AI_TRAINER_CARD_PHASE_04 ; $4 + const AI_TRAINER_CARD_PHASE_05 ; $5 + const AI_TRAINER_CARD_PHASE_06 ; $6 + const AI_TRAINER_CARD_PHASE_07 ; $7 + const AI_TRAINER_CARD_PHASE_08 ; $8 + const AI_TRAINER_CARD_PHASE_09 ; $9 + const AI_TRAINER_CARD_PHASE_10 ; $a + const AI_TRAINER_CARD_PHASE_11 ; $b + const AI_TRAINER_CARD_PHASE_12 ; $c + const AI_TRAINER_CARD_PHASE_13 ; $d + const AI_TRAINER_CARD_PHASE_14 ; $e + const AI_TRAINER_CARD_PHASE_15 ; $f -- cgit v1.2.3 From cf9a3c313b63c78ebcb4077e827eeff9a5940ba0 Mon Sep 17 00:00:00 2001 From: ElectroDeoxys Date: Thu, 30 Apr 2020 16:04:07 +0100 Subject: Unpack Legendary Moltres AI --- src/constants/duel_constants.asm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/constants') diff --git a/src/constants/duel_constants.asm b/src/constants/duel_constants.asm index b667c50..9cdc73b 100644 --- a/src/constants/duel_constants.asm +++ b/src/constants/duel_constants.asm @@ -3,6 +3,8 @@ MAX_PLAY_AREA_POKEMON EQU 6 ; arena + bench MAX_HP EQU 120 HP_BAR_LENGTH EQU MAX_HP / 10 +STARTING_HAND_SIZE EQU 7 + ; hWhoseTurn constants PLAYER_TURN EQUS "HIGH(wPlayerDuelVariables)" OPPONENT_TURN EQUS "HIGH(wOpponentDuelVariables)" -- cgit v1.2.3 From 17b8a2fdc29ff221b18533f06966b02ad0883fb2 Mon Sep 17 00:00:00 2001 From: ElectroDeoxys Date: Fri, 1 May 2020 17:28:57 +0100 Subject: Document AI Anti Mill strategy --- src/constants/duel_constants.asm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/constants') diff --git a/src/constants/duel_constants.asm b/src/constants/duel_constants.asm index 9cdc73b..47ca1ad 100644 --- a/src/constants/duel_constants.asm +++ b/src/constants/duel_constants.asm @@ -263,3 +263,8 @@ AI_ENERGY_FLAG_SKIP_ARENA_CARD EQU 1 << 7 ; whether to include Arena card in det const AI_TRAINER_CARD_PHASE_13 ; $d const AI_TRAINER_CARD_PHASE_14 ; $e const AI_TRAINER_CARD_PHASE_15 ; $f + +; used by wAIBarrierFlagCounter to determine +; whether Player is running Mewtwo1 mill deck. +; flag set means true, flag not set means false. +AI_FLAG_MEWTWO_MILL EQU 1 << 7 -- cgit v1.2.3 From 085660d0799a85e18fa6a25f251875ce7c0db5d4 Mon Sep 17 00:00:00 2001 From: Andrew Martinek Date: Tue, 5 May 2020 21:29:47 -0400 Subject: Added NPC_ Prefix, Changed Level to Map in some places --- src/constants/map_constants.asm | 4 +- src/constants/npc_constants.asm | 232 ++++++++++++++++++++-------------------- 2 files changed, 118 insertions(+), 118 deletions(-) (limited to 'src/constants') diff --git a/src/constants/map_constants.asm b/src/constants/map_constants.asm index 92eaf4c..d8637d6 100644 --- a/src/constants/map_constants.asm +++ b/src/constants/map_constants.asm @@ -35,10 +35,10 @@ const HALL_OF_HONOR ; $21 -; Size of map data. See data/npc_map_data.asm and data/level_objects.asm +; Size of map data. See data/npc_map_data.asm and data/map_objects.asm ; for more info on what these represent NPC_MAP_SIZE EQU $06 -LEVEL_OBJECT_SIZE EQU $09 +MAP_OBJECT_SIZE EQU $09 ; Most of these aren't fully understood so the names aren't great MAP_SCRIPT_SIZE EQU $0f diff --git a/src/constants/npc_constants.asm b/src/constants/npc_constants.asm index 5ae8f99..e51dfb9 100644 --- a/src/constants/npc_constants.asm +++ b/src/constants/npc_constants.asm @@ -19,9 +19,9 @@ LOADED_NPC_LENGTH EQU const_value ; npc_struct constants const_def const NPC_TRAINER_ID - const NPC_DATA_FIELD_01 ; Sprite - const NPC_DATA_FIELD_02 ; DMG/SGB pal - const NPC_DATA_FIELD_03 ; CGB pal + const NPC_DATA_FIELD_01 ; 01-03 Seem to relate to sprites + const NPC_DATA_FIELD_02 + const NPC_DATA_FIELD_03 const NPC_DATA_FIELD_04 const NPC_DATA_OWSEQUENCE_PTR const_value = const_value+1 @@ -77,119 +77,119 @@ NPC_DATA_LENGTH EQU const_value const AARON_PIC ; $29 const_def 1 - const DRMASON ; $01 - const RONALD1 ; $02 - const ISHIHARA ; $03 - const IMAKUNI ; $04 + const NPC_DRMASON ; $01 + const NPC_RONALD1 ; $02 + const NPC_ISHIHARA ; $03 + const NPC_IMAKUNI ; $04 const_value = const_value+1 ; DRMASON duplicate const_value = const_value+1 ; DRMASON duplicate - const SAM ; $07 - const TECH1 ; $08 - const TECH2 ; $09 - const TECH3 ; $0a - const TECH4 ; $0b - const TECH5 ; $0c - const TECH6 ; $0d - const CLERK1 ; $0e - const CLERK2 ; $0f - const CLERK3 ; $10 - const CLERK4 ; $11 - const CLERK5 ; $12 - const CLERK6 ; $13 - const CLERK7 ; $14 - const CLERK8 ; $15 - const CLERK9 ; $16 - const CHRIS ; $17 - const MICHAEL ; $18 - const JESSICA ; $19 - const MITCH ; $1a - const MATTHEW ; $1b - const RYAN ; $1c - const ANDREW ; $1d - const GENE ; $1e - const SARA ; $1f - const AMANDA ; $20 - const JOSHUA ; $21 - const AMY ; $22 - const JENNIFER ; $23 - const NICHOLAS ; $24 - const BRANDON ; $25 - const ISAAC ; $26 - const BRITTANY ; $27 - const KRISTIN ; $28 - const HEATHER ; $29 - const NIKKI ; $2a - const ROBERT ; $2b - const DANIEL ; $2c - const STEPHANIE ; $2d - const MURRAY1 ; $2e - const JOSEPH ; $2f - const DAVID ; $30 - const ERIK ; $31 - const RICK ; $32 - const JOHN ; $33 - const ADAM ; $34 - const JONATHAN ; $35 - const KEN ; $36 - const COURTNEY ; $37 - const STEVE ; $38 - const JACK ; $39 - const ROD ; $3a - const CLERK10 ; $3b - const GIFT_CENTER_CLERK ; $3c - const MAN1 ; $3d - const WOMAN1 ; $3e - const CHAP1 ; $3f - const GAL1 ; $40 - const LASS1 ; $41 - const CHAP2 ; $42 - const LASS2 ; $43 - const PAPPY1 ; $44 - const LAD1 ; $45 - const LAD2 ; $46 - const CHAP3 ; $47 - const CLERK12 ; $48 - const CLERK13 ; $49 - const HOST ; $4a - const SPECS1 ; $4b - const BUTCH ; $4c - const GRANNY1 ; $4d - const LASS3 ; $4e - const MAN2 ; $4f - const PAPPY2 ; $50 - const LASS4 ; $51 - const HOOD1 ; $52 - const GRANNY2 ; $53 - const GAL2 ; $54 - const LAD3 ; $55 - const GAL3 ; $56 - const CHAP4 ; $57 - const MAN3 ; $58 - const SPECS2 ; $59 - const SPECS3 ; $5a - const WOMAN2 ; $5b - const MANIA ; $5c - const PAPPY3 ; $5d - const GAL4 ; $5e - const CHAMP ; $5f - const HOOD2 ; $60 - const LASS5 ; $61 - const CHAP5 ; $62 - const AARON ; $63 - const GUIDE ; $64 - const TECH7 ; $65 - const TECH8 ; $66 - const _11F18 ; $67 - const LEGEND_CARDS_TOP_LEFT ; $68 - const LEGEND_CARDS_TOP_RIGHT ; $69 - const LEGEND_CARDS_LEFT_SPARK ; $6a - const LEGEND_CARDS_BOTTOM_LEFT ; $6b - const LEGEND_CARDS_BOTTOM_RIGHT ; $6c - const LEGEND_CARDS_RIGHT_SPARK ; $6d - const _11F49 ; $6e -const_value = const_value+1 ; _11F49 duplicate - const MURRAY2 ; $70 - const RONALD2 ; $71 - const RONALD3 ; $72 -const_value = const_value+1 ; _11f49 duplicate + const NPC_SAM ; $07 + const NPC_TECH1 ; $08 + const NPC_TECH2 ; $09 + const NPC_TECH3 ; $0a + const NPC_TECH4 ; $0b + const NPC_TECH5 ; $0c + const NPC_TECH6 ; $0d + const NPC_CLERK1 ; $0e + const NPC_CLERK2 ; $0f + const NPC_CLERK3 ; $10 + const NPC_CLERK4 ; $11 + const NPC_CLERK5 ; $12 + const NPC_CLERK6 ; $13 + const NPC_CLERK7 ; $14 + const NPC_CLERK8 ; $15 + const NPC_CLERK9 ; $16 + const NPC_CHRIS ; $17 + const NPC_MICHAEL ; $18 + const NPC_JESSICA ; $19 + const NPC_MITCH ; $1a + const NPC_MATTHEW ; $1b + const NPC_RYAN ; $1c + const NPC_ANDREW ; $1d + const NPC_GENE ; $1e + const NPC_SARA ; $1f + const NPC_AMANDA ; $20 + const NPC_JOSHUA ; $21 + const NPC_AMY ; $22 + const NPC_JENNIFER ; $23 + const NPC_NICHOLAS ; $24 + const NPC_BRANDON ; $25 + const NPC_ISAAC ; $26 + const NPC_BRITTANY ; $27 + const NPC_KRISTIN ; $28 + const NPC_HEATHER ; $29 + const NPC_NIKKI ; $2a + const NPC_ROBERT ; $2b + const NPC_DANIEL ; $2c + const NPC_STEPHANIE ; $2d + const NPC_MURRAY1 ; $2e + const NPC_JOSEPH ; $2f + const NPC_DAVID ; $30 + const NPC_ERIK ; $31 + const NPC_RICK ; $32 + const NPC_JOHN ; $33 + const NPC_ADAM ; $34 + const NPC_JONATHAN ; $35 + const NPC_KEN ; $36 + const NPC_COURTNEY ; $37 + const NPC_STEVE ; $38 + const NPC_JACK ; $39 + const NPC_ROD ; $3a + const NPC_CLERK10 ; $3b + const NPC_GIFT_CENTER_CLERK ; $3c + const NPC_MAN1 ; $3d + const NPC_WOMAN1 ; $3e + const NPC_CHAP1 ; $3f + const NPC_GAL1 ; $40 + const NPC_LASS1 ; $41 + const NPC_CHAP2 ; $42 + const NPC_LASS2 ; $43 + const NPC_PAPPY1 ; $44 + const NPC_LAD1 ; $45 + const NPC_LAD2 ; $46 + const NPC_CHAP3 ; $47 + const NPC_CLERK12 ; $48 + const NPC_CLERK13 ; $49 + const NPC_HOST ; $4a + const NPC_SPECS1 ; $4b + const NPC_BUTCH ; $4c + const NPC_GRANNY1 ; $4d + const NPC_LASS3 ; $4e + const NPC_MAN2 ; $4f + const NPC_PAPPY2 ; $50 + const NPC_LASS4 ; $51 + const NPC_HOOD1 ; $52 + const NPC_GRANNY2 ; $53 + const NPC_GAL2 ; $54 + const NPC_LAD3 ; $55 + const NPC_GAL3 ; $56 + const NPC_CHAP4 ; $57 + const NPC_MAN3 ; $58 + const NPC_SPECS2 ; $59 + const NPC_SPECS3 ; $5a + const NPC_WOMAN2 ; $5b + const NPC_MANIA ; $5c + const NPC_PAPPY3 ; $5d + const NPC_GAL4 ; $5e + const NPC_CHAMP ; $5f + const NPC_HOOD2 ; $60 + const NPC_LASS5 ; $61 + const NPC_CHAP5 ; $62 + const NPC_AARON ; $63 + const NPC_GUIDE ; $64 + const NPC_TECH7 ; $65 + const NPC_TECH8 ; $66 + const NPC_11F18 ; $67 + const NPC_LEGEND_CARDS_TOP_LEFT ; $68 + const NPC_LEGEND_CARDS_TOP_RIGHT ; $69 + const NPC_LEGEND_CARDS_LEFT_SPARK ; $6a + const NPC_LEGEND_CARDS_BOTTOM_LEFT ; $6b + const NPC_LEGEND_CARDS_BOTTOM_RIGHT ; $6c + const NPC_LEGEND_CARDS_RIGHT_SPARK ; $6d + const NPC_11F49 ; $6e +const_value = const_value+1 ; NPC_11F49 duplicate + const NPC_MURRAY2 ; $70 + const NPC_RONALD2 ; $71 + const NPC_RONALD3 ; $72 +const_value = const_value+1 ; NPC_11f49 duplicate -- cgit v1.2.3 From d1a545a71e996fac826e2e0d299ffa0dd1ef491a Mon Sep 17 00:00:00 2001 From: Andrew Martinek Date: Tue, 5 May 2020 21:37:55 -0400 Subject: Changed Unnamed NPC to TORCH --- src/constants/npc_constants.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/constants') diff --git a/src/constants/npc_constants.asm b/src/constants/npc_constants.asm index e51dfb9..113d790 100644 --- a/src/constants/npc_constants.asm +++ b/src/constants/npc_constants.asm @@ -179,7 +179,7 @@ const_value = const_value+1 ; DRMASON duplicate const NPC_GUIDE ; $64 const NPC_TECH7 ; $65 const NPC_TECH8 ; $66 - const NPC_11F18 ; $67 + const NPC_TORCH ; $67 const NPC_LEGEND_CARDS_TOP_LEFT ; $68 const NPC_LEGEND_CARDS_TOP_RIGHT ; $69 const NPC_LEGEND_CARDS_LEFT_SPARK ; $6a -- cgit v1.2.3 From a1f9dca9f563e6bc82c533f8e3a82edb954b8842 Mon Sep 17 00:00:00 2001 From: Andrew Martinek Date: Tue, 5 May 2020 22:45:50 -0400 Subject: changed wording when it comes to the legendary card sprite --- src/constants/npc_constants.asm | 12 ++++++------ src/constants/script_constants.asm | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/constants') diff --git a/src/constants/npc_constants.asm b/src/constants/npc_constants.asm index 113d790..eb7b75b 100644 --- a/src/constants/npc_constants.asm +++ b/src/constants/npc_constants.asm @@ -180,12 +180,12 @@ const_value = const_value+1 ; DRMASON duplicate const NPC_TECH7 ; $65 const NPC_TECH8 ; $66 const NPC_TORCH ; $67 - const NPC_LEGEND_CARDS_TOP_LEFT ; $68 - const NPC_LEGEND_CARDS_TOP_RIGHT ; $69 - const NPC_LEGEND_CARDS_LEFT_SPARK ; $6a - const NPC_LEGEND_CARDS_BOTTOM_LEFT ; $6b - const NPC_LEGEND_CARDS_BOTTOM_RIGHT ; $6c - const NPC_LEGEND_CARDS_RIGHT_SPARK ; $6d + const NPC_LEGENDARY_CARD_TOP_LEFT ; $68 + const NPC_LEGENDARY_CARD_TOP_RIGHT ; $69 + const NPC_LEGENDARY_CARD_LEFT_SPARK ; $6a + const NPC_LEGENDARY_CARD_BOTTOM_LEFT ; $6b + const NPC_LEGENDARY_CARD_BOTTOM_RIGHT ; $6c + const NPC_LEGENDARY_CARD_RIGHT_SPARK ; $6d const NPC_11F49 ; $6e const_value = const_value+1 ; NPC_11F49 duplicate const NPC_MURRAY2 ; $70 diff --git a/src/constants/script_constants.asm b/src/constants/script_constants.asm index 05aaf57..9607ba0 100644 --- a/src/constants/script_constants.asm +++ b/src/constants/script_constants.asm @@ -33,7 +33,7 @@ const EVENT_FLAG_1F ; $1f const EVENT_FLAG_20 ; $20 const EVENT_FLAG_21 ; $21 - const EVENT_RECEIVED_LEGEND_CARDS ; $22 + const EVENT_RECEIVED_LEGENDARY_CARD ; $22 const EVENT_FLAG_23 ; $23 const EVENT_FLAG_24 ; $24 const EVENT_FLAG_25 ; $25 -- cgit v1.2.3 From c4183f69cd8cb0fe1482cac8487efaf68160a411 Mon Sep 17 00:00:00 2001 From: ElectroDeoxys Date: Thu, 7 May 2020 15:42:13 +0100 Subject: Deck AI macros and tidying --- src/constants/duel_constants.asm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/constants') diff --git a/src/constants/duel_constants.asm b/src/constants/duel_constants.asm index 47ca1ad..dd692d0 100644 --- a/src/constants/duel_constants.asm +++ b/src/constants/duel_constants.asm @@ -246,7 +246,11 @@ AI_ENERGY_FLAG_SKIP_ARENA_CARD EQU 1 << 7 ; whether to include Arena card in det ; used to determine which Trainer cards for AI ; to process in AIProcessHandTrainerCards. -; aside from a few exceptions, these go in chronological order. +; these go in chronological order, except for +; AI_TRAINER_CARD_PHASE_14 which happens just before AI attacks. +; AI_TRAINER_CARD_PHASE_15 is reserved for Professor Oak card. +; if Professor Oak is played, all other Trainer card phases +; are processed again except AI_TRAINER_CARD_PHASE_15. const_def 1 const AI_TRAINER_CARD_PHASE_01 ; $1 const AI_TRAINER_CARD_PHASE_02 ; $2 @@ -261,10 +265,17 @@ AI_ENERGY_FLAG_SKIP_ARENA_CARD EQU 1 << 7 ; whether to include Arena card in det const AI_TRAINER_CARD_PHASE_11 ; $b const AI_TRAINER_CARD_PHASE_12 ; $c const AI_TRAINER_CARD_PHASE_13 ; $d - const AI_TRAINER_CARD_PHASE_14 ; $e - const AI_TRAINER_CARD_PHASE_15 ; $f + const AI_TRAINER_CARD_PHASE_14 ; $e, just before attack + const AI_TRAINER_CARD_PHASE_15 ; $f, for Professor Oak ; used by wAIBarrierFlagCounter to determine ; whether Player is running Mewtwo1 mill deck. ; flag set means true, flag not set means false. AI_FLAG_MEWTWO_MILL EQU 1 << 7 + +; defines the behaviour of HandleAIEnergyTrans, for determining +; whether to move energy cards from the Bench to the Arena or vice-versa +; and the number of energy cards needed for achieving that. +AI_ENERGY_TRANS_RETREAT EQU $9 ; moves energy cards needed for Retreat Cost +AI_ENERGY_TRANS_ATTACK EQU $d ; moves energy cards needed for second attack +AI_ENERGY_TRANS_TO_BENCH EQU $e ; moves energy cards away from Arena card -- cgit v1.2.3 From 86d8cfb0fd86326e4534fc33c7bb384d515bbe0e Mon Sep 17 00:00:00 2001 From: ElectroDeoxys Date: Sat, 9 May 2020 12:11:05 +0100 Subject: Separate AI constants and new AIACTION_* --- src/constants/deck_ai_constants.asm | 61 +++++++++++++++++++++++++++++++++++++ src/constants/duel_constants.asm | 53 -------------------------------- 2 files changed, 61 insertions(+), 53 deletions(-) create mode 100644 src/constants/deck_ai_constants.asm (limited to 'src/constants') diff --git a/src/constants/deck_ai_constants.asm b/src/constants/deck_ai_constants.asm new file mode 100644 index 0000000..ceae8ed --- /dev/null +++ b/src/constants/deck_ai_constants.asm @@ -0,0 +1,61 @@ +; wPreviousAIFlags and wCurrentAIFlags constants +AI_FLAG_USED_PLUSPOWER EQU 1 << 0 +AI_FLAG_USED_SWITCH EQU 1 << 1 +AI_FLAG_USED_PROFESSOR_OAK EQU 1 << 2 +AI_FLAG_MODIFIED_HAND EQU 1 << 3 +AI_FLAG_USED_GUST_OF_WIND EQU 1 << 4 + +; used as input for AIProcessEnergyCards to determine what to check +; and whether to play card after the routine is over. +; I suspect AI_ENERGY_FLAG_DONT_PLAY to be a flag to signal the routine +; not to actually play the energy card after it's finished, +; but AIProcessEnergyCards checks whether ANY flag is set in order +; to decide not to play it, so it's redundant in the presence of another flag. +AI_ENERGY_FLAG_DONT_PLAY EQU 1 << 0 ; whether to play energy card (?) +AI_ENERGY_FLAG_SKIP_EVOLUTION EQU 1 << 1 ; whether to check if card has evolutions +AI_ENERGY_FLAG_SKIP_ARENA_CARD EQU 1 << 7 ; whether to include Arena card in determining which card to attach energy + +; used to determine which Trainer cards for AI +; to process in AIProcessHandTrainerCards. +; these go in chronological order, except for +; AI_TRAINER_CARD_PHASE_14 which happens just before AI attacks. +; AI_TRAINER_CARD_PHASE_15 is reserved for Professor Oak card. +; if Professor Oak is played, all other Trainer card phases +; are processed again except AI_TRAINER_CARD_PHASE_15. + const_def 1 + const AI_TRAINER_CARD_PHASE_01 ; $1 + const AI_TRAINER_CARD_PHASE_02 ; $2 + const AI_TRAINER_CARD_PHASE_03 ; $3 + const AI_TRAINER_CARD_PHASE_04 ; $4 + const AI_TRAINER_CARD_PHASE_05 ; $5 + const AI_TRAINER_CARD_PHASE_06 ; $6 + const AI_TRAINER_CARD_PHASE_07 ; $7 + const AI_TRAINER_CARD_PHASE_08 ; $8 + const AI_TRAINER_CARD_PHASE_09 ; $9 + const AI_TRAINER_CARD_PHASE_10 ; $a + const AI_TRAINER_CARD_PHASE_11 ; $b + const AI_TRAINER_CARD_PHASE_12 ; $c + const AI_TRAINER_CARD_PHASE_13 ; $d + const AI_TRAINER_CARD_PHASE_14 ; $e, just before attack + const AI_TRAINER_CARD_PHASE_15 ; $f, for Professor Oak + +; used by wAIBarrierFlagCounter to determine +; whether Player is running Mewtwo1 mill deck. +; flag set means true, flag not set means false. +AI_FLAG_MEWTWO_MILL EQU 1 << 7 + +; defines the behaviour of HandleAIEnergyTrans, for determining +; whether to move energy cards from the Bench to the Arena or vice-versa +; and the number of energy cards needed for achieving that. +AI_ENERGY_TRANS_RETREAT EQU $9 ; moves energy cards needed for Retreat Cost +AI_ENERGY_TRANS_ATTACK EQU $d ; moves energy cards needed for second attack +AI_ENERGY_TRANS_TO_BENCH EQU $e ; moves energy cards away from Arena card + +; used to know which AI routine to call in +; the AIAction pointer tables in AIDoAction + const_def 1 + const AIACTION_DO_TURN ; $1 + const AIACTION_START_DUEL ; $2 + const AIACTION_FORCED_SWITCH ; $3 + const AIACTION_KO_SWITCH ; $4 + const AIACTION_TAKE_PRIZE ; $5 diff --git a/src/constants/duel_constants.asm b/src/constants/duel_constants.asm index dd692d0..d461d24 100644 --- a/src/constants/duel_constants.asm +++ b/src/constants/duel_constants.asm @@ -226,56 +226,3 @@ EFFECT_FAILED_UNSUCCESSFUL EQU $02 ; wAnimationQueue length ANIMATION_QUEUE_LENGTH EQU 7 - -; wPreviousAIFlags and wCurrentAIFlags constants -AI_FLAG_USED_PLUSPOWER EQU 1 << 0 -AI_FLAG_USED_SWITCH EQU 1 << 1 -AI_FLAG_USED_PROFESSOR_OAK EQU 1 << 2 -AI_FLAG_MODIFIED_HAND EQU 1 << 3 -AI_FLAG_USED_GUST_OF_WIND EQU 1 << 4 - -; used as input for AIProcessEnergyCards to determine what to check -; and whether to play card after the routine is over. -; I suspect AI_ENERGY_FLAG_DONT_PLAY to be a flag to signal the routine -; not to actually play the energy card after it's finished, -; but AIProcessEnergyCards checks whether ANY flag is set in order -; to decide not to play it, so it's redundant in the presence of another flag. -AI_ENERGY_FLAG_DONT_PLAY EQU 1 << 0 ; whether to play energy card (?) -AI_ENERGY_FLAG_SKIP_EVOLUTION EQU 1 << 1 ; whether to check if card has evolutions -AI_ENERGY_FLAG_SKIP_ARENA_CARD EQU 1 << 7 ; whether to include Arena card in determining which card to attach energy - -; used to determine which Trainer cards for AI -; to process in AIProcessHandTrainerCards. -; these go in chronological order, except for -; AI_TRAINER_CARD_PHASE_14 which happens just before AI attacks. -; AI_TRAINER_CARD_PHASE_15 is reserved for Professor Oak card. -; if Professor Oak is played, all other Trainer card phases -; are processed again except AI_TRAINER_CARD_PHASE_15. - const_def 1 - const AI_TRAINER_CARD_PHASE_01 ; $1 - const AI_TRAINER_CARD_PHASE_02 ; $2 - const AI_TRAINER_CARD_PHASE_03 ; $3 - const AI_TRAINER_CARD_PHASE_04 ; $4 - const AI_TRAINER_CARD_PHASE_05 ; $5 - const AI_TRAINER_CARD_PHASE_06 ; $6 - const AI_TRAINER_CARD_PHASE_07 ; $7 - const AI_TRAINER_CARD_PHASE_08 ; $8 - const AI_TRAINER_CARD_PHASE_09 ; $9 - const AI_TRAINER_CARD_PHASE_10 ; $a - const AI_TRAINER_CARD_PHASE_11 ; $b - const AI_TRAINER_CARD_PHASE_12 ; $c - const AI_TRAINER_CARD_PHASE_13 ; $d - const AI_TRAINER_CARD_PHASE_14 ; $e, just before attack - const AI_TRAINER_CARD_PHASE_15 ; $f, for Professor Oak - -; used by wAIBarrierFlagCounter to determine -; whether Player is running Mewtwo1 mill deck. -; flag set means true, flag not set means false. -AI_FLAG_MEWTWO_MILL EQU 1 << 7 - -; defines the behaviour of HandleAIEnergyTrans, for determining -; whether to move energy cards from the Bench to the Arena or vice-versa -; and the number of energy cards needed for achieving that. -AI_ENERGY_TRANS_RETREAT EQU $9 ; moves energy cards needed for Retreat Cost -AI_ENERGY_TRANS_ATTACK EQU $d ; moves energy cards needed for second attack -AI_ENERGY_TRANS_TO_BENCH EQU $e ; moves energy cards away from Arena card -- cgit v1.2.3