koishi-plugin-ggcevo-game 1.2.67 → 1.2.68

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 -6
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -284,7 +284,7 @@ function apply(ctx, config) {
284
284
  type: "爆破物",
285
285
  description: "一种小型的机械装置,用于吸收空间站能量并进行爆破",
286
286
  redCrystalCost: 30,
287
- effects: "仅当主宰为“空间站感染虫”时使用,对“空间站哨枪塔”造成其当前血量值的伤害",
287
+ effects: "当主宰为“空间站感染虫”时才能使用,对“空间站哨枪塔”造成其当前血量值的伤害(获得等同于伤害值的金币)",
288
288
  // 确保结构兼容性
289
289
  price: 0,
290
290
  damage: 0,
@@ -1423,7 +1423,7 @@ function apply(ctx, config) {
1423
1423
  return null;
1424
1424
  }
1425
1425
  let reduction = 0.2;
1426
- let msg = "常规减伤20%";
1426
+ let msg = "常规武器减伤20%";
1427
1427
  if (weaponData.type === "热能武器") {
1428
1428
  reduction = 0.4;
1429
1429
  msg = "热能武器减伤40%";
@@ -1758,12 +1758,13 @@ function apply(ctx, config) {
1758
1758
  }
1759
1759
  }
1760
1760
  __name(checkTransferRequirements, "checkTransferRequirements");
1761
- async function applyItemEffect(handle, itemId) {
1761
+ async function applyItemEffect(session, handle, itemId) {
1762
1762
  const itemConfig2 = Object.values(weaponConfig).find((v) => v.id === itemId);
1763
1763
  if (!itemConfig2) return "该物品未配置效果";
1764
1764
  if (itemId === 1e3) {
1765
1765
  const [SentryTower] = await ctx.database.get("ggcevo_boss", { name: "空间站哨枪塔", isActive: true });
1766
1766
  const [record] = await ctx.database.get("ggcevo_sign", { handle });
1767
+ const [existingRecord] = await ctx.database.get("ggcevo_boss_damage", { handle });
1767
1768
  await ctx.database.set(
1768
1769
  "ggcevo_boss",
1769
1770
  { name: "空间站哨枪塔" },
@@ -1772,11 +1773,18 @@ function apply(ctx, config) {
1772
1773
  HP: 0
1773
1774
  }
1774
1775
  );
1776
+ await ctx.database.upsert("ggcevo_boss_damage", [{
1777
+ handle,
1778
+ playerName: session.username,
1779
+ totalDamage: (existingRecord?.totalDamage || 0) + SentryTower.HP,
1780
+ // 改为实际伤害
1781
+ attackCount: existingRecord?.attackCount || 0
1782
+ }], ["handle"]);
1775
1783
  await ctx.database.upsert("ggcevo_sign", [{
1776
1784
  handle,
1777
1785
  totalRewards: (record?.totalRewards || 0) + SentryTower.HP
1778
1786
  }], ["handle"]);
1779
- return `您使用了E-2能量炸弹,直接摧毁了“空间站哨枪塔”,并且获得了${SentryTower.HP}金币。`;
1787
+ return `您使用了E-2能量炸弹,直接摧毁了“空间站哨枪塔”并且获得了${SentryTower.HP}金币。`;
1780
1788
  }
1781
1789
  }
1782
1790
  __name(applyItemEffect, "applyItemEffect");
@@ -4424,7 +4432,7 @@ ${validTypes.join("、")}`;
4424
4432
  }
4425
4433
  const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
4426
4434
  if (!careerData || careerData.group !== "辛迪加海盗") {
4427
- return "🚫 需要辛迪加海盗阵营权限";
4435
+ return "🚫 该功能需要【辛迪加海盗】阵营权限";
4428
4436
  }
4429
4437
  if (!item) return "请输入要订购的物品名称";
4430
4438
  const config2 = weaponConfig[item];
@@ -4550,7 +4558,7 @@ ${validTypes.join("、")}`;
4550
4558
  await ctx.database.set("ggcevo_warehouse", { handle, itemId: targetItem.itemId }, {
4551
4559
  quantity: Math.max(targetItem.quantity - 1, 0)
4552
4560
  });
4553
- const effectResult = await applyItemEffect(handle, targetItem.itemId);
4561
+ const effectResult = await applyItemEffect(session, handle, targetItem.itemId);
4554
4562
  return `使用成功!消耗 ${itemName} ×1
4555
4563
  剩余数量:${targetItem.quantity - 1}
4556
4564
  ${effectResult}`;
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.67",
4
+ "version": "1.2.68",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [