44
0
12d
User prompt
Please fix the bug: 'Uncaught ReferenceError: nenMastery is not defined' in or related to this line: 'return player.level >= 35 && nenMastery.totalTechniques >= 5;' Line Number: 10130
User prompt
Diyer Nen yeteneklerini de ( basit ve Gelişmiş Nen yetenekleri ) Geliştir ve Detaylandır yeni özellikler ekle
User prompt
Nen tekniklerini falan daha fazla detaylandır Ko Shu Ten Ren vb Aura Maliyetlerini arttır mesela Ko yu Salmak yerine Charge layabilelim gibi gibi her Nen tekniğine böyle eklemeler yap ama bunlardan önce Normal Basit Nen Teknikleri(Ten,Zetsu,Ren ) da değişiklik yap sadece, (Hatsu Maliyetlerini değiştirme sadece gelişmiş 6 Nen tekniği ve 3 Basit nen tekniği ne bakacaksın)
User prompt
Nen tekniklerini falan daha fazla detaylandır Ko Shu Ten Ren vb Aura Maliyetlerini arttır mesela Ko yu Salmak yerine Charge layabilelim gibi gibi her Nen tekniğine böyle eklemeler yap ama bunlardan önce Normal Basit Nen Teknikleri(Ten,Zetsu,Ren) da değişiklik yap sadece,
User prompt
Hisoka nın Geçmişini baya bi uzat !
User prompt
daha fazla Story ekle ! Story Arcs a
User prompt
daha fazla Story ekle ! Story Arcs a
User prompt
bu farklı evrenlerden gelenlerle savaşamıyoruz levelleri çok fazla biz maks 50 olabiliyoruz ya 60-50 arası yap yada direk 50 ye indir
User prompt
5 tane Boss Battles a farklı evrenlerden 5 tane boss ekle
User prompt
Please fix the bug: 'Uncaught ReferenceError: getDynamicBoss is not defined' in or related to this line: 'var boss = getDynamicBoss(bossKey) || bosses[bossKey];' Line Number: 9357
User prompt
Daha fazla Boss ekle ne bulursan
User prompt
Please fix the bug: '_storage is not defined' in or related to this line: 'var player = {' Line Number: 569 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Please fix the bug: '__storage is not defined' in or related to this line: 'var _storage = __storage; // Hatsu Creation System' Line Number: 193
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'undefined')' in or related to this line: 'return typeof key !== "undefined" ? key : "";' Line Number: 6690
User prompt
Please fix the bug: '___________storage is not defined' in or related to this line: 'var _storage = ___________storage;' Line Number: 197
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'undefined')' in or related to this line: 'return key;' Line Number: 6687
User prompt
Please fix the bug: 'player is not defined' in or related to this line: 'if (player.hatsu && !player.hatsu.battleEffects) {' Line Number: 722
User prompt
Please fix the bug: 'storage is not defined' in or related to this line: 'var _storage = storage;' Line Number: 192
User prompt
Lütfen bu dediğin şeyleri denermisin ve düzeltirmisin bir kayıp olmadan ?
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'undefined')' in or related to this line: 'return key;' Line Number: 6674
User prompt
Oyundaki bugları düzelt
User prompt
Oyundaki tüm Bugları kalıcı olarak Düzelt
User prompt
Please fix the bug: '________storage is not defined' in or related to this line: 'var _______storage = ________storage; // Fix ReferenceError for _______storage' Line Number: 213
"use strict";/**** * 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 boss = getDynamicBoss("gon"); // returns Gon with stats scaled to current arc/chapter /** * Returns a dynamically scaled boss object if dynamic scaling is ever re-enabled. * For now, returns null to fall back to static bosses. * This prevents ReferenceError if called. */var ____________storage=LK.import("@upit/storage.v1");"use strict";"use strict";"use strict";"use strict";function _typeof2(o){"@babel/helpers - typeof";return _typeof2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof2(o);}"use strict";var gameState="characterCreation";var trainingState="menu";// menu, training, skillTree var debugMode=false;// Set to false to hide debug buttons // Fix storage references - use the actual storage import var ___________storage=____________storage;var _storage=___________storage;var __storage=___________storage;var ___storage=___________storage;var ____storage=___________storage;var _____storage=___________storage;var ______storage=___________storage;var _______storage=___________storage;var ________storage=___________storage;var _________storage=___________storage;var __________storage=___________storage;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function getDynamicBoss(bossKey){// Dynamic scaling is currently disabled; always return null. // If dynamic scaling is needed, implement logic here. if(_storage.player_hatsu){var nenTypeKey=player.nenType?player.nenType.toLowerCase():"";var templates=hatsuTemplates[nenTypeKey];if(templates){for(var i=0;i<templates.length;i++){if(templates[i]&&templates[i].name===_storage.player_hatsu){// Create deep copy of template to avoid reference issues player.hatsu={name:templates[i].name,description:templates[i].description,auraReq:templates[i].auraReq,conditions:templates[i].conditions,battleEffects:templates[i].battleEffects?{type:templates[i].battleEffects.type,multiplier:templates[i].battleEffects.multiplier,special:templates[i].battleEffects.special}:null};// Restore Lightning Palm XP/Level/Mastery if this is Lightning Palm return null;}var hatsuTemplates={enhancer:[{name:"Titan Fist",description:"Enhance punching power by 350% and gain a chance to break enemy defense. Now can be used as a multi-hit combo.",auraReq:20,conditions:"Must maintain eye contact with target",battleEffects:{type:"damage",multiplier:3.5,special:"stun_chance,break_defense,multi_hit"}},{name:"Iron Skin",description:"Harden skin to deflect attacks. Now reflects 50% of received damage and grants a temporary defense buff.",auraReq:15,conditions:"Cannot move while active",battleEffects:{type:"defense",multiplier:2.0,special:"reflect_damage,defense_buff"}},{name:"Healing Touch",description:"Accelerate healing of wounds. Now also grants a small aura shield for 2 turns.",auraReq:25,conditions:"Must touch wound for 30 seconds",battleEffects:{type:"heal",amount:60,special:"status_cure,aura_shield"}},{name:"Berserker Rage",description:"Enter an uncontrollable fury that triples all physical abilities, but you cannot guard or heal for 3 turns.",auraReq:35,conditions:"Must be below 50% health to activate",battleEffects:{type:"berserk",multiplier:3.0,special:"cannot_guard,stat_lock"}},{name:"Perfect Enhancement",description:"Enhance any object or body part to its theoretical maximum. Now can adapt to enemy weaknesses for bonus damage.",auraReq:40,conditions:"Can only enhance one thing at a time",battleEffects:{type:"variable",multiplier:2.7,special:"adaptable,weakness_exploit"}},{name:"Jajanken",description:"Rock-paper-scissors based attacks: Rock (punch, now stuns), Paper (emission, now pierces defense), Scissors (transmutation, now causes bleed).",auraReq:30,conditions:"Must charge for 3 seconds before attack",battleEffects:{type:"variable_combo",variants:["rock","paper","scissors"],multiplier:3.0,special:"triple_technique,stun,pierce,bleed"}},{name:"100-Type Guanyin Bodhisattva",description:"Channel the power of the goddess of mercy for devastating attacks. Now has a 20% instant kill chance and ignores all defense.",auraReq:80,conditions:"Must meditate for 10 seconds before use",battleEffects:{type:"divine_strike",multiplier:4.5,special:"instant_kill_chance,ignore_defense"}},{name:"Zero Hand",description:"Concentrate all aura into one final devastating blast. Now also drains all enemy aura if it hits.",auraReq:100,conditions:"Must be below 25% health to activate",battleEffects:{type:"ultimate_sacrifice",multiplier:6.0,special:"uses_all_aura,drain_enemy_aura"}},{name:"Shockwave Punch",description:"Enhance a punch to create devastating shockwaves that hit multiple times. Now can hit up to 5 times and has a chance to stun.",auraReq:35,conditions:"Must charge for 2 seconds before striking",battleEffects:{type:"multi_hit_damage",multiplier:2.8,special:"shockwave_effect,multi_hit,stun"}},{name:"Enhancement Overload",description:"Temporarily enhance all physical abilities beyond normal limits. Now grants immunity to debuffs for 2 turns.",auraReq:45,conditions:"Cannot use other abilities for 3 turns after",battleEffects:{type:"temporary_boost",multiplier:3.5,special:"stat_enhancement,immunity"}},{name:"Focused Strike",description:"Concentrate all enhancement into a single perfect strike. Now always crits if enemy is below 50% health.",auraReq:25,conditions:"Must have line of sight to target",battleEffects:{type:"precision_damage",multiplier:2.7,special:"critical_hit_chance,execute_below_half"}}],emitter:[{name:"Spirit Gun",description:"Fire concentrated aura bullets. Now can pierce through up to 2 enemies in a line.",auraReq:18,conditions:"Must point finger like a gun",battleEffects:{type:"ranged_damage",multiplier:2.2,special:"piercing,line_attack"}},{name:"Teleport Beacon",description:"Mark location for instant teleportation. Now also grants a free dodge after teleport.",auraReq:30,conditions:"Can only have one beacon active",battleEffects:{type:"utility",special:"escape_advantage,free_dodge"}},{name:"Aura Shield",description:"Project defensive barrier at distance. Now reflects 30% of ranged damage.",auraReq:22,conditions:"Shield weakens with distance",battleEffects:{type:"barrier",multiplier:1.7,special:"ranged_defense,reflect_ranged"}},{name:"Orbital Strike",description:"Launch concentrated aura high into the air for devastating delayed attack. Now has a 50% chance to ignore guard.",auraReq:45,conditions:"Must wait 3 turns before impact",battleEffects:{type:"delayed_damage",multiplier:4.2,special:"unavoidable,ignore_guard"}},{name:"Remote Punch",description:"Project your fist through space to strike at any distance. Now has a 30% chance to stun.",auraReq:28,conditions:"Must have line of sight to target",battleEffects:{type:"ranged_damage",multiplier:2.4,special:"surprise_attack,stun"}}],manipulator:[{name:"Puppet Master",description:"Control defeated opponents. Now can use their abilities for 2 turns.",auraReq:35,conditions:"Target must be unconscious first",battleEffects:{type:"control",special:"turn_enemy,use_enemy_ability"}},{name:"Object Dance",description:"Animate and control inanimate objects. Now can animate up to 3 objects at once.",auraReq:20,conditions:"Must physically touch object first",battleEffects:{type:"summon",multiplier:1.7,special:"multiple_attacks,multi_object"}},{name:"Memory Thief",description:"Extract and view target's memories. Now also reduces enemy intelligence for 2 turns.",auraReq:40,conditions:"Must maintain physical contact for 1 minute",battleEffects:{type:"debuff",special:"confusion,int_down"}},{name:"Pain Amplifier",description:"Manipulate pain receptors to make even small wounds agonizing. Now also reduces enemy attack for 2 turns.",auraReq:30,conditions:"Must have inflicted damage on target first",battleEffects:{type:"debuff",multiplier:2.0,special:"damage_over_time,atk_down"}},{name:"Emotion Control",description:"Manipulate target's emotions to make them fight for you. Now can charm up to 2 enemies at once.",auraReq:50,conditions:"Target must trust you initially",battleEffects:{type:"control",special:"ally_conversion,multi_charm"}}],transmuter:[{name:"Lightning Palm",description:"Transform aura into electricity. Now has a 40% chance to stun and deals bonus damage if used after GodSpeed.",auraReq:25,conditions:"Damage self if used more than 3 times per day",battleEffects:{type:"elemental_damage",multiplier:2.4,special:"paralysis,bonus_after_godspeed"}},{name:"Rubber Body",description:"Make body elastic and bouncy. Now reflects 20% melee damage and can dodge one attack per battle.",auraReq:20,conditions:"Vulnerable to sharp objects while active",battleEffects:{type:"defense",multiplier:2.0,special:"bounce_back,melee_reflect,free_dodge"}},{name:"Poison Touch",description:"Transmute aura into various toxins. Now can stack poison up to 3 times.",auraReq:30,conditions:"Must know chemical composition of poison",battleEffects:{type:"poison",multiplier:1.7,special:"damage_over_time,stackable"}},{name:"Diamond Aura",description:"Transform aura into the hardest material for ultimate offense and defense. Now grants immunity to critical hits.",auraReq:45,conditions:"Becomes immobile while diamond form is active",battleEffects:{type:"form_change",multiplier:3.0,special:"ultimate_defense,crit_immunity"}},{name:"Liquid Aura",description:"Make aura flow like water to slip through any defense. Now can ignore all buffs on enemy for 1 turn.",auraReq:35,conditions:"Cannot use other abilities while liquid",battleEffects:{type:"penetration",multiplier:2.7,special:"ignore_defense,ignore_buffs"}},{name:"Binding Chains",description:"Create unbreakable restraints. Now also deals damage over time while enemy is bound.",auraReq:35,conditions:"Chains disappear if you lose consciousness",battleEffects:{type:"restraint",multiplier:2.5,special:"immobilize_and_damage,damage_over_time"}}],conjurer:[{name:"Weapon Vault",description:"Conjure any weapon you've mastered. Now can switch weapons mid-battle for bonus effects.",auraReq:28,conditions:"Must have trained with weapon for 100 hours",battleEffects:{type:"weapon_summon",multiplier:2.2,special:"versatile,weapon_switch"}},{name:"Fortress Creation",description:"Conjure defensive structures. Now also grants a shield to all allies for 2 turns.",auraReq:45,conditions:"Cannot move while maintaining structure",battleEffects:{type:"barrier",multiplier:2.7,special:"area_defense,ally_shield"}},{name:"Binding Chains",description:"Create unbreakable restraints. Now can bind up to 2 enemies at once.",auraReq:35,conditions:"Chains disappear if you lose consciousness",battleEffects:{type:"restraint",special:"immobilize,multi_target"}},{name:"Living Armor",description:"Conjure sentient armor that fights alongside you. Now armor can block one fatal attack per battle.",auraReq:50,conditions:"Armor has its own personality and may disobey",battleEffects:{type:"companion",multiplier:2.0,special:"independent_action,block_fatal"}},{name:"Dimensional Pocket",description:"Create pocket dimensions to store unlimited items and launch surprise attacks. Now can instantly retrieve any item for a bonus action.",auraReq:40,conditions:"Items stored for too long may disappear",battleEffects:{type:"utility",special:"surprise_items,instant_retrieve"}}],specialist:[{name:"Fate Reading",description:"See possible futures of target. Now can force enemy to miss one attack per battle.",auraReq:50,conditions:"Can only be used once per person",battleEffects:{type:"precognition",special:"predict_attacks,force_miss"}},{name:"Power Copy",description:"Temporarily copy opponent's ability. Now copied ability is 20% stronger for 1 turn.",auraReq:60,conditions:"Must witness ability being used 3 times",battleEffects:{type:"copy",special:"steal_abilities,copy_buff"}},{name:"Soul Bond",description:"Share damage and healing with ally. Now also shares buffs and debuffs.",auraReq:40,conditions:"Bond lasts until one partner dies",battleEffects:{type:"link",special:"shared_damage,shared_buffs"}},{name:"Probability Manipulation",description:"Alter the odds of any event in your favor. Now can reroll one failed action per battle.",auraReq:70,conditions:"Each use reduces your own luck for 24 hours",battleEffects:{type:"luck",special:"critical_control,reroll"}},{name:"Time Echo",description:"Create echoes of your past actions to attack multiple times. Now can echo up to 3 actions in a row.",auraReq:55,conditions:"Can only echo actions from the last 10 minutes",battleEffects:{type:"temporal",multiplier:2.7,special:"multi_attack,echo_chain"}},{name:"Ability Copy",description:"Copy and store up to 3 enemy abilities to use in battle. Now can swap copied abilities mid-battle.",auraReq:45,conditions:"Must witness ability 3 times to copy it permanently",battleEffects:{type:"copy_system",special:"ability_mimic,swap_copied",slots:3}}]};// Add GodSpeed as a possible second Hatsu for Transmuters who master Lightning Palm hatsuTemplates.transmuter.push({name:"GodSpeed",description:"Ultimate lightning-based speed enhancement. Whirlwind and Speed of Lightning techniques. Now grants a free extra turn if you stun the enemy.",auraReq:35,conditions:"Must have Lightning Palm mastery, drains aura rapidly",battleEffects:{type:"godspeed",multiplier:3.0,special:"lightning_speed,extra_turn_on_stun"}});// Load player data from storage or use defaults var player={name:_storage.player_name||"Hunter",nenType:_storage.player_nenType||"",level:_storage.player_level||1,experience:_storage.player_experience||0,maxExperience:_storage.player_maxExperience||100,health:_storage.player_health||100,maxHealth:_storage.player_maxHealth||100,aura:_storage.player_aura||50,maxAura:_storage.player_maxAura||50,stats:{strength:_storage.player_stats_strength||10,speed:_storage.player_stats_speed||10,intelligence:_storage.player_stats_intelligence||10,aura:_storage.player_stats_aura||10},abilities:_storage.player_abilities?_storage.player_abilities.split(","):[],currentChapter:_storage.player_currentChapter||1,energy:_storage.player_energy||100,maxEnergy:_storage.player_maxEnergy||100,skillPoints:_storage.player_skillPoints||0,trainingCount:_storage.player_trainingCount||0,hunterExamCompleted:_storage.player_hunterExamCompleted===1,hatsu:null,nenVow:null,hatsuMastery:_storage.player_hatsuMastery||0,hatsuLevel:_storage.player_hatsuLevel||1,hatsuXP:_storage.player_hatsuXP||0,secondHatsu:null,secondHatsuLevel:_storage.player_secondHatsuLevel||0,secondHatsuMastery:_storage.player_secondHatsuMastery||0,secondHatsuXP:_storage.player_secondHatsuXP||0,copiedAbilities:_storage.player_copiedAbilities?_storage.player_copiedAbilities.split("|"):[null,null,null],copiedAbilityWitnesses:_storage.player_copiedAbilityWitnesses?function(){var witnesses={};var pairs=_storage.player_copiedAbilityWitnesses.split(",");for(var i=0;i<pairs.length;i++){var pair=pairs[i].split(":");if(pair.length===2){witnesses[pair[0]]=parseInt(pair[1])||0;}}return witnesses;}():{},race:_storage.player_race||"Human",clan:_storage.player_clan||null,scarletEyesLevel:_storage.player_scarletEyesLevel||0,scarletEyesProgress:_storage.player_scarletEyesProgress||0,transplantedEyeLevel:_storage.player_transplantedEyeLevel||0,transplantedEyeProgress:_storage.player_transplantedEyeProgress||0,kurapikaEyes:_storage.player_kurapikaEyes||0};// Restore full Lightning Palm XP/Level/Mastery if present in storage if(_storage.player_lightningPalmLevel||_storage.player_lightningPalmMastery||_storage.player_lightningPalmXP){player.lightningPalmLevel=_storage.player_lightningPalmLevel||1;player.lightningPalmMastery=_storage.player_lightningPalmMastery||0;player.lightningPalmXP=_storage.player_lightningPalmXP||0;}// Restore full GodSpeed XP/Level/Mastery if present in storage if(_storage.player_godspeedLevel||_storage.player_godspeedMastery||_storage.player_godspeedXP){player.godspeedLevel=_storage.player_godspeedLevel||1;player.godspeedMastery=_storage.player_godspeedMastery||0;player.godspeedXP=_storage.player_godspeedXP||0;}// Restore main Hatsu object if name matches a template if(player.hatsu.name==="Lightning Palm"&&player.lightningPalmLevel){player.hatsuLevel=player.lightningPalmLevel;player.hatsuMastery=player.lightningPalmMastery;player.hatsuXP=player.lightningPalmXP;}break;}}}}// Restore second Hatsu object if name matches GodSpeed if(_storage.player_secondHatsu==="GodSpeed"){player.secondHatsu={name:"GodSpeed",description:"Ultimate lightning-based speed enhancement. Whirlwind and Speed of Lightning techniques.",auraReq:35,conditions:"Must have Lightning Palm mastery, drains aura rapidly",battleEffects:{type:"godspeed",multiplier:2.8,special:"lightning_speed"}};// Restore GodSpeed XP/Level/Mastery if present if(player.godspeedLevel){player.secondHatsuLevel=player.godspeedLevel;}if(player.godspeedMastery){player.secondHatsuMastery=player.godspeedMastery;}if(player.godspeedXP){player.secondHatsuXP=player.godspeedXP;}}// Clan System for Human Race // Initialize default values for undefined Hatsu properties if(typeof player!=="undefined"&&player&&player.hatsu&&!player.hatsu.battleEffects){player.hatsu.battleEffects=null;}if(typeof player!=="undefined"&&player&&player.secondHatsu&&!player.secondHatsu.battleEffects){player.secondHatsu.battleEffects=null;}var humanClans={netero:{name:"Netero Clan",description:"Descendants of Isaac Netero, masters of enhancement and meditation",rarity:0.10,// 10% chance bonuses:{strength:50,aura:100,intelligence:30,maxHealth:150,maxAura:200},specialAbility:{name:"100-Type Guanyin Bodhisattva",description:"Channel the power of the Bodhisattva for devastating attacks",auraRequired:80,multiplier:4.0},hatsuBoost:{nenTypes:["Enhancer"],multiplier:2.5,description:"Netero clan enhances Enhancement-type Hatsu"},requirements:{nenType:"Enhancer",level:20}},zoldyck:{name:"Zoldyck Family",description:"Elite assassin family with unmatched killing techniques",rarity:0.15,// 15% chance bonuses:{strength:40,speed:60,aura:50,intelligence:20,maxHealth:100,maxAura:150},specialAbility:{name:"Assassination Arts",description:"Master the Zoldyck family's deadly techniques",auraRequired:60,multiplier:3.5,special:"instant_kill_chance"},hatsuBoost:{nenTypes:["Transmuter","Manipulator"],multiplier:2.2,description:"Zoldyck family enhances Transmutation and Manipulation Hatsu"},requirements:{level:15}},freecss:{name:"Freecss Lineage",description:"Natural-born hunters with incredible potential and determination",rarity:0.12,// 12% chance bonuses:{strength:35,speed:35,intelligence:25,aura:80,maxHealth:120,maxAura:180},specialAbility:{name:"Hunter's Instinct",description:"Tap into natural hunting instincts for enhanced abilities",auraRequired:50,multiplier:3.0,special:"stat_enhancement"},hatsuBoost:{nenTypes:["Enhancer","Emitter"],multiplier:2.3,description:"Freecss lineage enhances Enhancement and Emission Hatsu"},requirements:{hunterExamCompleted:true}},lucilfer:{name:"Lucilfer Heritage",description:"Ancient family of scholars and thieves with mysterious powers",rarity:0.18,// 18% chance bonuses:{intelligence:70,aura:60,speed:25,strength:15,maxHealth:80,maxAura:200},specialAbility:{name:"Ancestral Knowledge",description:"Access ancient techniques and stolen abilities",auraRequired:70,multiplier:3.2,special:"ability_steal"},hatsuBoost:{nenTypes:["Specialist","Conjurer"],multiplier:2.4,description:"Lucilfer heritage enhances Specialist and Conjuration Hatsu"},requirements:{nenType:"Specialist",intelligence:150}},kurta:{name:"Kurta Clan",description:"The legendary scarlet-eyed clan with Emperor Time abilities",rarity:0.20,// 20% chance (most rare) bonuses:{intelligence:80,aura:90,speed:40,strength:30,maxHealth:100,maxAura:250},specialAbility:{name:"Scarlet Eyes",description:"Activate the legendary scarlet eyes for ultimate power",auraRequired:90,multiplier:4.5,special:"emperor_time"},hatsuBoost:{nenTypes:["All"],multiplier:3.0,description:"Kurta clan enhances ALL Nen types through Emperor Time"},requirements:{level:25,hatsuMastery:50}},uchiha:{name:"Uchiha Clan",description:"Hidden legendary clan with the power of the Sharingan",rarity:0.01,// 1% chance - very rare hidden:true,bonuses:{strength:100,speed:150,intelligence:200,aura:300,maxHealth:500,maxAura:1000},specialAbility:{name:"Sharingan",description:"Copy any technique and see through all illusions",auraRequired:120,multiplier:5.0,special:"sharingan_copy"},hatsuBoost:{nenTypes:["All"],multiplier:4.0,description:"Uchiha clan enhances ALL Nen types through Sharingan mastery"},requirements:{achievement:"emperor_time_master",level:50,emperorTimeUsed:100}}};// 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 Arc System - Player Choice Driven Narratives var currentStoryArc=null;var storyProgress={currentArc:null,currentChapter:0,completedArcs:[],playerChoices:[],persistentConsequences:[]};// Main Story Arcs var storyArcs={// --- NEW STORY ARC: Kurapika's Bodyguard Arc --- kurapikaBodyguard:{title:"Kurapika's Bodyguard Arc",description:"Protect Neon Nostrade and navigate the mafia underworld as Kurapika's ally.",unlocked:false,unlock_requirement:{yorknewCompleted:true,level:28},chapters:[{title:"The Bodyguard Contract",text:"Kurapika recruits you to join the Nostrade Family as a bodyguard for Neon. The mafia world is full of danger and intrigue.",choices:[{text:"Accept the contract and swear loyalty",action:"accept_bodyguard",consequences:"You become a trusted bodyguard, gaining access to mafia secrets.",statChanges:{intelligence:3,aura:2,maxHealth:10},experience:60,reputation:{loyal:+3,underworld:+2},allies:["Kurapika Kurta","Neon Nostrade"],unlocks:["Bodyguard Network"]},{text:"Negotiate for higher pay and privileges",action:"negotiate_contract",consequences:"You secure better terms, but some mafia members distrust you.",statChanges:{intelligence:4,aura:1},experience:55,reputation:{cunning:+2,greedy:+2},unlocks:["Negotiator"]},{text:"Refuse and investigate the Nostrade Family independently",action:"refuse_bodyguard",consequences:"You operate as a freelancer, risking mafia hostility.",statChanges:{intelligence:2,speed:2},experience:50,reputation:{independent:+3,risky:+2},unlocks:["Freelance Investigator"]}]},{title:"The Chain User's Secret",text:"Kurapika reveals his true identity as a Kurta and his quest for vengeance. You must decide how deeply to involve yourself.",choices:[{text:"Swear to help Kurapika avenge his clan",action:"swear_vengeance",consequences:"You become Kurapika's confidant and share in his burden.",statChanges:{intelligence:2,aura:2},experience:70,reputation:{loyal:+2,vengeful:+2},unlocks:["Kurta Secrets"]},{text:"Advise Kurapika to seek peace",action:"advise_peace",consequences:"You try to temper Kurapika's rage, risking his trust.",statChanges:{intelligence:3},experience:60,reputation:{diplomatic:+2,cautious:+2},unlocks:["Voice of Reason"]},{text:"Keep your distance and focus on your own goals",action:"distance_self",consequences:"You remain an observer, learning from the shadows.",statChanges:{intelligence:2,speed:1},experience:50,reputation:{independent:+2,mysterious:+2},unlocks:["Shadow Watcher"]}]},{title:"The Auction Showdown",text:"The Phantom Troupe attacks the auction. As chaos erupts, your choices will determine who survives.",choices:[{text:"Defend Neon and the Nostrade Family",action:"defend_neon",consequences:"You protect Neon, earning the family's gratitude.",statChanges:{strength:3,aura:2,health:-20},experience:80,reputation:{protector:+3,heroic:+2},allies:["Neon Nostrade"],unlocks:["Family Trust"]},{text:"Confront a Troupe member directly",action:"confront_troupe",consequences:"You face a deadly enemy, risking your life.",statChanges:{strength:4,aura:3,health:-40},experience:100,reputation:{fearless:+3,reckless:+2},battle_trigger:"Phantom Troupe Member"},{text:"Use the chaos to steal a rare artifact",action:"steal_artifact",consequences:"You gain a powerful item but risk being branded a criminal.",statChanges:{intelligence:3,aura:2},experience:70,reputation:{criminal:+3,opportunist:+2},items:["Rare Mafia Artifact"]}]}],completion_rewards:{skillPoints:30,experience:600,title:"Mafia Bodyguard",unlocks:["Mafia Network","Kurta Alliance"]}},// --- NEW STORY ARC: Zushi's Training (Side Story) --- zushiTraining:{title:"Zushi's Training: The Path of the Disciple",description:"Help Zushi, Wing's student, overcome his limits and discover his own Nen path.",unlocked:false,unlock_requirement:{level:18,hunterExamCompleted:true},chapters:[{title:"The Reluctant Student",text:"Zushi struggles to master Ren under Wing's strict guidance. He asks for your advice.",choices:[{text:"Encourage Zushi to keep training",action:"encourage_zushi",consequences:"Zushi is motivated by your words and trains harder.",statChanges:{intelligence:2,aura:2},experience:40,reputation:{mentor:+2},allies:["Zushi"],unlocks:["Disciple's Trust"]},{text:"Show Zushi a shortcut technique",action:"shortcut_technique",consequences:"Zushi learns a risky shortcut, but Wing is disappointed.",statChanges:{speed:2},experience:35,reputation:{reckless:+2},unlocks:["Risky Training"]},{text:"Ask Wing for advice on teaching",action:"ask_wing",consequences:"Wing shares teaching wisdom, improving your own Nen understanding.",statChanges:{intelligence:3},experience:45,reputation:{scholar:+2},unlocks:["Teaching Wisdom"]}]},{title:"The Arena Challenge",text:"Zushi faces a tough opponent in Heaven's Arena. You can intervene or let him fight alone.",choices:[{text:"Coach Zushi from the sidelines",action:"coach_zushi",consequences:"Zushi wins with your guidance, boosting his confidence.",statChanges:{aura:2,speed:1},experience:50,reputation:{mentor:+2},unlocks:["Arena Victory"]},{text:"Let Zushi fight alone",action:"zushi_fight_alone",consequences:"Zushi struggles but learns from defeat.",statChanges:{intelligence:2},experience:40,reputation:{independent:+2},unlocks:["Hard Lessons"]},{text:"Intervene and fight for Zushi",action:"fight_for_zushi",consequences:"You win easily, but Zushi feels overshadowed.",statChanges:{strength:2},experience:30,reputation:{overbearing:+2},unlocks:["Protector"]}]},{title:"The Nen Awakening",text:"Zushi finally awakens his own Nen ability. He asks for your opinion on his path.",choices:[{text:"Encourage Zushi to follow his heart",action:"zushi_heart",consequences:"Zushi chooses a unique Nen path, inspired by you.",statChanges:{aura:3},experience:60,reputation:{inspirational:+2},unlocks:["Unique Nen"]},{text:"Suggest he follow Wing's teachings",action:"zushi_wing",consequences:"Zushi becomes a disciplined student, mastering basics.",statChanges:{intelligence:2,aura:1},experience:55,reputation:{disciplined:+2},unlocks:["Disciple's Path"]},{text:"Challenge Zushi to a friendly spar",action:"spar_zushi",consequences:"You both grow stronger through friendly competition.",statChanges:{strength:2,speed:2},experience:65,reputation:{friendly:+2},unlocks:["Sparring Partner"]}]}],completion_rewards:{skillPoints:10,experience:200,title:"Disciple's Mentor",unlocks:["Zushi's Trust","Teaching Wisdom"]}},// --- NEW STORY ARC: Biscuit's Secret Training (Side Story) --- biscuitTraining:{title:"Biscuit's Secret Training",description:"Undergo Biscuit Krueger's brutal training to unlock hidden potential.",unlocked:false,unlock_requirement:{level:22,hunterExamCompleted:true},chapters:[{title:"The Invitation",text:"Biscuit offers to train you, but warns her methods are harsh.",choices:[{text:"Accept Biscuit's training",action:"accept_biscuit",consequences:"You brace yourself for intense training.",statChanges:{strength:2,aura:2},experience:50,reputation:{brave:+2},unlocks:["Biscuit's Approval"]},{text:"Negotiate for easier lessons",action:"negotiate_biscuit",consequences:"Biscuit laughs and makes training even harder.",statChanges:{intelligence:2},experience:40,reputation:{cheeky:+2},unlocks:["Tough Love"]},{text:"Decline and train alone",action:"decline_biscuit",consequences:"You miss out on Biscuit's wisdom, but gain independence.",statChanges:{speed:2},experience:35,reputation:{independent:+2},unlocks:["Solo Path"]}]},{title:"The True Form",text:"Biscuit reveals her true muscular form during training.",choices:[{text:"Try to copy Biscuit's transformation",action:"copy_biscuit",consequences:"You fail hilariously, but learn about transformation Nen.",statChanges:{aura:2},experience:60,reputation:{funny:+2},unlocks:["Transformation Insights"]},{text:"Ask Biscuit for transformation tips",action:"ask_transformation",consequences:"Biscuit shares secret techniques.",statChanges:{intelligence:3},experience:55,reputation:{curious:+2},unlocks:["Transformation Tips"]},{text:"Challenge Biscuit to an arm-wrestling match",action:"arm_wrestle_biscuit",consequences:"You lose, but gain respect for her strength.",statChanges:{strength:2},experience:50,reputation:{respectful:+2},unlocks:["Strength Respect"]}]},{title:"Graduation",text:"After weeks of training, Biscuit tests your progress.",choices:[{text:"Demonstrate your new strength",action:"show_strength",consequences:"Biscuit is impressed by your growth.",statChanges:{strength:3},experience:70,reputation:{strong:+2},unlocks:["Biscuit's Praise"]},{text:"Show off a new Nen technique",action:"show_nen",consequences:"Biscuit critiques your technique, but you learn a lot.",statChanges:{aura:3},experience:65,reputation:{learner:+2},unlocks:["Nen Growth"]},{text:"Thank Biscuit for her guidance",action:"thank_biscuit",consequences:"Biscuit is touched and gives you a special gift.",statChanges:{intelligence:2},experience:60,reputation:{grateful:+2},items:["Biscuit's Cookie"],unlocks:["Special Gift"]}]}],completion_rewards:{skillPoints:15,experience:300,title:"Biscuit's Graduate",unlocks:["Biscuit's Approval","Transformation Insights","Special Gift"]}},// --- NEW STORY ARC: Kite's Last Hunt (Side Story) --- kiteLastHunt:{title:"Kite's Last Hunt",description:"Join Kite on his final hunt before the Chimera Ant crisis.",unlocked:false,unlock_requirement:{level:28,hunterExamCompleted:true},chapters:[{title:"The Call of the Wild",text:"Kite invites you to track a dangerous beast in the wilderness.",choices:[{text:"Accept Kite's invitation",action:"accept_kite",consequences:"You set out on a wild adventure.",statChanges:{speed:2,aura:2},experience:55,reputation:{adventurous:+2},allies:["Kite"],unlocks:["Wild Hunt"]},{text:"Ask Kite about his research",action:"kite_research",consequences:"Kite shares his knowledge of rare creatures.",statChanges:{intelligence:3},experience:50,reputation:{scholar:+2},unlocks:["Research Partner"]},{text:"Decline and stay in town",action:"decline_kite",consequences:"You miss out on the adventure, but rest up.",statChanges:{health:10},experience:30,reputation:{rested:+2},unlocks:["Rested"]}]},{title:"The Hunt",text:"You and Kite track the beast through treacherous terrain.",choices:[{text:"Lead the way with your tracking skills",action:"lead_tracking",consequences:"You impress Kite with your skills.",statChanges:{intelligence:2,speed:2},experience:60,reputation:{leader:+2},unlocks:["Tracker"]},{text:"Let Kite take the lead",action:"kite_leads",consequences:"You learn from Kite's expertise.",statChanges:{intelligence:2},experience:55,reputation:{student:+2},unlocks:["Kite's Wisdom"]},{text:"Set traps for the beast",action:"set_traps",consequences:"Your traps help capture the beast.",statChanges:{intelligence:2,strength:1},experience:65,reputation:{tactical:+2},unlocks:["Trap Master"]}]},{title:"The Final Stand",text:"The beast attacks! You and Kite must fight together.",choices:[{text:"Attack head-on with Kite",action:"attack_with_kite",consequences:"You and Kite defeat the beast together.",statChanges:{strength:3},experience:80,reputation:{heroic:+2},unlocks:["Beast Slayer"]},{text:"Use Nen techniques to support Kite",action:"nen_support",consequences:"Your Nen support helps Kite land the final blow.",statChanges:{aura:3},experience:75,reputation:{supportive:+2},unlocks:["Nen Support"]},{text:"Distract the beast while Kite attacks",action:"distract_beast",consequences:"Your distraction allows Kite to win.",statChanges:{speed:2,intelligence:2},experience:70,reputation:{clever:+2},unlocks:["Distraction Master"]}]}],completion_rewards:{skillPoints:12,experience:250,title:"Kite's Ally",unlocks:["Wild Hunt","Beast Slayer","Kite's Wisdom"]}},hisokaPast:{title:"Hisoka's Past: The Magician's Origin",description:"Unravel the mysterious past of Hisoka Morow and discover the roots of his obsession with strong opponents.",unlocked:false,unlock_requirement:{level:32,hunterExamCompleted:true},chapters:[{title:"The Circus of Death",text:"You find yourself in a traveling circus where a young Hisoka first discovered his love for combat and deception.",choices:[{text:"Challenge Hisoka in a magic duel",action:"magic_duel",consequences:"You impress Hisoka with your skills, earning his interest.",statChanges:{intelligence:3,aura:2},experience:60,reputation:{rival:+2,mysterious:+2},unlocks:["Hisoka's Favor"]},{text:"Investigate the circus's dark secrets",action:"investigate_circus",consequences:"You uncover the truth behind the circus's disappearances.",statChanges:{intelligence:4,speed:2},experience:70,reputation:{detective:+2,brave:+2},unlocks:["Circus Secrets"]},{text:"Befriend the young Hisoka",action:"befriend_hisoka",consequences:"You form a strange friendship, learning about his philosophy.",statChanges:{intelligence:2,aura:2},experience:50,reputation:{friendly:+2,odd:+2},unlocks:["Hisoka's Philosophy"]}]},{title:"The First Kill",text:"Hisoka is forced to fight for his life against a cruel ringmaster. You must decide whether to intervene or let fate take its course.",choices:[{text:"Help Hisoka defeat the ringmaster",action:"help_hisoka",consequences:"You and Hisoka defeat the ringmaster, forging a bond.",statChanges:{strength:3,aura:2,health:-10},experience:80,reputation:{ally:+2,dangerous:+2},unlocks:["Blood Bond"]},{text:"Let Hisoka fight alone",action:"let_hisoka_fight",consequences:"Hisoka wins, but you see his true nature.",statChanges:{intelligence:2,aura:2},experience:60,reputation:{observer:+2,cautious:+2},unlocks:["Witness to Power"]},{text:"Stop the fight and expose the circus",action:"expose_circus",consequences:"You end the violence, but Hisoka disappears.",statChanges:{intelligence:3,aura:1},experience:70,reputation:{peacemaker:+2,mysterious:+2},unlocks:["Circus Exposed"]}]},// --- New: The Wandering Years --- {title:"The Wandering Years",text:"After leaving the circus, Hisoka wanders from town to town, perfecting his magic and fighting skills. He encounters street gangs, con artists, and other outcasts.",choices:[{text:"Join a gang and rise through the ranks",action:"join_gang",consequences:"You and Hisoka become feared in the underworld, learning ruthless tactics.",statChanges:{strength:2,intelligence:2,aura:1},experience:70,reputation:{criminal:+3,dangerous:+2},unlocks:["Underworld Tactics"]},{text:"Challenge a local con artist to a battle of wits",action:"battle_con_artist",consequences:"You outsmart the con artist, gaining respect and new tricks.",statChanges:{intelligence:4,aura:1},experience:60,reputation:{cunning:+2,mysterious:+1},unlocks:["Con Artist Tricks"]},{text:"Travel alone, focusing on perfecting magic",action:"solo_magic_training",consequences:"You and Hisoka develop new illusions and sleight of hand.",statChanges:{intelligence:2,aura:2,speed:1},experience:65,reputation:{odd:+2,mysterious:+2},unlocks:["Advanced Illusions"]}]},// --- New: The Bungee Gum Awakening --- {title:"The Bungee Gum Awakening",text:"Hisoka discovers his unique Nen ability: Bungee Gum. The process is dangerous and nearly kills him.",choices:[{text:"Assist Hisoka in his Nen training",action:"assist_bungee_gum",consequences:"You help Hisoka survive the ordeal, learning about Nen's risks.",statChanges:{aura:4,intelligence:2},experience:80,reputation:{nen_expert:+2,ally:+1},unlocks:["Bungee Gum Theory"]},{text:"Challenge Hisoka to a Nen duel",action:"nen_duel",consequences:"You push each other to the limit, both growing stronger.",statChanges:{strength:2,aura:3,health:-10},experience:90,reputation:{rival:+2,dangerous:+1},unlocks:["Nen Rivalry"]},{text:"Study the properties of Bungee Gum",action:"study_bungee_gum",consequences:"You gain deep insight into transmutation Nen.",statChanges:{intelligence:5},experience:70,reputation:{scholar:+2,analytical:+2},unlocks:["Transmutation Insights"]}]},// --- New: The Meteor City Incident --- {title:"The Meteor City Incident",text:"Hisoka travels to Meteor City, seeking stronger opponents. He faces the Phantom Troupe for the first time.",choices:[{text:"Spy on the Troupe's training",action:"spy_troupe_training",consequences:"You learn about the Troupe's deadly teamwork and Nen abilities.",statChanges:{intelligence:3,aura:2},experience:80,reputation:{spy:+2,mysterious:+1},unlocks:["Troupe Intel"]},{text:"Challenge a Troupe member to a duel",action:"duel_troupe_member",consequences:"You and Hisoka barely survive, but gain the Troupe's attention.",statChanges:{strength:3,aura:3,health:-20},experience:100,reputation:{dangerous:+3,rival:+2},unlocks:["Troupe Rivalry"]},{text:"Escape Meteor City with new knowledge",action:"escape_meteor_city",consequences:"You avoid conflict, but the Troupe remembers your face.",statChanges:{speed:3,intelligence:2},experience:60,reputation:{cautious:+2,mysterious:+1},unlocks:["Survivor"]}]},// --- New: The Hunter Exam Prequel --- {title:"The Hunter Exam Prequel",text:"Before the official Hunter Exam, Hisoka tests his skills against underground examiners and other hopefuls.",choices:[{text:"Help Hisoka defeat a fake examiner",action:"defeat_fake_examiner",consequences:"You expose the fraud and gain a reputation for cunning.",statChanges:{intelligence:3,aura:2},experience:70,reputation:{cunning:+2,justice:+1},unlocks:["Examiner Exposed"]},{text:"Sabotage other candidates to ensure Hisoka's victory",action:"sabotage_candidates",consequences:"You and Hisoka use dirty tricks to eliminate rivals.",statChanges:{intelligence:2,speed:2},experience:60,reputation:{criminal:+2,dangerous:+1},unlocks:["Saboteur"]},{text:"Train in secret, preparing for the real exam",action:"secret_training",consequences:"You and Hisoka develop new strategies for the official exam.",statChanges:{intelligence:2,aura:2},experience:65,reputation:{mysterious:+2,odd:+1},unlocks:["Exam Prep"]}]},// --- New: The Magician's Code (Epilogue) --- {title:"The Magician's Code",text:"Hisoka develops his own code: always seek the strongest, never stop improving, and never reveal all your tricks.",choices:[{text:"Swear to follow Hisoka's code",action:"follow_magician_code",consequences:"You and Hisoka become true kindred spirits, always seeking new challenges.",statChanges:{intelligence:2,aura:2,strength:2},experience:100,reputation:{rival:+2,ally:+2},unlocks:["Magician's Code"]},{text:"Forge your own path, diverging from Hisoka",action:"forge_own_path",consequences:"You respect Hisoka, but choose your own destiny.",statChanges:{intelligence:3,speed:2},experience:80,reputation:{independent:+3,mysterious:+1},unlocks:["Independent Magician"]},{text:"Challenge Hisoka to a final duel",action:"final_duel_hisoka",consequences:"You and Hisoka battle as equals, cementing your place in his story.",statChanges:{strength:3,aura:3,health:-15},experience:120,reputation:{rival:+3,legendary:+2},unlocks:["Legendary Rivalry"]}]}],completion_rewards:{skillPoints:40,experience:900,title:"Hisoka's Confidant",unlocks:["Hisoka's Techniques","Magician's Secrets","Magician's Code","Troupe Rivalry","Underworld Tactics","Transmutation Insights"]}},// --- NEW STORY ARC: Beyond Netero (Mini-Arc) --- beyondNetero:{title:"Beyond Netero: The Chairman's Legacy",description:"Explore the legacy of Isaac Netero and the secret missions he left behind.",unlocked:false,unlock_requirement:{level:38,hunterExamCompleted:true},chapters:[{title:"The Secret Letter",text:"You receive a mysterious letter from Netero, inviting you to a hidden training ground.",choices:[{text:"Accept the invitation and train",action:"train_with_netero",consequences:"You undergo grueling training, increasing your stats.",statChanges:{strength:4,aura:3,intelligence:2},experience:90,reputation:{disciplined:+2,honored:+2},unlocks:["Netero's Techniques"]},{text:"Investigate the letter's origin",action:"investigate_letter",consequences:"You uncover a secret about Netero's past.",statChanges:{intelligence:5,aura:2},experience:80,reputation:{detective:+2,curious:+2},unlocks:["Chairman's Secret"]},{text:"Ignore the letter and focus on your own path",action:"ignore_letter",consequences:"You miss out on Netero's training but gain independence.",statChanges:{intelligence:2,speed:2},experience:60,reputation:{independent:+2,stubborn:+2},unlocks:["Lone Path"]}]},{title:"The Final Test",text:"Netero challenges you to a final test of strength and character.",choices:[{text:"Face Netero head-on",action:"face_netero",consequences:"You battle Netero, gaining his respect.",statChanges:{strength:5,aura:4,health:-30},experience:120,reputation:{brave:+3,legendary:+2},battle_trigger:"Isaac Netero"},{text:"Try to outwit Netero",action:"outwit_netero",consequences:"You use strategy to impress Netero.",statChanges:{intelligence:6,aura:2},experience:110,reputation:{clever:+3,strategic:+2},unlocks:["Strategic Mastery"]},{text:"Refuse the test and walk away",action:"refuse_test",consequences:"You choose your own destiny, forgoing Netero's approval.",statChanges:{intelligence:2,aura:1},experience:70,reputation:{independent:+2,mysterious:+2},unlocks:["Self-Determination"]}]}],completion_rewards:{skillPoints:25,experience:500,title:"Netero's Successor",unlocks:["Chairman's Blessing","Legacy Techniques"]}},// --- NEW WHAT IF? ARC: Phantom Troupe Redemption --- phantomTroupeRedemption:{title:"What If? Phantom Troupe Redemption",description:"Explore an alternate timeline where the Phantom Troupe seeks redemption instead of destruction.",unlocked:false,unlock_requirement:{yorknewCompleted:true,level:40},chapters:[{title:"The Spider's Doubt",text:"Chrollo begins to question the Troupe's path. You are invited to a secret meeting.",choices:[{text:"Encourage Chrollo to seek redemption",action:"encourage_redemption",consequences:"You help Chrollo consider a new path.",statChanges:{intelligence:3,aura:2},experience:80,reputation:{diplomatic:+2,visionary:+2},unlocks:["Redemption Path"]},{text:"Spy on the meeting for the Hunter Association",action:"spy_on_meeting",consequences:"You gather intelligence but risk exposure.",statChanges:{intelligence:4,speed:2},experience:70,reputation:{spy:+2,risky:+2},unlocks:["Secret Intel"]},{text:"Sabotage the Troupe's plans",action:"sabotage_troupe",consequences:"You disrupt the Troupe, risking their wrath.",statChanges:{intelligence:2,aura:2},experience:60,reputation:{saboteur:+2,dangerous:+2},unlocks:["Sabotage"]}]},{title:"The Choice",text:"The Troupe must decide whether to turn themselves in or continue their criminal ways.",choices:[{text:"Convince the Troupe to surrender",action:"convince_surrender",consequences:"You lead the Troupe toward redemption.",statChanges:{intelligence:5,aura:3},experience:100,reputation:{peacemaker:+3,leader:+2},unlocks:["Spider's Redemption"]},{text:"Expose the Troupe to the authorities",action:"expose_troupe",consequences:"You ensure justice is served.",statChanges:{intelligence:4,aura:2},experience:90,reputation:{justice:+3,methodical:+2},unlocks:["Justice Served"]},{text:"Let the Troupe escape and start anew",action:"let_escape",consequences:"You allow the Troupe to disappear, changing the course of history.",statChanges:{intelligence:2,aura:2},experience:70,reputation:{mysterious:+2,independent:+2},unlocks:["Alternate Timeline"]}]}],completion_rewards:{skillPoints:20,experience:400,title:"Spider Redeemer",unlocks:["Alternate Endings","Troupe Ally"]}},hunterExam:{// --- NEW STORY ARC: Kurapika's Bodyguard Arc --- kurapikaBodyguard:{title:"Kurapika's Bodyguard Arc",description:"Protect Neon Nostrade and navigate the mafia underworld as Kurapika's ally.",unlocked:false,unlock_requirement:{yorknewCompleted:true,level:28},chapters:[{title:"The Bodyguard Contract",text:"Kurapika recruits you to join the Nostrade Family as a bodyguard for Neon. The mafia world is full of danger and intrigue.",choices:[{text:"Accept the contract and swear loyalty",action:"accept_bodyguard",consequences:"You become a trusted bodyguard, gaining access to mafia secrets.",statChanges:{intelligence:3,aura:2,maxHealth:10},experience:60,reputation:{loyal:+3,underworld:+2},allies:["Kurapika Kurta","Neon Nostrade"],unlocks:["Bodyguard Network"]},{text:"Negotiate for higher pay and privileges",action:"negotiate_contract",consequences:"You secure better terms, but some mafia members distrust you.",statChanges:{intelligence:4,aura:1},experience:55,reputation:{cunning:+2,greedy:+2},unlocks:["Negotiator"]},{text:"Refuse and investigate the Nostrade Family independently",action:"refuse_bodyguard",consequences:"You operate as a freelancer, risking mafia hostility.",statChanges:{intelligence:2,speed:2},experience:50,reputation:{independent:+3,risky:+2},unlocks:["Freelance Investigator"]}]},{title:"The Chain User's Secret",text:"Kurapika reveals his true identity as a Kurta and his quest for vengeance. You must decide how deeply to involve yourself.",choices:[{text:"Swear to help Kurapika avenge his clan",action:"swear_vengeance",consequences:"You become Kurapika's confidant and share in his burden.",statChanges:{intelligence:2,aura:2},experience:70,reputation:{loyal:+2,vengeful:+2},unlocks:["Kurta Secrets"]},{text:"Advise Kurapika to seek peace",action:"advise_peace",consequences:"You try to temper Kurapika's rage, risking his trust.",statChanges:{intelligence:3},experience:60,reputation:{diplomatic:+2,cautious:+2},unlocks:["Voice of Reason"]},{text:"Keep your distance and focus on your own goals",action:"distance_self",consequences:"You remain an observer, learning from the shadows.",statChanges:{intelligence:2,speed:1},experience:50,reputation:{independent:+2,mysterious:+2},unlocks:["Shadow Watcher"]}]},{title:"The Auction Showdown",text:"The Phantom Troupe attacks the auction. As chaos erupts, your choices will determine who survives.",choices:[{text:"Defend Neon and the Nostrade Family",action:"defend_neon",consequences:"You protect Neon, earning the family's gratitude.",statChanges:{strength:3,aura:2,health:-20},experience:80,reputation:{protector:+3,heroic:+2},allies:["Neon Nostrade"],unlocks:["Family Trust"]},{text:"Confront a Troupe member directly",action:"confront_troupe",consequences:"You face a deadly enemy, risking your life.",statChanges:{strength:4,aura:3,health:-40},experience:100,reputation:{fearless:+3,reckless:+2},battle_trigger:"Phantom Troupe Member"},{text:"Use the chaos to steal a rare artifact",action:"steal_artifact",consequences:"You gain a powerful item but risk being branded a criminal.",statChanges:{intelligence:3,aura:2},experience:70,reputation:{criminal:+3,opportunist:+2},items:["Rare Mafia Artifact"]}]}],completion_rewards:{skillPoints:30,experience:600,title:"Mafia Bodyguard",unlocks:["Mafia Network","Kurta Alliance"]}},// --- NEW STORY ARC: Hisoka's Past (Side Story) --- hisokaPast:{title:"Hisoka's Past: The Magician's Origin",description:"Unravel the mysterious past of Hisoka Morow and discover the roots of his obsession with strong opponents.",unlocked:false,unlock_requirement:{level:32,hunterExamCompleted:true},chapters:[{title:"The Circus of Death",text:"You find yourself in a traveling circus where a young Hisoka first discovered his love for combat and deception.",choices:[{text:"Challenge Hisoka in a magic duel",action:"magic_duel",consequences:"You impress Hisoka with your skills, earning his interest.",statChanges:{intelligence:3,aura:2},experience:60,reputation:{rival:+2,mysterious:+2},unlocks:["Hisoka's Favor"]},{text:"Investigate the circus's dark secrets",action:"investigate_circus",consequences:"You uncover the truth behind the circus's disappearances.",statChanges:{intelligence:4,speed:2},experience:70,reputation:{detective:+2,brave:+2},unlocks:["Circus Secrets"]},{text:"Befriend the young Hisoka",action:"befriend_hisoka",consequences:"You form a strange friendship, learning about his philosophy.",statChanges:{intelligence:2,aura:2},experience:50,reputation:{friendly:+2,odd:+2},unlocks:["Hisoka's Philosophy"]}]},{title:"The First Kill",text:"Hisoka is forced to fight for his life against a cruel ringmaster. You must decide whether to intervene or let fate take its course.",choices:[{text:"Help Hisoka defeat the ringmaster",action:"help_hisoka",consequences:"You and Hisoka defeat the ringmaster, forging a bond.",statChanges:{strength:3,aura:2,health:-10},experience:80,reputation:{ally:+2,dangerous:+2},unlocks:["Blood Bond"]},{text:"Let Hisoka fight alone",action:"let_hisoka_fight",consequences:"Hisoka wins, but you see his true nature.",statChanges:{intelligence:2,aura:2},experience:60,reputation:{observer:+2,cautious:+2},unlocks:["Witness to Power"]},{text:"Stop the fight and expose the circus",action:"expose_circus",consequences:"You end the violence, but Hisoka disappears.",statChanges:{intelligence:3,aura:1},experience:70,reputation:{peacemaker:+2,mysterious:+2},unlocks:["Circus Exposed"]}]}],completion_rewards:{skillPoints:20,experience:400,title:"Hisoka's Confidant",unlocks:["Hisoka's Techniques","Magician's Secrets"]}},// --- NEW STORY ARC: Beyond Netero (Mini-Arc) --- beyondNetero:{title:"Beyond Netero: The Chairman's Legacy",description:"Explore the legacy of Isaac Netero and the secret missions he left behind.",unlocked:false,unlock_requirement:{level:38,hunterExamCompleted:true},chapters:[{title:"The Secret Letter",text:"You receive a mysterious letter from Netero, inviting you to a hidden training ground.",choices:[{text:"Accept the invitation and train",action:"train_with_netero",consequences:"You undergo grueling training, increasing your stats.",statChanges:{strength:4,aura:3,intelligence:2},experience:90,reputation:{disciplined:+2,honored:+2},unlocks:["Netero's Techniques"]},{text:"Investigate the letter's origin",action:"investigate_letter",consequences:"You uncover a secret about Netero's past.",statChanges:{intelligence:5,aura:2},experience:80,reputation:{detective:+2,curious:+2},unlocks:["Chairman's Secret"]},{text:"Ignore the letter and focus on your own path",action:"ignore_letter",consequences:"You miss out on Netero's training but gain independence.",statChanges:{intelligence:2,speed:2},experience:60,reputation:{independent:+2,stubborn:+2},unlocks:["Lone Path"]}]},{title:"The Final Test",text:"Netero challenges you to a final test of strength and character.",choices:[{text:"Face Netero head-on",action:"face_netero",consequences:"You battle Netero, gaining his respect.",statChanges:{strength:5,aura:4,health:-30},experience:120,reputation:{brave:+3,legendary:+2},battle_trigger:"Isaac Netero"},{text:"Try to outwit Netero",action:"outwit_netero",consequences:"You use strategy to impress Netero.",statChanges:{intelligence:6,aura:2},experience:110,reputation:{clever:+3,strategic:+2},unlocks:["Strategic Mastery"]},{text:"Refuse the test and walk away",action:"refuse_test",consequences:"You choose your own destiny, forgoing Netero's approval.",statChanges:{intelligence:2,aura:1},experience:70,reputation:{independent:+2,mysterious:+2},unlocks:["Self-Determination"]}]}],completion_rewards:{skillPoints:25,experience:500,title:"Netero's Successor",unlocks:["Chairman's Blessing","Legacy Techniques"]}},// --- NEW WHAT IF? ARC: Phantom Troupe Redemption --- phantomTroupeRedemption:{title:"What If? Phantom Troupe Redemption",description:"Explore an alternate timeline where the Phantom Troupe seeks redemption instead of destruction.",unlocked:false,unlock_requirement:{yorknewCompleted:true,level:40},chapters:[{title:"The Spider's Doubt",text:"Chrollo begins to question the Troupe's path. You are invited to a secret meeting.",choices:[{text:"Encourage Chrollo to seek redemption",action:"encourage_redemption",consequences:"You help Chrollo consider a new path.",statChanges:{intelligence:3,aura:2},experience:80,reputation:{diplomatic:+2,visionary:+2},unlocks:["Redemption Path"]},{text:"Spy on the meeting for the Hunter Association",action:"spy_on_meeting",consequences:"You gather intelligence but risk exposure.",statChanges:{intelligence:4,speed:2},experience:70,reputation:{spy:+2,risky:+2},unlocks:["Secret Intel"]},{text:"Sabotage the Troupe's plans",action:"sabotage_troupe",consequences:"You disrupt the Troupe, risking their wrath.",statChanges:{intelligence:2,aura:2},experience:60,reputation:{saboteur:+2,dangerous:+2},unlocks:["Sabotage"]}]},{title:"The Choice",text:"The Troupe must decide whether to turn themselves in or continue their criminal ways.",choices:[{text:"Convince the Troupe to surrender",action:"convince_surrender",consequences:"You lead the Troupe toward redemption.",statChanges:{intelligence:5,aura:3},experience:100,reputation:{peacemaker:+3,leader:+2},unlocks:["Spider's Redemption"]},{text:"Expose the Troupe to the authorities",action:"expose_troupe",consequences:"You ensure justice is served.",statChanges:{intelligence:4,aura:2},experience:90,reputation:{justice:+3,methodical:+2},unlocks:["Justice Served"]},{text:"Let the Troupe escape and start anew",action:"let_escape",consequences:"You allow the Troupe to disappear, changing the course of history.",statChanges:{intelligence:2,aura:2},experience:70,reputation:{mysterious:+2,independent:+2},unlocks:["Alternate Timeline"]}]}],completion_rewards:{skillPoints:20,experience:400,title:"Spider Redeemer",unlocks:["Alternate Endings","Troupe Ally"]}},title:"Hunter Exam Saga",description:"Your journey to become a licensed Hunter through the legendary exam",unlocked:true,chapters:[{title:"Phase 1: The Long Run - Meeting the Competitors",text:"Examiner Satotz leads 404 applicants through the Milsy Wetlands. Among the crowd, you notice several distinctive figures: a spiky-haired boy with intense determination (Gon), a white-haired boy with calculating eyes (Killua), a blonde with chains around his hand (Kurapika), and a man in a suit carrying a briefcase (Leorio). The fog grows thicker as dangerous creatures lurk nearby.",choices:[{text:"Approach Gon and offer to run together",action:"approach_gon",consequences:"Form friendship with Gon, gain his optimistic outlook",statChanges:{speed:2,maxHealth:15},experience:40,reputation:{heroic:+2,friendly:+3},allies:["Gon Freecss"]},{text:"Challenge Killua to a speed competition",action:"challenge_killua",consequences:"Impress Killua with your boldness, learn assassin techniques",statChanges:{speed:4,intelligence:1},experience:45,reputation:{reckless:+2,competitive:+3},unlocks:["Zoldyck Family Interest"]},{text:"Study Kurapika's chain techniques while running",action:"observe_kurapika",consequences:"Learn about Nen chains, gain analytical skills",statChanges:{intelligence:3,aura:2},experience:50,reputation:{analytical:+3,observant:+2},unlocks:["Chain Techniques Insight"]},{text:"Help Leorio who's struggling with medical supplies",action:"help_leorio",consequences:"Earn Leorio's friendship and medical knowledge",statChanges:{strength:2,intelligence:2,maxHealth:20},experience:35,reputation:{helpful:+3,medical:+2},allies:["Leorio Paradinight"],unlocks:["Medical Knowledge"]}]},{title:"Phase 1 Continued: The Wetlands Creatures",text:"As the run continues, massive creatures emerge from the fog. A pack of Noggin Lugging Tortoises blocks the path while Hypnosis Butterflies swarm overhead. The other candidates panic, but this is your chance to show your true abilities.",choices:[{text:"Use your analytical skills to find the creatures' weakness",action:"analyze_creatures",consequences:"Discover creature patterns, help other candidates survive",statChanges:{intelligence:4,aura:3},experience:60,reputation:{brilliant:+3,tactical:+2},unlocks:["Creature Analysis Expert"]},{text:"Fight the creatures head-on to protect weaker candidates",action:"fight_creatures",consequences:"Gain combat experience but risk serious injury",statChanges:{strength:5,speed:3,health:-25},experience:70,reputation:{brave:+4,protector:+3},unlocks:["Combat Veteran"]},{text:"Rally candidates to work together against the threat",action:"rally_candidates",consequences:"Develop leadership skills, create lasting alliances",statChanges:{intelligence:3,aura:2,maxHealth:10},experience:55,reputation:{leader:+4,charismatic:+3},allies:["Candidate Coalition Alpha"],unlocks:["Natural Leadership"]}]},{title:"Phase 1 Finale: Satotz's Secret Test",text:"As you near the end of Phase 1, Examiner Satotz reveals this was more than a simple run. He's been observing each candidate's character, decision-making, and potential. Your actions have not gone unnoticed, and he approaches you specifically.",choices:[{text:"Ask Satotz about the true nature of the Hunter Exam",action:"question_satotz",consequences:"Gain deep insight into what being a Hunter really means",statChanges:{intelligence:5,aura:4},experience:80,reputation:{inquisitive:+3,philosophical:+2},unlocks:["Hunter Philosophy","Satotz's Respect"]},{text:"Challenge Satotz to test your current abilities",action:"challenge_satotz",consequences:"Dangerous but could earn massive respect if you survive",statChanges:{strength:3,speed:4,health:-40},experience:100,reputation:{fearless:+5,reckless:+2},battle_trigger:"Examiner Satotz",survival_chance:0.6},{text:"Offer to help Satotz with the remaining phases",action:"assist_satotz",consequences:"Gain examiner's trust and inside knowledge",statChanges:{intelligence:4,aura:3},experience:65,reputation:{helpful:+3,trusted:+4},unlocks:["Examiner Insights","Phase 2 Advantage"]}]},{title:"Phase 2: Gourmet Hunters - The Cooking Challenge",text:"Examiners Menchi and Buhara present the cooking challenge. But this isn't just about food - it's about creativity, resourcefulness, and understanding your ingredients. You notice Gon attempting to befriend the local wildlife while Killua effortlessly catches fish.",choices:[{text:"Team up with Gon to hunt the Great Stamp pig",action:"team_gon_hunting",consequences:"Learn Gon's nature-based techniques and gain his trust",statChanges:{strength:3,speed:2,intelligence:2},experience:75,reputation:{nature_lover:+3,teamwork:+4},allies:["Gon Freecss"],unlocks:["Nature Hunting","Gon's Techniques"]},{text:"Study Killua's lightning-fast fishing methods",action:"study_killua",consequences:"Learn assassination techniques and speed methods",statChanges:{speed:5,intelligence:3},experience:80,reputation:{analytical:+3,speed_demon:+3},unlocks:["Assassin Techniques","Lightning Speed"]},{text:"Approach Kurapika to learn about ingredient analysis",action:"learn_kurapika",consequences:"Gain knowledge of Nen and analytical skills",statChanges:{intelligence:4,aura:3},experience:70,reputation:{scholarly:+3,analytical:+2},unlocks:["Nen Analysis","Kurapika's Respect"]},{text:"Work with Leorio to create a medicinal dish",action:"medical_cooking",consequences:"Combine medical knowledge with cooking skills",statChanges:{intelligence:3,maxHealth:25},experience:65,reputation:{medical:+3,innovative:+2},unlocks:["Medical Cooking","Healing Dishes"]}]},{title:"Phase 2 Continued: Menchi's Secret Requirements",text:"Menchi reveals that the cooking test had hidden requirements. She's been evaluating not just your cooking, but your ability to work under pressure, adapt to new situations, and show respect for your ingredients. Your previous choices have shaped how she views you.",choices:[{text:"Present your dish with a detailed explanation of its cultural significance",action:"cultural_explanation",consequences:"Impress Menchi with your understanding of food's deeper meaning",statChanges:{intelligence:4,aura:2},experience:90,reputation:{cultured:+3,respectful:+4},unlocks:["Cultural Mastery","Menchi's Approval"]},{text:"Offer to teach other candidates your cooking techniques",action:"teach_cooking",consequences:"Show leadership and generosity, gain multiple allies",statChanges:{intelligence:3,maxHealth:15},experience:85,reputation:{teacher:+4,generous:+3},allies:["Cooking Study Group"],unlocks:["Teaching Abilities"]},{text:"Challenge Menchi's evaluation methods respectfully",action:"challenge_menchi",consequences:"Risk failure but potentially gain enormous respect",statChanges:{intelligence:5,aura:3,health:-20},experience:110,reputation:{bold:+4,intellectual:+3},unlocks:["Intellectual Courage"],survival_chance:0.7}]},{title:"Phase 2: Gourmet Hunters",text:"The cooking challenge reveals more than culinary skills. Menchi and Buhara test creativity under pressure. Your approach influences which examiners notice you.",choices:[{text:"Create an innovative fusion dish",action:"innovative_cooking",consequences:"Impress Menchi with creativity, unlock cooking techniques",statChanges:{intelligence:3,aura:5},experience:40,reputation:{creative:+3,traditional:-1},unlocks:["Gourmet Hunter Path"]},{text:"Perfect a traditional recipe",action:"traditional_cooking",consequences:"Show respect for cooking traditions, gain Buhara's approval",statChanges:{strength:2,intelligence:2},experience:35,reputation:{traditional:+2,creative:-1}},{text:"Help organize other candidates' efforts",action:"organize_candidates",consequences:"Display leadership, some candidates become allies",statChanges:{intelligence:4},experience:45,reputation:{leader:+3,follower:-2},allies:["Candidate Group Alpha"]}]},{title:"Phase 3: Trick Tower - The Teams Form",text:"The 50-hour time limit challenge begins in the mysterious Trick Tower. You must form a team of 5 candidates. Gon's team is forming with Killua, Kurapika, and Leorio, but there's room for one more. Other strong candidates are also forming teams.",choices:[{text:"Join Gon's team as the fifth member",action:"join_gon_team",consequences:"Become part of the main group, gain incredible allies",statChanges:{intelligence:3,aura:3,maxHealth:20},experience:120,reputation:{main_character:+5,team_player:+4},allies:["Gon Freecss","Killua Zoldyck","Kurapika Kurta","Leorio Paradinight"],unlocks:["Main Team Member","Protagonist Group"]},{text:"Form your own rival team with other strong candidates",action:"form_rival_team",consequences:"Create competition with main group, develop leadership",statChanges:{intelligence:4,strength:3,aura:2},experience:100,reputation:{leader:+5,rival:+3},allies:["Rival Team Alpha"],unlocks:["Team Leadership","Rival Dynamic"]},{text:"Secretly observe all teams before deciding",action:"observe_teams",consequences:"Gain intelligence on all candidates' abilities",statChanges:{intelligence:6,speed:2},experience:85,reputation:{analytical:+4,mysterious:+3},unlocks:["Candidate Analysis","Strategic Intelligence"]}]},{title:"Phase 3 Continued: The Majority Rules Room",text:"Your team faces the Majority Rules room where democratic decisions determine your path. Each choice reveals more about your teammates' personalities and creates tension or harmony within the group.",choices:[{text:"Advocate for the most difficult but rewarding path",action:"difficult_path",consequences:"Test your team's resolve and gain respect for your ambition",statChanges:{intelligence:4,aura:3,health:-15},experience:95,reputation:{ambitious:+3,challenging:+2},unlocks:["Leadership Under Pressure"]},{text:"Propose a compromise solution that benefits everyone",action:"compromise_solution",consequences:"Strengthen team bonds and develop diplomatic skills",statChanges:{intelligence:5,maxHealth:15},experience:80,reputation:{diplomatic:+4,unifying:+3},unlocks:["Team Harmony","Diplomatic Solutions"]},{text:"Study the room's mechanisms to find hidden options",action:"find_hidden_options",consequences:"Discover secret paths and alternative solutions",statChanges:{intelligence:6,aura:4},experience:110,reputation:{brilliant:+4,innovative:+3},unlocks:["Hidden Paths","Innovative Thinking"]}]},{title:"Phase 3 Deep Dive: The Prisoner's Dilemma",text:"Your team encounters Lippo, a prisoner who offers a deal. He's willing to reduce your sentence in exchange for defeating him in a specific challenge. This moral dilemma tests your team's unity and individual ethics.",choices:[{text:"Accept the challenge and fight Lippo honorably",action:"fight_lippo_honorably",consequences:"Gain respect but face a dangerous opponent",statChanges:{strength:4,aura:3,health:-25},experience:130,reputation:{honorable:+4,brave:+3},battle_trigger:"Lippo the Prisoner",unlocks:["Combat Honor"]},{text:"Negotiate with Lippo to find a peaceful solution",action:"negotiate_lippo",consequences:"Avoid combat but learn valuable information",statChanges:{intelligence:5,aura:4},experience:100,reputation:{diplomatic:+4,peaceful:+3},unlocks:["Peaceful Resolution","Negotiation Master"]},{text:"Refuse the deal and find another way through",action:"refuse_deal",consequences:"Maintain moral integrity but face harder challenges",statChanges:{intelligence:3,maxHealth:20,aura:2},experience:90,reputation:{principled:+5,stubborn:+2},unlocks:["Moral Integrity","Alternative Solutions"]}]},{title:"Phase 3 Finale: The Tower's True Purpose",text:"As you near the tower's end, you discover its true purpose: evaluating candidates' problem-solving abilities under extreme pressure. The final challenge requires you to demonstrate everything you've learned.",choices:[{text:"Use all your accumulated knowledge to solve the final puzzle",action:"final_puzzle_master",consequences:"Showcase your intellectual growth throughout the phase",statChanges:{intelligence:7,aura:5},experience:150,reputation:{genius:+5,puzzle_master:+4},unlocks:["Intellectual Mastery","Puzzle Genius"]},{text:"Rally your team for one final coordinated effort",action:"team_coordination",consequences:"Demonstrate perfect teamwork and leadership",statChanges:{intelligence:4,strength:3,maxHealth:25},experience:140,reputation:{leader:+5,coordinator:+4},unlocks:["Perfect Teamwork","Leadership Excellence"]},{text:"Take a massive risk to achieve the best possible outcome",action:"ultimate_risk",consequences:"Risk everything for the chance at ultimate success",statChanges:{intelligence:5,aura:6,health:-40},experience:200,reputation:{legendary:+5,risk_taker:+4},unlocks:["Legendary Courage"],survival_chance:0.6}]},{title:"Phase 4: Zevil Island - The Hunt Begins",text:"Each candidate draws a number determining their target. You must collect 6 points: 3 from your target, 1 from your own badge, and 2 from anyone else. The island's ecosystem creates complex predator-prey relationships among candidates.",choices:[{text:"Immediately track your target using advanced hunting techniques",action:"advanced_tracking",consequences:"Quickly locate your target but reveal your own position",statChanges:{speed:4,intelligence:3,aura:2},experience:110,reputation:{hunter:+4,tracker:+3},unlocks:["Master Tracker","Hunting Instincts"]},{text:"Study the island's ecosystem and candidate behaviors",action:"ecosystem_study",consequences:"Gain comprehensive understanding of the island dynamics",statChanges:{intelligence:6,aura:3},experience:95,reputation:{analytical:+4,patient:+3},unlocks:["Ecosystem Analysis","Behavioral Prediction"]},{text:"Form temporary alliances with other candidates",action:"temporary_alliances",consequences:"Create mutual protection but complicate point collection",statChanges:{intelligence:4,maxHealth:20},experience:85,reputation:{diplomatic:+3,strategic:+3},allies:["Island Alliance Network"],unlocks:["Alliance Warfare"]}]},{title:"Phase 4: Zevil Island Politics",text:"The badge hunt reveals the true nature of the exam. Alliances form and break. Your strategy affects the entire candidate ecosystem.",choices:[{text:"Form a candidate protection alliance",action:"protection_alliance",consequences:"Create a network of mutual protection, change exam dynamics",statChanges:{intelligence:4,aura:5},experience:55,reputation:{protector:+4,predator:-3},allies:["Island Protection Network"],unlocks:["Group Leadership Skills"]},{text:"Hunt solo using advanced tactics",action:"solo_hunter",consequences:"Perfect stealth techniques, become feared by other candidates",statChanges:{speed:4,intelligence:3},experience:50,reputation:{lone_wolf:+4,team_player:-2},unlocks:["Advanced Stealth Techniques"]},{text:"Manipulate candidate conflicts",action:"manipulate_conflicts",consequences:"Create chaos to your advantage, learn psychological warfare",statChanges:{intelligence:5,aura:-5},experience:45,reputation:{manipulator:+3,trustworthy:-4},unlocks:["Psychological Manipulation"]}]},{title:"Phase 4 Continued: The Predator Becomes Prey",text:"You discover that someone else is hunting you while you hunt your target. This creates a complex three-way dynamic where you must simultaneously be predator and avoid becoming prey.",choices:[{text:"Set a trap using your target as bait",action:"target_trap",consequences:"Complex strategy that could backfire spectacularly",statChanges:{intelligence:5,aura:3,health:-20},experience:125,reputation:{cunning:+4,manipulative:+3},unlocks:["Master Strategist"],survival_chance:0.7},{text:"Confront your hunter directly",action:"confront_hunter",consequences:"Bold move that could end the threat or end you",statChanges:{strength:4,speed:3,health:-30},experience:135,reputation:{fearless:+5,tactical:-2},battle_trigger:"Island Hunter",unlocks:["Direct Confrontation Master"]},{text:"Use misdirection to make your hunter target someone else",action:"misdirection_play",consequences:"Manipulate the island's dynamics to your advantage",statChanges:{intelligence:6,speed:2},experience:115,reputation:{manipulator:+4,clever:+3},unlocks:["Psychological Manipulation Master"]}]},{title:"Phase 4 Climax: The Great Convergence",text:"As the week progresses, multiple candidates converge on the same area. Gon faces Hisoka, Killua shows his true assassin nature, and Kurapika reveals more about his past. Your actions here will determine your final relationships.",choices:[{text:"Intervene to help Gon against Hisoka",action:"help_gon_hisoka",consequences:"Earn Gon's eternal gratitude but face Hisoka's wrath",statChanges:{strength:3,aura:4,health:-35},experience:160,reputation:{heroic:+5,protective:+4},allies:["Gon Freecss"],enemies:["Hisoka Morow"],unlocks:["Hisoka's Interest","Gon's Loyalty"]},{text:"Approach Killua to learn about his assassin background",action:"learn_killua_past",consequences:"Gain insight into the Zoldyck family but risk their attention",statChanges:{intelligence:5,speed:4},experience:140,reputation:{investigative:+3,dangerous:+2},unlocks:["Zoldyck Family Knowledge","Assassination Techniques"]},{text:"Convince Kurapika to share his clan's tragic history",action:"kurapika_history",consequences:"Learn about the Kurta clan and scarlet eyes",statChanges:{intelligence:4,aura:5},experience:150,reputation:{trustworthy:+4,empathetic:+3},allies:["Kurapika Kurta"],unlocks:["Kurta Clan History","Scarlet Eyes Knowledge"]},{text:"Observe all events while remaining hidden",action:"hidden_observer",consequences:"Gain comprehensive intelligence on all main characters",statChanges:{intelligence:7,speed:3},experience:130,reputation:{mysterious:+4,analytical:+3},unlocks:["Complete Character Analysis","Hidden Presence"]}]},{title:"Phase 5: Tournament Preliminaries - The Bracket Reveals",text:"The tournament bracket is announced, and your position reflects your journey's impact. Your potential opponents include both allies and enemies you've made. The examiners watch closely to see how relationships affect combat.",choices:[{text:"Request to face your strongest ally to test your friendship",action:"fight_ally",consequences:"Ultimate test of friendship vs ambition",statChanges:{strength:3,intelligence:4,aura:3},experience:120,reputation:{complex:+4,challenging:+3},unlocks:["Friendship Trial"],battle_trigger:"Ally Tournament Match"},{text:"Prepare to face your greatest enemy with everything you have",action:"face_enemy",consequences:"Epic confrontation with maximum stakes",statChanges:{strength:5,aura:4,health:-25},experience:150,reputation:{resolute:+5,determined:+4},unlocks:["Ultimate Confrontation"],battle_trigger:"Enemy Tournament Match"},{text:"Study all potential opponents to prepare for any scenario",action:"study_all_opponents",consequences:"Gain strategic advantages but spread your focus thin",statChanges:{intelligence:6,aura:2},experience:110,reputation:{tactical:+4,prepared:+3},unlocks:["Strategic Mastery","Opponent Analysis"]}]},{title:"Phase 5 Continued: The Tournament Battles",text:"Your first tournament match begins. The examiner explains that winning isn't everything - they're evaluating your fighting spirit, adaptability, and potential for growth. Your opponent reflects your journey's choices.",choices:[{text:"Fight with perfect technique and control",action:"perfect_technique",consequences:"Impress examiners with technical mastery",statChanges:{strength:4,aura:5,intelligence:3},experience:140,reputation:{technical_master:+5,perfectionist:+3},unlocks:["Technical Mastery","Perfect Control"]},{text:"Show your raw determination and willpower",action:"raw_determination",consequences:"Demonstrate the heart of a true Hunter",statChanges:{strength:5,aura:4,maxHealth:30},experience:160,reputation:{determined:+5,inspiring:+4},unlocks:["Indomitable Will","Hunter's Heart"]},{text:"Use psychological tactics to understand your opponent",action:"psychological_analysis",consequences:"Win through understanding rather than force",statChanges:{intelligence:6,aura:3},experience:130,reputation:{psychologist:+4,understanding:+3},unlocks:["Psychological Mastery","Opponent Reading"]}]},{title:"Phase 5 Finale: The Ultimate Test",text:"Whether you win or lose your tournament match, Chairman Netero appears for the final evaluation. He's observed your entire journey and wants to test you personally. This is the true final exam.",choices:[{text:"Accept Netero's personal challenge with honor",action:"netero_challenge",consequences:"Face the legendary Hunter Association Chairman",statChanges:{strength:6,aura:7,health:-50},experience:200,reputation:{legendary:+5,honored:+4},unlocks:["Netero's Recognition"],battle_trigger:"Chairman Netero",survival_chance:0.5},{text:"Demonstrate your unique philosophy of what a Hunter should be",action:"hunter_philosophy",consequences:"Impress Netero with your understanding of the Hunter ideal",statChanges:{intelligence:7,aura:5},experience:180,reputation:{philosophical:+5,visionary:+4},unlocks:["Hunter Philosophy Master","Netero's Respect"]},{text:"Show how your journey has changed you as a person",action:"personal_growth",consequences:"Demonstrate the true purpose of the Hunter Exam",statChanges:{intelligence:4,aura:4,maxHealth:40},experience:170,reputation:{evolved:+5,mature:+4},unlocks:["Personal Evolution","Hunter's Journey"]}]}],completion_rewards:{skillPoints:25,experience:500,title:"Licensed Hunter",unlocks:["Professional Hunter Opportunities","Hunter Association Access"]}},yorknewCitySaga:{title:"Yorknew City Underground",description:"Navigate the criminal underworld during the Southernpiece Auction",unlocked:false,unlock_requirement:{hunterExamCompleted:true,level:25},chapters:[{title:"Arrival in the Auction City - Meeting the Nostrade Family",text:"Yorknew City buzzes with criminal energy as the Southernpiece Auction approaches. You encounter Neon Nostrade, the fortune-telling daughter of a mafia boss, and her bodyguards including Kurapika. The city's underworld is more complex than you imagined.",choices:[{text:"Approach Kurapika and offer to help with his mission",action:"help_kurapika_mission",consequences:"Learn about the Kurta clan's tragedy and gain a powerful ally",statChanges:{intelligence:4,aura:3,maxHealth:15},experience:80,reputation:{justice_seeker:+4,vengeful:+2},allies:["Kurapika Kurta"],unlocks:["Kurta Clan Revenge","Chain User Techniques"]},{text:"Investigate the Nostrade family's operations independently",action:"investigate_nostrade",consequences:"Gain insight into mafia operations but risk discovery",statChanges:{intelligence:5,speed:3,health:-15},experience:90,reputation:{investigative:+4,criminal:+2},unlocks:["Mafia Operations","Fortune Telling Knowledge"]},{text:"Seek audience with Neon Nostrade for a fortune reading",action:"neon_fortune",consequences:"Learn prophetic information but attract unwanted attention",statChanges:{intelligence:3,aura:4},experience:70,reputation:{mystic:+3,curious:+2},unlocks:["Prophetic Knowledge","Lovely Ghostwriter Insight"]},{text:"Work with the Shadow Beasts to understand the auction's dangers",action:"shadow_beasts_cooperation",consequences:"Gain insider knowledge of the Ten Dons' operations",statChanges:{strength:3,intelligence:4,aura:2},experience:85,reputation:{underworld:+4,connected:+3},unlocks:["Shadow Beast Techniques","Ten Dons Intelligence"]}]},{title:"The Phantom Troupe's Past - Meteor City Origins",text:"Through your investigations, you discover the Phantom Troupe's origins in Meteor City. Their tragic backstory reveals they aren't simple criminals but products of a system that discarded them. You encounter Chrollo Lucilfer reading in an abandoned church.",choices:[{text:"Attempt to understand Chrollo's philosophy",action:"understand_chrollo",consequences:"Gain insight into the Troupe's motivations but risk philosophical corruption",statChanges:{intelligence:6,aura:4,maxHealth:-20},experience:120,reputation:{philosophical:+4,dangerous:+3},unlocks:["Chrollo's Philosophy","Skill Hunter Understanding"]},{text:"Challenge Chrollo to a battle of ideologies",action:"ideology_battle",consequences:"Intellectual confrontation with the Spider's head",statChanges:{intelligence:5,aura:5,health:-25},experience:150,reputation:{intellectual:+5,challenging:+3},unlocks:["Ideological Warfare"],battle_trigger:"Chrollo Lucilfer"},{text:"Spy on the Troupe's reunion and member interactions",action:"spy_troupe_reunion",consequences:"Learn about each member's personality and abilities",statChanges:{intelligence:7,speed:4},experience:100,reputation:{spy:+4,analytical:+3},unlocks:["Troupe Member Analysis","Spider Web Knowledge"]}]},{title:"The Mafia's Counterstrike - Ten Dons vs Phantom Troupe",text:"The Ten Dons hire professional assassins to eliminate the Phantom Troupe. You witness the arrival of the Zoldyck family's Illumi and Silva. The underworld war escalates beyond anything you've seen.",choices:[{text:"Approach Illumi to learn about the Zoldyck assassination contract",action:"illumi_contract",consequences:"Gain assassin family knowledge but risk their attention",statChanges:{intelligence:4,speed:5,health:-30},experience:130,reputation:{assassin_connected:+4,dangerous:+3},unlocks:["Zoldyck Assassination Techniques","Illumi's Methods"]},{text:"Side with the Ten Dons and their Shadow Beast enforcers",action:"side_ten_dons",consequences:"Join the established order against the Troupe",statChanges:{strength:4,intelligence:3,aura:3},experience:110,reputation:{establishment:+4,order:+3},allies:["Ten Dons Alliance"],unlocks:["Shadow Beast Combat","Mafia Hierarchy"]},{text:"Maintain neutrality while gathering intelligence on both sides",action:"neutral_intelligence",consequences:"Comprehensive understanding but no powerful allies",statChanges:{intelligence:6,aura:2},experience:95,reputation:{neutral:+4,informed:+3},unlocks:["Complete War Analysis","Neutral Observer"]}]},{title:"Kurapika's Vengeance - The Chain User's Hunt",text:"Kurapika's hatred for the Phantom Troupe reaches its peak. You witness him capture Chrollo with his Chain Jail and see the terrifying power of his Emperor Time. His scarlet eyes burn with generations of accumulated rage.",choices:[{text:"Support Kurapika's quest for justice",action:"support_kurapika_justice",consequences:"Help him achieve vengeance but witness his moral degradation",statChanges:{intelligence:3,aura:4,maxHealth:20},experience:140,reputation:{justice:+5,vengeful:+3},allies:["Kurapika Kurta"],unlocks:["Chain Jail Techniques","Emperor Time Witness"]},{text:"Try to convince Kurapika to show mercy",action:"convince_mercy",consequences:"Attempt to save his soul from consuming hatred",statChanges:{intelligence:5,aura:3},experience:120,reputation:{merciful:+4,compassionate:+3},unlocks:["Mercy's Power","Soul Preservation"]},{text:"Study Kurapika's Emperor Time ability for your own use",action:"study_emperor_time",consequences:"Learn about the ultimate Nen ability but risk moral corruption",statChanges:{intelligence:6,aura:6,health:-20},experience:160,reputation:{power_seeker:+4,analytical:+3},unlocks:["Emperor Time Theory","Scarlet Eyes Research"]}]},{title:"The Auction House Heist - Night of Chaos",text:"The night of the auction arrives. The Phantom Troupe strikes with devastating efficiency. Bodies pile up as Uvogin demonstrates his monstrous strength. Your previous choices determine your options and allies in this crisis.",dynamic_choices:true,base_choices:[{text:"Evacuate civilians while the Troupe is distracted",action:"evacuate_civilians",consequences:"Save innocent lives but miss rare opportunities",statChanges:{maxHealth:40,intelligence:3},experience:100,reputation:{heroic:+5,selfless:+4},moral_boost:true,unlocks:["Civilian Protector"]},{text:"Confront Uvogin directly to test your strength",action:"confront_uvogin",consequences:"Face the Troupe's most physically powerful member",statChanges:{strength:6,aura:4,health:-60},experience:200,reputation:{fearless:+5,warrior:+4},battle_trigger:"Uvogin the Destroyer",survival_chance:0.4},{text:"Steal rare Nen artifacts during the chaos",action:"steal_artifacts",consequences:"Gain powerful items but become complicit in the heist",statChanges:{aura:8,intelligence:4,maxHealth:-30},experience:130,reputation:{opportunist:+4,criminal:+3},unlocks:["Rare Nen Artifacts","Stolen Treasures"],items:["Cursed Nen Tools","Ancient Scrolls","Mafia Relics"]}]},{title:"The Underground Pursuit - Chasing Shadows",text:"The Troupe scatters into Yorknew's underground after the heist. You must navigate the city's criminal underworld, following leads through dark alleys, abandoned buildings, and secret tunnels. Each path reveals more about the city's hidden nature.",choices:[{text:"Follow Nobunaga and Pakunoda through the old subway tunnels",action:"follow_nobunaga_pakunoda",consequences:"Learn about the Troupe's emotional bonds and weaknesses",statChanges:{intelligence:4,speed:3,aura:2},experience:115,reputation:{tracker:+3,stealthy:+2},unlocks:["Troupe Emotional Bonds","Underground Navigation"]},{text:"Investigate the criminal networks that support the Troupe",action:"investigate_criminal_networks",consequences:"Uncover the vast conspiracy behind the Troupe's operations",statChanges:{intelligence:6,aura:3},experience:125,reputation:{investigative:+4,conspiracy_hunter:+3},unlocks:["Criminal Network Map","Conspiracy Knowledge"]},{text:"Hunt down Franklin and Shalnark at their hideout",action:"hunt_franklin_shalnark",consequences:"Confront the Troupe's tactical support members",statChanges:{strength:4,speed:4,health:-35},experience:145,reputation:{hunter:+4,aggressive:+3},battle_trigger:"Franklin and Shalnark",unlocks:["Tactical Combat"]}]},{title:"The Requiem's End - Final Confrontations",text:"The saga reaches its climax as all parties converge for final confrontations. Kurapika faces his destiny, the Troupe mourns their losses, and the city's power structure shifts forever. Your choices throughout the arc determine your role in the conclusion.",choices:[{text:"Stand with Kurapika in his final confrontation with Chrollo",action:"final_kurapika_chrollo",consequences:"Witness the ultimate battle between vengeance and acceptance",statChanges:{strength:5,intelligence:4,aura:6},experience:180,reputation:{legendary:+5,witness:+4},unlocks:["Ultimate Confrontation Witness"],battle_trigger:"Final Kurapika vs Chrollo"},{text:"Attempt to broker peace between all factions",action:"broker_peace",consequences:"Try to end the cycle of violence through diplomacy",statChanges:{intelligence:7,aura:4,maxHealth:30},experience:160,reputation:{peacemaker:+5,diplomatic:+4},unlocks:["Master Diplomat","Peace Broker"]},{text:"Use the chaos to establish your own power base in the city",action:"establish_power_base",consequences:"Emerge as a new player in Yorknew's criminal underworld",statChanges:{intelligence:5,strength:4,aura:5},experience:170,reputation:{power_broker:+5,ambitious:+4},unlocks:["Criminal Empire","Underworld Authority"]}]}],completion_rewards:{skillPoints:40,experience:800,title:"Yorknew Survivor",unlocks:["Criminal Network Access","Auction House Connections"]}},greedIslandAdventure:{title:"Greed Island: The Ultimate Game",description:"Enter the legendary Nen-powered game where death is real",unlocked:false,unlock_requirement:{level:35,yorknewCompleted:true},chapters:[{title:"Game Tutorial and First Impressions",text:"Welcome to Greed Island! The tutorial explains the card system, but experienced players watch you carefully. Your first actions set your reputation in this deadly game.",choices:[{text:"Focus on collecting spell cards",action:"collect_spell_cards",consequences:"Build strong defensive capabilities early",statChanges:{intelligence:4,aura:6},experience:70,reputation:{strategic:+3,aggressive:-1},unlocks:["Spell Card Mastery","Defensive Strategies"]},{text:"Hunt rare restricted cards immediately",action:"hunt_rare_cards",consequences:"High risk approach targeting the most valuable prizes",statChanges:{strength:6,speed:5,health:-30},experience:100,reputation:{aggressive:+4,cautious:-2},unlocks:["Rare Card Locations","High-Risk Hunting"]},{text:"Form alliances with other players",action:"form_player_alliances",consequences:"Create safety networks but share rewards",statChanges:{intelligence:5,maxHealth:20},experience:85,reputation:{diplomatic:+4,lone_wolf:-2},allies:["Greed Island Player Network"]}]},{title:"The Bomber's Threat",text:"Genthru the Bomber has marked you for death. Your approach to this deadly game of cat and mouse will determine whether you become predator or prey.",choices:[{text:"Confront the Bomber directly",action:"confront_bomber",consequences:"Extremely dangerous battle with massive rewards if successful",statChanges:{strength:12,aura:10,health:-60},experience:250,reputation:{fearless:+5,prudent:-3},battle_trigger:"Genthru the Bomber",special_reward:"Bomber Defeat Bonus"},{text:"Unite players against the common threat",action:"unite_against_bomber",consequences:"Organize resistance but risk being betrayed",statChanges:{intelligence:8,speed:4},experience:180,reputation:{leader:+4,follower:-2},unlocks:["Player Coalition","Group Combat Tactics"]},{text:"Use stealth and misdirection",action:"stealth_vs_bomber",consequences:"Avoid direct confrontation while undermining his operations",statChanges:{speed:8,intelligence:6},experience:160,reputation:{cunning:+4,straightforward:-2},unlocks:["Advanced Stealth","Sabotage Techniques"]}]}],completion_rewards:{skillPoints:60,experience:1200,title:"Greed Island Victor",unlocks:["Game Master Techniques","Reality Manipulation Basics"]}},chimeraAntCrisis:{title:"Chimera Ant Crisis",description:"Face the ultimate threat to humanity as the Chimera Ant Queen creates an army of monsters. The longest and most branching arc, with deep ties to the 13th Hunter Chairman Election and Killua/Alluka/Gon.",unlocked:false,unlock_requirement:{level:30,yorknewCompleted:true},chapters:[{title:"The Discovery - First Contact",text:"Reports come in of strange creatures attacking villages near the NGL border. A massive insect-like Queen has been spotted consuming humans and animals to birth powerful hybrid soldiers. The Hunter Association mobilizes, but you arrive first at the scene of devastation.",choices:[{text:"Investigate the Queen's nest alone",action:"investigate_queen_nest",consequences:"Discover the Queen's terrifying reproductive process but risk detection",statChanges:{intelligence:6,aura:4,health:-25},experience:100,reputation:{brave:+4,reckless:+2},unlocks:["Queen's Nest Knowledge","Chimera Ant Biology"]},{text:"Rally local hunters and form a search party",action:"rally_hunters",consequences:"Safer approach but some hunters may be consumed",statChanges:{intelligence:4,strength:3,maxHealth:20},experience:80,reputation:{leader:+3,protective:+2},allies:["Hunter Search Party"],unlocks:["Hunter Coordination"]},{text:"Report to the Hunter Association immediately",action:"report_association",consequences:"Bring in professional help but lose time and initiative",statChanges:{intelligence:3,aura:2},experience:60,reputation:{cautious:+2,obedient:+1},unlocks:["Association Backup","Professional Support"]}]},{title:"The Ant Army Grows",text:"The Queen's army expands rapidly, consuming entire villages. You must choose how to respond as the Ants begin to develop Nen.",choices:[{text:"Attempt to negotiate with a sentient Ant",action:"negotiate_ant",consequences:"You try to reason with a Chimera Ant who shows signs of humanity.",statChanges:{intelligence:5,aura:3},experience:90,reputation:{diplomatic:+2,risky:+2},unlocks:["Ant Negotiation","Moral Dilemma"]},{text:"Lead a raid to rescue survivors",action:"raid_rescue",consequences:"You lead a dangerous mission to save humans from the nest.",statChanges:{strength:6,speed:4,health:-20},experience:120,reputation:{heroic:+3,leader:+2},allies:["Rescued Survivors"],unlocks:["Rescue Operations"]},{text:"Study the Ants' Nen development",action:"study_ant_nen",consequences:"You observe the Ants as they awaken Nen abilities.",statChanges:{intelligence:7,aura:5},experience:100,reputation:{scholar:+3,analytical:+2},unlocks:["Ant Nen Theory"]}]},{title:"The Royal Guards Emerge",text:"The Queen has birthed her Royal Guards - Neferpitou, Shaiapouf, and Menthuthuyoupi. Each possesses power beyond normal Nen users. Their auras are so intense that even approaching them causes terror. You witness their first display of power as they slaughter an entire Hunter team.",choices:[{text:"Challenge Neferpitou directly",action:"challenge_neferpitou",consequences:"Face the playful but deadly cat-like Royal Guard",statChanges:{strength:8,speed:6,health:-60},experience:200,reputation:{fearless:+5,suicidal:+3},battle_trigger:"Neferpitou",survival_chance:0.3},{text:"Study Shaiapouf's manipulation abilities",action:"study_shaiapouf",consequences:"Learn about advanced manipulation but risk mind control",statChanges:{intelligence:8,aura:6,health:-40},experience:180,reputation:{analytical:+4,risky:+2},unlocks:["Manipulation Mastery","Mind Control Resistance"]},{text:"Observe Menthuthuyoupi's rage transformation",action:"observe_menthuthuyoupi",consequences:"Understand transformation abilities but witness horrible power",statChanges:{intelligence:6,aura:8,health:-30},experience:160,reputation:{scholar:+3,survivor:+2},unlocks:["Transformation Theory","Rage Power"]}]},{title:"The King's Birth and the Queen's Death",text:"Meruem, the Chimera Ant King, is born. His first act is to kill the Queen and begin his reign. The Royal Guards become even more fanatical.",choices:[{text:"Attempt to assassinate the King while he's young",action:"assassinate_king",consequences:"Suicidal mission but could save humanity",statChanges:{strength:10,speed:8,health:-80},experience:300,reputation:{heroic:+6,martyr:+4},battle_trigger:"Meruem (Young King)",survival_chance:0.1},{text:"Study the King's power from a distance",action:"study_king_power",consequences:"Learn about ultimate power but risk being detected",statChanges:{intelligence:12,aura:10,health:-50},experience:250,reputation:{scholar:+5,cautious:+3},unlocks:["King's Power Analysis","Ultimate Nen Theory"]},{text:"Evacuate civilians from the King's path",action:"evacuate_civilians",consequences:"Save lives but allow the King to grow stronger",statChanges:{intelligence:4,maxHealth:40,aura:3},experience:180,reputation:{heroic:+4,protective:+5},unlocks:["Mass Evacuation","Civilian Trust"]}]},{title:"The Palace Infiltration",text:"The Hunters, including Knov, Morel, and the main cast, plan a dangerous infiltration of the palace. The fate of humanity hangs in the balance.",choices:[{text:"Join the infiltration team",action:"join_infiltration",consequences:"You sneak into the palace with the main team.",statChanges:{intelligence:6,speed:5,health:-30},experience:200,reputation:{heroic:+3,tactical:+2},allies:["Knuckle","Shoot","Morel"],unlocks:["Palace Infiltration"]},{text:"Create a diversion outside",action:"create_diversion",consequences:"You draw the Royal Guards' attention, risking your life.",statChanges:{strength:7,health:-40},experience:180,reputation:{brave:+3,reckless:+2},unlocks:["Diversion Tactics"]},{text:"Attempt to assassinate a Royal Guard",action:"assassinate_guard",consequences:"You try to take out a Royal Guard solo.",statChanges:{strength:10,aura:8,health:-60},experience:250,reputation:{assassin:+3,risky:+3},battle_trigger:"Neferpitou",survival_chance:0.2}]},{title:"Gon's Rage and Komugi's Fate",text:"Gon, driven by rage over Kite's death, confronts Neferpitou. Meanwhile, Komugi, the King's favorite, is gravely injured. Your choices here affect the outcome for Gon and the King.",choices:[{text:"Help Gon control his rage",action:"help_gon_rage",consequences:"You try to calm Gon, risking his wrath.",statChanges:{intelligence:8,aura:6},experience:150,reputation:{empathetic:+3,leader:+2},unlocks:["Gon's Trust"]},{text:"Encourage Gon to unleash his power",action:"encourage_gon",consequences:"You push Gon to his limits, risking his life.",statChanges:{strength:12,health:-50},experience:200,reputation:{reckless:+4,power_seeker:+2},unlocks:["Gon's Transformation"]},{text:"Tend to Komugi's wounds",action:"heal_komugi",consequences:"You help save Komugi, earning the King's attention.",statChanges:{intelligence:6,aura:5},experience:120,reputation:{healer:+3,diplomatic:+2},unlocks:["Komugi's Gratitude"]}]},{title:"The Selection Process",text:"The King begins his 'Selection' - forcing humans to participate in deadly games. Those who survive gain incredible Nen abilities but become his servants. You witness the transformation of humans into powerful Nen users through this horrific process.",choices:[{text:"Infiltrate the Selection to gain power",action:"infiltrate_selection",consequences:"Risk becoming the King's servant but gain immense power",statChanges:{strength:15,speed:12,aura:18,intelligence:8},experience:400,reputation:{power_seeker:+5,corrupted:+3},unlocks:["Selection Survivor","Enhanced Nen"],survival_chance:0.4},{text:"Sabotage the Selection process",action:"sabotage_selection",consequences:"Disrupt the King's plans but face his wrath",statChanges:{intelligence:8,aura:6,health:-40},experience:280,reputation:{saboteur:+4,rebellious:+3},unlocks:["Sabotage Techniques","Royal Wrath"]},{text:"Rescue Selection participants",action:"rescue_participants",consequences:"Save some humans but reveal your presence",statChanges:{strength:6,speed:8,maxHealth:30},experience:220,reputation:{heroic:+5,rescuer:+4},unlocks:["Rescue Operations","Human Resistance"]}]},{title:"The King vs Netero",text:"The ultimate battle begins: Chairman Netero faces Meruem. The fate of the world hangs in the balance. You can choose to intervene, support, or escape.",choices:[{text:"Fight alongside Chairman Netero",action:"fight_with_netero",consequences:"Face the King with humanity's strongest warrior",statChanges:{strength:12,aura:15,health:-60},experience:500,reputation:{legendary:+6,heroic:+5},battle_trigger:"Meruem (Final Form)",allies:["Chairman Netero"],unlocks:["Netero's Techniques","Ultimate Sacrifice"]},{text:"Use the Poor Man's Rose bomb",action:"use_miniature_rose",consequences:"Nuclear option that could stop the King but at terrible cost",statChanges:{intelligence:10,health:-90,maxHealth:-50},experience:400,reputation:{destroyer:+6,necessary_evil:+4},unlocks:["Nuclear Warfare","Pyrrhic Victory"]},{text:"Attempt to reason with the King",action:"reason_with_king",consequences:"Try to appeal to whatever humanity remains in Meruem",statChanges:{intelligence:15,aura:12,health:-70},experience:450,reputation:{diplomatic:+6,idealistic:+4},unlocks:["Royal Diplomacy","King's Humanity"],survival_chance:0.2}]},{title:"Aftermath: The World Reacts",text:"The Chimera Ant threat is ended, but the world is forever changed. Survivors are traumatized, and the Hunter Association is thrown into chaos by Netero's death.",choices:[{text:"Help rebuild NGL and support survivors",action:"rebuild_ngl",consequences:"You dedicate yourself to healing the world.",statChanges:{intelligence:6,aura:4},experience:120,reputation:{heroic:+3,healer:+2},unlocks:["NGL Rebuilder"]},{text:"Investigate the origins of Chimera Ants",action:"investigate_origins",consequences:"You seek the truth behind the Ants' existence.",statChanges:{intelligence:10,aura:6},experience:150,reputation:{scholar:+3,seeker:+2},unlocks:["Ant Origins","Dark Continent Clue"]},{text:"Prepare for the political chaos to come",action:"prepare_election",consequences:"You sense the coming storm in the Hunter Association.",statChanges:{intelligence:8,aura:5},experience:100,reputation:{tactical:+2,visionary:+2},unlocks:["Election Preparation"]}]},{title:"Special Branch: Killua, Alluka, and Gon",text:"If your relationship with Killua is high, you can join him in rescuing Alluka to heal Gon. This branch leads directly into the 13th Hunter Chairman Election Arc.",choices:[{text:"Help Killua rescue Alluka and heal Gon",action:"alluka_rescue",consequences:"You and Killua defy the Zoldyck family, risking everything to save Gon.",statChanges:{strength:8,speed:8,intelligence:6,aura:10,health:-30},experience:300,reputation:{heroic:+5,family_enemy:+3},allies:["Killua Zoldyck","Alluka Zoldyck","Gon Freecss"],enemies:["Zoldyck Family"],unlocks:["Alluka's Power","Gon's Recovery","Election Arc Branch"]},{text:"Let Killua go alone",action:"let_killua_alone",consequences:"You trust Killua to handle Alluka's rescue. The outcome is uncertain.",statChanges:{intelligence:4,aura:3},experience:80,reputation:{independent:+2,cautious:+2},unlocks:["Election Arc Branch"]}]},{title:"Epilogue: The Election Approaches",text:"With the King defeated and Gon healed (if you helped Killua), the Hunter Association prepares for the 13th Chairman Election. Your actions in the Chimera Ant Arc will influence the next saga.",choices:[{text:"Step forward as a candidate for Chairman",action:"candidate_chairman",consequences:"You throw your hat into the ring for the most powerful position in the Hunter world.",statChanges:{intelligence:10,aura:8,strength:5},experience:200,reputation:{leader:+4,ambitious:+3},unlocks:["Election Candidate"]},{text:"Support Killua, Gon, or Leorio in the election",action:"support_friends_election",consequences:"You back your friends, shaping the future of the Association.",statChanges:{intelligence:6,aura:5},experience:120,reputation:{supportive:+3,loyal:+3},unlocks:["Election Supporter"]},{text:"Withdraw from politics and rest",action:"withdraw_politics",consequences:"You choose to rest after the long crisis, letting others fight for power.",statChanges:{health:30,aura:3},experience:80,reputation:{neutral:+2,peaceful:+2},unlocks:["Rested for Next Arc"]}]}],completion_rewards:{skillPoints:120,experience:2500,title:"Chimera Ant Hero",unlocks:["Anti-Chimera Techniques","Royal Guard Knowledge","King's Power","Alluka's Blessing","Election Arc Branch"]}},darkContinentExpedition:{title:"Beyond the Known World",description:"Venture into the forbidden Dark Continent where the impossible becomes reality",unlocked:false,unlock_requirement:{level:45,hatsuMastery:80,greedIslandCompleted:true},chapters:[{title:"The Gatekeeper's Trial",text:"At the edge of the known world, an ancient entity tests those who would enter the Dark Continent. Your demonstration of worthiness shapes what awaits you beyond.",choices:[{text:"Demonstrate perfect Nen mastery",action:"perfect_nen_demonstration",consequences:"Impress the gatekeeper but exhaust yourself",statChanges:{aura:15,intelligence:8,maxAura:-30},experience:150,reputation:{master:+5,amateur:-3},unlocks:["Gatekeeper's Blessing","Ancient Nen Secrets"]},{text:"Show courage through direct challenge",action:"challenge_gatekeeper",consequences:"Dangerous but proves your determination",statChanges:{strength:10,health:-50,maxHealth:50},experience:180,reputation:{brave:+5,cautious:-3},battle_trigger:"Ancient Gatekeeper"},{text:"Offer service in exchange for passage",action:"service_for_passage",consequences:"Gain safe passage but owe future favors",statChanges:{intelligence:6,aura:5},experience:120,reputation:{diplomatic:+3,prideful:-2},future_obligation:"Gatekeeper's Debt"}]},{title:"The Impossible Ecosystem",text:"You've entered regions where the laws of nature don't apply. Creatures that shouldn't exist roam freely, and reality itself seems malleable.",choices:[{text:"Study and catalog the anomalies",action:"study_anomalies",consequences:"Gain incredible knowledge but risk mental breakdown",statChanges:{intelligence:15,aura:10,maxHealth:-40},experience:300,reputation:{scholar:+5,practical:-2},unlocks:["Reality Manipulation Theory","Anomaly Catalog"],sanity_check:true},{text:"Hunt the apex predators",action:"hunt_apex_predators",consequences:"Extreme danger but unparalleled power gains",statChanges:{strength:20,speed:15,health:-80},experience:400,reputation:{apex_hunter:+6,cautious:-4},battle_trigger:"Impossible Creature",special_reward:"Apex Predator Powers"},{text:"Seek the source of anomalies",action:"seek_anomaly_source",consequences:"Dangerous quest to understand the continent's nature",statChanges:{intelligence:12,aura:15},experience:350,reputation:{seeker:+4,content:-2},unlocks:["Dark Continent Mysteries","Reality Core Access"]}]}],completion_rewards:{skillPoints:100,experience:2000,title:"Dark Continent Explorer",unlocks:["Reality Manipulation","Impossible Abilities","Continental Authority"]}},chairmanElection:{title:"13th Hunter Chairman Election",description:"Navigate the political chaos following Chairman Netero's death",unlocked:false,unlock_requirement:{level:35,chimeraAntCompleted:true},chapters:[{title:"The Power Vacuum",text:"Chairman Netero's death has left the Hunter Association in chaos. The Zodiac Twelve struggle to maintain order as various factions vie for power. Ging Freecss has disappeared, and you find yourself caught in the middle of political intrigue.",choices:[{text:"Support Cheadle Yorkshire for Chairman",action:"support_cheadle",consequences:"Back the steady, diplomatic candidate",statChanges:{intelligence:5,aura:3,maxHealth:15},experience:120,reputation:{diplomatic:+4,conservative:+2},allies:["Cheadle Yorkshire","Zodiac Moderates"],unlocks:["Political Influence","Diplomatic Immunity"]},{text:"Rally behind Pariston Hill's faction",action:"support_pariston",consequences:"Join the charismatic but dangerous manipulator",statChanges:{intelligence:6,aura:4,health:-20},experience:140,reputation:{manipulative:+5,dangerous:+3},allies:["Pariston Hill","Temp Hunters"],unlocks:["Manipulation Mastery","Political Schemes"]},{text:"Seek out Ging Freecss independently",action:"seek_ging",consequences:"Try to find the legendary hunter on your own",statChanges:{intelligence:4,speed:5,aura:3},experience:100,reputation:{independent:+4,adventurous:+3},unlocks:["Ging's Trail","Independent Hunter"]}]},{title:"The Election Debates",text:"The Zodiac Twelve hold public debates to determine the next Chairman. Each candidate presents their vision for the Association's future. Behind the scenes, deals are made and alliances form. Your support could sway the election.",choices:[{text:"Expose Pariston's secret agenda publicly",action:"expose_pariston",consequences:"Reveal his true plans but make a dangerous enemy",statChanges:{intelligence:8,aura:5,health:-30},experience:160,reputation:{truth_seeker:+5,enemy_maker:+4},enemies:["Pariston Hill"],unlocks:["Whistleblower","Truth Revelation"]},{text:"Propose election reforms to prevent corruption",action:"propose_reforms",consequences:"Attempt to change the system from within",statChanges:{intelligence:7,aura:4,maxHealth:20},experience:140,reputation:{reformer:+4,idealistic:+3},unlocks:["Election Reform","Systematic Change"]},{text:"Work in the shadows to influence votes",action:"shadow_influence",consequences:"Use underhanded tactics to sway the election",statChanges:{intelligence:6,speed:4,aura:3},experience:130,reputation:{manipulative:+4,shadow_worker:+3},unlocks:["Shadow Politics","Vote Manipulation"]}]},{title:"The Alluka Crisis",text:"Killua's sister Alluka possesses the dangerous power of Nanika, an entity from the Dark Continent. The Zoldyck family is in turmoil, and this power could reshape the world. Your involvement in this family crisis will have far-reaching consequences.",choices:[{text:"Help Killua protect Alluka",action:"protect_alluka",consequences:"Stand against the Zoldyck family's traditions",statChanges:{strength:6,speed:8,health:-40},experience:180,reputation:{protective:+5,family_enemy:+3},allies:["Killua Zoldyck","Alluka Zoldyck"],enemies:["Zoldyck Family"],unlocks:["Alluka's Power","Family Rebellion"]},{text:"Study Nanika's Dark Continent origins",action:"study_nanika",consequences:"Research the entity's true nature and powers",statChanges:{intelligence:10,aura:8,health:-30},experience:200,reputation:{scholar:+5,dangerous_knowledge:+4},unlocks:["Dark Continent Entity","Nanika's Truth"]},{text:"Attempt to control Nanika's power",action:"control_nanika",consequences:"Try to harness the entity's incredible abilities",statChanges:{intelligence:8,aura:12,health:-60},experience:220,reputation:{power_seeker:+6,reckless:+4},unlocks:["Nanika Control","Entity Manipulation"],survival_chance:0.6}]},{title:"The Final Vote",text:"The election reaches its climax as the final vote approaches. Leorio's passionate speech about friendship and idealism has stirred the Hunter community. The outcome will determine not just the next Chairman, but the soul of the Hunter Association.",choices:[{text:"Rally support for Leorio's idealistic vision",action:"support_leorio",consequences:"Champion friendship and idealism over politics",statChanges:{intelligence:5,aura:6,maxHealth:30},experience:150,reputation:{idealistic:+5,inspiring:+4},allies:["Leorio Paradinight","Idealistic Hunters"],unlocks:["Friendship Power","Idealistic Leadership"]},{text:"Ensure Ging becomes Chairman",action:"support_ging",consequences:"Back the most qualified but reluctant candidate",statChanges:{intelligence:6,aura:5,speed:4},experience:170,reputation:{pragmatic:+4,ging_ally:+3},allies:["Ging Freecss"],unlocks:["Ging's Secrets","Ancient Hunter Knowledge"]},{text:"Accept whatever outcome emerges naturally",action:"accept_outcome",consequences:"Let democracy take its course without interference",statChanges:{intelligence:4,aura:3,maxHealth:20},experience:120,reputation:{neutral:+3,democratic:+2},unlocks:["Democratic Process","Natural Order"]}]},{title:"The New Era Begins",text:"The election concludes and a new Chairman takes office. The Hunter Association enters a new era, shaped by the choices made during this turbulent time. Your role in these events will be remembered, and new opportunities await.",choices:[{text:"Join the new Chairman's inner circle",action:"join_inner_circle",consequences:"Become part of the Association's new leadership",statChanges:{intelligence:8,aura:6,maxHealth:25},experience:200,reputation:{influential:+5,establishment:+4},unlocks:["Inner Circle Access","Association Leadership"]},{text:"Maintain independence while supporting reforms",action:"independent_support",consequences:"Support change while keeping your freedom",statChanges:{intelligence:6,aura:4,speed:3},experience:160,reputation:{independent:+4,supportive:+3},unlocks:["Independent Authority","Reform Support"]},{text:"Focus on preparing for future Dark Continent threats",action:"prepare_dark_continent",consequences:"Begin preparing for the ultimate challenge ahead",statChanges:{intelligence:10,aura:8,strength:5},experience:240,reputation:{visionary:+5,prepared:+4},unlocks:["Dark Continent Preparation","Future Threat Analysis"]}]}],completion_rewards:{skillPoints:70,experience:1200,title:"Political Survivor",unlocks:["Association Authority","Political Mastery","Election Influence"]}},successionWar:{title:"Kakin Succession War",description:"Navigate the deadly succession war aboard the Black Whale ship",unlocked:false,unlock_requirement:{level:40,chairmanElectionCompleted:true},chapters:[{title:"The Black Whale Departure",text:"The massive ship Black Whale embarks toward the Dark Continent, carrying the Kakin royal family and their deadly succession war. Fourteen princes compete for the throne, each with their own Guardian Spirit Beast and loyal followers. You board as tensions reach a breaking point.",choices:[{text:"Ally with Prince Woble and Queen Oito",action:"ally_woble",consequences:"Protect the infant prince and his mother",statChanges:{intelligence:6,aura:5,maxHealth:20},experience:140,reputation:{protective:+5,royal_ally:+3},allies:["Queen Oito","Prince Woble"],unlocks:["Royal Protection","Succession Knowledge"]},{text:"Serve Prince Benjamin's military faction",action:"serve_benjamin",consequences:"Join the militaristic first prince's forces",statChanges:{strength:8,speed:6,aura:4},experience:160,reputation:{military:+5,authoritarian:+3},allies:["Prince Benjamin","Military Faction"],unlocks:["Military Hierarchy","Combat Authority"]},{text:"Investigate the Guardian Spirit Beasts",action:"investigate_spirits",consequences:"Research the mysterious creatures bonded to each prince",statChanges:{intelligence:10,aura:8,health:-30},experience:180,reputation:{researcher:+5,dangerous_knowledge:+4},unlocks:["Spirit Beast Knowledge","Guardian Secrets"]}]},{title:"The Phantom Troupe Infiltration",text:"The Phantom Troupe has infiltrated the Black Whale, seeking to steal the royal treasures. Their presence adds another layer of danger to the already volatile succession war. Hisoka is also aboard, hunting the Troupe members.",choices:[{text:"Hunt the Phantom Troupe with Hisoka",action:"hunt_with_hisoka",consequences:"Partner with the dangerous magician",statChanges:{strength:10,speed:8,health:-40},experience:200,reputation:{hunter:+5,dangerous_ally:+4},allies:["Hisoka Morow"],enemies:["Phantom Troupe"],unlocks:["Hisoka's Techniques","Troupe Hunter"]},{text:"Warn the Troupe about Hisoka's presence",action:"warn_troupe",consequences:"Gain the Troupe's temporary trust",statChanges:{intelligence:8,aura:6,speed:5},experience:170,reputation:{criminal:+4,informant:+3},allies:["Phantom Troupe"],enemies:["Hisoka Morow"],unlocks:["Troupe Alliance","Criminal Network"]},{text:"Stay neutral and observe the conflict",action:"observe_conflict",consequences:"Gather intelligence on both sides",statChanges:{intelligence:12,aura:4,speed:3},experience:150,reputation:{neutral:+3,observant:+4},unlocks:["Conflict Analysis","Intelligence Network"]}]},{title:"The Mafia Families' War",text:"The ship's lower decks erupt into violence as the three major mafia families - Cha-R, Heil-Ly, and Xi-Yu - begin their own war. Their conflict threatens to tear the ship apart from within while the princes' succession war continues above.",choices:[{text:"Ally with the Xi-Yu family",action:"ally_xi_yu",consequences:"Join the most traditional and honorable family",statChanges:{strength:7,intelligence:5,aura:6},experience:160,reputation:{traditional:+4,honorable:+3},allies:["Xi-Yu Family"],unlocks:["Mafia Honor","Traditional Combat"]},{text:"Support the Cha-R family's modernization",action:"support_cha_r",consequences:"Help the family embrace new methods",statChanges:{intelligence:8,aura:7,speed:4},experience:180,reputation:{modern:+4,progressive:+3},allies:["Cha-R Family"],unlocks:["Modern Warfare","Progressive Tactics"]},{text:"Eliminate all three families",action:"eliminate_families",consequences:"Attempt to end the mafia war through force",statChanges:{strength:12,speed:10,health:-60},experience:220,reputation:{eliminator:+6,peace_maker:+4},unlocks:["Mafia Destroyer","Peace Through Strength"],survival_chance:0.5}]},{title:"The Succession Ceremony",text:"The final succession ceremony begins as the surviving princes gather. The Guardian Spirit Beasts become more active, and the true nature of the succession war is revealed. Only one prince can survive to claim the throne.",choices:[{text:"Protect your chosen prince to the end",action:"protect_chosen_prince",consequences:"Ensure your ally survives the final confrontation",statChanges:{strength:10,aura:8,health:-50},experience:250,reputation:{loyal:+6,protector:+5},unlocks:["Royal Loyalty","Ultimate Protection"]},{text:"Attempt to break the succession war's rules",action:"break_succession_rules",consequences:"Try to end the war without a single victor",statChanges:{intelligence:15,aura:12,health:-70},experience:300,reputation:{rule_breaker:+6,revolutionary:+5},unlocks:["System Breaker","Revolutionary Change"],survival_chance:0.4},{text:"Claim the throne for yourself",action:"claim_throne",consequences:"Attempt to seize royal power",statChanges:{strength:15,intelligence:12,aura:15,health:-80},experience:350,reputation:{usurper:+7,ambitious:+6},unlocks:["Royal Usurper","Throne Claimer"],survival_chance:0.3}]},{title:"The Dark Continent Approach",text:"As the Black Whale nears the Dark Continent, the true horrors of the forbidden realm become apparent. The succession war has ended, but new threats await. Your choices have determined your position for the ultimate challenge ahead.",choices:[{text:"Prepare the survivors for Dark Continent threats",action:"prepare_survivors",consequences:"Use your knowledge to help humanity survive",statChanges:{intelligence:10,aura:8,maxHealth:40},experience:280,reputation:{leader:+5,savior:+4},unlocks:["Survival Leadership","Dark Continent Readiness"]},{text:"Seek to control the Dark Continent's power",action:"control_dark_power",consequences:"Attempt to harness the continent's dangers",statChanges:{intelligence:12,aura:15,health:-60},experience:320,reputation:{power_seeker:+6,dangerous:+5},unlocks:["Dark Power Control","Continental Mastery"],survival_chance:0.6},{text:"Document everything for future generations",action:"document_everything",consequences:"Preserve knowledge of the journey and war",statChanges:{intelligence:15,aura:6,maxHealth:30},experience:260,reputation:{chronicler:+5,wise:+4},unlocks:["Historical Record","Knowledge Preservation"]}]}],completion_rewards:{skillPoints:90,experience:1800,title:"War Survivor",unlocks:["Royal Authority","Succession Knowledge","Dark Continent Preparation"]}}};// Story Choice Consequence System var consequenceSystem={reputation:{heroic:0,criminal:0,methodical:0,reckless:0,leader:0,follower:0,independent:0,diplomatic:0,fearless:0,cautious:0,scholar:0,hunter:0},allies:[],enemies:[],obligations:[],unlocked_paths:[],moral_alignment:0,// -100 (evil) to +100 (good) items:[],titles:[]};// Story Chapters - Hunter Exam Stages (Legacy compatibility) 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 // Dynamic boss/enemy/friend scaling and relationship detail as story arcs progress // Helper to get current arc and chapter for scaling function getCurrentArcKeyAndChapter(){var arcKey=storyProgress.currentArc;var chapter=storyProgress.currentChapter||0;// If not in an arc, fallback to completed arcs for scaling if(!arcKey&&storyProgress.completedArcs.length>0){arcKey=storyProgress.completedArcs[storyProgress.completedArcs.length-1];chapter=storyArcs[arcKey]&&storyArcs[arcKey].chapters?storyArcs[arcKey].chapters.length-1:0;}return{arcKey:arcKey,chapter:chapter};}// Relationship map for major characters (for Dossier and scaling) var characterRelations={"Gon Freecss":{friends:["Killua Zoldyck","Kurapika Kurta","Leorio Paradinight"],rivals:["Hisoka Morow"],enemies:["Chimera Ants","Genthru (The Bomber)","Meruem (The King)"]},"Killua Zoldyck":{friends:["Gon Freecss","Alluka Zoldyck"],rivals:["Illumi Zoldyck","Hisoka Morow"],enemies:["Chimera Ants","Phantom Troupe"]},"Kurapika Kurta":{friends:["Leorio Paradinight","Gon Freecss"],rivals:["Chrollo Lucilfer"],enemies:["Phantom Troupe","Uvogin"]},"Hisoka Morow":{friends:[],rivals:["Chrollo Lucilfer","Gon Freecss","Killua Zoldyck"],enemies:["Phantom Troupe"]},"Chrollo Lucilfer":{friends:["Phantom Troupe"],rivals:["Hisoka Morow","Kurapika Kurta"],enemies:["Kurapika Kurta","Zoldyck Family"]},"Meruem (The King)":{friends:["Komugi"],rivals:["Netero"],enemies:["Hunters","Netero","You"]},"Ging Freecss":{friends:["Kite","Gon Freecss"],rivals:["Pariston Hill"],enemies:["Unknown"]},"Isaac Netero":{friends:["Zeno Zoldyck","Hunters"],rivals:["Meruem (The King)"],enemies:["Chimera Ants","Meruem (The King)"]},"Zeno Zoldyck":{friends:["Silva Zoldyck","Isaac Netero"],rivals:["Chrollo Lucilfer"],enemies:["Phantom Troupe"]},"Silva Zoldyck":{friends:["Zeno Zoldyck","Killua Zoldyck"],rivals:["Chrollo Lucilfer"],enemies:["Phantom Troupe"]}// ... add more as needed };// Dynamic boss stats by arc/chapter function getBossStats(base,arcKey,chapter){// Scaling removed: bosses always use their base stats, regardless of arc/chapter var stats={};for(var k in base.stats){stats[k]=base.stats[k];}return{name:base.name,level:base.level,health:base.health,maxHealth:base.maxHealth,stats:stats,abilities:base.abilities,hatsu:base.hatsu,reward:base.reward};}// Bosses with dynamic scaling var bosses={gon:{name:"Gon Freecss",level:25,health:1200,maxHealth:1200,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!"}},kurapika:{name:"Kurapika Kurta",level:35,health:1500,maxHealth:1500,stats:{strength:28,speed:30,intelligence:45,aura:40},abilities:["Chain Jail","Holy Chain","Dowsing Chain","Judgment Chain","Emperor Time"],hatsu:{name:"Chain Jail",auraRequired:45,description:"Kurapika's deadly chains that can instantly defeat Phantom Troupe members"},reward:{experience:300,skillPoints:15,unlockMessage:"You've witnessed the power of the Kurta Clan's vengeance!"}},killua:{name:"Killua Zoldyck",level:30,health:1100,maxHealth:1100,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:2000,maxHealth:2000,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:1800,maxHealth:1800,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!"}},// --- NEW BOSSES ADDED BELOW --- uvogin:{name:"Uvogin",level:38,health:1700,maxHealth:1700,stats:{strength:60,speed:22,intelligence:15,aura:35},abilities:["Big Bang Impact","Roar","Super Regeneration"],hatsu:{name:"Big Bang Impact",auraRequired:50,description:"A single punch with the force of a missile"},reward:{experience:320,skillPoints:14,unlockMessage:"You survived Uvogin's overwhelming power!"}},feitan:{name:"Feitan Portor",level:40,health:1400,maxHealth:1400,stats:{strength:38,speed:45,intelligence:30,aura:40},abilities:["Pain Packer","Rising Sun"],hatsu:{name:"Pain Packer",auraRequired:45,description:"Transforms pain into a devastating counterattack."},reward:{experience:350,skillPoints:16,unlockMessage:"You endured Feitan's torture and survived!"}},phinks:{name:"Phinks Magcub",level:36,health:1350,maxHealth:1350,stats:{strength:50,speed:30,intelligence:20,aura:32},abilities:["Ripper Cyclotron"],hatsu:{name:"Ripper Cyclotron",auraRequired:40,description:"Winds up his arm to deliver a massive punch."},reward:{experience:300,skillPoints:13,unlockMessage:"You survived Phinks' spinning punch!"}},shizuku:{name:"Shizuku Murasaki",level:34,health:1200,maxHealth:1200,stats:{strength:22,speed:28,intelligence:35,aura:30},abilities:["Blinky","Vacuum Clean"],hatsu:{name:"Blinky",auraRequired:30,description:"A conjured vacuum that can suck up anything except living things."},reward:{experience:250,skillPoints:11,unlockMessage:"You outsmarted Shizuku's Blinky!"}},machi:{name:"Machi Komacine",level:37,health:1250,maxHealth:1250,stats:{strength:32,speed:40,intelligence:28,aura:34},abilities:["Nen Stitches","Superhuman Strength"],hatsu:{name:"Nen Stitches",auraRequired:35,description:"Uses nen threads to heal or immobilize."},reward:{experience:270,skillPoints:12,unlockMessage:"You escaped Machi's nen threads!"}},neferpitou:{name:"Neferpitou",level:55,health:3200,maxHealth:3200,stats:{strength:55,speed:60,intelligence:40,aura:65},abilities:["Terpsichora","Doctor Blythe","Puppeteer"],hatsu:{name:"Terpsichora",auraRequired:60,description:"Posthumous manipulation that enhances all abilities"},reward:{experience:600,skillPoints:28,unlockMessage:"You faced the Royal Guard's terrifying power!"}},razor:{name:"Razor",level:45,health:2500,maxHealth:2500,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 Razor's deadly game!"}},genthru:{name:"Genthru (The Bomber)",level:50,health:2800,maxHealth:2800,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!"}},meruem:{name:"Meruem (The King)",level:60,health:5000,maxHealth:5000,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!"}},// --- NEW BOSSES ADDED: Ging, Netero, Zeno, Silva --- ging:{name:"Ging Freecss",level:55,health:3200,maxHealth:3200,stats:{strength:48,speed:52,intelligence:90,aura:65},abilities:["Unknown Hatsu","Genius Tactics","Unpredictable"],hatsu:{name:"Secret Technique",auraRequired:55,description:"Ging's Hatsu is a mystery, but it's always one step ahead."},reward:{experience:700,skillPoints:32,unlockMessage:"You've witnessed the genius of Ging Freecss!"}},netero:{name:"Isaac Netero",level:65,health:4200,maxHealth:4200,stats:{strength:60,speed:80,intelligence:70,aura:90},abilities:["100-Type Guanyin Bodhisattva","Zero Hand","Ultimate Speed"],hatsu:{name:"100-Type Guanyin Bodhisattva",auraRequired:80,description:"Netero's ultimate enhancement: a giant Bodhisattva statue for devastating attacks."},reward:{experience:1200,skillPoints:60,unlockMessage:"You survived the might of the Chairman!"}},zeno:{name:"Zeno Zoldyck",level:50,health:2600,maxHealth:2600,stats:{strength:42,speed:55,intelligence:65,aura:60},abilities:["Dragon Dive","Assassin Mastery"],hatsu:{name:"Dragon Dive",auraRequired:50,description:"Summon a dragon-shaped aura for a rain of destruction."},reward:{experience:600,skillPoints:28,unlockMessage:"You've learned from the Zoldyck patriarch!"}},silva:{name:"Silva Zoldyck",level:52,health:2800,maxHealth:2800,stats:{strength:55,speed:50,intelligence:55,aura:65},abilities:["Aura Bomb","Assassin Arts"],hatsu:{name:"Aura Bomb",auraRequired:55,description:"Silva concentrates his aura into a massive destructive sphere."},reward:{experience:650,skillPoints:30,unlockMessage:"You've survived Silva's overwhelming power!"}},// --- EVEN MORE BOSSES ADDED TO EACH GROUP --- kalluto:{name:"Kalluto Zoldyck",level:28,health:900,maxHealth:900,stats:{strength:18,speed:32,intelligence:40,aura:28},abilities:["Paper Manipulation","Stealth"],hatsu:{name:"Paper Dance",auraRequired:28,description:"Manipulate paper for offense and defense."},reward:{experience:180,skillPoints:8,unlockMessage:"You outmaneuvered Kalluto's paper techniques!"}},milluki:{name:"Milluki Zoldyck",level:22,health:800,maxHealth:800,stats:{strength:12,speed:10,intelligence:38,aura:20},abilities:["Tech Genius","Poison"],hatsu:{name:"Poison Hack",auraRequired:20,description:"Uses technology and poison for indirect attacks."},reward:{experience:120,skillPoints:6,unlockMessage:"You survived Milluki's poison and gadgets!"}},shalnark:{name:"Shalnark",level:33,health:1100,maxHealth:1100,stats:{strength:20,speed:30,intelligence:45,aura:32},abilities:["Autopilot","Manipulation"],hatsu:{name:"Black Voice",auraRequired:32,description:"Control others with antennae."},reward:{experience:220,skillPoints:10,unlockMessage:"You resisted Shalnark's Black Voice!"}},franklin:{name:"Franklin Bordeau",level:39,health:1600,maxHealth:1600,stats:{strength:55,speed:20,intelligence:22,aura:38},abilities:["Double Machine Gun"],hatsu:{name:"Double Machine Gun",auraRequired:38,description:"Fires aura bullets from fingers."},reward:{experience:300,skillPoints:13,unlockMessage:"You survived Franklin's hail of aura bullets!"}},nobunaga:{name:"Nobunaga Hazama",level:35,health:1300,maxHealth:1300,stats:{strength:40,speed:28,intelligence:25,aura:30},abilities:["Iaido","Sword Mastery"],hatsu:{name:"Circle Defense",auraRequired:30,description:"Deadly swordsmanship and aura zone."},reward:{experience:250,skillPoints:11,unlockMessage:"You survived Nobunaga's sword draw!"}},pakunoda:{name:"Pakunoda",level:32,health:1000,maxHealth:1000,stats:{strength:18,speed:22,intelligence:48,aura:28},abilities:["Memory Reading","Questioning"],hatsu:{name:"Memory Bomb",auraRequired:28,description:"Reads and shares memories with a touch."},reward:{experience:200,skillPoints:9,unlockMessage:"You resisted Pakunoda's memory reading!"}},bonolenov:{name:"Bonolenov Ndongo",level:34,health:1200,maxHealth:1200,stats:{strength:28,speed:30,intelligence:30,aura:32},abilities:["Battle Cantabile"],hatsu:{name:"Battle Cantabile",auraRequired:32,description:"Plays music for powerful effects."},reward:{experience:210,skillPoints:10,unlockMessage:"You endured Bonolenov's battle music!"}},kortopi:{name:"Kortopi",level:30,health:900,maxHealth:900,stats:{strength:10,speed:18,intelligence:40,aura:25},abilities:["Gallery Fake"],hatsu:{name:"Gallery Fake",auraRequired:25,description:"Creates perfect copies of objects."},reward:{experience:160,skillPoints:7,unlockMessage:"You saw through Kortopi's fakes!"}},komugi:{name:"Komugi",level:20,health:500,maxHealth:500,stats:{strength:5,speed:8,intelligence:100,aura:10},abilities:["Gungi Master"],hatsu:{name:"Gungi Genius",auraRequired:10,description:"Unbeatable in Gungi, inspires Nen users."},reward:{experience:100,skillPoints:5,unlockMessage:"You learned from Komugi's genius!"}},morel:{name:"Morel Mackernasey",level:44,health:2000,maxHealth:2000,stats:{strength:38,speed:32,intelligence:55,aura:48},abilities:["Deep Purple","Smoke Trooper"],hatsu:{name:"Deep Purple",auraRequired:48,description:"Manipulates smoke for offense and defense."},reward:{experience:400,skillPoints:18,unlockMessage:"You dispersed Morel's smoke army!"}},knuckle:{name:"Knuckle Bine",level:40,health:1500,maxHealth:1500,stats:{strength:35,speed:30,intelligence:30,aura:40},abilities:["Hakoware","APR"],hatsu:{name:"Hakoware",auraRequired:40,description:"Attaches an aura counter to drain enemy aura."},reward:{experience:320,skillPoints:14,unlockMessage:"You survived Knuckle's APR!"}},shoot:{name:"Shoot McMahon",level:39,health:1400,maxHealth:1400,stats:{strength:28,speed:32,intelligence:38,aura:36},abilities:["Floating Hands"],hatsu:{name:"Floating Hands",auraRequired:36,description:"Detaches hands for ranged attacks."},reward:{experience:310,skillPoints:13,unlockMessage:"You dodged Shoot's floating hands!"}},colt:{name:"Colt (Chimera Ant)",level:28,health:900,maxHealth:900,stats:{strength:22,speed:24,intelligence:28,aura:22},abilities:["Flight","Loyalty"],hatsu:{name:"Chimera Ant Loyalty",auraRequired:22,description:"Fights fiercely to protect the Queen."},reward:{experience:150,skillPoints:7,unlockMessage:"You earned Colt's respect!"}},cheetu:{name:"Cheetu (Chimera Ant)",level:36,health:1200,maxHealth:1200,stats:{strength:28,speed:80,intelligence:18,aura:30},abilities:["Super Speed","Game Creation"],hatsu:{name:"Speed Game",auraRequired:30,description:"Creates a game where only speed matters."},reward:{experience:220,skillPoints:10,unlockMessage:"You caught Cheetu!"}},leol:{name:"Leol (Chimera Ant)",level:38,health:1300,maxHealth:1300,stats:{strength:32,speed:28,intelligence:30,aura:34},abilities:["Rental Pod"],hatsu:{name:"Rental Pod",auraRequired:34,description:"Borrows abilities from others."},reward:{experience:230,skillPoints:11,unlockMessage:"You outlasted Leol's borrowed power!"}},biscuit:{name:"Biscuit Krueger",level:42,health:1800,maxHealth:1800,stats:{strength:60,speed:40,intelligence:60,aura:50},abilities:["Muscle Form","Transformation"],hatsu:{name:"True Form",auraRequired:50,description:"Transforms into a muscular powerhouse."},reward:{experience:350,skillPoints:16,unlockMessage:"You survived Biscuit's true form!"}},wing:{name:"Wing",level:25,health:900,maxHealth:900,stats:{strength:20,speed:18,intelligence:40,aura:28},abilities:["Nen Teacher"],hatsu:{name:"Nen Guidance",auraRequired:28,description:"Boosts Nen learning and defense."},reward:{experience:120,skillPoints:6,unlockMessage:"You learned from Wing's Nen lessons!"}},// --- EVEN MORE BOSSES FROM HUNTER X HUNTER, ANIME, MANGA, AND BEYOND --- pariston:{name:"Pariston Hill",level:48,health:2100,maxHealth:2100,stats:{strength:30,speed:35,intelligence:80,aura:55},abilities:["Manipulation","Political Schemes"],hatsu:{name:"Smile Manipulation",auraRequired:40,description:"Manipulates the mood and actions of others with a smile."},reward:{experience:400,skillPoints:18,unlockMessage:"You outwitted Pariston's schemes!"}},cheadle:{name:"Cheadle Yorkshire",level:46,health:2000,maxHealth:2000,stats:{strength:28,speed:32,intelligence:85,aura:50},abilities:["Medical Nen","Zodiac Strategy"],hatsu:{name:"Medical Guidance",auraRequired:38,description:"Heals and buffs allies, can debuff enemies."},reward:{experience:380,skillPoints:17,unlockMessage:"You survived Cheadle's medical tactics!"}},leorio:{name:"Leorio Paradinight",level:32,health:1200,maxHealth:1200,stats:{strength:20,speed:18,intelligence:40,aura:28},abilities:["Medical Punch","Nen Transmission"],hatsu:{name:"Remote Punch",auraRequired:30,description:"Punches from a distance using emission."},reward:{experience:200,skillPoints:9,unlockMessage:"You learned from Leorio's resolve!"}},gotoh:{name:"Gotoh",level:30,health:1100,maxHealth:1100,stats:{strength:22,speed:30,intelligence:28,aura:25},abilities:["Coin Flicker"],hatsu:{name:"Coin Flicker",auraRequired:25,description:"Deadly coin-based emission attack."},reward:{experience:160,skillPoints:7,unlockMessage:"You dodged Gotoh's coins!"}},hanzo:{name:"Hanzo",level:28,health:950,maxHealth:950,stats:{strength:24,speed:32,intelligence:30,aura:22},abilities:["Ninja Arts"],hatsu:{name:"Shadow Clone",auraRequired:22,description:"Creates shadow clones for deception and attack."},reward:{experience:150,skillPoints:6,unlockMessage:"You survived Hanzo's ninja skills!"}},beyond:{name:"Beyond Netero",level:60,health:4000,maxHealth:4000,stats:{strength:65,speed:60,intelligence:85,aura:80},abilities:["Dark Continent Explorer","Unknown Nen"],hatsu:{name:"Forbidden Power",auraRequired:70,description:"Mysterious Nen from the Dark Continent."},reward:{experience:1200,skillPoints:55,unlockMessage:"You faced Beyond Netero's ambition!"}},alluka:{name:"Alluka Zoldyck",level:20,health:600,maxHealth:600,stats:{strength:5,speed:10,intelligence:60,aura:100},abilities:["Wish Granting"],hatsu:{name:"Nanika",auraRequired:100,description:"Grants wishes at a terrible cost."},reward:{experience:300,skillPoints:15,unlockMessage:"You survived Alluka's wish!"}},nanika:{name:"Nanika",level:99,health:9999,maxHealth:9999,stats:{strength:0,speed:0,intelligence:999,aura:999},abilities:["Reality Warp"],hatsu:{name:"Wish Curse",auraRequired:999,description:"Can grant or destroy anything."},reward:{experience:9999,skillPoints:99,unlockMessage:"You survived the impossible!"}},kite:{name:"Kite",level:38,health:1300,maxHealth:1300,stats:{strength:32,speed:34,intelligence:50,aura:36},abilities:["Crazy Slots"],hatsu:{name:"Crazy Slots",auraRequired:36,description:"Random weapon conjuration."},reward:{experience:230,skillPoints:11,unlockMessage:"You survived Kite's random weapon!"}},pouf:{name:"Shaiapouf",level:54,health:3000,maxHealth:3000,stats:{strength:40,speed:60,intelligence:70,aura:60},abilities:["Spiritual Message","Metamorphosis"],hatsu:{name:"Spiritual Message",auraRequired:60,description:"Manipulates emotions and thoughts."},reward:{experience:550,skillPoints:25,unlockMessage:"You resisted Pouf's manipulation!"}},youpi:{name:"Menthuthuyoupi",level:56,health:3500,maxHealth:3500,stats:{strength:70,speed:55,intelligence:30,aura:65},abilities:["Rage Transformation"],hatsu:{name:"Rage Form",auraRequired:65,description:"Transforms to increase power as anger rises."},reward:{experience:600,skillPoints:27,unlockMessage:"You survived Youpi's rage!"}},queen_ant:{name:"Chimera Ant Queen",level:50,health:4000,maxHealth:4000,stats:{strength:60,speed:30,intelligence:40,aura:60},abilities:["Birth Army"],hatsu:{name:"Royal Command",auraRequired:60,description:"Commands all Chimera Ants."},reward:{experience:800,skillPoints:35,unlockMessage:"You survived the Queen's nest!"}},beyond_hxh:{name:"Don Freecss",level:99,health:9999,maxHealth:9999,stats:{strength:99,speed:99,intelligence:99,aura:99},abilities:["Unknown"],hatsu:{name:"Unknown",auraRequired:99,description:"The original explorer of the Dark Continent."},reward:{experience:9999,skillPoints:99,unlockMessage:"You met the legendary Don Freecss!"}},// Fun/bonus/other anime bosses goku:{name:"Goku (Dragon Ball)",level:100,health:10000,maxHealth:10000,stats:{strength:999,speed:999,intelligence:80,aura:999},abilities:["Kamehameha","Ultra Instinct"],hatsu:{name:"Ultra Instinct",auraRequired:999,description:"Moves and attacks without thinking."},reward:{experience:9999,skillPoints:99,unlockMessage:"You survived Goku's power!"}},naruto:{name:"Naruto Uzumaki",level:80,health:8000,maxHealth:8000,stats:{strength:500,speed:600,intelligence:200,aura:800},abilities:["Shadow Clone","Rasengan"],hatsu:{name:"Kurama Mode",auraRequired:800,description:"Unleashes the power of the Nine-Tails."},reward:{experience:8000,skillPoints:80,unlockMessage:"You survived Naruto's ninja way!"}},saitama:{name:"Saitama (One Punch Man)",level:999,health:99999,maxHealth:99999,stats:{strength:9999,speed:9999,intelligence:100,aura:9999},abilities:["Serious Punch"],hatsu:{name:"Serious Punch",auraRequired:1,description:"Defeats any enemy in one punch."},reward:{experience:99999,skillPoints:999,unlockMessage:"You survived Saitama's punch (somehow)!"}},// Meme/bonus bosses chairman_cat:{name:"Chairman Cat",level:1,health:10,maxHealth:10,stats:{strength:1,speed:1,intelligence:1,aura:1},abilities:["Meow"],hatsu:{name:"Cat Nap",auraRequired:1,description:"Puts you to sleep with a meow."},reward:{experience:1,skillPoints:1,unlockMessage:"You defeated the Chairman Cat! Meow!"}}};// var boss = getDynamicBoss("gon"); // returns Gon with stats scaled to current arc/chapter // For Dossier: show relationship map var langBtn=new MenuButton(t("Language")+": "+languageNames[lang],function(){showLanguageMenu();});langBtn.x=1800;langBtn.y=100;buttons.push(langBtn);game.addChild(langBtn);// --- Add language selection buttons at the bottom center --- var langBtnEn=new MenuButton("English",function(){setLanguage("en");});langBtnEn.x=900;langBtnEn.y=2600;if(lang==="en"){langBtnEn.alpha=0.7;}buttons.push(langBtnEn);game.addChild(langBtnEn);var langBtnTr=new MenuButton("Türkçe",function(){setLanguage("tr");});langBtnTr.x=1150;langBtnTr.y=2600;if(lang==="tr"){langBtnTr.alpha=0.7;}buttons.push(langBtnTr);game.addChild(langBtnTr);// Story Panel - moved to center-right var storyPanel;var buttons=[];var statsUI=[];var titleText;var playerInfoText;var levelText;var statNumbersText=[];// --- Language System --- var supportedLanguages=["en","tr"];var languageNames={en:"English",tr:"Türkçe"};var lang=_storage.selectedLanguage||"en";function setLanguage(newLang){if(supportedLanguages.indexOf(newLang)===-1){return;}lang=newLang;_storage.selectedLanguage=newLang;// Re-initialize UI and refresh current screen initializeUI();if(gameState==="characterCreation"){startCharacterCreation();}else if(gameState==="training"){startTrainingMode();}}function t(key){// Simple translation dictionary var dict={"Hunter X Hunter: Nen Mastery Challenge":{en:"Hunter X Hunter: Nen Mastery Challenge",tr:"Hunter X Hunter: Nen Ustalığı Mücadelesi"},"Level":{en:"Level",tr:"Seviye"},"Race":{en:"Race",tr:"Irk"},"Clan":{en:"Clan",tr:"Klan"},"None":{en:"None",tr:"Yok"},"Nen Type":{en:"Nen Type",tr:"Nen Tipi"},"SP":{en:"SP",tr:"YP"},"Strength":{en:"Strength",tr:"Güç"},"Speed":{en:"Speed",tr:"Hız"},"Intelligence":{en:"Intelligence",tr:"Zeka"},"Aura":{en:"Aura",tr:"Aura"},"Health":{en:"Health",tr:"Can"},"Energy":{en:"Energy",tr:"Enerji"},"Experience":{en:"Experience",tr:"Deneyim"},"Language":{en:"Language",tr:"Dil"},"Select Language":{en:"Select Language",tr:"Dil Seçimi"},"Back":{en:"Back",tr:"Geri"}// Add more keys as needed for UI };// Defensive: ensure dict[key] and dict[key][lang] are defined before accessing if(_typeof(dict)==="object"&&dict!==null&&typeof key!=="undefined"&&dict[key]&&typeof lang!=="undefined"&&typeof dict[key][lang]!=="undefined"){return dict[key][lang];}return typeof key!=="undefined"?key:"";}// --- Language Selection UI --- function showLanguageMenu(){storyPanel.setText(t("Select Language"));clearButtons();var y=1200;for(var i=0;i<supportedLanguages.length;i++){(function(idx){var l=supportedLanguages[idx];var btn=new MenuButton(languageNames[l],function(){setLanguage(l);});btn.x=1024;btn.y=y+idx*120;if(lang===l){btn.alpha=0.7;}buttons.push(btn);game.addChild(btn);})(i);}var backBtn=new MenuButton(t("Back"),function(){if(gameState==="characterCreation"){startCharacterCreation();}else if(gameState==="training"){startTrainingMode();}});backBtn.x=1024;backBtn.y=y+supportedLanguages.length*120+60;buttons.push(backBtn);game.addChild(backBtn);}// --- Patch initializeUI to add language button and use translations --- function initializeUI(){// Initialize achievement storage first initializeAchievementStorage();// Load achievement states from storage for(var category in achievements){var categoryData=achievements[category];for(var i=0;i<categoryData.achievements.length;i++){var achievement=categoryData.achievements[i];var storageKey="achievement_"+achievement.id;achievement.unlocked=_storage[storageKey]===1;}}// Fix bug: check achievements on UI init in case player already meets condition (e.g. after loading save) checkAchievements();// Title titleText=new Text2(t("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);// Language selection button (top 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(t("Level")+": "+player.level+" | "+t("Race")+": "+player.race,{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(t("Nen Type")+": "+(player.nenType||t("None"))+"\n"+t("SP")+": "+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=[t("Strength"),t("Speed"),t("Intelligence"),t("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(t("Health"),player.maxHealth,player.health,0xff0000));statsUI.push(new StatBar(t("Aura"),player.maxAura,player.aura,0x0066ff));statsUI.push(new StatBar(t("Energy"),player.maxEnergy,player.energy,0x00ff00));statsUI.push(new StatBar(t("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;statsUI[i].scaleY=0.7;game.addChild(statsUI[i]);}}// Character Creation function getCharacterRelationshipSummary(name){var rel=characterRelations[name];if(!rel){return"";}var s="";if(rel.friends&&rel.friends.length){s+="Friends: "+rel.friends.join(", ")+"\n";}if(rel.rivals&&rel.rivals.length){s+="Rivals: "+rel.rivals.join(", ")+"\n";}if(rel.enemies&&rel.enemies.length){s+="Enemies: "+rel.enemies.join(", ")+"\n";}return s;}// Travel Locations - load from storage 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:_storage.travelLocations_heavensArena_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:2500,maxHealth:2500,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:3000,maxHealth:3000,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:2800,maxHealth:2800,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:5000,maxHealth:5000,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:2200,maxHealth:2200,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},eyeTraining:{name:"Eye Training",description:"Train your eyes to handle intense emotions and power (Kurta clan only)",cost:20,benefits:{intelligence:1,aura:1},experience:25,clanRequired:"kurta"},transplantedEyeTraining:{name:"Transplanted Eye Training",description:"Train your stolen scarlet eyes (Very inefficient - 50% less effective than natural)",cost:40,benefits:{intelligence:1,aura:1},experience:15,eyeRequired:"transplanted"}};// Nen Techniques System - load from storage var nenTechniques={basic:{name:"Basic Nen Principles",techniques:[{name:"Ten",description:"Shroud your body with aura to enhance defense",cost:0,unlocked:_storage.nenTechniques_basic_Ten===1,auraReq:10,benefits:{defense:20}},{name:"Zetsu",description:"Stop the flow of aura to hide your presence",cost:5,unlocked:_storage.nenTechniques_basic_Zetsu===1,auraReq:15,benefits:{stealth:30}},{name:"Ren",description:"Increase the amount of aura around your body",cost:10,unlocked:_storage.nenTechniques_basic_Ren===1,auraReq:20,benefits:{aura:10,strength:5}},{name:"Hatsu",description:"Use aura to perform supernatural feats",cost:20,unlocked:_storage.nenTechniques_basic_Hatsu===1,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:_storage.nenTechniques_advanced_Gyo===1,auraReq:25,benefits:{intelligence:10}},{name:"In",description:"Hide your aura completely",cost:25,unlocked:_storage.nenTechniques_advanced_In===1,auraReq:35,benefits:{stealth:50}},{name:"En",description:"Extend your aura to sense surroundings",cost:30,unlocked:_storage.nenTechniques_advanced_En===1,auraReq:40,benefits:{aura:15,intelligence:8}},{name:"Shu",description:"Extend aura to objects you're holding",cost:20,unlocked:_storage.nenTechniques_advanced_Shu===1,auraReq:30,benefits:{strength:12}},{name:"Ko",description:"Focus all aura into one body part",cost:35,unlocked:_storage.nenTechniques_advanced_Ko===1,auraReq:45,benefits:{strength:20}},{name:"Ken",description:"Maintain Ren for extended periods",cost:40,unlocked:_storage.nenTechniques_advanced_Ken===1,auraReq:50,benefits:{aura:20,health:30}}]}};// Add Nen mastery to player data - load from storage var nenMastery={basicMastered:_storage.nenMastery_basicMastered||0,advancedMastered:_storage.nenMastery_advancedMastered||0,totalTechniques:_storage.nenMastery_totalTechniques||0};// Battle System Data var currentBattle=null;var battleState={playerTurn:true,playerHealth:0,enemyHealth:0,playerAura:0,enemyAura:0,battleLog:[],availableActions:[],enemy:null,ultimateVowUsed:false,emperorTimeActive:false,emperorTimeHealthDrain:0,scarletEyesLevel:0,storyContext:null};// Emperor Time system for Kurta clan var emperorTimeData={healthDrainPerSecond:3,activationCost:50,damageMultiplier:4.0,allCategoriesMastery:true,requiredScarletLevel:3};// Scarlet Eyes Training System var scarletEyesSystem={currentLevel:0,maxLevel:20,trainingProgress:0,trainingRequired:100,combatExperience:0,combatRequired:50};// Battle Actions var battleActions={zeroHand:{name:"Zero Hand",auraRequired:100,damage:"zero_hand",description:"Netero clan only: Use all remaining aura for a single, overwhelming attack (cannot instantly kill, only once per battle)",hatsuRequired:"Zero Hand"},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"]},shockwavePunch:{name:"Shockwave Punch",auraRequired:35,damage:"shockwave",description:"Create devastating shockwaves with enhanced punch",hatsuRequired:"Shockwave Punch"},enhancementOverload:{name:"Enhancement Overload",auraRequired:45,damage:"overload",description:"Temporarily enhance all abilities beyond limits",hatsuRequired:"Enhancement Overload"},focusedStrike:{name:"Focused Strike",auraRequired:25,damage:"focused",description:"Perfect strike with concentrated enhancement",hatsuRequired:"Focused Strike"},titanFistVariants:{name:"Titan Fist Techniques",auraRequired:25,damage:"titan_variants",description:"Multiple Titan Fist combat techniques",hatsuRequired:"Titan Fist"},ironSkinVariants:{name:"Iron Skin Forms",auraRequired:20,damage:"iron_variants",description:"Different Iron Skin defensive forms",hatsuRequired:"Iron Skin"},berserkerRageVariants:{name:"Berserker Techniques",auraRequired:40,damage:"berserker_variants",description:"Various berserker rage combat modes",hatsuRequired:"Berserker Rage"},perfectEnhancementVariants:{name:"Perfect Enhancement Arts",auraRequired:45,damage:"perfect_variants",description:"Master-level enhancement techniques",hatsuRequired:"Perfect Enhancement"},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"]},ultimatePotential:{name:"Ultimate Potential Vow",auraRequired:50,damage:"ultimate_vow",description:"Sacrifice your life for ultimate power (Health < 200 required)",special:"death_after_battle"},emperorTimeVow:{name:"Emperor Time Vow",auraRequired:80,damage:"emperor_time_vow",description:"Kurta clan only: Create Emperor Time as second Hatsu (Health < 200 required)",special:"kurta_only",clanRequired:"kurta"},scarletEyes:{name:"Scarlet Eyes",auraRequired:30,damage:"scarlet_activation",description:"Kurta clan only: Activate scarlet eyes (3 levels available)",special:"kurta_only",clanRequired:"kurta"},emperorTimeActivate:{name:"Emperor Time",auraRequired:50,damage:"emperor_time_battle",description:"Kurta clan only: Activate Emperor Time (drains health over time)",special:"kurta_emperor_time",clanRequired:"kurta"},emperorTimeDeactivate:{name:"Deactivate Emperor Time",auraRequired:0,damage:0,description:"Turn off Emperor Time to stop health drain",special:"kurta_emperor_time_off"},clanSpecial:{name:"Clan Heritage",auraRequired:50,damage:"clan_power",description:"Use your clan's legendary abilities"},nenTen:{name:"Ten (Aura Shroud)",auraRequired:10,damage:0,description:"Shroud body with aura for enhanced defense"},nenZetsu:{name:"Zetsu (Hide Presence)",auraRequired:15,damage:0,description:"Completely hide your aura presence"},nenRen:{name:"Ren (Aura Enhancement)",auraRequired:20,damage:"nen_ren",description:"Increase aura output for enhanced attacks"},nenKo:{name:"Ko (Focused Strike)",auraRequired:45,damage:"nen_ko",description:"Focus all aura into one devastating attack"},nenKen:{name:"Ken (Sustained Defense)",auraRequired:50,damage:0,description:"Maintain enhanced aura defense"},nenEn:{name:"En (Aura Extension)",auraRequired:40,damage:"nen_en",description:"Extend aura to sense and attack surroundings"},nenGyo:{name:"Gyo (Aura Focus)",auraRequired:25,damage:"nen_gyo",description:"Focus aura into eyes to see hidden techniques"},nenIn:{name:"In (Concealed Aura)",auraRequired:35,damage:"nen_in",description:"Hide aura to set up surprise attacks"},nenShu:{name:"Shu (Object Enhancement)",auraRequired:30,damage:"nen_shu",description:"Extend aura to objects for enhanced combat"},godspeedWhirlwind:{name:"GodSpeed: Whirlwind",auraRequired:35,damage:"godspeed_whirlwind",description:"Lightning-fast movement creating devastating whirlwind attacks",secondHatsuRequired:"GodSpeed"},godspeedSpeedOfLightning:{name:"GodSpeed: Speed of Lightning",auraRequired:40,damage:"godspeed_lightning",description:"Ultimate lightning speed allowing instantaneous movement and strikes",secondHatsuRequired:"GodSpeed"}};// Nen Vows System var nenVows=[{name:"Combat Restriction",description:"Never use Hatsu to kill. If you kill with Hatsu, you lose all Nen abilities.",powerBoost:1.5,type:"moral",consequence:"Breaking this vow permanently seals your Nen."},{name:"Time Limit",description:"Ability only works for 10 minutes per day. If you exceed the limit, you lose 90% of your aura permanently.",powerBoost:2.0,type:"temporal",consequence:"Breaking this vow reduces your max aura drastically."},{name:"Location Binding",description:"Ability only works in a specific location (e.g., Yorknew City). If used elsewhere, you become unable to use Nen for 1 year.",powerBoost:2.5,type:"spatial",consequence:"Breaking this vow disables Nen for 1 year (in-game time)."},{name:"Emotional Trigger",description:"Only works when extremely angry. If used while calm, you lose 50% of your health instantly.",powerBoost:1.8,type:"emotional",consequence:"Breaking this vow causes instant health loss."},{name:"Risk of Death",description:"Ability will kill you if overused (e.g., more than 3 times per day).",powerBoost:3.0,type:"sacrificial",consequence:"Breaking this vow results in instant death."},{name:"Shared Burden",description:"Allies also take damage when you do. If you avoid sharing damage, your Nen weakens by 80%.",powerBoost:2.2,type:"collective",consequence:"Breaking this vow drastically weakens your Nen."},{name:"Chrollo-Only Vow",description:"Ability can only be used against Chrollo Lucilfer. If used on anyone else, you die instantly.",powerBoost:4.0,type:"targeted",target:"Chrollo Lucilfer",consequence:"Breaking this vow results in instant death."},{name:"Vow of Vengeance",description:"Ability only works against the Phantom Troupe. If used on others, you lose all Nen.",powerBoost:3.5,type:"vengeance",target:"Phantom Troupe",consequence:"Breaking this vow permanently seals your Nen."},{name:"Yemin Bozma Bedeli",description:"If you break your vow, you suffer a unique penalty based on the vow type (e.g., death, Nen loss, aura drain, or permanent debuff).",powerBoost:1.0,type:"meta",consequence:"Each vow has a specific, severe penalty for breaking it."},{name:"Emperor Time Creation",description:"Create Emperor Time as second Hatsu (Kurta clan only)",powerBoost:4.0,type:"kurta_special",clanRequired:"kurta",requirement:"scarletEyesLevel >= 3",consequence:"If you break the vow (e.g., use Emperor Time without scarlet eyes), you lose all Nen and health."},{name:"Bloodline Sacrifice",description:"Sacrifice clan heritage for ultimate power. If you use clan abilities again, you lose all Nen.",powerBoost:3.5,type:"heritage_sacrifice",consequence:"Breaking this vow permanently seals your Nen."},{name:"Memory Seal",description:"Seal memories of loved ones for enhanced focus. If you recall them, you lose all Nen.",powerBoost:2.8,type:"psychological",consequence:"Breaking this vow permanently seals your Nen."},{name:"Life Force Drain",description:"Each use shortens lifespan but grants immense power. If you use the ability more than your remaining lifespan allows, you die instantly.",powerBoost:3.2,type:"sacrificial_advanced",consequence:"Breaking this vow results in instant death."}];// Special Clan Vows var clanSpecialVows={kurta:[{name:"Scarlet Eyes Oath",description:"Eyes turn permanently scarlet, health drains in combat",powerBoost:4.5,special:"permanent_emperor_time"},{name:"Vengeance Binding",description:"Power increases against those who harm innocents",powerBoost:3.0,special:"justice_boost"}],netero:[{name:"Meditation Mastery",description:"Must meditate 8 hours daily for power",powerBoost:2.8,special:"meditation_required"}],zoldyck:[{name:"Assassination Oath",description:"Power only works on killing techniques",powerBoost:3.5,special:"killing_intent_only"}]};// Skill Tree - load from storage var skillTree={enhancer:{name:"Enhancement Skills",skills:[{name:"Iron Body",cost:50,unlocked:_storage.skillTree_enhancer_IronBody===1,description:"Increase defense by 20%"},{name:"Power Boost",cost:100,unlocked:_storage.skillTree_enhancer_PowerBoost===1,description:"Increase strength by 50%"},{name:"Regeneration",cost:150,unlocked:_storage.skillTree_enhancer_Regeneration===1,description:"Slowly recover health over time"},{name:"Berserker Instinct",cost:200,unlocked:_storage.skillTree_enhancer_BerserkerInstinct===1,description:"Temporarily double all physical stats when below 30% health"},{name:"Perfect Focus",cost:250,unlocked:_storage.skillTree_enhancer_PerfectFocus===1,description:"Critical hits deal 2x damage and ignore defense"},{name:"Aura Overdrive",cost:300,unlocked:_storage.skillTree_enhancer_AuraOverdrive===1,description:"Spend all aura for a massive attack (damage scales with aura spent)"}]},emitter:{name:"Emission Skills",skills:[{name:"Aura Blast",cost:60,unlocked:_storage.skillTree_emitter_AuraBlast===1,description:"Ranged aura attack"},{name:"Remote Control",cost:120,unlocked:_storage.skillTree_emitter_RemoteControl===1,description:"Control objects from distance"},{name:"Aura Sphere",cost:180,unlocked:_storage.skillTree_emitter_AuraSphere===1,description:"Create protective aura barriers"},{name:"Chain Reaction",cost:220,unlocked:_storage.skillTree_emitter_ChainReaction===1,description:"Aura attacks can bounce to additional targets"},{name:"Delayed Explosion",cost:270,unlocked:_storage.skillTree_emitter_DelayedExplosion===1,description:"Set aura traps that explode after a delay"},{name:"Teleport Shot",cost:320,unlocked:_storage.skillTree_emitter_TeleportShot===1,description:"Instantly move to the location of your last aura attack"}]},manipulator:{name:"Manipulation Skills",skills:[{name:"Object Control",cost:70,unlocked:_storage.skillTree_manipulator_ObjectControl===1,description:"Manipulate nearby objects"},{name:"Mind Influence",cost:140,unlocked:_storage.skillTree_manipulator_MindInfluence===1,description:"Influence enemy actions"},{name:"Mass Control",cost:200,unlocked:_storage.skillTree_manipulator_MassControl===1,description:"Control multiple targets"},{name:"Pain Link",cost:250,unlocked:_storage.skillTree_manipulator_PainLink===1,description:"Link two enemies so they share damage"},{name:"Forced Movement",cost:300,unlocked:_storage.skillTree_manipulator_ForcedMovement===1,description:"Force an enemy to act or move against their will"},{name:"Memory Rewrite",cost:350,unlocked:_storage.skillTree_manipulator_MemoryRewrite===1,description:"Temporarily erase or alter an enemy's memory"}]},transmuter:{name:"Transmutation Skills",skills:[{name:"Rubber Aura",cost:55,unlocked:_storage.skillTree_transmuter_RubberAura===1,description:"Make aura elastic and bouncy"},{name:"Electric Aura",cost:110,unlocked:_storage.skillTree_transmuter_ElectricAura===1,description:"Transmute aura into electricity"},{name:"Shape Shift",cost:165,unlocked:_storage.skillTree_transmuter_ShapeShift===1,description:"Change aura into various forms"},{name:"Poison Touch",cost:210,unlocked:_storage.skillTree_transmuter_PoisonTouch===1,description:"Transmute aura into poison, inflicting damage over time"},{name:"Diamond Skin",cost:260,unlocked:_storage.skillTree_transmuter_DiamondSkin===1,description:"Temporarily become nearly invulnerable to physical attacks"},{name:"Aura Mirage",cost:320,unlocked:_storage.skillTree_transmuter_AuraMirage===1,description:"Create illusory duplicates to confuse enemies"}]},conjurer:{name:"Conjuration Skills",skills:[{name:"Weapon Summon",cost:80,unlocked:_storage.skillTree_conjurer_WeaponSummon===1,description:"Conjure basic weapons"},{name:"Tool Creation",cost:160,unlocked:_storage.skillTree_conjurer_ToolCreation===1,description:"Create useful tools"},{name:"Complex Objects",cost:240,unlocked:_storage.skillTree_conjurer_ComplexObjects===1,description:"Conjure complex mechanisms"},{name:"Living Construct",cost:300,unlocked:_storage.skillTree_conjurer_LivingConstruct===1,description:"Conjure a sentient companion to fight for you"},{name:"Dimensional Storage",cost:350,unlocked:_storage.skillTree_conjurer_DimensionalStorage===1,description:"Store unlimited items in a conjured pocket dimension"},{name:"Trap Mastery",cost:400,unlocked:_storage.skillTree_conjurer_TrapMastery===1,description:"Conjure hidden traps that trigger on enemies"}]},specialist:{name:"Specialist Skills",skills:[{name:"Unique Ability",cost:100,unlocked:_storage.skillTree_specialist_UniqueAbility===1,description:"Discover your unique power"},{name:"Power Amplify",cost:200,unlocked:_storage.skillTree_specialist_PowerAmplify===1,description:"Amplify all abilities"},{name:"Reality Bend",cost:300,unlocked:_storage.skillTree_specialist_RealityBend===1,description:"Bend rules of reality"},{name:"Fate Twist",cost:400,unlocked:_storage.skillTree_specialist_FateTwist===1,description:"Once per battle, reroll any failed action or avoid death"},{name:"Ability Theft",cost:500,unlocked:_storage.skillTree_specialist_AbilityTheft===1,description:"Steal a random ability from an enemy for the duration of the battle"},{name:"Nen Nullification",cost:600,unlocked:_storage.skillTree_specialist_NenNullification===1,description:"Temporarily nullify all Nen abilities in the area (including your own)"}]}};// UI Elements 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;}// Save the Nen type selection immediately savePlayerData();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);// Check Nen awakening achievement var nenAwakeningAchievement=achievements.nen.achievements[0];if(!nenAwakeningAchievement.unlocked&&nenAwakeningAchievement.condition()){var storageKey="achievement_"+nenAwakeningAchievement.id;if(!_storage[storageKey]){nenAwakeningAchievement.unlocked=true;_storage[storageKey]=1;player.skillPoints+=nenAwakeningAchievement.reward.skillPoints;player.experience+=nenAwakeningAchievement.reward.experience;showAchievementNotification(nenAwakeningAchievement);}}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();}// Log story choice if(typeof addActivityLogEntry==="function"){addActivityLogEntry("Story choice: "+action.replace(/_/g," ")+" ("+result.split(".")[0]+")");}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;// Stat gain animation var popup=new Text2("Level Up! Stats Increased!",{size:48,fill:0xffff00});popup.anchor.set(0.5,0.5);popup.x=1024;popup.y=350;game.addChild(popup);LK.setTimeout(function(){if(popup.parent){popup.destroy();}},2000);// Log level up if(typeof addActivityLogEntry==="function"){addActivityLogEntry("LEVEL UP! Reached level "+player.level+".");}// Check for clan unlock when Human race reaches certain levels if(player.race==="Human"&&!player.clan&&(player.level===10||player.level===20||player.level===30)){checkClanUnlock();}LK.getSound('levelUp').play();LK.effects.flashScreen(0xffff00,500);}function checkClanUnlock(){if(player.race!=="Human"||player.clan){return;}var availableClans=[];var clanKeys=Object.keys(humanClans);for(var i=0;i<clanKeys.length;i++){var clanKey=clanKeys[i];var clan=humanClans[clanKey];var meetsRequirements=true;// Check requirements if(clan.requirements.nenType&&player.nenType!==clan.requirements.nenType){meetsRequirements=false;}if(clan.requirements.level&&player.level<clan.requirements.level){meetsRequirements=false;}if(clan.requirements.hunterExamCompleted&&!player.hunterExamCompleted){meetsRequirements=false;}if(clan.requirements.intelligence&&player.stats.intelligence<clan.requirements.intelligence){meetsRequirements=false;}if(clan.requirements.hatsuMastery&&player.hatsuMastery<clan.requirements.hatsuMastery){meetsRequirements=false;}if(meetsRequirements){availableClans.push({key:clanKey,clan:clan});}}if(availableClans.length===0){return;}// Roll for clan discovery for(var i=0;i<availableClans.length;i++){var clanData=availableClans[i];if(Math.random()<clanData.clan.rarity){unlockClan(clanData.key,clanData.clan);return;}}}function unlockClan(clanKey,clan){player.clan=clanKey;// Apply clan bonuses if(clan.bonuses.strength){player.stats.strength+=clan.bonuses.strength;}if(clan.bonuses.speed){player.stats.speed+=clan.bonuses.speed;}if(clan.bonuses.intelligence){player.stats.intelligence+=clan.bonuses.intelligence;}if(clan.bonuses.aura){player.stats.aura+=clan.bonuses.aura;}if(clan.bonuses.maxHealth){player.maxHealth+=clan.bonuses.maxHealth;player.health=player.maxHealth;}if(clan.bonuses.maxAura){player.maxAura+=clan.bonuses.maxAura;player.aura=player.maxAura;}// Add special ability to player abilities if(!player.abilities.includes(clan.specialAbility.name)){player.abilities.push(clan.specialAbility.name);}storyPanel.setText("CLAN DISCOVERY!\n\nYou have discovered your heritage as a member of the "+clan.name+"!\n\n"+clan.description+"\n\nYou have awakened to your bloodline's power and gained incredible abilities!\n\nSpecial Ability Unlocked: "+clan.specialAbility.name+"\n"+clan.specialAbility.description);var popup=new Text2("Clan Bonus! Stats Increased",{size:40,fill:0xffd700});popup.anchor.set(0.5,0.5);popup.x=1024;popup.y=400;game.addChild(popup);LK.setTimeout(function(){if(popup.parent){popup.destroy();}},2000);clearButtons();var continueButton=new MenuButton("Embrace Your Heritage",function(){updateStatsUI();if(gameState==="training"){startTrainingMode();}else{showTravelMenu();}});continueButton.x=1024;continueButton.y=1400;buttons.push(continueButton);game.addChild(continueButton);// Check clan discovery achievement var clanDiscoveryAchievement=achievements.clan.achievements[0];if(!clanDiscoveryAchievement.unlocked&&clanDiscoveryAchievement.condition()){var storageKey="achievement_"+clanDiscoveryAchievement.id;if(!_storage[storageKey]){clanDiscoveryAchievement.unlocked=true;_storage[storageKey]=1;player.skillPoints+=clanDiscoveryAchievement.reward.skillPoints;player.experience+=clanDiscoveryAchievement.reward.experience;showAchievementNotification(clanDiscoveryAchievement);}}updateStatsUI();LK.effects.flashScreen(0xffd700,2000);}function showGameComplete(){player.hunterExamCompleted=true;// Mark Hunter Exam Saga as completed in story progress if(!storyProgress.completedArcs.includes("hunterExam")){storyProgress.completedArcs.push("hunterExam");saveStoryProgress();}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);// Check Hunter License achievement var hunterLicenseAchievement=achievements.story.achievements[0];if(!hunterLicenseAchievement.unlocked&&hunterLicenseAchievement.condition()){var storageKey="achievement_"+hunterLicenseAchievement.id;if(!_storage[storageKey]){hunterLicenseAchievement.unlocked=true;_storage[storageKey]=1;player.skillPoints+=hunterLicenseAchievement.reward.skillPoints;player.experience+=hunterLicenseAchievement.reward.experience;showAchievementNotification(hunterLicenseAchievement);}}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();// Story Arc button var storyButton=new MenuButton("Story Arcs",function(){showStoryArcsMenu();});storyButton.x=400;storyButton.y=1200;buttons.push(storyButton);game.addChild(storyButton);// Nen Vow/Reset System button var vowResetButton=new MenuButton("Nen Vow System",function(){showVowResetSystem();});vowResetButton.x=850;vowResetButton.y=1200;buttons.push(vowResetButton);game.addChild(vowResetButton);// Training buttons var activities=Object.keys(trainingActivities);var displayedActivities=[];for(var i=0;i<activities.length;i++){var activity=activities[i];var activityData=trainingActivities[activity];// Check if activity has clan requirement if(activityData.clanRequired&&player.clan!==activityData.clanRequired){continue;// Skip this activity if player doesn't meet clan requirement }// Check if activity has eye requirement if(activityData.eyeRequired&&activityData.eyeRequired==="transplanted"&&(!player.transplantedEyeLevel||player.transplantedEyeLevel===0)){continue;// Skip this activity if player doesn't have transplanted eyes }displayedActivities.push(activity);}// Create training buttons for displayed activities for(var i=0;i<displayedActivities.length;i++){var activity=displayedActivities[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=1400;buttons.push(restButton);game.addChild(restButton);// Skill Tree button (available after completing Hunter Exam Saga) var hasCompletedHunterExamSaga=storyProgress.completedArcs.includes("hunterExam")||player.hunterExamCompleted;if(hasCompletedHunterExamSaga){var skillTreeButton=new MenuButton("Skill Tree",function(){showSkillTree();});skillTreeButton.x=850;skillTreeButton.y=1400;buttons.push(skillTreeButton);game.addChild(skillTreeButton);}else{var skillTreeButton=new MenuButton("Skill Tree (Complete Hunter Exam Saga)",function(){// Do nothing - button is disabled });skillTreeButton.x=850;skillTreeButton.y=1400;skillTreeButton.alpha=0.5;// Make it look disabled buttons.push(skillTreeButton);game.addChild(skillTreeButton);}// Hatsu Creation button (available based on Nen type and requirements) if(player.nenType){var hasCompletedHunterExamSaga=storyProgress.completedArcs.includes("hunterExam")||player.hunterExamCompleted;var hatsuReqs=hasCompletedHunterExamSaga&&player.stats.aura>=150&&player.stats.strength>=250&&player.stats.intelligence>=100;var hatsuButtonText=hatsuReqs||player.hatsu?"Create Hatsu":player.hatsu?"Create Hatsu":!hasCompletedHunterExamSaga?"Create Hatsu (Complete Hunter Exam Saga)":"Create Hatsu (Need: 150 Aura, 250 Str, 100 Int)";var hatsuButton=new MenuButton(hatsuButtonText,function(){showHatsuCreation();});hatsuButton.x=1300;hatsuButton.y=1400;if(!hatsuReqs&&!player.hatsu){hatsuButton.alpha=0.7;}buttons.push(hatsuButton);game.addChild(hatsuButton);}// Nen Techniques button (always visible when player has a Nen type) var nenButton=new MenuButton("Nen Techniques",function(){showNenTechniques();});nenButton.x=400;nenButton.y=1500;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);}// Travel button var travelButton=new MenuButton("Travel",function(){showTravelMenu();});travelButton.x=850;travelButton.y=1500;buttons.push(travelButton);game.addChild(travelButton);// Achievements button var achievementsButton=new MenuButton("Achievements",function(){showAchievementsMenu();});achievementsButton.x=1300;achievementsButton.y=1500;buttons.push(achievementsButton);game.addChild(achievementsButton);// Hunter's Dossier button var dossierButton=new MenuButton("Hunter's Dossier",function(){showHuntersDossier();});// Recent Activity Log button var activityLogButton=new MenuButton("Recent Activity Log",function(){showRecentActivityLog();});activityLogButton.x=1300;activityLogButton.y=1700;buttons.push(activityLogButton);game.addChild(activityLogButton);// --- Activity Log System --- // Hunter Exam button removed - now available through Story Arcs if(typeof activityLog==="undefined"){var activityLog=[];}// Helper to add to activity log function addActivityLogEntry(entry){if(!activityLog){activityLog=[];}var timestamp=new Date();var timeStr=timestamp.getHours().toString().padStart(2,"0")+":"+timestamp.getMinutes().toString().padStart(2,"0");activityLog.unshift("["+timeStr+"] "+entry);if(activityLog.length>50){activityLog.length=50;}}// Show activity log screen function showRecentActivityLog(){var logText=" RECENT ACTIVITY LOG\n\n";if(activityLog&&activityLog.length>0){for(var i=0;i<Math.min(activityLog.length,20);i++){logText+=activityLog[i]+"\n";}}else{logText+="No recent activities recorded yet.\n";}storyPanel.setText(logText);clearButtons();var backButton=new MenuButton("Back to Training",function(){startTrainingMode();});backButton.x=1024;backButton.y=1400;buttons.push(backButton);game.addChild(backButton);}// Function to show the Hunter's Dossier in sections function showHuntersDossier(section){// Section order and titles var sections=[{key:"identity",label:"Kimlik & Ünvanlar"},{key:"stats",label:"Statlar & Yetenekler"},{key:"hatsu",label:"Hatsu ve Nen Bilgisi"},{key:"journey",label:"Yolculuk & Hikaye İlerlemesi"},{key:"relations",label:"İlişkiler & İtibar"},{key:"items",label:"Eşyalar & Önemli Olaylar"}];// Default to first section var currentSection=section||"identity";var sectionIndex=0;for(var i=0;i<sections.length;i++){if(sections[i].key===currentSection){sectionIndex=i;break;}}var dossierText="\n\n\n\n\n\n\n\n\n\n HUNTER'S DOSSIER\n\n";dossierText+="=== "+sections[sectionIndex].label+" ===\n\n";// Section content if(currentSection==="identity"){dossierText+="Name: "+player.name+"\n";dossierText+="Race: "+player.race+"\n";dossierText+="Clan: "+(player.clan?humanClans[player.clan].name:"None")+"\n";if(consequenceSystem.titles.length>0){dossierText+="Titles: "+consequenceSystem.titles.join(", ")+"\n";}else{dossierText+="Titles: None\n";}}else if(currentSection==="stats"){dossierText+="Level: "+player.level+"\n";dossierText+="Nen Type: "+(player.nenType||"Undiscovered")+"\n";dossierText+="Strength: "+player.stats.strength+"\n";dossierText+="Speed: "+player.stats.speed+"\n";dossierText+="Intelligence: "+player.stats.intelligence+"\n";dossierText+="Aura: "+player.stats.aura+"\n";// Stat Radar Chart var statVals=[Math.max(0,Math.min(1000,player.stats.strength)),Math.max(0,Math.min(1000,player.stats.speed)),Math.max(0,Math.min(1000,player.stats.intelligence)),Math.max(0,Math.min(1000,player.stats.aura))];var statLabels=["STR","SPD","INT","AURA"];var maxStat=1000;var chart="\n[Stat Radar Chart]\n";var chartRows=7;for(var row=chartRows;row>=1;row--){var line=" ";for(var i=0;i<statVals.length;i++){var threshold=maxStat*row/chartRows;line+=(statVals[i]>=threshold?"●":"○")+" ";}chart+=line+"\n";}chart+=" ";for(var i=0;i<statLabels.length;i++){chart+=statLabels[i]+" ";}chart+="\n";dossierText+=chart;dossierText+="\nStat Explanations:\n";dossierText+="Strength: Increases attack power and physical feats\n";dossierText+="Speed: Determines turn order, dodge, and multi-hit chance\n";dossierText+="Intelligence: Unlocks skills, improves Nen technique learning, and story options\n";dossierText+="Aura: Boosts Hatsu power, Nen technique effectiveness, and aura pool\n";}else if(currentSection==="hatsu"){if(player.hatsu){dossierText+="Hatsu: "+player.hatsu.name+" (Lv."+(player.hatsuLevel||1)+", Mastery "+(player.hatsuMastery||0)+"%)\n";}else{dossierText+="Hatsu: None\n";}if(player.secondHatsu){dossierText+="Second Hatsu: "+player.secondHatsu.name+" (Lv."+(player.secondHatsuLevel||1)+", Mastery "+(player.secondHatsuMastery||0)+"%)\n";}else{dossierText+="Second Hatsu: None\n";}if(player.nenVow){dossierText+="Nen Vow: "+player.nenVow.name+"\n";}else{dossierText+="Nen Vow: None\n";}}else if(currentSection==="journey"){dossierText+="=== Journey & Story Timeline ===\n";if(storyProgress.completedArcs.length>0){dossierText+="Story Timeline:\n";for(var i=0;i<storyProgress.completedArcs.length;i++){var arcKey=storyProgress.completedArcs[i];var arc=storyArcs[arcKey];if(arc){dossierText+=" • "+arc.title+(arc.completion_rewards&&arc.completion_rewards.title?" ["+arc.completion_rewards.title+"]":"")+"\n";}else{dossierText+=" • "+arcKey+"\n";}}}else{dossierText+="Story Timeline: None\n";}if(storyProgress.currentArc&&storyArcs[storyProgress.currentArc]){var arc=storyArcs[storyProgress.currentArc];dossierText+="Current Arc: "+arc.title+" (Chapter "+(storyProgress.currentChapter+1)+")\n";}dossierText+="Total Story Choices Made: "+storyProgress.playerChoices.length+"\n";if(storyProgress.playerChoices.length>0){dossierText+="Recent Major Choices:\n";var shown=0;for(var i=storyProgress.playerChoices.length-1;i>=0&&shown<3;i--){var pc=storyProgress.playerChoices[i];if(pc&&pc.arc&&pc.action){dossierText+=" • "+(storyArcs[pc.arc]?storyArcs[pc.arc].title:pc.arc)+" - "+pc.action.replace(/_/g," ")+"\n";shown++;}}}dossierText+="\n[Timeline Legend]\n";dossierText+="• = Completed Arc [Title] = Earned Title\n";}else if(currentSection==="relations"){dossierText+="Allies: "+(consequenceSystem.allies.length>0?consequenceSystem.allies.join(", "):"None")+"\n";dossierText+="Enemies: "+(consequenceSystem.enemies.length>0?consequenceSystem.enemies.join(", "):"None")+"\n";if(consequenceSystem.allies.length+consequenceSystem.enemies.length>0){dossierText+="Relationship Summary:\n";if(consequenceSystem.allies.length>0){dossierText+=" Trusted: "+consequenceSystem.allies[0];for(var i=1;i<Math.min(3,consequenceSystem.allies.length);i++){dossierText+=", "+consequenceSystem.allies[i];}dossierText+="\n";}if(consequenceSystem.enemies.length>0){dossierText+=" Rivalry: "+consequenceSystem.enemies[0];for(var i=1;i<Math.min(3,consequenceSystem.enemies.length);i++){dossierText+=", "+consequenceSystem.enemies[i];}dossierText+="\n";}}dossierText+="\n=== Character Relationship Details ===\n";var mainChars=["Gon Freecss","Killua Zoldyck","Kurapika Kurta","Hisoka Morow","Chrollo Lucilfer","Meruem (The King)"];for(var i=0;i<mainChars.length;i++){dossierText+=mainChars[i]+":\n";dossierText+=getCharacterRelationshipSummary(mainChars[i]);}// Visual Relationship Map if(consequenceSystem.allies.length+consequenceSystem.enemies.length>0){dossierText+="\n[Relationship Map]\n";dossierText+="You";if(consequenceSystem.allies.length>0){dossierText+=" --Allies--> ";dossierText+=consequenceSystem.allies.slice(0,2).join(", ");}if(consequenceSystem.enemies.length>0){dossierText+=" --Rivals--> ";dossierText+=consequenceSystem.enemies.slice(0,2).join(", ");}dossierText+="\n";}// Dynamic Boss/Friend Scaling (removed - bosses now have static stats) var arcInfo=getCurrentArcKeyAndChapter();dossierText+="\n=== Current Arc Boss/Friend Info ===\n";dossierText+="Current Arc: "+(arcInfo.arcKey?storyArcs[arcInfo.arcKey]?storyArcs[arcInfo.arcKey].title:arcInfo.arcKey:"None")+" (Chapter "+(arcInfo.chapter+1)+")\n";dossierText+="Bosses and major characters encountered in this arc will have their original, unscaled stats.\n";dossierText+="You will face the same level of challenge regardless of story progress.\n";// Reputation dossierText+="Reputation:\n";var repList=[];for(var rep in consequenceSystem.reputation){if(consequenceSystem.reputation[rep]!==0){repList.push(rep+": "+consequenceSystem.reputation[rep]);}}if(repList.length>0){dossierText+=" "+repList.join(", ")+"\n";}else{dossierText+=" Neutral\n";}dossierText+="Moral Alignment: "+consequenceSystem.moral_alignment+"\n";}else if(currentSection==="items"){dossierText+="Significant Items: "+(consequenceSystem.items.length>0?consequenceSystem.items.join(", "):"None")+"\n";dossierText+="\n";dossierText+="Recent Story Events:\n";if(storyProgress.playerChoices.length>0){for(var i=storyProgress.playerChoices.length-1;i>=Math.max(0,storyProgress.playerChoices.length-5);i--){var pc=storyProgress.playerChoices[i];if(pc&&pc.arc&&pc.action){dossierText+=" • "+(storyArcs[pc.arc]?storyArcs[pc.arc].title:pc.arc)+" - "+pc.action.replace(/_/g," ")+"\n";}}}else{dossierText+=" None\n";}}// Add extra newlines at the bottom to ensure the last lines are visible and not cut off dossierText+="\n\n\n\n\n\n\n\n\n\n";storyPanel.setText(dossierText);clearButtons();// Navigation buttons - vertical, top-aligned var navYStart=400;var navX=1500;for(var i=0;i<sections.length;i++){(function(idx){var navBtn=new MenuButton(sections[idx].label,function(){showHuntersDossier(sections[idx].key);});navBtn.x=navX;navBtn.y=navYStart+idx*120;if(idx===sectionIndex){navBtn.alpha=0.7;}buttons.push(navBtn);game.addChild(navBtn);})(i);}// Back button var backButton=new MenuButton("Back to Training",function(){startTrainingMode();});backButton.x=1024;backButton.y=1400;buttons.push(backButton);game.addChild(backButton);}dossierButton.x=1300;dossierButton.y=1600;buttons.push(dossierButton);game.addChild(dossierButton);// Debug Mode - Creator buttons for testing }function performTraining(activity){var activityData=trainingActivities[activity];// Deduct energy player.energy-=activityData.cost;// Apply benefits // Apply stat growth bonus from Mystic Vow if active var statGrowthMultiplier=player.statGrowthBonus||1.0;// Track stat milestones before var prevStats={strength:player.stats.strength,speed:player.stats.speed,intelligence:player.stats.intelligence,aura:player.stats.aura};if(activityData.benefits.strength){player.stats.strength+=Math.max(1,Math.floor(activityData.benefits.strength*statGrowthMultiplier*0.8));}if(activityData.benefits.speed){player.stats.speed+=Math.max(1,Math.floor(activityData.benefits.speed*statGrowthMultiplier*0.8));}if(activityData.benefits.intelligence){player.stats.intelligence+=Math.max(1,Math.floor(activityData.benefits.intelligence*statGrowthMultiplier*0.8));}if(activityData.benefits.aura){player.stats.aura+=Math.max(1,Math.floor(activityData.benefits.aura*statGrowthMultiplier*0.8));}// Stat milestone popups var statMilestones=[100,250,500,1000];var statNames=["Strength","Speed","Intelligence","Aura"];for(var i=0;i<statNames.length;i++){var statKey=statNames[i].toLowerCase();var before=prevStats[statKey];var after=player.stats[statKey];for(var m=0;m<statMilestones.length;m++){if(before<statMilestones[m]&&after>=statMilestones[m]){// Show popup for milestone var popup=new Text2("Milestone! "+statNames[i]+" reached "+statMilestones[m]+"!",{size:40,fill:0x00ffcc});popup.anchor.set(0.5,0.5);popup.x=1024;popup.y=400+i*50;game.addChild(popup);LK.effects.flashScreen(0x00ffcc,600);LK.setTimeout(function(p){return function(){if(p.parent){p.destroy();}};}(popup),2000);}}}if(activityData.benefits.health){player.maxHealth+=activityData.benefits.health;player.health=player.maxHealth;}// Log training activity if(typeof addActivityLogEntry==="function"){addActivityLogEntry("Completed training: "+activityData.name+" (+"+(activityData.benefits.strength?" STR:"+activityData.benefits.strength:"")+(activityData.benefits.speed?" SPD:"+activityData.benefits.speed:"")+(activityData.benefits.intelligence?" INT:"+activityData.benefits.intelligence:"")+(activityData.benefits.aura?" AURA:"+activityData.benefits.aura:"")+(activityData.benefits.health?" HP:"+activityData.benefits.health:"")+")");}// Add experience and skill points player.experience+=activityData.experience;player.skillPoints+=Math.floor(activityData.experience/10);player.trainingCount++;// Handle Eye Training for Kurta clan if(activity==="eyeTraining"&&player.clan==="kurta"){player.scarletEyesProgress+=20;if(player.scarletEyesProgress>=100){if(player.scarletEyesLevel<20){player.scarletEyesLevel++;player.scarletEyesProgress=0;LK.effects.flashScreen(0xff0000,1000);storyPanel.setText("Your Scarlet Eyes have evolved! Level "+player.scarletEyesLevel+" achieved!\n\nYour eyes burn with increased power. Each level makes your Emperor Time stronger and easier to control.");}}}// Handle Transplanted Eye Training if(activity==="transplantedEyeTraining"&&player.transplantedEyeLevel>0){player.transplantedEyeProgress+=10;// Half the progress of natural eyes if(player.transplantedEyeProgress>=100){if(player.transplantedEyeLevel<50){player.transplantedEyeLevel++;player.transplantedEyeProgress=0;LK.effects.flashScreen(0x660000,1000);storyPanel.setText("Your stolen scarlet eyes have developed! Level "+player.transplantedEyeLevel+" achieved!\n\nThe transplanted eyes slowly adapt to your body, but they remain significantly weaker than natural scarlet eyes. You need level 50 to unlock basic Emperor Time functionality.");}}}// Check for level up if(player.experience>=player.maxExperience){levelUp();}// Check specific training achievements only if(player.trainingCount===1){// Check first training achievement var firstTrainingAchievement=achievements.training.achievements[0];if(!firstTrainingAchievement.unlocked&&firstTrainingAchievement.condition()){var storageKey="achievement_"+firstTrainingAchievement.id;if(!_storage[storageKey]){firstTrainingAchievement.unlocked=true;_storage[storageKey]=1;player.skillPoints+=firstTrainingAchievement.reward.skillPoints;player.experience+=firstTrainingAchievement.reward.experience;showAchievementNotification(firstTrainingAchievement);}}}else if(player.trainingCount===25){// Check training adept achievement var trainingAdeptAchievement=achievements.training.achievements[1];if(!trainingAdeptAchievement.unlocked&&trainingAdeptAchievement.condition()){var storageKey="achievement_"+trainingAdeptAchievement.id;if(!_storage[storageKey]){trainingAdeptAchievement.unlocked=true;_storage[storageKey]=1;player.skillPoints+=trainingAdeptAchievement.reward.skillPoints;player.experience+=trainingAdeptAchievement.reward.experience;showAchievementNotification(trainingAdeptAchievement);}}}else if(player.trainingCount===100){// Check training master achievement var trainingMasterAchievement=achievements.training.achievements[2];if(!trainingMasterAchievement.unlocked&&trainingMasterAchievement.condition()){var storageKey="achievement_"+trainingMasterAchievement.id;if(!_storage[storageKey]){trainingMasterAchievement.unlocked=true;_storage[storageKey]=1;player.skillPoints+=trainingMasterAchievement.reward.skillPoints;player.experience+=trainingMasterAchievement.reward.experience;showAchievementNotification(trainingMasterAchievement);}}}// Check stat demon achievement only when stats reach 1000 if(player.stats.strength===1000||player.stats.speed===1000||player.stats.intelligence===1000||player.stats.aura===1000){var statDemonAchievement=achievements.training.achievements[3];if(!statDemonAchievement.unlocked&&statDemonAchievement.condition()){var storageKey="achievement_"+statDemonAchievement.id;if(!_storage[storageKey]){statDemonAchievement.unlocked=true;_storage[storageKey]=1;player.skillPoints+=statDemonAchievement.reward.skillPoints;player.experience+=statDemonAchievement.reward.experience;showAchievementNotification(statDemonAchievement);}}}// 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 var statGrowthMultiplier=player.statGrowthBonus||1.0;var statPopupText="";if(technique.benefits.defense){var defGain=Math.max(1,Math.floor(technique.benefits.defense*statGrowthMultiplier*0.7));player.maxHealth+=defGain;statPopupText+="DEF+"+defGain+" ";}if(technique.benefits.aura){var auraGain=Math.max(1,Math.floor(technique.benefits.aura*statGrowthMultiplier*0.7));player.stats.aura+=auraGain;player.maxAura+=auraGain;statPopupText+="AURA+"+auraGain+" ";}if(technique.benefits.strength){var strGain=Math.max(1,Math.floor(technique.benefits.strength*statGrowthMultiplier*0.7));player.stats.strength+=strGain;statPopupText+="STR+"+strGain+" ";}if(technique.benefits.intelligence){var intGain=Math.max(1,Math.floor(technique.benefits.intelligence*statGrowthMultiplier*0.7));player.stats.intelligence+=intGain;statPopupText+="INT+"+intGain+" ";}if(technique.benefits.health){var healthGain=Math.max(1,Math.floor(technique.benefits.health*statGrowthMultiplier*0.7));player.maxHealth+=healthGain;player.health=player.maxHealth;statPopupText+="HP+"+healthGain+" ";}if(technique.benefits.allStats){var allStatsGain=Math.max(1,Math.floor(technique.benefits.allStats*statGrowthMultiplier*0.7));player.stats.strength+=allStatsGain;player.stats.speed+=allStatsGain;player.stats.intelligence+=allStatsGain;player.stats.aura+=allStatsGain;statPopupText+="ALL+"+allStatsGain+" ";}if(statPopupText){var popup=new Text2("Stats: "+statPopupText,{size:36,fill:0x00ffcc});popup.anchor.set(0.5,0.5);popup.x=1024;popup.y=420;game.addChild(popup);LK.setTimeout(function(){if(popup.parent){popup.destroy();}},1800);}// Update mastery counters if(category==='basic'){nenMastery.basicMastered++;}else{nenMastery.advancedMastered++;}nenMastery.totalTechniques++;LK.getSound('levelUp').play();LK.effects.flashScreen(0x00ffff,500);updateStatsUI();savePlayerData();// Save progress 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 hasCompletedHunterExamSaga=storyProgress.completedArcs.includes("hunterExam")||player.hunterExamCompleted;var hasRequirements=hasCompletedHunterExamSaga&&player.stats.aura>=150&&player.stats.strength>=250&&player.stats.intelligence>=100;if(!hasRequirements&&!player.hatsu){if(!hasCompletedHunterExamSaga){storyPanel.setText("Hatsu Creation Requirements:\n\n• Complete Hunter Exam Saga first!\n\nAfter completing the Hunter Exam Saga, you'll also need:\n• Aura: 150 (Current: "+player.stats.aura+")\n• Strength: 250 (Current: "+player.stats.strength+")\n• Intelligence: 100 (Current: "+player.stats.intelligence+")");}else{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){var hatsuText="Your Current Hatsu: "+player.hatsu.name+"\n\n"+player.hatsu.description+"\nAura Required: "+player.hatsu.auraReq+"\nCondition: "+player.hatsu.conditions+"\nLevel: "+(player.hatsuLevel||1)+"/20\nMastery: "+player.hatsuMastery+"/100\nXP: "+(player.hatsuXP||0)+"/"+(player.hatsuLevel||1)*100;if(player.nenVow){hatsuText+="\n\nNen Vow: "+player.nenVow.name+" - "+player.nenVow.description;}// Check for second Hatsu option if(player.hatsu.name==="Lightning Palm"&&!player.secondHatsu){hatsuText+="\n\n🌟 GodSpeed Available! 🌟\nYou can now develop GodSpeed as your second Hatsu!";}else if(player.secondHatsu){hatsuText+="\n\nSecond Hatsu: "+player.secondHatsu.name+"\n"+player.secondHatsu.description+"\nLevel: "+(player.secondHatsuLevel||1)+"/20\nMastery: "+(player.secondHatsuMastery||0)+"/100\nXP: "+(player.secondHatsuXP||0)+"/"+(player.secondHatsuLevel||1)*100;}storyPanel.setText(hatsuText);}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=500;vowButton.y=1200;buttons.push(vowButton);game.addChild(vowButton);}// Train Main Hatsu button var trainButton=new MenuButton("Train "+player.hatsu.name+" (20 Energy)",function(){if(player.energy>=20){player.energy-=20;// Initialize values if not exist if(!player.hatsuLevel){player.hatsuLevel=1;}if(!player.hatsuXP){player.hatsuXP=0;}// Add XP and Mastery var xpGain=10+Math.floor(Math.random()*8);// 10-17 XP (lowered for balance) var masteryGain=Math.floor(Math.random()*8)+3;// 3-10 Mastery (lowered for balance) player.hatsuXP+=xpGain;player.hatsuMastery=Math.min(100,player.hatsuMastery+masteryGain);// Show stat gain popup for Hatsu training var popup=new Text2("Hatsu XP+"+xpGain+" Mastery+"+masteryGain,{size:36,fill:0x00ffcc});popup.anchor.set(0.5,0.5);popup.x=1024;popup.y=470;game.addChild(popup);LK.setTimeout(function(){if(popup.parent){popup.destroy();}},1800);// Check for level up var xpNeeded=player.hatsuLevel*100;if(player.hatsuXP>=xpNeeded&&player.hatsuLevel<20){player.hatsuLevel++;player.hatsuXP=0;LK.effects.flashScreen(0xffff00,1000);}// If Lightning Palm, also update dedicated fields for persistence if(player.hatsu&&player.hatsu.name==="Lightning Palm"){player.lightningPalmLevel=player.hatsuLevel;player.lightningPalmMastery=player.hatsuMastery;player.lightningPalmXP=player.hatsuXP;}updateStatsUI();LK.effects.flashScreen(0x0066ff,300);showHatsuCreation();}});trainButton.x=850;trainButton.y=1200;buttons.push(trainButton);game.addChild(trainButton);// GodSpeed Creation button if Lightning Palm is mastered if(player.hatsu.name==="Lightning Palm"&&!player.secondHatsu){var godSpeedButton=new MenuButton("Create GodSpeed (Second Hatsu)",function(){createGodSpeed();});godSpeedButton.x=500;godSpeedButton.y=1300;buttons.push(godSpeedButton);game.addChild(godSpeedButton);}// Train Second Hatsu button if it exists if(player.secondHatsu){var trainSecondButton=new MenuButton("Train "+player.secondHatsu.name+" (20 Energy)",function(){if(player.energy>=20){player.energy-=20;// Initialize values if not exist if(!player.secondHatsuLevel){player.secondHatsuLevel=1;}if(!player.secondHatsuXP){player.secondHatsuXP=0;}if(!player.secondHatsuMastery){player.secondHatsuMastery=0;}// Add XP and Mastery var xpGain=10+Math.floor(Math.random()*8);// 10-17 XP (lowered for balance) var masteryGain=Math.floor(Math.random()*8)+3;// 3-10 Mastery (lowered for balance) player.secondHatsuXP+=xpGain;player.secondHatsuMastery=Math.min(100,player.secondHatsuMastery+masteryGain);// Show stat gain popup for second Hatsu training var popup=new Text2("Hatsu XP+"+xpGain+" Mastery+"+masteryGain,{size:36,fill:0x00ffcc});popup.anchor.set(0.5,0.5);popup.x=1024;popup.y=520;game.addChild(popup);LK.setTimeout(function(){if(popup.parent){popup.destroy();}},1800);// Check for level up var xpNeeded=player.secondHatsuLevel*100;if(player.secondHatsuXP>=xpNeeded&&player.secondHatsuLevel<20){player.secondHatsuLevel++;player.secondHatsuXP=0;LK.effects.flashScreen(0xffff00,1000);}// If GodSpeed, also update dedicated fields for persistence if(player.secondHatsu&&player.secondHatsu.name==="GodSpeed"){player.godspeedLevel=player.secondHatsuLevel;player.godspeedMastery=player.secondHatsuMastery;player.godspeedXP=player.secondHatsuXP;}updateStatsUI();LK.effects.flashScreen(0x0066ff,300);showHatsuCreation();}});trainSecondButton.x=1200;trainSecondButton.y=1200;buttons.push(trainSecondButton);game.addChild(trainSecondButton);}}// 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(){// Special: If player is Netero clan, has 100-Type Guanyin Bodhisattva as main Hatsu, and selects Zero Hand, set as second Hatsu if(player.clan==="netero"&&player.hatsu&&player.hatsu.name==="100-Type Guanyin Bodhisattva"&&template.name==="Zero Hand"){// Add Zero Hand as second Hatsu (non-lethal, uses all aura, not instant kill) player.secondHatsu={name:"Zero Hand",description:"Concentrate all aura into one final devastating blast. Uses all remaining aura for a massive attack, but does NOT instantly kill. Can only be used once per battle.",auraReq:100,conditions:"Must be below 25% health to activate. Consumes all aura.",battleEffects:{type:"ultimate_bodhisattva",multiplier:8.0,special:"uses_all_aura,nonlethal"}};player.secondHatsuLevel=1;player.secondHatsuMastery=10;player.secondHatsuXP=0;storyPanel.setText("Zero Hand Created!\n\nYou have unlocked the legendary Zero Hand as your second Hatsu!\n\nThis ultimate technique channels all your remaining aura into a single, overwhelming attack. It does NOT instantly kill, but can turn the tide of any battle. Use it wisely!");clearButtons();var continueButton=new MenuButton("Continue",function(){showHatsuCreation();});continueButton.x=1024;continueButton.y=1400;buttons.push(continueButton);game.addChild(continueButton);LK.effects.flashScreen(0xffe066,1500);return;}selectHatsu(template);};}function selectHatsu(template){player.hatsu=template;player.hatsuMastery=10;// Log Hatsu creation if(typeof addActivityLogEntry==="function"){addActivityLogEntry("Created Hatsu: "+template.name);}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!");// Check first Hatsu achievement var firstHatsuAchievement=achievements.nen.achievements[1];if(!firstHatsuAchievement.unlocked&&firstHatsuAchievement.condition()){var storageKey="achievement_"+firstHatsuAchievement.id;if(!_storage[storageKey]){firstHatsuAchievement.unlocked=true;_storage[storageKey]=1;player.skillPoints+=firstHatsuAchievement.reward.skillPoints;player.experience+=firstHatsuAchievement.reward.experience;showAchievementNotification(firstHatsuAchievement);}}updateStatsUI();LK.effects.flashScreen(0x00ffff,1000);}function showNenVows(){var vowText="Nen Vows\n\nBy imposing restrictions on yourself, you can greatly increase your Hatsu's power. Choose carefully - vows are permanent!";// Add clan-specific information if(player.clan&&clanSpecialVows[player.clan]){vowText+="\n\nSpecial "+humanClans[player.clan].name+" vows available!";}storyPanel.setText(vowText);clearButtons();var availableVows=[];var currentY=1200;// Regular vows for(var i=0;i<Math.min(4,nenVows.length);i++){var vow=nenVows[i];// Check if vow has requirements var canSelect=true;if(vow.clanRequired&&player.clan!==vow.clanRequired){canSelect=false;}if(vow.requirement&&vow.requirement==="scarletEyesLevel >= 3"&&battleState.scarletEyesLevel<3){canSelect=false;}var vowButton=new MenuButton(vow.name+" (+"+Math.floor((vow.powerBoost-1)*100)+"% power)"+(canSelect?"":" (Locked)"),canSelect?createVowCallback(vow):null);vowButton.x=700+i%2*450;vowButton.y=currentY+Math.floor(i/2)*120;if(!canSelect){vowButton.alpha=0.5;}buttons.push(vowButton);game.addChild(vowButton);}currentY+=300;// Clan-specific vows if(player.clan&&clanSpecialVows[player.clan]){var clanVows=clanSpecialVows[player.clan];for(var i=0;i<clanVows.length;i++){var clanVow=clanVows[i];var clanVowButton=new MenuButton("🏰 "+clanVow.name+" (+"+Math.floor((clanVow.powerBoost-1)*100)+"% power)",createVowCallback(clanVow));clanVowButton.x=700+i%2*450;clanVowButton.y=currentY+Math.floor(i/2)*120;buttons.push(clanVowButton);game.addChild(clanVowButton);}currentY+=150;}var backButton=new MenuButton("Back to Hatsu",function(){showHatsuCreation();});backButton.x=1024;backButton.y=currentY;buttons.push(backButton);game.addChild(backButton);}function createVowCallback(vow){return function(){selectNenVow(vow);};}function selectNenVow(vow){player.nenVow=vow;// Log Nen Vow if(typeof addActivityLogEntry==="function"){addActivityLogEntry("Made Nen Vow: "+vow.name);}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);var popup=new Text2("Nen Vow: +"+Math.floor((vow.powerBoost-1)*100)+"% Hatsu Power",{size:36,fill:0xff0000});popup.anchor.set(0.5,0.5);popup.x=1024;popup.y=470;game.addChild(popup);LK.setTimeout(function(){if(popup.parent){popup.destroy();}},1800);updateStatsUI();}function unlockSkill(skill,skillData){player.skillPoints-=skillData.cost;skillData.unlocked=true;player.abilities.push(skill.name);// Apply skill effects var statGrowthMultiplier=player.statGrowthBonus||1.0;var statPopupText="";if(skill.name==="Iron Body"){var hp=Math.max(5,Math.floor(30*statGrowthMultiplier));player.maxHealth+=hp;statPopupText+="HP+"+hp+" ";}if(skill.name==="Power Boost"){var str=Math.max(2,Math.floor(12*statGrowthMultiplier));player.stats.strength+=str;statPopupText+="STR+"+str+" ";}if(skill.name==="Aura Blast"){var aura=Math.max(3,Math.floor(18*statGrowthMultiplier));player.maxAura+=aura;statPopupText+="AURA+"+aura+" ";}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,hatsuLevel:1,hatsuXP:0,secondHatsu:null,secondHatsuLevel:0,secondHatsuMastery:0,secondHatsuXP:0,race:"Human",clan:null,scarletEyesLevel:0,scarletEyesProgress:0};// Reset Nen mastery nenMastery={basicMastered:0,advancedMastered:0,totalTechniques:0};// Reset Emperor Time state battleState.emperorTimeActive=false;battleState.emperorTimeHealthDrain=0;battleState.scarletEyesLevel=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;}// Reset all storage values to 0 _storage.battlesWon=0;_storage.bossesDefeated=0;_storage.locationsVisited=0;_storage.emperorTimeUsed=0;_storage.ultimateVowUsed=0;_storage.phantomTroupeEncounter=0;_storage.darkContinentCompleted=0;_storage.yorknewCompleted=0;_storage.greedIslandCompleted=0;_storage.assassinationSuccess=0;_storage.bodhisattvaUsed=0;_storage.abilitiesCopied=0;_storage.darkContinentPerfect=0;_storage.ultimateVowBossKills=0;// Reset all player data storage _storage.player_name="Hunter";_storage.player_nenType="";_storage.player_level=1;_storage.player_experience=0;_storage.player_maxExperience=100;_storage.player_health=100;_storage.player_maxHealth=100;_storage.player_aura=50;_storage.player_maxAura=50;_storage.player_stats_strength=10;_storage.player_stats_speed=10;_storage.player_stats_intelligence=10;_storage.player_stats_aura=10;_storage.player_abilities="";_storage.player_currentChapter=1;_storage.player_energy=100;_storage.player_maxEnergy=100;_storage.player_skillPoints=0;_storage.player_trainingCount=0;_storage.player_hunterExamCompleted=0;_storage.player_hatsu="";_storage.player_nenVow="";_storage.player_hatsuMastery=0;_storage.player_hatsuLevel=1;_storage.player_hatsuXP=0;_storage.player_secondHatsu="";_storage.player_secondHatsuLevel=0;_storage.player_secondHatsuMastery=0;_storage.player_secondHatsuXP=0;_storage.player_copiedAbilities="";_storage.player_copiedAbilityWitnesses="";_storage.player_race="Human";_storage.player_clan="";_storage.player_scarletEyesLevel=0;_storage.player_scarletEyesProgress=0;_storage.nenMastery_basicMastered=0;_storage.nenMastery_advancedMastered=0;_storage.nenMastery_totalTechniques=0;_storage.travelLocations_heavensArena_currentFloor=0;// Reset story progress storage _storage.storyProgress_currentArc=null;_storage.storyProgress_currentChapter=0;_storage.storyProgress_completedArcs="";_storage.storyProgress_playerChoices="";_storage.storyProgress_persistentConsequences="";_storage.storyProgress_rewards="";// Reset arc completion flags _storage.hunterExamCompleted=0;_storage.yorknewCityCompleted=0;_storage.greedIslandCompleted=0;_storage.darkContinentCompleted=0;_storage.meteorCityCompleted=0;_storage.whaleIslandCompleted=0;_storage.nglCompleted=0;// Reset consequence system storage _storage.consequenceSystem_heroic=0;_storage.consequenceSystem_criminal=0;_storage.consequenceSystem_methodical=0;_storage.consequenceSystem_reckless=0;_storage.consequenceSystem_leader=0;_storage.consequenceSystem_follower=0;_storage.consequenceSystem_independent=0;_storage.consequenceSystem_diplomatic=0;_storage.consequenceSystem_fearless=0;_storage.consequenceSystem_cautious=0;_storage.consequenceSystem_scholar=0;_storage.consequenceSystem_hunter=0;_storage.consequenceSystem_allies="";_storage.consequenceSystem_enemies="";_storage.consequenceSystem_obligations="";_storage.consequenceSystem_unlocked_paths="";_storage.consequenceSystem_moral_alignment=0;_storage.consequenceSystem_items="";_storage.consequenceSystem_titles="";// Reset story progress objects storyProgress.currentArc=null;storyProgress.currentChapter=0;storyProgress.completedArcs=[];storyProgress.playerChoices=[];storyProgress.persistentConsequences=[];// Reset consequence system consequenceSystem.reputation={heroic:0,criminal:0,methodical:0,reckless:0,leader:0,follower:0,independent:0,diplomatic:0,fearless:0,cautious:0,scholar:0,hunter:0};consequenceSystem.allies=[];consequenceSystem.enemies=[];consequenceSystem.obligations=[];consequenceSystem.unlocked_paths=[];consequenceSystem.moral_alignment=0;consequenceSystem.items=[];consequenceSystem.titles=[];// Reset all achievement unlocks for(var category in achievements){var categoryData=achievements[category];for(var i=0;i<categoryData.achievements.length;i++){var achievement=categoryData.achievements[i];achievement.unlocked=false;var storageKey="achievement_"+achievement.id;_storage[storageKey]=0;}}gameState="characterCreation";updateStatsUI();checkAchievements();// Ensure achievements are checked after reset 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];// Track achievement progress var currentVisited=_storage.locationsVisited||0;_storage.locationsVisited=currentVisited+1;// Fix: check achievements after visiting a location checkAchievements();// 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 boss=getBossStats(location.specialBoss,getCurrentArcKeyAndChapter().arcKey,getCurrentArcKeyAndChapter().chapter);var canFight=player.level>=boss.level-15&&player.hunterExamCompleted;var bossButton=new MenuButton("Fight "+boss.name+" (Lv."+boss.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(){// Show dynamic scaling info for boss if on last floor if(location.currentFloor>=200&&location.specialBoss){var boss=getBossStats(location.specialBoss,getCurrentArcKeyAndChapter().arcKey,getCurrentArcKeyAndChapter().chapter);storyPanel.setText("Special Boss: "+boss.name+" (Level "+boss.level+")\nHealth: "+boss.health+"\nStrength: "+boss.stats.strength+"\nSpeed: "+boss.stats.speed+"\nIntelligence: "+boss.stats.intelligence+"\nAura: "+boss.stats.aura+"\n\nPrepare for the ultimate challenge!");}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(selectedGroupIndex){// Remove all previous text and only show group or boss buttons storyPanel.setText("Boss Battles\n\nTest your skills against legendary hunters and dangerous opponents!\n\nSelect a group to see its bosses.");clearButtons();// Define boss groups with more bosses in each group var bossGroups=[{name:"Main Characters",keys:["gon","killua","kurapika","hisoka","illumi","biscuit","wing"]},{name:"Zoldyck's",keys:["zeno","silva","illumi","killua","kalluto","milluki"]},{name:"Phantom Troupe & Yorknew",keys:["uvogin","feitan","phinks","shizuku","machi","shalnark","franklin","nobunaga","pakunoda","bonolenov","kortopi"]},{name:"Chimera Ants",keys:["neferpitou","meruem","colt","cheetu","leol"]},{name:"Greed Island",keys:["razor","genthru","biscuit"]},{name:"Hunters & Legends",keys:["ging","netero","morel","knuckle","shoot"]},{name:"Other",keys:["komugi"]}];// Add any bosses not in a group to "Other Bosses" var allBossKeys=Object.keys(bosses);var groupedKeys=[];for(var g=0;g<bossGroups.length;g++){groupedKeys=groupedKeys.concat(bossGroups[g].keys);}var otherBossKeys=[];for(var i=0;i<allBossKeys.length;i++){if(groupedKeys.indexOf(allBossKeys[i])===-1){otherBossKeys.push(allBossKeys[i]);}}if(otherBossKeys.length>0){bossGroups.push({name:"Other Bosses",keys:otherBossKeys});}var yStart=1200;var groupSpacing=80;var bossSpacing=90;// If no group is selected, show group buttons only if(typeof selectedGroupIndex==="undefined"){for(var g=0;g<bossGroups.length;g++){(function(groupIdx){var group=bossGroups[groupIdx];var groupButton=new MenuButton(group.name,function(){showBossMenu(groupIdx);});groupButton.x=700+groupIdx%2*450;groupButton.y=yStart+Math.floor(groupIdx/2)*120;buttons.push(groupButton);game.addChild(groupButton);})(g);}var backButton=new MenuButton("Back to Travel",function(){showTravelMenu();});backButton.x=1024;backButton.y=yStart+Math.ceil(bossGroups.length/2)*120+100;buttons.push(backButton);game.addChild(backButton);return;}// If a group is selected, show only bosses from that group var group=bossGroups[selectedGroupIndex];storyPanel.setText("Boss Battles: "+group.name+"\n\nSelect a boss to challenge.");clearButtons();var groupLabel=new Text2(group.name,{size:44,fill:0xffd700});groupLabel.anchor.set(0.5,0.5);groupLabel.x=1024;groupLabel.y=yStart-80;game.addChild(groupLabel);for(var b=0;b<group.keys.length;b++){var bossKey=group.keys[b];var boss=getDynamicBoss(bossKey)||bosses[bossKey];if(!boss){continue;}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+b%2*450;bossButton.y=yStart+Math.floor(b/2)*bossSpacing;if(!canFight){bossButton.alpha=0.5;}buttons.push(bossButton);game.addChild(bossButton);}// Add "Back to Groups" button var backGroupsButton=new MenuButton("Back to Groups",function(){showBossMenu();});backGroupsButton.x=1024;backGroupsButton.y=yStart+Math.ceil(group.keys.length/2)*bossSpacing+100;buttons.push(backGroupsButton);game.addChild(backGroupsButton);}function createBossCallback(bossKey){return function(){fightBoss(bossKey);};}function fightLocationBoss(locationKey){var location=travelLocations[locationKey];var boss=getBossStats(location.specialBoss,getCurrentArcKeyAndChapter().arcKey,getCurrentArcKeyAndChapter().chapter);// 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=getDynamicBoss(bossKey)||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;case"kurapika":bossDialogue="Kurapika's eyes glow scarlet with rage. 'I will not let anyone stand in the way of my vengeance!'";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 boss=getBossStats(location.specialBoss,getCurrentArcKeyAndChapter().arcKey,getCurrentArcKeyAndChapter().chapter);var canFightBoss=player.level>=boss.level-15&&player.hunterExamCompleted;var bossButton=new MenuButton("Challenge "+boss.name+" (Level "+boss.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.ultimateVowUsed=false;battleState.emperorTimeActive=false;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 Technique actions based on learned techniques if(nenMastery.basicMastered>0||nenMastery.advancedMastered>0){// Ten - Basic defensive technique if(nenTechniques.basic.techniques[0].unlocked&&battleState.playerAura>=10){actions.push("nenTen");}// Zetsu - Hide presence technique if(nenTechniques.basic.techniques[1].unlocked&&battleState.playerAura>=15){actions.push("nenZetsu");}// Ren - Enhance aura output if(nenTechniques.basic.techniques[2].unlocked&&battleState.playerAura>=20){actions.push("nenRen");}// Ko - Focus all aura into one attack if(nenTechniques.advanced.techniques[4].unlocked&&battleState.playerAura>=45){actions.push("nenKo");}// Ken - Maintain enhanced defense if(nenTechniques.advanced.techniques[5].unlocked&&battleState.playerAura>=50){actions.push("nenKen");}// En - Extend aura sensing if(nenTechniques.advanced.techniques[2].unlocked&&battleState.playerAura>=40){actions.push("nenEn");}// Gyo - Focus aura into eyes if(nenTechniques.advanced.techniques[0].unlocked&&battleState.playerAura>=25){actions.push("nenGyo");}// In - Hide aura completely if(nenTechniques.advanced.techniques[1].unlocked&&battleState.playerAura>=35){actions.push("nenIn");}// Shu - Extend aura to objects if(nenTechniques.advanced.techniques[3].unlocked&&battleState.playerAura>=30){actions.push("nenShu");}}// Add Kurapika's 4 chain abilities and Emperor Time if player has Binding Chains Hatsu if(player.hatsu&&player.hatsu.name==="Binding Chains"){// Ensure battleActions for chains exist, if not, define them if(!battleActions.chainJail){battleActions.chainJail={name:"Chain Jail",auraRequired:45,damage:"chain_jail",description:"Bind and immobilize the enemy. Instant kill vs Phantom Troupe."};}if(!battleActions.holyChain){battleActions.holyChain={name:"Holy Chain",auraRequired:30,damage:"holy_chain",description:"Heal yourself and deal damage to the enemy."};}if(!battleActions.dowsingChain){battleActions.dowsingChain={name:"Dowsing Chain",auraRequired:28,damage:"dowsing_chain",description:"Track and strike the enemy, ignoring defense."};}if(!battleActions.judgmentChain){battleActions.judgmentChain={name:"Judgment Chain",auraRequired:50,damage:"judgment_chain",description:"Pierce the enemy's heart with a deadly curse."};}// Add chain actions if enough aura if(battleState.playerAura>=battleActions.chainJail.auraRequired){actions.push("chainJail");}if(battleState.playerAura>=battleActions.holyChain.auraRequired){actions.push("holyChain");}if(battleState.playerAura>=battleActions.dowsingChain.auraRequired){actions.push("dowsingChain");}if(battleState.playerAura>=battleActions.judgmentChain.auraRequired){actions.push("judgmentChain");}// Add Emperor Time if Kurta clan and scarlet eyes level is high enough // Apply clan Hatsu boost with proper null checks if(player.clan&&humanClans[player.clan]&&humanClans[player.clan].hatsuBoost){var clanBoost=humanClans[player.clan].hatsuBoost;var shouldBoost=false;if(clanBoost&&clanBoost.nenTypes&&clanBoost.nenTypes.includes&&(clanBoost.nenTypes.includes("All")||clanBoost.nenTypes.includes(player.nenType))){shouldBoost=true;}if(shouldBoost&&clanBoost.multiplier){damage=Math.floor(damage*clanBoost.multiplier);logMessage+=" Your "+humanClans[player.clan].name+" heritage amplifies the attack!";}}if(player.nenVow&&player.nenVow.powerBoost){damage=Math.floor(damage*player.nenVow.powerBoost);}if(player.hatsu&&player.hatsu.battleEffects){var effects=player.hatsu.battleEffects;if(effects&&effects.multiplier){damage=Math.floor(damage*effects.multiplier);}// Handle special effects if(effects&&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&&effects.special==="piercing"){battleState.ignoredDefense=true;logMessage="Your "+player.hatsu.name+" pierces through defenses for "+damage+" damage!";}else if(effects&&effects.special==="damage_over_time"){battleState.poisonDamage=Math.floor(damage*0.2);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?player.hatsu.name:"Unknown Hatsu")+" for "+damage+" damage!";}if(player.clan==="kurta"&&(battleState.scarletEyesLevel>=3||player.scarletEyesLevel>=3)){if(!battleState.emperorTimeActive&&battleState.playerAura>=battleActions.emperorTimeActivate.auraRequired){if(actions.indexOf("emperorTimeActivate")===-1){actions.push("emperorTimeActivate");}}else if(battleState.emperorTimeActive){if(actions.indexOf("emperorTimeDeactivate")===-1){actions.push("emperorTimeDeactivate");}}}}// 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 specific Enhancer Hatsu abilities if player has them if(player.nenType==="Enhancer"&&player.hatsu){if(player.hatsu.name==="Shockwave Punch"&&battleState.playerAura>=battleActions.shockwavePunch.auraRequired){actions.push("shockwavePunch");}if(player.hatsu.name==="Enhancement Overload"&&battleState.playerAura>=battleActions.enhancementOverload.auraRequired){actions.push("enhancementOverload");}if(player.hatsu.name==="Focused Strike"&&battleState.playerAura>=battleActions.focusedStrike.auraRequired){actions.push("focusedStrike");}// Add enhanced variants for other Enhancer Hatsu abilities if(player.hatsu.name==="Titan Fist"&&battleState.playerAura>=25){actions.push("titanFistVariants");}if(player.hatsu.name==="Iron Skin"&&battleState.playerAura>=20){actions.push("ironSkinVariants");}if(player.hatsu.name==="Berserker Rage"&&battleState.playerAura>=40){actions.push("berserkerRageVariants");}if(player.hatsu.name==="Perfect Enhancement"&&battleState.playerAura>=45){actions.push("perfectEnhancementVariants");}}// 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));}}}}// Add Ultimate Potential Vow if health is below 200 and not already used if(battleState.playerHealth<200&&!battleState.ultimateVowUsed&&battleState.playerAura>=50){actions.push("ultimatePotential");}// Add Emperor Time Vow for Kurta clan members if(battleState.playerHealth<200&&player.clan==="kurta"&&!battleState.ultimateVowUsed&&battleState.playerAura>=80){actions.push("emperorTimeVow");}// Add Scarlet Eyes for Kurta clan members if(player.clan==="kurta"&&battleState.playerAura>=30){actions.push("scarletEyes");}// Add Emperor Time activation/deactivation for Kurta clan members if(player.clan==="kurta"&&(battleState.scarletEyesLevel>=3||player.scarletEyesLevel>=3)){if(!battleState.emperorTimeActive&&battleState.playerAura>=50){actions.push("emperorTimeActivate");}else if(battleState.emperorTimeActive){actions.push("emperorTimeDeactivate");}}// Add Transplanted Eye Emperor Time for those with stolen eyes (level 50 required) if(player.transplantedEyeLevel>=50&&battleState.playerAura>=100){if(!battleState.emperorTimeActive){actions.push("transplantedEmperorTimeActivate");}else if(battleState.emperorTimeActive){actions.push("emperorTimeDeactivate");}}// Add GodSpeed abilities if player has GodSpeed as second Hatsu if(player.secondHatsu&&player.secondHatsu.name==="GodSpeed"){if(battleState.playerAura>=battleActions.godspeedWhirlwind.auraRequired){actions.push("godspeedWhirlwind");}if(battleState.playerAura>=battleActions.godspeedSpeedOfLightning.auraRequired){actions.push("godspeedSpeedOfLightning");}}// Add Zero Hand for Netero clan with 100-Type Guanyin Bodhisattva and Zero Hand as second Hatsu if(player.clan==="netero"&&player.hatsu&&player.hatsu.name==="100-Type Guanyin Bodhisattva"&&player.secondHatsu&&player.secondHatsu.name==="Zero Hand"){// Only allow if enough aura and not already used this battle if(battleState.playerAura>=100&&!battleState.zeroHandUsed){actions.push("zeroHand");}}// Add clan-specific abilities if(player.race==="Human"&&player.clan&&humanClans[player.clan]){var clan=humanClans[player.clan];if(battleState.playerAura>=clan.specialAbility.auraRequired){actions.push("clanSpecial");}}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";// Show Emperor Time status if(battleState.emperorTimeActive){battleText+="🔴 EMPEROR TIME ACTIVE (Draining health) 🔴\n";}if(battleState.scarletEyesLevel>0){battleText+="👁️ Scarlet Eyes Level "+battleState.scarletEyesLevel+"\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);// Handle Emperor Time health drain if(battleState.emperorTimeActive){// Higher eye levels reduce drain rate var drainReduction=Math.max(0.1,1-player.scarletEyesLevel*0.1);var actualDrain=emperorTimeData.healthDrainPerSecond*drainReduction/60;battleState.emperorTimeHealthDrain+=actualDrain;// Drain per frame if(battleState.emperorTimeHealthDrain>=1){var drainAmount=Math.floor(battleState.emperorTimeHealthDrain);battleState.playerHealth-=drainAmount;battleState.emperorTimeHealthDrain-=drainAmount;// Flash red when health drains LK.effects.flashScreen(0x660000,200);// Check if player dies from drain if(battleState.playerHealth<=0){battleState.battleLog.push("Emperor Time has drained your life force! You collapse!");endBattle(false);return;}}}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;}else if(battleState.emperorTimeActive&&(actionKey==="chainJail"||actionKey==="holyChain"||actionKey==="dowsingChain"||actionKey==="judgmentChain")){// Highlight Kurapika's Chain abilities in red when Emperor Time is active actionButton.children[0].tint=0xff0000;// Assuming buttonBg is the first child }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"zeroHand":// Only allow once per battle if(battleState.zeroHandUsed){battleState.battleLog.push("Zero Hand can only be used once per battle!");break;}battleState.zeroHandUsed=true;// Use all remaining aura for the attack var zeroHandAura=battleState.playerAura;battleState.playerAura=0;// Balanced: scale with strength, aura, and level, but cap at 80% of enemy health damage=Math.floor(player.stats.strength*6+player.stats.aura*4+player.level*10+Math.random()*100)+zeroHandAura*2;var maxAllowed=Math.floor(battleState.enemyHealth*0.8);if(damage>=battleState.enemyHealth){damage=Math.max(1,battleState.enemyHealth-1);}if(damage>maxAllowed){damage=maxAllowed;}logMessage="You unleash the ultimate: ZERO HAND!\nAll your remaining aura explodes in a single, overwhelming blast for "+damage+" damage!\n(Zero Hand cannot instantly kill, but leaves your foe on the brink!)";LK.effects.flashScreen(0xffe066,2000);break;case"attack":// Basic attack: scale with strength and a small random factor, add a small bonus from aura damage=Math.floor(player.stats.strength*1.1+player.stats.aura*0.2+Math.random()*10);// 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){// Balanced: scale with strength, aura, and Hatsu level, plus a random factor var hatsuLevel=player.hatsuLevel||1;damage=Math.floor(player.stats.strength*0.8+player.stats.aura*1.2+hatsuLevel*5+Math.random()*20);// Apply Hatsu battle effects 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":// Balanced: scale with strength and level, high multiplier, chance to stun damage=Math.floor(player.stats.strength*2.2+player.level*5+Math.random()*30);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":// Balanced: scale with aura and level, ignores defense damage=Math.floor(player.stats.aura*1.5+player.level*4+Math.random()*25);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":// Balanced: scale with speed, strength, and level, high multiplier, chance to cause bleed damage=Math.floor((player.stats.speed+player.stats.strength)*1.2+player.level*4+Math.random()*30);damage=Math.floor(damage*2.0);logMessage="You strike: 'Jajanken: Scissors!' Sharp transmuted aura cuts deep for "+damage+" damage!";if(Math.random()<0.3){battleState.poisonDamage=Math.floor(damage*0.15);battleState.poisonTurns=2;logMessage+=" The cutting aura causes bleeding!";}if(player.nenVow){damage=Math.floor(damage*player.nenVow.powerBoost);}break;case"nenTechnique":// Balanced: scale with aura and intelligence, plus a small random factor damage=Math.floor(player.stats.aura*0.7+player.stats.intelligence*0.5+Math.random()*15);// 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;var shockwaveVariant=Math.floor(Math.random()*3);// 0, 1, or 2 switch(shockwaveVariant){case 0:// Single Devastating Wave damage=player.stats.strength*3.0+Math.floor(Math.random()*60);if(Math.random()<0.6){battleState.enemyStunned=true;logMessage="You charge your fist with concentrated aura: 'Shockwave Punch: Crushing Wave!' A single devastating shockwave hits for "+damage+" damage and stuns the enemy!";}else{logMessage="You unleash: 'Shockwave Punch: Crushing Wave!' One powerful concentrated shockwave deals "+damage+" damage!";}break;case 1:// Multiple Rapid Waves damage=player.stats.strength*2.2+Math.floor(Math.random()*40);var waveCount=3+Math.floor(Math.random()*3);// 3-5 waves damage*=waveCount;logMessage="You rapidly punch the air: 'Shockwave Punch: Rapid Barrage!' "+waveCount+" consecutive shockwaves deal "+damage+" total damage!";if(Math.random()<0.3){battleState.enemyStunned=true;logMessage+=" The overwhelming barrage stuns the enemy!";}break;case 2:// Piercing Concentrated Wave damage=player.stats.strength*2.6+Math.floor(Math.random()*50);battleState.ignoredDefense=true;logMessage="You focus all your power into a needle-point: 'Shockwave Punch: Piercing Lance!' A concentrated lance of energy pierces through all defenses for "+damage+" damage!";if(Math.random()<0.4){battleState.poisonDamage=Math.floor(damage*0.2);battleState.poisonTurns=2;logMessage+=" The piercing energy causes internal damage!";}break;}if(player.nenVow){damage=Math.floor(damage*player.nenVow.powerBoost);}break;case"enhancementOverload":// Enhancement Overload variants based on stat focus var overloadVariant=Math.floor(Math.random()*3);// 0, 1, or 2 switch(overloadVariant){case 0:// Strength Overload damage=player.stats.strength*4.0+Math.floor(Math.random()*80);battleState.overloadActive=4;// Lasts 4 turns player.stats.strength+=100;logMessage="You push your strength beyond all limits: 'Enhancement Overload: Titan Mode!' Devastating attack for "+damage+" damage! Your strength is dramatically enhanced!";if(Math.random()<0.5){battleState.enemyStunned=true;logMessage+=" The overwhelming force stuns the enemy!";}break;case 1:// Speed Overload damage=player.stats.strength*2.8+Math.floor(Math.random()*50);battleState.overloadActive=3;player.stats.speed+=150;player.stats.strength+=25;var attackCount=3;damage*=attackCount;logMessage="You enhance your speed to superhuman levels: 'Enhancement Overload: Lightning Mode!' "+attackCount+" lightning-fast strikes deal "+damage+" total damage! Your speed is dramatically enhanced!";break;case 2:// Defensive Overload damage=player.stats.strength*2.0+Math.floor(Math.random()*40);battleState.overloadActive=5;player.stats.strength+=50;player.maxHealth+=100;battleState.playerHealth+=100;battleState.nextGuard=true;// Auto-guard next attack logMessage="You enhance your defensive capabilities: 'Enhancement Overload: Fortress Mode!' Attack for "+damage+" damage while gaining massive defensive bonuses! You're prepared to guard the next attack!";break;}if(player.nenVow){damage=Math.floor(damage*player.nenVow.powerBoost);}break;case"focusedStrike":// Focused Strike variants based on targeting var focusVariant=Math.floor(Math.random()*3);// 0, 1, or 2 switch(focusVariant){case 0:// Vital Point Strike damage=player.stats.strength*3.0+Math.floor(Math.random()*60);if(Math.random()<0.8){damage=Math.floor(damage*2.0);// Double damage critical battleState.ignoredDefense=true;logMessage="You target a vital point: 'Focused Strike: Vital Shot!' Perfect critical strike to a weak point for "+damage+" damage that ignores all defenses!";}else{logMessage="You aim for vital points: 'Focused Strike: Vital Shot!' Precise targeting deals "+damage+" damage!";}break;case 1:// Pressure Point Strike damage=player.stats.strength*2.2+Math.floor(Math.random()*35);if(Math.random()<0.7){battleState.enemyStunned=true;battleState.needleDebuff=true;// Weakens enemy's next attack logMessage="You strike pressure points: 'Focused Strike: Pressure Lock!' Precise nerve strikes deal "+damage+" damage, stun the enemy, and weaken their next attack!";}else{logMessage="You target pressure points: 'Focused Strike: Pressure Lock!' Nerve-targeting attack deals "+damage+" damage!";}break;case 2:// Energy Point Strike damage=player.stats.strength*2.8+Math.floor(Math.random()*45);if(Math.random()<0.6){var auraDrain=Math.floor(damage*0.5);battleState.enemyAura=Math.max(0,battleState.enemyAura-auraDrain);logMessage="You target aura points: 'Focused Strike: Energy Sever!' Aura-disrupting strike deals "+damage+" damage and drains "+auraDrain+" enemy aura!";}else{logMessage="You strike at energy flow points: 'Focused Strike: Energy Sever!' Aura-disrupting attack deals "+damage+" damage!";}battleState.ignoredDefense=true;break;}if(player.nenVow){damage=Math.floor(damage*player.nenVow.powerBoost);}break;case"titanFistVariants":// Titan Fist variants based on technique var titanVariant=Math.floor(Math.random()*3);switch(titanVariant){case 0:// Crushing Blow damage=player.stats.strength*3.5+Math.floor(Math.random()*70);if(Math.random()<0.5){battleState.enemyStunned=true;logMessage="You wind up for a devastating blow: 'Titan Fist: Crushing Meteor!' A planet-crushing punch deals "+damage+" damage and stuns the enemy!";}else{logMessage="You unleash: 'Titan Fist: Crushing Meteor!' Devastating punch deals "+damage+" damage!";}break;case 1:// Rapid Titan Strikes damage=player.stats.strength*2.0+Math.floor(Math.random()*40);var strikeCount=4;damage*=strikeCount;logMessage="You throw a flurry of enhanced punches: 'Titan Fist: Meteor Storm!' "+strikeCount+" powerful strikes deal "+damage+" total damage!";break;case 2:// Armor-Breaking Strike damage=player.stats.strength*2.8+Math.floor(Math.random()*50);battleState.ignoredDefense=true;battleState.armorBreak=2;// Reduces enemy defense for 2 turns logMessage="You strike with bone-crushing force: 'Titan Fist: Armor Breaker!' Defense-shattering punch deals "+damage+" damage and breaks through all armor!";break;}if(player.nenVow){damage=Math.floor(damage*player.nenVow.powerBoost);}break;case"ironSkinVariants":// Iron Skin variants focus on defense with counter-attacks var ironVariant=Math.floor(Math.random()*3);switch(ironVariant){case 0:// Reflective Skin damage=Math.floor(player.stats.strength*0.8)+Math.floor(Math.random()*20);battleState.reflectDamage=3;// Reflects damage for 3 turns battleState.nextGuard=true;logMessage="You harden your skin to mirror-like quality: 'Iron Skin: Mirror Shell!' Light attack for "+damage+" damage but you'll reflect enemy attacks back!";break;case 1:// Spikes Defense damage=player.stats.strength*1.5+Math.floor(Math.random()*30);battleState.spikeDefense=2;// Damages attackers for 2 turns player.maxHealth+=50;battleState.playerHealth+=50;logMessage="You grow metallic spikes from your skin: 'Iron Skin: Thorn Armor!' Strike for "+damage+" damage while gaining spike defense that hurts attackers!";break;case 2:// Adaptive Armor damage=player.stats.strength*2.0+Math.floor(Math.random()*35);battleState.adaptiveArmor=4;// Becomes stronger each turn battleState.nextGuard=true;logMessage="Your skin adapts to threats: 'Iron Skin: Evolution Armor!' Attack for "+damage+" damage with armor that gets stronger each turn!";break;}if(player.nenVow){damage=Math.floor(damage*player.nenVow.powerBoost);}break;case"berserkerRageVariants":// Berserker variants focus on uncontrolled power var berserkerVariant=Math.floor(Math.random()*3);switch(berserkerVariant){case 0:// Uncontrolled Fury damage=player.stats.strength*4.0+Math.floor(Math.random()*80);battleState.berserkerFury=3;// Cannot guard but massive damage for 3 turns player.stats.strength+=150;player.stats.speed+=100;battleState.cannotGuard=3;logMessage="You lose all control: 'Berserker Rage: Mindless Fury!' Devastating attack for "+damage+" damage! You cannot guard but your power is overwhelming!";break;case 1:// Blood Frenzy damage=player.stats.strength*3.0+Math.floor(Math.random()*60);var healthCost=Math.floor(battleState.playerHealth*0.2);battleState.playerHealth-=healthCost;damage+=healthCost*2;// Converts health to damage logMessage="You sacrifice health for power: 'Berserker Rage: Blood Frenzy!' Spend "+healthCost+" health to deal "+damage+" massive damage!";break;case 2:// Escalating Rage damage=player.stats.strength*2.5+Math.floor(Math.random()*50);battleState.escalatingRage=(battleState.escalatingRage||0)+1;damage*=battleState.escalatingRage;logMessage="Your rage builds: 'Berserker Rage: Escalation!' Rage multiplier x"+battleState.escalatingRage+" deals "+damage+" damage! Each use makes you stronger!";break;}if(player.nenVow){damage=Math.floor(damage*player.nenVow.powerBoost);}break;case"perfectEnhancementVariants":// Perfect Enhancement variants showcase mastery var perfectVariant=Math.floor(Math.random()*3);switch(perfectVariant){case 0:// Perfect Weapon Enhancement damage=player.stats.strength*3.8+Math.floor(Math.random()*75);battleState.ignoredDefense=true;battleState.perfectWeapon=2;// Enhanced attacks for 2 turns logMessage="You enhance your fists to perfection: 'Perfect Enhancement: Ultimate Weapon!' Perfect weapon strikes for "+damage+" damage that ignore all defenses!";break;case 1:// Perfect Body Enhancement damage=player.stats.strength*2.5+Math.floor(Math.random()*45);player.stats.strength+=100;player.stats.speed+=100;player.stats.aura+=50;battleState.perfectBody=4;// All stats enhanced for 4 turns logMessage="You enhance your entire body: 'Perfect Enhancement: Ultimate Form!' Strike for "+damage+" damage with perfect physical enhancement!";break;case 2:// Perfect Aura Enhancement damage=player.stats.aura*2.0+Math.floor(Math.random()*40);var auraRecovered=Math.floor(player.maxAura*0.3);battleState.playerAura=Math.min(player.maxAura,battleState.playerAura+auraRecovered);battleState.perfectAura=3;// Aura efficiency enhanced for 3 turns logMessage="You achieve perfect aura control: 'Perfect Enhancement: Ultimate Aura!' Aura-enhanced strike for "+damage+" damage while recovering "+auraRecovered+" aura!";break;}if(player.nenVow){damage=Math.floor(damage*player.nenVow.powerBoost);}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;case"ultimatePotential":// Ultimate Nen Vow - massive power boost but death after battle battleState.ultimateVowUsed=true;// Track achievement _storage.ultimateVowUsed=(_storage.ultimateVowUsed||0)+1;// Gain 100 levels (beyond normal 50 limit) player.level=100;// Massive stat boosts (defensive: only apply once per vow use) if(!battleState.ultimateVowBoosted){player.stats.strength+=2000;player.stats.speed+=2000;player.stats.intelligence+=2000;player.stats.aura+=10000;player.maxHealth+=2000;player.maxAura+=10000;battleState.ultimateVowBoosted=true;}// Full heal and aura battleState.playerHealth=player.maxHealth;battleState.playerAura=player.maxAura;// Upgrade all Hatsu to ultimate versions if(player.hatsu){if(!player.hatsu.description.startsWith("ULTIMATE ")){player.hatsu.description="ULTIMATE "+player.hatsu.description;}player.hatsuMastery=100;if(player.hatsu.battleEffects&&player.hatsu.battleEffects.multiplier){player.hatsu.battleEffects.multiplier=player.hatsu.battleEffects.multiplier*5;}}damage=player.stats.strength*10+Math.floor(Math.random()*1000);// Massive damage logMessage="You make the ultimate Nen Vow! 'I sacrifice my life to reach my full potential!' Your power explodes beyond all limits! Devastating attack for "+damage+" damage! You feel your life force burning away...";LK.effects.flashScreen(0xffffff,2000);// Bright white flash break;case"emperorTimeVow":// Emperor Time Nen Vow - Kurta clan special ability battleState.ultimateVowUsed=true;// Gain 100 levels (beyond normal 50 limit) player.level=100;// Massive stat boosts player.stats.strength+=2000;player.stats.speed+=2000;player.stats.intelligence+=2000;player.stats.aura+=10000;// Massive health and aura boosts player.maxHealth+=2000;player.maxAura+=10000;battleState.playerHealth=player.maxHealth;// Full heal battleState.playerAura=player.maxAura;// Full aura // Create Emperor Time as second Hatsu player.secondHatsu={name:"Emperor Time",description:"ULTIMATE EMPEROR TIME - Master all Nen categories with perfect efficiency. All abilities become ultimate versions.",auraReq:100,conditions:"Eyes must be scarlet, life force drains rapidly",battleEffects:{type:"emperor_time_ultimate",multiplier:10.0,special:"all_categories_master"}};// Upgrade original Hatsu to ultimate version if(player.hatsu){player.hatsu.description="ULTIMATE "+player.hatsu.description;player.hatsuMastery=100;if(player.hatsu.battleEffects&&player.hatsu.battleEffects.multiplier){player.hatsu.battleEffects.multiplier*=10;// 10x damage multiplier for Kurta }}damage=player.stats.aura*15+Math.floor(Math.random()*1500);// Massive Emperor Time damage logMessage="Your eyes blaze SCARLET! 'I vow to create Emperor Time as my second Hatsu!' Reality bends around your perfect mastery! All Nen categories become ultimate! Devastating Emperor Time attack for "+damage+" damage! The screen turns red as your eyes burn with power!";LK.effects.flashScreen(0xff0000,3000);// Deep red flash for scarlet eyes // Change background to red temporarily game.setBackgroundColor(0x660000);break;case"scarletEyes":// Can only activate up to player's trained level var maxActivationLevel=Math.min(3,player.scarletEyesLevel+1);battleState.scarletEyesLevel=Math.min(maxActivationLevel,battleState.scarletEyesLevel+1);damage=0;// No immediate damage logMessage="Your eyes begin to glow scarlet! Scarlet Eyes Level "+battleState.scarletEyesLevel+" activated!";// Gain combat experience for eye training if(player.clan==="kurta"){player.scarletEyesProgress+=5;if(player.scarletEyesProgress>=100&&player.scarletEyesLevel<20){player.scarletEyesLevel++;player.scarletEyesProgress=0;logMessage+=" Your eyes have evolved from combat experience! New level: "+player.scarletEyesLevel+"!";LK.effects.flashScreen(0xffffff,500);}}if(battleState.scarletEyesLevel>=3){logMessage+=" Maximum battle level reached! Emperor Time is now available!";}// Apply stat boosts based on level (stronger with higher trained level) var statBoost=battleState.scarletEyesLevel*(5+Math.floor(player.scarletEyesLevel/2));player.stats.strength+=statBoost;player.stats.speed+=statBoost;player.stats.intelligence+=statBoost;player.stats.aura+=statBoost;// Visual effect based on level var flashColor=battleState.scarletEyesLevel===1?0xff6666:battleState.scarletEyesLevel===2?0xff3333:0xff0000;LK.effects.flashScreen(flashColor,1000);break;case"emperorTimeActivate":if(battleState.scarletEyesLevel>=3||player.scarletEyesLevel>=3){battleState.emperorTimeActive=true;battleState.emperorTimeHealthDrain=0;damage=0;// No immediate damage logMessage="EMPEROR TIME ACTIVATED! Your eyes blaze with ultimate scarlet power! All Nen types mastered! (Health will drain over time)";// Track achievement _storage.emperorTimeUsed=(_storage.emperorTimeUsed||0)+1;// Check Emperor Time user achievement (first use) if(_storage.emperorTimeUsed===1){var emperorTimeUserAchievement=achievements.combat.achievements[2];if(!emperorTimeUserAchievement.unlocked&&emperorTimeUserAchievement.condition()){var storageKey="achievement_"+emperorTimeUserAchievement.id;if(!_storage[storageKey]){emperorTimeUserAchievement.unlocked=true;_storage[storageKey]=1;player.skillPoints+=emperorTimeUserAchievement.reward.skillPoints;player.experience+=emperorTimeUserAchievement.reward.experience;showAchievementNotification(emperorTimeUserAchievement);}}}// Check Emperor Time master achievement (100 uses) if(_storage.emperorTimeUsed===100){var emperorTimeMasterAchievement=achievements.hidden.achievements[0];if(!emperorTimeMasterAchievement.unlocked&&emperorTimeMasterAchievement.condition()){var storageKey="achievement_"+emperorTimeMasterAchievement.id;if(!_storage[storageKey]){emperorTimeMasterAchievement.unlocked=true;_storage[storageKey]=1;player.skillPoints+=emperorTimeMasterAchievement.reward.skillPoints;player.experience+=emperorTimeMasterAchievement.reward.experience;showAchievementNotification(emperorTimeMasterAchievement);// Unlock Uchiha clan if(emperorTimeMasterAchievement.reward.unlocksClan==="uchiha"){unlockUchihaClan();}}}}// Stat boost scales with trained eye level var eyePower=Math.max(1,player.scarletEyesLevel);var strengthBoost=100+eyePower*20;var speedBoost=100+eyePower*20;var intBoost=100+eyePower*20;var auraBoost=200+eyePower*50;player.stats.strength+=strengthBoost;player.stats.speed+=speedBoost;player.stats.intelligence+=intBoost;player.stats.aura+=auraBoost;logMessage+=" Eye Level "+player.scarletEyesLevel+" amplifies the power!";// Change screen to red game.setBackgroundColor(0x330000);LK.effects.flashScreen(0xff0000,2000);}break;case"emperorTimeDeactivate":battleState.emperorTimeActive=false;damage=0;logMessage="Emperor Time deactivated. Your eyes return to normal.";// Remove temporary stat boosts player.stats.strength-=200;player.stats.speed-=200;player.stats.intelligence-=200;player.stats.aura-=500;// Reset screen color game.setBackgroundColor(0x1a1a1a);break;case"transplantedEmperorTimeActivate":if(player.transplantedEyeLevel>=50){battleState.emperorTimeActive=true;battleState.emperorTimeHealthDrain=0;damage=0;// No immediate damage logMessage="STOLEN EMPEROR TIME ACTIVATED! Your transplanted scarlet eyes blaze with stolen power! All Nen types accessible but at 50% efficiency! (Health will drain faster due to rejection)";// Track achievement _storage.emperorTimeUsed=(_storage.emperorTimeUsed||0)+1;// Weaker stat boosts than natural Emperor Time var strengthBoost=75;// 50% less than natural var speedBoost=75;var intBoost=75;var auraBoost=150;player.stats.strength+=strengthBoost;player.stats.speed+=speedBoost;player.stats.intelligence+=intBoost;player.stats.aura+=auraBoost;// Higher health drain rate due to rejection battleState.emperorTimeHealthDrain=emperorTimeData.healthDrainPerSecond*2;// Double drain logMessage+=" The foreign eyes strain your body heavily!";// Change screen to dark red (less vibrant than natural) game.setBackgroundColor(0x220000);LK.effects.flashScreen(0x660000,2000);}break;case"emperorTimeActivate":damage=Math.floor((player.stats.strength+player.stats.aura+player.stats.intelligence)*emperorTimeData.damageMultiplier)+Math.floor(Math.random()*150);battleState.ignoredDefense=true;logMessage="EMPEROR TIME ULTIMATE ATTACK! Perfect mastery of all Nen types unleashed for "+damage+" damage!";// Special effects for different Nen combinations if(Math.random()<0.6){battleState.enemyStunned=true;logMessage+=" The overwhelming Nen mastery stuns the enemy!";}LK.effects.flashScreen(0xff0000,1000);break;case"clanSpecial":if(player.race==="Human"&&player.clan&&humanClans[player.clan]){var clan=humanClans[player.clan];var specialAbility=clan.specialAbility;damage=Math.floor((player.stats.strength+player.stats.aura+player.stats.intelligence)*specialAbility.multiplier)+Math.floor(Math.random()*100);switch(player.clan){case"netero":logMessage="You channel the power of your ancestor! '100-Type Guanyin Bodhisattva!' A massive golden statue appears and strikes for "+damage+" damage!";_storage.bodhisattvaUsed=(_storage.bodhisattvaUsed||0)+1;if(Math.random()<0.4){battleState.enemyStunned=true;logMessage+=" The divine presence overwhelms your enemy!";}break;case"zoldyck":logMessage="You activate the Zoldyck assassination arts! Lightning-fast killing techniques deal "+damage+" damage!";if(Math.random()<0.2){damage=battleState.enemyHealth;// Instant kill chance logMessage="ASSASSINATION! Your strike finds a vital point - instant kill!";_storage.assassinationSuccess=(_storage.assassinationSuccess||0)+1;}break;case"freecss":logMessage="Your hunter's instinct awakens! 'Natural Enhancement!' Your fighting spirit deals "+damage+" damage!";// Boost stats temporarily player.stats.strength+=20;player.stats.speed+=20;logMessage+=" Your physical abilities are enhanced!";break;case"lucilfer":logMessage="You tap into ancestral knowledge! Ancient techniques strike for "+damage+" damage!";if(Math.random()<0.3&&battleState.enemy.hatsu){logMessage+=" You temporarily steal your enemy's technique!";// Next attack will use enemy's multiplier battleState.stolenTechnique=true;}break;case"kurta":logMessage="Your eyes blaze scarlet! 'Emperor Time!' All Nen mastery activated for "+damage+" damage!";battleState.ignoredDefense=true;if(Math.random()<0.5){damage=Math.floor(damage*1.5);logMessage+=" Perfect mastery amplifies the attack!";}break;}LK.effects.flashScreen(0xffd700,1000);}break;case"nenTen":damage=0;battleState.tenDefense=3;// Lasts 3 turns battleState.nextGuard=true;var defenseBonus=Math.floor(player.stats.aura*0.2);battleState.tenDefenseBonus=defenseBonus;logMessage="You shroud your body with aura! 'Ten!' Enhanced defense for 3 turns (+"+defenseBonus+" defense)!";LK.effects.flashScreen(0x0066ff,500);break;case"nenZetsu":damage=0;battleState.zetsuActive=2;// Lasts 2 turns battleState.nextAttackSurprise=true;logMessage="You stop your aura flow! 'Zetsu!' You become nearly invisible - next attack will be a surprise!";LK.effects.flashScreen(0x333333,500);break;case"nenRen":damage=player.stats.aura+Math.floor(Math.random()*20);var statBoost=Math.floor(player.stats.aura*0.1);player.stats.strength+=statBoost;player.stats.speed+=statBoost;battleState.renActive=4;// Lasts 4 turns logMessage="You increase your aura output! 'Ren!' Attack for "+damage+" damage and boost physical stats by "+statBoost+" for 4 turns!";LK.effects.flashScreen(0x00ff00,500);break;case"nenKo":damage=(player.stats.strength+player.stats.aura)*2+Math.floor(Math.random()*50);battleState.ignoredDefense=true;battleState.koVulnerable=2;// Vulnerable for 2 turns after use logMessage="You focus all aura into one point! 'Ko!' Devastating focused strike for "+damage+" damage that ignores all defenses! You're vulnerable for 2 turns!";if(Math.random()<0.6){battleState.enemyStunned=true;logMessage+=" The concentrated attack stuns the enemy!";}LK.effects.flashScreen(0xffff00,800);break;case"nenKen":damage=0;battleState.kenDefense=5;// Lasts 5 turns var healthBoost=Math.floor(player.stats.aura*0.3);battleState.playerHealth+=healthBoost;battleState.kenHealthBoost=healthBoost;logMessage="You maintain enhanced aura! 'Ken!' Sustained defense for 5 turns and +"+healthBoost+" temporary health!";LK.effects.flashScreen(0x00aaaa,500);break;case"nenEn":damage=player.stats.aura+Math.floor(Math.random()*30);battleState.enActive=3;// Lasts 3 turns battleState.nextAttackRevealed=true;var auraRecovered=Math.floor(player.stats.aura*0.1);battleState.playerAura+=auraRecovered;logMessage="You extend your aura! 'En!' Area attack for "+damage+" damage, reveal enemy's next move, and recover "+auraRecovered+" aura!";LK.effects.flashScreen(0x00ffff,500);break;case"nenGyo":damage=player.stats.intelligence+Math.floor(Math.random()*25);battleState.gyoActive=3;// Lasts 3 turns battleState.seeHiddenAttacks=true;logMessage="You focus aura into your eyes! 'Gyo!' Enhanced vision attack for "+damage+" damage! You can see hidden techniques for 3 turns!";if(battleState.enemy.hatsu){logMessage+=" You've analyzed the enemy's "+battleState.enemy.hatsu.name+"!";battleState.hatsuAnalyzed=true;}LK.effects.flashScreen(0xff00ff,500);break;case"nenIn":damage=player.stats.intelligence+player.stats.speed+Math.floor(Math.random()*35);battleState.inActive=2;// Lasts 2 turns battleState.nextAttackSurprise=true;battleState.ignoredDefense=true;logMessage="You hide your aura completely! 'In!' Concealed surprise attack for "+damage+" damage that ignores defenses!";LK.effects.flashScreen(0x000066,500);break;case"nenShu":damage=player.stats.strength+player.stats.aura+Math.floor(Math.random()*40);battleState.shuActive=3;// Lasts 3 turns battleState.weaponEnhanced=true;var weaponBonus=Math.floor(player.stats.aura*0.2);battleState.shuWeaponBonus=weaponBonus;logMessage="You extend aura to your weapons! 'Shu!' Enhanced weapon attack for "+damage+" damage! All attacks gain +"+weaponBonus+" damage for 3 turns!";LK.effects.flashScreen(0xffaa00,500);break;case"godspeedWhirlwind":var baseLevel=player.secondHatsuLevel||1;var masteryBonus=Math.floor((player.secondHatsuMastery||0)/20);damage=(player.stats.speed+player.stats.aura)*(2.0+baseLevel*0.1)+Math.floor(Math.random()*50);damage=Math.floor(damage*(1+masteryBonus*0.1));battleState.whirlwindActive=3;// Enhanced speed for 3 turns player.stats.speed+=50;if(Math.random()<0.4){battleState.enemyStunned=true;logMessage="You activate GodSpeed: Whirlwind! Lightning-fast movement creates devastating whirlwind attacks for "+damage+" damage and stuns the enemy!";}else{logMessage="You unleash GodSpeed: Whirlwind! Lightning speed creates multiple striking whirlwinds for "+damage+" damage!";}LK.effects.flashScreen(0x00ffff,800);break;case"godspeedSpeedOfLightning":var baseLevel=player.secondHatsuLevel||1;var masteryBonus=Math.floor((player.secondHatsuMastery||0)/20);damage=(player.stats.speed+player.stats.aura)*(2.5+baseLevel*0.15)+Math.floor(Math.random()*75);damage=Math.floor(damage*(1+masteryBonus*0.15));battleState.ignoredDefense=true;battleState.lightningSpeedActive=2;// Ultimate speed for 2 turns player.stats.speed+=100;if(Math.random()<0.6){damage=Math.floor(damage*1.5);logMessage="You achieve Speed of Lightning! Instantaneous movement allows you to strike from impossible angles for "+damage+" damage that ignores all defenses! Critical hit!";}else{logMessage="You move at the Speed of Lightning! Instantaneous strikes from multiple positions deal "+damage+" damage that bypasses all defenses!";}LK.effects.flashScreen(0xffff00,1000);case"chainJail":// Kurapika's most dangerous attack - potential instant kill var chainJailDamage=Math.floor((player.stats.intelligence+player.stats.aura)*2.0+Math.random()*75);logMessage="You summon the Chain Jail!";// Check for instant kill condition (vs Phantom Troupe or similar) if(battleState.enemy.abilities.includes("Spider Tattoo")||Math.random()<0.2){// 20% chance on non-troupe chainJailDamage=battleState.enemyHealth;// Instant kill logMessage+=" The Chain Jail binds the enemy completely! Instantly defeated!";}else{logMessage+=" The Chain Jail restrains and damages the enemy for "+chainJailDamage+"!";// Apply immobilization debuff battleState.enemyStunned=true;}damage=chainJailDamage;if(player.nenVow){damage=Math.floor(damage*player.nenVow.powerBoost);}break;case"holyChain":var healAmount=Math.floor((player.stats.aura+player.stats.intelligence)*0.5+Math.random()*30);player.health=Math.min(player.maxHealth,player.health+healAmount);var holyChainDamage=Math.floor((player.stats.intelligence+player.stats.aura)*1.2+Math.random()*20);logMessage="You summon the Holy Chain! Healing yourself for "+healAmount+" HP and striking for "+holyChainDamage+" damage!";damage=holyChainDamage;if(player.nenVow){damage=Math.floor(damage*player.nenVow.powerBoost);}break;case"dowsingChain":var dowsingDamage=Math.floor((player.stats.intelligence+player.stats.speed)*1.8+Math.random()*35);battleState.ignoredDefense=true;logMessage="You summon the Dowsing Chain! It tracks the enemy's movements and strikes for "+dowsingDamage+" damage, ignoring defenses!";// Reveal enemy's next action battleState.nextAttackRevealed=true;damage=dowsingDamage;if(player.nenVow){damage=Math.floor(damage*player.nenVow.powerBoost);}break;case"judgmentChain":var judgmentDamage=Math.floor((player.stats.intelligence+player.stats.strength)*2.0+Math.random()*40);logMessage="You summon the Judgment Chain! Piercing attack for "+judgmentDamage+" damage!";// Apply a curse that deals damage over time battleState.judgmentChainCurse={damage:Math.floor(judgmentDamage*0.3),turns:3};logMessage+=" The enemy is afflicted by a deadly curse!";damage=judgmentDamage;if(player.nenVow){damage=Math.floor(damage*player.nenVow.powerBoost);}break;break;}if(damage>0){battleState.enemyHealth-=damage;}battleState.battleLog.push(logMessage);battleState.playerTurn=false;// Clean up expired Nen technique effects if(battleState.zetsuActive>0){battleState.zetsuActive--;}if(battleState.renActive>0){battleState.renActive--;}if(battleState.enActive>0){battleState.enActive--;}if(battleState.gyoActive>0){battleState.gyoActive--;}if(battleState.inActive>0){battleState.inActive--;}if(battleState.shuActive>0){battleState.shuActive--;}// Apply ongoing Ren stat boosts if(battleState.renActive===0&&battleState.renBoostApplied){// Remove Ren stat boosts when effect ends var statBoost=Math.floor(player.stats.aura*0.1);player.stats.strength-=statBoost;player.stats.speed-=statBoost;battleState.renBoostApplied=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;case"Chain Jail":// Kurapika's most dangerous attack - instant kill if conditions are met if(player.race==="Human"&&(player.abilities.includes("Phantom Troupe")||Math.random()<0.15)){// Instant kill for Phantom Troupe members or 15% chance for others damage=battleState.playerHealth*2;// Guaranteed kill logMessage=enemy.name+"'s chains glow with deadly resolve: 'Chain Jail!' The chains wrap around you completely! If you disobey, you die instantly!";battleState.chainJailActive=true;}else{damage=enemy.stats.intelligence*2+Math.floor(Math.random()*60);logMessage=enemy.name+" summons his chains: 'Chain Jail!' Binding chains deal "+damage+" damage!";if(Math.random()<0.4){battleState.playerStunned=true;logMessage+=" You're bound and cannot move!";}}if(player.nenType==="Specialist"&&player.hatsu&&player.hatsu.name==="Ability Copy"){tryToCopyAbility("Chain Jail",{name:"Chain Jail",multiplier:2.5,special:"instant_kill_condition"});}break;case"Holy Chain":// Healing ability that also deals damage var healAmount=Math.floor(enemy.maxHealth*0.3);enemy.health=Math.min(enemy.maxHealth,enemy.health+healAmount);damage=enemy.stats.aura+Math.floor(Math.random()*25);logMessage=enemy.name+" uses 'Holy Chain!' Healing "+healAmount+" HP and attacking for "+damage+" damage!";if(player.nenType==="Specialist"&&player.hatsu&&player.hatsu.name==="Ability Copy"){tryToCopyAbility("Holy Chain",{name:"Holy Chain",multiplier:1.5,special:"heal_and_damage"});}break;case"Dowsing Chain":// Tracking and piercing attack damage=enemy.stats.intelligence+enemy.stats.speed+Math.floor(Math.random()*35);battleState.ignoredDefense=true;logMessage=enemy.name+" extends his 'Dowsing Chain!' It tracks your movement and strikes for "+damage+" damage!";if(Math.random()<0.3){battleState.nextAttackRevealed=true;logMessage+=" The chain reveals your next attack!";}if(player.nenType==="Specialist"&&player.hatsu&&player.hatsu.name==="Ability Copy"){tryToCopyAbility("Dowsing Chain",{name:"Dowsing Chain",multiplier:2.0,special:"tracking_pierce"});}break;case"Judgment Chain":// Places a deadly curse damage=enemy.stats.intelligence+Math.floor(Math.random()*30);logMessage=enemy.name+" pierces your heart with 'Judgment Chain!' You take "+damage+" damage!";if(Math.random()<0.5){battleState.judgmentChainActive=3;// Lasts 3 turns logMessage+=" A deadly chain wraps around your heart! Breaking Kurapika's rules will kill you!";}if(player.nenType==="Specialist"&&player.hatsu&&player.hatsu.name==="Ability Copy"){tryToCopyAbility("Judgment Chain",{name:"Judgment Chain",multiplier:1.8,special:"death_curse"});}break;case"Emperor Time":// Ultimate ability that enhances all stats temporarily damage=enemy.stats.aura*1.5+Math.floor(Math.random()*50);logMessage=enemy.name+"'s eyes blaze scarlet: 'Emperor Time!' All Nen types mastered! Devastating attack for "+damage+" damage!";// Enhance enemy stats temporarily battleState.emperorTimeActive=2;// Lasts 2 turns enemy.stats.strength+=20;enemy.stats.speed+=20;enemy.stats.intelligence+=20;enemy.stats.aura+=20;if(Math.random()<0.4){battleState.playerStunned=true;logMessage+=" The overwhelming Nen presence stuns you!";}if(player.nenType==="Specialist"&&player.hatsu&&player.hatsu.name==="Ability Copy"){tryToCopyAbility("Emperor Time",{name:"Emperor Time",multiplier:2.8,special:"all_types_mastery"});}break;default:// Generic Hatsu attack for any other abilities - now more powerful damage=enemy.stats.strength+enemy.stats.aura+Math.floor(Math.random()*40);// Scale damage based on enemy level and multiply by Hatsu multiplier var hatsuMultiplier=enemy.hatsu.battleEffects&&enemy.hatsu.battleEffects.multiplier?enemy.hatsu.battleEffects.multiplier:1.0;damage=Math.floor(damage*(1+(enemy.level||1)*0.03)*hatsuMultiplier);// Increased scaling and apply Hatsu multiplier 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);// Scale damage based on enemy level damage=Math.floor(damage*(1+(enemy.level||1)*0.02));// Increased scaling 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 Nen technique defensive modifiers if(battleState.tenDefense>0){var tenReduction=Math.floor(damage*0.3)+battleState.tenDefenseBonus;damage=Math.max(1,damage-tenReduction);logMessage+=" Your Ten defense reduces damage by "+tenReduction+"!";battleState.tenDefense--;}if(battleState.kenDefense>0){var kenReduction=Math.floor(damage*0.4);damage=Math.max(1,damage-kenReduction);logMessage+=" Your Ken defense reduces damage by "+kenReduction+"!";battleState.kenDefense--;}if(battleState.koVulnerable>0){damage=Math.floor(damage*1.5);logMessage+=" Your Ko vulnerability increases damage!";battleState.koVulnerable--;}// Apply damage battleState.playerHealth-=damage;// Apply Judgment Chain curse damage if(battleState.judgmentChainCurse&&battleState.judgmentChainCurse.turns>0){var curseDamage=battleState.judgmentChainCurse.damage;battleState.enemyHealth-=curseDamage;battleState.battleLog.push(battleState.enemy.name+" is damaged by the Judgment Chain curse for "+curseDamage+"!");battleState.judgmentChainCurse.turns--;if(battleState.judgmentChainCurse.turns===0){delete battleState.judgmentChainCurse;}}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 // Convert object to string representation with proper null checks var witnessesStr="";if(player.copiedAbilityWitnesses&&_typeof2(player.copiedAbilityWitnesses)==='object'){for(var key in player.copiedAbilityWitnesses){if(player.copiedAbilityWitnesses.hasOwnProperty(key)){if(witnessesStr){witnessesStr+=",";}witnessesStr+=key+":"+player.copiedAbilityWitnesses[key];}}}else{player.copiedAbilityWitnesses={};}_storage.player_copiedAbilityWitnesses=witnessesStr;if(!player.copiedAbilities||!Array.isArray(player.copiedAbilities)){player.copiedAbilities=[null,null,null];}var copiedAbilitiesArray=[];for(var i=0;i<player.copiedAbilities.length;i++){if(player.copiedAbilities[i]&&player.copiedAbilities[i].name){copiedAbilitiesArray.push(player.copiedAbilities[i].name);}else{copiedAbilitiesArray.push("");}}_storage.player_copiedAbilities=copiedAbilitiesArray.join("|");var levelDefenseBonus=enemyLevel*0.005;// 0.5% defense bonus per level defenseLevel=1.0-Math.min(0.9,levelDefenseBonus);// Cap defense at 90% reduction if(enemyLevel>=50){// High-level bosses use Ken (maintain aura defense) if(Math.random()<0.7){defenseLevel=Math.min(defenseLevel,0.4);// Ken provides at least 60% reduction defenseType="Ken (Enhanced Defense)";}}else if(enemyLevel>=35){// Mid-level bosses use Ten (basic aura shroud) if(Math.random()<0.5){defenseLevel=Math.min(defenseLevel,0.6);// Ten provides at least 40% reduction defenseType="Ten (Aura Shroud)";}}else if(enemyLevel>=25){// Lower bosses have basic defense if(Math.random()<0.3){defenseLevel=Math.min(defenseLevel,0.8);// Basic provides at least 20% 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);// Track achievement _storage.abilitiesCopied=(_storage.abilitiesCopied||0)+1;break;}}}}function handleChimeraAntReincarnation(){var reincarnationChance=Math.random();var reincarnationType="";var newStats={};if(reincarnationChance<=0.05){// 5% chance to become King reincarnationType="Chimera Ant King";player.race="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";player.race="Chimera Ant Royal";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";player.race="Chimera Ant";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);var popup=new Text2("Chimera Ant Power! Stats Greatly Increased",{size:40,fill:0x880088});popup.anchor.set(0.5,0.5);popup.x=1024;popup.y=400;game.addChild(popup);LK.setTimeout(function(){if(popup.parent){popup.destroy();}},2000);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){var wasStoryBattle=battleState.storyContext!==null;var storyContext=battleState.storyContext;battleState.storyContext=null;// Clear context 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;// Track achievement progress _storage.battlesWon=(_storage.battlesWon||0)+1;// Check if this was a boss battle if(battleState.enemy.level>=25){_storage.bossesDefeated=(_storage.bossesDefeated||0)+1;}// Check if defeated enemy is Kurapika for eye extraction if(battleState.enemy.name==="Kurapika Kurta"){handleKurapikaEyeExtraction();return;// Skip normal end battle flow }while(player.experience>=player.maxExperience&&player.level<50){levelUp();}// Check achievements after battle win (fixes bug for storage-based achievements) checkAchievements();// Check specific battle achievements only when won if(_storage.battlesWon===1){// Check first victory achievement var firstVictoryAchievement=achievements.combat.achievements[0];if(!firstVictoryAchievement.unlocked&&firstVictoryAchievement.condition()){var storageKey="achievement_"+firstVictoryAchievement.id;if(!_storage[storageKey]){firstVictoryAchievement.unlocked=true;_storage[storageKey]=1;player.skillPoints+=firstVictoryAchievement.reward.skillPoints;player.experience+=firstVictoryAchievement.reward.experience;showAchievementNotification(firstVictoryAchievement);}}}else if(_storage.bossesDefeated===5){// Check boss slayer achievement var bossSlayerAchievement=achievements.combat.achievements[1];if(!bossSlayerAchievement.unlocked&&bossSlayerAchievement.condition()){var storageKey="achievement_"+bossSlayerAchievement.id;if(!_storage[storageKey]){bossSlayerAchievement.unlocked=true;_storage[storageKey]=1;player.skillPoints+=bossSlayerAchievement.reward.skillPoints;player.experience+=bossSlayerAchievement.reward.experience;showAchievementNotification(bossSlayerAchievement);}}}// Check if ultimate vow was used - death after victory if(battleState.ultimateVowUsed){storyPanel.setText("ULTIMATE VICTORY!\n\nYou defeated "+battleState.enemy.name+" using your ultimate potential!\n\nBut the Nen Vow demanded your life as payment...\n\nExperience gained: "+exp+"\nSkill Points gained: "+sp+"\n\nYou achieved victory beyond your normal limits, but at the ultimate cost.\n\nYour legend will be remembered forever.\n\nGAME OVER - Ultimate Sacrifice");LK.effects.flashScreen(0xffffff,3000);// Reset after showing victory LK.setTimeout(function(){resetGame();},5000);return;}var victoryMessage="VICTORY!\n\nYou defeated "+battleState.enemy.name+"!\n\nExperience gained: "+exp+"\nSkill Points gained: "+sp;if(wasStoryBattle){victoryMessage+="\n\n"+storyContext.choice.consequences;}storyPanel.setText(victoryMessage);LK.effects.flashScreen(0x00ff00,1000);}else{if(wasStoryBattle){storyPanel.setText("DEFEAT!\n\nYou were defeated by "+battleState.enemy.name+".\n\nYour story cannot proceed until you overcome this challenge.");LK.effects.flashScreen(0xff0000,1000);clearButtons();var retryButton=new MenuButton("Retry Battle",function(){startStoryBattle(storyContext.choice.battle_trigger,storyContext.choice,storyContext.arcKey,storyContext.chapterIndex);});retryButton.x=1024;retryButton.y=1300;buttons.push(retryButton);game.addChild(retryButton);var retreatButton=new MenuButton("Retreat to Story Arcs",function(){showStoryArcsMenu();});retreatButton.x=1024;retreatButton.y=1400;buttons.push(retreatButton);game.addChild(retreatButton);updateStatsUI();return;}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;if(playerWon&&wasStoryBattle){continueButton=new MenuButton("Continue Story",function(){storyProgress.currentChapter++;saveStoryProgress();showStoryChapter(storyContext.arcKey,storyProgress.currentChapter);});}else{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();}// Save all player data to storage function savePlayerData(){// Save player basic data _storage.player_name=player.name;_storage.player_nenType=player.nenType;_storage.player_level=player.level;_storage.player_experience=player.experience;_storage.player_maxExperience=player.maxExperience;_storage.player_health=player.health;_storage.player_maxHealth=player.maxHealth;_storage.player_aura=player.aura;_storage.player_maxAura=player.maxAura;_storage.player_stats_strength=player.stats.strength;_storage.player_stats_speed=player.stats.speed;_storage.player_stats_intelligence=player.stats.intelligence;_storage.player_stats_aura=player.stats.aura;_storage.player_abilities=player.abilities.join(",");_storage.player_currentChapter=player.currentChapter;_storage.player_energy=player.energy;_storage.player_maxEnergy=player.maxEnergy;_storage.player_skillPoints=player.skillPoints;_storage.player_trainingCount=player.trainingCount;_storage.player_hunterExamCompleted=player.hunterExamCompleted?1:0;// Save main Hatsu data _storage.player_hatsu=player.hatsu?player.hatsu.name||"":"";_storage.player_nenVow=player.nenVow?player.nenVow.name||"":"";_storage.player_hatsuMastery=player.hatsuMastery;_storage.player_hatsuLevel=player.hatsuLevel||1;_storage.player_hatsuXP=player.hatsuXP||0;// Save full Lightning Palm XP/Level/Mastery if it's the main Hatsu if(player.hatsu&&player.hatsu.name==="Lightning Palm"){_storage.player_lightningPalmLevel=player.hatsuLevel||1;_storage.player_lightningPalmMastery=player.hatsuMastery||0;_storage.player_lightningPalmXP=player.hatsuXP||0;}// Save second Hatsu data _storage.player_secondHatsu=player.secondHatsu?player.secondHatsu.name||"":"";_storage.player_secondHatsuLevel=player.secondHatsuLevel||0;_storage.player_secondHatsuMastery=player.secondHatsuMastery||0;_storage.player_secondHatsuXP=player.secondHatsuXP||0;// Save full GodSpeed XP/Level/Mastery if it's the second Hatsu if(player.secondHatsu&&player.secondHatsu.name==="GodSpeed"){_storage.player_godspeedLevel=player.secondHatsuLevel||1;_storage.player_godspeedMastery=player.secondHatsuMastery||0;_storage.player_godspeedXP=player.secondHatsuXP||0;}// Handle copiedAbilities array safely _storage.nenMastery_basicMastered=nenMastery.basicMastered;_storage.nenMastery_advancedMastered=nenMastery.advancedMastered;_storage.nenMastery_totalTechniques=nenMastery.totalTechniques;// Save travel locations _storage.travelLocations_heavensArena_currentFloor=travelLocations.heavensArena.currentFloor;// Save nen techniques _storage.nenTechniques_basic_Ten=nenTechniques.basic.techniques[0].unlocked?1:0;_storage.nenTechniques_basic_Zetsu=nenTechniques.basic.techniques[1].unlocked?1:0;_storage.nenTechniques_basic_Ren=nenTechniques.basic.techniques[2].unlocked?1:0;_storage.nenTechniques_basic_Hatsu=nenTechniques.basic.techniques[3].unlocked?1:0;_storage.nenTechniques_advanced_Gyo=nenTechniques.advanced.techniques[0].unlocked?1:0;_storage.nenTechniques_advanced_In=nenTechniques.advanced.techniques[1].unlocked?1:0;_storage.nenTechniques_advanced_En=nenTechniques.advanced.techniques[2].unlocked?1:0;_storage.nenTechniques_advanced_Shu=nenTechniques.advanced.techniques[3].unlocked?1:0;_storage.nenTechniques_advanced_Ko=nenTechniques.advanced.techniques[4].unlocked?1:0;_storage.nenTechniques_advanced_Ken=nenTechniques.advanced.techniques[5].unlocked?1:0;// Save skill tree progress _storage.skillTree_enhancer_IronBody=skillTree.enhancer.skills[0].unlocked?1:0;_storage.skillTree_enhancer_PowerBoost=skillTree.enhancer.skills[1].unlocked?1:0;_storage.skillTree_enhancer_Regeneration=skillTree.enhancer.skills[2].unlocked?1:0;_storage.skillTree_enhancer_BerserkerInstinct=skillTree.enhancer.skills[3].unlocked?1:0;_storage.skillTree_enhancer_PerfectFocus=skillTree.enhancer.skills[4].unlocked?1:0;_storage.skillTree_enhancer_AuraOverdrive=skillTree.enhancer.skills[5].unlocked?1:0;_storage.skillTree_emitter_AuraBlast=skillTree.emitter.skills[0].unlocked?1:0;_storage.skillTree_emitter_RemoteControl=skillTree.emitter.skills[1].unlocked?1:0;_storage.skillTree_emitter_AuraSphere=skillTree.emitter.skills[2].unlocked?1:0;_storage.skillTree_emitter_ChainReaction=skillTree.emitter.skills[3].unlocked?1:0;_storage.skillTree_emitter_DelayedExplosion=skillTree.emitter.skills[4].unlocked?1:0;_storage.skillTree_emitter_TeleportShot=skillTree.emitter.skills[5].unlocked?1:0;_storage.skillTree_manipulator_ObjectControl=skillTree.manipulator.skills[0].unlocked?1:0;_storage.skillTree_manipulator_MindInfluence=skillTree.manipulator.skills[1].unlocked?1:0;_storage.skillTree_manipulator_MassControl=skillTree.manipulator.skills[2].unlocked?1:0;_storage.skillTree_manipulator_PainLink=skillTree.manipulator.skills[3].unlocked?1:0;_storage.skillTree_manipulator_ForcedMovement=skillTree.manipulator.skills[4].unlocked?1:0;_storage.skillTree_manipulator_MemoryRewrite=skillTree.manipulator.skills[5].unlocked?1:0;_storage.skillTree_transmuter_RubberAura=skillTree.transmuter.skills[0].unlocked?1:0;_storage.skillTree_transmuter_ElectricAura=skillTree.transmuter.skills[1].unlocked?1:0;_storage.skillTree_transmuter_ShapeShift=skillTree.transmuter.skills[2].unlocked?1:0;_storage.skillTree_transmuter_PoisonTouch=skillTree.transmuter.skills[3].unlocked?1:0;_storage.skillTree_transmuter_DiamondSkin=skillTree.transmuter.skills[4].unlocked?1:0;_storage.skillTree_transmuter_AuraMirage=skillTree.transmuter.skills[5].unlocked?1:0;_storage.skillTree_conjurer_WeaponSummon=skillTree.conjurer.skills[0].unlocked?1:0;_storage.skillTree_conjurer_ToolCreation=skillTree.conjurer.skills[1].unlocked?1:0;_storage.skillTree_conjurer_ComplexObjects=skillTree.conjurer.skills[2].unlocked?1:0;_storage.skillTree_conjurer_LivingConstruct=skillTree.conjurer.skills[3].unlocked?1:0;_storage.skillTree_conjurer_DimensionalStorage=skillTree.conjurer.skills[4].unlocked?1:0;_storage.skillTree_conjurer_TrapMastery=skillTree.conjurer.skills[5].unlocked?1:0;_storage.skillTree_specialist_UniqueAbility=skillTree.specialist.skills[0].unlocked?1:0;_storage.skillTree_specialist_PowerAmplify=skillTree.specialist.skills[1].unlocked?1:0;_storage.skillTree_specialist_RealityBend=skillTree.specialist.skills[2].unlocked?1:0;_storage.skillTree_specialist_FateTwist=skillTree.specialist.skills[3].unlocked?1:0;_storage.skillTree_specialist_AbilityTheft=skillTree.specialist.skills[4].unlocked?1:0;_storage.skillTree_specialist_NenNullification=skillTree.specialist.skills[5].unlocked?1:0;}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){var clanText="";if(player.clan&&humanClans[player.clan]){clanText=" | Clan: "+humanClans[player.clan].name;}else{clanText=" | Clan: None";}levelText.setText("Level: "+player.level+" | Race: "+player.race+clanText);}// Update player info text if(playerInfoText){var infoText="Nen Type: "+(player.nenType||"None")+"\nSP: "+player.skillPoints;if(player.clan==="kurta"){infoText+="\nScarlet Eyes Lv: "+player.scarletEyesLevel+" ("+player.scarletEyesProgress+"/100)";}if(player.transplantedEyeLevel&&player.transplantedEyeLevel>0){infoText+="\nTransplanted Eye Lv: "+player.transplantedEyeLevel+" ("+(player.transplantedEyeProgress||0)+"/100)";}playerInfoText.setText(infoText);}// Update stat numbers with XP levels 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"];// Calculate XP level for each stat (every 100 points = 1 level) var xpLevel=Math.floor(statsValues[i]/100);statNumbersText[i].setText(statsLabels[i]+": "+statsValues[i]+" (Lv."+xpLevel+")");}// Save player data whenever stats are updated savePlayerData();}// Achievement System var achievements={training:{name:"Training Mastery",achievements:[{id:"first_training",name:"First Steps",description:"Complete your first training session",icon:"🏃",unlocked:false,condition:function condition(){return player.trainingCount>=1;},reward:{skillPoints:2,experience:50}},{id:"training_adept",name:"Training Adept",description:"Complete 25 training sessions",icon:"💪",unlocked:false,condition:function condition(){return player.trainingCount>=25;},reward:{skillPoints:10,experience:200}},{id:"training_master",name:"Training Master",description:"Complete 100 training sessions",icon:"🏆",unlocked:false,condition:function condition(){return player.trainingCount>=100;},reward:{skillPoints:25,experience:500}},{id:"stat_demon",name:"Stat Demon",description:"Reach 1000 in any stat",icon:"👹",unlocked:false,condition:function condition(){return player.stats.strength>=1000||player.stats.speed>=1000||player.stats.intelligence>=1000||player.stats.aura>=1000;},reward:{skillPoints:50,experience:1000}}]},combat:{name:"Combat Prowess",achievements:[{id:"first_victory",name:"First Victory",description:"Win your first battle",icon:"⚔️",unlocked:false,condition:function condition(){return(_storage.battlesWon||0)>=1;},reward:{skillPoints:5,experience:100}},{id:"boss_slayer",name:"Boss Slayer",description:"Defeat 5 different bosses",icon:"🗡️",unlocked:false,condition:function condition(){return(_storage.bossesDefeated||0)>=5;},reward:{skillPoints:20,experience:400}},{id:"emperor_time_user",name:"Emperor Time User",description:"Use Emperor Time in battle (Kurta clan only)",icon:"👁️",unlocked:false,condition:function condition(){return(_storage.emperorTimeUsed||0)>=1;},reward:{skillPoints:30,experience:600}},{id:"ultimate_sacrifice",name:"Ultimate Sacrifice",description:"Use Ultimate Potential Vow in battle",icon:"💀",unlocked:false,condition:function condition(){return(_storage.ultimateVowUsed||0)>=1;},reward:{skillPoints:100,experience:2000}}]},exploration:{name:"World Explorer",achievements:[{id:"first_travel",name:"First Journey",description:"Visit your first location",icon:"🗺️",unlocked:false,condition:function condition(){return(_storage.locationsVisited||0)>=1;},reward:{skillPoints:3,experience:75}},{id:"world_traveler",name:"World Traveler",description:"Visit all available locations",icon:"🌍",unlocked:false,condition:function condition(){return(_storage.locationsVisited||0)>=7;},reward:{skillPoints:40,experience:800}},{id:"heavens_conqueror",name:"Heaven's Conqueror",description:"Reach floor 200 in Heaven's Arena",icon:"🏢",unlocked:false,condition:function condition(){return travelLocations.heavensArena.currentFloor>=200;},reward:{skillPoints:25,experience:500}},{id:"dark_continent_survivor",name:"Dark Continent Survivor",description:"Complete Dark Continent storyline",icon:"🌑",unlocked:false,condition:function condition(){return(_storage.darkContinentCompleted||0)>=1;},reward:{skillPoints:50,experience:1000}}]},story:{name:"Story Progress",achievements:[{id:"hunter_license",name:"Hunter License",description:"Pass the Hunter Exam",icon:"🏅",unlocked:false,condition:function condition(){return player.hunterExamCompleted;},reward:{skillPoints:15,experience:300}},{id:"phantom_troupe_encounter",name:"Spider's Web",description:"Encounter the Phantom Troupe",icon:"🕷️",unlocked:false,condition:function condition(){return(_storage.phantomTroupeEncounter||0)>=1;},reward:{skillPoints:20,experience:400}},{id:"chimera_ant_reborn",name:"Chimera Ant Reborn",description:"Be reincarnated as a Chimera Ant",icon:"🐜",unlocked:false,condition:function condition(){return player.race.includes("Chimera");},reward:{skillPoints:35,experience:700}}]},nen:{name:"Nen Mastery",achievements:[{id:"nen_awakening",name:"Nen Awakening",description:"Choose your Nen type",icon:"✨",unlocked:false,condition:function condition(){return player.nenType!=="";},reward:{skillPoints:5,experience:100}},{id:"first_hatsu",name:"First Hatsu",description:"Create your first Hatsu",icon:"🔥",unlocked:false,condition:function condition(){return player.hatsu!==null;},reward:{skillPoints:15,experience:300}},{id:"nen_master",name:"Nen Master",description:"Master 10 Nen techniques",icon:"🧙",unlocked:false,condition:function condition(){return nenMastery.totalTechniques>=10;},reward:{skillPoints:30,experience:600}},{id:"hatsu_perfection",name:"Hatsu Perfection",description:"Reach 100 Hatsu mastery",icon:"💎",unlocked:false,condition:function condition(){return player.hatsuMastery>=100;},reward:{skillPoints:25,experience:500}},{id:"nen_vow_maker",name:"Nen Vow Maker",description:"Make a Nen Vow",icon:"⚡",unlocked:false,condition:function condition(){return player.nenVow!==null;},reward:{skillPoints:20,experience:400}}]},clan:{name:"Heritage & Lineage",achievements:[{id:"clan_discovery",name:"Bloodline Awakening",description:"Discover your clan heritage",icon:"🏛️",unlocked:false,condition:function condition(){return player.clan!==null;},reward:{skillPoints:10,experience:200}},{id:"scarlet_eyes_master",name:"Scarlet Eyes Master",description:"Reach level 20 Scarlet Eyes (Kurta clan)",icon:"👁️🗨️",unlocked:false,condition:function condition(){return player.scarletEyesLevel>=20;},reward:{skillPoints:50,experience:1000}},{id:"zoldyck_assassin",name:"Master Assassin",description:"Use Zoldyck assassination arts successfully",icon:"🗡️",unlocked:false,condition:function condition(){return player.clan==="zoldyck"&&(_storage.assassinationSuccess||0)>=1;},reward:{skillPoints:30,experience:600}},{id:"netero_successor",name:"Netero's Successor",description:"Use 100-Type Guanyin Bodhisattva",icon:"🙏",unlocked:false,condition:function condition(){return player.clan==="netero"&&(_storage.bodhisattvaUsed||0)>=1;},reward:{skillPoints:40,experience:800}}]},legendary:{name:"Legendary Feats",achievements:[{id:"level_50_cap",name:"Peak Human",description:"Reach level 50",icon:"🏔️",unlocked:false,condition:function condition(){return player.level>=50;},reward:{skillPoints:30,experience:600}},{id:"level_100_transcendent",name:"Transcendent Being",description:"Reach level 100 through ultimate sacrifice",icon:"👑",unlocked:false,condition:function condition(){return player.level>=100;},reward:{skillPoints:100,experience:2000}},{id:"all_locations_complete",name:"World Conqueror",description:"Complete all location storylines",icon:"🌟",unlocked:false,condition:function condition(){return(_storage.yorknewCompleted||0)>=1&&(_storage.greedIslandCompleted||0)>=1&&(_storage.darkContinentCompleted||0)>=1;},reward:{skillPoints:100,experience:2000}},{id:"ability_collector",name:"Ability Collector",description:"Copy 10 different abilities (Specialist)",icon:"📚",unlocked:false,condition:function condition(){return(_storage.abilitiesCopied||0)>=10;},reward:{skillPoints:50,experience:1000}}]},hidden:{name:"Hidden Secrets",achievements:[{id:"emperor_time_master",name:"Emperor Time Master",description:"Use Emperor Time 100 times to unlock the legendary Uchiha clan",icon:"👁️",unlocked:false,hidden:true,condition:function condition(){return(_storage.emperorTimeUsed||0)>=100;},reward:{skillPoints:200,experience:5000,unlocksClan:"uchiha"}},{id:"shadow_walker",name:"Shadow Walker",description:"Complete all Dark Continent chapters without taking damage",icon:"🌑",unlocked:false,hidden:true,condition:function condition(){return(_storage.darkContinentPerfect||0)>=1;},reward:{skillPoints:100,experience:2000,unlocksShadowTechniques:true}},{id:"ultimate_hunter",name:"Ultimate Hunter",description:"Defeat all bosses with Ultimate Potential Vow active",icon:"⚡",unlocked:false,hidden:true,condition:function condition(){return(_storage.ultimateVowBossKills||0)>=5;},reward:{skillPoints:150,experience:3000,unlocksUltimateForm:true}}]}};// Initialize achievement storage var achievementProgress={battlesWon:0,bossesDefeated:0,locationsVisited:0,emperorTimeUsed:0,ultimateVowUsed:0,phantomTroupeEncounter:0,darkContinentCompleted:0,yorknewCompleted:0,greedIslandCompleted:0,assassinationSuccess:0,bodhisattvaUsed:0,abilitiesCopied:0,darkContinentPerfect:0,ultimateVowBossKills:0};// Initialize storage values function initializeAchievementStorage(){// Only initialize if storage values don't exist, and set them to 0 if(!_storage.battlesWon){_storage.battlesWon=0;}if(!_storage.bossesDefeated){_storage.bossesDefeated=0;}if(!_storage.locationsVisited){_storage.locationsVisited=0;}if(!_storage.emperorTimeUsed){_storage.emperorTimeUsed=0;}if(!_storage.ultimateVowUsed){_storage.ultimateVowUsed=0;}if(!_storage.phantomTroupeEncounter){_storage.phantomTroupeEncounter=0;}if(!_storage.darkContinentCompleted){_storage.darkContinentCompleted=0;}if(!_storage.yorknewCompleted){_storage.yorknewCompleted=0;}if(!_storage.greedIslandCompleted){_storage.greedIslandCompleted=0;}if(!_storage.assassinationSuccess){_storage.assassinationSuccess=0;}if(!_storage.bodhisattvaUsed){_storage.bodhisattvaUsed=0;}if(!_storage.abilitiesCopied){_storage.abilitiesCopied=0;}if(!_storage.darkContinentPerfect){_storage.darkContinentPerfect=0;}if(!_storage.ultimateVowBossKills){_storage.ultimateVowBossKills=0;}// Initialize story progress storage if(!_storage.storyProgress){_storage.storyProgress_currentArc=null;_storage.storyProgress_currentChapter=0;_storage.storyProgress_completedArcs="";_storage.storyProgress_playerChoices="";_storage.storyProgress_persistentConsequences="";_storage.storyProgress_rewards="";}// Initialize consequence system storage if(!_storage.consequenceSystem_heroic){_storage.consequenceSystem_heroic=0;_storage.consequenceSystem_criminal=0;_storage.consequenceSystem_methodical=0;_storage.consequenceSystem_reckless=0;_storage.consequenceSystem_leader=0;_storage.consequenceSystem_follower=0;_storage.consequenceSystem_independent=0;_storage.consequenceSystem_diplomatic=0;_storage.consequenceSystem_fearless=0;_storage.consequenceSystem_cautious=0;_storage.consequenceSystem_scholar=0;_storage.consequenceSystem_hunter=0;_storage.consequenceSystem_allies="";_storage.consequenceSystem_enemies="";_storage.consequenceSystem_obligations="";_storage.consequenceSystem_unlocked_paths="";_storage.consequenceSystem_moral_alignment=0;_storage.consequenceSystem_items="";_storage.consequenceSystem_titles="";}// Load story progress from storage storyProgress.currentArc=_storage.storyProgress_currentArc;storyProgress.currentChapter=_storage.storyProgress_currentChapter||0;storyProgress.completedArcs=_storage.storyProgress_completedArcs?_storage.storyProgress_completedArcs.split(","):[];storyProgress.playerChoices=_storage.storyProgress_playerChoices?_storage.storyProgress_playerChoices.split("|"):[];storyProgress.persistentConsequences=_storage.storyProgress_persistentConsequences?_storage.storyProgress_persistentConsequences.split("|"):[];// Load all arc completion statuses and ensure they're in completedArcs array var arcKeys=Object.keys(storyArcs);for(var i=0;i<arcKeys.length;i++){var arcKey=arcKeys[i];var storageKey=arcKey+"Completed";if(_storage[storageKey]===1&&!storyProgress.completedArcs.includes(arcKey)){storyProgress.completedArcs.push(arcKey);}}// Also check legacy storage keys if(_storage.hunterExamCompleted===1&&!storyProgress.completedArcs.includes("hunterExam")){storyProgress.completedArcs.push("hunterExam");}if(_storage.yorknewCityCompleted===1&&!storyProgress.completedArcs.includes("yorknewCitySaga")){storyProgress.completedArcs.push("yorknewCitySaga");}if(_storage.greedIslandCompleted===1&&!storyProgress.completedArcs.includes("greedIslandAdventure")){storyProgress.completedArcs.push("greedIslandAdventure");}if(_storage.darkContinentCompleted===1&&!storyProgress.completedArcs.includes("darkContinentExpedition")){storyProgress.completedArcs.push("darkContinentExpedition");}// Ensure player.hunterExamCompleted is synchronized with story progress if(storyProgress.completedArcs.includes("hunterExam")){player.hunterExamCompleted=true;}consequenceSystem.reputation.heroic=_storage.consequenceSystem_heroic||0;consequenceSystem.reputation.criminal=_storage.consequenceSystem_criminal||0;consequenceSystem.reputation.methodical=_storage.consequenceSystem_methodical||0;consequenceSystem.reputation.reckless=_storage.consequenceSystem_reckless||0;consequenceSystem.reputation.leader=_storage.consequenceSystem_leader||0;consequenceSystem.reputation.follower=_storage.consequenceSystem_follower||0;consequenceSystem.reputation.independent=_storage.consequenceSystem_independent||0;consequenceSystem.reputation.diplomatic=_storage.consequenceSystem_diplomatic||0;consequenceSystem.reputation.fearless=_storage.consequenceSystem_fearless||0;consequenceSystem.reputation.cautious=_storage.consequenceSystem_cautious||0;consequenceSystem.reputation.scholar=_storage.consequenceSystem_scholar||0;consequenceSystem.reputation.hunter=_storage.consequenceSystem_hunter||0;consequenceSystem.allies=_storage.consequenceSystem_allies?_storage.consequenceSystem_allies.split(","):[];consequenceSystem.enemies=_storage.consequenceSystem_enemies?_storage.consequenceSystem_enemies.split(","):[];consequenceSystem.obligations=_storage.consequenceSystem_obligations?_storage.consequenceSystem_obligations.split(","):[];consequenceSystem.unlocked_paths=_storage.consequenceSystem_unlocked_paths?_storage.consequenceSystem_unlocked_paths.split(","):[];consequenceSystem.moral_alignment=_storage.consequenceSystem_moral_alignment||0;consequenceSystem.items=_storage.consequenceSystem_items?_storage.consequenceSystem_items.split(","):[];consequenceSystem.titles=_storage.consequenceSystem_titles?_storage.consequenceSystem_titles.split(","):[];}// Check and unlock achievements function checkAchievements(){var newUnlocks=[];for(var category in achievements){var categoryData=achievements[category];for(var i=0;i<categoryData.achievements.length;i++){var achievement=categoryData.achievements[i];if(!achievement.unlocked&&achievement.condition()){// Check if achievement was already unlocked in storage var storageKey="achievement_"+achievement.id;if(!_storage[storageKey]){achievement.unlocked=true;_storage[storageKey]=1;newUnlocks.push(achievement);// Apply rewards if(achievement.reward.skillPoints){player.skillPoints+=achievement.reward.skillPoints;}if(achievement.reward.experience){player.experience+=achievement.reward.experience;while(player.experience>=player.maxExperience&&player.level<50){levelUp();}}// Handle special clan unlocks if(achievement.reward.unlocksClan){var clanKey=achievement.reward.unlocksClan;if(clanKey==="uchiha"&&humanClans.uchiha){unlockUchihaClan();}}}}}}// Show achievement notifications for(var i=0;i<newUnlocks.length;i++){showAchievementNotification(newUnlocks[i]);}return newUnlocks.length>0;}// Show achievement notification function showAchievementNotification(achievement){LK.effects.flashScreen(0xffd700,1000);LK.getSound('levelUp').play();// Create temporary achievement popup var achievementPopup=new Text2("🏆 ACHIEVEMENT UNLOCKED!\n"+achievement.icon+" "+achievement.name+"\n"+achievement.description,{size:36,fill:0xffd700,wordWrap:true,wordWrapWidth:800});achievementPopup.anchor.set(0.5,0.5);achievementPopup.x=1024;achievementPopup.y=400;game.addChild(achievementPopup);// Remove popup after 3 seconds LK.setTimeout(function(){if(achievementPopup.parent){achievementPopup.destroy();}},3000);}// Show achievements menu function showAchievementsMenu(){storyPanel.setText("🏆 ACHIEVEMENTS 🏆\n\nTrack your progress and unlock rewards!\n\nSelect a category to view achievements:");clearButtons();var categoryKeys=Object.keys(achievements);var buttonY=1200;for(var i=0;i<categoryKeys.length;i++){var categoryKey=categoryKeys[i];var category=achievements[categoryKey];// Skip hidden category unless player has unlocked at least one hidden achievement if(categoryKey==="hidden"){var hasUnlockedHidden=false;for(var j=0;j<category.achievements.length;j++){if(category.achievements[j].unlocked){hasUnlockedHidden=true;break;}}if(!hasUnlockedHidden){continue;}}// Count unlocked achievements in this category var unlockedCount=0;var totalCount=category.achievements.length;for(var j=0;j<category.achievements.length;j++){if(category.achievements[j].unlocked){unlockedCount++;}}var categoryButton=new MenuButton(category.name+" ("+unlockedCount+"/"+totalCount+")",createAchievementCategoryCallback(categoryKey));categoryButton.x=400+i%3*450;categoryButton.y=buttonY+Math.floor(i/3)*100;buttons.push(categoryButton);game.addChild(categoryButton);}// Back button var backButton=new MenuButton("Back to Training",function(){startTrainingMode();});backButton.x=1024;backButton.y=1600;buttons.push(backButton);game.addChild(backButton);}// Create achievement category callback function createAchievementCategoryCallback(categoryKey){return function(){showAchievementCategory(categoryKey);};}// Show specific achievement category function showAchievementCategory(categoryKey){var category=achievements[categoryKey];var categoryText="🏆 "+category.name+" 🏆\n\n";for(var i=0;i<category.achievements.length;i++){var achievement=category.achievements[i];var status=achievement.unlocked?"✅":"❌";var rewardText="";if(achievement.reward.skillPoints){rewardText+="SP: +"+achievement.reward.skillPoints+" ";}if(achievement.reward.experience){rewardText+="EXP: +"+achievement.reward.experience;}categoryText+=status+" "+achievement.icon+" "+achievement.name+"\n";categoryText+=" "+achievement.description+"\n";if(rewardText){categoryText+=" Reward: "+rewardText+"\n";}categoryText+="\n";}storyPanel.setText(categoryText);clearButtons();// Back to achievements menu var backButton=new MenuButton("Back to Achievements",function(){showAchievementsMenu();});backButton.x=1024;backButton.y=1400;buttons.push(backButton);game.addChild(backButton);}// Uchiha clan unlock function function unlockUchihaClan(){if(player.clan){// Remove current clan bonuses before applying new ones var currentClan=humanClans[player.clan];if(currentClan&¤tClan.bonuses){if(currentClan.bonuses.strength){player.stats.strength-=currentClan.bonuses.strength;}if(currentClan.bonuses.speed){player.stats.speed-=currentClan.bonuses.speed;}if(currentClan.bonuses.intelligence){player.stats.intelligence-=currentClan.bonuses.intelligence;}if(currentClan.bonuses.aura){player.stats.aura-=currentClan.bonuses.aura;}if(currentClan.bonuses.maxHealth){player.maxHealth-=currentClan.bonuses.maxHealth;player.health=Math.min(player.health,player.maxHealth);}if(currentClan.bonuses.maxAura){player.maxAura-=currentClan.bonuses.maxAura;player.aura=Math.min(player.aura,player.maxAura);}}}// Apply Uchiha clan unlockClan("uchiha",humanClans.uchiha);storyPanel.setText("🔥 LEGENDARY CLAN UNLOCKED! 🔥\n\nThrough your mastery of Emperor Time, you have awakened the legendary Uchiha bloodline!\n\nYour eyes transform into the legendary Sharingan, granting you the power to copy any technique and see through all illusions.\n\nThe Uchiha clan's power flows through you - you are now one of the most powerful beings in existence!\n\n👁️ SHARINGAN ACTIVATED 👁️");LK.effects.flashScreen(0xff0000,3000);game.setBackgroundColor(0x330000);}// Story Arc System Functions function showStoryArcsMenu(){var menuText="📚 STORY ARCS 📚\n\nChoose your path! Each arc shapes your destiny with permanent consequences.\n\n";if(consequenceSystem.titles.length>0){menuText+="🏆 Your Titles: "+consequenceSystem.titles.join(", ")+"\n\n";}menuText+="Available Story Arcs:";storyPanel.setText(menuText);clearButtons();var arcKeys=Object.keys(storyArcs);var buttonY=1200;for(var i=0;i<arcKeys.length;i++){var arcKey=arcKeys[i];var arc=storyArcs[arcKey];var isUnlocked=checkStoryArcUnlock(arcKey);var isCompleted=storyProgress.completedArcs.includes(arcKey);var statusIcon=isCompleted?"✅":isUnlocked?"📖":"🔒";var buttonText=statusIcon+" "+arc.title+(isCompleted?" (Complete)":"");var arcButton=new MenuButton(buttonText,isUnlocked&&!isCompleted?createArcCallback(arcKey):null);arcButton.x=400+i%2*800;arcButton.y=buttonY+Math.floor(i/2)*100;if(!isUnlocked||isCompleted){arcButton.alpha=0.7;}buttons.push(arcButton);game.addChild(arcButton);}var backButton=new MenuButton("Back to Training",function(){startTrainingMode();});backButton.x=1024;backButton.y=1700;buttons.push(backButton);game.addChild(backButton);}function checkStoryArcUnlock(arcKey){var arc=storyArcs[arcKey];if(!arc.unlock_requirement){return arc.unlocked||false;}var reqs=arc.unlock_requirement;if(reqs.hunterExamCompleted&&!player.hunterExamCompleted){return false;}if(reqs.level&&player.level<reqs.level){return false;}if(reqs.yorknewCompleted&&!storyProgress.completedArcs.includes("yorknewCitySaga")){return false;}if(reqs.greedIslandCompleted&&!storyProgress.completedArcs.includes("greedIslandAdventure")){return false;}if(reqs.hatsuMastery&&player.hatsuMastery<reqs.hatsuMastery){return false;}return true;}function createArcCallback(arcKey){return function(){startStoryArc(arcKey);};}function startStoryArc(arcKey){currentStoryArc=arcKey;storyProgress.currentArc=arcKey;storyProgress.currentChapter=0;saveStoryProgress();showStoryChapter(arcKey,0);}function showStoryChapter(arcKey,chapterIndex){var arc=storyArcs[arcKey];var chapter=arc.chapters[chapterIndex];if(!chapter){completeStoryArc(arcKey);return;}var chapterText="📚 "+arc.title+" 📚\n";chapterText+="Chapter "+(chapterIndex+1)+": "+chapter.title+"\n\n";chapterText+=chapter.text+"\n\n";chapterText+="Your choice will have permanent consequences:";storyPanel.setText(chapterText);clearButtons();var choices=chapter.dynamic_choices?generateDynamicChoices(chapter):chapter.choices;for(var i=0;i<choices.length;i++){var choice=choices[i];var choiceButton=new MenuButton(choice.text,createStoryChoiceCallback(arcKey,chapterIndex,choice));choiceButton.x=1024;choiceButton.y=1300+i*100;buttons.push(choiceButton);game.addChild(choiceButton);}}function generateDynamicChoices(chapter){// Generate choices based on player's past decisions and reputation var choices=[];for(var i=0;i<chapter.base_choices.length;i++){choices.push(chapter.base_choices[i]);}// Add dynamic choices based on reputation if(consequenceSystem.reputation.criminal>=3){choices.push({text:"Use your criminal connections",action:"use_criminal_connections",consequences:"Leverage underworld knowledge for advantage",statChanges:{intelligence:3,aura:2},experience:50,reputation:{criminal:+2}});}if(consequenceSystem.reputation.heroic>=3){choices.push({text:"Rally allies to your cause",action:"rally_heroic_allies",consequences:"Inspire others with your heroic reputation",statChanges:{strength:2,intelligence:3},experience:60,reputation:{heroic:+2,leader:+1}});}return choices;}function createStoryChoiceCallback(arcKey,chapterIndex,choice){return function(){handleStoryChoice(arcKey,chapterIndex,choice);};}function handleStoryChoice(arcKey,chapterIndex,choice){// Record the choice storyProgress.playerChoices.push({arc:arcKey,chapter:chapterIndex,action:choice.action,timestamp:Date.now()});// Apply immediate consequences if(choice.statChanges){var statGrowthMultiplier=player.statGrowthBonus||1.0;for(var stat in choice.statChanges){if(stat==="health"){player.health=Math.max(1,player.health+Math.floor(choice.statChanges[stat]*statGrowthMultiplier));}else if(stat==="maxHealth"){player.maxHealth+=Math.floor(choice.statChanges[stat]*statGrowthMultiplier);player.health=Math.min(player.health,player.maxHealth);}else if(stat==="maxAura"){player.maxAura+=Math.floor(choice.statChanges[stat]*statGrowthMultiplier);player.aura=Math.min(player.aura,player.maxAura);}else if(player.stats[stat]!==undefined){player.stats[stat]+=Math.floor(choice.statChanges[stat]*statGrowthMultiplier);}}}// Apply experience if(choice.experience){player.experience+=choice.experience;while(player.experience>=player.maxExperience&&player.level<50){levelUp();}}// Apply reputation changes if(choice.reputation){for(var rep in choice.reputation){consequenceSystem.reputation[rep]=(consequenceSystem.reputation[rep]||0)+choice.reputation[rep];}}// Apply moral alignment if(choice.moral_boost){consequenceSystem.moral_alignment+=10;}else if(choice.moral_consequence==="Criminal Path"){consequenceSystem.moral_alignment-=15;}// Add allies if(choice.allies){for(var i=0;i<choice.allies.length;i++){if(!consequenceSystem.allies.includes(choice.allies[i])){consequenceSystem.allies.push(choice.allies[i]);}}}// Add unlocks if(choice.unlocks){for(var i=0;i<choice.unlocks.length;i++){if(!consequenceSystem.unlocked_paths.includes(choice.unlocks[i])){consequenceSystem.unlocked_paths.push(choice.unlocks[i]);}}}// Add items if(choice.items){for(var i=0;i<choice.items.length;i++){consequenceSystem.items.push(choice.items[i]);}}// Handle battle triggers if(choice.battle_trigger){// Create dynamic battle based on story context startStoryBattle(choice.battle_trigger,choice,arcKey,chapterIndex);return;}// Handle survival checks if(choice.survival_chance&&Math.random()>choice.survival_chance){handleStoryDeath(choice);return;}// Show immediate results var resultText="📊 CONSEQUENCES 📊\n\n";resultText+=choice.consequences+"\n\n";resultText+="Experience gained: "+(choice.experience||0)+"\n";if(choice.statChanges){resultText+="Stat changes applied\n";}if(choice.reputation){resultText+="Reputation affected\n";}storyPanel.setText(resultText);clearButtons();var continueButton=new MenuButton("Continue Story",function(){storyProgress.currentChapter++;saveStoryProgress();showStoryChapter(arcKey,chapterIndex+1);});continueButton.x=1024;continueButton.y=1400;buttons.push(continueButton);game.addChild(continueButton);updateStatsUI();saveStoryProgress();// Also save player data to ensure all progress is preserved savePlayerData();LK.effects.flashScreen(0x4488ff,800);}function completeStoryArc(arcKey){var arc=storyArcs[arcKey];// Add to completed arcs if(!storyProgress.completedArcs.includes(arcKey)){storyProgress.completedArcs.push(arcKey);}// Apply completion rewards if(arc.completion_rewards){if(arc.completion_rewards.skillPoints){player.skillPoints+=arc.completion_rewards.skillPoints;}if(arc.completion_rewards.experience){player.experience+=arc.completion_rewards.experience;while(player.experience>=player.maxExperience&&player.level<50){levelUp();}}if(arc.completion_rewards.title){if(!consequenceSystem.titles.includes(arc.completion_rewards.title)){consequenceSystem.titles.push(arc.completion_rewards.title);}// Show info about next arc's bosses/friends being stronger var nextArcKey=Object.keys(storyArcs)[Object.keys(storyArcs).indexOf(arcKey)+1];if(nextArcKey&&storyArcs[nextArcKey]){var nextArc=storyArcs[nextArcKey];completionText+="\n\n[Notice] In the next arc ("+nextArc.title+"), you will face even stronger versions of previous bosses and friends. Prepare for new challenges!";}}if(arc.completion_rewards.unlocks){for(var i=0;i<arc.completion_rewards.unlocks.length;i++){if(!consequenceSystem.unlocked_paths.includes(arc.completion_rewards.unlocks[i])){consequenceSystem.unlocked_paths.push(arc.completion_rewards.unlocks[i]);}}}}// Mark specific completions in storage if(arcKey==="yorknewCitySaga"){_storage.yorknewCompleted=1;}if(arcKey==="greedIslandAdventure"){_storage.greedIslandCompleted=1;}if(arcKey==="darkContinentExpedition"){_storage.darkContinentCompleted=1;}if(arcKey==="hunterExam"){_storage.hunterExamCompleted=1;player.hunterExamCompleted=true;}// Save all progress immediately when arc is completed saveStoryProgress();var completionText="🎉 ARC COMPLETED! 🎉\n\n";completionText+=arc.title+" - Complete!\n\n";completionText+="Final Rewards:\n";if(arc.completion_rewards.skillPoints){completionText+="Skill Points: +"+arc.completion_rewards.skillPoints+"\n";}if(arc.completion_rewards.experience){completionText+="Experience: +"+arc.completion_rewards.experience+"\n";}if(arc.completion_rewards.title){completionText+="Title Earned: "+arc.completion_rewards.title+"\n";}// Log arc completion if(typeof addActivityLogEntry==="function"){addActivityLogEntry("Completed Story Arc: "+arc.title);}storyPanel.setText(completionText);clearButtons();var continueButton=new MenuButton("Return to Story Arcs",function(){currentStoryArc=null;storyProgress.currentArc=null;storyProgress.currentChapter=0;saveStoryProgress();showStoryArcsMenu();});continueButton.x=1024;continueButton.y=1400;buttons.push(continueButton);game.addChild(continueButton);updateStatsUI();checkAchievements();// Ensure achievements are checked after arc completion saveStoryProgress();LK.effects.flashScreen(0x00ff00,1500);}function saveStoryProgress(){_storage.storyProgress_currentArc=storyProgress.currentArc;_storage.storyProgress_currentChapter=storyProgress.currentChapter;_storage.storyProgress_completedArcs=storyProgress.completedArcs.join(",");_storage.storyProgress_playerChoices=storyProgress.playerChoices.join("|");_storage.storyProgress_persistentConsequences=storyProgress.persistentConsequences.join("|");// Save story rewards gained var storyRewards=[];for(var i=0;i<storyProgress.completedArcs.length;i++){var arcKey=storyProgress.completedArcs[i];var arc=storyArcs[arcKey];if(arc&&arc.completion_rewards){var rewardText=arcKey+":";if(arc.completion_rewards.skillPoints){rewardText+="SP+"+arc.completion_rewards.skillPoints;}if(arc.completion_rewards.experience){rewardText+="EXP+"+arc.completion_rewards.experience;}if(arc.completion_rewards.title){rewardText+="TITLE:"+arc.completion_rewards.title;}storyRewards.push(rewardText);}}_storage.storyProgress_rewards=storyRewards.join("|");// Save individual arc completion status - ensure ALL arcs are properly marked _storage.hunterExamCompleted=storyProgress.completedArcs.includes("hunterExam")?1:0;_storage.yorknewCityCompleted=storyProgress.completedArcs.includes("yorknewCitySaga")?1:0;_storage.greedIslandCompleted=storyProgress.completedArcs.includes("greedIslandAdventure")?1:0;_storage.darkContinentCompleted=storyProgress.completedArcs.includes("darkContinentExpedition")?1:0;_storage.meteorCityCompleted=storyProgress.completedArcs.includes("meteorCitySaga")?1:0;_storage.whaleIslandCompleted=storyProgress.completedArcs.includes("whaleIslandSaga")?1:0;_storage.nglCompleted=storyProgress.completedArcs.includes("nglSaga")?1:0;// Also save all other arc keys that might exist var arcKeys=Object.keys(storyArcs);for(var i=0;i<arcKeys.length;i++){var arcKey=arcKeys[i];var storageKey=arcKey+"Completed";_storage[storageKey]=storyProgress.completedArcs.includes(arcKey)?1:0;}// Save reputation system _storage.consequenceSystem_heroic=consequenceSystem.reputation.heroic;_storage.consequenceSystem_criminal=consequenceSystem.reputation.criminal;_storage.consequenceSystem_methodical=consequenceSystem.reputation.methodical;_storage.consequenceSystem_reckless=consequenceSystem.reputation.reckless;_storage.consequenceSystem_leader=consequenceSystem.reputation.leader;_storage.consequenceSystem_follower=consequenceSystem.reputation.follower;_storage.consequenceSystem_independent=consequenceSystem.reputation.independent;_storage.consequenceSystem_diplomatic=consequenceSystem.reputation.diplomatic;_storage.consequenceSystem_fearless=consequenceSystem.reputation.fearless;_storage.consequenceSystem_cautious=consequenceSystem.reputation.cautious;_storage.consequenceSystem_scholar=consequenceSystem.reputation.scholar;_storage.consequenceSystem_hunter=consequenceSystem.reputation.hunter;_storage.consequenceSystem_allies=consequenceSystem.allies.join(",");_storage.consequenceSystem_enemies=consequenceSystem.enemies.join(",");_storage.consequenceSystem_obligations=consequenceSystem.obligations.join(",");_storage.consequenceSystem_unlocked_paths=consequenceSystem.unlocked_paths.join(",");_storage.consequenceSystem_moral_alignment=consequenceSystem.moral_alignment;_storage.consequenceSystem_items=consequenceSystem.items.join(",");_storage.consequenceSystem_titles=consequenceSystem.titles.join(",");// Save all player data as well when story progresses savePlayerData();}function showVowResetSystem(){var vowText="⚡ NEN VOW SYSTEM ⚡\n\n";vowText+="Make binding vows to reshape your destiny!\n\n";vowText+="🔮 Mystic Vow - Reset with enhanced potential\n";vowText+="💀 Death Vow - Permanent reset losing everything\n\n";vowText+="⚠️ WARNING: These actions are PERMANENT! ⚠️";storyPanel.setText(vowText);clearButtons();// Mystic Vow - Enhanced Reset var mysticVowButton=new MenuButton("Mystic Vow: Rebirth",function(){showMysticVowConfirmation();});mysticVowButton.x=400;mysticVowButton.y=1300;buttons.push(mysticVowButton);game.addChild(mysticVowButton);// Death Vow - Complete Reset var deathVowButton=new MenuButton("Death Vow: Oblivion",function(){showDeathVowConfirmation();});deathVowButton.x=1400;deathVowButton.y=1300;buttons.push(deathVowButton);game.addChild(deathVowButton);// Story Progress Review var reviewButton=new MenuButton("Review Story Progress",function(){showStoryProgressReview();});reviewButton.x=900;reviewButton.y=1400;buttons.push(reviewButton);game.addChild(reviewButton);var backButton=new MenuButton("Back to Training",function(){startTrainingMode();});backButton.x=1024;backButton.y=1500;buttons.push(backButton);game.addChild(backButton);}function showMysticVowConfirmation(){var confirmText="🔮 MYSTIC VOW CONFIRMATION 🔮\n\n";confirmText+="You are about to make a Mystic Vow!\n\n";confirmText+="WHAT YOU KEEP:\n";confirmText+="✅ All story progress and choices\n";confirmText+="✅ All unlocked achievements\n";confirmText+="✅ Reputation and allies\n";confirmText+="✅ +25% stat growth bonus permanently\n\n";confirmText+="WHAT YOU LOSE:\n";confirmText+="❌ Current level and stats (reset to 1)\n";confirmText+="❌ Current Hatsu and techniques\n";confirmText+="❌ Current items and skill points\n\n";confirmText+="❓ Are you sure you want to proceed?";storyPanel.setText(confirmText);clearButtons();var confirmButton=new MenuButton("YES - Make Mystic Vow",function(){executeMysticVow();});confirmButton.x=600;confirmButton.y=1400;buttons.push(confirmButton);game.addChild(confirmButton);var cancelButton=new MenuButton("NO - Cancel",function(){showVowResetSystem();});cancelButton.x=1200;cancelButton.y=1400;buttons.push(cancelButton);game.addChild(cancelButton);}function showDeathVowConfirmation(){var confirmText="💀 DEATH VOW CONFIRMATION 💀\n\n";confirmText+="You are about to make a Death Vow!\n\n";confirmText+="COMPLETE RESET:\n";confirmText+="❌ ALL progress will be lost\n";confirmText+="❌ ALL achievements reset\n";confirmText+="❌ ALL story progress erased\n";confirmText+="❌ ALL reputation and allies lost\n";confirmText+="❌ Everything returns to beginning\n\n";confirmText+="This is equivalent to starting completely over.\n\n";confirmText+="💀 ARE YOU ABSOLUTELY SURE? 💀";storyPanel.setText(confirmText);clearButtons();var confirmButton=new MenuButton("YES - Make Death Vow",function(){executeDeathVow();});confirmButton.x=600;confirmButton.y=1400;buttons.push(confirmButton);game.addChild(confirmButton);var cancelButton=new MenuButton("NO - Cancel",function(){showVowResetSystem();});cancelButton.x=1200;cancelButton.y=1400;buttons.push(cancelButton);game.addChild(cancelButton);}function executeMysticVow(){// Save story progress before reset var savedStoryData={currentArc:storyProgress.currentArc,currentChapter:storyProgress.currentChapter,completedArcs:storyProgress.completedArcs.slice(),playerChoices:storyProgress.playerChoices.slice(),persistentConsequences:storyProgress.persistentConsequences.slice()};var savedConsequenceData={heroic:consequenceSystem.reputation.heroic,criminal:consequenceSystem.reputation.criminal,methodical:consequenceSystem.reputation.methodical,reckless:consequenceSystem.reputation.reckless,leader:consequenceSystem.reputation.leader,follower:consequenceSystem.reputation.follower,independent:consequenceSystem.reputation.independent,diplomatic:consequenceSystem.reputation.diplomatic,fearless:consequenceSystem.reputation.fearless,cautious:consequenceSystem.reputation.cautious,scholar:consequenceSystem.reputation.scholar,hunter:consequenceSystem.reputation.hunter,allies:consequenceSystem.allies.slice(),enemies:consequenceSystem.enemies.slice(),obligations:consequenceSystem.obligations.slice(),unlocked_paths:consequenceSystem.unlocked_paths.slice(),moral_alignment:consequenceSystem.moral_alignment,items:consequenceSystem.items.slice(),titles:consequenceSystem.titles.slice()};var savedAchievements={};for(var category in achievements){var categoryData=achievements[category];for(var i=0;i<categoryData.achievements.length;i++){var achievement=categoryData.achievements[i];var storageKey="achievement_"+achievement.id;if(_storage[storageKey]){savedAchievements[storageKey]=1;}}}// Reset player data resetGame();// Restore story elements storyProgress.currentArc=savedStoryData.currentArc;storyProgress.currentChapter=savedStoryData.currentChapter;storyProgress.completedArcs=savedStoryData.completedArcs;storyProgress.playerChoices=savedStoryData.playerChoices;storyProgress.persistentConsequences=savedStoryData.persistentConsequences;consequenceSystem.reputation.heroic=savedConsequenceData.heroic;consequenceSystem.reputation.criminal=savedConsequenceData.criminal;consequenceSystem.reputation.methodical=savedConsequenceData.methodical;consequenceSystem.reputation.reckless=savedConsequenceData.reckless;consequenceSystem.reputation.leader=savedConsequenceData.leader;consequenceSystem.reputation.follower=savedConsequenceData.follower;consequenceSystem.reputation.independent=savedConsequenceData.independent;consequenceSystem.reputation.diplomatic=savedConsequenceData.diplomatic;consequenceSystem.reputation.fearless=savedConsequenceData.fearless;consequenceSystem.reputation.cautious=savedConsequenceData.cautious;consequenceSystem.reputation.scholar=savedConsequenceData.scholar;consequenceSystem.reputation.hunter=savedConsequenceData.hunter;consequenceSystem.allies=savedConsequenceData.allies;consequenceSystem.enemies=savedConsequenceData.enemies;consequenceSystem.obligations=savedConsequenceData.obligations;consequenceSystem.unlocked_paths=savedConsequenceData.unlocked_paths;consequenceSystem.moral_alignment=savedConsequenceData.moral_alignment;consequenceSystem.items=savedConsequenceData.items;consequenceSystem.titles=savedConsequenceData.titles;// Restore achievements for(var key in savedAchievements){_storage[key]=savedAchievements[key];}// Apply mystic bonus player.statGrowthBonus=1.25;// 25% bonus to all stat gains _storage.mysticVowActive=1;storyPanel.setText("🔮 MYSTIC VOW COMPLETE! 🔮\n\nYou have been reborn with enhanced potential!\n\nYour story progress and achievements remain, but your power has been reset to grow stronger than ever before.\n\n+25% stat growth bonus applied permanently!");clearButtons();var continueButton=new MenuButton("Begin New Journey",function(){startCharacterCreation();});continueButton.x=1024;continueButton.y=1400;buttons.push(continueButton);game.addChild(continueButton);LK.effects.flashScreen(0x8800ff,2000);// Fix: check achievements after mystic vow reset checkAchievements();}function executeDeathVow(){// Complete wipe - equivalent to full reset resetGame();storyPanel.setText("💀 DEATH VOW COMPLETE 💀\n\nEverything has been erased.\n\nYou return to the beginning with no memory of your past lives.\n\nOnly the void remembers what once was...");clearButtons();var continueButton=new MenuButton("Begin Anew",function(){startCharacterCreation();});continueButton.x=1024;continueButton.y=1400;buttons.push(continueButton);game.addChild(continueButton);LK.effects.flashScreen(0x000000,3000);// Fix: check achievements after death vow reset checkAchievements();}function showStoryProgressReview(){var reviewText="📊 STORY PROGRESS REVIEW 📊\n\n";if(storyProgress.completedArcs.length>0){reviewText+="Completed Arcs & Rewards:\n";for(var i=0;i<storyProgress.completedArcs.length;i++){var arcKey=storyProgress.completedArcs[i];var arc=storyArcs[arcKey];reviewText+="✅ "+arc.title;// Show rewards gained from this arc if(arc.completion_rewards){var rewards=[];if(arc.completion_rewards.skillPoints){rewards.push("SP: +"+arc.completion_rewards.skillPoints);}if(arc.completion_rewards.experience){rewards.push("EXP: +"+arc.completion_rewards.experience);}if(arc.completion_rewards.title){rewards.push("Title: "+arc.completion_rewards.title);}if(rewards.length>0){reviewText+=" ("+rewards.join(", ")+")";}}reviewText+="\n";}reviewText+="\n";}if(consequenceSystem.titles.length>0){reviewText+="Earned Titles:\n";for(var i=0;i<consequenceSystem.titles.length;i++){reviewText+="🏆 "+consequenceSystem.titles[i]+"\n";}reviewText+="\n";}reviewText+="Reputation Standing:\n";var topReps=[];for(var rep in consequenceSystem.reputation){if(consequenceSystem.reputation[rep]>0){topReps.push(rep+": "+consequenceSystem.reputation[rep]);}}if(topReps.length>0){reviewText+=topReps.join(", ")+"\n\n";}else{reviewText+="No significant reputation\n\n";}reviewText+="Moral Alignment: "+consequenceSystem.moral_alignment+"\n";reviewText+="Total Story Choices: "+storyProgress.playerChoices.length;storyPanel.setText(reviewText);clearButtons();var backButton=new MenuButton("Back to Vow System",function(){showVowResetSystem();});backButton.x=1024;backButton.y=1400;buttons.push(backButton);game.addChild(backButton);}// Function to show the Debug Menu // Function to show the Hunter's Dossier function showHuntersDossier(){var dossierText="\n\n\n\n\n\n\n\n\n\n HUNTER'S DOSSIER\n\n";dossierText+="=== Identity & Titles ===\n";dossierText+="Name: "+player.name+"\n";dossierText+="Race: "+player.race+"\n";dossierText+="Clan: "+(player.clan?humanClans[player.clan].name:"None")+"\n";if(consequenceSystem.titles.length>0){dossierText+="Titles: "+consequenceSystem.titles.join(", ")+"\n";}else{dossierText+="Titles: None\n";}dossierText+="\n=== Visual Stat & Ability Panel ===\n";dossierText+="Level: "+player.level+"\n";dossierText+="Nen Type: "+(player.nenType||"Undiscovered")+"\n";dossierText+="Strength: "+player.stats.strength+"\n";dossierText+="Speed: "+player.stats.speed+"\n";dossierText+="Intelligence: "+player.stats.intelligence+"\n";dossierText+="Aura: "+player.stats.aura+"\n";if(player.hatsu){dossierText+="Hatsu: "+player.hatsu.name+" (Lv."+(player.hatsuLevel||1)+", Mastery "+(player.hatsuMastery||0)+"%)\n";}else{dossierText+="Hatsu: None\n";}if(player.secondHatsu){dossierText+="Second Hatsu: "+player.secondHatsu.name+" (Lv."+(player.secondHatsuLevel||1)+", Mastery "+(player.secondHatsuMastery||0)+"%)\n";}else{dossierText+="Second Hatsu: None\n";}if(player.nenVow){dossierText+="Nen Vow: "+player.nenVow.name+"\n";}else{dossierText+="Nen Vow: None\n";}dossierText+="\n=== Journey & Relationships Map ===\n";dossierText+="Completed Story Arcs: "+(storyProgress.completedArcs.length>0?storyProgress.completedArcs.join(", "):"None")+"\n";dossierText+="Total Story Choices Made: "+storyProgress.playerChoices.length+"\n";if(consequenceSystem.allies.length>0){dossierText+="Allies: "+consequenceSystem.allies.join(", ")+"\n";}else{dossierText+="Allies: None\n";}if(consequenceSystem.enemies.length>0){dossierText+="Enemies: "+consequenceSystem.enemies.join(", ")+"\n";}else{dossierText+="Enemies: None\n";}dossierText+="Reputation:\n";var repList=[];for(var rep in consequenceSystem.reputation){if(consequenceSystem.reputation[rep]!==0){repList.push(rep+": "+consequenceSystem.reputation[rep]);}}if(repList.length>0){dossierText+=" "+repList.join(", ")+"\n";}else{dossierText+=" Neutral\n";}dossierText+="Moral Alignment: "+consequenceSystem.moral_alignment+"\n";if(consequenceSystem.items.length>0){dossierText+="Significant Items: "+consequenceSystem.items.join(", ")+"\n";}else{dossierText+="Significant Items: None\n";}// Add extra newlines at the bottom to ensure the last lines are visible and not cut off dossierText+="\n\n\n\n\n\n";storyPanel.setText(dossierText);clearButtons();var backButton=new MenuButton("Back to Training",function(){startTrainingMode();});backButton.x=1024;backButton.y=1400;buttons.push(backButton);game.addChild(backButton);}initializeUI();// Check if player has existing save data or has already chosen Nen type if(_storage.player_name&&_storage.player_name!=="Hunter"||_storage.player_nenType&&_storage.player_nenType!==""){// Player has save data or has chosen Nen type, skip character creation gameState="training";startTrainingMode();}else{// New player, start character creation startCharacterCreation();}game.update=function(){// Only check achievements when significant actions occur, not every frame // But also check on first update to fix bug: achievements not unlocked if player already meets condition if(!game._achievementsCheckedOnLoad){checkAchievements();game._achievementsCheckedOnLoad=true;}};function handleKurapikaEyeExtraction(){storyPanel.setText("VICTORY OVER KURAPIKA!\n\nYou have defeated the last of the Kurta clan. As Kurapika lies defeated, you notice his legendary scarlet eyes slowly fading back to their normal brown color.\n\nThese eyes contain the power of Emperor Time - the ability to master all Nen categories with perfect efficiency.\n\nDo you wish to attempt extracting his eyes? This is a dark path that will forever change your destiny...");clearButtons();var extractButton=new MenuButton("Extract Kurapika's Eyes",function(){attemptEyeExtraction();});extractButton.x=700;extractButton.y=1300;buttons.push(extractButton);game.addChild(extractButton);var spareButton=new MenuButton("Spare Kurapika",function(){spareKurapika();});spareButton.x=1300;spareButton.y=1300;buttons.push(spareButton);game.addChild(spareButton);}function attemptEyeExtraction(){// 5% chance to successfully extract eye var extractionSuccess=Math.random()<0.05;if(extractionSuccess){// Successfully extracted eye if(!player.kurapikaEyes){player.kurapikaEyes=0;}player.kurapikaEyes+=1;// 50% chance to successfully transplant var transplantSuccess=Math.random()<0.5;if(transplantSuccess){handleSuccessfulTransplant();}else{handleFailedTransplant();}}else{// Failed to extract eye storyPanel.setText("EXTRACTION FAILED!\n\nYour attempt to extract Kurapika's eye has failed. The delicate procedure requires perfect precision, and in your haste, you have damaged the eye beyond use.\n\nKurapika's scarlet eyes lose their power as they are ruined by your clumsy attempt.\n\nYou gain experience from the battle, but no eyes were obtained.");clearButtons();var continueButton=new MenuButton("Continue",function(){finishBattleNormally();});continueButton.x=1024;continueButton.y=1400;buttons.push(continueButton);game.addChild(continueButton);}}function handleSuccessfulTransplant(){// Initialize transplanted eye level and progress if(!player.transplantedeEyeLevel){player.transplantedEyeLevel=0;player.transplantedEyeProgress=0;}player.transplantedEyeLevel+=1;storyPanel.setText("TRANSPLANTATION SUCCESSFUL!\n\n🩸 You have successfully extracted and transplanted one of Kurapika's scarlet eyes!\n\nHowever, the transplanted eye is severely weakened compared to the original. The eye requires extensive training to reach even basic functionality.\n\nTransplanted Eye Level: "+player.transplantedEyeLevel+"\nTo reach Level 3 (basic Emperor Time): Need 50 eye levels\n\n⚠️ WARNING: These transplanted eyes are 50% less efficient than natural scarlet eyes!\n\n🔴 You have committed a grave sin against the Kurta clan...");// Apply immediate penalties for this dark act player.stats.aura-=50;// Guilt affects aura control consequenceSystem.moral_alignment-=50;// Major moral penalty consequenceSystem.reputation.criminal+=5;// Become known as criminal // Mark this dark achievement _storage.kurapikaEyesHarvested=(_storage.kurapikaEyesHarvested||0)+1;clearButtons();var continueButton=new MenuButton("Continue with Stolen Power",function(){finishBattleNormally();});continueButton.x=1024;continueButton.y=1400;buttons.push(continueButton);game.addChild(continueButton);LK.effects.flashScreen(0x660000,2000);// Dark red flash }function handleFailedTransplant(){storyPanel.setText("TRANSPLANTATION FAILED!\n\n💀 You successfully extracted Kurapika's eye, but the transplantation procedure has failed catastrophically!\n\nThe foreign eye tissue is rejected by your body, causing severe damage to your own vision and aura system.\n\nYou lose significant health and aura capacity as your body fights the foreign tissue.\n\nThe extracted eye is wasted, and you are left weakened by the failed procedure.\n\n🔴 You have committed a grave sin for nothing...");// Apply severe penalties for failed transplant player.health=Math.max(1,player.health-80);// Severe health loss player.maxHealth-=50;// Permanent health reduction player.maxAura-=30;// Permanent aura reduction player.aura=Math.min(player.aura,player.maxAura);// Still apply moral penalties consequenceSystem.moral_alignment-=50;consequenceSystem.reputation.criminal+=5;clearButtons();var continueButton=new MenuButton("Continue Weakened",function(){finishBattleNormally();});continueButton.x=1024;continueButton.y=1400;buttons.push(continueButton);game.addChild(continueButton);LK.effects.flashScreen(0x000000,1500);// Black flash for failure }function spareKurapika(){storyPanel.setText("MERCY SHOWN\n\nYou choose to spare Kurapika despite your victory. Even in defeat, the last of the Kurta clan maintains his dignity.\n\nYour merciful act resonates with the spirits of the Kurta clan. Though you could have taken his eyes, you chose the path of honor.\n\nThis act of mercy may be remembered by the world...");// Apply positive moral consequences consequenceSystem.moral_alignment+=25;consequenceSystem.reputation.heroic+=3;player.experience+=50;// Bonus experience for showing mercy clearButtons();var continueButton=new MenuButton("Continue",function(){finishBattleNormally();});continueButton.x=1024;continueButton.y=1400;buttons.push(continueButton);game.addChild(continueButton);LK.effects.flashScreen(0x00ff00,1000);// Green flash for mercy }// Start story battle with dynamic enemy creation function startStoryBattle(battleTrigger,choice,arcKey,chapterIndex){battleState.storyContext={arcKey:arcKey,chapterIndex:chapterIndex,choice:choice};var enemy=null;var battleMultiplier=1.0;// Create enemy based on battle trigger switch(battleTrigger){case"Phantom Troupe Member":enemy={name:"Phantom Troupe Member",health:800+player.level*20,maxHealth:800+player.level*20,level:Math.max(25,player.level+5),stats:{strength:25+player.level,speed:30+player.level,intelligence:20+player.level,aura:35+player.level},abilities:["Spider Tattoo","Thievery"],hatsu:{name:"Spider Web",auraRequired:30,description:"Phantom Troupe coordination attack"},reward:{experience:200,skillPoints:15}};break;case"Multiple Troupe Members":enemy={name:"Multiple Troupe Members",health:1200+player.level*30,maxHealth:1200+player.level*30,level:Math.max(35,player.level+10),stats:{strength:40+player.level,speed:35+player.level,intelligence:30+player.level,aura:45+player.level},abilities:["Coordinated Attack","Spider Formation"],hatsu:{name:"Combined Spider Arts",auraRequired:50,description:"Multiple Phantom Troupe members attack together"},reward:{experience:400,skillPoints:25}};break;case"Genthru the Bomber":enemy={name:"Genthru the Bomber",health:1500+player.level*25,maxHealth:1500+player.level*25,level:Math.max(40,player.level+8),stats:{strength:45+player.level,speed:30+player.level,intelligence:35+player.level,aura:50+player.level},abilities:["Little Flower","Countdown"],hatsu:{name:"Little Flower",auraRequired:45,description:"Explosive aura detonation"},reward:{experience:350,skillPoints:20}};break;case"Ancient Gatekeeper":enemy={name:"Ancient Gatekeeper",health:2000+player.level*40,maxHealth:2000+player.level*40,level:Math.max(45,player.level+15),stats:{strength:60+player.level,speed:40+player.level,intelligence:80+player.level,aura:70+player.level},abilities:["Ancient Wisdom","Reality Bend"],hatsu:{name:"Gatekeeper's Judgment",auraRequired:60,description:"Ancient power that tests worthiness"},reward:{experience:500,skillPoints:30}};break;case"Impossible Creature":enemy={name:"Impossible Creature",health:2500+player.level*50,maxHealth:2500+player.level*50,level:Math.max(50,player.level+20),stats:{strength:80+player.level,speed:70+player.level,intelligence:60+player.level,aura:90+player.level},abilities:["Reality Distortion","Impossible Existence"],hatsu:{name:"Paradox Strike",auraRequired:80,description:"Attack that defies natural laws"},reward:{experience:750,skillPoints:40}};break;case"Chimera Ant Squadron Leader":enemy={name:"Chimera Ant Squadron Leader",health:1800+player.level*35,maxHealth:1800+player.level*35,level:Math.max(40,player.level+12),stats:{strength:50+player.level,speed:45+player.level,intelligence:35+player.level,aura:55+player.level},abilities:["Ant Coordination","Predator Instinct"],hatsu:{name:"Squadron Command",auraRequired:40,description:"Coordinate attacks with ant underlings"},reward:{experience:400,skillPoints:25}};break;case"Neferpitou":enemy={name:"Neferpitou",health:2500+player.level*45,maxHealth:2500+player.level*45,level:Math.max(50,player.level+20),stats:{strength:60+player.level,speed:70+player.level,intelligence:50+player.level,aura:80+player.level},abilities:["Terpsichora","Doctor Blythe","Puppeteer"],hatsu:{name:"Terpsichora",auraRequired:60,description:"Posthumous manipulation that enhances all abilities"},reward:{experience:600,skillPoints:35}};break;case"Meruem (Young King)":enemy={name:"Meruem (Young King)",health:3000+player.level*50,maxHealth:3000+player.level*50,level:Math.max(55,player.level+25),stats:{strength:80+player.level,speed:75+player.level,intelligence:90+player.level,aura:100+player.level},abilities:["Metamorphosis","Aura Synthesis","Rage Blast"],hatsu:{name:"Metamorphosis",auraRequired:80,description:"Evolve and gain power from consumed enemies"},reward:{experience:800,skillPoints:50}};break;case"Meruem (Final Form)":enemy={name:"Meruem (Final Form)",health:5000+player.level*80,maxHealth:5000+player.level*80,level:Math.max(60,player.level+30),stats:{strength:120+player.level,speed:100+player.level,intelligence:150+player.level,aura:200+player.level},abilities:["Perfect Evolution","Photon","Rage Blast"],hatsu:{name:"Photon",auraRequired:100,description:"Ultimate light-based attack from perfect evolution"},reward:{experience:1200,skillPoints:75}};break;case"Prince Benjamin":enemy={name:"Prince Benjamin",health:1600+player.level*30,maxHealth:1600+player.level*30,level:Math.max(45,player.level+15),stats:{strength:55+player.level,speed:40+player.level,intelligence:45+player.level,aura:60+player.level},abilities:["Military Command","Benjamin Baton"],hatsu:{name:"Benjamin Baton",auraRequired:50,description:"Inherit abilities from fallen subordinates"},reward:{experience:450,skillPoints:30}};break;case"Guardian Spirit Beast":enemy={name:"Guardian Spirit Beast",health:2000+player.level*40,maxHealth:2000+player.level*40,level:Math.max(50,player.level+18),stats:{strength:70+player.level,speed:60+player.level,intelligence:80+player.level,aura:90+player.level},abilities:["Spirit Protection","Succession Power","Royal Bond"],hatsu:{name:"Succession Power",auraRequired:70,description:"Mysterious power tied to royal bloodline"},reward:{experience:550,skillPoints:35}};break;default:// Generic story enemy enemy={name:"Story Enemy",health:600+player.level*15,maxHealth:600+player.level*15,level:Math.max(20,player.level+3),stats:{strength:20+player.level,speed:20+player.level,intelligence:15+player.level,aura:25+player.level},abilities:["Basic Combat"],hatsu:{name:"Story Technique",auraRequired:25,description:"Context-appropriate combat technique"},reward:{experience:150,skillPoints:10}};break;}// Track phantom troupe encounters if(battleTrigger.includes("Troupe")){_storage.phantomTroupeEncounter=(_storage.phantomTroupeEncounter||0)+1;}// Start the battle startBattle(enemy);}function handleStoryDeath(choice){// Handle story death scenarios when survival chance fails var deathMessage="💀 STORY DEATH 💀\n\n";// Different death messages based on the choice action switch(choice.action){case"challenge_satotz":deathMessage+="Your reckless challenge against Examiner Satotz proves fatal. His overwhelming power crushes you before you can react.\n\nYour Hunter journey ends before it truly began...";break;case"challenge_menchi":deathMessage+="Your disrespectful challenge to Menchi enrages her beyond measure. Her Gourmet Hunter techniques prove too much for you to handle.\n\nYou've been eliminated from the Hunter Exam permanently...";break;case"challenge_gatekeeper":deathMessage+="The Ancient Gatekeeper's power is beyond mortal comprehension. Your challenge was brave but foolish.\n\nYou are consumed by ancient forces...";break;case"ultimate_risk":deathMessage+="Your ultimate gamble has failed catastrophically. The massive risk you took has cost you everything.\n\nSometimes the greatest risks lead to the greatest failures...";break;case"queen_combat":deathMessage+="The Chimera Ant Queen's power is absolute. Your direct challenge results in immediate consumption.\n\nYou have been devoured and will be reborn as a Chimera Ant...";// Special case - trigger reincarnation instead of death handleChimeraAntReincarnation();return;case"challenge_new_queen":deathMessage+="The evolved Chimera Ant Queen proves too powerful. Your challenge ends in defeat and consumption.\n\nYou become food for the colony...";handleChimeraAntReincarnation();return;case"confront_bomber":deathMessage+="Genthru's explosive power overwhelms you completely. Your direct confrontation ends in a devastating explosion.\n\nYou have been blown to pieces...";break;case"fight_lippo_honorably":deathMessage+="Your honorable battle with Lippo ends in defeat. Despite fighting with honor, you couldn't overcome his experience.\n\nYou fall with dignity intact...";break;case"netero_challenge":deathMessage+="Chairman Netero's legendary power is beyond your current abilities. Your challenge, while admirable, proves fatal.\n\nYou have been defeated by the greatest Hunter...";break;case"hunt_apex_predators":deathMessage+="The Dark Continent's apex predators prove beyond your capabilities. These impossible creatures tear you apart.\n\nYou become food for beings that shouldn't exist...";break;case"use_miniature_rose":deathMessage+="The Poor Man's Rose bomb consumes you along with your target. Your sacrifice may have saved others, but at the ultimate cost.\n\nYou have been vaporized by nuclear fire...";break;case"reason_with_king":deathMessage+="Your attempt to reason with Meruem fails utterly. The King shows no mercy to those who dare approach him.\n\nYou have been eliminated by the King...";break;case"control_nanika":deathMessage+="Your attempt to control Nanika backfires catastrophically. The Dark Continent entity's power destroys you.\n\nYou have been erased from existence...";break;case"claim_throne":deathMessage+="Your ambitious attempt to claim the throne results in immediate elimination by the royal guards.\n\nYour rebellion ends in execution...";break;case"break_succession_rules":deathMessage+="Your attempt to break the succession war's ancient rules triggers divine punishment.\n\nYou have been judged unworthy...";break;default:deathMessage+="Your risky choice has led to an unfortunate end. The dangers of the Hunter x Hunter world have claimed another victim.\n\nYour story ends here...";break;}deathMessage+="\n\n💀 GAME OVER 💀\n\nYou can start a new journey or load your last save.";storyPanel.setText(deathMessage);clearButtons();// Add restart option var restartButton=new MenuButton("Start New Journey",function(){resetGame();});restartButton.x=1024;restartButton.y=1400;buttons.push(restartButton);game.addChild(restartButton);// Apply death screen effects LK.effects.flashScreen(0x000000,3000);game.setBackgroundColor(0x110011);// Update stats one last time updateStatsUI();}function finishBattleNormally(){// Continue with normal battle end sequence while(player.experience>=player.maxExperience&&player.level<50){levelUp();}// Check achievements after battle win (fixes bug for storage-based achievements) checkAchievements();// Check specific battle achievements only when won if(_storage.battlesWon===1){// Check first victory achievement var firstVictoryAchievement=achievements.combat.achievements[0];if(!firstVictoryAchievement.unlocked&&firstVictoryAchievement.condition()){var storageKey="achievement_"+firstVictoryAchievement.id;if(!_storage[storageKey]){firstVictoryAchievement.unlocked=true;_storage[storageKey]=1;player.skillPoints+=firstVictoryAchievement.reward.skillPoints;player.experience+=firstVictoryAchievement.reward.experience;showAchievementNotification(firstVictoryAchievement);}}}else if(_storage.bossesDefeated===5){// Check boss slayer achievement var bossSlayerAchievement=achievements.combat.achievements[1];if(!bossSlayerAchievement.unlocked&&bossSlayerAchievement.condition()){var storageKey="achievement_"+bossSlayerAchievement.id;if(!_storage[storageKey]){bossSlayerAchievement.unlocked=true;_storage[storageKey]=1;player.skillPoints+=bossSlayerAchievement.reward.skillPoints;player.experience+=bossSlayerAchievement.reward.experience;showAchievementNotification(bossSlayerAchievement);}}}// Check if ultimate vow was used - death after victory if(battleState.ultimateVowUsed){var exp=battleState.enemy.reward?battleState.enemy.reward.experience:100;var sp=battleState.enemy.reward?battleState.enemy.reward.skillPoints:5;storyPanel.setText("ULTIMATE VICTORY!\n\nYou defeated "+battleState.enemy.name+" using your ultimate potential!\n\nBut the Nen Vow demanded your life as payment...\n\nExperience gained: "+exp+"\nSkill Points gained: "+sp+"\n\nYou achieved victory beyond your normal limits, but at the ultimate cost.\n\nYour legend will be remembered forever.\n\nGAME OVER - Ultimate Sacrifice");LK.effects.flashScreen(0xffffff,3000);// Reset after showing victory LK.setTimeout(function(){resetGame();},5000);}else{var exp=battleState.enemy.reward?battleState.enemy.reward.experience:100;var sp=battleState.enemy.reward?battleState.enemy.reward.skillPoints:5;storyPanel.setText("VICTORY!\n\nYou defeated "+battleState.enemy.name+"!\n\nExperience gained: "+exp+"\nSkill Points gained: "+sp);LK.effects.flashScreen(0x00ff00,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 createGodSpeed(){player.secondHatsu={name:"GodSpeed",description:"Ultimate lightning-based speed enhancement. Whirlwind and Speed of Lightning techniques.",auraReq:35,conditions:"Must have Lightning Palm mastery, drains aura rapidly",battleEffects:{type:"godspeed",multiplier:2.8,special:"lightning_speed"}};player.secondHatsuLevel=1;player.secondHatsuMastery=10;player.secondHatsuXP=0;// Also initialize dedicated GodSpeed fields for persistence player.godspeedLevel=1;player.godspeedMastery=10;player.godspeedXP=0;storyPanel.setText("GodSpeed Created!\n\nYou have developed GodSpeed as your second Hatsu!\n\nThis ultimate lightning technique allows you to move at godlike speeds and unleash devastating lightning attacks.\n\nYour mastery of Lightning Palm has evolved into something far greater!");clearButtons();var continueButton=new MenuButton("Continue",function(){showHatsuCreation();});continueButton.x=1024;continueButton.y=1400;buttons.push(continueButton);game.addChild(continueButton);LK.effects.flashScreen(0x00ffff,1500);}
===================================================================
--- original.js
+++ change.js
@@ -11,12 +11,12 @@
/**
* Returns a dynamically scaled boss object if dynamic scaling is ever re-enabled.
* For now, returns null to fall back to static bosses.
* This prevents ReferenceError if called.
-*/var storage=LK.import("@upit/storage.v1");"use strict";"use strict";"use strict";function _typeof2(o){"@babel/helpers - typeof";return _typeof2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof2(o);}"use strict";var gameState="characterCreation";var trainingState="menu";// menu, training, skillTree
+*/var ____________storage=LK.import("@upit/storage.v1");"use strict";"use strict";"use strict";"use strict";function _typeof2(o){"@babel/helpers - typeof";return _typeof2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof2(o);}"use strict";var gameState="characterCreation";var trainingState="menu";// menu, training, skillTree
var debugMode=false;// Set to false to hide debug buttons
// Fix storage references - use the actual storage import
-var _storage=___________storage;var __storage=___________storage;var ___storage=___________storage;var ____storage=___________storage;var _____storage=___________storage;var ______storage=___________storage;var _______storage=___________storage;var ________storage=___________storage;var _________storage=___________storage;var __________storage=___________storage;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function getDynamicBoss(bossKey){// Dynamic scaling is currently disabled; always return null.
+var ___________storage=____________storage;var _storage=___________storage;var __storage=___________storage;var ___storage=___________storage;var ____storage=___________storage;var _____storage=___________storage;var ______storage=___________storage;var _______storage=___________storage;var ________storage=___________storage;var _________storage=___________storage;var __________storage=___________storage;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function getDynamicBoss(bossKey){// Dynamic scaling is currently disabled; always return null.
// If dynamic scaling is needed, implement logic here.
if(_storage.player_hatsu){var nenTypeKey=player.nenType?player.nenType.toLowerCase():"";var templates=hatsuTemplates[nenTypeKey];if(templates){for(var i=0;i<templates.length;i++){if(templates[i]&&templates[i].name===_storage.player_hatsu){// Create deep copy of template to avoid reference issues
player.hatsu={name:templates[i].name,description:templates[i].description,auraReq:templates[i].auraReq,conditions:templates[i].conditions,battleEffects:templates[i].battleEffects?{type:templates[i].battleEffects.type,multiplier:templates[i].battleEffects.multiplier,special:templates[i].battleEffects.special}:null};// Restore Lightning Palm XP/Level/Mastery if this is Lightning Palm
return null;}var hatsuTemplates={enhancer:[{name:"Titan Fist",description:"Enhance punching power by 350% and gain a chance to break enemy defense. Now can be used as a multi-hit combo.",auraReq:20,conditions:"Must maintain eye contact with target",battleEffects:{type:"damage",multiplier:3.5,special:"stun_chance,break_defense,multi_hit"}},{name:"Iron Skin",description:"Harden skin to deflect attacks. Now reflects 50% of received damage and grants a temporary defense buff.",auraReq:15,conditions:"Cannot move while active",battleEffects:{type:"defense",multiplier:2.0,special:"reflect_damage,defense_buff"}},{name:"Healing Touch",description:"Accelerate healing of wounds. Now also grants a small aura shield for 2 turns.",auraReq:25,conditions:"Must touch wound for 30 seconds",battleEffects:{type:"heal",amount:60,special:"status_cure,aura_shield"}},{name:"Berserker Rage",description:"Enter an uncontrollable fury that triples all physical abilities, but you cannot guard or heal for 3 turns.",auraReq:35,conditions:"Must be below 50% health to activate",battleEffects:{type:"berserk",multiplier:3.0,special:"cannot_guard,stat_lock"}},{name:"Perfect Enhancement",description:"Enhance any object or body part to its theoretical maximum. Now can adapt to enemy weaknesses for bonus damage.",auraReq:40,conditions:"Can only enhance one thing at a time",battleEffects:{type:"variable",multiplier:2.7,special:"adaptable,weakness_exploit"}},{name:"Jajanken",description:"Rock-paper-scissors based attacks: Rock (punch, now stuns), Paper (emission, now pierces defense), Scissors (transmutation, now causes bleed).",auraReq:30,conditions:"Must charge for 3 seconds before attack",battleEffects:{type:"variable_combo",variants:["rock","paper","scissors"],multiplier:3.0,special:"triple_technique,stun,pierce,bleed"}},{name:"100-Type Guanyin Bodhisattva",description:"Channel the power of the goddess of mercy for devastating attacks. Now has a 20% instant kill chance and ignores all defense.",auraReq:80,conditions:"Must meditate for 10 seconds before use",battleEffects:{type:"divine_strike",multiplier:4.5,special:"instant_kill_chance,ignore_defense"}},{name:"Zero Hand",description:"Concentrate all aura into one final devastating blast. Now also drains all enemy aura if it hits.",auraReq:100,conditions:"Must be below 25% health to activate",battleEffects:{type:"ultimate_sacrifice",multiplier:6.0,special:"uses_all_aura,drain_enemy_aura"}},{name:"Shockwave Punch",description:"Enhance a punch to create devastating shockwaves that hit multiple times. Now can hit up to 5 times and has a chance to stun.",auraReq:35,conditions:"Must charge for 2 seconds before striking",battleEffects:{type:"multi_hit_damage",multiplier:2.8,special:"shockwave_effect,multi_hit,stun"}},{name:"Enhancement Overload",description:"Temporarily enhance all physical abilities beyond normal limits. Now grants immunity to debuffs for 2 turns.",auraReq:45,conditions:"Cannot use other abilities for 3 turns after",battleEffects:{type:"temporary_boost",multiplier:3.5,special:"stat_enhancement,immunity"}},{name:"Focused Strike",description:"Concentrate all enhancement into a single perfect strike. Now always crits if enemy is below 50% health.",auraReq:25,conditions:"Must have line of sight to target",battleEffects:{type:"precision_damage",multiplier:2.7,special:"critical_hit_chance,execute_below_half"}}],emitter:[{name:"Spirit Gun",description:"Fire concentrated aura bullets. Now can pierce through up to 2 enemies in a line.",auraReq:18,conditions:"Must point finger like a gun",battleEffects:{type:"ranged_damage",multiplier:2.2,special:"piercing,line_attack"}},{name:"Teleport Beacon",description:"Mark location for instant teleportation. Now also grants a free dodge after teleport.",auraReq:30,conditions:"Can only have one beacon active",battleEffects:{type:"utility",special:"escape_advantage,free_dodge"}},{name:"Aura Shield",description:"Project defensive barrier at distance. Now reflects 30% of ranged damage.",auraReq:22,conditions:"Shield weakens with distance",battleEffects:{type:"barrier",multiplier:1.7,special:"ranged_defense,reflect_ranged"}},{name:"Orbital Strike",description:"Launch concentrated aura high into the air for devastating delayed attack. Now has a 50% chance to ignore guard.",auraReq:45,conditions:"Must wait 3 turns before impact",battleEffects:{type:"delayed_damage",multiplier:4.2,special:"unavoidable,ignore_guard"}},{name:"Remote Punch",description:"Project your fist through space to strike at any distance. Now has a 30% chance to stun.",auraReq:28,conditions:"Must have line of sight to target",battleEffects:{type:"ranged_damage",multiplier:2.4,special:"surprise_attack,stun"}}],manipulator:[{name:"Puppet Master",description:"Control defeated opponents. Now can use their abilities for 2 turns.",auraReq:35,conditions:"Target must be unconscious first",battleEffects:{type:"control",special:"turn_enemy,use_enemy_ability"}},{name:"Object Dance",description:"Animate and control inanimate objects. Now can animate up to 3 objects at once.",auraReq:20,conditions:"Must physically touch object first",battleEffects:{type:"summon",multiplier:1.7,special:"multiple_attacks,multi_object"}},{name:"Memory Thief",description:"Extract and view target's memories. Now also reduces enemy intelligence for 2 turns.",auraReq:40,conditions:"Must maintain physical contact for 1 minute",battleEffects:{type:"debuff",special:"confusion,int_down"}},{name:"Pain Amplifier",description:"Manipulate pain receptors to make even small wounds agonizing. Now also reduces enemy attack for 2 turns.",auraReq:30,conditions:"Must have inflicted damage on target first",battleEffects:{type:"debuff",multiplier:2.0,special:"damage_over_time,atk_down"}},{name:"Emotion Control",description:"Manipulate target's emotions to make them fight for you. Now can charm up to 2 enemies at once.",auraReq:50,conditions:"Target must trust you initially",battleEffects:{type:"control",special:"ally_conversion,multi_charm"}}],transmuter:[{name:"Lightning Palm",description:"Transform aura into electricity. Now has a 40% chance to stun and deals bonus damage if used after GodSpeed.",auraReq:25,conditions:"Damage self if used more than 3 times per day",battleEffects:{type:"elemental_damage",multiplier:2.4,special:"paralysis,bonus_after_godspeed"}},{name:"Rubber Body",description:"Make body elastic and bouncy. Now reflects 20% melee damage and can dodge one attack per battle.",auraReq:20,conditions:"Vulnerable to sharp objects while active",battleEffects:{type:"defense",multiplier:2.0,special:"bounce_back,melee_reflect,free_dodge"}},{name:"Poison Touch",description:"Transmute aura into various toxins. Now can stack poison up to 3 times.",auraReq:30,conditions:"Must know chemical composition of poison",battleEffects:{type:"poison",multiplier:1.7,special:"damage_over_time,stackable"}},{name:"Diamond Aura",description:"Transform aura into the hardest material for ultimate offense and defense. Now grants immunity to critical hits.",auraReq:45,conditions:"Becomes immobile while diamond form is active",battleEffects:{type:"form_change",multiplier:3.0,special:"ultimate_defense,crit_immunity"}},{name:"Liquid Aura",description:"Make aura flow like water to slip through any defense. Now can ignore all buffs on enemy for 1 turn.",auraReq:35,conditions:"Cannot use other abilities while liquid",battleEffects:{type:"penetration",multiplier:2.7,special:"ignore_defense,ignore_buffs"}},{name:"Binding Chains",description:"Create unbreakable restraints. Now also deals damage over time while enemy is bound.",auraReq:35,conditions:"Chains disappear if you lose consciousness",battleEffects:{type:"restraint",multiplier:2.5,special:"immobilize_and_damage,damage_over_time"}}],conjurer:[{name:"Weapon Vault",description:"Conjure any weapon you've mastered. Now can switch weapons mid-battle for bonus effects.",auraReq:28,conditions:"Must have trained with weapon for 100 hours",battleEffects:{type:"weapon_summon",multiplier:2.2,special:"versatile,weapon_switch"}},{name:"Fortress Creation",description:"Conjure defensive structures. Now also grants a shield to all allies for 2 turns.",auraReq:45,conditions:"Cannot move while maintaining structure",battleEffects:{type:"barrier",multiplier:2.7,special:"area_defense,ally_shield"}},{name:"Binding Chains",description:"Create unbreakable restraints. Now can bind up to 2 enemies at once.",auraReq:35,conditions:"Chains disappear if you lose consciousness",battleEffects:{type:"restraint",special:"immobilize,multi_target"}},{name:"Living Armor",description:"Conjure sentient armor that fights alongside you. Now armor can block one fatal attack per battle.",auraReq:50,conditions:"Armor has its own personality and may disobey",battleEffects:{type:"companion",multiplier:2.0,special:"independent_action,block_fatal"}},{name:"Dimensional Pocket",description:"Create pocket dimensions to store unlimited items and launch surprise attacks. Now can instantly retrieve any item for a bonus action.",auraReq:40,conditions:"Items stored for too long may disappear",battleEffects:{type:"utility",special:"surprise_items,instant_retrieve"}}],specialist:[{name:"Fate Reading",description:"See possible futures of target. Now can force enemy to miss one attack per battle.",auraReq:50,conditions:"Can only be used once per person",battleEffects:{type:"precognition",special:"predict_attacks,force_miss"}},{name:"Power Copy",description:"Temporarily copy opponent's ability. Now copied ability is 20% stronger for 1 turn.",auraReq:60,conditions:"Must witness ability being used 3 times",battleEffects:{type:"copy",special:"steal_abilities,copy_buff"}},{name:"Soul Bond",description:"Share damage and healing with ally. Now also shares buffs and debuffs.",auraReq:40,conditions:"Bond lasts until one partner dies",battleEffects:{type:"link",special:"shared_damage,shared_buffs"}},{name:"Probability Manipulation",description:"Alter the odds of any event in your favor. Now can reroll one failed action per battle.",auraReq:70,conditions:"Each use reduces your own luck for 24 hours",battleEffects:{type:"luck",special:"critical_control,reroll"}},{name:"Time Echo",description:"Create echoes of your past actions to attack multiple times. Now can echo up to 3 actions in a row.",auraReq:55,conditions:"Can only echo actions from the last 10 minutes",battleEffects:{type:"temporal",multiplier:2.7,special:"multi_attack,echo_chain"}},{name:"Ability Copy",description:"Copy and store up to 3 enemy abilities to use in battle. Now can swap copied abilities mid-battle.",auraReq:45,conditions:"Must witness ability 3 times to copy it permanently",battleEffects:{type:"copy_system",special:"ability_mimic,swap_copied",slots:3}}]};// Add GodSpeed as a possible second Hatsu for Transmuters who master Lightning Palm