做不出来
This commit is contained in:
@@ -160,26 +160,26 @@ namespace Cielonos.MainGame
|
||||
#region TimeSubmodule
|
||||
public T SetTimeSubmodule<T>(float lifeTime) where T : AttackAreaBase
|
||||
{
|
||||
timeSm = new TimeSubmodule(this, lifeTime);
|
||||
float graceBefore = targetFractions.Contains(Fraction.Player) ? 0.1f : 0f;
|
||||
timeSm = new TimeSubmodule(this, lifeTime, 0f, 0.04f, null, null, graceBefore);
|
||||
return this as T;
|
||||
}
|
||||
|
||||
public T SetTimeSubmodule<T>(float lifeTime, float delayTime, float enableTime = 0.04f,
|
||||
Action enableAction = null, Action timeOutAction = null) where T : AttackAreaBase
|
||||
{
|
||||
timeSm = new TimeSubmodule(this, lifeTime, delayTime, enableTime, enableAction, timeOutAction);
|
||||
return this as T;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置带反应 grace window 的时间子模块。graceBefore/graceAfter 为 0 时行为与无 grace window 一致。
|
||||
/// 设置带反应 grace window 的时间子模块。graceBefore 为 0 时行为与无 grace window 一致。
|
||||
/// </summary>
|
||||
public T SetTimeSubmodule<T>(float lifeTime, float delayTime, float enableTime,
|
||||
Action enableAction, Action timeOutAction, float graceBefore) where T : AttackAreaBase
|
||||
public T SetTimeSubmodule<T>(float lifeTime, float delayTime, float enableTime = 0.04f,
|
||||
Action enableAction = null, Action timeOutAction = null, float graceBefore = -1f) where T : AttackAreaBase
|
||||
{
|
||||
if (graceBefore < 0f)
|
||||
{
|
||||
graceBefore = targetFractions.Contains(Fraction.Player) ? 0.1f : 0f;
|
||||
}
|
||||
|
||||
timeSm = new TimeSubmodule(this, lifeTime, delayTime, enableTime, enableAction, timeOutAction, graceBefore);
|
||||
return this as T;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region HitSubmodule
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace Cielonos.MainGame
|
||||
{
|
||||
public void Update()
|
||||
{
|
||||
if (!isEnabling || currentHitIndex >= originalHitCount - 1 || attackArea.timeSm.delayTime > 0)
|
||||
if (!isEnabling || currentHitIndex >= originalHitCount || attackArea.timeSm.delayTime > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ namespace Cielonos.MainGame
|
||||
currentHitIndex++;
|
||||
}
|
||||
|
||||
if (currentHitIndex >= originalHitCount - 1)
|
||||
if (currentHitIndex >= originalHitCount)
|
||||
{
|
||||
attackArea.isEnabling = false;
|
||||
}
|
||||
|
||||
@@ -57,11 +57,11 @@ namespace Cielonos.MainGame
|
||||
}
|
||||
});
|
||||
|
||||
this.reactionGraceBefore = 0.1f;
|
||||
this.reactionGraceBefore = 0f;
|
||||
}
|
||||
|
||||
public TimeSubmodule(AttackAreaBase attackArea, float lifeTime, float delayTime, float enableTime,
|
||||
Action enableAction, Action timeOutAction, float graceBefore = 0.1f) : base(attackArea)
|
||||
Action enableAction, Action timeOutAction, float graceBefore = 0f) : base(attackArea)
|
||||
{
|
||||
this.isEnabling = true;
|
||||
this.lifeTime = lifeTime;
|
||||
@@ -118,6 +118,14 @@ namespace Cielonos.MainGame
|
||||
return true;
|
||||
}
|
||||
|
||||
// 过渡帧桥接:delay 刚结束(delayTime 被扣至 <=0),但 enable 阶段尚未在下一帧
|
||||
// 的 timeSm.Update() 中激活。此帧 isEnabling 为 false 且 delayTime 不再 >0,
|
||||
// 若不补此条件会导致 1 帧的反应窗口真空,玩家的完美闪避/格挡可能被跳过。
|
||||
if (reactionGraceBefore > 0f && delayTime <= 0f && !hasInvokedEnableAction)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user