完善定点查看

This commit is contained in:
unanmed 2023-01-06 22:42:46 +08:00
parent 2cfbe4984f
commit 77d051dd27
8 changed files with 38 additions and 16 deletions

View File

@ -1190,6 +1190,10 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
return; 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值来执行对应操作 // 根据keyCode值来执行对应操作
switch (keyCode) { switch (keyCode) {
case 74: // J:打开技能树 case 74: // J:打开技能树
@ -1248,17 +1252,12 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
core.useItem('I560', true); core.useItem('I560', true);
break; break;
case 75: // J定点查看 case 75: // J定点查看
if ( if (core.getBlockCls(mx, my)?.startsWith('enemy')) {
core.getBlockCls(...flags.mouseLoc)?.startsWith('enemy')
) {
core.plugin.showFixed.value = false; core.plugin.showFixed.value = false;
core.plugin.fixedDetailOpened.value = true; core.plugin.fixedDetailOpened.value = true;
} }
break; break;
case 77: // M快速标记 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 blocks = core.getMapBlocksObj();
const block = blocks[`${mx},${my}`]; const block = blocks[`${mx},${my}`];
if (block.event.cls.startsWith('enemy')) { if (block.event.cls.startsWith('enemy')) {

View File

@ -310,6 +310,10 @@
"本塔的怪物手册功能很多,下面一一介绍。", "本塔的怪物手册功能很多,下面一一介绍。",
"<br>", "<br>",
"<br>", "<br>",
"首先你可以按X打开怪物手册。将鼠标移动到一个怪物上按下<span style=\"color: gold\">",
"K键</span>,也可以定点查看某个怪物的详细属性。将鼠标移动到怪物上也可以定点查看怪物的粗略信息。",
"<br>",
"<br>",
"怪物手册打开的时候有一个0.6秒的动画,如果不想要可以在开头捡的系统设置里面关闭(默认关闭)。", "怪物手册打开的时候有一个0.6秒的动画,如果不想要可以在开头捡的系统设置里面关闭(默认关闭)。",
"<br>", "<br>",
"<br>", "<br>",

View File

@ -37,7 +37,7 @@
"useFixed": { "useFixed": {
"text": "移动鼠标显示怪物信息", "text": "移动鼠标显示怪物信息",
"desc": [ "desc": [
"开启后,当鼠标移动到怪物上时,会以盒子的形式展示该点的怪物信息。", "开启后,当鼠标移动到怪物上时,会以盒子的形式展示该点的怪物信息。手机端此功能无效。",
"<br>", "<br>",
"<br>", "<br>",
"注当鼠标移动到怪物上时经过200毫秒才会显示信息防止误操作。" "注当鼠标移动到怪物上时经过200毫秒才会显示信息防止误操作。"

View File

@ -104,6 +104,12 @@ const ceil = Math.ceil;
const x = ref(props.fromBook ? void 0 : flags.mouseLoc[0]); const x = ref(props.fromBook ? void 0 : flags.mouseLoc[0]);
const y = ref(props.fromBook ? void 0 : flags.mouseLoc[1]); 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 originCri = getCriticalDamage(enemy, 0, 0, x.value, y.value);
let originDef = getDefDamage(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) => { 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( allCri.value = getCriticalDamage(
enemy, enemy,
addAtk.value * ratio, addAtk.value * ratio,

View File

@ -35,12 +35,21 @@
<script lang="ts" setup> <script lang="ts" setup>
import { isMobile } from '../plugin/use'; import { isMobile } from '../plugin/use';
import { getSpecialHint } from '../plugin/ui/book'; 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 enemy = core.plugin.bookDetailEnemy;
const info = getSpecialHint(enemy); 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; const format = core.formatBigNumber;
</script> </script>

View File

@ -9,10 +9,12 @@ const show = debounce((ev: MouseEvent) => {
if (!flags.mouseLoc) return; if (!flags.mouseLoc) return;
flags.clientLoc = [ev.clientX, ev.clientY]; flags.clientLoc = [ev.clientX, ev.clientY];
const [x, y] = flags.mouseLoc; 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; if (!e || !core.getClsFromId(e)?.startsWith('enemy')) return;
const enemy = core.material.enemys[e as EnemyIds]; 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 = detail;
showFixed.value = true; showFixed.value = true;
}, 200); }, 200);

View File

@ -9,7 +9,10 @@
></a-divider> ></a-divider>
</div> </div>
<Transition name="detail"> <Transition name="detail">
<EnemySpecial v-if="panel === 'special'"></EnemySpecial> <EnemySpecial
:from-book="fromBook"
v-if="panel === 'special'"
></EnemySpecial>
<EnemyCritical <EnemyCritical
:from-book="fromBook" :from-book="fromBook"
v-else-if="panel === 'critical'" v-else-if="panel === 'critical'"

View File

@ -17,12 +17,13 @@ function close() {
onMounted(() => { onMounted(() => {
const [x, y] = flags.mouseLoc; 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; if (!e || !core.getClsFromId(e)?.startsWith('enemy')) return;
const enemy = core.material.enemys[e as EnemyIds]; 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 = detail;
core.plugin.bookDetailEnemy = getDetailedEnemy(enemy, x, y);
}); });
</script> </script>