mirror of
https://github.com/pret/pmd-red.git
synced 2026-03-26 12:05:17 -05:00
27 lines
763 B
C
27 lines
763 B
C
#include "global.h"
|
|
#include "constants/ability.h"
|
|
#include "constants/iq_skill.h"
|
|
#include "structs/dungeon_entity.h"
|
|
#include "dungeon_pokemon_attributes.h"
|
|
#include "dungeon_random.h"
|
|
#include "dungeon_util.h"
|
|
|
|
s32 CalculateStatusTurns(Entity *target, s16 *turnRange, bool8 factorCurerSkills)
|
|
{
|
|
s32 numTurns;
|
|
|
|
numTurns = DungeonRandRange(turnRange[0],turnRange[1]);
|
|
if (EntityExists(target) && (GetEntityType(target) == ENTITY_MONSTER) && (factorCurerSkills)) {
|
|
if (IQSkillIsEnabled(target, IQ_SELF_CURER) && (numTurns != 0x7f)) {
|
|
numTurns /= 2;
|
|
}
|
|
if (AbilityIsActive(target, ABILITY_NATURAL_CURE) && (numTurns != 0x7f) && (4 < numTurns)) {
|
|
numTurns = 5;
|
|
}
|
|
}
|
|
if (numTurns < 1) {
|
|
numTurns = 1;
|
|
}
|
|
return numTurns;
|
|
}
|