Example #1
0
 private static float GetPartyBonus(this IEnumerable <CharacterObject> party, GetBonusDelegate getBonusDelegate, LogBonusDelegate logBonusDelegate) =>
 1 + party
 .Where(troop => troop != null && troop.IsHero)
 .Distinct()
 .Select(troop => new
 {
     bonus = getBonusDelegate(new CharacterAttributeBonuses(troop)),
     name  = troop.Name.ToString()
 })
 .Do(troop => logBonusDelegate?.Invoke(troop.bonus, troop.name))
 .Sum(troop => troop.bonus);
Example #2
0
 public static float GetPartyBonus(this Clan party, GetBonusDelegate getBonusDelegate, LogBonusDelegate logBonusDelegate) =>
 party.Companions
 .Select(companion => companion.CharacterObject)
 .GetPartyBonus(party.Leader.CharacterObject, getBonusDelegate, logBonusDelegate);
Example #3
0
 public static float GetPartyBonus(this MobileParty party, GetBonusDelegate getBonusDelegate, LogBonusDelegate logBonusDelegate) =>
 party.Party
 .GetPartyBonus(getBonusDelegate, logBonusDelegate);
Example #4
0
 public static float GetPartyBonus(this PartyBase party, GetBonusDelegate getBonusDelegate, LogBonusDelegate logBonusDelegate) =>
 party.MemberRoster.Troops
 .GetPartyBonus(party.Leader, getBonusDelegate, logBonusDelegate);
Example #5
0
 public static float GetPartyBonus(this IEnumerable <CharacterObject> party, CharacterObject leader, GetBonusDelegate getBonusDelegate, LogBonusDelegate logBonusDelegate) =>
 (Config.Instance.applye_bonuses_from_companions
         ? new CharacterObject[] { leader }.Concat(party)
         : new CharacterObject[] { leader })
 .GetPartyBonus(getBonusDelegate, logBonusDelegate);