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.
84 lines
2.9 KiB
84 lines
2.9 KiB
import { PrePassiveSkill, BuffSkill, CounterSkill, StartPassiveSkill } from './base'; |
|
import i18n from '../i18n'; |
|
import { BattleRole, callDmgReduc, replace } from '@/tool'; |
|
import { BlocPercentBuff } from './buff'; |
|
const { t } = i18n; |
|
|
|
//百花羞的矜持 |
|
export class BHXDJC extends PrePassiveSkill { |
|
name: string = 'bhxdjc'; |
|
hpPercent: number = 60; |
|
shieldPercentOfHp: number = 80; |
|
cd: number = 999; |
|
desc(): string { |
|
return replace(t('skill.bhxdjc.1'), [this.hpPercent, this.shieldPercentOfHp]); |
|
} |
|
trigger(owner: BattleRole, target: BattleRole): boolean { |
|
return owner.attr.curHp / owner.attr.hp < this.hpPercent / 100; |
|
} |
|
takeEffect(owner: BattleRole, target: BattleRole): void { |
|
const shield = Math.ceil((owner.attr.hp * this.shieldPercentOfHp) / 100); |
|
owner.shield += shield; |
|
owner.battleLog(replace(t('skill.bhxdjc.2'), [shield])); |
|
} |
|
} |
|
//铁壁 |
|
export class TieBi extends BuffSkill { |
|
name: string = 'tiebi'; |
|
last: number = 4; |
|
cd: number = 6; |
|
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 = 40; |
|
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])); |
|
} |
|
} |
|
//牢不可破 |
|
export class LaoBuKePo extends StartPassiveSkill { |
|
name: string = 'laobukepo'; |
|
percent: number = 200; |
|
desc(): string { |
|
return replace(t('skill.laobukepo.1'), [this.percent]); |
|
} |
|
takeEffect(owner: BattleRole, target: BattleRole): void { |
|
const laobukepo = new BlocPercentBuff(this.name, this.percent, 9999); |
|
owner.putBuff(laobukepo); |
|
} |
|
}
|
|
|