UNPKG

md5-fight-plus

Version:

32 lines (31 loc) 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.normalAttack = void 0; exports._normalAttack = _normalAttack; const utils_1 = require("../utils"); const general_1 = require("./general"); /**普通攻击 */ const getAttackInfo = (player, atk) => { const info = [ `${player.name}跌跌撞撞A了过去,造成${atk}伤害!!`, `${player.name}释放技能【平A】,造成${atk}点伤害`, ]; return (0, utils_1.getRandomItem)(info); }; function _normalAttack(player) { player.hooks.onAttack.tap({ name: "normal Attack", lives: 1, }, ({ battleField, oneRoundContext }) => { const atk = Math.round(player.runtimeProperty.attack * 0.5); player.battleField.logger.addInfo(getAttackInfo(player, atk), player.hooks.onAttack); return { battleField, oneRoundContext, damage: atk }; }); } exports.normalAttack = { name: "普通攻击", description: "简简单单攻击一下...", mana: 1, run: _normalAttack, type: [general_1.GENERAL_TYPE], };