Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     fx->FirstApply=first_apply;
  2.     if( first_apply) {
  3.         if( (fx->PosX==0xffffffff) && (fx->PosY==0xffffffff)) {
  4.             fx->PosX = target->Pos.x;
  5.             fx->PosY = target->Pos.y;
  6.         }
  7.  
  8.         //gemrb specific, stat based chance
  9.         if ((fx->Probability2 == 100) && Owner && (Owner->Type==ST_ACTOR) ) {
  10.             fx->Probability2 = 0;
  11.             fx->Probability1 = ((Actor *) Owner)->GetSafeStat(fx->Probability1);
  12.         }
  13.  
  14.     if (resistance) {
  15.           //the effect didn't pass the probability check
  16.           if( !check_probability(fx) ) {
  17.               fx->TimingMode = FX_DURATION_JUST_EXPIRED;
  18.               return FX_NOT_APPLIED;
  19.           }
  20.  
  21.           //the effect didn't pass the target level check
  22.           if( check_level(target, fx) ) {
  23.             fx->TimingMode = FX_DURATION_JUST_EXPIRED;
  24.             return FX_NOT_APPLIED;
  25.           }
  26.  
  27.           //the effect didn't pass the resistance check
  28.           if( check_resistance(target, fx) ) {
  29.               fx->TimingMode = FX_DURATION_JUST_EXPIRED;
  30.               return FX_NOT_APPLIED;
  31.      }
  32.         }
  33.  
  34.         //Same as in items and spells
  35.         if (fx->SourceFlags & SF_HOSTILE) {
  36.             if (target && (target != Owner) && Owner && (Owner->Type==ST_ACTOR) ) {
  37.                 target->AttackedBy((Actor *) Owner);
  38.             }
  39.         }
  40.  
  41.         if( NeedPrepare(fx->TimingMode) ) {
  42.             //save delay for later
  43.             fx->SecondaryDelay = fx->Duration;
  44.             if( fx->TimingMode == FX_DURATION_INSTANT_LIMITED) {
  45.                 fx->TimingMode = FX_DURATION_ABSOLUTE;
  46.             }
  47.             PrepareDuration(fx);
  48.         }
  49.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement