Ejemplo n.º 1
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 = specailAttack(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);
        }
Ejemplo n.º 2
0
        public float principalAttackValueFire(Monster attackMonster, Move attackMove)
        {
            float pAV = attackMove.getMaxDamage();


            float moveSize     = attackMove.getSize();
            float moveSpeed    = attackMove.getSpeed();
            float moveStrength = attackMove.getStrength();

            moveSize     = moveSize / 100;
            moveSpeed    = moveSpeed / 100;
            moveStrength = moveStrength / 100;

            int creatureSpeed    = attackMonster.getSpeed();
            int creatureStrength = attackMonster.getstrength();
            int creatureSize     = attackMonster.getSize();

            moveSize     = moveSize * creatureSize;
            moveSpeed    = moveSpeed * creatureSpeed;
            moveStrength = moveStrength * creatureStrength;

            float total = moveSize + moveSpeed + moveStrength;


            float effectivnessDecimal = total / 100;

            //  Console.Write("move max damage @ 100% effecency " + pAV + "\n");

            pAV = pAV * effectivnessDecimal;
            //Console.Write("max damage after applied (defense still to be calculated) " + pAV + "\n");

            float levelMod = attackMonster.getlevel();

            levelMod = levelMod / 100;
            //    Console.Write(" level mod attacker " + levelMod + "\n");
            pAV = pAV * levelMod;
            //  Console.Write("pAV w/ level consider " + pAV + "\n");
            float fireMult = attackMove.getFire();

            fireMult = fireMult / 100;
            // Console.Write("fire mult " + fireMult + "\n");

            pAV = pAV * fireMult;
            Console.Write("pAV w/ fire " + pAV + "\n");
            Console.Write("\n");
            return(pAV);
        }
Ejemplo n.º 3
0
        public void fightTwo(Monster attackMonster, Monster defendingMonster)
        {
            Console.Write("\n");
            Console.Write("Attacker: " + attackMonster.getName() + ", Level: " + attackMonster.getlevel() + " Health: " + attackMonster.gethealth() + ", Stamina: " + attackMonster.getstamina() + ", Type: " + attackMonster.getType() + "\n");
            Console.Write("Defender: " + defendingMonster.getName() + ", Level: " + defendingMonster.getlevel() + " Health: " + defendingMonster.gethealth() + ", Stamina: " + defendingMonster.getstamina() + ", Type: " + defendingMonster.getType() + "\n");

            Move toBecastMove = getMoveFromConsole(attackMonster.getmoveList());

            castMove(attackMonster, toBecastMove, defendingMonster);
            if (defendingMonster.currentlyLiving() == true)
            {
                fightTwo(defendingMonster, attackMonster);
                Console.Write("other player's turn " + "\n");
            }
            else
            {
                Console.Write("Monster has died" + "\n");
            }
        }
Ejemplo n.º 4
0
        public float principalDefenseValue(Monster defenseMonster, Move attackMove)
        {
            float pDV = attackMove.getMaxDefense();
            //  Console.Write("  max d =" + pDV + "\n");
            float dSpeed    = attackMove.getDSpeed();
            float dSize     = attackMove.getDSize();
            float dstrength = attackMove.getDStrength();

            //   Console.Write("dmove size after " + dSize + "\n");
            // Console.Write("dmove speed after " + dSpeed + "\n");
            // Console.Write("dmove strength after " + dstrength + "\n");
            // Console.Write(" " + "\n");

            dSpeed    = dSpeed / 100;
            dSize     = dSize / 100;
            dstrength = dstrength / 100;


            int defenderSpeed   = defenseMonster.getSpeed();
            int defenderSize    = defenseMonster.getSize();
            int defenderStrengh = defenseMonster.getstrength();

            dSpeed    = dSpeed * defenderSpeed;
            dSize     = dSize * defenderSize;
            dstrength = dstrength * defenderStrengh;
            float total = dSpeed + dSize + dstrength;

            total = total / 100;

            float levelMod = defenseMonster.getlevel();

            levelMod = levelMod / 100;

            total = total * levelMod;

            pDV = pDV * total;



            return(pDV);
        }
Ejemplo n.º 5
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 = specailAttack(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;
        }
Ejemplo n.º 6
0
        public float principalDefenseValue(Monster defenseMonster, Move attackMove)
        {
            float pDV = attackMove.getMaxDefense();
              //  Console.Write("  max d =" + pDV + "\n");
            float dSpeed = attackMove.getDSpeed();
            float dSize = attackMove.getDSize();
            float dstrength = attackMove.getDStrength();
            //   Console.Write("dmove size after " + dSize + "\n");
            // Console.Write("dmove speed after " + dSpeed + "\n");
            // Console.Write("dmove strength after " + dstrength + "\n");
            // Console.Write(" " + "\n");

            dSpeed = dSpeed / 100;
            dSize = dSize / 100;
            dstrength = dstrength / 100;

            int defenderSpeed = defenseMonster.getSpeed();
            int defenderSize = defenseMonster.getSize();
            int defenderStrengh = defenseMonster.getstrength();
            dSpeed = dSpeed * defenderSpeed;
            dSize = dSize * defenderSize;
            dstrength = dstrength * defenderStrengh;
            float total = dSpeed + dSize + dstrength;
            total = total / 100;

            float levelMod = defenseMonster.getlevel();
            levelMod = levelMod / 100;

            total = total * levelMod;

            pDV = pDV * total;

            return pDV;
        }
Ejemplo n.º 7
0
        public float principalAttackValueFire(Monster attackMonster, Move attackMove)
        {
            float pAV = attackMove.getMaxDamage();

            float moveSize = attackMove.getSize();
            float moveSpeed = attackMove.getSpeed();
            float moveStrength = attackMove.getStrength();

            moveSize = moveSize / 100;
            moveSpeed = moveSpeed / 100;
            moveStrength = moveStrength / 100;

            int creatureSpeed = attackMonster.getSpeed();
            int creatureStrength = attackMonster.getstrength();
            int creatureSize = attackMonster.getSize();

            moveSize = moveSize * creatureSize;
            moveSpeed = moveSpeed * creatureSpeed;
            moveStrength = moveStrength * creatureStrength;

            float total = moveSize + moveSpeed + moveStrength;

            float effectivnessDecimal = total / 100;
              //  Console.Write("move max damage @ 100% effecency " + pAV + "\n");

            pAV = pAV * effectivnessDecimal;
            //Console.Write("max damage after applied (defense still to be calculated) " + pAV + "\n");

            float levelMod = attackMonster.getlevel();
            levelMod = levelMod / 100;
            //    Console.Write(" level mod attacker " + levelMod + "\n");
            pAV = pAV * levelMod;
              //  Console.Write("pAV w/ level consider " + pAV + "\n");
            float fireMult = attackMove.getFire();
            fireMult = fireMult / 100;
               // Console.Write("fire mult " + fireMult + "\n");

            pAV = pAV * fireMult;
            Console.Write("pAV w/ fire " + pAV + "\n");
            Console.Write("\n");
            return pAV;
        }
Ejemplo n.º 8
0
        public void fightTwo(Monster attackMonster, Monster defendingMonster)
        {
            Console.Write("\n");
            Console.Write("Attacker: " + attackMonster.getName() + ", Level: " + attackMonster.getlevel() + " Health: " + attackMonster.gethealth() + ", Stamina: " + attackMonster.getstamina()+", Type: "+attackMonster.getType() + "\n");
            Console.Write("Defender: " + defendingMonster.getName() + ", Level: " + defendingMonster.getlevel() + " Health: " + defendingMonster.gethealth() + ", Stamina: " + defendingMonster.getstamina()+ ", Type: "+defendingMonster.getType() + "\n");

            Move toBecastMove = getMoveFromConsole(attackMonster.getmoveList());
            castMove(attackMonster, toBecastMove, defendingMonster);
            if (defendingMonster.currentlyLiving() == true)
            {

                fightTwo(defendingMonster, attackMonster);
                Console.Write("other player's turn " + "\n");
            }
            else
            {
                Console.Write("Monster has died" + "\n");

            }
        }