diff --git a/components/SecondTabContent.vue b/components/SecondTabContent.vue
index 17b3588..d8f7ffc 100644
--- a/components/SecondTabContent.vue
+++ b/components/SecondTabContent.vue
@@ -5,17 +5,19 @@
:key="index"
class="flex flex-col mb-4 p-4 rounded border"
:class="`border-${$store.getters.activeTab.darkColor}`"
+ @click="$store.commit('purchaseWorker', index)"
>
- {{ process.workerCount }} {{ process.worker }}s
+ {{ process.workerCount }} {{ process.worker
+ }}s
Each {{ process.worker }} makes your
- {{ process.device }}s produce {{ process.produces }} at an
- increased rate.
+ {{ process.device }}s produce spare time at an increased
+ rate.
Cost for next {{ process.worker }}: 4
+ >Cost for next {{ process.worker }}: {{ process.nextWorkerCost }}
{{ process.buyWorkersWith }}
diff --git a/store/index.js b/store/index.js
index b90d909..e4c5ff0 100644
--- a/store/index.js
+++ b/store/index.js
@@ -60,30 +60,36 @@ export const state = () => ({
instrument: 'Star Chart',
worker: 'Shaman',
deviceCount: new Decimal(0),
- workerCount: 1,
+ workerCount: 0,
completion: 0,
- workerRate: 8.0, // amount added to "completion" (100=full bar) per worker
- reward: 10, // currency added when the bar is completed
+ workerRate: 6.0, // amount added to "completion" (100=full bar) per worker
+ reward: 8, // currency added when the bar is completed
+ nextWorkerCost: 15, // currency cost of next worker
+ nextWorkerFactor: 1.4, // worker cost *= this factor after each purchase
unlockThreshold: { tech: null, currency: 0 },
},
{
instrument: 'Stone Calendar',
worker: 'Stonecarver',
deviceCount: new Decimal(0),
- workerCount: 1,
+ workerCount: 0,
completion: 0,
workerRate: 4.0,
reward: 35,
+ nextWorkerCost: 60,
+ nextWorkerFactor: 1.6,
unlockThreshold: { tech: null, currency: 10000 },
},
{
instrument: 'Astrolabes',
worker: 'Mathematician',
deviceCount: new Decimal(0),
- workerCount: 1,
+ workerCount: 0,
completion: 0,
workerRate: 1.5,
reward: 80,
+ nextWorkerCost: 90,
+ nextWorkerFactor: 1.8,
unlockThreshold: { tech: 0, currency: new Decimal(10e5) },
},
],
@@ -166,4 +172,15 @@ export const mutations = {
completeMission: (state, missionIndex) => {
state.missions[missionIndex].complete = true
},
+ purchaseWorker: (state, processIndex) => {
+ const p = state.processes[processIndex]
+ if (p.nextWorkerCost > state.currency) return
+ state.currency = Decimal.subtract(state.currency, p.nextWorkerCost)
+ Vue.set(state.processes[processIndex], 'workerCount', p.workerCount + 1)
+ Vue.set(
+ state.processes[processIndex],
+ 'nextWorkerCost',
+ Math.floor(p.nextWorkerCost * p.nextWorkerFactor)
+ )
+ },
}