Exemplo n.º 1
0
        public void ExecuteAgressiveAction(Hero player, Hero enemy)
        {
            var isCritical = CriticalChecker.CheckForCrit(player);

            if (isCritical)
            {
                CriticalPrinter.PrintCritical(player);
            }

            var isBerserk = HeroTypeChecker.CheckForPassive(player);

            if (isBerserk)
            {
                if (!isCritical)
                {
                    enemy.TakeDamage(this.Damage * 2);
                }
                else
                {
                    enemy.GainArmor(this.Damage * 3);
                }
                BerserkerWarrior warrior = (BerserkerWarrior)player;
                warrior.PassiveDuration--;
                if (warrior.PassiveDuration <= 0)
                {
                    warrior.IsBerserk = false;
                }
            }
            else
            {
                enemy.TakeDamage(this.Damage);
            }

            if (isCritical)
            {
                enemy.TakeDamage(this.Damage);
            }

            Warrior playerOnTurn = (Warrior)player;

            playerOnTurn.GetRageOnHit();
        }
Exemplo n.º 2
0
        //Gives the MenuDraw method the properties needed to draw an Action Menu for the current hero.
        public static Models.Action ActionsMenu(Hero player)
        {
            var energyTypeAndAmount = HeroTypeChecker.GetHeroEnergyTypeAndAmount(player);
            var title       = $"{player.Name} NEEDS TO SELECT AN ACTION: Health: {player.Health} ARMOR {player.Armor} {energyTypeAndAmount[0]}: {energyTypeAndAmount[1]}";
            var isAmplified = HeroTypeChecker.CheckForPassive(player);

            if (isAmplified)
            {
                title += $" {player.Name}'S DAMAGE IS BUFFED DUE TO PASSIVE";
            }
            List <string> stringsToBeGiven = new List <string>()
            {
                title
            };

            foreach (var action in player.Actions)
            {
                stringsToBeGiven.Add(action.ToString());
            }
            var option = MenuDrawer.DrawMenu(stringsToBeGiven);

            return(player.Actions.Where(a => a.Name.Contains(option.Trim(':'))).First());
        }