diff --git a/components.d.ts b/components.d.ts index d508c8b..f5721f1 100644 --- a/components.d.ts +++ b/components.d.ts @@ -14,6 +14,7 @@ declare module '@vue/runtime-core' { ASlider: typeof import('ant-design-vue/es')['Slider'] Box: typeof import('./src/components/box.vue')['default'] BoxAnimate: typeof import('./src/components/boxAnimate.vue')['default'] + Colomn: typeof import('./src/components/colomn.vue')['default'] EnemyOne: typeof import('./src/components/enemyOne.vue')['default'] Scroll: typeof import('./src/components/scroll.vue')['default'] } diff --git a/public/project/items.js b/public/project/items.js index 6602d7b..e025275 100644 --- a/public/project/items.js +++ b/public/project/items.js @@ -345,7 +345,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "name": "查看技能", "text": "查看勇士的技能", "canUseItemEffect": true, - "useItemEffect": "core.openSkills();" + "useItemEffect": "core.openSkill();" }, "dagger": { "cls": "constants", diff --git a/public/project/plugins.js b/public/project/plugins.js index da3bb44..a642d54 100644 --- a/public/project/plugins.js +++ b/public/project/plugins.js @@ -6262,6 +6262,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = { core.plugin.chapterContent.value = chapter; core.plugin.chapterShowed.value = true; }; + + this.openSkill = function () { + if (main.replayChecking) return; + core.plugin.skillOpened.value = true; + }; }, remainEnemy: function () { /** @@ -6343,5 +6348,19 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = { flags[setting] = v; return true; }); + }, + skillTree: function () { + /** + * @type {number[]} + */ + const levels = []; + + /** + * 获取技能等级 + * @param {number} skill + */ + this.getSkillLevel = function (skill) { + return (levels[skill] ??= 0); + }; } }; diff --git a/src/components/colomn.vue b/src/components/colomn.vue new file mode 100644 index 0000000..86f1dbb --- /dev/null +++ b/src/components/colomn.vue @@ -0,0 +1,151 @@ + + + + + diff --git a/src/data/skill.json b/src/data/skill.json new file mode 100644 index 0000000..4f30ba3 --- /dev/null +++ b/src/data/skill.json @@ -0,0 +1,29 @@ +{ + "none": { + "text": "无", + "opened": "true", + "desc": [ + "当前未选择技能" + ] + }, + "blade": { + "text": "断灭之刃", + "opened": "core.getSkillLevel(2) > 0", + "desc": [ + "快捷键1,开启后勇士攻击增加${level:2 * 10}%,", + "同时防御减少${level:2 * 10}%。", + "
", + "
", + "当前等级:${level:2}" + ] + }, + "jump": { + "text": "跳跃", + "opened": "flags.skill2 === true", + "desc": [ + "快捷键2,消耗200点生命值,困难消耗400点,一个地图只能使用3次,", + "如果前方为可通行的地面,则不能使用该技能,如果前方为怪物,则将怪物移至勇士视线上第一个不能通行的方块后", + "如果前方为障碍物,则直接跳到该障碍物的后方。" + ] + } +} \ No newline at end of file diff --git a/src/plugin/uiController.ts b/src/plugin/uiController.ts index bc64672..f9e6725 100644 --- a/src/plugin/uiController.ts +++ b/src/plugin/uiController.ts @@ -5,6 +5,7 @@ import Toolbox from '../ui/toolbox.vue'; import Equipbox from '../ui/equipbox.vue'; import Settings from '../ui/settings.vue'; import Desc from '../ui/desc.vue'; +import Skill from '../ui/skill.vue'; export const bookOpened = ref(false); export const toolOpened = ref(false); @@ -12,6 +13,7 @@ export const equipOpened = ref(false); export const showStatusBar = ref(false); export const settingsOpened = ref(false); export const descOpened = ref(false); +export const skillOpened = ref(false); export const transition = ref(true); export const noClosePanel = ref(false); @@ -24,7 +26,8 @@ const UI_LIST: [Ref, Component][] = [ [toolOpened, Toolbox], [equipOpened, Equipbox], [settingsOpened, Settings], - [descOpened, Desc] + [descOpened, Desc], + [skillOpened, Skill] ]; /** ui栈 */ @@ -55,7 +58,8 @@ export default function init() { equipOpened, showStatusBar, settingsOpened, - descOpened + descOpened, + skillOpened }; } diff --git a/src/types/plugin.d.ts b/src/types/plugin.d.ts index 499b900..3ecb1b0 100644 --- a/src/types/plugin.d.ts +++ b/src/types/plugin.d.ts @@ -139,6 +139,9 @@ interface PluginUis { /** 百科全书是否打开了 */ readonly descOpened: Ref; + /** 技能查看界面是否打开 */ + readonly skillOpened: Ref; + /** ui栈 */ readonly uiStack: Ref; @@ -147,6 +150,11 @@ interface PluginUis { * @param chapter 显示的文字 */ showChapter(chapter: string): void; + + /** + * 打开技能查看界面 + */ + openSkill(): void; } interface PluginUse { @@ -192,6 +200,14 @@ interface PluginUse { useUp(ele: HTMLElement, fn: DragFn): void; } +interface SkillTree { + /** + * 获取技能等级 + * @param skill 技能索引 + */ + getSkillLevel(skill: number): number; +} + type Forward = { [K in keyof T as T[K] extends Function ? K extends `_${string}` diff --git a/src/ui/desc.vue b/src/ui/desc.vue index b2cd066..b536c06 100644 --- a/src/ui/desc.vue +++ b/src/ui/desc.vue @@ -1,40 +1,25 @@ diff --git a/src/ui/settings.vue b/src/ui/settings.vue index db691cc..ae27458 100644 --- a/src/ui/settings.vue +++ b/src/ui/settings.vue @@ -1,50 +1,35 @@ diff --git a/src/ui/skill.vue b/src/ui/skill.vue new file mode 100644 index 0000000..9821d11 --- /dev/null +++ b/src/ui/skill.vue @@ -0,0 +1,78 @@ + + + + +