示例#1
0
        public override void PerformSpecialAction()
        {
            // TODO: implement special action logic
            var _random = new System.Random();
            List <Character> validTargets = Battlefield.GetValidTargets(this, TargetType.Opponents);

            Battlefield.DisplayMessage($"{FullyQualifiedName} now will attack 3 random opponents!");
            for (int i = 0; i < 3; i++)
            {
                int       randomIndex = _random.Next(0, validTargets.Count - 1);
                Character target      = validTargets[randomIndex];

                if (_random.NextDouble() > Accuracy / 2)
                {
                    Battlefield.DisplayMessage($"{FullyQualifiedName} missed his {i} special attack against {target.FullyQualifiedName}.");
                }
                else
                {
                    Battlefield.DisplayMessage($"{FullyQualifiedName} used his {i} special attack on {target.FullyQualifiedName} for {Damage * 0.75} damage!");
                    target.CurrentHealth -= Damage * 0.75f;
                }
            }

            //Battlefield.DisplayMessage($"{FullyQualifiedName} just used his special action!");
        }
        public override void PerformSpecialAction()
        {
            // TODO: implement special action logic
            Battlefield.DisplayMessage($"{FullyQualifiedName} just used his special action!");

            /*List<Character> validTargets = Battlefield.GetValidTargets(this, TargetType.Opponents);
             * List<Character> invalidTargets = Battlefield.GetInvalidTargets(this, TargetType.Opponents);
             * int randomIndex = _random.Next(0, validTargets.Count - 1);
             *
             *
             * if (_random.NextDouble() > SpAccuracy)
             * {
             *  for (int i = 0; i < consolePlayer.numberOfMonsters; i++)
             *  {
             *      Character target = invalidTargets[i];
             *      Battlefield.DisplayMessage($"{FullyQualifiedName} missed his special attack against the Hero Party, so he attacked his whole Monster Party for {SpCollateralDamage} damage.");
             *      target.CurrentHealth -= SpCollateralDamage;
             *      return;
             *  }
             * }
             * else
             * {
             *  for (int i = 0; i < consolePlayer.numberOfAllies; i++)
             *  {
             *      Character target = validTargets[randomIndex];
             *      Battlefield.DisplayMessage($"{FullyQualifiedName} used his special attack against the whole Hero Party for {SpDamage} damage.");
             *      target.CurrentHealth -= SpDamage;
             *  }
             * }*/
        }
