Пример #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 = 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);
        }
Пример #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;
        }
Пример #3
0
        public float specialAttack(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).50;
                    damage    = typeBonus(fireTypeBonus, damage);
                    keepTrack = 1;
                    Console.Write("check lava on rock" + "\n");
                    return(damage);
                }
                if (defendingMonster.getType() == "water")
                {
                    float fireTypeBonus = (float).6;
                    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);
            }
        }
Пример #4
0
        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;
                }
        }