diff --git a/public/libs/enemys.js b/public/libs/enemys.js index ba40d73..e5778a4 100644 --- a/public/libs/enemys.js +++ b/public/libs/enemys.js @@ -225,9 +225,6 @@ enemys.prototype.getDamageString = function (enemy, x, y, floorId) { else color = '#FF2222'; damage = core.formatBigNumber(damage, true); - if (core.enemys.hasSpecial(enemy, 19)) damage += '+'; - if (core.enemys.hasSpecial(enemy, 21)) damage += '-'; - if (core.enemys.hasSpecial(enemy, 11)) damage += '^'; } return { diff --git a/public/project/floors/MT14.js b/public/project/floors/MT14.js index 65be6af..506e595 100644 --- a/public/project/floors/MT14.js +++ b/public/project/floors/MT14.js @@ -122,15 +122,14 @@ main.floors.MT14= } ], "no": [ - "注意:如果剧情过程中卡死,请刷新页面(不会修,根本找不到问题在哪)", { "type": "pauseBgm" }, - "\t[野蛮人,hero]\b[down,hero]终于逃出来了!", - "\t[野蛮人,hero]\b[down,hero]太吓人了!!!", - "\t[野蛮人,hero]\b[down,hero]这下应该不会有魔物再出现了吧", - "\t[野蛮人,hero]\b[down,hero]这山都快塌了", - "\t[野蛮人,hero]\b[down,hero]天也快黑了,回家休息休息吧", + "\t[野蛮人,hero]\b[down,hero]呼!", + "\t[野蛮人,hero]\b[down,hero]总算逃出来了。", + "\t[野蛮人,hero]\b[down,hero]没想到柴火没砍成,还碰到了狼。", + "\t[野蛮人,hero]\b[down,hero]真是倒了血霉了。", + "\t[野蛮人,hero]\b[down,hero]算了,明天再砍柴吧。", { "type": "setCurtain", "color": [ @@ -142,160 +141,65 @@ main.floors.MT14= "time": 1500, "keep": true }, - { - "type": "changeFloor", - "floorId": "MT0", - "loc": [ - 7, - 12 - ], - "direction": "up" - }, - { - "type": "pauseBgm" - }, - { - "type": "setCurtain", - "time": 1500 - }, - "\t[野蛮人,hero]\b[up,hero]看来,我也需要鼓起勇气向未知的区域前进了", - "\t[野蛮人,hero]\b[up,hero]只在这附近无法再让我提升了啊", - { - "type": "setCurtain", - "color": [ - 0, - 0, - 0, - 1 - ], - "time": 1500, - "keep": true - }, - { - "type": "hideHero" - }, - { - "type": "setValue", - "name": "flag:plot", - "value": "true" - }, - { - "type": "function", - "function": "function(){\ncore.values.floorChangeTime = 0;\n}" - }, - { - "type": "changeFloor", - "floorId": "MT14", - "loc": [ - 24, - 7 - ] - }, - { - "type": "playBgm", - "name": "plot1.mp3", - "keep": true - }, - { - "type": "setCurtain", - "time": 2000, - "async": true - }, - { - "type": "setViewport", - "dxy": [ - 20, - 0 - ], - "time": 10000 - }, - { - "type": "setCurtain", - "color": [ - 0, - 0, - 0, - 1 - ], - "time": 500, - "keep": true - }, - { - "type": "changeFloor", - "floorId": "MT14", - "loc": [ - 93, - 7 - ] - }, - { - "type": "setCurtain", - "time": 500, - "async": true - }, - { - "type": "setViewport", - "dxy": [ - 20, - 0 - ], - "time": 10000 - }, - { - "type": "setCurtain", - "color": [ - 0, - 0, - 0, - 1 - ], - "time": 500, - "keep": true - }, - { - "type": "changeFloor", - "floorId": "MT15", - "loc": [ - 31, - 7 - ] - }, - { - "type": "setCurtain", - "time": 500, - "async": true - }, - { - "type": "setViewport", - "dxy": [ - 20, - 0 - ], - "time": 10000 - }, - { - "type": "setCurtain", - "color": [ - 0, - 0, - 0, - 1 - ], - "time": 500, - "keep": true - }, - { - "type": "waitAsync" - }, { "type": "setText", - "align": "center" + "text": [ + 0, + 0, + 0, + 1 + ], + "background": "winskin3.png" }, { - "type": "scrollText", - "text": "就这样,野蛮人踏上了寻求智慧的旅途\n在那片绿色结晶的驱使下,他发现了智慧的强大\n而人类历史由此转向快速发展期\n智慧终将战胜一切\n而野蛮将会挫败永世\n\n一刀一剑斩天歌,随风来者是稀客\n一点智慧破苍穹,万里征途犹坎坷\n回首却看山前树,挥手不忘前时乐\n一鼓作气寻征途,留下芳香艳人色\n\n回首处望苍穹,千里共当时明月终\n\n人类,正在开天辟地", - "time": 30000, - "lineHeight": 2 + "type": "setGlobalAttribute", + "name": "font", + "value": "scroll" + }, + "人类简史——起源篇", + { + "type": "playSound", + "name": "paper.mp3" + }, + "但他已经抑制不了自己的好奇心。", + { + "type": "playSound", + "name": "paper.mp3" + }, + "人类嘛,总会在好奇心的驱使下前进。", + { + "type": "playSound", + "name": "paper.mp3" + }, + "但是,他们却用好奇心给自己带来了灾难,", + { + "type": "playSound", + "name": "paper.mp3" + }, + "只得利用历史中的野蛮人的好奇心来拯救自己。", + { + "type": "playSound", + "name": "paper.mp3" + }, + "不出所料,这个野蛮人走上了勇气之路。", + { + "type": "playSound", + "name": "paper.mp3" + }, + { + "type": "setText", + "text": [ + 255, + 255, + 255, + 1 + ], + "background": "winskin2.png" + }, + { + "type": "setGlobalAttribute", + "name": "font", + "value": "normal" }, { "type": "changeFloor", @@ -305,29 +209,8 @@ main.floors.MT14= 7 ], "direction": "right" - }, - { - "type": "function", - "function": "function(){\ncore.values.floorChangeTime = 200;\n}" - }, - { - "type": "showHero" - }, - { - "type": "setCurtain", - "time": 500 - }, - { - "type": "setText", - "align": "left" } ] - }, - "\t[野蛮人]\b[up,hero]勇气之路,我来了!", - { - "type": "setValue", - "name": "flag:plot", - "value": "false" } ] } diff --git a/public/project/floors/MT16.js b/public/project/floors/MT16.js index a130dbc..2b8045e 100644 --- a/public/project/floors/MT16.js +++ b/public/project/floors/MT16.js @@ -422,6 +422,10 @@ main.floors.MT16= "追逐的时候不能用2技能,不能用楼传,逃跑后要原路返回山洞", "追逐战分为两个难度,简单难度会显示逃跑路径,困难模式不显示,困难模式逃跑成功可以获得成就", "前方会有大约40秒的剧情,之后开始追逐战并自动存档,如果逃跑失败需要重打,可以直接读自动存档", + "\t[野蛮人]\b[up,hero]这墙上有文字?", + "\t[野蛮人]\b[up,hero]真相就藏在智慧之塔中,而想要到达智慧之塔,你必须经过勇气的考验,通过勇气之路。", + "\t[野蛮人]\b[up,hero]智慧之塔?勇气之路?", + "\t[野蛮人]\b[up,hero]算了,先砍柴吧。", { "type": "hide", "remove": true diff --git a/public/project/floors/MT17.js b/public/project/floors/MT17.js index 3580e8f..06a479d 100644 --- a/public/project/floors/MT17.js +++ b/public/project/floors/MT17.js @@ -17,9 +17,10 @@ main.floors.MT17= "weather": null, "firstArrive": [ { - "type": "function", - "function": "function(){\ncore.resetMap(\"tower6\");\n}" + "type": "setCurtain", + "time": 1000 }, + "\t[野蛮人]\b[up,hero]勇气之路,智慧之塔,我来了!", "血瓶宝石效果已变成两倍", { "type": "setGlobalValue", diff --git a/public/project/floors/MT20.js b/public/project/floors/MT20.js index e85bf1d..0464582 100644 --- a/public/project/floors/MT20.js +++ b/public/project/floors/MT20.js @@ -13,12 +13,7 @@ main.floors.MT20= "ratio": 2, "defaultGround": "grass", "bgm": "plot1.mp3", - "firstArrive": [ - "\t[野蛮人]\b[up,hero]高塔?", - "\t[野蛮人]\b[up,hero]奇怪,这塔这么高,恐怕不是现在可以建造出来的", - "\t[野蛮人]\b[up,hero]这又是什么神奇的东西", - "\t[野蛮人]\b[up,hero]小心行事为好" - ], + "firstArrive": null, "eachArrive": [ { "type": "setGlobalValue", @@ -29,24 +24,10 @@ main.floors.MT20= "parallelDo": "", "events": { "6,9": [ - "这是一座来自未来的高塔", - { - "type": "animate", - "name": "emm", - "loc": "hero" - }, - "\t[原始人]\b[up,hero]来自未来...", - "\t[原始人]\b[up,hero]难道和那个智慧结有关?" + "万里,智慧破苍穹" ], "8,9": [ - "唯有拥有智慧之人才可进入此塔", - { - "type": "animate", - "name": "emm", - "loc": "hero" - }, - "\t[原始人]\b[up,hero]拥有智慧...", - "\t[原始人]\b[up,hero]什么意思?" + "千丈,勇气贯星海" ] }, "changeFloor": { @@ -79,7 +60,7 @@ main.floors.MT20= [142,142,142,142,40184,40185,40202,40203,40204,40189,40190,142,142,142,142], [142,142,142,142,40192,40193,40202,40203,40204,40197,40198,142,142,142,142], [142,142,142,142,40200,40201,40267,40268,40269,40205,40206,142,142,142,142], - [142,142,142,142,40208,40209,40275, 91,40277,40213,40214,142,142,142,142], + [142,142,142,142,40208,40209,40275,543,40277,40213,40214,142,142,142,142], [142,142,142,142,142,142,129, 0,129,142,142,142,142,142,142], [142,142,142,142,142,142,142, 0,142,142,142,142,142,142,142], [142,142,142,142,142,142,142, 0,142,142,142,142,142,142,142], @@ -121,5 +102,12 @@ main.floors.MT20= [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +], + "cannotMoveIn": {}, + "bg2map": [ + +], + "fg2map": [ + ] } \ No newline at end of file diff --git a/public/project/floors/tower1.js b/public/project/floors/tower1.js index c66219c..fbaefe7 100644 --- a/public/project/floors/tower1.js +++ b/public/project/floors/tower1.js @@ -14,13 +14,7 @@ main.floors.tower1= "defaultGround": "T526", "bgm": "tower.mp3", "firstArrive": [ - "\t[原始人]\b[up,hero]智慧之塔...", - "\t[原始人]\b[up,hero]看来它认为我是拥有智慧之人啊", - "\t[原始人]\b[up,hero]那我就只好爬塔咯", - { - "type": "function", - "function": "function(){\ncore.resetMap('tower6');\n}" - } + "\t[野蛮人]\b[up,hero]这里,便是智慧之塔了" ], "eachArrive": [], "parallelDo": "", diff --git a/public/project/functions.js b/public/project/functions.js index 2e90c3d..ac269bf 100644 --- a/public/project/functions.js +++ b/public/project/functions.js @@ -52,7 +52,10 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { // 隐藏右下角的音乐按钮 core.dom.musicBtn.style.display = 'none'; core.dom.enlargeBtn.style.display = 'none'; - if (main.mode === 'play' && !main.replayChecking) core.splitArea(); + if (main.mode === 'play' && !main.replayChecking) { + core.splitArea(); + core.resetFlagSettings(); + } }, win: function (reason, norank, noexit) { // 游戏获胜事件 @@ -838,8 +841,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { var hp_buff = 0, atk_buff = 0, def_buff = 0; - // 已经计算过的光环怪ID列表,用于判定叠加 - var usedEnemyIds = {}; // 检查光环和支援的缓存 var index = x != null && y != null ? x + ',' + y : 'floor' + enemy.id; @@ -856,35 +857,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { enemy = core.material.enemys[id]; var dx = Math.abs(block.x - x), dy = Math.abs(block.y - y); - // 检查【光环】技能,数字25 - if (enemy && core.hasSpecial(enemy.special, 25)) { - // 检查是否是范围光环 - var inRange = enemy.range == null; - if ( - enemy.range != null && - x != null && - y != null - ) { - // 检查十字和九宫格光环 - if (dx + dy <= enemy.range) inRange = true; - if ( - enemy.zoneSquare && - dx <= enemy.range && - dy <= enemy.range - ) - inRange = true; - } - // 检查是否可叠加 - if ( - inRange && - (enemy.add || !usedEnemyIds[enemy.id]) - ) { - hp_buff += enemy.value || 0; - atk_buff += enemy.atkValue || 0; - def_buff += enemy.defValue || 0; - usedEnemyIds[enemy.id] = true; - } - } // 检查【支援】技能,数字26 if ( enemy && @@ -966,169 +938,192 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { // 后面三个参数主要是可以在光环等效果上可以适用 floorId = floorId || core.status.floorId; - var hero_hp = core.getRealStatusOrDefault(hero, 'hp'), - hero_atk = core.getRealStatusOrDefault(hero, 'atk'), - hero_def = core.getRealStatusOrDefault(hero, 'def'), - hero_IQ = core.getRealStatusOrDefault(hero, 'mdef'), - hero_recovery = core.getRealStatusOrDefault(hero, 'hpmax'), - hero_extraAtk = core.getRealStatusOrDefault(hero, 'mana'), - origin_hero_hp = core.getStatusOrDefault(hero, 'hp'), - origin_hero_atk = core.getStatusOrDefault(hero, 'atk'), - origin_hero_def = core.getStatusOrDefault(hero, 'def'); - - // 勇士的负属性都按0计算 - hero_hp = Math.max(0, hero_hp); - hero_atk = Math.max(0, hero_atk); - hero_def = Math.max(0, hero_def); - // 怪物的各项数据 // 对坚固模仿等处理扔到了脚本编辑-getEnemyInfo之中 - var enemyInfo = core.enemys.getEnemyInfo( + const enemyInfo = core.enemys.getEnemyInfo( enemy, hero, x, y, floorId ); - var mon_hp = enemyInfo.hp, - mon_atk = enemyInfo.atk, - mon_def = enemyInfo.def, - mon_special = enemyInfo.special; - var damage = 0; - // 断灭之刃技能 - if (core.getFlag('bladeOn') && core.getFlag('blade')) { - var level = core.getSkillLevel()[2]; - hero_atk *= 1 + 0.1 * level; - hero_def *= 1 - 0.1 * level; - } - // 饥渴 - if (core.hasSpecial(mon_special, 7)) { - hero_atk *= 1 - (enemy.hungry || 0) / 100; - } + function getDamage() { + let hero_hp = core.getRealStatusOrDefault(hero, 'hp'), + hero_atk = core.getRealStatusOrDefault(hero, 'atk'), + hero_def = core.getRealStatusOrDefault(hero, 'def'), + hero_IQ = core.getRealStatusOrDefault(hero, 'mdef'), + hero_recovery = core.getRealStatusOrDefault(hero, 'hpmax'), + hero_extraAtk = core.getRealStatusOrDefault(hero, 'mana'), + origin_hero_hp = core.getStatusOrDefault(hero, 'hp'), + origin_hero_atk = core.getStatusOrDefault(hero, 'atk'), + origin_hero_def = core.getStatusOrDefault(hero, 'def'); - // 如果是无敌属性,且勇士未持有十字架 - if (core.hasSpecial(mon_special, 20) && !core.hasItem('cross')) - return null; // 不可战斗 + let mon_hp = enemyInfo.hp, + mon_atk = enemyInfo.atk, + mon_def = enemyInfo.def, + mon_special = enemyInfo.special; - // 战前造成的额外伤害(可被护盾抵消) - var init_damage = 0; + let damage = 0; - // 每回合怪物对勇士造成的战斗伤害 - var per_damage = mon_atk - hero_def; - // 魔攻:战斗伤害就是怪物攻击力 - if ( - core.hasSpecial(mon_special, 2) || - core.hasSpecial(mon_special, 13) - ) - per_damage = mon_atk; - // 战斗伤害不能为负值 - if (per_damage < 0) per_damage = 0; - - // 2连击 & 3连击 & N连击 - if (core.hasSpecial(mon_special, 4)) per_damage *= 2; - if (core.hasSpecial(mon_special, 5)) per_damage *= 3; - if (core.hasSpecial(mon_special, 6)) per_damage *= enemy.n || 4; - // 勇士每回合对怪物造成的伤害 - if (!core.hasSpecial(mon_special, 9)) { - var hero_per_damage = Math.max(hero_atk - mon_def, 0); - if (hero_per_damage > 0) hero_per_damage += hero_extraAtk; - } - if (core.hasSpecial(mon_special, 9)) { - var hero_per_damage = Math.max( - hero_atk + hero_extraAtk - mon_def, - 0 - ); - } - - // 如果没有破防,则不可战斗 - if (hero_per_damage <= 0) return null; - - // 勇士的攻击回合数;为怪物生命除以每回合伤害向上取整 - var turn = Math.ceil(mon_hp / hero_per_damage); - - // 致命一击 - if (core.hasSpecial(mon_special, 1)) { - var times = Math.floor(turn / 5); - damage += - ((times * ((enemy.crit || 100) - 100)) / 100) * per_damage; - } - // 勇气之刃 - if (turn > 1 && core.hasSpecial(mon_special, 10)) { - damage += ((enemy.courage || 100) / 100 - 1) * per_damage; - } - // 勇气冲锋 - if (core.hasSpecial(mon_special, 11)) { - damage += ((enemy.charge || 100) / 100) * per_damage; - turn += 5; - } - - // ------ 支援 ----- // - // 这个递归最好想明白为什么,flag:__extraTurn__是怎么用的 - var guards = core.getFlag( - '__guards__' + x + '_' + y, - enemyInfo.guards - ); - var guard_before_current_enemy = true; // ------ 支援怪是先打(true)还是后打(false)? - turn += core.getFlag('__extraTurn__', 0); - if (guards.length > 0) { - if (!guard_before_current_enemy) { - // --- 先打当前怪物,记录当前回合数 - core.setFlag('__extraTurn__', turn); + // 断灭之刃技能 + if (core.getFlag('bladeOn') && core.getFlag('blade')) { + var level = core.getSkillLevel(2); + hero_atk *= 1 + 0.1 * level; + hero_def *= 1 - 0.1 * level; } - // 获得那些怪物组成小队战斗 - for (var i = 0; i < guards.length; i++) { - var gx = guards[i][0], - gy = guards[i][1], - gid = guards[i][2]; - // 递归计算支援怪伤害信息,这里不传x,y保证不会重复调用 - // 这里的mdef传0,因为护盾应该只会被计算一次 - var info = core.enemys.getDamageInfo( - core.material.enemys[gid], - { - hp: origin_hero_hp, - atk: origin_hero_atk, - def: origin_hero_def, - mdef: 0 - } + // 饥渴 + if (core.hasSpecial(mon_special, 7)) { + hero_atk *= 1 - (enemy.hungry || 0) / 100; + } + + // 战前造成的额外伤害(可被护盾抵消) + var init_damage = 0; + + // 每回合怪物对勇士造成的战斗伤害 + var per_damage = mon_atk - hero_def; + // 魔攻:战斗伤害就是怪物攻击力 + if ( + core.hasSpecial(mon_special, 2) || + core.hasSpecial(mon_special, 13) + ) + per_damage = mon_atk; + // 战斗伤害不能为负值 + if (per_damage < 0) per_damage = 0; + + // 2连击 & 3连击 & N连击 + if (core.hasSpecial(mon_special, 4)) per_damage *= 2; + if (core.hasSpecial(mon_special, 5)) per_damage *= 3; + if (core.hasSpecial(mon_special, 6)) per_damage *= enemy.n || 4; + // 勇士每回合对怪物造成的伤害 + if (!core.hasSpecial(mon_special, 9)) { + var hero_per_damage = Math.max(hero_atk - mon_def, 0); + if (hero_per_damage > 0) hero_per_damage += hero_extraAtk; + } + if (core.hasSpecial(mon_special, 9)) { + var hero_per_damage = Math.max( + hero_atk + hero_extraAtk - mon_def, + 0 ); - if (info == null) { - // 小队中任何一个怪物不可战斗,直接返回null - core.removeFlag('__extraTurn__'); - return null; + } + + // 如果没有破防,则不可战斗 + if (hero_per_damage <= 0) return null; + + // 勇士的攻击回合数;为怪物生命除以每回合伤害向上取整 + let turn = Math.ceil(mon_hp / hero_per_damage); + + // 致命一击 + if (core.hasSpecial(mon_special, 1)) { + var times = Math.floor(turn / 5); + damage += + ((times * ((enemy.crit || 100) - 100)) / 100) * + per_damage; + } + // 勇气之刃 + if (turn > 1 && core.hasSpecial(mon_special, 10)) { + damage += ((enemy.courage || 100) / 100 - 1) * per_damage; + } + // 勇气冲锋 + if (core.hasSpecial(mon_special, 11)) { + damage += ((enemy.charge || 100) / 100) * per_damage; + turn += 5; + } + + // ------ 支援 ----- // + // 这个递归最好想明白为什么,flag:__extraTurn__是怎么用的 + const guards = core.getFlag( + '__guards__' + x + '_' + y, + enemyInfo.guards + ); + const guard_before_current_enemy = true; // ------ 支援怪是先打(true)还是后打(false)? + turn += core.getFlag('__extraTurn__', 0); + if (guards.length > 0) { + if (!guard_before_current_enemy) { + // --- 先打当前怪物,记录当前回合数 + core.setFlag('__extraTurn__', turn); + } + // 获得那些怪物组成小队战斗 + for (var i = 0; i < guards.length; i++) { + var gx = guards[i][0], + gy = guards[i][1], + gid = guards[i][2]; + // 递归计算支援怪伤害信息,这里不传x,y保证不会重复调用 + // 这里的mdef传0,因为护盾应该只会被计算一次 + var info = core.enemys.getDamageInfo( + core.material.enemys[gid], + { + hp: origin_hero_hp, + atk: origin_hero_atk, + def: origin_hero_def, + mdef: 0 + } + ); + if (info == null) { + // 小队中任何一个怪物不可战斗,直接返回null + core.removeFlag('__extraTurn__'); + return null; + } + // 已经进行的回合数 + core.setFlag('__extraTurn__', info.turn); + init_damage += info.damage; + } + if (guard_before_current_enemy) { + // --- 先打支援怪物,增加当前回合数 + turn += core.getFlag('__extraTurn__', 0); } - // 已经进行的回合数 - core.setFlag('__extraTurn__', info.turn); - init_damage += info.damage; } - if (guard_before_current_enemy) { - // --- 先打支援怪物,增加当前回合数 - turn += core.getFlag('__extraTurn__', 0); + core.removeFlag('__extraTurn__'); + // ------ 支援END ------ // + + // 最终伤害:初始伤害 + 怪物对勇士造成的伤害 + 反击伤害 + damage += init_damage + (turn - 1) * per_damage; + // 无上之盾 + if (core.hasFlag('superSheild')) { + damage -= hero_IQ; } - } - core.removeFlag('__extraTurn__'); - // ------ 支援END ------ // + // 生命回复 + damage -= hero_recovery * turn; + if (core.getFlag('hard') === 1) damage *= 0.9; - // 最终伤害:初始伤害 + 怪物对勇士造成的伤害 + 反击伤害 - damage += init_damage + (turn - 1) * per_damage; - // 无上之盾 - if (core.hasFlag('superSheild')) { - damage -= hero_IQ; + return { + mon_hp: Math.floor(mon_hp), + mon_atk: Math.floor(mon_atk), + mon_def: Math.floor(mon_def), + init_damage: Math.floor(init_damage), + per_damage: Math.floor(per_damage), + hero_per_damage: Math.floor(hero_per_damage), + turn: Math.floor(turn), + damage: Math.floor(damage) + }; } - // 生命回复 - damage -= hero_recovery * turn; - if (core.getFlag('hard') == 1) damage *= 0.9; - return { - mon_hp: Math.floor(mon_hp), - mon_atk: Math.floor(mon_atk), - mon_def: Math.floor(mon_def), - init_damage: Math.floor(init_damage), - per_damage: Math.floor(per_damage), - hero_per_damage: Math.floor(hero_per_damage), - turn: Math.floor(turn), - damage: Math.floor(damage) - }; + let damageInfo = null; + let damage = Infinity; + + const skills = [['bladeOn', 'blade']]; + damageInfo = getDamage(); + if (damageInfo) damage = damageInfo.damage; + + if (flags.autoSkill) { + for (const [unlock, condition] of skills) { + if (flags[unlock]) { + flags[condition] = true; + const info = getDamage(); + const d = info?.damage; + if (d !== null && d !== void 0) { + if (d < damage) { + damage = d; + damageInfo = info; + } + } + flags[condition] = false; + } + } + return damageInfo; + } else { + return getDamage(); + } } }, actions: { @@ -1261,12 +1256,12 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { core.actions._clickGameInfo_openComments(); break; case 49: // 1: 断灭之刃 - if (!flags.bladeOn) break; + if (!flags.bladeOn || flags.autoSkill) break; core.status.route.push('key:49'); // 将按键记在录像中 core.playSound('光标移动'); if (flags.blade) flags.blade = false; else flags.blade = true; - core.updateStatusBar(false, true); + core.updateStatusBar(); break; case 50: // 快捷键2: 跳跃技能 || 破 if ( diff --git a/src/data/desc.json b/src/data/desc.json index ff7672d..784e487 100644 --- a/src/data/desc.json +++ b/src/data/desc.json @@ -6,7 +6,7 @@ "这里显示本塔中需要注意的事项。", "
", "
", - "1. 本百科全书字数很多,可以选择性地阅读。", + "1. 本百科全书字数很多,可以选择性地阅读。", "
", "
", "2. 本塔中几乎所有 ui 都可以纵向滚动,如果发现显示不全,", @@ -155,7 +155,9 @@ "
", "下面是本塔中新增的快捷键:", "
", - "M:快速标记怪物" + "M:快速标记怪物", + "
", + "J:打开技能树" ] }, "extraAttr": { diff --git a/src/panel/enemyCritical.vue b/src/panel/enemyCritical.vue index aff45e4..ec77973 100644 --- a/src/panel/enemyCritical.vue +++ b/src/panel/enemyCritical.vue @@ -8,11 +8,11 @@ 最大值    {{ - (originCri.at(-1)?.[0] ?? 2) - 1 + ceil((originCri.at(-1)?.[0] ?? 2) / ratio) - 1 }} @@ -29,11 +29,11 @@ 最大值    {{ - (originDef.at(-1)?.[0] ?? 2) - 1 + ceil((originDef.at(-1)?.[0] ?? 2) / ratio) - 1 }} @@ -96,6 +96,7 @@ const critical = ref(); const def = ref(); const enemy = core.plugin.bookDetailEnemy; +const ceil = Math.ceil; let originCri = getCriticalDamage(enemy); let originDef = getDefDamage(enemy); diff --git a/src/ui/fly.vue b/src/ui/fly.vue index 99b25c9..0130c44 100644 --- a/src/ui/fly.vue +++ b/src/ui/fly.vue @@ -118,7 +118,7 @@ watch(nowArea, n => { oy = 0; scale = 3; lastScale = 3; - if (!area[n].includes(nowFloor.value)) + if (area[n] && !area[n].includes(nowFloor.value)) nowFloor.value = area[n].find(v => v === core.status.floorId) ?? area[n][0]; }); @@ -342,7 +342,7 @@ function drawRight() { y = thumb.height / 2 - h / 2; } if (ratio < 1) { - w = h / ratio; + w = h * ratio; x = thumb.width / 2 - w / 2; } thumbCtx.fillStyle = '#000'; @@ -478,6 +478,7 @@ function locateMap(id: FloorIds) { noBorder.value ? 5 : 0, noBorder.value ? 0.5 : 1 ); + if (!data.locs[id]) return; const [x, y] = data.locs[id]!; ox = (-x + data.width / 2) * scale; oy = (-y + data.height / 2) * scale; diff --git a/src/ui/statusBar.vue b/src/ui/statusBar.vue index 068fe22..53b7b72 100644 --- a/src/ui/statusBar.vue +++ b/src/ui/statusBar.vue @@ -167,6 +167,8 @@ function update() { lvName.value = core.getLvName(hero.lv); if (flags.blade && flags.bladeOn) { skill.value = '断灭之刃'; + } else { + skill.value = '无'; } up.value = core.getNextLvUpNeed() ?? 0; if (core.hasFlag('spring')) {