koishi-plugin-ggcevo-game 1.3.39 → 1.3.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.
Files changed (2) hide show
  1. package/lib/index.js +106 -24
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -417,7 +417,7 @@ function apply(ctx, config) {
417
417
  type: "能量武器",
418
418
  damage: 25,
419
419
  description: "一种经过改造的电动工具,可对近距离的目标放出高压电",
420
- specialeffect: "",
420
+ specialeffect: "攻击拥有能量的目标将会消耗其100点能量",
421
421
  price: 750,
422
422
  redCrystalCost: 10,
423
423
  isantiair: true,
@@ -457,7 +457,7 @@ function apply(ctx, config) {
457
457
  type: "能量武器",
458
458
  damage: 30,
459
459
  description: "面对护盾目标而开发的武器",
460
- specialeffect: "",
460
+ specialeffect: "攻击护盾目标,无视其50%的减伤效果",
461
461
  price: 1050,
462
462
  redCrystalCost: 15,
463
463
  isantiair: true,
@@ -499,7 +499,7 @@ function apply(ctx, config) {
499
499
  description: "电磁脉冲干扰机械目标和灵能目标",
500
500
  price: 75,
501
501
  redCrystalCost: 0,
502
- effects: "对目标使用后,消耗其所有能量"
502
+ effects: "对目标使用后,消耗其500点能量"
503
503
  }
504
504
  };
505
505
  const modConfig = {
@@ -692,23 +692,23 @@ function apply(ctx, config) {
692
692
  },
693
693
  "能量虹吸": {
694
694
  effect: 0,
695
- description: "当血量大于70%的时候,受到的伤害-40%; 当血量大于30%的时候,受到的伤害-20%"
695
+ description: "当血量≥70%的时候,受到的伤害-40%; 当血量≥30%的时候,受到的伤害-20%"
696
+ },
697
+ "能源虹吸": {
698
+ effect: 0,
699
+ description: "拥有独特的“能量”机制。当“能量”≥80%的时候,受到的伤害-50%; 当“能量”≥50%的时候,受到的伤害-30%"
696
700
  },
697
701
  "电能立场": {
698
702
  effect: 0,
699
- description: "当“能量”大于20%的时候,每次受到攻击有55%的概率免疫此次伤害(无法免疫寒冷伤害); 每拥有一层“寒冷”则降低5%的概率"
703
+ description: "当“能量”≥10%的时候,每次受到攻击有55%的概率免疫此次伤害(无法免疫寒冷伤害); 每拥有一层“寒冷”则降低5%的概率"
700
704
  },
701
705
  "电能冲击波": {
702
706
  effect: 0,
703
707
  description: "每次受到攻击时,自身回复100点“能量”"
704
708
  },
705
- "能源虹吸": {
706
- effect: 0,
707
- description: "拥有独特的“能量”机制。当“能量”大于80%的时候,受到的伤害-50%; 当“能量”大于50%的时候,受到的伤害-30%"
708
- },
709
709
  "脉冲": {
710
710
  effect: 0,
711
- description: "当“能量”大于80%的时候,每次受到攻击有60%的概率回复所有异形100点HP; 每拥有一层“寒冷”则降低5%的概率"
711
+ description: "当“能量”≥80%的时候,每次受到攻击有60%的概率回复所有异形100点HP; 每拥有一层“寒冷”则降低5%的概率"
712
712
  },
713
713
  "能量黑洞": {
714
714
  effect: 0,
@@ -1181,11 +1181,20 @@ function apply(ctx, config) {
1181
1181
  "成人之美": {
1182
1182
  id: 1,
1183
1183
  type: "可重复任务",
1184
- description: "每一个成功人士的背后总有默默付出的辅助,而你,我的朋友,理应获得补助",
1184
+ description: "利用【伽马枪】武器对异形目标造成辐射伤害",
1185
1185
  target: 2,
1186
1186
  price: 50,
1187
1187
  redCrystalCost: 0,
1188
1188
  condition: "使用伽马枪攻击异形并成功使辐射层数+1"
1189
+ },
1190
+ "零度之下": {
1191
+ id: 2,
1192
+ type: "可重复任务",
1193
+ description: "利用【零度之下】武器对异形目标造成严寒伤害",
1194
+ target: 2,
1195
+ price: 100,
1196
+ redCrystalCost: 0,
1197
+ condition: "使用零度之下攻击异形并成功使寒冷层数+1"
1189
1198
  }
1190
1199
  };
1191
1200
  async function calculateTotalDamage(ctx2, session, equippedWeapon, targetBoss, options) {
@@ -1918,6 +1927,7 @@ function apply(ctx, config) {
1918
1927
  if (weaponName !== "零度之下" || !(targetBoss.skills.includes("电能导体") || targetBoss.skills.includes("超导体"))) {
1919
1928
  return null;
1920
1929
  }
1930
+ let freezing = false;
1921
1931
  const currentFreezing = targetBoss.freezing || 0;
1922
1932
  if (currentFreezing < 10) {
1923
1933
  const newFreezing = currentFreezing + 1;
@@ -1926,8 +1936,10 @@ function apply(ctx, config) {
1926
1936
  { name: targetBoss.name },
1927
1937
  { freezing: newFreezing }
1928
1938
  );
1939
+ freezing = true;
1929
1940
  return {
1930
- messages: [`❄️ ${targetBoss.name} 获得一层"寒冷"(当前 ${newFreezing}层)`]
1941
+ messages: [`❄️ ${targetBoss.name} 获得一层"寒冷"(当前 ${newFreezing}层)`],
1942
+ freezing
1931
1943
  };
1932
1944
  }
1933
1945
  return null;
@@ -1959,9 +1971,9 @@ function apply(ctx, config) {
1959
1971
  handleEnergySiphon: /* @__PURE__ */ __name((targetBoss, currentHP, maxHP) => {
1960
1972
  if (!targetBoss.skills.includes("能量虹吸")) return null;
1961
1973
  let reduction = 0;
1962
- if (currentHP > maxHP * 0.7) {
1974
+ if (currentHP >= maxHP * 0.7) {
1963
1975
  reduction = 0.4;
1964
- } else if (currentHP > maxHP * 0.3) {
1976
+ } else if (currentHP >= maxHP * 0.3) {
1965
1977
  reduction = 0.2;
1966
1978
  }
1967
1979
  if (reduction > 0) {
@@ -2032,7 +2044,7 @@ function apply(ctx, config) {
2032
2044
  const currentFreezing = targetBoss.freezing || 0;
2033
2045
  let immuneChance = 55 - currentFreezing * 5;
2034
2046
  immuneChance = Math.max(immuneChance, 5);
2035
- if (currentEnergy < 200) {
2047
+ if (currentEnergy < 100) {
2036
2048
  return null;
2037
2049
  }
2038
2050
  const roll = Math.random() * 100;
@@ -2106,12 +2118,57 @@ function apply(ctx, config) {
2106
2118
  }
2107
2119
  return null;
2108
2120
  }, "handlePulse"),
2121
+ // 处理弧焊枪的能量消耗
2122
+ handleArcWelderEffect: /* @__PURE__ */ __name(async (ctx2, targetBoss, weaponName) => {
2123
+ if (weaponName !== "弧焊枪") return null;
2124
+ const currentEnergy = targetBoss.energy || 0;
2125
+ const messages = [];
2126
+ if (currentEnergy > 0) {
2127
+ const energyDrain = Math.min(100, currentEnergy);
2128
+ const newEnergy = currentEnergy - energyDrain;
2129
+ await ctx2.database.set(
2130
+ "ggcevo_boss",
2131
+ { name: targetBoss.name },
2132
+ { energy: newEnergy }
2133
+ );
2134
+ messages.push(`⚡ 【电弧焊接】生效:消耗目标${energyDrain}点能量`);
2135
+ } else {
2136
+ return null;
2137
+ }
2138
+ return { messages };
2139
+ }, "handleArcWelderEffect"),
2140
+ // 处理粒子相位枪的无视减伤效果
2141
+ handleParticlePhaseEffect: /* @__PURE__ */ __name((targetBoss, weaponName, totalMultiplier) => {
2142
+ if (weaponName !== "粒子相位枪" || totalMultiplier >= 0) return null;
2143
+ const messages = [];
2144
+ const hasShieldTag = targetBoss.tags.includes("护盾");
2145
+ if (hasShieldTag) {
2146
+ const originalReduction = Math.abs(totalMultiplier);
2147
+ const effectiveReduction = originalReduction * 0.5;
2148
+ const reducedMultiplier = -effectiveReduction;
2149
+ messages.push(
2150
+ `⚡ 【粒子相位】生效:护盾目标减伤效果减半`,
2151
+ `原减伤:${Math.round(originalReduction * 100)}% → 实际减伤:${Math.round(effectiveReduction * 100)}%`
2152
+ );
2153
+ return {
2154
+ damageMultiplier: reducedMultiplier,
2155
+ messages
2156
+ };
2157
+ } else {
2158
+ return null;
2159
+ }
2160
+ }, "handleParticlePhaseEffect"),
2109
2161
  // 统一处理被动技能
2110
2162
  handlePassives: /* @__PURE__ */ __name(async function(ctx2, targetBoss, initialDamage, currentHP, maxHP, weaponName, weaponData, activeBosses, bossGroup) {
2111
2163
  let messages = [];
2112
2164
  let skillUpdates = [];
2113
2165
  let totalMultiplier = 0;
2114
2166
  let radiationApplied = false;
2167
+ let freezing = false;
2168
+ const arcResult = await this.handleArcWelderEffect(ctx2, targetBoss, weaponName);
2169
+ if (arcResult) {
2170
+ messages.push(...arcResult.messages);
2171
+ }
2115
2172
  const frostEvoResult = this.handleFrostEvolution(targetBoss, weaponName, initialDamage, maxHP);
2116
2173
  if (frostEvoResult) {
2117
2174
  return {
@@ -2185,6 +2242,15 @@ function apply(ctx, config) {
2185
2242
  totalMultiplier += radiationCalc.damageMultiplier;
2186
2243
  messages.push(...radiationCalc.messages);
2187
2244
  }
2245
+ const particleResult = this.handleParticlePhaseEffect(
2246
+ targetBoss,
2247
+ weaponName,
2248
+ totalMultiplier
2249
+ );
2250
+ if (particleResult) {
2251
+ totalMultiplier = particleResult.damageMultiplier;
2252
+ messages.push(...particleResult.messages);
2253
+ }
2188
2254
  const originalMultiplier = totalMultiplier;
2189
2255
  if (originalMultiplier < -1) {
2190
2256
  messages.push(`⚠️ 触发伤害保底机制:强制造成1点伤害`);
@@ -2238,6 +2304,7 @@ function apply(ctx, config) {
2238
2304
  const freezingStackResult = await this.handleFreezingStack(ctx2, targetBoss, weaponName);
2239
2305
  if (freezingStackResult) {
2240
2306
  messages.push(...freezingStackResult.messages);
2307
+ freezing = freezingStackResult.freezing;
2241
2308
  }
2242
2309
  const tagChangeResult = await this.handleConductorTagChange(ctx2, targetBoss, currentHP, maxHP);
2243
2310
  if (tagChangeResult) {
@@ -2258,8 +2325,9 @@ function apply(ctx, config) {
2258
2325
  messages,
2259
2326
  skillUpdates,
2260
2327
  initialDamage: finalDamage,
2261
- radiationApplied
2328
+ radiationApplied,
2262
2329
  // 新增返回辐射应用标记
2330
+ freezing
2263
2331
  };
2264
2332
  }, "handlePassives"),
2265
2333
  // 应用技能更新到数据库(优化合并同名boss的更新)
@@ -2707,11 +2775,11 @@ function apply(ctx, config) {
2707
2775
  success: false,
2708
2776
  message: "您未选择合适的目标。"
2709
2777
  };
2710
- const targetboss = await ctx.database.get("ggcevo_boss", {
2778
+ const [targetboss] = await ctx.database.get("ggcevo_boss", {
2711
2779
  name: target,
2712
2780
  isActive: true
2713
2781
  });
2714
- if (!targetboss.length || targetboss[0].Skillcountpoints === 0 || targetboss[0].tags.includes("建筑") || targetboss[0].tags.includes("重型")) return {
2782
+ if (!targetboss || targetboss?.Skillcountpoints === 0 || targetboss?.tags.includes("建筑") || targetboss?.tags.includes("重型")) return {
2715
2783
  success: false,
2716
2784
  message: "您无法对目标使用。(目标已死亡/目标的技能计数为0/目标拥有“建筑”或“重型”标签)"
2717
2785
  };
@@ -2736,22 +2804,23 @@ function apply(ctx, config) {
2736
2804
  success: false,
2737
2805
  message: "您未选择合适的目标。"
2738
2806
  };
2739
- const targetboss = await ctx.database.get("ggcevo_boss", {
2807
+ const [targetboss] = await ctx.database.get("ggcevo_boss", {
2740
2808
  name: target,
2741
2809
  isActive: true
2742
2810
  });
2743
- if (!targetboss.length || targetboss[0].energy === 0) return {
2811
+ if (!targetboss || targetboss?.energy === 0) return {
2744
2812
  success: false,
2745
2813
  message: "您无法对目标使用。(目标的能量为0)"
2746
2814
  };
2747
2815
  await ctx.database.set(
2748
2816
  "ggcevo_boss",
2749
2817
  { name: target },
2750
- { energy: 0 }
2818
+ { energy: Math.max(targetboss.energy - 500, 0) }
2819
+ // 确保不低于0
2751
2820
  );
2752
2821
  return {
2753
2822
  success: true,
2754
- message: `成功使用 ${itemName},消耗 ${target} 的所有能量`
2823
+ message: `成功使用 ${itemName},消耗 ${target} 500点能量`
2755
2824
  };
2756
2825
  }
2757
2826
  return {
@@ -5159,6 +5228,7 @@ ${validTypes.join("、")}`;
5159
5228
  let currentHP = targetBoss.HP - initialDamage;
5160
5229
  let passiveMessages = [];
5161
5230
  let radiationApplied = false;
5231
+ let freezing = false;
5162
5232
  const passiveResult = await PassiveHandler.handlePassives(
5163
5233
  ctx,
5164
5234
  targetBoss,
@@ -5174,6 +5244,7 @@ ${validTypes.join("、")}`;
5174
5244
  initialDamage = passiveResult.initialDamage;
5175
5245
  passiveMessages.push(...passiveResult.messages);
5176
5246
  radiationApplied = passiveResult.radiationApplied;
5247
+ freezing = passiveResult.freezing;
5177
5248
  if (passiveResult.skillUpdates.length > 0) {
5178
5249
  await PassiveHandler.applySkillUpdates(ctx, passiveResult.skillUpdates);
5179
5250
  }
@@ -5203,6 +5274,17 @@ ${validTypes.join("、")}`;
5203
5274
  progress: (RadiationRecord?.progress || 0) + 1
5204
5275
  }], ["handle"]);
5205
5276
  }
5277
+ if (freezing) {
5278
+ const [freezingRecord] = await ctx.database.get("ggcevo_task", {
5279
+ handle,
5280
+ taskId: 2
5281
+ });
5282
+ await ctx.database.upsert("ggcevo_task", [{
5283
+ handle,
5284
+ taskId: 2,
5285
+ progress: (freezingRecord?.progress || 0) + 1
5286
+ }], ["handle"]);
5287
+ }
5206
5288
  if (isDefeated) {
5207
5289
  if (targetBoss.type === "主宰") {
5208
5290
  await ctx.database.set(
@@ -5464,7 +5546,7 @@ ${scatterEffectMessages.map((m) => `▸ ${m}`).join("\n")}`
5464
5546
  `❤️ ${mainBossHpBar} (${mainBoss.HP}/${bossGroup.main.maxHP})`
5465
5547
  ];
5466
5548
  if (bossGroup.main.energy > 0) {
5467
- result.push(`⚡ 能量:${mainBoss.energy}`);
5549
+ result.push(`⚡ 能量:${mainBoss.energy}/1000`);
5468
5550
  }
5469
5551
  result.push(
5470
5552
  `🏷️ 标签:${mainBoss.tags?.join("、") || "无"}`,
@@ -5490,7 +5572,7 @@ ${scatterEffectMessages.map((m) => `▸ ${m}`).join("\n")}`
5490
5572
  `❤️ ${minionHpBar} (${minion.HP}/${minionConfig?.maxHP || "未知"})`
5491
5573
  ];
5492
5574
  if (minionConfig && minionConfig.energy > 0) {
5493
- minionInfo.push(`⚡ 能量:${minion.energy}`);
5575
+ minionInfo.push(`⚡ 能量:${minion.energy}/1000`);
5494
5576
  }
5495
5577
  minionInfo.push(
5496
5578
  `🏷️ 标签:${minion.tags?.join("、") || "无"}`,
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.3.39",
4
+ "version": "1.3.41",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [