Show sortie recommendation feedback

This commit is contained in:
2026-07-05 05:22:34 +09:00
parent 9dd2721121
commit 589c7ca972

View File

@@ -10726,6 +10726,7 @@ export class CampScene extends Phaser.Scene {
private sortieItemAssignments: CampaignSortieItemAssignments = {};
private sortieFocusedUnitId = 'liu-bei';
private sortieRosterScroll = 0;
private sortiePlanFeedback = '';
private terrainCountCache = new Map<BattleScenarioId, SortieTerrainCounts>();
private openSortiePrepOnCreate = false;
private skipIntroStoryForSortie = false;
@@ -12567,12 +12568,13 @@ export class CampScene extends Phaser.Scene {
this.renderSortieDeploymentMap(x + 16, y + 58, width - 32, 62, depth + 1);
this.renderSortieSlotCards(x + 16, y + 126, width - 32, 104, plan, depth + 1);
const planFeedback = this.sortiePlanFeedback || plan.warningLine;
this.trackSortie(
this.add.text(
x + 16,
y + 236,
this.compactText(plan.warningLine, 43),
this.textStyle(11, plan.warnings.length > 0 ? '#ffdf7b' : '#a8ffd0', true)
this.compactText(planFeedback, 43),
this.textStyle(11, this.sortiePlanFeedback ? '#a8ffd0' : plan.warnings.length > 0 ? '#ffdf7b' : '#a8ffd0', true)
)
).setDepth(depth + 1);
@@ -13343,6 +13345,8 @@ export class CampScene extends Phaser.Scene {
...this.sortieFormationAssignments,
[unit.id]: role
};
const roleLabel = sortieFormationSlotDefinitions.find((slot) => slot.role === role)?.label ?? '예비';
this.sortiePlanFeedback = `${unit.name} 역할 변경 · ${roleLabel}`;
this.persistSortieSelection();
soundDirector.playSelect();
this.showSortiePrep();
@@ -13389,12 +13393,26 @@ export class CampScene extends Phaser.Scene {
this.selectedSortieUnitIds = nextSelectedIds;
this.sortieFormationAssignments = this.normalizedSortieFormationAssignments(nextAssignments);
this.sortieFocusedUnitId = nextSelectedIds[0] ?? this.sortieFocusedUnitId;
this.sortiePlanFeedback = this.recommendedSortieFeedback(nextSelectedIds, nextAssignments);
this.persistSortieSelection();
soundDirector.playSelect();
this.showCampNotice(`추천 편성 적용: ${nextSelectedIds.map((id) => this.unitName(id)).join(', ')}`);
this.showSortiePrep();
}
private recommendedSortieFeedback(unitIds: string[], assignments: SortieFormationAssignments) {
const roleCounts = unitIds.reduce(
(counts, unitId) => {
counts[assignments[unitId] ?? 'reserve'] += 1;
return counts;
},
{ front: 0, flank: 0, support: 0, reserve: 0 } as Record<SortieFormationRole, number>
);
const names = unitIds.slice(0, 3).map((id) => this.unitName(id)).join(', ');
const extra = unitIds.length > 3 ? `${unitIds.length - 3}` : '';
return `추천 편성 적용 · ${names}${extra} · 전열 ${roleCounts.front} / 돌파 ${roleCounts.flank} / 후원 ${roleCounts.support}`;
}
private sortieTerrainScore(unit: UnitData, scenario: BattleScenarioDefinition | undefined) {
if (!scenario) {
return 100;
@@ -15029,6 +15047,9 @@ export class CampScene extends Phaser.Scene {
}
this.selectedSortieUnitIds = this.normalizedSortieUnitIds(Array.from(selected));
this.sortiePlanFeedback = selected.has(unitId)
? `${unit.name} 출전 추가 · 직접 편성 중`
: `${unit.name} 출전 해제 · 직접 편성 중`;
this.persistSortieSelection();
soundDirector.playSelect();
this.showSortiePrep();