QA and tune Hanzhong campaign battles

This commit is contained in:
2026-06-27 17:52:35 +09:00
parent f32e0fc61d
commit a114b36286
6 changed files with 206 additions and 122 deletions

View File

@@ -23,6 +23,16 @@ const yizhouReliefSortie = ['liu-bei', 'zhuge-liang', 'huang-zhong', 'wei-yan',
const fuPassSortie = ['liu-bei', 'pang-tong', 'zhuge-liang', 'wei-yan', 'huang-zhong', 'zhao-yun'];
const luoOuterSortie = ['liu-bei', 'fa-zheng', 'zhuge-liang', 'huang-zhong', 'zhao-yun', 'mi-zhu'];
const luofengSortie = ['liu-bei', 'pang-tong', 'wu-yi', 'fa-zheng', 'zhao-yun', 'huang-zhong'];
const luoMainSortie = ['liu-bei', 'pang-tong', 'fa-zheng', 'wu-yi', 'huang-zhong', 'zhang-fei'];
const mianzhuSortie = ['liu-bei', 'yan-yan', 'fa-zheng', 'wu-yi', 'pang-tong', 'huang-zhong'];
const chengduSortie = ['liu-bei', 'li-yan', 'zhuge-liang', 'fa-zheng', 'yan-yan', 'wu-yi'];
const jiamengSortie = ['liu-bei', 'huang-quan', 'zhao-yun', 'zhang-fei', 'fa-zheng', 'huang-zhong'];
const yangpingSortie = ['liu-bei', 'ma-chao', 'huang-quan', 'zhuge-liang', 'zhao-yun', 'fa-zheng'];
const dingjunSortie = ['liu-bei', 'huang-zhong', 'fa-zheng', 'ma-chao', 'ma-dai', 'mi-zhu'];
const hanzhongSortie = ['liu-bei', 'huang-zhong', 'fa-zheng', 'wang-ping', 'ma-chao', 'ma-dai', 'zhuge-liang'];
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 earlyCampaignBattles = [
{ no: 1, id: 'first-battle-zhuo-commandery', selected: [], targets: ['rebel-leader'], protected: ['liu-bei'] },
@@ -237,6 +247,79 @@ const southernCampaignBattles = [
}
];
const hanzhongCampaignBattles = [
{
no: 31,
id: 'thirty-first-battle-luo-main-gate',
selected: luoMainSortie,
targets: ['luo-main-leader-zhang-ren'],
protected: ['liu-bei', 'pang-tong']
},
{
no: 32,
id: 'thirty-second-battle-mianzhu-gate',
selected: mianzhuSortie,
targets: ['chengdu-leader-li-yan'],
protected: ['liu-bei', 'yan-yan']
},
{
no: 33,
id: 'thirty-third-battle-chengdu-surrender',
selected: chengduSortie,
targets: ['chengdu-final-leader-huang-quan'],
protected: ['liu-bei', 'li-yan']
},
{
no: 34,
id: 'thirty-fourth-battle-jiameng-pass',
selected: jiamengSortie,
targets: ['jiameng-leader-ma-chao'],
protected: ['liu-bei', 'huang-quan']
},
{
no: 35,
id: 'thirty-fifth-battle-yangping-scout',
selected: yangpingSortie,
targets: ['yangping-leader-zhang-wei'],
protected: ['liu-bei', 'ma-chao']
},
{
no: 36,
id: 'thirty-sixth-battle-dingjun-vanguard',
selected: dingjunSortie,
targets: ['dingjun-leader-xiahou-yuan'],
protected: ['liu-bei', 'huang-zhong']
},
{
no: 37,
id: 'thirty-seventh-battle-hanzhong-decisive',
selected: hanzhongSortie,
targets: ['hanzhong-leader-cao-cao'],
protected: ['liu-bei', 'wang-ping']
},
{
no: 38,
id: 'thirty-eighth-battle-jing-defense',
selected: jingDefenseSortie,
targets: ['jing-defense-leader-lu-meng'],
protected: ['liu-bei', 'guan-yu']
},
{
no: 39,
id: 'thirty-ninth-battle-fan-castle-vanguard',
selected: fanCastleVanguardSortie,
targets: ['fan-castle-leader-pang-de'],
protected: ['liu-bei', 'guan-yu']
},
{
no: 40,
id: 'fortieth-battle-han-river-flood',
selected: hanRiverFloodSortie,
targets: ['han-river-leader-yu-jin'],
protected: ['liu-bei', 'guan-yu']
}
];
const allRepresentativeBattles = [
{ no: 1, id: 'first-battle-zhuo-commandery', selected: [], targets: ['rebel-leader'], protected: ['liu-bei'] },
{
@@ -301,7 +384,8 @@ const qaBattleSets = {
representative: allRepresentativeBattles,
early: earlyCampaignBattles,
refuge: refugeCampaignBattles,
southern: southernCampaignBattles
southern: southernCampaignBattles,
hanzhong: hanzhongCampaignBattles
};
const qaSetName = process.env.QA_SET ?? 'representative';
const qaBattleSet = qaBattleSets[qaSetName];

View File

@@ -4457,7 +4457,7 @@ try {
!dingjunSortieState.sortieRoster?.some((unit) => unit.id === 'fa-zheng' && unit.recruited && unit.recommended) ||
!dingjunSortieState.sortieRoster?.some((unit) => unit.id === 'ma-chao' && unit.recruited && unit.recommended) ||
!dingjunSortieState.sortieRoster?.some((unit) => unit.id === 'ma-dai' && unit.recruited && unit.recommended) ||
!dingjunSortieState.sortieRoster?.some((unit) => unit.id === 'zhuge-liang' && unit.recruited && unit.recommended) ||
!dingjunSortieState.sortieRoster?.some((unit) => unit.id === 'mi-zhu' && unit.recruited && unit.recommended) ||
dingjunSortieState.sortieRoster?.some((unit) => unit.id === 'wang-ping') ||
dingjunSortieState.sortieRoster?.length < 21 ||
dingjunSortieState.sortiePlan?.maxCount !== 6
@@ -4488,7 +4488,7 @@ try {
'ma-dai'
]);
const dingjunPriorityUnits = ['huang-zhong', 'fa-zheng', 'ma-chao', 'ma-dai', 'zhuge-liang'];
const dingjunPriorityUnits = ['huang-zhong', 'fa-zheng', 'ma-chao', 'ma-dai', 'mi-zhu'];
for (const unitId of dingjunPriorityUnits) {
const currentSortieState = await page.evaluate(() => window.__HEROS_DEBUG__?.camp());
if (!currentSortieState.sortieRoster?.some((unit) => unit.id === unitId && unit.selected)) {
@@ -4510,7 +4510,7 @@ try {
dingjunSortieReadyState.sortiePlan?.selectedCount !== 6 ||
dingjunSortieReadyState.sortiePlan?.recommendedSelectedCount < 6
) {
throw new Error(`Expected Dingjun sortie to deploy Huang Zhong, Fa Zheng, Ma Chao, Ma Dai, and Zhuge Liang while preserving six-officer pressure: ${JSON.stringify(dingjunSortieReadyState)}`);
throw new Error(`Expected Dingjun sortie to deploy Huang Zhong, Fa Zheng, Ma Chao, Ma Dai, and Mi Zhu while preserving six-officer pressure: ${JSON.stringify(dingjunSortieReadyState)}`);
}
await page.screenshot({ path: 'dist/verification-dingjun-sortie.png', fullPage: true });
@@ -4553,7 +4553,7 @@ try {
!thirtySixthAllies.some((unit) => unit.id === 'fa-zheng') ||
!thirtySixthAllies.some((unit) => unit.id === 'ma-chao') ||
!thirtySixthAllies.some((unit) => unit.id === 'ma-dai') ||
!thirtySixthAllies.some((unit) => unit.id === 'zhuge-liang') ||
!thirtySixthAllies.some((unit) => unit.id === 'mi-zhu') ||
!unitUsesTexture(thirtySixthBattleState, 'dingjun-officer-wang-ping', 'unit-wang-ping') ||
!unitUsesTexture(thirtySixthBattleState, 'huang-zhong', 'unit-huang-zhong') ||
!unitUsesTexture(thirtySixthBattleState, 'fa-zheng', 'unit-fa-zheng') ||