Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class X2TargetingMethod_IRI_DynamicDeployment extends X2TargetingMethod_VoidRift;
- // when this targeting method is initiated, we request make an asynchronous request for soldiers that we could potentially dynamically deploy
- // this should smooth out the lag when Dynamic Deployment is activated
- function Init(AvailableAction InAction, int NewTargetIndex)
- {
- local array<XComGameState_Unit> Units;
- local XComGameState_Unit Unit;
- local array<string> Resources;
- local string Resource;
- local XComContentManager Content;
- local StateObjectReference ItemReference;
- local XComGameState_Item ItemState;
- local XComGameStateHistory History;
- super.Init(InAction, NewTargetIndex);
- Content = `CONTENT;
- History = `XCOMHISTORY;
- // Build a list of units we would deploy if Dynamic Deployment is activated
- Units = class'X2Effect_IRI_SpawnSoldier'.static.ChooseStrategyUnits(`XCOMHISTORY, class'X2Effect_IRI_SpawnSoldier'.static.CalculateReinforcementsSize());
- foreach Units(Unit)
- {
- // preload the unit
- Unit.RequestResources(Resources);
- foreach Resources(Resource)
- {
- Content.RequestGameArchetype(Resource,,, true);
- }
- // preload unit's items
- foreach Unit.InventoryItems(ItemReference)
- {
- ItemState = XComGameState_Item(History.GetGameStateForObjectID(ItemReference.ObjectID));
- ItemState.RequestResources(Resources);
- foreach Resources(Resource)
- {
- Content.RequestGameArchetype(Resource,,, true);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement