mirror of
https://github.com/pret/pmd-red.git
synced 2026-04-25 07:28:17 -05:00
Fix and unify IQ struct and joinetAt struct
This commit is contained in:
parent
59675af1f9
commit
87f623136d
|
|
@ -7,7 +7,7 @@
|
|||
extern u8 gWalkableTileToCrossableTerrain[8];
|
||||
|
||||
u8 GetCrossableTerrain(s16 species);
|
||||
u8 sub_807034C(s16 id, const Tile *tile);
|
||||
u8 sub_807034C(s32 id, const Tile *tile);
|
||||
u8 sub_80703A0(Entity *pokemon, DungeonPos *pos);
|
||||
bool8 CanCrossWalls(Entity *pokemon);
|
||||
bool8 sub_807049C(Entity *pokemon, DungeonPos *pos);
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@ void CopyTacticsNameToBuffer(char *buffer, u8 tactic);
|
|||
u8 *GetIQSkillName(u8 skill);
|
||||
u8 *GetIQSkillDescription(u8 skill);
|
||||
u8 *GetTacticsDescription(u8 tactic);
|
||||
void ToggleIQSkill(u8 *param_1, u32 skillIndex);
|
||||
void SetIQSkill(u8 *param_1, u32 skillIndex);
|
||||
bool8 IsIQSkillSet(u8 *IQSkillFlags, u32 IQSkill);
|
||||
void SetDefaultIQSkills(u8 *param_1, bool8 enableSelfCurer);
|
||||
void ToggleIQSkill(IqSkillFlags *iq, u32 skillIndex);
|
||||
void SetIQSkill(IqSkillFlags *iq, u32 skillIndex);
|
||||
bool8 IsIQSkillSet(IqSkillFlags *iq, u32 IQSkillBit);
|
||||
void SetDefaultIQSkills(IqSkillFlags *iq, bool8 enableSelfCurer);
|
||||
void sub_808F468(PokemonStruct1 *param_1, EvolveStatus *evolveStatus, u8 param_3);
|
||||
u32 sub_808F734(PokemonStruct1 *pokemon, s16 _species);
|
||||
s16 ExtractSpeciesIndex(UnkDungeonGlobal_unk1CD98 *r0);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
#include "structs/str_items.h"
|
||||
#include "structs/str_moves.h"
|
||||
#include "structs/str_position.h"
|
||||
#include "structs/str_dungeon_location.h"
|
||||
#include "structs/str_iq_skill_flags.h"
|
||||
#include "math.h"
|
||||
#include "number_util.h"
|
||||
#include "sprite.h"
|
||||
|
|
@ -27,8 +29,6 @@
|
|||
#define STAT_STAGE_ACCURACY 0
|
||||
#define STAT_STAGE_EVASION 1
|
||||
|
||||
#define NUM_PICKED_IQ_SKILLS 3
|
||||
|
||||
// size: 0x8
|
||||
typedef struct unkStruct_8044CC8
|
||||
{
|
||||
|
|
@ -55,13 +55,6 @@ typedef struct HiddenPower
|
|||
/* 0x2 */ u8 hiddenPowerType;
|
||||
} HiddenPower;
|
||||
|
||||
// size: 0x4
|
||||
typedef struct JoinedAt
|
||||
{
|
||||
/* 0x0 */ u8 joinedAt;
|
||||
/* 0x1 */ u8 unk1;
|
||||
} JoinedAt;
|
||||
|
||||
// size: 0x14
|
||||
typedef struct AITarget
|
||||
{
|
||||
|
|
@ -238,7 +231,7 @@ typedef struct EntityInfo
|
|||
// Index 0 is Defense. Index 1 is Special Defense.
|
||||
/* 0x34 */ s24_8 defensiveMultipliers[2];
|
||||
/* 0x3C */ HiddenPower hiddenPower;
|
||||
/* 0x40 */ JoinedAt joinedAt; // Uses the dungeon index in dungeon.h.
|
||||
/* 0x40 */ DungeonLocation joinedAt; // Uses the dungeon index in dungeon.h.
|
||||
/* 0x44 */ ActionContainer action;
|
||||
/* 0x5C */ u8 types[2];
|
||||
/* 0x5E */ u8 abilities[2];
|
||||
|
|
@ -247,10 +240,8 @@ typedef struct EntityInfo
|
|||
/* 0x68 */ DungeonPos prevPos[NUM_PREV_POS];
|
||||
/* 0x78 */ AITarget aiTarget;
|
||||
// Bitwise flags corresponding to selected IQ skills.
|
||||
/* 0x8C */ u8 IQSkillMenuFlags[NUM_PICKED_IQ_SKILLS]; // IQ skills selected in the IQ skills menu.
|
||||
u8 padding8F;
|
||||
/* 0x90 */ u8 IQSkillFlags[NUM_PICKED_IQ_SKILLS];
|
||||
u8 padding93;
|
||||
/* 0x8C */ IqSkillFlags IQSkillMenuFlags; // IQ skills selected in the IQ skills menu.
|
||||
/* 0x90 */ IqSkillFlags IQSkillFlags;
|
||||
/* 0x94 */ u8 tactic;
|
||||
u8 fill95[0x98 - 0x95];
|
||||
/* 0x98 */ u32 unk98;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include "structs/rgb.h"
|
||||
#include "structs/str_position.h"
|
||||
#include "structs/str_traps.h"
|
||||
#include "structs/str_dungeon_location.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#define DUNGEON_MAX_SIZE_X 56
|
||||
|
|
@ -18,13 +19,6 @@
|
|||
#define DUNGEON_MAX_TRAPS 64
|
||||
#define DUNGEON_MAX_ITEMS 64
|
||||
|
||||
// size: 0x4
|
||||
typedef struct DungeonLocation
|
||||
{
|
||||
/* 0x0 */ u8 id;
|
||||
/* 0x1 */ u8 floor;
|
||||
} DungeonLocation;
|
||||
|
||||
// size: 0x18
|
||||
typedef struct Weather
|
||||
{
|
||||
|
|
|
|||
11
include/structs/str_dungeon_location.h
Normal file
11
include/structs/str_dungeon_location.h
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef GUARD_STR_DUNGEON_LOCATION_H
|
||||
#define GUARD_STR_DUNGEON_LOCATION_H
|
||||
|
||||
// size: 0x4
|
||||
typedef struct DungeonLocation
|
||||
{
|
||||
/* 0x0 */ u8 id;
|
||||
/* 0x1 */ u8 floor;
|
||||
} DungeonLocation;
|
||||
|
||||
#endif // GUARD_STR_DUNGEON_LOCATION_H
|
||||
11
include/structs/str_iq_skill_flags.h
Normal file
11
include/structs/str_iq_skill_flags.h
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef GUARD_STR_IQ_SKILL_FLAGS_H
|
||||
#define GUARD_STR_IQ_SKILL_FLAGS_H
|
||||
|
||||
#define NUM_PICKED_IQ_SKILLS 3
|
||||
|
||||
typedef struct IqSkillFlags
|
||||
{
|
||||
u8 flags[NUM_PICKED_IQ_SKILLS];
|
||||
} IqSkillFlags;
|
||||
|
||||
#endif
|
||||
|
|
@ -5,6 +5,7 @@
|
|||
#include "structs/str_dungeon.h"
|
||||
#include "structs/str_items.h"
|
||||
#include "structs/str_moves.h"
|
||||
#include "structs/str_iq_skill_flags.h"
|
||||
|
||||
// size: 0x4
|
||||
typedef struct Offense
|
||||
|
|
@ -33,7 +34,7 @@ typedef struct PokemonStruct1
|
|||
/* 0x16 */ s16 pokeHP;
|
||||
/* 0x18 */ Offense offense;
|
||||
/* 0x1C */ u32 currExp;
|
||||
/* 0x20 */ u32 IQSkills;
|
||||
/* 0x20 */ IqSkillFlags IQSkills;
|
||||
/* 0x24 */ u8 tacticIndex;
|
||||
/* 0x28 */ BulkItem heldItem;
|
||||
/* 0x2C */ Move moves[MAX_MON_MOVES];
|
||||
|
|
@ -73,7 +74,7 @@ typedef struct PokemonStruct2
|
|||
/* 0x40 */ Item itemSlot; // heldItem
|
||||
/* 0x44 */ FixedPoint belly;
|
||||
/* 0x48 */ FixedPoint maxBelly;
|
||||
/* 0x4C */ u32 IQSkills; // unk20
|
||||
/* 0x4C */ IqSkillFlags IQSkills;
|
||||
/* 0x50 */ u8 tacticIndex;
|
||||
/* 0x54 */ HiddenPower hiddenPower;
|
||||
/* 0x58 */ u8 name[POKEMON_NAME_LENGTH]; // name (other offset)
|
||||
|
|
|
|||
|
|
@ -1018,7 +1018,7 @@ void sub_8043D60(void)
|
|||
|
||||
if (monInfo->shopkeeper == TRUE)
|
||||
unk = FALSE;
|
||||
if (IsClientOrTeamBase(monInfo->joinedAt.joinedAt))
|
||||
if (IsClientOrTeamBase(monInfo->joinedAt.id))
|
||||
unk = FALSE;
|
||||
if (monInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET)
|
||||
unk = FALSE;
|
||||
|
|
|
|||
|
|
@ -746,7 +746,7 @@ void HandleGummiItemAction(Entity *pokemon, Entity *target, u8 gummiIndex)
|
|||
gUnknown_810A808[targetInfo->types[0]][gummiIndex] +
|
||||
gUnknown_810A808[targetInfo->types[1]][gummiIndex],0,1);
|
||||
if (!targetInfo->isNotTeamMember) {
|
||||
if (!IsClientOrTeamBase(targetInfo->joinedAt.joinedAt)) {
|
||||
if (!IsClientOrTeamBase(targetInfo->joinedAt.id)) {
|
||||
baseIQ = targetInfo->IQ;
|
||||
targetInfo->IQ += gummiBoost;
|
||||
currIQ = baseIQ + gummiBoost;
|
||||
|
|
@ -834,7 +834,7 @@ bool8 sub_8048950(Entity *param_1,Item *item)
|
|||
if (entityInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) {
|
||||
flag = FALSE;
|
||||
}
|
||||
if (IsClientOrTeamBase(entityInfo->joinedAt.joinedAt)) {
|
||||
if (IsClientOrTeamBase(entityInfo->joinedAt.id)) {
|
||||
flag = FALSE;
|
||||
}
|
||||
entityInfo->unk157 = flag;
|
||||
|
|
@ -896,7 +896,7 @@ bool8 sub_8048A68(Entity *param_1,Item *item)
|
|||
if (pEVar6->monsterBehavior == BEHAVIOR_RESCUE_TARGET) {
|
||||
flag = FALSE;
|
||||
}
|
||||
if (IsClientOrTeamBase(pEVar6->joinedAt.joinedAt)) {
|
||||
if (IsClientOrTeamBase(pEVar6->joinedAt.id)) {
|
||||
flag = FALSE;
|
||||
}
|
||||
if (pEVar6->isTeamLeader) {
|
||||
|
|
@ -959,7 +959,7 @@ bool32 sub_8048B9C(Entity *entity,Item *param_2)
|
|||
{
|
||||
flag = FALSE;
|
||||
}
|
||||
if(IsClientOrTeamBase(entity1Info->joinedAt.joinedAt))
|
||||
if(IsClientOrTeamBase(entity1Info->joinedAt.id))
|
||||
{
|
||||
flag = FALSE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1544,7 +1544,7 @@ bool8 sub_805EC4C(Entity *a0, u8 a1)
|
|||
tileMonsterInfo = GetEntInfo(tileMonster);
|
||||
if (tileMonsterInfo->isNotTeamMember
|
||||
&& (tileMonsterInfo->shopkeeper != 1 && tileMonsterInfo->shopkeeper != 2)
|
||||
&& !IsClientOrTeamBase(tileMonsterInfo->joinedAt.joinedAt)
|
||||
&& !IsClientOrTeamBase(tileMonsterInfo->joinedAt.id)
|
||||
&& tileMonsterInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET) {
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -3439,7 +3439,7 @@ void sub_806145C(struct UnkFieldTeamMenuStruct *a0)
|
|||
sub_8044F5C(0x1B, 0);
|
||||
sub_8044F5C(0x19, 0);
|
||||
if (!monInfo->isTeamLeader) {
|
||||
if (!gDungeon->unk644.unk19 && (monInfo->joinedAt.joinedAt != DUNGEON_JOIN_LOCATION_PARTNER || gDungeon->unk644.unk18)) {
|
||||
if (!gDungeon->unk644.unk19 && (monInfo->joinedAt.id != DUNGEON_JOIN_LOCATION_PARTNER || gDungeon->unk644.unk18)) {
|
||||
sub_8044F5C(0x34, 0);
|
||||
}
|
||||
sub_8044F5C(0x1C, 0);
|
||||
|
|
@ -3471,7 +3471,7 @@ void sub_806145C(struct UnkFieldTeamMenuStruct *a0)
|
|||
}
|
||||
}
|
||||
|
||||
if (IsClientOrTeamBase(monInfo->joinedAt.joinedAt)) {
|
||||
if (IsClientOrTeamBase(monInfo->joinedAt.id)) {
|
||||
sub_8044FF0(0x19);
|
||||
sub_8044FF0(0x3B);
|
||||
sub_8044FF0(0x1A);
|
||||
|
|
|
|||
|
|
@ -1045,7 +1045,7 @@ UNUSED static s32 sub_806B09C(UnkDungeonGlobal_unk1CD98 *unkPtr, bool8 a1)
|
|||
|
||||
extern const DungeonPos gUnknown_80F4598[];
|
||||
|
||||
bool8 sub_806B8CC(s16 species, s32 x, s32 y, PokemonStruct2 *monPtr, u32 *a4, bool8 a5, u8 a6);
|
||||
bool8 sub_806B8CC(s16 species, s32 x, s32 y, PokemonStruct2 *monPtr, Entity **a4, bool8 a5, u8 a6);
|
||||
|
||||
void sub_806B168(void)
|
||||
{
|
||||
|
|
@ -1338,6 +1338,7 @@ void sub_806B6C4(void)
|
|||
}
|
||||
|
||||
extern Entity *sub_804550C(s16 a);
|
||||
extern Entity *sub_80453AC(s16 id);
|
||||
|
||||
void sub_806BC68(bool8 a0, Entity *entity, struct unkStruct_806B7F8 *structPtr, DungeonPos *pos);
|
||||
|
||||
|
|
@ -1371,4 +1372,118 @@ Entity* sub_806B7F8(struct unkStruct_806B7F8 *structPtr, bool8 a1)
|
|||
return entity;
|
||||
}
|
||||
|
||||
extern u8 gUnknown_202F32C;
|
||||
extern u8 sub_803D73C(s32 a0);
|
||||
extern bool8 IsBossFight(void);
|
||||
|
||||
/*
|
||||
bool8 sub_806B8CC(s16 species, s32 x, s32 y, PokemonStruct2 *monPtr, Entity **a4, bool8 a5, u8 a6)
|
||||
{
|
||||
s32 i;
|
||||
DungeonPos unkPosition;
|
||||
struct unkStruct_806B7F8 spStruct;
|
||||
s16 baseSpecies;
|
||||
Entity *entity;
|
||||
EntityInfo *entityInfo;
|
||||
bool8 isTeamLeader = (monPtr->isTeamLeader != FALSE);
|
||||
|
||||
if (a4 != NULL) {
|
||||
*a4 = NULL;
|
||||
}
|
||||
|
||||
baseSpecies = GetBaseSpecies(species);
|
||||
if (baseSpecies == MONSTER_DEOXYS_NORMAL) {
|
||||
if (a5) {
|
||||
species = gDungeon->deoxysForm;
|
||||
}
|
||||
else {
|
||||
species = baseSpecies;
|
||||
}
|
||||
}
|
||||
|
||||
if (sub_807034C(species, GetTile(x, y)))
|
||||
return FALSE;
|
||||
|
||||
entity = sub_80453AC(species);
|
||||
if (entity == NULL)
|
||||
return FALSE;
|
||||
|
||||
spStruct.pos.x = x;
|
||||
spStruct.pos.y = y;
|
||||
spStruct.species = species;
|
||||
spStruct.level = monPtr->level;
|
||||
spStruct.unk2 = 0;
|
||||
spStruct.unk4 = 0;
|
||||
spStruct.unk10 = 0;
|
||||
|
||||
unkPosition.x = gAdjacentTileOffsets[gUnknown_202F32C].x + x;
|
||||
unkPosition.y = gAdjacentTileOffsets[gUnknown_202F32C].y + y;
|
||||
sub_806BC68(TRUE, entity, &spStruct, (isTeamLeader ? &gUnknown_202EE0C : &unkPosition));
|
||||
|
||||
entityInfo = GetEntInfo(entity);
|
||||
entityInfo->isNotTeamMember = FALSE;
|
||||
entityInfo->shopkeeper = 0;
|
||||
entityInfo->isTeamLeader = isTeamLeader;
|
||||
entityInfo->unkF9 = a6;
|
||||
|
||||
gLeaderPointer = NULL;
|
||||
if (isTeamLeader) {
|
||||
gUnknown_202EE0C.x = x;
|
||||
gUnknown_202EE0C.y = y;
|
||||
}
|
||||
|
||||
entityInfo->HP = monPtr->unk10;
|
||||
entityInfo->maxHPStat = monPtr->unk12;
|
||||
entityInfo->exp = monPtr->currExp;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
entityInfo->atk[i] = monPtr->offense.att[i];
|
||||
entityInfo->def[i] = monPtr->offense.def[i];
|
||||
}
|
||||
|
||||
entityInfo->moves = monPtr->moves;
|
||||
for (i = 0; i < MAX_MON_MOVES; i++) {
|
||||
if (MoveFlagExists(&entityInfo->moves.moves[i])) {
|
||||
entityInfo->moves.moves[i].moveFlags &= ~(MOVE_FLAG_LAST_USED);
|
||||
entityInfo->moves.moves[i].moveFlags &= ~(MOVE_FLAG_REPLACE);
|
||||
}
|
||||
}
|
||||
entityInfo->moves.struggleMoveFlags &= ~(MOVE_FLAG_LAST_USED);
|
||||
entityInfo->moves.struggleMoveFlags &= ~(MOVE_FLAG_REPLACE);
|
||||
|
||||
entityInfo->level = monPtr->level;
|
||||
entityInfo->IQ = monPtr->IQ;
|
||||
entityInfo->tactic = monPtr->tacticIndex;
|
||||
entityInfo->IQSkillFlags = monPtr->IQSkills;
|
||||
entityInfo->IQSkillMenuFlags = monPtr->IQSkills;
|
||||
entityInfo->hiddenPower = monPtr->hiddenPower;
|
||||
entityInfo->joinedAt = monPtr->dungeonLocation;
|
||||
entityInfo->maxBelly = monPtr->maxBelly;
|
||||
entityInfo->teamIndex = monPtr->unkC;
|
||||
entityInfo->heldItem = monPtr->itemSlot;
|
||||
entityInfo->unkF3 = 0;
|
||||
entityInfo->unk64 = 0;
|
||||
|
||||
// Pickup Check
|
||||
if (gDungeon->unk644.dungeonLocation.id != DUNGEON_TINY_WOODS
|
||||
&& !IsBossFight()
|
||||
&& (entityInfo->abilities[0] == ABILITY_PICKUP || entityInfo->abilities[1] == ABILITY_PICKUP)
|
||||
&& !ItemExists(&entityInfo->heldItem))
|
||||
{
|
||||
u32 pickUpItem = sub_803D73C(0);
|
||||
if (pickUpItem != ITEM_POKE) {
|
||||
xxx_init_itemslot_8090A8C(&entityInfo->heldItem, pickUpItem, 0);
|
||||
entityInfo->unkF3 = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
sub_806A6E8(entity);
|
||||
LoadIQSkills(entity);
|
||||
if (a4) {
|
||||
*a4 = entity;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
*/
|
||||
//
|
||||
|
|
|
|||
|
|
@ -736,10 +736,10 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
|
|||
}
|
||||
else {
|
||||
PokemonStruct2 *recruitedMon = &gRecruitedPokemonRef->pokemon2[targetData->teamIndex];
|
||||
if (targetData->isTeamLeader || (targetData->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER && gDungeon->unk644.unk18 == 0)) {
|
||||
if (targetData->isTeamLeader || (targetData->joinedAt.id == DUNGEON_JOIN_LOCATION_PARTNER && gDungeon->unk644.unk18 == 0)) {
|
||||
DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9CEC[r8]);
|
||||
}
|
||||
else if (IsClientOrTeamBase(targetData->joinedAt.joinedAt)) {
|
||||
else if (IsClientOrTeamBase(targetData->joinedAt.id)) {
|
||||
DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DAC[r8]);
|
||||
}
|
||||
else if (targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET) {
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ bool8 sub_806F660(Entity *pokemon,Entity *target)
|
|||
if (iVar5 < 0) {
|
||||
iVar5 = -iVar5;
|
||||
}
|
||||
if (((iVar5 < 2) && (targetInfo->joinedAt.joinedAt != 0x4A)) &&
|
||||
if (((iVar5 < 2) && (targetInfo->joinedAt.id != 0x4A)) &&
|
||||
(targetInfo->monsterBehavior != 1 && (CanSeeTarget(target,pokemon))
|
||||
)) {
|
||||
sub_806F910();
|
||||
|
|
@ -773,7 +773,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa
|
|||
pokeStruct2->isTeamLeader = FALSE;
|
||||
pokeStruct2->level = param_3->level;
|
||||
pokeStruct2->IQ = 1;
|
||||
SetDefaultIQSkills((u8 *)&(pokeStruct2->IQSkills),FALSE);
|
||||
SetDefaultIQSkills(&pokeStruct2->IQSkills,FALSE);
|
||||
pokeStruct2->hiddenPower = param_3->hiddenPower;
|
||||
pokeStruct2->tacticIndex = 0;
|
||||
pokeStruct2->unkA = -1;
|
||||
|
|
@ -1033,7 +1033,7 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr)
|
|||
pokeStruct2->isTeamLeader = FALSE;
|
||||
pokeStruct2->level = local_74.level;
|
||||
pokeStruct2->IQ = 1;
|
||||
SetDefaultIQSkills((u8 *)&(pokeStruct2->IQSkills),FALSE);
|
||||
SetDefaultIQSkills(&pokeStruct2->IQSkills,FALSE);
|
||||
pokeStruct2->hiddenPower = local_74.hiddenPower;
|
||||
pokeStruct2->tacticIndex = 0;
|
||||
pokeStruct2->unkA = -1;
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ void sub_8071D4C(Entity *pokemon, Entity *target, s32 exp)
|
|||
|
||||
info = GetEntInfo(target);
|
||||
if (info->level != 100) {
|
||||
if (!IsClientOrTeamBase(info->joinedAt.joinedAt)) {
|
||||
if (!IsClientOrTeamBase(info->joinedAt.id)) {
|
||||
newExp = info->exp + exp;
|
||||
if (9999998 < newExp) {
|
||||
newExp = 9999999;
|
||||
|
|
@ -309,7 +309,7 @@ void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 para
|
|||
atk[1] = info->atk[1];
|
||||
def[0] = info->def[0];
|
||||
def[1] = info->def[1];
|
||||
if (!IsClientOrTeamBase(info->joinedAt.joinedAt)) {
|
||||
if (!IsClientOrTeamBase(info->joinedAt.id)) {
|
||||
newLevel = info->level + level;
|
||||
if (99 < newLevel) {
|
||||
newLevel = 100;
|
||||
|
|
@ -367,15 +367,15 @@ void sub_807218C(Entity *pokemon)
|
|||
{
|
||||
r3 = 0;
|
||||
r1 = info->id;
|
||||
if(info->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON)
|
||||
if(info->joinedAt.id == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON)
|
||||
{
|
||||
r1 = 0x1A4;
|
||||
}
|
||||
else if(info->joinedAt.joinedAt == DUNGEON_RESCUE_TEAM_BASE)
|
||||
else if(info->joinedAt.id == DUNGEON_RESCUE_TEAM_BASE)
|
||||
{
|
||||
r1 = 0x1A5;
|
||||
}
|
||||
else if(info->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER)
|
||||
else if(info->joinedAt.id == DUNGEON_JOIN_LOCATION_PARTNER)
|
||||
{
|
||||
if(gDungeon->unk644.unk18 == 0)
|
||||
r3 = 1;
|
||||
|
|
@ -441,7 +441,7 @@ void LevelDownTarget(Entity *pokemon, Entity *target, u32 level)
|
|||
{
|
||||
flag = FALSE;
|
||||
info = GetEntInfo(target);
|
||||
if(!IsClientOrTeamBase(info->joinedAt.joinedAt))
|
||||
if(!IsClientOrTeamBase(info->joinedAt.id))
|
||||
{
|
||||
newLevel = info->level - level;
|
||||
if(newLevel <= 0)
|
||||
|
|
@ -480,7 +480,7 @@ bool8 sub_80723D0(Entity *pokemon, Entity *target, u8 param_3, u8 param_4)
|
|||
exp = info->exp;
|
||||
|
||||
|
||||
if(IsClientOrTeamBase(info->joinedAt.joinedAt))
|
||||
if(IsClientOrTeamBase(info->joinedAt.id))
|
||||
return FALSE;
|
||||
|
||||
for(level = info->level + 1; level <= 100; level++)
|
||||
|
|
@ -577,7 +577,7 @@ bool8 sub_80725A4(Entity *pokemon, Entity *target)
|
|||
oldLevel = info->level;
|
||||
|
||||
|
||||
if(IsClientOrTeamBase(info->joinedAt.joinedAt)) return FALSE;
|
||||
if(IsClientOrTeamBase(info->joinedAt.id)) return FALSE;
|
||||
|
||||
for(level = 1; level < info->level; level++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ void sub_8073D14(Entity *entity)
|
|||
return;
|
||||
if (entityInfo->shopkeeper == 1)
|
||||
return;
|
||||
if (IsClientOrTeamBase(entityInfo->joinedAt.joinedAt))
|
||||
if (IsClientOrTeamBase(entityInfo->joinedAt.id))
|
||||
return;
|
||||
if (entityInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -534,9 +534,9 @@ u8 sub_807167C(Entity * pokemon, Entity * target)
|
|||
pokemonEntityData = GetEntInfo(pokemon);
|
||||
targetEntityInfo = GetEntInfo(target);
|
||||
if (pokemonEntityData->monsterBehavior != BEHAVIOR_RESCUE_TARGET) {
|
||||
cannotUseItems = IsClientOrTeamBase(pokemonEntityData->joinedAt.joinedAt);
|
||||
cannotUseItems = IsClientOrTeamBase(pokemonEntityData->joinedAt.id);
|
||||
if (!cannotUseItems && (pokemonEntityData->shopkeeper == SHOPKEEPER_MODE_NORMAL) && (targetEntityInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET)) {
|
||||
cannotUseItems = IsClientOrTeamBase(targetEntityInfo->joinedAt.joinedAt);
|
||||
cannotUseItems = IsClientOrTeamBase(targetEntityInfo->joinedAt.id);
|
||||
if (cannotUseItems || (targetEntityInfo->shopkeeper != SHOPKEEPER_MODE_NORMAL)) {
|
||||
error:
|
||||
return TREATMENT_IGNORE;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ bool8 CheckVariousConditions(Entity *pokemon)
|
|||
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
|
||||
|
||||
if (pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET
|
||||
|| IsClientOrTeamBase(pokemonInfo->joinedAt.joinedAt)
|
||||
|| IsClientOrTeamBase(pokemonInfo->joinedAt.id)
|
||||
|| (!pokemonInfo->isTeamLeader && ShouldMonsterRunAway(pokemon))
|
||||
|| CheckVariousStatuses2(pokemon, FALSE)
|
||||
|| CheckVariousStatuses(pokemon))
|
||||
|
|
|
|||
|
|
@ -486,7 +486,7 @@ void SetupBossFightHP(Entity *pokemon, s32 newHP, u16 songIndex)
|
|||
}
|
||||
|
||||
gDungeon->unk644.bossSongIndex = songIndex;
|
||||
SetDefaultIQSkills(entityInfo->IQSkillMenuFlags, entityInfo->bossFlag);
|
||||
SetDefaultIQSkills(&entityInfo->IQSkillMenuFlags, entityInfo->bossFlag);
|
||||
LoadIQSkills(pokemon);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,13 +38,13 @@ u8 GetCrossableTerrain(s16 species)
|
|||
}
|
||||
}
|
||||
|
||||
u8 sub_807034C(s16 id, const Tile *tile)
|
||||
u8 sub_807034C(s32 id, const Tile *tile)
|
||||
{
|
||||
s32 crossableTerrain;
|
||||
u16 tileFlags;
|
||||
s32 id_s32;
|
||||
|
||||
id_s32 = id;
|
||||
id_s32 = SpeciesId(id);
|
||||
|
||||
if ((tile->monster == NULL) && ((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0)) {
|
||||
crossableTerrain = GetCrossableTerrain(id_s32);
|
||||
|
|
|
|||
|
|
@ -150,43 +150,41 @@ bool8 HasTactic(Entity *pokemon, u8 tactic)
|
|||
|
||||
bool8 IQSkillIsEnabled(Entity *pokemon, u8 IQSkill)
|
||||
{
|
||||
return IsIQSkillSet(GetEntInfo(pokemon)->IQSkillFlags, 1 << IQSkill);
|
||||
return IsIQSkillSet(&GetEntInfo(pokemon)->IQSkillFlags, 1 << IQSkill);
|
||||
}
|
||||
|
||||
bool8 IQSkillPairIsEnabled(Entity *pokemon, u8 IQSkill1, u8 IQSkill2)
|
||||
{
|
||||
return IsIQSkillSet(GetEntInfo(pokemon)->IQSkillFlags,
|
||||
1 << IQSkill1 | 1 << IQSkill2);
|
||||
return IsIQSkillSet(&GetEntInfo(pokemon)->IQSkillFlags, 1 << IQSkill1 | 1 << IQSkill2);
|
||||
}
|
||||
|
||||
void LoadIQSkills(Entity *pokemon)
|
||||
{
|
||||
u8 *iVar2;
|
||||
s32 IQSkill;
|
||||
EntityInfo *pokemonInfo;
|
||||
|
||||
pokemonInfo = GetEntInfo(pokemon);
|
||||
if (pokemonInfo->isNotTeamMember) {
|
||||
iVar2 = pokemonInfo->IQSkillFlags;
|
||||
SetIQSkill(iVar2, IQ_STATUS_CHECKER);
|
||||
SetIQSkill(iVar2, IQ_PP_CHECKER);
|
||||
SetIQSkill(iVar2, IQ_ITEM_CATCHER);
|
||||
IqSkillFlags *iqSkills = &pokemonInfo->IQSkillFlags;
|
||||
SetIQSkill(iqSkills, IQ_STATUS_CHECKER);
|
||||
SetIQSkill(iqSkills, IQ_PP_CHECKER);
|
||||
SetIQSkill(iqSkills, IQ_ITEM_CATCHER);
|
||||
if (pokemonInfo->bossFlag)
|
||||
SetIQSkill(iVar2, IQ_SELF_CURER);
|
||||
SetIQSkill(iqSkills, IQ_SELF_CURER);
|
||||
if (pokemonInfo->level >= *gItemMasterMinWildLevel)
|
||||
SetIQSkill(iVar2, IQ_ITEM_MASTER);
|
||||
SetIQSkill(iqSkills, IQ_ITEM_MASTER);
|
||||
pokemonInfo->tactic = TACTIC_GO_AFTER_FOES;
|
||||
}
|
||||
else {
|
||||
pokemonInfo->IQSkillFlags[0] = 0;
|
||||
pokemonInfo->IQSkillFlags[1] = 0;
|
||||
pokemonInfo->IQSkillFlags[2] = 0;
|
||||
pokemonInfo->IQSkillFlags.flags[0] = 0;
|
||||
pokemonInfo->IQSkillFlags.flags[1] = 0;
|
||||
pokemonInfo->IQSkillFlags.flags[2] = 0;
|
||||
for(IQSkill = IQ_TYPE_ADVANTAGE_MASTER; IQSkill < NUM_IQ_SKILLS; IQSkill++)
|
||||
{
|
||||
if (HasIQForSkill(pokemonInfo->IQ,IQSkill) &&
|
||||
IsIQSkillSet(pokemonInfo->IQSkillMenuFlags, 1 << IQSkill))
|
||||
IsIQSkillSet(&pokemonInfo->IQSkillMenuFlags, 1 << IQSkill))
|
||||
{
|
||||
SetIQSkill(pokemonInfo->IQSkillFlags,IQSkill);
|
||||
SetIQSkill(&pokemonInfo->IQSkillFlags,IQSkill);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -239,8 +237,8 @@ bool8 MonsterCanThrowItems(EntityInfo *pokemon)
|
|||
|
||||
static inline bool8 sub_8071A8C_sub(EntityInfo *pokemonInfo)
|
||||
{
|
||||
if(pokemonInfo->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON ||
|
||||
pokemonInfo->joinedAt.joinedAt == DUNGEON_RESCUE_TEAM_BASE)
|
||||
if(pokemonInfo->joinedAt.id == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON ||
|
||||
pokemonInfo->joinedAt.id == DUNGEON_RESCUE_TEAM_BASE)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
|
|
|
|||
|
|
@ -46,10 +46,10 @@ static void ReadBlinkerClassStatus(DataSerializer *seri, BlinkerClassStatus *dst
|
|||
static s24_8 ReadF24_8(DataSerializer *seri);
|
||||
static void ReadHiddenPower(DataSerializer *seri, HiddenPower *dst);
|
||||
static void ReadFrozenClassStatus(DataSerializer *seri, FrozenClassStatus *dst);
|
||||
static void ReadIQSkills(DataSerializer *seri, u8 *dst);
|
||||
static void ReadIQSkills(DataSerializer *seri, IqSkillFlags *dst);
|
||||
static void ReadItem(DataSerializer *seri, Item *dst);
|
||||
static void ReadLongTossClassStatus(DataSerializer *seri, LongTossClassStatus *dst);
|
||||
static void ReadJoinedAt(DataSerializer *seri, JoinedAt *dst);
|
||||
static void ReadDungeonLocation(DataSerializer *seri, DungeonLocation *dst);
|
||||
static void ReadLeechSeedClassStatus(DataSerializer *seri, LeechSeedClassStatus *dst);
|
||||
static void ReadMonster(DataSerializer *seri, bool8 isTeamMember, s32 index);
|
||||
static s16 ReadMonsterID(DataSerializer *seri);
|
||||
|
|
@ -99,10 +99,10 @@ static void WriteBlinkerClassStatus(DataSerializer *seri, BlinkerClassStatus *sr
|
|||
static void WriteF24_8(DataSerializer *seri, s24_8 value);
|
||||
static void WriteHiddenPower(DataSerializer *seri, HiddenPower *src);
|
||||
static void WriteFrozenClassStatus(DataSerializer *seri, FrozenClassStatus *src);
|
||||
static void WriteIQSkills(DataSerializer *seri, u8 *src);
|
||||
static void WriteIQSkills(DataSerializer *seri, IqSkillFlags *src);
|
||||
static void WriteItem(DataSerializer *seri, Item *src);
|
||||
static void WriteLongTossClassStatus(DataSerializer *seri, LongTossClassStatus *src);
|
||||
static void WriteJoinedAt(DataSerializer *seri, JoinedAt *src);
|
||||
static void WriteDungeonLocation(DataSerializer *seri, DungeonLocation *src);
|
||||
static void WriteLeechSeedClassStatus(DataSerializer *seri, LeechSeedClassStatus *src);
|
||||
static void WriteMonster(DataSerializer *seri, Entity *src);
|
||||
static void WriteMonsterID(DataSerializer *seri, s16 value);
|
||||
|
|
@ -290,7 +290,7 @@ static void WriteMonster(DataSerializer *seri, Entity *src)
|
|||
WriteU8(seri, info->shopkeeper);
|
||||
WriteU8(seri, info->level);
|
||||
WriteU8(seri, info->teamIndex);
|
||||
WriteJoinedAt(seri, &info->joinedAt);
|
||||
WriteDungeonLocation(seri, &info->joinedAt);
|
||||
WriteS16(seri, info->IQ);
|
||||
WriteS16(seri, info->HP);
|
||||
WriteS16(seri, info->maxHPStat);
|
||||
|
|
@ -323,8 +323,8 @@ static void WriteMonster(DataSerializer *seri, Entity *src)
|
|||
WriteTilePos(seri, &info->prevPos[i]);
|
||||
|
||||
WriteAITarget(seri, &info->aiTarget);
|
||||
WriteIQSkills(seri, info->IQSkillMenuFlags);
|
||||
WriteIQSkills(seri, info->IQSkillFlags);
|
||||
WriteIQSkills(seri, &info->IQSkillMenuFlags);
|
||||
WriteIQSkills(seri, &info->IQSkillFlags);
|
||||
WriteTactic(seri, info->tactic);
|
||||
WriteHiddenPower(seri, &info->hiddenPower);
|
||||
WriteU32(seri, info->unk98);
|
||||
|
|
@ -556,10 +556,10 @@ static void WriteMonsterBehavior(DataSerializer *seri, u8 value)
|
|||
WriteU8(seri, value);
|
||||
}
|
||||
|
||||
static void WriteJoinedAt(DataSerializer *seri, JoinedAt *src)
|
||||
static void WriteDungeonLocation(DataSerializer *seri, DungeonLocation *src)
|
||||
{
|
||||
WriteU8(seri, src->joinedAt);
|
||||
WriteU8(seri, src->unk1);
|
||||
WriteU8(seri, src->id);
|
||||
WriteU8(seri, src->floor);
|
||||
}
|
||||
|
||||
static void WriteAITarget(DataSerializer *seri, AITarget* src)
|
||||
|
|
@ -685,7 +685,7 @@ static void WriteBelly(DataSerializer *seri, FixedPoint *src)
|
|||
WriteS16(seri, src->unk2);
|
||||
}
|
||||
|
||||
static void WriteIQSkills(DataSerializer *seri, u8 *src)
|
||||
static void WriteIQSkills(DataSerializer *seri, IqSkillFlags *src)
|
||||
{
|
||||
WriteBytes(seri, src, NUM_PICKED_IQ_SKILLS);
|
||||
}
|
||||
|
|
@ -973,7 +973,7 @@ static void ReadMonster(DataSerializer *seri, bool8 isTeamMember, s32 index)
|
|||
entInfo.shopkeeper = ReadU8(seri);
|
||||
entInfo.level = ReadU8(seri);
|
||||
entInfo.teamIndex = ReadU8(seri);
|
||||
ReadJoinedAt(seri, &entInfo.joinedAt);
|
||||
ReadDungeonLocation(seri, &entInfo.joinedAt);
|
||||
entInfo.IQ = ReadS16(seri);
|
||||
entInfo.HP = ReadS16(seri);
|
||||
entInfo.maxHPStat = ReadS16(seri);
|
||||
|
|
@ -1006,8 +1006,8 @@ static void ReadMonster(DataSerializer *seri, bool8 isTeamMember, s32 index)
|
|||
ReadTilePos(seri, &entInfo.prevPos[i]);
|
||||
|
||||
ReadAITarget(seri, &entInfo.aiTarget);
|
||||
ReadIQSkills(seri, entInfo.IQSkillMenuFlags);
|
||||
ReadIQSkills(seri, entInfo.IQSkillFlags);
|
||||
ReadIQSkills(seri, &entInfo.IQSkillMenuFlags);
|
||||
ReadIQSkills(seri, &entInfo.IQSkillFlags);
|
||||
entInfo.tactic = ReadTactic(seri);
|
||||
ReadHiddenPower(seri, &entInfo.hiddenPower);
|
||||
entInfo.unk98 = ReadU32(seri);
|
||||
|
|
@ -1370,7 +1370,7 @@ static void ReadAITarget(DataSerializer *seri, AITarget *dst)
|
|||
ReadTilePos(seri, &dst->aiTargetPos);
|
||||
}
|
||||
|
||||
static void ReadIQSkills(DataSerializer *seri, u8 *dst)
|
||||
static void ReadIQSkills(DataSerializer *seri, IqSkillFlags *dst)
|
||||
{
|
||||
ReadBytes(seri, dst, NUM_PICKED_IQ_SKILLS);
|
||||
}
|
||||
|
|
@ -1491,10 +1491,10 @@ static void ReadBelly(DataSerializer *seri, FixedPoint *dst)
|
|||
dst->unk2 = ReadS16(seri);
|
||||
}
|
||||
|
||||
static void ReadJoinedAt(DataSerializer *seri, JoinedAt *dst)
|
||||
static void ReadDungeonLocation(DataSerializer *seri, DungeonLocation *dst)
|
||||
{
|
||||
dst->joinedAt = ReadU8(seri);
|
||||
dst->unk1 = ReadU8(seri);
|
||||
dst->id = ReadU8(seri);
|
||||
dst->floor = ReadU8(seri);
|
||||
}
|
||||
|
||||
static void ReadHiddenPower(DataSerializer *seri, HiddenPower *dst)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ Entity *GetPartnerEntity(void)
|
|||
for(counter = 0; counter < MAX_TEAM_MEMBERS; counter++)
|
||||
{
|
||||
entity = gDungeon->teamPokemon[counter];
|
||||
if(EntityExists(entity) && GetEntInfo(entity)->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER)
|
||||
if(EntityExists(entity) && GetEntInfo(entity)->joinedAt.id == DUNGEON_JOIN_LOCATION_PARTNER)
|
||||
{
|
||||
return entity;
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ void sub_80854D4(void)
|
|||
for(index = 0; index < MAX_TEAM_MEMBERS; index++)
|
||||
{
|
||||
entity3 = stack1[index];
|
||||
if(entity3 != NULL && GetEntInfo(entity3)->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER)
|
||||
if(entity3 != NULL && GetEntInfo(entity3)->joinedAt.id == DUNGEON_JOIN_LOCATION_PARTNER)
|
||||
{
|
||||
stack1[index] = NULL;
|
||||
stack2[counter] = entity3;
|
||||
|
|
@ -126,7 +126,7 @@ void sub_80855E4(DungeonCallback func)
|
|||
{
|
||||
entity = gDungeon->teamPokemon[index];
|
||||
if (EntityExists(entity)) {
|
||||
if (GetEntInfo(entity)->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER) {
|
||||
if (GetEntInfo(entity)->joinedAt.id == DUNGEON_JOIN_LOCATION_PARTNER) {
|
||||
flag = TRUE;
|
||||
}
|
||||
func(entity);
|
||||
|
|
@ -145,7 +145,7 @@ void sub_808563C(DungeonCallback func)
|
|||
for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++)
|
||||
{
|
||||
entity = gDungeon->wildPokemon[index];
|
||||
if ((EntityExists(entity)) && (GetEntInfo(entity)->joinedAt.joinedAt != 0x41)) {
|
||||
if ((EntityExists(entity)) && (GetEntInfo(entity)->joinedAt.id != 0x41)) {
|
||||
func(entity);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ void BuildIQSkillList(void)
|
|||
y = sub_8013800(&sIQSkillListMenu->s24.s0.input, counter);
|
||||
strncpy(gFormatBuffer_Items[1], GetIQSkillName(skillIndex), 80);
|
||||
|
||||
if (IsIQSkillSet((u8 *)&sIQSkillListMenu->pokeStruct->IQSkills, 1 << skillIndex))
|
||||
if (IsIQSkillSet(&sIQSkillListMenu->pokeStruct->IQSkills, 1 << skillIndex))
|
||||
strcpy(gFormatBuffer_Items[1] - 80, sStarBullet);
|
||||
else
|
||||
strcpy(gFormatBuffer_Items[1] - 80, sUnknown_80DBE18);
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ static void HandleIQSkillMenuAction(void)
|
|||
switch (menuAction) {
|
||||
case IQ_SKILL_MENU_SWITCH: // Switch
|
||||
PlaySound(307);
|
||||
ToggleIQSkill((u8 *)&sIQSkillMenu->pokeStruct->IQSkills, sIQSkillMenu->iqSkillIndex);
|
||||
ToggleIQSkill(&sIQSkillMenu->pokeStruct->IQSkills, sIQSkillMenu->iqSkillIndex);
|
||||
SetIQSkillMenuState(IQ_SKILL_MENU_STATE_MAIN);
|
||||
break;
|
||||
case IQ_SKILL_MENU_INFO: // Info
|
||||
|
|
|
|||
|
|
@ -2889,7 +2889,7 @@ bool32 sub_805AD54(Entity * pokemon, Entity * target, Move *move, u32 param_4)
|
|||
&& GetTreatmentBetweenMonsters(pokemon,targetEntity,FALSE,FALSE) == TREATMENT_TREAT_AS_ALLY)
|
||||
{
|
||||
EntityInfo *targetInfo = GetEntInfo(targetEntity);
|
||||
if (targetInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET && !IsClientOrTeamBase(targetInfo->joinedAt.joinedAt)) {
|
||||
if (targetInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET && !IsClientOrTeamBase(targetInfo->joinedAt.id)) {
|
||||
sub_807D148(pokemon,targetEntity,2,&target->pos);
|
||||
flag = TRUE;
|
||||
SetExpMultplier(info);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ void sub_808CE74(s16 _species, bool32 _isLeader, u8* name)
|
|||
pokemon.IQ = 1;
|
||||
pokemon.unkC[0].level = 0;
|
||||
pokemon.unkC[1].level = 0;
|
||||
SetDefaultIQSkills((u8*)&pokemon.IQSkills, FALSE);
|
||||
SetDefaultIQSkills(&pokemon.IQSkills, FALSE);
|
||||
pokemon.speciesNum = species;
|
||||
pokemon.heldItem.id = ITEM_NOTHING;
|
||||
pokemon.heldItem.quantity = 0;
|
||||
|
|
@ -136,7 +136,7 @@ void sub_808CFD0(PokemonStruct1 *pokemon, s16 _species, u8* name, u32 _itemID, D
|
|||
pokemon->dungeonLocation = *location;
|
||||
pokemon->unkC[0].level = 0;
|
||||
pokemon->unkC[1].level = 0;
|
||||
SetDefaultIQSkills((u8*)&pokemon->IQSkills, FALSE);
|
||||
SetDefaultIQSkills(&pokemon->IQSkills, FALSE);
|
||||
|
||||
if(moveID != NULL)
|
||||
{
|
||||
|
|
@ -180,7 +180,7 @@ void sub_808D0D8(PokemonStruct1 *pokemon)
|
|||
pokemon->currExp = 0;
|
||||
pokemon->tacticIndex = 0;
|
||||
pokemon->IQ = 1;
|
||||
SetDefaultIQSkills((u8*)&pokemon->IQSkills, FALSE);
|
||||
SetDefaultIQSkills(&pokemon->IQSkills, FALSE);
|
||||
sub_808E490(pokemon->moves, pokemon->speciesNum);
|
||||
}
|
||||
|
||||
|
|
@ -218,7 +218,7 @@ void sub_808D144(PokemonStruct1 *pokemon, struct unkStruct_808D144 *r1)
|
|||
pokemon->dungeonLocation = r1->dungeonLocation;
|
||||
pokemon->unkC[0].level = 0;
|
||||
pokemon->unkC[1].level = 0;
|
||||
SetDefaultIQSkills((u8*)&pokemon->IQSkills, FALSE);
|
||||
SetDefaultIQSkills(&pokemon->IQSkills, FALSE);
|
||||
|
||||
for(i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
|
|
|
|||
110
src/pokemon_3.c
110
src/pokemon_3.c
|
|
@ -559,74 +559,68 @@ s32 GetNumAvailableIQSkills(u8 *iqSkillBuffer, s32 pokeIQ)
|
|||
return availIQSkills;
|
||||
}
|
||||
|
||||
void ToggleIQSkill(u8 *param_1, u32 skillIndex)
|
||||
void ToggleIQSkill(IqSkillFlags *iq, u32 skillIndex)
|
||||
{
|
||||
int iVar2; // a mask?
|
||||
|
||||
iVar2 = 1 << (skillIndex);
|
||||
if (IsIQSkillSet(param_1, iVar2)) {
|
||||
param_1[0] = param_1[0] & ~iVar2;
|
||||
param_1[1] = param_1[1] & ~(iVar2 >> 8);
|
||||
param_1[2] = param_1[2] & ~(iVar2 >> 0x10);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetIQSkill(param_1, skillIndex);
|
||||
}
|
||||
}
|
||||
|
||||
void SetIQSkill(u8 *param_1, u32 skillIndex)
|
||||
{
|
||||
s32 iVar1;
|
||||
s32 iqSkill;
|
||||
s32 iqSkillGroup;
|
||||
s32 iVar5;
|
||||
|
||||
for (iqSkill = 0, iqSkillGroup = gIQSkillGroups[skillIndex]; iqSkill < NUM_IQ_SKILLS; iqSkill++)
|
||||
{
|
||||
// Turn off each IQ Skill that's in the same group as the chosen skill
|
||||
if (iqSkillGroup == gIQSkillGroups[iqSkill]) {
|
||||
iVar1 = 1 << (iqSkill);
|
||||
param_1[0] = param_1[0] & ~iVar1;
|
||||
param_1[1] = param_1[1] & ~(iVar1 >> 8);
|
||||
param_1[2] = param_1[2] & ~(iVar1 >> 0x10);
|
||||
s32 bit = 1 << (skillIndex);
|
||||
if (IsIQSkillSet(iq, bit)) {
|
||||
iq->flags[0] &= ~(bit);
|
||||
iq->flags[1] &= ~(bit >> 8);
|
||||
iq->flags[2] &= ~(bit >> 16);
|
||||
}
|
||||
else {
|
||||
SetIQSkill(iq, skillIndex);
|
||||
}
|
||||
}
|
||||
|
||||
iVar5 = 1 << (skillIndex);
|
||||
param_1[0] |= iVar5;
|
||||
param_1[1] |= (iVar5 >> 8);
|
||||
param_1[2] |= (iVar5 >> 0x10);
|
||||
}
|
||||
|
||||
void SetDefaultIQSkills(u8 *param_1, bool8 enableSelfCurer)
|
||||
void SetIQSkill(IqSkillFlags *iq, u32 skillIndex)
|
||||
{
|
||||
s32 iqSkill;
|
||||
s32 iqSkillGroup;
|
||||
s32 bit;
|
||||
|
||||
param_1[0] = 0;
|
||||
param_1[1] = 0;
|
||||
param_1[2] = 0;
|
||||
SetIQSkill(param_1, IQ_ITEM_CATCHER);
|
||||
SetIQSkill(param_1, IQ_COURSE_CHECKER);
|
||||
SetIQSkill(param_1, IQ_ITEM_MASTER);
|
||||
for (iqSkill = 0, iqSkillGroup = gIQSkillGroups[skillIndex]; iqSkill < NUM_IQ_SKILLS; iqSkill++) {
|
||||
// Turn off each IQ Skill that's in the same group as the chosen skill
|
||||
if (iqSkillGroup == gIQSkillGroups[iqSkill]) {
|
||||
s32 bit = 1 << (iqSkill);
|
||||
iq->flags[0] &= ~(bit);
|
||||
iq->flags[1] &= ~(bit >> 8);
|
||||
iq->flags[2] &= ~(bit >> 16);
|
||||
}
|
||||
}
|
||||
|
||||
// Flag is usually enabled for Boss fights.
|
||||
if (enableSelfCurer) {
|
||||
SetIQSkill(param_1, IQ_SELF_CURER);
|
||||
}
|
||||
bit = 1 << (skillIndex);
|
||||
iq->flags[0] |= bit;
|
||||
iq->flags[1] |= (bit >> 8);
|
||||
iq->flags[2] |= (bit >> 16);
|
||||
}
|
||||
|
||||
bool8 IsIQSkillSet(u8 *IQSkillFlags, u32 IQSkill)
|
||||
void SetDefaultIQSkills(IqSkillFlags *iq, bool8 enableSelfCurer)
|
||||
{
|
||||
if (!(IQSkillFlags[0] & IQSkill) &&
|
||||
!(IQSkillFlags[1] & IQSkill >> 8) &&
|
||||
!(IQSkillFlags[2] & IQSkill >> 16))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
iq->flags[0] = 0;
|
||||
iq->flags[1] = 0;
|
||||
iq->flags[2] = 0;
|
||||
SetIQSkill(iq, IQ_ITEM_CATCHER);
|
||||
SetIQSkill(iq, IQ_COURSE_CHECKER);
|
||||
SetIQSkill(iq, IQ_ITEM_MASTER);
|
||||
|
||||
// Flag is usually enabled for Boss fights.
|
||||
if (enableSelfCurer) {
|
||||
SetIQSkill(iq, IQ_SELF_CURER);
|
||||
}
|
||||
}
|
||||
|
||||
bool8 IsIQSkillSet(IqSkillFlags *iq, u32 IQSkillBit)
|
||||
{
|
||||
if (!(iq->flags[0] & IQSkillBit) &&
|
||||
!(iq->flags[1] & IQSkillBit >> 8) &&
|
||||
!(iq->flags[2] & IQSkillBit >> 16))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_808ECFC(void)
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ void SetMessageArgument_2(u8 *buffer, EntityInfo *param_2, s32 colorNum)
|
|||
else
|
||||
{
|
||||
if (param_2->isNotTeamMember) {
|
||||
if ((param_2->joinedAt.joinedAt == 0x4A) || (param_2->monsterBehavior == BEHAVIOR_RESCUE_TARGET)) {
|
||||
if ((param_2->joinedAt.id == 0x4A) || (param_2->monsterBehavior == BEHAVIOR_RESCUE_TARGET)) {
|
||||
CopyYellowMonsterNametoBuffer(buffer, param_2->apparentID);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user