44
0
13d
User prompt
Please fix the bug: 'storage.get is not a function' in or related to this line: 'if (storage.get(key) === undefined) {' Line Number: 5456 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Please fix the bug: 'storage.get is not a function' in or related to this line: 'if (storage.get(key) === undefined) {' Line Number: 5456 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
oyuna başarımlar sekmesi ekle !
User prompt
20 Level e çıkaralım Göz seviyesini Emperor Time için
User prompt
Gözün seviyesini dövüşerek+Antrenman yaparak arttıralım
User prompt
Emperor Time Dövüşte istediğimiz zaman kullanabiliriz ama saniye başı 2 ila 3 can götürsün ve Scarlet Eye's ı 3 Level yapmamız gereksin Emperor Time Nen Vow unu Create Hatsu kısmında yapmak için kısaca Gizli bir hatsu Emperor Time ve ekstra Kurta lar için veya tüm klanlar için özel Nen yeminleri ekle
User prompt
Her Klan kendi hatsusunu Boostlasın ve Kurta olan biri Nen Vow kullanırken Emperor Time ı yemin olarak yaratsın yani 2. Hatsu yaratmış olsun dövüşte ya biz istersek açabilirizki ekran Kırmızıya dönsün böyle olunca ve Debug Mode a istediğimiz klana geçme ekle
User prompt
Clan:Kurta,Lucifer,Netero,Freecss,Zoldyck falan diye yazsın bunlardan biri denk gelirse bize yoksa Clan:None yazsın
User prompt
Race imiz Human olduğu zaman Netero,Zoldyck,Freecss,Lucifer,Kurta gibi Klan Bonusları alabilelim nadirlikler %10 ila %20 maks
User prompt
Bossların Canlarını arttır he bide Dövüş sırasında Yeni Nen yeminleri yapabilelim mesela canımız 200 ün altına düşerse gidip Tüm Potansiyeline Erişme Yemini yapabilelim karşılığında 100 Seviye olalım ki bu Normal sınırın yani 50 nin üstüne çıkmak ! oluyor +10000 Aura +2000 Can Tüm Hatsuların NİHAİ versiyonları ama karşılığında savaş sonunda ölürüz!
User prompt
Kurapika Boss u ekle ! 5 Saldırısı olsun Serçe parmağındaki onun istediğini yapmazsak tek atsın öldürsün direk diyerlerini yap bide ırkımız Level imizin yanında Yazsın Race:Human Race:Chimera Ant/King/Royal anladın sen
User prompt
Debug Mode sekmesine +100 Stat da eklesene hemen +1000 Stat ın altına
User prompt
Boss lara belirli bir Savunma ekle (neden çünkü Gon a falan tek atıyoruz normal Hatsu açtığımız zamanki Statlarla Boss lar Ken falan kullansın Ten kullansın savunma için ) ve her bölgeye bir tane at NGL olay örgüsü baya uzun olsun ve orada bir Chimera karıncasına kaybedersek ve bizi yerse Chimera karıncası olarak Reankarne olabilelim %80 şansla normal Chimera karıncası %15 Kraliyet muhafızı %5 Kral olarak
User prompt
Bosslara gidemiyoruz Gittiğimiz yerlerdeki Olay örgülerini uzat ve Boss larla savaşacağımız bir seçenek ekle
User prompt
Bossların saldırıları daha cezalandırıcı olsun ve özel olsun ve esktra başka özel Boss lar ekle bu Bosslarla Boss fight ta değilde Travel ile gittiğimiz yerlerde savaşalım ve Hatsumuza göre savaş ekranındayken extra mesela Jajanken in 3 özelliğide olsun biz Hatsumuzun özelliklerine çalışalım vede
User prompt
Boss lara da Nen yeteneği ataki Specialist oynarken onlardan aynı sanki Enchancer gibi Gon la kapışırken Jajanken:Rock ı kopyalayıp kullana bileyim !
User prompt
Enchancer a Gon un Hatsusunu ekle ve Specialist te Kopyalama yeteneği için savaşta 3 tane boş slot koy karşımızdaki kişinin yeteneğini kopyalayıp kullanalım !
User prompt
yeni Gidilebilecek alanlar ekle ve Nen türleri için daha fazla Hatsu ve savaşlarda bu Hatsular için özel seçenekler olsun
User prompt
yeni Gidilebilecek alanlar ekle ve Nen türleri için daha fazla Hatsu ve savaşlarda bu Hatsular için özel seçenekler olsun ve Greed Island otomatik 40 seviyede açılsın (mesela Savaşta ekstra haraket veren Hatsular Gon un Jajanken i gibi)
User prompt
Hunter Exam butonu yok ekle bi yere
User prompt
Bosslarda Hatsularını kullanabilsin mesela Gon Jajanken kullansın Rock,Paper,Scisor Killua Lightning Hatsu kullansın Hisoka Bungee Gum kullansın
User prompt
Nen butonunun yerini değiştir
User prompt
Nen butonu kayboluyor şimdide her zaman ekranda dursun o diyer butonlar gibi
User prompt
Yeni bölgeler ekle gidile bilen ve bizim şu an oyunda olan Greed Island Newyork ve Dark Continent e özel diyaloglar yaz her birinde arka plan değişsin ve uzun bir hikaye örgüsü olsun ve Savaş sistemi yap Savaşlarda 1 biz 1 karşı taraf hamle yapacak ekranda yeteneklerimiz Aura mız canımız falan olacak bide açtığımız yeteneklerimiz mesela Gon Jajanken:Scisor ! kullandı Parry basarak durdurabiliriz Str stat ımız 400 ise
User prompt
butonlar kayboluyor (Nen le Hatsu yaratma butonları)birde Debug mode olarak kenara sadece Yaratıcı diye otomatik stat verebileceğim butonlar koysana test için
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var MenuButton = Container.expand(function (text, callback) { var self = Container.call(this); var buttonBg = self.attachAsset('buttonBg', { anchorX: 0.5, anchorY: 0.5 }); var buttonText = new Text2(text, { size: 40, fill: 0xFFFFFF }); buttonText.anchor.set(0.5, 0.5); self.addChild(buttonText); self.callback = callback; self.isHovered = false; self.down = function (x, y, obj) { LK.getSound('menuSelect').play(); if (self.callback) { self.callback(); } }; self.move = function (x, y, obj) { if (!self.isHovered) { self.isHovered = true; buttonBg.tint = 0x6a6a6a; } }; return self; }); var SkillButton = Container.expand(function (skill, skillData) { var self = Container.call(this); var buttonColor = skillData.unlocked ? 0x4a4a4a : 0x2a2a2a; var buttonBg = LK.getAsset('buttonBg', { anchorX: 0.5, anchorY: 0.5, tint: buttonColor }); self.addChild(buttonBg); var skillText = new Text2(skillData.name, { size: 32, fill: skillData.unlocked ? 0xFFFFFF : 0x888888 }); skillText.anchor.set(0.5, 0.3); self.addChild(skillText); var costText = new Text2("SP: " + skillData.cost, { size: 24, fill: 0x00FF00 }); costText.anchor.set(0.5, 0.7); self.addChild(costText); self.skill = skill; self.skillData = skillData; self.down = function (x, y, obj) { if (!skillData.unlocked && player.skillPoints >= skillData.cost) { LK.getSound('levelUp').play(); unlockSkill(skill, skillData); } }; return self; }); var StatBar = Container.expand(function (label, maxValue, currentValue, color) { var self = Container.call(this); var labelText = new Text2(label + ": " + currentValue + "/" + maxValue, { size: 30, fill: 0xFFFFFF }); labelText.anchor.set(0, 0.5); self.addChild(labelText); var barBg = self.attachAsset('statBar', { anchorX: 0, anchorY: 0.5, x: 200 }); var barFill = LK.getAsset('statBarFill', { anchorX: 0, anchorY: 0.5, x: 200, scaleX: currentValue / maxValue, tint: color || 0x00ff00 }); self.addChild(barFill); self.maxValue = maxValue; self.currentValue = currentValue; self.barFill = barFill; self.labelText = labelText; self.updateValue = function (newValue) { self.currentValue = Math.max(0, Math.min(newValue, self.maxValue)); self.barFill.scaleX = self.currentValue / self.maxValue; self.labelText.setText(label + ": " + self.currentValue + "/" + self.maxValue); }; return self; }); var StoryPanel = Container.expand(function () { var self = Container.call(this); var panelBg = self.attachAsset('backgroundPanel', { anchorX: 0.5, anchorY: 0.5 }); var storyText = new Text2("", { size: 34, fill: 0xFFFFFF, wordWrap: true, wordWrapWidth: 1700 }); storyText.anchor.set(0.5, 0.5); self.addChild(storyText); self.storyText = storyText; self.setText = function (text) { self.storyText.setText(text); }; return self; }); var TrainingButton = Container.expand(function (activity, activityData) { var self = Container.call(this); var buttonBg = self.attachAsset('buttonBg', { anchorX: 0.5, anchorY: 0.5 }); var buttonText = new Text2(activityData.name, { size: 36, fill: 0xFFFFFF }); buttonText.anchor.set(0.5, 0.3); self.addChild(buttonText); var costText = new Text2("Energy: " + activityData.cost, { size: 24, fill: 0xFFFF00 }); costText.anchor.set(0.5, 0.7); self.addChild(costText); self.activity = activity; self.activityData = activityData; self.isHovered = false; self.down = function (x, y, obj) { if (player.energy >= activityData.cost) { LK.getSound('menuSelect').play(); performTraining(activity); } }; self.move = function (x, y, obj) { if (!self.isHovered) { self.isHovered = true; buttonBg.tint = 0x6a6a6a; } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x1a1a1a }); /**** * Game Code ****/ // Game State var gameState = "characterCreation"; var trainingState = "menu"; // menu, training, skillTree var debugMode = true; // Set to false to hide debug buttons var player = { name: "Hunter", nenType: "", level: 1, experience: 0, maxExperience: 100, health: 100, maxHealth: 100, aura: 50, maxAura: 50, stats: { strength: 10, speed: 10, intelligence: 10, aura: 10 }, abilities: [], currentChapter: 1, energy: 100, maxEnergy: 100, skillPoints: 0, trainingCount: 0, hunterExamCompleted: false, hatsu: null, nenVow: null, hatsuMastery: 0, copiedAbilities: [null, null, null], copiedAbilityWitnesses: {} }; // Nen Types Data var nenTypes = { "Enhancer": { description: "Enhancers can increase the natural abilities of an object or one's own body.", bonuses: { strength: 3, health: 20 } }, "Emitter": { description: "Emitters can separate their aura from their body and control it from a distance.", bonuses: { aura: 10, intelligence: 2 } }, "Manipulator": { description: "Manipulators can control living or non-living things with their aura.", bonuses: { intelligence: 3, aura: 5 } }, "Transmuter": { description: "Transmuters can change the properties of their aura to mimic other substances.", bonuses: { speed: 3, aura: 5 } }, "Conjurer": { description: "Conjurers can create physical objects out of their aura.", bonuses: { intelligence: 2, aura: 8 } }, "Specialist": { description: "Specialists have unique abilities that don't fit into other categories.", bonuses: { aura: 15 } } }; // Story Chapters - Hunter Exam Stages var storyChapters = { 1: { title: "Hunter Exam - Phase 1: The Long Run", text: "Examiner Satotz leads 404 applicants through the Milsy Wetlands. You must keep up with his pace while avoiding the creatures lurking in the fog. How do you proceed?", choices: [{ text: "Stay close to the examiner and maintain steady pace", action: "steady_pace" }, { text: "Sprint ahead to secure a good position", action: "sprint_ahead" }, { text: "Help other struggling candidates", action: "help_others" }] }, 2: { title: "Hunter Exam - Phase 2: Gourmet Hunters", text: "Examiners Menchi and Buhara challenge you to cook! Buhara wants roasted whole pig, while Menchi demands the perfect boiled egg. The kitchen is chaotic with desperate candidates.", choices: [{ text: "Hunt the Great Stamp pig with strategy", action: "hunt_strategically" }, { text: "Attempt to cook multiple dishes quickly", action: "cook_multiple" }, { text: "Observe successful candidates and learn", action: "observe_learn" }] }, 3: { title: "Hunter Exam - Phase 3: Trick Tower", text: "The 50-hour time limit challenge in the Trick Tower! You must navigate traps, puzzles, and face other candidates. Your current path leads to a choice of three doors.", choices: [{ text: "Choose the door marked with strength symbol", action: "strength_door" }, { text: "Choose the door marked with wisdom symbol", action: "wisdom_door" }, { text: "Choose the door marked with agility symbol", action: "agility_door" }] }, 4: { title: "Hunter Exam - Phase 4: Zevil Island", text: "You've landed on Zevil Island! Each candidate must collect 6 points total - 3 from your target's badge, 1 from your own, and 2 from anyone else's. Your target has been spotted near the rocky cliffs.", choices: [{ text: "Ambush your target using stealth", action: "stealth_ambush" }, { text: "Challenge your target to direct combat", action: "direct_combat" }, { text: "Set a trap and wait patiently", action: "set_trap" }] }, 5: { title: "Hunter Exam - Phase 5: Final Tournament", text: "The final phase! A tournament bracket has been set. You face a dangerous opponent who seems to have killed before. The fight can end in victory, defeat, or death. What's your strategy?", choices: [{ text: "Fight with full power from the start", action: "full_power" }, { text: "Analyze opponent's fighting style first", action: "analyze_first" }, { text: "Try to win through tactics and cunning", action: "tactical_approach" }] } }; // Boss System var bosses = { gon: { name: "Gon Freecss", level: 25, health: 500, maxHealth: 500, stats: { strength: 30, speed: 35, intelligence: 20, aura: 25 }, abilities: ["Rock Paper Scissors", "Enhanced Senses"], hatsu: { name: "Jajanken", variants: ["Rock", "Paper", "Scissors"], auraRequired: 30, description: "Gon's signature rock-paper-scissors based attack" }, reward: { experience: 200, skillPoints: 10, unlockMessage: "You've learned Gon's determination!" } }, killua: { name: "Killua Zoldyck", level: 30, health: 450, maxHealth: 450, stats: { strength: 25, speed: 45, intelligence: 35, aura: 30 }, abilities: ["Thunderbolt", "Assassin Techniques"], hatsu: { name: "Lightning Palm", auraRequired: 25, description: "Killua transmutes his aura into electricity" }, reward: { experience: 250, skillPoints: 12, unlockMessage: "You've learned Killua's lightning speed!" } }, hisoka: { name: "Hisoka Morow", level: 50, health: 800, maxHealth: 800, stats: { strength: 40, speed: 38, intelligence: 45, aura: 50 }, abilities: ["Bungee Gum", "Texture Surprise"], hatsu: { name: "Bungee Gum", auraRequired: 35, description: "Hisoka's rubber and gum properties aura" }, reward: { experience: 400, skillPoints: 20, unlockMessage: "You've survived Hisoka's twisted game!" } }, illumi: { name: "Illumi Zoldyck", level: 45, health: 700, maxHealth: 700, stats: { strength: 35, speed: 30, intelligence: 50, aura: 45 }, abilities: ["Needle People", "Manipulation"], hatsu: { name: "Needle People", auraRequired: 40, description: "Illumi manipulates targets with his needles" }, reward: { experience: 350, skillPoints: 18, unlockMessage: "You've overcome Illumi's manipulation!" } } }; // Travel Locations var travelLocations = { heavensArena: { name: "Heaven's Arena", description: "Fight through 200 floors of the famous combat tower. Face stronger opponents as you climb higher.", unlocked: true, floors: 200, currentFloor: 1, background: 0x4a4a4a, opponents: [{ name: "Floor 50 Fighter", level: 10, reward: { exp: 50, money: 100 } }, { name: "Floor 100 Fighter", level: 20, reward: { exp: 100, money: 200 } }, { name: "Floor 150 Fighter", level: 30, reward: { exp: 150, money: 300 } }, { name: "Floor 200 Champion", level: 40, reward: { exp: 200, money: 500 } }], specialBoss: { name: "Razor", level: 45, health: 800, maxHealth: 800, stats: { strength: 45, speed: 40, intelligence: 35, aura: 50 }, abilities: ["14 Devils", "Emission Mastery"], hatsu: { name: "14 Devils", auraRequired: 40, description: "Razor summons his 14 emission devils for devastating attacks" }, reward: { experience: 400, skillPoints: 25, unlockMessage: "You've conquered Heaven's Arena!" } } }, yorknewCity: { name: "Yorknew City", description: "The bustling auction city where the Phantom Troupe lurks in shadows.", unlocked: false, unlockRequirement: "Complete Heaven's Arena", background: 0x2a2a4a, story: "You arrive in Yorknew City during the annual auction. The streets buzz with activity, but there's an underlying tension. Reports of the Phantom Troupe's presence have put everyone on edge. As a Hunter, you must decide your next move carefully.", specialBoss: { name: "Chrollo Lucilfer", level: 55, health: 1000, maxHealth: 1000, stats: { strength: 40, speed: 45, intelligence: 60, aura: 55 }, abilities: ["Skill Hunter", "Leadership"], hatsu: { name: "Skill Hunter", auraRequired: 50, description: "Chrollo can use any stolen ability with devastating effect" }, reward: { experience: 600, skillPoints: 35, unlockMessage: "You've survived the Spider's web!" } }, chapters: [{ title: "Arrival in Yorknew", text: "The towering skyscrapers of Yorknew City cast long shadows as you step off the airship. The Southernpiece Auction is about to begin, and you can sense the aura of powerful individuals gathering. What's your approach?", choices: [{ text: "Head to the auction house immediately", action: "auction_direct", consequences: "You gain intel on rare items but attract unwanted attention" }, { text: "Gather information in the underground markets", action: "underground_info", consequences: "You learn about Phantom Troupe movements" }, { text: "Contact the Hunter Association for backup", action: "hunter_backup", consequences: "You gain allies but alert criminals to Hunter presence" }] }, { title: "The Phantom Troupe Encounter", text: "During your investigation, you've crossed paths with members of the notorious Phantom Troupe. Their leader, Chrollo, stands before you with an unsettling calm. The air crackles with deadly nen energy.", choices: [{ text: "Challenge them directly", action: "direct_confrontation", consequences: "High risk, high reward - massive stat gains if you survive" }, { text: "Attempt to negotiate", action: "negotiate_troupe", consequences: "Learn secret techniques but make dangerous enemies" }, { text: "Retreat and plan an ambush", action: "tactical_retreat", consequences: "Safe but miss opportunity for major growth" }] }, { title: "The Underground Network", text: "You've discovered a hidden network beneath Yorknew City. Crime families, black market dealers, and information brokers operate in these shadows. Your presence hasn't gone unnoticed by the local powers.", choices: [{ text: "Infiltrate the crime families", action: "infiltrate_crime", consequences: "Learn underground secrets but risk being discovered" }, { text: "Seek alliance with information brokers", action: "broker_alliance", consequences: "Gain valuable intel network but owe favors" }, { text: "Challenge the underground bosses", action: "underground_bosses", consequences: "Establish dominance but make many enemies" }] }, { title: "The Auction House Heist", text: "The Phantom Troupe strikes! The auction house is under attack and chaos erupts. You must decide whether to stop them, help them, or use the confusion to your advantage.", choices: [{ text: "Try to stop the Phantom Troupe", action: "stop_troupe", consequences: "Heroic action but extremely dangerous" }, { text: "Use the chaos to steal rare items", action: "steal_items", consequences: "Gain powerful artifacts but become a criminal" }, { text: "Help evacuate innocent people", action: "save_innocents", consequences: "Gain respect but miss rare opportunities" }] }] }, greedIsland: { name: "Greed Island", description: "Enter the legendary game world where nen users compete for ultimate prizes.", unlocked: false, unlockRequirement: "Reach Level 40", background: 0x2a4a2a, story: "You've obtained one of the rare copies of Greed Island, the legendary game created by Nen users. As you activate the game, reality shifts around you and you find yourself in a vibrant virtual world where everything is real and death is permanent.", specialBoss: { name: "Genthru (The Bomber)", level: 50, health: 900, maxHealth: 900, stats: { strength: 50, speed: 35, intelligence: 40, aura: 45 }, abilities: ["Little Flower", "Countdown"], hatsu: { name: "Little Flower", auraRequired: 45, description: "Genthru creates explosive aura that can devastate anything he touches" }, reward: { experience: 500, skillPoints: 30, unlockMessage: "You've disarmed the Bomber!" } }, chapters: [{ title: "Tutorial Island", text: "Welcome to Greed Island! A cheerful NPC named Elena explains the rules. You must collect designated cards to win, but beware - other players will kill for rare cards. Your starting city of Antokiba spreads out before you.", choices: [{ text: "Head to the rocky area to hunt monsters", action: "hunt_monsters", consequences: "Gain combat experience and basic spell cards" }, { text: "Team up with other new players", action: "form_team", consequences: "Safety in numbers but shared rewards" }, { text: "Seek out veteran players for advice", action: "veteran_advice", consequences: "Learn advanced strategies but reveal your rookie status" }] }, { title: "The Card Collection Crisis", text: "You've been collecting cards steadily, but a rival player group has targeted you. They want your rare cards and won't hesitate to kill for them. The island's dangerous wildlife adds another layer of threat.", choices: [{ text: "Set traps around your base", action: "defensive_traps", consequences: "Protect your cards but limit exploration" }, { text: "Launch a preemptive strike on rivals", action: "attack_rivals", consequences: "Eliminate threats but become notorious" }, { text: "Propose an alliance with rivals", action: "rival_alliance", consequences: "Share resources but risk betrayal" }] }, { title: "The Restricted Areas", text: "You've discovered areas of Greed Island that are off-limits to most players. Ancient ruins, dangerous monsters, and legendary cards await those brave enough to venture into the forbidden zones.", choices: [{ text: "Explore the ancient ruins alone", action: "ruins_solo", consequences: "Uncover ancient secrets but face unknown dangers" }, { text: "Gather a team to explore together", action: "ruins_team", consequences: "Shared risks and rewards" }, { text: "Research the ruins before entering", action: "ruins_research", consequences: "Safer approach but others might get there first" }] }, { title: "The Bomber's Challenge", text: "You've encountered Genthru, the infamous Bomber. His explosive nen ability has already killed dozens of players. He offers a deadly game - find his bombs hidden throughout the island or face his wrath directly.", choices: [{ text: "Accept the bomb disposal challenge", action: "bomb_challenge", consequences: "Extremely dangerous but massive rewards if successful" }, { text: "Rally other players to fight together", action: "unite_players", consequences: "Share the danger and potential victory" }, { text: "Try to outmaneuver him with speed", action: "speed_escape", consequences: "Avoid direct confrontation but miss rare cards" }] }] }, darkContinent: { name: "Dark Continent", description: "The forbidden realm beyond the known world, home to unimaginable horrors and treasures.", unlocked: false, unlockRequirement: "Master your Hatsu and reach Level 50", background: 0x1a1a2a, story: "Beyond the world map lies the Dark Continent - a place so dangerous that it's forbidden by international law. Ancient civilizations, impossible creatures, and treasures that could reshape the world await those brave or foolish enough to venture here.", specialBoss: { name: "Meruem (The King)", level: 60, health: 1500, maxHealth: 1500, stats: { strength: 70, speed: 65, intelligence: 80, aura: 70 }, abilities: ["Metamorphosis", "Rage Blast"], hatsu: { name: "Rage Blast", auraRequired: 60, description: "The King's ultimate attack that can destroy entire landscapes" }, reward: { experience: 1000, skillPoints: 50, unlockMessage: "You've challenged the ultimate lifeform!" } }, chapters: [{ title: "The Gatekeeper's Trial", text: "At the edge of the known world, a massive stone guardian blocks your path. Its eyes glow with ancient nen energy as it speaks: 'Only those who understand the true nature of nen may pass. Show me your resolve, human.'", choices: [{ text: "Demonstrate your most powerful Hatsu", action: "show_hatsu", consequences: "Prove your worth but exhaust yourself" }, { text: "Attempt to communicate with the guardian", action: "communicate_guardian", consequences: "Learn ancient nen secrets or face its wrath" }, { text: "Try to sneak past using stealth", action: "stealth_bypass", consequences: "Avoid confrontation but miss valuable knowledge" }] }, { title: "The Forbidden Zones", text: "You've entered regions that even the Dark Continent expedition teams avoid. Here, the laws of nature bend and break. Creatures that shouldn't exist roam freely, and the very air pulses with dangerous energy.", choices: [{ text: "Study the anomalous phenomena", action: "study_anomalies", consequences: "Gain understanding of reality manipulation but risk mental damage" }, { text: "Hunt the impossible creatures", action: "hunt_impossibles", consequences: "Gain incredible power but attract cosmic attention" }, { text: "Seek shelter and wait for safety", action: "wait_safety", consequences: "Survive but miss once-in-a-lifetime opportunities" }] }, { title: "The Ancient Civilization", text: "You discover ruins of a civilization that predates human history. The architecture defies physics, and inscriptions glow with residual nen energy. This place holds secrets about the origin of nen itself.", choices: [{ text: "Decipher the ancient inscriptions", action: "decipher_inscriptions", consequences: "Learn origin secrets of nen but risk ancient curses" }, { text: "Explore the impossible architecture", action: "explore_architecture", consequences: "Discover dimensional manipulation techniques" }, { text: "Attempt to contact ancient spirits", action: "contact_spirits", consequences: "Gain ancient knowledge but risk possession" }] }, { title: "The Chimera Ant Colony", text: "Deep in the Dark Continent, you discover a massive Chimera Ant colony. These aren't the ants from the known world - these are the originals, far more powerful and intelligent. Their Queen regards you with calculating eyes.", choices: [{ text: "Challenge the Queen to single combat", action: "queen_combat", consequences: "Ultimate test of strength - victory means legendary power" }, { text: "Offer to serve the colony temporarily", action: "serve_colony", consequences: "Learn their combat techniques but risk losing humanity" }, { text: "Attempt to form an alliance", action: "ant_alliance", consequences: "Gain powerful allies but make enemies of other humans" }] }] }, meteor_city: { name: "Meteor City", description: "The lawless junkyard city where the Phantom Troupe was born. A place where nothing has value, including human life.", unlocked: false, unlockRequirement: "Reach Level 30 and complete Yorknew City", background: 0x4a2a1a, story: "You arrive at the infamous Meteor City, a massive junkyard where society's discarded people and objects pile up endlessly. The residents here don't officially exist, making it the perfect breeding ground for criminals and outcasts.", chapters: [{ title: "The Junkyard Entrance", text: "Towering piles of garbage stretch as far as the eye can see. A sign reads: 'We reject no one, so take nothing from us.' Local scavengers eye you suspiciously. In this place, outsiders are not welcome.", choices: [{ text: "Offer to help the scavengers with their work", action: "help_scavengers", consequences: "Gain trust but risk getting involved in dangerous activities" }, { text: "Search for information about the Phantom Troupe", action: "troupe_investigation", consequences: "Learn valuable intel but make powerful enemies" }, { text: "Challenge the local strongmen to prove yourself", action: "prove_strength", consequences: "Earn respect through combat prowess" }] }, { title: "The Underground Fighting Rings", text: "Beneath the junkyard, illegal fighting tournaments rage. Meteor City's strongest fighters gather here to prove themselves. The prize money could help the city, but the fights are often to the death.", choices: [{ text: "Enter the tournaments as a fighter", action: "fighting_tournaments", consequences: "Gain incredible combat experience but risk death" }, { text: "Try to organize legitimate competitions", action: "organize_legitimate", consequences: "Help the community but face resistance from underground bosses" }, { text: "Expose the illegal operations to authorities", action: "expose_operations", consequences: "Stop exploitation but make enemies in the city" }] }, { title: "The Elder's Test", text: "You meet one of Meteor City's mysterious Elders, an ancient woman who knew the Phantom Troupe's founders. She offers to teach you their techniques, but only if you prove your dedication to protecting the city's inhabitants.", choices: [{ text: "Accept the trial of loyalty", action: "loyalty_trial", consequences: "Learn devastating combat techniques but bind yourself to the city" }, { text: "Decline respectfully and seek other teachers", action: "seek_others", consequences: "Maintain freedom but miss unique abilities" }, { text: "Propose an alternative arrangement", action: "negotiate_elder", consequences: "Potentially gain benefits without full commitment" }] }] }, whale_island: { name: "Whale Island", description: "Gon Freecss's peaceful home island. A place of natural beauty and simple living, perfect for meditation and training.", unlocked: false, unlockRequirement: "Reach Level 20", background: 0x2a4a2a, story: "You arrive at the serene Whale Island, where Gon Freecss grew up. The island's pure natural energy makes it an ideal place for Nen training and spiritual development.", chapters: [{ title: "Mito's Welcome", text: "Gon's aunt Mito greets you warmly and offers to let you stay while you train. The island's peaceful atmosphere is perfect for developing your Nen abilities without distractions.", choices: [{ text: "Focus on meditation and spiritual growth", action: "spiritual_training", consequences: "Greatly increase aura capacity and control" }, { text: "Train with the island's wildlife", action: "nature_training", consequences: "Improve physical stats and gain nature-based insights" }, { text: "Help the islanders with their daily work", action: "community_service", consequences: "Learn patience and gain the islanders' blessings" }] }, { title: "The Sacred Grove", text: "Deep in the island's forest lies a grove where Gon used to train. The trees here are infused with natural Nen energy, and practicing here could unlock hidden potential.", choices: [{ text: "Meditate in the grove for days", action: "grove_meditation", consequences: "Risk exhaustion but gain incredible Nen insights" }, { text: "Practice your Hatsu among the ancient trees", action: "hatsu_practice", consequences: "Strengthen your unique ability connection to nature" }, { text: "Commune with the island's animal spirits", action: "spirit_communion", consequences: "Gain animal-like instincts and enhanced senses" }] }] }, ngl: { name: "NGL (Neo-Green Life)", description: "The autonomous nation that rejects modern technology. Former site of the Chimera Ant crisis.", unlocked: false, unlockRequirement: "Reach Level 35 and master at least 5 Nen techniques", background: 0x1a3a1a, story: "You enter the Neo-Green Life autonomous region, a nation that has completely rejected modern technology. Though the Chimera Ant threat has passed, dangerous remnants and new threats still lurk in this untamed wilderness.", specialBoss: { name: "Chimera Ant Squadron Leader", level: 40, health: 600, maxHealth: 600, stats: { strength: 40, speed: 35, intelligence: 30, aura: 35 }, abilities: ["Predator Instinct", "Pack Coordination"], hatsu: { name: "Predator's Hunt", auraRequired: 35, description: "Enhanced senses and coordinated attacks from the squadron" }, reward: { experience: 300, skillPoints: 20, unlockMessage: "You've survived the Chimera Ant remnants!" } }, chapters: [{ title: "The Border Crossing", text: "At the NGL border, stern officials in primitive clothing confiscate all your modern equipment. 'Technology corrupts the soul,' they declare. You're given basic supplies and warned about the dangers ahead. The dense forest stretches endlessly, and you can sense hostile auras lurking within.", choices: [{ text: "Follow the marked safe paths deeper into NGL", action: "safe_paths", consequences: "Slower progress but avoid immediate dangers" }, { text: "Take shortcuts through the dangerous wilderness", action: "wilderness_shortcuts", consequences: "Risk encounters with dangerous creatures but faster progress" }, { text: "Set up camp and observe the area first", action: "observe_area", consequences: "Learn about local threats and opportunities" }] }, { title: "The Chimera Ant Scouts", text: "You encounter your first Chimera Ant soldiers - remnants from the invasion that still patrol these lands. They're smaller than the Royal Guards but still incredibly dangerous. Their compound eyes track your every movement as they communicate in clicking sounds.", choices: [{ text: "Engage the scouts in direct combat", action: "fight_scouts", consequences: "High risk but significant combat experience if successful" }, { text: "Use stealth to avoid the patrol", action: "stealth_avoid", consequences: "Avoid immediate danger but may miss important intelligence" }, { text: "Attempt to communicate with them", action: "communicate_ants", consequences: "Potentially learn about their hierarchy but risk being attacked" }] }, { title: "The Abandoned Research Facility", text: "You discover a hidden research facility deep in the forest - clearly built before the Chimera Ant invasion. Scientific equipment lies scattered, and you find research notes about 'human enhancement projects' and 'biological weapons development.' This place holds dark secrets.", choices: [{ text: "Investigate the research data thoroughly", action: "investigate_research", consequences: "Learn disturbing truths about NGL's past and gain scientific knowledge" }, { text: "Search for any surviving researchers", action: "find_researchers", consequences: "Potentially find allies or enemies from the facility" }, { text: "Destroy the facility to prevent misuse", action: "destroy_facility", consequences: "Prevent dangerous research from continuing but lose valuable information" }] }, { title: "The Queen's Nest Ruins", text: "You reach the ruins of the original Chimera Ant Queen's nest. The massive structure still emanates a malevolent aura. Broken shells and skeletal remains litter the ground. In the deepest chamber, you find pulsing organic matter - remnants of the Queen's genetic material that could still be active.", choices: [{ text: "Study the genetic material carefully", action: "genetic_study", consequences: "Gain evolution-based abilities but risk severe mutation" }, { text: "Collect samples for the Hunter Association", action: "collect_samples", consequences: "Gain Association favor but risk exposure to dangerous genetic material" }, { text: "Destroy all remaining genetic material", action: "destroy_genetic_material", consequences: "Prevent future Chimera Ant emergence but lose unique research opportunities" }] }, { title: "The Underground Colony", text: "You discover an active underground Chimera Ant colony that survived the original purge. These ants have evolved differently, becoming more intelligent and organized. Their Queen is smaller but more cunning than the original. She regards you with calculating compound eyes.", choices: [{ text: "Challenge the new Queen to combat", action: "challenge_new_queen", consequences: "Ultimate test - victory means incredible power, defeat means potential reincarnation" }, { text: "Try to negotiate with the evolved colony", action: "negotiate_colony", consequences: "Potentially gain powerful allies but risk being seen as food" }, { text: "Retreat and report the colony's location", action: "report_colony", consequences: "Fulfill duty to humanity but miss unique opportunities" }] }, { title: "The Final Confrontation", text: "The Squadron Leader of the surviving Chimera Ants blocks your path. This creature has adapted beyond its original programming, developing its own Nen abilities through consuming powerful hunters. Its aura is a mixture of dozens of different humans, creating an unsettling composite presence.", choices: [{ text: "Fight with everything you have", action: "final_battle_full_power", consequences: "Risk everything for the chance to eliminate a major threat" }, { text: "Try to understand the creature's evolution", action: "study_evolution", consequences: "Learn about Chimera Ant development but risk being consumed" }, { text: "Attempt to turn it against other threats", action: "turn_against_threats", consequences: "Create a dangerous ally against other enemies" }] }] } }; // Training Activities var trainingActivities = { meditation: { name: "Meditation", description: "Focus your mind and expand your aura capacity", cost: 10, // energy cost benefits: { aura: 2, intelligence: 1 }, experience: 15 }, pushups: { name: "Push-ups", description: "Build physical strength through intense training", cost: 15, benefits: { strength: 2, health: 5 }, experience: 20 }, running: { name: "Running", description: "Improve speed and endurance", cost: 12, benefits: { speed: 2, health: 3 }, experience: 18 } }; // Hatsu Creation System var hatsuTemplates = { enhancer: [{ name: "Titan Fist", description: "Enhance punching power by 300%", auraReq: 20, conditions: "Must maintain eye contact with target", battleEffects: { type: "damage", multiplier: 3.0, special: "stun_chance" } }, { name: "Iron Skin", description: "Harden skin to deflect attacks", auraReq: 15, conditions: "Cannot move while active", battleEffects: { type: "defense", multiplier: 2.0, special: "reflect_damage" } }, { name: "Healing Touch", description: "Accelerate healing of wounds", auraReq: 25, conditions: "Must touch wound for 30 seconds", battleEffects: { type: "heal", amount: 50, special: "status_cure" } }, { name: "Berserker Rage", description: "Enter an uncontrollable fury that doubles all physical abilities", auraReq: 35, conditions: "Must be below 50% health to activate", battleEffects: { type: "berserk", multiplier: 2.0, special: "cannot_guard" } }, { name: "Perfect Enhancement", description: "Enhance any object or body part to its theoretical maximum", auraReq: 40, conditions: "Can only enhance one thing at a time", battleEffects: { type: "variable", multiplier: 2.5, special: "adaptable" } }, { name: "Jajanken", description: "Rock-paper-scissors based attacks: Rock (punch), Paper (emission), Scissors (transmutation)", auraReq: 30, conditions: "Must charge for 3 seconds before attack", battleEffects: { type: "variable_combo", variants: ["rock", "paper", "scissors"], multiplier: 2.8, special: "triple_technique" } }], emitter: [{ name: "Spirit Gun", description: "Fire concentrated aura bullets", auraReq: 18, conditions: "Must point finger like a gun", battleEffects: { type: "ranged_damage", multiplier: 2.0, special: "piercing" } }, { name: "Teleport Beacon", description: "Mark location for instant teleportation", auraReq: 30, conditions: "Can only have one beacon active", battleEffects: { type: "utility", special: "escape_advantage" } }, { name: "Aura Shield", description: "Project defensive barrier at distance", auraReq: 22, conditions: "Shield weakens with distance", battleEffects: { type: "barrier", multiplier: 1.5, special: "ranged_defense" } }, { name: "Orbital Strike", description: "Launch concentrated aura high into the air for devastating delayed attack", auraReq: 45, conditions: "Must wait 3 turns before impact", battleEffects: { type: "delayed_damage", multiplier: 4.0, special: "unavoidable" } }, { name: "Remote Punch", description: "Project your fist through space to strike at any distance", auraReq: 28, conditions: "Must have line of sight to target", battleEffects: { type: "ranged_damage", multiplier: 2.2, special: "surprise_attack" } }], manipulator: [{ name: "Puppet Master", description: "Control defeated opponents", auraReq: 35, conditions: "Target must be unconscious first", battleEffects: { type: "control", special: "turn_enemy" } }, { name: "Object Dance", description: "Animate and control inanimate objects", auraReq: 20, conditions: "Must physically touch object first", battleEffects: { type: "summon", multiplier: 1.5, special: "multiple_attacks" } }, { name: "Memory Thief", description: "Extract and view target's memories", auraReq: 40, conditions: "Must maintain physical contact for 1 minute", battleEffects: { type: "debuff", special: "confusion" } }, { name: "Pain Amplifier", description: "Manipulate pain receptors to make even small wounds agonizing", auraReq: 30, conditions: "Must have inflicted damage on target first", battleEffects: { type: "debuff", multiplier: 1.8, special: "damage_over_time" } }, { name: "Emotion Control", description: "Manipulate target's emotions to make them fight for you", auraReq: 50, conditions: "Target must trust you initially", battleEffects: { type: "control", special: "ally_conversion" } }], transmuter: [{ name: "Lightning Palm", description: "Transform aura into electricity", auraReq: 25, conditions: "Damage self if used more than 3 times per day", battleEffects: { type: "elemental_damage", multiplier: 2.2, special: "paralysis" } }, { name: "Rubber Body", description: "Make body elastic and bouncy", auraReq: 20, conditions: "Vulnerable to sharp objects while active", battleEffects: { type: "defense", multiplier: 1.8, special: "bounce_back" } }, { name: "Poison Touch", description: "Transmute aura into various toxins", auraReq: 30, conditions: "Must know chemical composition of poison", battleEffects: { type: "poison", multiplier: 1.5, special: "damage_over_time" } }, { name: "Diamond Aura", description: "Transform aura into the hardest material for ultimate offense and defense", auraReq: 45, conditions: "Becomes immobile while diamond form is active", battleEffects: { type: "form_change", multiplier: 3.0, special: "ultimate_defense" } }, { name: "Liquid Aura", description: "Make aura flow like water to slip through any defense", auraReq: 35, conditions: "Cannot use other abilities while liquid", battleEffects: { type: "penetration", multiplier: 2.5, special: "ignore_defense" } }], conjurer: [{ name: "Weapon Vault", description: "Conjure any weapon you've mastered", auraReq: 28, conditions: "Must have trained with weapon for 100 hours", battleEffects: { type: "weapon_summon", multiplier: 2.0, special: "versatile" } }, { name: "Fortress Creation", description: "Conjure defensive structures", auraReq: 45, conditions: "Cannot move while maintaining structure", battleEffects: { type: "barrier", multiplier: 2.5, special: "area_defense" } }, { name: "Binding Chains", description: "Create unbreakable restraints", auraReq: 35, conditions: "Chains disappear if you lose consciousness", battleEffects: { type: "restraint", special: "immobilize" } }, { name: "Living Armor", description: "Conjure sentient armor that fights alongside you", auraReq: 50, conditions: "Armor has its own personality and may disobey", battleEffects: { type: "companion", multiplier: 1.8, special: "independent_action" } }, { name: "Dimensional Pocket", description: "Create pocket dimensions to store unlimited items and launch surprise attacks", auraReq: 40, conditions: "Items stored for too long may disappear", battleEffects: { type: "utility", special: "surprise_items" } }], specialist: [{ name: "Fate Reading", description: "See possible futures of target", auraReq: 50, conditions: "Can only be used once per person", battleEffects: { type: "precognition", special: "predict_attacks" } }, { name: "Power Copy", description: "Temporarily copy opponent's ability", auraReq: 60, conditions: "Must witness ability being used 3 times", battleEffects: { type: "copy", special: "steal_abilities" } }, { name: "Soul Bond", description: "Share damage and healing with ally", auraReq: 40, conditions: "Bond lasts until one partner dies", battleEffects: { type: "link", special: "shared_damage" } }, { name: "Probability Manipulation", description: "Alter the odds of any event in your favor", auraReq: 70, conditions: "Each use reduces your own luck for 24 hours", battleEffects: { type: "luck", special: "critical_control" } }, { name: "Time Echo", description: "Create echoes of your past actions to attack multiple times", auraReq: 55, conditions: "Can only echo actions from the last 10 minutes", battleEffects: { type: "temporal", multiplier: 2.5, special: "multi_attack" } }, { name: "Ability Copy", description: "Copy and store up to 3 enemy abilities to use in battle", auraReq: 45, conditions: "Must witness ability 3 times to copy it permanently", battleEffects: { type: "copy_system", special: "ability_mimic", slots: 3 } }] }; // Nen Techniques System var nenTechniques = { basic: { name: "Basic Nen Principles", techniques: [{ name: "Ten", description: "Shroud your body with aura to enhance defense", cost: 0, unlocked: false, auraReq: 10, benefits: { defense: 20 } }, { name: "Zetsu", description: "Stop the flow of aura to hide your presence", cost: 5, unlocked: false, auraReq: 15, benefits: { stealth: 30 } }, { name: "Ren", description: "Increase the amount of aura around your body", cost: 10, unlocked: false, auraReq: 20, benefits: { aura: 10, strength: 5 } }, { name: "Hatsu", description: "Use aura to perform supernatural feats", cost: 20, unlocked: false, auraReq: 30, benefits: { allStats: 5 } }] }, advanced: { name: "Advanced Nen Techniques", techniques: [{ name: "Gyo", description: "Focus aura into your eyes to see hidden things", cost: 15, unlocked: false, auraReq: 25, benefits: { intelligence: 10 } }, { name: "In", description: "Hide your aura completely", cost: 25, unlocked: false, auraReq: 35, benefits: { stealth: 50 } }, { name: "En", description: "Extend your aura to sense surroundings", cost: 30, unlocked: false, auraReq: 40, benefits: { aura: 15, intelligence: 8 } }, { name: "Shu", description: "Extend aura to objects you're holding", cost: 20, unlocked: false, auraReq: 30, benefits: { strength: 12 } }, { name: "Ko", description: "Focus all aura into one body part", cost: 35, unlocked: false, auraReq: 45, benefits: { strength: 20 } }, { name: "Ken", description: "Maintain Ren for extended periods", cost: 40, unlocked: false, auraReq: 50, benefits: { aura: 20, health: 30 } }] } }; // Add Nen mastery to player data var nenMastery = { basicMastered: 0, advancedMastered: 0, totalTechniques: 0 }; // Battle System Data var currentBattle = null; var battleState = { playerTurn: true, playerHealth: 0, enemyHealth: 0, playerAura: 0, enemyAura: 0, battleLog: [], availableActions: [], enemy: null }; // Battle Actions var battleActions = { attack: { name: "Basic Attack", auraRequired: 5, damage: "strength", description: "Strike with your fists" }, hatsuAttack: { name: "Hatsu Attack", auraRequired: 20, damage: "hatsu", description: "Use your unique Hatsu ability" }, jajankenRock: { name: "Jajanken: Rock", auraRequired: 30, damage: "jajanken_rock", description: "Charge up for a devastating punch attack", hatsuRequired: "Jajanken" }, jajankenPaper: { name: "Jajanken: Paper", auraRequired: 25, damage: "jajanken_paper", description: "Release concentrated aura emission blast", hatsuRequired: "Jajanken" }, jajankenScissors: { name: "Jajanken: Scissors", auraRequired: 35, damage: "jajanken_scissors", description: "Sharp transmuted aura cutting attack", hatsuRequired: "Jajanken" }, nenTechnique: { name: "Nen Technique", auraRequired: 15, damage: "technique", description: "Use mastered Nen techniques" }, parry: { name: "Parry", auraRequired: 10, damage: 0, description: "Block and counter the next attack" }, guard: { name: "Guard", auraRequired: 5, damage: 0, description: "Reduce incoming damage by 50%" }, recover: { name: "Recover Aura", auraRequired: 0, damage: 0, description: "Restore 30 aura points" }, enhancerSpecial: { name: "Enhancement Mastery", auraRequired: 25, damage: "enhanced", description: "Use advanced Enhancement techniques", hatsuTypes: ["enhancer"] }, emitterSpecial: { name: "Emission Barrage", auraRequired: 30, damage: "emission", description: "Launch multiple aura projectiles", hatsuTypes: ["emitter"] }, manipulatorSpecial: { name: "Mind Games", auraRequired: 35, damage: "manipulation", description: "Manipulate enemy's actions", hatsuTypes: ["manipulator"] }, transmuterSpecial: { name: "Property Change", auraRequired: 28, damage: "transmutation", description: "Use transmuted aura with special properties", hatsuTypes: ["transmuter"] }, conjurerSpecial: { name: "Conjured Arsenal", auraRequired: 32, damage: "conjuration", description: "Summon multiple conjured objects", hatsuTypes: ["conjurer"] }, specialistSpecial: { name: "Unique Power", auraRequired: 40, damage: "specialist", description: "Use your one-of-a-kind ability", hatsuTypes: ["specialist"] }, copySlot1: { name: "Use Copied Ability 1", auraRequired: 25, damage: "copied", description: "Use first copied ability", hatsuTypes: ["specialist"] }, copySlot2: { name: "Use Copied Ability 2", auraRequired: 25, damage: "copied", description: "Use second copied ability", hatsuTypes: ["specialist"] }, copySlot3: { name: "Use Copied Ability 3", auraRequired: 25, damage: "copied", description: "Use third copied ability", hatsuTypes: ["specialist"] } }; // Nen Vows System var nenVows = [{ name: "Combat Restriction", description: "Never use Hatsu to kill", powerBoost: 1.5, type: "moral" }, { name: "Time Limit", description: "Ability only works for 10 minutes per day", powerBoost: 2.0, type: "temporal" }, { name: "Location Binding", description: "Ability only works in specific location", powerBoost: 2.5, type: "spatial" }, { name: "Emotional Trigger", description: "Only works when extremely angry", powerBoost: 1.8, type: "emotional" }, { name: "Risk of Death", description: "Ability will kill you if overused", powerBoost: 3.0, type: "sacrificial" }, { name: "Shared Burden", description: "Allies also take damage when you do", powerBoost: 2.2, type: "collective" }]; // Skill Tree var skillTree = { enhancer: { name: "Enhancement Skills", skills: [{ name: "Iron Body", cost: 50, unlocked: false, description: "Increase defense by 20%" }, { name: "Power Boost", cost: 100, unlocked: false, description: "Increase strength by 50%" }, { name: "Regeneration", cost: 150, unlocked: false, description: "Slowly recover health over time" }] }, emitter: { name: "Emission Skills", skills: [{ name: "Aura Blast", cost: 60, unlocked: false, description: "Ranged aura attack" }, { name: "Remote Control", cost: 120, unlocked: false, description: "Control objects from distance" }, { name: "Aura Sphere", cost: 180, unlocked: false, description: "Create protective aura barriers" }] }, manipulator: { name: "Manipulation Skills", skills: [{ name: "Object Control", cost: 70, unlocked: false, description: "Manipulate nearby objects" }, { name: "Mind Influence", cost: 140, unlocked: false, description: "Influence enemy actions" }, { name: "Mass Control", cost: 200, unlocked: false, description: "Control multiple targets" }] }, transmuter: { name: "Transmutation Skills", skills: [{ name: "Rubber Aura", cost: 55, unlocked: false, description: "Make aura elastic and bouncy" }, { name: "Electric Aura", cost: 110, unlocked: false, description: "Transmute aura into electricity" }, { name: "Shape Shift", cost: 165, unlocked: false, description: "Change aura into various forms" }] }, conjurer: { name: "Conjuration Skills", skills: [{ name: "Weapon Summon", cost: 80, unlocked: false, description: "Conjure basic weapons" }, { name: "Tool Creation", cost: 160, unlocked: false, description: "Create useful tools" }, { name: "Complex Objects", cost: 240, unlocked: false, description: "Conjure complex mechanisms" }] }, specialist: { name: "Specialist Skills", skills: [{ name: "Unique Ability", cost: 100, unlocked: false, description: "Discover your unique power" }, { name: "Power Amplify", cost: 200, unlocked: false, description: "Amplify all abilities" }, { name: "Reality Bend", cost: 300, unlocked: false, description: "Bend rules of reality" }] } }; // UI Elements var storyPanel; var buttons = []; var statsUI = []; var titleText; var playerInfoText; var levelText; var statNumbersText = []; // Initialize UI function initializeUI() { // Title titleText = new Text2("Hunter X Hunter: Nen Mastery Challenge", { size: 56, fill: 0xFFFF00 }); titleText.anchor.set(0.5, 0.5); titleText.x = 1024; titleText.y = 150; game.addChild(titleText); // Story Panel - moved to center-right storyPanel = new StoryPanel(); storyPanel.x = 1200; storyPanel.y = 700; game.addChild(storyPanel); // Bottom left stats panel background var statsPanelBg = LK.getAsset('backgroundPanel', { anchorX: 0, anchorY: 1, scaleX: 0.4, scaleY: 0.8, tint: 0x1a1a1a }); statsPanelBg.x = 50; statsPanelBg.y = 2680; game.addChild(statsPanelBg); // Level display levelText = new Text2("Level: " + player.level, { size: 38, fill: 0xFFFF00 }); levelText.anchor.set(0, 0.5); levelText.x = 80; levelText.y = 2250; game.addChild(levelText); // Player info under level playerInfoText = new Text2("Nen Type: " + (player.nenType || "None") + "\nSP: " + player.skillPoints, { size: 28, fill: 0xFFFFFF }); playerInfoText.anchor.set(0, 0.5); playerInfoText.x = 80; playerInfoText.y = 2310; game.addChild(playerInfoText); // Stats as numbers var statsLabels = ["Strength", "Speed", "Intelligence", "Aura"]; var statsValues = [player.stats.strength, player.stats.speed, player.stats.intelligence, player.stats.aura]; for (var i = 0; i < statsLabels.length; i++) { var statText = new Text2(statsLabels[i] + ": " + statsValues[i], { size: 24, fill: 0xAAFFAA }); statText.anchor.set(0, 0.5); statText.x = 80; statText.y = 2400 + i * 30; statNumbersText.push(statText); game.addChild(statText); } // Status bars (Health, Aura, Energy, Experience) - compact version var statusY = 2520; statsUI.push(new StatBar("Health", player.maxHealth, player.health, 0xff0000)); statsUI.push(new StatBar("Aura", player.maxAura, player.aura, 0x0066ff)); statsUI.push(new StatBar("Energy", player.maxEnergy, player.energy, 0x00ff00)); statsUI.push(new StatBar("Experience", player.maxExperience, player.experience, 0xffff00)); for (var i = 0; i < statsUI.length; i++) { statsUI[i].x = 80; statsUI[i].y = statusY + i * 40; statsUI[i].scaleX = 0.7; // Make bars more compact statsUI[i].scaleY = 0.7; game.addChild(statsUI[i]); } } // Character Creation function startCharacterCreation() { storyPanel.setText("Welcome, aspiring Hunter! First, you must discover your Nen type. Choose your path:"); clearButtons(); var nenTypeKeys = Object.keys(nenTypes); for (var i = 0; i < nenTypeKeys.length; i++) { var nenType = nenTypeKeys[i]; var button = new MenuButton(nenType, createNenTypeCallback(nenType)); button.x = 400 + i % 3 * 450; button.y = 1200 + Math.floor(i / 3) * 100; buttons.push(button); game.addChild(button); } } function createNenTypeCallback(nenType) { return function () { selectNenType(nenType); }; } function selectNenType(nenType) { player.nenType = nenType; var typeData = nenTypes[nenType]; // Apply bonuses if (typeData.bonuses.strength) player.stats.strength += typeData.bonuses.strength; if (typeData.bonuses.speed) player.stats.speed += typeData.bonuses.speed; if (typeData.bonuses.intelligence) player.stats.intelligence += typeData.bonuses.intelligence; if (typeData.bonuses.aura) player.stats.aura += typeData.bonuses.aura; if (typeData.bonuses.health) { player.maxHealth += typeData.bonuses.health; player.health = player.maxHealth; } storyPanel.setText("Excellent! You are a " + nenType + ". " + typeData.description); clearButtons(); var continueButton = new MenuButton("Start Training", function () { gameState = "training"; startTrainingMode(); }); continueButton.x = 1024; continueButton.y = 1400; buttons.push(continueButton); game.addChild(continueButton); updateStatsUI(); } // Story System function startStoryChapter(chapterNum) { var chapter = storyChapters[chapterNum]; if (!chapter) return; player.currentChapter = chapterNum; storyPanel.setText(chapter.title + "\n\n" + chapter.text); clearButtons(); for (var i = 0; i < chapter.choices.length; i++) { var choice = chapter.choices[i]; var button = new MenuButton(choice.text, createChoiceCallback(choice.action)); button.x = 1024; button.y = 1400 + i * 100; buttons.push(button); game.addChild(button); } } function createChoiceCallback(action) { return function () { handleChoice(action); }; } function handleChoice(action) { var result = ""; var expGain = 0; switch (action) { // Phase 1: The Long Run case "steady_pace": result = "You maintain a steady pace, conserving energy while staying with the main group. Your endurance improves and you avoid the dangerous creatures in the fog."; player.stats.speed += 2; player.maxHealth += 10; expGain = 30; break; case "sprint_ahead": result = "You sprint ahead but exhaust yourself. However, you gain valuable experience in speed and spot shortcuts for future reference."; player.stats.speed += 3; player.health -= 15; expGain = 25; break; case "help_others": result = "You help struggling candidates, earning their respect. Your leadership skills and intelligence grow, though you use more energy."; player.stats.intelligence += 2; player.health -= 10; expGain = 35; break; // Phase 2: Gourmet Hunters case "hunt_strategically": result = "You successfully hunt the Great Stamp pig using clever tactics. Your strategic thinking and strength improve significantly."; player.stats.strength += 3; player.stats.intelligence += 2; expGain = 40; break; case "cook_multiple": result = "You attempt multiple dishes but burn several. You learn from your mistakes and improve your multitasking abilities."; player.stats.intelligence += 1; player.stats.speed += 2; expGain = 25; break; case "observe_learn": result = "You carefully observe successful candidates and learn their techniques. Your analytical skills improve greatly."; player.stats.intelligence += 4; expGain = 45; break; // Phase 3: Trick Tower case "strength_door": result = "You choose the strength path and face physical challenges. Your raw power increases but you take some damage from the trials."; player.stats.strength += 4; player.health -= 20; expGain = 35; break; case "wisdom_door": result = "You solve complex puzzles and riddles. Your intelligence grows significantly as you overcome mental challenges."; player.stats.intelligence += 5; expGain = 50; break; case "agility_door": result = "You navigate through speed-based obstacles and traps. Your agility and reflexes improve dramatically."; player.stats.speed += 4; expGain = 40; break; // Phase 4: Zevil Island case "stealth_ambush": result = "You successfully ambush your target using stealth tactics. Your speed and intelligence improve from the successful strategy."; player.stats.speed += 3; player.stats.intelligence += 2; expGain = 45; break; case "direct_combat": result = "You engage in direct combat with your target. A fierce battle ensues, improving your strength but leaving you injured."; player.stats.strength += 4; player.health -= 25; expGain = 40; break; case "set_trap": result = "You patiently set a trap and wait. Your strategic thinking pays off as you capture your target with minimal effort."; player.stats.intelligence += 3; player.stats.aura += 2; expGain = 50; break; // Phase 5: Final Tournament case "full_power": result = "You unleash your full power from the start! Your overwhelming strength secures victory, and you pass the Hunter Exam!"; player.stats.strength += 5; player.stats.aura += 3; expGain = 60; break; case "analyze_first": result = "You carefully analyze your opponent's fighting style before striking. Your tactical approach leads to a decisive victory!"; player.stats.intelligence += 4; player.stats.speed += 3; expGain = 65; break; case "tactical_approach": result = "You use cunning tactics to outmaneuver your opponent. Your strategic mind proves superior, earning you the Hunter License!"; player.stats.intelligence += 5; player.stats.aura += 4; expGain = 70; break; } // Apply experience player.experience += expGain; if (player.experience >= player.maxExperience) { levelUp(); } storyPanel.setText(result); clearButtons(); var continueButton = new MenuButton("Continue", function () { var nextChapter = player.currentChapter + 1; if (nextChapter <= 5) { startStoryChapter(nextChapter); } else { showGameComplete(); } }); continueButton.x = 1024; continueButton.y = 1400; buttons.push(continueButton); game.addChild(continueButton); updateStatsUI(); } function levelUp() { if (player.level >= 50) { return; // Maximum level reached } player.level++; player.skillPoints += 2; // Give 2 SP per level player.experience = 0; player.maxExperience += 50; player.maxHealth += 20; player.health = player.maxHealth; player.maxAura += 10; player.aura = player.maxAura; LK.getSound('levelUp').play(); LK.effects.flashScreen(0xffff00, 500); } function showGameComplete() { player.hunterExamCompleted = true; storyPanel.setText("🎉 CONGRATULATIONS! 🎉\n\nYou have successfully passed the Hunter Exam and earned your Hunter License!\n\nYou survived all 5 phases:\n✓ The Long Run through Milsy Wetlands\n✓ Gourmet Hunters Challenge\n✓ Trick Tower Navigation\n✓ Zevil Island Badge Hunt\n✓ Final Tournament Victory\n\nYou can now access advanced Nen techniques through the Skill Tree and continue your journey as a licensed Hunter!\n\nFinal Stats:\nLevel: " + player.level + "\nNen Type: " + player.nenType + "\nStrength: " + player.stats.strength + "\nSpeed: " + player.stats.speed + "\nIntelligence: " + player.stats.intelligence + "\nAura: " + player.stats.aura); clearButtons(); var continueButton = new MenuButton("Continue as Licensed Hunter", function () { gameState = "training"; startTrainingMode(); }); continueButton.x = 1024; continueButton.y = 1400; buttons.push(continueButton); game.addChild(continueButton); LK.setScore(player.level * 100 + player.stats.strength + player.stats.speed + player.stats.intelligence + player.stats.aura); } function startTrainingMode() { storyPanel.setText("Welcome to the training grounds! Train your abilities before attempting the Hunter Exam.\n\nTraining will cost energy but will make you stronger. Rest to recover energy."); clearButtons(); // Training buttons var activities = Object.keys(trainingActivities); for (var i = 0; i < activities.length; i++) { var activity = activities[i]; var activityData = trainingActivities[activity]; var button = new TrainingButton(activity, activityData); button.x = 400 + i * 450; button.y = 1300; buttons.push(button); game.addChild(button); } // Rest button var restButton = new MenuButton("Rest (+50 Energy)", function () { player.energy = Math.min(player.maxEnergy, player.energy + 50); updateStatsUI(); }); restButton.x = 400; restButton.y = 1450; buttons.push(restButton); game.addChild(restButton); // Skill Tree button (only available after Hunter Exam) if (player.hunterExamCompleted) { var skillTreeButton = new MenuButton("Skill Tree", function () { showSkillTree(); }); skillTreeButton.x = 850; skillTreeButton.y = 1450; buttons.push(skillTreeButton); game.addChild(skillTreeButton); } else { var skillTreeButton = new MenuButton("Skill Tree (Locked)", function () { // Do nothing - button is disabled }); skillTreeButton.x = 850; skillTreeButton.y = 1450; skillTreeButton.alpha = 0.5; // Make it look disabled buttons.push(skillTreeButton); game.addChild(skillTreeButton); } // Nen Techniques button (always visible when player has a Nen type) var nenButton = new MenuButton("Nen Techniques", function () { showNenTechniques(); }); nenButton.x = 850; nenButton.y = 1550; if (player.nenType) { buttons.push(nenButton); game.addChild(nenButton); } else { nenButton.alpha = 0.5; // Make it look disabled when no Nen type buttons.push(nenButton); game.addChild(nenButton); } // Hatsu Creation button (available based on Nen type and requirements) if (player.nenType) { var hatsuReqs = player.stats.aura >= 150 && player.stats.strength >= 250 && player.stats.intelligence >= 100; var hatsuButtonText = hatsuReqs || player.hatsu ? "Create Hatsu" : "Create Hatsu (Need: 150 Aura, 250 Str, 100 Int)"; var hatsuButton = new MenuButton(hatsuButtonText, function () { showHatsuCreation(); }); hatsuButton.x = 1750; hatsuButton.y = 1450; if (!hatsuReqs && !player.hatsu) { hatsuButton.alpha = 0.7; } buttons.push(hatsuButton); game.addChild(hatsuButton); } // Travel button var travelButton = new MenuButton("Travel", function () { showTravelMenu(); }); travelButton.x = 1300; travelButton.y = 1550; buttons.push(travelButton); game.addChild(travelButton); // Debug Mode - Creator buttons for testing if (debugMode) { // Debug panel background var debugPanelBg = LK.getAsset('backgroundPanel', { anchorX: 0.5, anchorY: 0, scaleX: 0.9, scaleY: 0.3, tint: 0x330033 }); debugPanelBg.x = 1024; debugPanelBg.y = 1650; game.addChild(debugPanelBg); var debugLabel = new Text2("=== DEBUG MODE ===", { size: 32, fill: 0xFF00FF }); debugLabel.anchor.set(0.5, 0.5); debugLabel.x = 1024; debugLabel.y = 1680; game.addChild(debugLabel); var debugButton = new MenuButton("Yaratıcı: +1000 Stat", function () { player.stats.strength += 1000; player.stats.speed += 1000; player.stats.intelligence += 1000; player.stats.aura += 1000; player.maxAura += 1000; player.aura = player.maxAura; player.skillPoints += 100; updateStatsUI(); LK.effects.flashScreen(0xff00ff, 300); startTrainingMode(); // Refresh to show updated requirements }); debugButton.x = 400; debugButton.y = 1750; debugButton.scaleX = 0.7; debugButton.scaleY = 0.7; buttons.push(debugButton); game.addChild(debugButton); var debugLevelButton = new MenuButton("Yaratıcı: +10 Level", function () { for (var i = 0; i < 10; i++) { if (player.level < 50) { levelUp(); } } updateStatsUI(); LK.effects.flashScreen(0x00ffff, 300); }); debugLevelButton.x = 750; debugLevelButton.y = 1750; debugLevelButton.scaleX = 0.7; debugLevelButton.scaleY = 0.7; buttons.push(debugLevelButton); game.addChild(debugLevelButton); var debugEnergyButton = new MenuButton("Yaratıcı: Dolu Enerji", function () { player.energy = player.maxEnergy; player.health = player.maxHealth; player.aura = player.maxAura; updateStatsUI(); LK.effects.flashScreen(0xffff00, 300); }); debugEnergyButton.x = 1100; debugEnergyButton.y = 1750; debugEnergyButton.scaleX = 0.7; debugEnergyButton.scaleY = 0.7; buttons.push(debugEnergyButton); game.addChild(debugEnergyButton); var debugHatsuButton = new MenuButton("Yaratıcı: Hatsu Unlock", function () { player.hunterExamCompleted = true; if (!player.nenType) { player.nenType = "Enhancer"; var typeData = nenTypes["Enhancer"]; if (typeData.bonuses.strength) player.stats.strength += typeData.bonuses.strength; if (typeData.bonuses.health) { player.maxHealth += typeData.bonuses.health; player.health = player.maxHealth; } } updateStatsUI(); LK.effects.flashScreen(0x00ff00, 300); startTrainingMode(); // Refresh to show all buttons }); debugHatsuButton.x = 1450; debugHatsuButton.y = 1750; debugHatsuButton.scaleX = 0.7; debugHatsuButton.scaleY = 0.7; buttons.push(debugHatsuButton); game.addChild(debugHatsuButton); } // Hunter Exam button (available after some training) var examReqs = player.trainingCount >= 5; var examButtonText = examReqs ? "Take Hunter Exam" : "Hunter Exam (Need 5 Trainings)"; var examButton = new MenuButton(examButtonText, examReqs ? function () { gameState = "story"; startStoryChapter(1); } : null); examButton.x = 400; examButton.y = 1600; if (!examReqs) { examButton.alpha = 0.5; // Make it look disabled when requirements not met } buttons.push(examButton); game.addChild(examButton); } function performTraining(activity) { var activityData = trainingActivities[activity]; // Deduct energy player.energy -= activityData.cost; // Apply benefits if (activityData.benefits.strength) player.stats.strength += activityData.benefits.strength; if (activityData.benefits.speed) player.stats.speed += activityData.benefits.speed; if (activityData.benefits.intelligence) player.stats.intelligence += activityData.benefits.intelligence; if (activityData.benefits.aura) player.stats.aura += activityData.benefits.aura; if (activityData.benefits.health) { player.maxHealth += activityData.benefits.health; player.health = player.maxHealth; } // Add experience and skill points player.experience += activityData.experience; player.skillPoints += Math.floor(activityData.experience / 10); player.trainingCount++; // Check for level up if (player.experience >= player.maxExperience) { levelUp(); } // Update UI updateStatsUI(); // Flash effect LK.effects.flashScreen(0x00ff00, 300); // Refresh training mode to update buttons startTrainingMode(); } function showNenTechniques() { storyPanel.setText("Nen Techniques\n\nMaster the fundamental principles of Nen and advanced techniques. Basic techniques must be learned before advanced ones.\n\nBasic Mastered: " + nenMastery.basicMastered + "/4\nAdvanced Mastered: " + nenMastery.advancedMastered + "/6"); clearButtons(); var yStart = 1100; var currentY = yStart; // Basic Techniques Section var basicLabel = new Text2("Basic Nen Principles (Ten, Zetsu, Ren, Hatsu)", { size: 32, fill: 0x00FF00 }); basicLabel.anchor.set(0.5, 0.5); basicLabel.x = 1024; basicLabel.y = currentY; game.addChild(basicLabel); currentY += 60; for (var i = 0; i < nenTechniques.basic.techniques.length; i++) { var technique = nenTechniques.basic.techniques[i]; var canLearn = player.stats.aura >= technique.auraReq && player.skillPoints >= technique.cost; var buttonText = technique.name + " - " + technique.cost + " SP"; if (technique.unlocked) buttonText += " (Mastered)"; var techniqueButton = new MenuButton(buttonText, technique.unlocked ? null : createTechniqueCallback(technique, 'basic')); techniqueButton.x = 400 + i % 4 * 350; techniqueButton.y = currentY; if (technique.unlocked) { techniqueButton.alpha = 0.7; } else if (!canLearn) { techniqueButton.alpha = 0.5; } buttons.push(techniqueButton); game.addChild(techniqueButton); } currentY += 120; // Advanced Techniques Section var advancedLabel = new Text2("Advanced Nen Techniques", { size: 32, fill: 0xFF6600 }); advancedLabel.anchor.set(0.5, 0.5); advancedLabel.x = 1024; advancedLabel.y = currentY; game.addChild(advancedLabel); currentY += 60; // Show advanced techniques only if all basic are mastered if (nenMastery.basicMastered >= 4) { for (var i = 0; i < nenTechniques.advanced.techniques.length; i++) { var technique = nenTechniques.advanced.techniques[i]; var canLearn = player.stats.aura >= technique.auraReq && player.skillPoints >= technique.cost; var buttonText = technique.name + " - " + technique.cost + " SP"; if (technique.unlocked) buttonText += " (Mastered)"; var techniqueButton = new MenuButton(buttonText, technique.unlocked ? null : createTechniqueCallback(technique, 'advanced')); techniqueButton.x = 300 + i % 3 * 350; techniqueButton.y = currentY + Math.floor(i / 3) * 100; if (technique.unlocked) { techniqueButton.alpha = 0.7; } else if (!canLearn) { techniqueButton.alpha = 0.5; } buttons.push(techniqueButton); game.addChild(techniqueButton); } } else { var lockText = new Text2("Master all basic techniques to unlock advanced ones", { size: 28, fill: 0x888888 }); lockText.anchor.set(0.5, 0.5); lockText.x = 1024; lockText.y = currentY + 50; game.addChild(lockText); } // Back button var backButton = new MenuButton("Back to Training", function () { startTrainingMode(); }); backButton.x = 1024; backButton.y = 1700; buttons.push(backButton); game.addChild(backButton); } function createTechniqueCallback(technique, category) { return function () { learnNenTechnique(technique, category); }; } function learnNenTechnique(technique, category) { if (player.skillPoints >= technique.cost && player.stats.aura >= technique.auraReq) { player.skillPoints -= technique.cost; technique.unlocked = true; // Apply benefits if (technique.benefits.defense) player.maxHealth += technique.benefits.defense; if (technique.benefits.aura) { player.stats.aura += technique.benefits.aura; player.maxAura += technique.benefits.aura; } if (technique.benefits.strength) player.stats.strength += technique.benefits.strength; if (technique.benefits.intelligence) player.stats.intelligence += technique.benefits.intelligence; if (technique.benefits.health) { player.maxHealth += technique.benefits.health; player.health = player.maxHealth; } if (technique.benefits.allStats) { player.stats.strength += technique.benefits.allStats; player.stats.speed += technique.benefits.allStats; player.stats.intelligence += technique.benefits.allStats; player.stats.aura += technique.benefits.allStats; } // Update mastery counters if (category === 'basic') { nenMastery.basicMastered++; } else { nenMastery.advancedMastered++; } nenMastery.totalTechniques++; LK.getSound('levelUp').play(); LK.effects.flashScreen(0x00ffff, 500); updateStatsUI(); showNenTechniques(); // Refresh the menu } } function showSkillTree() { var nenTypeKey = player.nenType.toLowerCase(); var skillCategory = skillTree[nenTypeKey]; if (!skillCategory) return; storyPanel.setText("Skill Tree: " + skillCategory.name + "\n\nSpend skill points to unlock new abilities. Each skill will enhance your combat effectiveness."); clearButtons(); // Skill buttons for (var i = 0; i < skillCategory.skills.length; i++) { var skill = skillCategory.skills[i]; var skillButton = new SkillButton(skill, skill); skillButton.x = 700 + i % 2 * 450; skillButton.y = 1200 + Math.floor(i / 2) * 120; buttons.push(skillButton); game.addChild(skillButton); } // Back button var backButton = new MenuButton("Back to Training", function () { startTrainingMode(); }); backButton.x = 1024; backButton.y = 1600; buttons.push(backButton); game.addChild(backButton); } function showHatsuCreation() { var nenTypeKey = player.nenType.toLowerCase(); var templates = hatsuTemplates[nenTypeKey]; if (!templates) return; // Check requirements var hasRequirements = player.stats.aura >= 150 && player.stats.strength >= 250 && player.stats.intelligence >= 100; if (!hasRequirements && !player.hatsu) { storyPanel.setText("Hatsu Creation Requirements:\n\n• Aura: 150 (Current: " + player.stats.aura + ")\n• Strength: 250 (Current: " + player.stats.strength + ")\n• Intelligence: 100 (Current: " + player.stats.intelligence + ")\n\nTrain more to unlock Hatsu creation!"); clearButtons(); var backButton = new MenuButton("Back to Training", function () { startTrainingMode(); }); backButton.x = 1024; backButton.y = 1400; buttons.push(backButton); game.addChild(backButton); return; } if (player.hatsu) { storyPanel.setText("Your Current Hatsu: " + player.hatsu.name + "\n\n" + player.hatsu.description + "\nAura Required: " + player.hatsu.auraReq + "\nCondition: " + player.hatsu.conditions + "\nMastery Level: " + player.hatsuMastery + "/100" + (player.nenVow ? "\n\nNen Vow: " + player.nenVow.name + " - " + player.nenVow.description : "")); } else { storyPanel.setText("Hatsu Creation - " + player.nenType + " Type\n\nChoose a Hatsu template to develop your unique ability. Each Hatsu requires specific aura amounts and has conditions for use."); } clearButtons(); if (!player.hatsu) { // Show Hatsu templates for (var i = 0; i < templates.length; i++) { var template = templates[i]; var hatsuButton = new MenuButton(template.name, createHatsuCallback(template)); hatsuButton.x = 700 + i % 2 * 450; hatsuButton.y = 1200 + Math.floor(i / 2) * 120; buttons.push(hatsuButton); game.addChild(hatsuButton); } } else { // Show Nen Vow options if no vow exists if (!player.nenVow && player.hatsuMastery >= 50) { var vowButton = new MenuButton("Add Nen Vow", function () { showNenVows(); }); vowButton.x = 700; vowButton.y = 1200; buttons.push(vowButton); game.addChild(vowButton); } // Train Hatsu button var trainButton = new MenuButton("Train Hatsu (20 Energy)", function () { if (player.energy >= 20) { player.energy -= 20; player.hatsuMastery = Math.min(100, player.hatsuMastery + 10); updateStatsUI(); LK.effects.flashScreen(0x0066ff, 300); showHatsuCreation(); } }); trainButton.x = 1100; trainButton.y = 1200; buttons.push(trainButton); game.addChild(trainButton); } // Back button var backButton = new MenuButton("Back to Training", function () { startTrainingMode(); }); backButton.x = 1024; backButton.y = 1600; buttons.push(backButton); game.addChild(backButton); } function createHatsuCallback(template) { return function () { selectHatsu(template); }; } function selectHatsu(template) { player.hatsu = template; player.hatsuMastery = 10; storyPanel.setText("Congratulations! You have created your Hatsu: " + template.name + "\n\n" + template.description + "\n\nYour unique ability is now part of you. Train to increase mastery and unlock its full potential!"); updateStatsUI(); LK.effects.flashScreen(0x00ffff, 1000); } function showNenVows() { storyPanel.setText("Nen Vows\n\nBy imposing restrictions on yourself, you can greatly increase your Hatsu's power. Choose carefully - vows are permanent!"); clearButtons(); for (var i = 0; i < Math.min(3, nenVows.length); i++) { var vow = nenVows[i]; var vowButton = new MenuButton(vow.name + " (+" + Math.floor((vow.powerBoost - 1) * 100) + "% power)", createVowCallback(vow)); vowButton.x = 700 + i % 2 * 450; vowButton.y = 1200 + Math.floor(i / 2) * 120; buttons.push(vowButton); game.addChild(vowButton); } var backButton = new MenuButton("Back to Hatsu", function () { showHatsuCreation(); }); backButton.x = 1024; backButton.y = 1500; buttons.push(backButton); game.addChild(backButton); } function createVowCallback(vow) { return function () { selectNenVow(vow); }; } function selectNenVow(vow) { player.nenVow = vow; storyPanel.setText("You have made a Nen Vow: " + vow.name + "\n\n" + vow.description + "\n\nYour Hatsu power has increased by " + Math.floor((vow.powerBoost - 1) * 100) + "%! Remember, this restriction is now permanent."); LK.effects.flashScreen(0xff0000, 1000); updateStatsUI(); } function unlockSkill(skill, skillData) { player.skillPoints -= skillData.cost; skillData.unlocked = true; player.abilities.push(skill.name); // Apply skill effects if (skill.name === "Iron Body") player.maxHealth += 50; if (skill.name === "Power Boost") player.stats.strength += 20; if (skill.name === "Aura Blast") player.maxAura += 30; updateStatsUI(); showSkillTree(); // Refresh skill tree } function resetGame() { player = { name: "Hunter", nenType: "", level: 1, experience: 0, maxExperience: 100, health: 100, maxHealth: 100, aura: 50, maxAura: 50, stats: { strength: 10, speed: 10, intelligence: 10, aura: 10 }, abilities: [], currentChapter: 1, energy: 100, maxEnergy: 100, skillPoints: 0, trainingCount: 0, hunterExamCompleted: false, hatsu: null, nenVow: null, hatsuMastery: 0 }; // Reset Nen mastery nenMastery = { basicMastered: 0, advancedMastered: 0, totalTechniques: 0 }; // Reset technique unlocks for (var i = 0; i < nenTechniques.basic.techniques.length; i++) { nenTechniques.basic.techniques[i].unlocked = false; } for (var i = 0; i < nenTechniques.advanced.techniques.length; i++) { nenTechniques.advanced.techniques[i].unlocked = false; } gameState = "characterCreation"; updateStatsUI(); startCharacterCreation(); } function clearButtons() { for (var i = 0; i < buttons.length; i++) { buttons[i].destroy(); } buttons = []; } function showTravelMenu() { storyPanel.setText("Travel Destinations\n\nChoose your next adventure! Each location offers unique challenges and rewards."); clearButtons(); var locationKeys = Object.keys(travelLocations); var buttonY = 1200; for (var i = 0; i < locationKeys.length; i++) { var locationKey = locationKeys[i]; var location = travelLocations[locationKey]; var isUnlocked = location.unlocked || checkLocationUnlock(locationKey); var buttonText = location.name + (isUnlocked ? "" : " (Locked)"); var travelButton = new MenuButton(buttonText, isUnlocked ? createTravelCallback(locationKey) : null); travelButton.x = 700 + i % 2 * 450; travelButton.y = buttonY + Math.floor(i / 2) * 100; if (!isUnlocked) travelButton.alpha = 0.5; buttons.push(travelButton); game.addChild(travelButton); } // Boss Battle section var bossButton = new MenuButton("Boss Battles", function () { showBossMenu(); }); bossButton.x = 1024; bossButton.y = 1500; buttons.push(bossButton); game.addChild(bossButton); var backButton = new MenuButton("Back to Training", function () { startTrainingMode(); }); backButton.x = 1024; backButton.y = 1600; buttons.push(backButton); game.addChild(backButton); } function checkLocationUnlock(locationKey) { var location = travelLocations[locationKey]; switch (locationKey) { case "yorknewCity": return travelLocations.heavensArena.currentFloor >= 200; case "greedIsland": return player.level >= 40; case "darkContinent": return player.hatsu && player.hatsuMastery >= 80 && player.level >= 50; case "meteor_city": return player.level >= 30 && (travelLocations.yorknewCity.currentChapter >= 2 || player.hunterExamCompleted); case "whale_island": return player.level >= 20; case "ngl": return player.level >= 35 && nenMastery.totalTechniques >= 5; default: return location.unlocked; } } function createTravelCallback(locationKey) { return function () { visitLocation(locationKey); }; } function visitLocation(locationKey) { var location = travelLocations[locationKey]; // Change background color based on location if (location.background) { game.setBackgroundColor(location.background); } if (locationKey === "heavensArena") { showHeavensArena(); } else if (location.chapters && location.chapters.length > 0) { // Show story-based location currentLocation = locationKey; showLocationStory(locationKey, 0); } else { // Show location with special boss option storyPanel.setText("Welcome to " + location.name + "!\n\n" + location.description + "\n\n" + (location.specialBoss ? "A powerful enemy awaits you here!" : "This location is under development. More adventures coming soon!")); clearButtons(); // Add special boss fight button if available if (location.specialBoss) { var canFight = player.level >= location.specialBoss.level - 15 && player.hunterExamCompleted; var bossButton = new MenuButton("Fight " + location.specialBoss.name + " (Lv." + location.specialBoss.level + ")" + (canFight ? "" : " (Too Strong)"), canFight ? function () { fightLocationBoss(locationKey); } : null); bossButton.x = 1024; bossButton.y = 1300; if (!canFight) bossButton.alpha = 0.5; buttons.push(bossButton); game.addChild(bossButton); } var backButton = new MenuButton("Back to Travel", function () { game.setBackgroundColor(0x1a1a1a); // Reset to default background showTravelMenu(); }); backButton.x = 1024; backButton.y = 1400; buttons.push(backButton); game.addChild(backButton); } } function showHeavensArena() { var location = travelLocations.heavensArena; storyPanel.setText("Heaven's Arena - Floor " + location.currentFloor + "/200\n\nFight your way to the top! Each floor brings stronger opponents and greater rewards.\n\nCurrent Floor: " + location.currentFloor); clearButtons(); if (location.currentFloor < 200) { var fightButton = new MenuButton("Fight Next Opponent", function () { startHeavensArenaFight(); }); fightButton.x = 1024; fightButton.y = 1300; buttons.push(fightButton); game.addChild(fightButton); } else { var completedText = new Text2("Congratulations! You've conquered Heaven's Arena!", { size: 32, fill: 0x00FF00 }); completedText.anchor.set(0.5, 0.5); completedText.x = 1024; completedText.y = 1300; game.addChild(completedText); } var backButton = new MenuButton("Back to Travel", function () { showTravelMenu(); }); backButton.x = 1024; backButton.y = 1400; buttons.push(backButton); game.addChild(backButton); } function startHeavensArenaFight() { var location = travelLocations.heavensArena; var floorLevel = Math.floor(location.currentFloor / 50); var opponent = location.opponents[Math.min(floorLevel, location.opponents.length - 1)]; var playerPower = player.stats.strength + player.stats.speed + player.stats.intelligence + player.stats.aura; var opponentPower = opponent.level * 10; var success = playerPower > opponentPower * 0.8; if (success) { location.currentFloor += 25; player.experience += opponent.reward.exp; player.skillPoints += Math.floor(opponent.reward.exp / 20); if (player.experience >= player.maxExperience) { levelUp(); } storyPanel.setText("Victory!\n\nYou defeated the " + opponent.name + "!\n\nFloor advanced to: " + location.currentFloor + "\nExperience gained: " + opponent.reward.exp + "\nSkill Points gained: " + Math.floor(opponent.reward.exp / 20)); LK.effects.flashScreen(0x00ff00, 500); } else { player.health = Math.max(1, player.health - 30); storyPanel.setText("Defeat!\n\nThe " + opponent.name + " was too strong!\n\nHealth lost: 30\nTrain more before attempting this floor again!"); LK.effects.flashScreen(0xff0000, 500); } updateStatsUI(); clearButtons(); var continueButton = new MenuButton("Continue", function () { showHeavensArena(); }); continueButton.x = 1024; continueButton.y = 1400; buttons.push(continueButton); game.addChild(continueButton); } function showBossMenu() { storyPanel.setText("Boss Battles\n\nTest your skills against legendary hunters and dangerous opponents!"); clearButtons(); var bossKeys = Object.keys(bosses); var buttonY = 1200; for (var i = 0; i < bossKeys.length; i++) { var bossKey = bossKeys[i]; var boss = bosses[bossKey]; var canFight = player.level >= boss.level - 10 && player.hunterExamCompleted; var buttonText = boss.name + " (Lv." + boss.level + ")" + (canFight ? "" : " (Too Strong)"); var bossButton = new MenuButton(buttonText, canFight ? createBossCallback(bossKey) : null); bossButton.x = 700 + i % 2 * 450; bossButton.y = buttonY + Math.floor(i / 2) * 100; if (!canFight) bossButton.alpha = 0.5; buttons.push(bossButton); game.addChild(bossButton); } var backButton = new MenuButton("Back to Travel", function () { showTravelMenu(); }); backButton.x = 1024; backButton.y = 1600; buttons.push(backButton); game.addChild(backButton); } function createBossCallback(bossKey) { return function () { fightBoss(bossKey); }; } function fightLocationBoss(locationKey) { var location = travelLocations[locationKey]; var boss = location.specialBoss; // Create boss enemy object for battle system var bossEnemy = { name: boss.name, health: boss.health, maxHealth: boss.maxHealth, aura: boss.stats.aura * 5, stats: boss.stats, reward: boss.reward, abilities: boss.abilities, hatsu: boss.hatsu, level: boss.level }; // Add special boss dialogue based on location var bossDialogue = ""; switch (locationKey) { case "heavensArena": bossDialogue = "Razor grins as his 14 devils materialize around him. 'Let's play a real game!'"; break; case "yorknewCity": bossDialogue = "Chrollo opens his book calmly. 'I wonder what ability I should borrow for this fight...'"; break; case "greedIsland": bossDialogue = "Genthru's hands glow menacingly. 'You're about to learn why they call me the Bomber.'"; break; case "darkContinent": bossDialogue = "The King regards you with cold calculation. 'A human dares challenge me? Amusing.'"; break; default: bossDialogue = boss.name + " prepares for battle!"; break; } storyPanel.setText("Location Boss Battle: " + boss.name + "\n\n" + bossDialogue + "\n\nThis will be an intense battle!"); clearButtons(); var fightButton = new MenuButton("Begin Battle!", function () { startBattle(bossEnemy); }); fightButton.x = 1024; fightButton.y = 1300; buttons.push(fightButton); game.addChild(fightButton); var retreatButton = new MenuButton("Retreat", function () { visitLocation(locationKey); }); retreatButton.x = 1024; retreatButton.y = 1400; buttons.push(retreatButton); game.addChild(retreatButton); } function fightBoss(bossKey) { var boss = bosses[bossKey]; // Create boss enemy object for battle system var bossEnemy = { name: boss.name, health: boss.health, maxHealth: boss.maxHealth, aura: boss.stats.aura * 5, stats: boss.stats, reward: boss.reward, abilities: boss.abilities, hatsu: boss.hatsu, level: boss.level }; // Add special boss dialogue var bossDialogue = ""; switch (bossKey) { case "gon": bossDialogue = "Gon clenches his fist, rock energy gathering around him. 'I won't lose to you!'"; break; case "killua": bossDialogue = "Killua's hands crackle with electricity. 'Let me show you the Zoldyck family's power!'"; break; case "hisoka": bossDialogue = "Hisoka licks his lips menacingly. 'Oh, what a delicious fight this will be... ♠'"; break; case "illumi": bossDialogue = "Illumi's dead eyes stare at you. 'I'll make you into one of my puppets.'"; break; } storyPanel.setText("Boss Battle: " + boss.name + "\n\n" + bossDialogue + "\n\nThe battle begins!"); clearButtons(); var fightButton = new MenuButton("Begin Battle!", function () { startBattle(bossEnemy); }); fightButton.x = 1024; fightButton.y = 1300; buttons.push(fightButton); game.addChild(fightButton); var retreatButton = new MenuButton("Retreat", function () { showBossMenu(); }); retreatButton.x = 1024; retreatButton.y = 1400; buttons.push(retreatButton); game.addChild(retreatButton); } // Current location tracking var currentLocation = null; var currentLocationChapter = 0; function showLocationStory(locationKey, chapterIndex) { var location = travelLocations[locationKey]; var chapter = location.chapters[chapterIndex]; if (!chapter) { // Story completed, show boss fight option and summary storyPanel.setText("Your adventure in " + location.name + " is complete!\n\nYou've gained valuable experience and grown stronger through your journey. The challenges you faced have prepared you for what lies ahead.\n\n" + (location.specialBoss ? "A powerful enemy still lurks in this area. Do you dare to face them?" : "This location holds no more immediate threats.")); clearButtons(); // Add boss fight option if available if (location.specialBoss) { var canFightBoss = player.level >= location.specialBoss.level - 15 && player.hunterExamCompleted; var bossButton = new MenuButton("Challenge " + location.specialBoss.name + " (Level " + location.specialBoss.level + ")" + (canFightBoss ? "" : " - Too Strong"), canFightBoss ? function () { fightLocationBoss(locationKey); } : null); bossButton.x = 1024; bossButton.y = 1300; if (!canFightBoss) bossButton.alpha = 0.5; buttons.push(bossButton); game.addChild(bossButton); } var backButton = new MenuButton("Return to Travel", function () { game.setBackgroundColor(0x1a1a1a); // Reset background showTravelMenu(); }); backButton.x = 1024; backButton.y = 1400; buttons.push(backButton); game.addChild(backButton); return; } storyPanel.setText(location.story + "\n\n" + chapter.title + "\n\n" + chapter.text); clearButtons(); for (var i = 0; i < chapter.choices.length; i++) { var choice = chapter.choices[i]; var choiceButton = new MenuButton(choice.text, createLocationChoiceCallback(locationKey, chapterIndex, choice)); choiceButton.x = 1024; choiceButton.y = 1300 + i * 100; buttons.push(choiceButton); game.addChild(choiceButton); } } function createLocationChoiceCallback(locationKey, chapterIndex, choice) { return function () { handleLocationChoice(locationKey, chapterIndex, choice); }; } function handleLocationChoice(locationKey, chapterIndex, choice) { var expGain = 100 + chapterIndex * 50; var statGain = 5 + chapterIndex * 2; // Apply choice consequences switch (choice.action) { case "auction_direct": player.stats.intelligence += statGain; player.health -= 20; break; case "underground_info": player.stats.speed += statGain; player.stats.intelligence += statGain; break; case "hunter_backup": player.stats.strength += statGain; break; case "direct_confrontation": if (Math.random() < 0.3) { // 30% chance of success player.stats.strength += statGain * 3; player.stats.aura += statGain * 2; expGain *= 3; } else { player.health = Math.max(1, player.health - 60); expGain = Math.floor(expGain / 2); } break; case "negotiate_troupe": player.stats.intelligence += statGain * 2; player.skillPoints += 10; break; case "tactical_retreat": player.stats.speed += statGain; break; case "hunt_monsters": player.stats.strength += statGain; player.stats.speed += statGain; break; case "form_team": player.stats.intelligence += statGain; player.health += 20; break; case "veteran_advice": player.stats.intelligence += statGain * 2; player.skillPoints += 5; break; case "bomb_challenge": if (Math.random() < 0.4) { // 40% chance of success player.stats.aura += statGain * 3; player.skillPoints += 20; expGain *= 4; } else { player.health = Math.max(1, player.health - 80); } break; case "unite_players": player.stats.intelligence += statGain; player.stats.strength += statGain; break; case "speed_escape": player.stats.speed += statGain * 2; break; case "show_hatsu": if (player.hatsu) { player.stats.aura += statGain * 2; player.hatsuMastery += 20; player.aura = Math.max(10, player.aura - 50); } break; case "communicate_guardian": if (Math.random() < 0.5) { player.stats.intelligence += statGain * 2; player.stats.aura += statGain * 2; nenMastery.totalTechniques += 2; } else { player.health = Math.max(1, player.health - 40); } break; case "stealth_bypass": player.stats.speed += statGain; break; case "queen_combat": if (Math.random() < 0.2) { // 20% chance - very difficult player.stats.strength += statGain * 4; player.stats.aura += statGain * 4; player.level += 5; expGain *= 5; } else { player.health = Math.max(1, player.health - 90); expGain = Math.floor(expGain / 3); } break; case "serve_colony": player.stats.strength += statGain * 2; player.stats.speed += statGain * 2; player.stats.intelligence -= statGain; // Lose some humanity break; case "ant_alliance": player.stats.intelligence += statGain * 2; player.skillPoints += 15; break; // New Yorknew City actions case "infiltrate_crime": if (Math.random() < 0.6) { player.stats.intelligence += statGain * 2; player.skillPoints += 10; expGain *= 2; } else { player.health = Math.max(1, player.health - 40); } break; case "broker_alliance": player.stats.intelligence += statGain * 3; player.skillPoints += 15; break; case "underground_bosses": player.stats.strength += statGain * 2; player.stats.speed += statGain; break; case "stop_troupe": if (Math.random() < 0.3) { player.stats.strength += statGain * 4; player.stats.aura += statGain * 3; expGain *= 4; } else { player.health = Math.max(1, player.health - 70); } break; case "steal_items": player.stats.speed += statGain * 2; player.stats.intelligence += statGain; player.skillPoints += 20; break; case "save_innocents": player.stats.intelligence += statGain; player.maxHealth += 30; break; // New Greed Island actions case "defensive_traps": player.stats.intelligence += statGain * 2; break; case "attack_rivals": player.stats.strength += statGain * 2; player.stats.speed += statGain; break; case "rival_alliance": player.stats.intelligence += statGain; player.skillPoints += 8; break; case "ruins_solo": if (Math.random() < 0.4) { player.stats.aura += statGain * 3; player.skillPoints += 25; expGain *= 3; } else { player.health = Math.max(1, player.health - 50); } break; case "ruins_team": player.stats.strength += statGain; player.stats.intelligence += statGain; break; case "ruins_research": player.stats.intelligence += statGain * 2; break; // New Dark Continent actions case "study_anomalies": if (Math.random() < 0.5) { player.stats.intelligence += statGain * 3; player.stats.aura += statGain * 2; nenMastery.totalTechniques += 3; } else { player.stats.intelligence -= statGain; player.health = Math.max(1, player.health - 30); } break; case "hunt_impossibles": if (Math.random() < 0.3) { player.stats.strength += statGain * 4; player.stats.aura += statGain * 4; player.level += 3; expGain *= 5; } else { player.health = Math.max(1, player.health - 80); } break; case "wait_safety": player.health += 30; break; case "decipher_inscriptions": if (Math.random() < 0.6) { player.stats.intelligence += statGain * 3; player.stats.aura += statGain * 3; nenMastery.totalTechniques += 5; player.skillPoints += 30; } else { player.health = Math.max(1, player.health - 60); player.stats.intelligence -= Math.floor(statGain / 2); } break; case "explore_architecture": player.stats.aura += statGain * 2; player.stats.intelligence += statGain * 2; break; case "contact_spirits": if (Math.random() < 0.4) { player.stats.aura += statGain * 4; player.stats.intelligence += statGain * 3; nenMastery.totalTechniques += 4; expGain *= 4; } else { player.health = Math.max(1, player.health - 70); player.aura = Math.max(10, player.aura - 40); } break; // NGL-specific actions case "safe_paths": player.stats.intelligence += statGain; player.health += 20; break; case "wilderness_shortcuts": if (Math.random() < 0.6) { player.stats.speed += statGain * 2; player.stats.strength += statGain; expGain *= 2; } else { player.health = Math.max(1, player.health - 40); } break; case "observe_area": player.stats.intelligence += statGain * 2; player.skillPoints += 8; break; case "fight_scouts": if (Math.random() < 0.4) { player.stats.strength += statGain * 3; player.stats.speed += statGain * 2; expGain *= 3; } else { player.health = Math.max(1, player.health - 50); expGain = Math.floor(expGain / 2); } break; case "stealth_avoid": player.stats.speed += statGain; player.stats.intelligence += statGain; break; case "communicate_ants": if (Math.random() < 0.3) { player.stats.intelligence += statGain * 3; player.skillPoints += 15; nenMastery.totalTechniques += 2; } else { player.health = Math.max(1, player.health - 60); } break; case "investigate_research": player.stats.intelligence += statGain * 3; player.skillPoints += 20; if (Math.random() < 0.2) { player.stats.aura += statGain * 2; } break; case "find_researchers": if (Math.random() < 0.5) { player.stats.intelligence += statGain * 2; player.skillPoints += 10; expGain *= 2; } else { player.health = Math.max(1, player.health - 35); } break; case "destroy_facility": player.stats.strength += statGain; player.maxHealth += 25; break; case "genetic_study": if (Math.random() < 0.3) { // Successful study - gain incredible evolution-based powers player.stats.strength += statGain * 4; player.stats.speed += statGain * 3; player.stats.aura += statGain * 4; player.level += 2; expGain *= 5; } else { // Mutation risk - lose health but gain some benefits player.health = Math.max(1, player.health - 70); player.stats.strength += statGain; player.stats.aura += statGain; } break; case "collect_samples": player.stats.intelligence += statGain * 2; player.skillPoints += 25; if (Math.random() < 0.4) { player.health = Math.max(1, player.health - 30); } break; case "destroy_genetic_material": player.stats.intelligence += statGain; player.maxHealth += 30; break; case "challenge_new_queen": if (Math.random() < 0.2) { // Victory against Queen - incredible rewards player.stats.strength += statGain * 5; player.stats.speed += statGain * 4; player.stats.aura += statGain * 5; player.level += 3; expGain *= 6; } else { // Defeat - Chimera Ant reincarnation system handleChimeraAntReincarnation(); return; // Skip normal processing } break; case "negotiate_colony": if (Math.random() < 0.4) { player.stats.intelligence += statGain * 3; player.skillPoints += 30; expGain *= 3; } else { handleChimeraAntReincarnation(); return; } break; case "report_colony": player.stats.intelligence += statGain; player.skillPoints += 15; break; case "final_battle_full_power": if (Math.random() < 0.3) { player.stats.strength += statGain * 4; player.stats.aura += statGain * 4; expGain *= 4; } else { handleChimeraAntReincarnation(); return; } break; case "study_evolution": if (Math.random() < 0.5) { player.stats.intelligence += statGain * 4; nenMastery.totalTechniques += 3; expGain *= 3; } else { handleChimeraAntReincarnation(); return; } break; case "turn_against_threats": player.stats.intelligence += statGain * 2; player.skillPoints += 20; break; // New Meteor City actions case "fighting_tournaments": if (Math.random() < 0.5) { player.stats.strength += statGain * 3; player.stats.speed += statGain * 2; expGain *= 3; } else { player.health = Math.max(1, player.health - 60); } break; case "organize_legitimate": player.stats.intelligence += statGain * 2; player.maxHealth += 25; break; case "expose_operations": player.stats.intelligence += statGain; player.health = Math.max(1, player.health - 30); break; } // Apply experience and level up if needed player.experience += expGain; while (player.experience >= player.maxExperience && player.level < 50) { levelUp(); } // Show results storyPanel.setText("Result: " + choice.consequences + "\n\nExperience gained: " + expGain + "\nStats improved based on your choice!"); clearButtons(); var continueButton = new MenuButton("Continue", function () { showLocationStory(locationKey, chapterIndex + 1); }); continueButton.x = 1024; continueButton.y = 1400; buttons.push(continueButton); game.addChild(continueButton); updateStatsUI(); LK.effects.flashScreen(0x00aaff, 500); } function startBattle(enemy) { currentBattle = true; battleState.enemy = enemy; battleState.playerHealth = player.health; battleState.enemyHealth = enemy.health; battleState.playerAura = player.aura; battleState.enemyAura = enemy.aura || 100; battleState.playerTurn = true; battleState.battleLog = []; battleState.availableActions = getAvailableBattleActions(); showBattleScreen(); } function getAvailableBattleActions() { var actions = ["attack", "guard", "recover"]; if (player.hatsu && battleState.playerAura >= battleActions.hatsuAttack.auraRequired) { actions.push("hatsuAttack"); } if (nenMastery.totalTechniques > 0 && battleState.playerAura >= battleActions.nenTechnique.auraRequired) { actions.push("nenTechnique"); } if (battleState.playerAura >= battleActions.parry.auraRequired) { actions.push("parry"); } // Add Jajanken variants if player has Jajanken if (player.hatsu && player.hatsu.name === "Jajanken") { if (battleState.playerAura >= battleActions.jajankenRock.auraRequired) { actions.push("jajankenRock"); } if (battleState.playerAura >= battleActions.jajankenPaper.auraRequired) { actions.push("jajankenPaper"); } if (battleState.playerAura >= battleActions.jajankenScissors.auraRequired) { actions.push("jajankenScissors"); } } // Add Nen type specific special actions if (player.nenType && player.hatsu) { var nenTypeKey = player.nenType.toLowerCase(); var specialActionKey = nenTypeKey + "Special"; if (battleActions[specialActionKey] && battleState.playerAura >= battleActions[specialActionKey].auraRequired) { actions.push(specialActionKey); } // Add Specialist copy slots if they have the copy ability if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") { for (var i = 0; i < 3; i++) { if (player.copiedAbilities[i] && battleState.playerAura >= 25) { actions.push("copySlot" + (i + 1)); } } } } return actions; } function showBattleScreen() { var battleText = "=== BATTLE ===\n\n"; battleText += "You: " + battleState.playerHealth + "/" + player.maxHealth + " HP, " + battleState.playerAura + "/" + player.maxAura + " Aura\n"; battleText += battleState.enemy.name + ": " + battleState.enemyHealth + "/" + battleState.enemy.health + " HP\n\n"; if (battleState.battleLog.length > 0) { battleText += "Last Action: " + battleState.battleLog[battleState.battleLog.length - 1] + "\n\n"; } battleText += battleState.playerTurn ? "Your turn! Choose your action:" : "Enemy is preparing to attack..."; storyPanel.setText(battleText); clearButtons(); if (battleState.playerTurn) { var actionsPerRow = 3; for (var i = 0; i < battleState.availableActions.length; i++) { var actionKey = battleState.availableActions[i]; var action = battleActions[actionKey]; var actionButton = new MenuButton(action.name + " (" + action.auraRequired + " aura)", createBattleActionCallback(actionKey)); actionButton.x = 400 + i % actionsPerRow * 400; actionButton.y = 1300 + Math.floor(i / actionsPerRow) * 100; if (battleState.playerAura < action.auraRequired) { actionButton.alpha = 0.5; } buttons.push(actionButton); game.addChild(actionButton); } } else { // Enemy turn - automatically execute after delay LK.setTimeout(function () { executeEnemyTurn(); }, 1500); } } function createBattleActionCallback(actionKey) { return function () { if (battleState.playerAura >= battleActions[actionKey].auraRequired) { executeBattleAction(actionKey); } }; } function executeBattleAction(actionKey) { var action = battleActions[actionKey]; var damage = 0; var logMessage = ""; battleState.playerAura -= action.auraRequired; // Check if player is stunned (skip turn) if (battleState.playerStunned) { logMessage = "You're stunned and cannot act this turn!"; battleState.playerStunned = false; battleState.battleLog.push(logMessage); battleState.playerTurn = false; showBattleScreen(); return; } switch (actionKey) { case "attack": damage = player.stats.strength + Math.floor(Math.random() * 20); // Apply needle debuff if (battleState.needleDebuff) { damage = Math.floor(damage * 0.6); logMessage = "Your attack is weakened by Illumi's needles! You strike for " + damage + " damage!"; battleState.needleDebuff = false; } else { logMessage = "You strike for " + damage + " damage!"; } break; case "hatsuAttack": if (player.hatsu) { damage = player.stats.strength + player.stats.aura + Math.floor(Math.random() * 30); // Apply Hatsu battle effects if (player.hatsu.battleEffects) { var effects = player.hatsu.battleEffects; if (effects.multiplier) { damage = Math.floor(damage * effects.multiplier); } // Handle special effects if (effects.special === "stun_chance" && Math.random() < 0.3) { battleState.enemyStunned = true; logMessage = "Your " + player.hatsu.name + " stuns the enemy for " + damage + " damage!"; } else if (effects.special === "piercing") { battleState.ignoredDefense = true; logMessage = "Your " + player.hatsu.name + " pierces through defenses for " + damage + " damage!"; } else if (effects.special === "damage_over_time") { battleState.poisonDamage = Math.floor(damage * 0.3); battleState.poisonTurns = 3; logMessage = "Your " + player.hatsu.name + " poisons the enemy for " + damage + " damage! They'll take more damage over time!"; } else { logMessage = "You use " + player.hatsu.name + " for " + damage + " damage!"; } } else { logMessage = "You use " + player.hatsu.name + " for " + damage + " damage!"; } if (player.nenVow) { damage = Math.floor(damage * player.nenVow.powerBoost); } // Apply needle debuff if (battleState.needleDebuff) { damage = Math.floor(damage * 0.6); logMessage = "Your Hatsu is weakened by Illumi's needles! " + logMessage; battleState.needleDebuff = false; } } break; case "jajankenRock": damage = player.stats.strength * 3 + Math.floor(Math.random() * 50); if (Math.random() < 0.4) { battleState.enemyStunned = true; logMessage = "You charge up: 'Jajanken: Rock!' A devastating punch that stuns the enemy for " + damage + " damage!"; } else { logMessage = "You charge up: 'Jajanken: Rock!' A powerful punch for " + damage + " damage!"; } if (player.nenVow) { damage = Math.floor(damage * player.nenVow.powerBoost); } break; case "jajankenPaper": damage = player.stats.aura * 2 + Math.floor(Math.random() * 40); battleState.ignoredDefense = true; logMessage = "You unleash: 'Jajanken: Paper!' An aura emission blast that pierces defenses for " + damage + " damage!"; if (player.nenVow) { damage = Math.floor(damage * player.nenVow.powerBoost); } break; case "jajankenScissors": damage = player.stats.speed + player.stats.strength + Math.floor(Math.random() * 45); damage = Math.floor(damage * 2.5); // High damage multiplier logMessage = "You strike: 'Jajanken: Scissors!' Sharp transmuted aura cuts deep for " + damage + " damage!"; if (Math.random() < 0.3) { battleState.poisonDamage = Math.floor(damage * 0.2); battleState.poisonTurns = 2; logMessage += " The cutting aura causes bleeding!"; } if (player.nenVow) { damage = Math.floor(damage * player.nenVow.powerBoost); } break; case "nenTechnique": damage = player.stats.aura + Math.floor(Math.random() * 25); // Apply needle debuff if (battleState.needleDebuff) { damage = Math.floor(damage * 0.6); logMessage = "Your Nen technique is weakened by Illumi's needles! You attack for " + damage + " damage!"; battleState.needleDebuff = false; } else { logMessage = "You use a Nen technique for " + damage + " damage!"; } break; case "enhancerSpecial": damage = player.stats.strength * 2 + Math.floor(Math.random() * 40); if (Math.random() < 0.4) { battleState.nextAttackEnhanced = true; logMessage = "You focus all your enhancement! Devastating strike for " + damage + " damage! Your next attack will be enhanced!"; } else { logMessage = "You unleash your Enhancement mastery for " + damage + " damage!"; } break; case "emitterSpecial": damage = player.stats.aura * 1.5 + Math.floor(Math.random() * 35); if (Math.random() < 0.5) { damage = Math.floor(damage * 1.5); logMessage = "Multiple aura projectiles hit the target for " + damage + " damage!"; } else { logMessage = "Your emission barrage deals " + damage + " damage!"; } break; case "manipulatorSpecial": damage = player.stats.intelligence + Math.floor(Math.random() * 25); if (Math.random() < 0.6) { battleState.enemyConfused = true; logMessage = "You manipulate the enemy's mind! They take " + damage + " damage and become confused!"; } else { logMessage = "Your manipulation attempt deals " + damage + " damage!"; } break; case "transmuterSpecial": damage = player.stats.aura + player.stats.speed + Math.floor(Math.random() * 30); var properties = ["electric", "rubber", "sharp", "sticky"]; var property = properties[Math.floor(Math.random() * properties.length)]; if (property === "electric" && Math.random() < 0.4) { battleState.enemyStunned = true; logMessage = "Your electric aura shocks for " + damage + " damage and stuns the enemy!"; } else if (property === "sharp") { damage = Math.floor(damage * 1.3); logMessage = "Your sharp aura cuts deeply for " + damage + " damage!"; } else { logMessage = "Your transmuted " + property + " aura deals " + damage + " damage!"; } break; case "conjurerSpecial": damage = player.stats.intelligence + Math.floor(Math.random() * 28); var conjuredWeapons = Math.floor(Math.random() * 3) + 2; damage *= conjuredWeapons; logMessage = "You conjure " + conjuredWeapons + " weapons that attack for " + damage + " total damage!"; break; case "specialistSpecial": damage = player.stats.aura + player.stats.intelligence + Math.floor(Math.random() * 50); if (Math.random() < 0.3) { damage = Math.floor(damage * 2); logMessage = "Your unique specialist ability activates perfectly for " + damage + " damage!"; } else { logMessage = "Your specialist power deals " + damage + " damage!"; } break; case "copySlot1": case "copySlot2": case "copySlot3": var slotIndex = parseInt(actionKey.slice(-1)) - 1; var copiedAbility = player.copiedAbilities[slotIndex]; if (copiedAbility) { damage = Math.floor((player.stats.aura + player.stats.intelligence) * copiedAbility.multiplier) + Math.floor(Math.random() * 30); logMessage = "You use copied ability: " + copiedAbility.name + " for " + damage + " damage!"; if (copiedAbility.special === "stun_chance" && Math.random() < 0.25) { battleState.enemyStunned = true; logMessage += " The enemy is stunned!"; } else if (copiedAbility.special === "piercing") { battleState.ignoredDefense = true; logMessage += " The attack pierces defenses!"; } } break; case "parry": battleState.nextParry = true; logMessage = "You prepare to parry the next attack!"; break; case "guard": battleState.nextGuard = true; logMessage = "You take a defensive stance!"; break; case "recover": var auraRecovered = Math.min(30, player.maxAura - battleState.playerAura); battleState.playerAura += auraRecovered; logMessage = "You recover " + auraRecovered + " aura!"; break; } if (damage > 0) { battleState.enemyHealth -= damage; } battleState.battleLog.push(logMessage); battleState.playerTurn = false; // Check if enemy is defeated if (battleState.enemyHealth <= 0) { endBattle(true); return; } battleState.availableActions = getAvailableBattleActions(); showBattleScreen(); } function executeEnemyTurn() { var enemy = battleState.enemy; var useHatsu = false; var damage = 0; var logMessage = ""; // Enhanced boss logic - higher chance to use special attacks and more devastating effects var hatsuChance = enemy.level >= 50 ? 0.6 : 0.3; // Stronger bosses use abilities more often // Check if enemy should use Hatsu if (enemy.hatsu && battleState.enemyAura >= enemy.hatsu.auraRequired && Math.random() < hatsuChance) { useHatsu = true; battleState.enemyAura -= enemy.hatsu.auraRequired; // Execute specific Hatsu attacks based on enemy Hatsu data switch (enemy.hatsu.name) { case "Jajanken": var variant = enemy.hatsu.variants[Math.floor(Math.random() * 3)]; switch (variant) { case "Rock": damage = enemy.stats.strength * 2 + Math.floor(Math.random() * 30); logMessage = enemy.name + " charges up: 'Jajanken: Rock!' A devastating punch for " + damage + " damage!"; // Try to copy this ability for Specialists if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") { tryToCopyAbility("Jajanken: Rock", { name: "Jajanken: Rock", multiplier: 2.0, special: "stun_chance" }); } break; case "Paper": damage = enemy.stats.aura + Math.floor(Math.random() * 25); logMessage = enemy.name + " unleashes: 'Jajanken: Paper!' An aura blast for " + damage + " damage!"; if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") { tryToCopyAbility("Jajanken: Paper", { name: "Jajanken: Paper", multiplier: 1.8, special: "piercing" }); } break; case "Scissors": damage = enemy.stats.speed + enemy.stats.strength + Math.floor(Math.random() * 20); logMessage = enemy.name + " strikes: 'Jajanken: Scissors!' A sharp cutting attack for " + damage + " damage!"; if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") { tryToCopyAbility("Jajanken: Scissors", { name: "Jajanken: Scissors", multiplier: 1.9, special: "piercing" }); } break; } break; case "Lightning Palm": damage = enemy.stats.speed + enemy.stats.aura + Math.floor(Math.random() * 35); logMessage = enemy.name + "'s hands crackle with electricity: 'Lightning Palm!' Shocking you for " + damage + " damage!"; if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") { tryToCopyAbility("Lightning Palm", { name: "Lightning Palm", multiplier: 2.2, special: "stun_chance" }); } // Lightning has chance to stun (skip next turn) if (Math.random() < 0.3) { battleState.playerStunned = true; logMessage += " You're stunned by the electricity!"; } break; case "Bungee Gum": damage = enemy.stats.intelligence + Math.floor(Math.random() * 25); logMessage = enemy.name + " grins: 'Bungee Gum has both rubber and gum properties!' Tricky attack for " + damage + " damage!"; if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") { tryToCopyAbility("Bungee Gum", { name: "Bungee Gum", multiplier: 1.8, special: "movement_restrict" }); } // Bungee Gum can pull player closer (reduce next guard effectiveness) battleState.bungeeGumEffect = true; logMessage += " Your movements are restricted!"; break; case "Needle People": damage = enemy.stats.intelligence + Math.floor(Math.random() * 20); logMessage = enemy.name + " throws needles: 'Needle People!' Manipulating attack for " + damage + " damage!"; if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") { tryToCopyAbility("Needle People", { name: "Needle People", multiplier: 1.6, special: "debuff_enemy" }); } // Needle manipulation reduces player's next attack if (Math.random() < 0.4) { battleState.needleDebuff = true; logMessage += " The needles cloud your mind!"; } break; case "14 Devils": damage = enemy.stats.aura * 2 + Math.floor(Math.random() * 60); var devilCount = Math.floor(Math.random() * 3) + 2; damage *= devilCount; logMessage = enemy.name + " summons " + devilCount + " emission devils: '14 Devils!' Multiple devastating attacks for " + damage + " total damage!"; if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") { tryToCopyAbility("14 Devils", { name: "14 Devils", multiplier: 2.5, special: "multi_hit" }); } // Devils have chance to inflict status effects if (Math.random() < 0.4) { battleState.playerStunned = true; logMessage += " The devils overwhelm you!"; } break; case "Skill Hunter": damage = enemy.stats.intelligence * 2 + Math.floor(Math.random() * 50); var stolenSkills = ["Indoor Fish", "Order Stamp", "Black Voice"]; var usedSkill = stolenSkills[Math.floor(Math.random() * stolenSkills.length)]; logMessage = enemy.name + " opens his book: 'Skill Hunter - " + usedSkill + "!' Stolen ability deals " + damage + " damage!"; if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") { tryToCopyAbility("Skill Hunter", { name: "Skill Hunter", multiplier: 2.0, special: "ability_steal" }); } // Different effects based on stolen skill if (usedSkill === "Black Voice" && Math.random() < 0.3) { battleState.needleDebuff = true; logMessage += " You feel controlled!"; } break; case "Little Flower": damage = enemy.stats.strength * 2.5 + Math.floor(Math.random() * 70); logMessage = enemy.name + " touches you: 'Little Flower!' Explosive aura detonates for " + damage + " damage!"; if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") { tryToCopyAbility("Little Flower", { name: "Little Flower", multiplier: 2.5, special: "explosive" }); } // Explosion can cause burn damage over time if (Math.random() < 0.5) { battleState.poisonDamage = Math.floor(damage * 0.4); battleState.poisonTurns = 3; logMessage += " The explosion burns you!"; } break; case "Rage Blast": damage = enemy.stats.aura * 3 + Math.floor(Math.random() * 100); logMessage = enemy.name + " charges ultimate power: 'Rage Blast!' Apocalyptic energy blast for " + damage + " damage!"; if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") { tryToCopyAbility("Rage Blast", { name: "Rage Blast", multiplier: 3.0, special: "ultimate_attack" }); } // Rage Blast is extremely devastating battleState.ignoredDefense = true; if (Math.random() < 0.6) { battleState.playerStunned = true; logMessage += " The overwhelming power stuns you!"; } break; default: // Generic Hatsu attack for any other abilities - now more powerful damage = enemy.stats.strength + enemy.stats.aura + Math.floor(Math.random() * 40); // Stronger enemies deal more damage if (enemy.level >= 50) { damage = Math.floor(damage * 1.5); } logMessage = enemy.name + " uses " + enemy.hatsu.name + " for " + damage + " damage!"; if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") { tryToCopyAbility(enemy.hatsu.name, { name: enemy.hatsu.name, multiplier: 1.8, special: "generic_hatsu" }); } break; } } else { // Regular attack damage = enemy.stats.strength + Math.floor(Math.random() * 15); logMessage = enemy.name + " attacks for " + damage + " damage!"; } // Apply boss defense system if (battleState.enemy && damage > 0) { var bossDefense = calculateBossDefense(battleState.enemy); var originalDamage = damage; damage = Math.max(1, Math.floor(damage * bossDefense.damageReduction)); if (originalDamage !== damage && bossDefense.defenseType) { logMessage += " " + battleState.enemy.name + " uses " + bossDefense.defenseType + " to reduce damage!"; } } // Apply player defensive modifiers if (battleState.nextParry && !battleState.playerStunned) { var parryEffectiveness = battleState.bungeeGumEffect ? 0.4 : 0.2; damage = Math.floor(damage * parryEffectiveness); var counterDamage = player.stats.strength; battleState.enemyHealth -= counterDamage; logMessage += " You parry and counter for " + counterDamage + " damage!"; battleState.nextParry = false; } else if (battleState.nextGuard && !battleState.playerStunned) { var guardEffectiveness = battleState.bungeeGumEffect ? 0.7 : 0.5; damage = Math.floor(damage * guardEffectiveness); logMessage += " You block, reducing damage!"; battleState.nextGuard = false; } // Apply damage battleState.playerHealth -= damage; battleState.battleLog.push(logMessage); // Reset status effects if (battleState.playerStunned) { battleState.playerStunned = false; } if (battleState.bungeeGumEffect) { battleState.bungeeGumEffect = false; } battleState.playerTurn = true; // Check if player is defeated if (battleState.playerHealth <= 0) { endBattle(false); return; } showBattleScreen(); } function calculateBossDefense(enemy) { var defenseLevel = 1.0; // No defense reduction by default var defenseType = ""; var enemyLevel = enemy.level || 25; var enemyAura = enemy.stats ? enemy.stats.aura : 25; // Stronger bosses have better defensive techniques if (enemyLevel >= 50) { // High-level bosses use Ken (maintain aura defense) if (Math.random() < 0.7) { defenseLevel = 0.4; // 60% damage reduction defenseType = "Ken (Enhanced Defense)"; } } else if (enemyLevel >= 35) { // Mid-level bosses use Ten (basic aura shroud) if (Math.random() < 0.5) { defenseLevel = 0.6; // 40% damage reduction defenseType = "Ten (Aura Shroud)"; } } else if (enemyLevel >= 25) { // Lower bosses have basic defense if (Math.random() < 0.3) { defenseLevel = 0.8; // 20% damage reduction defenseType = "Basic Nen Defense"; } } // Special boss-specific defenses if (enemy.name === "Meruem (The King)") { defenseLevel = 0.3; // King has incredible defense defenseType = "Royal Guard Defense"; } else if (enemy.name === "Razor") { if (Math.random() < 0.6) { defenseLevel = 0.5; defenseType = "Devil Shield"; } } else if (enemy.name === "Chrollo Lucilfer") { if (Math.random() < 0.4) { defenseLevel = 0.7; defenseType = "Stolen Defensive Ability"; } } else if (enemy.name === "Hisoka Morow") { if (Math.random() < 0.3) { defenseLevel = 0.8; defenseType = "Bungee Gum Shield"; } } return { damageReduction: defenseLevel, defenseType: defenseType }; } function tryToCopyAbility(abilityName, abilityData) { if (!player.copiedAbilityWitnesses[abilityName]) { player.copiedAbilityWitnesses[abilityName] = 0; } player.copiedAbilityWitnesses[abilityName]++; if (player.copiedAbilityWitnesses[abilityName] >= 3) { // Find empty slot to store ability for (var i = 0; i < 3; i++) { if (!player.copiedAbilities[i]) { player.copiedAbilities[i] = abilityData; battleState.battleLog.push("You've learned to copy: " + abilityName + "!"); LK.effects.flashScreen(0x00ffff, 300); break; } } } } function handleChimeraAntReincarnation() { var reincarnationChance = Math.random(); var reincarnationType = ""; var newStats = {}; if (reincarnationChance <= 0.05) { // 5% chance to become King reincarnationType = "Chimera Ant King"; newStats = { strength: player.stats.strength + 50, speed: player.stats.speed + 40, intelligence: player.stats.intelligence + 60, aura: player.stats.aura + 70 }; player.level += 10; player.maxHealth += 200; player.maxAura += 150; } else if (reincarnationChance <= 0.20) { // 15% chance to become Royal Guard reincarnationType = "Royal Guard"; newStats = { strength: player.stats.strength + 30, speed: player.stats.speed + 25, intelligence: player.stats.intelligence + 20, aura: player.stats.aura + 35 }; player.level += 5; player.maxHealth += 100; player.maxAura += 75; } else { // 80% chance to become normal Chimera Ant reincarnationType = "Chimera Ant Soldier"; newStats = { strength: player.stats.strength + 10, speed: player.stats.speed + 10, intelligence: player.stats.intelligence + 5, aura: player.stats.aura + 15 }; player.level += 2; player.maxHealth += 50; player.maxAura += 25; } // Apply new stats player.stats = newStats; player.health = player.maxHealth; player.aura = player.maxAura; player.experience = 0; player.maxExperience += 100; player.skillPoints += 50; // Add special Chimera Ant abilities if (!player.abilities.includes("Enhanced Senses")) { player.abilities.push("Enhanced Senses"); } if (!player.abilities.includes("Regeneration")) { player.abilities.push("Regeneration"); } // Special Hatsu based on reincarnation type if (reincarnationType === "Chimera Ant King") { player.hatsu = { name: "Royal Authority", description: "Command lesser Chimera Ants and use devastating royal techniques", auraReq: 60, conditions: "Must maintain royal dignity", battleEffects: { type: "royal_command", multiplier: 3.5, special: "command_ants" } }; } else if (reincarnationType === "Royal Guard") { player.hatsu = { name: "Guard's Devotion", description: "Protective abilities and enhanced combat techniques", auraReq: 40, conditions: "Must protect allies", battleEffects: { type: "guard_protection", multiplier: 2.8, special: "protect_others" } }; } else { player.hatsu = { name: "Ant Instincts", description: "Enhanced predatory abilities and pack coordination", auraReq: 25, conditions: "Must hunt with purpose", battleEffects: { type: "predator_instinct", multiplier: 2.2, special: "pack_hunt" } }; } player.hatsuMastery = 30; storyPanel.setText("REINCARNATION!\n\nYou have been consumed by the Chimera Ants and reborn as a " + reincarnationType + "!\n\nYour human memories remain, but your body and abilities have been dramatically enhanced. You retain your intelligence and Nen abilities while gaining incredible new powers.\n\nNew Type: " + reincarnationType + "\nLevel Gained: +" + (reincarnationType === "Chimera Ant King" ? 10 : reincarnationType === "Royal Guard" ? 5 : 2) + "\nNew Hatsu: " + player.hatsu.name); clearButtons(); var continueButton = new MenuButton("Continue as " + reincarnationType, function () { updateStatsUI(); LK.effects.flashScreen(0x880088, 2000); game.setBackgroundColor(0x1a1a1a); showTravelMenu(); }); continueButton.x = 1024; continueButton.y = 1400; buttons.push(continueButton); game.addChild(continueButton); updateStatsUI(); LK.effects.flashScreen(0x880088, 2000); } function endBattle(playerWon) { currentBattle = false; player.health = battleState.playerHealth; player.aura = battleState.playerAura; if (playerWon) { var exp = battleState.enemy.reward ? battleState.enemy.reward.experience : 100; var sp = battleState.enemy.reward ? battleState.enemy.reward.skillPoints : 5; player.experience += exp; player.skillPoints += sp; while (player.experience >= player.maxExperience && player.level < 50) { levelUp(); } storyPanel.setText("VICTORY!\n\nYou defeated " + battleState.enemy.name + "!\n\nExperience gained: " + exp + "\nSkill Points gained: " + sp); LK.effects.flashScreen(0x00ff00, 1000); } else { storyPanel.setText("DEFEAT!\n\nYou were defeated by " + battleState.enemy.name + ".\n\nYou retreat to recover your strength."); LK.effects.flashScreen(0xff0000, 1000); } clearButtons(); var continueButton = new MenuButton("Continue", function () { if (currentLocation) { game.setBackgroundColor(0x1a1a1a); showTravelMenu(); } else { startTrainingMode(); } }); continueButton.x = 1024; continueButton.y = 1400; buttons.push(continueButton); game.addChild(continueButton); updateStatsUI(); } function updateStatsUI() { if (statsUI.length > 0) { statsUI[0].updateValue(player.health); statsUI[1].updateValue(player.aura); statsUI[2].updateValue(player.energy); statsUI[3].updateValue(player.experience); } // Update level text if (levelText) { levelText.setText("Level: " + player.level); } // Update player info text if (playerInfoText) { playerInfoText.setText("Nen Type: " + (player.nenType || "None") + "\nSP: " + player.skillPoints); } // Update stat numbers var statsValues = [player.stats.strength, player.stats.speed, player.stats.intelligence, player.stats.aura]; for (var i = 0; i < statNumbersText.length && i < statsValues.length; i++) { var statsLabels = ["Strength", "Speed", "Intelligence", "Aura"]; statNumbersText[i].setText(statsLabels[i] + ": " + statsValues[i]); } } // Initialize game initializeUI(); startCharacterCreation(); game.update = function () { // Game loop logic if needed };
===================================================================
--- original.js
+++ change.js
@@ -864,40 +864,127 @@
unlocked: false,
unlockRequirement: "Reach Level 35 and master at least 5 Nen techniques",
background: 0x1a3a1a,
story: "You enter the Neo-Green Life autonomous region, a nation that has completely rejected modern technology. Though the Chimera Ant threat has passed, dangerous remnants and new threats still lurk in this untamed wilderness.",
+ specialBoss: {
+ name: "Chimera Ant Squadron Leader",
+ level: 40,
+ health: 600,
+ maxHealth: 600,
+ stats: {
+ strength: 40,
+ speed: 35,
+ intelligence: 30,
+ aura: 35
+ },
+ abilities: ["Predator Instinct", "Pack Coordination"],
+ hatsu: {
+ name: "Predator's Hunt",
+ auraRequired: 35,
+ description: "Enhanced senses and coordinated attacks from the squadron"
+ },
+ reward: {
+ experience: 300,
+ skillPoints: 20,
+ unlockMessage: "You've survived the Chimera Ant remnants!"
+ }
+ },
chapters: [{
- title: "The Technology Purge",
- text: "At the border, NGL officials confiscate all your modern equipment. You must survive in this primitive land using only your Nen abilities and natural skills. The forest ahead teems with both natural predators and lingering Chimera Ant soldiers.",
+ title: "The Border Crossing",
+ text: "At the NGL border, stern officials in primitive clothing confiscate all your modern equipment. 'Technology corrupts the soul,' they declare. You're given basic supplies and warned about the dangers ahead. The dense forest stretches endlessly, and you can sense hostile auras lurking within.",
choices: [{
- text: "Hunt the remaining Chimera Ant soldiers",
- action: "hunt_chimera_ants",
- consequences: "Extremely dangerous but massive combat experience gains"
+ text: "Follow the marked safe paths deeper into NGL",
+ action: "safe_paths",
+ consequences: "Slower progress but avoid immediate dangers"
}, {
- text: "Study the unique ecosystem changes",
- action: "study_ecosystem",
- consequences: "Learn about bio-manipulation and natural Nen applications"
+ text: "Take shortcuts through the dangerous wilderness",
+ action: "wilderness_shortcuts",
+ consequences: "Risk encounters with dangerous creatures but faster progress"
}, {
- text: "Seek out surviving NGL resistance fighters",
- action: "find_resistance",
- consequences: "Learn guerrilla tactics and survival techniques"
+ text: "Set up camp and observe the area first",
+ action: "observe_area",
+ consequences: "Learn about local threats and opportunities"
}]
}, {
- title: "The Queen's Legacy",
- text: "Deep in the forest, you discover a hidden chamber containing remnants of the Chimera Ant Queen's genetic material. The evolutionary potential here is incredible, but also incredibly dangerous.",
+ title: "The Chimera Ant Scouts",
+ text: "You encounter your first Chimera Ant soldiers - remnants from the invasion that still patrol these lands. They're smaller than the Royal Guards but still incredibly dangerous. Their compound eyes track your every movement as they communicate in clicking sounds.",
choices: [{
+ text: "Engage the scouts in direct combat",
+ action: "fight_scouts",
+ consequences: "High risk but significant combat experience if successful"
+ }, {
+ text: "Use stealth to avoid the patrol",
+ action: "stealth_avoid",
+ consequences: "Avoid immediate danger but may miss important intelligence"
+ }, {
+ text: "Attempt to communicate with them",
+ action: "communicate_ants",
+ consequences: "Potentially learn about their hierarchy but risk being attacked"
+ }]
+ }, {
+ title: "The Abandoned Research Facility",
+ text: "You discover a hidden research facility deep in the forest - clearly built before the Chimera Ant invasion. Scientific equipment lies scattered, and you find research notes about 'human enhancement projects' and 'biological weapons development.' This place holds dark secrets.",
+ choices: [{
+ text: "Investigate the research data thoroughly",
+ action: "investigate_research",
+ consequences: "Learn disturbing truths about NGL's past and gain scientific knowledge"
+ }, {
+ text: "Search for any surviving researchers",
+ action: "find_researchers",
+ consequences: "Potentially find allies or enemies from the facility"
+ }, {
+ text: "Destroy the facility to prevent misuse",
+ action: "destroy_facility",
+ consequences: "Prevent dangerous research from continuing but lose valuable information"
+ }]
+ }, {
+ title: "The Queen's Nest Ruins",
+ text: "You reach the ruins of the original Chimera Ant Queen's nest. The massive structure still emanates a malevolent aura. Broken shells and skeletal remains litter the ground. In the deepest chamber, you find pulsing organic matter - remnants of the Queen's genetic material that could still be active.",
+ choices: [{
text: "Study the genetic material carefully",
action: "genetic_study",
- consequences: "Gain evolution-based abilities but risk mutation"
+ consequences: "Gain evolution-based abilities but risk severe mutation"
}, {
- text: "Destroy the dangerous materials",
- action: "destroy_legacy",
- consequences: "Prevent future disasters but miss unique power opportunities"
+ text: "Collect samples for the Hunter Association",
+ action: "collect_samples",
+ consequences: "Gain Association favor but risk exposure to dangerous genetic material"
}, {
- text: "Secure the materials for the Hunter Association",
- action: "secure_materials",
- consequences: "Gain association favor and access to research data"
+ text: "Destroy all remaining genetic material",
+ action: "destroy_genetic_material",
+ consequences: "Prevent future Chimera Ant emergence but lose unique research opportunities"
}]
+ }, {
+ title: "The Underground Colony",
+ text: "You discover an active underground Chimera Ant colony that survived the original purge. These ants have evolved differently, becoming more intelligent and organized. Their Queen is smaller but more cunning than the original. She regards you with calculating compound eyes.",
+ choices: [{
+ text: "Challenge the new Queen to combat",
+ action: "challenge_new_queen",
+ consequences: "Ultimate test - victory means incredible power, defeat means potential reincarnation"
+ }, {
+ text: "Try to negotiate with the evolved colony",
+ action: "negotiate_colony",
+ consequences: "Potentially gain powerful allies but risk being seen as food"
+ }, {
+ text: "Retreat and report the colony's location",
+ action: "report_colony",
+ consequences: "Fulfill duty to humanity but miss unique opportunities"
+ }]
+ }, {
+ title: "The Final Confrontation",
+ text: "The Squadron Leader of the surviving Chimera Ants blocks your path. This creature has adapted beyond its original programming, developing its own Nen abilities through consuming powerful hunters. Its aura is a mixture of dozens of different humans, creating an unsettling composite presence.",
+ choices: [{
+ text: "Fight with everything you have",
+ action: "final_battle_full_power",
+ consequences: "Risk everything for the chance to eliminate a major threat"
+ }, {
+ text: "Try to understand the creature's evolution",
+ action: "study_evolution",
+ consequences: "Learn about Chimera Ant development but risk being consumed"
+ }, {
+ text: "Attempt to turn it against other threats",
+ action: "turn_against_threats",
+ consequences: "Create a dangerous ally against other enemies"
+ }]
}]
}
};
// Training Activities
@@ -3015,8 +3102,147 @@
player.health = Math.max(1, player.health - 70);
player.aura = Math.max(10, player.aura - 40);
}
break;
+ // NGL-specific actions
+ case "safe_paths":
+ player.stats.intelligence += statGain;
+ player.health += 20;
+ break;
+ case "wilderness_shortcuts":
+ if (Math.random() < 0.6) {
+ player.stats.speed += statGain * 2;
+ player.stats.strength += statGain;
+ expGain *= 2;
+ } else {
+ player.health = Math.max(1, player.health - 40);
+ }
+ break;
+ case "observe_area":
+ player.stats.intelligence += statGain * 2;
+ player.skillPoints += 8;
+ break;
+ case "fight_scouts":
+ if (Math.random() < 0.4) {
+ player.stats.strength += statGain * 3;
+ player.stats.speed += statGain * 2;
+ expGain *= 3;
+ } else {
+ player.health = Math.max(1, player.health - 50);
+ expGain = Math.floor(expGain / 2);
+ }
+ break;
+ case "stealth_avoid":
+ player.stats.speed += statGain;
+ player.stats.intelligence += statGain;
+ break;
+ case "communicate_ants":
+ if (Math.random() < 0.3) {
+ player.stats.intelligence += statGain * 3;
+ player.skillPoints += 15;
+ nenMastery.totalTechniques += 2;
+ } else {
+ player.health = Math.max(1, player.health - 60);
+ }
+ break;
+ case "investigate_research":
+ player.stats.intelligence += statGain * 3;
+ player.skillPoints += 20;
+ if (Math.random() < 0.2) {
+ player.stats.aura += statGain * 2;
+ }
+ break;
+ case "find_researchers":
+ if (Math.random() < 0.5) {
+ player.stats.intelligence += statGain * 2;
+ player.skillPoints += 10;
+ expGain *= 2;
+ } else {
+ player.health = Math.max(1, player.health - 35);
+ }
+ break;
+ case "destroy_facility":
+ player.stats.strength += statGain;
+ player.maxHealth += 25;
+ break;
+ case "genetic_study":
+ if (Math.random() < 0.3) {
+ // Successful study - gain incredible evolution-based powers
+ player.stats.strength += statGain * 4;
+ player.stats.speed += statGain * 3;
+ player.stats.aura += statGain * 4;
+ player.level += 2;
+ expGain *= 5;
+ } else {
+ // Mutation risk - lose health but gain some benefits
+ player.health = Math.max(1, player.health - 70);
+ player.stats.strength += statGain;
+ player.stats.aura += statGain;
+ }
+ break;
+ case "collect_samples":
+ player.stats.intelligence += statGain * 2;
+ player.skillPoints += 25;
+ if (Math.random() < 0.4) {
+ player.health = Math.max(1, player.health - 30);
+ }
+ break;
+ case "destroy_genetic_material":
+ player.stats.intelligence += statGain;
+ player.maxHealth += 30;
+ break;
+ case "challenge_new_queen":
+ if (Math.random() < 0.2) {
+ // Victory against Queen - incredible rewards
+ player.stats.strength += statGain * 5;
+ player.stats.speed += statGain * 4;
+ player.stats.aura += statGain * 5;
+ player.level += 3;
+ expGain *= 6;
+ } else {
+ // Defeat - Chimera Ant reincarnation system
+ handleChimeraAntReincarnation();
+ return; // Skip normal processing
+ }
+ break;
+ case "negotiate_colony":
+ if (Math.random() < 0.4) {
+ player.stats.intelligence += statGain * 3;
+ player.skillPoints += 30;
+ expGain *= 3;
+ } else {
+ handleChimeraAntReincarnation();
+ return;
+ }
+ break;
+ case "report_colony":
+ player.stats.intelligence += statGain;
+ player.skillPoints += 15;
+ break;
+ case "final_battle_full_power":
+ if (Math.random() < 0.3) {
+ player.stats.strength += statGain * 4;
+ player.stats.aura += statGain * 4;
+ expGain *= 4;
+ } else {
+ handleChimeraAntReincarnation();
+ return;
+ }
+ break;
+ case "study_evolution":
+ if (Math.random() < 0.5) {
+ player.stats.intelligence += statGain * 4;
+ nenMastery.totalTechniques += 3;
+ expGain *= 3;
+ } else {
+ handleChimeraAntReincarnation();
+ return;
+ }
+ break;
+ case "turn_against_threats":
+ player.stats.intelligence += statGain * 2;
+ player.skillPoints += 20;
+ break;
// New Meteor City actions
case "fighting_tournaments":
if (Math.random() < 0.5) {
player.stats.strength += statGain * 3;
@@ -3540,8 +3766,17 @@
// Regular attack
damage = enemy.stats.strength + Math.floor(Math.random() * 15);
logMessage = enemy.name + " attacks for " + damage + " damage!";
}
+ // Apply boss defense system
+ if (battleState.enemy && damage > 0) {
+ var bossDefense = calculateBossDefense(battleState.enemy);
+ var originalDamage = damage;
+ damage = Math.max(1, Math.floor(damage * bossDefense.damageReduction));
+ if (originalDamage !== damage && bossDefense.defenseType) {
+ logMessage += " " + battleState.enemy.name + " uses " + bossDefense.defenseType + " to reduce damage!";
+ }
+ }
// Apply player defensive modifiers
if (battleState.nextParry && !battleState.playerStunned) {
var parryEffectiveness = battleState.bungeeGumEffect ? 0.4 : 0.2;
damage = Math.floor(damage * parryEffectiveness);
@@ -3572,8 +3807,58 @@
return;
}
showBattleScreen();
}
+function calculateBossDefense(enemy) {
+ var defenseLevel = 1.0; // No defense reduction by default
+ var defenseType = "";
+ var enemyLevel = enemy.level || 25;
+ var enemyAura = enemy.stats ? enemy.stats.aura : 25;
+ // Stronger bosses have better defensive techniques
+ if (enemyLevel >= 50) {
+ // High-level bosses use Ken (maintain aura defense)
+ if (Math.random() < 0.7) {
+ defenseLevel = 0.4; // 60% damage reduction
+ defenseType = "Ken (Enhanced Defense)";
+ }
+ } else if (enemyLevel >= 35) {
+ // Mid-level bosses use Ten (basic aura shroud)
+ if (Math.random() < 0.5) {
+ defenseLevel = 0.6; // 40% damage reduction
+ defenseType = "Ten (Aura Shroud)";
+ }
+ } else if (enemyLevel >= 25) {
+ // Lower bosses have basic defense
+ if (Math.random() < 0.3) {
+ defenseLevel = 0.8; // 20% damage reduction
+ defenseType = "Basic Nen Defense";
+ }
+ }
+ // Special boss-specific defenses
+ if (enemy.name === "Meruem (The King)") {
+ defenseLevel = 0.3; // King has incredible defense
+ defenseType = "Royal Guard Defense";
+ } else if (enemy.name === "Razor") {
+ if (Math.random() < 0.6) {
+ defenseLevel = 0.5;
+ defenseType = "Devil Shield";
+ }
+ } else if (enemy.name === "Chrollo Lucilfer") {
+ if (Math.random() < 0.4) {
+ defenseLevel = 0.7;
+ defenseType = "Stolen Defensive Ability";
+ }
+ } else if (enemy.name === "Hisoka Morow") {
+ if (Math.random() < 0.3) {
+ defenseLevel = 0.8;
+ defenseType = "Bungee Gum Shield";
+ }
+ }
+ return {
+ damageReduction: defenseLevel,
+ defenseType: defenseType
+ };
+}
function tryToCopyAbility(abilityName, abilityData) {
if (!player.copiedAbilityWitnesses[abilityName]) {
player.copiedAbilityWitnesses[abilityName] = 0;
}
@@ -3589,8 +3874,117 @@
}
}
}
}
+function handleChimeraAntReincarnation() {
+ var reincarnationChance = Math.random();
+ var reincarnationType = "";
+ var newStats = {};
+ if (reincarnationChance <= 0.05) {
+ // 5% chance to become King
+ reincarnationType = "Chimera Ant King";
+ newStats = {
+ strength: player.stats.strength + 50,
+ speed: player.stats.speed + 40,
+ intelligence: player.stats.intelligence + 60,
+ aura: player.stats.aura + 70
+ };
+ player.level += 10;
+ player.maxHealth += 200;
+ player.maxAura += 150;
+ } else if (reincarnationChance <= 0.20) {
+ // 15% chance to become Royal Guard
+ reincarnationType = "Royal Guard";
+ newStats = {
+ strength: player.stats.strength + 30,
+ speed: player.stats.speed + 25,
+ intelligence: player.stats.intelligence + 20,
+ aura: player.stats.aura + 35
+ };
+ player.level += 5;
+ player.maxHealth += 100;
+ player.maxAura += 75;
+ } else {
+ // 80% chance to become normal Chimera Ant
+ reincarnationType = "Chimera Ant Soldier";
+ newStats = {
+ strength: player.stats.strength + 10,
+ speed: player.stats.speed + 10,
+ intelligence: player.stats.intelligence + 5,
+ aura: player.stats.aura + 15
+ };
+ player.level += 2;
+ player.maxHealth += 50;
+ player.maxAura += 25;
+ }
+ // Apply new stats
+ player.stats = newStats;
+ player.health = player.maxHealth;
+ player.aura = player.maxAura;
+ player.experience = 0;
+ player.maxExperience += 100;
+ player.skillPoints += 50;
+ // Add special Chimera Ant abilities
+ if (!player.abilities.includes("Enhanced Senses")) {
+ player.abilities.push("Enhanced Senses");
+ }
+ if (!player.abilities.includes("Regeneration")) {
+ player.abilities.push("Regeneration");
+ }
+ // Special Hatsu based on reincarnation type
+ if (reincarnationType === "Chimera Ant King") {
+ player.hatsu = {
+ name: "Royal Authority",
+ description: "Command lesser Chimera Ants and use devastating royal techniques",
+ auraReq: 60,
+ conditions: "Must maintain royal dignity",
+ battleEffects: {
+ type: "royal_command",
+ multiplier: 3.5,
+ special: "command_ants"
+ }
+ };
+ } else if (reincarnationType === "Royal Guard") {
+ player.hatsu = {
+ name: "Guard's Devotion",
+ description: "Protective abilities and enhanced combat techniques",
+ auraReq: 40,
+ conditions: "Must protect allies",
+ battleEffects: {
+ type: "guard_protection",
+ multiplier: 2.8,
+ special: "protect_others"
+ }
+ };
+ } else {
+ player.hatsu = {
+ name: "Ant Instincts",
+ description: "Enhanced predatory abilities and pack coordination",
+ auraReq: 25,
+ conditions: "Must hunt with purpose",
+ battleEffects: {
+ type: "predator_instinct",
+ multiplier: 2.2,
+ special: "pack_hunt"
+ }
+ };
+ }
+ player.hatsuMastery = 30;
+ storyPanel.setText("REINCARNATION!\n\nYou have been consumed by the Chimera Ants and reborn as a " + reincarnationType + "!\n\nYour human memories remain, but your body and abilities have been dramatically enhanced. You retain your intelligence and Nen abilities while gaining incredible new powers.\n\nNew Type: " + reincarnationType + "\nLevel Gained: +" + (reincarnationType === "Chimera Ant King" ? 10 : reincarnationType === "Royal Guard" ? 5 : 2) + "\nNew Hatsu: " + player.hatsu.name);
+ clearButtons();
+ var continueButton = new MenuButton("Continue as " + reincarnationType, function () {
+ updateStatsUI();
+ LK.effects.flashScreen(0x880088, 2000);
+ game.setBackgroundColor(0x1a1a1a);
+ showTravelMenu();
+ });
+ continueButton.x = 1024;
+ continueButton.y = 1400;
+ buttons.push(continueButton);
+ game.addChild(continueButton);
+ updateStatsUI();
+ LK.effects.flashScreen(0x880088, 2000);
+}
function endBattle(playerWon) {
currentBattle = false;
player.health = battleState.playerHealth;
player.aura = battleState.playerAura;