36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
// Player-buildable tile improvements. A tile carries at most one, laid down on
|
|
// land the civilisation controls: a road or a railway, the latter twice as fast
|
|
// again as a road. Both are bought outright and then cost an hourly maintenance
|
|
// for every tile of the network a nation holds.
|
|
|
|
export const TRANSPORT_IMPROVEMENTS = [
|
|
{
|
|
id: "road",
|
|
name: "Road",
|
|
// The texture the client draws the tile with.
|
|
texture: "road",
|
|
// Travel multiplier once a unit is on the tile. Unimproved grass is 1.0, so
|
|
// a road moves twice as fast and a railway twice as fast again (50% faster
|
|
// than a road).
|
|
movementCostMultiplier: 0.5,
|
|
buildCost: 50_000_000,
|
|
maintenance: 100_000,
|
|
},
|
|
{
|
|
id: "railway",
|
|
name: "Railway",
|
|
texture: "rail",
|
|
movementCostMultiplier: 0.25,
|
|
buildCost: 150_000_000,
|
|
maintenance: 300_000,
|
|
},
|
|
];
|
|
|
|
export const TRANSPORT_BY_ID = Object.fromEntries(
|
|
TRANSPORT_IMPROVEMENTS.map((improvement) => [improvement.id, improvement])
|
|
);
|
|
|
|
export function transportImprovement(id) {
|
|
return TRANSPORT_BY_ID[id] || null;
|
|
}
|