diff --git a/docs/REMAINING_SYSTEMS_PLAN.md b/docs/REMAINING_SYSTEMS_PLAN.md new file mode 100644 index 000000000..5dc4df384 --- /dev/null +++ b/docs/REMAINING_SYSTEMS_PLAN.md @@ -0,0 +1,121 @@ +# 🎮 REMAINING SYSTEMS IMPLEMENTATION PLAN +**Date:** 2026-01-05 18:44 CET +**Status:** 2/9 systems complete, 7 remaining + +--- + +## ✅ COMPLETED SYSTEMS (2/9) +1. ✅ **TownRestorationLogic.js** - Full 14-building restoration system +2. ✅ **MuseumEvolutionSystem.js** - 3-stage museum + artifact collection + +--- + +## 🔴 REMAINING SYSTEMS (7/9) + +### **PRIORITY 1: Combat & Survival** + +#### **3. Zombie Scout Leveling System (1-20)** +**File:** `src/systems/ZombieScoutLevelingSystem.js` +**Features:** +- XP gain from combat, exploration, digging +- Level 1-20 progression +- Stat increases per level +- Visual level-up effects +- Skill point unlocks + +#### **4. Zombie Scout Skills** +**File:** `src/systems/ZombieScoutSkills.js` +**Features:** +- Skill tree (digging, combat, utility) +- Active skills (special attacks) +- Passive bonuses +- Skill point allocation +- Visual skill effects + +#### **5. Nomad Raider AI** +**File:** `src/systems/NomadRaiderAI.js` +**Features:** +- Raider spawn logic +- Pathfinding to farm +- Combat AI +- Loot stealing behavior +- Difficulty scaling + +#### **6. Farm Raid System** +**File:** `src/systems/FarmRaidSystem.js` +**Features:** +- Raid triggers (fame, resources) +- Wave spawning +- Defense response +- Damage to buildings/crops +- Raid rewards (defending) + +--- + +### **PRIORITY 2: Town Evolution** + +#### **7. School Buff System** +**File:** `src/systems/SchoolBuffSystem.js` +**Features:** +- Teacher NPC unlocks system +- Skill learning (farming, combat) +- Temporary buffs +- Knowledge tree +- Student progression + +#### **8. NPC Settlement System (Magic Helpers)** +**File:** `src/systems/NPCSettlementSystem.js` +**Features:** +- NPC auto-assistance +- Task delegation +- Worker efficiency +- Happiness/loyalty +- NPC housing + +#### **9. City Gratitude Gift System** +**File:** `src/systems/CityGratitudeSystem.js` +**Features:** +- Population milestones +- Gift unlocks +- Unique rewards +- City reputation +- Special equipment + +--- + +## 📋 IMPLEMENTATION ORDER + +**Batch 1 (Combat Priority):** +1. ZombieScoutLevelingSystem.js +2. ZombieScoutSkills.js +3. NomadRaiderAI.js +4. FarmRaidSystem.js + +**Batch 2 (Town Evolution):** +5. SchoolBuffSystem.js +6. NPCSettlementSystem.js +7. CityGratitudeSystem.js + +--- + +## 🎯 ESTIMATED COMPLETION + +**Per System:** ~20-30 minutes +**Total Time:** ~2.5-3.5 hours +**Current Time:** 18:44 CET +**Est. Completion:** 21:30 CET (tonight) + +--- + +## 📦 DELIVERABLES + +Each system includes: +- Full JavaScript implementation +- Integration with existing systems +- Visual feedback +- Quest hooks +- Save/load support + +--- + +**STARTING IMPLEMENTATION NOW...** diff --git a/src/systems/ZombieScoutLevelingSystem.js b/src/systems/ZombieScoutLevelingSystem.js new file mode 100644 index 000000000..e4da080f2 --- /dev/null +++ b/src/systems/ZombieScoutLevelingSystem.js @@ -0,0 +1,340 @@ +/** + * ZOMBIE SCOUT LEVELING SYSTEM (1-20) + * XP progression, stat increases, level-up rewards + * Integrates with ZombieScout companion + */ + +export class ZombieScoutLevelingSystem { + constructor(scene) { + this.scene = scene; + + // Current stats + this.currentLevel = 1; + this.currentXP = 0; + this.skillPoints = 0; + + // Stats per level + this.baseStats = { + health: 50, + attack: 5, + digSpeed: 1.0, + moveSpeed: 100, + defense: 0 + }; + + this.currentStats = { ...this.baseStats }; + + // XP curve + this.xpRequirements = this.generateXPCurve(); + + // Level rewards + this.levelRewards = new Map(); + + this.init(); + } + + init() { + this.initializeLevelRewards(); + } + + /** + * Generate XP requirements for each level (exponential curve) + */ + generateXPCurve() { + const curve = [0]; // Level 1 = 0 XP + + for (let level = 2; level <= 20; level++) { + // Formula: baseXP * (level ^ 1.5) + const baseXP = 100; + const requiredXP = Math.floor(baseXP * Math.pow(level, 1.5)); + curve.push(requiredXP); + } + + return curve; + } + + /** + * Initialize rewards for each level + */ + initializeLevelRewards() { + // Skill points every level + for (let level = 2; level <= 20; level++) { + this.levelRewards.set(level, { + skillPoints: 1, + statBonus: this.getStatBonusForLevel(level), + specialUnlock: this.getSpecialUnlockForLevel(level) + }); + } + } + + /** + * Get stat bonus for specific level + */ + getStatBonusForLevel(level) { + const bonuses = { + health: 10, // +10 HP per level + attack: 1, // +1 attack per level + digSpeed: 0.05, // +5% dig speed per level + defense: 0.5 // +0.5 defense per level + }; + + // Every 5 levels: bonus move speed + if (level % 5 === 0) { + bonuses.moveSpeed = 10; // +10 speed at levels 5, 10, 15, 20 + } + + return bonuses; + } + + /** + * Get special unlock for milestone levels + */ + getSpecialUnlockForLevel(level) { + const unlocks = { + 5: { type: 'skill', name: 'Basic Attack', description: 'Zombie can attack enemies' }, + 10: { type: 'skill', name: 'Speed Dig', description: 'Dig 50% faster for 10 seconds' }, + 15: { type: 'skill', name: 'Treasure Sense', description: 'Reveal nearby buried items' }, + 20: { type: 'evolution', name: 'Scout Commander', description: 'Zombie becomes elite unit' } + }; + + return unlocks[level] || null; + } + + /** + * Award XP to Zombie Scout + */ + awardXP(amount, source = 'general') { + this.currentXP += amount; + + // Visual feedback + this.showXPGain(amount, source); + + // Check for level up + this.checkLevelUp(); + + console.log(`+${amount} XP from ${source} (${this.currentXP}/${this.getRequiredXP()})`); + } + + /** + * Check if Zombie Scout should level up + */ + checkLevelUp() { + if (this.currentLevel >= 20) return; // Max level cap + + const requiredXP = this.getRequiredXP(); + + if (this.currentXP >= requiredXP) { + this.levelUp(); + } + } + + /** + * Level up Zombie Scout + */ + levelUp() { + this.currentLevel++; + this.currentXP -= this.getRequiredXP(this.currentLevel - 1); // Carry over excess XP + + // Apply stat bonuses + const rewards = this.levelRewards.get(this.currentLevel); + if (rewards) { + // Apply stat increases + for (const [stat, bonus] of Object.entries(rewards.statBonus)) { + this.currentStats[stat] += bonus; + } + + // Award skill points + this.skillPoints += rewards.skillPoints; + + // Special unlock + if (rewards.specialUnlock) { + this.unlockSpecial(rewards.specialUnlock); + } + } + + // Visual effects + this.playLevelUpEffects(); + + // Notification + this.scene.uiSystem?.showNotification( + `Zombie Scout reached Level ${this.currentLevel}!`, + 'level_up', + { skillPoints: this.skillPoints } + ); + + // Update Zombie Scout sprite if evolution + if (this.currentLevel === 20) { + this.evolveScout(); + } + + console.log(`🎉 LEVEL UP! Zombie Scout is now Level ${this.currentLevel}`); + console.log(`Stats:`, this.currentStats); + console.log(`Skill Points: ${this.skillPoints}`); + + // Quest check + this.scene.questSystem?.checkScoutLevel(this.currentLevel); + } + + /** + * Unlock special ability or feature + */ + unlockSpecial(unlock) { + console.log(`✨ Special Unlock: ${unlock.name} - ${unlock.description}`); + + if (unlock.type === 'skill') { + this.scene.zombieScoutSkills?.unlockSkill(unlock.name); + } else if (unlock.type === 'evolution') { + // Mark for visual evolution + this.isEvolved = true; + } + + this.scene.uiSystem?.showNotification( + `Unlocked: ${unlock.name}!`, + 'unlock', + { description: unlock.description } + ); + } + + /** + * Visual evolution at level 20 + */ + evolveScout() { + // Update sprite to "Commander" version + const scout = this.scene.zombieScout; + if (scout) { + scout.setTexture('zombie_scout_commander'); + scout.setScale(scout.scale * 1.2); // Slightly larger + + // VFX: Evolution animation + this.scene.vfxSystem?.playEffect('evolution', scout.x, scout.y); + } + } + + /** + * Award XP for different actions + */ + onCombatKill(enemyType) { + const xpValues = { + 'zombie': 10, + 'raider': 25, + 'mutant': 50, + 'boss': 200 + }; + + this.awardXP(xpValues[enemyType] || 10, 'combat'); + } + + onDigComplete(itemRarity) { + const xpValues = { + 'common': 5, + 'uncommon': 15, + 'rare': 30, + 'legendary': 100 + }; + + this.awardXP(xpValues[itemRarity] || 5, 'digging'); + } + + onExplorationProgress() { + // Award XP for exploring new areas + this.awardXP(20, 'exploration'); + } + + onQuestComplete(questDifficulty) { + const xpValues = { + 'easy': 50, + 'medium': 100, + 'hard': 200, + 'story': 300 + }; + + this.awardXP(xpValues[questDifficulty] || 50, 'quest'); + } + + /** + * Get required XP for current or specific level + */ + getRequiredXP(level = this.currentLevel) { + return this.xpRequirements[level] || 0; + } + + /** + * Get XP progress percentage + */ + getXPProgress() { + if (this.currentLevel >= 20) return 100; + + const required = this.getRequiredXP(); + return Math.min(100, Math.floor((this.currentXP / required) * 100)); + } + + /** + * Visual effects + */ + showXPGain(amount, source) { + // Floating text above Zombie Scout + const scout = this.scene.zombieScout; + if (scout) { + this.scene.vfxSystem?.floatingText(`+${amount} XP`, scout.x, scout.y - 30, '#FFD700'); + } + } + + playLevelUpEffects() { + const scout = this.scene.zombieScout; + if (!scout) return; + + // VFX: Level up particles + this.scene.vfxSystem?.playEffect('level_up', scout.x, scout.y); + + // SFX: Level up sound + this.scene.soundSystem?.play('level_up'); + + // Camera shake + this.scene.cameras.main.shake(200, 0.005); + + // Flash + this.scene.cameras.main.flash(300, 255, 215, 0); // Gold flash + } + + /** + * Get current level data + */ + getLevelData() { + return { + level: this.currentLevel, + xp: this.currentXP, + requiredXP: this.getRequiredXP(), + progress: this.getXPProgress(), + stats: { ...this.currentStats }, + skillPoints: this.skillPoints, + isMaxLevel: this.currentLevel >= 20, + nextUnlock: this.levelRewards.get(this.currentLevel + 1)?.specialUnlock || null + }; + } + + /** + * Save/Load support + */ + getSaveData() { + return { + currentLevel: this.currentLevel, + currentXP: this.currentXP, + skillPoints: this.skillPoints, + currentStats: this.currentStats, + isEvolved: this.isEvolved || false + }; + } + + loadSaveData(data) { + this.currentLevel = data.currentLevel || 1; + this.currentXP = data.currentXP || 0; + this.skillPoints = data.skillPoints || 0; + this.currentStats = data.currentStats || { ...this.baseStats }; + this.isEvolved = data.isEvolved || false; + + // Apply visual evolution if loaded at level 20 + if (this.isEvolved) { + this.evolveScout(); + } + } +}