Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fx->FirstApply=first_apply;
- if( first_apply) {
- if( (fx->PosX==0xffffffff) && (fx->PosY==0xffffffff)) {
- fx->PosX = target->Pos.x;
- fx->PosY = target->Pos.y;
- }
- //gemrb specific, stat based chance
- if ((fx->Probability2 == 100) && Owner && (Owner->Type==ST_ACTOR) ) {
- fx->Probability2 = 0;
- fx->Probability1 = ((Actor *) Owner)->GetSafeStat(fx->Probability1);
- }
- if (resistance) {
- //the effect didn't pass the probability check
- if( !check_probability(fx) ) {
- fx->TimingMode = FX_DURATION_JUST_EXPIRED;
- return FX_NOT_APPLIED;
- }
- //the effect didn't pass the target level check
- if( check_level(target, fx) ) {
- fx->TimingMode = FX_DURATION_JUST_EXPIRED;
- return FX_NOT_APPLIED;
- }
- //the effect didn't pass the resistance check
- if( check_resistance(target, fx) ) {
- fx->TimingMode = FX_DURATION_JUST_EXPIRED;
- return FX_NOT_APPLIED;
- }
- }
- //Same as in items and spells
- if (fx->SourceFlags & SF_HOSTILE) {
- if (target && (target != Owner) && Owner && (Owner->Type==ST_ACTOR) ) {
- target->AttackedBy((Actor *) Owner);
- }
- }
- if( NeedPrepare(fx->TimingMode) ) {
- //save delay for later
- fx->SecondaryDelay = fx->Duration;
- if( fx->TimingMode == FX_DURATION_INSTANT_LIMITED) {
- fx->TimingMode = FX_DURATION_ABSOLUTE;
- }
- PrepareDuration(fx);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement