public List <int> GetBaseAttack() { var totalBab = CurrentClasses.Sum(x => x.GetBaseAttackBonus()); var attacks = new List <int>(); for (var i = totalBab; i > 0; i -= 5) { attacks.Add(i); } if (_bonusDto != null && attacks.Any()) { foreach (var bonusRef in _bonusDto.Bonuses) { if (bonusRef.Bonues != null && bonusRef.Bonues.Type == BonusType.ExtraAttackAtFullBab) { if (!bonusRef.IsActive(_bonusDto)) { continue; } var amount = 0; if (bonusRef.Bonues != null && bonusRef.Bonues.BonusValue != null && bonusRef.Bonues.BonusValue.FixedValue.HasValue) { amount = bonusRef.Bonues.BonusValue.FixedValue.Value; } for (int i = 0; i < amount; i++) { attacks.Insert(0, attacks[0]); } } } } return(attacks); }
public int GetTotalLevel() { return(CurrentClasses.Sum(x => x.Level)); }