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.
- package/lib/index.js +14 -3
- 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 [
|
|
2256
|
-
if (
|
|
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:
|
|
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}`,
|