-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fdc23c1
commit 203628a
Showing
6 changed files
with
69 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,22 @@ | ||
import {base} from './task-lib.js'; | ||
/* | ||
function replenish(_, game_context) { | ||
game_context.tasks[109].quantity += 1; | ||
return game_context; | ||
} | ||
Take x Reed | ||
function collect(_, game_context) { | ||
const {quantity} = game_context.tasks[109]; | ||
game_context.supply.reed += quantity; | ||
game_context.tasks[109].quantity = 0; | ||
return game_context; | ||
} | ||
*/ | ||
|
||
import task from './lib-task.js'; | ||
|
||
export default base.createMachine({ | ||
initial: 'idle', | ||
states: { | ||
idle: { | ||
on: { | ||
'task.replenish': { | ||
actions: [ | ||
{type: 'game-update', params: {updater: replenish}}, | ||
{type: 'ack'} | ||
] | ||
}, | ||
'task.selected': { | ||
actions: [ | ||
{type: 'game-update', params: {updater: collect}}, | ||
{type: 'task-complete'} | ||
] | ||
} | ||
} | ||
} | ||
export default task({ | ||
id: '109', | ||
replenish: (_, game) => { | ||
game.tasks[109].quantity += 1; | ||
return game; | ||
}, | ||
execute: (_, game) => { | ||
const {quantity} = game.tasks[109]; | ||
game.supply.reed += quantity; | ||
game.tasks[109].quantity = 0; | ||
return game; | ||
} | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,22 @@ | ||
import {base} from './task-lib.js'; | ||
/* | ||
function replenish(_, game_context) { | ||
game_context.tasks[110].quantity += 1; | ||
return game_context; | ||
} | ||
Fishing | ||
Take x Food | ||
function collect(_, game_context) { | ||
const {quantity} = game_context.tasks[110]; | ||
game_context.supply.food += quantity; | ||
game_context.tasks[110].quantity = 0; | ||
return game_context; | ||
} | ||
*/ | ||
import task from './lib-task.js'; | ||
|
||
export default base.createMachine({ | ||
initial: 'idle', | ||
states: { | ||
idle: { | ||
on: { | ||
'task.replenish': { | ||
actions: [ | ||
{type: 'game-update', params: {updater: replenish}}, | ||
{type: 'ack'} | ||
] | ||
}, | ||
'task.selected': { | ||
actions: [ | ||
{type: 'game-update', params: {updater: collect}}, | ||
{type: 'task-complete'} | ||
] | ||
} | ||
} | ||
} | ||
export default task({ | ||
id: '110', | ||
replenish: (_, game) => { | ||
game.tasks[110].quantity += 1; | ||
return game; | ||
}, | ||
execute: (_, game) => { | ||
const {quantity} = game.tasks[110]; | ||
game.supply.food += quantity; | ||
game.tasks[110].quantity = 0; | ||
return game; | ||
} | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,13 @@ | ||
import {base} from './task-lib.js'; | ||
/* | ||
export default base.createMachine({ | ||
initial: 'idle', | ||
states: { | ||
idle: { | ||
on: { | ||
'task.selected': { | ||
actions: { | ||
type: 'abort', | ||
params: { | ||
task_id: 111, | ||
err: 'TODO' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
Fences | ||
*/ | ||
|
||
import task from './lib-task.js'; | ||
|
||
export default task({ | ||
id: '111', | ||
todo: true | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,13 @@ | ||
import {base} from './task-lib.js'; | ||
/* | ||
export default base.createMachine({ | ||
initial: 'idle', | ||
states: { | ||
idle: { | ||
on: { | ||
'task.selected': { | ||
actions: { | ||
type: 'abort', | ||
params: { | ||
task_id: 112, | ||
err: 'TODO' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
Major Improvement | ||
*/ | ||
|
||
import task from './lib-task.js'; | ||
|
||
export default task({ | ||
id: '112', | ||
todo: true | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,13 @@ | ||
/* | ||
Family growth | ||
Family growth | ||
*/ | ||
|
||
import {base} from './task-lib.js'; | ||
import task from './lib-task.js'; | ||
|
||
export default base.createMachine({ | ||
initial: 'idle', | ||
states: { | ||
idle: { | ||
on: { | ||
'task.selected': { | ||
actions: { | ||
type: 'abort', | ||
params: { | ||
task_id: 115, | ||
err: 'TODO' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
export default task({ | ||
id: '115', | ||
todo: true | ||
}); | ||
|