Esempio n. 1
0
 public virtual void Tick()
 {
     if (timer <= 0)                                     //WHEN THE AFFECTER IS READY TO INTERACT WITH OTHER AFFECTERS
     {
         for (int i = 0; i < reactorList.Count; i++)     //THIS WILL ADJUST THE VITALITY OF EACH REACTOR AT THE START OF EACH WAVE OF AFFECTER INTERACTIONS
         {
             Reactor reactor = reactorList.ElementAt(i); //THIS WILL ADJUST THE VITALITY OF EACH REACTOR AT THE START OF EACH WAVE OF AFFECTER INTERACTIONS
             reactor.Check();                            //THIS WILL ADJUST THE VITALITY OF EACH REACTOR AT THE START OF EACH WAVE OF AFFECTER INTERACTIONS
         }
         if (!Check())                                   //IF THE AFFECTER IS DEAD
         {
             if (inAffecter)
             {
                 targetBody.RemoveFromAffecterList(this);             //IF IT'S IN THE AFFECTERLIST, DELETE IT THENCE
             }
             else
             {
                 targetBody.RemoveFromTraitList(this);  //IF IT'S IN THE TRAITLIST, DELETE IT THENCE
             }
             if (spreadable)
             {
                 targetBody.RemoveFromSpreadList(this);             //IF IT'S IN THE SPREAD LIST, DELETE IT THENCE
             }
             if (layered)
             {
                 targetBody.RemoveFromLayerList(this);    //IF IT SERVES AS A LAYER, DELETE IT THENCE
             }
             return;                                      //STOP TICKING
         }
         if (inAffecterChanged)                           //IF THE PLACE NEEDS TO BE SWAPPED
         {
             inAffecterChanged = false;                   //RESET THE DIRTY BIT
             if (inAffecter)                              //IF IT OUGHT TO BE IN THE AFFECTER LIST
             {
                 targetBody.AddToAffecterList(this);      //ADD TO AFFECTER LIST
                 targetBody.RemoveFromTraitList(this);    //REMOVE FROM TRAIT LIST
             }
             else                                         //IF IT OUGHT TO BE IN THE TRAITLIST
             {
                 targetBody.AddToTraitList(this);         //ADD TO TRAITLIST
                 targetBody.RemoveFromAffecterList(this); //ADD TO AFFECTER LIST
                 return;                                  //THE GOYIM KNOW; SHUT IT DOWN; STOP TICKING
             }
         }
         Dewit();                 //PERFORM ITS FUNCTION AND INTERACT WITH OTHER AFFECTERS
         turnVitality = vitality; //THE VITALITY WITH WHICH OTHER AFFECTERS ARE AFFECTED
         timer        = freq;     //RESET TIMER
     }
     timer--;                     //DECREASE TIMER
 }