feat: Issue 34 - instruments now produce spare time, at a rate proportional to the number of workers
This commit is contained in:
parent
af96580125
commit
095938e8eb
2 changed files with 18 additions and 8 deletions
|
|
@ -102,11 +102,15 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
gametick() {
|
||||
for (let i = 0; i <= 4; i++) {
|
||||
const currentCompletion = this.$store.state.processes[i].completion
|
||||
const step = 100.0 / (6.0 * (i + 1)) // go at different rates
|
||||
let newValue = currentCompletion + step
|
||||
if (newValue >= 100) newValue = newValue - 100
|
||||
for (let i = 0; i < this.$store.state.processes.length; i++) {
|
||||
const p = this.$store.state.processes[i]
|
||||
// const step = 100.0 / (6.0 * (i + 1)) // go at different rates
|
||||
const step = p.workerRate * p.workerCount
|
||||
let newValue = p.completion + step
|
||||
while (newValue >= 100) {
|
||||
newValue = newValue - 100
|
||||
this.$store.commit('addCurrency', p.reward)
|
||||
}
|
||||
this.$store.commit('setProcessCompletion', {
|
||||
processIndex: i,
|
||||
value: newValue,
|
||||
|
|
|
|||
Reference in a new issue