示例#3
0
        public void PerformBaseAttack()
        {
            if (this.Category == CharacterType.Paladin)
            {
                if (CurrentMana < MaxMana)
                {
                    CurrentMana += 10;
                }
            }

            List <Character> validTargets = Battlefield.GetValidTargets(this, TargetType.Opponents);

            int       randomIndex = _random.Next(0, validTargets.Count - 1);
            Character target      = validTargets[randomIndex];

            if (this.UsedPaladinEffect = false && Battlefield.PaladinEffect == true)
            {
                this.Damage            = this.Damage * 1.75f;
                this.UsedPaladinEffect = true;
            }

            if (_random.NextDouble() > Accuracy)
            {
                Battlefield.DisplayMessage($"{FullyQualifiedName} missed his attack against {target.FullyQualifiedName}.");
                return;
            }

            Battlefield.DisplayMessage($"{FullyQualifiedName} attacked {target.FullyQualifiedName} for {Damage} damage.");
            target.CurrentHealth -= Damage;

            if (this.UsedPaladinEffect = true && Battlefield.PaladinEffect == true)
            {
                Damage = Damage / 1.75f;
            }
        }
        public override void PerformSpecialAction()
        {
            // TODO: implement special action logic
            var _random                   = new System.Random();
            List <Character> allies       = Battlefield.GetValidTargets(this, TargetType.Allies);
            List <Character> ValidTargets = Battlefield.GetValidTargets(this, TargetType.Opponents);
            int r = _random.Next(0, 1);

            if (r == 0)
            {
                for (int i = 0; i < ValidTargets.Count; i++)
                {
                    ValidTargets[i].CurrentHealth = ValidTargets[i].CurrentHealth - 20;
                }
                Battlefield.DisplayMessage($"{FullyQualifiedName} just attacked all the opponents for 20 damage!");
            }
            if (r == 1)
            {
                for (int i = 0; i < allies.Count; i++)
                {
                    allies[i].CurrentHealth = allies[i].CurrentHealth - 20;
                }
                Battlefield.DisplayMessage($"{FullyQualifiedName} just missed the opponents and attacked all the allies for 15 damage!");
            }

            //Battlefield.DisplayMessage($"{FullyQualifiedName} just used his special action!");
        }
        public override void PerformSpecialAction()
        {
            Random           random       = new Random();
            List <Character> validTargets = Battlefield.GetValidTargets(this, TargetType.Opponents);
            int randomIndex = random.Next(0, 2);

            switch (randomIndex)
            {
            case (0):
                Battlefield.DisplayMessage($"{FullyQualifiedName} used a hellfire at the Heroes hitting them for {30} damage .");
                foreach (Character target in validTargets)
                {
                    target.CurrentHealth -= 20;
                }
                break;

            case (1):
                Battlefield.DisplayMessage($"{FullyQualifiedName} used a hellfire at the Heroes but he lost control of it and hits the Monsters for { 15} damage .");

                validTargets = Battlefield.GetValidTargets(this, TargetType.Allies);
                foreach (Character target in validTargets)
                {
                    target.CurrentHealth -= 15;
                }
                break;
            }
            Character choosenTarget = this;
        }
示例#6
0
        public override void PerformSpecialAction()
        {
            float _damageForThisAction   = Damage * 2f;
            float _accuracyForThisAction = Accuracy * 0.5f;

            if (_random.NextDouble() > _accuracyForThisAction)
            {
                List <Character> validTargets = Battlefield.GetValidTargets(this, TargetType.Allies);
                _damageForThisAction = 15;
                foreach (Character target in validTargets)
                {
                    Battlefield.DisplayMessage($"{FullyQualifiedName} attacked {target.FullyQualifiedName} with his SPECIAL ATTACK for {_damageForThisAction} damage.");
                    ReduceTargetHealth(target, _damageForThisAction);
                }
            }
            else
            {
                List <Character> validTargets = Battlefield.GetValidTargets(this, TargetType.Opponents);
                _damageForThisAction = 20;
                foreach (Character target in validTargets)
                {
                    Battlefield.DisplayMessage($"{FullyQualifiedName} attacked {target.FullyQualifiedName} with his SPECIAL ATTACK for {_damageForThisAction} damage.");
                    ReduceTargetHealth(target, _damageForThisAction);
                }
            }
        }
        public override void PerformSpecialAction()
        {
            float   enemyDamage  = 20;
            float   allyDamage   = 15;
            Boolean randomChance = false;

            if (_random.Next(0, 10) >= 5)
            {
                randomChance = true;
            }

            if (randomChance)
            {
                Battlefield.DisplayMessage($"{FullyQualifiedName} fireballed all alive enemies with his special move");
                List <Character> validTargets = Battlefield.GetValidTargets(this, TargetType.Opponents);
                foreach (Character target in validTargets)
                {
                    Battlefield.DisplayMessage($"{target.FullyQualifiedName} got bruned for {enemyDamage} damage.");
                    target.CurrentHealth -= enemyDamage;
                }
            }
            else
            {
                Battlefield.DisplayMessage($"{FullyQualifiedName} fireballed his own allies and himself ");
                List <Character> validTargets = Battlefield.GetValidTargets(this, TargetType.Allies);
                foreach (Character target in validTargets)
                {
                    Battlefield.DisplayMessage($"{target.FullyQualifiedName} got bruned for {allyDamage} damage.");
                    target.CurrentHealth -= allyDamage;
                }
            }
        }
