Skip to content

Commit

Permalink
implement task 118
Browse files Browse the repository at this point in the history
  • Loading branch information
customcommander committed Oct 12, 2024
1 parent 6c79cc3 commit 5b0f462
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/component-supply.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ class Supply extends LitElement {
}

render() {
const {food, grain, wood, reed, clay, stone} = this.#supply.value;
const {food, grain, vegetable, wood, reed, clay, stone} = this.#supply.value;
const msg = this.#messages.value;
return html`
<div>
<span>${msg.supply_food({qty: food})}</span>
<span>${msg.supply_grain({qty: grain})}</span>
<span>${msg.supply_vegetable({qty: vegetable})}</span>
<span>${msg.supply_wood({qty: wood})}</span>
<span>${msg.supply_reed({qty: reed})}</span>
<span>${msg.supply_clay({qty: clay})}</span>
Expand Down
23 changes: 16 additions & 7 deletions src/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,13 @@ const machine = src.createMachine({
family: 2,
workers: 2,
supply: {
food: 0,
grain: 0,
wood: 0,
clay: 0,
reed: 0,
stone: 0
food: 0,
grain: 0,
vegetable: 0,
wood: 0,
clay: 0,
reed: 0,
stone: 0
},
house_type: 'wooden-hut',
farmyard: {
Expand Down Expand Up @@ -228,7 +229,15 @@ const machine = src.createMachine({
// After Renovation also Major Improvement
117: {selected: false,
turn: ro[1][2],
hidden: ro[1][2] > turn}
hidden: ro[1][2] > turn},

// Stage 3

// Take x Vegetable
118: {selected: false,
turn: ro[2][0],
hidden: ro[2][0] > turn}


},
error: null,
Expand Down
1 change: 1 addition & 0 deletions src/messages_en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ num_workers_description:

supply_food: Food ({qty})
supply_grain: Grain ({qty})
supply_vegetable: Vegetable ({qty})
supply_wood: Wood ({qty})
supply_reed: Reed ({qty})
supply_clay: Clay ({qty})
Expand Down
17 changes: 17 additions & 0 deletions src/task-118.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
Take x Vegetable
*/

import task from './lib-task.js';

export default task({
id: '118',

execute: (_, game) => {
game.supply.vegetable += 1;
return game;
}
});

0 comments on commit 5b0f462

Please sign in to comment.