Add World Update script
This commit is contained in:
13
scripts/update_world.ts
Normal file
13
scripts/update_world.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
import { readFileSync, writeFileSync } from 'fs';
|
||||
|
||||
function updateWorld() {
|
||||
const state = JSON.parse(readFileSync('world_state.json', 'utf8'));
|
||||
state.tower.energy = Math.min(100, state.tower.energy + 5);
|
||||
state.matrix.stability = Math.min(1.0, state.matrix.stability + 0.01);
|
||||
state.last_updated = new Date().toISOString();
|
||||
writeFileSync('world_state.json', JSON.stringify(state, null, 2));
|
||||
console.log('World state updated successfully.');
|
||||
}
|
||||
|
||||
updateWorld();
|
||||
Reference in New Issue
Block a user