Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function float GetReactionAdjust(XComGameState_Unit Shooter, XComGameState_Unit Target)
- {
- local XComGameStateHistory History;
- local XComGameState_Unit OldTarget;
- local UnitValue ConcealedValue;
- local int PathIndex, ChainStartIdx;
- local XComGameStateContext_Ability AbilityContext;
- local bool FoundContext;
- History = `XCOMHISTORY;
- // No penalty if the shooter went into Overwatch while concealed.
- if (Shooter.GetUnitValue(class'X2Ability_DefaultAbilitySet'.default.ConcealedOverwatchTurn, ConcealedValue))
- {
- if (ConcealedValue.fValue > 0)
- return 0;
- }
- `log("Finding correct AbilityContext:");
- foreach History.IterateContextsByClassType(class'XComGameStateContext_Ability', AbilityContext,,, ChainStartIdx)
- {
- If (ChainStartIdx == 0) ChainStartIdx=AbilityContext.EventChainStartIndex; // What we're reacting to can't possibly be further back than this!
- // Also note the current reaction isn't in history (indeed, the AI may just be checking hit chances), so can't just ask it directly
- `log(AbilityContext);
- if(AbilityContext.InputContext.SourceObject.ObjectID==Target.ObjectID)
- {
- FoundContext = true;
- break;
- }
- }
- `log(`showvar(FoundContext));
- if(FoundContext)
- {
- PathIndex = AbilityContext.GetMovePathIndex(Target.ObjectID);// Ok, did we move?
- `log(`showvar(PathIndex));
- if (PathIndex!=INDEX_NONE) `log(`showvar(AbilityContext.InputContext.MovementPaths[PathIndex].CostIncreases.Length));
- If (PathIndex!=INDEX_NONE && AbilityContext.InputContext.MovementPaths[PathIndex].CostIncreases.Length!=0)//Dash check
- {
- return REACTION_DASHING_FINALMOD;
- }
- }
- return default.REACTION_FINALMOD;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement