Advertisement
Guest User

Untitled

a guest
Dec 13th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class X2AbilityTag_IRI_RocketLaunchers extends X2AbilityTag;
  2.  
  3. // Modified and Implemented from Xylith's XModBase
  4.  
  5. // The previous X2AbilityTag. We save it so we can just call it to handle any tag we don't
  6. // recognize, so we don't have to include a copy of the regular X2AbilityTag code. This also
  7. // makes it so we will play well with any other mods that replace X2AbilityTag this way.
  8. var X2AbilityTag WrappedTag;
  9.  
  10. var localized string strGenericClassName;
  11.  
  12. event ExpandHandler(string InString, out string OutString)
  13. {
  14.     local name                      Type, nName;
  15.     local XComGameStateHistory      History;
  16.     local XComGameState_Unit        TargetUnitState;
  17.     //local X2SoldierClassTemplate  ClassTemplate;
  18.     local XComGameState_Ability     AbilityState;
  19.     local XComGameState_Effect      EffectState;
  20.     local UITacticalHUD             TacticalHUD;
  21.     local int                       iVal;
  22.     local string                    sStr;
  23.  
  24.     Type = name(InString);
  25.     History = `XCOMHISTORY;
  26.  
  27.     `LOG("Expand Handler",,'IRIDAR');
  28.  
  29.     switch (Type)
  30.     {  
  31.         case 'IRI_ROCKETSCATTER':
  32.             `LOG("Case IRI ROCKETSCATTER",,'IRIDAR');
  33.             TacticalHUD = UITacticalHUD(`SCREENSTACK.GetScreen(class'UITacticalHUD'));
  34.             AbilityState = XComGameState_Ability(ParseObj);
  35.             EffectState = XComGameState_Effect(ParseObj);
  36.             if (AbilityState != none)
  37.                 TargetUnitState = XComGameState_Unit(`XCOMHISTORY.GetGameStateForObjectID(AbilityState.OwnerStateObject.ObjectID));
  38.             else if (EffectState != none)
  39.                 TargetUnitState = XComGameState_Unit(`XCOMHISTORY.GetGameStateForObjectID(EffectState.ApplyEffectParameters.TargetStateObjectRef.ObjectID));
  40.             if (TacticalHUD != none && TacticalHUD.GetTargetingMethod() != none && TargetUnitState != none)
  41.             {
  42.                 iVal = class'X2TargetingMethod_IRI_LWRocketLauncher'.static.GetNumAimRolls(TargetUnitState);
  43.                 Outstring = class'X2TargetingMethod_IRI_LWRocketLauncher'.default.strMaxScatter $ string(iVal);
  44.             }
  45.             else
  46.             {
  47.                 Outstring = "";
  48.             }
  49.             break;
  50.  
  51.         // We don't handle this tag, check the wrapped tag.
  52.         default:
  53.             WrappedTag.ParseObj = ParseObj;
  54.             WrappedTag.StrategyParseObj = StrategyParseObj;
  55.             WrappedTag.GameState = GameState;
  56.             WrappedTag.ExpandHandler(InString, OutString);
  57.             // clear them out again
  58.             WrappedTag.ParseObj = none;
  59.             WrappedTag.StrategyParseObj = none;
  60.             WrappedTag.GameState = none;  
  61.             return;
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement