mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-19 04:19:30 +08:00
完善定点查看
This commit is contained in:
parent
36cf6150e4
commit
2cfbe4984f
@ -102,8 +102,11 @@ const def = ref<HTMLCanvasElement>();
|
|||||||
const enemy = core.plugin.bookDetailEnemy;
|
const enemy = core.plugin.bookDetailEnemy;
|
||||||
const ceil = Math.ceil;
|
const ceil = Math.ceil;
|
||||||
|
|
||||||
let originCri = getCriticalDamage(enemy);
|
const x = ref(props.fromBook ? void 0 : flags.mouseLoc[0]);
|
||||||
let originDef = getDefDamage(enemy);
|
const y = ref(props.fromBook ? void 0 : flags.mouseLoc[1]);
|
||||||
|
|
||||||
|
let originCri = getCriticalDamage(enemy, 0, 0, x.value, y.value);
|
||||||
|
let originDef = getDefDamage(enemy, 0, 0, x.value, y.value);
|
||||||
|
|
||||||
// 当前数据
|
// 当前数据
|
||||||
const allCri = ref(originCri);
|
const allCri = ref(originCri);
|
||||||
@ -113,17 +116,22 @@ const allDef = ref(originDef);
|
|||||||
const addAtk = ref(0);
|
const addAtk = ref(0);
|
||||||
const addDef = ref(0);
|
const addDef = ref(0);
|
||||||
|
|
||||||
const originDamage = core.getDamageInfo(enemy);
|
const originDamage = core.getDamageInfo(enemy, void 0, x.value, y.value);
|
||||||
|
|
||||||
// 转发core上的内容至当前作用域
|
// 转发core上的内容至当前作用域
|
||||||
const format = core.formatBigNumber;
|
const format = core.formatBigNumber;
|
||||||
const ratio = core.status.thisMap.ratio;
|
const ratio = core.status.thisMap.ratio;
|
||||||
|
|
||||||
const nowDamage = computed(() => {
|
const nowDamage = computed(() => {
|
||||||
const dam = core.getDamageInfo(enemy, {
|
const dam = core.getDamageInfo(
|
||||||
atk: core.getStatus('atk') + addAtk.value * ratio,
|
enemy,
|
||||||
def: core.getStatus('def') + addDef.value * ratio
|
{
|
||||||
});
|
atk: core.getStatus('atk') + addAtk.value * ratio,
|
||||||
|
def: core.getStatus('def') + addDef.value * ratio
|
||||||
|
},
|
||||||
|
x.value,
|
||||||
|
y.value
|
||||||
|
);
|
||||||
if (!has(dam)) return ['???', '???'];
|
if (!has(dam)) return ['???', '???'];
|
||||||
if (!has(originDamage)) return [-dam.damage, dam.damage];
|
if (!has(originDamage)) return [-dam.damage, dam.damage];
|
||||||
return [originDamage.damage - dam.damage, dam.damage];
|
return [originDamage.damage - dam.damage, dam.damage];
|
||||||
@ -177,20 +185,21 @@ function generateData(data: [number, number][]): ChartConfiguration['data'] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const update = debounce((atk: Chart, def: Chart) => {
|
const update = debounce((atk: Chart, def: Chart) => {
|
||||||
const [x, y] = props.fromBook ? [void 0, void 0] : flags.mouseLoc;
|
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,
|
||||||
addDef.value * ratio,
|
addDef.value * ratio,
|
||||||
x,
|
x.value,
|
||||||
y
|
y.value
|
||||||
);
|
);
|
||||||
allDef.value = getDefDamage(
|
allDef.value = getDefDamage(
|
||||||
enemy,
|
enemy,
|
||||||
addDef.value * ratio,
|
addDef.value * ratio,
|
||||||
addAtk.value * ratio,
|
addAtk.value * ratio,
|
||||||
x,
|
x.value,
|
||||||
y
|
y.value
|
||||||
);
|
);
|
||||||
if (allCri.value.length > originCri.length) originCri = allCri.value;
|
if (allCri.value.length > originCri.length) originCri = allCri.value;
|
||||||
if (allDef.value.length > originDef.length) originDef = allDef.value;
|
if (allDef.value.length > originDef.length) originDef = allDef.value;
|
||||||
|
@ -80,8 +80,8 @@ async function calHeight() {
|
|||||||
vw = window.innerWidth;
|
vw = window.innerWidth;
|
||||||
width.value = vh * 0.28;
|
width.value = vh * 0.28;
|
||||||
await new Promise(res => requestAnimationFrame(res));
|
await new Promise(res => requestAnimationFrame(res));
|
||||||
if (!main) return;
|
|
||||||
main = document.getElementById('enemy-fixed') as HTMLDivElement;
|
main = document.getElementById('enemy-fixed') as HTMLDivElement;
|
||||||
|
if (!main) return;
|
||||||
const style = getComputedStyle(main);
|
const style = getComputedStyle(main);
|
||||||
const h = parseFloat(style.height);
|
const h = parseFloat(style.height);
|
||||||
const [cx, cy] = flags.clientLoc;
|
const [cx, cy] = flags.clientLoc;
|
||||||
|
Loading…
Reference in New Issue
Block a user