Drakten

Untitled

Jun 13th, 2020
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. static function X2AbilityTemplate BscGuardDAb()
  2. {
  3. local X2AbilityTemplate Template;
  4. local X2Effect_PersistentStatChange Effect;
  5. local X2Condition_UnitType UnitTypeCondition;
  6. local X2Condition_UnitValue ValueCondition;
  7. local X2Effect_IncrementUnitValue IncrementEffect;
  8. local X2Condition_UnitInventoryMelee MeleeWeaponCondition;
  9.  
  10.  
  11. // Using shield to debug for now because easy visualization
  12. Effect = new class'X2Effect_PersistentStatChange';
  13. Effect.EffectName = 'BscGuardDAb';
  14. Effect.AddPersistentStatChange(eStat_ShieldHP, default.GUARD_SHIELD);
  15. Effect.DuplicateResponse = eDupe_Allow;
  16. Effect.BuildPersistentEffect(1, true, true, false);
  17.  
  18. // Create a triggered ability that activates whenever the unit gets a kill
  19. Template = SelfTargetTrigger('BscGuardDAb', "img:///UILibrary_XPACK_Common.PerkIcons.UIPerk_ReflectShot", false, Effect, 'KillMail');
  20.  
  21. // Does not trigger when killing Lost
  22. UnitTypeCondition = new class'X2Condition_UnitType';
  23. UnitTypeCondition.ExcludeTypes.AddItem('TheLost');
  24. AddTriggerTargetCondition(Template, UnitTypeCondition);
  25.  
  26. // Limit activations
  27. ValueCondition = new class'X2Condition_UnitValue';
  28. ValueCondition.AddCheckValue('Guard_Activations', default.GUARD_ACTIVATIONS_PER_MISSION, eCheck_LessThan);
  29. Template.AbilityTargetConditions.AddItem(ValueCondition);
  30.  
  31. // Create an effect that will increment the unit value
  32. IncrementEffect = new class'X2Effect_IncrementUnitValue';
  33. IncrementEffect.UnitName = 'Guard_Activations';
  34. IncrementEffect.NewValueToSet = 1;
  35. IncrementEffect.CleanupType = eCleanup_BeginTactical;
  36. Template.AddTargetEffect(IncrementEffect);
  37.  
  38. // Trigger abilities don't appear as passives. Add a passive ability icon.
  39. AddIconPassive(Template);
  40.  
  41. // Show a flyover when activated
  42. Template.bShowActivation = true;
  43.  
  44. MeleeWeaponCondition = new class'X2Condition_UnitInventoryMelee';
  45. MeleeWeaponCondition.RelevantSlots.AddItem(eInvSlot_PrimaryWeapon);
  46. MeleeWeaponCondition.RelevantSlots.AddItem(eInvSlot_SecondaryWeapon);
  47. MeleeWeaponCondition.RequireWeaponCategory = 'sword';
  48. Template.AddTriggerTargetCondition.AddItem(MeleeWeaponCondition);
  49. Template.DefaultSourceItemSlot = eSlot_SecondaryWeapon;
  50.  
  51. return Template;
  52. }
Add Comment
Please, Sign In to add comment