From 2a6a1d6cfe1bf878c6506f871b6152b5788bd982 Mon Sep 17 00:00:00 2001
From: unanmed <1319491857@qq.com>
Date: Sun, 3 Mar 2024 22:31:54 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E6=98=BE=E4=BC=A4=20&=20=E9=9B=B6?=
=?UTF-8?q?=E7=A2=8E=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/.vitepress/config.ts | 3 ++-
docs/guide/diff.md | 2 ++
docs/guide/misc.md | 31 +++++++++++++++++++++++++++++++
src/game/enemy/damage.ts | 4 ++--
4 files changed, 37 insertions(+), 3 deletions(-)
create mode 100644 docs/guide/misc.md
diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts
index 8e5f17f..55a879b 100644
--- a/docs/.vitepress/config.ts
+++ b/docs/.vitepress/config.ts
@@ -41,7 +41,8 @@ export default defineConfig({
},
{ text: '设置系统', link: '/guide/setting' },
{ text: '存储系统', link: '/guide/storage' },
- { text: '按键系统', link: '/guide/hotkey' }
+ { text: '按键系统', link: '/guide/hotkey' },
+ { text: '零碎功能', link: '/guide/misc' }
]
}
],
diff --git a/docs/guide/diff.md b/docs/guide/diff.md
index a177e2a..f485061 100644
--- a/docs/guide/diff.md
+++ b/docs/guide/diff.md
@@ -8,6 +8,8 @@ lang: zh-CN
本指南建立在你已经大致了解 js 的基础语法的基础上。如果还不了解可以尝试对指南内容进行模仿,或者查看[人类塔解析](https://h5mota.com/bbs/thread/?tid=1018&p=1)
+如果你有能力直接使用源码版样板进行创作,也可以直接 fork 或 clone 2.A 样板[存储库](https://github.com/unanmed/HumanBreak/tree/template-v2.A)。2.A 样板使用了 vite 作为了构建工具,同时使用了 ts, vue, less 等作为了开发语言。
+
## 注意事项
对于新样板,由于拥有了近乎完整的类型标注,因此更推荐使用 `VS Code` 进行代码编写,这样你可以获取到完整的类型标注,而由于类型标注的复杂性,样板编辑器完全无法部署,因此样板编辑器不会有任何新版的类型标注。
diff --git a/docs/guide/misc.md b/docs/guide/misc.md
new file mode 100644
index 0000000..fa74f54
--- /dev/null
+++ b/docs/guide/misc.md
@@ -0,0 +1,31 @@
+# 零碎功能介绍
+
+新样板中包含了很多零碎功能,这些功能比较细微,不适合单独开一个页面进行讲解,因此这里把这些零碎功能全部放到了这个页面
+
+## html解析
+
+有很多地方可以填写 html 字符串来实现解析 html:
+
+1. 道具、装备描述:
+
+ 以 `!!html`开头,后面紧跟着 html 字符串即可实现将这些内容解析为 html,例如:
+
+ ```text
+ !!html这是一段红色的字
+ ```
+
+2. 虚拟按键:
+
+ 注册虚拟按键时,按键的显示名称可以填写 html。例如 Win 键就是这么写的:
+
+ ```html
+
+
+
+ ```
+
+3. 设置:
+
+ 设置的说明也可以使用 html
\ No newline at end of file
diff --git a/src/game/enemy/damage.ts b/src/game/enemy/damage.ts
index 6837eaf..2f91b81 100644
--- a/src/game/enemy/damage.ts
+++ b/src/game/enemy/damage.ts
@@ -258,7 +258,7 @@ export class EnemyCollection implements RangeCollection {
if (!dam || objs[id]?.event.noPass) continue;
// 地图伤害
- if (dam.damage !== 0) {
+ if (dam.damage !== 0 && !dam.ambush) {
const damage = core.formatBigNumber(dam.damage, true);
const color = dam.damage < 0 ? '#6eff6a' : '#fa3';
core.status.damage.extraData.push({
@@ -280,7 +280,7 @@ export class EnemyCollection implements RangeCollection {
});
}
- if (dam.repulse) {
+ if (dam.repulse && dam.damage <= 0) {
core.status.damage.extraData.push({
text: '阻',
px: 32 * x + 16,