Make soldiers carry less resources.

This commit is contained in:
Adrian 2024-11-07 15:14:24 +01:00
parent 2dffb2dcac
commit 42b8dae615
5 changed files with 10 additions and 2 deletions

View File

@ -9,6 +9,7 @@ export default [
food: 0,
},
behavior: {
caryingCapacity: 2,
culturePerMinute: 1,
foodIntakePerMinute: 2,
},
@ -23,6 +24,7 @@ export default [
food: 0,
},
behavior: {
caryingCapacity: 4,
foodIntakePerMinute: 1,
},
},

View File

@ -2,6 +2,7 @@
import buildings from "../data/buildings";
import moves from "../moves";
import showBuildingCreator from "../stores/showBuildingCreator";
import Cost from "./Cost.svelte";
function close() {
showBuildingCreator.set(null);
@ -34,6 +35,7 @@
{ #each constructible as building }
<div>
<p>{ building.name }</p>
<Cost cost={ building.cost(1) } />
<button on:click={ () => build(building.type) }>Build</button>
</div>
{ /each }

View File

@ -1,4 +1,5 @@
import type { OasisType, RegionType } from "./types";
import { getUnitSource } from "./utils";
import type { VillageState } from "./village";
@ -26,6 +27,8 @@ function resolvePillageOasis(V: VillageState, region: OasisType) {
return;
}
V.resources[region.resource] += mission.unitCount * 40;
const unit = getUnitSource('soldier');
V.resources[region.resource] += mission.unitCount * unit.behavior.caryingCapacity;
delete region.state.mission;
}

View File

@ -58,6 +58,7 @@ export interface UnitType {
name: string;
cost: CostType;
behavior: {
caryingCapacity: number;
foodIntakePerMinute: number;
culturePerMinute?: number;
}

View File

@ -119,7 +119,7 @@ function getInitialState() {
}
const newBuilding = createBuilding(type);
newBuilding.tile = new Hex(x, y);
newBuilding.level = newBuilding.type === 'field' ? 1 : 10;
newBuilding.level = 1; //newBuilding.type === 'field' ? 1 : 10;
state.outsideTiles[y][x] = newBuilding.id;
state.buildings.push(newBuilding);
});