This commit is contained in:
DizzyEggg 2020-03-14 12:23:51 +01:00
parent 1fc89941ac
commit 3d1b546e05

View File

@ -3618,7 +3618,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_AbilityCuredStatus;
gBattleScripting.battler = gActiveBattler = gAbilityBattler = battler;
gBattleScripting.battler = gActiveBattler = gBattlerAbility = battler;
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1);
MarkBattlerForControllerExec(gActiveBattler);
return effect;
@ -5775,6 +5775,18 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b
return ApplyModifier(modifier, atkStat);
}
static bool32 CanEvolve(u32 species)
{
u32 i;
for (i = 0; i < EVOS_PER_MON; i++)
{
if (gEvolutionTable[species][i].method && gEvolutionTable[species][i].method != EVO_MEGA_EVOLUTION)
return TRUE;
}
return FALSE;
}
static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, bool32 isCrit)
{
bool32 usesDefStat;
@ -5867,7 +5879,8 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType,
MulModifier(&modifier, UQ_4_12(2.0));
break;
case HOLD_EFFECT_EVIOLITE:
// todo
if (CanEvolve(gBattleMons[battlerDef].species))
MulModifier(&modifier, UQ_4_12(1.5));
break;
case HOLD_EFFECT_ASSAULT_VEST:
if (!usesDefStat)