예제 #1
0
        public bool intelligencePull()
        {
            bool chaos = false;

            switch (intelligence)
            {
            case Intelligence.Chaotic:
                chaos = Combat.rollCheck(60, 101);
                //sixty percent chance to make random move
                break;

            case Intelligence.Low:
                chaos = Combat.rollCheck(50, 101);
                break;

            case Intelligence.Normal:
                chaos = Combat.rollCheck(35, 101);
                break;

            case Intelligence.High:
                chaos = Combat.rollCheck(15, 101);
                break;

            case Intelligence.Mastermind:
                chaos = Combat.rollCheck(5, 101);
                break;

            default:
                chaos = false;
                break;
            }
            //Console.WriteLine(owner.Name + " chaos set to " + chaos.ToString());
            return(chaos);
        }
예제 #2
0
 public virtual void activate()
 {
     if (Combat.rollCheck(activateChance, 101))
     {           //skill activates
         readFunction();
     }
     else
     {
         return;
     }
 }
예제 #3
0
        int accuracyCheck()
        {
            int   check     = 0;
            float targetNum = ((user.tempAccuracy + accuracy) / targets[currentTarget].tempEvasion) * 100f;

            if (Combat.rollCheck((int)targetNum, 101))
            {
                check = 1;
            }
            if (Combat.rollCheck((int)criticalRatio, 101))
            {
                check = 2;
            }
            //roll for accuracy, return 1 if hit, 2 if crit
            return(check);
        }
예제 #4
0
 private bool addStatus(string status, int stacks, int chance, string target, bool endFlag)
 {
     if (target == "enemies")
     {
         foreach (Character c in targets)
         {
             if (c.team != user.team)
             {
                 if (Combat.rollCheck(chance, 101))
                 {
                     c.addStatus(status);
                 }
             }
         }
         if (endFlag)
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
     if (target == "allies")
     {
         foreach (Character c in targets)
         {
             if (c.team == user.team && c != user)
             {//use on allies and not self
                 if (Combat.rollCheck(chance, 101))
                 {
                     c.addStatus(status);
                 }
             }
         }
         if (endFlag)
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
     if (target == "self")
     {
         if (Combat.rollCheck(chance, 101))
         {
             user.addStatus(status);
         }
         if (endFlag)
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
     return(true);
 }