koishi-plugin-smmcat-gensokyo 0.0.7 → 0.0.8
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 +20 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1393,8 +1393,8 @@ MP:${item.mp}/${item.maxMp + item.gain.maxMp}`);
|
|
|
1393
1393
|
const monsterName = tempData.goal.filter((item) => item.type == "怪物").map((i) => ({ name: i.name, lv: i.lv }));
|
|
1394
1394
|
monsterName.forEach((item) => {
|
|
1395
1395
|
const monster = Monster.monsterTempData[item.name];
|
|
1396
|
-
if (monster
|
|
1397
|
-
val += monster
|
|
1396
|
+
if (monster) {
|
|
1397
|
+
val += monster.giveExp + monster.giveExp * (item.lv - 1) * 0.2;
|
|
1398
1398
|
}
|
|
1399
1399
|
});
|
|
1400
1400
|
for (const agent of selfList) {
|
|
@@ -1657,6 +1657,24 @@ function apply(ctx, config) {
|
|
|
1657
1657
|
return `[${goal}]信息如下:
|
|
1658
1658
|
` + skillFn[goal].info;
|
|
1659
1659
|
});
|
|
1660
|
+
const temp = {};
|
|
1661
|
+
ctx.command("幻想乡/补给").action(async ({ session }) => {
|
|
1662
|
+
const userData = await User.getUserAttribute(session);
|
|
1663
|
+
if (!userData) return;
|
|
1664
|
+
GensokyoMap.initUserPoistion(session, userData);
|
|
1665
|
+
if (temp[session.userId] == void 0) {
|
|
1666
|
+
temp[session.userId] = 0;
|
|
1667
|
+
}
|
|
1668
|
+
const useTime = Date.now() - temp[session.userId];
|
|
1669
|
+
if (useTime < 36e4) {
|
|
1670
|
+
return `请等待下一个补给时间!剩余${Math.floor(useTime / 6e4)}分钟。`;
|
|
1671
|
+
}
|
|
1672
|
+
temp[session.userId] = Date.now();
|
|
1673
|
+
const { maxHp, maxMp, playName } = User.getUserAttributeByUserId(session.userId);
|
|
1674
|
+
User.userTempData[session.userId].hp = maxHp;
|
|
1675
|
+
User.userTempData[session.userId].mp = maxMp;
|
|
1676
|
+
return playName + `通过补给,目前已恢复HP和MP`;
|
|
1677
|
+
});
|
|
1660
1678
|
}
|
|
1661
1679
|
__name(apply, "apply");
|
|
1662
1680
|
// Annotate the CommonJS export names for ESM import in node:
|