koishi-plugin-ggcevo-game 1.4.40 → 1.4.41

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.
@@ -80,14 +80,14 @@ export declare const BattleEffectProcessor: {
80
80
  nerfMultiplier: number;
81
81
  messages: string[];
82
82
  };
83
- handleSurvivalInstinctI: (targetBoss: any) => {
83
+ handleSurvivalInstinctI: (targetBoss: any, damageAmount: number) => {
84
84
  messages: string[];
85
85
  targetUpdates: {
86
86
  name: string;
87
87
  updates: Partial<BattleStatistics>;
88
88
  } | null;
89
89
  } | null;
90
- handleSurvivalInstinctII: (targetBoss: any) => {
90
+ handleSurvivalInstinctII: (targetBoss: any, damageAmount: number) => {
91
91
  messages: string[];
92
92
  targetUpdates: {
93
93
  name: string;
@@ -301,8 +301,7 @@ export declare const BattleEffectProcessor: {
301
301
  updates: Partial<BattleStatistics>;
302
302
  } | null;
303
303
  } | null;
304
- /** 复苏处理(免疫死亡并回复) */
305
- handleRevival: (targetBoss: any) => {
304
+ handleRevival: (targetBoss: any, damageAmount: number) => {
306
305
  messages: string[];
307
306
  targetUpdates: {
308
307
  name: string;
package/lib/index.js CHANGED
@@ -2642,22 +2642,25 @@ var BattleEffectProcessor = {
2642
2642
  }
2643
2643
  return null;
2644
2644
  }, "handleStressShellII"),
2645
- handleSurvivalInstinctI: /* @__PURE__ */ __name(function(targetBoss) {
2645
+ // 求生本能I (修改后)
2646
+ handleSurvivalInstinctI: /* @__PURE__ */ __name(function(targetBoss, damageAmount) {
2646
2647
  const messages = [];
2647
2648
  if (!targetBoss.skills.includes("求生本能I")) {
2648
2649
  return null;
2649
2650
  }
2650
2651
  const targetMaxHP = getMaxHPByName(targetBoss.name);
2651
- const currentHP = targetBoss.HP;
2652
- if (currentHP !== 0) {
2652
+ const isLethal = damageAmount >= targetBoss.HP;
2653
+ if (!isLethal) {
2653
2654
  return null;
2654
2655
  }
2655
2656
  const selfHealAmount = Math.round(targetMaxHP * 0.3);
2656
2657
  const updates = {
2657
2658
  hpChange: selfHealAmount,
2659
+ // 回复生命值
2658
2660
  skillsRemoved: ["求生本能I"]
2661
+ // 移除技能
2659
2662
  };
2660
- messages.push(`❤️ 【求生本能I】触发:濒死时,回复${selfHealAmount}点生命值`);
2663
+ messages.push(`❤️ 【求生本能I】触发:承受致命伤害时,回复${selfHealAmount}点生命值`);
2661
2664
  messages.push(`❤️ 【求生本能I】技能移除`);
2662
2665
  return {
2663
2666
  messages,
@@ -2667,14 +2670,15 @@ var BattleEffectProcessor = {
2667
2670
  }
2668
2671
  };
2669
2672
  }, "handleSurvivalInstinctI"),
2670
- handleSurvivalInstinctII: /* @__PURE__ */ __name(function(targetBoss) {
2673
+ // 求生本能II (修改后)
2674
+ handleSurvivalInstinctII: /* @__PURE__ */ __name(function(targetBoss, damageAmount) {
2671
2675
  const messages = [];
2672
2676
  if (!targetBoss.skills.includes("求生本能II")) {
2673
2677
  return null;
2674
2678
  }
2675
2679
  const targetMaxHP = getMaxHPByName(targetBoss.name);
2676
- const currentHP = targetBoss.HP;
2677
- if (currentHP !== 0) {
2680
+ const isLethal = damageAmount >= targetBoss.HP;
2681
+ if (!isLethal) {
2678
2682
  return null;
2679
2683
  }
2680
2684
  const selfHealAmount = Math.round(targetMaxHP * 0.5);
@@ -2684,7 +2688,7 @@ var BattleEffectProcessor = {
2684
2688
  skillsRemoved: ["求生本能II"]
2685
2689
  // 移除的技能
2686
2690
  };
2687
- messages.push(`❤️ 【求生本能II】触发:濒死时,回复${selfHealAmount}点生命值`);
2691
+ messages.push(`❤️ 【求生本能II】触发:承受致命伤害时,回复${selfHealAmount}点生命值`);
2688
2692
  messages.push(`❤️ 【求生本能II】技能移除`);
2689
2693
  return {
2690
2694
  messages,
@@ -3549,13 +3553,14 @@ var BattleEffectProcessor = {
3549
3553
  }
3550
3554
  };
3551
3555
  }, "handleCosmicEnergy"),
3552
- /** 复苏处理(免疫死亡并回复) */
3553
- handleRevival: /* @__PURE__ */ __name(function(targetBoss) {
3556
+ // 复苏 (修改后)
3557
+ handleRevival: /* @__PURE__ */ __name(function(targetBoss, damageAmount) {
3554
3558
  const messages = [];
3555
3559
  if (!targetBoss.skills.includes("复苏")) {
3556
3560
  return null;
3557
3561
  }
3558
- if (targetBoss.HP !== 0) {
3562
+ const isLethal = damageAmount >= targetBoss.HP;
3563
+ if (!isLethal) {
3559
3564
  return null;
3560
3565
  }
3561
3566
  const maxHP = getMaxHPByName(targetBoss.name);
@@ -3566,7 +3571,7 @@ var BattleEffectProcessor = {
3566
3571
  name: targetBoss.name,
3567
3572
  updates: {
3568
3573
  hpChange: healAmount,
3569
- // 回复50%最大生命值
3574
+ // 回复60%最大生命值
3570
3575
  energyChange: energyGain,
3571
3576
  // 回复100%能量
3572
3577
  skillsRemoved: ["复苏"],
@@ -4088,14 +4093,11 @@ function applyPassiveEffects(targetBoss, activeBosses, weaponName, damage, ignor
4088
4093
  { effect: BattleEffectProcessor.handleFrostRegeneration, args: [targetBoss, activeBosses] },
4089
4094
  { effect: BattleEffectProcessor.handleFrostAura, args: [targetBoss, activeBosses] },
4090
4095
  { effect: BattleEffectProcessor.handleSentryGun, args: [targetBoss, activeBosses] },
4091
- { effect: BattleEffectProcessor.handleSurvivalInstinctI, args: [targetBoss] },
4092
- { effect: BattleEffectProcessor.handleSurvivalInstinctII, args: [targetBoss] },
4093
4096
  { effect: BattleEffectProcessor.handleMoldGrowth, args: [targetBoss, activeBosses] },
4094
4097
  { effect: BattleEffectProcessor.handleElectricShockwave, args: [targetBoss] },
4095
4098
  { effect: BattleEffectProcessor.handlePulse, args: [targetBoss, activeBosses] },
4096
4099
  { effect: BattleEffectProcessor.handleFeeding, args: [targetBoss] },
4097
4100
  { effect: BattleEffectProcessor.handleBurningBurrow, args: [targetBoss] },
4098
- { effect: BattleEffectProcessor.handleRevival, args: [targetBoss] },
4099
4101
  { effect: BattleEffectProcessor.handleCosmicEnergy, args: [targetBoss, damage] },
4100
4102
  { effect: BattleEffectProcessor.handleBombardmentGuide, args: [targetBoss] },
4101
4103
  { effect: BattleEffectProcessor.handleOverdriveShield, args: [targetBoss, activeBosses] }
@@ -4180,18 +4182,38 @@ function applyPassiveEffects(targetBoss, activeBosses, weaponName, damage, ignor
4180
4182
  layerReduced = layerReduceResult.reductionSuccess || false;
4181
4183
  }
4182
4184
  let finalDamage = damage;
4185
+ const isLethal = finalDamage >= targetBoss.HP && finalDamage > 0;
4183
4186
  if (!immune) {
4184
4187
  let adjustedNerfMultiplier = totalNerfMultiplier * (1 - ignoreRate);
4185
4188
  const damageMultiplier = 1 + totalBuffMultiplier - adjustedNerfMultiplier;
4186
4189
  finalDamage = Math.max(1, Math.round(damage * damageMultiplier));
4187
- if (finalDamage > 0) {
4188
- updateStatsByName(targetBoss.name, {
4189
- hpChange: -finalDamage
4190
- });
4191
- }
4192
4190
  } else {
4193
4191
  finalDamage = 0;
4194
4192
  }
4193
+ const survivalSkills = [
4194
+ { func: BattleEffectProcessor.handleSurvivalInstinctI, name: "求生本能I" },
4195
+ { func: BattleEffectProcessor.handleSurvivalInstinctII, name: "求生本能II" },
4196
+ { func: BattleEffectProcessor.handleRevival, name: "复苏" }
4197
+ ];
4198
+ let revivalTriggered = false;
4199
+ if (isLethal) {
4200
+ for (const skill of survivalSkills) {
4201
+ if (targetBoss.skills.includes(skill.name)) {
4202
+ const result = skill.func(targetBoss, finalDamage);
4203
+ if (result) {
4204
+ updateStatsByName(result.targetUpdates.name, result.targetUpdates.updates);
4205
+ messages.push(...result.messages);
4206
+ revivalTriggered = true;
4207
+ break;
4208
+ }
4209
+ }
4210
+ }
4211
+ }
4212
+ if (!revivalTriggered && !immune && finalDamage > 0) {
4213
+ updateStatsByName(targetBoss.name, {
4214
+ hpChange: -finalDamage
4215
+ });
4216
+ }
4195
4217
  return {
4196
4218
  finalDamage,
4197
4219
  messages,
@@ -5303,7 +5325,7 @@ function apply(ctx, config) {
5303
5325
  const [itemName, itemData] = entry;
5304
5326
  return itemData.description ? `${itemName} x ${userItem.quantity}:${itemData.description}` : `${itemName} x ${userItem.quantity}`;
5305
5327
  });
5306
- return `【${handle}的背包】
5328
+ return `【${session.username}的背包】
5307
5329
  ${itemDetails.join("\n")}`;
5308
5330
  });
5309
5331
  ctx.command("ggcevo/签到").action(async (argv) => {
@@ -6974,7 +6996,7 @@ ${validTypes.join("、")}`;
6974
6996
  ].join("\n");
6975
6997
  }));
6976
6998
  return [
6977
- `🛡️ ${handle}的武器仓库`,
6999
+ `🛡️ ${session.username}的武器列表`,
6978
7000
  '使用"装备 武器名称"来装备武器',
6979
7001
  "⚡表示当前装备武器",
6980
7002
  "──────────────",
@@ -8151,7 +8173,7 @@ ${validTypes.join("、")}`;
8151
8173
  ]);
8152
8174
  const totalRewards = signData[0]?.totalRewards || 0;
8153
8175
  const redcrystal = careerData[0]?.redcrystal || 0;
8154
- const message = [`【${handle}的仓库】`];
8176
+ const message = [`【${session.username}的仓库】`];
8155
8177
  message.push(`💰 金币:${totalRewards}`);
8156
8178
  if (careerData[0]?.group === "辛迪加海盗") {
8157
8179
  message.push(`🔴 红晶:${redcrystal}`);
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.40",
4
+ "version": "1.4.41",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -19,7 +19,7 @@
19
19
  "peerDependencies": {
20
20
  "@koishijs/plugin-proxy-agent": "^0.3.3",
21
21
  "koishi": "^4.18.7",
22
- "koishi-plugin-sc2arcade-search": "^1.1.18"
22
+ "koishi-plugin-sc2arcade-search": "^1.1.19"
23
23
  },
24
24
  "koishi": {
25
25
  "service": {