QA and tune Yiling campaign battles

This commit is contained in:
2026-06-27 22:47:56 +09:00
parent a114b36286
commit d1dbc66e61
3 changed files with 215 additions and 14 deletions

View File

@@ -33,6 +33,16 @@ const hanzhongSortie = ['liu-bei', 'huang-zhong', 'fa-zheng', 'wang-ping', 'ma-c
const jingDefenseSortie = ['liu-bei', 'guan-yu', 'zhang-fei', 'ma-liang', 'mi-zhu', 'zhuge-liang', 'zhao-yun'];
const fanCastleVanguardSortie = ['liu-bei', 'guan-yu', 'zhang-fei', 'zhao-yun', 'huang-zhong', 'fa-zheng', 'ma-liang'];
const hanRiverFloodSortie = ['liu-bei', 'guan-yu', 'fa-zheng', 'ma-liang', 'huang-quan', 'zhao-yun', 'ma-chao'];
const fanCastleSiegeSortie = ['liu-bei', 'guan-yu', 'huang-zhong', 'ma-liang', 'fa-zheng', 'zhao-yun', 'ma-chao'];
const jingRearSortie = ['liu-bei', 'guan-yu', 'ma-liang', 'mi-zhu', 'zhao-yun', 'huang-quan', 'wang-ping'];
const gonganCollapseSortie = ['liu-bei', 'guan-yu', 'ma-liang', 'mi-zhu', 'huang-quan', 'wang-ping', 'zhao-yun'];
const maichengSortie = ['liu-bei', 'guan-yu', 'wang-ping', 'zhao-yun', 'huang-zhong', 'ma-dai', 'ma-liang'];
const yilingVanguardSortie = ['liu-bei', 'zhang-fei', 'zhao-yun', 'ma-chao', 'zhuge-liang', 'huang-quan', 'ma-liang'];
const yilingFireSortie = ['liu-bei', 'huang-quan', 'zhuge-liang', 'ma-liang', 'zhao-yun', 'wang-ping', 'ma-chao'];
const nanzhongStabilizationSortie = ['zhuge-liang', 'zhao-yun', 'wang-ping', 'ma-liang', 'huang-quan', 'huang-zhong', 'ma-chao'];
const mengHuoMainSortie = ['zhuge-liang', 'ma-liang', 'wang-ping', 'huang-quan', 'zhao-yun', 'ma-chao', 'huang-zhong'];
const mengHuoSecondSortie = ['zhuge-liang', 'huang-quan', 'wang-ping', 'ma-liang', 'zhao-yun', 'huang-zhong', 'ma-chao'];
const mengHuoThirdSortie = ['zhuge-liang', 'ma-liang', 'huang-quan', 'wang-ping', 'zhao-yun', 'ma-chao', 'huang-zhong'];
const earlyCampaignBattles = [
{ no: 1, id: 'first-battle-zhuo-commandery', selected: [], targets: ['rebel-leader'], protected: ['liu-bei'] },
@@ -320,6 +330,79 @@ const hanzhongCampaignBattles = [
}
];
const yilingCampaignBattles = [
{
no: 41,
id: 'forty-first-battle-fan-castle-siege',
selected: fanCastleSiegeSortie,
targets: ['fan-siege-leader-cao-ren'],
protected: ['liu-bei', 'guan-yu']
},
{
no: 42,
id: 'forty-second-battle-jing-rear-crisis',
selected: jingRearSortie,
targets: ['jing-rear-leader-lu-meng'],
protected: ['liu-bei', 'guan-yu']
},
{
no: 43,
id: 'forty-third-battle-gongan-collapse',
selected: gonganCollapseSortie,
targets: ['jing-collapse-leader-lu-meng'],
protected: ['liu-bei', 'guan-yu']
},
{
no: 44,
id: 'forty-fourth-battle-maicheng-isolation',
selected: maichengSortie,
targets: ['maicheng-leader-lu-meng'],
protected: ['liu-bei', 'guan-yu']
},
{
no: 45,
id: 'forty-fifth-battle-yiling-vanguard',
selected: yilingVanguardSortie,
targets: ['yiling-leader-lu-xun'],
protected: ['liu-bei']
},
{
no: 46,
id: 'forty-sixth-battle-yiling-fire',
selected: yilingFireSortie,
targets: ['yiling-fire-leader-lu-xun'],
protected: ['liu-bei']
},
{
no: 47,
id: 'forty-seventh-battle-nanzhong-stabilization',
selected: nanzhongStabilizationSortie,
targets: ['nanzhong-leader-yong-kai'],
protected: ['zhuge-liang']
},
{
no: 48,
id: 'forty-eighth-battle-meng-huo-main-force',
selected: mengHuoMainSortie,
targets: ['menghuo-leader'],
protected: ['zhuge-liang']
},
{
no: 49,
id: 'forty-ninth-battle-meng-huo-second-capture',
selected: mengHuoSecondSortie,
targets: ['menghuo-second-leader'],
protected: ['zhuge-liang']
},
{
no: 50,
id: 'fiftieth-battle-meng-huo-third-capture',
selected: mengHuoThirdSortie,
targets: ['menghuo-third-leader'],
protected: ['zhuge-liang']
}
];
const allRepresentativeBattles = [
{ no: 1, id: 'first-battle-zhuo-commandery', selected: [], targets: ['rebel-leader'], protected: ['liu-bei'] },
{
@@ -385,7 +468,8 @@ const qaBattleSets = {
early: earlyCampaignBattles,
refuge: refugeCampaignBattles,
southern: southernCampaignBattles,
hanzhong: hanzhongCampaignBattles
hanzhong: hanzhongCampaignBattles,
yiling: yilingCampaignBattles
};
const qaSetName = process.env.QA_SET ?? 'representative';
const qaBattleSet = qaBattleSets[qaSetName];
@@ -415,8 +499,13 @@ try {
const results = [];
for (const battle of representativeBattles) {
console.log(`QA battle ${battle.no}: ${battle.id}`);
await setupBattle(page, battle);
results.push(await playBattleWithoutDebugVictory(page, battle));
const result = await playBattleWithoutDebugVictory(page, battle);
results.push(result);
console.log(
`QA result ${result.no}: ${result.outcome} turn=${result.finalTurn} allies=${result.alliesAlive} enemies=${result.enemiesAlive} items=${result.itemsUsed} objectives=${result.objectivesAchieved}/${result.objectiveCount}`
);
}
const failed = results.filter((result) => result.outcome !== 'victory');