xy-server/game/skill/low/QingMianLiaoYa.ts

46 lines
1.5 KiB
TypeScript
Raw Normal View History

2025-04-23 09:34:08 +08:00
import SkillBase from "../core/SkillBase";
import GameUtil from "../../core/GameUtil";
import SKDataUtil from "../../gear/SKDataUtil";
import {EActionOn, EActionType, EAttrTypeL1, EMagicType, ESkillQuality, ESkillType} from "../../role/EEnum";
// 用自己的法力 换 对方的气血
export default class QingMianLiaoYa extends SkillBase {
constructor() {
super();
this.skill_id = ESkillType.QingMianLiaoYa;
this.kind = ESkillType.QingMianLiaoYa;
this.skill_name = '青面獠牙';
this.skill_type = EMagicType.NONE;
this.action_type = EActionType.INITIATIVE;
this.quality = ESkillQuality.LOW;
this.act_on = EActionOn.ENEMY;// 技能作用于 0 all 1 敌人 2 自己人
}
useSkill(brole: any): any {
let cur = brole.getAttr(EAttrTypeL1.MP) || 0;
let max = brole.getAttr(EAttrTypeL1.MP_MAX) || 0;
let sub = Math.ceil(max * 0.95);
if (cur < sub) {
return `[${this.skill_name}]法力不足,无法释放`;
}
brole.subMP(-sub);
return "";
}
getEffect(params: any = null): any {
let level = params.level || 0;
let relive = params.relive || 0;
let qinmi = params.qinmi || 0;
let brole: any = params.brole;
let max = brole.getAttr(EAttrTypeL1.MP_MAX) || 0;
let sub = Math.ceil(max * 0.95);
let ret = SKDataUtil.clone(GameUtil.skillEffect);
let hurt = sub * 0.3;
ret.hurt = Math.round(hurt + (hurt * 0.5 * (relive * 0.01 + 1) ) + (level ** 0.1 / 100 * hurt ) + (qinmi ** 0.01666667 * 0.010248 / (2 + relive * 0.001)));
return ret;
}
}