Passion & UI
This commit is contained in:
@@ -21,7 +21,8 @@ namespace Cielonos.MainGame
|
||||
|
||||
public override void HitCharacter(Collider characterCollider, Vector3 hitPosition)
|
||||
{
|
||||
if (!isEnabling)
|
||||
// 既不在伤害阶段也不在反应窗口,直接跳过
|
||||
if (!isEnabling && !isReactionActive)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -30,13 +31,33 @@ namespace Cielonos.MainGame
|
||||
|
||||
if (!IsValidTarget(targetCharacter)) return;
|
||||
|
||||
// 已在 grace window 期间成功反应的目标不再处理
|
||||
if (reactedTargets.Contains(targetCharacter.gameObject))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (hitSm.checkedObjects.Contains(targetCharacter.gameObject))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
hitSm.AddCheckedObject(targetCharacter.gameObject);
|
||||
|
||||
// 仅在反应窗口内(enable 阶段之前或之后),只做反应检测
|
||||
if (!isEnabling && isReactionActive)
|
||||
{
|
||||
HitOnTarget(characterCollider, areaCollider.ClosestPoint(targetCharacter.CenterPoint.position),
|
||||
out Attack.Result graceResult, onlyCheckReaction: true);
|
||||
if (graceResult.isBlocked || graceResult.isDodged)
|
||||
{
|
||||
reactedTargets.Add(targetCharacter.gameObject);
|
||||
hitSm.AddCheckedObject(targetCharacter.gameObject);
|
||||
Debug.Log($"[NormalArea] Target {targetCharacter.name} successfully reacted during grace window. Blocked: {graceResult.isBlocked}, Dodged: {graceResult.isDodged}");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 正常 enable 阶段:造成伤害
|
||||
hitSm.AddCheckedObject(targetCharacter.gameObject);
|
||||
HitOnTarget(characterCollider, areaCollider.ClosestPoint(targetCharacter.CenterPoint.position), out _);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user