完善技能树和百科全书

This commit is contained in:
unanmed 2022-12-31 18:24:21 +08:00
parent e24fb961b8
commit 6292bf2df7
6 changed files with 37 additions and 10 deletions

View File

@ -17,8 +17,6 @@
玩法一个会转动的圆盘带有一个伸出去的把手boss 从四面八方射子弹,当子弹恰好落到把手前端时,点击按键或屏幕,可以抵挡子弹,简单难度 3 条命,困难 1 条。简单难度音符密度低。困难难度为冰与火之舞的节奏。简单难度判定时间为前后各 100ms困难为 50ms 玩法一个会转动的圆盘带有一个伸出去的把手boss 从四面八方射子弹,当子弹恰好落到把手前端时,点击按键或屏幕,可以抵挡子弹,简单难度 3 条命,困难 1 条。简单难度音符密度低。困难难度为冰与火之舞的节奏。简单难度判定时间为前后各 100ms困难为 50ms
### 第三章 战争
## 主角 ## 主角
- 反抢夺1 级反 1.02 级反 2.03 级反 3.0,用智慧点点 - 反抢夺1 级反 1.02 级反 2.03 级反 3.0,用智慧点点
@ -26,6 +24,8 @@
- 铸剑为盾:主动技能,减少攻击,增加防御 - 铸剑为盾:主动技能,减少攻击,增加防御
- 血之代偿:消耗一定血量,战前对怪物造成同等数值的伤害 - 血之代偿:消耗一定血量,战前对怪物造成同等数值的伤害
### 第三章 战争
## 机制 ## 机制
### 通用 ### 通用

View File

@ -77,7 +77,10 @@ items.prototype.getItemEffectTip = function (itemId) {
////// 使用道具 ////// ////// 使用道具 //////
items.prototype.useItem = function (itemId, noRoute, callback) { items.prototype.useItem = function (itemId, noRoute, callback) {
const ignore = ['I560', 'I559']; const ignore = ['I560', 'I559'];
if (!this.canUseItem(itemId) || ignore.includes(itemId)) { if (
!this.canUseItem(itemId) ||
(ignore.includes(itemId) && core.isReplaying())
) {
if (callback) callback(); if (callback) callback();
return; return;
} }
@ -86,7 +89,8 @@ items.prototype.useItem = function (itemId, noRoute, callback) {
// 执行完毕 // 执行完毕
this._afterUseItem(itemId); this._afterUseItem(itemId);
// 记录路线 // 记录路线
if (!noRoute) core.status.route.push('item:' + itemId); if (!noRoute && !ignore.includes(itemId))
core.status.route.push('item:' + itemId);
if (callback) callback(); if (callback) callback();
}; };

View File

@ -131,6 +131,7 @@ main.floors.MT6=
"你可以通过拾取绿宝石来获取智慧,拥有足够的智慧后请尽快加点", "你可以通过拾取绿宝石来获取智慧,拥有足够的智慧后请尽快加点",
"合理分配技能是该塔的关键,所以请加点时慎重选择", "合理分配技能是该塔的关键,所以请加点时慎重选择",
"按J或者点击状态栏的技能树可以打开技能树", "按J或者点击状态栏的技能树可以打开技能树",
"现在技能树已经可以在百科全书中查看",
"祝您游戏愉快!", "祝您游戏愉快!",
{ {
"type": "openDoor", "type": "openDoor",

View File

@ -29,7 +29,15 @@ function popValue() {
// 绘制 // 绘制
if (one.frame >= 60) core.setAlpha(ctx, 3 - one.frame / 30); if (one.frame >= 60) core.setAlpha(ctx, 3 - one.frame / 30);
else core.setAlpha(ctx, 1); else core.setAlpha(ctx, 1);
core.fillBoldText(ctx, one.value, one.px, one.py); core.fillBoldText(
ctx,
one.value,
one.px,
one.py,
'#f22',
'#000',
'24px normal'
);
if (one.frame >= 90) count++; if (one.frame >= 90) count++;
}); });
if (count > 0) pop.splice(0, count); if (count > 0) pop.splice(0, count);

View File

@ -2,13 +2,14 @@
<Colomn @close="exit" :width="80" :height="80" :left="30" :right="70" <Colomn @close="exit" :width="80" :height="80" :left="30" :right="70"
><template #left ><template #left
><div id="desc-list"> ><div id="desc-list">
<span <div
v-for="(data, k) in desc" v-for="(data, k) in desc"
class="selectable desc-item" class="selectable desc-item"
:selected="selected === k" :selected="selected === k"
@click="selected = k" @click="click(k)"
>{{ data.text }}</span
> >
<span v-if="show(data.condition)">{{ data.text }}</span>
</div>
</div></template </div></template
> >
<template #right><span v-html="content"></span></template <template #right><span v-html="content"></span></template
@ -32,6 +33,15 @@ function exit() {
const content = computed(() => { const content = computed(() => {
return splitText(desc[selected.value].desc); return splitText(desc[selected.value].desc);
}); });
function click(key: DescKey) {
if (!eval(desc[key].condition)) return;
selected.value = key;
}
function show(condition: string) {
return eval(condition);
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@ -46,5 +56,6 @@ const content = computed(() => {
.desc-item { .desc-item {
padding: 1% 3% 1% 3%; padding: 1% 3% 1% 3%;
width: 100%;
} }
</style> </style>

View File

@ -168,17 +168,19 @@ function draw() {
const d = dict.value; const d = dict.value;
const w = canvas.width; const w = canvas.width;
const per = w / 11; const per = w / 11;
ctx.clearRect(0, 0, canvas.width, canvas.height);
skills.value.forEach(v => { skills.value.forEach(v => {
const [x, y] = v.loc.map(v => v * 2 - 1); const [x, y] = v.loc.map(v => v * 2 - 1);
// 线 // 线
v.front.forEach(([skill]) => { v.front.forEach(([skill], i) => {
const s = skills.value[d[skill]]; const s = skills.value[d[skill]];
ctx.beginPath(); ctx.beginPath();
ctx.moveTo(x * per + per / 2, y * per + per / 2); ctx.moveTo(x * per + per / 2, y * per + per / 2);
ctx.lineTo( ctx.lineTo(
...(s.loc.map(v => (v * 2 - 1) * per + per / 2) as LocArr) ...(s.loc.map(v => (v * 2 - 1) * per + per / 2) as LocArr)
); );
if (core.getSkillLevel(s.index) === 0) ctx.strokeStyle = '#aaa'; if (core.getSkillLevel(s.index) < v.front[i][1])
ctx.strokeStyle = '#aaa';
else ctx.strokeStyle = '#0f8'; else ctx.strokeStyle = '#0f8';
ctx.lineWidth = devicePixelRatio; ctx.lineWidth = devicePixelRatio;
ctx.stroke(); ctx.stroke();
@ -249,6 +251,7 @@ function selectChapter(delta: number) {
font-size: 2.8vh; font-size: 2.8vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
user-select: none;
} }
#skill-title { #skill-title {