Example #1
0
        private static void ScoreStatChange(PBEBattlePokemon user, PBEBattlePokemon target, PBEStat stat, int change, ref double score)
        {
            // TODO: Do we need the stat change? Physical vs special vs status users, and base stats/transform stats/power trick stats
            sbyte original      = target.GetStatChange(stat);
            sbyte maxStatChange = user.Battle.Settings.MaxStatChange;

            change = Math.Max(-maxStatChange, Math.Min(maxStatChange, original + change)) - original;
            if (change != 0)
            {
                score += (user.Team == target.Team ? +1 : -1) * change * 10;
                score += HPAware(target.HPPercentage, -20, +10);
            }
        }