feat: add signature officer tactics
This commit is contained in:
@@ -38,13 +38,13 @@ try {
|
||||
JSON.stringify(strategyCoverageDefinitions.map(({ id, label, usableId }) => ({ id, label, usableId }))) === JSON.stringify([
|
||||
{ id: 'healing', label: '회복', usableId: 'aid' },
|
||||
{ id: 'buff', label: '강화', usableId: 'encourage' },
|
||||
{ id: 'fire', label: '화공', usableId: 'fireTactic' },
|
||||
{ id: 'offense', label: '공격', usableId: 'fireTactic' },
|
||||
{ id: 'control', label: '제어', usableId: 'roar' }
|
||||
]),
|
||||
`Expected the four sortie strategy coverage roles to remain stable: ${JSON.stringify(strategyCoverageDefinitions)}`
|
||||
);
|
||||
assert(
|
||||
JSON.stringify(getUnitStrategyNames(['liu-bei'])) === JSON.stringify(['응급', '격려']),
|
||||
JSON.stringify(getUnitStrategyNames(['liu-bei'])) === JSON.stringify(['응급', '인덕의 호령']),
|
||||
`Expected Liu Bei's strategy names to be visible before sortie: ${JSON.stringify(getUnitStrategyNames(['liu-bei']))}`
|
||||
);
|
||||
const brotherStrategyCoverage = getUnitStrategyCoverage(['liu-bei', 'guan-yu', 'zhang-fei', 'liu-bei']);
|
||||
@@ -54,22 +54,22 @@ try {
|
||||
brotherStrategyCoverage.missing.length === 0,
|
||||
`Expected the three brothers to cover healing, buff, attack, and control: ${JSON.stringify(brotherStrategyCoverage)}`
|
||||
);
|
||||
const noFireStrategyCoverage = getUnitStrategyCoverage(['liu-bei', 'zhang-fei', 'unknown-unit']);
|
||||
const noOffenseStrategyCoverage = getUnitStrategyCoverage(['liu-bei', 'unknown-unit']);
|
||||
assert(
|
||||
noFireStrategyCoverage.count === 3 &&
|
||||
noFireStrategyCoverage.missing.length === 1 &&
|
||||
noFireStrategyCoverage.missing[0]?.id === 'fire',
|
||||
`Expected removing Guan Yu to expose the missing fire-tactic role: ${JSON.stringify(noFireStrategyCoverage)}`
|
||||
noOffenseStrategyCoverage.count === 2 &&
|
||||
noOffenseStrategyCoverage.missing.length === 2 &&
|
||||
noOffenseStrategyCoverage.missing.some((definition) => definition.id === 'offense') &&
|
||||
noOffenseStrategyCoverage.missing.some((definition) => definition.id === 'control'),
|
||||
`Expected Liu Bei alone to leave offense and control uncovered: ${JSON.stringify(noOffenseStrategyCoverage)}`
|
||||
);
|
||||
const evenStrategyTrade = compareUnitStrategyCoverage(['liu-bei', 'guan-yu'], ['liu-bei', 'zhang-fei']);
|
||||
const controlStrategyGain = compareUnitStrategyCoverage(['liu-bei', 'guan-yu'], ['liu-bei', 'zhang-fei']);
|
||||
assert(
|
||||
evenStrategyTrade.delta === 0 &&
|
||||
evenStrategyTrade.trend === 'even' &&
|
||||
evenStrategyTrade.gained.length === 1 &&
|
||||
evenStrategyTrade.gained[0]?.id === 'control' &&
|
||||
evenStrategyTrade.lost.length === 1 &&
|
||||
evenStrategyTrade.lost[0]?.id === 'fire',
|
||||
`Expected exchanging fire tactics for control at equal coverage to remain a neutral trade: ${JSON.stringify(evenStrategyTrade)}`
|
||||
controlStrategyGain.delta === 1 &&
|
||||
controlStrategyGain.trend === 'gain' &&
|
||||
controlStrategyGain.gained.length === 1 &&
|
||||
controlStrategyGain.gained[0]?.id === 'control' &&
|
||||
controlStrategyGain.lost.length === 0,
|
||||
`Expected Zhang Fei's signature control to add coverage while preserving offense: ${JSON.stringify(controlStrategyGain)}`
|
||||
);
|
||||
const unknownStrategyIds = Object.entries(unitStrategyIds)
|
||||
.flatMap(([unitId, strategyIds]) => strategyIds.map((strategyId) => ({ unitId, strategyId })))
|
||||
|
||||
Reference in New Issue
Block a user