koishi-plugin-maple-warriors 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +7 -7
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -100,7 +100,7 @@ var INITIAL_ITEMS = [
100
100
  function calculateRates(character) {
101
101
  const resistance = (character.toughness / (character.toughness + 90)).toFixed(4);
102
102
  const critRate = (character.crit / (character.crit + 90)).toFixed(4);
103
- const chargeTime = (1 + 720 / (character.agility + 80)).toFixed(2);
103
+ const chargeTime = (1 + 1800 / (7 * character.agility + 200)).toFixed(2);
104
104
  const dodgeRate = (0.2 * character.agility / (character.agility + 90)).toFixed(4);
105
105
  return { resistance, critRate, chargeTime, dodgeRate };
106
106
  }
@@ -1337,17 +1337,17 @@ buff: ${buffEffects} 持续${duration}`;
1337
1337
  ctx.command("猫武士/战斗训练 <target:user>", "与指定用户的角色进行训练战斗(不消耗HP)").example("战斗训练 @火星").action(async ({ session }, target) => {
1338
1338
  const channelId = session.channelId;
1339
1339
  const userId = session.userId;
1340
- let targetUserId = target;
1341
- if (target.includes(":")) {
1342
- const parts = target.split(":");
1343
- targetUserId = parts[parts.length - 1];
1344
- }
1345
1340
  if (battleManager.isBattling(channelId)) {
1346
1341
  return "请等待当前战斗结束!";
1347
1342
  }
1348
- if (!targetUserId) {
1343
+ if (!target) {
1349
1344
  return "请指定训练对手!正确格式:战斗训练 @用户名";
1350
1345
  }
1346
+ let targetUserId = target;
1347
+ if (target.includes(":")) {
1348
+ const parts = target.split(":");
1349
+ targetUserId = parts[parts.length - 1];
1350
+ }
1351
1351
  if (targetUserId === userId) {
1352
1352
  return "不能和自己进行战斗训练!";
1353
1353
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-maple-warriors",
3
3
  "description": "-",
4
- "version": "0.1.1",
4
+ "version": "0.1.3",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [