public List<Monster> castMove(Monster attackMonster, Move attackMove, Monster defendingMonster)
        {
            List<Monster> attackDefenderList = new List<Monster>();
            int staminaRequired = attackMove.getStamina();
            int staminaPossessed = attackMonster.getStamina();
            if (staminaRequired > staminaPossessed)
            {
                attackDefenderList.Add(attackMonster);
                attackDefenderList.Add(defendingMonster);
                Console.Write("Error Not enough Stamina"+"\n");
                return attackDefenderList;

            }

            float damage = 0;
            float netAttack;
            float netDefense;

                Console.Write("Move Name: " + attackMove.getName() +", Stamina required: "+attackMove.getStamina()+"\n");
                Console.Write("Attacker: " + attackMonster.getName() + ", Level: " + attackMonster.getLevel()+" Health: "+attackMonster.getHealth()+", Stamina: " + attackMonster.getStamina() + "\n");
                Console.Write("Defender: " + defendingMonster.getName() + ", Level: " + defendingMonster.getLevel()+" Health: "+defendingMonster.getHealth() + ", Stamina: "+defendingMonster.getStamina() +"\n");

            netAttack = principalAttackValue(attackMonster, attackMove);
            netDefense = principalDefenseValue(defendingMonster, attackMove);
            damage = netAttack - netDefense;

            if (attackMove.getType() != "normal")
            {
                damage = specialAttack(defendingMonster, attackMove, damage);
            }
            else
            {

            }

            // Before damage is rendered the random varible must be applied
            //            the random effectiveness variable, it will be modeled as RE = (2 / 3 + E) + R where 2 / 3 represents 66 %
            //effective all the time, then E = Level / 300, such that at level 100 a creature will be completely effective while
            //  a creature at 1 will be .661.Then another variable R will be created. R will be a number that is a random
            //  number between the range of 0:X where x = 1 - (.2 / 3 + E),

            int level=attackMonster.getLevel();
            float tempLevel = (float)level;
            tempLevel = tempLevel / 100;
            damage = damage * tempLevel;
            int roundedDamage = (int)damage;
            defendingMonster.renderDamage(roundedDamage,attackMonster, defendingMonster,attackMove);
                attackDefenderList.Add(attackMonster);
                attackDefenderList.Add(defendingMonster);

            return attackDefenderList;
        }
Esempio n. 2
0
        public List <Monster> castMove(Monster attackMonster, Move attackMove, Monster defendingMonster)
        {
            List <Monster> attackDefenderList = new List <Monster>();
            int            staminaRequired    = attackMove.getStamina();
            int            staminaPossessed   = attackMonster.getStamina();

            if (staminaRequired > staminaPossessed)
            {
                attackDefenderList.Add(attackMonster);
                attackDefenderList.Add(defendingMonster);
                Console.Write("Error Not enough Stamina" + "\n");
                return(attackDefenderList);
            }

            float damage = 0;
            float netAttack;
            float netDefense;

            Console.Write("Move Name: " + attackMove.getName() + ", Stamina required: " + attackMove.getStamina() + "\n");
            Console.Write("Attacker: " + attackMonster.getName() + ", Level: " + attackMonster.getLevel() + " Health: " + attackMonster.getHealth() + ", Stamina: " + attackMonster.getStamina() + "\n");
            Console.Write("Defender: " + defendingMonster.getName() + ", Level: " + defendingMonster.getLevel() + " Health: " + defendingMonster.getHealth() + ", Stamina: " + defendingMonster.getStamina() + "\n");

            netAttack  = principalAttackValue(attackMonster, attackMove);
            netDefense = principalDefenseValue(defendingMonster, attackMove);
            damage     = netAttack - netDefense;

            if (attackMove.getType() != "normal")
            {
                damage = specialAttack(defendingMonster, attackMove, damage);
            }
            else
            {
            }

            // Before damage is rendered the random varible must be applied
            //            the random effectiveness variable, it will be modeled as RE = (2 / 3 + E) + R where 2 / 3 represents 66 %
            //effective all the time, then E = Level / 300, such that at level 100 a creature will be completely effective while
            //  a creature at 1 will be .661.Then another variable R will be created. R will be a number that is a random
            //  number between the range of 0:X where x = 1 - (.2 / 3 + E),


            int   level     = attackMonster.getLevel();
            float tempLevel = (float)level;

            tempLevel = tempLevel / 100;
            damage    = damage * tempLevel;
            int roundedDamage = (int)damage;

            defendingMonster.renderDamage(roundedDamage, attackMonster, defendingMonster, attackMove);
            attackDefenderList.Add(attackMonster);
            attackDefenderList.Add(defendingMonster);

            return(attackDefenderList);
        }
Esempio n. 3
0
        public void renderDamage(int damage, Monster attackMonster, Monster defendingMonster, Move attackMove)
        {
            health = health - damage;
            if (health < 1)
            {
                isAlive = false;
            }
            if (defendingMonster.currentlyLiving() == false)
            {
                Console.Write(defendingMonster.getName() + " is dead" + "\n");
            }

            useStamina(attackMove.getStamina(), attackMonster);
        }
Esempio n. 4
0
        public void renderDamage(int damage, Monster attackMonster, Monster defendingMonster, Move attackMove)
        {
            health = health - damage;
            if (health < 1)
            {
                isAlive = false;
            }
            if (defendingMonster.currentlyLiving() == false)
            {
                Console.Write(defendingMonster.getName() + " is dead" + "\n");
            }

            useStamina(attackMove.getStamina(),attackMonster);
        }