Guest User

Untitled

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