Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function SharedAnimation_MergeVisualization2(X2Action BuildTree, out X2Action VisualizationTree)
- {
- local XComGameStateVisualizationMgr VisMgr;
- local array<X2Action> arrActions;
- local X2Action_MarkerTreeInsertBegin MarkerStart;
- local X2Action_MarkerTreeInsertEnd MarkerEnd;
- local X2Action WaitAction;
- local X2Action_MarkerNamed MarkerAction;
- local X2Action_ApplyWeaponDamageToUnit DamageAction;
- local XComGameStateContext_Ability AbilityContext;
- local VisualizationActionMetadata ActionMetadata;
- local bool bFoundHistoryIndex;
- local int i;
- VisMgr = `XCOMVISUALIZATIONMGR;
- MarkerStart = X2Action_MarkerTreeInsertBegin(VisMgr.GetNodeOfType(BuildTree, class'X2Action_MarkerTreeInsertBegin'));
- AbilityContext = XComGameStateContext_Ability(MarkerStart.StateChangeContext);
- VisMgr.GetNodesOfType(VisualizationTree, class'X2Action_Fire', arrActions);
- for (i = 0; i < arrActions.Length; i++)
- {
- if (arrActions[i].StateChangeContext.AssociatedState.HistoryIndex == AbilityContext.DesiredVisualizationBlockIndex)
- {
- bFoundHistoryIndex = true;
- break;
- }
- }
- if (bFoundHistoryIndex) `LOG("found history index!",, 'IRISINGE');
- else
- {
- `LOG("not found history index!",, 'IRISINGE');
- AbilityContext.SuperMergeIntoVisualizationTree(BuildTree, VisualizationTree);
- return;
- }
- AbilityContext = XComGameStateContext_Ability(arrActions[i].StateChangeContext);
- ActionMetaData = arrActions[i].Metadata;
- WaitAction = class'X2Action_WaitForAbilityEffect'.static.AddToVisualizationTree(ActionMetaData, AbilityContext,, arrActions[i]);
- VisMgr.ConnectAction(MarkerStart, VisualizationTree,, WaitAction);
- VisMgr.GetNodesOfType(VisualizationTree, class'X2Action_MarkerNamed', arrActions);
- for (i = 0; i < arrActions.Length; i++)
- {
- MarkerAction = X2Action_MarkerNamed(arrActions[i]);
- if (MarkerAction.MarkerName == 'Join' && MarkerAction.StateChangeContext.AssociatedState.HistoryIndex == AbilityContext.DesiredVisualizationBlockIndex)
- {
- MarkerEnd = X2Action_MarkerTreeInsertEnd(VisMgr.GetNodeOfType(BuildTree, class'X2Action_MarkerTreeInsertEnd'));
- //If the second shot has a join created, then just slot it in above the first shots join
- if (MarkerEnd != none)
- {
- VisMgr.ConnectAction(MarkerEnd, VisualizationTree,,, MarkerAction.ParentActions);
- VisMgr.ConnectAction(MarkerAction, BuildTree,, MarkerEnd);
- }
- //If the second shot does not have a join, then connect the leaf nodes to the first shots join
- else
- {
- VisMgr.GetAllLeafNodes(BuildTree, arrActions);
- VisMgr.ConnectActionMarkerAction, BuildTree,,, arrActions);
- }
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement