Add wonder data

This commit is contained in:
Kenneth Allen 2021-10-22 19:39:12 +11:00
parent e721b8f357
commit 5c621c9394
3 changed files with 101 additions and 23 deletions

View File

@ -15,7 +15,7 @@ export type Science = 'engineering' | 'research' | 'education'
export const sciences: Science[] = ['engineering', 'research', 'education']
export interface TurnPlan {
action: 'structure' | 'discard'
action: 'structure' | 'discard' | 'wonder'
cardIdx: number
goldLeft: number
goldRight: number

View File

@ -5,14 +5,8 @@ export const structureTypes: StructureType[] = ['commerce', 'culture', 'science'
export type Countable = StructureType | 'wonder stage' | 'defeat'
export interface Structure {
type: StructureType
name: string
appears?: (undefined | (3 | 4 | 5 | 6 | 7)[])[]
export interface Project {
cost?: Map<Resource | 'gold', number>
freeWith?: string[]
paysFor?: string[]
gold?: number
goldPer?: Map<Countable, number>
@ -28,6 +22,19 @@ export interface Structure {
direction: ('left' | 'right')[]
amount: number
}[]
playBothOnLastTurn?: boolean
buildDiscardedNow?: boolean
copyNeighboringGuild?: boolean
ignoreCostOncePerAge?: boolean
}
export interface Structure extends Project {
type: StructureType
name: string
appears?: (undefined | (3 | 4 | 5 | 6 | 7)[])[]
freeWith?: string[]
paysFor?: string[]
}
export const structuresByAge: Structure[][] = [

View File

@ -1,54 +1,125 @@
import { Resource } from "./basic"
import { Project } from "./structure"
export interface Wonder {
name: string
innateResource: Resource
//stages: Structure[]
stages: Project[]
}
const wonderList: Wonder[] = [
{
name: 'Great Pyramid of Giza A',
innateResource: 'stone'
innateResource: 'stone',
stages: [
{ cost: new Map([['stone', 2]]), points: 3 },
{ cost: new Map([['wood', 3]]), points: 5 },
{ cost: new Map([['stone', 4]]), points: 7 },
],
}, {
name: 'Great Pyramid of Giza B',
innateResource: 'stone'
innateResource: 'stone',
stages: [
{ cost: new Map([['wood', 2]]), points: 3 },
{ cost: new Map([['stone', 3]]), points: 5 },
{ cost: new Map([['brick', 3]]), points: 5 },
{ cost: new Map([['paper', 1], ['stone', 4]]), points: 7 },
],
}, {
name: 'Hanging Gardens of Babylon A',
innateResource: 'brick'
innateResource: 'brick',
stages: [
{ cost: new Map([['brick', 2]]), points: 3 },
{ cost: new Map([['wood', 3]]), sciences: new Set(['engineering', 'research', 'education']) },
{ cost: new Map([['brick', 4]]), points: 7 },
],
}, {
name: 'Hanging Gardens of Babylon B',
innateResource: 'brick'
innateResource: 'brick',
stages: [
{ cost: new Map([['cloth', 1], ['brick', 1]]), points: 3 },
{ cost: new Map([['glass', 1], ['wood', 2]]), playBothOnLastTurn: true },
{ cost: new Map([['paper', 1], ['brick', 3]]), sciences: new Set(['engineering', 'research', 'education']) },
],
}, {
name: 'Temple of Artemis at Ephesus A',
innateResource: 'paper'
innateResource: 'paper',
stages: [
{ cost: new Map([['stone', 2]]), points: 3 },
{ cost: new Map([['wood', 2]]), gold: 9 },
{ cost: new Map([['paper', 2]]), points: 7 },
],
}, {
name: 'Temple of Artemis at Ephesus B',
innateResource: 'paper'
innateResource: 'paper',
stages: [
{ cost: new Map([['stone', 2]]), points: 2, gold: 4 },
{ cost: new Map([['wood', 2]]), points: 3, gold: 4 },
{ cost: new Map([['paper', 1], ['cloth', 1], ['glass', 1]]), points: 5, gold: 4 },
],
}, {
name: 'Statue of Zeus at Olympia A',
innateResource: 'wood'
innateResource: 'wood',
stages: [
{ cost: new Map([['wood', 2]]), points: 3 },
{ cost: new Map([['stone', 2]]), ignoreCostOncePerAge: true },
{ cost: new Map([['ore', 2]]), points: 7 },
],
}, {
name: 'Statue of Zeus at Olympia B',
innateResource: 'wood'
innateResource: 'wood',
stages: [
{ cost: new Map([['wood', 2]]), discountTrade: [{ resourceType: 'basic', direction: ['left', 'right'], amount: 1 }] },
{ cost: new Map([['stone', 2]]), points: 5 },
{ cost: new Map([['cloth', 1], ['ore', 2]]), copyNeighboringGuild: true },
],
}, {
name: 'Mausoleum at Halicarnassus A',
innateResource: 'cloth'
innateResource: 'cloth',
stages: [
{ cost: new Map([['brick', 2]]), points: 3 },
{ cost: new Map([['ore', 3]]), buildDiscardedNow: true },
{ cost: new Map([['cloth', 2]]), points: 7 },
],
}, {
name: 'Mausoleum at Halicarnassus B',
innateResource: 'cloth'
innateResource: 'cloth',
stages: [
{ cost: new Map([['ore', 2]]), points: 2, buildDiscardedNow: true },
{ cost: new Map([['brick', 3]]), points: 1, buildDiscardedNow: true },
{ cost: new Map([['paper', 1], ['cloth', 1], ['glass', 1]]), buildDiscardedNow: true },
],
}, {
name: 'Colossus of Rhodes A',
innateResource: 'ore'
innateResource: 'ore',
stages: [
{ cost: new Map([['wood', 2]]), points: 3 },
{ cost: new Map([['brick', 3]]), shields: 2 },
{ cost: new Map([['ore', 4]]), points: 7 },
],
}, {
name: 'Colossus of Rhodes B',
innateResource: 'ore'
innateResource: 'ore',
stages: [
{ cost: new Map([['stone', 3]]), shields: 1, points: 3, gold: 3 },
{ cost: new Map([['ore', 4]]), shields: 1, points: 4, gold: 4 },
],
}, {
name: 'Lighthouse of Alexandria A',
innateResource: 'glass'
innateResource: 'glass',
stages: [
{ cost: new Map([['stone', 2]]), points: 3 },
{ cost: new Map([['ore', 2]]), resources: new Map([['brick', 1], ['ore', 1], ['wood', 1], ['stone', 1]]) },
{ cost: new Map([['glass', 2]]), points: 7 },
],
}, {
name: 'Lighthouse of Alexandria B',
innateResource: 'glass'
innateResource: 'glass',
stages: [
{ cost: new Map([['brick', 2]]), resources: new Map([['brick', 1], ['ore', 1], ['wood', 1], ['stone', 1]]) },
{ cost: new Map([['wood', 2]]), resources: new Map([['glass', 1], ['cloth', 1], ['paper', 1]]) },
{ cost: new Map([['stone', 3]]), points: 7 },
],
},
]
export const wonders = new Map(wonderList.map(w => [w.name, w]))