koishi-plugin-ggcevo-game 1.4.63 → 1.4.65

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 +41 -18
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -467,7 +467,7 @@ var modConfig = {
467
467
  },
468
468
  "破甲模块": {
469
469
  cost: 1250,
470
- effect: "攻击无视目标15%的减伤效果",
470
+ effect: "攻击无视目标10%的减伤效果",
471
471
  exclusiveTo: "",
472
472
  isExclusive: false
473
473
  },
@@ -500,7 +500,7 @@ var modConfig = {
500
500
  },
501
501
  "金刚石瞄准镜": {
502
502
  cost: 2250,
503
- effect: "无视目标50%的减伤效果",
503
+ effect: "无视目标20%的减伤效果",
504
504
  exclusiveTo: "侦察步枪",
505
505
  isExclusive: true
506
506
  },
@@ -4656,7 +4656,7 @@ async function calculateTotalDamage(ctx, session, config, equippedWeapon, target
4656
4656
  const [weaponName, weaponData] = weaponConfigEntry;
4657
4657
  const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
4658
4658
  armorDamageReduction = weaponData.armorDamageReduction || 0;
4659
- if (careerData.career === "猩红杀手" && weaponName === "侦察步枪") {
4659
+ if (careerData?.career === "猩红杀手" && weaponName === "侦察步枪") {
4660
4660
  armorDamageReduction = 0;
4661
4661
  }
4662
4662
  const armorReduction = armorDamageReduction * getArmorByName(targetBoss.name);
@@ -5110,6 +5110,11 @@ async function handleDeathTargets(ctx, deadTargets, killerName, killerHandle) {
5110
5110
  "🏆 伤害排行榜奖励:",
5111
5111
  ...rewardMessages
5112
5112
  );
5113
+ } else {
5114
+ await ctx.database.set("ggcevo_boss", { groupId: deadBoss.groupId }, {
5115
+ isActive: false,
5116
+ HP: 0
5117
+ });
5113
5118
  }
5114
5119
  }
5115
5120
  return {
@@ -5354,16 +5359,16 @@ async function handleIgnoreReductionEffects(ctx, handle, weaponName, targetBoss)
5354
5359
  });
5355
5360
  if (!equippedWeapon?.installedMods) return;
5356
5361
  if (equippedWeapon.installedMods.includes("破甲模块")) {
5357
- ignoreEffects.push(0.15);
5358
- messages.push(`⚡ 【破甲模块】生效:无视15%减伤效果`);
5362
+ ignoreEffects.push(0.1);
5363
+ messages.push(`⚡ 【破甲模块】生效:无视10%减伤效果`);
5359
5364
  }
5360
5365
  if (weaponName === "高斯步枪" && equippedWeapon.installedMods.includes("裂甲核心")) {
5361
5366
  ignoreEffects.push(0.4);
5362
5367
  messages.push(`💥 【裂甲核心】生效:无视40%减伤效果`);
5363
5368
  }
5364
5369
  if (weaponName === "侦察步枪" && equippedWeapon.installedMods.includes("金刚石瞄准镜")) {
5365
- ignoreEffects.push(0.4);
5366
- messages.push(`💥 【金刚石瞄准镜】生效:无视50%减伤效果`);
5370
+ ignoreEffects.push(0.2);
5371
+ messages.push(`💥 【金刚石瞄准镜】生效:无视20%减伤效果`);
5367
5372
  }
5368
5373
  }, "handlePiercingMod");
5369
5374
  handleWeaponEffect();
@@ -5379,10 +5384,6 @@ async function handleIgnoreReductionEffects(ctx, handle, weaponName, targetBoss)
5379
5384
  ignoreEffects.push(0.1);
5380
5385
  messages.push(`🛰️ 【雷达面罩】生效:无视10%减伤效果`);
5381
5386
  }
5382
- if (careerData.career === "猩红杀手" && weaponName === "侦察步枪") {
5383
- ignoreEffects.push(0.2);
5384
- messages.push(`🎯 猩红杀手职业:无视20%减伤效果`);
5385
- }
5386
5387
  }, "handleCareerEffects");
5387
5388
  await handleCareerEffects();
5388
5389
  if (ignoreEffects.length === 0) return { ignoreRate: 0, messages: [] };
@@ -7436,6 +7437,7 @@ ${discountDetails.join("\n")}`,
7436
7437
  return `无效武器分类,可用分类:
7437
7438
  ${Object.keys(categoryStats).join("、")}`;
7438
7439
  }
7440
+ const displayDiscounts = category === "传奇武器" ? discountDetails.filter((d) => !d.includes("蚱蜢优购")) : discountDetails;
7439
7441
  const items = Object.entries(weaponConfig).filter(([_, config2]) => config2.category === category && config2.price !== 0).map(([name2, config2]) => {
7440
7442
  let applicableDiscount = 0;
7441
7443
  if (careerData?.career === "武器中士") {
@@ -7453,7 +7455,6 @@ ${Object.keys(categoryStats).join("、")}`;
7453
7455
  if (config2.tagEffects && Object.keys(config2.tagEffects).length > 0) {
7454
7456
  tagEffectsDesc = Object.entries(config2.tagEffects).map(([tag, multiplier]) => `▸ 对${tag}目标造成${(multiplier * 100).toFixed(0)}%伤害`).join("\n");
7455
7457
  }
7456
- const specialEffect = config2.specialeffect ? `特殊效果:${config2.specialeffect}` : "";
7457
7458
  const armorDamageDesc = (() => {
7458
7459
  if (config2.armorDamageReduction === 0) {
7459
7460
  return `护甲减伤:0`;
@@ -7468,7 +7469,6 @@ ${Object.keys(categoryStats).join("、")}`;
7468
7469
  `武器类型:${config2.type}`,
7469
7470
  `基础伤害:${config2.damage}`,
7470
7471
  armorDamageDesc,
7471
- // 添加这里
7472
7472
  `价格:${priceDisplay}`,
7473
7473
  config2.specialeffect && `特殊效果:${config2.specialeffect}`,
7474
7474
  "特性:",
@@ -7481,8 +7481,8 @@ ${Object.keys(categoryStats).join("、")}`;
7481
7481
  return [
7482
7482
  `🏪 咕咕武器库 - ${category} 🏪`,
7483
7483
  '使用"购买 武器名称"指令进行购买',
7484
- discountDetails.length > 0 ? `💰 折扣明细:
7485
- ${discountDetails.join("\n")}` : "",
7484
+ displayDiscounts.length > 0 ? `💰 折扣明细:
7485
+ ${displayDiscounts.join("\n")}` : "",
7486
7486
  permissionNotice,
7487
7487
  "====================",
7488
7488
  ...items,
@@ -7868,6 +7868,19 @@ ${validTypes.join("、")}`;
7868
7868
  const universalDiscountRate = calculateDiscountRate(false);
7869
7869
  const exclusiveDiscountRate = calculateDiscountRate(true);
7870
7870
  if (weapon && weaponConfig[weapon]?.id) {
7871
+ const weaponExclusiveMods = Object.entries(modConfig).filter(
7872
+ ([_, cfg]) => cfg.isExclusive && cfg.exclusiveTo === weapon
7873
+ );
7874
+ const exclusiveList = weaponExclusiveMods.length > 0 ? weaponExclusiveMods.map(([name2, cfg]) => {
7875
+ const discountRate = calculateDiscountRate(true);
7876
+ const actualPrice = Math.floor(cfg.cost * (1 - discountRate / 100));
7877
+ return [
7878
+ `【${name2}】`,
7879
+ `价格:${actualPrice}金币${discountRate > 0 ? ` (原价${cfg.cost})` : ""}`,
7880
+ `效果:${cfg.effect}`,
7881
+ "------------------"
7882
+ ].join("\n");
7883
+ }).join("\n") : "❌ 该武器没有可用的专属模块";
7871
7884
  return [
7872
7885
  `🛠️ ${weapon} 专属模块 🛠️`,
7873
7886
  "使用「改装 武器名称 模块名称」安装",
@@ -7875,13 +7888,13 @@ ${validTypes.join("、")}`;
7875
7888
  exclusiveDiscountRate > 0 && `💰 当前专属模块折扣:
7876
7889
  ▸ ⚙️ 武器升级平台Lv.${techLevel}:${exclusiveDiscountRate}%折扣`,
7877
7890
  "====================",
7878
- buildModList(true)
7891
+ exclusiveList
7879
7892
  ].filter(Boolean).join("\n");
7880
7893
  } else {
7881
7894
  return [
7882
7895
  "🛠️ 通用武器模块 🛠️",
7883
7896
  "使用「改装 武器名称 模块名称」安装通用模块",
7884
- "使用「改装 武器名称」查询武器专属模块",
7897
+ "使用「改装 武器名称」查询武器专属模块",
7885
7898
  universalDiscountRate > 0 && `💰 当前通用模块折扣:
7886
7899
  ▸ ⚙️ 武器升级平台Lv.${techLevel}:${universalDiscountRate}%折扣`,
7887
7900
  "====================",
@@ -8843,10 +8856,20 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
8843
8856
  discountPrice = Math.floor(config2.redCrystalCost * 0.5);
8844
8857
  discountProfession = currentCareer;
8845
8858
  }
8859
+ const armorDamageDesc = (() => {
8860
+ if (config2.armorDamageReduction === 0) {
8861
+ return `护甲减伤:0`;
8862
+ } else if (config2.armorDamageReduction > 0) {
8863
+ return `护甲减伤:${config2.armorDamageReduction}(每点护甲扣除${config2.armorDamageReduction}点伤害)`;
8864
+ } else {
8865
+ return `护甲减伤:${config2.armorDamageReduction}(每点护甲增加${Math.abs(config2.armorDamageReduction)}点伤害)`;
8866
+ }
8867
+ })();
8846
8868
  const infoBlocks = [
8847
8869
  `【${name2}】`,
8848
8870
  `武器类型:${config2.type}`,
8849
- `基础伤害:${config2.damage}`
8871
+ `基础伤害:${config2.damage}`,
8872
+ armorDamageDesc
8850
8873
  ];
8851
8874
  if (discountPrice) {
8852
8875
  infoBlocks.push(
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.63",
4
+ "version": "1.4.65",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [