Browse Source

新增图标和多彩装备

1.新增戒指和项链图标
2.新增多彩装备:奎英的百褶裙、金刚琢、断·极
3.调整主动攻击技能伤害说明
4.调整伤害公式
v1.0
许孟阳 2 weeks ago
parent
commit
3be7277251
  1. BIN
      public/img/equips/neck/众生醉.png
  2. BIN
      public/img/equips/neck/佛灯油.png
  3. BIN
      public/img/equips/neck/冷龙.png
  4. BIN
      public/img/equips/neck/十八念佛珠.png
  5. BIN
      public/img/equips/neck/太乙神器 五行圭.png
  6. BIN
      public/img/equips/neck/女王蜂链.png
  7. BIN
      public/img/equips/neck/姜氏哀歌.png
  8. BIN
      public/img/equips/neck/断·极.png
  9. BIN
      public/img/equips/neck/最初的彼岸花.png
  10. BIN
      public/img/equips/neck/狸猫内丹.png
  11. BIN
      public/img/equips/neck/琉璃碎片.png
  12. BIN
      public/img/equips/neck/虎视.png
  13. BIN
      public/img/equips/neck/血怒.png
  14. BIN
      public/img/equips/neck/赤瞳金玉坠.png
  15. BIN
      public/img/equips/neck/鬼眼.png
  16. BIN
      public/img/equips/neck/龙腾护心镜.png
  17. BIN
      public/img/equips/ring/冰粼暮光.png
  18. BIN
      public/img/equips/ring/刺客.png
  19. BIN
      public/img/equips/ring/四眼.png
  20. BIN
      public/img/equips/ring/垂涎.png
  21. BIN
      public/img/equips/ring/太阳真火戒.png
  22. BIN
      public/img/equips/ring/太阴紫电戒.png
  23. BIN
      public/img/equips/ring/妖族之力.png
  24. BIN
      public/img/equips/ring/愣伽指环.png
  25. BIN
      public/img/equips/ring/无名戒.png
  26. BIN
      public/img/equips/ring/旱魃.png
  27. BIN
      public/img/equips/ring/望月.png
  28. BIN
      public/img/equips/ring/满堂红.png
  29. BIN
      public/img/equips/ring/破戒.png
  30. BIN
      public/img/equips/ring/移山.png
  31. BIN
      public/img/equips/ring/金刚琢.png
  32. BIN
      public/img/equips/ring/金戒指.png
  33. BIN
      public/img/equips/ring/陆吾之目.png
  34. BIN
      public/img/equips/ring/鬼缠.png
  35. BIN
      public/img/equips/ring/鬼骨戒.png
  36. BIN
      public/img/equips/ring/黄泉之尘.png
  37. 13
      src/config/equips/neck.ts
  38. 13
      src/config/equips/pants.ts
  39. 14
      src/config/equips/ring.ts
  40. 38
      src/config/i18n/zh/euips.ts
  41. 15
      src/config/i18n/zh/skills.ts
  42. 2
      src/config/skill/base.ts
  43. 4
      src/config/skill/index.ts
  44. 22
      src/config/skill/neck.ts
  45. 22
      src/config/skill/pant.ts
  46. 39
      src/config/skill/ring.ts
  47. 2
      src/config/skill/weapon.ts
  48. 12
      src/tool/caller/attribute.ts
  49. 37
      src/tool/caller/battle.ts

BIN
public/img/equips/neck/众生醉.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
public/img/equips/neck/佛灯油.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
public/img/equips/neck/冷龙.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
public/img/equips/neck/十八念佛珠.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
public/img/equips/neck/太乙神器 五行圭.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
public/img/equips/neck/女王蜂链.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
public/img/equips/neck/姜氏哀歌.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
public/img/equips/neck/断·极.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
public/img/equips/neck/最初的彼岸花.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
public/img/equips/neck/狸猫内丹.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
public/img/equips/neck/琉璃碎片.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
public/img/equips/neck/虎视.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
public/img/equips/neck/血怒.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
public/img/equips/neck/赤瞳金玉坠.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
public/img/equips/neck/鬼眼.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
public/img/equips/neck/龙腾护心镜.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
public/img/equips/ring/冰粼暮光.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
public/img/equips/ring/刺客.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
public/img/equips/ring/四眼.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
public/img/equips/ring/垂涎.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
public/img/equips/ring/太阳真火戒.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
public/img/equips/ring/太阴紫电戒.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
public/img/equips/ring/妖族之力.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
public/img/equips/ring/愣伽指环.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
public/img/equips/ring/无名戒.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
public/img/equips/ring/旱魃.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
public/img/equips/ring/望月.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
public/img/equips/ring/满堂红.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
public/img/equips/ring/破戒.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
public/img/equips/ring/移山.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
public/img/equips/ring/金刚琢.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
public/img/equips/ring/金戒指.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
public/img/equips/ring/陆吾之目.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
public/img/equips/ring/鬼缠.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
public/img/equips/ring/鬼骨戒.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
public/img/equips/ring/黄泉之尘.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

13
src/config/equips/neck.ts

@ -6,7 +6,18 @@ const extraEntrys = ['atk', 'crit', 'critDmg', 'hp', 'def', 'bloc']; @@ -6,7 +6,18 @@ const extraEntrys = ['atk', 'crit', 'critDmg', 'hp', 'def', 'bloc'];
const coefficient = { shabby: 0.6, ordinary: 0.9, artifact: 1.3, epic: 1.6, unique: 1.8, colorful: 1.8 };
export const neckColorfulCategorys: Categorys[] = [];
export const neckColorfulCategorys: Categorys[] = [
new Categorys(
'duanji',
'neck/断·极.png',
[
{ type: 'bloc', valCoefficient: 1.3 },
{ type: 'def', valCoefficient: 0.8 },
{ type: 'hp', valCoefficient: 0.9 },
],
'Duan'
),
];
export const neckUniqueCategorys: Categorys[] = [
new Categorys('demonSlayer', 'U_neck01.png', [

13
src/config/equips/pants.ts

@ -4,7 +4,18 @@ import { qualitys, extra_entry_num } from './constant'; @@ -4,7 +4,18 @@ import { qualitys, 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 pantsColorfulCategorys: Categorys[] = [];
export const pantsColorfulCategorys: Categorys[] = [
new Categorys(
'baizhequn',
'pants/奎英的百褶裙.png',
[
{ type: 'def', valCoefficient: 1.2 },
{ type: 'bloc', valCoefficient: 1.5 },
{ type: 'hp', valCoefficient: 1.4 },
],
'SLWX,JinGangZhuo'
),
];
export const pantsUniqueCategorys: Categorys[] = [
new Categorys('mhlg', 'pants/梦回龙宫.png', [

14
src/config/equips/ring.ts

@ -6,7 +6,19 @@ const extraEntrys = ['atk', 'crit', 'critDmg', 'hp', 'def']; @@ -6,7 +6,19 @@ const extraEntrys = ['atk', 'crit', 'critDmg', 'hp', 'def'];
const coefficient = { shabby: 0.6, ordinary: 0.9, artifact: 1.3, epic: 1.6, unique: 1.8, colorful: 2 };
export const ringColorfulCategorys: Categorys[] = [];
export const ringColorfulCategorys: Categorys[] = [
new Categorys(
'jingangzhuo',
'ring/金刚琢.png',
[
{ type: 'atk', valCoefficient: 2.4 },
{ type: 'def', valCoefficient: 0.5 },
{ type: 'hp', valCoefficient: 0.9 },
],
'SLWX,JinGangZhuo',
0.9
),
];
export const ringUniqueCategorys: Categorys[] = [
new Categorys('death', 'U_ring01.png', [

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

@ -84,6 +84,23 @@ export const armor = { @@ -84,6 +84,23 @@ export const armor = {
};
export const neck = {
type: '项链',
chitong: ['赤瞳金玉坠', '传闻为仙族神器。佩戴者回洞悉敌人的弱点。'],
duanji: ['断·极', '若众生都断了情欲,那世间岂不是一色苍凉。'],
fodengyou: ['佛灯油', '听说灵山永寂,灯影不摇,我若去了,便叫它风起云动。 ----黄风大圣'],
guiyan: ['鬼眼', '多少楼台平山演,鬼使飞阁绿林空。'],
hushi: ['虎视', '我看见了你,偷丹贼。 ----三仙的丹房'],
aige: ['姜氏哀歌', '这悲伤的歌声浸透了这条项链,你听。'],
limao: ['狸猫内丹', '影中之影,幻中之幻。'],
longteng: ['龙腾护心镜', '腾龙即出,四海来朝。'],
lenglong: ['冷龙', '避暑圣物。'],
liuli: ['琉璃碎片', '有人在人间寻找了它整整五百年。'],
nvwangfeng: ['女王蜂项链', '以毒攻毒,百毒不侵。'],
fouzhu: ['十八念佛珠', '别人念佛是为了求如来保佑,如来念佛又是为了什么。'],
wuxinggui: ['太乙神器 五行圭', '太乙出品,必属精品。'],
xuenu: ['血怒', '我们都曾把愤怒埋藏在鲜血里。'],
zhongsheng: ['众生醉', '美酒斟杯莫思量,烦丝一甩九霄扬。'],
bianhua: ['最初的彼岸花', '三千年生叶,叶落始开花。三千年开花,花谢始叶生。'],
demonSlayer: ['十字旅团降魔项链', '十字旅团降魔项链'],
darkDragon: ['进阶黑暗龙王项链', '进阶黑暗龙王项链'],
single: ['单身贵族项链', '真棒,真帅。有了这条帅气的项链,一辈子单身都不会孤独'],
@ -96,6 +113,27 @@ export const neck = { @@ -96,6 +113,27 @@ export const neck = {
};
export const ring = {
type: '戒指',
jingangzhuo: ['金刚琢', '无敌。'],
yaozuzhili: ['妖族之力', '妖王的荣耀。'],
mantanghong: ['满堂红', '青灯知有喜,花发满堂红。'],
pojie: ['破戒', '我心中爱你美丽,怎能嘴上装四大皆空。 ----金蝉子'],
siyan: ['四眼', '我花了十万年才长出一只眼睛。'],
taiyang: ['太阳真火戒', '这里面有太阳的光辉。'],
taiyin: ['太阴紫电戒', '这里面有月亮的锋芒。'],
huangquan: ['黄泉之尘', '这尘埃上有一个黄泉的国度。'],
hanba: ['旱魃', '国师与旱魃斗法七日,始有甘霖降车迟国。'],
lengqie: ['楞伽指环', '楞伽,此云难入。'],
luwuzhimu: ['陆吾之目', '似乎随时会睁开。'],
yishan: ['移山', '山神很忙。'],
binglin: ['冰粼暮光', '灭却心头火,剔起佛前灯。'],
chuixian: ['垂涎', '最好不要吵醒一只冬眠的熊。 ----黑风大王的冬眠居'],
cike: ['刺客', '最强的刺客总是无名。'],
guichan: ['鬼缠', '小鬼难缠。'],
guigu: ['鬼骨戒', '世道酆都阴城险,我觉弹指一笑间。'],
jinjiezhi: ['金戒指', '这下你应该满意了吧!'],
wangyue: ['望月', '犀牛望月,其影于角。燃其犀角,可见冥界诸灵。'],
wumingjie: ['无名戒', '某个在孽镜台被吃掉的倒霉鬼的遗物。'],
death: ['死神名片戒指', '死神名片戒指'],
realFurryRing: ['真·毛毛指环', '死神名片戒指'],
pioneer: ['先驱者戒指', '先驱者戒指'],

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

@ -5,7 +5,7 @@ export const control = ['${0}使用了${1},', '${0}被控制${1}回合', '控制 @@ -5,7 +5,7 @@ export const control = ['${0}使用了${1},', '${0}被控制${1}回合', '控制
export const crit = ['触发了暴击'];
export const iceBlade = ['冰刃', '暴击时有${0}几率释放冰线冲击,附加${1}%攻击力的伤害和${2}回合冰冻效果。', '触发了冰刃,附加${0}点伤害,冰冻${1}${2}回合'];
export const seeRed = ['见红', '造成${0}%攻击力的基础伤害,冷却${1}回合。'];
export const seeRed = ['见红', '攻击倍率${0}%,冷却${1}回合。'];
export const qici = ['鳍刺', '攻击时有${0}%概率对目标造成流血,持续${1}回合。'];
export const bhxdjc = [
@ -14,12 +14,23 @@ export const bhxdjc = [ @@ -14,12 +14,23 @@ export const bhxdjc = [
'触发百花羞得矜持,获得${0}点护盾。',
];
export const duan = ['断', '伤害目标后,若目标血量低于${0}%,则直接处决目标。', '目标血量低于${0}%,触发【断】,造成${1}点伤害'];
export const SLWX = ['森罗万象', '增加${0}%攻击加成、伤害加成、暴击率、暴击伤害。'];
export const jinggangzhuo = ['金刚琢', '攻击时有${0}%几率使目标进入缴械状态${1}回合。', '触发金刚镯,目标缴械${0}回合'];
export const fate = ['化缘', '副本掉落金币奖励提高${0}%。'];
export const vampire = ['汲血', '生命偷取${0}%。', '触发汲血,偷取${0}点生命'];
export const prototype = ['现原形', '将目标变为猴子,持续${0}回合,冷却${1}回合,对boss只有${2}%成功率。'];
export const attack = ['普通攻击', '造成100%攻击力的基础伤害', '${0}使用了${1}${4},对${2}造成了${3}点伤害'];
export const attack = ['普通攻击', '攻击倍率100%', '${0}使用了${1}${4},对${2}造成了${3}点伤害'];
export const critFear = ['暴击恐惧', '暴击时附加${0}%攻击力的额外伤害。', '触发暴击恐惧,附加${0}点伤害'];
export const liulipan = ['琉璃盘', '使用后产生黑红内丹,临时提高${0}点基础攻击力进行攻击,冷却${1}回合。'];
export const JHSY = ['镜花水月', '受到伤害时有${0}%概率反弹${1}%所受伤害。', '${0}触发了镜花水月,反弹${1}点伤害'];
export const xianglong = ['降龙', '攻击时,若生命值低于${0}%,增加${1}%伤害加成。', '触发降龙,增加${1}%伤害加成。'];
export const furenpihu = [
'白骨夫人的庇护',
'血量低于${0}%时,获得白骨夫人的庇护,获得${1}%伤害减免,持续${2}回合,此效果每场战斗只能触发一次。',
'血量低于${0}%,触发白骨夫人的庇护,获得${1}%伤害减免',
];

2
src/config/skill/base.ts

@ -161,7 +161,7 @@ export class Attack extends ActionSkill { @@ -161,7 +161,7 @@ export class Attack extends ActionSkill {
return t('skill.attack.1');
}
use(owner: BattleRole, target: BattleRole) {
owner.extraAttr.baseAtk += (owner.attr.baseAtk * (this.precent - 100)) / 100;
owner.skillPercent = this.precent;
owner.callDmg(target);
let critLog = owner.crit ? t('skill.crit.0') : '';
if (owner.dmg) {

4
src/config/skill/index.ts

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

22
src/config/skill/neck.ts

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
import { SufPassiveSkill, PrePassiveSkill } from './base';
import i18n from '../i18n';
import { BattleRole, replace } from '@/tool';
const { t } = i18n;
export class Duan extends SufPassiveSkill {
name: string = 'duan';
rate: number = 10;
order: number = 999;
dmg: number = 999999999;
desc(): string {
return replace(t('skill.duan.1'), [this.rate]);
}
trigger(owner: BattleRole, target: BattleRole): boolean {
return target.attr.curHp / target.attr.hp < this.rate / 100;
}
takeEffect(owner: BattleRole, target: BattleRole): void {
target.addHp(-1 * this.dmg);
const log = replace(t('skill.duan.2'), [this.rate, this.dmg]);
owner.battleLog(log);
}
}

22
src/config/skill/pant.ts

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
import { SufPassiveSkill, PrePassiveSkill } from './base';
import i18n from '../i18n';
import { BattleRole, replace } from '@/tool';
const { t } = i18n;
export class FuRenPiHu extends SufPassiveSkill {
name: string = 'furenpihu';
hpPercent: number = 30;
last: number = 3;
dmgReduc: number = 100;
desc(): string {
return replace(t('skill.furenpihu.1'), [this.hpPercent, this.dmgReduc, this.last]);
}
trigger(owner: BattleRole, target: BattleRole): boolean {
return owner.attr.curHp / owner.attr.hp < this.hpPercent / 100;
}
takeEffect(owner: BattleRole, target: BattleRole): void {
owner.extraAttr.dmgReduc = this.dmgReduc;
const log = replace(t('skill.furenpihu.2'), [this.hpPercent, this.dmgReduc]);
owner.battleLog(log);
}
}

39
src/config/skill/ring.ts

@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
import { SufPassiveSkill, PrePassiveSkill } from './base';
import i18n from '../i18n';
import { BattleRole, replace } from '@/tool';
const { t } = i18n;
export class SLWX extends PrePassiveSkill {
name: string = 'SLWX';
percent: number = 20;
desc(): string {
return replace(t('skill.SLWX.1'), [this.percent]);
}
trigger(owner: BattleRole, target: BattleRole): boolean {
return true;
}
takeEffect(owner: BattleRole, target: BattleRole): void {
const extra = owner.extraAttr;
extra.atkPercent += this.percent;
extra.dmgPercent = (100 + extra.dmgPercent) * (1 + this.percent / 100) - 100;
extra.crit += 20;
extra.critDmg += 20;
}
}
export class JinGangZhuo extends SufPassiveSkill {
name: string = 'jinggangzhuo';
rate: number = 5;
last: number = 2;
desc(): string {
return replace(t('skill.jinggangzhuo.1'), [this.rate, this.last]);
}
trigger(owner: BattleRole, target: BattleRole): boolean {
return Math.random() < this.rate / 100;
}
takeEffect(owner: BattleRole, target: BattleRole): void {
target.control = target.control > this.last ? target.control : this.last;
const log = replace(t('skill.jinggangzhuo.2'), [this.last]);
owner.battleLog(log);
}
}

2
src/config/skill/weapon.ts

@ -25,7 +25,7 @@ export class IceBlade extends SufPassiveSkill { @@ -25,7 +25,7 @@ export class IceBlade extends SufPassiveSkill {
}
export class SeeRed extends Attack {
order: number = 100;
order: number = 99;
name: string = 'seeRed';
cd: number = 4;
precent: number = 200;

12
src/tool/caller/attribute.ts

@ -24,16 +24,11 @@ export const callPlayerAttribute = (player: Player, rA: any) => { @@ -24,16 +24,11 @@ export const callPlayerAttribute = (player: Player, rA: any) => {
if (key == 'dmgPercent') {
attribute[key] = Math.round((attribute[key] + 100) * (item.value / 100 + 1) - 100);
} else if (key == 'dmgReduc') {
attribute[key] = Math.round(100 - (1 - attribute[key] / 100) * (1 - item.value / 100) * 100);
attribute[key] = Math.floor(100 - (1 - attribute[key] / 100) * (1 - item.value / 100) * 100);
} else {
attribute[key] += item.value;
}
});
// 暴击率最多100%
// if (attribute.crit > 100) {
// attribute.crit = 100;
// }
//计算最终属性
attribute.hp = Math.ceil(attribute.hp * (1 + attribute.hpPercent / 100));
attribute.curHp = Math.ceil(attribute.hp * hpP);
attribute.baseAtk = attribute.atk;
@ -46,18 +41,17 @@ export const callPlayerAttribute = (player: Player, rA: any) => { @@ -46,18 +41,17 @@ export const callPlayerAttribute = (player: Player, rA: any) => {
});
//计算秒伤
const atk = attribute.atk,
crit = (attribute.crit > 100 ? 100 : attribute.crit) / 100,
crit = (attribute.crit > 100 ? 100 : attribute.crit) / 100, // 暴击率最多100%
critdmg = attribute.critDmg / 100,
dmgPercent = attribute.dmgPercent / 100;
attribute.dps = Math.ceil((1 - crit + crit * critdmg) * atk * (1 + dmgPercent));
//计算减伤比例
attribute.reducPercent = callReducPercent(attribute.def);
// attribute.reducPercent = attribute.def / (200 + 1.1 * attribute.def) + (0.09 * attribute.def) / (attribute.def + 200);
// attribute.reducPercent = (0.5 * attribute.def) / (200 + 0.502 * attribute.def);
player.attribute = attribute;
};
export const callReducPercent = (def) => {
// return def / (200 + 1.1 * def) + (0.09 * def) / (def + 200);
return def / (200 + 1.05263 * def);
};

37
src/tool/caller/battle.ts

@ -16,6 +16,7 @@ export class BattleRole { @@ -16,6 +16,7 @@ export class BattleRole {
crit: boolean = false;
extraAttr: Attribute = new Attribute();
shield: number = 0;
skillPercent: number = 100;
constructor(attr: Attribute, commit, type: string) {
this.attr = attr;
@ -33,6 +34,7 @@ export class BattleRole { @@ -33,6 +34,7 @@ export class BattleRole {
this.extraAttr.hp = 0;
this.extraAttr.critDmg = 0;
this.shield = Math.ceil(this.shield * 0.9);
this.skillPercent = 100;
};
addSkill = (skillName, lv?) => {
@ -53,6 +55,9 @@ export class BattleRole { @@ -53,6 +55,9 @@ export class BattleRole {
this.actions.sort((a, b) => {
return (a.order = b.order);
});
this.actions.sort((a, b) => {
return (a.order = b.order);
});
//战斗开始前触发的技能
this.passives.forEach((skill) => {
skill.beforeBattle(this, target);
@ -121,7 +126,14 @@ export class BattleRole { @@ -121,7 +126,14 @@ export class BattleRole {
return this.attr.curHp <= 0;
};
/**
*
* @param skillPercent
* @param target
* @returns
*/
callDmg = (target: BattleRole) => {
//被控制时无法攻击
if (this.control > 0) {
const log = replace(t('skill.control.3'), [t(this.type), this.control]);
this.battleLog(log);
@ -130,19 +142,22 @@ export class BattleRole { @@ -130,19 +142,22 @@ export class BattleRole {
}
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;
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 * (this.skillPercent / 100); //造成伤害
const reducPercent = callReducPercent(target.attr.def + target.extraAttr.def); //目标防御提供的伤害减免
const takeDmgPercent = (1 - reducPercent) * (1 - target.attr.dmgReduc / 100) * (1 - target.extraAttr.dmgReduc / 100); //目标承受伤害比例
const bloc = target.attr.bloc + target.extraAttr.bloc; //目标格挡值
dmg = dmg * takeDmgPercent - bloc; //目标承受伤害
const crit = attr.crit + extra.crit - target.attr.critAvoid - target.extraAttr.critAvoid; //最终暴击率
this.crit = Math.random() < crit / 100;
if (this.crit) {
let critDmg = attr.critDmg - target.attr.critDmgReduc;
critDmg < 100 ? 100 : critDmg;
dmg *= critDmg / 100;
let critDmg = attr.critDmg + extra.critDmg - target.attr.critDmgReduc - target.extraAttr.critDmg; //目标最终承受暴击伤害
critDmg < 100 ? 100 : critDmg; //暴击伤害不低于100%
dmg *= critDmg / 100; //暴击时目标承受伤害
}
dmg = dmg <= 0 ? 1 : dmg;
dmg = dmg <= 0 ? 1 : dmg; //最低造成1点伤害
this.dmg = Math.ceil(dmg);
};
}

Loading…
Cancel
Save