feat: add community swarm simulation for #6
This commit is contained in:
11
js/engine.js
11
js/engine.js
@@ -102,6 +102,14 @@ function updateRates() {
|
||||
G.codeRate += G.swarmRate;
|
||||
}
|
||||
|
||||
if (typeof SwarmSim !== 'undefined') {
|
||||
const simRates = SwarmSim.computeRates();
|
||||
G.codeRate += simRates.codeRate;
|
||||
G.knowledgeRate += simRates.knowledgeRate;
|
||||
G.harmonyRate += simRates.harmonyRate;
|
||||
G.trustRate += simRates.trustRate;
|
||||
}
|
||||
|
||||
// Apply persistent debuffs from active events
|
||||
if (G.activeDebuffs && G.activeDebuffs.length > 0) {
|
||||
for (const debuff of G.activeDebuffs) {
|
||||
@@ -216,6 +224,9 @@ function tick() {
|
||||
// Combat: tick battle simulation
|
||||
Combat.tickBattle(dt);
|
||||
|
||||
// Community swarm alignment simulation
|
||||
if (typeof tickSwarm === 'function') tickSwarm(dt);
|
||||
|
||||
// Check milestones
|
||||
checkMilestones();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user