koishi-plugin-smmcat-gensokyo 0.0.37 → 0.0.38

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 +15 -0
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -3507,9 +3507,24 @@ function apply(ctx, config) {
3507
3507
  await session.send(await ctx.puppeteer.render(html));
3508
3508
  });
3509
3509
  ctx.command("幻想乡/打怪逃跑").action(async ({ session }) => {
3510
+ const userData = await User.getUserAttribute(session);
3511
+ if (!userData) return;
3510
3512
  await Queue.add(async () => await BattleData.battleEscape(session));
3511
3513
  });
3512
3514
  ctx.command("幻想乡/传送 <floor:posint>").action(async ({ session }, floor) => {
3515
+ const userData = await User.getUserAttribute(session);
3516
+ if (!userData) return;
3517
+ GensokyoMap.initUserPoistion(session, userData);
3518
+ if (BattleData.isBattle(session)) {
3519
+ await session.send("您正在战斗中,无法移动!");
3520
+ return;
3521
+ }
3522
+ if (BattleData.isTeam(session) && BattleData.teamTemp[session.userId].identity !== "队长") {
3523
+ return `你在队伍中,请等待队长选择移动的位置!`;
3524
+ }
3525
+ if (User.isDie(session.userId)) {
3526
+ return `你已经阵亡,请发送 /补给 进行治疗。`;
3527
+ }
3513
3528
  if (GensokyoMap.getUserCurrentArea(session.userId).type !== "传送门" /* 传送门 */) {
3514
3529
  return "该区域未存在传送门建筑,传送失败!";
3515
3530
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-smmcat-gensokyo",
3
3
  "description": "名为《幻想乡》的文字冒险游戏",
4
- "version": "0.0.37",
4
+ "version": "0.0.38",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [