koishi-plugin-ggcevo-game 1.2.0 → 1.2.1

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 +14 -3
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -2252,10 +2252,10 @@ ${achievementList.join("\n")}`;
2252
2252
  }
2253
2253
  for (const [handle2, reward] of rewardMap) {
2254
2254
  const signPromise = (async () => {
2255
- const [existingSign] = await ctx.database.get("ggcevo_sign", { handle: handle2 });
2256
- if (existingSign) {
2255
+ const [existingSign2] = await ctx.database.get("ggcevo_sign", { handle: handle2 });
2256
+ if (existingSign2) {
2257
2257
  await ctx.database.set("ggcevo_sign", { handle: handle2 }, {
2258
- totalRewards: existingSign.totalRewards + reward.gold
2258
+ totalRewards: existingSign2.totalRewards + reward.gold
2259
2259
  });
2260
2260
  } else {
2261
2261
  await ctx.database.create("ggcevo_sign", {
@@ -2322,6 +2322,17 @@ ${achievementList.join("\n")}`;
2322
2322
  { HP: updatedHP }
2323
2323
  );
2324
2324
  }
2325
+ const [existingSign] = await ctx.database.get("ggcevo_sign", { handle });
2326
+ if (existingSign) {
2327
+ await ctx.database.set("ggcevo_sign", { handle }, {
2328
+ totalRewards: existingSign.totalRewards + damage
2329
+ });
2330
+ } else {
2331
+ await ctx.database.create("ggcevo_sign", {
2332
+ handle,
2333
+ totalRewards: damage
2334
+ });
2335
+ }
2325
2336
  return [
2326
2337
  `🔥 对 ${targetBoss.name} 发起攻击!`,
2327
2338
  `造成伤害:${damage}`,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-ggcevo-game",
3
3
  "description": "《星际争霸2》咕咕虫-evolved地图的专属游戏助手插件,集成天梯排行、抽奖系统、签到福利、兑换商城等丰富功能。",
4
- "version": "1.2.0",
4
+ "version": "1.2.1",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [