Beispiel #1
0
 // STATIC METHODS
 public static effectList getEffectListByThreshhold(effectList[] lists, int[] th)
 {
     if (lists == null || th == null)
         return null;
     for (int j = 0; j < lists.Length; j++)
     {
         //Check which list of effects has the same threshholds
         if (lists[j].checkThreshholds(th))
         {
             return lists[j];
         }
     }
     return null;
 }
Beispiel #2
0
 /* For every list of checks, get the threshholds. Then
  * for the array of lists of effects with the same index
  as the list of checks, get the one list with the same threshholds*/
 public virtual bool doAction(bool doChecks=true,bool doEffects=true)
 {
     int[] currentThreshholds;
     effectList foundList=new effectList();
     for (int i = 0; i < itsChecks.Length; i++)
     {
         //Get threshholds for this list, if doChecks=false, use last threshHolds
         currentThreshholds = doChecks?
             itsChecks[i].doChecks():itsChecks[i].LastThreshholds;
         if (doEffects)
         {
             foundList=WeaponAction.getEffectListByThreshhold
                 (itsEffectLists[i], currentThreshholds);
             if (foundList != null)
                 foundList.doEffects();
         }
     }
     return true;
 }