negligible changes
This commit is contained in:
+7
-9
@@ -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 && <circle cx={combat.playerPos.x} cy={combat.playerPos.y} r={getSkillRange(limbSelect, selectedSkill)} fill="none" stroke="rgba(52,152,219,0.5)" strokeWidth="1" strokeDasharray="4 4" />}
|
||||
{combat && <circle cx={combat.playerPos.x} cy={combat.playerPos.y} r="4" fill="#3498db" stroke="#000" strokeWidth="0.5" />}
|
||||
{combat && <circle cx={attackLerp ? attackLerp.from.x + (attackLerp.to.x - attackLerp.from.x) * attackLerp.t : combat.playerPos.x} cy={attackLerp ? attackLerp.from.y + (attackLerp.to.y - attackLerp.from.y) * attackLerp.t : combat.playerPos.y} r="4" fill="#3498db" stroke="#000" strokeWidth="0.5" />}
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user