Improve handpainted battle unit readability

This commit is contained in:
2026-06-30 22:18:34 +09:00
parent 6eb3f029c3
commit 3092b295e6
101 changed files with 1405 additions and 16 deletions

View File

@@ -3200,7 +3200,7 @@ export class BattleScene extends Phaser.Scene {
private drawUnits() {
battleUnits.forEach((unit) => {
const sizeRatio = unit.faction === 'ally' ? 1.32 : 1.24;
const sizeRatio = this.unitDisplaySizeRatio(unit);
const textureBase = this.unitTextureKey(unit);
const centerX = this.tileCenterX(unit.x);
const centerY = this.tileCenterY(unit.y);
@@ -3243,6 +3243,11 @@ export class BattleScene extends Phaser.Scene {
});
}
private unitDisplaySizeRatio(unit: UnitData) {
const baseRatio = unit.faction === 'ally' ? 1.32 : 1.24;
return unit.id === 'guan-yu' ? baseRatio * 1.03 : baseRatio;
}
private drawSidePanel() {
const { panelX, panelY, panelWidth, panelHeight } = this.layout;
this.add.rectangle(panelX, panelY, panelWidth, panelHeight, palette.panel, 0.96).setOrigin(0);
@@ -9670,19 +9675,12 @@ export class BattleScene extends Phaser.Scene {
private startUnitIdleMotion(unit: UnitData, view: UnitView, direction: UnitDirection) {
const mounted = this.isMountedUnit(unit);
const seed = this.hashString(unit.id) % 160;
const sway = direction === 'west' ? -1 : 1;
const bob = mounted ? 2.1 : 1.35;
const duration = mounted ? 520 + seed * 0.45 : 880 + seed * 0.8;
const angle = mounted ? 0.45 * sway : 0.65 * sway;
const scaleX = view.baseScaleX * (mounted ? 1.012 : 0.992);
const scaleY = view.baseScaleY * (mounted ? 0.988 : 1.014);
const bob = mounted ? 2.35 : 1.9;
const duration = mounted ? 660 + seed * 0.32 : 900 + seed * 0.5;
view.idleTween = this.tweens.add({
targets: view.sprite,
y: view.baseY - bob,
angle,
scaleX,
scaleY,
duration,
ease: 'Sine.easeInOut',
yoyo: true,