示例#8
0
        public override void PerformSpecialAction()
        {
            // TODO: implement special action logic
            DamageSp   = Damage;
            AccuracySp = Accuracy;



            Battlefield.DisplayMessage($"{FullyQualifiedName} just used his special action with double damage!");
        }
        protected override void PerformSpecialAction()
        {
            int randomAmount = Random.Next(1, 4);

            for (int i = 0; i < randomAmount; i++)
            {
                Battlefield.Monsters.CreateNewCharacter(CharacterType.Skeleton, Battlefield.AiController, Battlefield);
            }

            Battlefield.DisplayMessage($"{FullyQualifiedName} has just raised {randomAmount} Skeleton{(randomAmount > 1 ? "s" : string.Empty)} from the dead!");
        }
        protected void Attack(Character target, float damage, float accuracy, string messagePrefix = null)
        {
            if (Random.NextDouble() > accuracy)
            {
                Battlefield.DisplayMessage($"{messagePrefix}{FullyQualifiedName} missed his attack against {target.FullyQualifiedName}.");
                return;
            }

            Battlefield.DisplayMessage($"{messagePrefix}{FullyQualifiedName} attacked {target.FullyQualifiedName} for {damage} damage.");
            target.CurrentHealth -= damage;
        }
示例#11
0
        protected override void PerformSpecialAction()
        {
            List <Character> allies = Battlefield.GetValidTargets(this, TargetType.Allies);

            allies.Remove(this);
            foreach (Character ally in allies)
            {
                ally.NextBaseAttackBoost = _blessBoost;
            }

            Battlefield.DisplayMessage($"{FullyQualifiedName} blessed his allies! On the next base attack, {string.Join(", ", allies)} will do {_blessBoost}x damage.");
        }
示例#12
0
        public override void PerformSpecialAction()
        {
            int randomIndex = _random.Next(1, 4);

            CurrentMana -= 50;
            for (int i = 0; i < randomIndex; i++)
            {
                Battlefield.CreateSkeleton();
            }

            Battlefield.DisplayMessage($"{FullyQualifiedName} Create a skeleton.");
        }
示例#13
0
        public override void PerformSpecialAction()
        {
            // TODO: implement special action logic
            //CurrentHealth = CurrentHealth + 30;

            List <Character> helpAllies = Battlefield.GetValidTargets(this, TargetType.Allies);

            for (int i = 0; i < helpAllies.Count; i++)
            {
                helpAllies[i].CurrentHealth = helpAllies[i].CurrentHealth + 30;
            }
            Battlefield.DisplayMessage($"{FullyQualifiedName} just added 30 of health at all his faction!");
            //Battlefield.DisplayMessage($"{FullyQualifiedName} just used his special action!");
        }
        protected override void PerformSpecialAction()
        {
            bool       success    = Random.NextDouble() > 0.5f;
            TargetType targetType = success ? TargetType.Opponents : TargetType.Allies;

            List <Character> targets = Battlefield.GetValidTargets(this, targetType);

            Battlefield.DisplayMessage($"{FullyQualifiedName} {(success ? "successfully casted" : "failed to cast")} a fireball spell! {string.Join(", ", targets)} damaged by {_spellDamage}.");

            foreach (Character target in targets)
            {
                target.CurrentHealth -= _spellDamage;
            }
        }
        public override void PerformSpecialAction()
        {
            Random randomNumber = new Random();

            Battlefield.DisplayMessage($"{FullyQualifiedName} just used his special action!");

            /*for (int i = 0; i < 3; i++)
             * {
             *
             * List<Character> validTargets = Battlefield.GetValidTargets(this, TargetType.Opponents);
             *  int randomIndex = randomNumber.Next(0, validTargets.Count - 1);
             * Character target = validTargets[randomIndex];
             * //target.CurrentHealth -= Damage;
             * }*/
        }
        public override void PerformSpecialAction()
        {
            int ManaCost = 30;

            if (_currentMana - ManaCost >= 0)
            {
                _currentMana -= ManaCost;
                //TODO implement ally buff mechanic - add mana regen-
            }
            else
            {
                Battlefield.DisplayMessage($"{FullyQualifiedName} doesn't have enough mana to use the special attack");
                //TODO riprova a scegliere invece di saltare il turno
            }
        }
        public void PerformSpecialAction()
        {
            List <Character> validTargets = Battlefield.GetValidTargets(this, TargetType.Opponents);
            int       randomIndex         = _random.Next(0, validTargets.Count - 1);
            Character target = validTargets[randomIndex];

            if (_random.NextDouble() > Accuracy)
            {
                Battlefield.DisplayMessage($"{FullyQualifiedName} missed his attack against {target.FullyQualifiedName}.");
                return;
            }

            Battlefield.DisplayMessage($"{FullyQualifiedName} attacked {target.FullyQualifiedName} for {Damage} damage.");
            target.CurrentHealth -= Damage;
        }
示例#18
0
        public override void PerformSpecialAction()
        {
            float _damageForThisAction   = Damage * 3f;
            float _accuracyForThisAction = Accuracy * 0.33f;

            Character target = ChooseTarget();

            if (_random.NextDouble() > _accuracyForThisAction)
            {
                Battlefield.DisplayMessage($"{FullyQualifiedName} missed his special attack against {target.FullyQualifiedName}.");
                return;
            }

            Battlefield.DisplayMessage($"{FullyQualifiedName} attacked {target.FullyQualifiedName} with his SPECIAL ATTACK for {_damageForThisAction} damage.");
            //target.CurrentHealth -= _damageForThisAction;
            ReduceTargetHealth(target, _damageForThisAction);
        }
示例#19
0
        public void PerformBaseAttack()
        {
            //List<Character> validTargets = Battlefield.GetValidTargets(this, TargetType.Opponents);
            //int randomIndex = _random.Next(0, validTargets.Count - 1);
            //Character target = validTargets[randomIndex];
            Character target = ChooseTarget();

            if (_random.NextDouble() > Accuracy)
            {
                Battlefield.DisplayMessage($"{FullyQualifiedName} missed his attack against {target.FullyQualifiedName}.");
                return;
            }

            Battlefield.DisplayMessage($"{FullyQualifiedName} attacked {target.FullyQualifiedName} for {Damage} damage.");
            //target.CurrentHealth -= Damage;
            ReduceTargetHealth(target, Damage);
        }
示例#20
0
        public override void PerformSpecialAction()
        {
            if (CurrentMana > 30)
            {
                CurrentMana -= 30;

                Battlefield.DisplayMessage($"{FullyQualifiedName} just use his special ability ,improved attack Squad (1.75%)");

                Battlefield.PaladinEffect = true;
            }
            else
            {
                this.CurrentMana = CurrentMana + 10;
                Console.ResetColor();
                this.PerformBaseAttack();
            }
        }
        public override void PerformSpecialAction()
        {
            Random random = new Random();

            List <Character> validTargets = Battlefield.GetValidTargets(this, TargetType.Opponents);
            int randomIndex = random.Next(0, validTargets.Count - 1);

            Character target = validTargets[randomIndex];

            if (random.NextDouble() > Accuracy * 2)
            {
                Battlefield.DisplayMessage($"{FullyQualifiedName} hits with a hammer {target.FullyQualifiedName} but he missed.");
                return;
            }

            Battlefield.DisplayMessage($"{FullyQualifiedName}hits with a hammer {target.FullyQualifiedName} for {Damage * 0.75f} damage.");
            target.CurrentHealth -= Damage * 0.75f;
        }
示例#22
0
        public override void PerformSpecialAction()
        {
            float SpecialAccuracy = (1 / 3) * Accuracy;
            float SpecialDamage   = 3 * Damage;

            List <Character> validTargets = Battlefield.GetValidTargets(this, TargetType.Opponents);
            int       randomIndex         = _random.Next(0, validTargets.Count - 1);
            Character target = validTargets[randomIndex];

            if (_random.NextDouble() > SpecialAccuracy)
            {
                Battlefield.DisplayMessage($"{FullyQualifiedName} missed his special attack against {target.FullyQualifiedName}.");
                return;
            }

            Battlefield.DisplayMessage($"{FullyQualifiedName} super *bonked* {target.FullyQualifiedName} with his special attack for {SpecialDamage} damage.");
            target.CurrentHealth -= SpecialDamage;
        }
示例#23
0
        public override void PerformSpecialAction()
        {
            float            spetialDamage   = 2 * Damage;
            float            spetialAccuracy = Accuracy / 2;
            List <Character> validTargets    = Battlefield.GetValidTargets(this, TargetType.Opponents);
            int       randomIndex            = _random.Next(0, validTargets.Count - 1);
            Character target = validTargets[randomIndex];

            Battlefield.DisplayMessage($"{FullyQualifiedName} just used his special action!");
            if (_random.NextDouble() > spetialAccuracy)
            {
                Battlefield.DisplayMessage($"{FullyQualifiedName} missed his attack against {target.FullyQualifiedName}.");
                return;
            }

            Battlefield.DisplayMessage($"{FullyQualifiedName} successfully attacked {target.FullyQualifiedName} for {spetialDamage} damage.");
            target.CurrentHealth -= spetialDamage;
        }
示例#24
0
        public override void PerformSpecialAction()
        {
            var _random = new System.Random();
            // TODO: implement special action logic
            List <Character> validTargets = Battlefield.GetValidTargets(this, TargetType.Opponents);
            int       randomIndex         = _random.Next(0, validTargets.Count - 1);
            Character target = validTargets[randomIndex];

            if (_random.NextDouble() > Accuracy / 2)
            {
                Battlefield.DisplayMessage($"{FullyQualifiedName} missed his special attack against {target.FullyQualifiedName}.");
                return;
            }

            Battlefield.DisplayMessage($"{FullyQualifiedName} used special attack on {target.FullyQualifiedName} for {Damage*2} damage!");
            target.CurrentHealth -= Damage * 2;
            //Battlefield.DisplayMessage($"{FullyQualifiedName} just used his special action!");
        }
        public override void PerformSpecialAction()
        {
            Random random = new Random();

            List <Character> validTargets = Battlefield.GetValidTargets(this, TargetType.Opponents);
            int randomIndex;



            if (validTargets.Count >= 3)
            {
                for (int i = 0; i < 3; i++)
                {
                    randomIndex = random.Next(0, validTargets.Count - 1);
                    Character target = validTargets[randomIndex];

                    if (random.NextDouble() > Accuracy / 2)
                    {
                        Battlefield.DisplayMessage($"{FullyQualifiedName} throw a arrow at {target.FullyQualifiedName} but he missed.");
                    }
                    else
                    {
                        Battlefield.DisplayMessage($"{FullyQualifiedName} throw a arrow at {target.FullyQualifiedName} for {Damage * 0.75f} damage.");
                        target.CurrentHealth -= Damage * 0.75f;
                    }
                }
            }
            else
            {
                foreach (Character target in validTargets)
                {
                    if (random.NextDouble() > Accuracy / 2)
                    {
                        Battlefield.DisplayMessage($"{FullyQualifiedName} throw a arrow at {target.FullyQualifiedName} but he missed.");
                    }
                    else
                    {
                        Battlefield.DisplayMessage($"{FullyQualifiedName} throw a arrow at {target.FullyQualifiedName} for {Damage * 0.75f} damage.");
                        target.CurrentHealth -= Damage * 0.75f;
                    }
                }
            }
        }
示例#26
0
        public override void PerformSpecialAction()
        {
            float            heal             = 30;
            List <Character> validTargets     = Battlefield.GetValidTargets(this, TargetType.Allies); //NON SO PERCHè CRASHA
            Character        lowestHealthChar = null;
            float            min = 1000;

            foreach (Character t in validTargets)
            {
                if (t.CurrentHealth < min)
                {
                    min = t.CurrentHealth;
                    lowestHealthChar = t;
                }
            }

            Battlefield.DisplayMessage($"{FullyQualifiedName} healed {lowestHealthChar.FullyQualifiedName} for {heal} hp with his special attack.");
            lowestHealthChar.CurrentHealth += heal;
        }
示例#27
0
        public override void PerformSpecialAction()
        {
            //List<Character> targets = new List<Character>();
            List <Character> validTargets = Battlefield.GetValidTargets(this, TargetType.Opponents);

            for (int i = 0; i < 3; i++)
            {
                int       randomIndex = _random.Next(0, validTargets.Count - 1);
                Character target      = validTargets[randomIndex];

                if (_random.NextDouble() > Accuracy / 2)
                {
                    Battlefield.DisplayMessage($"{FullyQualifiedName} missed his attack against {target.FullyQualifiedName}.");
                    return;
                }

                Battlefield.DisplayMessage($"{FullyQualifiedName} attacked {target.FullyQualifiedName} for {Damage * 0.75} damage.");
                target.CurrentHealth -= Damage * (75 / 100);
            }
        }
示例#28
0
        public override void PerformSpecialAction()
        {
            float            specialAccuracy = 0.5f * Accuracy;
            float            specialDamage   = 0.75f * Damage;
            int              hits            = 3;
            List <Character> validTargets    = Battlefield.GetValidTargets(this, TargetType.Opponents);

            switch (validTargets.Count)
            {
            case 1: hits = 1;
                break;

            case 2: hits = 2;
                break;

            case 0: hits = 0;
                break;

            default: hits = 3;
                break;
            }

            int randomIndex = 0;

            for (int i = 0; i < hits; i++)
            {
                randomIndex = _random.Next(0, validTargets.Count - 1);

                Character target = validTargets[randomIndex];

                if (_random.NextDouble() > specialAccuracy)
                {
                    Battlefield.DisplayMessage($"{FullyQualifiedName} missed his special attack {i}. shot against {target.FullyQualifiedName}.");
                }
                else
                {
                    Battlefield.DisplayMessage($"{FullyQualifiedName} shot {target.FullyQualifiedName} for {specialDamage} damage. ({i}. shot)");
                    target.CurrentHealth -= specialDamage;
                }
            }
        }
示例#29
0
        public override void PerformSpecialAction()
        {
            List <Monster> targets = new List <Monster>();
            float          _damageForThisAction   = Damage * 0.75f;
            float          _accuracyForThisAction = Accuracy * 0.5f;

            Monster target;

            for (int i = 0; i < 3; i++)
            {
                do
                {
                    target = (Monster)ChooseTarget();
                } while (targets.Contains(target));
                if (_random.NextDouble() > _accuracyForThisAction)
                {
                    Battlefield.DisplayMessage($"{FullyQualifiedName} missed his special attack against {target.FullyQualifiedName}.");
                    return;
                }
            }
        }
示例#30
0
        public override void PerformSpecialAction()
        {
            List <Character> validTargets = Battlefield.GetValidTargets(this, TargetType.Allies);
            int       randomIndex         = _random.Next(0, validTargets.Count - 1);
            Character target = validTargets[randomIndex];

            if (_random.NextDouble() > Accuracy)
            {
                Battlefield.DisplayMessage($"{FullyQualifiedName} just use his curative's power!");
                return;
            }
            if (target == this)
            {
                Battlefield.DisplayMessage($"{FullyQualifiedName} just heal himself with 30 hp!");
            }
            else
            {
                Battlefield.DisplayMessage($"{FullyQualifiedName} just heal {target.FullyQualifiedName} with 30 hp");
            }
            target.CurrentHealth += 30;
        }