Browse Source

BUFF类代码优化,新增多件神话装备

伤心刺、鳌之毒、十九叉、青光、暴雪、杀意
v1.0
许孟阳 1 week ago
parent
commit
908287b77d
  1. BIN
      public/img/equips/weapon/剑姬.png
  2. 0
      public/img/equips/weapon/十九叉.png
  3. BIN
      public/img/equips/weapon/鸣血.png
  4. 72
      src/config/equips/weapon.ts
  5. 11
      src/config/i18n/zh/euips.ts
  6. 9
      src/config/i18n/zh/skills.ts
  7. 11
      src/config/skill/armor.ts
  8. 4
      src/config/skill/base.ts
  9. 7
      src/config/skill/bracers.ts
  10. 99
      src/config/skill/buff.ts
  11. 5
      src/config/skill/neck.ts
  12. 6
      src/config/skill/ring.ts
  13. 122
      src/config/skill/weapon.ts
  14. 37
      src/tool/caller/battle.ts

BIN
public/img/equips/weapon/剑姬.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

0
public/img/equips/weapon/九灵·元圣.png → public/img/equips/weapon/十九叉.png

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
public/img/equips/weapon/鸣血.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

72
src/config/equips/weapon.ts

@ -34,12 +34,78 @@ export const weaponColorfulCategorys: Categorys[] = [
'kantou', 'kantou',
'weapon/砍头.png', 'weapon/砍头.png',
[ [
{ type: 'atk', valCoefficient: 1.6 }, { type: 'atk', valCoefficient: 1.6 },
{ type: 'crit', valCoefficient: 1.5 }, { type: 'crit', valCoefficient: 1.5 },
{ type: 'critDmg', valCoefficient: 1.5 }, { type: 'critDmg', valCoefficient: 1.5 },
], ],
'BaoNue' '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[] = [ export const weaponUniqueCategorys: WeaponCategory[] = [

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

@ -15,26 +15,25 @@ export const weapon = {
qiuai: ['求爱', '我不是在求你爱我,而是,不接受我的爱,你就要死。 ----琵琶精'], qiuai: ['求爱', '我不是在求你爱我,而是,不接受我的爱,你就要死。 ----琵琶精'],
qici: ['鳍刺', '这美丽簪成了夺命的刺。多少年后,你还记得是谁曾以此为你绾起青丝。'], qici: ['鳍刺', '这美丽簪成了夺命的刺。多少年后,你还记得是谁曾以此为你绾起青丝。'],
kantou: ['砍头', '你知道比砍头更痛苦的是什么吗?'], kantou: ['砍头', '你知道比砍头更痛苦的是什么吗?'],
shangxin: ['伤心刺', '比砍头更痛苦的,是伤心。'],
aozhidu: ['鳌之毒', '相思有毒,曲终无怨。'], aozhidu: ['鳌之毒', '相思有毒,曲终无怨。'],
shijiucha: ['十九叉', '每个人都至少有两面。但据说它的主人会有十九个人格。'],
datiecheng: ['大铁城', '其重如一整座冥铁打造的郢都城。'],
qingguang: ['青光', '你活着看到的最后东西是一道青光。'],
baoxue: ['暴雪', '铁匠将交付时间推延了二十四次。'], baoxue: ['暴雪', '铁匠将交付时间推延了二十四次。'],
shayi: ['杀意', '仇敌,莫让吾听闻汝名。'],
chengba: ['称霸', '霸者不藏其锋,以天地为鞘。'], chengba: ['称霸', '霸者不藏其锋,以天地为鞘。'],
chulian: ['初恋', '我的初恋在月亮之上。 ----八戒'], chulian: ['初恋', '我的初恋在月亮之上。 ----八戒'],
datiecheng: ['大铁城', '其重如一整座冥铁打造的郢都城。'],
duwu: ['黩武', '若未用够最后一丝力气,如何能甘心。'], duwu: ['黩武', '若未用够最后一丝力气,如何能甘心。'],
emeng: ['噩梦', '我最近的噩梦,都和一只猴子有关...... ----增长天王'], emeng: ['噩梦', '我最近的噩梦,都和一只猴子有关...... ----增长天王'],
heifeng: ['黑风', '这把斧子一直不肯相信它的主人已经死去。'], heifeng: ['黑风', '这把斧子一直不肯相信它的主人已经死去。'],
shishen: ['弑神', '从斩妖台流落到地府的禁忌之物,慎用。'], shishen: ['弑神', '从斩妖台流落到地府的禁忌之物,慎用。'],
jianji: ['剑姬', '美人蒙尘,以诗有缘。'],
jlys: ['九灵·元圣', '当坐骑总比没命了强。'], jlys: ['九灵·元圣', '当坐骑总比没命了强。'],
shangxin: ['伤心刺', '比砍头更痛苦的,是伤心。'],
llzx: ['冷龙之心', '长九尺三寸,苍青之气盘绕九十三匝。'], llzx: ['冷龙之心', '长九尺三寸,苍青之气盘绕九十三匝。'],
lmlr: ['狸猫利刃', '比时光还要无情。'], lmlr: ['狸猫利刃', '比时光还要无情。'],
liuying: ['流萤', '若不困顿於林野,必凄惶於道路。'], liuying: ['流萤', '若不困顿於林野,必凄惶於道路。'],
liubuxiang: ['六不像', '汝若身披业火,当一念不起,六欲尽灭。'], liubuxiang: ['六不像', '汝若身披业火,当一念不起,六欲尽灭。'],
longxian: ['龙衔', '天之西北有幽冥无日之国,有龙衔烛而照之也。'], longxian: ['龙衔', '天之西北有幽冥无日之国,有龙衔烛而照之也。'],
mingxue: ['鸣血', '别想让他停下来,它已经饥渴难耐了。'],
qingguang: ['青光', '你活着看到的最后东西是一道青光。'],
shayi: ['杀意', '仇敌,莫让吾听闻汝名。'],
siyu: ['私语', '你爱的不是我,而是灵山项上那个在绚烂中毁灭的金蝉子。 ----唐僧'], siyu: ['私语', '你爱的不是我,而是灵山项上那个在绚烂中毁灭的金蝉子。 ----唐僧'],
tianzhao: ['天照', '神的叹息'], tianzhao: ['天照', '神的叹息'],
wuzhe: ['无遮', '知识自境之心。'], wuzhe: ['无遮', '知识自境之心。'],

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

@ -10,6 +10,12 @@ export const iceBlade = ['冰刃', '暴击时有${0}几率释放冰线冲击,附
export const seeRed = ['见红', '对目标施加${0}层流血,持续${1}回合。', '冷却${0}回合。']; export const seeRed = ['见红', '对目标施加${0}层流血,持续${1}回合。', '冷却${0}回合。'];
export const qici = ['鳍刺', '攻击时有${0}%概率对目标施加${1}层流血,持续${2}回合。', '触发鳍刺,对${0}施加${1}层流血,持续${2}回合。']; export const qici = ['鳍刺', '攻击时有${0}%概率对目标施加${1}层流血,持续${2}回合。', '触发鳍刺,对${0}施加${1}层流血,持续${2}回合。'];
export const baonue = ['暴虐', '攻击时有${0}%概率使目标筋脉爆裂,施加满层流血,持续${1}回合。', '触发暴虐,对${0}施加满层流血,持续${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 = [ export const bhxdjc = [
'百花羞的矜持', '百花羞的矜持',
@ -72,9 +78,10 @@ export const linggan = ['灵感', '每回合回复${0}%生命。'];
export const wankang = ['顽抗', '被攻击时反弹${0}%所受伤害,最大反弹值等于${1}%生命上限。', '${0}触发顽抗,反弹${1}点伤害']; export const wankang = ['顽抗', '被攻击时反弹${0}%所受伤害,最大反弹值等于${1}%生命上限。', '${0}触发顽抗,反弹${1}点伤害'];
export const wuwei = ['五味', '获得${0}%伤害减免。']; 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 critbuff = ['提升${0}%暴击率。', '提升${0}%暴击伤害。', '提升${0}%暴击减免。', '提升${0}%暴击伤害减免。'];
export const defbuff = ['提升${0}点防御。', '提升${0}%防御。', '获得${0}%伤害减免。']; export const defbuff = ['提升${0}点防御。', '提升${0}%防御。', '获得${0}%伤害减免。'];
export const blocbuff = ['提升${0}点格挡。', '提升${0}%格挡。'];
export const kuilan = '防御降低${0}%。'; export const kuilan = '防御降低${0}%。';
export const liuxue = ['每回合流失%{0}当前生命值', '受(${0}层)流血影响,${1}损失${2}生命值。']; export const liuxue = ['每回合流失%{0}当前生命值', '受(${0}层)流血影响,${1}损失${2}生命值。'];

11
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 i18n from '../i18n';
import { BattleRole, callDmgReduc, replace } from '@/tool'; import { BattleRole, callDmgReduc, replace } from '@/tool';
import { BlocPercentBuff } from './buff';
const { t } = i18n; 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'; name: string = 'laobukepo';
percent: number = 200; percent: number = 200;
desc(): string { desc(): string {
return replace(t('skill.laobukepo.1'), [this.percent]); return replace(t('skill.laobukepo.1'), [this.percent]);
} }
trigger(owner: BattleRole, target: BattleRole): boolean {
return true;
}
takeEffect(owner: BattleRole, target: BattleRole): void { 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);
} }
} }

4
src/config/skill/base.ts

@ -1,7 +1,7 @@
import { BattleRole, callReducPercent, replace } from '@/tool'; import { BattleRole, callReducPercent, replace } from '@/tool';
import { type_boss } from '@/config'; import { type_boss } from '@/config';
import i18n from '../i18n'; import i18n from '../i18n';
import { ControlAbnormal } from './buff'; import { ControlBuff } from './buff';
const { t } = i18n; const { t } = i18n;
export interface Skill { export interface Skill {
order: number; order: number;
@ -152,7 +152,7 @@ export abstract class Control extends ActionSkill {
const rate = target.type == type_boss ? this.bossRate : this.rate; const rate = target.type == type_boss ? this.bossRate : this.rate;
let log = t('skill.control.1'); let log = t('skill.control.1');
if (Math.random() < rate / 100) { 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 = 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; log = log = replace(t('skill.user'), [t(owner.type), t('skill.' + this.name + '.0')]) + log;

7
src/config/skill/bracers.ts

@ -36,17 +36,16 @@ export class DaLiDan extends StartPassiveSkill {
//剧毒 //剧毒
export class JuDu extends CounterSkill { export class JuDu extends CounterSkill {
name: string = 'judu'; name: string = 'judu';
rate: number = 80; rate: number = 60;
percent: number = 50;
last: number = 2; last: number = 2;
desc(): string { 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 { trigger(owner: BattleRole, target: BattleRole): boolean {
return Math.random() < this.rate / 100; return Math.random() < this.rate / 100;
} }
takeEffect(owner: BattleRole, target: BattleRole): void { 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); target.putBuff(judu);
owner.battleLog(replace(t('skill.judu.2'), [t(target.type), this.last])); owner.battleLog(replace(t('skill.judu.2'), [t(target.type), this.last]));
} }

99
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'; import i18n from '../i18n';
const { t } = i18n; const { t } = i18n;
//增益BUFF //BUFF
export abstract class Buff { export abstract class Buff {
order: number = 1; order: number = 1;
type: string = 'buff'; abstract type: string;
name: string; name: string;
layer: number = 1; layer: number = 1;
maxLayer: number = 1; maxLayer: number = 1;
@ -38,40 +38,57 @@ export abstract class Buff {
} }
abstract takeEffect(owner: BattleRole): void; abstract takeEffect(owner: BattleRole): void;
} }
//减益BUFF //攻击时触发的BUFF
export abstract class Debuff extends Buff { export abstract class AttackBuff extends Buff {
type: string = 'debuff'; type: string = 'attackBuff';
} }
//异常 //被攻击时触发的BUFF
export abstract class Abnormal extends Buff { export abstract class AttackedBuff extends Buff {
type: string = 'abnormal'; type: string = 'attackedBuff';
} }
//百分比增益BUFF ///攻击时触发的百分比BUFF
export abstract class PercentBuff extends Buff { export abstract class PercentAttackBuff extends AttackBuff {
percent: number; percent: number;
constructor(name: string, percent: number, last: number, maxLayer?: number) { constructor(name: string, percent: number, last: number, maxLayer?: number) {
super(name, last, maxLayer); super(name, last, maxLayer);
this.percent = percent; this.percent = percent;
} }
} }
//百分比减益DEBUFF //被攻击时触发的百分比BUFF
export abstract class PercentDebuff extends Debuff { export abstract class PercentAttackedBuff extends AttackedBuff {
percent: number; percent: number;
constructor(name: string, percent: number, last: number, maxLayer?: number) { constructor(name: string, percent: number, last: number, maxLayer?: number) {
super(name, last, maxLayer); super(name, last, maxLayer);
this.percent = percent; this.percent = percent;
} }
} }
//固定数值减益DEBUFF //被攻击时触发的固定数值BUFF
export abstract class ConstantDebuff extends Debuff { export abstract class ConstantAttackBuff extends AttackedBuff {
number: number; number: number;
constructor(name: string, number: number, last: number, maxLayer?: number) { constructor(name: string, number: number, last: number, maxLayer?: number) {
super(name, last, maxLayer); super(name, last, maxLayer);
this.number = number; this.number = number;
} }
} }
//基础攻击百分比增益BUFF //被攻击时触发的固定数值BUFF
export class BaseAtkPercentBuff extends PercentBuff { 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 { desc(): string {
return replace(t('skill.atkbuff.1'), [this.percent * this.layer]); 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; owner.extraAttr.baseAtk += (this.percent / 100) * this.layer * owner.attr.baseAtk;
} }
} }
//攻击加成增益BUFF //攻击加成增益BUFF
export class AtkPercentBuff extends PercentBuff { export class AtkPercentBuff extends PercentAttackBuff {
desc(): string { desc(): string {
return replace(t('skill.atkbuff.2'), [this.percent * this.layer]); return replace(t('skill.atkbuff.2'), [this.percent * this.layer]);
} }
@ -88,8 +105,8 @@ export class AtkPercentBuff extends PercentBuff {
owner.extraAttr.atkPercent += this.percent; owner.extraAttr.atkPercent += this.percent;
} }
} }
//爆伤增益BUFF //爆伤增益BUFF
export class CritDmgBuff extends PercentBuff { export class CritDmgBuff extends PercentAttackBuff {
desc(): string { desc(): string {
return replace(t('skill.critbuff.1'), [this.percent * this.layer]); 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; owner.extraAttr.critDmg += this.percent * this.layer;
} }
} }
//爆伤减免增益BUFF //爆伤减免增益BUFF
export class CritDmgReducBuff extends PercentBuff { export class CritDmgReducBuff extends PercentAttackedBuff {
desc(): string { desc(): string {
return replace(t('skill.critbuff.3'), [this.percent * this.layer]); 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; owner.extraAttr.critDmgReduc += this.percent * this.layer;
} }
} }
//伤害减免增减益BUFF
//伤害减免增益BUFF export class DmgReducBuff extends PercentAttackedBuff {
export class DmgReducBuff extends Buff { desc(): string {
dmgReduc: number; return replace(t('skill.defbuff.2'), [this.percent * this.layer]);
constructor(name: string, dmgReduc: number, last: number, maxLayer?: number) {
super(name, last, maxLayer);
this.dmgReduc = dmgReduc;
} }
takeEffect(owner: BattleRole): void {
owner.extraAttr.dmgReduc = callDmgReduc(owner.extraAttr.dmgReduc, this.percent);
}
}
//格挡百分比增减益BUFF
export class BlocPercentBuff extends PercentAttackedBuff {
desc(): string { 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 { 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) { constructor(name: string, last: number) {
super(name, last); 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 { desc(): string {
return replace(t('skill.kongbulingyu.2'), [this.percent]); 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 { desc(): string {
return replace(t('skill.kongbulingyu.2'), [this.number]); 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 { desc(): string {
return replace(t('skill.linggan.1'), [this.percent]); 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; percent: number = 2;
maxLayer: number = 10; maxLayer: number = 10;
constructor(layer: number, last: number) { constructor(layer: number, last: number) {
super('liuxue', last); super('liuxue', last);
this.layer = layer > this.maxLayer ? this.maxLayer :layer; this.layer = layer > this.maxLayer ? this.maxLayer : layer;
} }
desc(): string { desc(): string {
return replace(t('skill.liuxue.0'), [this.percent]); return replace(t('skill.liuxue.0'), [this.percent]);

5
src/config/skill/neck.ts

@ -51,6 +51,7 @@ export class ShaYi extends SufPassiveSkill {
atkPercent: number = 3; atkPercent: number = 3;
maxLayer: number = 10; maxLayer: number = 10;
reduc: number = 3; reduc: number = 3;
retains: string[] = ['percent', 'maxLayer'];
desc(): string { desc(): string {
return replace(st('shayi.1'), [this.atkPercent, this.reduc, this.maxLayer]); 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 { takeEffect(owner: BattleRole, target: BattleRole): void {
const shayi = new BaseAtkPercentBuff(this.name, this.atkPercent, 9999, this.maxLayer); 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])); owner.battleLog(replace(st('shayi.2'), [shayi.layer]));
} }
onAtked(owner: BattleRole, target: BattleRole): void { onAtked(owner: BattleRole, target: BattleRole): void {
if (target.crit) { if (target.crit) {
const shayi = new BaseAtkPercentBuff(this.name, this.atkPercent, 9999, this.maxLayer); const shayi = new BaseAtkPercentBuff(this.name, this.atkPercent, 9999, this.maxLayer);
shayi.layer = -1 * this.reduc; shayi.layer = -1 * this.reduc;
owner.putBuff(shayi); owner.putBuff(shayi, this.retains);
owner.battleLog(replace(st('shayi.3'), [this.reduc])); owner.battleLog(replace(st('shayi.3'), [this.reduc]));
} }
} }

6
src/config/skill/ring.ts

@ -1,7 +1,7 @@
import { SufPassiveSkill, PrePassiveSkill, PassiveSkill, CounterSkill } from './base'; import { SufPassiveSkill, PrePassiveSkill, PassiveSkill, CounterSkill } from './base';
import i18n from '../i18n'; import i18n from '../i18n';
import { BattleRole, callDmgPercent, replace } from '@/tool'; import { BattleRole, callDmgPercent, replace } from '@/tool';
import { ControlAbnormal, CritDmgBuff, CritDmgReducBuff } from './buff'; import { ControlBuff, CritDmgBuff, CritDmgReducBuff } from './buff';
const { t } = i18n; const { t } = i18n;
//森罗万象 //森罗万象
@ -35,7 +35,7 @@ export class JinGangZhuo extends SufPassiveSkill {
return Math.random() < this.rate / 100; return Math.random() < this.rate / 100;
} }
takeEffect(owner: BattleRole, target: BattleRole): void { 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])); owner.battleLog(replace(t('skill.jinggangzhuo.2'), [this.last]));
} }
} }
@ -58,7 +58,7 @@ export class FengXie extends SufPassiveSkill {
owner.putBuff(fengxie); owner.putBuff(fengxie);
owner.battleLog(replace(t('skill.fengxie.2'), [fengxie.layer])); owner.battleLog(replace(t('skill.fengxie.2'), [fengxie.layer]));
} else { } else {
owner.buff.delete(this.name); owner.attackBuff.delete(this.name);
owner.battleLog(t('skill.fengxie.3')); owner.battleLog(t('skill.fengxie.3'));
} }
} }

122
src/config/skill/weapon.ts

@ -1,8 +1,10 @@
import { ActionSkill, Attack, PassiveSkill, SufPassiveSkill } from './base'; import { ActionSkill, Attack, Control, PassiveSkill, PrePassiveSkill, StartPassiveSkill, SufPassiveSkill } from './base';
import i18n from '../i18n'; import { createt } from '../i18n';
import { replace, BattleRole } from '@/tool'; import { replace, BattleRole } from '@/tool';
import { ControlAbnormal, LiuXue } from './buff'; import { BaseAtkPercentBuff, ControlBuff, CritDmgBuff, DmgPercentBuff, DmgReducBuff, KuiLan, LiuXue } from './buff';
const { t } = i18n;
const t = createt('');
const st = createt('skill.');
//冰刃 //冰刃
export class IceBlade extends SufPassiveSkill { export class IceBlade extends SufPassiveSkill {
name: string = 'iceBlade'; name: string = 'iceBlade';
@ -10,7 +12,7 @@ export class IceBlade extends SufPassiveSkill {
percent: number = 1000; percent: number = 1000;
last: number = 1; last: number = 1;
desc(): string { 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 { trigger(owner: BattleRole, target: BattleRole): boolean {
return owner.crit && Math.random() < this.rate / 100; return owner.crit && Math.random() < this.rate / 100;
@ -18,8 +20,8 @@ export class IceBlade extends SufPassiveSkill {
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
const additional = Math.ceil((owner.atk * this.percent) / 100); const additional = Math.ceil((owner.atk * this.percent) / 100);
target.addHp(-1 * additional); target.addHp(-1 * additional);
target.putBuff(new ControlAbnormal(this.name, this.last)); target.putBuff(new ControlBuff(this.name, this.last));
owner.battleLog(replace(t('skill.iceBlade.2'), [additional, t(target.type), 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; cd: number = 5;
last: number = 5; last: number = 5;
desc(): string { 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 { use(owner: BattleRole, target: BattleRole): void {
owner.skillPercent = 0; owner.skillPercent = 0;
const liuxue = new LiuXue(this.layer, this.last); const liuxue = new LiuXue(this.layer, this.last);
target.putBuff(liuxue); 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; layer: number = 3;
last: number = 4; last: number = 4;
desc(): string { 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 { trigger(owner: BattleRole, target: BattleRole): boolean {
return owner.dmg > 0 && Math.random() < this.rate / 100; return owner.dmg > 0 && Math.random() < this.rate / 100;
@ -53,7 +55,7 @@ export class QiCi extends SufPassiveSkill {
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
const liuxue = new LiuXue(this.layer, this.last); const liuxue = new LiuXue(this.layer, this.last);
target.putBuff(liuxue); 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; rate: number = 30;
last: number = 2; last: number = 2;
desc(): string { 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 { trigger(owner: BattleRole, target: BattleRole): boolean {
return owner.dmg > 0 && Math.random() < this.rate / 100; return owner.dmg > 0 && Math.random() < this.rate / 100;
@ -70,6 +72,100 @@ export class BaoNue extends SufPassiveSkill {
takeEffect(owner: BattleRole, target: BattleRole): void { takeEffect(owner: BattleRole, target: BattleRole): void {
const liuxue = new LiuXue(9999, this.last); const liuxue = new LiuXue(9999, this.last);
target.putBuff(liuxue); 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;
}
} }
} }

37
src/tool/caller/battle.ts

@ -9,9 +9,8 @@ export class BattleRole {
passives: Skills.Skill[] = new Array(); passives: Skills.Skill[] = new Array();
commit; commit;
type: string; type: string;
buff: Map<string, Skills.Buff> = new Map(); attackBuff: Map<string, Skills.AttackedBuff> = new Map();
debuff: Map<string, Skills.Buff> = new Map(); attackedBuff: Map<string, Skills.AttackedBuff> = new Map();
abnormal: Map<string, Skills.Buff> = new Map();
//临时状态 //临时状态
action: Skills.ActionSkill | null = null; action: Skills.ActionSkill | null = null;
atk: number = 0; atk: number = 0;
@ -79,10 +78,9 @@ export class BattleRole {
this.passives.forEach((skill) => { this.passives.forEach((skill) => {
skill.beforeAtk(this, target); skill.beforeAtk(this, target);
}); });
//攻击前计算自身增益buff和异常buff以及目标减益 //攻击前计算双方BUFF
this.callBuff(); this.callAttackBuff();
this.callAbnormal(); target.callAttackedBuff();
target.callDebuff();
this.action?.use(this, target); this.action?.use(this, target);
//攻击后触发的被动技能 //攻击后触发的被动技能
this.passives.forEach((skill) => { this.passives.forEach((skill) => {
@ -166,35 +164,34 @@ export class BattleRole {
this.dmg = dmg < 1 ? 1 : dmg; this.dmg = dmg < 1 ? 1 : dmg;
}; };
putBuff(buff: Skills.Buff) { putBuff(buff: Skills.AttackBuff, retains?: string[]) {
const name = buff.name; const name = buff.name;
const type = buff.type; const type = buff.type;
const exit: Skills.Buff = this[type].get(name); const exit: Skills.Buff = this[type].get(name);
this[type].set(name, buff); this[type].set(name, buff);
if (exit) { if (exit) {
if (retains) {
retains.forEach((key) => {
buff[key] = exit[key];
});
}
buff.addLayer(exit.layer); buff.addLayer(exit.layer);
} }
} }
callBuff() { callAttackBuff() {
this.buff.forEach((value: Skills.Buff, key: string) => { this.attackBuff.forEach((value: Skills.Buff, key: string) => {
value.takeEffect(this);
});
}
callAbnormal() {
this.abnormal.forEach((value: Skills.Buff, key: string) => {
value.takeEffect(this); value.takeEffect(this);
}); });
} }
callDebuff() { callAttackedBuff() {
this.debuff.forEach((value: Skills.Buff, key: string) => { this.attackedBuff.forEach((value: Skills.Buff, key: string) => {
value.takeEffect(this); value.takeEffect(this);
}); });
} }
checkBuff() { checkBuff() {
checkBuf(this.buff); checkBuf(this.attackBuff);
checkBuf(this.abnormal); checkBuf(this.attackedBuff);
checkBuf(this.debuff);
} }
} }

Loading…
Cancel
Save