summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/status.c19
-rw-r--r--src/type_effectiveness.c8
2 files changed, 21 insertions, 6 deletions
diff --git a/src/status.c b/src/status.c
new file mode 100644
index 0000000..dc8a812
--- /dev/null
+++ b/src/status.c
@@ -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;
+}
diff --git a/src/type_effectiveness.c b/src/type_effectiveness.c
index efc1ef9..8a9ee04 100644
--- a/src/type_effectiveness.c
+++ b/src/type_effectiveness.c
@@ -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;
}