mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-18 20:09:27 +08:00
完善定点查看
This commit is contained in:
parent
2cfbe4984f
commit
77d051dd27
@ -1190,6 +1190,10 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
||||
return;
|
||||
}
|
||||
|
||||
const [x, y] = flags.mouseLoc;
|
||||
const mx = Math.round(x + core.bigmap.offsetX / 32);
|
||||
const my = Math.round(y + core.bigmap.offsetY / 32);
|
||||
|
||||
// 根据keyCode值来执行对应操作
|
||||
switch (keyCode) {
|
||||
case 74: // J:打开技能树
|
||||
@ -1248,17 +1252,12 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
||||
core.useItem('I560', true);
|
||||
break;
|
||||
case 75: // J:定点查看
|
||||
if (
|
||||
core.getBlockCls(...flags.mouseLoc)?.startsWith('enemy')
|
||||
) {
|
||||
if (core.getBlockCls(mx, my)?.startsWith('enemy')) {
|
||||
core.plugin.showFixed.value = false;
|
||||
core.plugin.fixedDetailOpened.value = true;
|
||||
}
|
||||
break;
|
||||
case 77: // M:快速标记
|
||||
const [x, y] = flags.mouseLoc;
|
||||
const mx = Math.round(x + core.bigmap.offsetX / 32);
|
||||
const my = Math.round(y + core.bigmap.offsetY / 32);
|
||||
const blocks = core.getMapBlocksObj();
|
||||
const block = blocks[`${mx},${my}`];
|
||||
if (block.event.cls.startsWith('enemy')) {
|
||||
|
@ -310,6 +310,10 @@
|
||||
"本塔的怪物手册功能很多,下面一一介绍。",
|
||||
"<br>",
|
||||
"<br>",
|
||||
"首先,你可以按X打开怪物手册。将鼠标移动到一个怪物上,按下<span style=\"color: gold\">",
|
||||
"K键</span>,也可以定点查看某个怪物的详细属性。将鼠标移动到怪物上也可以定点查看怪物的粗略信息。",
|
||||
"<br>",
|
||||
"<br>",
|
||||
"怪物手册打开的时候有一个0.6秒的动画,如果不想要可以在开头捡的系统设置里面关闭(默认关闭)。",
|
||||
"<br>",
|
||||
"<br>",
|
||||
|
@ -37,7 +37,7 @@
|
||||
"useFixed": {
|
||||
"text": "移动鼠标显示怪物信息",
|
||||
"desc": [
|
||||
"开启后,当鼠标移动到怪物上时,会以盒子的形式展示该点的怪物信息。",
|
||||
"开启后,当鼠标移动到怪物上时,会以盒子的形式展示该点的怪物信息。手机端此功能无效。",
|
||||
"<br>",
|
||||
"<br>",
|
||||
"注:当鼠标移动到怪物上时,经过200毫秒才会显示信息,防止误操作。"
|
||||
|
@ -104,6 +104,12 @@ const ceil = Math.ceil;
|
||||
|
||||
const x = ref(props.fromBook ? void 0 : flags.mouseLoc[0]);
|
||||
const y = ref(props.fromBook ? void 0 : flags.mouseLoc[1]);
|
||||
x.value = has(x.value)
|
||||
? Math.round(x.value + core.bigmap.offsetX / 32)
|
||||
: void 0;
|
||||
y.value = has(y.value)
|
||||
? Math.round(y.value + core.bigmap.offsetY / 32)
|
||||
: void 0;
|
||||
|
||||
let originCri = getCriticalDamage(enemy, 0, 0, x.value, y.value);
|
||||
let originDef = getDefDamage(enemy, 0, 0, x.value, y.value);
|
||||
@ -185,8 +191,6 @@ function generateData(data: [number, number][]): ChartConfiguration['data'] {
|
||||
}
|
||||
|
||||
const update = debounce((atk: Chart, def: Chart) => {
|
||||
x.value = props.fromBook ? void 0 : flags.mouseLoc[0];
|
||||
y.value = props.fromBook ? void 0 : flags.mouseLoc[1];
|
||||
allCri.value = getCriticalDamage(
|
||||
enemy,
|
||||
addAtk.value * ratio,
|
||||
|
@ -35,12 +35,21 @@
|
||||
<script lang="ts" setup>
|
||||
import { isMobile } from '../plugin/use';
|
||||
import { getSpecialHint } from '../plugin/ui/book';
|
||||
import { has } from '../plugin/utils';
|
||||
|
||||
const props = defineProps<{
|
||||
fromBook?: boolean;
|
||||
}>();
|
||||
|
||||
const [x, y] = props.fromBook ? [void 0, void 0] : flags.mouseLoc;
|
||||
const mx = has(x) ? Math.round(x + core.bigmap.offsetX / 32) : void 0;
|
||||
const my = has(y) ? Math.round(y + core.bigmap.offsetY / 32) : void 0;
|
||||
|
||||
const enemy = core.plugin.bookDetailEnemy;
|
||||
|
||||
const info = getSpecialHint(enemy);
|
||||
|
||||
const criticals = core.nextCriticals(enemy, isMobile ? 4 : 8);
|
||||
const criticals = core.nextCriticals(enemy, isMobile ? 4 : 8, mx, my);
|
||||
|
||||
const format = core.formatBigNumber;
|
||||
</script>
|
||||
|
@ -9,10 +9,12 @@ const show = debounce((ev: MouseEvent) => {
|
||||
if (!flags.mouseLoc) return;
|
||||
flags.clientLoc = [ev.clientX, ev.clientY];
|
||||
const [x, y] = flags.mouseLoc;
|
||||
const e = core.getBlockId(x, y);
|
||||
const mx = Math.round(x + core.bigmap.offsetX / 32);
|
||||
const my = Math.round(y + core.bigmap.offsetY / 32);
|
||||
const e = core.getBlockId(mx, my);
|
||||
if (!e || !core.getClsFromId(e)?.startsWith('enemy')) return;
|
||||
const enemy = core.material.enemys[e as EnemyIds];
|
||||
const detail = getDetailedEnemy(enemy, x, y);
|
||||
const detail = getDetailedEnemy(enemy, mx, my);
|
||||
core.plugin.bookDetailEnemy = detail;
|
||||
showFixed.value = true;
|
||||
}, 200);
|
||||
|
@ -9,7 +9,10 @@
|
||||
></a-divider>
|
||||
</div>
|
||||
<Transition name="detail">
|
||||
<EnemySpecial v-if="panel === 'special'"></EnemySpecial>
|
||||
<EnemySpecial
|
||||
:from-book="fromBook"
|
||||
v-if="panel === 'special'"
|
||||
></EnemySpecial>
|
||||
<EnemyCritical
|
||||
:from-book="fromBook"
|
||||
v-else-if="panel === 'critical'"
|
||||
|
@ -17,12 +17,13 @@ function close() {
|
||||
|
||||
onMounted(() => {
|
||||
const [x, y] = flags.mouseLoc;
|
||||
const e = core.getBlockId(x, y);
|
||||
const mx = Math.round(x + core.bigmap.offsetX / 32);
|
||||
const my = Math.round(y + core.bigmap.offsetY / 32);
|
||||
const e = core.getBlockId(mx, my);
|
||||
if (!e || !core.getClsFromId(e)?.startsWith('enemy')) return;
|
||||
const enemy = core.material.enemys[e as EnemyIds];
|
||||
const detail = getDetailedEnemy(enemy, x, y);
|
||||
const detail = getDetailedEnemy(enemy, mx, my);
|
||||
core.plugin.bookDetailEnemy = detail;
|
||||
core.plugin.bookDetailEnemy = getDetailedEnemy(enemy, x, y);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user