Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static function X2AbilityTemplate BscGuardDAb()
- {
- local X2AbilityTemplate Template;
- local X2Effect_PersistentStatChange Effect;
- local X2Condition_UnitType UnitTypeCondition;
- local X2Condition_UnitValue ValueCondition;
- local X2Effect_IncrementUnitValue IncrementEffect;
- local X2Condition_UnitInventoryMelee MeleeWeaponCondition;
- // Using shield to debug for now because easy visualization
- Effect = new class'X2Effect_PersistentStatChange';
- Effect.EffectName = 'BscGuardDAb';
- Effect.AddPersistentStatChange(eStat_ShieldHP, default.GUARD_SHIELD);
- Effect.DuplicateResponse = eDupe_Allow;
- Effect.BuildPersistentEffect(1, true, true, false);
- // Create a triggered ability that activates whenever the unit gets a kill
- Template = SelfTargetTrigger('BscGuardDAb', "img:///UILibrary_XPACK_Common.PerkIcons.UIPerk_ReflectShot", false, Effect, 'KillMail');
- // Does not trigger when killing Lost
- UnitTypeCondition = new class'X2Condition_UnitType';
- UnitTypeCondition.ExcludeTypes.AddItem('TheLost');
- AddTriggerTargetCondition(Template, UnitTypeCondition);
- // Limit activations
- ValueCondition = new class'X2Condition_UnitValue';
- ValueCondition.AddCheckValue('Guard_Activations', default.GUARD_ACTIVATIONS_PER_MISSION, eCheck_LessThan);
- Template.AbilityTargetConditions.AddItem(ValueCondition);
- // Create an effect that will increment the unit value
- IncrementEffect = new class'X2Effect_IncrementUnitValue';
- IncrementEffect.UnitName = 'Guard_Activations';
- IncrementEffect.NewValueToSet = 1;
- IncrementEffect.CleanupType = eCleanup_BeginTactical;
- Template.AddTargetEffect(IncrementEffect);
- // Trigger abilities don't appear as passives. Add a passive ability icon.
- AddIconPassive(Template);
- // Show a flyover when activated
- Template.bShowActivation = true;
- MeleeWeaponCondition = new class'X2Condition_UnitInventoryMelee';
- MeleeWeaponCondition.RelevantSlots.AddItem(eInvSlot_PrimaryWeapon);
- MeleeWeaponCondition.RelevantSlots.AddItem(eInvSlot_SecondaryWeapon);
- MeleeWeaponCondition.RequireWeaponCategory = 'sword';
- Template.AddTriggerTargetCondition.AddItem(MeleeWeaponCondition);
- Template.DefaultSourceItemSlot = eSlot_SecondaryWeapon;
- return Template;
- }
Add Comment
Please, Sign In to add comment