Browse Source

更新

1.新增图标资源
2.新增多彩装备:百花内甲,降龙
3.调整伤害计算逻辑适应新装备技能
4.自动出售可勾选独特品质
5.调整伤害加成、防御加成、生命加成数值
6.修复BUG
-秒伤计算了溢出得暴击率BUG
-战斗时切换装备无法监测角色死亡BUG
-困难副本可重复挑战问题
-装备图鉴不显示护腕图鉴问题
v1.0
许孟阳 2 weeks ago
parent
commit
85a6740acc
  1. BIN
      public/img/equips/armor/东方.png
  2. BIN
      public/img/equips/armor/五行压贴.png
  3. BIN
      public/img/equips/armor/吞鬼甲.png
  4. BIN
      public/img/equips/armor/天成.png
  5. BIN
      public/img/equips/armor/斗融之甲.png
  6. BIN
      public/img/equips/armor/炎狱.png
  7. BIN
      public/img/equips/armor/狐不归.png
  8. BIN
      public/img/equips/armor/百花内甲.png
  9. BIN
      public/img/equips/armor/美人鼓.png
  10. BIN
      public/img/equips/armor/蝙蝠氅.png
  11. BIN
      public/img/equips/armor/鬼蜮焚天.png
  12. BIN
      public/img/equips/armor/鬼门甲.png
  13. BIN
      public/img/equips/armor/鱼腹.png
  14. BIN
      public/img/equips/armor/黑犀.png
  15. BIN
      public/img/equips/armor/龟纹铠.png
  16. BIN
      public/img/equips/bracers/刑枷.png
  17. BIN
      public/img/equips/pants/鬼甲.png
  18. BIN
      public/img/map/boos_close.png
  19. BIN
      public/img/map/boss_lava.png
  20. BIN
      public/img/map/boss_warrior.png
  21. 19
      src/config/beings.ts
  22. 15
      src/config/equips/armor.ts
  23. 58
      src/config/equips/bracers.ts
  24. 17
      src/config/equips/constant.ts
  25. 18
      src/config/i18n/zh/euips.ts
  26. 8
      src/config/i18n/zh/skills.ts
  27. 23
      src/config/skill/armor.ts
  28. 30
      src/config/skill/base.ts
  29. 24
      src/config/skill/bracers.ts
  30. 2
      src/config/skill/index.ts
  31. 2
      src/config/skill/jewelry.ts
  32. 2
      src/tool/caller/attribute.ts
  33. 55
      src/tool/caller/battle.ts
  34. 6
      src/views/backpack/auto-sell.vue
  35. 35
      src/views/dungeon/battle.vue
  36. 10
      src/views/dungeon/dungeonMap.vue
  37. 1
      src/views/illustrated/illustrated.vue

BIN
public/img/equips/armor/东方.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
public/img/equips/armor/五行压贴.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
public/img/equips/armor/吞鬼甲.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
public/img/equips/armor/天成.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
public/img/equips/armor/斗融之甲.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
public/img/equips/armor/炎狱.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
public/img/equips/armor/狐不归.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
public/img/equips/armor/百花内甲.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
public/img/equips/armor/美人鼓.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
public/img/equips/armor/蝙蝠氅.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
public/img/equips/armor/鬼蜮焚天.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
public/img/equips/armor/鬼门甲.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
public/img/equips/armor/鱼腹.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
public/img/equips/armor/黑犀.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
public/img/equips/armor/龟纹铠.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
public/img/equips/bracers/刑枷.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
public/img/equips/pants/鬼甲.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
public/img/map/boos_close.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

BIN
public/img/map/boss_lava.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 KiB

BIN
public/img/map/boss_warrior.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

19
src/config/beings.ts

@ -86,13 +86,12 @@ export class Monster extends Attribute { @@ -86,13 +86,12 @@ export class Monster extends Attribute {
ef: number;
lf: number;
constructor(lv, difficulty: string, layer?: number) {
constructor(lv, difficulty: string, layer: number) {
super();
this.lv = lv;
this.difficulty = difficulty;
this.df = base_attr_factor[this.difficulty];
this.ef = extra_factor[difficulty];
layer = layer || 0;
this.lf = ((this.lv + layer) / this.lv) ** 2;
this.callAtk(2.5);
this.callHp(17);
@ -123,7 +122,7 @@ export class Monster extends Attribute { @@ -123,7 +122,7 @@ export class Monster extends Attribute {
export class BossMonster extends Monster {
type: string = type_boss;
constructor(lv, difficulty, layer?: number) {
constructor(lv, difficulty, layer: number) {
super(lv, difficulty, layer);
this.callAtk(3.5);
this.callHp(31);
@ -148,23 +147,29 @@ export class Dungeon { @@ -148,23 +147,29 @@ export class Dungeon {
left: string = '';
right: string = '';
top: string = '';
layer: number;
constructor(lv: number, difficulty: string, layer?: number) {
this.lv = lv;
this.difficulty = difficulty;
this.setDifficulty(difficulty, layer);
this.layer = layer || 0;
this.setDifficulty(difficulty);
}
setDifficulty(difficulty: string, layer?: number) {
setDifficulty(difficulty: string) {
const lv = this.lv;
this.difficulty = difficulty;
this.monsters = new Array();
for (let i = 0; i < 4; i++) {
this.monsters.push(new Monster(lv, this.difficulty, layer));
this.monsters.push(new Monster(lv, this.difficulty, this.layer));
}
const boss = new BossMonster(lv, difficulty, layer);
const boss = new BossMonster(lv, difficulty, this.layer);
this.monsters.push(boss);
this.needDps = Math.ceil(lv * lv ** 1.1 * 32.5 * base_attr_factor[this.difficulty]);
}
setLayer = (layer) => {
this.layer = layer;
this.setDifficulty(this.difficulty);
};
}
export const createdDungeons = () => {};

15
src/config/equips/armor.ts

@ -3,7 +3,18 @@ import { qualitys, entry_initor, extra_entry_num } from './constant'; @@ -3,7 +3,18 @@ import { qualitys, entry_initor, extra_entry_num } from './constant';
const extraEntrys = ['atk', 'hp', 'def', 'defPercent', 'hpPercent', 'dmgReduc', 'critAvoid', 'critDmgReduc'];
const coefficient = { shabby: 0.7, ordinary: 1, artifact: 1.5, epic: 1.8, unique: 2, colorful: 2 };
export const armorColorfulCategorys = [];
export const armorColorfulCategorys = [
{
name: 'baihua',
icon: 'armor/百花内甲.png',
entry: [
{ type: 'def', valCoefficient: 1.0 },
{ type: 'hp', valCoefficient: 1.4 },
{ type: 'atk', valCoefficient: 1.4 },
],
skill: 'BHXDJC',
},
];
export const armorUniqueCategorys = [
{
@ -150,7 +161,7 @@ const createBase = (quality, lv, category) => { @@ -150,7 +161,7 @@ const createBase = (quality, lv, category) => {
const qualityCoefficient = coefficient[quality];
entry.push(initor(lv, qualityCoefficient, item.valCoefficient));
});
return new EquipBase(category.name, category.icon, entry);
return new EquipBase(category.name, category.icon, entry, category.skill);
};
const getCategory = (quality) => {

58
src/config/equips/bracers.ts

@ -7,62 +7,14 @@ const coefficient = { shabby: 0.6, ordinary: 0.9, artifact: 1.3, epic: 1.6, uniq @@ -7,62 +7,14 @@ const coefficient = { shabby: 0.6, ordinary: 0.9, artifact: 1.3, epic: 1.6, uniq
export const bracersColorfulCategorys = [
{
name: 'shuzhuang',
icon: 'bracers/梳妆镜.png',
name: 'xianglong',
icon: 'bracers/降龙.png',
entry: [
{ type: 'critDmg', valCoefficient: 1.2 },
{ type: 'atkPercent', valCoefficient: 0.7 },
{ type: 'atk', valCoefficient: 1 },
{ type: 'hp', valCoefficient: 0.7 },
{ type: 'def', valCoefficient: 0.4 },
],
skill: 'JHSY',
},
{
name: 'liulipan',
icon: 'bracers/琉璃盘.png',
entry: [
{ type: 'atk', valCoefficient: 0.6 },
{ type: 'hp', valCoefficient: 1.5 },
],
skill: 'Liulipan',
},
{
name: 'ghdp',
icon: 'bracers/勾魂夺魂.png',
entry: [
{ type: 'critDmg', valCoefficient: 1 },
{ type: 'crit', valCoefficient: 0.4 },
{ type: 'atk', valCoefficient: 0.5 },
],
skill: 'CritFear',
},
{
name: 'youerhuan',
icon: 'bracers/白骨夫人的右耳环.png',
entry: [
{ type: 'critDmg', valCoefficient: 1.5 },
{ type: 'atk', valCoefficient: 0.8 },
],
skill: 'Vampire1',
},
{
name: 'jingboyu',
icon: 'bracers/金钵盂.png',
entry: [
{ type: 'atk', valCoefficient: 0.8 },
{ type: 'hp', valCoefficient: 0.6 },
{ type: 'def', valCoefficient: 0.6 },
],
skill: 'Prototype',
},
{
name: 'zijingboyu',
icon: 'bracers/紫金钵盂.png',
entry: [
{ type: 'atk', valCoefficient: 0.8 },
{ type: 'hp', valCoefficient: 0.6 },
{ type: 'def', valCoefficient: 0.6 },
],
skill: 'Fate',
skill: 'Xianglong',
},
];
export const bracersUniqueCategorys = [

17
src/config/equips/constant.ts

@ -64,9 +64,9 @@ export const entry_initor = { @@ -64,9 +64,9 @@ export const entry_initor = {
return new Entry('hp', value, '+' + value, max, min);
},
hpPercent: (lv: number, qualityCoefficient: number) => {
const value = Math.round((lv * 0.13 + ((Math.random() * lv) / 10 + 4)) * qualityCoefficient) || 1;
const max = Math.round((lv * 0.13 + (lv / 10 + 4)) * qualityCoefficient) || 1;
const min = Math.round((lv * 0.13 + 4) * qualityCoefficient) || 1;
const value = Math.round((lv * 0.1 + ((Math.random() * lv) / 10 + 4)) * qualityCoefficient) || 1;
const max = Math.round((lv * 0.1 + (lv / 10 + 4)) * qualityCoefficient) || 1;
const min = Math.round((lv * 0.1 + 4) * qualityCoefficient) || 1;
return new Entry('hpPercent', value, '+' + value + '%', max, min);
},
def: (lv: number, qualityCoefficient: number, valCoefficient?: number) => {
@ -77,9 +77,9 @@ export const entry_initor = { @@ -77,9 +77,9 @@ export const entry_initor = {
return new Entry('def', value, '+' + value, max, min);
},
defPercent: (lv: number, qualityCoefficient: number) => {
const value = Math.round(lv * 0.1 + ((Math.random() * lv) / 10 + 4) * qualityCoefficient) || 1;
const max = Math.round(lv * 0.1 + (lv / 10 + 4) * qualityCoefficient) || 1;
const min = Math.round(lv * 0.1 + 4 * qualityCoefficient) || 1;
const value = Math.round(lv * 0.13 + ((Math.random() * lv) / 10 + 4) * qualityCoefficient) || 1;
const max = Math.round(lv * 0.13 + (lv / 10 + 4) * qualityCoefficient) || 1;
const min = Math.round(lv * 0.13 + 4 * qualityCoefficient) || 1;
return new Entry('defPercent', value, '+' + value + '%', max, min);
},
bloc: (lv: number, qualityCoefficient: number, valCoefficient?: number) => {
@ -97,9 +97,6 @@ export const entry_initor = { @@ -97,9 +97,6 @@ export const entry_initor = {
},
crit: (lv: number, qualityCoefficient: number, valCoefficient?: number) => {
valCoefficient = valCoefficient || 0;
// const value = Math.round((Math.random() * 5 + 5 + 2 * valCoefficient) * qualityCoefficient) || 1;
// const max = Math.round((5 + 5 + 2 * valCoefficient) * qualityCoefficient) || 1;
// const min = Math.round((5 + 2 * valCoefficient) * qualityCoefficient) || 1;
const value = Math.round(((0.5 * lv) / 100 + 0.5) * (Math.random() * 5 + 5 + 2 * valCoefficient) * qualityCoefficient) || 1;
const max = Math.round(((0.5 * lv) / 100 + 0.5) * (5 + 5 + 2 * valCoefficient) * qualityCoefficient) || 1;
const min = Math.round(((0.5 * lv) / 100 + 0.5) * (5 + 2 * valCoefficient) * qualityCoefficient) || 1;
@ -113,7 +110,7 @@ export const entry_initor = { @@ -113,7 +110,7 @@ export const entry_initor = {
return new Entry('critDmg', value, '+' + value + '%', max, min);
},
dmgPercent: (lv: number, qualityCoefficient: number, valCoefficient?: number) => {
valCoefficient = valCoefficient || 0.5;
valCoefficient = valCoefficient || 1;
const value = Math.round(((Math.random() + 1) * lv * 0.08 + 3) * valCoefficient * qualityCoefficient) || 1;
const max = Math.round((lv * 0.16 + 3) * valCoefficient * qualityCoefficient) || 1;
const min = Math.round((lv * 0.08 + 3) * valCoefficient * qualityCoefficient) || 1;

18
src/config/i18n/zh/euips.ts

@ -53,6 +53,21 @@ export const weapon = { @@ -53,6 +53,21 @@ export const weapon = {
};
export const armor = {
type: '防具',
baihua: ['百花内甲', '内甲缝着一个香囊,本有百花香,如今只余勿忘我。'],
bianfu: ['蝙蝠氅', '穿上它,你能在一秒钟内分辨二百五十组回音。'],
dongfang: ['东方', '陆吾时常遥望东方,没有人知道他看到了什么。'],
dourong: ['斗融之甲', '它的主人最后成了一条龙的食物。'],
guiwen: ['龟纹铠', '督军穿上这件铠甲后觉得自己有了顶撞正妻的勇气,时候证明是幻觉。'],
guimen: ['鬼门甲', '不要妄图破坏它,它曾经是冥界之门的一部分。'],
gyft: ['鬼蜮焚天', '三途河岸那魅惑者亡灵、怒火焚天的红花。'],
heixi: ['黑犀', '本是七星剑的剑鞘,被小妖偷来做成了皮甲一副,冬暖夏凉。'],
hubugui: ['狐不归', '刀锋冷,映月辉;世情浊,胡不归?'],
meirengu: ['美人鼓', '白骨夫人曾鼓与花果山以壮百万妖君,声阙五百里'],
tiancheng: ['天成', '石像天成,好事者略施雕琢。'],
tungui: ['吞鬼甲', '执搏挫锐,噬食鬼魅。画虎于门,鬼不敢入。'],
wuxing: ['五行压贴', '除了玄奘,谁都不准动!'],
yanyu: ['炎狱', '穿在身上全身毛孔都要冒烟了。'],
yufu: ['鱼腹', '藏玉泥中,匿珪鱼腹'],
dispute: ['争执连身衣', '争执连身衣'],
jianHao: ['剑豪盔甲', '剑豪盔甲'],
samurai: ['隐武士铠甲', '隐武士铠甲'],
@ -122,6 +137,7 @@ export const quality = { @@ -122,6 +137,7 @@ export const quality = {
};
export const pants = {
type: '裤子',
guijia: ['鬼甲', '据说是由鬼魂的怨念凝聚而成。'],
baizhequn: ['荃英的百褶裙', '每一个褶子里,都是荃英的心血。'],
yulan: ['鱼篮', '观世音菩萨在紫竹林以六十二亿根竹篾编织而成。'],
mhlg: ['梦回龙宫', '沧海离歌一阕悲,梦里龙宫几度回。'],
@ -150,6 +166,8 @@ export const shoes = { @@ -150,6 +166,8 @@ export const shoes = {
initial: ['新手鞋子', '新手菜鸡使用的破旧鞋子'],
};
export const bracers = {
type: '护腕',
xingjia: ['刑枷', '我无法为野心套上邢枷,所以只好走向毁灭。'],
xuedun: ['毒蛇', '即使血是冷的,但你又怎知它不向往温暖。'],
xianglong: ['降龙', '见龙在田,利见大人。'],
huojing: ['火晶环', '闻上去有股老君八卦炉中单屑的味道。'],

8
src/config/i18n/zh/skills.ts

@ -8,6 +8,12 @@ export const iceBlade = ['冰刃', '暴击时有${0}几率释放冰线冲击,附 @@ -8,6 +8,12 @@ export const iceBlade = ['冰刃', '暴击时有${0}几率释放冰线冲击,附
export const seeRed = ['见红', '造成${0}%攻击力的基础伤害,冷却${1}回合。'];
export const qici = ['鳍刺', '攻击时有${0}%概率对目标造成流血,持续${1}回合。'];
export const bhxdjc = [
'百花羞的矜持',
'当生命值低于${0}%时,获得自身最大生命值${1}%的护盾(护盾能吸收等额伤害,但是每回合自然衰减10%),此效果每场战斗只能触发一次。',
'触发百花羞得矜持,获得${0}点护盾。',
];
export const fate = ['化缘', '副本掉落金币奖励提高${0}%。'];
export const vampire = ['汲血', '生命偷取${0}%。', '触发汲血,偷取${0}点生命'];
export const prototype = ['现原形', '将目标变为猴子,持续${0}回合,冷却${1}回合,对boss只有${2}%成功率。'];
@ -15,3 +21,5 @@ export const attack = ['普通攻击', '造成100%攻击力的基础伤害', '${ @@ -15,3 +21,5 @@ export const attack = ['普通攻击', '造成100%攻击力的基础伤害', '${
export const critFear = ['暴击恐惧', '暴击时附加${0}%攻击力的额外伤害。', '触发暴击恐惧,附加${0}点伤害'];
export const liulipan = ['琉璃盘', '使用后产生黑红内丹,临时提高${0}点基础攻击力进行攻击,冷却${1}回合。'];
export const JHSY = ['镜花水月', '受到伤害时有${0}%概率反弹${1}%所受伤害。', '${0}触发了镜花水月,反弹${1}点伤害'];
export const xianglong = ['降龙', '攻击时,若生命值低于${0}%,增加${1}%伤害加成。', '触发降龙,增加${1}%伤害加成。'];

23
src/config/skill/armor.ts

@ -0,0 +1,23 @@ @@ -0,0 +1,23 @@
import { CounterSkill, Attack, Control, GainsSkill, SufPassiveSkill, Vampire, PrePassiveSkill } from './base';
import i18n from '../i18n';
import { BattleRole, replace } from '@/tool';
const { t } = i18n;
export class BHXDJC extends PrePassiveSkill {
name: string = 'bhxdjc';
hpPercent: number = 60;
shieldPercentOfHp: number = 80;
triggered: boolean = false;
desc(): string {
return replace(t('skill.bhxdjc.1'), [this.hpPercent, this.shieldPercentOfHp]);
}
trigger(owner: BattleRole, target: BattleRole): boolean {
return !this.triggered && owner.attr.curHp / owner.attr.hp < this.hpPercent / 100;
}
takeEffect(owner: BattleRole, target: BattleRole): void {
this.triggered = true;
owner.shield = Math.ceil((owner.attr.hp * this.shieldPercentOfHp) / 100);
const log = replace(t('skill.bhxdjc.2'), [owner.shield]);
owner.battleLog(log);
}
}

30
src/config/skill/base.ts

@ -156,36 +156,18 @@ export class Attack extends ActionSkill { @@ -156,36 +156,18 @@ export class Attack extends ActionSkill {
order: number = 999;
name: string = 'attack';
cd: number = 1;
extraAtk = 0;
precent: number = 100;
desc(): string {
return t('skill.attack.1');
}
use(owner: BattleRole, target: BattleRole) {
if (owner.control > 0) {
const log = replace(t('skill.control.3'), [t(owner.type), owner.control]);
owner.extraAttr.baseAtk += (owner.attr.baseAtk * (this.precent - 100)) / 100;
owner.callDmg(target);
let critLog = owner.crit ? t('skill.crit.0') : '';
if (owner.dmg) {
target.addHp(-1 * owner.dmg);
const log = replace(t('skill.attack.2'), [t(owner.type), t('skill.' + this.name + '.0'), t(target.type), owner.dmg, critLog]);
owner.battleLog(log);
owner.control--;
return;
}
const attr = owner.attr;
const baseAtk = attr.baseAtk + this.extraAtk;
let dmg = ((baseAtk * (1 + attr.atkPercent / 100) * this.precent) / 100) * (1 + attr.dmgPercent / 100);
// const reducPercent = callReducPercent(target.attr.def);
const reducPercent = target.attr.reducPercent;
dmg = dmg * (1 - reducPercent) * (1 - target.attr.dmgReduc / 100) - target.attr.bloc;
owner.crit = Math.random() < (owner.attr.crit - target.attr.critAvoid) / 100;
let critLog = '';
if (owner.crit) {
let critDmg = owner.attr.critDmg - target.attr.critDmgReduc;
critDmg < 100 ? 100 : critDmg;
dmg *= critDmg / 100;
critLog = t('skill.crit.0');
}
dmg = dmg < 1 ? 1 : dmg;
owner.dmg = Math.ceil(dmg);
target.addHp(-1 * owner.dmg);
const log = replace(t('skill.attack.2'), [t(owner.type), t('skill.' + this.name + '.0'), t(target.type), owner.dmg, critLog]);
owner.battleLog(log);
}
}

24
src/config/skill/bracers.ts

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
import { CounterSkill, Attack, Control, GainsSkill, SufPassiveSkill, Vampire, PrePassiveSkill } from './base';
import i18n from '../i18n';
import { BattleRole, replace } from '@/tool';
const { t } = i18n;
export class Xianglong extends PrePassiveSkill {
name: string = 'xianglong';
hpPercent: number = 30;
dmgPercent: number = 100;
last: number = 1;
desc(): string {
return replace(t('skill.xianglong.1'), [this.hpPercent, this.dmgPercent]);
}
trigger(owner: BattleRole, target: BattleRole): boolean {
console.log(owner.attr.curHp / owner.attr.hp);
return owner.attr.curHp / owner.attr.hp < this.hpPercent / 100;
}
takeEffect(owner: BattleRole, target: BattleRole): void {
const extra = owner.extraAttr;
extra.dmgPercent = Math.ceil((100 + extra.dmgPercent) * (1 + this.dmgPercent / 100) - 100);
const log = replace(t('skill.xianglong.2'), [this.hpPercent, this.dmgPercent]);
owner.battleLog(log);
}
}

2
src/config/skill/index.ts

@ -1,3 +1,5 @@ @@ -1,3 +1,5 @@
export * from './base';
export * from './weapon';
export * from './jewelry';
export * from './bracers';
export * from './armor';

2
src/config/skill/jewelry.ts

@ -58,7 +58,7 @@ export class Liulipan extends Attack { @@ -58,7 +58,7 @@ export class Liulipan extends Attack {
return replace(t('skill.liulipan.1'), [(this.lv || 1) * this.atk, this.cd]);
}
beforeAtk(owner: BattleRole, target: BattleRole): void {
this.extraAtk = (this.lv || 1) * this.atk;
owner.extraAttr.baseAtk += (this.lv || 1) * this.atk;
super.beforeAtk(owner, target);
}
}

2
src/tool/caller/attribute.ts

@ -46,7 +46,7 @@ export const callPlayerAttribute = (player: Player, rA: any) => { @@ -46,7 +46,7 @@ export const callPlayerAttribute = (player: Player, rA: any) => {
});
//计算秒伤
const atk = attribute.atk,
crit = attribute.crit / 100,
crit = (attribute.crit > 100 ? 100 : attribute.crit) / 100,
critdmg = attribute.critDmg / 100,
dmgPercent = attribute.dmgPercent / 100;
attribute.dps = Math.ceil((1 - crit + crit * critdmg) * atk * (1 + dmgPercent));

55
src/tool/caller/battle.ts

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
import { Equip, Skills, Monster, Attribute, Player } from '@/config';
import { randonBootyEquip, deepCopy } from '@/tool';
import { randonBootyEquip, deepCopy, replace, callReducPercent } from '@/tool';
import i18n from '@/config/i18n';
const { t } = i18n;
@ -14,14 +14,27 @@ export class BattleRole { @@ -14,14 +14,27 @@ export class BattleRole {
action: Skills.ActionSkill | null = null;
dmg: number = 0;
crit: boolean = false;
extraAttr: Attribute = new Attribute();
shield: number = 0;
constructor(attr: Attribute, commit, type: string) {
this.attr = attr;
this.commit = commit;
this.type = type;
this.addSkill(attr.skill); //添加默认主动技能普通攻击
this.initTmp();
}
initTmp = () => {
this.action = null;
this.dmg = 0;
this.crit = false;
this.extraAttr = new Attribute();
this.extraAttr.hp = 0;
this.extraAttr.critDmg = 0;
this.shield = Math.ceil(this.shield * 0.9);
};
addSkill = (skillName, lv?) => {
lv = lv || 1;
const skills = createSkill(skillName, lv);
@ -63,9 +76,7 @@ export class BattleRole { @@ -63,9 +76,7 @@ export class BattleRole {
//触发攻击目标的反制技能
target.onAttacked(this);
//初始化临时状态
this.action = null;
this.dmg = 0;
this.crit = false;
this.initTmp();
};
onAttacked = (target: BattleRole) => {
@ -80,6 +91,15 @@ export class BattleRole { @@ -80,6 +91,15 @@ export class BattleRole {
};
addHp = (hp: number) => {
if (hp < 0 && this.shield > 0) {
if (this.shield > -1 * hp) {
this.shield += hp;
return;
} else {
hp += this.shield;
this.shield = 0;
}
}
if (this.type == 'player') {
this.commit('add_player_curhp', hp);
} else {
@ -100,11 +120,36 @@ export class BattleRole { @@ -100,11 +120,36 @@ export class BattleRole {
isDeath = () => {
return this.attr.curHp <= 0;
};
callDmg = (target: BattleRole) => {
if (this.control > 0) {
const log = replace(t('skill.control.3'), [t(this.type), this.control]);
this.battleLog(log);
this.control--;
return;
}
const attr = this.attr;
const extra = this.extraAttr;
const baseAtk = attr.baseAtk + extra.baseAtk;
const atkPercent = 1 + (attr.atkPercent + extra.atkPercent) / 100;
const dmgPercent = (1 + attr.dmgPercent / 100) * (1 + extra.dmgPercent / 100);
let dmg = baseAtk * atkPercent * dmgPercent;
const reducPercent = callReducPercent(target.attr.def + target.extraAttr.def);
dmg = dmg * (1 - reducPercent) * (1 - target.attr.dmgReduc / 100) - target.attr.bloc;
this.crit = Math.random() < (attr.crit - target.attr.critAvoid) / 100;
if (this.crit) {
let critDmg = attr.critDmg - target.attr.critDmgReduc;
critDmg < 100 ? 100 : critDmg;
dmg *= critDmg / 100;
}
dmg = dmg <= 0 ? 1 : dmg;
this.dmg = Math.ceil(dmg);
};
}
export const createBattleRole = (player: Player, monster: Monster, commit) => {
const playerRole = new BattleRole(player.attribute, commit, 'player');
const palyerEquips = [player.weapon, player.armor, player.neck, player.ring, player.jewelry];
const palyerEquips = [player.weapon, player.armor, player.neck, player.ring, player.jewelry, player.pants, player.shoes, player.bracers];
palyerEquips.forEach((equip) => {
equip && playerRole.addSkill(equip.base.skill);
});

6
src/views/backpack/auto-sell.vue

@ -13,12 +13,14 @@ @@ -13,12 +13,14 @@
<label :for="qualitys[0]">{{ t('quality.' + qualitys[0]) }}</label>
<input type="checkbox" v-model="autoSell" :value="qualitys[1]" :id="qualitys[1]">
<label :for="qualitys[1]">{{ t('quality.' + qualitys[1]) }}</label>
</div>
<div>
<input type="checkbox" v-model="autoSell" :value="qualitys[2]" :id="qualitys[2]">
<label :for="qualitys[2]">{{ t('quality.' + qualitys[2]) }}</label>
</div>
<div>
<input type="checkbox" v-model="autoSell" :value="qualitys[3]" :id="qualitys[3]">
<label :for="qualitys[3]">{{ t('quality.' + qualitys[3]) }}</label>
<input type="checkbox" v-model="autoSell" :value="qualitys[4]" :id="qualitys[4]">
<label :for="qualitys[4]">{{ t('quality.' + qualitys[4]) }}</label>
</div>
</div>
</span>

35
src/views/dungeon/battle.vue

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
<script lang="ts" setup>
import { useStore } from "vuex";
import { computed, nextTick, onMounted, ref } from "vue";
import { computed, nextTick, onMounted, ref, watch } from "vue";
import { useI18n } from "vue3-i18n";
import { dungeon_icon, player_move_time, player_battle_time, difficultys } from "@/config";
import { createBattleRole, BattleRole, replace } from "@/tool";
@ -73,17 +73,19 @@ const exploreDungeon = (monsterIdx) => { @@ -73,17 +73,19 @@ const exploreDungeon = (monsterIdx) => {
commit('set_player_lv', dungeon.lv)
commit('set_sys_info', { msg: t('upgrade'), type: 'win' })
}
if (dungeon.difficulty == difficultys[1] || dungeon.difficulty == 2) {
if (dungeon.difficulty == difficultys[1] || dungeon.difficulty == difficultys[2]) {
dungeon.setDifficulty(difficultys[0]);
battle.value.battleShow = false;
dispatch('play_music', 'backgound');
return;
} else if (dungeon.difficulty == difficultys[4]) {
//
commit('set_player_layer', dungeon.layer);
commit('add_player_curhp', state.playerAttribute.attribute.hp);
}
if (state.battle.repeat) {
if (dungeon.difficulty == difficultys[4] && state.battle.upward) {
dungeon.setDifficulty(dungeon.difficulty, layer.value + 1);
dungeon.setLayer(layer.value + 1);
}
playerMove(0, 0);
} else {
@ -113,7 +115,10 @@ const playerMove = (monsterIdx?, playerIdx?) => { @@ -113,7 +115,10 @@ const playerMove = (monsterIdx?, playerIdx?) => {
}, moveTime);
}
}
const battlePlayer = ref<BattleRole>();
watch(() => state.playerAttribute.attribute, (n) => {
battlePlayer.value && (battlePlayer.value.attr = n);
})
const battleWithMonster = (monster) => {
return new Promise((resolve, reject) => {
const battleTime = Math.ceil(player_battle_time * 100 / (100 + state.rebornAttribute.battleSpeed))
@ -123,15 +128,13 @@ const battleWithMonster = (monster) => { @@ -123,15 +128,13 @@ const battleWithMonster = (monster) => {
commit("set_sys_info", { msg: getMsg('battle', 0, 0), type: 'battle' });
const roles = createBattleRole(state.playerAttribute, monster, commit);
const player: BattleRole = roles.player;
battlePlayer.value = player;
const monster1: BattleRole = roles.monster;
player.onStartBattle(monster1);
monster1.onStartBattle(player);
oneBout(player, monster1, battleTime).then(rsp => {
if (player.isDeath()) {
commit("set_sys_info", { msg: t('bout.1'), type: 'warning' });
if (props.dungeon?.difficulty == difficultys[4] && state.battle.upward) {
props.dungeon?.setDifficulty(props.dungeon?.difficulty, layer.value);
}
battle.value.battleShow = false;
dispatch('play_music', 'backgound');
} else {
@ -141,24 +144,6 @@ const battleWithMonster = (monster) => { @@ -141,24 +144,6 @@ const battleWithMonster = (monster) => {
resolve(true);
}
})
// battle.value.timeOut = setTimeout(() => {
// const result: BattleResult = callBattleResult(player, monster, commit);
// nextTick(() => {
// commit('add_player_curhp', -1 * result.takeDmg);
// })
// if (result.win) {
// commit("set_sys_info", { msg: getMsg('killMonster', result.takeDmg, result.sneak), type: 'battle', bouts: result.bouts });
// //
// commit('add_bootys', { equips: result.equips, coins: result.coins });
// resolve(true);
// } else {
// commit("set_sys_info", { msg: getMsg('beKilled', result.takeDmg, result.sneak), type: 'warning', bouts: result.bouts });
// battle.value.battleShow = false;
// dispatch('play_music', 'backgound');
// }
// }, battleTime);
});
}

10
src/views/dungeon/dungeonMap.vue

@ -98,13 +98,17 @@ const refreshSecret = () => { @@ -98,13 +98,17 @@ const refreshSecret = () => {
xiaomi.value.right = '4%';
xiaomi.value.top = '43%';
dami.value = new Dungeon(100, 'dami', layer.value);
// dami.value = new Dungeon(100, 'dami', 100);
dami.value.right = '9%';
dami.value.top = '29%';
}
}
watch(layer, () => {
dami.value?.setDifficulty(dami.value.difficulty, layer.value);
watch(layer.value, (n) => {
dami.value?.setLayer(n);
})
watch(() => state.battle.battleShow, (n) => {
if (!n) {
dami.value?.setLayer(layer.value);
}
})
const setStype = () => {

1
src/views/illustrated/illustrated.vue

@ -67,6 +67,7 @@ const tabs = [ @@ -67,6 +67,7 @@ const tabs = [
{ label: t('jewelry.type'), name: 'jewelry' },
{ label: t('pants.type'), name: 'pants' },
{ label: t('shoes.type'), name: 'shoes' },
{ label: t('bracers.type'), name: 'bracers' },
]
const showMenu = () => {

Loading…
Cancel
Save