mirror of
https://github.com/pret/pmd-red.git
synced 2026-08-21 16:24:54 -05:00
Merge pull request #251 from DizzyEggg/code_806E8B0
Some checks are pending
GithubCI / build (push) Waiting to run
Some checks are pending
GithubCI / build (push) Waiting to run
code_806E8B0
This commit is contained in:
1160
asm/code_806E8B0.s
1160
asm/code_806E8B0.s
File diff suppressed because it is too large
Load Diff
@@ -196,10 +196,8 @@ typedef struct EntityInfo
|
||||
/* 0x10 */ s16 maxHPStat;
|
||||
// Bosses have higher HP than normal for their level. This is the max HP they would normally have given their level.
|
||||
/* 0x12 */ s16 originalHP;
|
||||
/* 0x14 */ u8 atk;
|
||||
/* 0x15 */ u8 spAtk;
|
||||
/* 0x16 */ u8 def;
|
||||
/* 0x17 */ u8 spDef;
|
||||
/* 0x14 */ u8 atk[2]; // Index 0 is Attack. Index 1 is Special Attack.
|
||||
/* 0x16 */ u8 def[2]; // Index 0 is Defense. Index 1 is Special Defense.
|
||||
/* 0x18 */ u32 exp;
|
||||
// Temporary stat boosts/drops from effects like Growl or Swords Dance.
|
||||
// These start at 10 and are in the range [1, 19].
|
||||
|
||||
@@ -249,7 +249,6 @@ SECTIONS {
|
||||
src/code_806CD90.o(.text);
|
||||
src/type_effectiveness.o(.text);
|
||||
src/code_806E8B0.o(.text);
|
||||
asm/code_806E8B0.o(.text);
|
||||
src/code_806FDF4.o(.text);
|
||||
src/status_checks.o(.text);
|
||||
src/dungeon_movement.o(.text);
|
||||
|
||||
@@ -33,10 +33,10 @@ void sub_8069D4C(struct unkStruct_8069D4C *r0, Entity *target)
|
||||
|
||||
GetPokemonLevelData(&leveldata, info->id, info->level);
|
||||
r0->exp = leveldata.expRequired;
|
||||
r0->offense.att[0] = info->atk;
|
||||
r0->offense.att[1] = info->spAtk;
|
||||
r0->offense.def[0] = info->def;
|
||||
r0->offense.def[1] = info->spDef;
|
||||
r0->offense.att[0] = info->atk[0];
|
||||
r0->offense.att[1] = info->atk[1];
|
||||
r0->offense.def[0] = info->def[0];
|
||||
r0->offense.def[1] = info->def[1];
|
||||
r0->heldItem = info->heldItem;
|
||||
memcpy(r0->moves.moves, info->moves.moves, sizeof(r0->moves));
|
||||
r0->belly = info->belly;
|
||||
|
||||
@@ -5,119 +5,497 @@
|
||||
#include "status_checks_1.h"
|
||||
#include "text_util.h"
|
||||
#include "dungeon_message.h"
|
||||
|
||||
extern u8 *gUnknown_80FEE04[];
|
||||
extern u8 *gUnknown_80FEE2C[];
|
||||
extern u8 *gUnknown_80FEE54[];
|
||||
#include "string_format.h"
|
||||
#include "type_effectiveness.h"
|
||||
#include "constants/move_id.h"
|
||||
#include "constants/monster.h"
|
||||
#include "constants/status.h"
|
||||
#include "constants/type.h"
|
||||
#include "constants/iq_skill.h"
|
||||
#include "math.h"
|
||||
#include "number_util.h"
|
||||
#include "status.h"
|
||||
#include "type_chart.h"
|
||||
#include "dungeon_random.h"
|
||||
#include "code_8045A00.h"
|
||||
#include "dungeon_items.h"
|
||||
#include "structs/str_damage.h"
|
||||
|
||||
void sub_8042940(Entity *r0);
|
||||
void sub_80428B0(Entity *r0);
|
||||
void sub_80428C4(Entity *r0);
|
||||
|
||||
void sub_806E8B0(Entity * pokemon, Entity * target, u8 param_3, s32 *param_4, s32 *param_5, s32 param_6)
|
||||
extern void sub_806F500(void);
|
||||
extern void sub_800A020(struct unkStruct_80943A8 *param_1, u32 param_2);
|
||||
extern void sub_800A3F0(struct unkStruct_80943A8 *param_1, struct unkStruct_80943A8 *param_2, struct unkStruct_80943A8 *);
|
||||
extern void sub_800A6D0(struct unkStruct_80943A8 *param_1, struct unkStruct_80943A8 *param_2, struct unkStruct_80943A8 *);
|
||||
extern void sub_800A34C(struct unkStruct_80943A8 *param_1, struct unkStruct_80943A8 *param_2, const struct unkStruct_80943A8 *param3);
|
||||
extern void sub_800A6F0(struct unkStruct_80943A8 *param_1, struct unkStruct_80943A8 *param_2, struct unkStruct_80943A8 *param3);
|
||||
extern void sub_800A088(struct unkStruct_80943A8 *param_1, u32 param_2);
|
||||
extern u32 sub_800A048(struct unkStruct_80943A8 *param_1);
|
||||
extern bool8 sub_800A2F0(const struct unkStruct_80943A8*, const struct unkStruct_80943A8*);
|
||||
extern bool8 sub_806E100(struct unkStruct_80943A8 *param_1, Entity *pokemon, Entity *target, u8 type, struct DamageStruct *dmgStruct);
|
||||
extern void sub_8041B74(Entity *pokemon);
|
||||
extern void sub_8041B5C(Entity *pokemon);
|
||||
extern void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4, bool32 arg8, s32 argC);
|
||||
extern void sub_80457DC(Entity *);
|
||||
|
||||
extern const s32 gUnknown_80F54B4[NUM_EFFECTIVENESS][NUM_EFFECTIVENESS];
|
||||
extern const s32 gUnknown_80F504C[];
|
||||
extern const s32 gUnknown_80F50A0[];
|
||||
extern const s16 gUnknown_810AC60;
|
||||
extern const s16 gUnknown_810AC68;
|
||||
extern const s16 gUnknown_810AC64;
|
||||
extern const s16 gUnknown_810AC66;
|
||||
extern const s16 gUnknown_810AC68;
|
||||
extern const s16 gUnknown_810AC62;
|
||||
extern const s16 gUnknown_80F4DAE;
|
||||
extern const s16 gUnknown_80F4DB0;
|
||||
extern const struct unkStruct_80943A8 gUnknown_8106F24;
|
||||
extern const struct unkStruct_80943A8 gUnknown_8106F04;
|
||||
extern const struct unkStruct_80943A8 gUnknown_8106F1C;
|
||||
extern const struct unkStruct_80943A8 gUnknown_8106F14;
|
||||
extern const u8 *const gUnknown_80FAE00;
|
||||
extern const u8 *const gUnknown_80FADD8;
|
||||
extern const u8 *const gUnknown_80FEE04;
|
||||
extern const u8 *const gUnknown_80FEE2C;
|
||||
extern const u8 *const gUnknown_80FEE54;
|
||||
|
||||
static void ApplyAtkDefStatBoosts(Entity *attacker, Entity *target, u8 moveType, s32 *atkStat, s32 *defStat, s32 rand)
|
||||
{
|
||||
bool8 hasNegStatus_pokemon;
|
||||
bool8 visFlags_pokemon_1;
|
||||
bool8 visFlags_pokemon_2;
|
||||
bool8 hasNegStatus_target;
|
||||
bool8 visFlags_target;
|
||||
s32 iVar3;
|
||||
bool32 isNotEnemy;
|
||||
EntityInfo * entityInfo;
|
||||
EntityInfo * entityInfo_1;
|
||||
s32 r7;
|
||||
s32 r8;
|
||||
s32 r10;
|
||||
s32 sp_0x4;
|
||||
s32 sp_0x8;
|
||||
bool32 isNotEnemy;
|
||||
s32 atkMultiplier = 1;
|
||||
s32 atkDivisor = 1;
|
||||
s32 defMultiplier = 1;
|
||||
s32 defDivisor = 1;
|
||||
s32 splitIndex = (!IsTypePhysical(moveType)) ? 1 : 0;
|
||||
|
||||
r7 = 1;
|
||||
r8 = 1;
|
||||
sp_0x4 = 1;
|
||||
sp_0x8 = 1;
|
||||
r10 = IsTypePhysical(param_3) == 0;
|
||||
if (HasAbility(attacker, ABILITY_GUTS)) {
|
||||
EntityInfo *entInfo = GetEntInfo(attacker);
|
||||
bool8 gutsBoost = HasNegativeStatus(attacker);
|
||||
bool8 visFlags_attacker_1 = SetVisualFlags(entInfo,1,gutsBoost);
|
||||
|
||||
|
||||
if (HasAbility(pokemon, ABILITY_GUTS)) {
|
||||
entityInfo = GetEntInfo(pokemon);
|
||||
hasNegStatus_pokemon = HasNegativeStatus(pokemon);
|
||||
visFlags_pokemon_1 = SetVisualFlags(entityInfo,1,hasNegStatus_pokemon);
|
||||
if (hasNegStatus_pokemon) {
|
||||
r7 = 2;
|
||||
if (gutsBoost) {
|
||||
atkMultiplier = 2;
|
||||
}
|
||||
if (visFlags_attacker_1) {
|
||||
sub_80428B0(attacker);
|
||||
TryDisplayDungeonLoggableMessage3(attacker,target, gUnknown_80FEE04); // Guts boosted its power
|
||||
}
|
||||
}
|
||||
if (visFlags_pokemon_1) {
|
||||
sub_80428B0(pokemon);
|
||||
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEE04); // Guts boosted its power
|
||||
|
||||
if ((HasAbility(attacker, ABILITY_HUGE_POWER)) || (HasAbility(attacker, ABILITY_PURE_POWER))) {
|
||||
EntityInfo *entInfo = GetEntInfo(attacker);
|
||||
bool32 hugePowerBoost = (rand < 33 && splitIndex == 0);
|
||||
bool8 visFlags_attacker_2 = SetVisualFlags(entInfo,0x100,hugePowerBoost);
|
||||
|
||||
if (hugePowerBoost) {
|
||||
atkMultiplier *= 3;
|
||||
atkDivisor *= 2;
|
||||
}
|
||||
if (visFlags_attacker_2) {
|
||||
sub_80428C4(attacker);
|
||||
TryDisplayDungeonLoggableMessage3(attacker,target, gUnknown_80FEE2C); // It's special ability boosted Attack
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((HasAbility(pokemon, ABILITY_HUGE_POWER)) || (HasAbility(pokemon, ABILITY_PURE_POWER))) {
|
||||
entityInfo_1 = GetEntInfo(pokemon);
|
||||
iVar3 = 0;
|
||||
if ((param_6 < 0x21) && (!r10)) {
|
||||
iVar3 = 1;
|
||||
if ((HasAbility(attacker, ABILITY_HUSTLE)) && (splitIndex == 0)) {
|
||||
atkMultiplier *= 3;
|
||||
atkDivisor *= 2;
|
||||
}
|
||||
visFlags_pokemon_2 = SetVisualFlags(entityInfo_1,0x100,iVar3);
|
||||
if (iVar3 != 0) {
|
||||
r7 *= 3;
|
||||
r8 <<= 1;
|
||||
|
||||
if (GetEntInfo(attacker)->isNotTeamMember) {
|
||||
isNotEnemy = FALSE;
|
||||
}
|
||||
if (visFlags_pokemon_2) {
|
||||
sub_80428C4(pokemon);
|
||||
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEE2C); // It's special ability boosted Attack
|
||||
else {
|
||||
isNotEnemy = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if ((HasAbility(pokemon, ABILITY_HUSTLE)) && (!r10)) {
|
||||
r7 *= 3;
|
||||
r8 <<= 1;
|
||||
}
|
||||
|
||||
if(GetEntInfo(pokemon)->isNotTeamMember)
|
||||
{
|
||||
isNotEnemy = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
isNotEnemy = TRUE;
|
||||
}
|
||||
|
||||
if ((HasAbility(pokemon, ABILITY_PLUS)) && (r10 == 1) && gDungeon->minusIsActive[isNotEnemy]) {
|
||||
r7 *= 15;
|
||||
r8 *= 10;
|
||||
}
|
||||
|
||||
// ABILITY_MINUS
|
||||
if ((HasAbility(pokemon, ABILITY_MINUS)) && (r10 == 1) && gDungeon->plusIsActive[isNotEnemy]) {
|
||||
r7 *= 15;
|
||||
r8 *= 10;
|
||||
}
|
||||
|
||||
if (HasAbility(target, ABILITY_INTIMIDATE) && (!r10)) {
|
||||
r7 <<= 2;
|
||||
r8 *= 5;
|
||||
}
|
||||
|
||||
if ((HasAbility(target, ABILITY_MARVEL_SCALE)) && (!r10)) {
|
||||
entityInfo = GetEntInfo(target);
|
||||
hasNegStatus_target = HasNegativeStatus(target);
|
||||
visFlags_target = SetVisualFlags(entityInfo, 8, hasNegStatus_target);
|
||||
if (hasNegStatus_target) {
|
||||
sp_0x4 *= 3;
|
||||
sp_0x8 <<= 1;
|
||||
if ((HasAbility(attacker, ABILITY_PLUS)) && (splitIndex == 1) && gDungeon->minusIsActive[isNotEnemy]) {
|
||||
atkMultiplier *= 15;
|
||||
atkDivisor *= 10;
|
||||
}
|
||||
if (visFlags_target) {
|
||||
sub_8042940(target);
|
||||
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEE54); // Its special ability quickened attacks!
|
||||
if ((HasAbility(attacker, ABILITY_MINUS)) && (splitIndex == 1) && gDungeon->plusIsActive[isNotEnemy]) {
|
||||
atkMultiplier *= 15;
|
||||
atkDivisor *= 10;
|
||||
}
|
||||
}
|
||||
|
||||
*param_4 *= r7;
|
||||
*param_5 *= sp_0x4;
|
||||
if (r8 != 1) {
|
||||
*param_4 = *param_4 / r8;
|
||||
}
|
||||
if (sp_0x8 != 1) {
|
||||
*param_5 = *param_5 / sp_0x8;
|
||||
}
|
||||
if (HasAbility(target, ABILITY_INTIMIDATE) && (splitIndex == 0)) {
|
||||
atkMultiplier *= 4;
|
||||
atkDivisor *= 5;
|
||||
}
|
||||
|
||||
if ((HasAbility(target, ABILITY_MARVEL_SCALE)) && (splitIndex == 0)) {
|
||||
EntityInfo *targetInfo = GetEntInfo(target);
|
||||
bool8 hasNegStatus_target = HasNegativeStatus(target);
|
||||
bool8 visFlags_target = SetVisualFlags(targetInfo, 8, hasNegStatus_target);
|
||||
|
||||
if (hasNegStatus_target) {
|
||||
defMultiplier *= 3;
|
||||
defDivisor *= 2;
|
||||
}
|
||||
if (visFlags_target) {
|
||||
sub_8042940(target);
|
||||
TryDisplayDungeonLoggableMessage3(attacker,target, gUnknown_80FEE54); // Its special ability quickened attacks!
|
||||
}
|
||||
}
|
||||
|
||||
*atkStat *= atkMultiplier;
|
||||
*defStat *= defMultiplier;
|
||||
if (atkDivisor != 1) {
|
||||
*atkStat = *atkStat / atkDivisor;
|
||||
}
|
||||
if (defDivisor != 1) {
|
||||
*defStat = *defStat / defDivisor;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void SetDamageOne(struct DamageStruct *dmgStruct, u8 moveType)
|
||||
{
|
||||
dmgStruct->dmg = 1;
|
||||
dmgStruct->residualDmgType = 0;
|
||||
dmgStruct->typeEffectiveness = EFFECTIVENESS_NEUTRAL;
|
||||
dmgStruct->type = moveType;
|
||||
dmgStruct->isCrit = FALSE;
|
||||
dmgStruct->unkE = 0;
|
||||
dmgStruct->unkF = 0;
|
||||
}
|
||||
|
||||
void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s32 critChance, struct DamageStruct *dmgStruct, s32 arg8, u16 moveId, bool8 arg_10)
|
||||
{
|
||||
EntityInfo *attackerInfo = GetEntInfo(attacker);
|
||||
EntityInfo *targetInfo = GetEntInfo(target);
|
||||
s32 splitIndex = (!IsTypePhysical(moveType)) ? 1 : 0;
|
||||
|
||||
sub_806F500();
|
||||
if (!attackerInfo->isTeamLeader && FixedPointToInt(attackerInfo->belly) == 0) {
|
||||
SetDamageOne(dmgStruct, moveType);
|
||||
}
|
||||
else if (moveId == MOVE_REGULAR_ATTACK && HasAbility(target, ABILITY_WONDER_GUARD)) {
|
||||
SetDamageOne(dmgStruct, moveType);
|
||||
}
|
||||
else {
|
||||
s32 atkStatStage, defStatStage;
|
||||
s32 statCalc;
|
||||
s32 atkStat, defStat;
|
||||
s32 rand;
|
||||
s32 r6;
|
||||
struct unkStruct_80943A8 unkSp1;
|
||||
struct unkStruct_80943A8 unkSp2;
|
||||
struct unkStruct_80943A8 unkSp3;
|
||||
struct unkStruct_80943A8 unkSp4;
|
||||
struct unkStruct_80943A8 unkSp5;
|
||||
struct unkStruct_80943A8 unkSp6;
|
||||
struct unkStruct_80943A8 unkSp7;
|
||||
struct unkStruct_80943A8 unkSp8;
|
||||
struct unkStruct_80943A8 unkSp9;
|
||||
struct unkStruct_80943A8 unkSp10;
|
||||
struct unkStruct_80943A8 unkSp11;
|
||||
bool8 r5;
|
||||
|
||||
dmgStruct->type = moveType;
|
||||
gDungeon->unk134.unk134 = moveType;
|
||||
gDungeon->unk134.unk138 = splitIndex;
|
||||
|
||||
atkStatStage = attackerInfo->offensiveStages[splitIndex];
|
||||
if (arg_10 && moveType == TYPE_FIRE) {
|
||||
atkStatStage += attackerInfo->flashFireBoost;
|
||||
gDungeon->unk134.unk140[2] = attackerInfo->flashFireBoost;
|
||||
}
|
||||
if (attackerInfo->apparentID == MONSTER_DEOXYS_ATTACK) {
|
||||
atkStatStage += 2;
|
||||
}
|
||||
if (attackerInfo->apparentID == MONSTER_DEOXYS_DEFENSE) {
|
||||
atkStatStage -= 2;
|
||||
}
|
||||
if (attackerInfo->apparentID == MONSTER_DEOXYS_SPEED) {
|
||||
atkStatStage -= 2;
|
||||
}
|
||||
|
||||
if (atkStatStage < 0) atkStatStage = 0;
|
||||
if (atkStatStage > 20) atkStatStage = 20;
|
||||
|
||||
gDungeon->unk134.unk13E[0] = atkStatStage;
|
||||
gDungeon->unk134.unk140[0] = attackerInfo->atk[splitIndex] + movePower;
|
||||
statCalc = s24_8_mul((attackerInfo->atk[splitIndex] + movePower) * 256, gUnknown_80F504C[atkStatStage]);
|
||||
statCalc = s24_8_mul(statCalc, attackerInfo->offensiveMultipliers[splitIndex]);
|
||||
atkStat = statCalc / 256;
|
||||
|
||||
defStatStage = targetInfo->defensiveStages[splitIndex];
|
||||
if (splitIndex == 0 && targetInfo->charging.chargingStatus == STATUS_SKULL_BASH) {
|
||||
gDungeon->unk134.unk17A = 1;
|
||||
defStatStage++;
|
||||
}
|
||||
if (targetInfo->apparentID == MONSTER_DEOXYS_ATTACK) {
|
||||
defStatStage -= 2;
|
||||
}
|
||||
if (targetInfo->apparentID == MONSTER_DEOXYS_DEFENSE) {
|
||||
defStatStage += 2;
|
||||
}
|
||||
if (targetInfo->apparentID == MONSTER_DEOXYS_SPEED) {
|
||||
defStatStage -= 2;
|
||||
}
|
||||
|
||||
if (defStatStage < 0) defStatStage = 0;
|
||||
if (defStatStage > 20) defStatStage = 20;
|
||||
|
||||
gDungeon->unk134.unk13E[1] = defStatStage;
|
||||
gDungeon->unk134.unk140[1] = targetInfo->def[splitIndex];
|
||||
statCalc = s24_8_mul((targetInfo->def[splitIndex]) * 256, gUnknown_80F50A0[defStatStage]);
|
||||
statCalc = s24_8_mul(statCalc, targetInfo->defensiveMultipliers[splitIndex]);
|
||||
defStat = statCalc / 256;
|
||||
|
||||
rand = DungeonRandInt(100);
|
||||
if (splitIndex == 0) {
|
||||
if (HasHeldItem(attacker, ITEM_POWER_BAND)) {
|
||||
atkStat += gUnknown_810AC60;
|
||||
gDungeon->unk134.unk160 += gUnknown_810AC60;
|
||||
}
|
||||
if (HasHeldItem(attacker, ITEM_MUNCH_BELT)) {
|
||||
atkStat += gUnknown_810AC68;
|
||||
gDungeon->unk134.unk160 += gUnknown_810AC68;
|
||||
}
|
||||
if (arg_10 && HasHeldItem(target, ITEM_DEF_SCARF)) {
|
||||
defStat += gUnknown_810AC64;
|
||||
gDungeon->unk134.unk162 += gUnknown_810AC64;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (arg_10 && HasHeldItem(target, ITEM_ZINC_BAND)) {
|
||||
defStat += gUnknown_810AC66;
|
||||
gDungeon->unk134.unk163 += gUnknown_810AC66;
|
||||
}
|
||||
if (HasHeldItem(attacker, ITEM_SPECIAL_BAND)) {
|
||||
atkStat += gUnknown_810AC62;
|
||||
gDungeon->unk134.unk161 += gUnknown_810AC62;
|
||||
}
|
||||
if (HasHeldItem(attacker, ITEM_MUNCH_BELT)) {
|
||||
atkStat += gUnknown_810AC68;
|
||||
gDungeon->unk134.unk161 += gUnknown_810AC68;
|
||||
}
|
||||
}
|
||||
|
||||
gDungeon->unk134.unk140[3] = atkStat;
|
||||
gDungeon->unk134.unk140[4] = defStat;
|
||||
if (atkStat < 0) atkStat = 0;
|
||||
if (atkStat >= 999) atkStat = 999;
|
||||
|
||||
attackerInfo->previousVisualFlags &= ~(0x100);
|
||||
attackerInfo->visualFlags &= ~(0x100);
|
||||
ApplyAtkDefStatBoosts(attacker, target, moveType, &atkStat, &defStat, rand);
|
||||
sub_800A020(&unkSp1, atkStat - defStat);
|
||||
sub_800A020(&unkSp2, 8);
|
||||
sub_800A3F0(&unkSp1, &unkSp1, &unkSp2);
|
||||
if (!attackerInfo->isNotTeamMember) {
|
||||
sub_800A020(&unkSp2, attackerInfo->level);
|
||||
unkSp3.s0 = 0;
|
||||
unkSp3.s4 = 0xAAAA;
|
||||
sub_800A34C(&unkSp2, &unkSp2, &unkSp3);
|
||||
r6 = (attackerInfo->level * 2) / 3;
|
||||
}
|
||||
else {
|
||||
s32 unkAtkStat2 = attackerInfo->atk[splitIndex];
|
||||
s32 unkDefStat2 = 1;
|
||||
ApplyAtkDefStatBoosts(attacker, target, moveType, &unkAtkStat2, &unkDefStat2, rand);
|
||||
sub_800A020(&unkSp2, unkAtkStat2);
|
||||
sub_800A020(&unkSp3, 3);
|
||||
sub_800A3F0(&unkSp2, &unkSp2, &unkSp3);
|
||||
r6 = unkAtkStat2 / 3;
|
||||
}
|
||||
sub_800A6D0(&unkSp4, &unkSp1, &unkSp2);
|
||||
gDungeon->unk134.unk140[5] = r6;
|
||||
gDungeon->unk134.unk140[6] = sub_800A048(&unkSp4);
|
||||
unkSp5 = unkSp4;
|
||||
unkSp7 = unkSp4;
|
||||
sub_800A34C(&unkSp5, &unkSp5, &unkSp5);
|
||||
unkSp6.s0 = 0;
|
||||
unkSp6.s4 = 0xCCC;
|
||||
sub_800A34C(&unkSp5, &unkSp5, &unkSp6);
|
||||
sub_800A020(&unkSp6, 2);
|
||||
sub_800A34C(&unkSp7, &unkSp7, &unkSp6);
|
||||
sub_800A020(&unkSp6, defStat);
|
||||
sub_800A6F0(&unkSp7, &unkSp7, &unkSp6);
|
||||
sub_800A020(&unkSp6, 10);
|
||||
sub_800A6D0(&unkSp7, &unkSp7, &unkSp6);
|
||||
sub_800A6D0(&unkSp8, &unkSp5, &unkSp7);
|
||||
if (sub_800A2F0(&gUnknown_8106F24, &unkSp8)) {
|
||||
unkSp8 = gUnknown_8106F24;
|
||||
}
|
||||
if (sub_800A2F0(&unkSp8, &gUnknown_8106F04)) {
|
||||
unkSp8 = gUnknown_8106F04;
|
||||
}
|
||||
r5 = sub_806E100(&unkSp9, attacker, target, moveType, dmgStruct);
|
||||
|
||||
if (moveType == TYPE_FIRE) {
|
||||
s32 flashFireStatus = GetFlashFireStatus(target);
|
||||
if (flashFireStatus != FLASH_FIRE_STATUS_NONE && targetInfo->unk152 == 0 && arg_10) {
|
||||
targetInfo->unk152 = 1;
|
||||
SetMessageArgument(gFormatBuffer_Monsters[1], target, 0);
|
||||
if (flashFireStatus == FLASH_FIRE_STATUS_MAXED) {
|
||||
TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FAE00); // Fire moves won't become stronger!
|
||||
}
|
||||
else {
|
||||
TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FADD8); // m1 used Flash Fire to absorb fire!
|
||||
}
|
||||
}
|
||||
}
|
||||
if (arg_10) {
|
||||
if (splitIndex == 0 && targetInfo->protection.protectionStatus == STATUS_REFLECT) {
|
||||
sub_8041B74(target);
|
||||
sub_800A34C(&unkSp9, &unkSp9, &gUnknown_8106F1C);
|
||||
gDungeon->unk134.unk166 = 1;
|
||||
}
|
||||
if (splitIndex == 1 && targetInfo->protection.protectionStatus == STATUS_LIGHT_SCREEN) {
|
||||
sub_8041B5C(target);
|
||||
sub_800A34C(&unkSp9, &unkSp9, &gUnknown_8106F1C);
|
||||
gDungeon->unk134.unk167 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Check crit
|
||||
if (!HasAbility(target, ABILITY_BATTLE_ARMOR) && !HasAbility(target, ABILITY_SHELL_ARMOR)) {
|
||||
s32 critOdds;
|
||||
|
||||
if (attackerInfo->isNotTeamMember) {
|
||||
critOdds = 0;
|
||||
}
|
||||
else {
|
||||
critOdds = critChance;
|
||||
}
|
||||
|
||||
if (attackerInfo->moveStatus.moveStatus == STATUS_FOCUS_ENERGY) {
|
||||
critOdds = 999;
|
||||
gDungeon->unk134.unk168 = 1;
|
||||
}
|
||||
else {
|
||||
if (HasHeldItem(attacker, ITEM_SCOPE_LENS)) {
|
||||
critOdds += gUnknown_80F4DAE;
|
||||
gDungeon->unk134.unk164 = 1;
|
||||
}
|
||||
if (HasHeldItem(target, ITEM_PATSY_BAND)) {
|
||||
critOdds += gUnknown_80F4DAE;
|
||||
gDungeon->unk134.unk165 = 1;
|
||||
}
|
||||
if (r5 && IQSkillIsEnabled(attacker, IQ_TYPE_ADVANTAGE_MASTER)) {
|
||||
critOdds = gUnknown_80F4DB0;
|
||||
gDungeon->unk134.unk169 = 1;
|
||||
}
|
||||
}
|
||||
if (DungeonRandInt(100) < critOdds) {
|
||||
sub_800A34C(&unkSp9, &unkSp9, &gUnknown_8106F14);
|
||||
dmgStruct->isCrit = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
gDungeon->unk134.unk154 = sub_800A048(&unkSp8);
|
||||
sub_800A34C(&unkSp8, &unkSp8, &unkSp9);
|
||||
{
|
||||
// Ugly hack needed to match
|
||||
#ifdef NONMATCHING
|
||||
s32 arg8_Match;
|
||||
#else
|
||||
register s32 arg8_Match asm("r2");
|
||||
#endif // NONMATCHING
|
||||
|
||||
gDungeon->unk134.unk15C = arg8_Match = arg8;
|
||||
ASM_MATCH_TRICK(arg8);
|
||||
sub_800A088(&unkSp10, arg8_Match);
|
||||
sub_800A34C(&unkSp8, &unkSp8, &unkSp10);
|
||||
}
|
||||
|
||||
// ALSO needed to match. unk694 chosen randomly and it worked with matching.
|
||||
ASM_MATCH_TRICK(gDungeon->unk694);
|
||||
gDungeon->unk134.unk150 = sub_800A048(&unkSp8);
|
||||
{
|
||||
s32 rnd = DungeonRandInt(0x4000);
|
||||
unkSp9.s0 = 0;
|
||||
unkSp9.s4 = 0xE000 + rnd;
|
||||
}
|
||||
sub_800A34C(&unkSp8, &unkSp8, &unkSp9);
|
||||
sub_800A020(&unkSp11, 100);
|
||||
|
||||
sub_800A34C(&unkSp9, &unkSp11, &unkSp9);
|
||||
gDungeon->unk134.unk158 = sub_800A048(&unkSp9);
|
||||
|
||||
dmgStruct->dmg = sub_800A048(&unkSp8);
|
||||
dmgStruct->residualDmgType = 0;
|
||||
if (dmgStruct->dmg == 0) {
|
||||
dmgStruct->isCrit = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_806F2BC(Entity *attacker, Entity *target, u8 moveType, s32 a2, struct DamageStruct *dmgStruct)
|
||||
{
|
||||
struct unkStruct_80943A8 unkSp1;
|
||||
struct unkStruct_80943A8 unkSp2;
|
||||
s32 a2New = a2;
|
||||
|
||||
if (a2New <= 0) a2New = 1;
|
||||
if (a2New > 999) a2New = 999;
|
||||
|
||||
dmgStruct->type = moveType;
|
||||
sub_806E100(&unkSp1, attacker, target, moveType, dmgStruct);
|
||||
sub_800A020(&unkSp2, a2New);
|
||||
sub_800A34C(&unkSp2, &unkSp2, &unkSp1);
|
||||
dmgStruct->dmg = sub_800A048(&unkSp2);
|
||||
dmgStruct->residualDmgType = 0;
|
||||
}
|
||||
|
||||
void DealDamageToEntity(Entity *entity, s32 dmg, s32 r6, s16 r4)
|
||||
{
|
||||
Entity spEntity;
|
||||
struct DamageStruct dmgStruct;
|
||||
s32 r4_ = r4;
|
||||
|
||||
sub_80457DC(&spEntity);
|
||||
dmgStruct.dmg = dmg;
|
||||
dmgStruct.typeEffectiveness = EFFECTIVENESS_NEUTRAL;
|
||||
dmgStruct.type = TYPE_NONE;
|
||||
dmgStruct.residualDmgType = r6;
|
||||
dmgStruct.isCrit = FALSE;
|
||||
dmgStruct.unkE = 0;
|
||||
dmgStruct.unkF = 0;
|
||||
HandleDealingDamage(&spEntity, entity, &dmgStruct, FALSE, FALSE, r4_, FALSE, 0);
|
||||
}
|
||||
|
||||
void sub_806F370(Entity *pokemon, Entity *target, s32 dmg, s32 r9, u8 *arg_0, u8 moveType, s16 arg_8, s32 arg_C, s32 arg_10, s32 arg_14)
|
||||
{
|
||||
s32 i;
|
||||
struct DamageStruct dmgStruct;
|
||||
s32 arg_8_ = arg_8;
|
||||
s32 dmgNew = dmg;
|
||||
|
||||
dmgStruct.typeEffectiveness = EFFECTIVENESS_NEUTRAL;
|
||||
dmgStruct.residualDmgType = arg_C;
|
||||
dmgStruct.type = moveType;
|
||||
dmgStruct.isCrit = FALSE;
|
||||
dmgStruct.unkE = 0;
|
||||
|
||||
if (moveType != TYPE_NONE) {
|
||||
s32 typeEffectiveness[2];
|
||||
EntityInfo *targetInfo = GetEntInfo(target);
|
||||
for (i = 0; i < 2; i++) {
|
||||
s32 effectiv = gTypeEffectivenessChart[moveType][targetInfo->types[i]];
|
||||
typeEffectiveness[i] = effectiv;
|
||||
}
|
||||
if (HasAbility(target, ABILITY_WONDER_GUARD)) {
|
||||
if (gUnknown_80F54B4[typeEffectiveness[0]][typeEffectiveness[1]] != EFFECTIVENESS_SUPER) {
|
||||
dmgNew = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dmgStruct.dmg = dmgNew;
|
||||
if (dmgNew == 0) {
|
||||
dmgStruct.unkF = 1;
|
||||
}
|
||||
else {
|
||||
dmgStruct.unkF = 0;
|
||||
}
|
||||
|
||||
HandleDealingDamage(pokemon, target, &dmgStruct, FALSE, r9, arg_8_, arg_10, arg_14);
|
||||
if (arg_0 != NULL) {
|
||||
*arg_0 = dmgStruct.unkF;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -514,10 +514,10 @@ void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 para
|
||||
GetAvailTacticsforLvl_Bool(tacticsBuffer1,info->level);
|
||||
}
|
||||
maxHP = info->maxHPStat;
|
||||
atk[0] = info->atk;
|
||||
atk[1] = info->spAtk;
|
||||
def[0] = info->def;
|
||||
def[1] = info->spDef;
|
||||
atk[0] = info->atk[0];
|
||||
atk[1] = info->atk[1];
|
||||
def[0] = info->def[0];
|
||||
def[1] = info->def[1];
|
||||
if (!IsClientOrTeamBase(info->joinedAt.joinedAt)) {
|
||||
newLevel = info->level + level;
|
||||
if (99 < newLevel) {
|
||||
@@ -529,10 +529,10 @@ void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 para
|
||||
flag |= (sub_80723D0(pokemon,target,param_4,param_5));
|
||||
if ((flag != 0) && (!info->isNotTeamMember)) {
|
||||
gFormatArgs[0] = info->maxHPStat - maxHP;
|
||||
gFormatArgs[1] = info->atk - atk[0];
|
||||
gFormatArgs[2] = info->def - def[0];
|
||||
gFormatArgs[3] = info->spAtk - atk[1];
|
||||
gFormatArgs[4] = info->spDef - def[1];
|
||||
gFormatArgs[1] = info->atk[0] - atk[0];
|
||||
gFormatArgs[2] = info->def[0] - def[0];
|
||||
gFormatArgs[3] = info->atk[1] - atk[1];
|
||||
gFormatArgs[4] = info->def[1] - def[1];
|
||||
if (param_4 != 0) {
|
||||
sub_807218C(target);
|
||||
}
|
||||
@@ -734,10 +734,10 @@ bool8 sub_80723D0(Entity *pokemon, Entity *target, u8 param_3, u8 param_4)
|
||||
info->HP = info->maxHPStat;
|
||||
}
|
||||
|
||||
gUnknown_202F31C[0] = info->atk;
|
||||
gUnknown_202F31C[1] = info->spAtk;
|
||||
gUnknown_202F324[0] = info->def;
|
||||
gUnknown_202F324[1] = info->spDef;
|
||||
gUnknown_202F31C[0] = info->atk[0];
|
||||
gUnknown_202F31C[1] = info->atk[1];
|
||||
gUnknown_202F324[0] = info->def[0];
|
||||
gUnknown_202F324[1] = info->def[1];
|
||||
|
||||
gUnknown_202F31C[0] += leveldata.gainAtt;
|
||||
gUnknown_202F31C[1] += leveldata.gainSPAtt;
|
||||
@@ -757,10 +757,10 @@ bool8 sub_80723D0(Entity *pokemon, Entity *target, u8 param_3, u8 param_4)
|
||||
LoadIQSkills(target);
|
||||
sub_8079764(target);
|
||||
|
||||
info->atk = gUnknown_202F31C[0];
|
||||
info->spAtk = gUnknown_202F31C[1];
|
||||
info->def = gUnknown_202F324[0];
|
||||
info->spDef = gUnknown_202F324[1];
|
||||
info->atk[0] = gUnknown_202F31C[0];
|
||||
info->atk[1] = gUnknown_202F31C[1];
|
||||
info->def[0] = gUnknown_202F324[0];
|
||||
info->def[1] = gUnknown_202F324[1];
|
||||
|
||||
sub_8072778(pokemon, target, param_3, param_4);
|
||||
}
|
||||
@@ -828,10 +828,10 @@ bool8 sub_80725A4(Entity *pokemon, Entity *target)
|
||||
info->HP = info->maxHPStat;
|
||||
}
|
||||
|
||||
gUnknown_202F31C[0] = info->atk;
|
||||
gUnknown_202F31C[1] = info->spAtk;
|
||||
gUnknown_202F324[0] = info->def;
|
||||
gUnknown_202F324[1] = info->spDef;
|
||||
gUnknown_202F31C[0] = info->atk[0];
|
||||
gUnknown_202F31C[1] = info->atk[1];
|
||||
gUnknown_202F324[0] = info->def[0];
|
||||
gUnknown_202F324[1] = info->def[1];
|
||||
|
||||
gUnknown_202F31C[0] -= leveldata.gainAtt;
|
||||
gUnknown_202F31C[1] -= leveldata.gainSPAtt;
|
||||
@@ -851,10 +851,10 @@ bool8 sub_80725A4(Entity *pokemon, Entity *target)
|
||||
LoadIQSkills(target);
|
||||
sub_8079764(target);
|
||||
|
||||
info->atk = gUnknown_202F31C[0];
|
||||
info->spAtk = gUnknown_202F31C[1];
|
||||
info->def = gUnknown_202F324[0];
|
||||
info->spDef = gUnknown_202F324[1];
|
||||
info->atk[0] = gUnknown_202F31C[0];
|
||||
info->atk[1] = gUnknown_202F31C[1];
|
||||
info->def[0] = gUnknown_202F324[0];
|
||||
info->def[1] = gUnknown_202F324[1];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -508,14 +508,14 @@ void RaiseAtkStatTarget(Entity * pokemon, Entity *target, s32 increment)
|
||||
SetMessageArgument(gFormatBuffer_Monsters[0],target,0);
|
||||
|
||||
entityInfo = GetEntInfo(target);
|
||||
oldStat = entityInfo->atk;
|
||||
oldStat = entityInfo->atk[0];
|
||||
oldStat1 = oldStat;
|
||||
|
||||
newStat = entityInfo->atk + increment;
|
||||
newStat = entityInfo->atk[0] + increment;
|
||||
if (0xfe < newStat) {
|
||||
newStat = 0xff;
|
||||
}
|
||||
entityInfo->atk = newStat;
|
||||
entityInfo->atk[0] = newStat;
|
||||
if (oldStat1 < (u8)newStat) {
|
||||
sub_8041E60(target);
|
||||
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC33C);
|
||||
@@ -538,14 +538,14 @@ void RaiseSpAtkStatTarget(Entity * pokemon, Entity *target, s32 increment)
|
||||
SetMessageArgument(gFormatBuffer_Monsters[0],target,0);
|
||||
|
||||
entityInfo = GetEntInfo(target);
|
||||
oldStat = entityInfo->spAtk;
|
||||
oldStat = entityInfo->atk[1];
|
||||
oldStat1 = oldStat;
|
||||
|
||||
newStat = entityInfo->spAtk + increment;
|
||||
newStat = entityInfo->atk[1] + increment;
|
||||
if (0xfe < newStat) {
|
||||
newStat = 0xff;
|
||||
}
|
||||
entityInfo->spAtk = newStat;
|
||||
entityInfo->atk[1] = newStat;
|
||||
if (oldStat1 < (u8)newStat) {
|
||||
sub_8041E74(target);
|
||||
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC388);
|
||||
@@ -568,14 +568,14 @@ void RaiseDefStatTarget(Entity * pokemon, Entity *target, s32 increment)
|
||||
SetMessageArgument(gFormatBuffer_Monsters[0],target,0);
|
||||
|
||||
entityInfo = GetEntInfo(target);
|
||||
oldStat = entityInfo->def;
|
||||
oldStat = entityInfo->def[0];
|
||||
oldStat1 = oldStat;
|
||||
|
||||
newStat = entityInfo->def + increment;
|
||||
newStat = entityInfo->def[0] + increment;
|
||||
if (0xfe < newStat) {
|
||||
newStat = 0xff;
|
||||
}
|
||||
entityInfo->def = newStat;
|
||||
entityInfo->def[0] = newStat;
|
||||
if (oldStat1 < (u8)newStat) {
|
||||
sub_8041E84(target);
|
||||
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC3D8);
|
||||
@@ -598,14 +598,14 @@ void RaiseSpDefStatTarget(Entity * pokemon, Entity *target, s32 increment)
|
||||
SetMessageArgument(gFormatBuffer_Monsters[0],target,0);
|
||||
|
||||
entityInfo = GetEntInfo(target);
|
||||
oldStat = entityInfo->spDef;
|
||||
oldStat = entityInfo->def[1];
|
||||
oldStat1 = oldStat;
|
||||
|
||||
newStat = entityInfo->spDef + increment;
|
||||
newStat = entityInfo->def[1] + increment;
|
||||
if (0xfe < newStat) {
|
||||
newStat = 0xff;
|
||||
}
|
||||
entityInfo->spDef = newStat;
|
||||
entityInfo->def[1] = newStat;
|
||||
if (oldStat1 < (u8)newStat) {
|
||||
sub_8041E94(target);
|
||||
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC428);
|
||||
|
||||
@@ -111,7 +111,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla
|
||||
}
|
||||
break;
|
||||
case ITEM_PROTEIN:
|
||||
if (pokemonInfo->atk > 249)
|
||||
if (pokemonInfo->atk[0] > 249)
|
||||
{
|
||||
itemWeight = 0;
|
||||
}
|
||||
@@ -121,7 +121,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla
|
||||
}
|
||||
break;
|
||||
case ITEM_CALCIUM:
|
||||
if (pokemonInfo->spAtk > 249)
|
||||
if (pokemonInfo->atk[1] > 249)
|
||||
{
|
||||
itemWeight = 0;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla
|
||||
}
|
||||
break;
|
||||
case ITEM_IRON:
|
||||
if (pokemonInfo->def > 249)
|
||||
if (pokemonInfo->def[0] > 249)
|
||||
{
|
||||
itemWeight = 0;
|
||||
}
|
||||
@@ -141,7 +141,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla
|
||||
}
|
||||
break;
|
||||
case ITEM_ZINC:
|
||||
if (pokemonInfo->spDef > 249)
|
||||
if (pokemonInfo->def[1] > 249)
|
||||
{
|
||||
itemWeight = 0;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ extern void sub_80429C8(Entity *r0);
|
||||
extern u8 sub_803F428(Position *);
|
||||
extern bool8 sub_8045888(Entity *r0);
|
||||
extern void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4, bool32 arg8, s32 argC);
|
||||
extern void sub_806EAF4(Entity *, Entity *, u8, u32, u32, struct DamageStruct *dmgStruct, u32, u16, u32);
|
||||
extern void CalcDamage(Entity *, Entity *, u8, u32, u32, struct DamageStruct *dmgStruct, u32, u16, u32);
|
||||
extern s16 sub_8057600(Move *move, s32 itemID);
|
||||
extern void sub_803ED30(s32, Entity *r0, u8, s32);
|
||||
extern void sub_8042238(Entity *pokemon, Entity *target);
|
||||
@@ -622,7 +622,6 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move
|
||||
case MOVE_JUMP_KICK:
|
||||
sub_8059E54(attacker, currTarget, move, itemId, 1);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (sub_8044B28())
|
||||
@@ -1667,7 +1666,7 @@ s32 HandleDamagingMove(Entity *attacker, Entity *target, Move *move, s32 r9, s32
|
||||
s32 movePower = GetMovePower(attacker, move);
|
||||
s32 critChance = GetMoveCritChance(move);
|
||||
|
||||
sub_806EAF4(attacker, target, moveType, movePower, critChance, &dmgStruct, r9, move->id, 1);
|
||||
CalcDamage(attacker, target, moveType, movePower, critChance, &dmgStruct, r9, move->id, 1);
|
||||
unk = sub_8057600(move, itemId);
|
||||
return TryHitTarget(attacker, target, move, &dmgStruct, unk);
|
||||
}
|
||||
@@ -1679,7 +1678,7 @@ s32 sub_80556BC(Entity *attacker, Entity *target, u8 moveType, Move *move, s32 r
|
||||
s32 movePower = GetMovePower(attacker, move);
|
||||
s32 critChance = GetMoveCritChance(move);
|
||||
|
||||
sub_806EAF4(attacker, target, moveType, movePower, critChance, &dmgStruct, r9, move->id, 1);
|
||||
CalcDamage(attacker, target, moveType, movePower, critChance, &dmgStruct, r9, move->id, 1);
|
||||
unk = sub_8057600(move, itemId);
|
||||
return TryHitTarget(attacker, target, move, &dmgStruct, unk);
|
||||
}
|
||||
|
||||
@@ -58,10 +58,10 @@ void sub_8083AB0(s16 param_0, Entity * target, Entity * entity)
|
||||
temp->exp = entityInfo->exp;
|
||||
temp->level = entityInfo->level;
|
||||
temp->maxHPStat = entityInfo->maxHPStat;
|
||||
temp->atk = entityInfo->atk;
|
||||
temp->spAtk = entityInfo->spAtk;
|
||||
temp->def = entityInfo->def;
|
||||
temp->spDef = entityInfo->spDef;
|
||||
temp->atk = entityInfo->atk[0];
|
||||
temp->spAtk = entityInfo->atk[1];
|
||||
temp->def = entityInfo->def[0];
|
||||
temp->spDef = entityInfo->def[1];
|
||||
temp->dungeonLocation = gDungeon->dungeonLocation;
|
||||
attackPtr = &temp->attBoost;
|
||||
*attackPtr = 0;
|
||||
|
||||
@@ -184,11 +184,11 @@ extern u8 sub_803F428(Position *pos);
|
||||
extern void sub_807EC28(bool8);
|
||||
extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32);
|
||||
extern void sub_804652C(Entity *, Entity *, Item *, u32, Position *);
|
||||
extern void sub_806EAF4(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32);
|
||||
extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32);
|
||||
extern void sub_8045C28(Item *, u8 , u8);
|
||||
extern void sub_805A7D4(Entity *, Entity *, Item *, Position *);
|
||||
extern void MudWaterSportEffect(u32);
|
||||
extern void sub_806EAF4(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32);
|
||||
extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32);
|
||||
extern void sub_806A6E8(Entity *);
|
||||
|
||||
extern void sub_806ABAC(Entity *, Entity *);
|
||||
@@ -2171,7 +2171,7 @@ bool8 sub_8059E54(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 pa
|
||||
moveType = GetMoveTypeForMonster(pokemon,move);
|
||||
movePower = GetMovePower(pokemon,move);
|
||||
moveCritChance = GetMoveCritChance(move);
|
||||
sub_806EAF4(pokemon,target,moveType,movePower,moveCritChance,local_30,0x100,move->id,0);
|
||||
CalcDamage(pokemon,target,moveType,movePower,moveCritChance,local_30,0x100,move->id,0);
|
||||
SetMessageArgument_2(gFormatBuffer_Monsters[0],GetEntInfo(pokemon),0);
|
||||
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC7C8);
|
||||
local_30[0] = local_30[0] / 2;
|
||||
@@ -2221,7 +2221,7 @@ bool8 sub_8059FC8(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 pa
|
||||
moveType = GetMoveTypeForMonster(pokemon,move);
|
||||
movePower = GetMovePower(pokemon,move);
|
||||
moveCritChance = GetMoveCritChance(move);
|
||||
sub_806EAF4(pokemon,target,moveType,movePower,moveCritChance,local_30,0x200,move->id,0);
|
||||
CalcDamage(pokemon,target,moveType,movePower,moveCritChance,local_30,0x200,move->id,0);
|
||||
SetMessageArgument_2(gFormatBuffer_Monsters[0],GetEntInfo(pokemon),0);
|
||||
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC7C8);
|
||||
local_30[0] = local_30[0] / 2;
|
||||
|
||||
@@ -333,10 +333,10 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2)
|
||||
sub_8083048(param_1,info->HP);
|
||||
sub_8083048(param_1,info->maxHPStat);
|
||||
sub_8083048(param_1,info->originalHP);
|
||||
sub_8083060(param_1,info->atk);
|
||||
sub_8083060(param_1,info->spAtk);
|
||||
sub_8083060(param_1,info->def);
|
||||
sub_8083060(param_1,info->spDef);
|
||||
sub_8083060(param_1,info->atk[0]);
|
||||
sub_8083060(param_1,info->atk[1]);
|
||||
sub_8083060(param_1,info->def[0]);
|
||||
sub_8083060(param_1,info->def[1]);
|
||||
sub_8083078(param_1,info->exp);
|
||||
sub_8083048(param_1,info->offensiveStages[0]);
|
||||
sub_8083048(param_1,info->offensiveStages[1]);
|
||||
|
||||
Reference in New Issue
Block a user