自动切换技能

This commit is contained in:
unanmed 2023-01-04 10:29:01 +08:00
parent d365569d45
commit dc6eb041df
11 changed files with 265 additions and 397 deletions

View File

@ -225,9 +225,6 @@ enemys.prototype.getDamageString = function (enemy, x, y, floorId) {
else color = '#FF2222'; else color = '#FF2222';
damage = core.formatBigNumber(damage, true); 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 { return {

View File

@ -122,15 +122,14 @@ main.floors.MT14=
} }
], ],
"no": [ "no": [
"注意:如果剧情过程中卡死,请刷新页面(不会修,根本找不到问题在哪)",
{ {
"type": "pauseBgm" "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", "type": "setCurtain",
"color": [ "color": [
@ -142,160 +141,65 @@ main.floors.MT14=
"time": 1500, "time": 1500,
"keep": true "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", "type": "setText",
"align": "center" "text": [
0,
0,
0,
1
],
"background": "winskin3.png"
}, },
{ {
"type": "scrollText", "type": "setGlobalAttribute",
"text": "就这样,野蛮人踏上了寻求智慧的旅途\n在那片绿色结晶的驱使下他发现了智慧的强大\n而人类历史由此转向快速发展期\n智慧终将战胜一切\n而野蛮将会挫败永世\n\n一刀一剑斩天歌随风来者是稀客\n一点智慧破苍穹万里征途犹坎坷\n回首却看山前树挥手不忘前时乐\n一鼓作气寻征途留下芳香艳人色\n\n回首处望苍穹千里共当时明月终\n\n人类正在开天辟地", "name": "font",
"time": 30000, "value": "scroll"
"lineHeight": 2 },
"人类简史——起源篇",
{
"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", "type": "changeFloor",
@ -305,29 +209,8 @@ main.floors.MT14=
7 7
], ],
"direction": "right" "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"
} }
] ]
} }

View File

@ -422,6 +422,10 @@ main.floors.MT16=
"追逐的时候不能用2技能不能用楼传逃跑后要原路返回山洞", "追逐的时候不能用2技能不能用楼传逃跑后要原路返回山洞",
"追逐战分为两个难度,简单难度会显示逃跑路径,困难模式不显示,困难模式逃跑成功可以获得成就", "追逐战分为两个难度,简单难度会显示逃跑路径,困难模式不显示,困难模式逃跑成功可以获得成就",
"前方会有大约40秒的剧情之后开始追逐战并自动存档如果逃跑失败需要重打可以直接读自动存档", "前方会有大约40秒的剧情之后开始追逐战并自动存档如果逃跑失败需要重打可以直接读自动存档",
"\t[野蛮人]\b[up,hero]这墙上有文字?",
"\t[野蛮人]\b[up,hero]真相就藏在智慧之塔中,而想要到达智慧之塔,你必须经过勇气的考验,通过勇气之路。",
"\t[野蛮人]\b[up,hero]智慧之塔?勇气之路?",
"\t[野蛮人]\b[up,hero]算了,先砍柴吧。",
{ {
"type": "hide", "type": "hide",
"remove": true "remove": true

View File

@ -17,9 +17,10 @@ main.floors.MT17=
"weather": null, "weather": null,
"firstArrive": [ "firstArrive": [
{ {
"type": "function", "type": "setCurtain",
"function": "function(){\ncore.resetMap(\"tower6\");\n}" "time": 1000
}, },
"\t[野蛮人]\b[up,hero]勇气之路,智慧之塔,我来了!",
"血瓶宝石效果已变成两倍", "血瓶宝石效果已变成两倍",
{ {
"type": "setGlobalValue", "type": "setGlobalValue",

View File

@ -13,12 +13,7 @@ main.floors.MT20=
"ratio": 2, "ratio": 2,
"defaultGround": "grass", "defaultGround": "grass",
"bgm": "plot1.mp3", "bgm": "plot1.mp3",
"firstArrive": [ "firstArrive": null,
"\t[野蛮人]\b[up,hero]高塔?",
"\t[野蛮人]\b[up,hero]奇怪,这塔这么高,恐怕不是现在可以建造出来的",
"\t[野蛮人]\b[up,hero]这又是什么神奇的东西",
"\t[野蛮人]\b[up,hero]小心行事为好"
],
"eachArrive": [ "eachArrive": [
{ {
"type": "setGlobalValue", "type": "setGlobalValue",
@ -29,24 +24,10 @@ main.floors.MT20=
"parallelDo": "", "parallelDo": "",
"events": { "events": {
"6,9": [ "6,9": [
"这是一座来自未来的高塔", "万里,智慧破苍穹"
{
"type": "animate",
"name": "emm",
"loc": "hero"
},
"\t[原始人]\b[up,hero]来自未来...",
"\t[原始人]\b[up,hero]难道和那个智慧结有关?"
], ],
"8,9": [ "8,9": [
"唯有拥有智慧之人才可进入此塔", "千丈,勇气贯星海"
{
"type": "animate",
"name": "emm",
"loc": "hero"
},
"\t[原始人]\b[up,hero]拥有智慧...",
"\t[原始人]\b[up,hero]什么意思?"
] ]
}, },
"changeFloor": { "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,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,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,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,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],
[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], [ 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": [
] ]
} }

View File

@ -14,13 +14,7 @@ main.floors.tower1=
"defaultGround": "T526", "defaultGround": "T526",
"bgm": "tower.mp3", "bgm": "tower.mp3",
"firstArrive": [ "firstArrive": [
"\t[原始人]\b[up,hero]智慧之塔...", "\t[野蛮人]\b[up,hero]这里,便是智慧之塔了"
"\t[原始人]\b[up,hero]看来它认为我是拥有智慧之人啊",
"\t[原始人]\b[up,hero]那我就只好爬塔咯",
{
"type": "function",
"function": "function(){\ncore.resetMap('tower6');\n}"
}
], ],
"eachArrive": [], "eachArrive": [],
"parallelDo": "", "parallelDo": "",

View File

@ -52,7 +52,10 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
// 隐藏右下角的音乐按钮 // 隐藏右下角的音乐按钮
core.dom.musicBtn.style.display = 'none'; core.dom.musicBtn.style.display = 'none';
core.dom.enlargeBtn.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) { win: function (reason, norank, noexit) {
// 游戏获胜事件 // 游戏获胜事件
@ -838,8 +841,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
var hp_buff = 0, var hp_buff = 0,
atk_buff = 0, atk_buff = 0,
def_buff = 0; def_buff = 0;
// 已经计算过的光环怪ID列表用于判定叠加
var usedEnemyIds = {};
// 检查光环和支援的缓存 // 检查光环和支援的缓存
var index = var index =
x != null && y != null ? x + ',' + y : 'floor' + enemy.id; 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]; enemy = core.material.enemys[id];
var dx = Math.abs(block.x - x), var dx = Math.abs(block.x - x),
dy = Math.abs(block.y - y); 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 // 检查【支援】技能数字26
if ( if (
enemy && enemy &&
@ -966,169 +938,192 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
// 后面三个参数主要是可以在光环等效果上可以适用 // 后面三个参数主要是可以在光环等效果上可以适用
floorId = floorId || core.status.floorId; 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之中 // 对坚固模仿等处理扔到了脚本编辑-getEnemyInfo之中
var enemyInfo = core.enemys.getEnemyInfo( const enemyInfo = core.enemys.getEnemyInfo(
enemy, enemy,
hero, hero,
x, x,
y, y,
floorId floorId
); );
var mon_hp = enemyInfo.hp,
mon_atk = enemyInfo.atk,
mon_def = enemyInfo.def,
mon_special = enemyInfo.special;
var damage = 0;
// 断灭之刃技能 function getDamage() {
if (core.getFlag('bladeOn') && core.getFlag('blade')) { let hero_hp = core.getRealStatusOrDefault(hero, 'hp'),
var level = core.getSkillLevel()[2]; hero_atk = core.getRealStatusOrDefault(hero, 'atk'),
hero_atk *= 1 + 0.1 * level; hero_def = core.getRealStatusOrDefault(hero, 'def'),
hero_def *= 1 - 0.1 * level; hero_IQ = core.getRealStatusOrDefault(hero, 'mdef'),
} hero_recovery = core.getRealStatusOrDefault(hero, 'hpmax'),
// 饥渴 hero_extraAtk = core.getRealStatusOrDefault(hero, 'mana'),
if (core.hasSpecial(mon_special, 7)) { origin_hero_hp = core.getStatusOrDefault(hero, 'hp'),
hero_atk *= 1 - (enemy.hungry || 0) / 100; origin_hero_atk = core.getStatusOrDefault(hero, 'atk'),
} origin_hero_def = core.getStatusOrDefault(hero, 'def');
// 如果是无敌属性,且勇士未持有十字架 let mon_hp = enemyInfo.hp,
if (core.hasSpecial(mon_special, 20) && !core.hasItem('cross')) mon_atk = enemyInfo.atk,
return null; // 不可战斗 mon_def = enemyInfo.def,
mon_special = enemyInfo.special;
// 战前造成的额外伤害(可被护盾抵消) let damage = 0;
var init_damage = 0;
// 每回合怪物对勇士造成的战斗伤害 // 断灭之刃技能
var per_damage = mon_atk - hero_def; if (core.getFlag('bladeOn') && core.getFlag('blade')) {
// 魔攻:战斗伤害就是怪物攻击力 var level = core.getSkillLevel(2);
if ( hero_atk *= 1 + 0.1 * level;
core.hasSpecial(mon_special, 2) || hero_def *= 1 - 0.1 * level;
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);
} }
// 获得那些怪物组成小队战斗 // 饥渴
for (var i = 0; i < guards.length; i++) { if (core.hasSpecial(mon_special, 7)) {
var gx = guards[i][0], hero_atk *= 1 - (enemy.hungry || 0) / 100;
gy = guards[i][1], }
gid = guards[i][2];
// 递归计算支援怪伤害信息这里不传x,y保证不会重复调用 // 战前造成的额外伤害(可被护盾抵消)
// 这里的mdef传0因为护盾应该只会被计算一次 var init_damage = 0;
var info = core.enemys.getDamageInfo(
core.material.enemys[gid], // 每回合怪物对勇士造成的战斗伤害
{ var per_damage = mon_atk - hero_def;
hp: origin_hero_hp, // 魔攻:战斗伤害就是怪物攻击力
atk: origin_hero_atk, if (
def: origin_hero_def, core.hasSpecial(mon_special, 2) ||
mdef: 0 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) { core.removeFlag('__extraTurn__');
// --- 先打支援怪物,增加当前回合数 // ------ 支援END ------ //
turn += core.getFlag('__extraTurn__', 0);
// 最终伤害:初始伤害 + 怪物对勇士造成的伤害 + 反击伤害
damage += init_damage + (turn - 1) * per_damage;
// 无上之盾
if (core.hasFlag('superSheild')) {
damage -= hero_IQ;
} }
} // 生命回复
core.removeFlag('__extraTurn__'); damage -= hero_recovery * turn;
// ------ 支援END ------ // if (core.getFlag('hard') === 1) damage *= 0.9;
// 最终伤害:初始伤害 + 怪物对勇士造成的伤害 + 反击伤害 return {
damage += init_damage + (turn - 1) * per_damage; mon_hp: Math.floor(mon_hp),
// 无上之盾 mon_atk: Math.floor(mon_atk),
if (core.hasFlag('superSheild')) { mon_def: Math.floor(mon_def),
damage -= hero_IQ; 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 { let damageInfo = null;
mon_hp: Math.floor(mon_hp), let damage = Infinity;
mon_atk: Math.floor(mon_atk),
mon_def: Math.floor(mon_def), const skills = [['bladeOn', 'blade']];
init_damage: Math.floor(init_damage), damageInfo = getDamage();
per_damage: Math.floor(per_damage), if (damageInfo) damage = damageInfo.damage;
hero_per_damage: Math.floor(hero_per_damage),
turn: Math.floor(turn), if (flags.autoSkill) {
damage: Math.floor(damage) 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: { actions: {
@ -1261,12 +1256,12 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
core.actions._clickGameInfo_openComments(); core.actions._clickGameInfo_openComments();
break; break;
case 49: // 1: 断灭之刃 case 49: // 1: 断灭之刃
if (!flags.bladeOn) break; if (!flags.bladeOn || flags.autoSkill) break;
core.status.route.push('key:49'); // 将按键记在录像中 core.status.route.push('key:49'); // 将按键记在录像中
core.playSound('光标移动'); core.playSound('光标移动');
if (flags.blade) flags.blade = false; if (flags.blade) flags.blade = false;
else flags.blade = true; else flags.blade = true;
core.updateStatusBar(false, true); core.updateStatusBar();
break; break;
case 50: // 快捷键2: 跳跃技能 || 破 case 50: // 快捷键2: 跳跃技能 || 破
if ( if (

View File

@ -6,7 +6,7 @@
"这里显示本塔中需要注意的事项。", "这里显示本塔中需要注意的事项。",
"<br>", "<br>",
"<br>", "<br>",
"1. 本百科全书字数很多,可以选择性地阅读。", "1. <span style=\"color: yellow\">本百科全书字数很多,可以选择性地阅读。</span>",
"<br>", "<br>",
"<br>", "<br>",
"2. 本塔中<span style=\"color: gold\">几乎所有 ui </span>都可以纵向滚动,如果发现显示不全,", "2. 本塔中<span style=\"color: gold\">几乎所有 ui </span>都可以纵向滚动,如果发现显示不全,",
@ -155,7 +155,9 @@
"<br>", "<br>",
"下面是本塔中新增的快捷键:", "下面是本塔中新增的快捷键:",
"<br>", "<br>",
"<span style=\"color: gold\">M</span>:快速标记怪物" "<span style=\"color: gold\">M</span>:快速标记怪物",
"<br>",
"<span style=\"color: gold\">J</span>:打开技能树"
] ]
}, },
"extraAttr": { "extraAttr": {

View File

@ -8,11 +8,11 @@
<a-slider <a-slider
class="slider" class="slider"
v-model:value="addAtk" v-model:value="addAtk"
:max="(originCri.at(-1)?.[0] ?? 2) - 1" :max="ceil((originCri.at(-1)?.[0] ?? 2) / ratio) - 1"
></a-slider> ></a-slider>
<span <span
>最大值&nbsp;&nbsp;&nbsp;&nbsp;{{ >最大值&nbsp;&nbsp;&nbsp;&nbsp;{{
(originCri.at(-1)?.[0] ?? 2) - 1 ceil((originCri.at(-1)?.[0] ?? 2) / ratio) - 1
}}</span }}</span
> >
</div> </div>
@ -29,11 +29,11 @@
<a-slider <a-slider
class="slider" class="slider"
v-model:value="addDef" v-model:value="addDef"
:max="(originDef.at(-1)?.[0] ?? 2) - 1" :max="ceil((originDef.at(-1)?.[0] ?? 2) / ratio) - 1"
></a-slider> ></a-slider>
<span <span
>最大值&nbsp;&nbsp;&nbsp;&nbsp;{{ >最大值&nbsp;&nbsp;&nbsp;&nbsp;{{
(originDef.at(-1)?.[0] ?? 2) - 1 ceil((originDef.at(-1)?.[0] ?? 2) / ratio) - 1
}}</span }}</span
> >
</div> </div>
@ -96,6 +96,7 @@ const critical = ref<HTMLCanvasElement>();
const def = ref<HTMLCanvasElement>(); const def = ref<HTMLCanvasElement>();
const enemy = core.plugin.bookDetailEnemy; const enemy = core.plugin.bookDetailEnemy;
const ceil = Math.ceil;
let originCri = getCriticalDamage(enemy); let originCri = getCriticalDamage(enemy);
let originDef = getDefDamage(enemy); let originDef = getDefDamage(enemy);

View File

@ -118,7 +118,7 @@ watch(nowArea, n => {
oy = 0; oy = 0;
scale = 3; scale = 3;
lastScale = 3; lastScale = 3;
if (!area[n].includes(nowFloor.value)) if (area[n] && !area[n].includes(nowFloor.value))
nowFloor.value = nowFloor.value =
area[n].find(v => v === core.status.floorId) ?? area[n][0]; area[n].find(v => v === core.status.floorId) ?? area[n][0];
}); });
@ -342,7 +342,7 @@ function drawRight() {
y = thumb.height / 2 - h / 2; y = thumb.height / 2 - h / 2;
} }
if (ratio < 1) { if (ratio < 1) {
w = h / ratio; w = h * ratio;
x = thumb.width / 2 - w / 2; x = thumb.width / 2 - w / 2;
} }
thumbCtx.fillStyle = '#000'; thumbCtx.fillStyle = '#000';
@ -478,6 +478,7 @@ function locateMap(id: FloorIds) {
noBorder.value ? 5 : 0, noBorder.value ? 5 : 0,
noBorder.value ? 0.5 : 1 noBorder.value ? 0.5 : 1
); );
if (!data.locs[id]) return;
const [x, y] = data.locs[id]!; const [x, y] = data.locs[id]!;
ox = (-x + data.width / 2) * scale; ox = (-x + data.width / 2) * scale;
oy = (-y + data.height / 2) * scale; oy = (-y + data.height / 2) * scale;

View File

@ -167,6 +167,8 @@ function update() {
lvName.value = core.getLvName(hero.lv); lvName.value = core.getLvName(hero.lv);
if (flags.blade && flags.bladeOn) { if (flags.blade && flags.bladeOn) {
skill.value = '断灭之刃'; skill.value = '断灭之刃';
} else {
skill.value = '无';
} }
up.value = core.getNextLvUpNeed() ?? 0; up.value = core.getNextLvUpNeed() ?? 0;
if (core.hasFlag('spring')) { if (core.hasFlag('spring')) {