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.
- package/lib/index.js +15 -0
- 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
|
}
|