phase 11 part1

This commit is contained in:
2025-12-08 12:30:15 +01:00
parent 3336b59e7d
commit 07f0752d81
15 changed files with 1383 additions and 133 deletions

View File

@@ -630,10 +630,11 @@ class NPC {
this.state = 'TAMED';
console.log('🧟❤️ Zombie TAMED!');
this.isTamed = true; // Mark as tamed
// Register to ZombieWorkerSystem
if (this.scene.zombieSystem) {
this.scene.zombieSystem.registerWorker(this);
// Register to ZombieWorkerSystem (assign FARM work by default)
if (this.scene.zombieWorkerSystem) {
this.scene.zombieWorkerSystem.assignWork(this, 'FARM', 5);
}
// Visual Feedback

View File

@@ -44,35 +44,41 @@ class Scooter {
}
tryFix(player) {
// Logic: Check if player has tools?
// User said: "ga more popraviti" (needs to fix it).
// Let's just require a short delay or check for 'wrench' if we had one.
// For easter egg, let's say hitting it with a hammer works, or just interacting.
// Let's make it simple: "Fixing Scooter..." progress.
// Use ScooterRepairSystem to check parts/tools
if (!this.scene.scooterRepairSystem) {
console.log('🚫 Repair system not available!');
return;
}
console.log('🔧 Fixing Scooter...');
this.scene.events.emit('show-floating-text', {
x: this.sprite.x,
y: this.sprite.y - 50,
text: "Fixing...",
color: '#FFFF00'
});
console.log('🔧 Attempting to repair Scooter...');
// Plays sound
if (this.scene.soundManager) this.scene.soundManager.playHit(); // Clank sounds
const success = this.scene.scooterRepairSystem.repairScooter();
// Delay 2 seconds then fix
this.scene.time.delayedCall(2000, () => {
if (success) {
this.isBroken = false;
this.createSprite(); // Update texture to shiny
this.createSprite(); // Update to fixed texture
this.scene.events.emit('show-floating-text', {
x: this.sprite.x,
y: this.sprite.y - 50,
text: "Scooter Fixed!",
text: "🛵 REPAIRED!",
color: '#00FF00'
});
console.log('✅ Scooter Fixed!');
});
if (this.scene.soundManager) {
this.scene.soundManager.playHarvest(); // Success sound
}
} else {
// Show what's missing
this.scene.scooterRepairSystem.listMissingParts();
this.scene.events.emit('show-floating-text', {
x: this.sprite.x,
y: this.sprite.y - 50,
text: "Missing Parts!",
color: '#FF0000'
});
}
}
toggleRide(player) {