diff --git a/public/img/equips/neck/众生醉.png b/public/img/equips/neck/众生醉.png new file mode 100644 index 0000000..06fc2ce Binary files /dev/null and b/public/img/equips/neck/众生醉.png differ diff --git a/public/img/equips/neck/佛灯油.png b/public/img/equips/neck/佛灯油.png new file mode 100644 index 0000000..15c4fd2 Binary files /dev/null and b/public/img/equips/neck/佛灯油.png differ diff --git a/public/img/equips/neck/冷龙.png b/public/img/equips/neck/冷龙.png new file mode 100644 index 0000000..c520b2f Binary files /dev/null and b/public/img/equips/neck/冷龙.png differ diff --git a/public/img/equips/neck/十八念佛珠.png b/public/img/equips/neck/十八念佛珠.png new file mode 100644 index 0000000..2dfd89f Binary files /dev/null and b/public/img/equips/neck/十八念佛珠.png differ diff --git a/public/img/equips/neck/太乙神器 五行圭.png b/public/img/equips/neck/太乙神器 五行圭.png new file mode 100644 index 0000000..0787824 Binary files /dev/null and b/public/img/equips/neck/太乙神器 五行圭.png differ diff --git a/public/img/equips/neck/女王蜂链.png b/public/img/equips/neck/女王蜂链.png new file mode 100644 index 0000000..6675061 Binary files /dev/null and b/public/img/equips/neck/女王蜂链.png differ diff --git a/public/img/equips/neck/姜氏哀歌.png b/public/img/equips/neck/姜氏哀歌.png new file mode 100644 index 0000000..508426e Binary files /dev/null and b/public/img/equips/neck/姜氏哀歌.png differ diff --git a/public/img/equips/neck/断·极.png b/public/img/equips/neck/断·极.png new file mode 100644 index 0000000..5abe63d Binary files /dev/null and b/public/img/equips/neck/断·极.png differ diff --git a/public/img/equips/neck/最初的彼岸花.png b/public/img/equips/neck/最初的彼岸花.png new file mode 100644 index 0000000..b85fee9 Binary files /dev/null and b/public/img/equips/neck/最初的彼岸花.png differ diff --git a/public/img/equips/neck/狸猫内丹.png b/public/img/equips/neck/狸猫内丹.png new file mode 100644 index 0000000..9c0247a Binary files /dev/null and b/public/img/equips/neck/狸猫内丹.png differ diff --git a/public/img/equips/neck/琉璃碎片.png b/public/img/equips/neck/琉璃碎片.png new file mode 100644 index 0000000..2391b8a Binary files /dev/null and b/public/img/equips/neck/琉璃碎片.png differ diff --git a/public/img/equips/neck/虎视.png b/public/img/equips/neck/虎视.png new file mode 100644 index 0000000..5c2f084 Binary files /dev/null and b/public/img/equips/neck/虎视.png differ diff --git a/public/img/equips/neck/血怒.png b/public/img/equips/neck/血怒.png new file mode 100644 index 0000000..f636485 Binary files /dev/null and b/public/img/equips/neck/血怒.png differ diff --git a/public/img/equips/neck/赤瞳金玉坠.png b/public/img/equips/neck/赤瞳金玉坠.png new file mode 100644 index 0000000..a06057d Binary files /dev/null and b/public/img/equips/neck/赤瞳金玉坠.png differ diff --git a/public/img/equips/neck/鬼眼.png b/public/img/equips/neck/鬼眼.png new file mode 100644 index 0000000..f0f87fd Binary files /dev/null and b/public/img/equips/neck/鬼眼.png differ diff --git a/public/img/equips/neck/龙腾护心镜.png b/public/img/equips/neck/龙腾护心镜.png new file mode 100644 index 0000000..be25379 Binary files /dev/null and b/public/img/equips/neck/龙腾护心镜.png differ diff --git a/public/img/equips/ring/冰粼暮光.png b/public/img/equips/ring/冰粼暮光.png new file mode 100644 index 0000000..a9ccf99 Binary files /dev/null and b/public/img/equips/ring/冰粼暮光.png differ diff --git a/public/img/equips/ring/刺客.png b/public/img/equips/ring/刺客.png new file mode 100644 index 0000000..536c6eb Binary files /dev/null and b/public/img/equips/ring/刺客.png differ diff --git a/public/img/equips/ring/四眼.png b/public/img/equips/ring/四眼.png new file mode 100644 index 0000000..d0f7d82 Binary files /dev/null and b/public/img/equips/ring/四眼.png differ diff --git a/public/img/equips/ring/垂涎.png b/public/img/equips/ring/垂涎.png new file mode 100644 index 0000000..2733a9e Binary files /dev/null and b/public/img/equips/ring/垂涎.png differ diff --git a/public/img/equips/ring/太阳真火戒.png b/public/img/equips/ring/太阳真火戒.png new file mode 100644 index 0000000..7a57459 Binary files /dev/null and b/public/img/equips/ring/太阳真火戒.png differ diff --git a/public/img/equips/ring/太阴紫电戒.png b/public/img/equips/ring/太阴紫电戒.png new file mode 100644 index 0000000..918ab71 Binary files /dev/null and b/public/img/equips/ring/太阴紫电戒.png differ diff --git a/public/img/equips/ring/妖族之力.png b/public/img/equips/ring/妖族之力.png new file mode 100644 index 0000000..a193c35 Binary files /dev/null and b/public/img/equips/ring/妖族之力.png differ diff --git a/public/img/equips/ring/愣伽指环.png b/public/img/equips/ring/愣伽指环.png new file mode 100644 index 0000000..16f91e5 Binary files /dev/null and b/public/img/equips/ring/愣伽指环.png differ diff --git a/public/img/equips/ring/无名戒.png b/public/img/equips/ring/无名戒.png new file mode 100644 index 0000000..574ea49 Binary files /dev/null and b/public/img/equips/ring/无名戒.png differ diff --git a/public/img/equips/ring/旱魃.png b/public/img/equips/ring/旱魃.png new file mode 100644 index 0000000..2118f18 Binary files /dev/null and b/public/img/equips/ring/旱魃.png differ diff --git a/public/img/equips/ring/望月.png b/public/img/equips/ring/望月.png new file mode 100644 index 0000000..9baf77a Binary files /dev/null and b/public/img/equips/ring/望月.png differ diff --git a/public/img/equips/ring/满堂红.png b/public/img/equips/ring/满堂红.png new file mode 100644 index 0000000..dad9440 Binary files /dev/null and b/public/img/equips/ring/满堂红.png differ diff --git a/public/img/equips/ring/破戒.png b/public/img/equips/ring/破戒.png new file mode 100644 index 0000000..3c2219d Binary files /dev/null and b/public/img/equips/ring/破戒.png differ diff --git a/public/img/equips/ring/移山.png b/public/img/equips/ring/移山.png new file mode 100644 index 0000000..0a5086d Binary files /dev/null and b/public/img/equips/ring/移山.png differ diff --git a/public/img/equips/ring/金刚琢.png b/public/img/equips/ring/金刚琢.png new file mode 100644 index 0000000..bd20acd Binary files /dev/null and b/public/img/equips/ring/金刚琢.png differ diff --git a/public/img/equips/ring/金戒指.png b/public/img/equips/ring/金戒指.png new file mode 100644 index 0000000..cdbcf36 Binary files /dev/null and b/public/img/equips/ring/金戒指.png differ diff --git a/public/img/equips/ring/陆吾之目.png b/public/img/equips/ring/陆吾之目.png new file mode 100644 index 0000000..6d7d9b4 Binary files /dev/null and b/public/img/equips/ring/陆吾之目.png differ diff --git a/public/img/equips/ring/鬼缠.png b/public/img/equips/ring/鬼缠.png new file mode 100644 index 0000000..920ff85 Binary files /dev/null and b/public/img/equips/ring/鬼缠.png differ diff --git a/public/img/equips/ring/鬼骨戒.png b/public/img/equips/ring/鬼骨戒.png new file mode 100644 index 0000000..c76535a Binary files /dev/null and b/public/img/equips/ring/鬼骨戒.png differ diff --git a/public/img/equips/ring/黄泉之尘.png b/public/img/equips/ring/黄泉之尘.png new file mode 100644 index 0000000..d85d690 Binary files /dev/null and b/public/img/equips/ring/黄泉之尘.png differ diff --git a/src/config/equips/neck.ts b/src/config/equips/neck.ts index 807e408..248a684 100644 --- a/src/config/equips/neck.ts +++ b/src/config/equips/neck.ts @@ -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', [ diff --git a/src/config/equips/pants.ts b/src/config/equips/pants.ts index 6e6639d..459c738 100644 --- a/src/config/equips/pants.ts +++ b/src/config/equips/pants.ts @@ -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', [ diff --git a/src/config/equips/ring.ts b/src/config/equips/ring.ts index 8117dc5..91a7c81 100644 --- a/src/config/equips/ring.ts +++ b/src/config/equips/ring.ts @@ -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', [ diff --git a/src/config/i18n/zh/euips.ts b/src/config/i18n/zh/euips.ts index 4929a2a..3b0bcc7 100644 --- a/src/config/i18n/zh/euips.ts +++ b/src/config/i18n/zh/euips.ts @@ -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 = { }; 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: ['先驱者戒指', '先驱者戒指'], diff --git a/src/config/i18n/zh/skills.ts b/src/config/i18n/zh/skills.ts index f89ef62..27276ea 100644 --- a/src/config/i18n/zh/skills.ts +++ b/src/config/i18n/zh/skills.ts @@ -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 = [ '触发百花羞得矜持,获得${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}%伤害减免', +]; diff --git a/src/config/skill/base.ts b/src/config/skill/base.ts index 3274749..ea26b8a 100644 --- a/src/config/skill/base.ts +++ b/src/config/skill/base.ts @@ -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) { diff --git a/src/config/skill/index.ts b/src/config/skill/index.ts index db08774..5492769 100644 --- a/src/config/skill/index.ts +++ b/src/config/skill/index.ts @@ -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'; diff --git a/src/config/skill/neck.ts b/src/config/skill/neck.ts new file mode 100644 index 0000000..5dbf0de --- /dev/null +++ b/src/config/skill/neck.ts @@ -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); + } +} diff --git a/src/config/skill/pant.ts b/src/config/skill/pant.ts new file mode 100644 index 0000000..fafa7a8 --- /dev/null +++ b/src/config/skill/pant.ts @@ -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); + } +} diff --git a/src/config/skill/ring.ts b/src/config/skill/ring.ts new file mode 100644 index 0000000..b8337ca --- /dev/null +++ b/src/config/skill/ring.ts @@ -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); + } +} diff --git a/src/config/skill/weapon.ts b/src/config/skill/weapon.ts index b72f14c..f117192 100644 --- a/src/config/skill/weapon.ts +++ b/src/config/skill/weapon.ts @@ -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; diff --git a/src/tool/caller/attribute.ts b/src/tool/caller/attribute.ts index ff88c4c..8d6042a 100644 --- a/src/tool/caller/attribute.ts +++ b/src/tool/caller/attribute.ts @@ -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) => { }); //计算秒伤 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); }; diff --git a/src/tool/caller/battle.ts b/src/tool/caller/battle.ts index dc7e4a6..c422e56 100644 --- a/src/tool/caller/battle.ts +++ b/src/tool/caller/battle.ts @@ -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 { 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 { 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 { 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 { } 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); }; }