UNPKG

md5-fight-plus

Version:

33 lines (32 loc) 1.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.iceArmor = void 0; exports._iceArmor = _iceArmor; const utils_1 = require("../../utils"); const firing_1 = require("../firing"); const getInfo = (player) => { const info = [`${player.name}释放【寒冰护甲】,获得10点护甲值`]; return (0, utils_1.getRandomItem)(info); }; function _iceArmor(player) { const defender = (0, utils_1.getOpponent)(player); const id = player.hooks.onAttack.tap("iceArmor", (props) => { player.hooks.onAdjustArmor.call(10); player.battleField.logger.addInfo(getInfo(player), player.hooks.onAttack); return props; }); const id2 = player.hooks.onUnderAttack.tap("Ice Armor Frostbite", (props) => { defender.hooks.onAdjustFrostbite.call(5); player.battleField.logger.addInfo(`因冰寒护甲,${defender.name}获得【霜蚀】5`); (0, utils_1.removeHookInRoundEnd)(player, id2, "onUnderAttack"); return props; }); (0, utils_1.removeHookInRoundEnd)(player, id, "onAttack"); } exports.iceArmor = { name: "寒冰护甲", description: "获得10点护甲,下一回合中每当受到一次攻击,【霜蚀】5", mana: 3, run: _iceArmor, type: [firing_1.FIRE_TYPE], };