feat(combat): 下劈弹跳完善——可破坏物可弹跳+独立弹跳力+下劈保留空中操控

- HitBox 新增 OnBreakableHitConfirmed:命中 IBreakable 也发命中确认,
  下劈打可破坏物同样弹跳;不走 OnHitConfirmed,灵力仍只来自敌人
- 新增 PogoBounceForce 配置(默认 15,略低于 JumpForce=18)+
  PlayerMovement.PogoBounce(),弹跳高度独立可调、固定不可截断
- DownAttackState 增加 OnStateFixedUpdate:下劈期间保留完整空中
  水平操控(含与 FallState 同款贴墙保护)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-12 09:51:17 +08:00
parent 3bafc4cbaa
commit 8515dfa7ab
6 changed files with 63 additions and 4 deletions

View File

@@ -58,10 +58,10 @@ namespace BaseGames.Player.States
{
if (_hasHitEnemy) return;
_hasHitEnemy = true;
// Pogo 弹跳:命中敌人后向上弹起,同时重置空中能力(等同落地效果)
// Pogo 弹跳:命中后向上弹起(独立弹跳力,略矮于满跳),同时重置空中能力(等同落地效果)
Owner.ResetAirJumps();
Owner.GetState<DashState>()?.ResetDashCharge();
Move.Jump();
Move.PogoBounce();
}
public override void OnStateUpdate()
@@ -73,6 +73,25 @@ namespace BaseGames.Player.States
}
}
public override void OnStateFixedUpdate()
{
// 下劈期间保留完整空中水平操控(与 FallState 同款贴墙保护,防止压墙摩擦/卡角)
if (Mathf.Abs(Input.MoveInput.x) > 0.01f)
{
int inputDir = Input.MoveInput.x > 0 ? 1 : -1;
var wd = Owner.WallDetector;
bool currentFrameWall = inputDir > 0 ? Move.IsWallRight : Move.IsWallLeft;
if (currentFrameWall
|| (wd != null && (wd.IsTouchingWall && wd.WallDirection == inputDir
|| wd.HasPartialContact(inputDir))))
Move.ZeroHorizontalVelocity();
else
Move.Move(Input.MoveInput.x * Cfg.RunSpeed);
}
else
Move.ZeroHorizontalVelocity();
}
private void OnClipEnd()
{
if (_exited) return;