diff --git a/src/App.jsx b/src/App.jsx index 8c81a99..613d555 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -538,7 +538,7 @@ function App() { const anim = attackAnimRef.current if (!anim) return const startTs = performance.now() - const hitAt = 0.5 + const hitAt = 0.12 let hit = false const startPos = combatRef.current?.playerPos ?? { x: 20, y: 75 } const targetEnemy = anim.enemyIndex !== undefined ? combatRef.current?.enemies[anim.enemyIndex] : null @@ -548,12 +548,10 @@ function App() { setCombatTime(ct => ct + 1/60) let lerp - if (elapsed < 0.3) { - lerp = elapsed / 0.3 - } else if (elapsed < 0.5) { - lerp = 1 - } else if (elapsed < 0.8) { - lerp = 1 - (elapsed - 0.5) / 0.3 + if (elapsed < hitAt) { + lerp = elapsed / hitAt + } else if (elapsed < 0.25) { + lerp = 1 - (elapsed - hitAt) / (0.25 - hitAt) } else { lerp = 0 } @@ -618,7 +616,7 @@ function App() { setBodyParts(finalPlayerParts) setBodyInjuries(finalPlayerInjuries) } - if (elapsed >= 1) { + if (elapsed >= 0.35) { setAttackAnim(null) setAttackLerp(null) setHitShake(null) @@ -1013,7 +1011,7 @@ function App() { onClick={(e) => { e.stopPropagation(); setTargetEnemy(i); setShowInventory(true); setPanelTarget(i) }} /> ))} {combat && selectedSkill && limbSelect && } - {combat && } + {combat && }