Skip to content

Commit

Permalink
Set TYPE_NONE as type 0 + other type data tweaks (#4462)
Browse files Browse the repository at this point in the history
* Set TYPE_MYSTERY as type 0

* Remove redundant TYPE_NONE

* Moved Gen 1-3 type damage categories to gTypesInfo

* Set TYPE_NONE as 0 instead

* Grouped type info to a single file

* Fixed sTypeEffectivenessTable static name

* Adjusted MON_DATA_TERA_TYPE to account for shift in type IDs

* oops, missed the extern

* Moved Tera Type RGB values to gTypesInfo

* Fixed Tera Type test

* Added option test feature to set IVs

* Hidden Power type test

* Tera Type safeguard in givemon

* Removed isHiddenPowerType for a future PR that refactors Hidden Power

* Review changes
  • Loading branch information
AsparagusEduardo authored Jun 1, 2024
1 parent cb1b4bc commit 0be643a
Show file tree
Hide file tree
Showing 22 changed files with 729 additions and 458 deletions.
Binary file added graphics/types/none.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion graphics_file_rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ STARTERGFXDIR := graphics/starter_choose
NAMINGGFXDIR := graphics/naming_screen
SPINDAGFXDIR := graphics/pokemon/spinda/spots

types := normal fight flying poison ground rock bug ghost steel mystery fire water grass electric psychic ice dragon dark fairy stellar
types := none normal fight flying poison ground rock bug ghost steel mystery fire water grass electric psychic ice dragon dark fairy stellar
contest_types := cool beauty cute smart tough

### Tilesets ###
Expand Down
1 change: 1 addition & 0 deletions include/battle_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ extern const struct SpriteTemplate gUnusedBattleInitSprite;
extern const struct OamData gOamData_BattleSpriteOpponentSide;
extern const struct OamData gOamData_BattleSpritePlayerSide;
extern const struct TypeInfo gTypesInfo[NUMBER_OF_MON_TYPES];
extern const uq4_12_t gTypeEffectivenessTable[NUMBER_OF_MON_TYPES][NUMBER_OF_MON_TYPES];

extern const u8 gStatusConditionString_PoisonJpn[8];
extern const u8 gStatusConditionString_SleepJpn[8];
Expand Down
2 changes: 1 addition & 1 deletion include/config/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#define B_GHOSTS_ESCAPE GEN_LATEST // In Gen6+, abilities like Shadow Tag or moves like Mean Look fail on Ghost-type Pokémon. They can also escape any Wild Battle.
#define B_PARALYZE_ELECTRIC GEN_LATEST // In Gen6+, Electric-type Pokémon can't be paralyzed.
#define B_POWDER_GRASS GEN_LATEST // In Gen6+, Grass-type Pokémon are immune to powder and spore moves.
#define B_UPDATED_TYPE_MATCHUPS GEN_LATEST // Updates Type matchups. Refer to sTypeEffectivenessTable for details.
#define B_UPDATED_TYPE_MATCHUPS GEN_LATEST // Updates Type matchups. src/data/types_info.h for details.
#define B_PRANKSTER_DARK_TYPES GEN_LATEST // In Gen7+, Prankster-elevated status moves do not affect Dark type Pokémon.
#define B_SHEER_COLD_IMMUNITY GEN_LATEST // In Gen7+, Ice-types are immune to Sheer Cold
#define B_ROOST_PURE_FLYING GEN_LATEST // In Gen5+, Roost makes pure Flying-types into Normal-type.
Expand Down
44 changes: 22 additions & 22 deletions include/constants/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@
#define GUARD_CONSTANTS_POKEMON_H

// Pokémon types
#define TYPE_NONE 255
#define TYPE_NORMAL 0
#define TYPE_FIGHTING 1
#define TYPE_FLYING 2
#define TYPE_POISON 3
#define TYPE_GROUND 4
#define TYPE_ROCK 5
#define TYPE_BUG 6
#define TYPE_GHOST 7
#define TYPE_STEEL 8
#define TYPE_MYSTERY 9
#define TYPE_FIRE 10
#define TYPE_WATER 11
#define TYPE_GRASS 12
#define TYPE_ELECTRIC 13
#define TYPE_PSYCHIC 14
#define TYPE_ICE 15
#define TYPE_DRAGON 16
#define TYPE_DARK 17
#define TYPE_FAIRY 18
#define TYPE_STELLAR 19
#define NUMBER_OF_MON_TYPES 20
#define TYPE_NONE 0
#define TYPE_NORMAL 1
#define TYPE_FIGHTING 2
#define TYPE_FLYING 3
#define TYPE_POISON 4
#define TYPE_GROUND 5
#define TYPE_ROCK 6
#define TYPE_BUG 7
#define TYPE_GHOST 8
#define TYPE_STEEL 9
#define TYPE_MYSTERY 10
#define TYPE_FIRE 11
#define TYPE_WATER 12
#define TYPE_GRASS 13
#define TYPE_ELECTRIC 14
#define TYPE_PSYCHIC 15
#define TYPE_ICE 16
#define TYPE_DRAGON 17
#define TYPE_DARK 18
#define TYPE_FAIRY 19
#define TYPE_STELLAR 20
#define NUMBER_OF_MON_TYPES 21

// Pokémon egg groups
#define EGG_GROUP_NONE 0
Expand Down
3 changes: 3 additions & 0 deletions include/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ struct TypeInfo
u8 palette;
u16 zMove;
u16 maxMove;
u16 teraTypeRGBValue; // Most values pulled from the Tera type icon palette.
u16 damageCategory:2; // Used for B_PHYSICAL_SPECIAL_SPLIT <= GEN_3
u16 padding:14;
const u32 *const paletteTMHM;
//u16 enhanceItem;
//u16 berry;
Expand Down
12 changes: 12 additions & 0 deletions include/test/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,12 @@ struct moveWithPP {
#define SpAttack(spAttack) SpAttack_(__LINE__, spAttack)
#define SpDefense(spDefense) SpDefense_(__LINE__, spDefense)
#define Speed(speed) Speed_(__LINE__, speed)
#define HPIV(hpIV) HPIV_(__LINE__, hpIV)
#define AttackIV(attackIV) AttackIV_(__LINE__, attackIV)
#define DefenseIV(defenseIV) DefenseIV_(__LINE__, defenseIV)
#define SpAttackIV(spAttackIV) SpAttackIV_(__LINE__, spAttackIV)
#define SpDefenseIV(spDefenseIV) SpDefenseIV_(__LINE__, spDefenseIV)
#define SpeedIV(speedIV) SpeedIV_(__LINE__, speedIV)
#define Item(item) Item_(__LINE__, item)
#define Moves(move1, ...) do { u16 moves_[MAX_MON_MOVES] = {move1, __VA_ARGS__}; Moves_(__LINE__, moves_); } while(0)
#define MovesWithPP(movewithpp1, ...) MovesWithPP_(__LINE__, (struct moveWithPP[MAX_MON_MOVES]) {movewithpp1, __VA_ARGS__})
Expand Down Expand Up @@ -854,6 +860,12 @@ void Defense_(u32 sourceLine, u32 defense);
void SpAttack_(u32 sourceLine, u32 spAttack);
void SpDefense_(u32 sourceLine, u32 spDefense);
void Speed_(u32 sourceLine, u32 speed);
void HPIV_(u32 sourceLine, u32 hpIV);
void AttackIV_(u32 sourceLine, u32 attackIV);
void DefenseIV_(u32 sourceLine, u32 defenseIV);
void SpAttackIV_(u32 sourceLine, u32 spAttackIV);
void SpDefenseIV_(u32 sourceLine, u32 spDefenseIV);
void SpeedIV_(u32 sourceLine, u32 speedIV);
void Item_(u32 sourceLine, u32 item);
void Moves_(u32 sourceLine, u16 moves[MAX_MON_MOVES]);
void MovesWithPP_(u32 sourceLine, struct moveWithPP moveWithPP[MAX_MON_MOVES]);
Expand Down
Loading

0 comments on commit 0be643a

Please sign in to comment.