feat: add community swarm simulation for #6
Some checks failed
Accessibility Checks / a11y-audit (pull_request) Successful in 8s
Smoke Test / smoke (pull_request) Failing after 20s

This commit is contained in:
Timmy
2026-04-20 21:22:46 -04:00
parent 1a20b14bd8
commit 0ce0ceadf3
6 changed files with 332 additions and 3 deletions

View File

@@ -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();