Advertisement
RustyDios

SectoidAbilitiesOPTC_ForKiruka

Feb 13th, 2021 (edited)
1,806
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //////////////////////////////////// BEGIN FILE //////////////////////////////////////////////////////////////////////////////////
  2. ... add these to your config file ...
  3. [_modname_.X2AbilityCooldown_Mindspin_Kiruka]
  4. iMINDSPIN_BASE_NUMBERTURNS = 3
  5.  
  6. [_modname_.X2AbilityCooldown_MassMindspin_Kiruka]
  7. iMINDSPINMASS_BASE_NUMBERTURNS = 3
  8.  
  9. [_modname_.X2dlcinfoname]
  10. ;might need "" marks here ....
  11. MindspinName            = Mindspin
  12. MassMindspinName        = MassMindspin
  13. PsiReanimationName      = PsiReanimation
  14. PsiReanimationMPName    = PsiReanimationMP
  15. MassReanimation_LWName  = MassReanimation_LW
  16.  
  17. //////////////////// END FILE ////////////////////////////////////////////////////////////////////////////////////////////////////
  18. //////////////////////////////////// BEGIN FILE //////////////////////////////////////////////////////////////////////////////////
  19. ... add to your X2AbilitySet_Aliens , in the ability creation bit...
  20.  
  21. Templates.AddItem(PurePassive('PAPuppetShow', "UILibrary_MZChimeraIcons.Ability_Puppeteer", true, 'eAbilitySource_Perk'));
  22.  
  23. //////////////////// END FILE ////////////////////////////////////////////////////////////////////////////////////////////////////
  24. //////////////////////////////////// BEGIN FILE //////////////////////////////////////////////////////////////////////////////////
  25. // This is part of Mindspins functionality, making Mindspin have reduced cooldown if the unit has PAPuppetShow
  26. class X2AbilityCooldown_Mindspin_Kiruka extends X2AbilityCooldown config (_INSERT_CONFIG_HERE_);
  27.  
  28. var config int iMINDSPIN_BASE_NUMBERTURNS;
  29.  
  30. simulated function int GetNumTurns(XComGameState_Ability kAbility, XComGameState_BaseObject AffectState, XComGameState_Item AffectWeapon, XComGameState NewGameState)
  31. {
  32.     //pull the default number from the config
  33.     iNumTurns = default.iMINDSPIN_BASE_NUMBERTURNS;
  34.  
  35.     if (XComGameState_Unit(AffectState).HasAbilityFromAnySource('PAPuppetShow'))
  36.     {
  37.         iNumTurns - 1;
  38.     }
  39.  
  40.     //return the calculated number
  41.     return iNumTurns;
  42. }
  43.  
  44. //////////////////// END FILE ////////////////////////////////////////////////////////////////////////////////////////////////////
  45. //////////////////////////////////// BEGIN FILE //////////////////////////////////////////////////////////////////////////////////
  46. class X2AbilityCooldown_MassMindspin_Kiruka extends X2AbilityCooldown config (_INSERT_CONFIG_HERE_);
  47.  
  48. var config int iMINDSPINMASS_BASE_NUMBERTURNS;
  49.  
  50. simulated function int GetNumTurns(XComGameState_Ability kAbility, XComGameState_BaseObject AffectState, XComGameState_Item AffectWeapon, XComGameState NewGameState)
  51. {
  52.     //pull the default number from the config
  53.     iNumTurns = default.iMINDSPINMASS_BASE_NUMBERTURNS;
  54.  
  55.     if (XComGameState_Unit(AffectState).HasAbilityFromAnySource('LiftOffAvenger')) //non-xcom units
  56.     {
  57.         iNumTurns + 3; //6 including the current turn, so effectively 5
  58.     }
  59.  
  60.     if (XComGameState_Unit(AffectState).HasAbilityFromAnySource('PAPuppetShow')) //reduce for PuppetShow
  61.     {
  62.         iNumTurns - 1; //one less
  63.     }
  64.  
  65.     //return the calculated number
  66.     return iNumTurns;
  67. }
  68. //////////////////// END FILE ////////////////////////////////////////////////////////////////////////////////////////////////////
  69. //////////////////////////////////// BEGIN FILE //////////////////////////////////////////////////////////////////////////////////
  70. .... add to your DLC2info OPTC ...
  71.  
  72. class OPTC_MassMindspin extends X2DownloadableContentInfo config(Game);
  73.  
  74. var config name MindspinName, MassMindspinName, PsiReanimationName, PsiReanimationMPName, MassReanimation_LWName;
  75.  
  76. static event OnPostTemplatesCreated()
  77. {
  78.     local X2AbilityTemplateManager  AbilityTemplateManager;
  79.  
  80.     //Karen!!  Get the Ability Template Manager.
  81.     AbilityTemplateManager = class'X2AbilityTemplateManager'.static.GetAbilityTemplateManager();
  82.  
  83.     AdjustAbility(AbilityTemplateManager.FindAbilityTemplate(default.MindspinName));
  84.     AdjustAbility(AbilityTemplateManager.FindAbilityTemplate(default.PsiReanimationName));
  85.     AdjustAbility(AbilityTemplateManager.FindAbilityTemplate(default.PsiReanimationMPName));
  86.    
  87.     AdjustMassAbility(AbilityTemplateManager.FindAbilityTemplate(default.MassReanimation_LWName));
  88.     AdjustMassAbility(AbilityTemplateManager.FindAbilityTemplate(default.MassMindspinName));
  89. }
  90.  
  91. static function AdjustAbility(X2AbilityTemplate Template)
  92. {
  93.     //  Check if the Ability Template was successfully found by the manager.
  94.     if (Template != none)
  95.     {
  96.         //  Modify template as you wish.
  97.         //  Remove the OLD cooldown!
  98.         Template.AbilityCooldown = none;
  99.  
  100.         //  Add the new cooldown
  101.         Template.AbilityCooldown = new class'X2AbilityCooldown_Mindspin_Kiruka';
  102.  
  103.         PuppetDoesNotConsume(Template);
  104.     }
  105. }
  106.  
  107. static function AdjustMassAbility(X2AbilityTemplate Template)
  108. {
  109.     //  Check if the Ability Template was successfully found by the manager.
  110.     if (Template != none)
  111.     {
  112.         //  Modify template as you wish.
  113.         //  Remove the OLD cooldown!
  114.         Template.AbilityCooldown = none;
  115.  
  116.         //  Add the new cooldown
  117.         Template.AbilityCooldown = new class'X2AbilityCooldown_MassMindspin_Kiruka';
  118.        
  119.         PuppetDoesNotConsume(Template);
  120.     }
  121. }
  122.  
  123. static function PuppetDoesNotConsume(X2AbilityTemplate Template)
  124. {
  125.     local X2AbilityCost Costs;
  126.     local X2AbilityCost_ActionPoints    APCost;
  127.  
  128.     foreach Template.AbilityCosts( Costs )
  129.     {
  130.         if (X2AbilityCost_ActionPoints (Costs) != none )
  131.         {
  132.             APCost = X2AbilityCost_ActionPoints (Costs);
  133.             APCost.DoNotConsumeAllSoldierAbilities.AddItem('PAPuppetShow');
  134.         }
  135.     }
  136. }
  137. //////////////////// END FILE ////////////////////////////////////////////////////////////////////////////////////////////////////
  138.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement