From 7dc95a0103af08c95c9093b6efa6c77af77a2538 Mon Sep 17 00:00:00 2001 From: aaaaaa123456789 Date: Sun, 13 Sep 2020 04:22:50 -0300 Subject: Undo PokeCodec's PRs This commit undoes most of PokeCodec's PRs after the debate in chat. Some harmless or completely superseded PRs have been left alone, as there is not much benefit in attempting to undo them. Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136, #1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179, #1180, #1181, #1182 and #1183. --- include/constants/battle.h | 2 +- include/constants/battle_pyramid.h | 10 ++++++++++ include/constants/rgb.h | 4 ---- 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'include/constants') diff --git a/include/constants/battle.h b/include/constants/battle.h index fa8f422c4..8b860e384 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -186,7 +186,7 @@ #define HITMARKER_x4000000 (1 << 26) #define HITMARKER_CHARGING (1 << 27) #define HITMARKER_FAINTED(battler) (gBitTable[battler] << 28) -#define HITMARKER_FAINTED2(battler) ((1 << 28) << battler) +#define HITMARKER_FAINTED2(battler) (1 << (28 + battler)) // Per-side statuses that affect an entire party #define SIDE_STATUS_REFLECT (1 << 0) diff --git a/include/constants/battle_pyramid.h b/include/constants/battle_pyramid.h index 378197a4d..004df7155 100644 --- a/include/constants/battle_pyramid.h +++ b/include/constants/battle_pyramid.h @@ -7,6 +7,16 @@ #define FLOOR_WALKABLE_METATILE 0x28D #define FLOOR_EXIT_METATILE 0x28E +#define HINT_EXIT_DIRECTION 0 +#define HINT_REMAINING_ITEMS 1 +#define HINT_REMAINING_TRAINERS 2 +#define HINT_EXIT_SHORT_REMAINING_TRAINERS 3 +#define HINT_EXIT_SHORT_REMAINING_ITEMS 4 +#define HINT_EXIT_MEDIUM_REMAINING_TRAINERS 5 +#define HINT_EXIT_MEDIUM_REMAINING_ITEMS 6 +#define HINT_EXIT_FAR_REMAINING_TRAINERS 7 +#define HINT_EXIT_FAR_REMAINING_ITEMS 8 + #define OBJ_TRAINERS 0 #define OBJ_ITEMS 1 diff --git a/include/constants/rgb.h b/include/constants/rgb.h index 1896250d2..80d951f4b 100644 --- a/include/constants/rgb.h +++ b/include/constants/rgb.h @@ -1,10 +1,6 @@ #ifndef GUARD_RGB_H #define GUARD_RGB_H -#define GET_R(color) ((color) & 0x1F) -#define GET_G(color) (((color) >> 5) & 0x1F) -#define GET_B(color) (((color) >> 10) & 0x1F) - #define RGB(r, g, b) ((r) | ((g) << 5) | ((b) << 10)) #define RGB2(r, g, b) (((b) << 10) | ((g) << 5) | (r)) #define _RGB(r, g, b) ((((b) & 0x1F) << 10) + (((g) & 0x1F) << 5) + ((r) & 0x1F)) -- cgit v1.2.3 From 66bd1e6d3f8ddc96b9a8be7d73ff084031072292 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 25 Sep 2020 11:18:52 -0400 Subject: Use constants for item digits --- include/constants/items.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/constants') diff --git a/include/constants/items.h b/include/constants/items.h index 9496a4c61..95c6aacfe 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -497,6 +497,10 @@ #define MAX_PC_ITEM_CAPACITY 999 #define MAX_BERRY_CAPACITY 999 +#define BAG_ITEM_CAPACITY_DIGITS 2 +#define BERRY_CAPACITY_DIGITS 3 +#define MAX_ITEM_DIGITS BERRY_CAPACITY_DIGITS + // Secondary IDs for rods #define OLD_ROD 0 #define GOOD_ROD 1 -- cgit v1.2.3 From 65a4e067378b53225536d060d10fa306b6f045c2 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 5 Oct 2020 18:48:51 -0400 Subject: Add ITEM6_HEAL constants, change move flags to shifts --- include/constants/item_effects.h | 5 +++++ include/constants/pokemon.h | 44 ++++++++++++++++++++-------------------- 2 files changed, 27 insertions(+), 22 deletions(-) (limited to 'include/constants') diff --git a/include/constants/item_effects.h b/include/constants/item_effects.h index 49fcedc61..6e61c4d7f 100644 --- a/include/constants/item_effects.h +++ b/include/constants/item_effects.h @@ -51,6 +51,11 @@ // fields 6 and onwards are item-specific arguments +// Special HP recovery amounts for ITEM4_HEAL_HP +#define ITEM6_HEAL_FULL ((u8) -1) +#define ITEM6_HEAL_HALF ((u8) -2) +#define ITEM6_HEAL_LVL_UP ((u8) -3) + // Used for GetItemEffectType. #define ITEM_EFFECT_X_ITEM 0 #define ITEM_EFFECT_RAISE_LEVEL 1 diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 52eabe71b..4cf0bd4f0 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -239,12 +239,12 @@ #define UNOWN_FORM_COUNT 28 // Battle move flags -#define FLAG_MAKES_CONTACT 0x1 -#define FLAG_PROTECT_AFFECTED 0x2 -#define FLAG_MAGICCOAT_AFFECTED 0x4 -#define FLAG_SNATCH_AFFECTED 0x8 -#define FLAG_MIRROR_MOVE_AFFECTED 0x10 -#define FLAG_KINGSROCK_AFFECTED 0x20 +#define FLAG_MAKES_CONTACT (1 << 0) +#define FLAG_PROTECT_AFFECTED (1 << 1) +#define FLAG_MAGICCOAT_AFFECTED (1 << 2) +#define FLAG_SNATCH_AFFECTED (1 << 3) +#define FLAG_MIRROR_MOVE_AFFECTED (1 << 4) +#define FLAG_KINGSROCK_AFFECTED (1 << 5) // Growth rates #define GROWTH_MEDIUM_FAST 0 @@ -268,22 +268,22 @@ #define F_SUMMARY_SCREEN_FLIP_SPRITE 0x80 -// Evolution type flags -#define EVO_FRIENDSHIP 0x0001 // Pokémon levels up with friendship ≥ 220 -#define EVO_FRIENDSHIP_DAY 0x0002 // Pokémon levels up during the day with friendship ≥ 220 -#define EVO_FRIENDSHIP_NIGHT 0x0003 // Pokémon levels up at night with friendship ≥ 220 -#define EVO_LEVEL 0x0004 // Pokémon reaches the specified level -#define EVO_TRADE 0x0005 // Pokémon is traded -#define EVO_TRADE_ITEM 0x0006 // Pokémon is traded while it's holding the specified item -#define EVO_ITEM 0x0007 // specified item is used on Pokémon -#define EVO_LEVEL_ATK_GT_DEF 0x0008 // Pokémon reaches the specified level with attack > defense -#define EVO_LEVEL_ATK_EQ_DEF 0x0009 // Pokémon reaches the specified level with attack = defense -#define EVO_LEVEL_ATK_LT_DEF 0x000a // Pokémon reaches the specified level with attack < defense -#define EVO_LEVEL_SILCOON 0x000b // Pokémon reaches the specified level with a Silcoon personality value -#define EVO_LEVEL_CASCOON 0x000c // Pokémon reaches the specified level with a Cascoon personality value -#define EVO_LEVEL_NINJASK 0x000d // Pokémon reaches the specified level (special value for Ninjask) -#define EVO_LEVEL_SHEDINJA 0x000e // Pokémon reaches the specified level (special value for Shedinja) -#define EVO_BEAUTY 0x000f // Pokémon levels up with beauty ≥ specified value +// Evolution types +#define EVO_FRIENDSHIP 1 // Pokémon levels up with friendship ≥ 220 +#define EVO_FRIENDSHIP_DAY 2 // Pokémon levels up during the day with friendship ≥ 220 +#define EVO_FRIENDSHIP_NIGHT 3 // Pokémon levels up at night with friendship ≥ 220 +#define EVO_LEVEL 4 // Pokémon reaches the specified level +#define EVO_TRADE 5 // Pokémon is traded +#define EVO_TRADE_ITEM 6 // Pokémon is traded while it's holding the specified item +#define EVO_ITEM 7 // specified item is used on Pokémon +#define EVO_LEVEL_ATK_GT_DEF 8 // Pokémon reaches the specified level with attack > defense +#define EVO_LEVEL_ATK_EQ_DEF 9 // Pokémon reaches the specified level with attack = defense +#define EVO_LEVEL_ATK_LT_DEF 10 // Pokémon reaches the specified level with attack < defense +#define EVO_LEVEL_SILCOON 11 // Pokémon reaches the specified level with a Silcoon personality value +#define EVO_LEVEL_CASCOON 12 // Pokémon reaches the specified level with a Cascoon personality value +#define EVO_LEVEL_NINJASK 13 // Pokémon reaches the specified level (special value for Ninjask) +#define EVO_LEVEL_SHEDINJA 14 // Pokémon reaches the specified level (special value for Shedinja) +#define EVO_BEAUTY 15 // Pokémon levels up with beauty ≥ specified value #define EVOS_PER_MON 5 -- cgit v1.2.3 From 90211248af2f02aa696b38fbf77ddfd2d2950312 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Fri, 23 Oct 2020 20:47:10 -0400 Subject: re-match Cmd_unknown_24 (from #1140) changes to data structs are necessary. other things that look unnecessary, like the order of operands, are also necessary. fuck this function. --- include/constants/battle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/constants') diff --git a/include/constants/battle.h b/include/constants/battle.h index 8b860e384..fa8f422c4 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -186,7 +186,7 @@ #define HITMARKER_x4000000 (1 << 26) #define HITMARKER_CHARGING (1 << 27) #define HITMARKER_FAINTED(battler) (gBitTable[battler] << 28) -#define HITMARKER_FAINTED2(battler) (1 << (28 + battler)) +#define HITMARKER_FAINTED2(battler) ((1 << 28) << battler) // Per-side statuses that affect an entire party #define SIDE_STATUS_REFLECT (1 << 0) -- cgit v1.2.3 From 44c2d15ca9f3b1b758fc70acdf6d0cf1cf74cf5f Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Fri, 23 Oct 2020 22:07:30 -0400 Subject: re-match sub_81C79BC (from #1177) also re-define RBG macros --- include/constants/rgb.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/constants') diff --git a/include/constants/rgb.h b/include/constants/rgb.h index 80d951f4b..1896250d2 100644 --- a/include/constants/rgb.h +++ b/include/constants/rgb.h @@ -1,6 +1,10 @@ #ifndef GUARD_RGB_H #define GUARD_RGB_H +#define GET_R(color) ((color) & 0x1F) +#define GET_G(color) (((color) >> 5) & 0x1F) +#define GET_B(color) (((color) >> 10) & 0x1F) + #define RGB(r, g, b) ((r) | ((g) << 5) | ((b) << 10)) #define RGB2(r, g, b) (((b) << 10) | ((g) << 5) | (r)) #define _RGB(r, g, b) ((((b) & 0x1F) << 10) + (((g) & 0x1F) << 5) + ((r) & 0x1F)) -- cgit v1.2.3 From 513c7c5f45b3c79e710ea1e48298d8a7bf9bb591 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 23 Nov 2020 14:41:22 -0500 Subject: Clarify Kecleon objects --- include/constants/event_objects.h | 4 ++-- include/constants/flags.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include/constants') diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index ca312e957..8e026ef2d 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -205,7 +205,7 @@ #define OBJ_EVENT_GFX_REGICE 201 #define OBJ_EVENT_GFX_REGISTEEL 202 #define OBJ_EVENT_GFX_SKITTY 203 -#define OBJ_EVENT_GFX_KECLEON_1 204 +#define OBJ_EVENT_GFX_KECLEON 204 #define OBJ_EVENT_GFX_KYOGRE_2 205 #define OBJ_EVENT_GFX_GROUDON_2 206 #define OBJ_EVENT_GFX_RAYQUAZA_2 207 @@ -213,7 +213,7 @@ #define OBJ_EVENT_GFX_PIKACHU 209 #define OBJ_EVENT_GFX_AZUMARILL 210 #define OBJ_EVENT_GFX_WINGULL 211 -#define OBJ_EVENT_GFX_KECLEON_2 212 +#define OBJ_EVENT_GFX_KECLEON_BRIDGE_SHADOW 212 #define OBJ_EVENT_GFX_TUBER_M_SWIMMING 213 #define OBJ_EVENT_GFX_AZURILL 214 #define OBJ_EVENT_GFX_MOM 215 diff --git a/include/constants/flags.h b/include/constants/flags.h index a562b0670..9be269105 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -1012,7 +1012,7 @@ #define FLAG_HIDE_MOSSDEEP_CITY_STEVENS_HOUSE_STEVEN 0x3C7 #define FLAG_HIDE_MOSSDEEP_CITY_STEVENS_HOUSE_BELDUM_POKEBALL 0x3C8 #define FLAG_HIDE_FORTREE_CITY_KECLEON 0x3C9 -#define FLAG_HIDE_ROUTE_120_KECLEON_BRIDGE_INVISIBLE 0x3CA +#define FLAG_HIDE_ROUTE_120_KECLEON_BRIDGE 0x3CA #define FLAG_HIDE_LILYCOVE_CITY_RIVAL 0x3CB #define FLAG_HIDE_ROUTE_120_STEVEN 0x3CC #define FLAG_HIDE_SOOTOPOLIS_CITY_STEVEN 0x3CD @@ -1023,7 +1023,7 @@ #define FLAG_HIDE_AQUA_HIDEOUT_B1F_ELECTRODE_2 0x3D2 #define FLAG_HIDE_OLDALE_TOWN_RIVAL 0x3D3 #define FLAG_HIDE_UNDERWATER_SEA_FLOOR_CAVERN_STOLEN_SUBMARINE 0x3D4 -#define FLAG_HIDE_ROUTE_120_KECLEON_BRIDGE_VISIBLE 0x3D5 +#define FLAG_HIDE_ROUTE_120_KECLEON_BRIDGE_SHADOW 0x3D5 #define FLAG_HIDE_ROUTE_120_KECLEON_1 0x3D6 #define FLAG_HIDE_RUSTURF_TUNNEL_WANDA 0x3D7 #define FLAG_HIDE_VERDANTURF_TOWN_WANDAS_HOUSE_WANDA 0x3D8 -- cgit v1.2.3