dodelani dnevnik
This commit is contained in:
32
src/systems/BlueprintSystem.js
Normal file
32
src/systems/BlueprintSystem.js
Normal file
@@ -0,0 +1,32 @@
|
||||
class BlueprintSystem {
|
||||
constructor(scene) {
|
||||
this.scene = scene;
|
||||
this.knownRecipes = ['axe', 'pickaxe', 'hoe']; // Default known
|
||||
this.blueprintsFound = []; // Items found but not learned? Or just list
|
||||
console.log('📜 BlueprintSystem: Initialized');
|
||||
}
|
||||
|
||||
// Called when digging/mining
|
||||
tryDropBlueprint() {
|
||||
if (Math.random() < 0.05) { // 5% chance
|
||||
const newBp = 'blueprint_barn'; // Randomize this
|
||||
console.log('✨ BLUEPRINT FOUND:', newBp);
|
||||
return newBp;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
learnBlueprint(id) {
|
||||
if (!this.knownRecipes.includes(id)) {
|
||||
this.knownRecipes.push(id);
|
||||
console.log('🧠 Learned Recipe:', id);
|
||||
// TODO: Add to Crafting Menu
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
hasRecipe(id) {
|
||||
return this.knownRecipes.includes(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user