koishi-plugin-ggcevo-game 1.4.29 → 1.4.30

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 +40 -24
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -3401,12 +3401,16 @@ var PassiveHandler = {
3401
3401
  (b) => b.groupId === targetBoss.groupId && b.HP > 0
3402
3402
  );
3403
3403
  const updates = [];
3404
- const messages = [`🌠 【星界之风】生效:治疗所有存活异形200点血量`];
3404
+ const messages = [`🌠 【星界之风】生效:治疗所有存活异形`];
3405
+ let updatedHP = currentHP;
3405
3406
  for (const member of groupMembers) {
3406
- const maxHP2 = PassiveHandler.getMemberConfig(member.name, bossGroup)?.maxHP;
3407
- if (!maxHP2) continue;
3407
+ const memberConfig = PassiveHandler.getMemberConfig(member.name, bossGroup);
3408
+ if (!memberConfig) continue;
3409
+ const maxMemberHP = memberConfig.maxHP;
3408
3410
  const healAmount = 200;
3409
- const newHP = Math.min(member.HP + healAmount, maxHP2);
3411
+ const actualHeal = Math.min(healAmount, maxMemberHP - member.HP);
3412
+ if (actualHeal <= 0) continue;
3413
+ const newHP = member.HP + actualHeal;
3410
3414
  updates.push(
3411
3415
  ctx.database.set(
3412
3416
  "ggcevo_boss",
@@ -3414,12 +3418,16 @@ var PassiveHandler = {
3414
3418
  { HP: newHP }
3415
3419
  )
3416
3420
  );
3417
- messages.push(`${member.name} +${healAmount}HP`);
3421
+ messages.push(`${member.name} +${actualHeal}HP`);
3422
+ if (member.name === targetBoss.name) {
3423
+ updatedHP = newHP;
3424
+ }
3418
3425
  }
3419
- if (hasPsychicFrenzy && isInFrenzy) {
3426
+ if (updates.length === 0) {
3427
+ return null;
3420
3428
  }
3421
3429
  await Promise.all(updates);
3422
- return { messages, updatedHP: currentHP + 200 };
3430
+ return { messages, updatedHP };
3423
3431
  }
3424
3432
  return null;
3425
3433
  }, "handleStellarWind"),
@@ -3622,30 +3630,38 @@ var PassiveHandler = {
3622
3630
  const groupMembers = activeBosses.filter(
3623
3631
  (b) => b.groupId === targetBoss.groupId && b.HP > 0
3624
3632
  );
3625
- const healAmount = lightbladeStacks * 10;
3633
+ const healPerStack = 10;
3634
+ const totalHeal = lightbladeStacks * healPerStack;
3626
3635
  const updates = [];
3627
3636
  const messages = [`🛡️ 【天启超载护盾】生效:治疗所有存活异形`];
3637
+ let updatedHP = currentHP;
3628
3638
  for (const member of groupMembers) {
3629
- const maxHP = this.getMemberConfig(member.name, bossGroup)?.maxHP;
3630
- if (!maxHP) continue;
3631
- const heal = Math.min(healAmount, maxHP - member.HP);
3632
- if (heal > 0) {
3633
- const newHP = member.HP + heal;
3634
- updates.push(
3635
- ctx.database.set(
3636
- "ggcevo_boss",
3637
- { name: member.name },
3638
- { HP: newHP }
3639
- )
3640
- );
3641
- messages.push(`${member.name} +${heal}HP`);
3639
+ const memberConfig = PassiveHandler.getMemberConfig(member.name, bossGroup);
3640
+ if (!memberConfig) continue;
3641
+ const maxMemberHP = memberConfig.maxHP;
3642
+ const actualHeal = Math.min(totalHeal, maxMemberHP - member.HP);
3643
+ if (actualHeal <= 0) continue;
3644
+ const newHP = member.HP + actualHeal;
3645
+ updates.push(
3646
+ ctx.database.set(
3647
+ "ggcevo_boss",
3648
+ { name: member.name },
3649
+ { HP: newHP }
3650
+ )
3651
+ );
3652
+ messages.push(`${member.name} +${actualHeal}HP`);
3653
+ if (member.name === targetBoss.name) {
3654
+ updatedHP = newHP;
3642
3655
  }
3643
3656
  }
3657
+ if (updates.length === 0) {
3658
+ return null;
3659
+ }
3644
3660
  await Promise.all(updates);
3645
3661
  return {
3646
3662
  messages,
3647
- updatedHP: currentHP + healAmount
3648
- // 不再清除层数
3663
+ updatedHP
3664
+ // 返回当前目标的新HP(如果被治疗)
3649
3665
  };
3650
3666
  }
3651
3667
  return null;
@@ -7318,7 +7334,7 @@ ${validTypes.join("、")}`;
7318
7334
  // 这里添加符号
7319
7335
  ] : [],
7320
7336
  `📊 理论伤害值:${damage}${hasCrit ? " (✨ 暴击)" : ""}`,
7321
- "💡 提示:使用 -t 重甲,生物……(标签之间用英文逗号分隔) 添加测试标签"
7337
+ "💡 提示:使用 -t 重甲,生物(标签之间用英文逗号分隔) 添加测试标签"
7322
7338
  ].filter((line) => line).join("\n");
7323
7339
  });
7324
7340
  ctx.command("ggcevo/伤害榜 [page]", "查看当前主宰伤害排名").usage("输入 伤害榜 [页码] 查看对应页的排行榜,每页10条").action(async (_, page) => {
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.4.29",
4
+ "version": "1.4.30",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [