Smaller hit range when the target is moving.

This commit is contained in:
MobiusDevelopment 2020-10-03 10:40:50 +00:00
parent bec91b65ae
commit e3ad144108
19 changed files with 19 additions and 57 deletions

View File

@ -973,7 +973,7 @@ public class CreatureAI extends AbstractAI
if (isFollowing()) if (isFollowing())
{ {
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius2D(target, offsetWithCollision + 100)) if (!_actor.isInsideRadius2D(target, offsetWithCollision + 30))
{ {
return true; return true;
} }
@ -989,7 +989,6 @@ public class CreatureAI extends AbstractAI
{ {
_actor.getAI().setIntention(AI_INTENTION_IDLE); _actor.getAI().setIntention(AI_INTENTION_IDLE);
} }
return true; return true;
} }
@ -1019,7 +1018,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else

View File

@ -973,7 +973,7 @@ public class CreatureAI extends AbstractAI
if (isFollowing()) if (isFollowing())
{ {
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius2D(target, offsetWithCollision + 100)) if (!_actor.isInsideRadius2D(target, offsetWithCollision + 30))
{ {
return true; return true;
} }
@ -989,7 +989,6 @@ public class CreatureAI extends AbstractAI
{ {
_actor.getAI().setIntention(AI_INTENTION_IDLE); _actor.getAI().setIntention(AI_INTENTION_IDLE);
} }
return true; return true;
} }
@ -1019,7 +1018,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else

View File

@ -973,7 +973,7 @@ public class CreatureAI extends AbstractAI
if (isFollowing()) if (isFollowing())
{ {
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius2D(target, offsetWithCollision + 100)) if (!_actor.isInsideRadius2D(target, offsetWithCollision + 30))
{ {
return true; return true;
} }
@ -989,7 +989,6 @@ public class CreatureAI extends AbstractAI
{ {
_actor.getAI().setIntention(AI_INTENTION_IDLE); _actor.getAI().setIntention(AI_INTENTION_IDLE);
} }
return true; return true;
} }
@ -1019,7 +1018,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else

View File

@ -973,7 +973,7 @@ public class CreatureAI extends AbstractAI
if (isFollowing()) if (isFollowing())
{ {
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius2D(target, offsetWithCollision + 100)) if (!_actor.isInsideRadius2D(target, offsetWithCollision + 30))
{ {
return true; return true;
} }
@ -989,7 +989,6 @@ public class CreatureAI extends AbstractAI
{ {
_actor.getAI().setIntention(AI_INTENTION_IDLE); _actor.getAI().setIntention(AI_INTENTION_IDLE);
} }
return true; return true;
} }
@ -1019,7 +1018,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else

View File

@ -973,7 +973,7 @@ public class CreatureAI extends AbstractAI
if (isFollowing()) if (isFollowing())
{ {
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius2D(target, offsetWithCollision + 100)) if (!_actor.isInsideRadius2D(target, offsetWithCollision + 30))
{ {
return true; return true;
} }
@ -989,7 +989,6 @@ public class CreatureAI extends AbstractAI
{ {
_actor.getAI().setIntention(AI_INTENTION_IDLE); _actor.getAI().setIntention(AI_INTENTION_IDLE);
} }
return true; return true;
} }
@ -1019,7 +1018,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else

View File

@ -973,7 +973,7 @@ public class CreatureAI extends AbstractAI
if (isFollowing()) if (isFollowing())
{ {
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius2D(target, offsetWithCollision + 100)) if (!_actor.isInsideRadius2D(target, offsetWithCollision + 30))
{ {
return true; return true;
} }
@ -989,7 +989,6 @@ public class CreatureAI extends AbstractAI
{ {
_actor.getAI().setIntention(AI_INTENTION_IDLE); _actor.getAI().setIntention(AI_INTENTION_IDLE);
} }
return true; return true;
} }
@ -1019,7 +1018,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else

View File

@ -973,7 +973,7 @@ public class CreatureAI extends AbstractAI
if (isFollowing()) if (isFollowing())
{ {
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius2D(target, offsetWithCollision + 100)) if (!_actor.isInsideRadius2D(target, offsetWithCollision + 30))
{ {
return true; return true;
} }
@ -989,7 +989,6 @@ public class CreatureAI extends AbstractAI
{ {
_actor.getAI().setIntention(AI_INTENTION_IDLE); _actor.getAI().setIntention(AI_INTENTION_IDLE);
} }
return true; return true;
} }
@ -1019,7 +1018,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else

View File

@ -973,7 +973,7 @@ public class CreatureAI extends AbstractAI
if (isFollowing()) if (isFollowing())
{ {
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius2D(target, offsetWithCollision + 100)) if (!_actor.isInsideRadius2D(target, offsetWithCollision + 30))
{ {
return true; return true;
} }
@ -989,7 +989,6 @@ public class CreatureAI extends AbstractAI
{ {
_actor.getAI().setIntention(AI_INTENTION_IDLE); _actor.getAI().setIntention(AI_INTENTION_IDLE);
} }
return true; return true;
} }
@ -1019,7 +1018,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else

View File

@ -977,11 +977,10 @@ public class CreatureAI extends AbstractAI
return true; return true;
} }
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius(target, offsetWithCollision + 100, false, false)) if (!_actor.isInsideRadius(target, offsetWithCollision + 30, false, false))
{ {
return true; return true;
} }
stopFollow(); stopFollow();
return false; return false;
} }
@ -1009,7 +1008,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else

View File

@ -977,11 +977,10 @@ public class CreatureAI extends AbstractAI
return true; return true;
} }
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius(target, offsetWithCollision + 100, false, false)) if (!_actor.isInsideRadius(target, offsetWithCollision + 30, false, false))
{ {
return true; return true;
} }
stopFollow(); stopFollow();
return false; return false;
} }
@ -1009,7 +1008,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else

View File

@ -1022,7 +1022,7 @@ public class CreatureAI extends AbstractAI
if (getFollowTarget() != null) if (getFollowTarget() != null)
{ {
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius2D(target, offsetWithCollision + 100)) if (!_actor.isInsideRadius2D(target, offsetWithCollision + 30))
{ {
return true; return true;
} }
@ -1038,7 +1038,6 @@ public class CreatureAI extends AbstractAI
{ {
_actor.getAI().setIntention(AI_INTENTION_IDLE); _actor.getAI().setIntention(AI_INTENTION_IDLE);
} }
return true; return true;
} }
@ -1068,7 +1067,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else

View File

@ -1022,7 +1022,7 @@ public class CreatureAI extends AbstractAI
if (getFollowTarget() != null) if (getFollowTarget() != null)
{ {
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius2D(target, offsetWithCollision + 100)) if (!_actor.isInsideRadius2D(target, offsetWithCollision + 30))
{ {
return true; return true;
} }
@ -1038,7 +1038,6 @@ public class CreatureAI extends AbstractAI
{ {
_actor.getAI().setIntention(AI_INTENTION_IDLE); _actor.getAI().setIntention(AI_INTENTION_IDLE);
} }
return true; return true;
} }
@ -1068,7 +1067,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else

View File

@ -973,7 +973,7 @@ public class CreatureAI extends AbstractAI
if (isFollowing()) if (isFollowing())
{ {
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius2D(target, offsetWithCollision + 100)) if (!_actor.isInsideRadius2D(target, offsetWithCollision + 30))
{ {
return true; return true;
} }
@ -989,7 +989,6 @@ public class CreatureAI extends AbstractAI
{ {
_actor.getAI().setIntention(AI_INTENTION_IDLE); _actor.getAI().setIntention(AI_INTENTION_IDLE);
} }
return true; return true;
} }
@ -1019,7 +1018,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else

View File

