Example #1
0
File: Aad.cs Project: resc/Risk
        private int GetSuccessRate(PossibleAttack possibleAttack)
        {
            var myTroops     = possibleAttack.NumberOfTroops;
            var targetTroops = possibleAttack.Victim.NumberOfTroops;

            if (targetTroops < 1)
            {
                targetTroops = 1;
            }
            if (myTroops < 1)
            {
                myTroops = 1;
            }

            var rate = 1000 * ((Convert.ToDouble(myTroops)) / (Convert.ToDouble(targetTroops + 1)));

            return(Convert.ToInt16(rate));
        }
Example #2
0
File: Aad.cs Project: resc/Risk
        private int GetSuccessRate(PossibleAttack possibleAttack)
        {
            var myTroops = possibleAttack.NumberOfTroops;
            var targetTroops = possibleAttack.Victim.NumberOfTroops;

            if (targetTroops < 1)
                targetTroops = 1;
            if (myTroops < 1)
                myTroops = 1;

            var rate = 1000 * ((Convert.ToDouble(myTroops)) / (Convert.ToDouble(targetTroops + 1)));

            return Convert.ToInt16(rate);
        }