Ejemplo n.º 1
0
        public int getMaxStackedDice(GameSettings settings, Map map)
        {
            int max = MAX_STACKED_DICE;

            if (settings.upgradesEnabled && !isGuest)
            {
                //if (!isGuest) {
                if (PayVault.Has("ArmyStorageUpg1"))
                {
                    max += 10;
                }
                if (PayVault.Has("ArmyStorageUpg2"))
                {
                    max += 10;
                }
                if (PayVault.Has("ArmyStorageUpg3"))
                {
                    max += Math.Min((int)(map.GetRegionCount() * 0.1), 10);
                }
                if (PayVault.Has("ArmyStorageUpg4"))
                {
                    max += Math.Min((int)(map.GetRegionCount() * 0.1), 10);
                }
                if (race == 116 && !bonusesDisabled)
                {
                    max += 5;
                }
            }
            return(max);
        }
Ejemplo n.º 2
0
        public int getDefenseWithBonus(int defaultDefense, GameSettings settings, bool usingDefenseBoost, Map map)
        {
            if (!settings.upgradesEnabled || bonusesDisabled)
            {
                return(defaultDefense);
            }

            double bonus = 1.0;

            if (race == 103)
            {
                bonus = 1.05;
            }
            if (race == 104)
            {
                bonus = 1.05;
            }
            if (race == 105)
            {
                bonus = 0.95;
            }
            if (race == 106)
            {
                bonus = 1.05;
            }
            if (race == 108)
            {
                bonus = 1.05;
            }
            if (race == 118)
            {
                bonus = 0.95;
            }
            if (race == 117 && usingDefenseBoost)
            {
                bonus = 1.1;
            }
            if (race == 121)
            {
                if (strength <= 5)
                {
                    bonus = 1.15;
                }
                else
                {
                    int max = map.GetRegionCount() / 2;
                    if (strength >= max)
                    {
                        bonus = 1;
                    }
                    else
                    {
                        bonus = 1 + 0.15 - 0.15 * (strength - 5.0) / (max - 5.0);
                    }
                }
            }

            if (bonus == 1)
            {
                return(defaultDefense);
            }

            return(bonus > 1.0 ? (int)Math.Floor(defaultDefense * bonus) : (int)Math.Ceiling(defaultDefense * bonus));
        }
Ejemplo n.º 3
0
        public int getAttackWithBonus(int defaultAttack, GameSettings settings, int attackerStrength, int defenderStrength, bool usingAttackBoost, Map map, bool hasDefenseBoost)
        {
            if (!settings.upgradesEnabled || bonusesDisabled)
            {
                return(defaultAttack);
            }

            double bonus = 1.0;

            if (race == 102)
            {
                bonus = 1.05;
            }
            if (race == 104)
            {
                bonus = 1.05;
            }
            if (race == 105)
            {
                bonus = 0.95;
            }
            if (race == 107)
            {
                bonus = 1.05;
            }
            if (race == 108)
            {
                bonus = 1.05;
            }
            if (race == 114 && attackerStrength < defenderStrength)
            {
                bonus = 1.15;
            }
            if (race == 118)
            {
                bonus = 0.95;
            }
            if (race == 115 && usingAttackBoost)
            {
                bonus = 1.1;
            }
            if (race == 120)
            {
                if (strength <= 5)
                {
                    bonus = 1.15;
                }
                else
                {
                    int max = map.GetRegionCount() / 2;
                    if (strength >= max)
                    {
                        bonus = 1;
                    }
                    else
                    {
                        bonus = 1 + 0.15 - 0.15 * (strength - 5.0) / (max - 5.0);
                    }
                }
            }
            if (race == 122)
            {
                bonus = hasDefenseBoost ? 1.2 : 1.0;
            }

            Console.WriteLine("attack bonus: " + bonus);

            if (bonus == 1)
            {
                return(defaultAttack);
            }

            return(bonus > 1.0 ? (int)Math.Floor(defaultAttack * bonus) : (int)Math.Ceiling(defaultAttack * bonus));
        }