Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        // 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);
        }
Ejemplo n.º 3
0
        public int NarcAttackMod(EWState attackerState)
        {
            int val = 0;

            if (narcEffect != null)
            {
                val = Math.Max(0, narcEffect.AttackMod - ECMAttackMod(attackerState));
            }
            return(val * -1);
        }
Ejemplo n.º 4
0
        public int NarcDetailsMod(EWState attackerState)
        {
            int val = 0;

            if (narcEffect != null)
            {
                val = Math.Max(0, narcEffect.DetailsMod - ECMDetailsMod(attackerState));
            }
            return(val);
        }
Ejemplo n.º 5
0
        public float NarcSignatureMod(EWState attackerState)
        {
            float val = 0;

            if (narcEffect != null)
            {
                val = (float)Math.Max(0.0f, narcEffect.SignatureMod - ECMDetailsMod(attackerState) * 0.1f);
            }
            return(val);
        }
Ejemplo n.º 6
0
        public int TagDetailsMod(EWState attackerState)
        {
            int val = 0;

            if (tagEffect != null)
            {
                val = Math.Max(0, tagEffect.DetailsMod - MimeticAttackMod(attackerState));
            }
            return(val);
        }
Ejemplo n.º 7
0
        public float TagSignatureMod(EWState attackerState)
        {
            float val = 0;

            if (tagEffect != null)
            {
                val = (float)Math.Max(0.0f, tagEffect.SignatureMod - MimeticVisibilityMod(attackerState));
            }
            return(val);
        }
Ejemplo n.º 8
0
        // 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);
        }
Ejemplo n.º 9
0
        // 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);
        }
Ejemplo n.º 10
0
        // 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);
        }
Ejemplo n.º 11
0
        // 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);
        }
Ejemplo n.º 12
0
        // 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);
        }
Ejemplo n.º 13
0
        // 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);
        }
Ejemplo n.º 14
0
        // 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);
        }
Ejemplo n.º 15
0
        // 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);
        }
Ejemplo n.º 16
0
        // 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);
        }
Ejemplo n.º 17
0
 // TAG effects
 public bool IsTagged(EWState attackerState)
 {
     return(tagEffect != null && Math.Max(0, tagEffect.AttackMod - MimeticAttackMod(attackerState)) > 0);
 }
Ejemplo n.º 18
0
 // NARC effects
 public bool IsNarced(EWState attackerState)
 {
     return(narcEffect != null);
 }