|
@@ -3792,8 +3792,8 @@ namespace CommonAI.Zone.Instance
|
|
|
private bool can_random_skill = true;
|
|
|
private bool can_attack = true;
|
|
|
|
|
|
- private float min_distance;
|
|
|
- private float max_distance;
|
|
|
+ private float min_distance = -1;
|
|
|
+ private float max_distance = -1;
|
|
|
|
|
|
/// <summary>
|
|
|
/// 是否追踪
|
|
@@ -3890,8 +3890,6 @@ namespace CommonAI.Zone.Instance
|
|
|
private void resetMaxMinRange()
|
|
|
{
|
|
|
var expect_skill = ExpectSkillState;
|
|
|
- min_distance = unit.BodyBlockSize + targetUnit.BodyBlockSize;
|
|
|
- max_distance = Math.Max(min_distance, unit.BodyBlockSize + targetUnit.BodyHitSize);
|
|
|
bool needCheck = true;
|
|
|
if (expect_skill == null)
|
|
|
{
|
|
@@ -3903,9 +3901,15 @@ namespace CommonAI.Zone.Instance
|
|
|
needCheck = false;
|
|
|
}
|
|
|
}
|
|
|
+ if(expect_skill == null )
|
|
|
+ {
|
|
|
+ expect_skill = unit.DefaultSkillStatus();
|
|
|
+ }
|
|
|
|
|
|
if (expect_skill != null)
|
|
|
{
|
|
|
+ min_distance = unit.BodyBlockSize + targetUnit.BodyBlockSize;
|
|
|
+ max_distance = Math.Max(min_distance, unit.BodyBlockSize + targetUnit.BodyHitSize);
|
|
|
if (can_random_skill)
|
|
|
{
|
|
|
if (needCheck == true && !expect_skill.checkTargetRange(targetUnit))
|
|
@@ -3928,7 +3932,7 @@ namespace CommonAI.Zone.Instance
|
|
|
else if (half > 0)
|
|
|
{
|
|
|
min_distance = min_distance + half;
|
|
|
- max_distance = Math.Max(max_distance, min_distance);
|
|
|
+ max_distance = Math.Max(skill_distance, min_distance);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -3941,10 +3945,12 @@ namespace CommonAI.Zone.Instance
|
|
|
|
|
|
protected override bool CheckTargetInMaxRange()
|
|
|
{
|
|
|
+ if (max_distance < 0) return true;
|
|
|
return CMath.includeRoundPoint(unit.X, unit.Y, max_distance, targetUnit.X, targetUnit.Y);
|
|
|
}
|
|
|
protected override bool CheckTargetInMinRange()
|
|
|
{
|
|
|
+ if(min_distance < 0) return true;
|
|
|
return CMath.includeRoundPoint(unit.X, unit.Y, min_distance, targetUnit.X, targetUnit.Y);
|
|
|
}
|
|
|
protected virtual bool OnEndAdjustKeepRange(StateMove m)
|