feat(expansion): implement Phase 3 (Town Restoration) and Phase 4 (Cannabis Textiles)
- Added TownSquareScene and linked it with M key transition - Integrated TownRestorationSystem with material costs and inventory - Added locked shop items in NPCShopSystem until buildings are restored - Updated InteractionSystem to handle ruin restoration triggers - Expanded Cannabis farming to yield Hemp Fiber - Added Hemp Clothing crafting recipe and procedural icons - Refactored StatusEffectSystem and NPCShopSystem to global classes
This commit is contained in:
@@ -208,6 +208,11 @@ class TownRestorationSystem {
|
||||
// Check milestones
|
||||
this.checkMilestones();
|
||||
|
||||
// Update visuals in the current scene
|
||||
if (this.scene.updateBuildingVisuals) {
|
||||
this.scene.updateBuildingVisuals(buildingId);
|
||||
}
|
||||
|
||||
this.showNotification({
|
||||
title: 'Building Complete!',
|
||||
text: `✅ ${building.name} restored!`,
|
||||
@@ -319,19 +324,23 @@ class TownRestorationSystem {
|
||||
return rewards[milestone] || { text: 'Bonus unlocked!' };
|
||||
}
|
||||
|
||||
/**
|
||||
* Check materials
|
||||
*/
|
||||
hasMaterials(required) {
|
||||
// TODO: Check actual inventory
|
||||
return true; // For now
|
||||
hasMaterials(materials) {
|
||||
if (!this.scene.inventorySystem) return true; // Safety fallback
|
||||
|
||||
for (const [item, count] of Object.entries(materials)) {
|
||||
if (!this.scene.inventorySystem.hasItem(item, count)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Consume materials
|
||||
*/
|
||||
consumeMaterials(materials) {
|
||||
// TODO: Remove from inventory
|
||||
if (!this.scene.inventorySystem) return;
|
||||
|
||||
for (const [item, count] of Object.entries(materials)) {
|
||||
this.scene.inventorySystem.removeItem(item, count);
|
||||
}
|
||||
console.log('📦 Materials consumed:', materials);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user