Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.10 KB | None | 0 0
  1. // This is an Unreal Script
  2.  
  3. class X2Ability_LW_TechnicalHeavyWeaponReload extends X2Ability
  4. dependson (XComGameStateContext_Ability);
  5.  
  6. static function array<X2DataTemplate> CreateTemplates()
  7. {
  8. local array<X2DataTemplate> Templates;
  9. Templates.AddItem(LWReloadFlamethrower());
  10. //Templates.AddItem(LWReloadRocketLauncher());
  11. Templates.AddItem(PurePassive('AutoloaderArmaments', "img:///UILibrary_LW_Overhaul.LW_AbilityFireandSteel"));
  12.  
  13. return Templates;
  14. }
  15.  
  16. static function X2AbilityTemplate LWReloadFlamethrower()
  17. {
  18. local X2AbilityTemplate Template;
  19. local X2AbilityTemplate FlameThrowerTemplate;
  20. local X2AbilityCost_ActionPoints ActionPointCost;
  21. local X2Condition_UnitProperty ShooterPropertyCondition;
  22. local X2Condition_AbilitySourceWeapon WeaponCondition;
  23. local X2AbilityTrigger_PlayerInput InputTrigger;
  24. local X2AbilityCharges_BonusCharges Charges;
  25. local array<name> SkipExclusions;
  26.  
  27. `CREATE_X2ABILITY_TEMPLATE(Template, 'LWReloadFlamethrower');
  28.  
  29. Template.bDontDisplayInAbilitySummary = true;
  30. ActionPointCost = new class'X2AbilityCost_ActionPoints';
  31. Template.AbilityCosts.AddItem(ActionPointCost);
  32.  
  33. ShooterPropertyCondition = new class'X2Condition_UnitProperty';
  34. ShooterPropertyCondition.ExcludeDead = true; //Can't reload while dead
  35. Template.AbilityShooterConditions.AddItem(ShooterPropertyCondition);
  36.  
  37. //add condition (must have less than max flamethrower ammo)
  38.  
  39. SkipExclusions.AddItem(class'X2AbilityTemplateManager'.default.DisorientedName);
  40. Template.AddShooterEffectExclusions(SkipExclusions);
  41.  
  42. InputTrigger = new class'X2AbilityTrigger_PlayerInput';
  43. Template.AbilityTriggers.AddItem(InputTrigger);
  44.  
  45. Charges = new class'X2AbilityCharges_BonusCharges';
  46. Charges.InitialCharges = class'X2ReloadStages'.GetFlamethrowerReloadStages(AffectState);
  47. Template.AbilityCharges = Charges;
  48.  
  49. ChargeCost = new class'X2AbilityCost_Charges';
  50. ChargeCost.NumCharges = 1;
  51. Template.AbilityCosts.AddItem(ChargeCost);
  52.  
  53. if(Charges == 1){
  54. AddCharges(Template, X2ReloadStages.GetFlamethrowerReloadStages(AffectState));
  55. FlameThowerTemplate = class'LWFlamethrower';
  56. AddCharges(FlameThrowerTemplate,1);
  57. }
  58.  
  59. Template.AbilityToHitCalc = default.DeadEye;
  60.  
  61. Template.AbilityTargetStyle = default.SelfTarget;
  62.  
  63. Template.AbilitySourceName = 'eAbilitySource_Standard';
  64. Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_ShowIfAvailable;
  65. Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_reload";
  66. Template.ShotHUDPriority = class'UIUtilities_Tactical'.const.ARMOR_ACTIVE_PRIORITY;
  67. Template.bNoConfirmationWithHotKey = true;
  68. Template.bDisplayInUITooltip = false;
  69. Template.bDisplayInUITacticalText = false;
  70. Template.DisplayTargetHitChance = false;
  71.  
  72. Template.ActivationSpeech = 'Reloading';
  73.  
  74. Template.BuildNewGameStateFn = ReloadAbility_BuildGameState;
  75. Template.BuildVisualizationFn = ReloadAbility_BuildVisualization;
  76.  
  77. ActionPointCost.iNumPoints = 1;
  78. Template.Hostility = eHostility_Neutral;
  79.  
  80. Template.CinescriptCameraType="GenericAccentCam";
  81.  
  82. return Template;
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement