fix: Adds GetDistanceToSqrt for Point3D and centralizes all the calls (#2233)
This commit is contained in:
parent
2086e9b292
commit
416e1be735
8 changed files with 56 additions and 39 deletions
|
|
@ -86,7 +86,7 @@ public partial class SummonedPaladin : BaseCreature
|
|||
|
||||
Timer.StartTimer(TimeSpan.FromSeconds(5.0), Delete);
|
||||
}
|
||||
else if (_necromancer.Map != Map || GetDistanceToSqrt(_necromancer) > RangePerception + 1)
|
||||
else if (_necromancer.Map != Map || this.GetDistanceToSqrt(_necromancer) > RangePerception + 1)
|
||||
{
|
||||
Effects.SendLocationParticles(
|
||||
EffectItem.Create(Location, Map, EffectItem.DefaultDuration),
|
||||
|
|
|
|||
|
|
@ -2439,7 +2439,7 @@ namespace Server.Mobiles
|
|||
{
|
||||
FightMode.Strongest => m.Skills.Tactics.Value + m.Str, // returns strongest mobile
|
||||
FightMode.Weakest => -m.Hits, // returns weakest mobile
|
||||
_ => -GetDistanceToSqrt(m)
|
||||
_ => -this.GetDistanceToSqrt(m)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -2461,7 +2461,7 @@ namespace Server.Mobiles
|
|||
|
||||
public bool IsHurt() => Hits != HitsMax;
|
||||
|
||||
public double GetHomeDistance() => GetDistanceToSqrt(m_Home);
|
||||
public double GetHomeDistance() => this.GetDistanceToSqrt(m_Home);
|
||||
|
||||
public virtual int GetTeamSize(int iRange)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ namespace Server.Mobiles
|
|||
|
||||
var total = Skills.Magery.Value + Skills.Poisoning.Value;
|
||||
|
||||
var dist = GetDistanceToSqrt(m);
|
||||
var dist = this.GetDistanceToSqrt(m);
|
||||
|
||||
if (dist >= 3.0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ namespace Server.Mobiles
|
|||
public override Poison PoisonImmune => Poison.Lethal;
|
||||
|
||||
public override double GetFightModeRanking(Mobile m, FightMode acqType, bool bPlayerOnly) =>
|
||||
m.Str / Math.Max(GetDistanceToSqrt(m), 1.0);
|
||||
m.Str / Math.Max(this.GetDistanceToSqrt(m), 1.0);
|
||||
|
||||
public override int GetAngerSound() => 0x23A;
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ namespace Server.Mobiles
|
|||
public override bool FollowsAcquireRules => Core.AOS || !Summoned || SummonMaster?.Player != true || Map != Map.Felucca;
|
||||
|
||||
public override double GetFightModeRanking(Mobile m, FightMode acqType, bool bPlayerOnly) =>
|
||||
(m.Str + m.Skills.Tactics.Value) / Math.Max(GetDistanceToSqrt(m), 1.0);
|
||||
(m.Str + m.Skills.Tactics.Value) / Math.Max(this.GetDistanceToSqrt(m), 1.0);
|
||||
|
||||
public override int GetAngerSound() => 0x23A;
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ namespace Server.Mobiles
|
|||
public override bool FollowsAcquireRules => Core.AOS || !Summoned || SummonMaster?.Player != true || Map != Map.Felucca;
|
||||
|
||||
public override double GetFightModeRanking(Mobile m, FightMode acqType, bool bPlayerOnly) =>
|
||||
(m.Int + m.Skills.Magery.Value) / Math.Max(GetDistanceToSqrt(m), 1.0);
|
||||
(m.Int + m.Skills.Magery.Value) / Math.Max(this.GetDistanceToSqrt(m), 1.0);
|
||||
|
||||
public override int GetAngerSound() => 0x15;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue