Merge branch 'master' into aug_sept_2024

This commit is contained in:
Seth Barberee 2024-10-04 08:41:12 -07:00 committed by GitHub
commit d4bbe9ccaf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 80 additions and 132 deletions

View File

@ -18,6 +18,20 @@ typedef struct unkStruct_202EE8C
extern unkStruct_202EE8C gUnknown_202EE8C[32];
// size: 0x4DD8
struct UnkBgStruct
{
OpenedFile *unk0[5];
u8 padding[0x4C4C - 0x14];
unkStruct_202EE8C unk4C4C[16];
u32 unk4DCC;
u32 unk4DD0;
/* 0x4DD4 */ s16 xoffset;
/* 0x4DD6 */ s16 yoffset;
};
extern struct UnkBgStruct *gUnknown_203B0E4;
// size: Variable
typedef struct unkDataFor8004AA4
{

View File

@ -1,42 +0,0 @@
#ifndef GUARD_CODE_800F958_H
#define GUARD_CODE_800F958_H
#include "structs/str_dungeon.h"
// size: 0x8
typedef struct DungeonPokemonStatusSprite
{
/* 0x0 */ u32 status;
/* 0x4 */ u32 frame;
} DungeonPokemonStatusSprite;
// size: 0x40
typedef struct DungeonPokemonSprite
{
/* 0x0 */ u8 exists;
/* 0x4 */ u32 id;
/* 0x8 */ u16 species; // Or sprite ID?
/* 0xA */ u16 unkA;
/* 0xC */ u32 status;
/* 0x10 */ u8 visible;
/* 0x11 */ u8 unk11;
/* 0x14 */ Position pos;
/* 0x18 */ Position statusOffsets[2];
/* 0x20 */ u32 unk20;
/* 0x24 */ u32 unk24;
/* 0x28 */ DungeonPokemonStatusSprite statusSprites[2];
/* 0x38 */ u8 unk38;
/* 0x3C */ u16 unk3C;
/* 0x3E */ u16 unk3E;
} DungeonPokemonSprite;
// size: 0x584
typedef struct DungeonPokemonSprites
{
/* 0x0 */ u32 frame;
/* 0x4 */ DungeonPokemonSprite sprites[22];
} DungeonPokemonSprites;
void sub_800F958(s32 dungeonSpriteID, Position *pos, Position *statusOffsets, u32 a3);
#endif

View File

@ -1,33 +0,0 @@
#ifndef GUARD_CODE_8010EF0_H
#define GUARD_CODE_8010EF0_H
#include "file_system.h"
#include "structs/rgb.h"
// size: 0x18
typedef struct unkStruct_202EE8C
{
u32 unk0;
u16 unk4;
s16 unk6;
RGB *unk8;
RGB *unkC;
RGB *unk10;
RGB unk14;
} unkStruct_202EE8C;
// size: 0x4DD8
struct UnkBgStruct
{
OpenedFile *unk0[5];
u8 padding[0x4C4C - 0x14];
unkStruct_202EE8C unk4C4C[16];
u32 unk4DCC;
u32 unk4DD0;
/* 0x4DD4 */ s16 xoffset;
/* 0x4DD6 */ s16 yoffset;
};
void sub_8010EF0(void);
#endif

View File

@ -1,7 +1,6 @@
#ifndef GUARD_CODE_801AFA4_H
#define GUARD_CODE_801AFA4_H
#include "global.h"
#include "constants/move.h"
#include "structs/menu.h"
#include "pokemon.h"
@ -26,4 +25,4 @@ bool8 sub_801AFA4(u32 index);
u32 sub_801B00C(void);
void sub_801B048(void);
#endif // GUARD_CODE_801AFA4_H
#endif // GUARD_CODE_801AFA4_H

View File

@ -1,6 +1,7 @@
#ifndef GUARD_CODE_8041AD0_H
#define GUARD_CODE_8041AD0_H
#include "structs/dungeon_entity.h"
#include "structs/str_damage.h"
void sub_80420E8(Entity *pokemon, struct DamageStruct *dmgStruct);

View File

@ -1,6 +1,8 @@
#ifndef GUARD_CODE_8077274_1_H
#define GUARD_CODE_8077274_1_H
#include "structs/dungeon_entity.h"
void MuzzleTarget(Entity *pokemon, Entity *target);
void TransformStatusTarget(Entity * pokemon, Entity * target);
void MobileStatusTarget(Entity * pokemon, Entity * target);

View File

@ -1,6 +1,8 @@
#ifndef GUARD_808417C_H
#define GUARD_808417C_H
#include "structs/dungeon_entity.h"
s32 CalculateStatusTurns(Entity *target, s16 *turnRange, bool8 factorCurerSkills);
#endif // GUARD_808417C_H

View File

@ -1,7 +1,7 @@
#ifndef GUARD_CONSTANTS_DUNGEON_ACTION_H
#define GUARD_CONSTANTS_DUNGEON_ACTION_H
enum Action
enum DungeonAction
{
ACTION_NOTHING = 0x0,
ACTION_PASS_TURN = 0x1,

View File

@ -1,6 +1,11 @@
#ifndef INCLUDE_FRIEND_LIST_MENU_H
#define INCLUDE_FRIEND_LIST_MENU_H
#include "structs/menu.h"
#include "structs/str_items.h"
#include "structs/str_moves.h"
#include "structs/str_pokemon.h"
// there might be more overlap with unkStruct_203B2BC
// I was working on the moves and put the data that seemed to correspond to that
// into a separate struct

View File

@ -1,10 +1,10 @@
#ifndef GUARD_GULPIN_SHOP_H
#define GUARD_GULPIN_SHOP_H
#include "constants/move.h"
#include "file_system.h"
#include "structs/menu.h"
#include "structs/str_text.h"
#include "structs/str_moves.h"
// size: 0x18C
typedef struct GulpinShopWork
@ -42,4 +42,4 @@ bool8 GulpinIsNextMoveLinked(void);
u32 sub_801E8C0(void);
#endif // GUARD_GULPIN_SHOP_H
#endif // GUARD_GULPIN_SHOP_H

View File

@ -1,7 +1,7 @@
#ifndef GUARD_MATH_H
#define GUARD_MATH_H
#include "global.h"
#include "gba/types.h"
/**
* This type represents a signed 24.8 fixed-point number, where the 24 most
@ -87,7 +87,7 @@ s24_8 s24_8_mul(s24_8 x, s24_8 y);
*
* @returns The quotient `x/y` as a signed 24.8 fixed-point number.
*/
s32 s24_8_div(s32 r0, s32 r1);
s32 s24_8_div(s32 x, s32 y);
/**
* This function multiplies two unsigned 24.8 fixed-point numbers.

View File

@ -1,6 +1,8 @@
#ifndef GUARD_MOVE_CHECKS_H
#define GUARD_MOVE_CHECKS_H
#include "structs/dungeon_entity.h"
bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move);
bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move);
bool8 HasDisabledMove(Move *moves);

View File

@ -1,3 +1,8 @@
#ifndef GUARD_PELIPPER_BOARD_H
#define GUARD_PELIPPER_BOARD_H
#include "structs/menu.h"
#include "structs/str_802C39C.h"
// Guessing based off of 203B304
struct unkStruct_203B308
@ -36,3 +41,4 @@ enum PelipperBoardActions
PELIPPER_BOARD_ACCEPT,
PELIPPER_BOARD_INFO,
};
#endif // GUARD_PELIPPER_BOARD_H

View File

@ -1,6 +1,8 @@
#ifndef GUARD_SAVE_MENU_H
#define GUARD_SAVE_MENU_H
#include "structs/menu.h"
// size: 0x1B4
typedef struct SaveMenuWork
{
@ -16,4 +18,4 @@ void CleanSaveMenu(void);
void CreateSaveMenu(s32 currMenu);
s32 UpdateSaveMenu(void);
#endif // GUARD_SAVE_MENU_H
#endif // GUARD_SAVE_MENU_H

View File

@ -1,7 +1,6 @@
#ifndef GUARD_STR_DUNGEON_H
#define GUARD_STR_DUNGEON_H
#include "global.h"
#include "constants/monster.h"
#include "structs/dungeon_entity.h"
#include "file_system.h"

View File

@ -1,7 +1,6 @@
#ifndef GUARD_TYPE_CHART_H
#define GUARD_TYPE_CHART_H
#include "global.h"
#include "constants/type.h"
#define NUM_EFFECTIVENESS 4
@ -14,4 +13,4 @@
// [Attacking type][Defending type]
extern const s16 gTypeEffectivenessChart[NUM_TYPES][NUM_TYPES];
#endif
#endif

View File

@ -1,8 +1,7 @@
#include "global.h"
#include "code_800F958.h"
#include "dungeon_pokemon_sprites.h"
#include "memory.h"
extern DungeonPokemonSprites *gDungeonPokemonSprites;
extern DungeonPokemonSprite *NewDungeonPokemonSprite(void);
extern DungeonPokemonSprite* GetDungeonPokemonSprite(s32 id);

View File

@ -1,9 +1,5 @@
#include "global.h"
#include "code_8010EF0.h"
extern struct UnkBgStruct *gUnknown_203B0E4;
extern void CloseFile(OpenedFile *);
#include "code_8004AA0.h"
void sub_8010EF0(void)
{

View File

@ -17,20 +17,6 @@
#include "event_flag.h"
#include "file_system.h"
// size: 0x4DD8
struct UnkBgStruct
{
OpenedFile *unk0[5];
u8 padding[0x4C4C - 0x14];
unkStruct_202EE8C unk4C4C[16];
u32 unk4DCC;
u32 unk4DD0;
/* 0x4DD4 */ s16 xoffset;
/* 0x4DD6 */ s16 yoffset;
};
extern struct UnkBgStruct *gUnknown_203B0E4;
extern const u16 gUnknown_80D4144[8];
EWRAM_DATA u32 gUnknown_202DE1C = {0};

25
src/data/type_chart.h Normal file
View File

@ -0,0 +1,25 @@
#define IMMUNE EFFECTIVENESS_IMMUNE
#define RESIST EFFECTIVENESS_RESIST
#define NEUTRAL EFFECTIVENESS_NEUTRAL
#define SUPER EFFECTIVENESS_SUPER
const s16 gTypeEffectivenessChart[NUM_TYPES][NUM_TYPES] = {
{NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL},
{NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, RESIST},
{NEUTRAL, NEUTRAL, RESIST, RESIST, SUPER, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, RESIST, NEUTRAL, RESIST, NEUTRAL, SUPER},
{NEUTRAL, NEUTRAL, SUPER, RESIST, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST, NEUTRAL, NEUTRAL},
{NEUTRAL, NEUTRAL, RESIST, SUPER, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, RESIST, SUPER, RESIST, NEUTRAL, RESIST, SUPER, NEUTRAL, RESIST, NEUTRAL, RESIST},
{NEUTRAL, NEUTRAL, NEUTRAL, SUPER, RESIST, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, IMMUNE, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, RESIST, NEUTRAL, NEUTRAL},
{NEUTRAL, NEUTRAL, RESIST, RESIST, SUPER, NEUTRAL, RESIST, NEUTRAL, NEUTRAL, SUPER, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST},
{NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST, NEUTRAL, RESIST, RESIST, RESIST, SUPER, NEUTRAL, NEUTRAL, SUPER, SUPER},
{NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, RESIST, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, RESIST, RESIST, NEUTRAL, NEUTRAL, IMMUNE},
{NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST, SUPER, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, IMMUNE, NEUTRAL, RESIST, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, SUPER},
{NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, RESIST, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, RESIST},
{NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, SUPER, NEUTRAL, NEUTRAL, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, IMMUNE, RESIST},
{NEUTRAL, NEUTRAL, RESIST, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, RESIST, RESIST, NEUTRAL, RESIST, SUPER, NEUTRAL, NEUTRAL, RESIST, NEUTRAL, SUPER, RESIST},
{NEUTRAL, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, RESIST, NEUTRAL, RESIST, SUPER, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, RESIST},
{NEUTRAL, IMMUNE, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST, RESIST},
{NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST},
{NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST, RESIST},
{NEUTRAL, NEUTRAL, RESIST, RESIST, NEUTRAL, RESIST, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, RESIST}
};

View File

@ -1110,8 +1110,17 @@ s32 ExecuteScriptCommand(Action *action) {
s32 cap1 = curCmd.arg1 * 2 - 1;
s32 cap2 = curCmd.arg2 * 2 - 1;
action->callbacks->getHitboxCenter(action->parentObject, &scriptData->pos1);
// BUG: (or two): these lines use the wrong script command arguments to calculate the position offset
// making the target position nonsense. But even if they were correct,
// the way the cap is calculated would make the random offset biased off-center.
// This doesn't affect the released version because these script commands are never used.
#ifndef BUGFIX
scriptData->pos2.x = scriptData->pos1.x + ((OtherRandInt(cap1) - curCmd.argShort) << 8);
scriptData->pos2.y = scriptData->pos1.y + ((OtherRandInt(cap2) - curCmd.arg1) << 8);
#else
scriptData->pos2.x = scriptData->pos1.x + ((OtherRandInt(curCmd.arg1 * 2 + 1) - curCmd.arg1) << 8);
scriptData->pos2.y = scriptData->pos1.y + ((OtherRandInt(curCmd.arg2 * 2 + 1) - curCmd.arg2) << 8);
#endif
if (curCmd.op == 0x7f || curCmd.op == 0x85) {
scriptData->unk2A = sub_8009FB8(scriptData->pos2.x - scriptData->pos1.x, scriptData->pos2.y - scriptData->pos1.y) / curCmd.argShort;
if (scriptData->unk2A <= 0) scriptData->unk2A = 1;

View File

@ -1,27 +1,4 @@
#include "global.h"
#include "type_chart.h"
#define IMMUNE EFFECTIVENESS_IMMUNE
#define RESIST EFFECTIVENESS_RESIST
#define NEUTRAL EFFECTIVENESS_NEUTRAL
#define SUPER EFFECTIVENESS_SUPER
const s16 gTypeEffectivenessChart[NUM_TYPES][NUM_TYPES] = {
{NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL},
{NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, RESIST},
{NEUTRAL, NEUTRAL, RESIST, RESIST, SUPER, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, RESIST, NEUTRAL, RESIST, NEUTRAL, SUPER},
{NEUTRAL, NEUTRAL, SUPER, RESIST, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST, NEUTRAL, NEUTRAL},
{NEUTRAL, NEUTRAL, RESIST, SUPER, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, RESIST, SUPER, RESIST, NEUTRAL, RESIST, SUPER, NEUTRAL, RESIST, NEUTRAL, RESIST},
{NEUTRAL, NEUTRAL, NEUTRAL, SUPER, RESIST, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, IMMUNE, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, RESIST, NEUTRAL, NEUTRAL},
{NEUTRAL, NEUTRAL, RESIST, RESIST, SUPER, NEUTRAL, RESIST, NEUTRAL, NEUTRAL, SUPER, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST},
{NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST, NEUTRAL, RESIST, RESIST, RESIST, SUPER, NEUTRAL, NEUTRAL, SUPER, SUPER},
{NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, RESIST, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, RESIST, RESIST, NEUTRAL, NEUTRAL, IMMUNE},
{NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST, SUPER, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, IMMUNE, NEUTRAL, RESIST, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, SUPER},
{NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, RESIST, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, RESIST},
{NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, SUPER, NEUTRAL, NEUTRAL, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, IMMUNE, RESIST},
{NEUTRAL, NEUTRAL, RESIST, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, RESIST, RESIST, NEUTRAL, RESIST, SUPER, NEUTRAL, NEUTRAL, RESIST, NEUTRAL, SUPER, RESIST},
{NEUTRAL, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, RESIST, NEUTRAL, RESIST, SUPER, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, RESIST},
{NEUTRAL, IMMUNE, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST, RESIST},
{NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST},
{NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, RESIST, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, RESIST, RESIST},
{NEUTRAL, NEUTRAL, RESIST, RESIST, NEUTRAL, RESIST, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, NEUTRAL, SUPER, NEUTRAL, NEUTRAL, NEUTRAL, RESIST}
};
#include "data/type_chart.h"