Compare commits
6 Commits
feat/beaco
...
feat/symbo
| Author | SHA1 | Date | |
|---|---|---|---|
| 5cfda3ecea | |||
| 16d5f98407 | |||
| 58c55176ae | |||
| 4ee5819398 | |||
|
|
fb5205092b | ||
| 1d16755f93 |
25
game.js
25
game.js
@@ -351,6 +351,31 @@ const BDEF = [
|
||||
unlock: () => G.totalKnowledge >= 50000 && G.mempalaceFlag === 1, phase: 5,
|
||||
edu: 'The Memory Palace technique: attach information to spatial locations. LLMs use vector spaces the same way — semantic proximity = spatial proximity. MemPalace gives sovereign AI persistent, structured recall.'
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'harvesterDrone', name: 'Harvester Drone',
|
||||
desc: "Autonomous code harvester. Rate follows the golden ratio.",
|
||||
baseCost: { compute: 10000 }, costMult: 1.15,
|
||||
rates: { code: 26180339 },
|
||||
unlock: () => G.totalCompute >= 5000 && G.phase >= 4, phase: 4,
|
||||
edu: 'The golden ratio (phi = 1.618) appears throughout nature. Using phi for rates means optimal utilization.'
|
||||
},
|
||||
{
|
||||
id: 'wireDrone', name: 'Wire Drone',
|
||||
desc: 'Connects systems. Rate follows phi squared.',
|
||||
baseCost: { compute: 50000 }, costMult: 1.15,
|
||||
rates: { compute: 16180339 },
|
||||
unlock: () => G.buildings.harvesterDrone >= 1, phase: 4,
|
||||
edu: 'Wire drones complement harvesters at golden ratio proportions.'
|
||||
},
|
||||
{
|
||||
id: 'droneFactory', name: 'Drone Factory',
|
||||
desc: 'Mass-produces drones. Economies of scale.',
|
||||
baseCost: { compute: 500000, code: 100000 }, costMult: 1.15,
|
||||
rates: { code: 161803398, compute: 100000000 },
|
||||
unlock: () => G.buildings.harvesterDrone >= 5 && G.buildings.wireDrone >= 3, phase: 5,
|
||||
edu: 'Factories follow economies of scale: first is expensive, each additional is cheaper.'
|
||||
}
|
||||
];
|
||||
|
||||
// === PROJECT DEFINITIONS (following Paperclips' pattern exactly) ===
|
||||
|
||||
18
game/npc-logic.js
Normal file
18
game/npc-logic.js
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
class NPCStateMachine {
|
||||
constructor(states) {
|
||||
this.states = states;
|
||||
this.current = 'idle';
|
||||
}
|
||||
update(context) {
|
||||
const state = this.states[this.current];
|
||||
for (const transition of state.transitions) {
|
||||
if (transition.condition(context)) {
|
||||
this.current = transition.target;
|
||||
console.log(`NPC transitioned to ${this.current}`);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
export default NPCStateMachine;
|
||||
26
scripts/guardrails.js
Normal file
26
scripts/guardrails.js
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
/**
|
||||
* Symbolic Guardrails for The Beacon
|
||||
* Ensures game logic consistency.
|
||||
*/
|
||||
class Guardrails {
|
||||
static validateStats(stats) {
|
||||
const required = ['hp', 'maxHp', 'mp', 'maxMp', 'level'];
|
||||
required.forEach(r => {
|
||||
if (!(r in stats)) throw new Error(`Missing stat: ${r}`);
|
||||
});
|
||||
if (stats.hp > stats.maxHp) return { valid: false, reason: 'HP exceeds MaxHP' };
|
||||
return { valid: true };
|
||||
}
|
||||
|
||||
static validateDebuff(debuff, stats) {
|
||||
if (debuff.type === 'drain' && stats.hp <= 1) {
|
||||
return { valid: false, reason: 'Drain debuff on critical HP' };
|
||||
}
|
||||
return { valid: true };
|
||||
}
|
||||
}
|
||||
|
||||
// Test
|
||||
const playerStats = { hp: 50, maxHp: 100, mp: 20, maxMp: 50, level: 1 };
|
||||
console.log('Stats check:', Guardrails.validateStats(playerStats));
|
||||
Reference in New Issue
Block a user