koishi-plugin-ggcevo-game 1.6.49 → 1.6.50

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 +7 -1
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -5951,6 +5951,13 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
5951
5951
  isActive: !isDefeated
5952
5952
  }
5953
5953
  );
5954
+ const [damageRecords] = await ctx.database.get("ggcevo_boss_damage", { handle });
5955
+ if (!damageRecords)
5956
+ return {
5957
+ success: false,
5958
+ message: "🚫 无法获取伤害记录,请先攻击一次。",
5959
+ isDefeated: false
5960
+ };
5954
5961
  if (actualDamage > 0) {
5955
5962
  await ctx.database.withTransaction(async () => {
5956
5963
  const signRecords = await ctx.database.get("ggcevo_sign", { handle });
@@ -5958,7 +5965,6 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
5958
5965
  handle,
5959
5966
  totalRewards: (signRecords[0]?.totalRewards || 0) + damage
5960
5967
  }], ["handle"]);
5961
- const [damageRecords] = await ctx.database.get("ggcevo_boss_damage", { handle });
5962
5968
  await ctx.database.upsert("ggcevo_boss_damage", [{
5963
5969
  handle,
5964
5970
  playerName: session.username,
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.6.49",
4
+ "version": "1.6.50",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [