File size: 11,668 Bytes
1c00bf3
10f590d
 
 
 
1c00bf3
 
 
10f590d
 
 
 
1c00bf3
 
 
 
10f590d
1c00bf3
10f590d
 
1c00bf3
 
 
10f590d
1c00bf3
10f590d
 
1c00bf3
 
 
10f590d
1c00bf3
10f590d
 
1c00bf3
 
 
 
 
10f590d
 
 
 
1c00bf3
 
 
10f590d
 
 
 
 
 
 
 
 
 
 
 
1c00bf3
 
 
10f590d
 
 
 
 
 
1c00bf3
 
 
10f590d
 
 
 
 
 
 
 
 
 
 
 
 
 
1c00bf3
 
 
10f590d
 
 
 
 
 
1c00bf3
 
 
 
 
10f590d
 
 
1c00bf3
 
 
 
 
 
 
 
 
 
 
 
 
10f590d
 
 
1c00bf3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
export const TERRAIN = {
  plains:   { label: '平原', bonus: 1.0, glyph: 'plains' },
  forest:   { label: '森林', bonus: 1.2, glyph: 'forest' },
  mountain: { label: '山地', bonus: 1.5, glyph: 'mountain' },
  city:     { label: '城市', bonus: 1.3, glyph: 'city' },
};

export const RESOURCES = {
  gold:  { label: '金幣', short: '金' },
  food:  { label: '糧食', short: '糧' },
  wood:  { label: '木材', short: '木' },
  stone: { label: '石料', short: '石' },
};

export const BUILDINGS = {
  walls: {
    id: 'walls', label: '城牆', icon: '🧱', image: 'assets/images/walls.png',
    cost: { wood: 10, stone: 15 },
    effect: '+0.3 防禦加成',
    blurb: '高聳的城垛與厚重石牆,讓守軍彷彿有大地為盾。',
    accent: '#9aa7b4',
  },
  barracks: {
    id: 'barracks', label: '兵營', icon: '🏛️', image: 'assets/images/barracks.png',
    cost: { wood: 8, stone: 5 },
    effect: '徵兵金幣成本降至 2',
    blurb: '操練場、軍械庫與老練士官,讓新兵更容易成軍。',
    accent: '#c98a4b',
  },
  market: {
    id: 'market', label: '市場', icon: '🏪', image: 'assets/images/market.png',
    cost: { gold: 10, wood: 5, stone: 3 },
    effect: '每回合 +2 金幣收入',
    blurb: '商人、商隊與喧鬧的市集,讓金幣穩定流入國庫。',
    accent: '#e0b34c',
  },
};

export const PERSONALITY = {
  aggressive: { label: '侵略', blurb: '先發制人,極少讓步。' },
  defensive:  { label: '防禦', blurb: '堅守防線,珍視和平。' },
  diplomatic: { label: '外交', blurb: '願意結盟與貿易。' },
  mercantile: { label: '商業', blurb: '利潤先於征服。' },
};

const mainlandTerritories = [
  { id: 'frosthold',  name: '霜堡',     type: 'mountain', owner: 'frost_wardens', armies: 3, resources: { gold: 1, food: 3, wood: 2, stone: 5 }, adjacentTo: ['northkeep', 'whisperfen'] },
  { id: 'northkeep',  name: '北境城',   type: 'city',     owner: 'iron_legion',  armies: 3, resources: { gold: 4, food: 4, wood: 1, stone: 2 }, adjacentTo: ['frosthold', 'iron_hills', 'greenwood'] },
  { id: 'iron_hills', name: '鐵丘',     type: 'mountain', owner: 'iron_legion',  armies: 2, resources: { gold: 2, food: 3, wood: 0, stone: 4 }, adjacentTo: ['northkeep', 'crossroads'] },
  { id: 'whisperfen', name: '低語沼',   type: 'forest',   owner: 'frost_wardens', armies: 2, resources: { gold: 1, food: 3, wood: 4, stone: 0 }, adjacentTo: ['frosthold', 'greenwood'] },
  { id: 'greenwood',  name: '翠林',     type: 'forest',   owner: 'green_pact',   armies: 2, resources: { gold: 1, food: 3, wood: 4, stone: 0 }, adjacentTo: ['northkeep', 'whisperfen', 'crossroads', 'silver_bay'] },
  { id: 'crossroads', name: '十字路口', type: 'plains',   owner: null,           armies: 0, resources: { gold: 2, food: 2, wood: 1, stone: 1 }, adjacentTo: ['iron_hills', 'greenwood', 'desert_gate', 'stonehaven'] },
  { id: 'desert_gate',name: '沙門',     type: 'plains',   owner: 'sand_empire',  armies: 2, resources: { gold: 3, food: 3, wood: 0, stone: 2 }, adjacentTo: ['crossroads', 'ashlands'] },
  { id: 'silver_bay', name: '銀灣',     type: 'city',     owner: 'green_pact',   armies: 3, resources: { gold: 5, food: 2, wood: 1, stone: 1 }, adjacentTo: ['greenwood', 'stonehaven'] },
  { id: 'stonehaven', name: '石港',     type: 'mountain', owner: 'sand_empire',  armies: 2, resources: { gold: 2, food: 3, wood: 0, stone: 5 }, adjacentTo: ['crossroads', 'silver_bay', 'dragon_peak', 'ashlands'] },
  { id: 'ashlands',   name: '灰燼原',   type: 'plains',   owner: 'crimson_horde', armies: 3, resources: { gold: 2, food: 4, wood: 1, stone: 3 }, adjacentTo: ['desert_gate', 'stonehaven'] },
  { id: 'dragon_peak',name: '龍峰',     type: 'mountain', owner: 'void_covenant', armies: 4, resources: { gold: 1, food: 2, wood: 0, stone: 6 }, adjacentTo: ['stonehaven', 'sunfield'] },
  { id: 'sunfield',   name: '日野',     type: 'plains',   owner: 'void_covenant', armies: 2, resources: { gold: 3, food: 4, wood: 1, stone: 0 }, adjacentTo: ['dragon_peak'] },
];

const mainlandFactions = [
  { id: 'iron_legion',    name: '鐵軍團',   personality: 'aggressive', color: '#d24b4b', crest: 'legion', territories: ['northkeep', 'iron_hills'], gold: 20, food: 10, wood: 5, stone: 15, blurb: '北方鑄造廠鍛出的紀律之師。' },
  { id: 'green_pact',     name: '翠盟',     personality: 'defensive',  color: '#5fae72', crest: 'leaf',   territories: ['greenwood', 'silver_bay'], gold: 15, food: 20, wood: 25, stone: 5, blurb: '古老森林與銀色港灣的守望者。' },
  { id: 'sand_empire',    name: '沙帝國',   personality: 'mercantile', color: '#e0b34c', crest: 'sun',    territories: ['desert_gate', 'stonehaven'], gold: 30, food: 8, wood: 2, stone: 10, blurb: '逐一買下綠洲的商隊領主。' },
  { id: 'void_covenant',  name: '虛空議會', personality: 'diplomatic', color: '#a77bd6', crest: 'eye',    territories: ['dragon_peak', 'sunfield'], gold: 10, food: 5, wood: 2, stone: 20, blurb: '言語帶有非自然份量的山中祕法師。' },
  { id: 'frost_wardens',  name: '霜衛',     personality: 'defensive',  color: '#6fb7d9', crest: 'snow',   territories: ['frosthold', 'whisperfen'], gold: 10, food: 12, wood: 15, stone: 18, blurb: '凍土高原上沉默的哨兵。' },
  { id: 'crimson_horde',  name: '赤紅部落', personality: 'aggressive', color: '#e2663f', crest: 'fang',   territories: ['ashlands'], gold: 15, food: 10, wood: 5, stone: 12, blurb: '專撿灰燼未燒盡之物的悍匪。' },
];

const archipelagoTerritories = [
  { id: 'coral_haven',   name: '珊瑚港',   type: 'city',     owner: 'tide_lords',    armies: 3, resources: { gold: 5, food: 3, wood: 1, stone: 1 }, adjacentTo: ['tidecrest', 'stormwatch'] },
  { id: 'tidecrest',     name: '潮冠',     type: 'plains',   owner: 'tide_lords',    armies: 2, resources: { gold: 2, food: 3, wood: 2, stone: 1 }, adjacentTo: ['coral_haven', 'pearl_shoals', 'whale_rock'] },
  { id: 'whale_rock',    name: '鯨岩',     type: 'mountain', owner: 'deep_ones',     armies: 3, resources: { gold: 2, food: 2, wood: 0, stone: 4 }, adjacentTo: ['tidecrest'] },
  { id: 'stormwatch',    name: '風暴哨',   type: 'mountain', owner: 'storm_kin',     armies: 3, resources: { gold: 1, food: 3, wood: 0, stone: 5 }, adjacentTo: ['coral_haven', 'pearl_shoals', 'driftwood'] },
  { id: 'pearl_shoals',  name: '珍珠淺灘', type: 'plains',   owner: null,            armies: 0, resources: { gold: 3, food: 2, wood: 1, stone: 1 }, adjacentTo: ['tidecrest', 'stormwatch', 'ember_isle', 'serpent_bay'] },
  { id: 'ember_isle',    name: '餘燼島',   type: 'mountain', owner: 'flame_brood',   armies: 3, resources: { gold: 2, food: 3, wood: 0, stone: 6 }, adjacentTo: ['pearl_shoals', 'obsidian_rock'] },
  { id: 'driftwood',     name: '漂流木',   type: 'forest',   owner: 'storm_kin',     armies: 2, resources: { gold: 1, food: 2, wood: 5, stone: 0 }, adjacentTo: ['stormwatch', 'kelp_forest'] },
  { id: 'serpent_bay',   name: '蛇灣',     type: 'city',     owner: null,            armies: 0, resources: { gold: 4, food: 2, wood: 1, stone: 2 }, adjacentTo: ['pearl_shoals', 'obsidian_rock', 'fog_marsh'] },
  { id: 'obsidian_rock', name: '黑曜岩',   type: 'mountain', owner: 'flame_brood',   armies: 2, resources: { gold: 1, food: 3, wood: 0, stone: 5 }, adjacentTo: ['ember_isle', 'serpent_bay', 'skyspire'] },
  { id: 'kelp_forest',   name: '海藻林',   type: 'forest',   owner: 'deep_ones',     armies: 2, resources: { gold: 1, food: 4, wood: 3, stone: 0 }, adjacentTo: ['driftwood'] },
  { id: 'fog_marsh',     name: '霧沼',     type: 'forest',   owner: 'mist_walkers',  armies: 3, resources: { gold: 2, food: 4, wood: 3, stone: 0 }, adjacentTo: ['serpent_bay', 'skyspire', 'sunken_ruins'] },
  { id: 'skyspire',      name: '天尖塔',   type: 'mountain', owner: 'mist_walkers',  armies: 2, resources: { gold: 3, food: 3, wood: 0, stone: 4 }, adjacentTo: ['obsidian_rock', 'fog_marsh'] },
  { id: 'sunken_ruins',  name: '沉沒遺跡', type: 'city',     owner: 'wraith_fleet',  armies: 3, resources: { gold: 4, food: 3, wood: 1, stone: 3 }, adjacentTo: ['fog_marsh', 'leviathan_cove'] },
  { id: 'leviathan_cove',name: '巨獸灣',   type: 'plains',   owner: 'wraith_fleet',  armies: 2, resources: { gold: 2, food: 3, wood: 2, stone: 1 }, adjacentTo: ['sunken_ruins'] },
];

const archipelagoFactions = [
  { id: 'tide_lords',   name: '潮汐領主', personality: 'mercantile', color: '#59c2d6', crest: 'wave',  territories: ['coral_haven', 'tidecrest'], gold: 25, food: 15, wood: 8, stone: 5, blurb: '艦隊控制每道海峽的商業親王。' },
  { id: 'storm_kin',    name: '風暴氏族', personality: 'aggressive', color: '#5c86d6', crest: 'bolt',  territories: ['stormwatch', 'driftwood'], gold: 15, food: 10, wood: 20, stone: 15, blurb: '崇拜雷電的迎風崖掠奪者。' },
  { id: 'flame_brood',  name: '烈焰裔',   personality: 'aggressive', color: '#e2583e', crest: 'flame', territories: ['ember_isle', 'obsidian_rock'], gold: 12, food: 5, wood: 2, stone: 25, blurb: '從火山群島孵化的龍裔。' },
  { id: 'mist_walkers', name: '霧行者',   personality: 'diplomatic', color: '#b07bd6', crest: 'mist',  territories: ['fog_marsh', 'skyspire'], gold: 18, food: 12, wood: 10, stone: 10, blurb: '在霧中交易祕密的蒙面使節。' },
  { id: 'deep_ones',    name: '深海者',   personality: 'defensive',  color: '#54a878', crest: 'scale', territories: ['whale_rock', 'kelp_forest'], gold: 12, food: 15, wood: 12, stone: 12, blurb: '沉沒森林的古老守護者。' },
  { id: 'wraith_fleet', name: '幽靈艦隊', personality: 'aggressive', color: '#d8c56a', crest: 'skull', territories: ['sunken_ruins', 'leviathan_cove'], gold: 20, food: 10, wood: 8, stone: 10, blurb: '自廢墟之城駛出的鬼船。' },
];

export const MAPS = {
  mainland: {
    id: 'mainland',
    name: '大陸王座',
    kicker: '經典大陸爭霸',
    description: '十二行省、六位強敵、一座王座。開闊邊界與漫長補給線,獎勵大膽的征服者。',
    territories: mainlandTerritories,
    factions: mainlandFactions,
    positions: {
      frosthold: [150, 120], northkeep: [420, 120], iron_hills: [700, 120],
      whisperfen: [150, 315], greenwood: [420, 315], crossroads: [700, 315], desert_gate: [980, 315],
      silver_bay: [420, 515], stonehaven: [700, 515], ashlands: [980, 515],
      dragon_peak: [700, 690], sunfield: [980, 690],
    },
    viewBox: [0, 0, 1140, 780],
    style: 'continent',
  },
  archipelago: {
    id: 'archipelago',
    name: '破碎群島',
    kicker: '島鏈與咽喉要道',
    description: '十四座島嶼散布在狂暴海域。你掌握的每道海峽,都是抵在對手喉嚨上的刀。',
    territories: archipelagoTerritories,
    factions: archipelagoFactions,
    positions: {
      coral_haven: [150, 110], tidecrest: [410, 110], whale_rock: [670, 110],
      stormwatch: [150, 285], pearl_shoals: [410, 285], ember_isle: [670, 285],
      driftwood: [150, 460], serpent_bay: [410, 460], obsidian_rock: [670, 460],
      kelp_forest: [150, 635], fog_marsh: [410, 635], skyspire: [670, 635],
      sunken_ruins: [410, 800], leviathan_cove: [670, 800],
    },
    viewBox: [0, 0, 1140, 900],
    style: 'isles',
  },
};

export const MAP_LIST = [MAPS.mainland, MAPS.archipelago];

export function factionById(mapId, id) {
  return MAPS[mapId].factions.find((f) => f.id === id) || null;
}

export function territoryTemplate(mapId, id) {
  const t = MAPS[mapId].territories.find((x) => x.id === id);
  return t ? JSON.parse(JSON.stringify(t)) : null;
}