Advertisement
Drakten

Untitled

Aug 25th, 2020
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. 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)
  2. {
  3. local ShotModifierInfo AccuracyInfo, CritInfo;
  4. local XComGameState_Item SourceWeapon;
  5. local X2WeaponTemplate WeaponTemplate;
  6.  
  7. if (EffectState.ApplyEffectParameters.ItemStateObjectRef.ObjectID == AbilityState.SourceWeapon.ObjectID)
  8. {
  9. SourceWeapon = AbilityState.GetSourceWeapon();
  10. if (SourceWeapon != none)
  11. {
  12. WeaponTemplate = X2WeaponTemplate(SourceWeapon.GetMyTemplate());
  13. if (WeaponTemplate != none)
  14. {
  15. switch (WeaponTemplate.WeaponTech)
  16. {
  17. case 'conventional':
  18. AccuracyInfo.Value = class'X2Ability_SRAbilitySet'.default.CV_DRONEMARK_AIM;
  19. CritInfo.Value = class'X2Ability_SRAbilitySet'.default.CV_DRONEMARK_CRIT_CHANCE;
  20. break;
  21. case 'magnetic':
  22. AccuracyInfo.Value = class'X2Ability_SRAbilitySet'.default.MG_DRONEMARK_AIM;
  23. CritInfo.Value = class'X2Ability_SRAbilitySet'.default.MG_DRONEMARK_CRIT_CHANCE;
  24. break;
  25. case 'beam':
  26. AccuracyInfo.Value = class'X2Ability_SRAbilitySet'.default.BM_DRONEMARK_AIM;
  27. CritInfo.Value = class'X2Ability_SRAbilitySet'.default.BM_DRONEMARK_CRIT_CHANCE;
  28. break;
  29. default:
  30. return;
  31. }
  32. }
  33. }
  34. }
  35. AccuracyInfo.ModType = eHit_Success;
  36. CritInfo.ModType = eHit_Crit;
  37. AccuracyInfo.Reason = FriendlyName;
  38. CritInfo.Reason = FriendlyName;
  39. ShotModifiers.AddItem(AccuracyInfo);
  40. ShotModifiers.AddItem(CritInfo);
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement