Esempio n. 1
0
 public HeroBaseStats(Hero hero)
 {
     Attack       = hero.Attack;
     Recovery     = hero.Recovery;
     Health       = hero.Health;
     AffinityType = hero.AffinityType;
     IsWarden     = hero.EventSkills.Warden;
 }
Esempio n. 2
0
 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;
     }
 }
Esempio n. 3
0
        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);
        }