feat: 修改学习与胜利之号技能

This commit is contained in:
unanmed 2024-09-28 18:04:28 +08:00
parent 5871558b15
commit d11699e06e
5 changed files with 93 additions and 77 deletions

View File

@ -43,7 +43,9 @@ main.floors.MT50=
"打完左下角和右下角的boss之后开四个机关门",
"注意不要忘记购买装备,到了下一章之后本章的商店将不能到达,不过快捷商店还会保留。这些装备在下一章都会有向上合成",
"本区域可以使用跳跃技能,不要忘记了。",
"注意火炬可通行,而且跳跃时会跳过火炬,不会跳到火炬上。"
"注意火炬可通行,而且跳跃时会跳过火炬,不会跳到火炬上。",
"三章及以后还会有魔攻怪,因此魔法防御技能的长期收益会较大",
"本区请至少留下一个红钥匙"
]
},
"changeFloor": {

View File

@ -42,19 +42,19 @@ main.floors.MT92=
"cannotMoveIn": {},
"map": [
[648,648,648,648,648,648,648, 91,648,648,648,648,648,648,648],
[648, 0, 0, 0, 0, 0, 0, 0, 0,648, 0, 0,648, 0,648],
[648, 0,648,648,648, 0,648,648,648,648,658,648,648, 0,648],
[648, 0, 0,648, 0, 0,648, 0,494, 0, 0, 0,232, 0,648],
[648, 0, 0,648, 0, 0, 0, 0,648,648,648,648,648, 0,648],
[648,648,648,648, 0,648,648, 0,648, 0,644, 0,648, 0,648],
[648, 0, 0,648, 0,648, 0, 0,648, 0,648, 0,677, 0,648],
[ 92, 0, 0, 0, 0, 0, 0, 0,648, 0,648,648,648,648,648],
[648,513,648,648,648,648,648,492,648, 0,679, 0, 0, 0,648],
[648, 0,648, 0,578, 0, 0, 0,648,648,648,648,648,677,648],
[648, 0,648, 0,648,648,648,682,648, 0,538, 0,648, 0,648],
[648, 0,249, 0,648, 0, 0, 0,648, 0,648, 0,648, 0,648],
[648,648,648,648,648,657,648,648,648, 0,648,658,648,682,648],
[648, 0, 0, 0,618, 0, 0, 0,513, 0,648, 0,682, 0,648],
[648,376, 0,491,679, 0,484, 0, 0,648, 0,381,648, 0,648],
[648,671,648,648,648,682,648,648,648,648,658,648,648, 0,648],
[648,381,484,648,484, 0,648,482,494, 0, 0, 0,232, 0,648],
[648,484,378,648, 0, 28,657, 0,648,648,648,648,648, 0,648],
[648,648,648,648,658,648,648,492,648, 0,644, 0,648, 0,648],
[648, 0,482,648,491,648, 28, 0,648,491,648,484,677, 0,648],
[ 92, 0, 0,682, 0,658, 0,484,648,378,648,648,648,648,648],
[648,513,648,648,648,648,648,492,648, 0,679,491, 0, 27,648],
[648, 27,648,484,578,484, 0,381,648,648,648,648,648,677,648],
[648, 0,648, 0,648,648,648,682,648, 27,538,376,648,378,648],
[648,484,249, 28,648, 28, 0,482,648, 0,648,484,648,484,648],
[648,648,648,648,648,657,648,648,648,484,648,658,648,682,648],
[648,487,376,378,618, 0,491, 0,513, 0,648, 0,682, 0,648],
[648,648,648,648,648,648,648,648,648,648,648,648,648,648,648]
],
"bgmap": [

View File

@ -1,5 +1,18 @@
let levels: number[] = [];
export type Chapter = 'chapter1' | 'chapter2';
export interface Skill {
index: number;
title: string;
desc: string[];
consume: (level: number) => number;
front: [skill: number, level: number][];
loc: LocArr;
max: number;
effect: (level: number) => string[];
}
/**
* @type {Record<Chapter, Skill[]>}
*/
@ -9,21 +22,21 @@ export const skills: Record<Chapter, Skill[]> = {
index: 0,
title: '力量',
desc: ['力量就是根本可以通过智慧增加力量每级增加2点攻击。'],
consume: '10 * level + 10',
consume: level => 10 * level + 10,
front: [],
loc: [1, 2],
max: 10,
effect: ['攻击 + ${level * 2}']
effect: level => [`攻击 + ${level * 2}`]
},
{
index: 1,
title: '致命一击',
desc: ['爆发出全部力量攻击敌人每级增加5点额外攻击。'],
consume: '30 * level + 30',
consume: level => 30 * level + 30,
front: [[0, 5]],
loc: [2, 1],
max: 10,
effect: ['额外攻击 + ${level * 5}']
effect: level => [`额外攻击 + ${level * 5}`]
},
{
index: 2,
@ -32,31 +45,31 @@ export const skills: Record<Chapter, Skill[]> = {
'<span style="color: gold">主动技能快捷键1</span>',
'开启后会在战斗时会额外增加一定量的攻击,但同时减少一定量的防御。'
],
consume: '200 * level + 400',
consume: level => 200 * level + 400,
front: [[1, 5]],
loc: [4, 1],
max: 5,
effect: ['增加${level * 10}%攻击,减少${level * 10}%防御']
effect: level => [`增加${level * 10}%攻击,减少${level * 10}%防御`]
},
{
index: 3,
title: '坚韧',
desc: ['由智慧转化出坚韧每级增加2点防御'],
consume: '10 * level + 10',
consume: level => 10 * level + 10,
front: [],
loc: [1, 4],
max: 10,
effect: ['防御 + ${level * 2}']
effect: level => [`防御 + ${level * 2}`]
},
{
index: 4,
title: '回春',
desc: ['让智慧化为治愈之泉水每级增加1点生命回复'],
consume: '20 * level + 20',
consume: level => 20 * level + 20,
front: [[3, 5]],
loc: [2, 5],
max: 25,
effect: ['生命回复 + ${level}']
effect: level => [`生命回复 + ${level}`]
},
{
index: 5,
@ -64,21 +77,21 @@ export const skills: Record<Chapter, Skill[]> = {
desc: [
'让生命变得更多一些吧每吃50瓶血瓶就增加当前生命回复10%的生命回复'
],
consume: '1500',
consume: () => 1500,
front: [[4, 25]],
loc: [4, 5],
max: 1,
effect: ['50瓶血10%生命回复']
effect: () => [`50瓶血10%生命回复`]
},
{
index: 6,
title: '坚固之盾',
desc: ['让护甲更加坚硬一些吧每级增加10点防御'],
consume: '50 + level * 50',
consume: level => 50 + level * 50,
front: [[3, 5]],
loc: [2, 3],
max: 10,
effect: ['防御 + ${level * 10}']
effect: level => [`防御 + ${level * 10}`]
},
{
index: 7,
@ -86,7 +99,7 @@ export const skills: Record<Chapter, Skill[]> = {
desc: [
'<span style="color: #dd4">第一章终极技能</span>,战斗时智慧的 1/10 会充当等量护盾。'
],
consume: '2500',
consume: () => 2500,
front: [
[6, 10],
[5, 1],
@ -94,7 +107,7 @@ export const skills: Record<Chapter, Skill[]> = {
],
loc: [5, 3],
max: 1,
effect: ['战斗时智慧会充当护盾']
effect: () => [`战斗时智慧会充当护盾`]
}
],
chapter2: [
@ -102,21 +115,21 @@ export const skills: Record<Chapter, Skill[]> = {
index: 8,
title: '锋利',
desc: ['让剑变得更加锋利每级使攻击增加1%buff式增加'],
consume: 'level > 5 ? 50 * level ** 2 : 250 * level + 250',
consume: level => (level > 5 ? 50 * level ** 2 : 250 * level + 250),
front: [],
loc: [1, 2],
max: 15,
effect: ['攻击增加${level}%']
effect: level => [`攻击增加${level}%`]
},
{
index: 9,
title: '坚硬',
desc: ['让盾牌变得更加坚固每级使防御增加1%buff式增加'],
consume: 'level > 5 ? 50 * level ** 2 : 250 * level + 250',
consume: level => (level > 5 ? 50 * level ** 2 : 250 * level + 250),
front: [],
loc: [1, 4],
max: 15,
effect: ['防御增加${level}%']
effect: level => [`防御增加${level}%`]
},
{
index: 10,
@ -125,59 +138,60 @@ export const skills: Record<Chapter, Skill[]> = {
'<span style="color: gold">主动技能快捷键3</span>',
'减少一定的攻击,增加一定的防御'
],
consume: '1000 * level ** 2 + 1000',
consume: level => 1000 * level ** 2 + 1000,
front: [[9, 5]],
loc: [2, 5],
max: 5,
effect: ['增加${level * 10}%的防御,减少${level * 10}%的攻击']
effect: level => [
`增加${level * 10}%的防御,减少${level * 10}%的攻击`
]
},
{
index: 11,
title: '学习',
desc: [
'<span style="color: gold">主动技能</span>可以消耗500智慧学习一个怪物的技能',
'持续5场战斗每学习一次消耗的智慧点增加250每次升级使持续的战斗次数增加3次。更多信息可在学习后在百科全书查看。'
],
consume: '2500 * 2 ** level + 5000',
title: '魔法盾',
desc: ['为主角提供魔法防御每级增加100点魔法防御'],
consume: level => 5000 * level + 5000,
front: [
[8, 10],
[12, 10]
],
loc: [4, 1],
max: 6,
effect: ['学习怪物技能,持续${level * 3 + 2}场战斗']
max: 10,
effect: level => [`学习怪物技能,持续${level * 3 + 2}场战斗`]
},
{
index: 12,
title: '聪慧',
desc: ['使主角变得更加聪明每级使绿宝石增加的智慧点上升5%'],
consume: 'level > 5 ? 100 * level ** 2 : 250 * level + 1250',
consume: level =>
level > 5 ? 100 * level ** 2 : 250 * level + 1250,
front: [
[8, 10],
[9, 10]
],
loc: [3, 3],
max: 20,
effect: ['增加${level * 5}%绿宝石效果']
effect: level => [`增加${level * 5}%绿宝石效果`]
},
{
index: 13,
title: '治愈',
desc: ['使主角能够更好地回复生命每级使血瓶的加血量增加2%'],
consume: 'level > 5 ? 100 * level ** 2 : 250 * level + 1250',
consume: level =>
level > 5 ? 100 * level ** 2 : 250 * level + 1250,
front: [[10, 3]],
loc: [4, 5],
max: 20,
effect: ['增加${level * 2}%的血瓶回血量']
effect: level => [`增加${level * 2}%的血瓶回血量`]
},
{
index: 14,
title: '胜利之号',
desc: [
'<span style="color: #dd4">第二章终极技能</span>',
'每打一个怪物勇士在本楼层对怪物造成的伤害便增加1%'
'勇士攻防增加10%buff式增加'
],
consume: '25000',
consume: () => 25000,
front: [
[13, 10],
[12, 10],
@ -185,7 +199,7 @@ export const skills: Record<Chapter, Skill[]> = {
],
loc: [5, 3],
max: 1,
effect: ['每打一个怪勇士造成的伤害增加1%']
effect: () => [`攻防增加10%`]
}
]
};
@ -210,17 +224,9 @@ export function getSkillLevel(skill: number) {
}
export function getSkillConsume(skill: number) {
return eval(
getSkillFromIndex(skill)?.consume.replace(
/level(:\d+)?/g,
(str, $1) => {
if ($1)
return `Mota.Plugin.require('skillTree_g').getSkillLevel(${$1})`;
else
return `Mota.Plugin.require('skillTree_g').getSkillLevel(${skill})`;
}
) ?? ''
);
const s = getSkillFromIndex(skill);
if (!s) return 0;
return s.consume(getSkillLevel(skill));
}
export function openTree() {
@ -285,7 +291,11 @@ export function upgradeSkill(skill: number) {
core.setFlag('shieldOn', true);
break;
case 11: // 学习
core.setItem('I565', 1);
core.status.hero.magicDef += 100;
break;
case 12:
core.addBuff('atk', 0.1);
core.addBuff('def', 0.1);
break;
}
const consume = getSkillConsume(skill);

View File

@ -87,6 +87,7 @@ import { sleep } from 'mutate-animate';
import { gameKey } from '@/core/main/custom/hotkey';
import { GameUi } from '@/core/main/custom/ui';
import { mainUi } from '@/core/main/init/ui';
import type { Chapter } from '@/plugin/game/skillTree';
const props = defineProps<{
num: number;
@ -143,19 +144,10 @@ const desc = computed(() => {
const effect = computed(() => {
return [0, 1].map(v => {
return eval(
'`' +
`${v === 0 ? '当前效果:' : '下一级效果:'}` +
skill.value.effect
.join('')
.replace(/level(:\d+)?/g, (str, $1) => {
if ($1)
return `(skillTree.getSkillLevel(${$1}) + ${v})`;
else
return `(skillTree.getSkillLevel(${skill.value.index}) + ${v})`;
}) +
'`'
);
const prefix = v === 0 ? '当前效果:' : '下一级效果:';
const level = skillTree.getSkillLevel(skill.value.index);
const content = skill.value.effect(level);
return prefix + content.join('');
}) as [string, string];
});

View File

@ -62,6 +62,12 @@
<div id="status-def" class="status-item status-item-bold">
<img :src="imgs['def.png'].src" class="status-icon" />
<span>{{ format(hero.def!) }}</span>
<span
v-if="hero.magicDef! > 0"
id="status-magic-def"
class="status-extra status-item-bold"
>+{{ format(hero.magicDef!) }}</span
>
</div>
<div id="status-mdef" class="status-item status-item-bold">
<img :src="imgs['IQ.png'].src" class="status-icon" />
@ -167,7 +173,8 @@ const toShow: (keyof NumbericHeroStatus)[] = [
'mana', //
'money', //
'exp', //
'lv' //
'lv', //
'magicDef' //
];
watch(status, update);
@ -326,6 +333,11 @@ onUnmounted(() => {
color: rgb(255, 211, 211);
}
#status-magic-def {
line-height: 0;
color: rgb(176, 189, 255);
}
#status-hpmax {
line-height: 0;
color: rgb(167, 255, 167);