You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
2.6 KiB
79 lines
2.6 KiB
import { SufPassiveSkill, PrePassiveSkill, CounterSkill, StartPassiveSkill } from './base'; |
|
import i18n from '../i18n'; |
|
import { BattleRole, replace } from '@/tool'; |
|
import { DmgReducBuff, KBLYDebuff, LingGanBuff } from './buff'; |
|
const { t } = i18n; |
|
|
|
//恐怖领域 |
|
export class KongBuLingYu extends StartPassiveSkill { |
|
name: string = 'kongbulingyu'; |
|
defReduc: number = 500; |
|
desc(): string { |
|
return replace(t('skill.kongbulingyu.1'), [this.defReduc]); |
|
} |
|
takeEffect(owner: BattleRole, target: BattleRole): void { |
|
const buff = new KBLYDebuff(this.name, this.defReduc, 9999); |
|
target.putBuff(buff); |
|
} |
|
} |
|
//白骨夫人的庇护 |
|
export class FuRenBiHu extends PrePassiveSkill { |
|
name: string = 'furenbihu'; |
|
cd: number = 999; |
|
hpPercent: number = 30; |
|
last: number = 3; |
|
dmgReduc: number = 100; |
|
desc(): string { |
|
return replace(t('skill.furenbihu.1'), [this.hpPercent, this.dmgReduc, this.last]); |
|
} |
|
trigger(owner: BattleRole, target: BattleRole): boolean { |
|
return owner.attr.curHp / owner.attr.hp < this.hpPercent / 100; |
|
} |
|
takeEffect(owner: BattleRole, target: BattleRole): void { |
|
owner.extraAttr.dmgReduc = this.dmgReduc; |
|
owner.gainLog(replace(t('skill.furenbihu.2'), [this.hpPercent, this.dmgReduc])); |
|
} |
|
} |
|
//灵感 |
|
export class LingGan extends StartPassiveSkill { |
|
name: string = 'linggan'; |
|
percent: number = 1; |
|
desc(): string { |
|
return replace(t('skill.linggan.1'), [this.percent]); |
|
} |
|
takeEffect(owner: BattleRole, target: BattleRole): void { |
|
const linggan = new LingGanBuff(this.name, this.percent, 9999); |
|
owner.putBuff(linggan); |
|
} |
|
} |
|
//顽抗 |
|
export class WanKang extends CounterSkill { |
|
name: string = 'wankang'; |
|
percent: number = 30; |
|
hpPercnet: number = 100; |
|
desc(): string { |
|
return replace(t('skill.wankang.1'), [this.percent, this.hpPercnet]); |
|
} |
|
trigger(owner: BattleRole, target: BattleRole): boolean { |
|
return target.dmg > 0; |
|
} |
|
takeEffect(owner: BattleRole, target: BattleRole): void { |
|
let reflected = Math.ceil((target.baseDmg * this.percent) / 100); |
|
const max = Math.ceil((owner.attr.hp * this.hpPercnet) / 100); |
|
reflected > max && (reflected = max); |
|
target.addHp(-1 * reflected); |
|
owner.extraDmgLog(replace(t('skill.wankang.2'), [t(owner.type), reflected])); |
|
} |
|
} |
|
//五味 |
|
export class WuWei extends StartPassiveSkill { |
|
name: string = 'wuwei'; |
|
dmgReduc: number = 20; |
|
desc(): string { |
|
return replace(t('skill.wuwei.1'), [this.dmgReduc]); |
|
} |
|
takeEffect(owner: BattleRole, target: BattleRole): void { |
|
const wuwei = new DmgReducBuff(this.name, this.dmgReduc, 9999); |
|
owner.putBuff(wuwei); |
|
} |
|
}
|
|
|