pokeemerald-expansion/include/generational_changes.h
FosterProgramming 550fe9a7de
Refactor pokerus and add configs (#7731)
Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2026-01-14 12:04:33 +01:00

30 lines
858 B
C

#ifndef GUARD_GENERATIONAL_CHANGES_H
#define GUARD_GENERATIONAL_CHANGES_H
#include "constants/generational_changes.h"
#include "config/battle.h"
#include "config/pokerus.h"
#define UNPACK_CONFIG_STRUCT(_name, _field, _typeMaxValue, ...) INVOKE_WITH_(UNPACK_CONFIG_STRUCT_, _field, UNPACK_B(_typeMaxValue));
#define UNPACK_CONFIG_STRUCT_(_field, _type, ...) _type FIRST(__VA_OPT__(_field:BIT_SIZE(FIRST(__VA_ARGS__)),) _field)
struct GenChanges
{
BATTLE_CONFIG_DEFINITIONS(UNPACK_CONFIG_STRUCT)
POKEMON_CONFIG_DEFINITIONS(UNPACK_CONFIG_STRUCT)
// Expands to:
// u32 critChance:4;
// u32 critMultiplier:4;
// ...
};
u32 GetConfig(enum ConfigTag configTag);
void SetConfig(enum ConfigTag configTag, u32 value);
#if TESTING
void TestInitConfigData(void);
void TestFreeConfigData(void);
#endif
#endif // GUARD_GENERATIONAL_CHANGES_H