feat(content): add action costs and multi-yield schema
This commit is contained in:
+3
-1
@@ -50,6 +50,8 @@ export function tickGame(state: GameState, content: Content, tickMs: number): vo
|
||||
state.actionElapsedMs += tickMs;
|
||||
while (state.actionElapsedMs >= action.durationMs) {
|
||||
state.actionElapsedMs -= action.durationMs;
|
||||
state.resources[action.yields.resourceId] += action.yields.amount;
|
||||
for (const y of action.yields) {
|
||||
state.resources[y.resourceId] += y.amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user