diff --git a/src/scenes/GameScene.js b/src/scenes/GameScene.js index 2b38f46f0..7eb9cffc7 100644 --- a/src/scenes/GameScene.js +++ b/src/scenes/GameScene.js @@ -1249,6 +1249,172 @@ class GameScene extends Phaser.Scene { this.input.keyboard.on('keydown-F8', () => this.saveGame()); this.input.keyboard.on('keydown-F9', () => this.loadGame()); + // ======================================================== + // 🎆 WEEK 1 DEBUG COMMANDS - Test Keyboard Shortcuts + // ======================================================== + + // F10 - Spawn Electrician NPC near player + this.input.keyboard.on('keydown-F10', () => { + if (this.buildingUpgradeSystem && this.player) { + const x = this.player.gridX + 3; + const y = this.player.gridY; + this.buildingUpgradeSystem.spawnElectrician(x * 48, y * 48); + console.log('⚡ Electrician spawned at player location!'); + } + }); + + // F11 - Spawn Zombie Statistician NPC near player + this.input.keyboard.on('keydown-F11', () => { + if (this.cityManagementSystem && this.player) { + const x = this.player.gridX - 3; + const y = this.player.gridY; + this.cityManagementSystem.spawnStatistician(x * 48, y * 48); + console.log('👔 Zombie Statistician spawned at player location!'); + } + }); + + // F12 - Build ALL Week 1 buildings near player + this.input.keyboard.on('keydown-F12', () => { + if (this.player) { + const baseX = this.player.gridX; + const baseY = this.player.gridY; + + // Generator + if (this.buildingUpgradeSystem) { + this.buildingUpgradeSystem.buildGenerator((baseX + 5) * 48, baseY * 48); + console.log('🏭 Generator built!'); + } + + // City Hall + if (this.cityManagementSystem) { + this.cityManagementSystem.placeCityHall((baseX - 5) * 48, baseY * 48); + console.log('🏛️ City Hall built!'); + } + + // Population Board + if (this.cityManagementSystem) { + this.cityManagementSystem.placePopulationBoard((baseX - 5) * 48, (baseY + 3) * 48); + console.log('📊 Population Board built!'); + } + + // Resource Depot + if (this.resourceLogisticsSystem) { + this.resourceLogisticsSystem.addDepot((baseX) * 48, (baseY - 5) * 48); + console.log('📦 Resource Depot built!'); + } + + console.log('✅ All Week 1 buildings constructed!'); + } + }); + + // NUMPAD 1 - Add test resources + this.input.keyboard.on('keydown-NUMPAD_ONE', () => { + if (this.resourceLogisticsSystem) { + this.resourceLogisticsSystem.addResource('wood', 100); + this.resourceLogisticsSystem.addResource('food', 50); + this.resourceLogisticsSystem.addResource('stone', 75); + console.log('💎 Added test resources: 100 wood, 50 food, 75 stone!'); + } + }); + + // NUMPAD 2 - Drop test resources near player + this.input.keyboard.on('keydown-NUMPAD_TWO', () => { + if (this.resourceLogisticsSystem && this.player) { + const x = this.player.x; + const y = this.player.y; + this.resourceLogisticsSystem.dropResource(x + 50, y, 'wood', 10); + this.resourceLogisticsSystem.dropResource(x - 50, y, 'food', 5); + this.resourceLogisticsSystem.dropResource(x, y + 50, 'stone', 8); + console.log('📦 Dropped test resources around player!'); + } + }); + + // NUMPAD 3 - Hire Electrician (auto) + this.input.keyboard.on('keydown-NUMPAD_THREE', () => { + if (this.buildingUpgradeSystem && this.buildingUpgradeSystem.electrician) { + this.buildingUpgradeSystem.hireElectrician(); + console.log('⚡ Electrician hired!'); + } else { + console.warn('⚠️ Spawn Electrician first (F10)!'); + } + }); + + // NUMPAD 4 - Hire Zombie Statistician (auto) + this.input.keyboard.on('keydown-NUMPAD_FOUR', () => { + if (this.cityManagementSystem && this.cityManagementSystem.statistician) { + this.cityManagementSystem.hireStatistician(); + console.log('👔 Zombie Statistician hired!'); + } else { + console.warn('⚠️ Spawn Zombie Statistician first (F11)!'); + } + }); + + // NUMPAD 5 - Trigger Electrician inspection + this.input.keyboard.on('keydown-NUMPAD_FIVE', () => { + if (this.buildingUpgradeSystem && this.buildingUpgradeSystem.electrician) { + this.buildingUpgradeSystem.electricianInspectGenerator(); + console.log('⚡ Electrician inspecting generator!'); + } else { + console.warn('⚠️ Electrician not spawned or not hired!'); + } + }); + + // NUMPAD 6 - Trigger Electrician repair + this.input.keyboard.on('keydown-NUMPAD_SIX', () => { + if (this.buildingUpgradeSystem && this.buildingUpgradeSystem.electrician) { + this.buildingUpgradeSystem.electricianRepairGenerator(); + console.log('⚡ Electrician repairing generator!'); + } else { + console.warn('⚠️ Electrician not spawned or not hired!'); + } + }); + + // NUMPAD 7 - Trigger Statistician board update + this.input.keyboard.on('keydown-NUMPAD_SEVEN', () => { + if (this.cityManagementSystem && this.cityManagementSystem.statistician) { + this.cityManagementSystem.statisticianUpdateBoard(); + console.log('👔 Zombie Statistician updating board!'); + } else { + console.warn('⚠️ Zombie Statistician not spawned or not hired!'); + } + }); + + // NUMPAD 8 - Show all Week 1 stats + this.input.keyboard.on('keydown-NUMPAD_EIGHT', () => { + console.log('📊 WEEK 1 SYSTEMS STATUS:'); + + if (this.resourceLogisticsSystem) { + const resources = this.resourceLogisticsSystem.getResources(); + console.log('📦 Resources:', resources); + } + + if (this.cityManagementSystem) { + const population = this.cityManagementSystem.getPopulation(); + console.log('👥 Population:', population); + console.log('👔 Statistician employed:', this.cityManagementSystem.statisticianEmployed); + } + + if (this.buildingUpgradeSystem) { + console.log('⚡ Generator health:', this.buildingUpgradeSystem.generatorHealth + '%'); + console.log('⚡ Power status:', this.buildingUpgradeSystem.isPowered ? 'ONLINE' : 'OFFLINE'); + console.log('⚡ Electrician employed:', this.buildingUpgradeSystem.electricianEmployed); + } + }); + + console.log('🎮 Week 1 Debug Commands enabled!'); + console.log(' F10 = Spawn Electrician'); + console.log(' F11 = Spawn Zombie Statistician'); + console.log(' F12 = Build all Week 1 buildings'); + console.log(' Numpad 1 = Add resources'); + console.log(' Numpad 2 = Drop resources'); + console.log(' Numpad 3 = Hire Electrician'); + console.log(' Numpad 4 = Hire Statistician'); + console.log(' Numpad 5 = Electrician inspect'); + console.log(' Numpad 6 = Electrician repair'); + console.log(' Numpad 7 = Statistician update board'); + console.log(' Numpad 8 = Show all stats'); + // ======================================================== + // Spawn Boss (Debug) this.input.keyboard.on('keydown-K', () => this.spawnBoss());