public void CalculateBoost() { if (Boost == null) { Boost = new int[8]; } if (ActivateBoost == null) { ActivateBoost = new ActivateBoost[8]; for (int i = 0; i < 8; i++) { ActivateBoost[i] = new ActivateBoost(); } } for (int i = 0; i < Boost.Length; i++) { Boost[i] = 0; } for (int i = 0; i < 4; i++) { if (Inventory[i] == null) { continue; } foreach (var b in Inventory[i].StatsBoost) { switch ((StatsType)b.Key) { case StatsType.MaximumHP: Boost[0] += b.Value; break; case StatsType.MaximumMP: Boost[1] += b.Value; break; case StatsType.Attack: Boost[2] += b.Value; break; case StatsType.Defense: Boost[3] += b.Value; break; case StatsType.Speed: Boost[4] += b.Value; break; case StatsType.Vitality: Boost[5] += b.Value; break; case StatsType.Wisdom: Boost[6] += b.Value; break; case StatsType.Dexterity: Boost[7] += b.Value; break; } } } for (int i = 0; i < 8; i++) // apply activate boosts { Boost[i] += ActivateBoost[i].GetBoost(); } }
public void CalculateBoost() { if (Boost == null) Boost = new int[8]; if (ActivateBoost == null) { ActivateBoost = new ActivateBoost[8]; for (int i = 0; i < 8; i++) ActivateBoost[i] = new ActivateBoost(); } for (int i = 0; i < Boost.Length; i++) Boost[i] = 0; for (int i = 0; i < 4; i++) { if (Inventory[i] == null) continue; foreach (var b in Inventory[i].StatsBoost) { switch ((StatsType)b.Key) { case StatsType.MaximumHP: Boost[0] += b.Value; break; case StatsType.MaximumMP: Boost[1] += b.Value; break; case StatsType.Attack: Boost[2] += b.Value; break; case StatsType.Defense: Boost[3] += b.Value; break; case StatsType.Speed: Boost[4] += b.Value; break; case StatsType.Vitality: Boost[5] += b.Value; break; case StatsType.Wisdom: Boost[6] += b.Value; break; case StatsType.Dexterity: Boost[7] += b.Value; break; } } } for (int i = 0; i < 8; i++) // apply activate boosts Boost[i] += ActivateBoost[i].GetBoost(); }