
I implemented in the character stand to determine whether or not to use the Half Moon skill on a monster.Im implementing to determine whether or not to use the half-moon skill on monsters at the character’s stance. This is a code to reduce the active switching of the Half Moon skill.
if (TargetObject != null || GameScene.Scene.MapControl.CanCrossHalfMoon(CurrentLocation))
{
MirDirection leftDir = Functions.PreviousDir(Direction);
MirDirection rightDir = Functions.NextDir(Direction);
int 人数 =0;
if (GameScene.User.Thrusting)
{
if (GameScene.Scene.MapControl.HasTarget(Functions.PointMove(CurrentLocation, Direction, 1)))
{
人数++;// 指定方向上1格处有目标
}
if (GameScene.Scene.MapControl.HasTarget(Functions.PointMove(CurrentLocation, leftDir, 1)))
{
人数++; // 指定方向左侧方向上1格处有目标
}
if (GameScene.Scene.MapControl.HasTarget(Functions.PointMove(CurrentLocation, rightDir, 1)))
{
人数++; // 指定方向右侧方向上1格处有目标
}
}
//上面只计算左右两个方向
magic = User.GetMagic(Spell.CrossHalfMoon);
if (人数 >=2 && magic != null && magic.BaseCost + magic.LevelCost * magic.Level <= User.MP)
Spell = Spell.CrossHalfMoon;
else
{
Spell = Spell.Thrusting;
}
}