Drakten

Untitled

Jun 1st, 2020
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.19 KB | None | 0 0
  1. 1- code from x2item uc file
  2.  
  3. static function X2DataTemplate CreateBasicCoating()
  4. {
  5. local X2WeaponUpgradeTemplate Template;
  6.  
  7. `CREATE_X2TEMPLATE(class'X2WeaponUpgradeTemplate', Template, 'Coating_Bsc');
  8. //Coating_Bsc to be used in loot tables and localization
  9. SetUpBasicCoating(Template);
  10. Template.BonusAbilities.AddItem('CoatingBscAbility');
  11. //CoatingBscAbility to be used in custom X2Ability_ItemGrantedAbilitySet
  12. Template.strImage = "img:///MelAtt.coating";
  13.  
  14. return Template;
  15. }
  16.  
  17. static function SetUpBasicCoating(out X2WeaponUpgradeTemplate Template)
  18. {
  19. Template.CanBeBuilt = false;
  20. Template.TradingPostValue = 10;
  21. Template.Tier = 0;
  22. Template.MaxQuantity = 1;
  23. Template.BlackMarketTexts = class'X2Item_DefaultUpgrades'.default.UpgradeBlackMarketTexts;
  24. Template.MutuallyExclusiveUpgrades.AddItem('Coating_Adv');
  25. Template.MutuallyExclusiveUpgrades.AddItem('Coating_Sup');
  26. Template.CanApplyUpgradeToWeaponFn = CanApplyToSword;
  27.  
  28. }
  29.  
  30. 2- code from x2ability uc file
  31.  
  32. var config int COATING_BSC_HOLO;
  33. var localized string CoatingHoloEffecttName;
  34. var localized string CoatingHoloEffectDesc;
  35.  
  36. static function array<X2DataTemplate> CreateTemplates()
  37. {
  38. local array<X2DataTemplate> Templates;
  39.  
  40. Templates.AddItem(CoatingBscAbility());
  41.  
  42. return Templates;
  43. }
  44.  
  45. static function X2AbilityTemplate CoatingBscAbility()
  46. {
  47. local X2AbilityTemplate Template;
  48. local X2Effect_Persistent PersistentEffect;
  49.  
  50. `CREATE_X2ABILITY_TEMPLATE(Template, 'CoatingBscAbility');
  51.  
  52. Template.AbilitySourceName = 'eAbilitySource_Item';
  53. Template.eAbilityIconBehaviorHUD = EAbilityIconBehavior_NeverShow;
  54. Template.Hostility = eHostility_Neutral;
  55. Template.bIsPassive = true;
  56.  
  57. Template.AbilityToHitCalc = default.DeadEye;
  58. Template.AbilityTargetStyle = default.SelfTarget;
  59. Template.AbilityTriggers.AddItem(default.UnitPostBeginPlayTrigger);
  60.  
  61. // This is a dummy effect so that an icon shows up in the UI.
  62. // Shot and Suppression abilities make use of HoloTargetEffect().
  63. PersistentEffect = new class'X2Effect_Persistent';
  64. PersistentEffect.BuildPersistentEffect(1, true, true);
  65. PersistentEffect.SetDisplayInfo(ePerkBuff_Passive, Template.LocFriendlyName, Template.LocLongDescription, Template.IconImage, true,,Template.AbilitySourceName);
  66. Template.AddTargetEffect(PersistentEffect);
  67.  
  68. Template.BuildNewGameStateFn = TypicalAbility_BuildGameState;
  69. // Note: no visualization on purpose!
  70.  
  71. return Template;
  72. }
  73.  
  74. static function X2Effect_CoatingHolo CoatingHoloEffect()
  75. {
  76. local X2Effect_CoatingHolo Effect;
  77. local X2Condition_AbilityProperty AbilityCondition;
  78. local X2AbilityTag AbilityTag;
  79.  
  80. Effect = new class'X2Effect_CoatingHolo';
  81. Effect.HitMod = default.COATING_BSC_HOLO;
  82. Effect.BuildPersistentEffect(1, false, false, false, eGameRule_PlayerTurnBegin);
  83. Effect.bRemoveWhenTargetDies = true;
  84. Effect.bUseSourcePlayerState = true;
  85.  
  86. AbilityTag = X2AbilityTag(`XEXPANDCONTEXT.FindTag("Ability"));
  87. AbilityTag.ParseObj = Effect;
  88.  
  89. Effect.SetDisplayInfo(ePerkBuff_Penalty, default.CoatingHoloEffecttName, `XEXPAND.ExpandString(default.CoatingHoloEffectDesc), "img:///UILibrary_PerkIcons.UIPerk_holotargeting", true);
  90.  
  91. AbilityCondition = new class'X2Condition_AbilityProperty';
  92. AbilityCondition.OwnerHasSoldierAbilities.AddItem('CoatingBscAbility');
  93. Effect.TargetConditions.AddItem(AbilityCondition);
  94.  
  95. // bsg-dforrest (7.27.17): need to clear out ParseObject
  96. AbilityTag.ParseObj = none;
  97. // bsg-dforrest (7.27.17): end
  98.  
  99. return Effect;
  100. }
  101.  
  102. 3- code from x2effect uc file
  103.  
  104. class X2Effect_CoatingHolo extends X2Effect_Persistent;
  105.  
  106. var int HitMod;
  107.  
  108. function GetToHitAsTargetModifiers(XComGameState_Effect EffectState, XComGameState_Unit Attacker, XComGameState_Unit Target, XComGameState_Ability AbilityState, class<X2AbilityToHitCalc> ToHitType, bool bMelee, bool bFlanking, bool bIndirectFire, out array<ShotModifierInfo> ShotModifiers)
  109. {
  110. local ShotModifierInfo ModInfo;
  111.  
  112. ModInfo.ModType = eHit_Success;
  113. ModInfo.Reason = FriendlyName;
  114. ModInfo.Value = HitMod;
  115.  
  116. ShotModifiers.AddItem(ModInfo);
  117. }
  118.  
  119. DefaultProperties
  120. {
  121. EffectName = "CoatingHoloEffect"
  122. DuplicateResponse = eDupe_Refresh;
  123. bApplyOnHit = true;
  124. bApplyOnMiss = false;
  125. }
Add Comment
Please, Sign In to add comment