diff --git a/public/img/equips/weapon/剑姬.png b/public/img/equips/weapon/剑姬.png deleted file mode 100644 index f46631c..0000000 Binary files a/public/img/equips/weapon/剑姬.png and /dev/null differ diff --git a/public/img/equips/weapon/九灵·元圣.png b/public/img/equips/weapon/十九叉.png similarity index 100% rename from public/img/equips/weapon/九灵·元圣.png rename to public/img/equips/weapon/十九叉.png diff --git a/public/img/equips/weapon/鸣血.png b/public/img/equips/weapon/鸣血.png deleted file mode 100644 index 2ff9ede..0000000 Binary files a/public/img/equips/weapon/鸣血.png and /dev/null differ diff --git a/src/config/equips/weapon.ts b/src/config/equips/weapon.ts index 0285853..b8cd768 100644 --- a/src/config/equips/weapon.ts +++ b/src/config/equips/weapon.ts @@ -34,12 +34,78 @@ export const weaponColorfulCategorys: Categorys[] = [ 'kantou', 'weapon/砍头.png', [ - { type: 'atk', valCoefficient: 1.6 }, - { type: 'crit', valCoefficient: 1.5 }, - { type: 'critDmg', valCoefficient: 1.5 }, + { type: 'atk', valCoefficient: 1.6 }, + { type: 'crit', valCoefficient: 1.5 }, + { type: 'critDmg', valCoefficient: 1.5 }, ], 'BaoNue' ), + new WeaponCategory( + 'shangxin', + 'weapon/伤心刺.png', + [ + { type: 'atk', valCoefficient: 1.8 }, + { type: 'crit', valCoefficient: 1.2 }, + { type: 'critDmg', valCoefficient: 1.8 }, + ], + 'ZhaXin' + ), + new WeaponCategory( + 'aozhidu', + 'weapon/鳌之毒.png', + [ + { type: 'atk', valCoefficient: 1.6 }, + { type: 'bloc', valCoefficient: 1.2 }, + { type: 'hp', valCoefficient: 1.6 }, + ], + 'AoZhiDu' + ), + new WeaponCategory( + 'shijiucha', + 'weapon/十九叉.png', + [ + { type: 'atk', valCoefficient: 1.2 }, + { type: 'def', valCoefficient: 1.6 }, + { type: 'hp', valCoefficient: 1.6 }, + ], + 'ShiJiuCha', + 0.98 + ), + new WeaponCategory('datiecheng', 'weapon/大铁城.png', [ + { type: 'atk', valCoefficient: 4.2 }, + { type: 'critDmg', valCoefficient: 4.2 }, + ]), + new WeaponCategory( + 'qingguang', + 'weapon/青光.png', + [ + { type: 'atk', valCoefficient: 1.5 }, + { type: 'crit', valCoefficient: 1.5 }, + { type: 'critDmg', valCoefficient: 1.5 }, + ], + 'JianQiDongSiFang', + 0.8 + ), + new WeaponCategory( + 'baoxue', + 'weapon/暴雪.png', + [ + { type: 'atk', valCoefficient: 1.8 }, + { type: 'crit', valCoefficient: 1.5 }, + { type: 'critDmg', valCoefficient: 1.3 }, + ], + 'BaoFengXue' + ), + new WeaponCategory( + 'shayi', + 'weapon/杀意.png', + [ + { type: 'atk', valCoefficient: 2.8 }, + { type: 'crit', valCoefficient: 1.5 }, + ], + 'BoDongShaYi', + 0.9 + ), ]; export const weaponUniqueCategorys: WeaponCategory[] = [ diff --git a/src/config/i18n/zh/euips.ts b/src/config/i18n/zh/euips.ts index e831f93..f460817 100644 --- a/src/config/i18n/zh/euips.ts +++ b/src/config/i18n/zh/euips.ts @@ -15,26 +15,25 @@ export const weapon = { qiuai: ['求爱', '我不是在求你爱我,而是,不接受我的爱,你就要死。 ----琵琶精'], qici: ['鳍刺', '这美丽簪成了夺命的刺。多少年后,你还记得是谁曾以此为你绾起青丝。'], kantou: ['砍头', '你知道比砍头更痛苦的是什么吗?'], + shangxin: ['伤心刺', '比砍头更痛苦的,是伤心。'], aozhidu: ['鳌之毒', '相思有毒,曲终无怨。'], + shijiucha: ['十九叉', '每个人都至少有两面。但据说它的主人会有十九个人格。'], + datiecheng: ['大铁城', '其重如一整座冥铁打造的郢都城。'], + qingguang: ['青光', '你活着看到的最后东西是一道青光。'], baoxue: ['暴雪', '铁匠将交付时间推延了二十四次。'], + shayi: ['杀意', '仇敌,莫让吾听闻汝名。'], chengba: ['称霸', '霸者不藏其锋,以天地为鞘。'], chulian: ['初恋', '我的初恋在月亮之上。 ----八戒'], - datiecheng: ['大铁城', '其重如一整座冥铁打造的郢都城。'], duwu: ['黩武', '若未用够最后一丝力气,如何能甘心。'], emeng: ['噩梦', '我最近的噩梦,都和一只猴子有关...... ----增长天王'], heifeng: ['黑风', '这把斧子一直不肯相信它的主人已经死去。'], shishen: ['弑神', '从斩妖台流落到地府的禁忌之物,慎用。'], - jianji: ['剑姬', '美人蒙尘,以诗有缘。'], jlys: ['九灵·元圣', '当坐骑总比没命了强。'], - shangxin: ['伤心刺', '比砍头更痛苦的,是伤心。'], llzx: ['冷龙之心', '长九尺三寸,苍青之气盘绕九十三匝。'], lmlr: ['狸猫利刃', '比时光还要无情。'], liuying: ['流萤', '若不困顿於林野,必凄惶於道路。'], liubuxiang: ['六不像', '汝若身披业火,当一念不起,六欲尽灭。'], longxian: ['龙衔', '天之西北有幽冥无日之国,有龙衔烛而照之也。'], - mingxue: ['鸣血', '别想让他停下来,它已经饥渴难耐了。'], - qingguang: ['青光', '你活着看到的最后东西是一道青光。'], - shayi: ['杀意', '仇敌,莫让吾听闻汝名。'], siyu: ['私语', '你爱的不是我,而是灵山项上那个在绚烂中毁灭的金蝉子。 ----唐僧'], tianzhao: ['天照', '神的叹息'], wuzhe: ['无遮', '知识自境之心。'], diff --git a/src/config/i18n/zh/skills.ts b/src/config/i18n/zh/skills.ts index e668251..02772f7 100644 --- a/src/config/i18n/zh/skills.ts +++ b/src/config/i18n/zh/skills.ts @@ -10,6 +10,12 @@ export const iceBlade = ['冰刃', '暴击时有${0}几率释放冰线冲击,附 export const seeRed = ['见红', '对目标施加${0}层流血,持续${1}回合。', '冷却${0}回合。']; export const qici = ['鳍刺', '攻击时有${0}%概率对目标施加${1}层流血,持续${2}回合。', '触发鳍刺,对${0}施加${1}层流血,持续${2}回合。']; export const baonue = ['暴虐', '攻击时有${0}%概率使目标筋脉爆裂,施加满层流血,持续${1}回合。', '触发暴虐,对${0}施加满层流血,持续${2}回合。']; +export const zhaxin = ['扎心', '获得${0}%暴击伤害加成。']; +export const aozhidu = ['鳌之毒', '攻击时使目标进入溃烂状态${0}回合。', '触发鳌之毒,${0}进入溃烂状态${1}回合']; +export const shijiucha = ['十九叉', '每九次攻击获得连刺状态,使得第十次攻击附加${0}倍伤害。', '${0}触发十九叉连刺,附加${0}点伤害']; +export const jianqidongsifang = ['剑气动四方', '攻击造成的伤害增加${0}%,但被攻击时受到的伤害也增加${1}%。']; +export const baofengxue = ['暴风雪', '使目标进入冰冻状态${0}回合,冷却${1}回合。对boss只有${2}%成功率。']; +export const bodongshayi = ['波动杀意', '每层杀意提升的基础攻击力提高到${0}%,并且杀意最多可以叠加${1}层']; export const bhxdjc = [ '百花羞的矜持', @@ -72,9 +78,10 @@ export const linggan = ['灵感', '每回合回复${0}%生命。']; export const wankang = ['顽抗', '被攻击时反弹${0}%所受伤害,最大反弹值等于${1}%生命上限。', '${0}触发顽抗,反弹${1}点伤害']; export const wuwei = ['五味', '获得${0}%伤害减免。']; -export const atkbuff = ['提升${0}点基础攻击力。', '提升${0}%基础攻击力。', '提升${0}%攻击加成。']; +export const atkbuff = ['提升${0}点基础攻击力。', '提升${0}%基础攻击力。', '提升${0}%攻击加成。', '提升${0}%伤害加成。']; export const critbuff = ['提升${0}%暴击率。', '提升${0}%暴击伤害。', '提升${0}%暴击减免。', '提升${0}%暴击伤害减免。']; export const defbuff = ['提升${0}点防御。', '提升${0}%防御。', '获得${0}%伤害减免。']; +export const blocbuff = ['提升${0}点格挡。', '提升${0}%格挡。']; export const kuilan = '防御降低${0}%。'; export const liuxue = ['每回合流失%{0}当前生命值', '受(${0}层)流血影响,${1}损失${2}生命值。']; diff --git a/src/config/skill/armor.ts b/src/config/skill/armor.ts index c802d22..b8a9854 100644 --- a/src/config/skill/armor.ts +++ b/src/config/skill/armor.ts @@ -1,6 +1,7 @@ -import { PrePassiveSkill, BuffSkill, CounterSkill } from './base'; +import { PrePassiveSkill, BuffSkill, CounterSkill, StartPassiveSkill } from './base'; import i18n from '../i18n'; import { BattleRole, callDmgReduc, replace } from '@/tool'; +import { BlocPercentBuff } from './buff'; const { t } = i18n; //百花羞的矜持 @@ -70,16 +71,14 @@ export class JinGuangHuShen extends CounterSkill { } } //牢不可破 -export class LaoBuKePo extends PrePassiveSkill { +export class LaoBuKePo extends StartPassiveSkill { 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); + const laobukepo = new BlocPercentBuff(this.name, this.percent, 9999); + owner.putBuff(laobukepo); } } diff --git a/src/config/skill/base.ts b/src/config/skill/base.ts index ca31aeb..3200154 100644 --- a/src/config/skill/base.ts +++ b/src/config/skill/base.ts @@ -1,7 +1,7 @@ import { BattleRole, callReducPercent, replace } from '@/tool'; import { type_boss } from '@/config'; import i18n from '../i18n'; -import { ControlAbnormal } from './buff'; +import { ControlBuff } from './buff'; const { t } = i18n; export interface Skill { order: number; @@ -152,7 +152,7 @@ export abstract class Control extends ActionSkill { const rate = target.type == type_boss ? this.bossRate : this.rate; let log = t('skill.control.1'); if (Math.random() < rate / 100) { - target.putBuff(new ControlAbnormal(this.name, this.last)); + target.putBuff(new ControlBuff(this.name, this.last)); log = replace(t('skill.control.0'), [t(target.type), this.last]); } log = log = replace(t('skill.user'), [t(owner.type), t('skill.' + this.name + '.0')]) + log; diff --git a/src/config/skill/bracers.ts b/src/config/skill/bracers.ts index f4b7e67..4ff0eb5 100644 --- a/src/config/skill/bracers.ts +++ b/src/config/skill/bracers.ts @@ -36,17 +36,16 @@ export class DaLiDan extends StartPassiveSkill { //剧毒 export class JuDu extends CounterSkill { name: string = 'judu'; - rate: number = 80; - percent: number = 50; + rate: number = 60; last: number = 2; desc(): string { - return replace(t('skill.judu.1'), [this.rate, this.last]) + replace(t('skill.kuilan'), [this.percent]); + return replace(t('skill.judu.1'), [this.rate, this.last]); } trigger(owner: BattleRole, target: BattleRole): boolean { return Math.random() < this.rate / 100; } takeEffect(owner: BattleRole, target: BattleRole): void { - const judu = new KuiLan('kuilan', this.percent, this.last); + const judu = new KuiLan('kuilan', this.last); target.putBuff(judu); owner.battleLog(replace(t('skill.judu.2'), [t(target.type), this.last])); } diff --git a/src/config/skill/buff.ts b/src/config/skill/buff.ts index 970ca8b..8ebe780 100644 --- a/src/config/skill/buff.ts +++ b/src/config/skill/buff.ts @@ -1,11 +1,11 @@ -import { BattleRole, callDmgReduc, replace } from '@/tool'; +import { BattleRole, callDmgPercent, callDmgReduc, replace } from '@/tool'; import i18n from '../i18n'; const { t } = i18n; -//增益BUFF +//BUFF export abstract class Buff { order: number = 1; - type: string = 'buff'; + abstract type: string; name: string; layer: number = 1; maxLayer: number = 1; @@ -38,40 +38,57 @@ export abstract class Buff { } abstract takeEffect(owner: BattleRole): void; } -//减益BUFF -export abstract class Debuff extends Buff { - type: string = 'debuff'; +//攻击时触发的BUFF +export abstract class AttackBuff extends Buff { + type: string = 'attackBuff'; } -//异常 -export abstract class Abnormal extends Buff { - type: string = 'abnormal'; +//被攻击时触发的BUFF +export abstract class AttackedBuff extends Buff { + type: string = 'attackedBuff'; } -//百分比增益BUFF -export abstract class PercentBuff extends Buff { +///攻击时触发的百分比BUFF +export abstract class PercentAttackBuff extends AttackBuff { percent: number; constructor(name: string, percent: number, last: number, maxLayer?: number) { super(name, last, maxLayer); this.percent = percent; } } -//百分比减益DEBUFF -export abstract class PercentDebuff extends Debuff { +//被攻击时触发的百分比BUFF +export abstract class PercentAttackedBuff extends AttackedBuff { percent: number; constructor(name: string, percent: number, last: number, maxLayer?: number) { super(name, last, maxLayer); this.percent = percent; } } -//固定数值减益DEBUFF -export abstract class ConstantDebuff extends Debuff { +//被攻击时触发的固定数值BUFF +export abstract class ConstantAttackBuff extends AttackedBuff { number: number; constructor(name: string, number: number, last: number, maxLayer?: number) { super(name, last, maxLayer); this.number = number; } } -//基础攻击百分比增益BUFF -export class BaseAtkPercentBuff extends PercentBuff { +//被攻击时触发的固定数值BUFF +export abstract class ConstantAttackedBuff extends AttackedBuff { + number: number; + constructor(name: string, number: number, last: number, maxLayer?: number) { + super(name, last, maxLayer); + this.number = number; + } +} +//伤害加成增减益BUFF +export class DmgPercentBuff extends PercentAttackBuff { + desc(): string { + return replace(t('skill.atkbuff.3'), [this.percent * this.layer]); + } + takeEffect(owner: BattleRole): void { + owner.extraAttr.dmgPercent = callDmgPercent(owner.extraAttr.dmgPercent, this.percent); + } +} +//基础攻击百分比增减益BUFF +export class BaseAtkPercentBuff extends PercentAttackBuff { desc(): string { return replace(t('skill.atkbuff.1'), [this.percent * this.layer]); } @@ -79,8 +96,8 @@ export class BaseAtkPercentBuff extends PercentBuff { owner.extraAttr.baseAtk += (this.percent / 100) * this.layer * owner.attr.baseAtk; } } -//攻击加成增益BUFF -export class AtkPercentBuff extends PercentBuff { +//攻击加成增减益BUFF +export class AtkPercentBuff extends PercentAttackBuff { desc(): string { return replace(t('skill.atkbuff.2'), [this.percent * this.layer]); } @@ -88,8 +105,8 @@ export class AtkPercentBuff extends PercentBuff { owner.extraAttr.atkPercent += this.percent; } } -//爆伤增益BUFF -export class CritDmgBuff extends PercentBuff { +//爆伤增减益BUFF +export class CritDmgBuff extends PercentAttackBuff { desc(): string { return replace(t('skill.critbuff.1'), [this.percent * this.layer]); } @@ -97,8 +114,8 @@ export class CritDmgBuff extends PercentBuff { owner.extraAttr.critDmg += this.percent * this.layer; } } -//爆伤减免增益BUFF -export class CritDmgReducBuff extends PercentBuff { +//爆伤减免增减益BUFF +export class CritDmgReducBuff extends PercentAttackedBuff { desc(): string { return replace(t('skill.critbuff.3'), [this.percent * this.layer]); } @@ -106,23 +123,26 @@ export class CritDmgReducBuff extends PercentBuff { owner.extraAttr.critDmgReduc += this.percent * this.layer; } } - -//伤害减免增益BUFF -export class DmgReducBuff extends Buff { - dmgReduc: number; - constructor(name: string, dmgReduc: number, last: number, maxLayer?: number) { - super(name, last, maxLayer); - this.dmgReduc = dmgReduc; +//伤害减免增减益BUFF +export class DmgReducBuff extends PercentAttackedBuff { + desc(): string { + return replace(t('skill.defbuff.2'), [this.percent * this.layer]); } + takeEffect(owner: BattleRole): void { + owner.extraAttr.dmgReduc = callDmgReduc(owner.extraAttr.dmgReduc, this.percent); + } +} +//格挡百分比增减益BUFF +export class BlocPercentBuff extends PercentAttackedBuff { desc(): string { - return replace(t('skill.defbuff.2'), [this.dmgReduc * this.layer]); + return replace(t('skill.blocbuff.2'), [this.percent * this.layer]); } takeEffect(owner: BattleRole): void { - owner.extraAttr.dmgReduc = callDmgReduc(owner.extraAttr.dmgReduc, this.dmgReduc); + owner.extraAttr.bloc += Math.ceil(owner.attr.bloc * this.percent); } } //控制异常 -export class ControlAbnormal extends Abnormal { +export class ControlBuff extends AttackBuff { constructor(name: string, last: number) { super(name, last); } @@ -135,7 +155,10 @@ export class ControlAbnormal extends Abnormal { } } //溃烂 -export class KuiLan extends PercentDebuff { +export class KuiLan extends PercentAttackedBuff { + constructor(name: string, last: number) { + super(name, 50, last); + } desc(): string { return replace(t('skill.kongbulingyu.2'), [this.percent]); } @@ -144,7 +167,7 @@ export class KuiLan extends PercentDebuff { } } //恐怖领域 -export class KBLYDebuff extends ConstantDebuff { +export class KBLYDebuff extends ConstantAttackedBuff { desc(): string { return replace(t('skill.kongbulingyu.2'), [this.number]); } @@ -153,7 +176,7 @@ export class KBLYDebuff extends ConstantDebuff { } } //灵感 -export class LingGanBuff extends PercentBuff { +export class LingGanBuff extends PercentAttackBuff { desc(): string { return replace(t('skill.linggan.1'), [this.percent]); } @@ -162,12 +185,12 @@ export class LingGanBuff extends PercentBuff { } } //流血 -export class LiuXue extends Abnormal { +export class LiuXue extends AttackBuff { percent: number = 2; maxLayer: number = 10; constructor(layer: number, last: number) { super('liuxue', last); - this.layer = layer > this.maxLayer ? this.maxLayer :layer; + this.layer = layer > this.maxLayer ? this.maxLayer : layer; } desc(): string { return replace(t('skill.liuxue.0'), [this.percent]); diff --git a/src/config/skill/neck.ts b/src/config/skill/neck.ts index 6e7e936..7da152b 100644 --- a/src/config/skill/neck.ts +++ b/src/config/skill/neck.ts @@ -51,6 +51,7 @@ export class ShaYi extends SufPassiveSkill { atkPercent: number = 3; maxLayer: number = 10; reduc: number = 3; + retains: string[] = ['percent', 'maxLayer']; desc(): string { return replace(st('shayi.1'), [this.atkPercent, this.reduc, this.maxLayer]); } @@ -59,14 +60,14 @@ export class ShaYi extends SufPassiveSkill { } takeEffect(owner: BattleRole, target: BattleRole): void { const shayi = new BaseAtkPercentBuff(this.name, this.atkPercent, 9999, this.maxLayer); - owner.putBuff(shayi); + owner.putBuff(shayi, this.retains); owner.battleLog(replace(st('shayi.2'), [shayi.layer])); } onAtked(owner: BattleRole, target: BattleRole): void { if (target.crit) { const shayi = new BaseAtkPercentBuff(this.name, this.atkPercent, 9999, this.maxLayer); shayi.layer = -1 * this.reduc; - owner.putBuff(shayi); + owner.putBuff(shayi, this.retains); owner.battleLog(replace(st('shayi.3'), [this.reduc])); } } diff --git a/src/config/skill/ring.ts b/src/config/skill/ring.ts index 99cf3ef..f807b2c 100644 --- a/src/config/skill/ring.ts +++ b/src/config/skill/ring.ts @@ -1,7 +1,7 @@ import { SufPassiveSkill, PrePassiveSkill, PassiveSkill, CounterSkill } from './base'; import i18n from '../i18n'; import { BattleRole, callDmgPercent, replace } from '@/tool'; -import { ControlAbnormal, CritDmgBuff, CritDmgReducBuff } from './buff'; +import { ControlBuff, CritDmgBuff, CritDmgReducBuff } from './buff'; const { t } = i18n; //森罗万象 @@ -35,7 +35,7 @@ export class JinGangZhuo extends SufPassiveSkill { return Math.random() < this.rate / 100; } takeEffect(owner: BattleRole, target: BattleRole): void { - target.putBuff(new ControlAbnormal(this.name, this.last)); + target.putBuff(new ControlBuff(this.name, this.last)); owner.battleLog(replace(t('skill.jinggangzhuo.2'), [this.last])); } } @@ -58,7 +58,7 @@ export class FengXie extends SufPassiveSkill { owner.putBuff(fengxie); owner.battleLog(replace(t('skill.fengxie.2'), [fengxie.layer])); } else { - owner.buff.delete(this.name); + owner.attackBuff.delete(this.name); owner.battleLog(t('skill.fengxie.3')); } } diff --git a/src/config/skill/weapon.ts b/src/config/skill/weapon.ts index 0c9bddb..634cb7c 100644 --- a/src/config/skill/weapon.ts +++ b/src/config/skill/weapon.ts @@ -1,8 +1,10 @@ -import { ActionSkill, Attack, PassiveSkill, SufPassiveSkill } from './base'; -import i18n from '../i18n'; +import { ActionSkill, Attack, Control, PassiveSkill, PrePassiveSkill, StartPassiveSkill, SufPassiveSkill } from './base'; +import { createt } from '../i18n'; import { replace, BattleRole } from '@/tool'; -import { ControlAbnormal, LiuXue } from './buff'; -const { t } = i18n; +import { BaseAtkPercentBuff, ControlBuff, CritDmgBuff, DmgPercentBuff, DmgReducBuff, KuiLan, LiuXue } from './buff'; + +const t = createt(''); +const st = createt('skill.'); //冰刃 export class IceBlade extends SufPassiveSkill { name: string = 'iceBlade'; @@ -10,7 +12,7 @@ export class IceBlade extends SufPassiveSkill { percent: number = 1000; last: number = 1; desc(): string { - return replace(t('skill.iceBlade.1'), [this.rate, this.percent, this.last]); + return replace(st('iceBlade.1'), [this.rate, this.percent, this.last]); } trigger(owner: BattleRole, target: BattleRole): boolean { return owner.crit && Math.random() < this.rate / 100; @@ -18,8 +20,8 @@ export class IceBlade extends SufPassiveSkill { takeEffect(owner: BattleRole, target: BattleRole): void { const additional = Math.ceil((owner.atk * this.percent) / 100); target.addHp(-1 * additional); - target.putBuff(new ControlAbnormal(this.name, this.last)); - owner.battleLog(replace(t('skill.iceBlade.2'), [additional, t(target.type), this.last])); + target.putBuff(new ControlBuff(this.name, this.last)); + owner.battleLog(replace(st('iceBlade.2'), [additional, t(target.type), this.last])); } } //见红 @@ -29,13 +31,13 @@ export class SeeRed extends ActionSkill { cd: number = 5; last: number = 5; desc(): string { - return replace(t('skill.seeRed.1'), [this.layer, this.last]) + replace(t('skill.seeRed.2'), [this.cd]); + return replace(st('seeRed.1'), [this.layer, this.last]) + replace(st('seeRed.2'), [this.cd]); } use(owner: BattleRole, target: BattleRole): void { owner.skillPercent = 0; const liuxue = new LiuXue(this.layer, this.last); target.putBuff(liuxue); - owner.battleLog(replace(t('skill.user'), [t(owner.type), t('skill.' + this.name + '.0')]) + replace(t('skill.seeRed.1'), [this.layer, this.last])); + owner.battleLog(replace(st('user'), [t(owner.type), st(this.name + '.0')]) + replace(st('seeRed.1'), [this.layer, this.last])); } } //鳍刺 @@ -45,7 +47,7 @@ export class QiCi extends SufPassiveSkill { layer: number = 3; last: number = 4; desc(): string { - return replace(t('skill.qici.1'), [this.rate, this.layer, this.last]); + return replace(st('qici.1'), [this.rate, this.layer, this.last]); } trigger(owner: BattleRole, target: BattleRole): boolean { return owner.dmg > 0 && Math.random() < this.rate / 100; @@ -53,7 +55,7 @@ export class QiCi extends SufPassiveSkill { takeEffect(owner: BattleRole, target: BattleRole): void { const liuxue = new LiuXue(this.layer, this.last); target.putBuff(liuxue); - owner.battleLog(replace(t('skill.qici.2'), [t(target.type), this.layer, this.last])); + owner.battleLog(replace(st('qici.2'), [t(target.type), this.layer, this.last])); } } //暴虐 @@ -62,7 +64,7 @@ export class BaoNue extends SufPassiveSkill { rate: number = 30; last: number = 2; desc(): string { - return replace(t('skill.baonue.1'), [this.rate, this.last]); + return replace(st('baonue.1'), [this.rate, this.last]); } trigger(owner: BattleRole, target: BattleRole): boolean { return owner.dmg > 0 && Math.random() < this.rate / 100; @@ -70,6 +72,100 @@ export class BaoNue extends SufPassiveSkill { takeEffect(owner: BattleRole, target: BattleRole): void { const liuxue = new LiuXue(9999, this.last); target.putBuff(liuxue); - owner.battleLog(replace(t('skill.baonue.2'), [t(target.type), this.last])); + owner.battleLog(replace(st('baonue.2'), [t(target.type), this.last])); + } +} +//扎心 +export class ZhaXin extends StartPassiveSkill { + name: string = 'zhaxin'; + critDmg: number = 200; + desc(): string { + return replace(st('zhaxin.1'), [this.critDmg]); + } + takeEffect(owner: BattleRole, target: BattleRole): void { + const zhaxin = new CritDmgBuff(this.name, this.critDmg, 9999); + owner.putBuff(zhaxin); + } +} +//鳌之毒 +export class AoZhiDu extends SufPassiveSkill { + name: string = 'aozhidu'; + last: number = 2; + desc(): string { + return replace(st('aozhidu.1'), [this.last]); + } + trigger(owner: BattleRole, target: BattleRole): boolean { + return owner.dmg > 0; + } + takeEffect(owner: BattleRole, target: BattleRole): void { + const aozhidu = new KuiLan('kuilan', this.last); + target.putBuff(aozhidu); + owner.battleLog(replace(st('aozhidu.2'), [t(target.type), this.last])); + } +} +//十九叉 +export class ShiJiuCha extends SufPassiveSkill { + name: string = 'shijiucha'; + times: number = 9; + cout: number = 0; + desc(): string { + return replace(st('shijiucha.1'), [this.times]); + } + trigger(owner: BattleRole, target: BattleRole): boolean { + return owner.dmg > 0; + } + takeEffect(owner: BattleRole, target: BattleRole): void { + this.cout++; + if (this.cout >= 10) { + this.cout = 0; + const dmg = owner.dmg * this.times; + owner.battleLog(replace(st('shijiucha.2'), [t(owner.type), dmg])); + } + } +} +//剑气动四方 +export class JianQiDongSiFang extends StartPassiveSkill { + name: string = 'jianqidongsifang'; + dmgPercent: number = 50; + dmgReduc: number = -20; + desc(): string { + return replace(st('jianqidongsifang.1'), [this.dmgPercent, this.dmgReduc * -1]); + } + takeEffect(owner: BattleRole, target: BattleRole): void { + const buff1 = new DmgPercentBuff(this.name, this.dmgPercent, 9999); + owner.putBuff(buff1); + const buff2 = new DmgReducBuff(this.name, this.dmgPercent, 9999); + owner.putBuff(buff2); + } +} +//暴风雪 +export class BaoFengXue extends Control { + name: string = 'baofengxue'; + cd: number = 10; + last: number = 3; + rate: number = 100; + bossRate: number = 65; + desc(): string { + return replace(st('baofengxue.1'), [this.last, this.cd, this.bossRate]); + } +} + +// 波动杀意 +export class BoDongShaYi extends PrePassiveSkill { + name: string = 'bodongshayi'; + perent: number = 6; + maxLayer: number = 15; + desc(): string { + return replace(st('bodongshayi.1'), [this.perent, this.maxLayer]); + } + trigger(owner: BattleRole, target: BattleRole): boolean { + return true; + } + takeEffect(owner: BattleRole, target: BattleRole): void { + const shayi: any = owner.attackBuff.get('shayi'); + if (shayi) { + shayi.percent = this.perent; + shayi.maxLayer = this.maxLayer; + } } } diff --git a/src/tool/caller/battle.ts b/src/tool/caller/battle.ts index b381305..64a7cad 100644 --- a/src/tool/caller/battle.ts +++ b/src/tool/caller/battle.ts @@ -9,9 +9,8 @@ export class BattleRole { passives: Skills.Skill[] = new Array(); commit; type: string; - buff: Map = new Map(); - debuff: Map = new Map(); - abnormal: Map = new Map(); + attackBuff: Map = new Map(); + attackedBuff: Map = new Map(); //临时状态 action: Skills.ActionSkill | null = null; atk: number = 0; @@ -79,10 +78,9 @@ export class BattleRole { this.passives.forEach((skill) => { skill.beforeAtk(this, target); }); - //攻击前计算自身增益buff和异常buff以及目标减益 - this.callBuff(); - this.callAbnormal(); - target.callDebuff(); + //攻击前计算双方BUFF + this.callAttackBuff(); + target.callAttackedBuff(); this.action?.use(this, target); //攻击后触发的被动技能 this.passives.forEach((skill) => { @@ -166,35 +164,34 @@ export class BattleRole { this.dmg = dmg < 1 ? 1 : dmg; }; - putBuff(buff: Skills.Buff) { + putBuff(buff: Skills.AttackBuff, retains?: string[]) { const name = buff.name; const type = buff.type; const exit: Skills.Buff = this[type].get(name); this[type].set(name, buff); if (exit) { + if (retains) { + retains.forEach((key) => { + buff[key] = exit[key]; + }); + } buff.addLayer(exit.layer); } } - callBuff() { - this.buff.forEach((value: Skills.Buff, key: string) => { - value.takeEffect(this); - }); - } - callAbnormal() { - this.abnormal.forEach((value: Skills.Buff, key: string) => { + callAttackBuff() { + this.attackBuff.forEach((value: Skills.Buff, key: string) => { value.takeEffect(this); }); } - callDebuff() { - this.debuff.forEach((value: Skills.Buff, key: string) => { + callAttackedBuff() { + this.attackedBuff.forEach((value: Skills.Buff, key: string) => { value.takeEffect(this); }); } checkBuff() { - checkBuf(this.buff); - checkBuf(this.abnormal); - checkBuf(this.debuff); + checkBuf(this.attackBuff); + checkBuf(this.attackedBuff); } }