[ai] use expected value to simulate EFFECT_PSYWAVE
This commit is contained in:
parent
0ee13418dc
commit
303e31ae25
1 changed files with 2 additions and 10 deletions
|
@ -737,6 +737,8 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef)
|
||||||
switch (gBattleMoves[move].effect)
|
switch (gBattleMoves[move].effect)
|
||||||
{
|
{
|
||||||
case EFFECT_LEVEL_DAMAGE:
|
case EFFECT_LEVEL_DAMAGE:
|
||||||
|
case EFFECT_PSYWAVE:
|
||||||
|
//psywave's expected damage is equal to the user's level
|
||||||
dmg = gBattleMons[battlerAtk].level;
|
dmg = gBattleMons[battlerAtk].level;
|
||||||
break;
|
break;
|
||||||
case EFFECT_DRAGON_RAGE:
|
case EFFECT_DRAGON_RAGE:
|
||||||
|
@ -745,16 +747,6 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef)
|
||||||
case EFFECT_SONICBOOM:
|
case EFFECT_SONICBOOM:
|
||||||
dmg = 20;
|
dmg = 20;
|
||||||
break;
|
break;
|
||||||
case EFFECT_PSYWAVE:
|
|
||||||
{
|
|
||||||
u32 randDamage;
|
|
||||||
if (B_PSYWAVE_DMG >= GEN_6)
|
|
||||||
randDamage = (Random() % 101);
|
|
||||||
else
|
|
||||||
randDamage = (Random() % 11) * 10;
|
|
||||||
dmg = gBattleMons[battlerAtk].level * (randDamage + 50) / 100;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
//case EFFECT_METAL_BURST:
|
//case EFFECT_METAL_BURST:
|
||||||
//case EFFECT_COUNTER:
|
//case EFFECT_COUNTER:
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue