mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-19 04:19:30 +08:00
快速标记怪物
This commit is contained in:
parent
1f1cd6ea3b
commit
3db34ffad9
@ -1224,8 +1224,22 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
||||
case 72: // H:打开帮助页面
|
||||
core.ui._drawHelp();
|
||||
break;
|
||||
case 77: // M:打开存档笔记
|
||||
core.actions._clickNotes_show();
|
||||
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')) {
|
||||
const name = core.material.enemys[block.event.id].name;
|
||||
if (core.hasMarkedEnemy(block.event.id)) {
|
||||
core.tip('success', `已取消标记${name}!`);
|
||||
core.unmarkEnemy(block.event.id);
|
||||
} else {
|
||||
core.tip('success', `已标记${name}!`);
|
||||
core.markEnemy(block.event.id);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 78: // N:重新开始
|
||||
core.confirmRestart();
|
||||
|
@ -3,7 +3,8 @@
|
||||
var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
init: function () {
|
||||
this._afterLoadResources = function () {
|
||||
if (!main.replayChecking) {
|
||||
if (!main.replayChecking && main.mode === 'play') {
|
||||
main.forward();
|
||||
core.resetSettings();
|
||||
}
|
||||
};
|
||||
|
@ -22,7 +22,16 @@
|
||||
"markEnemy": {
|
||||
"text": "标记怪物",
|
||||
"desc": [
|
||||
"标记怪物可以使你能够更加方便地了解一个怪物的情况。你可以在怪物手册的怪物更多信息栏进行标记。",
|
||||
"标记怪物可以使你能够更加方便地了解一个怪物的情况。",
|
||||
"<br>",
|
||||
"你可以通过以下两种方式标记怪物:",
|
||||
"<br>",
|
||||
"1. 打开怪物手册,选中怪物,进入怪物更多信息栏,点击标记怪物。",
|
||||
"<br>",
|
||||
"2. 将鼠标移动到你想要标记的怪物上面,按下M键,即可标记怪物,注意浏览地图中不能用该方式标记。",
|
||||
"手机端暂时没有快速标记怪物的方式。",
|
||||
"<br>",
|
||||
"<br>",
|
||||
"当一个怪物被标记后,怪物会有以下行为:",
|
||||
"<br>",
|
||||
"1. 当勇士恰好能打败怪物时,会进行提示",
|
||||
@ -62,7 +71,7 @@
|
||||
"在详细临界栏中,怪物的伤害会以可视化折线图的方式显示出来,从而你可以更为清晰地看出怪物减伤趋势。",
|
||||
"除了查看怪物伤害曲线,你还可以规划宝石。每个折线图下方都有一个滑动条,你可以拖动来模拟吃宝石。",
|
||||
"注意,拖动时,滑动条左边会显示当前的加攻或加防次数,这个数值指的是在勇士所在地图中需要吃的宝石数量。",
|
||||
"例如,当前勇士所在地图中一个宝石最低加2点攻击,加攻数值为3,那么勇士的攻击增加量就为6。",
|
||||
"例如,当前勇士所在地图中一个宝石最低加2点攻击,加攻次数为3,那么勇士的攻击增加量就为6。",
|
||||
"勇士增加的攻击数值也会在下方显示。当加攻次数和加防次数改变时,折线图也会变化。",
|
||||
"当前状态下怪物的伤害以及减伤总量也会在下方显示。",
|
||||
"<br>",
|
||||
|
@ -9,7 +9,7 @@ import mark from './plugin/mark';
|
||||
import setting from './plugin/settings';
|
||||
import chapter from './plugin/ui/chapter';
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
function forward() {
|
||||
// 每个引入的插件都要在这里执行,否则不会被转发
|
||||
const toForward: any[] = [
|
||||
pop(),
|
||||
@ -42,4 +42,6 @@ window.addEventListener('load', () => {
|
||||
|
||||
console.log('插件转发完成!');
|
||||
})();
|
||||
});
|
||||
}
|
||||
|
||||
main.forward = forward;
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div class="des">加攻伤害</div>
|
||||
<canvas ref="critical" class="chart"></canvas>
|
||||
<div class="slider-div">
|
||||
<span>加攻数值 {{ addAtk }}</span>
|
||||
<span>加攻次数 {{ addAtk }}</span>
|
||||
<a-slider
|
||||
class="slider"
|
||||
v-model:value="addAtk"
|
||||
@ -25,7 +25,7 @@
|
||||
<div class="des">加防伤害</div>
|
||||
<canvas ref="def" class="chart"></canvas>
|
||||
<div class="slider-div">
|
||||
<span>加防数值 {{ addDef }}</span>
|
||||
<span>加防次数 {{ addDef }}</span>
|
||||
<a-slider
|
||||
class="slider"
|
||||
v-model:value="addDef"
|
||||
|
@ -116,5 +116,23 @@ export function checkMarkedEnemy(noMessage: boolean = false) {
|
||||
export const checkMarkedStatus = ref(false);
|
||||
|
||||
export default function init() {
|
||||
return { checkMarkedEnemy, checkStatus: checkMarkedStatus };
|
||||
// 鼠标移动时进行监听,按下M时进行快速标记
|
||||
core.registerAction(
|
||||
'onmove',
|
||||
'mark',
|
||||
(x, y) => {
|
||||
if (core.isPlaying()) {
|
||||
flags.mouseLoc = [x, y];
|
||||
}
|
||||
return false;
|
||||
},
|
||||
150
|
||||
);
|
||||
return {
|
||||
checkMarkedEnemy,
|
||||
checkStatus: checkMarkedStatus,
|
||||
markEnemy,
|
||||
hasMarkedEnemy,
|
||||
unmarkEnemy
|
||||
};
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ export default function init() {
|
||||
* 弹出文字
|
||||
*/
|
||||
function popValue() {
|
||||
let ctx = core.getContextByName('pop');
|
||||
let ctx = core.getContextByName('pop')!;
|
||||
if (!ctx) ctx = core.createCanvas('pop', 0, 0, core._PX_, core._PY_, 90);
|
||||
core.clearMap(ctx);
|
||||
let count = 0;
|
||||
|
@ -14,7 +14,7 @@ type CanParseCss = keyof {
|
||||
};
|
||||
|
||||
export default function init() {
|
||||
return { has, getDamageColor, parseCss };
|
||||
return { has, getDamageColor, parseCss, tip };
|
||||
}
|
||||
|
||||
/**
|
||||
|
12
src/types/core.d.ts
vendored
12
src/types/core.d.ts
vendored
@ -1324,6 +1324,11 @@ interface Main extends MainData {
|
||||
* 执行样板的所有监听
|
||||
*/
|
||||
listen(): void;
|
||||
|
||||
/**
|
||||
* 执行ts的插件转发
|
||||
*/
|
||||
forward(): void;
|
||||
}
|
||||
|
||||
interface Flags {
|
||||
@ -1362,6 +1367,11 @@ interface Flags {
|
||||
*/
|
||||
readonly __visited__: Record<FloorIds, boolean>;
|
||||
|
||||
/**
|
||||
* 鼠标位置
|
||||
*/
|
||||
mouseLoc: LocArr;
|
||||
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
@ -1453,4 +1463,6 @@ declare const plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1: PluginDeclaration;
|
||||
|
||||
interface Window {
|
||||
core: CoreMixin;
|
||||
flags: Flags;
|
||||
hero: HeroStatus;
|
||||
}
|
||||
|
25
src/types/plugin.d.ts
vendored
25
src/types/plugin.d.ts
vendored
@ -49,6 +49,22 @@ interface PluginDeclaration extends PluginUtils, PluginUis, PluginUse {
|
||||
*/
|
||||
checkMarkedEnemy(): void;
|
||||
|
||||
/**
|
||||
* 标记怪物
|
||||
* @param id 怪物id
|
||||
*/
|
||||
markEnemy(id: EnemyIds): void;
|
||||
|
||||
/**
|
||||
* 是否标记过某个怪物
|
||||
*/
|
||||
hasMarkedEnemy(id: EnemyIds): void;
|
||||
|
||||
/**
|
||||
* 取消标记过某个怪物
|
||||
*/
|
||||
unmarkEnemy(id: EnemyIds): void;
|
||||
|
||||
/**
|
||||
* 重置设置信息
|
||||
*/
|
||||
@ -73,6 +89,15 @@ interface PluginUtils {
|
||||
* @param css 要解析的css字符串
|
||||
*/
|
||||
parseCss(css: string): Partial<Record<CanParseCss, string>>;
|
||||
|
||||
/**
|
||||
* 弹出一段提示
|
||||
* @param text 提示信息
|
||||
*/
|
||||
tip(
|
||||
type: 'warn' | 'info' | 'success' | 'error' | 'warning' | 'loading',
|
||||
text: string
|
||||
): void;
|
||||
}
|
||||
|
||||
interface PluginUis {
|
||||
|
@ -47,9 +47,9 @@ function exit() {
|
||||
const content = computed(() => {
|
||||
return desc[selected.value].desc
|
||||
.map((v, i, a) => {
|
||||
if (/^\d+\./.test(v)) return `${' '.repeat(4)}${v}`;
|
||||
if (/^\d+\./.test(v)) return `${' '.repeat(12)}${v}`;
|
||||
else if (
|
||||
(has(a[i - 1] && v !== '<br>') && a[i - 1] === '<br>') ||
|
||||
(has(a[i - 1]) && v !== '<br>' && a[i - 1] === '<br>') ||
|
||||
i === 0
|
||||
) {
|
||||
return `${' '.repeat(8)}${v}`;
|
||||
|
Loading…
Reference in New Issue
Block a user