Polish early sortie flow guidance
This commit is contained in:
@@ -12439,6 +12439,26 @@ export class CampScene extends Phaser.Scene {
|
||||
return score > 0 ? '주의' : '미정';
|
||||
}
|
||||
|
||||
private sortieRecoveryTargets(thresholdRatio = 0.7) {
|
||||
return this.currentUnits()
|
||||
.filter((unit) => unit.faction === 'ally' && unit.hp > 0 && unit.maxHp > 0 && unit.hp / unit.maxHp < thresholdRatio)
|
||||
.sort((a, b) => a.hp / a.maxHp - b.hp / b.maxHp || a.name.localeCompare(b.name));
|
||||
}
|
||||
|
||||
private sortieRecoveryHint() {
|
||||
const targets = this.sortieRecoveryTargets();
|
||||
if (targets.length === 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const names = targets.slice(0, 2).map((unit) => `${unit.name} ${unit.hp}/${unit.maxHp}`).join(', ');
|
||||
const extra = targets.length > 2 ? ` 외 ${targets.length - 2}명` : '';
|
||||
const supplyCount = campSupplies.reduce((total, supply) => total + this.inventoryAmount(supply.label), 0);
|
||||
const assignedSupplyCount = campSupplies.reduce((total, supply) => total + this.totalAssignedSupplyCount(supply.usableId), 0);
|
||||
const supplyText = supplyCount > 0 ? `보급 ${assignedSupplyCount}/${supplyCount}` : '보급 없음';
|
||||
return `정비: ${names}${extra} 회복 권장 · ${supplyText}`;
|
||||
}
|
||||
|
||||
private renderSortieRewardHint(x: number, y: number, width: number, height: number, depth: number) {
|
||||
const bg = this.trackSortie(this.add.rectangle(x, y, width, height, 0x151f2a, 0.9));
|
||||
bg.setOrigin(0);
|
||||
@@ -12458,18 +12478,20 @@ export class CampScene extends Phaser.Scene {
|
||||
const inventorySummary = `보급 ${assignedSupplyCount}/${supplyCount} · 장비 ${equipmentCount} · 기록 ${recordCount}`;
|
||||
const reward = this.currentSortieFlow().rewardHint;
|
||||
const sortieNote = this.nextSortieRule().note;
|
||||
const recoveryHint = this.sortieRecoveryHint();
|
||||
const readyLine = [
|
||||
`대화 ${completedDialogues}/${availableDialogues.length}`,
|
||||
`방문 ${completedVisits}/${availableVisits.length}`,
|
||||
`출전 ${selectedSummary}`,
|
||||
`보유 ${inventorySummary}`
|
||||
].join(' · ');
|
||||
const rewardLine = recoveryHint ? `${reward} · ${recoveryHint}` : `${reward} · ${readyLine}`;
|
||||
this.trackSortie(this.add.text(x + 16, y + 9, this.compactText(`편성 메모: ${sortieNote}`, 42), this.textStyle(13, '#f2e3bf', true))).setDepth(depth + 1);
|
||||
this.trackSortie(
|
||||
this.add.text(
|
||||
x + 16,
|
||||
y + 30,
|
||||
this.compactText(`${reward} · ${readyLine}`, 48),
|
||||
this.compactText(rewardLine, 48),
|
||||
this.textStyle(12, '#d4dce6')
|
||||
)
|
||||
).setDepth(depth + 1);
|
||||
@@ -12562,7 +12584,13 @@ export class CampScene extends Phaser.Scene {
|
||||
const requiredDetail = requiredUnits.length > 0
|
||||
? requiredUnits.map((unit) => `${unit.name} ${unit.hp}/${unit.maxHp}`).join(', ')
|
||||
: '필수 무장 없음';
|
||||
const injured = units.filter((unit) => unit.hp < unit.maxHp);
|
||||
const injured = units.filter((unit) => unit.hp > 0 && unit.hp < unit.maxHp);
|
||||
const recoveryTargets = this.sortieRecoveryTargets();
|
||||
const recoveryDetail = recoveryTargets.length > 0
|
||||
? `${recoveryTargets.map((unit) => `${unit.name} ${unit.hp}/${unit.maxHp}`).join(', ')} 회복 권장`
|
||||
: injured.length > 0
|
||||
? `${injured.length}명 경상 · 출전 가능`
|
||||
: '전원 완전한 병력';
|
||||
const supplyCount = campSupplies.reduce((total, supply) => total + this.inventoryAmount(supply.label), 0);
|
||||
const assignedSupplyCount = campSupplies.reduce((total, supply) => total + this.totalAssignedSupplyCount(supply.usableId), 0);
|
||||
const availableDialogues = this.availableCampDialogues();
|
||||
@@ -12589,8 +12617,8 @@ export class CampScene extends Phaser.Scene {
|
||||
},
|
||||
{
|
||||
label: '부상 장수 확인',
|
||||
complete: injured.length === 0,
|
||||
detail: injured.length === 0 ? '전원 완전한 병력' : `${injured.map((unit) => unit.name).join(', ')} 회복 권장`,
|
||||
complete: recoveryTargets.length === 0,
|
||||
detail: recoveryDetail,
|
||||
priority: 'recommended'
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user