@ -973,7 +973,7 @@ public class CreatureAI extends AbstractAI
if (isFollowing()) if (isFollowing())
{ {
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius2D(target, offsetWithCollision + 100)) if (!_actor.isInsideRadius2D(target, offsetWithCollision + 30))
{ {
return true; return true;
} }
@ -989,7 +989,6 @@ public class CreatureAI extends AbstractAI
{ {
_actor.getAI().setIntention(AI_INTENTION_IDLE); _actor.getAI().setIntention(AI_INTENTION_IDLE);
} }
return true; return true;
} }
@ -1019,7 +1018,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else

View File

@ -973,7 +973,7 @@ public class CreatureAI extends AbstractAI
if (isFollowing()) if (isFollowing())
{ {
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius2D(target, offsetWithCollision + 100)) if (!_actor.isInsideRadius2D(target, offsetWithCollision + 30))
{ {
return true; return true;
} }
@ -989,7 +989,6 @@ public class CreatureAI extends AbstractAI
{ {
_actor.getAI().setIntention(AI_INTENTION_IDLE); _actor.getAI().setIntention(AI_INTENTION_IDLE);
} }
return true; return true;
} }
@ -1019,7 +1018,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else

View File

@ -973,7 +973,7 @@ public class CreatureAI extends AbstractAI
if (isFollowing()) if (isFollowing())
{ {
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius2D(target, offsetWithCollision + 100)) if (!_actor.isInsideRadius2D(target, offsetWithCollision + 30))
{ {
return true; return true;
} }
@ -989,7 +989,6 @@ public class CreatureAI extends AbstractAI
{ {
_actor.getAI().setIntention(AI_INTENTION_IDLE); _actor.getAI().setIntention(AI_INTENTION_IDLE);
} }
return true; return true;
} }
@ -1019,7 +1018,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else

View File

@ -973,7 +973,7 @@ public class CreatureAI extends AbstractAI
if (isFollowing()) if (isFollowing())
{ {
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius2D(target, offsetWithCollision + 100)) if (!_actor.isInsideRadius2D(target, offsetWithCollision + 30))
{ {
return true; return true;
} }
@ -989,7 +989,6 @@ public class CreatureAI extends AbstractAI
{ {
_actor.getAI().setIntention(AI_INTENTION_IDLE); _actor.getAI().setIntention(AI_INTENTION_IDLE);
} }
return true; return true;
} }
@ -1019,7 +1018,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else

View File

@ -973,7 +973,7 @@ public class CreatureAI extends AbstractAI
if (isFollowing()) if (isFollowing())
{ {
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius2D(target, offsetWithCollision + 100)) if (!_actor.isInsideRadius2D(target, offsetWithCollision + 30))
{ {
return true; return true;
} }
@ -989,7 +989,6 @@ public class CreatureAI extends AbstractAI
{ {
_actor.getAI().setIntention(AI_INTENTION_IDLE); _actor.getAI().setIntention(AI_INTENTION_IDLE);
} }
return true; return true;
} }
@ -1019,7 +1018,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else

View File

@ -973,7 +973,7 @@ public class CreatureAI extends AbstractAI
if (isFollowing()) if (isFollowing())
{ {
// allow larger hit range when the target is moving (check is run only once per second) // allow larger hit range when the target is moving (check is run only once per second)
if (!_actor.isInsideRadius2D(target, offsetWithCollision + 100)) if (!_actor.isInsideRadius2D(target, offsetWithCollision + 30))
{ {
return true; return true;
} }
@ -989,7 +989,6 @@ public class CreatureAI extends AbstractAI
{ {
_actor.getAI().setIntention(AI_INTENTION_IDLE); _actor.getAI().setIntention(AI_INTENTION_IDLE);
} }
return true; return true;
} }
@ -1019,7 +1018,6 @@ public class CreatureAI extends AbstractAI
{ {
offset = 5; offset = 5;
} }
startFollow((Creature) target, offset); startFollow((Creature) target, offset);
} }
else else