This commit is contained in:
2025-12-11 20:41:00 +01:00
parent 6e998d516d
commit 8b37814bd8
11 changed files with 1184 additions and 143 deletions

View File

@@ -169,88 +169,8 @@ class GameScene extends Phaser.Scene {
console.log('👤 Initializing player...');
this.player = new Player(this, 50, 50, this.terrainOffsetX, this.terrainOffsetY);
// Dodaj 3 NPCje (Mixed)
// Dodaj 3 NPCje (Mixed) - Removed zombie
console.log('🧟 Initializing NPCs...');
const npcTypes = ['villager', 'merchant'];
for (let i = 0; i < npcTypes.length; i++) {
const randomX = Phaser.Math.Between(40, 60); // Closer to center
const randomY = Phaser.Math.Between(40, 60);
console.log(`👤 Spawning NPC type: ${npcTypes[i]} at (${randomX}, ${randomY})`);
const npc = new NPC(this, randomX, randomY, this.terrainOffsetX, this.terrainOffsetY, npcTypes[i]);
this.npcs.push(npc);
}
// Dodaj 10 dodatnih Zombijev! - REMOVED BY REQUEST
/*
for (let i = 0; i < 10; i++) {
const randomX = Phaser.Math.Between(10, 90);
const randomY = Phaser.Math.Between(10, 90);
const zombie = new NPC(this, randomX, randomY, this.terrainOffsetX, this.terrainOffsetY, 'zombie');
this.npcs.push(zombie);
}
*/
// ZOMBIE WORKER SYSTEM
console.log('🧟⚒️ Initializing Zombie Worker System...');
this.zombieWorkerSystem = new ZombieWorkerSystem(this);
// SPAWN STARTER ZOMBIE WORKER (8x8 Farm)
console.log('🧟 Spawning STARTER Zombie Worker...');
const starterZombieX = 48; // Inside 8x8 farm (center is 50,50, farm is 46-54)
const starterZombieY = 48;
const starterZombie = new NPC(this, starterZombieX, starterZombieY, this.terrainOffsetX, this.terrainOffsetY, 'zombie');
// Auto-tame the starter zombie
starterZombie.isTamed = true; // Use isTamed (not just tamed)
starterZombie.state = 'IDLE';
if (starterZombie.showEmote) {
starterZombie.showEmote('👋'); // Friendly wave
}
this.npcs.push(starterZombie);
// Assign to farming work
if (this.zombieWorkerSystem) {
this.zombieWorkerSystem.assignWork(starterZombie, 'FARM', 5); // Farming work, 5 tile radius
}
console.log('✅ Starter zombie worker spawned and assigned to farming!');
// GRAVE SYSTEM
console.log('🪦 Initializing Grave System...');
this.graveSystem = new GraveSystem(this);
// SCOOTER REPAIR SYSTEM
console.log('🛵 Initializing Scooter Repair System...');
this.scooterRepairSystem = new ScooterRepairSystem(this);
// EXPANSION SYSTEM
console.log('🗺️ Initializing Expansion System...');
this.expansionSystem = new ExpansionSystem(this);
// BLUEPRINT SYSTEM
console.log('📜 Initializing Blueprint System...');
this.blueprintSystem = new BlueprintSystem(this);
// WORKSTATION SYSTEM
console.log('🏭 Initializing Workstation System...');
this.workstationSystem = new WorkstationSystem(this);
// ELITE ZOMBIE v City območju (1x za testiranje)
console.log('👹 Spawning ELITE ZOMBIE in City...');
const eliteX = Phaser.Math.Between(50, 80); // City area
const eliteY = Phaser.Math.Between(50, 80);
const elite = new NPC(this, eliteX, eliteY, this.terrainOffsetX, this.terrainOffsetY, 'elite_zombie');
this.npcs.push(elite);
// MUTANTS (Troll & Elf)
console.log('👹 Spawning MUTANTS...');
this.npcs.push(new NPC(this, 60, 20, this.terrainOffsetX, this.terrainOffsetY, 'troll')); // Forest
this.npcs.push(new NPC(this, 70, 70, this.terrainOffsetX, this.terrainOffsetY, 'elf')); // City
// ANIMALS (Peaceful + Mutated)
console.log('🐄 Spawning ANIMALS...');
this.npcs.push(new NPC(this, 22, 22, this.terrainOffsetX, this.terrainOffsetY, 'cow'));
this.npcs.push(new NPC(this, 24, 20, this.terrainOffsetX, this.terrainOffsetY, 'chicken'));
this.npcs.push(new NPC(this, 25, 23, this.terrainOffsetX, this.terrainOffsetY, 'chicken'));
this.npcs.push(new NPC(this, 62, 22, this.terrainOffsetX, this.terrainOffsetY, 'cow_mutant')); // Aggressive mutant
// ALL NPCs REMOVED - Solo farming mode
console.log('🌾 Solo farming mode - no NPCs');
// Easter Egg: Broken Scooter
console.log('🛵 Spawning Scooter Easter Egg...');
@@ -614,10 +534,12 @@ class GameScene extends Phaser.Scene {
}
}
// NPC Update
// NPC Update - DISABLED (no NPCs)
/*
for (const npc of this.npcs) {
npc.update(delta);
}
*/
// Vehicles Update
if (this.vehicles) {
@@ -706,6 +628,10 @@ class GameScene extends Phaser.Scene {
}
spawnNightZombie() {
// DISABLED - No NPCs allowed
return;
/*
if (!this.player || this.npcs.length > 50) return;
const playerPos = this.player.getPosition();
@@ -725,6 +651,7 @@ class GameScene extends Phaser.Scene {
zombie.state = 'CHASE';
this.npcs.push(zombie);
}
*/
}
showHordeWarning() {
@@ -763,6 +690,10 @@ class GameScene extends Phaser.Scene {
}
spawnBoss() {
// DISABLED - No NPCs allowed
return;
/*
if (!this.player) return;
console.log('👑 SPANWING ZOMBIE KING!');
const playerPos = this.player.getPosition();
@@ -773,6 +704,7 @@ class GameScene extends Phaser.Scene {
this.npcs.push(boss);
this.showHordeWarning();
this.events.emit('show-floating-text', { x: this.player.x, y: this.player.y - 100, text: "THE KING HAS ARRIVED!", color: '#AA00FF' });
*/
}
saveGame() {