diff --git a/src/config/equips/armor.ts b/src/config/equips/armor.ts index c1c4657..06ee23a 100644 --- a/src/config/equips/armor.ts +++ b/src/config/equips/armor.ts @@ -16,6 +16,45 @@ export const armorColorfulCategorys: Categorys[] = [ 'BHXDJC', 0.9 ), + new Categorys( + 'heixi', + 'armor/黑犀.png', + [ + { type: 'def', valCoefficient: 1.8 }, + { type: 'hp', valCoefficient: 1 }, + { type: 'bloc', valCoefficient: 1 }, + ], + 'TieBi' + ), + new Categorys( + 'guiwen', + 'armor/龟纹铠.png', + [ + { type: 'def', valCoefficient: 1.0 }, + { type: 'hp', valCoefficient: 1.4 }, + { type: 'bloc', valCoefficient: 1.4 }, + ], + 'DuJunQianNeng' + ), + new Categorys( + 'wuxing', + 'armor/五行压贴.png', + [ + { type: 'def', valCoefficient: 0.9 }, + { type: 'critDmg', valCoefficient: 1.7 }, + { type: 'atk', valCoefficient: 1.7 }, + ], + 'JinGuangHuShen' + ), + new Categorys( + 'guimen', + 'armor/鬼门甲.png', + [ + { type: 'bloc', valCoefficient: 2.8 }, + { type: 'def', valCoefficient: 1.0 }, + ], + 'LaoBuKePo' + ), ]; export const armorUniqueCategorys: Categorys[] = [ diff --git a/src/config/equips/neck.ts b/src/config/equips/neck.ts index 248a684..8ee66e0 100644 --- a/src/config/equips/neck.ts +++ b/src/config/equips/neck.ts @@ -17,6 +17,34 @@ export const neckColorfulCategorys: Categorys[] = [ ], 'Duan' ), + new Categorys( + 'hushi', + 'neck/虎视.png', + [ + { type: 'atk', valCoefficient: 1.6 }, + { type: 'hp', valCoefficient: 1.5 }, + ], + 'NuMu' + ), + new Categorys( + 'xuenu', + 'neck/血怒.png', + [ + { type: 'critDmg', valCoefficient: 1.5 }, + { type: 'atk', valCoefficient: 1.6 }, + ], + 'HongYan' + ), + new Categorys( + 'guiyan', + 'neck/鬼眼.png', + [ + { type: 'critDmg', valCoefficient: 1.4 }, + { type: 'crit', valCoefficient: 0.5 }, + { type: 'hp', valCoefficient: 0.8 }, + ], + 'ShaYi' + ), ]; export const neckUniqueCategorys: Categorys[] = [ diff --git a/src/config/equips/shoes.ts b/src/config/equips/shoes.ts index f3287ca..87d6524 100644 --- a/src/config/equips/shoes.ts +++ b/src/config/equips/shoes.ts @@ -4,9 +4,17 @@ import { qualitys, extra_entry_num } from './constant'; const extraEntrys = ['atk', 'hp', 'def', 'moveSpeed', 'dmgReduc']; const coefficient = { shabby: 0.7, ordinary: 1, artifact: 1.3, epic: 1.5, unique: 1.8, colorful: 1.8 }; -export const shoesColorfulCategorys: Categorys[] = []; - -export const shoesUniqueCategorys: Categorys[] = [ +export const shoesColorfulCategorys: Categorys[] = [ + new Categorys('lingyun', 'shoes/灵韵集能器.png', [ + { type: 'moveSpeed', valCoefficient: 1.2 }, + { type: 'atk', valCoefficient: 1.8 }, + { type: 'hp', valCoefficient: 1 }, + ]), + new Categorys('siben', 'shoes/私奔.png', [ + { type: 'moveSpeed', valCoefficient: 2 }, + { type: 'def', valCoefficient: 1 }, + { type: 'hp', valCoefficient: 1.4 }, + ]), new Categorys('qxzl', 'shoes/浅夏紫灵.png', [ { type: 'moveSpeed', valCoefficient: 1.5 }, { type: 'atk', valCoefficient: 1.2 }, @@ -14,8 +22,16 @@ export const shoesUniqueCategorys: Categorys[] = [ ]), new Categorys('xuedun', 'shoes/血遁靴.png', [ { type: 'moveSpeed', valCoefficient: 2.8 }, - { type: 'hp', valCoefficient: 1.2 }, + { type: 'hp', valCoefficient: 2 }, + ]), + new Categorys('wajiang', 'shoes/蛙将足.png', [ + { type: 'moveSpeed', valCoefficient: 1.4 }, + { type: 'atk', valCoefficient: 1.5 }, + { type: 'def', valCoefficient: 1 }, ]), +]; + +export const shoesUniqueCategorys: Categorys[] = [ new Categorys('talang', 'shoes/踏浪.png', [ { type: 'moveSpeed', valCoefficient: 1.8 }, { type: 'hp', valCoefficient: 1 }, diff --git a/src/config/i18n/zh/euips.ts b/src/config/i18n/zh/euips.ts index b85ed75..393b526 100644 --- a/src/config/i18n/zh/euips.ts +++ b/src/config/i18n/zh/euips.ts @@ -54,18 +54,18 @@ export const weapon = { export const armor = { type: '防具', baihua: ['百花内甲', '内甲缝着一个香囊,本有百花香,如今只余勿忘我。'], + heixi: ['黑犀', '本是七星剑的剑鞘,被小妖偷来做成了皮甲一副,冬暖夏凉。'], + guiwen: ['龟纹铠', '督军穿上这件铠甲后觉得自己有了顶撞正妻的勇气,事后证明是幻觉。'], + wuxing: ['五行压贴', '除了玄奘,谁都不准动!'], bianfu: ['蝙蝠氅', '穿上它,你能在一秒钟内分辨二百五十组回音。'], dongfang: ['东方', '陆吾时常遥望东方,没有人知道他看到了什么。'], dourong: ['斗融之甲', '它的主人最后成了一条龙的食物。'], - guiwen: ['龟纹铠', '督军穿上这件铠甲后觉得自己有了顶撞正妻的勇气,时候证明是幻觉。'], guimen: ['鬼门甲', '不要妄图破坏它,它曾经是冥界之门的一部分。'], gyft: ['鬼蜮焚天', '三途河岸那魅惑者亡灵、怒火焚天的红花。'], - heixi: ['黑犀', '本是七星剑的剑鞘,被小妖偷来做成了皮甲一副,冬暖夏凉。'], hubugui: ['狐不归', '刀锋冷,映月辉;世情浊,胡不归?'], meirengu: ['美人鼓', '白骨夫人曾鼓与花果山以壮百万妖君,声阙五百里'], tiancheng: ['天成', '石像天成,好事者略施雕琢。'], tungui: ['吞鬼甲', '执搏挫锐,噬食鬼魅。画虎于门,鬼不敢入。'], - wuxing: ['五行压贴', '除了玄奘,谁都不准动!'], yanyu: ['炎狱', '穿在身上全身毛孔都要冒烟了。'], yufu: ['鱼腹', '藏玉泥中,匿珪鱼腹'], dispute: ['争执连身衣', '争执连身衣'], @@ -84,13 +84,14 @@ export const armor = { }; export const neck = { type: '项链', - chitong: ['赤瞳金玉坠', '传闻为仙族神器。佩戴者回洞悉敌人的弱点。'], duanji: ['断·极', '若众生都断了情欲,那世间岂不是一色苍凉。'], + hushi: ['虎视', '我看见了你,偷丹贼。 ----三仙的丹房'], + xuenu: ['血怒', '我们都曾把愤怒埋藏在鲜血里。'], + chitong: ['赤瞳金玉坠', '传闻为仙族神器。佩戴者回洞悉敌人的弱点。'], fannao: ['百八烦恼珠', '求人不如求己。'], zhuxian: ['诛仙', '原来,神的身体流动的血,都是冷的。'], fodengyou: ['佛灯油', '听说灵山永寂,灯影不摇,我若去了,便叫它风起云动。 ----黄风大圣'], guiyan: ['鬼眼', '多少楼台平山演,鬼使飞阁绿林空。'], - hushi: ['虎视', '我看见了你,偷丹贼。 ----三仙的丹房'], aige: ['姜氏哀歌', '这悲伤的歌声浸透了这条项链,你听。'], limao: ['狸猫内丹', '影中之影,幻中之幻。'], longteng: ['龙腾护心镜', '腾龙即出,四海来朝。'], @@ -99,7 +100,6 @@ export const neck = { nvwangfeng: ['女王蜂项链', '以毒攻毒,百毒不侵。'], fouzhu: ['十八念佛珠', '别人念佛是为了求如来保佑,如来念佛又是为了什么。'], wuxinggui: ['太乙神器 五行圭', '太乙出品,必属精品。'], - xuenu: ['血怒', '我们都曾把愤怒埋藏在鲜血里。'], zhongsheng: ['众生醉', '美酒斟杯莫思量,烦丝一甩九霄扬。'], bianhua: ['最初的彼岸花', '三千年生叶,叶落始开花。三千年开花,花谢始叶生。'], @@ -195,11 +195,11 @@ export const pants = { }; export const shoes = { type: '鞋子', - lingyun: ['灵韵聚能器', '闪开,俺老孙还有一个很重要的约会。'], + lingyun: ['灵韵集能器', '闪开,俺老孙还有一个很重要的约会。'], siben: ['私奔', '这些年,除了爱,我一无所有,但你不爱我的一无所有。 ----荃木狼'], - wajiang: ['蛙将足', '大小刚刚合适。'], qxzl: ['浅夏紫灵', '夏日么么哒!'], xuedun: ['血遁靴', '客观,赶着投胎么?我想你需要他。 ----郢都城门鬼差'], + wajiang: ['蛙将足', '大小刚刚合适。'], talang: ['踏浪', '东海水晶宫出品。'], jiuwanli: ['九万里', '逐风而来。'], hongchen: ['红尘', '滚滚红尘里有隐约的耳语,跟随我俩的传说。'], @@ -210,9 +210,9 @@ export const shoes = { }; export const bracers = { type: '护腕', + xianglong: ['降龙', '见龙在田,利见大人。'], xingjia: ['刑枷', '我无法为野心套上邢枷,所以只好走向毁灭。'], xuedun: ['毒蛇', '即使血是冷的,但你又怎知它不向往温暖。'], - xianglong: ['降龙', '见龙在田,利见大人。'], huojing: ['火晶环', '闻上去有股老君八卦炉中单屑的味道。'], limao: ['狸猫足印', '无声,快速,锐利,不可思议。'], meipusa: ['美菩萨', '是因为美丽?还是因为菩萨?'], diff --git a/src/config/i18n/zh/skills.ts b/src/config/i18n/zh/skills.ts index e591014..d57675f 100644 --- a/src/config/i18n/zh/skills.ts +++ b/src/config/i18n/zh/skills.ts @@ -14,15 +14,27 @@ export const bhxdjc = [ '当生命值低于${0}%时,获得自身最大生命值${1}%的护盾(护盾能吸收等额伤害,但每回合自然衰减10%),此效果每场战斗只能触发一次。', '触发百花羞得矜持,获得${0}点护盾。', ]; +export const tiebi = ['铁壁', '获得${0}%伤害减免,持续${1}回合,冷却时间${2}回合', '{0}使用了铁壁,获得${0}%伤害减免,持续${1}回合。']; +export const dujunqianneng = ['督军的潜能', '生命值低于${0}%时,获得${1}%伤害减免。', '血量低于${0}%,触发督军的潜能,获得%{1}伤害减免。']; +export const jinguanghushen = ['金光护身', '抵抗一次死亡,并回复${0}%的生命,此效果每场战斗只能触发一次。', '触发金光护身,回复${0}%生命。']; +export const laobukepo = ['牢不可破', '提升${0}%格挡值。']; export const duan = ['断', '攻击目标后,若目标血量低于${0}%,则直接处决目标。', '目标血量低于${0}%,触发【断】,造成${1}点伤害']; +export const hongyan = ['红眼', '生命低于${0}%时,提高${1}点基础攻击力,且攻击附加${2}%攻击力的伤害。', '血量低于${0}%,触发红眼,附加${1}点伤害。']; +export const shayi = [ + '杀意', + '攻击时增加一层杀意(提升${0}%基础攻击力),被暴击则减少${1}层,杀意最多叠加${2}层。', + '增加一层杀意,当前${0}层', + '被暴击,减少${0}层杀意。', +]; +export const numu = ['怒目', '被攻击时提升${0}%基础攻击力,最多叠加${1}层。', '增加一层怒目,当前${0}层']; export const SLWX = ['森罗万象', '增加${0}%攻击加成、伤害加成、暴击率、暴击伤害。']; export const jinggangzhuo = ['金刚琢', '攻击时有${0}%几率使目标进入缴械状态${1}回合。', '触发金刚镯,目标缴械${0}回合']; -export const fengxie = ['奉邪', '每次暴击,增加${0}%的暴击伤害,最多叠加${1}层,未暴击时层数清零。', '触发奉邪,当前层数${0}层。']; -export const shizhong = ['噬忠', '每次被暴击,增加${0}%的暴击伤害减免,最多叠加${1}层,持续到战斗结束。', '触发噬忠,当前层数${0}层。']; +export const fengxie = ['奉邪', '每次暴击,增加${0}%的暴击伤害,最多叠加${1}层,未暴击时层数清零。', '触发奉邪,当前${0}层。']; +export const shizhong = ['噬忠', '每次被暴击,增加${0}%的暴击伤害减免,最多叠加${1}层,持续到战斗结束。', '触发噬忠,当前${0}层。']; export const shenshang = ['神赏', '暴击时有${0}%概率恢复自身生命${1}点。', '触发神赏,恢复生命${0}点。']; -export const tongjuefanji = ['痛觉反击', '每次受到暴击时,对目标使用刺痛反击,伤害倍率${0}%。', '触发刺痛反击,对${0}造成${1}点伤害。']; +export const tongjuefanji = ['痛觉反击', '每次受到暴击时,对目标使用刺痛反击,伤害倍率${0}%。', '触发反击,对${0}造成${1}点伤害。']; export const fate = ['化缘', '副本掉落金币奖励提高${0}%。']; export const vampire = ['汲血', '生命偷取${0}%。', '触发汲血,偷取${0}点生命']; @@ -40,17 +52,14 @@ export const furenpihu = [ ]; //未实装,待补充 -export const shayi = ['杀意', '攻击时增加一层杀意(提升${0}%基础攻击力),被暴击则减少${1}层,杀意最多叠加${2}层。']; + export const ruiyayin = ['锐牙印', '攻击时有${0}概率偷取目标${1}%暴击率,持续${2}回合。']; -export const numu = ['怒目', '被攻击时提升${0}点基础攻击力,最多叠加${1}层。']; + export const xuanwo = ['漩涡', '攻击时有${0}概率提升${1}%点基础攻击力,持续${2}回合,冷去${3}回合。']; export const kongbulingyu = ['恐怖领域', '自身防御力提升${0}点,周围敌方目标防御力降低${1}点。']; export const shichou = ['世仇', '每回合对周围地方目标施加震慑(攻击力降低${0}%)状态,最多叠加${1}层。']; export const nuyi = ['奴役', '攻击时有${0}概率附加尸毒,持续${1}回合,若目标在尸毒持续时间内死亡,则回复所有生命。']; -export const hongyan = ['红眼', '生命低于65%时,攻击附加${0}攻击力的附加伤害,并提高${1}基础攻击力。']; -export const jinguanghushen = ['金光护身', '抵抗一次死亡,并回复${0}%的生命,此效果每场战斗只能触发一次。']; export const jinmaibaolie = ['筋脉爆裂', '攻击时有${0}概率使目标筋脉爆裂,每回合流失%{1}当前生命值,持续${2}回合。']; export const jiupinjinlian = ['九品金莲', '目标死亡时有${0}%概率额外掉一件装备。']; export const zhuanjie = ['黑白钻戒', '获得${0}%伤害减免。']; -export const laobukepo = ['牢不可破', '提升${0}%格挡值。']; export const xingyunshuzi = ['幸运数字', '战斗开始时随机获得${0}个幸运数字,攻击造成的伤害以幸运数字结尾时,????']; diff --git a/src/config/skill/armor.ts b/src/config/skill/armor.ts index 903fd00..1158739 100644 --- a/src/config/skill/armor.ts +++ b/src/config/skill/armor.ts @@ -1,23 +1,84 @@ -import { CounterSkill, Attack, Control, GainsSkill, SufPassiveSkill, Vampire, PrePassiveSkill } from './base'; +import { PrePassiveSkill, BuffSkill, CounterSkill } from './base'; import i18n from '../i18n'; -import { BattleRole, replace } from '@/tool'; +import { BattleRole, callDmgReduc, replace } from '@/tool'; const { t } = i18n; +//百花羞的矜持 export class BHXDJC extends PrePassiveSkill { name: string = 'bhxdjc'; hpPercent: number = 60; shieldPercentOfHp: number = 80; - triggered: boolean = false; + cd: number = 999; 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; + return 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); + owner.battleLog(replace(t('skill.bhxdjc.2'), [owner.shield])); + } +} +//铁壁 +export class TieBi extends BuffSkill { + name: string = 'tiebi'; + last: number = 6; + cd: number = 9; + dmgReduc: number = 40; + desc(): string { + return replace(t('skill.tiebi.1'), [this.dmgReduc, this.last, this.cd]); + } + takeEffect(owner: BattleRole, target: BattleRole): void { + owner.extraAttr.dmgReduc = callDmgReduc(owner.extraAttr.dmgReduc, this.dmgReduc); + } + log(owner: BattleRole, target: BattleRole): void { + owner.battleLog(replace(t('skill.tiebi.2'), [t(owner.type), this.dmgReduc, this.last])); + } +} +//督军的潜能 +export class DuJunQianNeng extends PrePassiveSkill { + name: string = 'dujunqianneng'; + hpPercent: number = 50; + dmgReduc: number = 50; + desc(): string { + return replace(t('skill.dujunqianneng.1'), [this.hpPercent, this.dmgReduc]); + } + 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 = callDmgReduc(owner.extraAttr.dmgReduc, this.dmgReduc); + owner.battleLog(replace(t('skill.dujunqianneng.2'), [this.hpPercent, this.dmgReduc])); + } +} +//金光护身 +export class JinGuangHuShen extends CounterSkill { + name: string = 'jinguanghushen'; + cd: number = 999; + hpPercent: number = 35; + desc(): string { + return replace(t('skill.jinguanghushen.1'), [this.hpPercent]); + } + trigger(owner: BattleRole, target: BattleRole): boolean { + return owner.isDeath(); + } + takeEffect(owner: BattleRole, target: BattleRole): void { + owner.addHp((owner.attr.hp * this.hpPercent) / 100); + owner.battleLog(replace(t('skill.jinguanghushen.2'), [this.hpPercent])); + } +} +//laobukepo +export class LaoBuKePo extends PrePassiveSkill { + name: string = 'laobukepo'; + percent: number = 200; + desc(): string { + return replace(t('skill.laobukepo.1'), [this.percent]); + } + trigger(owner: BattleRole, target: BattleRole): boolean { + return true; + } + takeEffect(owner: BattleRole, target: BattleRole): void { + owner.extraAttr.bloc += owner.attr.bloc * (this.percent / 100); } } diff --git a/src/config/skill/base.ts b/src/config/skill/base.ts index ea26b8a..8d29a63 100644 --- a/src/config/skill/base.ts +++ b/src/config/skill/base.ts @@ -134,7 +134,7 @@ export abstract class Vampire extends SufPassiveSkill { } } } -//控制技能 +//主动控制技能 export abstract class Control extends ActionSkill { abstract last: number; abstract rate: number; @@ -151,7 +151,7 @@ export abstract class Control extends ActionSkill { owner.battleLog(log); } } -//普通攻击 +//主动攻击技能(普通攻击) export class Attack extends ActionSkill { order: number = 999; name: string = 'attack'; @@ -171,3 +171,24 @@ export class Attack extends ActionSkill { } } } +//主动增益技能(buff) +export abstract class BuffSkill extends ActionSkill { + abstract last: number; + rmdLast = 0; + beforeAtk(owner: BattleRole, target: BattleRole): void { + super.beforeAtk(owner, target); + this.check(owner, target); + } + check(owner: BattleRole, target: BattleRole): void { + if (this.rmdLast > 0) { + this.rmdLast--; + this.takeEffect(owner, target); + } + } + abstract takeEffect(owner: BattleRole, target: BattleRole): void; + use(owner: BattleRole, target: BattleRole): void { + this.rmdLast = this.last; + this.log(owner, target); + } + abstract log(owner: BattleRole, target: BattleRole): void; +} diff --git a/src/config/skill/bracers.ts b/src/config/skill/bracers.ts index bd29c29..f67a123 100644 --- a/src/config/skill/bracers.ts +++ b/src/config/skill/bracers.ts @@ -1,6 +1,6 @@ import { CounterSkill, Attack, Control, GainsSkill, SufPassiveSkill, Vampire, PrePassiveSkill } from './base'; import i18n from '../i18n'; -import { BattleRole, replace } from '@/tool'; +import { BattleRole, callDmgPercent, replace } from '@/tool'; const { t } = i18n; export class Xianglong extends PrePassiveSkill { @@ -12,13 +12,11 @@ export class Xianglong extends PrePassiveSkill { 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); + extra.dmgPercent = callDmgPercent(extra.dmgPercent, this.dmgPercent); + owner.battleLog(replace(t('skill.xianglong.2'), [this.hpPercent, this.dmgPercent])); } } diff --git a/src/config/skill/jewelry.ts b/src/config/skill/jewelry.ts index 7bb68bc..9175a0f 100644 --- a/src/config/skill/jewelry.ts +++ b/src/config/skill/jewelry.ts @@ -40,11 +40,9 @@ export class CritFear extends SufPassiveSkill { return owner.crit; } takeEffect(owner: BattleRole, target: BattleRole): void { - const additional = Math.ceil((owner.attr.atk * this.percent) / 100); - owner.dmg += additional; + const additional = Math.ceil((owner.atk * this.percent) / 100); target.addHp(-1 * additional); - const log = replace(t('skill.critFear.2'), [additional]); - owner.battleLog(log); + owner.battleLog(replace(t('skill.critFear.2'), [additional])); } } //琉璃盘 diff --git a/src/config/skill/neck.ts b/src/config/skill/neck.ts index f8ecdc0..ffffe02 100644 --- a/src/config/skill/neck.ts +++ b/src/config/skill/neck.ts @@ -1,4 +1,4 @@ -import { SufPassiveSkill, PassiveSkill } from './base'; +import { SufPassiveSkill, PassiveSkill, PrePassiveSkill } from './base'; import i18n from '../i18n'; import { BattleRole, replace } from '@/tool'; const { t } = i18n; @@ -6,18 +6,90 @@ const { t } = i18n; //断 export class Duan extends SufPassiveSkill { name: string = 'duan'; - rate: number = 10; + hpPercent: number = 10; order: number = 999; dmg: number = 999999999; desc(): string { - return replace(t('skill.duan.1'), [this.rate]); + return replace(t('skill.duan.1'), [this.hpPercent]); } trigger(owner: BattleRole, target: BattleRole): boolean { - return target.attr.curHp / target.attr.hp < this.rate / 100; + return owner.dmg > 0 && target.attr.curHp / target.attr.hp < this.hpPercent / 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); + owner.battleLog(replace(t('skill.duan.2'), [this.hpPercent, this.dmg])); + } +} +//红眼 +export class HongYan extends PrePassiveSkill { + name: string = 'hongyan'; + hpPercent: number = 65; + atk: number = 3000; + atkPercent: number = 200; + desc(): string { + return replace(t('skill.hongyan.1'), [this.hpPercent, this.atk, this.atkPercent]); + } + trigger(owner: BattleRole, target: BattleRole): boolean { + return owner.attr.curHp / owner.attr.hp < this.hpPercent / 100; + } + takeEffect(owner: BattleRole, target: BattleRole): void { + owner.extraAttr.baseAtk += this.atk; + } + afterAtk(owner: BattleRole, target: BattleRole): void { + if (this.trigger(owner, target)) { + const additional = Math.ceil((owner.atk * this.atkPercent) / 100); + target.addHp(-1 * additional); + owner.battleLog(replace(t('skill.hongyan.2'), [this.hpPercent, additional])); + } + } +} +//杀意 +export class ShaYi extends PrePassiveSkill { + name: string = 'shayi'; + atkPercent: number = 3; + layer: number = 0; + maxLayer: number = 10; + reduc: number = 3; + desc(): string { + return replace(t('skill.shayi.1'), [this.atkPercent, this.reduc, this.maxLayer]); + } + trigger(owner: BattleRole, target: BattleRole): boolean { + return true; + } + takeEffect(owner: BattleRole, target: BattleRole): void { + owner.extraAttr.baseAtk += (this.atkPercent / 100) * this.layer * owner.attr.baseAtk; + } + afterAtk(owner: BattleRole, target: BattleRole): void { + this.layer < this.maxLayer && this.layer++; + owner.battleLog(replace(t('skill.shayi.2'), [this.layer])); + } + onAtked(owner: BattleRole, target: BattleRole): void { + if (target.crit) { + this.layer -= this.reduc; + this.layer < 0 && (this.layer = 0); + owner.battleLog(replace(t('skill.shayi.3'), [this.reduc])); + } + } +} +//怒目 +export class NuMu extends PrePassiveSkill { + name: string = 'numu'; + atkPercent: number = 3; + layer: number = 0; + maxLayer: number = 10; + desc(): string { + return replace(t('skill.numu.1'), [this.atkPercent, this.maxLayer]); + } + trigger(owner: BattleRole, target: BattleRole): boolean { + return true; + } + takeEffect(owner: BattleRole, target: BattleRole): void { + owner.extraAttr.baseAtk += (this.atkPercent / 100) * this.layer * owner.attr.baseAtk; + } + onAtked(owner: BattleRole, target: BattleRole): void { + if (target.dmg > 0) { + this.layer < this.maxLayer && this.layer++; + owner.battleLog(replace(t('skill.numu.3'), [this.layer])); + } } } diff --git a/src/config/skill/pants.ts b/src/config/skill/pants.ts index fafa7a8..655aea4 100644 --- a/src/config/skill/pants.ts +++ b/src/config/skill/pants.ts @@ -1,10 +1,11 @@ -import { SufPassiveSkill, PrePassiveSkill } from './base'; +import { SufPassiveSkill, PrePassiveSkill, CounterSkill } from './base'; import i18n from '../i18n'; import { BattleRole, replace } from '@/tool'; const { t } = i18n; export class FuRenPiHu extends SufPassiveSkill { name: string = 'furenpihu'; + cd: number = 999; hpPercent: number = 30; last: number = 3; dmgReduc: number = 100; @@ -16,7 +17,7 @@ export class FuRenPiHu extends SufPassiveSkill { } 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); + owner.battleLog(replace(t('skill.furenpihu.2'), [this.hpPercent, this.dmgReduc])); } } + diff --git a/src/config/skill/ring.ts b/src/config/skill/ring.ts index c0df853..24e4683 100644 --- a/src/config/skill/ring.ts +++ b/src/config/skill/ring.ts @@ -1,12 +1,12 @@ import { SufPassiveSkill, PrePassiveSkill, PassiveSkill, CounterSkill } from './base'; import i18n from '../i18n'; -import { BattleRole, replace } from '@/tool'; +import { BattleRole, callDmgPercent, replace } from '@/tool'; const { t } = i18n; //森罗万象 export class SLWX extends PrePassiveSkill { name: string = 'SLWX'; - percent: number = 20; + percent: number = 30; desc(): string { return replace(t('skill.SLWX.1'), [this.percent]); } @@ -16,9 +16,9 @@ export class SLWX extends PrePassiveSkill { 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; + extra.dmgPercent = callDmgPercent(extra.dmgPercent, this.percent); + extra.crit += this.percent; + extra.critDmg += this.percent; } } diff --git a/src/config/skill/weapon.ts b/src/config/skill/weapon.ts index f117192..f444be7 100644 --- a/src/config/skill/weapon.ts +++ b/src/config/skill/weapon.ts @@ -15,12 +15,10 @@ export class IceBlade extends SufPassiveSkill { return owner.crit && Math.random() < this.rate / 100; } takeEffect(owner: BattleRole, target: BattleRole): void { - const additional = Math.ceil((owner.attr.atk * this.percent) / 100); - owner.dmg += additional; + const additional = Math.ceil((owner.atk * this.percent) / 100); target.addHp(-1 * additional); target.control = target.control > this.last ? target.control : this.last; - const log = replace(t('skill.iceBlade.2'), [additional, t(target.type), this.last]); - owner.battleLog(log); + owner.battleLog(replace(t('skill.iceBlade.2'), [additional, t(target.type), this.last])); } } diff --git a/src/tool/caller/attribute.ts b/src/tool/caller/attribute.ts index 8d6042a..3cfe4d7 100644 --- a/src/tool/caller/attribute.ts +++ b/src/tool/caller/attribute.ts @@ -22,13 +22,14 @@ export const callPlayerAttribute = (player: Player, rA: any) => { entry.forEach((item) => { const key = item.type; if (key == 'dmgPercent') { - attribute[key] = Math.round((attribute[key] + 100) * (item.value / 100 + 1) - 100); + attribute[key] = Math.round(callDmgPercent(attribute[key], item.value)); } else if (key == 'dmgReduc') { - attribute[key] = Math.floor(100 - (1 - attribute[key] / 100) * (1 - item.value / 100) * 100); + attribute[key] = callDmgReduc(attribute[key], item.value); } else { attribute[key] += item.value; } }); + attribute.dmgReduc = Math.floor(attribute.dmgReduc * 100) / 100; //伤害减免保留两位小数 attribute.hp = Math.ceil(attribute.hp * (1 + attribute.hpPercent / 100)); attribute.curHp = Math.ceil(attribute.hp * hpP); attribute.baseAtk = attribute.atk; @@ -50,11 +51,39 @@ export const callPlayerAttribute = (player: Player, rA: any) => { player.attribute = attribute; }; -export const callReducPercent = (def) => { +/** + * 计算防御提供的减伤比例 + * @param def 防御 + * @returns 减伤比例 + */ +export const callReducPercent = (def: number): number => { // return def / (200 + 1.1 * def) + (0.09 * def) / (def + 200); return def / (200 + 1.05263 * def); }; +/** + * 计算新增伤害减免后的伤害减免 + * @param source 已有伤害减免 + * @param add 新增伤害减免 + * @returns 最终伤害减免 + */ +export const callDmgReduc = (has, addition) => { + if (has > 100 || addition > 100) { + return 100; + } + return 100 - (100 - has) * (1 - addition / 100); +}; + +/** + * 计算新增伤害加成后的伤害加成 + * @param source 已有伤害加成 + * @param add 新增伤害加成 + * @returns 最终伤害加成 + */ +export const callDmgPercent = (has, addition) => { + return (100 + has) * (1 + addition / 100) - 100; +}; + /** * 计算装备强化后的基础属性 * @param equip 装备 diff --git a/src/tool/caller/battle.ts b/src/tool/caller/battle.ts index c422e56..062a3b1 100644 --- a/src/tool/caller/battle.ts +++ b/src/tool/caller/battle.ts @@ -1,5 +1,5 @@ import { Equip, Skills, Monster, Attribute, Player } from '@/config'; -import { randonBootyEquip, deepCopy, replace, callReducPercent } from '@/tool'; +import { randonBootyEquip, deepCopy, replace, callReducPercent, callDmgReduc, callDmgPercent } from '@/tool'; import i18n from '@/config/i18n'; const { t } = i18n; @@ -12,6 +12,7 @@ export class BattleRole { control: number = 0; //临时状态 action: Skills.ActionSkill | null = null; + atk: number = 0; dmg: number = 0; crit: boolean = false; extraAttr: Attribute = new Attribute(); @@ -28,6 +29,7 @@ export class BattleRole { initTmp = () => { this.action = null; + this.atk = 0; this.dmg = 0; this.crit = false; this.extraAttr = new Attribute(); @@ -144,10 +146,12 @@ export class BattleRole { 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 * (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); //目标承受伤害比例 + this.atk = baseAtk * atkPercent; //回合最终攻击力 + const dmgPercent = callDmgPercent(attr.dmgPercent, extra.dmgPercent) / 100; //伤害加成 + let dmg = this.atk * dmgPercent * (this.skillPercent / 100); //造成伤害 + const reducPercent = callReducPercent(target.attr.def + target.extraAttr.def); //目标防御提供的减伤比例 + const dmgReduc = callDmgReduc(target.attr.dmgReduc, target.extraAttr.dmgReduc); //目标伤害减免 + const takeDmgPercent = (1 - reducPercent) * (1 - 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; //最终暴击率