public HeroBaseStats(Hero hero) { Attack = hero.Attack; Recovery = hero.Recovery; Health = hero.Health; AffinityType = hero.AffinityType; IsWarden = hero.EventSkills.Warden; }
private static void ApplyAffinityBonus(ref HeroBaseStats heroBaseStats, HeroStat.Affinity.Type opponentAffinity) { if (HeroStat.Affinity.Counters(heroBaseStats.AffinityType, opponentAffinity)) { heroBaseStats.Attack <<= 1; } else if (HeroStat.Affinity.Counters(opponentAffinity, heroBaseStats.AffinityType)) { heroBaseStats.Attack >>= 1; } }
public DeckStats Calculate(HeroStat.Affinity.Type opponentAffinity) { DeckStats deckStats = new DeckStats(); foreach (Hero hero in heroes) { HeroBaseStats deckHeroBaseStats = new HeroBaseStats(hero); ApplyAffinityBonus(ref deckHeroBaseStats, opponentAffinity); ApplyLeaderAbilityBonus(hero, ref deckHeroBaseStats); // ApplyEventBonus(ref deckHero); deckStats.Attack += deckHeroBaseStats.Attack; deckStats.Power += HeroStat.Power.Calculate( deckHeroBaseStats.Attack, deckHeroBaseStats.Recovery, deckHeroBaseStats.Health, deckHeroBaseStats.IsWarden ); } return(deckStats); }