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:
2025-12-27 23:32:22 +01:00
parent 611cd35777
commit 822c586843
12 changed files with 454 additions and 40 deletions

View File

@@ -1,4 +1,5 @@
// Game Scene - Glavna igralna scena
class GameScene extends Phaser.Scene {
constructor() {
super({ key: 'GameScene' });
@@ -6,13 +7,14 @@ class GameScene extends Phaser.Scene {
this.terrainContainer = null;
this.player = null;
this.npcs = []; // Array za NPCje
this.statusEffectSystem = null;
// Settings
this.settings = {
viewDistance: 'HIGH', // LOW, MEDIUM, HIGH
particles: 'HIGH', // NONE, LOW, HIGH
viewDistance: 'HIGH',
particles: 'HIGH',
shadows: true
};
this.townRestorationSystem = null;
}
async create() {
@@ -258,6 +260,7 @@ class GameScene extends Phaser.Scene {
// Initialize Farming System
this.farmingSystem = new FarmingSystem(this);
this.statusEffectSystem = new StatusEffectSystem(this);
console.log('🌾 Farming system initialized!');
// Initialize Build System
@@ -759,6 +762,12 @@ class GameScene extends Phaser.Scene {
this.craftingUI.toggle();
}
});
// Add M key to transition to Town Square
this.input.keyboard.on('keydown-M', () => {
console.log('🔄 Transitioning to Town Square...');
this.scene.start('TownSquareScene');
});
});
// ========================================================
@@ -774,6 +783,8 @@ class GameScene extends Phaser.Scene {
this.lootSystem = new LootSystem(this);
this.interactionSystem = new InteractionSystem(this);
this.farmingSystem = new FarmingSystem(this);
this.statusEffectSystem = new StatusEffectSystem(this);
this.townRestorationSystem = new TownRestorationSystem(this);
this.buildingSystem = new BuildingSystem(this);
// this.pathfinding = new Pathfinding(this); // REMOVED: Using PathfindingSystem (Worker) instead
this.questSystem = new QuestSystem(this);
@@ -1879,6 +1890,7 @@ class GameScene extends Phaser.Scene {
if (this.lootSystem) this.lootSystem.update(delta);
if (this.interactionSystem) this.interactionSystem.update(delta);
if (this.farmingSystem) this.farmingSystem.update(delta);
if (this.statusEffectSystem) this.statusEffectSystem.update(time, delta);
if (this.buildSystem) this.buildSystem.update(delta);
if (this.questSystem) this.questSystem.update(delta);
if (this.multiplayerSystem) this.multiplayerSystem.update(delta);