Prepare battle scenario progression foundations
This commit is contained in:
@@ -9,8 +9,27 @@ import {
|
||||
type UnitData
|
||||
} from './scenario';
|
||||
|
||||
export type BattleScenarioDefinition = {
|
||||
export type BattleScenarioId = 'first-battle-zhuo-commandery';
|
||||
|
||||
export type BattleObjectiveKind = 'defeat-leader' | 'keep-unit-alive' | 'secure-terrain' | 'quick-victory';
|
||||
|
||||
export type BattleObjectiveDefinition = {
|
||||
id: string;
|
||||
kind: BattleObjectiveKind;
|
||||
label: string;
|
||||
rewardGold: number;
|
||||
unitId?: string;
|
||||
terrain?: string;
|
||||
maxTurn?: number;
|
||||
};
|
||||
|
||||
export type BattleDefeatConditionDefinition = {
|
||||
kind: 'unit-defeated';
|
||||
unitId: string;
|
||||
};
|
||||
|
||||
export type BattleScenarioDefinition = {
|
||||
id: BattleScenarioId;
|
||||
title: string;
|
||||
map: BattleMap;
|
||||
units: UnitData[];
|
||||
@@ -19,6 +38,8 @@ export type BattleScenarioDefinition = {
|
||||
leaderUnitId: string;
|
||||
quickVictoryTurnLimit: number;
|
||||
baseVictoryGold: number;
|
||||
objectives: BattleObjectiveDefinition[];
|
||||
defeatConditions: BattleDefeatConditionDefinition[];
|
||||
itemRewards: string[];
|
||||
victoryPages: StoryPage[];
|
||||
nextCampScene: string;
|
||||
@@ -34,7 +55,53 @@ export const firstBattleScenario: BattleScenarioDefinition = {
|
||||
leaderUnitId: 'rebel-leader',
|
||||
quickVictoryTurnLimit: 8,
|
||||
baseVictoryGold: 300,
|
||||
objectives: [
|
||||
{
|
||||
id: 'leader',
|
||||
kind: 'defeat-leader',
|
||||
label: '황건 두령 격파',
|
||||
rewardGold: 200,
|
||||
unitId: 'rebel-leader'
|
||||
},
|
||||
{
|
||||
id: 'liu-bei',
|
||||
kind: 'keep-unit-alive',
|
||||
label: '유비 생존',
|
||||
rewardGold: 100,
|
||||
unitId: 'liu-bei'
|
||||
},
|
||||
{
|
||||
id: 'village',
|
||||
kind: 'secure-terrain',
|
||||
label: '마을 확보',
|
||||
rewardGold: 150,
|
||||
terrain: 'village'
|
||||
},
|
||||
{
|
||||
id: 'quick',
|
||||
kind: 'quick-victory',
|
||||
label: '8턴 안에 승리',
|
||||
rewardGold: 120,
|
||||
maxTurn: 8
|
||||
}
|
||||
],
|
||||
defeatConditions: [{ kind: 'unit-defeated', unitId: 'liu-bei' }],
|
||||
itemRewards: ['콩 1', '탁주 1', '의용군 명성 +1'],
|
||||
victoryPages: firstBattleVictoryPages,
|
||||
nextCampScene: 'CampScene'
|
||||
};
|
||||
|
||||
export const defaultBattleScenarioId: BattleScenarioId = firstBattleScenario.id;
|
||||
|
||||
export const battleScenarios: Record<BattleScenarioId, BattleScenarioDefinition> = {
|
||||
[firstBattleScenario.id]: firstBattleScenario
|
||||
};
|
||||
|
||||
export const defaultBattleScenario = battleScenarios[defaultBattleScenarioId];
|
||||
|
||||
export function getBattleScenario(id: string | undefined) {
|
||||
if (id && id in battleScenarios) {
|
||||
return battleScenarios[id as BattleScenarioId];
|
||||
}
|
||||
return defaultBattleScenario;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user