mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-05-10 18:43:24 +08:00
Deploying to gh-pages from @ 7465dd92c8
🚀
This commit is contained in:
parent
1302a38086
commit
686dec1364
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
|||||||
System.register(["./antdv-legacy.1af1bcaf.js"],(function(n,t){"use strict";var r;return{setters:[n=>{r=n.c}],execute:function(){var t=n("l",{exports:{}});
|
System.register(["./antdv-legacy.8282396f.js"],(function(n,t){"use strict";var r;return{setters:[n=>{r=n.c}],execute:function(){var t=n("l",{exports:{}});
|
||||||
/**
|
/**
|
||||||
* @license
|
* @license
|
||||||
* Lodash <https://lodash.com/>
|
* Lodash <https://lodash.com/>
|
@ -1,4 +1,4 @@
|
|||||||
import{c as jt}from"./antdv.82ccdc2e.js";var el={exports:{}};/**
|
import{c as jt}from"./antdv.5500b770.js";var el={exports:{}};/**
|
||||||
* @license
|
* @license
|
||||||
* Lodash <https://lodash.com/>
|
* Lodash <https://lodash.com/>
|
||||||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
10
index.html
10
index.html
@ -18,10 +18,10 @@
|
|||||||
<meta name="x5-fullscreen" content="true">
|
<meta name="x5-fullscreen" content="true">
|
||||||
<meta name="x5-page-mode" content="app">
|
<meta name="x5-page-mode" content="app">
|
||||||
<link id="mota-css" type='text/css' href='/HumanBreak/styles.css' rel='stylesheet'>
|
<link id="mota-css" type='text/css' href='/HumanBreak/styles.css' rel='stylesheet'>
|
||||||
<script type="module" crossorigin src="/HumanBreak/assets/index.9914a5b3.js"></script>
|
<script type="module" crossorigin src="/HumanBreak/assets/index.e842c75a.js"></script>
|
||||||
<link rel="modulepreload" crossorigin href="/HumanBreak/assets/antdv.82ccdc2e.js">
|
<link rel="modulepreload" crossorigin href="/HumanBreak/assets/antdv.5500b770.js">
|
||||||
<link rel="modulepreload" crossorigin href="/HumanBreak/assets/common.b7335525.js">
|
<link rel="modulepreload" crossorigin href="/HumanBreak/assets/common.7ff7c6bc.js">
|
||||||
<link rel="stylesheet" href="/HumanBreak/assets/index.fd22eca4.css">
|
<link rel="stylesheet" href="/HumanBreak/assets/index.b63f6c4b.css">
|
||||||
<script type="module">try{import.meta.url;import("_").catch(()=>1);}catch(e){}window.__vite_is_modern_browser=true;</script>
|
<script type="module">try{import.meta.url;import("_").catch(()=>1);}catch(e){}window.__vite_is_modern_browser=true;</script>
|
||||||
<script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy build because dynamic import or import.meta.url is unsupported, syntax error above should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
|
<script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy build because dynamic import or import.meta.url is unsupported, syntax error above should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
|
||||||
</head>
|
</head>
|
||||||
@ -215,7 +215,7 @@
|
|||||||
|
|
||||||
<script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
|
<script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
|
||||||
<script nomodule crossorigin id="vite-legacy-polyfill" src="/HumanBreak/assets/polyfills-legacy.fcbd97b9.js"></script>
|
<script nomodule crossorigin id="vite-legacy-polyfill" src="/HumanBreak/assets/polyfills-legacy.fcbd97b9.js"></script>
|
||||||
<script nomodule crossorigin id="vite-legacy-entry" data-src="/HumanBreak/assets/index-legacy.bf84b3c3.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
|
<script nomodule crossorigin id="vite-legacy-entry" data-src="/HumanBreak/assets/index-legacy.d8c1fc77.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -3056,14 +3056,7 @@ control.prototype.getStatus = function (name) {
|
|||||||
if (main.mode == 'editor' && !core.hasFlag('__statistics__')) {
|
if (main.mode == 'editor' && !core.hasFlag('__statistics__')) {
|
||||||
return data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.firstData.hero[name];
|
return data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.firstData.hero[name];
|
||||||
}
|
}
|
||||||
if (name === 'atk' || name === 'def') {
|
return core.status.hero[name];
|
||||||
return (
|
|
||||||
core.status.hero[name] +
|
|
||||||
(window.flags?.[`night_${core.status.floorId}`] ?? 0)
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return core.status.hero[name];
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
////// 从status中获得属性,如果不存在则从勇士属性中获取 //////
|
////// 从status中获得属性,如果不存在则从勇士属性中获取 //////
|
||||||
@ -3079,9 +3072,7 @@ control.prototype.getRealStatus = function (name) {
|
|||||||
|
|
||||||
////// 从status中获得实际属性(增幅后的),如果不存在则从勇士属性中获取 //////
|
////// 从status中获得实际属性(增幅后的),如果不存在则从勇士属性中获取 //////
|
||||||
control.prototype.getRealStatusOrDefault = function (status, name) {
|
control.prototype.getRealStatusOrDefault = function (status, name) {
|
||||||
return Math.floor(
|
return core.getHeroStatusOf(status, name);
|
||||||
this.getStatusOrDefault(status, name) * this.getBuff(name)
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
////// 获得勇士原始属性(无装备和衰弱影响) //////
|
////// 获得勇士原始属性(无装备和衰弱影响) //////
|
||||||
|
@ -517,6 +517,7 @@ enemys.prototype._getDamage = function (enemy, hero, x, y, floorId) {
|
|||||||
if (typeof enemy == 'string') enemy = core.material.enemys[enemy];
|
if (typeof enemy == 'string') enemy = core.material.enemys[enemy];
|
||||||
if (enemy == null) return null;
|
if (enemy == null) return null;
|
||||||
|
|
||||||
|
if (x === 9 && y === 3) debugger;
|
||||||
var info = this.getDamageInfo(enemy, hero, x, y, floorId);
|
var info = this.getDamageInfo(enemy, hero, x, y, floorId);
|
||||||
if (info == null) return null;
|
if (info == null) return null;
|
||||||
if (typeof info == 'number') return info;
|
if (typeof info == 'number') return info;
|
||||||
|
@ -282,7 +282,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
"statusLeftBackground": "url(project/images/cave1.jpg)",
|
"statusLeftBackground": "url(project/images/cave1.jpg)",
|
||||||
"statusTopBackground": "url(project/images/cave2.jpg) no-repeat",
|
"statusTopBackground": "url(project/images/cave2.jpg) no-repeat",
|
||||||
"toolsBackground": "url(project/images/cave2.jpg) no-repeat",
|
"toolsBackground": "url(project/images/cave2.jpg) no-repeat",
|
||||||
"floorChangingStyle": "background-color: #000000;color:#000000",
|
"floorChangingStyle": " ",
|
||||||
"statusBarColor": [
|
"statusBarColor": [
|
||||||
255,
|
255,
|
||||||
255,
|
255,
|
||||||
|
@ -61,7 +61,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
// 游戏获胜事件
|
// 游戏获胜事件
|
||||||
// 请注意,成绩统计时是按照hp进行上传并排名
|
// 请注意,成绩统计时是按照hp进行上传并排名
|
||||||
// 可以先在这里对最终分数进行计算,比如将2倍攻击和5倍黄钥匙数量加到分数上
|
// 可以先在这里对最终分数进行计算,比如将2倍攻击和5倍黄钥匙数量加到分数上
|
||||||
// core.status.hero.hp += 2 * core.getRealStatus('atk') + 5 * core.itemCount('yellowKey');
|
|
||||||
|
|
||||||
// 如果不退出,则临时存储数据
|
// 如果不退出,则临时存储数据
|
||||||
if (noexit) {
|
if (noexit) {
|
||||||
@ -648,11 +647,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
core.formatBigNumber(
|
core.formatBigNumber(
|
||||||
Math.max(
|
Math.max(
|
||||||
(enemy.value || 0) -
|
(enemy.value || 0) -
|
||||||
core.getRealStatusOrDefault(
|
core.getHeroStatusOn('def')
|
||||||
null,
|
|
||||||
'def'
|
|
||||||
),
|
|
||||||
0
|
|
||||||
)
|
)
|
||||||
) +
|
) +
|
||||||
'点伤害'
|
'点伤害'
|
||||||
@ -762,10 +757,19 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
// floorId:该怪物所在的楼层
|
// floorId:该怪物所在的楼层
|
||||||
// 后面三个参数主要是可以在光环等效果上可以适用(也可以按需制作部分范围光环效果)
|
// 后面三个参数主要是可以在光环等效果上可以适用(也可以按需制作部分范围光环效果)
|
||||||
floorId = floorId || core.status.floorId;
|
floorId = floorId || core.status.floorId;
|
||||||
var hero_hp = core.getRealStatusOrDefault(hero, 'hp'),
|
|
||||||
hero_atk = core.getRealStatusOrDefault(hero, 'atk'),
|
let {
|
||||||
hero_def = core.getRealStatusOrDefault(hero, 'def'),
|
atk: hero_atk,
|
||||||
hero_mdef = core.getRealStatusOrDefault(hero, 'mdef');
|
def: hero_def,
|
||||||
|
mdef: hero_mdef,
|
||||||
|
hp: hero_hp
|
||||||
|
} = core.getHeroStatusOf(
|
||||||
|
hero,
|
||||||
|
['atk', 'def', 'mdef', 'hp'],
|
||||||
|
hero?.x,
|
||||||
|
hero?.y,
|
||||||
|
floorId
|
||||||
|
);
|
||||||
|
|
||||||
var mon_hp = core.getEnemyValue(enemy, 'hp', x, y, floorId),
|
var mon_hp = core.getEnemyValue(enemy, 'hp', x, y, floorId),
|
||||||
mon_atk = core.getEnemyValue(enemy, 'atk', x, y, floorId),
|
mon_atk = core.getEnemyValue(enemy, 'atk', x, y, floorId),
|
||||||
@ -793,7 +797,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 智慧之源
|
// 智慧之源
|
||||||
if (core.hasSpecial(mon_special, 14) && flags.hard == 2) {
|
if (core.hasSpecial(mon_special, 14) && flags.hard === 2) {
|
||||||
mon_atk += core.getFlag('inte_' + floorId, 0);
|
mon_atk += core.getFlag('inte_' + floorId, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -906,13 +910,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
mon_def *= 1 + def_buff / 100;
|
mon_def *= 1 + def_buff / 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO:可以在这里新增其他的怪物数据变化
|
|
||||||
// 比如仿攻(怪物攻击不低于勇士攻击):
|
|
||||||
// if (core.hasSpecial(mon_special, 27) && mon_atk < hero_atk) {
|
|
||||||
// mon_atk = hero_atk;
|
|
||||||
// }
|
|
||||||
// 也可以按需增加各种自定义内容
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
hp: Math.floor(mon_hp),
|
hp: Math.floor(mon_hp),
|
||||||
atk: Math.floor(mon_atk),
|
atk: Math.floor(mon_atk),
|
||||||
@ -936,19 +933,62 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
// 后面三个参数主要是可以在光环等效果上可以适用
|
// 后面三个参数主要是可以在光环等效果上可以适用
|
||||||
floorId = floorId || core.status.floorId;
|
floorId = floorId || core.status.floorId;
|
||||||
|
|
||||||
function getDamage() {
|
// 勇士位置应该在这里进行计算,四个位置依次遍历,去重
|
||||||
let hero_hp = core.getRealStatusOrDefault(hero, 'hp'),
|
let toMap = [];
|
||||||
hero_atk = core.getRealStatusOrDefault(hero, 'atk'),
|
if (
|
||||||
hero_def = core.getRealStatusOrDefault(hero, 'def'),
|
x !== null &&
|
||||||
hero_IQ = core.getRealStatusOrDefault(hero, 'mdef'),
|
x !== void 0 &&
|
||||||
hero_recovery = core.getRealStatusOrDefault(hero, 'hpmax'),
|
y !== null &&
|
||||||
hero_extraAtk = core.getRealStatusOrDefault(hero, 'mana'),
|
y !== void 0 &&
|
||||||
origin_hero_hp = core.getStatusOrDefault(hero, 'hp'),
|
floorId !== null &&
|
||||||
origin_hero_atk = core.getStatusOrDefault(hero, 'atk'),
|
floorId !== void 0 &&
|
||||||
origin_hero_def = core.getStatusOrDefault(hero, 'def');
|
flags.autoLocate &&
|
||||||
|
flags.chapter >= 2
|
||||||
|
) {
|
||||||
|
const floor = core.status.maps[floorId];
|
||||||
|
// 存在坐标,进行遍历
|
||||||
|
for (const [dir, { x: dx, y: dy }] of Object.entries(
|
||||||
|
core.utils.scan
|
||||||
|
)) {
|
||||||
|
// 只有攻击和防御和特殊光环需要注意,其他的一般都不会随楼层与坐标变化
|
||||||
|
const nx = x + dx;
|
||||||
|
const ny = y + dy;
|
||||||
|
if (
|
||||||
|
nx < 0 ||
|
||||||
|
nx >= floor.width ||
|
||||||
|
ny < 0 ||
|
||||||
|
ny >= floor.height
|
||||||
|
) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
core.noPass(nx, ny) ||
|
||||||
|
!core.canMoveHero(nx, ny, core.backDir(dir), floorId)
|
||||||
|
) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const toGet = ['atk', 'def'];
|
||||||
|
const status = core.getHeroStatusOf(
|
||||||
|
hero,
|
||||||
|
toGet,
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
floorId
|
||||||
|
);
|
||||||
|
if (
|
||||||
|
toMap.some(v =>
|
||||||
|
toGet.every(vv => v[1][vv] === status[vv])
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
toMap.push([dir, Object.assign({}, status, { x, y })]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
toMap = [['none', core.getHeroStatusOf(hero, ['atk', 'def'])]];
|
||||||
|
}
|
||||||
|
|
||||||
// 怪物的各项数据
|
function getDamage(h) {
|
||||||
// 对坚固模仿等处理扔到了脚本编辑-getEnemyInfo之中
|
|
||||||
const enemyInfo = core.enemys.getEnemyInfo(
|
const enemyInfo = core.enemys.getEnemyInfo(
|
||||||
enemy,
|
enemy,
|
||||||
hero,
|
hero,
|
||||||
@ -957,10 +997,18 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
floorId
|
floorId
|
||||||
);
|
);
|
||||||
|
|
||||||
let mon_hp = enemyInfo.hp,
|
let {
|
||||||
mon_atk = enemyInfo.atk,
|
hp: mon_hp,
|
||||||
mon_def = enemyInfo.def,
|
atk: mon_atk,
|
||||||
mon_special = enemyInfo.special;
|
def: mon_def,
|
||||||
|
special: mon_special
|
||||||
|
} = enemyInfo;
|
||||||
|
let { atk: hero_atk, def: hero_def } = h;
|
||||||
|
|
||||||
|
let hero_hp = core.getRealStatusOrDefault(hero, 'hp'),
|
||||||
|
hero_IQ = core.getRealStatusOrDefault(hero, 'mdef'),
|
||||||
|
hero_recovery = core.getRealStatusOrDefault(hero, 'hpmax'),
|
||||||
|
hero_extraAtk = core.getRealStatusOrDefault(hero, 'mana');
|
||||||
|
|
||||||
let damage = 0;
|
let damage = 0;
|
||||||
|
|
||||||
@ -1045,52 +1093,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
turn += 5;
|
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.removeFlag('__extraTurn__');
|
|
||||||
// ------ 支援END ------ //
|
|
||||||
|
|
||||||
// 最终伤害:初始伤害 + 怪物对勇士造成的伤害 + 反击伤害
|
// 最终伤害:初始伤害 + 怪物对勇士造成的伤害 + 反击伤害
|
||||||
damage += init_damage + (turn - 1) * per_damage;
|
damage += init_damage + (turn - 1) * per_damage;
|
||||||
// 无上之盾
|
// 无上之盾
|
||||||
@ -1113,34 +1115,55 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
let damageInfo = null;
|
|
||||||
let damage = Infinity;
|
|
||||||
|
|
||||||
const skills = [
|
const skills = [
|
||||||
['bladeOn', 'blade'],
|
['bladeOn', 'blade'],
|
||||||
['shieldOn', 'shield']
|
['shieldOn', 'shield']
|
||||||
];
|
];
|
||||||
damageInfo = getDamage();
|
|
||||||
if (damageInfo) damage = damageInfo.damage;
|
|
||||||
|
|
||||||
if (flags.autoSkill) {
|
function autoSkillOf(h) {
|
||||||
for (const [unlock, condition] of skills) {
|
if (flags.autoSkill) {
|
||||||
if (flags[unlock]) {
|
for (const [unlock, condition] of skills) {
|
||||||
flags[condition] = true;
|
if (flags[unlock]) {
|
||||||
const info = getDamage();
|
flags[condition] = true;
|
||||||
const d = info?.damage;
|
const info = getDamage(h);
|
||||||
if (d !== null && d !== void 0) {
|
const d = info?.damage;
|
||||||
if (d < damage) {
|
if (d !== null && d !== void 0) {
|
||||||
damage = d;
|
if (d < damage) {
|
||||||
damageInfo = info;
|
damage = d;
|
||||||
|
damageInfo = info;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
flags[condition] = false;
|
||||||
}
|
}
|
||||||
flags[condition] = false;
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
damageInfo = getDamage(h);
|
||||||
|
if (damageInfo) damage = damageInfo.damage;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let damageInfo = null;
|
||||||
|
let damage = Infinity;
|
||||||
|
|
||||||
|
if (!flags.autoLocate) {
|
||||||
|
autoSkillOf(toMap[0][1]);
|
||||||
return damageInfo;
|
return damageInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (toMap.length === 1) {
|
||||||
|
// 单个与多个分开计算,有助于提高性能表现
|
||||||
|
const h = toMap[0][1];
|
||||||
|
autoSkillOf(h);
|
||||||
|
if (damageInfo) {
|
||||||
|
return Object.assign(damageInfo, { dir: toMap[0][0] });
|
||||||
|
} else return null;
|
||||||
} else {
|
} else {
|
||||||
return getDamage();
|
for (const [dir, h] of toMap) {
|
||||||
|
autoSkillOf(h);
|
||||||
|
if (damageInfo) {
|
||||||
|
return Object.assign(damageInfo, { dir });
|
||||||
|
} else return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1416,7 +1416,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
|||||||
// 获取宝石信息 并绘制
|
// 获取宝石信息 并绘制
|
||||||
this.getItemDetail = function (floorId) {
|
this.getItemDetail = function (floorId) {
|
||||||
if (!core.getFlag('itemDetail')) return;
|
if (!core.getFlag('itemDetail')) return;
|
||||||
floorId = floorId ?? core.status.thisMap.floorId;
|
floorId ??= core.status.thisMap.floorId;
|
||||||
let diff = {};
|
let diff = {};
|
||||||
const before = core.status.hero;
|
const before = core.status.hero;
|
||||||
const hero = core.clone(core.status.hero);
|
const hero = core.clone(core.status.hero);
|
||||||
@ -4306,24 +4306,6 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* 滑动数组
|
|
||||||
* @param {any[]} arr
|
|
||||||
* @param {number} delta
|
|
||||||
*/
|
|
||||||
this.slide = function (arr, delta) {
|
|
||||||
if (delta === 0) return arr;
|
|
||||||
delta %= arr.length;
|
|
||||||
if (delta > 0) {
|
|
||||||
arr.unshift(...arr.splice(arr.length - delta, delta));
|
|
||||||
return arr;
|
|
||||||
}
|
|
||||||
if (delta < 0) {
|
|
||||||
arr.push(...arr.splice(0, -delta));
|
|
||||||
return arr;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 移动地图
|
* 移动地图
|
||||||
* @param {number} delta
|
* @param {number} delta
|
||||||
@ -4642,5 +4624,92 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
|||||||
}
|
}
|
||||||
ctx.restore();
|
ctx.restore();
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
hero: function () {
|
||||||
|
/**
|
||||||
|
* 获取勇士在某一点的属性
|
||||||
|
* @param {keyof HeroStatus | 'all'} name
|
||||||
|
* @param {number} x
|
||||||
|
* @param {number} y
|
||||||
|
* @param {FloorIds} floorId
|
||||||
|
*/
|
||||||
|
this.getHeroStatusOn = function (name, x, y, floorId) {
|
||||||
|
return this.getRealStatusOf(core.status.hero, name, x, y, floorId);
|
||||||
|
};
|
||||||
|
|
||||||
|
this.getHeroStatusOf = function (status, name, x, y, floorId) {
|
||||||
|
return getRealStatus(status, name, x, y, floorId);
|
||||||
|
};
|
||||||
|
|
||||||
|
function getRealStatus(status, name, x, y, floorId) {
|
||||||
|
if (name instanceof Array) {
|
||||||
|
return Object.fromEntries(
|
||||||
|
name.map(v => [
|
||||||
|
v,
|
||||||
|
v !== 'all' && getRealStatus(status, v, x, y, floorId)
|
||||||
|
])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name === 'all') {
|
||||||
|
return Object.fromEntries(
|
||||||
|
Object.keys(core.status.hero).map(v => [
|
||||||
|
v,
|
||||||
|
v !== 'all' && getRealStatus(status, v, x, y, floorId)
|
||||||
|
])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
let s = status?.[name] ?? core.status.hero[name];
|
||||||
|
if (s === null || s === void 0) {
|
||||||
|
throw new ReferenceError(
|
||||||
|
`Wrong hero status property name is delivered: ${name}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
x ??= core.status.hero.loc.x;
|
||||||
|
y ??= core.status.hero.loc.y;
|
||||||
|
floorId ??= core.status.floorId;
|
||||||
|
|
||||||
|
// 永夜、极昼
|
||||||
|
if (name === 'atk' || name === 'def') {
|
||||||
|
s += window.flags?.[`night_${floorId}`] ?? 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// buff
|
||||||
|
if (typeof s === 'number') s *= core.getBuff(name);
|
||||||
|
|
||||||
|
// 取整
|
||||||
|
if (typeof s === 'number') s = Math.floor(s);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
pluginUtils: function () {
|
||||||
|
/**
|
||||||
|
* 滑动数组
|
||||||
|
* @param {any[]} arr
|
||||||
|
* @param {number} delta
|
||||||
|
*/
|
||||||
|
this.slide = function (arr, delta) {
|
||||||
|
if (delta === 0) return arr;
|
||||||
|
delta %= arr.length;
|
||||||
|
if (delta > 0) {
|
||||||
|
arr.unshift(...arr.splice(arr.length - delta, delta));
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
|
if (delta < 0) {
|
||||||
|
arr.push(...arr.splice(0, -delta));
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.backDir = function (dir) {
|
||||||
|
return {
|
||||||
|
up: 'down',
|
||||||
|
down: 'up',
|
||||||
|
left: 'right',
|
||||||
|
right: 'left'
|
||||||
|
}[dir];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -261,7 +261,7 @@ span#hard {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
display: none;
|
display: none;
|
||||||
color: #fff;
|
color: transparent;
|
||||||
background-color: #000;
|
background-color: #000;
|
||||||
z-index: 230;
|
z-index: 230;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
Loading…
Reference in New Issue
Block a user