Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////////////////////// BEGIN FILE //////////////////////////////////////////////////////////////////////////////////
- ... add these to your config file ...
- [_modname_.X2AbilityCooldown_Mindspin_Kiruka]
- iMINDSPIN_BASE_NUMBERTURNS = 3
- [_modname_.X2AbilityCooldown_MassMindspin_Kiruka]
- iMINDSPINMASS_BASE_NUMBERTURNS = 3
- [_modname_.X2dlcinfoname]
- ;might need "" marks here ....
- MindspinName = Mindspin
- MassMindspinName = MassMindspin
- PsiReanimationName = PsiReanimation
- PsiReanimationMPName = PsiReanimationMP
- MassReanimation_LWName = MassReanimation_LW
- //////////////////// END FILE ////////////////////////////////////////////////////////////////////////////////////////////////////
- //////////////////////////////////// BEGIN FILE //////////////////////////////////////////////////////////////////////////////////
- ... add to your X2AbilitySet_Aliens , in the ability creation bit...
- Templates.AddItem(PurePassive('PAPuppetShow', "UILibrary_MZChimeraIcons.Ability_Puppeteer", true, 'eAbilitySource_Perk'));
- //////////////////// END FILE ////////////////////////////////////////////////////////////////////////////////////////////////////
- //////////////////////////////////// BEGIN FILE //////////////////////////////////////////////////////////////////////////////////
- // This is part of Mindspins functionality, making Mindspin have reduced cooldown if the unit has PAPuppetShow
- class X2AbilityCooldown_Mindspin_Kiruka extends X2AbilityCooldown config (_INSERT_CONFIG_HERE_);
- var config int iMINDSPIN_BASE_NUMBERTURNS;
- simulated function int GetNumTurns(XComGameState_Ability kAbility, XComGameState_BaseObject AffectState, XComGameState_Item AffectWeapon, XComGameState NewGameState)
- {
- //pull the default number from the config
- iNumTurns = default.iMINDSPIN_BASE_NUMBERTURNS;
- if (XComGameState_Unit(AffectState).HasAbilityFromAnySource('PAPuppetShow'))
- {
- iNumTurns - 1;
- }
- //return the calculated number
- return iNumTurns;
- }
- //////////////////// END FILE ////////////////////////////////////////////////////////////////////////////////////////////////////
- //////////////////////////////////// BEGIN FILE //////////////////////////////////////////////////////////////////////////////////
- class X2AbilityCooldown_MassMindspin_Kiruka extends X2AbilityCooldown config (_INSERT_CONFIG_HERE_);
- var config int iMINDSPINMASS_BASE_NUMBERTURNS;
- simulated function int GetNumTurns(XComGameState_Ability kAbility, XComGameState_BaseObject AffectState, XComGameState_Item AffectWeapon, XComGameState NewGameState)
- {
- //pull the default number from the config
- iNumTurns = default.iMINDSPINMASS_BASE_NUMBERTURNS;
- if (XComGameState_Unit(AffectState).HasAbilityFromAnySource('LiftOffAvenger')) //non-xcom units
- {
- iNumTurns + 3; //6 including the current turn, so effectively 5
- }
- if (XComGameState_Unit(AffectState).HasAbilityFromAnySource('PAPuppetShow')) //reduce for PuppetShow
- {
- iNumTurns - 1; //one less
- }
- //return the calculated number
- return iNumTurns;
- }
- //////////////////// END FILE ////////////////////////////////////////////////////////////////////////////////////////////////////
- //////////////////////////////////// BEGIN FILE //////////////////////////////////////////////////////////////////////////////////
- .... add to your DLC2info OPTC ...
- class OPTC_MassMindspin extends X2DownloadableContentInfo config(Game);
- var config name MindspinName, MassMindspinName, PsiReanimationName, PsiReanimationMPName, MassReanimation_LWName;
- static event OnPostTemplatesCreated()
- {
- local X2AbilityTemplateManager AbilityTemplateManager;
- //Karen!! Get the Ability Template Manager.
- AbilityTemplateManager = class'X2AbilityTemplateManager'.static.GetAbilityTemplateManager();
- AdjustAbility(AbilityTemplateManager.FindAbilityTemplate(default.MindspinName));
- AdjustAbility(AbilityTemplateManager.FindAbilityTemplate(default.PsiReanimationName));
- AdjustAbility(AbilityTemplateManager.FindAbilityTemplate(default.PsiReanimationMPName));
- AdjustMassAbility(AbilityTemplateManager.FindAbilityTemplate(default.MassReanimation_LWName));
- AdjustMassAbility(AbilityTemplateManager.FindAbilityTemplate(default.MassMindspinName));
- }
- static function AdjustAbility(X2AbilityTemplate Template)
- {
- // Check if the Ability Template was successfully found by the manager.
- if (Template != none)
- {
- // Modify template as you wish.
- // Remove the OLD cooldown!
- Template.AbilityCooldown = none;
- // Add the new cooldown
- Template.AbilityCooldown = new class'X2AbilityCooldown_Mindspin_Kiruka';
- PuppetDoesNotConsume(Template);
- }
- }
- static function AdjustMassAbility(X2AbilityTemplate Template)
- {
- // Check if the Ability Template was successfully found by the manager.
- if (Template != none)
- {
- // Modify template as you wish.
- // Remove the OLD cooldown!
- Template.AbilityCooldown = none;
- // Add the new cooldown
- Template.AbilityCooldown = new class'X2AbilityCooldown_MassMindspin_Kiruka';
- PuppetDoesNotConsume(Template);
- }
- }
- static function PuppetDoesNotConsume(X2AbilityTemplate Template)
- {
- local X2AbilityCost Costs;
- local X2AbilityCost_ActionPoints APCost;
- foreach Template.AbilityCosts( Costs )
- {
- if (X2AbilityCost_ActionPoints (Costs) != none )
- {
- APCost = X2AbilityCost_ActionPoints (Costs);
- APCost.DoNotConsumeAllSoldierAbilities.AddItem('PAPuppetShow');
- }
- }
- }
- //////////////////// END FILE ////////////////////////////////////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement