Advertisement
DeleteMetaInf

X2Ability_TacticalReloadNew2.uc

Apr 15th, 2023
2,250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class X2Ability_TacticalReloadNew2 extends X2Ability
  2.     config(TacticalReloadNew2);
  3.  
  4. var config int TACTICALRELOAD_COOLDOWN;
  5. var config float TACTICALRELOAD_AIM_MULTIPLIER;
  6.  
  7. var config float DAMAGE_MULTIPLIER_TEMP;
  8.  
  9. static function array<X2DataTemplate> CreateTemplates()
  10. {
  11.     local array<X2DataTemplate> Templates;
  12.    
  13.     Templates.AddItem(TacticalReloadAbility());
  14.     //Templates.AddItem(TacticalReloadDamage());
  15.  
  16.     return Templates;
  17. }
  18.  
  19. static function AddCooldown(out X2AbilityTemplate Template, int Cooldown)
  20. {
  21.     local X2AbilityCooldown AbilityCooldown;
  22.  
  23.     if (Cooldown > 0)
  24.     {
  25.         AbilityCooldown = new class'X2AbilityCooldown';
  26.         AbilityCooldown.iNumTurns = Cooldown;
  27.         Template.AbilityCooldown = AbilityCooldown;
  28.     }
  29. }
  30.  
  31. static function X2AbilityTemplate TacticalReloadAbility()
  32. {
  33.     local X2AbilityTemplate               Template;
  34.     local X2Effect_TacticalReloadDamage   TacticalReloadEffect;
  35.     //local X2Condition_UnitEffects         EffectCondition;
  36.     local X2AbilityCost_ActionPoints      ActionPointCost;
  37.  
  38.     `CREATE_X2ABILITY_TEMPLATE(Template, 'TacticalReload');
  39.  
  40.     // Icon
  41.     Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_reload";
  42.     Template.AbilitySourceName = 'eAbilitySource_Perk';
  43.     Template.ShotHUDPriority = class'UIUtilities_Tactical'.const.CLASS_CORPORAL_PRIORITY;
  44.     Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_AlwaysShow;
  45.  
  46.     // Targeting and Triggering
  47.     Template.AbilityToHitCalc = default.DeadEye;
  48.     Template.AbilityTargetStyle = default.SelfTarget;
  49.     Template.AbilityTriggers.AddItem(default.PlayerInputTrigger);
  50.  
  51.     // Cost
  52.     ActionPointCost = new class'X2AbilityCost_ActionPoints';
  53.     ActionPointCost.iNumPoints = 1;
  54.     ActionPointCost.bConsumeAllPoints = false;
  55.     Template.AbilityCosts.AddItem(ActionPointCost);
  56.  
  57.     // Cooldown
  58.     AddCooldown(Template, default.TACTICALRELOAD_COOLDOWN);
  59.  
  60.     // Shooter conditions
  61.     Template.AbilityShooterConditions.AddItem(default.LivingShooterProperty);
  62.     Template.AddShooterEffectExclusions();
  63.  
  64.     TacticalReloadEffect.fDamageMultiplier = default.DAMAGE_MULTIPLIER_TEMP; // Remove later
  65.  
  66.     //  Infinite duration, but doesn't stack
  67.     TacticalReloadEffect = new class'X2Effect_TacticalReloadDamage';
  68.     //Effect.fDamageMultiplier = default.POWER_UP_DAMAGE_MULTIPLIER;
  69.     TacticalReloadEffect.BuildPersistentEffect(1, false, true, false, eGameRule_PlayerTurnEnd);
  70.     TacticalReloadEffect.SetDisplayInfo(ePerkBuff_Bonus, Template.LocFriendlyName, Template.GetMyLongDescription(), Template.IconImage, true,, Template.AbilitySourceName);
  71.     Template.AddShooterEffect(TacticalReloadEffect);
  72.  
  73.     Template.SuperConcealmentLoss = class'X2AbilityTemplateManager'.default.SuperConcealmentStandardShotLoss;
  74.     Template.ChosenActivationIncreasePerUse = class'X2AbilityTemplateManager'.default.StandardShotChosenActivationIncreasePerUse;
  75.     Template.LostSpawnIncreasePerUse = class'X2AbilityTemplateManager'.default.StandardShotLostSpawnIncreasePerUse;
  76.  
  77.     Template.AbilityConfirmSound = "TacticalUI_Activate_Ability_Wraith_Armor";
  78.     Template.Hostility = eHostility_Neutral;
  79.     Template.bShowActivation = false;
  80.     Template.bSkipFireAction = true;
  81.     Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
  82.     Template.BuildVisualizationFn = TypicalAbility_BuildVisualization;
  83.  
  84.     //Template.AdditionalAbilities.AddItem('IRI_Rider_AnimPassive');
  85.  
  86.     if(class'X2DownloadableContentInfo_TacticalReloadNew2'.default.CROSS_CLASS == true)
  87.     {
  88.         Template.bCrossClassEligible = true;
  89.     }
  90.  
  91.     return Template;
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement