Example #1
0
    private void OnValidate()
    {
        //Validate Debuffs
        for (int i = 0; i < BattleStats.Immunities.Stats.Length; i++)
        {
            if (BattleStats.Immunities.Stats[i] != Stat.None && !Debuffs.Contains(BattleStats.Immunities.Stats[i]))
            {
                List <Stat> temp = BattleStats.Immunities.Stats.ToList();
                temp.RemoveAt(i);
                i--;
                BattleStats.Immunities.Stats = temp.ToArray();
            }
        }

        //Serialize Stat Pools
        BattleStats.Immunities.BuffPool     = Debuffs.Where(x => !BattleStats.Immunities.Stats.Contains(x)).ToArray();
        BattleStats.AppliedEffects.BuffPool = All.Where(x => !BattleStats.AppliedEffects.Stats.Contains(x)).ToArray();
    }