Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
- {
- local ShotModifierInfo AccuracyInfo, CritInfo;
- local XComGameState_Item SourceWeapon;
- local X2WeaponTemplate WeaponTemplate;
- if (EffectState.ApplyEffectParameters.ItemStateObjectRef.ObjectID == AbilityState.SourceWeapon.ObjectID)
- {
- SourceWeapon = AbilityState.GetSourceWeapon();
- if (SourceWeapon != none)
- {
- WeaponTemplate = X2WeaponTemplate(SourceWeapon.GetMyTemplate());
- if (WeaponTemplate != none)
- {
- switch (WeaponTemplate.WeaponTech)
- {
- case 'conventional':
- AccuracyInfo.Value = class'X2Ability_SRAbilitySet'.default.CV_DRONEMARK_AIM;
- CritInfo.Value = class'X2Ability_SRAbilitySet'.default.CV_DRONEMARK_CRIT_CHANCE;
- break;
- case 'magnetic':
- AccuracyInfo.Value = class'X2Ability_SRAbilitySet'.default.MG_DRONEMARK_AIM;
- CritInfo.Value = class'X2Ability_SRAbilitySet'.default.MG_DRONEMARK_CRIT_CHANCE;
- break;
- case 'beam':
- AccuracyInfo.Value = class'X2Ability_SRAbilitySet'.default.BM_DRONEMARK_AIM;
- CritInfo.Value = class'X2Ability_SRAbilitySet'.default.BM_DRONEMARK_CRIT_CHANCE;
- break;
- default:
- return;
- }
- }
- }
- }
- AccuracyInfo.ModType = eHit_Success;
- CritInfo.ModType = eHit_Crit;
- AccuracyInfo.Reason = FriendlyName;
- CritInfo.Reason = FriendlyName;
- ShotModifiers.AddItem(AccuracyInfo);
- ShotModifiers.AddItem(CritInfo);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement