koishi-plugin-ggcevo-game 1.4.48 → 1.4.49

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.
@@ -393,7 +393,10 @@ export declare const BattleEffectProcessor: {
393
393
  buffMultiplier: number;
394
394
  layerAdded: boolean;
395
395
  } | null;
396
- handleWeaponEnergyDrain: (targetBoss: any, weaponName: string) => {
396
+ handleWeaponEnergyDrain: (targetBoss: any, weaponName: string, maxStatsMap: Record<string, {
397
+ maxHP: number;
398
+ maxEnergy: number;
399
+ }>) => {
397
400
  messages: string[];
398
401
  targetUpdates: {
399
402
  name: string;
package/lib/index.js CHANGED
@@ -2781,13 +2781,14 @@ var BattleEffectProcessor = {
2781
2781
  };
2782
2782
  }, "handleColdEffect"),
2783
2783
  // 统一的武器能量消耗处理函数
2784
- handleWeaponEnergyDrain: /* @__PURE__ */ __name(function(targetBoss, weaponName) {
2784
+ handleWeaponEnergyDrain: /* @__PURE__ */ __name(function(targetBoss, weaponName, maxStatsMap) {
2785
2785
  const weaponEnergyDrain = {
2786
2786
  "弧焊枪": 200,
2787
2787
  "DG-3电弧步枪": 500
2788
2788
  };
2789
+ const targetmaxEnergy = maxStatsMap[targetBoss.name].maxEnergy;
2789
2790
  const drainValue = weaponEnergyDrain[weaponName];
2790
- if (!drainValue) {
2791
+ if (!drainValue || targetmaxEnergy === 0) {
2791
2792
  return null;
2792
2793
  }
2793
2794
  const messages = [];
@@ -2983,7 +2984,7 @@ function applyPassiveEffects(targetBoss, activeBosses, weaponName, damage, ignor
2983
2984
  processEffect(effectItem.effect, ...effectItem.args);
2984
2985
  }
2985
2986
  const healingEffects = [
2986
- { effect: BattleEffectProcessor.handleFrostRegeneration, args: [targetBoss, activeBosses] },
2987
+ { effect: BattleEffectProcessor.handleFrostRegeneration, args: [targetBoss, activeBosses, maxStatsMap] },
2987
2988
  { effect: BattleEffectProcessor.handleFrostAura, args: [targetBoss, activeBosses] },
2988
2989
  { effect: BattleEffectProcessor.handleSentryGun, args: [targetBoss, activeBosses] },
2989
2990
  { effect: BattleEffectProcessor.handleMoldGrowth, args: [targetBoss, activeBosses] },
@@ -3056,7 +3057,7 @@ function applyPassiveEffects(targetBoss, activeBosses, weaponName, damage, ignor
3056
3057
  }
3057
3058
  coldLayerAdded = coldResult.layerAdded;
3058
3059
  }
3059
- const energyDrainResult = BattleEffectProcessor.handleWeaponEnergyDrain(targetBoss, weaponName);
3060
+ const energyDrainResult = BattleEffectProcessor.handleWeaponEnergyDrain(targetBoss, weaponName, maxStatsMap);
3060
3061
  if (energyDrainResult) {
3061
3062
  messages.push(...energyDrainResult.messages);
3062
3063
  if (energyDrainResult.targetUpdates) {
@@ -8854,6 +8855,57 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
8854
8855
  return "购买过程中发生错误,请稍后再试";
8855
8856
  }
8856
8857
  });
8858
+ ctx.command("ggcevo/打开军械库防爆门").action(async (argv) => {
8859
+ const session = argv.session;
8860
+ const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
8861
+ if (!profile) return "🔒 请先绑定游戏句柄。";
8862
+ const { regionId, realmId, profileId } = profile;
8863
+ const handle = `${regionId}-S2-${realmId}-${profileId}`;
8864
+ const isBlacklisted = await ctx.database.get("ggcevo_blacklist", { handle });
8865
+ if (isBlacklisted.length > 0) return "⛔ 您已被列入黑名单。";
8866
+ const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
8867
+ if (!careerData || careerData.group !== "人类联盟") {
8868
+ return "⚠️ 您不属于人类阵营,无法执行此操作";
8869
+ }
8870
+ const validCareers = ["警卫", "警卫长", "情报副官"];
8871
+ if (!careerData.career || !validCareers.includes(careerData.career)) {
8872
+ return `⚠️ 您的职业(${careerData.career || "未设置"})不是警卫、警卫长或情报副官`;
8873
+ }
8874
+ const [permission] = await ctx.database.get("ggcevo_permissions", { handle });
8875
+ if (!permission || !permission.explosiondoorauthority || permission.explosiondoorauthority < 1) {
8876
+ return "⚠️ 您没有操作军械库防爆门的权限";
8877
+ }
8878
+ const userWeapons = await ctx.database.get("ggcevo_weapons", { handle });
8879
+ const ownedLegendaryIds = userWeapons.filter((weapon) => weapon.weaponId >= 101 && weapon.weaponId <= 108).map((weapon) => weapon.weaponId);
8880
+ const allLegendaryWeapons = Object.entries(weaponConfig).filter(([_, config2]) => config2.category === "传奇武器").map(([name2, config2]) => ({ name: name2, ...config2 }));
8881
+ const availableLegendaryWeapons = allLegendaryWeapons.filter((weapon) => !ownedLegendaryIds.includes(weapon.id));
8882
+ if (availableLegendaryWeapons.length === 0) {
8883
+ return "⚠️ 您已经拥有所有传奇武器,无法获得新武器。";
8884
+ }
8885
+ const randomIndex = Math.floor(Math.random() * availableLegendaryWeapons.length);
8886
+ const awardedWeapon = availableLegendaryWeapons[randomIndex];
8887
+ await ctx.database.withTransaction(async () => {
8888
+ await ctx.database.set("ggcevo_permissions", { handle }, {
8889
+ explosiondoorauthority: permission.explosiondoorauthority - 1
8890
+ });
8891
+ await ctx.database.upsert("ggcevo_weapons", [{
8892
+ handle,
8893
+ weaponId: awardedWeapon.id,
8894
+ level: 0,
8895
+ modificationSlots: 1,
8896
+ installedMods: [],
8897
+ equipped: false
8898
+ }]);
8899
+ });
8900
+ return [
8901
+ `🎉 军械库防爆门已打开!`,
8902
+ `✨ 您获得了传奇武器:${awardedWeapon.name}`,
8903
+ `🔧 武器类型:${awardedWeapon.type}`,
8904
+ `⚔️ 基础伤害:${awardedWeapon.damage}`,
8905
+ `🔮 特殊效果:${awardedWeapon.specialeffect || "无"}`,
8906
+ `📖 描述:${awardedWeapon.description}`
8907
+ ].join("\n");
8908
+ });
8857
8909
  }
8858
8910
  __name(apply, "apply");
8859
8911
  // Annotate the CommonJS export names for ESM import in node:
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.48",
4
+ "version": "1.4.49",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [