Implement farming

This commit is contained in:
2024-01-28 17:33:55 +01:00
parent 6ee46da8ab
commit 205fb57f07
10 changed files with 85 additions and 73 deletions

View File

@@ -106,13 +106,20 @@ void inputUnitAction(Game *game, InputState *input) {
ecs_entity_t entity = it.entities[i];
Position target = *ecs_get(ECS, taskEntity, Position);
f32 proximity = 6.0f;
if (resource.type == RES_FOOD)
proximity = 2.0f;
Worker *worker = ecs_get_mut(ECS, entity, Worker);
worker->carryRes = resource.type;
setAIBehaviour(entity, game->BTs.workerHarvest, &(AIBlackboard) {
.as.worker = {
.harvestType = resource.type,
.harvestTarget = taskEntity,
.harvestPos = target,
},
.proximity = 6.0f,
.proximity = proximity,
});
}
}

View File

@@ -58,7 +58,7 @@ void drawGameUI(Game *game, f32 dt) {
BUILDING_WAREHOUSE,
BUILDING_MARKET,
BUILDING_MILL,
BUILDING_HOUSE_02, // placeholder for farm
BUILDING_WHEAT_0,
BUILDING_BARRACKS,
BUILDING_ARCHERY_RANGE
};