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;
        }
        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);
        }
Beispiel #3
0
 public void buildmoves()
 {
     /*magic bite
     max damage = 700
     max defense = 200
     size = 35
     strength = 40
     speed = 25
     type = normal
     dsize = 60
     dstrength = 25
     dspeed = 15
     fire = 0;
     ice = 0
     plant = 0
     water = 0
     rock = 0
     lightning = 0
     moveid=1
     stamina=45
        */
     Move bite = new Move("bite",1, 5, "normal", 700, 200, 35, 25, 60, 15, 40,25,0, 0, 0,0,0,0);
     Move fireBreath = new Move("fire Breath",2, 0, "lava", 950, 450, 15, 50, 50, 20, 50, 30, 85, 0, 0, 0, 0, 0);
     Move photoBeam = new Move("photoBeam", 3, 6, "plant", 750, 200, 35, 40, 60, 25, 40, 25, 0, 0, 85, 0, 0, 0);
     moveList.Add(bite);
     moveList.Add(fireBreath);
     moveList.Add(photoBeam);
 }
        public List<Move> buildmoves()
        {
            /*magic bite
            max damage = 700
            max defense = 200
            size = 35
            strength = 40
            speed = 25
            type = normal
            dsize = 60
            dstrength = 25
            dspeed = 15
            fire = 0;
            ice = 0
            plant = 0
            water = 0
            rock = 0
            lightning = 0
            moveid=1
            stamina=45
               */
            // Builder moveBuilder = new Builder();
            //  Move tempMove = moveBuilder.buildMoveFromConsole();
            //moveList.Add(tempMove);
            Move bite = new Move("bite", 1, 5, "normal", 700, 200, 35, 25, 60, 15, 40, 25, 0, 0, 0, 0, 0, 0,0);
            Move fireBreath = new Move("fire Breath", 2, 0, "lava", 950, 450, 15, 50, 50, 20, 50, 30, 85, 0, 0, 0, 0, 0,0);
            Move photoBeam = new Move("photoBeam", 3, 6, "plant", 750, 200, 35, 40, 60, 25, 40, 25, 0, 0, 85, 0, 0, 0,0);
            moveList.Add(bite);
            moveList.Add(fireBreath);
            moveList.Add(photoBeam);

            return moveList;
        }
        public Move buildMoveFromConsole(List<Move> moveList)
        {
            String tempString;
            String moveName;
            Console.Write("Input the Name of the move then press enter" + "\n");
            moveName = Console.ReadLine();

            //Console.Write("Input the Moves Id"+"\n");
            //tempString = Console.ReadLine();
            //int moveId = Convert.ToInt32(tempString);

            int moveId = moveList.Count();

            int staminaReq = 0;
            Console.Write("Input the Stamina Req"+"\n");
            tempString = Console.ReadLine();
            staminaReq = Convert.ToInt32(tempString);
            String attackType = "";
            Console.Write("Input the Attack Type (lava,water,light,rock,plant,ice,normal) "+"\n");
            attackType= Console.ReadLine();
            int maxDamage = 0;
            Console.Write("Input the Max Damage: "+"\n");
            tempString = Console.ReadLine();
            maxDamage = Convert.ToInt32(tempString);
            int maxDefense = 0;
            Console.Write("Input the Max Defense: "+"\n");
            tempString = Console.ReadLine();
            maxDefense = Convert.ToInt32(tempString);
            int attackSize = 0;
            Console.Write("Input the Attack Size" + "\n");
            tempString = Console.ReadLine();
            attackSize = Convert.ToInt32(tempString);
            int attackSpeed = 0;
            Console.Write("Input the attackSpeed: " + "\n");
            tempString = Console.ReadLine();
            attackSpeed = Convert.ToInt32(tempString);
            int defenseSize = 0;
            Console.Write("Input the Defense Size: " + "\n");
            tempString = Console.ReadLine();
            defenseSize = Convert.ToInt32(tempString);
            int defenseSpeed = 0;
            Console.Write("Input the Defense Speed: " + "\n");
            tempString = Console.ReadLine();
            defenseSpeed = Convert.ToInt32(tempString);
            int attackStrength = 0;
            Console.Write("Input the AttackStrength : " + "\n");
            tempString = Console.ReadLine();
            attackStrength = Convert.ToInt32(tempString);
            int defenseStrength = 0;
            Console.Write("Input the Defense Strength: " + "\n");
            tempString = Console.ReadLine();
            defenseStrength = Convert.ToInt32(tempString);
            int fire = 0;
            Console.Write("Input Fire Mastery: " + "\n");
            tempString = Console.ReadLine();
            fire = Convert.ToInt32(tempString);
            int ice = 0;
            Console.Write("Input Ice Mastery: " + "\n");
            tempString = Console.ReadLine();
            ice = Convert.ToInt32(tempString);
            int plant = 0;
            Console.Write("Input plant Mastery: " + "\n");
            tempString = Console.ReadLine();
            plant = Convert.ToInt32(tempString);
            int water = 0;
            Console.Write("Input Water Mastery: " + "\n");
            tempString = Console.ReadLine();
            water = Convert.ToInt32(tempString);
            int rock = 0;
            Console.Write("Input Rock Mastery: " + "\n");
            tempString = Console.ReadLine();
            rock = Convert.ToInt32(tempString);
            int light = 0;
            Console.Write("Input lightening Mastery: " + "\n");
            tempString = Console.ReadLine();
            light = Convert.ToInt32(tempString);
            Console.Write("Input Level Required to Equip Move");
            tempString = Console.ReadLine();
            int levelReq = Convert.ToInt32(tempString);

            Move tempMove = new Move(moveName, moveId, staminaReq, attackType, maxDamage, maxDefense, attackSize, attackSpeed, defenseSize,
                defenseSpeed, attackStrength, defenseStrength, fire, ice, plant, water, rock, light,levelReq);

            return tempMove;
        }
        public float specailAttack(Monster defendingMonster, Move attackMove, float damage)
        {
            int keepTrack = 0;
            if (attackMove.getType() == "lava")
            {
                if (defendingMonster.getType() == "plant")
                {
                    float fireTypeBonus = (float)1.75;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check lava on grass" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "ice")
                {
                    float fireTypeBonus = (float)2;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check lava on ice" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "rock")
                {
                    float fireTypeBonus = (float).60;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check lava on rock" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "water")
                {
                    float fireTypeBonus = (float).5;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check lava on water" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "lava")
                {

                    damage = 1;
                    keepTrack = 1;
                    Console.Write("check lava on lava" + "\n");
                    return damage;
                }

            }

            if (attackMove.getType() == "plant")
                Console.Write("check plant on first" + "\n");
            {
                if (defendingMonster.getType() == "rock")
                {
                    float fireTypeBonus = (float)2;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check plant on rock" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "lava")
                {
                    Console.Write("check plant on fire " + "\n");
                    float fireTypeBonus = (float).7;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check plant on lava" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "ice")
                {
                    float fireTypeBonus = (float).6;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check plant on ice" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "water")
                {
                    float fireTypeBonus = (float)2;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check plant on water" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "plant")
                {
                    Console.Write("check plant on fire " + "\n");
                    float fireTypeBonus = (float)1;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    return damage;
                }
            }

            if (attackMove.getType() == "ice")

            {
                if (defendingMonster.getType() == "rock")
                {
                    float fireTypeBonus = (float)2;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check ice on rock" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "lava")
                {
                    Console.Write("check plant on fire " + "\n");
                    float fireTypeBonus = (float).7;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check ice on lava" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "ice")
                {
                    float fireTypeBonus = (float)1;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check ice on ice" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "water")
                {
                    float fireTypeBonus = (float)1.2;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check ice on water" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "plant")
                {
                    Console.Write("check ice on fire " + "\n");
                    float fireTypeBonus = (float)2;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    return damage;
                }

            }

                if (attackMove.getType() == "rock")

                {
                    if (defendingMonster.getType() == "rock")
                    {
                        float fireTypeBonus = (float)2;
                        damage = typeBonus(fireTypeBonus, damage);
                        keepTrack = 1;
                        Console.Write("check rock on rock" + "\n");
                        return damage;
                    }
                    if (defendingMonster.getType() == "lava")
                    {
                        Console.Write("check plant on fire " + "\n");
                        float fireTypeBonus = (float)1.8;
                        damage = typeBonus(fireTypeBonus, damage);
                        keepTrack = 1;
                        Console.Write("check rock on lava" + "\n");
                        return damage;
                    }
                    if (defendingMonster.getType() == "ice")
                    {
                        float fireTypeBonus = (float)1;
                        damage = typeBonus(fireTypeBonus, damage);
                        keepTrack = 1;
                        Console.Write("check rock on ice" + "\n");
                        return damage;
                    }
                    if (defendingMonster.getType() == "water")
                    {
                        float fireTypeBonus = (float).5;
                        damage = typeBonus(fireTypeBonus, damage);
                        keepTrack = 1;
                        Console.Write("check rock on water" + "\n");
                        return damage;
                    }
                    if (defendingMonster.getType() == "plant")
                    {
                        Console.Write("check rock on plant " + "\n");
                        float fireTypeBonus = (float)2;
                        damage = typeBonus(fireTypeBonus, damage);
                        keepTrack = 1;
                        return damage;
                    }

                }

            if (attackMove.getType() == "light")

            {
                if (defendingMonster.getType() == "rock")
                {
                    float fireTypeBonus = (float).5;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check rock on light" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "lava")
                {
                    Console.Write("check plant on fire " + "\n");
                    float fireTypeBonus = (float)1.8;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check light on lava" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "ice")
                {
                    float fireTypeBonus = (float)1.8;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check light on ice" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "water")
                {
                    float fireTypeBonus = (float)2;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check light on water" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "plant")
                {
                    Console.Write("check light on plant " + "\n");
                    float fireTypeBonus = (float)1;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    return damage;
                }

            }

            if (attackMove.getType() == "water")

            {
                if (defendingMonster.getType() == "rock")
                {
                    float fireTypeBonus = (float)2;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check water on rock" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "lava")
                {
                    Console.Write("check plant on fire " + "\n");
                    float fireTypeBonus = (float)1.8;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check water on lava" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "ice")
                {
                    float fireTypeBonus = (float)1;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check rock on ice" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "water")
                {
                    float fireTypeBonus = (float)1;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check water on water" + "\n");
                    return damage;
                }
                if (defendingMonster.getType() == "plant")
                {
                    Console.Write("check water on plant " + "\n");
                    float fireTypeBonus = (float).5;
                    damage = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    return damage;
                }

            }

            if (keepTrack == 0)
                {
                    Console.Write("something went wrong with a specail move mult" + "\n");
                    return damage;
                }
                else
                {
                    Console.Write("something else went wrong with a specail move mult" + "\n");
                    return damage;
                }
        }
        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;
        }
        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;
        }
        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);
        }
        public float principalAttackValue(Monster attackMonster, Move attackMove)
        {
            float pAV = attackMove.getMaxDamage();

            float moveSize = attackMove.getSizeAttacker();
            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;
               //Console.Write("move size " + moveSize + "\n");
            //Console.Write("move speed " + moveSpeed + "\n");
            //Console.Write("move Strength " + moveStrength + "\n");

            float total = moveSize + moveSpeed + moveStrength;
            float effectivnessDecimal = total / 100;

            //Console.Write("move max damage @ 100% effecency " + pAV + "\n");
              //  Console.Write("effectivness deceimal= " + effectivnessDecimal + "\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(" final pAV w/ level consider " + pAV + "\n");
              //      Console.Write("\n");
            return pAV;
        }
        public Move getMoveFromConsole(List<Move> moveList,Monster attackMonster)
        {
            for (int b = 0; b < moveList.Count; b++)
            {
                Move moveChoice = new Move();
                moveChoice = moveList.ElementAt(b);
                float pAv= principalAttackValue(attackMonster, moveChoice);
                pAv = pAv / attackMonster.getLevel();
                int a = b;
                a += 1;
                Console.Write("Name: " + moveList.ElementAt(b).getName() + ", Choice: " + a + ", Type: " + moveList.ElementAt(b).getType() +", Perfect Hit: "+pAv + "\n");
            }
            string tempMove = Console.ReadLine();

            int tempMoveInt = Convert.ToInt32(tempMove);
            tempMoveInt = tempMoveInt - 1;
            Console.Write("Move chosen is: " + moveList.ElementAt(tempMoveInt).getName() + "\n");
            Console.Write("\n");
            return moveList.ElementAt(tempMoveInt);
        }