Decomped GetFlashFireStatus()

This commit is contained in:
AnonymousRandomPerson 2022-03-05 00:00:01 -05:00
parent 9a4864c1cf
commit f7a73281cf
6 changed files with 9222 additions and 9217 deletions

File diff suppressed because it is too large Load Diff

9186
asm/code_8077274.s Normal file

File diff suppressed because it is too large Load Diff

13
include/status.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef GUARD_STATUS_H
#define GUARD_STATUS_H
#include "dungeon_entity.h"
#define FLASH_FIRE_STATUS_NONE 0
#define FLASH_FIRE_STATUS_MAXED 1
#define FLASH_FIRE_STATUS_NOT_MAXED 2
// 0x7723C
u8 GetFlashFireStatus(struct DungeonEntity *pokemon);
#endif

View File

@ -240,6 +240,8 @@ SECTIONS {
asm/code_8073CF0.o(.text);
src/dungeon_ai_movement.o(.text);
asm/code_8075BA4.o(.text);
src/status.o(.text);
asm/code_8077274.o(.text);
src/dungeon_ai_attack.o(.text);
asm/code_807C4A0.o(.text);
src/dungeon_ai_attack_1.o(.text);

19
src/status.c Normal file
View File

@ -0,0 +1,19 @@
#include "global.h"
#include "status.h"
#include "constants/ability.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_util.h"
u8 GetFlashFireStatus(struct DungeonEntity *pokemon)
{
if (!EntityExists(pokemon) || !HasAbility(pokemon, ABILITY_FLASH_FIRE))
{
return FLASH_FIRE_STATUS_NONE;
}
if (pokemon->entityData->flashFireBoost > 1)
{
return FLASH_FIRE_STATUS_MAXED;
}
return FLASH_FIRE_STATUS_NOT_MAXED;
}

View File

@ -7,15 +7,12 @@
#include "dungeon_global_data.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_util.h"
#include "status.h"
#include "type_chart.h"
#include "weather.h"
#define FLASH_FIRE_STATUS_NONE 0
u32 gTypeEffectivenessMultipliers[] = {0, 1, 2, 4};
extern u8 GetFlashFireStatus(struct DungeonEntity *pokemon);
s32 WeightWeakTypePicker(struct DungeonEntity *user, struct DungeonEntity *target, u8 moveType)
{
s32 weight = 1;
@ -79,8 +76,7 @@ s32 WeightWeakTypePicker(struct DungeonEntity *user, struct DungeonEntity *targe
if (weight == 0)
{
// BUG: If the Pokémon's first type resists the move, the second type is ignored.
// This can cause type effectiveness to be calculated incorrectly
// if the first type resists the move and the second type is weak to the move.
// This calculates type effectiveness incorrectly if the first type resists the move and the second type is weak to the move.
// For example, a Fire-type move is considered not very effective against a Rock/Bug-type like Anorith.
return 2;
}