Advertisement
VatGhern

Shotgun Passive

Oct 4th, 2023
1,943
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
UnrealScript 2.48 KB | Source Code | 0 0
  1. /// <summary>
  2. /// Adds the damage effect that applies on misses to all the shotgun's templates
  3. /// </summary>
  4. static event OnPostTemplatesCreated()
  5. {
  6.     ModifyTemplateAllDiff('Shotgun_CV', class'X2WeaponTemplate', PatchWeaponTemplateCV);
  7.     ModifyTemplateAllDiff('Shotgun_MG', class'X2WeaponTemplate', PatchWeaponTemplateMGBM);
  8.     ModifyTemplateAllDiff('Shotgun_BM', class'X2WeaponTemplate', PatchWeaponTemplateMGBM);
  9.     ModifyTemplateAllDiff('TLE_Shotgun_CV', class'X2WeaponTemplate', PatchWeaponTemplateCV);
  10.     ModifyTemplateAllDiff('TLE_Shotgun_MG', class'X2WeaponTemplate', PatchWeaponTemplateMGBM);
  11.     ModifyTemplateAllDiff('TLE_Shotgun_BM', class'X2WeaponTemplate', PatchWeaponTemplateMGBM);
  12.     ModifyTemplateAllDiff('ChosenShotgun_CV', class'X2WeaponTemplate', PatchWeaponTemplateCV);
  13.     ModifyTemplateAllDiff('ChosenShotgun_MG', class'X2WeaponTemplate', PatchWeaponTemplateMGBM);
  14.     ModifyTemplateAllDiff('ChosenShotgun_BM', class'X2WeaponTemplate', PatchWeaponTemplateMGBM);
  15.     ModifyTemplateAllDiff('ChosenShotgun_T4', class'X2WeaponTemplate', PatchWeaponTemplateMGBM);
  16.     ModifyTemplateAllDiff('ChosenShotgun_XCOM', class'X2WeaponTemplate', PatchWeaponTemplateMGBM);
  17. }
  18.  
  19. /// <summary>
  20. /// Sets up the damage effect that applies on misses for conventional shotguns
  21. /// </summary>
  22. static function PatchWeaponTemplateCV(X2DataTemplate DataTemplate)
  23. {
  24.     local X2Effect_ApplyWeaponDamage DamageEffect;
  25.     local X2WeaponTemplate Template;
  26.  
  27.     DamageEffect = new class'X2Effect_ApplyWeaponDamage';
  28.     DamageEffect.bApplyOnHit = false;
  29.     DamageEffect.bApplyOnMiss = true;
  30.     DamageEffect.bIgnoreBaseDamage = true;
  31.     DamageEffect.bAllowWeaponUpgrade = true;
  32.     DamageEffect.bAllowFreeKill = false;
  33.     DamageEffect.EffectDamageValue.Damage = 1;
  34.  
  35.     Template = X2WeaponTemplate(DataTemplate);
  36.  
  37.     Template.BonusWeaponEffects.AddItem(DamageEffect);
  38. }
  39.  
  40. /// <summary>
  41. /// Sets up the damage effect that applies on misses for magnetic and plasma shotguns
  42. /// </summary>
  43. static function PatchWeaponTemplateMGBM(X2DataTemplate DataTemplate)
  44. {
  45.     local X2Effect_ApplyWeaponDamage DamageEffect;
  46.     local X2WeaponTemplate Template;
  47.  
  48.     DamageEffect = new class'X2Effect_ApplyWeaponDamage';
  49.     DamageEffect.bApplyOnHit = false;
  50.     DamageEffect.bApplyOnMiss = true;
  51.     DamageEffect.bIgnoreBaseDamage = true;
  52.     DamageEffect.bAllowWeaponUpgrade = true;
  53.     DamageEffect.bAllowFreeKill = false;
  54.     DamageEffect.EffectDamageValue.Damage = 2;
  55.  
  56.     Template = X2WeaponTemplate(DataTemplate);
  57.  
  58.     Template.BonusWeaponEffects.AddItem(DamageEffect);
  59. }
Tags: WOTC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement