md5-fight-plus
Version:
41 lines (40 loc) • 1.44 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.skill_777 = void 0;
exports._skill_777 = _skill_777;
const utils_1 = require("../../utils");
const _1 = require(".");
const utils_2 = require("../utils");
function _skill_777(player) {
const id = player.hooks.onAttack.tap("777", (props) => {
const roundTimes = player.runtimeContext.roundCount;
let info = `${player.name}释放【777】,正在进行神秘的抽签..`;
const infos = [];
const atk = getAtkAndHp(roundTimes, infos);
infos.push(`\n抽签结束共计造成${atk}伤害!`);
info += infos.join(",") + "!";
player.battleField.logger.addInfo(info);
return Object.assign(Object.assign({}, props), { damage: atk });
});
(0, utils_1.removeHookInRoundEnd)(player, id, "onAttack");
}
exports.skill_777 = {
name: "777",
description: "来一次神奇的赌博!",
mana: 7,
run: _skill_777,
type: [_1.GENERAL_TYPE],
};
const getAtkAndHp = (roundTimes, infos) => {
let atk = roundTimes % 2 === 0 ? ((0, utils_2.getRandomScope)(0, 7 * 3) % 7) * 7 : 0;
const again = (0, utils_2.getRandomScope)(0, 10) >= 7;
infos.push(`【${atk}】`);
if (again) {
infos.push("再来一次!再次进行抽签...");
}
if (again) {
const _atk = getAtkAndHp(roundTimes + 1, infos);
atk += _atk;
}
return atk;
};