|
|
@ -1,8 +1,9 @@ |
|
|
|
import { SufPassiveSkill, PassiveSkill, PrePassiveSkill, CounterSkill } from './base'; |
|
|
|
import { SufPassiveSkill, PrePassiveSkill, CounterSkill } from './base'; |
|
|
|
import i18n from '../i18n'; |
|
|
|
import { createt } from '../i18n'; |
|
|
|
import { BattleRole, replace } from '@/tool'; |
|
|
|
import { BattleRole, replace } from '@/tool'; |
|
|
|
import { BaseAtkPercentBuff, DmgReducBuff } from './buff'; |
|
|
|
import { BaseAtkPercentBuff, DmgReducBuff } from './buff'; |
|
|
|
const { t } = i18n; |
|
|
|
const st = createt('skill.'); |
|
|
|
|
|
|
|
const t = createt(''); |
|
|
|
|
|
|
|
|
|
|
|
//断
|
|
|
|
//断
|
|
|
|
export class Duan extends SufPassiveSkill { |
|
|
|
export class Duan extends SufPassiveSkill { |
|
|
@ -11,14 +12,14 @@ export class Duan extends SufPassiveSkill { |
|
|
|
order: number = 999; |
|
|
|
order: number = 999; |
|
|
|
dmg: number = 999999999; |
|
|
|
dmg: number = 999999999; |
|
|
|
desc(): string { |
|
|
|
desc(): string { |
|
|
|
return replace(t('skill.duan.1'), [this.hpPercent]); |
|
|
|
return replace(st('duan.1'), [this.hpPercent]); |
|
|
|
} |
|
|
|
} |
|
|
|
trigger(owner: BattleRole, target: BattleRole): boolean { |
|
|
|
trigger(owner: BattleRole, target: BattleRole): boolean { |
|
|
|
return owner.dmg > 0 && target.attr.curHp / target.attr.hp < this.hpPercent / 100; |
|
|
|
return owner.dmg > 0 && target.attr.curHp / target.attr.hp < this.hpPercent / 100; |
|
|
|
} |
|
|
|
} |
|
|
|
takeEffect(owner: BattleRole, target: BattleRole): void { |
|
|
|
takeEffect(owner: BattleRole, target: BattleRole): void { |
|
|
|
target.addHp(-1 * this.dmg); |
|
|
|
target.addHp(-1 * this.dmg); |
|
|
|
owner.battleLog(replace(t('skill.duan.2'), [this.hpPercent, this.dmg])); |
|
|
|
owner.battleLog(replace(st('duan.2'), [this.hpPercent, this.dmg])); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//红眼
|
|
|
|
//红眼
|
|
|
@ -28,7 +29,7 @@ export class HongYan extends PrePassiveSkill { |
|
|
|
atk: number = 2000; |
|
|
|
atk: number = 2000; |
|
|
|
atkPercent: number = 200; |
|
|
|
atkPercent: number = 200; |
|
|
|
desc(): string { |
|
|
|
desc(): string { |
|
|
|
return replace(t('skill.hongyan.1'), [this.hpPercent, this.atk, this.atkPercent]); |
|
|
|
return replace(st('hongyan.1'), [this.hpPercent, this.atk, this.atkPercent]); |
|
|
|
} |
|
|
|
} |
|
|
|
trigger(owner: BattleRole, target: BattleRole): boolean { |
|
|
|
trigger(owner: BattleRole, target: BattleRole): boolean { |
|
|
|
return owner.attr.curHp / owner.attr.hp < this.hpPercent / 100; |
|
|
|
return owner.attr.curHp / owner.attr.hp < this.hpPercent / 100; |
|
|
@ -40,7 +41,7 @@ export class HongYan extends PrePassiveSkill { |
|
|
|
if (this.trigger(owner, target)) { |
|
|
|
if (this.trigger(owner, target)) { |
|
|
|
const additional = Math.ceil((owner.atk * this.atkPercent) / 100); |
|
|
|
const additional = Math.ceil((owner.atk * this.atkPercent) / 100); |
|
|
|
target.addHp(-1 * additional); |
|
|
|
target.addHp(-1 * additional); |
|
|
|
owner.battleLog(replace(t('skill.hongyan.2'), [this.hpPercent, additional])); |
|
|
|
owner.battleLog(replace(st('hongyan.2'), [this.hpPercent, additional])); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -51,7 +52,7 @@ export class ShaYi extends SufPassiveSkill { |
|
|
|
maxLayer: number = 10; |
|
|
|
maxLayer: number = 10; |
|
|
|
reduc: number = 3; |
|
|
|
reduc: number = 3; |
|
|
|
desc(): string { |
|
|
|
desc(): string { |
|
|
|
return replace(t('skill.shayi.1'), [this.atkPercent, this.reduc, this.maxLayer]); |
|
|
|
return replace(st('shayi.1'), [this.atkPercent, this.reduc, this.maxLayer]); |
|
|
|
} |
|
|
|
} |
|
|
|
trigger(owner: BattleRole, target: BattleRole): boolean { |
|
|
|
trigger(owner: BattleRole, target: BattleRole): boolean { |
|
|
|
return owner.dmg > 0; |
|
|
|
return owner.dmg > 0; |
|
|
@ -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); |
|
|
|
owner.battleLog(replace(t('skill.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); |
|
|
|
owner.battleLog(replace(t('skill.shayi.3'), [this.reduc])); |
|
|
|
owner.battleLog(replace(st('shayi.3'), [this.reduc])); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -78,7 +79,7 @@ export class NuMu extends CounterSkill { |
|
|
|
layer: number = 0; |
|
|
|
layer: number = 0; |
|
|
|
maxLayer: number = 10; |
|
|
|
maxLayer: number = 10; |
|
|
|
desc(): string { |
|
|
|
desc(): string { |
|
|
|
return replace(t('skill.numu.1'), [this.atkPercent, this.maxLayer]); |
|
|
|
return replace(st('numu.1'), [this.atkPercent, this.maxLayer]); |
|
|
|
} |
|
|
|
} |
|
|
|
trigger(owner: BattleRole, target: BattleRole): boolean { |
|
|
|
trigger(owner: BattleRole, target: BattleRole): boolean { |
|
|
|
return target.dmg > 0; |
|
|
|
return target.dmg > 0; |
|
|
@ -86,17 +87,17 @@ export class NuMu extends CounterSkill { |
|
|
|
takeEffect(owner: BattleRole, target: BattleRole): void { |
|
|
|
takeEffect(owner: BattleRole, target: BattleRole): void { |
|
|
|
const numu = new BaseAtkPercentBuff(this.name, this.atkPercent, 9999, this.maxLayer); |
|
|
|
const numu = new BaseAtkPercentBuff(this.name, this.atkPercent, 9999, this.maxLayer); |
|
|
|
owner.putBuff(numu); |
|
|
|
owner.putBuff(numu); |
|
|
|
owner.battleLog(replace(t('skill.numu.2'), [numu.layer])); |
|
|
|
owner.battleLog(replace(st('numu.2'), [numu.layer])); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//longteng
|
|
|
|
//龙腾
|
|
|
|
export class LongTeng extends CounterSkill { |
|
|
|
export class LongTeng extends CounterSkill { |
|
|
|
name: string = 'longteng'; |
|
|
|
name: string = 'longteng'; |
|
|
|
dmgReduc: number = 8; |
|
|
|
dmgReduc: number = 8; |
|
|
|
rate: number = 8; |
|
|
|
rate: number = 8; |
|
|
|
shieldPercentOfHp: number = 8; |
|
|
|
shieldPercentOfHp: number = 8; |
|
|
|
desc(): string { |
|
|
|
desc(): string { |
|
|
|
return replace(t('skill.longteng.1'), [this.dmgReduc, this.rate, this.shieldPercentOfHp]); |
|
|
|
return replace(st('longteng.1'), [this.dmgReduc, this.rate, this.shieldPercentOfHp]); |
|
|
|
} |
|
|
|
} |
|
|
|
beforeBattle(owner: BattleRole, target: BattleRole): void { |
|
|
|
beforeBattle(owner: BattleRole, target: BattleRole): void { |
|
|
|
owner.putBuff(new DmgReducBuff(this.name, this.dmgReduc, 9999)); |
|
|
|
owner.putBuff(new DmgReducBuff(this.name, this.dmgReduc, 9999)); |
|
|
@ -107,6 +108,26 @@ export class LongTeng extends CounterSkill { |
|
|
|
takeEffect(owner: BattleRole, target: BattleRole): void { |
|
|
|
takeEffect(owner: BattleRole, target: BattleRole): void { |
|
|
|
const shield = Math.ceil((owner.attr.hp * this.shieldPercentOfHp) / 100); |
|
|
|
const shield = Math.ceil((owner.attr.hp * this.shieldPercentOfHp) / 100); |
|
|
|
owner.shield += shield; |
|
|
|
owner.shield += shield; |
|
|
|
owner.battleLog(replace(t('skill.longteng.2'), [shield])); |
|
|
|
owner.battleLog(replace(st('longteng.2'), [shield])); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//幸运数字
|
|
|
|
|
|
|
|
export class XingYunShuZi extends SufPassiveSkill { |
|
|
|
|
|
|
|
name: string = 'xingyunshuzi'; |
|
|
|
|
|
|
|
num: number = 0; |
|
|
|
|
|
|
|
desc(): string { |
|
|
|
|
|
|
|
return st('xingyunshuzi.1'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
beforeBattle(owner: BattleRole, target: BattleRole): void { |
|
|
|
|
|
|
|
this.num = Math.ceil(Math.random() * 9); |
|
|
|
|
|
|
|
owner.battleLog(replace(st('xingyunshuzi.2'), [t(owner.type), this.num])); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
trigger(owner: BattleRole, target: BattleRole): boolean { |
|
|
|
|
|
|
|
return this.num > 0 && owner.dmg % 10 == this.num; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
takeEffect(owner: BattleRole, target: BattleRole): void { |
|
|
|
|
|
|
|
const dmg = owner.dmg * this.num; |
|
|
|
|
|
|
|
target.addHp(-1 * dmg); |
|
|
|
|
|
|
|
owner.battleLog(replace(st('xingyunshuzi.3'), [t(target.type), dmg])); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|