koishi-plugin-smmcat-gensokyo 0.0.15 → 0.0.16

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 +5 -10
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -1280,8 +1280,11 @@ MP:${item.mp}/${item.maxMp + item.gain.maxMp}`);
1280
1280
  await session.send(msgTemp);
1281
1281
  }, "msg");
1282
1282
  const aynchronize = /* @__PURE__ */ __name((agent) => {
1283
- User.userTempData[agent.userId].hp = agent.hp;
1283
+ User.userTempData[agent.userId].hp = agent.hp > 0 ? agent.hp : 0;
1284
1284
  User.userTempData[agent.userId].mp = agent.mp;
1285
+ if (User.userTempData[agent.userId].hp <= 0) {
1286
+ User.userTempData[agent.userId].isDie = true;
1287
+ }
1285
1288
  }, "aynchronize");
1286
1289
  if (tempData.isPK) {
1287
1290
  if (overInfo.win == "self") {
@@ -1289,10 +1292,6 @@ MP:${item.mp}/${item.maxMp + item.gain.maxMp}`);
1289
1292
  for (const agent of allList) {
1290
1293
  aynchronize(agent);
1291
1294
  if (agent.for == "self") {
1292
- if (agent.hp <= 0) {
1293
- User.userTempData[agent.userId].hp = 0;
1294
- User.userTempData[agent.userId].isDie = true;
1295
- }
1296
1295
  await User.giveExp(agent.userId, 20, async (val) => await msg(val));
1297
1296
  await User.giveMonetary(agent.userId, 5);
1298
1297
  }
@@ -1302,10 +1301,6 @@ MP:${item.mp}/${item.maxMp + item.gain.maxMp}`);
1302
1301
  for (const agent of allList) {
1303
1302
  aynchronize(agent);
1304
1303
  if (agent.for == "goal") {
1305
- if (agent.hp <= 0) {
1306
- User.userTempData[agent.userId].hp = 0;
1307
- User.userTempData[agent.userId].isDie = true;
1308
- }
1309
1304
  await User.giveExp(agent.userId, 20, async (val) => await msg(val));
1310
1305
  await User.giveMonetary(agent.userId, 5);
1311
1306
  }
@@ -1331,10 +1326,10 @@ MP:${item.mp}/${item.maxMp + item.gain.maxMp}`);
1331
1326
  });
1332
1327
  }
1333
1328
  });
1334
- await session.send(`小队获得${val}EXP、${monetary}货币!`);
1335
1329
  for (const agent of selfList) {
1336
1330
  aynchronize(agent);
1337
1331
  if (overInfo.win == "self") {
1332
+ await session.send(`小队获得${val}EXP、${monetary}货币!`);
1338
1333
  await User.giveExp(agent.userId, val, async (val2) => await msg(val2));
1339
1334
  await User.giveMonetary(agent.userId, monetary);
1340
1335
  props.length && await User.giveProps(agent.userId, props, async (val2) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-smmcat-gensokyo",
3
3
  "description": "名为《幻想乡》的文字冒险游戏",
4
- "version": "0.0.15",
4
+ "version": "0.0.16",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [