From 12a994e91c237cd5aaa2a05e70e96090cd363464 Mon Sep 17 00:00:00 2001 From: "Fabian @ Blax Software" Date: Sat, 31 Oct 2026 10:56:48 +0100 Subject: [PATCH] feat: one farm feeds a full army: farm production factor 1.25 (level 30 about 19,400 food/h) Co-Authored-By: Claude Opus 5.5 (1M context) --- config/game/buildings.php | 2 +- tests/Feature/HospitalTest.php | 6 +++--- tests/Unit/Game/PopulationTest.php | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/game/buildings.php b/config/game/buildings.php index f847d2c..bd0ef08 100644 --- a/config/game/buildings.php +++ b/config/game/buildings.php @@ -41,7 +41,7 @@ return [ 'cost' => ['wood' => 45, 'clay' => 40, 'iron' => 30, 'factor' => 1.27], 'build_time' => ['base' => 120, 'factor' => 1.2], 'workers' => ['base' => 2, 'factor' => 1.1], - 'production' => ['resource' => 'food', 'base' => 30, 'factor' => 1.17], + 'production' => ['resource' => 'food', 'base' => 30, 'factor' => 1.25], 'instance_cost_factor' => 2.0, 'points' => ['base' => 5, 'factor' => 1.2], 'requires' => [], diff --git a/tests/Feature/HospitalTest.php b/tests/Feature/HospitalTest.php index 005af13..aa8a581 100644 --- a/tests/Feature/HospitalTest.php +++ b/tests/Feature/HospitalTest.php @@ -58,15 +58,15 @@ it('brings half the fallen defenders back wounded; they eat meanwhile and stand expect((array) $state['troops'])->toBe(['sword' => 11]) ->and($state['hospital'])->toMatchArray(['beds' => 20, 'occupied' => 4, 'share' => 0.5, 'heal_seconds' => 14400]) ->and((array) $state['hospital']['wounded'][0]['units'])->toBe(['sword' => 4]) - // Farm 10 feeds 0.8 × 123.2 = 98.6 heads: the 11 swordsmen and 4 wounded leave 83 villagers. - ->and($state['population']['villagers'])->toBe(83); + // Farm 10 feeds 0.8 × 223.5 = 178.8 heads: the 11 swordsmen and 4 wounded leave 163 villagers. + ->and($state['population']['villagers'])->toBe(163); $this->travel(4)->hours(); $this->artisan('game:events --once')->assertSuccessful(); $state = shown($defender); expect((array) $state['troops'])->toBe(['sword' => 15]) ->and($state['hospital'])->toMatchArray(['occupied' => 0, 'wounded' => []]) - ->and($state['population']['villagers'])->toBe(83); + ->and($state['population']['villagers'])->toBe(163); }); it('takes in no more wounded than it has free beds', function () { diff --git a/tests/Unit/Game/PopulationTest.php b/tests/Unit/Game/PopulationTest.php index ecb882c..af93780 100644 --- a/tests/Unit/Game/PopulationTest.php +++ b/tests/Unit/Game/PopulationTest.php @@ -6,10 +6,10 @@ it('feeds villagers from the share of farm output, leaving a surplus', function $population = new Population(gameConfig()); $workforce = $population->workforce([building(1, 'farm'), building(2, 'farm', 2)]); - // Budget 30 + 35.1 = 65.1 food/h; villagers fill 80% of it. - expect($workforce->foodBudget)->toBe(30 + 30 * 1.17) - ->and($workforce->villagers)->toBe(52) - ->and($workforce->upkeep)->toEqual(52); + // Budget 30 + 37.5 = 67.5 food/h; villagers fill 80% of it. + expect($workforce->foodBudget)->toBe(30 + 30 * 1.25) + ->and($workforce->villagers)->toBe(54) + ->and($workforce->upkeep)->toEqual(54); }); it('leaves soldiers upkeep out of the villagers share', function () {