Validate enemy usable save keys
This commit is contained in:
@@ -15,7 +15,8 @@ try {
|
||||
expectedBattleId: 'first-battle-zhuo-commandery',
|
||||
mapWidth: 12,
|
||||
mapHeight: 8,
|
||||
validUnitIds: new Set(['liu-bei', 'guan-yu', 'rebel-1'])
|
||||
validUnitIds: new Set(['liu-bei', 'guan-yu', 'rebel-1']),
|
||||
validUsableIds: new Set(['roar', 'fireTactic', 'aid'])
|
||||
};
|
||||
const validState = createValidBattleSaveState();
|
||||
const patchUnit = (index, patch) => validState.units.map((unit, unitIndex) => (unitIndex === index ? { ...unit, ...patch } : unit));
|
||||
@@ -57,6 +58,10 @@ try {
|
||||
['invalid stats shape', { battleStats: { 'liu-bei': { damageDealt: 10 } } }],
|
||||
['unknown stats unit id', { battleStats: { 'ghost-unit': validState.battleStats['liu-bei'] } }],
|
||||
['invalid enemy usable keys', { enemyUsableUseKeys: [1] }],
|
||||
['malformed enemy usable key', { enemyUsableUseKeys: ['rebel-1:shout'] }],
|
||||
['wrong battle enemy usable key', { enemyUsableUseKeys: ['other-battle:rebel-1:roar'] }],
|
||||
['unknown enemy usable unit id', { enemyUsableUseKeys: ['first-battle-zhuo-commandery:ghost-unit:roar'] }],
|
||||
['unknown enemy usable id', { enemyUsableUseKeys: ['first-battle-zhuo-commandery:rebel-1:phantom'] }],
|
||||
['invalid triggered events', { triggeredBattleEvents: [1] }]
|
||||
];
|
||||
|
||||
@@ -168,7 +173,7 @@ function createValidBattleSaveState() {
|
||||
support: 0
|
||||
}
|
||||
},
|
||||
enemyUsableUseKeys: ['rebel-1:shout'],
|
||||
enemyUsableUseKeys: ['first-battle-zhuo-commandery:rebel-1:roar'],
|
||||
triggeredBattleEvents: ['first-objective-near']
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user