negligible changes
This commit is contained in:
+7
-9
@@ -538,7 +538,7 @@ function App() {
|
|||||||
const anim = attackAnimRef.current
|
const anim = attackAnimRef.current
|
||||||
if (!anim) return
|
if (!anim) return
|
||||||
const startTs = performance.now()
|
const startTs = performance.now()
|
||||||
const hitAt = 0.5
|
const hitAt = 0.12
|
||||||
let hit = false
|
let hit = false
|
||||||
const startPos = combatRef.current?.playerPos ?? { x: 20, y: 75 }
|
const startPos = combatRef.current?.playerPos ?? { x: 20, y: 75 }
|
||||||
const targetEnemy = anim.enemyIndex !== undefined ? combatRef.current?.enemies[anim.enemyIndex] : null
|
const targetEnemy = anim.enemyIndex !== undefined ? combatRef.current?.enemies[anim.enemyIndex] : null
|
||||||
@@ -548,12 +548,10 @@ function App() {
|
|||||||
setCombatTime(ct => ct + 1/60)
|
setCombatTime(ct => ct + 1/60)
|
||||||
|
|
||||||
let lerp
|
let lerp
|
||||||
if (elapsed < 0.3) {
|
if (elapsed < hitAt) {
|
||||||
lerp = elapsed / 0.3
|
lerp = elapsed / hitAt
|
||||||
} else if (elapsed < 0.5) {
|
} else if (elapsed < 0.25) {
|
||||||
lerp = 1
|
lerp = 1 - (elapsed - hitAt) / (0.25 - hitAt)
|
||||||
} else if (elapsed < 0.8) {
|
|
||||||
lerp = 1 - (elapsed - 0.5) / 0.3
|
|
||||||
} else {
|
} else {
|
||||||
lerp = 0
|
lerp = 0
|
||||||
}
|
}
|
||||||
@@ -618,7 +616,7 @@ function App() {
|
|||||||
setBodyParts(finalPlayerParts)
|
setBodyParts(finalPlayerParts)
|
||||||
setBodyInjuries(finalPlayerInjuries)
|
setBodyInjuries(finalPlayerInjuries)
|
||||||
}
|
}
|
||||||
if (elapsed >= 1) {
|
if (elapsed >= 0.35) {
|
||||||
setAttackAnim(null)
|
setAttackAnim(null)
|
||||||
setAttackLerp(null)
|
setAttackLerp(null)
|
||||||
setHitShake(null)
|
setHitShake(null)
|
||||||
@@ -1013,7 +1011,7 @@ function App() {
|
|||||||
onClick={(e) => { e.stopPropagation(); setTargetEnemy(i); setShowInventory(true); setPanelTarget(i) }} />
|
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 && 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>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user