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.
- package/lib/index.js +7 -1
- 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,
|