koishi-plugin-ggcevo-game 1.4.47 → 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
@@ -2584,7 +2584,7 @@ var BattleEffectProcessor = {
2584
2584
  if (!targetBoss.skills.includes("灵能构造炉")) {
2585
2585
  return null;
2586
2586
  }
2587
- const baseProbability = 0.01;
2587
+ const baseProbability = 0.05;
2588
2588
  if (Math.random() >= baseProbability) {
2589
2589
  return null;
2590
2590
  }
@@ -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) {
@@ -3347,7 +3348,7 @@ var passiveConfig = {
3347
3348
  },
3348
3349
  "灵能构造炉": {
3349
3350
  type: "状态获得(技能获得)",
3350
- description: "受击时1%概率随机获得以下技能之一:天启超载护盾/塌缩脉冲/地毯式轰炸/轰炸引导"
3351
+ description: "受击时5%概率随机获得以下技能之一:天启超载护盾/塌缩脉冲/地毯式轰炸/轰炸引导"
3351
3352
  },
3352
3353
  "天启超载护盾": {
3353
3354
  type: "生存强化(生命回复)",
@@ -7501,7 +7502,7 @@ ${validTypes.join("、")}`;
7501
7502
  cleanerRewardBroadcast
7502
7503
  );
7503
7504
  });
7504
- ctx.command("ggcevo/攻击假人").option("tags", "-t <tags:string> 添加BOSS标签(逗号分隔)").option("passives", "-p <passives:string> 添加被动技能(逗号分隔)").option("hp", "-l <hp:number> 模拟假人血量").option("energy", "-e <energy:number> 模拟假人能量").action(async (argv) => {
7505
+ ctx.command("ggcevo/攻击假人").option("tags", "-t <tags:string> 添加BOSS标签(逗号分隔)").option("passives", "-p <passives:string> 添加被动技能(逗号分隔)").option("hp", "-l <hp:number> 模拟假人血量").option("energy", "-e <energy:number> 模拟假人能量").option("skillStacks", "-s <stacks:number> 技能层数").option("radiation", "-r <rad:number> 辐射层数").option("cold", "-c <cold:number> 寒冷层数").option("status", "-a <status:number> 状态层数").action(async (argv) => {
7505
7506
  const session = argv.session;
7506
7507
  const { options } = argv;
7507
7508
  let hp = 1e4;
@@ -7512,6 +7513,11 @@ ${validTypes.join("、")}`;
7512
7513
  if (typeof options.energy === "number") {
7513
7514
  energy = Math.max(0, Math.min(options.energy, 1e3));
7514
7515
  }
7516
+ const clampLayer = /* @__PURE__ */ __name((value, max = 100) => typeof value === "number" ? Math.max(0, Math.min(value, max)) : 0, "clampLayer");
7517
+ const skillStacks = clampLayer(options.skillStacks);
7518
+ const radiationLayers = clampLayer(options.radiation);
7519
+ const coldLayers = clampLayer(options.cold);
7520
+ const statusLayers = clampLayer(options.status);
7515
7521
  const parseList = /* @__PURE__ */ __name((str) => str ? str.split(",").map((s) => s.trim()).filter(Boolean) : [], "parseList");
7516
7522
  const tags = parseList(options.tags);
7517
7523
  const passives = parseList(options.passives);
@@ -7528,18 +7534,20 @@ ${validTypes.join("、")}`;
7528
7534
  const dummyBoss = {
7529
7535
  name: "测试假人",
7530
7536
  HP: hp,
7531
- // 使用处理后的血量值
7532
7537
  type: "主宰",
7533
7538
  groupId: 0,
7534
7539
  tags: tags || [],
7535
7540
  skills: passives || [],
7536
- skillStacks: 0,
7537
- radiationLayers: 0,
7538
- coldLayers: 0,
7541
+ skillStacks,
7542
+ // 使用自定义技能层数
7543
+ radiationLayers,
7544
+ // 使用自定义辐射层数
7545
+ coldLayers,
7546
+ // 使用自定义寒冷层数
7539
7547
  energy,
7540
- // 使用处理后的能量值
7541
7548
  isActive: true,
7542
- statusLayers: 0,
7549
+ statusLayers,
7550
+ // 使用自定义状态层数
7543
7551
  lastWeaponName: ""
7544
7552
  };
7545
7553
  const activeBosses = [dummyBoss];
@@ -7553,18 +7561,23 @@ ${validTypes.join("、")}`;
7553
7561
  config,
7554
7562
  equippedWeapon,
7555
7563
  dummyBoss,
7556
- // 目标BOSS
7557
7564
  activeBosses,
7558
- // 活跃BOSS列表
7559
7565
  weaponName
7560
- // 武器名称
7561
7566
  );
7567
+ const layerInfo = [];
7568
+ if (skillStacks > 0) layerInfo.push(`技能层数: ${skillStacks}`);
7569
+ if (radiationLayers > 0) layerInfo.push(`辐射层数: ${radiationLayers}`);
7570
+ if (coldLayers > 0) layerInfo.push(`寒冷层数: ${coldLayers}`);
7571
+ if (statusLayers > 0) layerInfo.push(`状态层数: ${statusLayers}`);
7572
+ const layerDisplay = layerInfo.length > 0 ? `📊 层数状态: ${layerInfo.join(" | ")}` : "";
7562
7573
  return [
7563
7574
  `🎯 使用武器 ${weaponName} 攻击 ${dummyBoss.name}`,
7564
7575
  `❤️ 假人血量:${dummyBoss.HP}`,
7565
7576
  `⚡ 假人能量:${dummyBoss.energy}`,
7566
7577
  options.tags?.length && `🏷️ 模拟标签:${tags.join(", ")}`,
7567
7578
  options.passives?.length && `✨ 模拟被动:${passives.join(", ")}`,
7579
+ layerDisplay,
7580
+ // 添加层数显示
7568
7581
  ...testResult.effectMessage.length > 0 ? [
7569
7582
  `⚡ 攻击效果:
7570
7583
  ${testResult.effectMessage.map((m) => `▸ ${m}`).join("\n")}`
@@ -7578,8 +7591,9 @@ ${testResult.ignoreMessage.map((m) => `▸ ${m}`).join("\n")}`
7578
7591
  ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
7579
7592
  ] : [],
7580
7593
  `📊 理论伤害值:${testResult.initialDamage}${testResult.hasCrit ? "(✨ 暴击)" : ""}`,
7581
- "💡 提示:可添加标签(-t)、被动(-p)、血量(-l)或能量(-e)",
7582
- `ℹ️ 测试假人最大血量:10000 | 最大能量:1000(超限值将自动调整)`
7594
+ "💡 提示:可添加标签(-t)、被动(-p)、血量(-l)、能量(-e)",
7595
+ "💡 层数选项:技能层数(-s)、辐射层数(-r)、寒冷层数(-c)、状态层数(-a)",
7596
+ `ℹ️ 测试假人最大血量:10000 | 最大能量:1000 | 最大层数:100`
7583
7597
  ].filter((line) => line).join("\n");
7584
7598
  } finally {
7585
7599
  Object.keys("测试假人").forEach((key) => delete battleStatsMap[key]);
@@ -8841,6 +8855,57 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
8841
8855
  return "购买过程中发生错误,请稍后再试";
8842
8856
  }
8843
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
+ });
8844
8909
  }
8845
8910
  __name(apply, "apply");
8846
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.47",
4
+ "version": "1.4.49",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [