Add third campaign battle path

This commit is contained in:
2026-06-22 23:22:51 +09:00
parent e06b8dab58
commit 68e1b10cb4
10 changed files with 650 additions and 23 deletions

View File

@@ -51,6 +51,17 @@ const unitTexture: Record<string, string> = {
'pursuit-leader-han-seok': 'unit-rebel-leader'
};
const unitTextureByClass: Partial<Record<UnitClassKey, string>> = {
lord: 'unit-liu-bei',
infantry: 'unit-guan-yu',
spearman: 'unit-zhang-fei',
archer: 'unit-rebel-archer',
cavalry: 'unit-rebel-cavalry',
bandit: 'unit-rebel',
yellowTurban: 'unit-rebel',
rebelLeader: 'unit-rebel-leader'
};
const unitFrameRows: Record<UnitDirection, number> = {
south: 0,
east: 1,
@@ -806,7 +817,7 @@ export class BattleScene extends Phaser.Scene {
private drawUnits() {
battleUnits.forEach((unit) => {
const sizeRatio = unit.faction === 'ally' ? 1.16 : 1.1;
const textureBase = unitTexture[unit.id] ?? 'unit-rebel';
const textureBase = unitTexture[unit.id] ?? unitTextureByClass[unit.classKey] ?? 'unit-rebel';
const sprite = this.add.sprite(this.tileCenterX(unit.x), this.tileCenterY(unit.y), textureBase, this.unitFrameIndex('south'));
sprite.setName(`unit-${unit.id}`);
sprite.setDisplaySize(this.layout.tileSize * sizeRatio, this.layout.tileSize * sizeRatio);