From 1911caa9c4a06bf62e634fab065afcd0be898a1e Mon Sep 17 00:00:00 2001
From: unanmed <1319491857@qq.com>
Date: Sun, 8 Jan 2023 22:59:39 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=AE=9A=E7=82=B9=E6=9F=A5?=
=?UTF-8?q?=E7=9C=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/project/data.js | 1 +
public/project/enemys.js | 2 +-
public/project/floors/MT1.js | 11 +-----
public/project/floors/MT10.js | 20 ++---------
public/project/floors/MT32.js | 2 +-
public/project/floors/empty.js | 61 ++++++++++++++++++++++++++++++++++
public/project/functions.js | 17 ++++++----
src/data/desc.json | 13 +++++---
src/plugin/ui/fixed.ts | 20 +++++++----
src/source/data.d.ts | 1 +
src/types/plugin.d.ts | 3 ++
src/ui/bookDetail.vue | 13 ++++----
src/ui/fixed.vue | 3 ++
src/ui/fixedDetail.vue | 8 ++++-
src/ui/markedEnemy.vue | 16 ++++++---
15 files changed, 132 insertions(+), 59 deletions(-)
create mode 100644 public/project/floors/empty.js
diff --git a/public/project/data.js b/public/project/data.js
index 607b637..f42e2d3 100644
--- a/public/project/data.js
+++ b/public/project/data.js
@@ -2,6 +2,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
{
"main": {
"floorIds": [
+ "empty",
"MT0",
"MT1",
"MT2",
diff --git a/public/project/enemys.js b/public/project/enemys.js
index b75e928..6358c71 100644
--- a/public/project/enemys.js
+++ b/public/project/enemys.js
@@ -141,7 +141,7 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 =
"E579": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
"E590": {"name":"冰封史莱姆","hp":7500,"atk":1750,"def":1000,"money":2,"exp":75,"point":0,"special":[20],"ice":25},
"E591": {"name":"新敌人","hp":10000,"atk":2000,"def":1000,"money":0,"exp":0,"point":0,"special":[]},
- "E592": {"name":"冰封巨兽","hp":6000,"atk":1750,"def":1000,"money":2,"exp":85,"point":0,"special":[20,21],"iceHalo":20,"ice":50},
+ "E592": {"name":"冰封巨兽","hp":10000,"atk":2000,"def":1000,"money":2,"exp":85,"point":0,"special":[20,21],"iceHalo":20,"ice":50},
"E593": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
"E594": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
"E595": {"name":"寒冰兽人","hp":12500,"atk":1800,"def":800,"money":2,"exp":100,"point":0,"special":[7],"hungry":25},
diff --git a/public/project/floors/MT1.js b/public/project/floors/MT1.js
index 97f237a..257f29c 100644
--- a/public/project/floors/MT1.js
+++ b/public/project/floors/MT1.js
@@ -22,16 +22,7 @@ main.floors.MT1=
"type": "if",
"condition": "(flag:hard===1)",
"true": [
- {
- "type": "confirm",
- "text": "是否阅读魔塔基本游戏规则(教程)",
- "yes": [
- "魔塔遵循你打我一下,我打你一下的原则,每次造成的伤害为己方攻击减去对方防御\n红宝石可以增加攻击,蓝宝石可以增加防御,血瓶增加血量\n打怪物可以获得经验和金币,经验可用于升级,金币可用于购物\n以上就是基本规则,祝您游戏愉快!"
- ],
- "no": [
- "祝您游戏愉快"
- ]
- }
+ "游戏的基础玩法可以在百科全书中查看,你可以按H或者在道具栏打开。"
]
}
],
diff --git a/public/project/floors/MT10.js b/public/project/floors/MT10.js
index 2b385d3..3c9cf9c 100644
--- a/public/project/floors/MT10.js
+++ b/public/project/floors/MT10.js
@@ -34,24 +34,8 @@ main.floors.MT10=
}
},
"afterBattle": {},
- "afterGetItem": {
- "4,6": [
- "\t[原始人]\b[up,hero]这是什么?",
- "\t[原始人]\b[up,hero]好像有什么形状",
- "\t[原始人]\b[up,hero]难道是什么钥匙吗",
- "\t[原始人]\b[up,hero]黄色的,好像和家里面的那些巨石有些关系"
- ]
- },
- "afterOpenDoor": {
- "1,4": [
- {
- "type": "animate",
- "name": "emm",
- "loc": "hero"
- },
- "\t[原始人]\b[down,hero]原来如此"
- ]
- },
+ "afterGetItem": {},
+ "afterOpenDoor": {},
"autoEvent": {},
"cannotMove": {},
"map": [
diff --git a/public/project/floors/MT32.js b/public/project/floors/MT32.js
index ee65d99..8819ce0 100644
--- a/public/project/floors/MT32.js
+++ b/public/project/floors/MT32.js
@@ -39,7 +39,7 @@ main.floors.MT32=
"衣服是个装备,记得穿上",
"光环会在地图上显示,如果不想要可以在背包里面的系统设置里面关闭",
"每张地图会保证极昼怪的数量与永夜怪的数量相同",
- "注意打过永夜怪或者极昼怪之后怪物标记可能与当前地图不符,因为标记怪物是标记的某一类怪物而不是某一点的怪物"
+ "注意打过永夜怪或者极昼怪之后或者有光环的时候,怪物标记可能与当前地图不符,因为标记怪物是标记的某一类怪物而不是某一点的怪物"
]
},
"changeFloor": {
diff --git a/public/project/floors/empty.js b/public/project/floors/empty.js
new file mode 100644
index 0000000..2d05fec
--- /dev/null
+++ b/public/project/floors/empty.js
@@ -0,0 +1,61 @@
+main.floors.empty=
+{
+ "floorId": "empty",
+ "title": "山脚",
+ "name": "13",
+ "width": 15,
+ "height": 15,
+ "canFlyTo": true,
+ "canFlyFrom": true,
+ "canUseQuickShop": true,
+ "cannotViewMap": false,
+ "images": [],
+ "ratio": 1,
+ "defaultGround": "grass",
+ "bgm": "mount.mp3",
+ "weather": [
+ "sun",
+ 8
+ ],
+ "firstArrive": [],
+ "eachArrive": [],
+ "parallelDo": "",
+ "events": {},
+ "changeFloor": {},
+ "beforeBattle": {},
+ "afterBattle": {},
+ "afterGetItem": {},
+ "afterOpenDoor": {},
+ "autoEvent": {},
+ "cannotMove": {},
+ "cannotMoveIn": {},
+ "map": [
+ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+],
+ "bgmap": [
+
+],
+ "fgmap": [
+
+],
+ "bg2map": [
+
+],
+ "fg2map": [
+
+]
+}
\ No newline at end of file
diff --git a/public/project/functions.js b/public/project/functions.js
index 2a5bac1..f5ae988 100644
--- a/public/project/functions.js
+++ b/public/project/functions.js
@@ -1220,9 +1220,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
case 68: // D:读档
core.load(true);
break;
- case 69: // E:打开光标
- core.ui._drawCursor();
- break;
case 84: // T:打开道具栏
core.openToolbox(true);
break;
@@ -1251,8 +1248,16 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
case 72: // H:打开帮助页面
core.useItem('I560', true);
break;
- case 75: // J:定点查看
+ case 67: // C:怪物临界
if (core.getBlockCls(mx, my)?.startsWith('enemy')) {
+ core.plugin.fixedDetailPanel = 'critical';
+ core.plugin.showFixed.value = false;
+ core.plugin.fixedDetailOpened.value = true;
+ }
+ break;
+ case 69: // E:怪物属性
+ if (core.getBlockCls(mx, my)?.startsWith('enemy')) {
+ core.plugin.fixedDetailPanel = 'special';
core.plugin.showFixed.value = false;
core.plugin.fixedDetailOpened.value = true;
}
@@ -1489,7 +1494,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
if (!floorId || !core.status.maps) return;
const haloMap = {
- 21: 'square:7:cyan'
+ 21: ['square:7:cyan']
};
var width = core.floors[floorId].width,
@@ -1737,7 +1742,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
for (const num of enemy.special) {
if (num in haloMap) {
halo[loc] ??= [];
- halo[loc].push(haloMap[num]);
+ halo[loc].push(...haloMap[num]);
}
}
}
diff --git a/src/data/desc.json b/src/data/desc.json
index 18881ee..31fd9d3 100644
--- a/src/data/desc.json
+++ b/src/data/desc.json
@@ -139,7 +139,7 @@
"condition": "true",
"desc": [
"这里包含本塔中所有的快捷键。对于手机端,可以点击工具栏的难度的位置切换工具栏至数字键。",
- "下面会分为样板快捷键和本塔快捷键两类。",
+ "下面会分为样板快捷键和本塔快捷键两类分别说明。",
"
",
"
",
"下面是样板中的所有快捷键:",
@@ -189,7 +189,9 @@
"
",
"H:打开百科全书",
"
",
- "K:查看鼠标位置怪物的详细信息"
+ "E:查看鼠标位置怪物的特殊属性信息",
+ "
",
+ "C:查看鼠标位置怪物的详细临界信息"
]
},
"extraAttr": {
@@ -243,6 +245,7 @@
"本塔的状态栏的布局较为灵活。它是横向的布局,在状态栏较宽时可以看到,属性会横向依次显示。按照显示顺序,",
"状态栏显示项依次为:",
"
",
+ "
",
"1. 楼层名,点击后进入浏览地图界面",
"
",
"2. 勇士等级",
@@ -310,8 +313,10 @@
"本塔的怪物手册功能很多,下面一一介绍。",
"
",
"
",
- "首先,你可以按X打开怪物手册。将鼠标移动到一个怪物上,按下",
- "K键,也可以定点查看某个怪物的详细属性。将鼠标移动到怪物上也可以定点查看怪物的粗略信息。",
+ "首先,你可以按X打开怪物手册。除此之外,将鼠标移动到怪物上也可以定点查看怪物的粗略信息。",
+ "将鼠标移动到一个怪物上,按下",
+ "E键,可以查看该怪物的特殊属性信息。按下",
+ "C键,可以查看该怪物的详细临界信息。",
"
",
"
",
"怪物手册打开的时候有一个0.6秒的动画,如果不想要可以在开头捡的系统设置里面关闭(默认关闭)。",
diff --git a/src/plugin/ui/fixed.ts b/src/plugin/ui/fixed.ts
index 39f571b..e7cb0fc 100644
--- a/src/plugin/ui/fixed.ts
+++ b/src/plugin/ui/fixed.ts
@@ -4,15 +4,15 @@ import { getDamageColor } from '../utils';
export const showFixed = ref(false);
-const show = debounce((ev: MouseEvent) => {
+let lastId: EnemyIds;
+
+const show = debounce((ev: MouseEvent, mx: number, my: number, e: AllIds) => {
if (!window.flags) return;
if (!flags.mouseLoc) return;
flags.clientLoc = [ev.clientX, ev.clientY];
- const [x, y] = flags.mouseLoc;
- 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 !== lastId) showFixed.value = false;
if (!e || !core.getClsFromId(e)?.startsWith('enemy')) return;
+ lastId = e as EnemyIds;
const enemy = core.material.enemys[e as EnemyIds];
const detail = getDetailedEnemy(enemy, mx, my);
core.plugin.bookDetailEnemy = detail;
@@ -22,8 +22,14 @@ const show = debounce((ev: MouseEvent) => {
export default function init() {
const data = core.canvas.data.canvas;
data.addEventListener('mousemove', ev => {
- showFixed.value = false;
- show(ev);
+ if (!core.isPlaying()) return;
+ const [x, y] = flags.mouseLoc;
+ 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 !== lastId) showFixed.value = false;
+ if (!e) return;
+ show(ev, mx, my, e);
});
return {
diff --git a/src/source/data.d.ts b/src/source/data.d.ts
index 767fb41..9b80818 100644
--- a/src/source/data.d.ts
+++ b/src/source/data.d.ts
@@ -1,5 +1,6 @@
type FloorIds =
+ | 'empty'
| 'MT0'
| 'MT1'
| 'MT2'
diff --git a/src/types/plugin.d.ts b/src/types/plugin.d.ts
index 9b93ac6..203d563 100644
--- a/src/types/plugin.d.ts
+++ b/src/types/plugin.d.ts
@@ -136,6 +136,9 @@ interface PluginUis {
/** 怪物手册详细信息展示的怪物 */
bookDetailEnemy: DetailedEnemy;
+ /** 定点查看的界面,特殊属性还是临界 */
+ fixedDetailPanel: 'special' | 'critical';
+
/** ui是否使用渐变 */
readonly transition: Ref;
diff --git a/src/ui/bookDetail.vue b/src/ui/bookDetail.vue
index a6e7b81..775c299 100644
--- a/src/ui/bookDetail.vue
+++ b/src/ui/bookDetail.vue
@@ -81,16 +81,17 @@ import { keycode } from '../plugin/utils';
import { sleep } from 'mutate-animate';
import EnemyTarget from '../panel/enemyTarget.vue';
-const enemy = core.plugin.bookDetailEnemy;
-const top = ref(core.plugin.bookDetailPos);
-const panel = ref('special');
-
-let detail: HTMLDivElement;
-
const props = defineProps<{
fromBook?: boolean;
+ defaultPanel?: 'special' | 'critical' | 'target';
}>();
+const enemy = core.plugin.bookDetailEnemy;
+const top = ref(core.plugin.bookDetailPos);
+const panel = ref(props.defaultPanel ?? 'special');
+
+let detail: HTMLDivElement;
+
const emits = defineEmits<{
(e: 'close'): void;
}>();
diff --git a/src/ui/fixed.vue b/src/ui/fixed.vue
index 30b945e..4306fab 100644
--- a/src/ui/fixed.vue
+++ b/src/ui/fixed.vue
@@ -80,6 +80,9 @@ async function calHeight() {
vw = window.innerWidth;
width.value = vh * 0.28;
await new Promise(res => requestAnimationFrame(res));
+ if (core.plugin.fixedDetailOpened.value) {
+ showFixed.value = false;
+ }
main = document.getElementById('enemy-fixed') as HTMLDivElement;
if (!main) return;
const style = getComputedStyle(main);
diff --git a/src/ui/fixedDetail.vue b/src/ui/fixedDetail.vue
index eb507f6..ca591eb 100644
--- a/src/ui/fixedDetail.vue
+++ b/src/ui/fixedDetail.vue
@@ -1,6 +1,10 @@
-
+
@@ -9,6 +13,8 @@ import { onMounted, ref } from 'vue';
import { getDetailedEnemy } from '../plugin/ui/fixed';
import BookDetail from './bookDetail.vue';
+const panel = core.plugin.fixedDetailPanel ?? 'special';
+
core.plugin.bookDetailPos = 0;
const [x, y] = flags.mouseLoc;
diff --git a/src/ui/markedEnemy.vue b/src/ui/markedEnemy.vue
index ce0e50d..50f86d7 100644
--- a/src/ui/markedEnemy.vue
+++ b/src/ui/markedEnemy.vue
@@ -102,19 +102,25 @@ function getName(id: EnemyIds) {
}
function getDamage(id: EnemyIds) {
- return core.formatBigNumber(core.getDamageInfo(id)?.damage) ?? '???';
+ return (
+ core.formatBigNumber(
+ core.getDamageInfo(id, void 0, void 0, void 0, 'empty')?.damage
+ ) ?? '???'
+ );
}
function getCritical(id: EnemyIds) {
return (
- core.nextCriticals(id, 1)[0]?.map(v => core.formatBigNumber(v)) ?? [
- 0, 0
- ]
+ core
+ .nextCriticals(id, 1, void 0, void 0, 'empty')[0]
+ ?.map(v => core.formatBigNumber(v)) ?? [0, 0]
);
}
function getDefDamage(id: EnemyIds) {
- return core.formatBigNumber(core.getDefDamage(id, ratio));
+ return core.formatBigNumber(
+ core.getDefDamage(id, ratio, void 0, void 0, 'empty')
+ );
}