public float ECMSignatureMod(EWState attackerState) { if (shieldedByECMMod <= 0) { return(0f); } int strength = shieldedByECMMod - attackerState.ProbeCarrierMod(); if (this.PingedByProbeMod() > 0) { strength -= this.PingedByProbeMod(); } if (attackerState.ProbeCarrierMod() > 0) { strength -= attackerState.ProbeCarrierMod(); } // Probe can reduce you to zero, but not further. strength = Math.Max(0, strength); float sigMod = strength * 0.1f; if (sigMod != 0) { Mod.Log.Trace?.Write($"Target:({CombatantUtils.Label(actor)}) has ECMSignatureMod:{sigMod}"); } return(sigMod); }
// Defender modifier public int StealthAttackMod(EWState attackerState, Weapon weapon, float distance) { if (stealth == null) { return(0); } int strength = 0; if (distance < weapon.MediumRange) { strength = stealth.MediumRangeAttackMod; } else if (distance < weapon.LongRange) { strength = stealth.LongRangeAttackMod; } else if (distance < weapon.MaxRange) { strength = stealth.ExtremeRangeAttackMod; } if (this.PingedByProbeMod() > 0) { strength -= this.PingedByProbeMod(); } if (attackerState.ProbeCarrierMod() > 0) { strength -= attackerState.ProbeCarrierMod(); } strength = Math.Max(0, strength); return(strength); }
// Mimetic public float MimeticVisibilityMod(EWState attackerState) { float strength = CurrentMimeticPips() * 0.05f; if (this.PingedByProbeMod() > 0) { strength -= (this.PingedByProbeMod() * 0.05f); } if (attackerState.ProbeCarrierMod() > 0) { strength -= (attackerState.ProbeCarrierMod() * 0.05f); } strength = Math.Max(0, strength); return(strength); }
// Stealth public float StealthSignatureMod(EWState attackerState) { float strength = this.stealth != null ? this.stealth.SignatureMulti : 0.0f; if (this.PingedByProbeMod() > 0) { strength -= (this.PingedByProbeMod() * 0.05f); } if (attackerState.ProbeCarrierMod() > 0) { strength -= (attackerState.ProbeCarrierMod() * 0.05f); } strength = Math.Max(0, strength); return(strength); }
// Defender modifier public int StealthAttackMod(EWState attackerState, Weapon weapon, float attackerDistance) { if (stealth == null) { return(0); } int strength = 0; if (attackerDistance <= weapon.ShortRange) { strength = 0; } else if (attackerDistance <= weapon.MediumRange) { strength = stealth.MediumRangeAttackMod; } else if (attackerDistance <= weapon.LongRange) { strength = stealth.LongRangeAttackMod; } else if (attackerDistance <= weapon.MaxRange) { strength = stealth.ExtremeRangeAttackMod; } if (strength > 0) { if (this.PingedByProbeMod() > 0) { strength -= this.PingedByProbeMod(); } if (attackerState.ProbeCarrierMod() > 0) { strength -= attackerState.ProbeCarrierMod(); } strength = Math.Max(0, strength); } // Positive strength is a negative attack modifier, so invert return(strength * -1); }
// Defender modifier public int MimeticAttackMod(EWState attackerState) { if (mimetic == null) { return(0); } int strength = CurrentMimeticPips(); if (this.PingedByProbeMod() > 0) { strength -= this.PingedByProbeMod(); } if (attackerState.ProbeCarrierMod() > 0) { strength -= attackerState.ProbeCarrierMod(); } strength = Math.Max(0, strength); return(strength); }
// Defender modifier public int ECMAttackMod(EWState attackerState) { if (shieldedByECMMod <= 0) { return(0); } int strength = shieldedByECMMod; if (this.PingedByProbeMod() > 0) { strength -= this.PingedByProbeMod(); } if (attackerState.ProbeCarrierMod() > 0) { strength -= attackerState.ProbeCarrierMod(); } strength = Math.Max(0, strength); return(strength); }
// Stealth public float StealthSignatureMod(EWState attackerState) { float strength = this.stealth != null ? this.stealth.SignatureMulti : 0.0f; if (strength > 0) { // Probe only applies if stealth sig starts out positive if (this.PingedByProbeMod() > 0) { strength -= (this.PingedByProbeMod() * 0.05f); } if (attackerState.ProbeCarrierMod() > 0) { strength -= (attackerState.ProbeCarrierMod() * 0.05f); } strength = Math.Max(0, strength); } // Invert the value to be a signature reduction return(strength * -1); }
// Shield modifier public int ECMAttackMod(EWState attackerState) { if (shieldedByECMMod <= 0) { return(0); } int strength = (int)Math.Floor(shieldedByECMMod * Mod.Config.Attack.ShieldedMulti); if (this.PingedByProbeMod() > 0) { strength -= this.PingedByProbeMod(); } if (attackerState.ProbeCarrierMod() > 0) { strength -= attackerState.ProbeCarrierMod(); } strength = Math.Max(0, strength); return(strength); }
// Defender modifier public int MimeticAttackMod(EWState attackerState) { // If no mimetic, return if (!HasMimetic()) { return(0); } int charges = CurrentMimeticPips(); if (this.PingedByProbeMod() > 0) { charges -= this.PingedByProbeMod(); } if (attackerState.ProbeCarrierMod() != 0) { charges -= attackerState.ProbeCarrierMod(); } int strength = charges > 0 ? (int)Math.Ceiling(charges * mimetic.AttackMod) : 0; return(strength); }
// Mimetic public float MimeticVisibilityMod(EWState attackerState) { // If no mimetic, return if (!HasMimetic()) { return(1f); } int charges = CurrentMimeticPips(); if (this.PingedByProbeMod() > 0) { charges -= this.PingedByProbeMod(); } if (attackerState.ProbeCarrierMod() != 0) { charges -= attackerState.ProbeCarrierMod(); } float visibility = charges > 0 ? 1f - (charges * mimetic.VisibilityMod) : 1f; return(visibility); }