Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static function X2AbilityTemplate CreateSpectreImmunitiesAbility()
- {
- local X2AbilityTemplate Template;
- local X2AbilityTrigger_UnitPostBeginPlay Trigger;
- local X2Effect_DamageImmunity DamageImmunity;
- `CREATE_X2ABILITY_TEMPLATE(Template, 'SpectreImmunities');
- Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_immunities";
- Template.AbilitySourceName = 'eAbilitySource_Perk';
- Template.eAbilityIconBehaviorHUD = EAbilityIconBehavior_NeverShow;
- Template.Hostility = eHostility_Neutral;
- Template.AbilityToHitCalc = default.DeadEye;
- Template.AbilityTargetStyle = default.SelfTarget;
- Trigger = new class'X2AbilityTrigger_UnitPostBeginPlay';
- Template.AbilityTriggers.AddItem(Trigger);
- // Build the immunities
- DamageImmunity = new class'X2Effect_DamageImmunity';
- DamageImmunity.BuildPersistentEffect(1, true, true, true);
- DamageImmunity.SetDisplayInfo(ePerkBuff_Passive, Template.LocFriendlyName, Template.GetMyLongDescription(), Template.IconImage,,,Template.AbilitySourceName);
- DamageImmunity.ImmuneTypes.AddItem('Poison');
- DamageImmunity.ImmuneTypes.AddItem('Fire');
- if (!IsModLoaded('RoboticSpectre'))
- {
- DamageImmunity.ImmuneTypes.AddItem('Mental');
- }
- DamageImmunity.ImmuneTypes.AddItem('Acid');
- DamageImmunity.ImmuneTypes.AddItem('EleriumPoisoning');
- DamageImmunity.ImmuneTypes.AddItem(class'X2Item_DefaultDamageTypes'.default.ParthenogenicPoisonType);
- DamageImmunity.ImmuneTypes.AddItem(class'X2Item_DefaultDamageTypes'.default.KnockbackDamageType);
- Template.AddTargetEffect(DamageImmunity);
- Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
- return Template;
- }
- static private function bool IsModLoaded(name ModName)
- {
- local XComOnlineEventMgr EventManager;
- local int Index;
- EventManager = `ONLINEEVENTMGR;
- for (Index = EventManager.GetNumDLC() - 1; Index >= 0; Index--)
- {
- if (EventManager.GetDLCNames(Index) == ModName)
- {
- return true;
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement