62
0
1y
User prompt
Kurapika ile savaşırken Kurapikayı yenersek Gözlerini alabilelim isteğe bağlı olarak(kısaca öldürünce gözünü çıkarmayı deneyecekmisin Diye sor Kurapikanın) her öldürdüğümüzde %5 şansla 1 gözünü alabiliriz ve %50 şansla kendimize nakledebiliriz çok daha verimsiz olur bu gözler 50 Göz seviyesine kadar kasmamız gerekir seviye 3 göz için ve Emepror Time gibi bir şey yaratsak bile %50 güç kaybeder ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Death Vow kullandığımızda Heaven Arena da 0 lansın ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'for (var i = 0; i < player.copiedAbilities.length; i++) {' Line Number: 6414 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'join')' in or related to this line: 'storage.player_copiedAbilities = player.copiedAbilities.join("|");' Line Number: 6412
User prompt
1 kere seçtikten sonra Nen tipimizi Ölene veya Vow la ölene kadar bir daha karşımıza çıkmasın direk ana ekrandan başlasın Start Training e bastıktan sonra gelen ekran kısaca ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
tüm ilerlememizi Seviyemizi statlarımızı falan kaydet ! ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'stringify')' in or related to this line: 'storage.player_copiedAbilities = JSON.stringify(player.copiedAbilities);' Line Number: 6398 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
oyundaki Seviyemizi Statlarımızı Sp lerimizi Skill Tree de açtıklarımızı Nenlerimizi oyundan çıksak ta Save le kısaca oyun içi ilerlememizi ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Skill Tree açılmıyor yine Story Arcs taki Hunter Exam Sagaya bağla eski Hunter Exam a bağlı tüm başka Skill Tree falan onları o Hunter Exam dan diyerine aktar
User prompt
evet uygula birbirlerine yakınlıkları aynı kalacak şekilde Story Panel in hemen altına ayarla Debug Buton orada kalabilir dokunma konumuna X ve Y sine onun
User prompt
evet uygula
User prompt
Ana ekrandaki Hunter Exam ı tamamen kaldırıp görevini Story deki Hunter Exam Saga ya verirmisin ? LÜTFEN
User prompt
tamam bunu şimdi oyuna uygula
User prompt
Butonların yerlerini dediğin gibi değiştir lütfen
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'stringify')' in or related to this line: 'storage.storyProgress = JSON.stringify({' Line Number: 6842 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'stringify')' in or related to this line: 'storage.storyProgress = JSON.stringify({' Line Number: 6842 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Oyuna bizim Seçeneklerimizle şekillenen Arc Arc ilerleyen bir Hikaye ekle ! ve Tüm kazandıklarımız başarımlar gibi kalıcı olsun istersek ya kendimizi Vow la yada normal bir öldürme Reset tuşu ilede tüm ilerlemeyi kalıcı olarak silebiliriz uyarı ver bunu kullandığımız zaman sıfırlayacakmısın ? diye ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Oyuna bizim Seçeneklerimizle şekillenen Arc Arc ilerleyen bir Hikaye ekle ! ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
demeye çalıştığım şu anki olan Hatsulara Ekstra Özellik varyantları ekle idi Jajanken e yaptığımız gibi yaparmısın Enchancer Hatsularına
User prompt
Enchancer (Jajanken dışı)Hatsularına 2-3 Yetenek ekle savaş ekranında kullanmalık
User prompt
tüm Hatsuları Jajanken e yaptığın gibi 2 3 Özellik ekle savaş ekranında kullanmak için ve Netero nun Hatsusunu yapınca Zero Hand i de alabilelim 2 Hatsu yani Meruem e karşı kullanma başarımı ekle
User prompt
antrenman falan yapınca boom diye bi sürü başarım yine tetikleniyor bunları Sadece kendi spesifik yerlerinde tetiklenecek şekilde ayarla ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
oyunun başında 6 seviye veriyor nedense Enchancer seçtiğim an vede 200 Sp falan bazı başarımları anında verdiği için bu bugları düzeltirmisin ?
User prompt
Netero nun Hatsusunu ekle ! ve 3 tane Gizli başarım ekle şartlarını söyleyip 1 i 100 kere Emperor Time kullan olacak sonuç olarak Gizli Klan Uchiha elde edebileceğiz ! diyer 2 si sana kalmış ↪💡 Consider importing and using the following plugins: @upit/storage.v1
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var MenuButton = Container.expand(function (text, callback) {
var self = Container.call(this);
var buttonBg = self.attachAsset('buttonBg', {
anchorX: 0.5,
anchorY: 0.5
});
var buttonText = new Text2(text, {
size: 40,
fill: 0xFFFFFF
});
buttonText.anchor.set(0.5, 0.5);
self.addChild(buttonText);
self.callback = callback;
self.isHovered = false;
self.down = function (x, y, obj) {
LK.getSound('menuSelect').play();
if (self.callback) {
self.callback();
}
};
self.move = function (x, y, obj) {
if (!self.isHovered) {
self.isHovered = true;
buttonBg.tint = 0x6a6a6a;
}
};
return self;
});
var SkillButton = Container.expand(function (skill, skillData) {
var self = Container.call(this);
var buttonColor = skillData.unlocked ? 0x4a4a4a : 0x2a2a2a;
var buttonBg = LK.getAsset('buttonBg', {
anchorX: 0.5,
anchorY: 0.5,
tint: buttonColor
});
self.addChild(buttonBg);
var skillText = new Text2(skillData.name, {
size: 32,
fill: skillData.unlocked ? 0xFFFFFF : 0x888888
});
skillText.anchor.set(0.5, 0.3);
self.addChild(skillText);
var costText = new Text2("SP: " + skillData.cost, {
size: 24,
fill: 0x00FF00
});
costText.anchor.set(0.5, 0.7);
self.addChild(costText);
self.skill = skill;
self.skillData = skillData;
self.down = function (x, y, obj) {
if (!skillData.unlocked && player.skillPoints >= skillData.cost) {
LK.getSound('levelUp').play();
unlockSkill(skill, skillData);
}
};
return self;
});
var StatBar = Container.expand(function (label, maxValue, currentValue, color) {
var self = Container.call(this);
var labelText = new Text2(label + ": " + currentValue + "/" + maxValue, {
size: 30,
fill: 0xFFFFFF
});
labelText.anchor.set(0, 0.5);
self.addChild(labelText);
var barBg = self.attachAsset('statBar', {
anchorX: 0,
anchorY: 0.5,
x: 200
});
var barFill = LK.getAsset('statBarFill', {
anchorX: 0,
anchorY: 0.5,
x: 200,
scaleX: currentValue / maxValue,
tint: color || 0x00ff00
});
self.addChild(barFill);
self.maxValue = maxValue;
self.currentValue = currentValue;
self.barFill = barFill;
self.labelText = labelText;
self.updateValue = function (newValue) {
self.currentValue = Math.max(0, Math.min(newValue, self.maxValue));
self.barFill.scaleX = self.currentValue / self.maxValue;
self.labelText.setText(label + ": " + self.currentValue + "/" + self.maxValue);
};
return self;
});
var StoryPanel = Container.expand(function () {
var self = Container.call(this);
var panelBg = self.attachAsset('backgroundPanel', {
anchorX: 0.5,
anchorY: 0.5
});
var storyText = new Text2("", {
size: 34,
fill: 0xFFFFFF,
wordWrap: true,
wordWrapWidth: 1700
});
storyText.anchor.set(0.5, 0.5);
self.addChild(storyText);
self.storyText = storyText;
self.setText = function (text) {
self.storyText.setText(text);
};
return self;
});
var TrainingButton = Container.expand(function (activity, activityData) {
var self = Container.call(this);
var buttonBg = self.attachAsset('buttonBg', {
anchorX: 0.5,
anchorY: 0.5
});
var buttonText = new Text2(activityData.name, {
size: 36,
fill: 0xFFFFFF
});
buttonText.anchor.set(0.5, 0.3);
self.addChild(buttonText);
var costText = new Text2("Energy: " + activityData.cost, {
size: 24,
fill: 0xFFFF00
});
costText.anchor.set(0.5, 0.7);
self.addChild(costText);
self.activity = activity;
self.activityData = activityData;
self.isHovered = false;
self.down = function (x, y, obj) {
if (player.energy >= activityData.cost) {
LK.getSound('menuSelect').play();
performTraining(activity);
}
};
self.move = function (x, y, obj) {
if (!self.isHovered) {
self.isHovered = true;
buttonBg.tint = 0x6a6a6a;
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x1a1a1a
});
/****
* Game Code
****/
// Game State
var gameState = "characterCreation";
var trainingState = "menu"; // menu, training, skillTree
var debugMode = true; // Set to false to hide debug buttons
var player = {
name: "Hunter",
nenType: "",
level: 1,
experience: 0,
maxExperience: 100,
health: 100,
maxHealth: 100,
aura: 50,
maxAura: 50,
stats: {
strength: 10,
speed: 10,
intelligence: 10,
aura: 10
},
abilities: [],
currentChapter: 1,
energy: 100,
maxEnergy: 100,
skillPoints: 0,
trainingCount: 0,
hunterExamCompleted: false,
hatsu: null,
nenVow: null,
hatsuMastery: 0,
copiedAbilities: [null, null, null],
copiedAbilityWitnesses: {},
race: "Human",
clan: null,
scarletEyesLevel: 0,
scarletEyesProgress: 0
};
// Save/Load system
function saveGameProgress() {
// Save player 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;
storage.player_hatsuMastery = player.hatsuMastery;
storage.player_race = player.race;
storage.player_clan = player.clan;
storage.player_scarletEyesLevel = player.scarletEyesLevel;
storage.player_scarletEyesProgress = player.scarletEyesProgress;
// Save Hatsu data
if (player.hatsu) {
storage.player_hatsu_name = player.hatsu.name;
storage.player_hatsu_description = player.hatsu.description;
storage.player_hatsu_auraReq = player.hatsu.auraReq;
storage.player_hatsu_conditions = player.hatsu.conditions;
} else {
storage.player_hatsu_name = null;
}
// Save Nen Vow data
if (player.nenVow) {
storage.player_nenVow_name = player.nenVow.name;
storage.player_nenVow_description = player.nenVow.description;
storage.player_nenVow_powerBoost = player.nenVow.powerBoost;
storage.player_nenVow_type = player.nenVow.type;
} else {
storage.player_nenVow_name = null;
}
// Save copied abilities
storage.player_copiedAbilities = "";
for (var i = 0; i < player.copiedAbilities.length; i++) {
if (player.copiedAbilities[i]) {
storage.player_copiedAbilities += player.copiedAbilities[i].name + "|";
}
}
// Save copied ability witnesses
storage.player_copiedAbilityWitnesses = "";
for (var ability in player.copiedAbilityWitnesses) {
storage.player_copiedAbilityWitnesses += ability + ":" + player.copiedAbilityWitnesses[ability] + "|";
}
// Save Nen mastery data
storage.nenMastery_basicMastered = nenMastery.basicMastered;
storage.nenMastery_advancedMastered = nenMastery.advancedMastered;
storage.nenMastery_totalTechniques = nenMastery.totalTechniques;
// Save technique unlocks
storage.nenTechniques_basic = "";
for (var i = 0; i < nenTechniques.basic.techniques.length; i++) {
if (nenTechniques.basic.techniques[i].unlocked) {
storage.nenTechniques_basic += nenTechniques.basic.techniques[i].name + "|";
}
}
storage.nenTechniques_advanced = "";
for (var i = 0; i < nenTechniques.advanced.techniques.length; i++) {
if (nenTechniques.advanced.techniques[i].unlocked) {
storage.nenTechniques_advanced += nenTechniques.advanced.techniques[i].name + "|";
}
}
// Save travel location data
storage.travelLocation_heavensArena_currentFloor = travelLocations.heavensArena.currentFloor;
// Save game state
storage.gameState = gameState;
storage.trainingState = trainingState;
}
function loadGameProgress() {
// Load player data
if (storage.player_name) {
player.name = storage.player_name;
player.nenType = storage.player_nenType || "";
player.level = storage.player_level || 1;
player.experience = storage.player_experience || 0;
player.maxExperience = storage.player_maxExperience || 100;
player.health = storage.player_health || 100;
player.maxHealth = storage.player_maxHealth || 100;
player.aura = storage.player_aura || 50;
player.maxAura = storage.player_maxAura || 50;
player.stats.strength = storage.player_stats_strength || 10;
player.stats.speed = storage.player_stats_speed || 10;
player.stats.intelligence = storage.player_stats_intelligence || 10;
player.stats.aura = storage.player_stats_aura || 10;
player.abilities = storage.player_abilities ? storage.player_abilities.split(",") : [];
player.currentChapter = storage.player_currentChapter || 1;
player.energy = storage.player_energy || 100;
player.maxEnergy = storage.player_maxEnergy || 100;
player.skillPoints = storage.player_skillPoints || 0;
player.trainingCount = storage.player_trainingCount || 0;
player.hunterExamCompleted = storage.player_hunterExamCompleted === 1;
player.hatsuMastery = storage.player_hatsuMastery || 0;
player.race = storage.player_race || "Human";
player.clan = storage.player_clan || null;
player.scarletEyesLevel = storage.player_scarletEyesLevel || 0;
player.scarletEyesProgress = storage.player_scarletEyesProgress || 0;
// Load Hatsu data
if (storage.player_hatsu_name) {
player.hatsu = {
name: storage.player_hatsu_name,
description: storage.player_hatsu_description,
auraReq: storage.player_hatsu_auraReq,
conditions: storage.player_hatsu_conditions,
battleEffects: {} // Will be restored from templates
};
}
// Load Nen Vow data
if (storage.player_nenVow_name) {
player.nenVow = {
name: storage.player_nenVow_name,
description: storage.player_nenVow_description,
powerBoost: storage.player_nenVow_powerBoost,
type: storage.player_nenVow_type
};
}
// Load copied abilities
if (storage.player_copiedAbilities) {
var copiedAbilitiesData = storage.player_copiedAbilities.split("|");
for (var i = 0; i < copiedAbilitiesData.length && i < 3; i++) {
if (copiedAbilitiesData[i]) {
player.copiedAbilities[i] = {
name: copiedAbilitiesData[i],
multiplier: 1.8,
special: "generic_copy"
};
}
}
}
// Load copied ability witnesses
if (storage.player_copiedAbilityWitnesses) {
var witnessData = storage.player_copiedAbilityWitnesses.split("|");
for (var i = 0; i < witnessData.length; i++) {
if (witnessData[i]) {
var parts = witnessData[i].split(":");
if (parts.length === 2) {
player.copiedAbilityWitnesses[parts[0]] = parseInt(parts[1]);
}
}
}
}
// Load Nen mastery data
nenMastery.basicMastered = storage.nenMastery_basicMastered || 0;
nenMastery.advancedMastered = storage.nenMastery_advancedMastered || 0;
nenMastery.totalTechniques = storage.nenMastery_totalTechniques || 0;
// Load technique unlocks
if (storage.nenTechniques_basic) {
var basicUnlocks = storage.nenTechniques_basic.split("|");
for (var i = 0; i < basicUnlocks.length; i++) {
if (basicUnlocks[i]) {
for (var j = 0; j < nenTechniques.basic.techniques.length; j++) {
if (nenTechniques.basic.techniques[j].name === basicUnlocks[i]) {
nenTechniques.basic.techniques[j].unlocked = true;
break;
}
}
}
}
}
if (storage.nenTechniques_advanced) {
var advancedUnlocks = storage.nenTechniques_advanced.split("|");
for (var i = 0; i < advancedUnlocks.length; i++) {
if (advancedUnlocks[i]) {
for (var j = 0; j < nenTechniques.advanced.techniques.length; j++) {
if (nenTechniques.advanced.techniques[j].name === advancedUnlocks[i]) {
nenTechniques.advanced.techniques[j].unlocked = true;
break;
}
}
}
}
}
// Load travel location data
travelLocations.heavensArena.currentFloor = storage.travelLocation_heavensArena_currentFloor || 1;
// Load game state
gameState = storage.gameState || "characterCreation";
trainingState = storage.trainingState || "menu";
}
}
// Clan System for Human Race
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 = {
hunterExam: {
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",
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. Your choice here will shape your reputation among other candidates.",
choices: [{
text: "Stay close to the examiner and maintain steady pace",
action: "steady_pace",
consequences: "Gain respect from methodical candidates, improve endurance",
statChanges: {
speed: 2,
maxHealth: 10
},
experience: 30,
reputation: {
methodical: +2,
reckless: -1
}
}, {
text: "Sprint ahead to secure a good position",
action: "sprint_ahead",
consequences: "Impress speed-focused candidates but exhaust yourself",
statChanges: {
speed: 3,
health: -15
},
experience: 25,
reputation: {
reckless: +2,
cautious: -1
}
}, {
text: "Help other struggling candidates",
action: "help_others",
consequences: "Earn loyalty from helped candidates, develop leadership",
statChanges: {
intelligence: 2,
health: -10
},
experience: 35,
reputation: {
heroic: +3,
selfish: -2
}
}]
}, {
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 Mysteries",
text: "The tower's puzzles test more than intelligence. Ancient Nen techniques are hidden in its walls, and your path determines what you discover.",
choices: [{
text: "Explore the forbidden upper levels",
action: "explore_forbidden",
consequences: "Discover ancient Nen secrets but face deadly traps",
statChanges: {
intelligence: 5,
aura: 10,
health: -30
},
experience: 60,
reputation: {
explorer: +4,
cautious: -2
},
unlocks: ["Ancient Nen Techniques", "Tower Secrets"]
}, {
text: "Solve puzzles through teamwork",
action: "teamwork_puzzles",
consequences: "Build strong alliances and learn collaborative techniques",
statChanges: {
intelligence: 3,
strength: 2
},
experience: 50,
reputation: {
team_player: +3,
lone_wolf: -2
},
allies: ["Puzzle Solving Team"]
}, {
text: "Use brute force to break through",
action: "brute_force_tower",
consequences: "Fastest route but destroys valuable puzzle mechanisms",
statChanges: {
strength: 4,
speed: 2,
intelligence: -1
},
experience: 35,
reputation: {
destroyer: +2,
preservationist: -3
}
}]
}, {
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 5: Tournament of Destinies",
text: "The final phase where your reputation, allies, and choices culminate. Your tournament bracket reflects your journey's impact.",
choices: [{
text: "Fight with honor and full strength",
action: "honorable_combat",
consequences: "Earn respect from examiners and candidates alike",
statChanges: {
strength: 5,
aura: 4
},
experience: 70,
reputation: {
honorable: +5,
dishonorable: -3
},
endingModifier: "Honor Champion"
}, {
text: "Use psychological warfare",
action: "psychological_combat",
consequences: "Win through mind games, disturb some observers",
statChanges: {
intelligence: 5,
speed: 3
},
experience: 65,
reputation: {
manipulator: +3,
trustworthy: -2
},
endingModifier: "Mind Master"
}, {
text: "Showcase unique Nen abilities",
action: "nen_showcase",
consequences: "Impress examiners with potential, attract attention",
statChanges: {
aura: 6,
intelligence: 2
},
experience: 75,
reputation: {
prodigy: +4,
humble: -1
},
endingModifier: "Nen Prodigy",
unlocks: ["Advanced Nen Training"]
}]
}],
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",
text: "Yorknew City buzzes with criminal energy as the Southernpiece Auction approaches. The Phantom Troupe's presence creates an undercurrent of danger. Your approach to this volatile situation will determine your survival.",
choices: [{
text: "Infiltrate the criminal networks",
action: "infiltrate_criminals",
consequences: "Gain insider knowledge but risk your identity being discovered",
statChanges: {
intelligence: 4,
speed: 3,
health: -20
},
experience: 60,
reputation: {
criminal: +3,
law_enforcer: -2
},
unlocks: ["Underground Contacts", "Criminal Techniques"]
}, {
text: "Cooperate with law enforcement",
action: "cooperate_law",
consequences: "Work with authorities but limit access to criminal information",
statChanges: {
intelligence: 2,
strength: 3
},
experience: 45,
reputation: {
law_enforcer: +3,
criminal: -2
},
unlocks: ["Police Cooperation", "Legal Investigation Methods"]
}, {
text: "Operate as independent investigator",
action: "independent_investigation",
consequences: "Maintain neutrality but work without backup",
statChanges: {
intelligence: 5,
aura: 2
},
experience: 55,
reputation: {
independent: +4
},
unlocks: ["Solo Investigation Techniques"]
}]
}, {
title: "The Phantom Troupe Encounter",
text: "You've discovered the Phantom Troupe's hideout. Their leader Chrollo stands before you, book in hand. This moment will define your path in the criminal underworld.",
choices: [{
text: "Challenge them directly",
action: "direct_confrontation_troupe",
consequences: "Extremely dangerous but massive growth if you survive",
statChanges: {
strength: 10,
speed: 8,
aura: 12,
health: -80
},
experience: 200,
reputation: {
fearless: +5,
prudent: -3
},
battle_trigger: "Phantom Troupe Member",
survival_chance: 0.3
}, {
text: "Attempt to join them temporarily",
action: "join_troupe_temporarily",
consequences: "Learn their techniques but compromise your morals",
statChanges: {
intelligence: 6,
aura: 8,
maxHealth: -50
},
experience: 150,
reputation: {
criminal: +5,
heroic: -4
},
unlocks: ["Troupe Combat Techniques", "Steal Chain"],
moral_consequence: "Criminal Path"
}, {
text: "Gather intelligence and retreat",
action: "intelligence_retreat",
consequences: "Safe approach with valuable information",
statChanges: {
intelligence: 7,
speed: 4
},
experience: 100,
reputation: {
cautious: +3,
reckless: -2
},
unlocks: ["Troupe Intelligence", "Strategic Planning"]
}]
}, {
title: "The Auction House Heist",
text: "The night of the auction arrives. The Phantom Troupe strikes, and chaos erupts. Your previous choices determine your options and allies in this crisis.",
dynamic_choices: true,
// Choices depend on previous decisions
base_choices: [{
text: "Protect innocent civilians",
action: "protect_civilians",
consequences: "Save lives but miss opportunities for rare items",
statChanges: {
maxHealth: 30,
intelligence: 3
},
experience: 80,
reputation: {
heroic: +4,
selfish: -2
},
moral_boost: true
}, {
text: "Secure rare Nen artifacts",
action: "secure_artifacts",
consequences: "Gain powerful items but ignore civilian casualties",
statChanges: {
aura: 10,
intelligence: 5
},
experience: 120,
reputation: {
opportunist: +3,
heroic: -3
},
unlocks: ["Rare Nen Artifacts"],
items: ["Cursed Nen Tools", "Ancient Scrolls"]
}, {
text: "Hunt down Troupe members",
action: "hunt_troupe_members",
consequences: "Dangerous pursuit with potential for massive rewards",
statChanges: {
strength: 8,
speed: 6,
health: -40
},
experience: 180,
reputation: {
hunter: +5,
cautious: -2
},
battle_trigger: "Multiple Troupe Members"
}]
}],
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"]
}
},
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"]
}
}
};
// 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
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!"
}
}
};
// Travel Locations
var travelLocations = {
heavensArena: {
name: "Heaven's Arena",
description: "Fight through 200 floors of the famous combat tower. Face stronger opponents as you climb higher.",
unlocked: true,
floors: 200,
currentFloor: 1,
background: 0x4a4a4a,
opponents: [{
name: "Floor 50 Fighter",
level: 10,
reward: {
exp: 50,
money: 100
}
}, {
name: "Floor 100 Fighter",
level: 20,
reward: {
exp: 100,
money: 200
}
}, {
name: "Floor 150 Fighter",
level: 30,
reward: {
exp: 150,
money: 300
}
}, {
name: "Floor 200 Champion",
level: 40,
reward: {
exp: 200,
money: 500
}
}],
specialBoss: {
name: "Razor",
level: 45,
health: 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"
}
};
// Hatsu Creation System
var hatsuTemplates = {
enhancer: [{
name: "Titan Fist",
description: "Enhance punching power by 300%",
auraReq: 20,
conditions: "Must maintain eye contact with target",
battleEffects: {
type: "damage",
multiplier: 3.0,
special: "stun_chance"
}
}, {
name: "Iron Skin",
description: "Harden skin to deflect attacks",
auraReq: 15,
conditions: "Cannot move while active",
battleEffects: {
type: "defense",
multiplier: 2.0,
special: "reflect_damage"
}
}, {
name: "Healing Touch",
description: "Accelerate healing of wounds",
auraReq: 25,
conditions: "Must touch wound for 30 seconds",
battleEffects: {
type: "heal",
amount: 50,
special: "status_cure"
}
}, {
name: "Berserker Rage",
description: "Enter an uncontrollable fury that doubles all physical abilities",
auraReq: 35,
conditions: "Must be below 50% health to activate",
battleEffects: {
type: "berserk",
multiplier: 2.0,
special: "cannot_guard"
}
}, {
name: "Perfect Enhancement",
description: "Enhance any object or body part to its theoretical maximum",
auraReq: 40,
conditions: "Can only enhance one thing at a time",
battleEffects: {
type: "variable",
multiplier: 2.5,
special: "adaptable"
}
}, {
name: "Jajanken",
description: "Rock-paper-scissors based attacks: Rock (punch), Paper (emission), Scissors (transmutation)",
auraReq: 30,
conditions: "Must charge for 3 seconds before attack",
battleEffects: {
type: "variable_combo",
variants: ["rock", "paper", "scissors"],
multiplier: 2.8,
special: "triple_technique"
}
}, {
name: "100-Type Guanyin Bodhisattva",
description: "Channel the power of the goddess of mercy for devastating attacks",
auraReq: 80,
conditions: "Must meditate for 10 seconds before use",
battleEffects: {
type: "divine_strike",
multiplier: 4.5,
special: "instant_kill_chance"
}
}, {
name: "Zero Hand",
description: "Concentrate all aura into one final devastating blast",
auraReq: 100,
conditions: "Must be below 25% health to activate",
battleEffects: {
type: "ultimate_sacrifice",
multiplier: 6.0,
special: "uses_all_aura"
}
}, {
name: "Shockwave Punch",
description: "Enhance a punch to create devastating shockwaves that hit multiple times",
auraReq: 35,
conditions: "Must charge for 2 seconds before striking",
battleEffects: {
type: "multi_hit_damage",
multiplier: 2.8,
special: "shockwave_effect"
}
}, {
name: "Enhancement Overload",
description: "Temporarily enhance all physical abilities beyond normal limits",
auraReq: 45,
conditions: "Cannot use other abilities for 3 turns after",
battleEffects: {
type: "temporary_boost",
multiplier: 3.2,
special: "stat_enhancement"
}
}, {
name: "Focused Strike",
description: "Concentrate all enhancement into a single perfect strike",
auraReq: 25,
conditions: "Must have line of sight to target",
battleEffects: {
type: "precision_damage",
multiplier: 2.5,
special: "critical_hit_chance"
}
}],
emitter: [{
name: "Spirit Gun",
description: "Fire concentrated aura bullets",
auraReq: 18,
conditions: "Must point finger like a gun",
battleEffects: {
type: "ranged_damage",
multiplier: 2.0,
special: "piercing"
}
}, {
name: "Teleport Beacon",
description: "Mark location for instant teleportation",
auraReq: 30,
conditions: "Can only have one beacon active",
battleEffects: {
type: "utility",
special: "escape_advantage"
}
}, {
name: "Aura Shield",
description: "Project defensive barrier at distance",
auraReq: 22,
conditions: "Shield weakens with distance",
battleEffects: {
type: "barrier",
multiplier: 1.5,
special: "ranged_defense"
}
}, {
name: "Orbital Strike",
description: "Launch concentrated aura high into the air for devastating delayed attack",
auraReq: 45,
conditions: "Must wait 3 turns before impact",
battleEffects: {
type: "delayed_damage",
multiplier: 4.0,
special: "unavoidable"
}
}, {
name: "Remote Punch",
description: "Project your fist through space to strike at any distance",
auraReq: 28,
conditions: "Must have line of sight to target",
battleEffects: {
type: "ranged_damage",
multiplier: 2.2,
special: "surprise_attack"
}
}],
manipulator: [{
name: "Puppet Master",
description: "Control defeated opponents",
auraReq: 35,
conditions: "Target must be unconscious first",
battleEffects: {
type: "control",
special: "turn_enemy"
}
}, {
name: "Object Dance",
description: "Animate and control inanimate objects",
auraReq: 20,
conditions: "Must physically touch object first",
battleEffects: {
type: "summon",
multiplier: 1.5,
special: "multiple_attacks"
}
}, {
name: "Memory Thief",
description: "Extract and view target's memories",
auraReq: 40,
conditions: "Must maintain physical contact for 1 minute",
battleEffects: {
type: "debuff",
special: "confusion"
}
}, {
name: "Pain Amplifier",
description: "Manipulate pain receptors to make even small wounds agonizing",
auraReq: 30,
conditions: "Must have inflicted damage on target first",
battleEffects: {
type: "debuff",
multiplier: 1.8,
special: "damage_over_time"
}
}, {
name: "Emotion Control",
description: "Manipulate target's emotions to make them fight for you",
auraReq: 50,
conditions: "Target must trust you initially",
battleEffects: {
type: "control",
special: "ally_conversion"
}
}],
transmuter: [{
name: "Lightning Palm",
description: "Transform aura into electricity",
auraReq: 25,
conditions: "Damage self if used more than 3 times per day",
battleEffects: {
type: "elemental_damage",
multiplier: 2.2,
special: "paralysis"
}
}, {
name: "Rubber Body",
description: "Make body elastic and bouncy",
auraReq: 20,
conditions: "Vulnerable to sharp objects while active",
battleEffects: {
type: "defense",
multiplier: 1.8,
special: "bounce_back"
}
}, {
name: "Poison Touch",
description: "Transmute aura into various toxins",
auraReq: 30,
conditions: "Must know chemical composition of poison",
battleEffects: {
type: "poison",
multiplier: 1.5,
special: "damage_over_time"
}
}, {
name: "Diamond Aura",
description: "Transform aura into the hardest material for ultimate offense and defense",
auraReq: 45,
conditions: "Becomes immobile while diamond form is active",
battleEffects: {
type: "form_change",
multiplier: 3.0,
special: "ultimate_defense"
}
}, {
name: "Liquid Aura",
description: "Make aura flow like water to slip through any defense",
auraReq: 35,
conditions: "Cannot use other abilities while liquid",
battleEffects: {
type: "penetration",
multiplier: 2.5,
special: "ignore_defense"
}
}],
conjurer: [{
name: "Weapon Vault",
description: "Conjure any weapon you've mastered",
auraReq: 28,
conditions: "Must have trained with weapon for 100 hours",
battleEffects: {
type: "weapon_summon",
multiplier: 2.0,
special: "versatile"
}
}, {
name: "Fortress Creation",
description: "Conjure defensive structures",
auraReq: 45,
conditions: "Cannot move while maintaining structure",
battleEffects: {
type: "barrier",
multiplier: 2.5,
special: "area_defense"
}
}, {
name: "Binding Chains",
description: "Create unbreakable restraints",
auraReq: 35,
conditions: "Chains disappear if you lose consciousness",
battleEffects: {
type: "restraint",
special: "immobilize"
}
}, {
name: "Living Armor",
description: "Conjure sentient armor that fights alongside you",
auraReq: 50,
conditions: "Armor has its own personality and may disobey",
battleEffects: {
type: "companion",
multiplier: 1.8,
special: "independent_action"
}
}, {
name: "Dimensional Pocket",
description: "Create pocket dimensions to store unlimited items and launch surprise attacks",
auraReq: 40,
conditions: "Items stored for too long may disappear",
battleEffects: {
type: "utility",
special: "surprise_items"
}
}],
specialist: [{
name: "Fate Reading",
description: "See possible futures of target",
auraReq: 50,
conditions: "Can only be used once per person",
battleEffects: {
type: "precognition",
special: "predict_attacks"
}
}, {
name: "Power Copy",
description: "Temporarily copy opponent's ability",
auraReq: 60,
conditions: "Must witness ability being used 3 times",
battleEffects: {
type: "copy",
special: "steal_abilities"
}
}, {
name: "Soul Bond",
description: "Share damage and healing with ally",
auraReq: 40,
conditions: "Bond lasts until one partner dies",
battleEffects: {
type: "link",
special: "shared_damage"
}
}, {
name: "Probability Manipulation",
description: "Alter the odds of any event in your favor",
auraReq: 70,
conditions: "Each use reduces your own luck for 24 hours",
battleEffects: {
type: "luck",
special: "critical_control"
}
}, {
name: "Time Echo",
description: "Create echoes of your past actions to attack multiple times",
auraReq: 55,
conditions: "Can only echo actions from the last 10 minutes",
battleEffects: {
type: "temporal",
multiplier: 2.5,
special: "multi_attack"
}
}, {
name: "Ability Copy",
description: "Copy and store up to 3 enemy abilities to use in battle",
auraReq: 45,
conditions: "Must witness ability 3 times to copy it permanently",
battleEffects: {
type: "copy_system",
special: "ability_mimic",
slots: 3
}
}]
};
// Nen Techniques System
var nenTechniques = {
basic: {
name: "Basic Nen Principles",
techniques: [{
name: "Ten",
description: "Shroud your body with aura to enhance defense",
cost: 0,
unlocked: false,
auraReq: 10,
benefits: {
defense: 20
}
}, {
name: "Zetsu",
description: "Stop the flow of aura to hide your presence",
cost: 5,
unlocked: false,
auraReq: 15,
benefits: {
stealth: 30
}
}, {
name: "Ren",
description: "Increase the amount of aura around your body",
cost: 10,
unlocked: false,
auraReq: 20,
benefits: {
aura: 10,
strength: 5
}
}, {
name: "Hatsu",
description: "Use aura to perform supernatural feats",
cost: 20,
unlocked: false,
auraReq: 30,
benefits: {
allStats: 5
}
}]
},
advanced: {
name: "Advanced Nen Techniques",
techniques: [{
name: "Gyo",
description: "Focus aura into your eyes to see hidden things",
cost: 15,
unlocked: false,
auraReq: 25,
benefits: {
intelligence: 10
}
}, {
name: "In",
description: "Hide your aura completely",
cost: 25,
unlocked: false,
auraReq: 35,
benefits: {
stealth: 50
}
}, {
name: "En",
description: "Extend your aura to sense surroundings",
cost: 30,
unlocked: false,
auraReq: 40,
benefits: {
aura: 15,
intelligence: 8
}
}, {
name: "Shu",
description: "Extend aura to objects you're holding",
cost: 20,
unlocked: false,
auraReq: 30,
benefits: {
strength: 12
}
}, {
name: "Ko",
description: "Focus all aura into one body part",
cost: 35,
unlocked: false,
auraReq: 45,
benefits: {
strength: 20
}
}, {
name: "Ken",
description: "Maintain Ren for extended periods",
cost: 40,
unlocked: false,
auraReq: 50,
benefits: {
aura: 20,
health: 30
}
}]
}
};
// Add Nen mastery to player data
var nenMastery = {
basicMastered: 0,
advancedMastered: 0,
totalTechniques: 0
};
// Battle System Data
var currentBattle = null;
var battleState = {
playerTurn: true,
playerHealth: 0,
enemyHealth: 0,
playerAura: 0,
enemyAura: 0,
battleLog: [],
availableActions: [],
enemy: null,
ultimateVowUsed: false,
emperorTimeActive: false,
emperorTimeHealthDrain: 0,
scarletEyesLevel: 0
};
// 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 = {
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"
}
};
// Nen Vows System
var nenVows = [{
name: "Combat Restriction",
description: "Never use Hatsu to kill",
powerBoost: 1.5,
type: "moral"
}, {
name: "Time Limit",
description: "Ability only works for 10 minutes per day",
powerBoost: 2.0,
type: "temporal"
}, {
name: "Location Binding",
description: "Ability only works in specific location",
powerBoost: 2.5,
type: "spatial"
}, {
name: "Emotional Trigger",
description: "Only works when extremely angry",
powerBoost: 1.8,
type: "emotional"
}, {
name: "Risk of Death",
description: "Ability will kill you if overused",
powerBoost: 3.0,
type: "sacrificial"
}, {
name: "Shared Burden",
description: "Allies also take damage when you do",
powerBoost: 2.2,
type: "collective"
}, {
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"
}, {
name: "Bloodline Sacrifice",
description: "Sacrifice clan heritage for ultimate power",
powerBoost: 3.5,
type: "heritage_sacrifice"
}, {
name: "Memory Seal",
description: "Seal memories of loved ones for enhanced focus",
powerBoost: 2.8,
type: "psychological"
}, {
name: "Life Force Drain",
description: "Each use shortens lifespan but grants immense power",
powerBoost: 3.2,
type: "sacrificial_advanced"
}];
// 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
var skillTree = {
enhancer: {
name: "Enhancement Skills",
skills: [{
name: "Iron Body",
cost: 50,
unlocked: false,
description: "Increase defense by 20%"
}, {
name: "Power Boost",
cost: 100,
unlocked: false,
description: "Increase strength by 50%"
}, {
name: "Regeneration",
cost: 150,
unlocked: false,
description: "Slowly recover health over time"
}]
},
emitter: {
name: "Emission Skills",
skills: [{
name: "Aura Blast",
cost: 60,
unlocked: false,
description: "Ranged aura attack"
}, {
name: "Remote Control",
cost: 120,
unlocked: false,
description: "Control objects from distance"
}, {
name: "Aura Sphere",
cost: 180,
unlocked: false,
description: "Create protective aura barriers"
}]
},
manipulator: {
name: "Manipulation Skills",
skills: [{
name: "Object Control",
cost: 70,
unlocked: false,
description: "Manipulate nearby objects"
}, {
name: "Mind Influence",
cost: 140,
unlocked: false,
description: "Influence enemy actions"
}, {
name: "Mass Control",
cost: 200,
unlocked: false,
description: "Control multiple targets"
}]
},
transmuter: {
name: "Transmutation Skills",
skills: [{
name: "Rubber Aura",
cost: 55,
unlocked: false,
description: "Make aura elastic and bouncy"
}, {
name: "Electric Aura",
cost: 110,
unlocked: false,
description: "Transmute aura into electricity"
}, {
name: "Shape Shift",
cost: 165,
unlocked: false,
description: "Change aura into various forms"
}]
},
conjurer: {
name: "Conjuration Skills",
skills: [{
name: "Weapon Summon",
cost: 80,
unlocked: false,
description: "Conjure basic weapons"
}, {
name: "Tool Creation",
cost: 160,
unlocked: false,
description: "Create useful tools"
}, {
name: "Complex Objects",
cost: 240,
unlocked: false,
description: "Conjure complex mechanisms"
}]
},
specialist: {
name: "Specialist Skills",
skills: [{
name: "Unique Ability",
cost: 100,
unlocked: false,
description: "Discover your unique power"
}, {
name: "Power Amplify",
cost: 200,
unlocked: false,
description: "Amplify all abilities"
}, {
name: "Reality Bend",
cost: 300,
unlocked: false,
description: "Bend rules of reality"
}]
}
};
// UI Elements
var storyPanel;
var buttons = [];
var statsUI = [];
var titleText;
var playerInfoText;
var levelText;
var statNumbersText = [];
// Initialize UI
function initializeUI() {
// Initialize achievement storage first
initializeAchievementStorage();
// Load game progress from storage
loadGameProgress();
// 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;
}
}
// Title
titleText = new Text2("Hunter X Hunter: Nen Mastery Challenge", {
size: 56,
fill: 0xFFFF00
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 1024;
titleText.y = 150;
game.addChild(titleText);
// Story Panel - moved to center-right
storyPanel = new StoryPanel();
storyPanel.x = 1200;
storyPanel.y = 700;
game.addChild(storyPanel);
// Bottom left stats panel background
var statsPanelBg = LK.getAsset('backgroundPanel', {
anchorX: 0,
anchorY: 1,
scaleX: 0.4,
scaleY: 0.8,
tint: 0x1a1a1a
});
statsPanelBg.x = 50;
statsPanelBg.y = 2680;
game.addChild(statsPanelBg);
// Level display
levelText = new Text2("Level: " + player.level + " | 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("Nen Type: " + (player.nenType || "None") + "\nSP: " + player.skillPoints, {
size: 28,
fill: 0xFFFFFF
});
playerInfoText.anchor.set(0, 0.5);
playerInfoText.x = 80;
playerInfoText.y = 2310;
game.addChild(playerInfoText);
// Stats as numbers
var statsLabels = ["Strength", "Speed", "Intelligence", "Aura"];
var statsValues = [player.stats.strength, player.stats.speed, player.stats.intelligence, player.stats.aura];
for (var i = 0; i < statsLabels.length; i++) {
var statText = new Text2(statsLabels[i] + ": " + statsValues[i], {
size: 24,
fill: 0xAAFFAA
});
statText.anchor.set(0, 0.5);
statText.x = 80;
statText.y = 2400 + i * 30;
statNumbersText.push(statText);
game.addChild(statText);
}
// Status bars (Health, Aura, Energy, Experience) - compact version
var statusY = 2520;
statsUI.push(new StatBar("Health", player.maxHealth, player.health, 0xff0000));
statsUI.push(new StatBar("Aura", player.maxAura, player.aura, 0x0066ff));
statsUI.push(new StatBar("Energy", player.maxEnergy, player.energy, 0x00ff00));
statsUI.push(new StatBar("Experience", player.maxExperience, player.experience, 0xffff00));
for (var i = 0; i < statsUI.length; i++) {
statsUI[i].x = 80;
statsUI[i].y = statusY + i * 40;
statsUI[i].scaleX = 0.7; // Make bars more compact
statsUI[i].scaleY = 0.7;
game.addChild(statsUI[i]);
}
}
// Character Creation
function startCharacterCreation() {
storyPanel.setText("Welcome, aspiring Hunter! First, you must discover your Nen type. Choose your path:");
clearButtons();
var nenTypeKeys = Object.keys(nenTypes);
for (var i = 0; i < nenTypeKeys.length; i++) {
var nenType = nenTypeKeys[i];
var button = new MenuButton(nenType, createNenTypeCallback(nenType));
button.x = 400 + i % 3 * 450;
button.y = 1200 + Math.floor(i / 3) * 100;
buttons.push(button);
game.addChild(button);
}
}
function createNenTypeCallback(nenType) {
return function () {
selectNenType(nenType);
};
}
function selectNenType(nenType) {
player.nenType = nenType;
var typeData = nenTypes[nenType];
// Apply bonuses
if (typeData.bonuses.strength) player.stats.strength += typeData.bonuses.strength;
if (typeData.bonuses.speed) player.stats.speed += typeData.bonuses.speed;
if (typeData.bonuses.intelligence) player.stats.intelligence += typeData.bonuses.intelligence;
if (typeData.bonuses.aura) player.stats.aura += typeData.bonuses.aura;
if (typeData.bonuses.health) {
player.maxHealth += typeData.bonuses.health;
player.health = player.maxHealth;
}
storyPanel.setText("Excellent! You are a " + nenType + ". " + typeData.description);
clearButtons();
var continueButton = new MenuButton("Start Training", function () {
gameState = "training";
startTrainingMode();
});
continueButton.x = 1024;
continueButton.y = 1400;
buttons.push(continueButton);
game.addChild(continueButton);
// 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();
// Save progress after selecting Nen type
saveGameProgress();
}
// Story System
function startStoryChapter(chapterNum) {
var chapter = storyChapters[chapterNum];
if (!chapter) return;
player.currentChapter = chapterNum;
storyPanel.setText(chapter.title + "\n\n" + chapter.text);
clearButtons();
for (var i = 0; i < chapter.choices.length; i++) {
var choice = chapter.choices[i];
var button = new MenuButton(choice.text, createChoiceCallback(choice.action));
button.x = 1024;
button.y = 1400 + i * 100;
buttons.push(button);
game.addChild(button);
}
}
function createChoiceCallback(action) {
return function () {
handleChoice(action);
};
}
function handleChoice(action) {
var result = "";
var expGain = 0;
switch (action) {
// Phase 1: The Long Run
case "steady_pace":
result = "You maintain a steady pace, conserving energy while staying with the main group. Your endurance improves and you avoid the dangerous creatures in the fog.";
player.stats.speed += 2;
player.maxHealth += 10;
expGain = 30;
break;
case "sprint_ahead":
result = "You sprint ahead but exhaust yourself. However, you gain valuable experience in speed and spot shortcuts for future reference.";
player.stats.speed += 3;
player.health -= 15;
expGain = 25;
break;
case "help_others":
result = "You help struggling candidates, earning their respect. Your leadership skills and intelligence grow, though you use more energy.";
player.stats.intelligence += 2;
player.health -= 10;
expGain = 35;
break;
// Phase 2: Gourmet Hunters
case "hunt_strategically":
result = "You successfully hunt the Great Stamp pig using clever tactics. Your strategic thinking and strength improve significantly.";
player.stats.strength += 3;
player.stats.intelligence += 2;
expGain = 40;
break;
case "cook_multiple":
result = "You attempt multiple dishes but burn several. You learn from your mistakes and improve your multitasking abilities.";
player.stats.intelligence += 1;
player.stats.speed += 2;
expGain = 25;
break;
case "observe_learn":
result = "You carefully observe successful candidates and learn their techniques. Your analytical skills improve greatly.";
player.stats.intelligence += 4;
expGain = 45;
break;
// Phase 3: Trick Tower
case "strength_door":
result = "You choose the strength path and face physical challenges. Your raw power increases but you take some damage from the trials.";
player.stats.strength += 4;
player.health -= 20;
expGain = 35;
break;
case "wisdom_door":
result = "You solve complex puzzles and riddles. Your intelligence grows significantly as you overcome mental challenges.";
player.stats.intelligence += 5;
expGain = 50;
break;
case "agility_door":
result = "You navigate through speed-based obstacles and traps. Your agility and reflexes improve dramatically.";
player.stats.speed += 4;
expGain = 40;
break;
// Phase 4: Zevil Island
case "stealth_ambush":
result = "You successfully ambush your target using stealth tactics. Your speed and intelligence improve from the successful strategy.";
player.stats.speed += 3;
player.stats.intelligence += 2;
expGain = 45;
break;
case "direct_combat":
result = "You engage in direct combat with your target. A fierce battle ensues, improving your strength but leaving you injured.";
player.stats.strength += 4;
player.health -= 25;
expGain = 40;
break;
case "set_trap":
result = "You patiently set a trap and wait. Your strategic thinking pays off as you capture your target with minimal effort.";
player.stats.intelligence += 3;
player.stats.aura += 2;
expGain = 50;
break;
// Phase 5: Final Tournament
case "full_power":
result = "You unleash your full power from the start! Your overwhelming strength secures victory, and you pass the Hunter Exam!";
player.stats.strength += 5;
player.stats.aura += 3;
expGain = 60;
break;
case "analyze_first":
result = "You carefully analyze your opponent's fighting style before striking. Your tactical approach leads to a decisive victory!";
player.stats.intelligence += 4;
player.stats.speed += 3;
expGain = 65;
break;
case "tactical_approach":
result = "You use cunning tactics to outmaneuver your opponent. Your strategic mind proves superior, earning you the Hunter License!";
player.stats.intelligence += 5;
player.stats.aura += 4;
expGain = 70;
break;
}
// Apply experience
player.experience += expGain;
if (player.experience >= player.maxExperience) {
levelUp();
}
storyPanel.setText(result);
clearButtons();
var continueButton = new MenuButton("Continue", function () {
var nextChapter = player.currentChapter + 1;
if (nextChapter <= 5) {
startStoryChapter(nextChapter);
} else {
showGameComplete();
}
});
continueButton.x = 1024;
continueButton.y = 1400;
buttons.push(continueButton);
game.addChild(continueButton);
updateStatsUI();
// Save progress after story choice
saveGameProgress();
}
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;
// 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);
// Save progress after level up
saveGameProgress();
}
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);
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);
// Save progress after unlocking clan
saveGameProgress();
}
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);
// Save progress after completing game
saveGameProgress();
}
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);
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
}
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);
// Debug Mode - Creator buttons for testing
if (debugMode) {
// Debug panel background
var debugPanelBg = LK.getAsset('backgroundPanel', {
anchorX: 0.5,
anchorY: 0,
scaleX: 0.9,
scaleY: 0.3,
tint: 0x330033
});
debugPanelBg.x = 1024;
debugPanelBg.y = 1650;
game.addChild(debugPanelBg);
var debugLabel = new Text2("=== DEBUG MODE ===", {
size: 32,
fill: 0xFF00FF
});
debugLabel.anchor.set(0.5, 0.5);
debugLabel.x = 1024;
debugLabel.y = 1680;
game.addChild(debugLabel);
var debugButton = new MenuButton("Yaratıcı: +1000 Stat", function () {
player.stats.strength += 1000;
player.stats.speed += 1000;
player.stats.intelligence += 1000;
player.stats.aura += 1000;
player.maxAura += 1000;
player.aura = player.maxAura;
player.skillPoints += 100;
updateStatsUI();
LK.effects.flashScreen(0xff00ff, 300);
startTrainingMode(); // Refresh to show updated requirements
});
debugButton.x = 400;
debugButton.y = 1750;
debugButton.scaleX = 0.7;
debugButton.scaleY = 0.7;
buttons.push(debugButton);
game.addChild(debugButton);
var debug100Button = new MenuButton("Yaratıcı: +100 Stat", function () {
player.stats.strength += 100;
player.stats.speed += 100;
player.stats.intelligence += 100;
player.stats.aura += 100;
player.maxAura += 100;
player.aura = player.maxAura;
player.skillPoints += 10;
updateStatsUI();
LK.effects.flashScreen(0x00ff88, 300);
startTrainingMode(); // Refresh to show updated requirements
});
debug100Button.x = 750;
debug100Button.y = 1750;
debug100Button.scaleX = 0.7;
debug100Button.scaleY = 0.7;
buttons.push(debug100Button);
game.addChild(debug100Button);
var debugLevelButton = new MenuButton("Yaratıcı: +10 Level", function () {
for (var i = 0; i < 10; i++) {
if (player.level < 50) {
levelUp();
}
}
updateStatsUI();
LK.effects.flashScreen(0x00ffff, 300);
});
debugLevelButton.x = 1100;
debugLevelButton.y = 1750;
debugLevelButton.scaleX = 0.7;
debugLevelButton.scaleY = 0.7;
buttons.push(debugLevelButton);
game.addChild(debugLevelButton);
var debugEnergyButton = new MenuButton("Yaratıcı: Dolu Enerji", function () {
player.energy = player.maxEnergy;
player.health = player.maxHealth;
player.aura = player.maxAura;
updateStatsUI();
LK.effects.flashScreen(0xffff00, 300);
});
debugEnergyButton.x = 1450;
debugEnergyButton.y = 1750;
debugEnergyButton.scaleX = 0.7;
debugEnergyButton.scaleY = 0.7;
buttons.push(debugEnergyButton);
game.addChild(debugEnergyButton);
var debugClanButton = new MenuButton("Yaratıcı: Klan Seç", function () {
showDebugClanSelection();
});
debugClanButton.x = 400;
debugClanButton.y = 1800;
debugClanButton.scaleX = 0.7;
debugClanButton.scaleY = 0.7;
buttons.push(debugClanButton);
game.addChild(debugClanButton);
var debugHatsuButton = new MenuButton("Yaratıcı: Hatsu Unlock", function () {
player.hunterExamCompleted = true;
if (!player.nenType) {
player.nenType = "Enhancer";
var typeData = nenTypes["Enhancer"];
if (typeData.bonuses.strength) player.stats.strength += typeData.bonuses.strength;
if (typeData.bonuses.health) {
player.maxHealth += typeData.bonuses.health;
player.health = player.maxHealth;
}
}
updateStatsUI();
LK.effects.flashScreen(0x00ff00, 300);
startTrainingMode(); // Refresh to show all buttons
});
debugHatsuButton.x = 750;
debugHatsuButton.y = 1800;
debugHatsuButton.scaleX = 0.7;
debugHatsuButton.scaleY = 0.7;
buttons.push(debugHatsuButton);
game.addChild(debugHatsuButton);
var debugSpecialButton = new MenuButton("Yaratıcı: Special", function () {
player.level = 50;
player.hatsuMastery = 100;
player.skillPoints += 200;
updateStatsUI();
LK.effects.flashScreen(0x8800ff, 300);
startTrainingMode();
});
debugSpecialButton.x = 1100;
debugSpecialButton.y = 1800;
debugSpecialButton.scaleX = 0.7;
debugSpecialButton.scaleY = 0.7;
buttons.push(debugSpecialButton);
game.addChild(debugSpecialButton);
var debugMasterButton = new MenuButton("Yaratıcı: Master All", function () {
player.level = 50;
player.stats.strength = 2000;
player.stats.speed = 2000;
player.stats.intelligence = 2000;
player.stats.aura = 2000;
player.maxAura = 5000;
player.aura = player.maxAura;
player.skillPoints = 500;
player.hatsuMastery = 100;
updateStatsUI();
LK.effects.flashScreen(0xff8800, 300);
startTrainingMode();
});
debugMasterButton.x = 1450;
debugMasterButton.y = 1800;
debugMasterButton.scaleX = 0.7;
debugMasterButton.scaleY = 0.7;
buttons.push(debugMasterButton);
game.addChild(debugMasterButton);
}
// Hunter Exam button removed - now available through Story Arcs
}
function performTraining(activity) {
var activityData = trainingActivities[activity];
// Deduct energy
player.energy -= activityData.cost;
// Apply benefits
if (activityData.benefits.strength) player.stats.strength += activityData.benefits.strength;
if (activityData.benefits.speed) player.stats.speed += activityData.benefits.speed;
if (activityData.benefits.intelligence) player.stats.intelligence += activityData.benefits.intelligence;
if (activityData.benefits.aura) player.stats.aura += activityData.benefits.aura;
if (activityData.benefits.health) {
player.maxHealth += activityData.benefits.health;
player.health = player.maxHealth;
}
// Add experience and skill points
player.experience += activityData.experience;
player.skillPoints += Math.floor(activityData.experience / 10);
player.trainingCount++;
// 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.");
}
}
}
// 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);
// Save progress
saveGameProgress();
// Refresh training mode to update buttons
startTrainingMode();
}
function showNenTechniques() {
storyPanel.setText("Nen Techniques\n\nMaster the fundamental principles of Nen and advanced techniques. Basic techniques must be learned before advanced ones.\n\nBasic Mastered: " + nenMastery.basicMastered + "/4\nAdvanced Mastered: " + nenMastery.advancedMastered + "/6");
clearButtons();
var yStart = 1100;
var currentY = yStart;
// Basic Techniques Section
var basicLabel = new Text2("Basic Nen Principles (Ten, Zetsu, Ren, Hatsu)", {
size: 32,
fill: 0x00FF00
});
basicLabel.anchor.set(0.5, 0.5);
basicLabel.x = 1024;
basicLabel.y = currentY;
game.addChild(basicLabel);
currentY += 60;
for (var i = 0; i < nenTechniques.basic.techniques.length; i++) {
var technique = nenTechniques.basic.techniques[i];
var canLearn = player.stats.aura >= technique.auraReq && player.skillPoints >= technique.cost;
var buttonText = technique.name + " - " + technique.cost + " SP";
if (technique.unlocked) buttonText += " (Mastered)";
var techniqueButton = new MenuButton(buttonText, technique.unlocked ? null : createTechniqueCallback(technique, 'basic'));
techniqueButton.x = 400 + i % 4 * 350;
techniqueButton.y = currentY;
if (technique.unlocked) {
techniqueButton.alpha = 0.7;
} else if (!canLearn) {
techniqueButton.alpha = 0.5;
}
buttons.push(techniqueButton);
game.addChild(techniqueButton);
}
currentY += 120;
// Advanced Techniques Section
var advancedLabel = new Text2("Advanced Nen Techniques", {
size: 32,
fill: 0xFF6600
});
advancedLabel.anchor.set(0.5, 0.5);
advancedLabel.x = 1024;
advancedLabel.y = currentY;
game.addChild(advancedLabel);
currentY += 60;
// Show advanced techniques only if all basic are mastered
if (nenMastery.basicMastered >= 4) {
for (var i = 0; i < nenTechniques.advanced.techniques.length; i++) {
var technique = nenTechniques.advanced.techniques[i];
var canLearn = player.stats.aura >= technique.auraReq && player.skillPoints >= technique.cost;
var buttonText = technique.name + " - " + technique.cost + " SP";
if (technique.unlocked) buttonText += " (Mastered)";
var techniqueButton = new MenuButton(buttonText, technique.unlocked ? null : createTechniqueCallback(technique, 'advanced'));
techniqueButton.x = 300 + i % 3 * 350;
techniqueButton.y = currentY + Math.floor(i / 3) * 100;
if (technique.unlocked) {
techniqueButton.alpha = 0.7;
} else if (!canLearn) {
techniqueButton.alpha = 0.5;
}
buttons.push(techniqueButton);
game.addChild(techniqueButton);
}
} else {
var lockText = new Text2("Master all basic techniques to unlock advanced ones", {
size: 28,
fill: 0x888888
});
lockText.anchor.set(0.5, 0.5);
lockText.x = 1024;
lockText.y = currentY + 50;
game.addChild(lockText);
}
// Back button
var backButton = new MenuButton("Back to Training", function () {
startTrainingMode();
});
backButton.x = 1024;
backButton.y = 1700;
buttons.push(backButton);
game.addChild(backButton);
}
function createTechniqueCallback(technique, category) {
return function () {
learnNenTechnique(technique, category);
};
}
function learnNenTechnique(technique, category) {
if (player.skillPoints >= technique.cost && player.stats.aura >= technique.auraReq) {
player.skillPoints -= technique.cost;
technique.unlocked = true;
// Apply benefits
if (technique.benefits.defense) player.maxHealth += technique.benefits.defense;
if (technique.benefits.aura) {
player.stats.aura += technique.benefits.aura;
player.maxAura += technique.benefits.aura;
}
if (technique.benefits.strength) player.stats.strength += technique.benefits.strength;
if (technique.benefits.intelligence) player.stats.intelligence += technique.benefits.intelligence;
if (technique.benefits.health) {
player.maxHealth += technique.benefits.health;
player.health = player.maxHealth;
}
if (technique.benefits.allStats) {
player.stats.strength += technique.benefits.allStats;
player.stats.speed += technique.benefits.allStats;
player.stats.intelligence += technique.benefits.allStats;
player.stats.aura += technique.benefits.allStats;
}
// Update mastery counters
if (category === 'basic') {
nenMastery.basicMastered++;
} else {
nenMastery.advancedMastered++;
}
nenMastery.totalTechniques++;
LK.getSound('levelUp').play();
LK.effects.flashScreen(0x00ffff, 500);
updateStatsUI();
// Save progress after learning technique
saveGameProgress();
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) {
storyPanel.setText("Your Current Hatsu: " + player.hatsu.name + "\n\n" + player.hatsu.description + "\nAura Required: " + player.hatsu.auraReq + "\nCondition: " + player.hatsu.conditions + "\nMastery Level: " + player.hatsuMastery + "/100" + (player.nenVow ? "\n\nNen Vow: " + player.nenVow.name + " - " + player.nenVow.description : ""));
} else {
storyPanel.setText("Hatsu Creation - " + player.nenType + " Type\n\nChoose a Hatsu template to develop your unique ability. Each Hatsu requires specific aura amounts and has conditions for use.");
}
clearButtons();
if (!player.hatsu) {
// Show Hatsu templates
for (var i = 0; i < templates.length; i++) {
var template = templates[i];
var hatsuButton = new MenuButton(template.name, createHatsuCallback(template));
hatsuButton.x = 700 + i % 2 * 450;
hatsuButton.y = 1200 + Math.floor(i / 2) * 120;
buttons.push(hatsuButton);
game.addChild(hatsuButton);
}
} else {
// Show Nen Vow options if no vow exists
if (!player.nenVow && player.hatsuMastery >= 50) {
var vowButton = new MenuButton("Add Nen Vow", function () {
showNenVows();
});
vowButton.x = 700;
vowButton.y = 1200;
buttons.push(vowButton);
game.addChild(vowButton);
}
// Train Hatsu button
var trainButton = new MenuButton("Train Hatsu (20 Energy)", function () {
if (player.energy >= 20) {
player.energy -= 20;
player.hatsuMastery = Math.min(100, player.hatsuMastery + 10);
updateStatsUI();
LK.effects.flashScreen(0x0066ff, 300);
showHatsuCreation();
}
});
trainButton.x = 1100;
trainButton.y = 1200;
buttons.push(trainButton);
game.addChild(trainButton);
}
// Back button
var backButton = new MenuButton("Back to Training", function () {
startTrainingMode();
});
backButton.x = 1024;
backButton.y = 1600;
buttons.push(backButton);
game.addChild(backButton);
}
function createHatsuCallback(template) {
return function () {
selectHatsu(template);
};
}
function selectHatsu(template) {
player.hatsu = template;
player.hatsuMastery = 10;
storyPanel.setText("Congratulations! You have created your Hatsu: " + template.name + "\n\n" + template.description + "\n\nYour unique ability is now part of you. Train to increase mastery and unlock its full potential!");
// 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);
// Save progress after creating Hatsu
saveGameProgress();
}
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;
storyPanel.setText("You have made a Nen Vow: " + vow.name + "\n\n" + vow.description + "\n\nYour Hatsu power has increased by " + Math.floor((vow.powerBoost - 1) * 100) + "%! Remember, this restriction is now permanent.");
LK.effects.flashScreen(0xff0000, 1000);
updateStatsUI();
// Save progress after making Nen vow
saveGameProgress();
}
function unlockSkill(skill, skillData) {
player.skillPoints -= skillData.cost;
skillData.unlocked = true;
player.abilities.push(skill.name);
// Apply skill effects
if (skill.name === "Iron Body") player.maxHealth += 50;
if (skill.name === "Power Boost") player.stats.strength += 20;
if (skill.name === "Aura Blast") player.maxAura += 30;
updateStatsUI();
showSkillTree(); // Refresh skill tree
}
function resetGame() {
player = {
name: "Hunter",
nenType: "",
level: 1,
experience: 0,
maxExperience: 100,
health: 100,
maxHealth: 100,
aura: 50,
maxAura: 50,
stats: {
strength: 10,
speed: 10,
intelligence: 10,
aura: 10
},
abilities: [],
currentChapter: 1,
energy: 100,
maxEnergy: 100,
skillPoints: 0,
trainingCount: 0,
hunterExamCompleted: false,
hatsu: null,
nenVow: null,
hatsuMastery: 0,
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 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();
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;
// Change background color based on location
if (location.background) {
game.setBackgroundColor(location.background);
}
if (locationKey === "heavensArena") {
showHeavensArena();
} else if (location.chapters && location.chapters.length > 0) {
// Show story-based location
currentLocation = locationKey;
showLocationStory(locationKey, 0);
} else {
// Show location with special boss option
storyPanel.setText("Welcome to " + location.name + "!\n\n" + location.description + "\n\n" + (location.specialBoss ? "A powerful enemy awaits you here!" : "This location is under development. More adventures coming soon!"));
clearButtons();
// Add special boss fight button if available
if (location.specialBoss) {
var canFight = player.level >= location.specialBoss.level - 15 && player.hunterExamCompleted;
var bossButton = new MenuButton("Fight " + location.specialBoss.name + " (Lv." + location.specialBoss.level + ")" + (canFight ? "" : " (Too Strong)"), canFight ? function () {
fightLocationBoss(locationKey);
} : null);
bossButton.x = 1024;
bossButton.y = 1300;
if (!canFight) bossButton.alpha = 0.5;
buttons.push(bossButton);
game.addChild(bossButton);
}
var backButton = new MenuButton("Back to Travel", function () {
game.setBackgroundColor(0x1a1a1a); // Reset to default background
showTravelMenu();
});
backButton.x = 1024;
backButton.y = 1400;
buttons.push(backButton);
game.addChild(backButton);
}
}
function showHeavensArena() {
var location = travelLocations.heavensArena;
storyPanel.setText("Heaven's Arena - Floor " + location.currentFloor + "/200\n\nFight your way to the top! Each floor brings stronger opponents and greater rewards.\n\nCurrent Floor: " + location.currentFloor);
clearButtons();
if (location.currentFloor < 200) {
var fightButton = new MenuButton("Fight Next Opponent", function () {
startHeavensArenaFight();
});
fightButton.x = 1024;
fightButton.y = 1300;
buttons.push(fightButton);
game.addChild(fightButton);
} else {
var completedText = new Text2("Congratulations! You've conquered Heaven's Arena!", {
size: 32,
fill: 0x00FF00
});
completedText.anchor.set(0.5, 0.5);
completedText.x = 1024;
completedText.y = 1300;
game.addChild(completedText);
}
var backButton = new MenuButton("Back to Travel", function () {
showTravelMenu();
});
backButton.x = 1024;
backButton.y = 1400;
buttons.push(backButton);
game.addChild(backButton);
}
function startHeavensArenaFight() {
var location = travelLocations.heavensArena;
var floorLevel = Math.floor(location.currentFloor / 50);
var opponent = location.opponents[Math.min(floorLevel, location.opponents.length - 1)];
var playerPower = player.stats.strength + player.stats.speed + player.stats.intelligence + player.stats.aura;
var opponentPower = opponent.level * 10;
var success = playerPower > opponentPower * 0.8;
if (success) {
location.currentFloor += 25;
player.experience += opponent.reward.exp;
player.skillPoints += Math.floor(opponent.reward.exp / 20);
if (player.experience >= player.maxExperience) {
levelUp();
}
storyPanel.setText("Victory!\n\nYou defeated the " + opponent.name + "!\n\nFloor advanced to: " + location.currentFloor + "\nExperience gained: " + opponent.reward.exp + "\nSkill Points gained: " + Math.floor(opponent.reward.exp / 20));
LK.effects.flashScreen(0x00ff00, 500);
} else {
player.health = Math.max(1, player.health - 30);
storyPanel.setText("Defeat!\n\nThe " + opponent.name + " was too strong!\n\nHealth lost: 30\nTrain more before attempting this floor again!");
LK.effects.flashScreen(0xff0000, 500);
}
updateStatsUI();
clearButtons();
var continueButton = new MenuButton("Continue", function () {
showHeavensArena();
});
continueButton.x = 1024;
continueButton.y = 1400;
buttons.push(continueButton);
game.addChild(continueButton);
}
function showBossMenu() {
storyPanel.setText("Boss Battles\n\nTest your skills against legendary hunters and dangerous opponents!");
clearButtons();
var bossKeys = Object.keys(bosses);
var buttonY = 1200;
for (var i = 0; i < bossKeys.length; i++) {
var bossKey = bossKeys[i];
var boss = bosses[bossKey];
var canFight = player.level >= boss.level - 10 && player.hunterExamCompleted;
var buttonText = boss.name + " (Lv." + boss.level + ")" + (canFight ? "" : " (Too Strong)");
var bossButton = new MenuButton(buttonText, canFight ? createBossCallback(bossKey) : null);
bossButton.x = 700 + i % 2 * 450;
bossButton.y = buttonY + Math.floor(i / 2) * 100;
if (!canFight) bossButton.alpha = 0.5;
buttons.push(bossButton);
game.addChild(bossButton);
}
var backButton = new MenuButton("Back to Travel", function () {
showTravelMenu();
});
backButton.x = 1024;
backButton.y = 1600;
buttons.push(backButton);
game.addChild(backButton);
}
function createBossCallback(bossKey) {
return function () {
fightBoss(bossKey);
};
}
function fightLocationBoss(locationKey) {
var location = travelLocations[locationKey];
var boss = location.specialBoss;
// Create boss enemy object for battle system
var bossEnemy = {
name: boss.name,
health: boss.health,
maxHealth: boss.maxHealth,
aura: boss.stats.aura * 5,
stats: boss.stats,
reward: boss.reward,
abilities: boss.abilities,
hatsu: boss.hatsu,
level: boss.level
};
// Add special boss dialogue based on location
var bossDialogue = "";
switch (locationKey) {
case "heavensArena":
bossDialogue = "Razor grins as his 14 devils materialize around him. 'Let's play a real game!'";
break;
case "yorknewCity":
bossDialogue = "Chrollo opens his book calmly. 'I wonder what ability I should borrow for this fight...'";
break;
case "greedIsland":
bossDialogue = "Genthru's hands glow menacingly. 'You're about to learn why they call me the Bomber.'";
break;
case "darkContinent":
bossDialogue = "The King regards you with cold calculation. 'A human dares challenge me? Amusing.'";
break;
default:
bossDialogue = boss.name + " prepares for battle!";
break;
}
storyPanel.setText("Location Boss Battle: " + boss.name + "\n\n" + bossDialogue + "\n\nThis will be an intense battle!");
clearButtons();
var fightButton = new MenuButton("Begin Battle!", function () {
startBattle(bossEnemy);
});
fightButton.x = 1024;
fightButton.y = 1300;
buttons.push(fightButton);
game.addChild(fightButton);
var retreatButton = new MenuButton("Retreat", function () {
visitLocation(locationKey);
});
retreatButton.x = 1024;
retreatButton.y = 1400;
buttons.push(retreatButton);
game.addChild(retreatButton);
}
function fightBoss(bossKey) {
var boss = bosses[bossKey];
// Create boss enemy object for battle system
var bossEnemy = {
name: boss.name,
health: boss.health,
maxHealth: boss.maxHealth,
aura: boss.stats.aura * 5,
stats: boss.stats,
reward: boss.reward,
abilities: boss.abilities,
hatsu: boss.hatsu,
level: boss.level
};
// Add special boss dialogue
var bossDialogue = "";
switch (bossKey) {
case "gon":
bossDialogue = "Gon clenches his fist, rock energy gathering around him. 'I won't lose to you!'";
break;
case "killua":
bossDialogue = "Killua's hands crackle with electricity. 'Let me show you the Zoldyck family's power!'";
break;
case "hisoka":
bossDialogue = "Hisoka licks his lips menacingly. 'Oh, what a delicious fight this will be... ♠'";
break;
case "illumi":
bossDialogue = "Illumi's dead eyes stare at you. 'I'll make you into one of my puppets.'";
break;
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 canFightBoss = player.level >= location.specialBoss.level - 15 && player.hunterExamCompleted;
var bossButton = new MenuButton("Challenge " + location.specialBoss.name + " (Level " + location.specialBoss.level + ")" + (canFightBoss ? "" : " - Too Strong"), canFightBoss ? function () {
fightLocationBoss(locationKey);
} : null);
bossButton.x = 1024;
bossButton.y = 1300;
if (!canFightBoss) bossButton.alpha = 0.5;
buttons.push(bossButton);
game.addChild(bossButton);
}
var backButton = new MenuButton("Return to Travel", function () {
game.setBackgroundColor(0x1a1a1a); // Reset background
showTravelMenu();
});
backButton.x = 1024;
backButton.y = 1400;
buttons.push(backButton);
game.addChild(backButton);
return;
}
storyPanel.setText(location.story + "\n\n" + chapter.title + "\n\n" + chapter.text);
clearButtons();
for (var i = 0; i < chapter.choices.length; i++) {
var choice = chapter.choices[i];
var choiceButton = new MenuButton(choice.text, createLocationChoiceCallback(locationKey, chapterIndex, choice));
choiceButton.x = 1024;
choiceButton.y = 1300 + i * 100;
buttons.push(choiceButton);
game.addChild(choiceButton);
}
}
function createLocationChoiceCallback(locationKey, chapterIndex, choice) {
return function () {
handleLocationChoice(locationKey, chapterIndex, choice);
};
}
function handleLocationChoice(locationKey, chapterIndex, choice) {
var expGain = 100 + chapterIndex * 50;
var statGain = 5 + chapterIndex * 2;
// Apply choice consequences
switch (choice.action) {
case "auction_direct":
player.stats.intelligence += statGain;
player.health -= 20;
break;
case "underground_info":
player.stats.speed += statGain;
player.stats.intelligence += statGain;
break;
case "hunter_backup":
player.stats.strength += statGain;
break;
case "direct_confrontation":
if (Math.random() < 0.3) {
// 30% chance of success
player.stats.strength += statGain * 3;
player.stats.aura += statGain * 2;
expGain *= 3;
} else {
player.health = Math.max(1, player.health - 60);
expGain = Math.floor(expGain / 2);
}
break;
case "negotiate_troupe":
player.stats.intelligence += statGain * 2;
player.skillPoints += 10;
break;
case "tactical_retreat":
player.stats.speed += statGain;
break;
case "hunt_monsters":
player.stats.strength += statGain;
player.stats.speed += statGain;
break;
case "form_team":
player.stats.intelligence += statGain;
player.health += 20;
break;
case "veteran_advice":
player.stats.intelligence += statGain * 2;
player.skillPoints += 5;
break;
case "bomb_challenge":
if (Math.random() < 0.4) {
// 40% chance of success
player.stats.aura += statGain * 3;
player.skillPoints += 20;
expGain *= 4;
} else {
player.health = Math.max(1, player.health - 80);
}
break;
case "unite_players":
player.stats.intelligence += statGain;
player.stats.strength += statGain;
break;
case "speed_escape":
player.stats.speed += statGain * 2;
break;
case "show_hatsu":
if (player.hatsu) {
player.stats.aura += statGain * 2;
player.hatsuMastery += 20;
player.aura = Math.max(10, player.aura - 50);
}
break;
case "communicate_guardian":
if (Math.random() < 0.5) {
player.stats.intelligence += statGain * 2;
player.stats.aura += statGain * 2;
nenMastery.totalTechniques += 2;
} else {
player.health = Math.max(1, player.health - 40);
}
break;
case "stealth_bypass":
player.stats.speed += statGain;
break;
case "queen_combat":
if (Math.random() < 0.2) {
// 20% chance - very difficult
player.stats.strength += statGain * 4;
player.stats.aura += statGain * 4;
player.level += 5;
expGain *= 5;
} else {
player.health = Math.max(1, player.health - 90);
expGain = Math.floor(expGain / 3);
}
break;
case "serve_colony":
player.stats.strength += statGain * 2;
player.stats.speed += statGain * 2;
player.stats.intelligence -= statGain; // Lose some humanity
break;
case "ant_alliance":
player.stats.intelligence += statGain * 2;
player.skillPoints += 15;
break;
// New Yorknew City actions
case "infiltrate_crime":
if (Math.random() < 0.6) {
player.stats.intelligence += statGain * 2;
player.skillPoints += 10;
expGain *= 2;
} else {
player.health = Math.max(1, player.health - 40);
}
break;
case "broker_alliance":
player.stats.intelligence += statGain * 3;
player.skillPoints += 15;
break;
case "underground_bosses":
player.stats.strength += statGain * 2;
player.stats.speed += statGain;
break;
case "stop_troupe":
if (Math.random() < 0.3) {
player.stats.strength += statGain * 4;
player.stats.aura += statGain * 3;
expGain *= 4;
} else {
player.health = Math.max(1, player.health - 70);
}
break;
case "steal_items":
player.stats.speed += statGain * 2;
player.stats.intelligence += statGain;
player.skillPoints += 20;
break;
case "save_innocents":
player.stats.intelligence += statGain;
player.maxHealth += 30;
break;
// New Greed Island actions
case "defensive_traps":
player.stats.intelligence += statGain * 2;
break;
case "attack_rivals":
player.stats.strength += statGain * 2;
player.stats.speed += statGain;
break;
case "rival_alliance":
player.stats.intelligence += statGain;
player.skillPoints += 8;
break;
case "ruins_solo":
if (Math.random() < 0.4) {
player.stats.aura += statGain * 3;
player.skillPoints += 25;
expGain *= 3;
} else {
player.health = Math.max(1, player.health - 50);
}
break;
case "ruins_team":
player.stats.strength += statGain;
player.stats.intelligence += statGain;
break;
case "ruins_research":
player.stats.intelligence += statGain * 2;
break;
// New Dark Continent actions
case "study_anomalies":
if (Math.random() < 0.5) {
player.stats.intelligence += statGain * 3;
player.stats.aura += statGain * 2;
nenMastery.totalTechniques += 3;
} else {
player.stats.intelligence -= statGain;
player.health = Math.max(1, player.health - 30);
}
break;
case "hunt_impossibles":
if (Math.random() < 0.3) {
player.stats.strength += statGain * 4;
player.stats.aura += statGain * 4;
player.level += 3;
expGain *= 5;
} else {
player.health = Math.max(1, player.health - 80);
}
break;
case "wait_safety":
player.health += 30;
break;
case "decipher_inscriptions":
if (Math.random() < 0.6) {
player.stats.intelligence += statGain * 3;
player.stats.aura += statGain * 3;
nenMastery.totalTechniques += 5;
player.skillPoints += 30;
} else {
player.health = Math.max(1, player.health - 60);
player.stats.intelligence -= Math.floor(statGain / 2);
}
break;
case "explore_architecture":
player.stats.aura += statGain * 2;
player.stats.intelligence += statGain * 2;
break;
case "contact_spirits":
if (Math.random() < 0.4) {
player.stats.aura += statGain * 4;
player.stats.intelligence += statGain * 3;
nenMastery.totalTechniques += 4;
expGain *= 4;
} else {
player.health = Math.max(1, player.health - 70);
player.aura = Math.max(10, player.aura - 40);
}
break;
// NGL-specific actions
case "safe_paths":
player.stats.intelligence += statGain;
player.health += 20;
break;
case "wilderness_shortcuts":
if (Math.random() < 0.6) {
player.stats.speed += statGain * 2;
player.stats.strength += statGain;
expGain *= 2;
} else {
player.health = Math.max(1, player.health - 40);
}
break;
case "observe_area":
player.stats.intelligence += statGain * 2;
player.skillPoints += 8;
break;
case "fight_scouts":
if (Math.random() < 0.4) {
player.stats.strength += statGain * 3;
player.stats.speed += statGain * 2;
expGain *= 3;
} else {
player.health = Math.max(1, player.health - 50);
expGain = Math.floor(expGain / 2);
}
break;
case "stealth_avoid":
player.stats.speed += statGain;
player.stats.intelligence += statGain;
break;
case "communicate_ants":
if (Math.random() < 0.3) {
player.stats.intelligence += statGain * 3;
player.skillPoints += 15;
nenMastery.totalTechniques += 2;
} else {
player.health = Math.max(1, player.health - 60);
}
break;
case "investigate_research":
player.stats.intelligence += statGain * 3;
player.skillPoints += 20;
if (Math.random() < 0.2) {
player.stats.aura += statGain * 2;
}
break;
case "find_researchers":
if (Math.random() < 0.5) {
player.stats.intelligence += statGain * 2;
player.skillPoints += 10;
expGain *= 2;
} else {
player.health = Math.max(1, player.health - 35);
}
break;
case "destroy_facility":
player.stats.strength += statGain;
player.maxHealth += 25;
break;
case "genetic_study":
if (Math.random() < 0.3) {
// Successful study - gain incredible evolution-based powers
player.stats.strength += statGain * 4;
player.stats.speed += statGain * 3;
player.stats.aura += statGain * 4;
player.level += 2;
expGain *= 5;
} else {
// Mutation risk - lose health but gain some benefits
player.health = Math.max(1, player.health - 70);
player.stats.strength += statGain;
player.stats.aura += statGain;
}
break;
case "collect_samples":
player.stats.intelligence += statGain * 2;
player.skillPoints += 25;
if (Math.random() < 0.4) {
player.health = Math.max(1, player.health - 30);
}
break;
case "destroy_genetic_material":
player.stats.intelligence += statGain;
player.maxHealth += 30;
break;
case "challenge_new_queen":
if (Math.random() < 0.2) {
// Victory against Queen - incredible rewards
player.stats.strength += statGain * 5;
player.stats.speed += statGain * 4;
player.stats.aura += statGain * 5;
player.level += 3;
expGain *= 6;
} else {
// Defeat - Chimera Ant reincarnation system
handleChimeraAntReincarnation();
return; // Skip normal processing
}
break;
case "negotiate_colony":
if (Math.random() < 0.4) {
player.stats.intelligence += statGain * 3;
player.skillPoints += 30;
expGain *= 3;
} else {
handleChimeraAntReincarnation();
return;
}
break;
case "report_colony":
player.stats.intelligence += statGain;
player.skillPoints += 15;
break;
case "final_battle_full_power":
if (Math.random() < 0.3) {
player.stats.strength += statGain * 4;
player.stats.aura += statGain * 4;
expGain *= 4;
} else {
handleChimeraAntReincarnation();
return;
}
break;
case "study_evolution":
if (Math.random() < 0.5) {
player.stats.intelligence += statGain * 4;
nenMastery.totalTechniques += 3;
expGain *= 3;
} else {
handleChimeraAntReincarnation();
return;
}
break;
case "turn_against_threats":
player.stats.intelligence += statGain * 2;
player.skillPoints += 20;
break;
// New Meteor City actions
case "fighting_tournaments":
if (Math.random() < 0.5) {
player.stats.strength += statGain * 3;
player.stats.speed += statGain * 2;
expGain *= 3;
} else {
player.health = Math.max(1, player.health - 60);
}
break;
case "organize_legitimate":
player.stats.intelligence += statGain * 2;
player.maxHealth += 25;
break;
case "expose_operations":
player.stats.intelligence += statGain;
player.health = Math.max(1, player.health - 30);
break;
}
// Apply experience and level up if needed
player.experience += expGain;
while (player.experience >= player.maxExperience && player.level < 50) {
levelUp();
}
// Show results
storyPanel.setText("Result: " + choice.consequences + "\n\nExperience gained: " + expGain + "\nStats improved based on your choice!");
clearButtons();
var continueButton = new MenuButton("Continue", function () {
showLocationStory(locationKey, chapterIndex + 1);
});
continueButton.x = 1024;
continueButton.y = 1400;
buttons.push(continueButton);
game.addChild(continueButton);
updateStatsUI();
LK.effects.flashScreen(0x00aaff, 500);
}
function startBattle(enemy) {
currentBattle = true;
battleState.enemy = enemy;
battleState.playerHealth = player.health;
battleState.enemyHealth = enemy.health;
battleState.playerAura = player.aura;
battleState.enemyAura = enemy.aura || 100;
battleState.playerTurn = true;
battleState.battleLog = [];
battleState.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 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 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;
}
buttons.push(actionButton);
game.addChild(actionButton);
}
} else {
// Enemy turn - automatically execute after delay
LK.setTimeout(function () {
executeEnemyTurn();
}, 1500);
}
}
function createBattleActionCallback(actionKey) {
return function () {
if (battleState.playerAura >= battleActions[actionKey].auraRequired) {
executeBattleAction(actionKey);
}
};
}
function executeBattleAction(actionKey) {
var action = battleActions[actionKey];
var damage = 0;
var logMessage = "";
battleState.playerAura -= action.auraRequired;
// Check if player is stunned (skip turn)
if (battleState.playerStunned) {
logMessage = "You're stunned and cannot act this turn!";
battleState.playerStunned = false;
battleState.battleLog.push(logMessage);
battleState.playerTurn = false;
showBattleScreen();
return;
}
switch (actionKey) {
case "attack":
damage = player.stats.strength + Math.floor(Math.random() * 20);
// Apply needle debuff
if (battleState.needleDebuff) {
damage = Math.floor(damage * 0.6);
logMessage = "Your attack is weakened by Illumi's needles! You strike for " + damage + " damage!";
battleState.needleDebuff = false;
} else {
logMessage = "You strike for " + damage + " damage!";
}
break;
case "hatsuAttack":
if (player.hatsu) {
damage = player.stats.strength + player.stats.aura + Math.floor(Math.random() * 30);
// Apply Hatsu battle effects
if (player.hatsu.battleEffects) {
var effects = player.hatsu.battleEffects;
if (effects.multiplier) {
damage = Math.floor(damage * effects.multiplier);
}
// Handle special effects
if (effects.special === "stun_chance" && Math.random() < 0.3) {
battleState.enemyStunned = true;
logMessage = "Your " + player.hatsu.name + " stuns the enemy for " + damage + " damage!";
} else if (effects.special === "piercing") {
battleState.ignoredDefense = true;
logMessage = "Your " + player.hatsu.name + " pierces through defenses for " + damage + " damage!";
} else if (effects.special === "damage_over_time") {
battleState.poisonDamage = Math.floor(damage * 0.3);
battleState.poisonTurns = 3;
logMessage = "Your " + player.hatsu.name + " poisons the enemy for " + damage + " damage! They'll take more damage over time!";
} else {
logMessage = "You use " + player.hatsu.name + " for " + damage + " damage!";
}
} else {
logMessage = "You use " + player.hatsu.name + " for " + damage + " damage!";
}
if (player.nenVow) {
damage = Math.floor(damage * player.nenVow.powerBoost);
}
// Apply clan Hatsu boost
if (player.clan && humanClans[player.clan] && humanClans[player.clan].hatsuBoost) {
var clanBoost = humanClans[player.clan].hatsuBoost;
var shouldBoost = false;
if (clanBoost.nenTypes.includes("All") || clanBoost.nenTypes.includes(player.nenType)) {
shouldBoost = true;
}
if (shouldBoost) {
damage = Math.floor(damage * clanBoost.multiplier);
logMessage += " Your " + humanClans[player.clan].name + " heritage amplifies the attack!";
}
}
// Apply needle debuff
if (battleState.needleDebuff) {
damage = Math.floor(damage * 0.6);
logMessage = "Your Hatsu is weakened by Illumi's needles! " + logMessage;
battleState.needleDebuff = false;
}
}
break;
case "jajankenRock":
damage = player.stats.strength * 3 + Math.floor(Math.random() * 50);
if (Math.random() < 0.4) {
battleState.enemyStunned = true;
logMessage = "You charge up: 'Jajanken: Rock!' A devastating punch that stuns the enemy for " + damage + " damage!";
} else {
logMessage = "You charge up: 'Jajanken: Rock!' A powerful punch for " + damage + " damage!";
}
if (player.nenVow) {
damage = Math.floor(damage * player.nenVow.powerBoost);
}
break;
case "jajankenPaper":
damage = player.stats.aura * 2 + Math.floor(Math.random() * 40);
battleState.ignoredDefense = true;
logMessage = "You unleash: 'Jajanken: Paper!' An aura emission blast that pierces defenses for " + damage + " damage!";
if (player.nenVow) {
damage = Math.floor(damage * player.nenVow.powerBoost);
}
break;
case "jajankenScissors":
damage = player.stats.speed + player.stats.strength + Math.floor(Math.random() * 45);
damage = Math.floor(damage * 2.5); // High damage multiplier
logMessage = "You strike: 'Jajanken: Scissors!' Sharp transmuted aura cuts deep for " + damage + " damage!";
if (Math.random() < 0.3) {
battleState.poisonDamage = Math.floor(damage * 0.2);
battleState.poisonTurns = 2;
logMessage += " The cutting aura causes bleeding!";
}
if (player.nenVow) {
damage = Math.floor(damage * player.nenVow.powerBoost);
}
break;
case "nenTechnique":
damage = player.stats.aura + Math.floor(Math.random() * 25);
// Apply needle debuff
if (battleState.needleDebuff) {
damage = Math.floor(damage * 0.6);
logMessage = "Your Nen technique is weakened by Illumi's needles! You attack for " + damage + " damage!";
battleState.needleDebuff = false;
} else {
logMessage = "You use a Nen technique for " + damage + " damage!";
}
break;
case "enhancerSpecial":
damage = player.stats.strength * 2 + Math.floor(Math.random() * 40);
if (Math.random() < 0.4) {
battleState.nextAttackEnhanced = true;
logMessage = "You focus all your enhancement! Devastating strike for " + damage + " damage! Your next attack will be enhanced!";
} else {
logMessage = "You unleash your Enhancement mastery for " + damage + " damage!";
}
break;
case "shockwavePunch":
// Shockwave Punch variants based on mastery and choice
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
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
// Upgrade all Hatsu to ultimate versions
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 *= 5; // 5x damage multiplier
}
}
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 "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;
}
if (damage > 0) {
battleState.enemyHealth -= damage;
}
battleState.battleLog.push(logMessage);
battleState.playerTurn = false;
// Check if enemy is defeated
if (battleState.enemyHealth <= 0) {
endBattle(true);
return;
}
battleState.availableActions = getAvailableBattleActions();
showBattleScreen();
}
function executeEnemyTurn() {
var enemy = battleState.enemy;
var useHatsu = false;
var damage = 0;
var logMessage = "";
// Enhanced boss logic - higher chance to use special attacks and more devastating effects
var hatsuChance = enemy.level >= 50 ? 0.6 : 0.3; // Stronger bosses use abilities more often
// Check if enemy should use Hatsu
if (enemy.hatsu && battleState.enemyAura >= enemy.hatsu.auraRequired && Math.random() < hatsuChance) {
useHatsu = true;
battleState.enemyAura -= enemy.hatsu.auraRequired;
// Execute specific Hatsu attacks based on enemy Hatsu data
switch (enemy.hatsu.name) {
case "Jajanken":
var variant = enemy.hatsu.variants[Math.floor(Math.random() * 3)];
switch (variant) {
case "Rock":
damage = enemy.stats.strength * 2 + Math.floor(Math.random() * 30);
logMessage = enemy.name + " charges up: 'Jajanken: Rock!' A devastating punch for " + damage + " damage!";
// Try to copy this ability for Specialists
if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") {
tryToCopyAbility("Jajanken: Rock", {
name: "Jajanken: Rock",
multiplier: 2.0,
special: "stun_chance"
});
}
break;
case "Paper":
damage = enemy.stats.aura + Math.floor(Math.random() * 25);
logMessage = enemy.name + " unleashes: 'Jajanken: Paper!' An aura blast for " + damage + " damage!";
if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") {
tryToCopyAbility("Jajanken: Paper", {
name: "Jajanken: Paper",
multiplier: 1.8,
special: "piercing"
});
}
break;
case "Scissors":
damage = enemy.stats.speed + enemy.stats.strength + Math.floor(Math.random() * 20);
logMessage = enemy.name + " strikes: 'Jajanken: Scissors!' A sharp cutting attack for " + damage + " damage!";
if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") {
tryToCopyAbility("Jajanken: Scissors", {
name: "Jajanken: Scissors",
multiplier: 1.9,
special: "piercing"
});
}
break;
}
break;
case "Lightning Palm":
damage = enemy.stats.speed + enemy.stats.aura + Math.floor(Math.random() * 35);
logMessage = enemy.name + "'s hands crackle with electricity: 'Lightning Palm!' Shocking you for " + damage + " damage!";
if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") {
tryToCopyAbility("Lightning Palm", {
name: "Lightning Palm",
multiplier: 2.2,
special: "stun_chance"
});
}
// Lightning has chance to stun (skip next turn)
if (Math.random() < 0.3) {
battleState.playerStunned = true;
logMessage += " You're stunned by the electricity!";
}
break;
case "Bungee Gum":
damage = enemy.stats.intelligence + Math.floor(Math.random() * 25);
logMessage = enemy.name + " grins: 'Bungee Gum has both rubber and gum properties!' Tricky attack for " + damage + " damage!";
if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") {
tryToCopyAbility("Bungee Gum", {
name: "Bungee Gum",
multiplier: 1.8,
special: "movement_restrict"
});
}
// Bungee Gum can pull player closer (reduce next guard effectiveness)
battleState.bungeeGumEffect = true;
logMessage += " Your movements are restricted!";
break;
case "Needle People":
damage = enemy.stats.intelligence + Math.floor(Math.random() * 20);
logMessage = enemy.name + " throws needles: 'Needle People!' Manipulating attack for " + damage + " damage!";
if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") {
tryToCopyAbility("Needle People", {
name: "Needle People",
multiplier: 1.6,
special: "debuff_enemy"
});
}
// Needle manipulation reduces player's next attack
if (Math.random() < 0.4) {
battleState.needleDebuff = true;
logMessage += " The needles cloud your mind!";
}
break;
case "14 Devils":
damage = enemy.stats.aura * 2 + Math.floor(Math.random() * 60);
var devilCount = Math.floor(Math.random() * 3) + 2;
damage *= devilCount;
logMessage = enemy.name + " summons " + devilCount + " emission devils: '14 Devils!' Multiple devastating attacks for " + damage + " total damage!";
if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") {
tryToCopyAbility("14 Devils", {
name: "14 Devils",
multiplier: 2.5,
special: "multi_hit"
});
}
// Devils have chance to inflict status effects
if (Math.random() < 0.4) {
battleState.playerStunned = true;
logMessage += " The devils overwhelm you!";
}
break;
case "Skill Hunter":
damage = enemy.stats.intelligence * 2 + Math.floor(Math.random() * 50);
var stolenSkills = ["Indoor Fish", "Order Stamp", "Black Voice"];
var usedSkill = stolenSkills[Math.floor(Math.random() * stolenSkills.length)];
logMessage = enemy.name + " opens his book: 'Skill Hunter - " + usedSkill + "!' Stolen ability deals " + damage + " damage!";
if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") {
tryToCopyAbility("Skill Hunter", {
name: "Skill Hunter",
multiplier: 2.0,
special: "ability_steal"
});
}
// Different effects based on stolen skill
if (usedSkill === "Black Voice" && Math.random() < 0.3) {
battleState.needleDebuff = true;
logMessage += " You feel controlled!";
}
break;
case "Little Flower":
damage = enemy.stats.strength * 2.5 + Math.floor(Math.random() * 70);
logMessage = enemy.name + " touches you: 'Little Flower!' Explosive aura detonates for " + damage + " damage!";
if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") {
tryToCopyAbility("Little Flower", {
name: "Little Flower",
multiplier: 2.5,
special: "explosive"
});
}
// Explosion can cause burn damage over time
if (Math.random() < 0.5) {
battleState.poisonDamage = Math.floor(damage * 0.4);
battleState.poisonTurns = 3;
logMessage += " The explosion burns you!";
}
break;
case "Rage Blast":
damage = enemy.stats.aura * 3 + Math.floor(Math.random() * 100);
logMessage = enemy.name + " charges ultimate power: 'Rage Blast!' Apocalyptic energy blast for " + damage + " damage!";
if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") {
tryToCopyAbility("Rage Blast", {
name: "Rage Blast",
multiplier: 3.0,
special: "ultimate_attack"
});
}
// Rage Blast is extremely devastating
battleState.ignoredDefense = true;
if (Math.random() < 0.6) {
battleState.playerStunned = true;
logMessage += " The overwhelming power stuns you!";
}
break;
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);
// Stronger enemies deal more damage
if (enemy.level >= 50) {
damage = Math.floor(damage * 1.5);
}
logMessage = enemy.name + " uses " + enemy.hatsu.name + " for " + damage + " damage!";
if (player.nenType === "Specialist" && player.hatsu && player.hatsu.name === "Ability Copy") {
tryToCopyAbility(enemy.hatsu.name, {
name: enemy.hatsu.name,
multiplier: 1.8,
special: "generic_hatsu"
});
}
break;
}
} else {
// Regular attack
damage = enemy.stats.strength + Math.floor(Math.random() * 15);
logMessage = enemy.name + " attacks for " + damage + " damage!";
}
// Apply boss defense system
if (battleState.enemy && damage > 0) {
var bossDefense = calculateBossDefense(battleState.enemy);
var originalDamage = damage;
damage = Math.max(1, Math.floor(damage * bossDefense.damageReduction));
if (originalDamage !== damage && bossDefense.defenseType) {
logMessage += " " + battleState.enemy.name + " uses " + bossDefense.defenseType + " to reduce damage!";
}
}
// Apply player defensive modifiers
if (battleState.nextParry && !battleState.playerStunned) {
var parryEffectiveness = battleState.bungeeGumEffect ? 0.4 : 0.2;
damage = Math.floor(damage * parryEffectiveness);
var counterDamage = player.stats.strength;
battleState.enemyHealth -= counterDamage;
logMessage += " You parry and counter for " + counterDamage + " damage!";
battleState.nextParry = false;
} else if (battleState.nextGuard && !battleState.playerStunned) {
var guardEffectiveness = battleState.bungeeGumEffect ? 0.7 : 0.5;
damage = Math.floor(damage * guardEffectiveness);
logMessage += " You block, reducing damage!";
battleState.nextGuard = false;
}
// Apply damage
battleState.playerHealth -= damage;
battleState.battleLog.push(logMessage);
// Reset status effects
if (battleState.playerStunned) {
battleState.playerStunned = false;
}
if (battleState.bungeeGumEffect) {
battleState.bungeeGumEffect = false;
}
battleState.playerTurn = true;
// Check if player is defeated
if (battleState.playerHealth <= 0) {
endBattle(false);
return;
}
showBattleScreen();
}
function calculateBossDefense(enemy) {
var defenseLevel = 1.0; // No defense reduction by default
var defenseType = "";
var enemyLevel = enemy.level || 25;
var enemyAura = enemy.stats ? enemy.stats.aura : 25;
// Stronger bosses have better defensive techniques
if (enemyLevel >= 50) {
// High-level bosses use Ken (maintain aura defense)
if (Math.random() < 0.7) {
defenseLevel = 0.4; // 60% damage reduction
defenseType = "Ken (Enhanced Defense)";
}
} else if (enemyLevel >= 35) {
// Mid-level bosses use Ten (basic aura shroud)
if (Math.random() < 0.5) {
defenseLevel = 0.6; // 40% damage reduction
defenseType = "Ten (Aura Shroud)";
}
} else if (enemyLevel >= 25) {
// Lower bosses have basic defense
if (Math.random() < 0.3) {
defenseLevel = 0.8; // 20% damage reduction
defenseType = "Basic Nen Defense";
}
}
// Special boss-specific defenses
if (enemy.name === "Meruem (The King)") {
defenseLevel = 0.3; // King has incredible defense
defenseType = "Royal Guard Defense";
} else if (enemy.name === "Razor") {
if (Math.random() < 0.6) {
defenseLevel = 0.5;
defenseType = "Devil Shield";
}
} else if (enemy.name === "Chrollo Lucilfer") {
if (Math.random() < 0.4) {
defenseLevel = 0.7;
defenseType = "Stolen Defensive Ability";
}
} else if (enemy.name === "Hisoka Morow") {
if (Math.random() < 0.3) {
defenseLevel = 0.8;
defenseType = "Bungee Gum Shield";
}
}
return {
damageReduction: defenseLevel,
defenseType: defenseType
};
}
function tryToCopyAbility(abilityName, abilityData) {
if (!player.copiedAbilityWitnesses[abilityName]) {
player.copiedAbilityWitnesses[abilityName] = 0;
}
player.copiedAbilityWitnesses[abilityName]++;
if (player.copiedAbilityWitnesses[abilityName] >= 3) {
// Find empty slot to store ability
for (var i = 0; i < 3; i++) {
if (!player.copiedAbilities[i]) {
player.copiedAbilities[i] = abilityData;
battleState.battleLog.push("You've learned to copy: " + abilityName + "!");
LK.effects.flashScreen(0x00ffff, 300);
// 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);
clearButtons();
var continueButton = new MenuButton("Continue as " + reincarnationType, function () {
updateStatsUI();
LK.effects.flashScreen(0x880088, 2000);
game.setBackgroundColor(0x1a1a1a);
showTravelMenu();
});
continueButton.x = 1024;
continueButton.y = 1400;
buttons.push(continueButton);
game.addChild(continueButton);
updateStatsUI();
LK.effects.flashScreen(0x880088, 2000);
}
function endBattle(playerWon) {
currentBattle = false;
player.health = battleState.playerHealth;
player.aura = battleState.playerAura;
if (playerWon) {
var exp = battleState.enemy.reward ? battleState.enemy.reward.experience : 100;
var sp = battleState.enemy.reward ? battleState.enemy.reward.skillPoints : 5;
player.experience += exp;
player.skillPoints += sp;
// 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;
}
while (player.experience >= player.maxExperience && player.level < 50) {
levelUp();
}
// 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);
} else {
storyPanel.setText("VICTORY!\n\nYou defeated " + battleState.enemy.name + "!\n\nExperience gained: " + exp + "\nSkill Points gained: " + sp);
LK.effects.flashScreen(0x00ff00, 1000);
}
} else {
storyPanel.setText("DEFEAT!\n\nYou were defeated by " + battleState.enemy.name + ".\n\nYou retreat to recover your strength.");
LK.effects.flashScreen(0xff0000, 1000);
}
clearButtons();
var continueButton = new MenuButton("Continue", function () {
if (currentLocation) {
game.setBackgroundColor(0x1a1a1a);
showTravelMenu();
} else {
startTrainingMode();
}
});
continueButton.x = 1024;
continueButton.y = 1400;
buttons.push(continueButton);
game.addChild(continueButton);
updateStatsUI();
// Save progress after battle
saveGameProgress();
}
function showDebugClanSelection() {
storyPanel.setText("DEBUG: Clan Selection\n\nChoose which clan to join:");
clearButtons();
var clanKeys = Object.keys(humanClans);
for (var i = 0; i < clanKeys.length; i++) {
var clanKey = clanKeys[i];
var clan = humanClans[clanKey];
var clanButton = new MenuButton(clan.name, createDebugClanCallback(clanKey));
clanButton.x = 700 + i % 2 * 450;
clanButton.y = 1200 + Math.floor(i / 2) * 100;
buttons.push(clanButton);
game.addChild(clanButton);
}
var noClanButton = new MenuButton("Remove Clan", function () {
player.clan = null;
updateStatsUI();
startTrainingMode();
});
noClanButton.x = 1024;
noClanButton.y = 1500;
buttons.push(noClanButton);
game.addChild(noClanButton);
var backButton = new MenuButton("Back", function () {
startTrainingMode();
});
backButton.x = 1024;
backButton.y = 1600;
buttons.push(backButton);
game.addChild(backButton);
}
function createDebugClanCallback(clanKey) {
return function () {
player.clan = clanKey;
var clan = humanClans[clanKey];
// Apply clan bonuses (if not already applied)
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);
}
updateStatsUI();
LK.effects.flashScreen(0xffd700, 1000);
startTrainingMode();
};
}
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)";
}
playerInfoText.setText(infoText);
}
// Update stat numbers
var statsValues = [player.stats.strength, player.stats.speed, player.stats.intelligence, player.stats.aura];
for (var i = 0; i < statNumbersText.length && i < statsValues.length; i++) {
var statsLabels = ["Strength", "Speed", "Intelligence", "Aura"];
statNumbersText[i].setText(statsLabels[i] + ": " + statsValues[i]);
}
}
// 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 = "";
}
// 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("|") : [];
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 && currentClan.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) {
for (var stat in choice.statChanges) {
if (stat === "health") {
player.health = Math.max(1, player.health + choice.statChanges[stat]);
} else if (stat === "maxHealth") {
player.maxHealth += choice.statChanges[stat];
player.health = Math.min(player.health, player.maxHealth);
} else if (stat === "maxAura") {
player.maxAura += choice.statChanges[stat];
player.aura = Math.min(player.aura, player.maxAura);
} else if (player.stats[stat] !== undefined) {
player.stats[stat] += choice.statChanges[stat];
}
}
}
// 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);
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();
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);
}
}
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;
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";
}
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();
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("|");
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(",");
}
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);
}
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);
}
function showStoryProgressReview() {
var reviewText = "📊 STORY PROGRESS REVIEW 📊\n\n";
if (storyProgress.completedArcs.length > 0) {
reviewText += "Completed Arcs:\n";
for (var i = 0; i < storyProgress.completedArcs.length; i++) {
var arcKey = storyProgress.completedArcs[i];
var arc = storyArcs[arcKey];
reviewText += "✅ " + arc.title + "\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);
}
// Initialize game
initializeUI();
// Check if player has saved progress
if (storage.player_name && storage.gameState) {
gameState = storage.gameState;
if (gameState === "training") {
startTrainingMode();
} else {
startCharacterCreation();
}
} else {
startCharacterCreation();
}
game.update = function () {
// Only check achievements when significant actions occur, not every frame
}; ===================================================================
--- original.js
+++ change.js
@@ -167,54 +167,232 @@
// Game State
var gameState = "characterCreation";
var trainingState = "menu"; // menu, training, skillTree
var debugMode = true; // Set to false to hide debug buttons
-// 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,
+ name: "Hunter",
+ nenType: "",
+ level: 1,
+ experience: 0,
+ maxExperience: 100,
+ health: 100,
+ maxHealth: 100,
+ aura: 50,
+ 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
+ strength: 10,
+ speed: 10,
+ intelligence: 10,
+ 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: storage.player_hatsu ? null : null,
- // Temporarily disable hatsu loading
- nenVow: storage.player_nenVow ? null : null,
- // Temporarily disable nenVow loading
- hatsuMastery: storage.player_hatsuMastery || 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;
+ abilities: [],
+ currentChapter: 1,
+ energy: 100,
+ maxEnergy: 100,
+ skillPoints: 0,
+ trainingCount: 0,
+ hunterExamCompleted: false,
+ hatsu: null,
+ nenVow: null,
+ hatsuMastery: 0,
+ copiedAbilities: [null, null, null],
+ copiedAbilityWitnesses: {},
+ race: "Human",
+ clan: null,
+ scarletEyesLevel: 0,
+ scarletEyesProgress: 0
+};
+// Save/Load system
+function saveGameProgress() {
+ // Save player 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;
+ storage.player_hatsuMastery = player.hatsuMastery;
+ storage.player_race = player.race;
+ storage.player_clan = player.clan;
+ storage.player_scarletEyesLevel = player.scarletEyesLevel;
+ storage.player_scarletEyesProgress = player.scarletEyesProgress;
+ // Save Hatsu data
+ if (player.hatsu) {
+ storage.player_hatsu_name = player.hatsu.name;
+ storage.player_hatsu_description = player.hatsu.description;
+ storage.player_hatsu_auraReq = player.hatsu.auraReq;
+ storage.player_hatsu_conditions = player.hatsu.conditions;
+ } else {
+ storage.player_hatsu_name = null;
+ }
+ // Save Nen Vow data
+ if (player.nenVow) {
+ storage.player_nenVow_name = player.nenVow.name;
+ storage.player_nenVow_description = player.nenVow.description;
+ storage.player_nenVow_powerBoost = player.nenVow.powerBoost;
+ storage.player_nenVow_type = player.nenVow.type;
+ } else {
+ storage.player_nenVow_name = null;
+ }
+ // Save copied abilities
+ storage.player_copiedAbilities = "";
+ for (var i = 0; i < player.copiedAbilities.length; i++) {
+ if (player.copiedAbilities[i]) {
+ storage.player_copiedAbilities += player.copiedAbilities[i].name + "|";
+ }
+ }
+ // Save copied ability witnesses
+ storage.player_copiedAbilityWitnesses = "";
+ for (var ability in player.copiedAbilityWitnesses) {
+ storage.player_copiedAbilityWitnesses += ability + ":" + player.copiedAbilityWitnesses[ability] + "|";
+ }
+ // Save Nen mastery data
+ storage.nenMastery_basicMastered = nenMastery.basicMastered;
+ storage.nenMastery_advancedMastered = nenMastery.advancedMastered;
+ storage.nenMastery_totalTechniques = nenMastery.totalTechniques;
+ // Save technique unlocks
+ storage.nenTechniques_basic = "";
+ for (var i = 0; i < nenTechniques.basic.techniques.length; i++) {
+ if (nenTechniques.basic.techniques[i].unlocked) {
+ storage.nenTechniques_basic += nenTechniques.basic.techniques[i].name + "|";
+ }
+ }
+ storage.nenTechniques_advanced = "";
+ for (var i = 0; i < nenTechniques.advanced.techniques.length; i++) {
+ if (nenTechniques.advanced.techniques[i].unlocked) {
+ storage.nenTechniques_advanced += nenTechniques.advanced.techniques[i].name + "|";
+ }
+ }
+ // Save travel location data
+ storage.travelLocation_heavensArena_currentFloor = travelLocations.heavensArena.currentFloor;
+ // Save game state
+ storage.gameState = gameState;
+ storage.trainingState = trainingState;
+}
+function loadGameProgress() {
+ // Load player data
+ if (storage.player_name) {
+ player.name = storage.player_name;
+ player.nenType = storage.player_nenType || "";
+ player.level = storage.player_level || 1;
+ player.experience = storage.player_experience || 0;
+ player.maxExperience = storage.player_maxExperience || 100;
+ player.health = storage.player_health || 100;
+ player.maxHealth = storage.player_maxHealth || 100;
+ player.aura = storage.player_aura || 50;
+ player.maxAura = storage.player_maxAura || 50;
+ player.stats.strength = storage.player_stats_strength || 10;
+ player.stats.speed = storage.player_stats_speed || 10;
+ player.stats.intelligence = storage.player_stats_intelligence || 10;
+ player.stats.aura = storage.player_stats_aura || 10;
+ player.abilities = storage.player_abilities ? storage.player_abilities.split(",") : [];
+ player.currentChapter = storage.player_currentChapter || 1;
+ player.energy = storage.player_energy || 100;
+ player.maxEnergy = storage.player_maxEnergy || 100;
+ player.skillPoints = storage.player_skillPoints || 0;
+ player.trainingCount = storage.player_trainingCount || 0;
+ player.hunterExamCompleted = storage.player_hunterExamCompleted === 1;
+ player.hatsuMastery = storage.player_hatsuMastery || 0;
+ player.race = storage.player_race || "Human";
+ player.clan = storage.player_clan || null;
+ player.scarletEyesLevel = storage.player_scarletEyesLevel || 0;
+ player.scarletEyesProgress = storage.player_scarletEyesProgress || 0;
+ // Load Hatsu data
+ if (storage.player_hatsu_name) {
+ player.hatsu = {
+ name: storage.player_hatsu_name,
+ description: storage.player_hatsu_description,
+ auraReq: storage.player_hatsu_auraReq,
+ conditions: storage.player_hatsu_conditions,
+ battleEffects: {} // Will be restored from templates
+ };
+ }
+ // Load Nen Vow data
+ if (storage.player_nenVow_name) {
+ player.nenVow = {
+ name: storage.player_nenVow_name,
+ description: storage.player_nenVow_description,
+ powerBoost: storage.player_nenVow_powerBoost,
+ type: storage.player_nenVow_type
+ };
+ }
+ // Load copied abilities
+ if (storage.player_copiedAbilities) {
+ var copiedAbilitiesData = storage.player_copiedAbilities.split("|");
+ for (var i = 0; i < copiedAbilitiesData.length && i < 3; i++) {
+ if (copiedAbilitiesData[i]) {
+ player.copiedAbilities[i] = {
+ name: copiedAbilitiesData[i],
+ multiplier: 1.8,
+ special: "generic_copy"
+ };
+ }
}
}
- return witnesses;
- }() : {},
- race: storage.player_race || "Human",
- clan: storage.player_clan || null,
- scarletEyesLevel: storage.player_scarletEyesLevel || 0,
- scarletEyesProgress: storage.player_scarletEyesProgress || 0
-};
+ // Load copied ability witnesses
+ if (storage.player_copiedAbilityWitnesses) {
+ var witnessData = storage.player_copiedAbilityWitnesses.split("|");
+ for (var i = 0; i < witnessData.length; i++) {
+ if (witnessData[i]) {
+ var parts = witnessData[i].split(":");
+ if (parts.length === 2) {
+ player.copiedAbilityWitnesses[parts[0]] = parseInt(parts[1]);
+ }
+ }
+ }
+ }
+ // Load Nen mastery data
+ nenMastery.basicMastered = storage.nenMastery_basicMastered || 0;
+ nenMastery.advancedMastered = storage.nenMastery_advancedMastered || 0;
+ nenMastery.totalTechniques = storage.nenMastery_totalTechniques || 0;
+ // Load technique unlocks
+ if (storage.nenTechniques_basic) {
+ var basicUnlocks = storage.nenTechniques_basic.split("|");
+ for (var i = 0; i < basicUnlocks.length; i++) {
+ if (basicUnlocks[i]) {
+ for (var j = 0; j < nenTechniques.basic.techniques.length; j++) {
+ if (nenTechniques.basic.techniques[j].name === basicUnlocks[i]) {
+ nenTechniques.basic.techniques[j].unlocked = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+ if (storage.nenTechniques_advanced) {
+ var advancedUnlocks = storage.nenTechniques_advanced.split("|");
+ for (var i = 0; i < advancedUnlocks.length; i++) {
+ if (advancedUnlocks[i]) {
+ for (var j = 0; j < nenTechniques.advanced.techniques.length; j++) {
+ if (nenTechniques.advanced.techniques[j].name === advancedUnlocks[i]) {
+ nenTechniques.advanced.techniques[j].unlocked = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+ // Load travel location data
+ travelLocations.heavensArena.currentFloor = storage.travelLocation_heavensArena_currentFloor || 1;
+ // Load game state
+ gameState = storage.gameState || "characterCreation";
+ trainingState = storage.trainingState || "menu";
+ }
+}
// Clan System for Human Race
var humanClans = {
netero: {
name: "Netero Clan",
@@ -1296,16 +1474,16 @@
unlockMessage: "You've overcome Illumi's manipulation!"
}
}
};
-// Travel Locations - load from storage
+// Travel Locations
var travelLocations = {
heavensArena: {
name: "Heaven's Arena",
description: "Fight through 200 floors of the famous combat tower. Face stronger opponents as you climb higher.",
unlocked: true,
floors: 200,
- currentFloor: storage.travelLocations_heavensArena_currentFloor || 1,
+ currentFloor: 1,
background: 0x4a4a4a,
opponents: [{
name: "Floor 50 Fighter",
level: 10,
@@ -2288,35 +2466,35 @@
slots: 3
}
}]
};
-// Nen Techniques System - load from storage
+// Nen Techniques System
var nenTechniques = {
basic: {
name: "Basic Nen Principles",
techniques: [{
name: "Ten",
description: "Shroud your body with aura to enhance defense",
cost: 0,
- unlocked: storage.nenTechniques_basic_Ten === 1,
+ unlocked: false,
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,
+ unlocked: false,
auraReq: 15,
benefits: {
stealth: 30
}
}, {
name: "Ren",
description: "Increase the amount of aura around your body",
cost: 10,
- unlocked: storage.nenTechniques_basic_Ren === 1,
+ unlocked: false,
auraReq: 20,
benefits: {
aura: 10,
strength: 5
@@ -2324,9 +2502,9 @@
}, {
name: "Hatsu",
description: "Use aura to perform supernatural feats",
cost: 20,
- unlocked: storage.nenTechniques_basic_Hatsu === 1,
+ unlocked: false,
auraReq: 30,
benefits: {
allStats: 5
}
@@ -2337,27 +2515,27 @@
techniques: [{
name: "Gyo",
description: "Focus aura into your eyes to see hidden things",
cost: 15,
- unlocked: storage.nenTechniques_advanced_Gyo === 1,
+ unlocked: false,
auraReq: 25,
benefits: {
intelligence: 10
}
}, {
name: "In",
description: "Hide your aura completely",
cost: 25,
- unlocked: storage.nenTechniques_advanced_In === 1,
+ unlocked: false,
auraReq: 35,
benefits: {
stealth: 50
}
}, {
name: "En",
description: "Extend your aura to sense surroundings",
cost: 30,
- unlocked: storage.nenTechniques_advanced_En === 1,
+ unlocked: false,
auraReq: 40,
benefits: {
aura: 15,
intelligence: 8
@@ -2365,40 +2543,40 @@
}, {
name: "Shu",
description: "Extend aura to objects you're holding",
cost: 20,
- unlocked: storage.nenTechniques_advanced_Shu === 1,
+ unlocked: false,
auraReq: 30,
benefits: {
strength: 12
}
}, {
name: "Ko",
description: "Focus all aura into one body part",
cost: 35,
- unlocked: storage.nenTechniques_advanced_Ko === 1,
+ unlocked: false,
auraReq: 45,
benefits: {
strength: 20
}
}, {
name: "Ken",
description: "Maintain Ren for extended periods",
cost: 40,
- unlocked: storage.nenTechniques_advanced_Ken === 1,
+ unlocked: false,
auraReq: 50,
benefits: {
aura: 20,
health: 30
}
}]
}
};
-// Add Nen mastery to player data - load from storage
+// Add Nen mastery to player data
var nenMastery = {
- basicMastered: storage.nenMastery_basicMastered || 0,
- advancedMastered: storage.nenMastery_advancedMastered || 0,
- totalTechniques: storage.nenMastery_totalTechniques || 0
+ basicMastered: 0,
+ advancedMastered: 0,
+ totalTechniques: 0
};
// Battle System Data
var currentBattle = null;
var battleState = {
@@ -2727,121 +2905,121 @@
powerBoost: 3.5,
special: "killing_intent_only"
}]
};
-// Skill Tree - load from storage
+// Skill Tree
var skillTree = {
enhancer: {
name: "Enhancement Skills",
skills: [{
name: "Iron Body",
cost: 50,
- unlocked: storage.skillTree_enhancer_IronBody === 1,
+ unlocked: false,
description: "Increase defense by 20%"
}, {
name: "Power Boost",
cost: 100,
- unlocked: storage.skillTree_enhancer_PowerBoost === 1,
+ unlocked: false,
description: "Increase strength by 50%"
}, {
name: "Regeneration",
cost: 150,
- unlocked: storage.skillTree_enhancer_Regeneration === 1,
+ unlocked: false,
description: "Slowly recover health over time"
}]
},
emitter: {
name: "Emission Skills",
skills: [{
name: "Aura Blast",
cost: 60,
- unlocked: storage.skillTree_emitter_AuraBlast === 1,
+ unlocked: false,
description: "Ranged aura attack"
}, {
name: "Remote Control",
cost: 120,
- unlocked: storage.skillTree_emitter_RemoteControl === 1,
+ unlocked: false,
description: "Control objects from distance"
}, {
name: "Aura Sphere",
cost: 180,
- unlocked: storage.skillTree_emitter_AuraSphere === 1,
+ unlocked: false,
description: "Create protective aura barriers"
}]
},
manipulator: {
name: "Manipulation Skills",
skills: [{
name: "Object Control",
cost: 70,
- unlocked: storage.skillTree_manipulator_ObjectControl === 1,
+ unlocked: false,
description: "Manipulate nearby objects"
}, {
name: "Mind Influence",
cost: 140,
- unlocked: storage.skillTree_manipulator_MindInfluence === 1,
+ unlocked: false,
description: "Influence enemy actions"
}, {
name: "Mass Control",
cost: 200,
- unlocked: storage.skillTree_manipulator_MassControl === 1,
+ unlocked: false,
description: "Control multiple targets"
}]
},
transmuter: {
name: "Transmutation Skills",
skills: [{
name: "Rubber Aura",
cost: 55,
- unlocked: storage.skillTree_transmuter_RubberAura === 1,
+ unlocked: false,
description: "Make aura elastic and bouncy"
}, {
name: "Electric Aura",
cost: 110,
- unlocked: storage.skillTree_transmuter_ElectricAura === 1,
+ unlocked: false,
description: "Transmute aura into electricity"
}, {
name: "Shape Shift",
cost: 165,
- unlocked: storage.skillTree_transmuter_ShapeShift === 1,
+ unlocked: false,
description: "Change aura into various forms"
}]
},
conjurer: {
name: "Conjuration Skills",
skills: [{
name: "Weapon Summon",
cost: 80,
- unlocked: storage.skillTree_conjurer_WeaponSummon === 1,
+ unlocked: false,
description: "Conjure basic weapons"
}, {
name: "Tool Creation",
cost: 160,
- unlocked: storage.skillTree_conjurer_ToolCreation === 1,
+ unlocked: false,
description: "Create useful tools"
}, {
name: "Complex Objects",
cost: 240,
- unlocked: storage.skillTree_conjurer_ComplexObjects === 1,
+ unlocked: false,
description: "Conjure complex mechanisms"
}]
},
specialist: {
name: "Specialist Skills",
skills: [{
name: "Unique Ability",
cost: 100,
- unlocked: storage.skillTree_specialist_UniqueAbility === 1,
+ unlocked: false,
description: "Discover your unique power"
}, {
name: "Power Amplify",
cost: 200,
- unlocked: storage.skillTree_specialist_PowerAmplify === 1,
+ unlocked: false,
description: "Amplify all abilities"
}, {
name: "Reality Bend",
cost: 300,
- unlocked: storage.skillTree_specialist_RealityBend === 1,
+ unlocked: false,
description: "Bend rules of reality"
}]
}
};
@@ -2856,8 +3034,10 @@
// Initialize UI
function initializeUI() {
// Initialize achievement storage first
initializeAchievementStorage();
+ // Load game progress from storage
+ loadGameProgress();
// Load achievement states from storage
for (var category in achievements) {
var categoryData = achievements[category];
for (var i = 0; i < categoryData.achievements.length; i++) {
@@ -2990,8 +3170,10 @@
showAchievementNotification(nenAwakeningAchievement);
}
}
updateStatsUI();
+ // Save progress after selecting Nen type
+ saveGameProgress();
}
// Story System
function startStoryChapter(chapterNum) {
var chapter = storyChapters[chapterNum];
@@ -3129,8 +3311,10 @@
continueButton.y = 1400;
buttons.push(continueButton);
game.addChild(continueButton);
updateStatsUI();
+ // Save progress after story choice
+ saveGameProgress();
}
function levelUp() {
if (player.level >= 50) {
return; // Maximum level reached
@@ -3148,8 +3332,10 @@
checkClanUnlock();
}
LK.getSound('levelUp').play();
LK.effects.flashScreen(0xffff00, 500);
+ // Save progress after level up
+ saveGameProgress();
}
function checkClanUnlock() {
if (player.race !== "Human" || player.clan) return;
var availableClans = [];
@@ -3237,8 +3423,10 @@
}
}
updateStatsUI();
LK.effects.flashScreen(0xffd700, 2000);
+ // Save progress after unlocking clan
+ saveGameProgress();
}
function showGameComplete() {
player.hunterExamCompleted = true;
// Mark Hunter Exam Saga as completed in story progress
@@ -3268,8 +3456,10 @@
showAchievementNotification(hunterLicenseAchievement);
}
}
LK.setScore(player.level * 100 + player.stats.strength + player.stats.speed + player.stats.intelligence + player.stats.aura);
+ // Save progress after completing game
+ saveGameProgress();
}
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();
@@ -3622,8 +3812,10 @@
// Update UI
updateStatsUI();
// Flash effect
LK.effects.flashScreen(0x00ff00, 300);
+ // Save progress
+ saveGameProgress();
// Refresh training mode to update buttons
startTrainingMode();
}
function showNenTechniques() {
@@ -3741,9 +3933,10 @@
nenMastery.totalTechniques++;
LK.getSound('levelUp').play();
LK.effects.flashScreen(0x00ffff, 500);
updateStatsUI();
- savePlayerData(); // Save progress
+ // Save progress after learning technique
+ saveGameProgress();
showNenTechniques(); // Refresh the menu
}
}
function showSkillTree() {
@@ -3866,8 +4059,10 @@
}
}
updateStatsUI();
LK.effects.flashScreen(0x00ffff, 1000);
+ // Save progress after creating Hatsu
+ saveGameProgress();
}
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
@@ -3927,8 +4122,10 @@
player.nenVow = vow;
storyPanel.setText("You have made a Nen Vow: " + vow.name + "\n\n" + vow.description + "\n\nYour Hatsu power has increased by " + Math.floor((vow.powerBoost - 1) * 100) + "%! Remember, this restriction is now permanent.");
LK.effects.flashScreen(0xff0000, 1000);
updateStatsUI();
+ // Save progress after making Nen vow
+ saveGameProgress();
}
function unlockSkill(skill, skillData) {
player.skillPoints -= skillData.cost;
skillData.unlocked = true;
@@ -3937,9 +4134,8 @@
if (skill.name === "Iron Body") player.maxHealth += 50;
if (skill.name === "Power Boost") player.stats.strength += 20;
if (skill.name === "Aura Blast") player.maxAura += 30;
updateStatsUI();
- savePlayerData(); // Save progress
showSkillTree(); // Refresh skill tree
}
function resetGame() {
player = {
@@ -4004,42 +4200,8 @@
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_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 = 1;
// Reset all achievement unlocks
for (var category in achievements) {
var categoryData = achievements[category];
for (var i = 0; i < categoryData.achievements.length; i++) {
@@ -6241,8 +6403,10 @@
continueButton.y = 1400;
buttons.push(continueButton);
game.addChild(continueButton);
updateStatsUI();
+ // Save progress after battle
+ saveGameProgress();
}
function showDebugClanSelection() {
storyPanel.setText("DEBUG: Clan Selection\n\nChoose which clan to join:");
clearButtons();
@@ -6298,83 +6462,8 @@
LK.effects.flashScreen(0xffd700, 1000);
startTrainingMode();
};
}
-// 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;
- storage.player_hatsu = player.hatsu ? player.hatsu.name || "" : "";
- storage.player_nenVow = player.nenVow ? player.nenVow.name || "" : "";
- storage.player_hatsuMastery = player.hatsuMastery;
- storage.player_copiedAbilities = player.copiedAbilities.join("|");
- // Convert object to string representation
- var witnessesStr = "";
- for (var key in player.copiedAbilityWitnesses) {
- if (witnessesStr) witnessesStr += ",";
- witnessesStr += key + ":" + player.copiedAbilityWitnesses[key];
- }
- storage.player_copiedAbilityWitnesses = witnessesStr;
- storage.player_race = player.race;
- storage.player_clan = player.clan;
- storage.player_scarletEyesLevel = player.scarletEyesLevel;
- storage.player_scarletEyesProgress = player.scarletEyesProgress;
- // Save nen mastery data
- 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_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_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_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_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_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;
-}
function updateStatsUI() {
if (statsUI.length > 0) {
statsUI[0].updateValue(player.health);
statsUI[1].updateValue(player.aura);
@@ -6404,10 +6493,8 @@
for (var i = 0; i < statNumbersText.length && i < statsValues.length; i++) {
var statsLabels = ["Strength", "Speed", "Intelligence", "Aura"];
statNumbersText[i].setText(statsLabels[i] + ": " + statsValues[i]);
}
- // Save player data whenever stats are updated
- savePlayerData();
}
// Achievement System
var achievements = {
training: {
@@ -7669,15 +7756,17 @@
game.addChild(backButton);
}
// Initialize game
initializeUI();
-// Check if player has existing save data
-if (storage.player_name && storage.player_name !== "Hunter") {
- // Player has save data, skip character creation
- gameState = "training";
- startTrainingMode();
+// Check if player has saved progress
+if (storage.player_name && storage.gameState) {
+ gameState = storage.gameState;
+ if (gameState === "training") {
+ startTrainingMode();
+ } else {
+ startCharacterCreation();
+ }
} else {
- // New player, start character creation
startCharacterCreation();
}
game.update = function () {
// Only check achievements when significant actions occur, not every frame