koishi-plugin-ggcevo-game 1.6.18 → 1.6.21

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.
@@ -649,6 +649,10 @@ export declare const BattleEffectProcessor: {
649
649
  nerfMultiplier: number;
650
650
  messages: string[];
651
651
  } | null;
652
+ handleDragonBreathResistance: (targetBoss: any, weaponName: string) => {
653
+ nerfMultiplier: number;
654
+ messages: string[];
655
+ } | null;
652
656
  };
653
657
  /**
654
658
  * 统一处理所有被动效果(包含伤害修正、免疫检查、状态更新等)
package/lib/index.js CHANGED
@@ -388,7 +388,7 @@ var weaponConfig = {
388
388
  damage: 90,
389
389
  armorDamageReduction: 0,
390
390
  description: "这是传说中的武器",
391
- specialeffect: "攻击时为目标附加2层[燃烧]效果,每层使目标受到火焰伤害时额外造成2点伤害(至多额外造成100点伤害)",
391
+ specialeffect: "造成的20%伤害转化为火焰伤害;攻击时为目标附加2层[燃烧]效果,每层使目标受到火焰伤害时额外造成2点伤害(至多额外造成100点伤害)",
392
392
  price: 6400,
393
393
  redCrystalCost: 200,
394
394
  isantiair: false,
@@ -655,6 +655,24 @@ var SyndicatedItems = {
655
655
  redCrystalCost: 20,
656
656
  condition: "辛迪加海盗阵营",
657
657
  effects: "挖矿获得的金币收益提高10%;可使用红晶升级"
658
+ },
659
+ "莫洛托夫燃烧弹": {
660
+ id: 9,
661
+ type: "手榴弹",
662
+ description: "一种轻型手榴弹,含有易燃物质",
663
+ price: 0,
664
+ redCrystalCost: 0,
665
+ condition: "目标不免疫燃烧",
666
+ effects: "使目标的燃烧层数增加5层"
667
+ },
668
+ "铝热炸弹": {
669
+ id: 10,
670
+ type: "爆破物",
671
+ description: "铝热炸弹能够轻易破坏安全门",
672
+ price: 0,
673
+ redCrystalCost: 0,
674
+ condition: "目标为异形",
675
+ effects: "造成100伤害;对建筑目标造成3倍伤害"
658
676
  }
659
677
  };
660
678
  var initDefaultItems = {
@@ -709,8 +727,8 @@ var itemConfig = {
709
727
  var spaceStationCrewConfig = [
710
728
  {
711
729
  professionName: "深空矿工",
712
- effect: "挖矿的收益提高50%",
713
- requirements: "挖矿累计收益达到500金币",
730
+ effect: "挖矿的金币收益提高50%",
731
+ requirements: "挖矿累计金币收益达到500金币",
714
732
  Jobtransfer: true,
715
733
  costcoins: 2e3
716
734
  },
@@ -730,7 +748,7 @@ var spaceStationCrewConfig = [
730
748
  },
731
749
  {
732
750
  professionName: "武器中士",
733
- effect: "攻击伤害+15%; 购买传奇武器不消耗权限次数(可消耗权限次数半价购买传奇武器)",
751
+ effect: "攻击伤害+15%; 购买传奇武器无需权限次数(可消耗权限次数半价购买传奇武器)",
734
752
  requirements: "至少拥有一把6级及以上等级的武器",
735
753
  Jobtransfer: true,
736
754
  costcoins: 3e3
@@ -751,7 +769,7 @@ var spaceStationCrewConfig = [
751
769
  },
752
770
  {
753
771
  professionName: "总工程师",
754
- effect: "探索获得的金币收益提高50%",
772
+ effect: "探索获得的金币收益提高50%;探索的成功率提高10%",
755
773
  requirements: "探索次数达到4次及以上",
756
774
  Jobtransfer: true,
757
775
  costcoins: 2e3
@@ -1177,7 +1195,7 @@ var Spacestationtechnology = [
1177
1195
  level: 5,
1178
1196
  cost: 5350,
1179
1197
  description: "完全恢复空间站安防系统,攻击获得的金币+25%",
1180
- careerBonus: "攻击获得的金币额外+25%; 获得一次打开安全军械库防爆门的权限,可以随机获得一把传奇武器"
1198
+ careerBonus: "攻击获得的金币额外+25%; 获得解锁军械库防爆门权限1次,可以随机获得一把传奇武器"
1181
1199
  }
1182
1200
  ]
1183
1201
  },
@@ -1305,7 +1323,7 @@ var Tasklist = {
1305
1323
  target: 1,
1306
1324
  price: 200,
1307
1325
  redCrystalCost: 0,
1308
- condition: "使用【焚烧枪】引爆具有10层及以上[灼烧粘液]的目标"
1326
+ condition: "使用【焚烧枪】或【龙息霰弹枪】引爆具有10层及以上[灼烧粘液]的目标"
1309
1327
  },
1310
1328
  "脉冲干扰": {
1311
1329
  id: 4,
@@ -1335,7 +1353,7 @@ var Tasklist = {
1335
1353
  id: 7,
1336
1354
  type: "可重复任务",
1337
1355
  target: 1,
1338
- price: 40,
1356
+ price: 25,
1339
1357
  redCrystalCost: 0,
1340
1358
  condition: "使用【焚烧枪】或【龙息霰弹枪】攻击目标并成功增加其1层[燃烧]"
1341
1359
  }
@@ -2583,20 +2601,29 @@ var BattleEffectProcessor = {
2583
2601
  if (!targetBoss.skills.includes("火焰异形")) {
2584
2602
  return null;
2585
2603
  }
2586
- const isFireDamage = weaponName === "焚烧枪";
2604
+ const isFireDamage = weaponName === "焚烧枪" || weaponName === "龙息霰弹枪";
2587
2605
  if (!isFireDamage) {
2588
2606
  return null;
2589
2607
  }
2590
- isImmune = true;
2591
- const healAmount = damage;
2592
- const targetUpdates = {
2593
- name: targetBoss.name,
2594
- updates: {
2595
- hpChange: healAmount
2596
- // 生命值变化量
2597
- }
2598
- };
2599
- messages.push(`🔥 【火焰异形】生效:免疫火焰伤害并回复${healAmount}点生命值`);
2608
+ let healAmount = 0;
2609
+ let targetUpdates = null;
2610
+ if (weaponName === "焚烧枪") {
2611
+ isImmune = true;
2612
+ healAmount = damage;
2613
+ messages.push(`🔥 【火焰异形】生效:免疫火焰伤害并回复${healAmount}点生命值`);
2614
+ } else if (weaponName === "龙息霰弹枪") {
2615
+ healAmount = Math.round(damage * 0.2);
2616
+ messages.push(`🔥 【火焰异形】生效:受到龙息霰弹枪的火焰伤害,回复${healAmount}点生命值`);
2617
+ }
2618
+ if (healAmount > 0) {
2619
+ targetUpdates = {
2620
+ name: targetBoss.name,
2621
+ updates: {
2622
+ hpChange: healAmount
2623
+ // 生命值变化量
2624
+ }
2625
+ };
2626
+ }
2600
2627
  return {
2601
2628
  isImmune,
2602
2629
  messages,
@@ -2627,7 +2654,7 @@ var BattleEffectProcessor = {
2627
2654
  }
2628
2655
  const currentStacks = targetBoss.skillStacks || 0;
2629
2656
  const maxStacks = 20;
2630
- const isFireDamage = weaponName === "焚烧枪";
2657
+ const isFireDamage = weaponName === "焚烧枪" || weaponName === "龙息霰弹枪";
2631
2658
  const updates = {};
2632
2659
  if (!isFireDamage && currentStacks < maxStacks) {
2633
2660
  updates.skillStacksChanged = 1;
@@ -4233,7 +4260,27 @@ var BattleEffectProcessor = {
4233
4260
  nerfMultiplier,
4234
4261
  messages
4235
4262
  };
4236
- }, "handleShiveringHowl")
4263
+ }, "handleShiveringHowl"),
4264
+ // 龙息霰弹枪抗性处理
4265
+ handleDragonBreathResistance: /* @__PURE__ */ __name(function(targetBoss, weaponName) {
4266
+ const isDragonBreath = weaponName === "龙息霰弹枪";
4267
+ if (!isDragonBreath) {
4268
+ return null;
4269
+ }
4270
+ const resistanceSkills = ["火焰异形", "猎手异形", "环境适应"];
4271
+ const activeResistances = resistanceSkills.filter(
4272
+ (skill) => targetBoss.skills.includes(skill)
4273
+ );
4274
+ if (activeResistances.length === 0) {
4275
+ return null;
4276
+ }
4277
+ return {
4278
+ nerfMultiplier: 0.2,
4279
+ messages: [
4280
+ `🔥 【龙息霰弹枪】:${activeResistances.join("、")}免疫20%的火焰伤害`
4281
+ ]
4282
+ };
4283
+ }, "handleDragonBreathResistance")
4237
4284
  };
4238
4285
  function applyPassiveEffects(targetBoss, activeBosses, weaponName, damage, hasCrit, ignoreRate, careerData, equippedWeapon) {
4239
4286
  const messages = [];
@@ -4400,6 +4447,7 @@ function applyPassiveEffects(targetBoss, activeBosses, weaponName, damage, hasCr
4400
4447
  // 双参数效果
4401
4448
  { effect: BattleEffectProcessor.handleStructuralArmor, args: [targetBoss, weaponData] },
4402
4449
  { effect: BattleEffectProcessor.handleDisguise, args: [targetBoss, weaponName] },
4450
+ { effect: BattleEffectProcessor.handleDragonBreathResistance, args: [targetBoss, weaponName] },
4403
4451
  // 多参数效果
4404
4452
  { effect: BattleEffectProcessor.handleIsolated, args: [targetBoss, activeBosses, isolatedImmunityMark] },
4405
4453
  { effect: BattleEffectProcessor.handleInfectedSpaceStation, args: [targetBoss, activeBosses] },
@@ -5341,6 +5389,24 @@ var ggcevoUpdates = [
5341
5389
  - 猜测下一个复活主宰的名字的赔率提升至10
5342
5390
  - 削弱了烈焰庞兽的太阳耀斑技能效果
5343
5391
  `.trim()
5392
+ },
5393
+ {
5394
+ version: "1.6.19",
5395
+ time: "2025-07-12",
5396
+ content: `
5397
+ - 修改了龙息霰弹枪的特殊效果
5398
+ - 下调了“烈火燎原”任务的奖励金币
5399
+ `.trim()
5400
+ },
5401
+ {
5402
+ version: "1.6.21",
5403
+ time: "2025-07-14",
5404
+ content: `
5405
+ - 增强了庞兽号歼星舰的反掠夺能力
5406
+ - 新增了莫洛托夫燃烧弹和铝热炸弹,可通过探索获得
5407
+ - 增强龙息霰弹枪特殊效果,并可引爆“灼烧粘液”
5408
+ - 增强了人类联盟的总工程师职业效果
5409
+ `.trim()
5344
5410
  }
5345
5411
  ];
5346
5412
  function compareVersions(a, b) {
@@ -5587,7 +5653,8 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
5587
5653
  if (itemConfig2.id === 1) {
5588
5654
  return {
5589
5655
  success: false,
5590
- message: "暂时被禁用了。"
5656
+ message: "暂时被禁用了。",
5657
+ isDefeated: false
5591
5658
  };
5592
5659
  const activeSentry = await ctx.database.get("ggcevo_boss", {
5593
5660
  name: "空间站哨枪塔",
@@ -5595,7 +5662,8 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
5595
5662
  });
5596
5663
  if (!activeSentry.length) return {
5597
5664
  success: false,
5598
- message: "⚠️ 目标「空间站哨枪塔」未存活"
5665
+ message: "⚠️ 目标「空间站哨枪塔」未存活",
5666
+ isDefeated: false
5599
5667
  };
5600
5668
  const [SentryTower] = await ctx.database.get("ggcevo_boss", {
5601
5669
  name: "空间站哨枪塔",
@@ -5624,13 +5692,15 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
5624
5692
  });
5625
5693
  return {
5626
5694
  success: true,
5627
- message: `成功引爆${itemName},对空间站哨枪塔造成${damageValue}点伤害,获得等额金币。`
5695
+ message: `成功引爆${itemName},对空间站哨枪塔造成${damageValue}点伤害,获得等额金币。`,
5696
+ isDefeated: false
5628
5697
  };
5629
5698
  }
5630
5699
  if (itemConfig2.id === 2) {
5631
5700
  if (!target) return {
5632
5701
  success: false,
5633
- message: "您未选择合适的目标。"
5702
+ message: "您未选择合适的目标。",
5703
+ isDefeated: false
5634
5704
  };
5635
5705
  const [targetboss] = await ctx.database.get("ggcevo_boss", {
5636
5706
  name: target,
@@ -5638,25 +5708,29 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
5638
5708
  });
5639
5709
  if (!targetboss) return {
5640
5710
  success: false,
5641
- message: "无法找到指定的目标。"
5711
+ message: "无法找到指定的目标。",
5712
+ isDefeated: false
5642
5713
  };
5643
5714
  if (targetboss.skills.includes("开天眼")) {
5644
5715
  return {
5645
5716
  success: false,
5646
- message: `目标免疫闪光弹,无法使用此物品。`
5717
+ message: `目标免疫闪光弹,无法使用此物品。`,
5718
+ isDefeated: false
5647
5719
  };
5648
5720
  }
5649
5721
  if (targetboss.tags.includes("建筑") || targetboss.tags.includes("重型") || targetboss.skills.includes("开天眼")) {
5650
5722
  return {
5651
5723
  success: false,
5652
- message: `目标${target}拥有"${targetboss.tags.includes("建筑") ? "建筑" : "重型"}"标签,无法使用此物品。`
5724
+ message: `目标${target}拥有"${targetboss.tags.includes("建筑") ? "建筑" : "重型"}"标签,无法使用此物品。`,
5725
+ isDefeated: false
5653
5726
  };
5654
5727
  }
5655
5728
  const currentCount = targetboss?.skillStacks || 0;
5656
5729
  if (currentCount <= 0) {
5657
5730
  return {
5658
5731
  success: false,
5659
- message: `目标${target}的技能层数已为0,无需使用此物品。`
5732
+ message: `目标${target}的技能层数已为0,无需使用此物品。`,
5733
+ isDefeated: false
5660
5734
  };
5661
5735
  }
5662
5736
  const newCount = Math.max(0, currentCount - 10);
@@ -5668,13 +5742,15 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
5668
5742
  );
5669
5743
  return {
5670
5744
  success: true,
5671
- message: `成功使用${itemName},使${target}的技能层数减少10层`
5745
+ message: `成功使用${itemName},使${target}的技能层数减少10层`,
5746
+ isDefeated: false
5672
5747
  };
5673
5748
  }
5674
5749
  if (itemConfig2.id === 4) {
5675
5750
  if (!target) return {
5676
5751
  success: false,
5677
- message: "您未选择合适的目标。"
5752
+ message: "您未选择合适的目标。",
5753
+ isDefeated: false
5678
5754
  };
5679
5755
  const [targetboss] = await ctx.database.get("ggcevo_boss", {
5680
5756
  name: target,
@@ -5683,12 +5759,14 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
5683
5759
  if (targetboss.skills.includes("质粒增殖")) {
5684
5760
  return {
5685
5761
  success: false,
5686
- message: `目标免疫脉冲手雷,无法使用此物品。`
5762
+ message: `目标免疫脉冲手雷,无法使用此物品。`,
5763
+ isDefeated: false
5687
5764
  };
5688
5765
  }
5689
5766
  if (!targetboss || targetboss?.energy === 0) return {
5690
5767
  success: false,
5691
- message: "您无法对没有能量的目标使用。"
5768
+ message: "您无法对没有能量的目标使用。",
5769
+ isDefeated: false
5692
5770
  };
5693
5771
  await ctx.database.set(
5694
5772
  "ggcevo_boss",
@@ -5698,18 +5776,119 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
5698
5776
  );
5699
5777
  return {
5700
5778
  success: true,
5701
- message: `成功使用${itemName},消耗${target}500点能量`
5779
+ message: `成功使用${itemName},消耗${target}500点能量`,
5780
+ isDefeated: false
5781
+ };
5782
+ }
5783
+ if (itemConfig2.id === 9) {
5784
+ if (!target) return {
5785
+ success: false,
5786
+ message: "使用燃烧弹需要指定目标",
5787
+ isDefeated: false
5788
+ };
5789
+ const [targetBoss] = await ctx.database.get("ggcevo_boss", {
5790
+ name: target,
5791
+ isActive: true
5792
+ });
5793
+ if (!targetBoss) return {
5794
+ success: false,
5795
+ message: `目标「${target}」未存活或不存在`,
5796
+ isDefeated: false
5797
+ };
5798
+ const immuneSkills = ["猎手异形", "环境适应"];
5799
+ const isImmune = immuneSkills.some(
5800
+ (skill) => targetBoss.skills?.includes(skill)
5801
+ );
5802
+ if (isImmune) return {
5803
+ success: false,
5804
+ message: `目标「${target}」免疫燃烧效果`,
5805
+ isDefeated: false
5806
+ };
5807
+ const currentLayers = targetBoss?.burnLayers || 0;
5808
+ const newLayers = currentLayers + 5;
5809
+ await ctx.database.set(
5810
+ "ggcevo_boss",
5811
+ { name: target },
5812
+ { burnLayers: newLayers }
5813
+ );
5814
+ const [taskRecord] = await ctx.database.get("ggcevo_task", {
5815
+ handle,
5816
+ taskId: 7
5817
+ });
5818
+ await ctx.database.upsert("ggcevo_task", [{
5819
+ handle,
5820
+ taskId: 7,
5821
+ progress: (taskRecord?.progress || 0) + 5
5822
+ }], ["handle", "taskId"]);
5823
+ return {
5824
+ success: true,
5825
+ message: `成功使用${itemName},目标「${target}」的燃烧层数增加5层`,
5826
+ isDefeated: false
5827
+ };
5828
+ }
5829
+ if (itemConfig2.id === 10) {
5830
+ if (!target) return {
5831
+ success: false,
5832
+ message: "使用铝热炸弹需要指定目标",
5833
+ isDefeated: false
5834
+ };
5835
+ const [targetBoss] = await ctx.database.get("ggcevo_boss", {
5836
+ name: target,
5837
+ isActive: true
5838
+ });
5839
+ if (!targetBoss) return {
5840
+ success: false,
5841
+ message: `目标「${target}」未存活或不存在`,
5842
+ isDefeated: false
5843
+ };
5844
+ const aerialTargets = ["吸血蝙蝠首领", "吸血蝙蝠", "猛毒异兽", "剧毒蝙蝠"];
5845
+ if (aerialTargets.includes(targetBoss.name)) {
5846
+ return {
5847
+ success: false,
5848
+ message: "无法对空中目标使用",
5849
+ isDefeated: false
5850
+ };
5851
+ }
5852
+ const baseDamage = 100;
5853
+ const isBuilding = targetBoss.tags?.includes("建筑");
5854
+ const damage = isBuilding ? baseDamage * 3 : baseDamage;
5855
+ const actualDamage = Math.min(damage, targetBoss.HP);
5856
+ const newHP = targetBoss.HP - actualDamage;
5857
+ const isDefeated = newHP <= 0;
5858
+ await ctx.database.set(
5859
+ "ggcevo_boss",
5860
+ { name: target },
5861
+ {
5862
+ HP: Math.max(newHP, 0),
5863
+ isActive: !isDefeated
5864
+ }
5865
+ );
5866
+ if (actualDamage > 0) {
5867
+ await ctx.database.withTransaction(async () => {
5868
+ const signRecords = await ctx.database.get("ggcevo_sign", { handle });
5869
+ await ctx.database.upsert("ggcevo_sign", [{
5870
+ handle,
5871
+ totalRewards: (signRecords[0]?.totalRewards || 0) + damage
5872
+ }], ["handle"]);
5873
+ });
5874
+ }
5875
+ return {
5876
+ success: true,
5877
+ message: `成功使用${itemName},对${isBuilding ? "建筑目标" : "目标"}「${target}」造成${damage}点伤害${isDefeated ? ",目标已被消灭" : ""}`,
5878
+ isDefeated
5702
5879
  };
5703
5880
  }
5704
5881
  return {
5705
5882
  success: false,
5706
- message: `${itemName} 无法使用。`
5883
+ message: `${itemName} 无法使用。`,
5884
+ isDefeated: false
5707
5885
  };
5708
5886
  } catch (error) {
5709
5887
  console.error("物品效果处理失败:", error);
5710
5888
  return {
5711
5889
  success: false,
5712
- message: "⚠️ 物品效果处理异常,已回滚操作。"
5890
+ message: "⚠️ 物品效果处理异常,已回滚操作。",
5891
+ isDefeated: false
5713
5892
  };
5714
5893
  }
5715
5894
  }
@@ -5747,7 +5926,7 @@ async function handleTechUpgrade(ctx, handle, target) {
5747
5926
  type: "武器系统",
5748
5927
  field: "legendarypermissions",
5749
5928
  amount: 1,
5750
- message: "🎉 解锁传奇武器购买权限1次!"
5929
+ message: "🎉 获得传奇武器购买权限1次!"
5751
5930
  };
5752
5931
  }
5753
5932
  if (tech.techname === "安防系统" && currentLevel === 4 && nextLevel === 5) {
@@ -5755,7 +5934,7 @@ async function handleTechUpgrade(ctx, handle, target) {
5755
5934
  type: "安防系统",
5756
5935
  field: "explosiondoorauthority",
5757
5936
  amount: 1,
5758
- message: "🔓 解锁安全军械库防爆门权限1次!(使用指令“开启军械库防爆门”)"
5937
+ message: "🔓 获得解锁军械库防爆门权限1次!(使用指令“开启军械库防爆门”)"
5759
5938
  };
5760
5939
  }
5761
5940
  await ctx.database.withTransaction(async () => {
@@ -7061,7 +7240,7 @@ var spaceship = {
7061
7240
  description: "巨兽级歼星舰的小型化版本",
7062
7241
  miningbonus: 0,
7063
7242
  explorebonus: 30,
7064
- effect: "探索的成功率提高60%;探索发生掠夺的概率提高30%;掠夺的成功率提高30%",
7243
+ effect: "探索的成功率提高60%;探索发生掠夺的概率提高30%;掠夺的成功率提高30%;被非庞兽号歼星舰掠夺的成功率降低30%",
7065
7244
  price: 6e3
7066
7245
  }
7067
7246
  };
@@ -7070,7 +7249,8 @@ var galaxy = {
7070
7249
  description: "这一片都是人类联盟的地区,但是并非一切都很安全",
7071
7250
  success: 0.6,
7072
7251
  bonus: 0,
7073
- available: "金币,爆破物,手榴弹",
7252
+ available: ["闪光弹", "脉冲手雷"],
7253
+ // 使用中文名称数组
7074
7254
  effect: "人类联盟阵营探索时成功率提高10%"
7075
7255
  },
7076
7256
  "辛迪加星系": {
@@ -7078,14 +7258,14 @@ var galaxy = {
7078
7258
  success: 0.4,
7079
7259
  bonus: 0.2,
7080
7260
  // 金币加成系数(1.2表示+20%)
7081
- available: "金币,爆破物,手榴弹",
7261
+ available: ["闪光弹", "脉冲手雷"],
7082
7262
  effect: "辛迪加海盗阵营探索时成功率提高10%"
7083
7263
  },
7084
7264
  "陨石星系": {
7085
7265
  description: "这一片星系有着大量的陨石,充满了危险,但可能存在一些有价值的资源",
7086
7266
  success: 0.4,
7087
7267
  bonus: 0,
7088
- available: "金币,爆破物,手榴弹",
7268
+ available: ["闪光弹", "脉冲手雷", "莫洛托夫燃烧弹", "铝热炸弹"],
7089
7269
  effect: "获得物品的概率提高10%"
7090
7270
  }
7091
7271
  };
@@ -11104,6 +11284,8 @@ ${discountReason}` : "",
11104
11284
  });
11105
11285
  ctx.command("ggcevo/使用 [itemName] [target]").action(async (argv, itemName, target) => {
11106
11286
  const session = argv.session;
11287
+ let bossEventBroadcast = null;
11288
+ let cleanerRewardBroadcast = null;
11107
11289
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
11108
11290
  if (!profile) return "🔒 需要先绑定游戏句柄。";
11109
11291
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -11133,11 +11315,25 @@ ${discountReason}` : "",
11133
11315
  { handle, itemId: targetItem.itemId },
11134
11316
  { quantity: newQuantity }
11135
11317
  );
11136
- return [
11137
- `✅ 成功使用 ${itemNameConfirmed}`,
11138
- `剩余数量:${newQuantity}`,
11139
- `触发效果:${effectResult.message}`
11140
- ].join("\n");
11318
+ const allDeadTargets = [];
11319
+ if (effectResult.isDefeated) {
11320
+ allDeadTargets.push(target);
11321
+ }
11322
+ const deathResults = await handleDeathTargets(ctx, allDeadTargets, session.username, handle);
11323
+ bossEventBroadcast = deathResults.bossBroadcast;
11324
+ cleanerRewardBroadcast = deathResults.cleanerBroadcast;
11325
+ await session.send(
11326
+ `✅ 成功使用 ${itemNameConfirmed}
11327
+ 剩余数量:${newQuantity}
11328
+ 触发效果:${effectResult.message}`
11329
+ );
11330
+ const groupId = [...config.groupId];
11331
+ await handleBroadcasts(
11332
+ ctx,
11333
+ groupId,
11334
+ bossEventBroadcast,
11335
+ cleanerRewardBroadcast
11336
+ );
11141
11337
  } catch (error) {
11142
11338
  ctx.logger("GGCEVO").error(error);
11143
11339
  return "⚠️ 物品使用失败,请联系管理员";
@@ -11198,7 +11394,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11198
11394
  `最大可升级等级:${romanNumerals[tech.maxLevel]}`,
11199
11395
  `适用职业:${tech.careerNames.join("、")}`,
11200
11396
  // 适用职业移动到最顶部
11201
- '使用 "升级 科技名称" 进行升级',
11397
+ '使用 "升级科技 科技名称" 进行升级',
11202
11398
  ...discountInfo,
11203
11399
  "====================",
11204
11400
  ...techDetails
@@ -11702,6 +11898,12 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11702
11898
  }
11703
11899
  });
11704
11900
  ctx.command("ggcevo/探索 [galaxyName]").action(async ({ session }, galaxyName) => {
11901
+ const possibleItems = [
11902
+ { id: 2, name: "闪光弹", chance: 0.1 },
11903
+ { id: 4, name: "脉冲手雷", chance: 0.1 },
11904
+ { id: 9, name: "莫洛托夫燃烧弹", chance: 0.05 },
11905
+ { id: 10, name: "铝热炸弹", chance: 0.05 }
11906
+ ];
11705
11907
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
11706
11908
  if (!profile) return "🔒 需要先绑定游戏句柄。";
11707
11909
  const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
@@ -11712,6 +11914,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11712
11914
  const [career] = await ctx.database.get("ggcevo_careers", { handle });
11713
11915
  const careerName = career?.career;
11714
11916
  const careerCoinBonus = careerName === "总工程师" ? 50 : 0;
11917
+ const engineerSuccessBonus = careerName === "总工程师" ? 0.1 : 0;
11715
11918
  const [shipRecord] = await ctx.database.get("ggcevo_spaceship", { handle });
11716
11919
  let shipBonus = 0;
11717
11920
  let plunderRateBonus = 0;
@@ -11772,6 +11975,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11772
11975
  let successRate = galaxyData2.success;
11773
11976
  if (career?.group === "人类联盟" && record.galaxy === "联盟星系") successRate += 0.1;
11774
11977
  else if (career?.group === "辛迪加海盗" && record.galaxy === "辛迪加星系") successRate += 0.1;
11978
+ successRate += engineerSuccessBonus;
11775
11979
  successRate += shipSuccessBonus;
11776
11980
  successRate = Math.min(successRate, 1);
11777
11981
  let baseCoinReward = Math.floor(Math.random() * 51) + 50;
@@ -11792,6 +11996,9 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11792
11996
  const sign = record.plunderbonus > 0 ? "+" : "";
11793
11997
  bonusEffects.push(`▸ ⚔️ 掠夺事件:${sign}${record.plunderbonus}%金币`);
11794
11998
  }
11999
+ if (engineerSuccessBonus > 0) {
12000
+ bonusEffects.push(`▸ 🔧 总工程师职业:成功率+${Math.round(engineerSuccessBonus * 100)}%`);
12001
+ }
11795
12002
  let itemDropBonus = 0;
11796
12003
  if (record.galaxy === "陨石星系") {
11797
12004
  itemDropBonus += 0.1;
@@ -11806,13 +12013,9 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11806
12013
  bonusEffects.push(`▸ ⚙️ 反应堆科技Lv.${techLevel}:+${(combinedTechBonus * 100).toFixed(0)}%金币`);
11807
12014
  }
11808
12015
  if (careerCoinBonus) {
11809
- bonusEffects.push(`▸ 🎓 总工程师职业:+${careerCoinBonus}%金币`);
12016
+ bonusEffects.push(`▸ 🎓 总工程师职业:金币+${careerCoinBonus}%`);
11810
12017
  }
11811
- const totalBonusMultiplier = 1 + (galaxyBonusPercent + // 星系加成
11812
- shipBonus + // 飞船加成
11813
- (record.plunderbonus || 0) + // 掠夺事件加成/减益
11814
- (techBonusRate + careerBonusRate) * 100 + // 科技和职业加成
11815
- careerCoinBonus) / 100;
12018
+ const totalBonusMultiplier = 1 + (galaxyBonusPercent + shipBonus + (record.plunderbonus || 0) + (techBonusRate + careerBonusRate) * 100 + careerCoinBonus) / 100;
11816
12019
  let finalCoin = Math.floor(baseCoinReward * totalBonusMultiplier);
11817
12020
  const isSuccess = Math.random() < successRate;
11818
12021
  if (!isSuccess) {
@@ -11834,31 +12037,30 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11834
12037
  }
11835
12038
  let itemRewards = [];
11836
12039
  if (isSuccess) {
11837
- const possibleItems = [
11838
- { id: 2, name: "闪光弹", chance: 0.05 },
11839
- { id: 4, name: "脉冲手雷", chance: 0.05 }
11840
- ];
12040
+ const availableItems = galaxyData2.available;
11841
12041
  for (const item of possibleItems) {
11842
- const dropRate = item.chance + itemDropBonus;
11843
- if (Math.random() < dropRate) {
11844
- const [existing] = await ctx.database.get("ggcevo_warehouse", {
11845
- handle,
11846
- itemId: item.id
11847
- });
11848
- if (existing) {
11849
- await ctx.database.set("ggcevo_warehouse", {
12042
+ if (availableItems.includes(item.name)) {
12043
+ const dropRate = item.chance + itemDropBonus;
12044
+ if (Math.random() < dropRate) {
12045
+ const [existing] = await ctx.database.get("ggcevo_warehouse", {
11850
12046
  handle,
11851
12047
  itemId: item.id
11852
- }, { quantity: existing.quantity + 1 });
11853
- } else {
11854
- await ctx.database.create("ggcevo_warehouse", {
11855
- handle,
11856
- itemId: item.id,
11857
- quantity: 1,
11858
- bonus: 0
11859
12048
  });
12049
+ if (existing) {
12050
+ await ctx.database.set("ggcevo_warehouse", {
12051
+ handle,
12052
+ itemId: item.id
12053
+ }, { quantity: existing.quantity + 1 });
12054
+ } else {
12055
+ await ctx.database.create("ggcevo_warehouse", {
12056
+ handle,
12057
+ itemId: item.id,
12058
+ quantity: 1,
12059
+ bonus: 0
12060
+ });
12061
+ }
12062
+ itemRewards.push(item.name);
11860
12063
  }
11861
- itemRewards.push(item.name);
11862
12064
  }
11863
12065
  }
11864
12066
  }
@@ -11871,13 +12073,14 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11871
12073
  });
11872
12074
  const isRewardModified = finalCoin !== baseCoinReward;
11873
12075
  const coinDisplay = isRewardModified ? `💰 金币 +${finalCoin}(基础值 ${baseCoinReward})` : `💰 金币 +${finalCoin}`;
12076
+ const availableItemsDisplay = galaxyData2.available.join("、") || "无";
11874
12077
  const resultMessage = [
11875
12078
  isSuccess ? "🎉 探索成功!" : "⚠️ 探索失败!",
11876
12079
  `🌌 星系:${record.galaxy}`,
11877
12080
  `🔮 实际成功率:${(successRate * 100).toFixed(1)}%`,
11878
12081
  coinDisplay,
11879
- // 使用新的金币显示方式
11880
- ...itemRewards.length > 0 ? [`📦 获得物品:${itemRewards.join("、")}`] : [],
12082
+ `📦 可探索物品:${availableItemsDisplay}`,
12083
+ ...itemRewards.length > 0 ? [`🎁 获得物品:${itemRewards.join("、")}`] : [],
11881
12084
  ...bonusEffects.length > 0 ? [
11882
12085
  "",
11883
12086
  "⚡ 加成效果:",
@@ -11898,7 +12101,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11898
12101
  `【${name3}】`,
11899
12102
  `- 成功率:${(info.success * 100).toFixed(0)}%`,
11900
12103
  `- 金币加成:${bonusPercent > 0 ? "+" : ""}${bonusPercent}%`,
11901
- `- 可获得:${info.available}`,
12104
+ `- 可探索物品:${info.available.join("、") || "无"}`,
11902
12105
  `- 特殊效果:${info.effect}`
11903
12106
  ].join("\n"));
11904
12107
  }
@@ -11922,7 +12125,6 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11922
12125
  status: "探索中",
11923
12126
  handle: { $ne: handle },
11924
12127
  plunderbonus: { $gte: 0 }
11925
- // 新增条件:掠夺收益大于等于0
11926
12128
  });
11927
12129
  if (explorers.length > 0) {
11928
12130
  const shipHandles = explorers.map((e) => e.handle);
@@ -11936,21 +12138,30 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11936
12138
  });
11937
12139
  if (plunderTargets.length > 0) {
11938
12140
  const target = plunderTargets[Math.floor(Math.random() * plunderTargets.length)];
12141
+ let isTargetBehemoth = false;
12142
+ let defenseNote = "";
12143
+ const [targetShip] = await ctx.database.get("ggcevo_spaceship", { handle: target.handle });
12144
+ if (targetShip && targetShip.id === 4) {
12145
+ isTargetBehemoth = true;
12146
+ }
11939
12147
  let baseSuccessRate = 50;
11940
12148
  if (isBehemoth) baseSuccessRate += 30;
11941
12149
  if (shipRecord?.id === 3) baseSuccessRate += 10;
12150
+ if (isTargetBehemoth && !isBehemoth) {
12151
+ baseSuccessRate -= 30;
12152
+ defenseNote = "⚠️ 目标飞船为庞兽号歼星舰,掠夺成功率降低30%!\n";
12153
+ }
12154
+ baseSuccessRate = Math.max(0, Math.min(baseSuccessRate, 100));
11942
12155
  await session.send([
11943
12156
  `❗ 您在探索过程中发现了【${target.name}】的飞船,是否掠夺?`,
12157
+ defenseNote,
11944
12158
  `🎯 掠夺成功率:${baseSuccessRate}%`,
11945
12159
  `⏱️ (30秒内输入"是"来进行掠夺)`
11946
- ].join("\n"));
12160
+ ].filter((line) => line !== "").join("\n"));
11947
12161
  try {
11948
12162
  const response = await session.prompt(3e4);
11949
12163
  if (response === "是") {
11950
- let baseSuccessRate2 = 0.5;
11951
- if (isBehemoth) baseSuccessRate2 += 0.3;
11952
- if (shipRecord?.id === 3) baseSuccessRate2 += 0.1;
11953
- const success = Math.random() < baseSuccessRate2;
12164
+ let success = Math.random() < baseSuccessRate / 100;
11954
12165
  let playerBonus, targetBonus;
11955
12166
  if (success) {
11956
12167
  playerBonus = 20;
@@ -11997,6 +12208,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
11997
12208
  let estimatedRate = galaxyData.success;
11998
12209
  if (career?.group === "人类联盟" && galaxyName === "联盟星系") estimatedRate += 0.1;
11999
12210
  else if (career?.group === "辛迪加海盗" && galaxyName === "辛迪加星系") estimatedRate += 0.1;
12211
+ estimatedRate += engineerSuccessBonus;
12000
12212
  estimatedRate += shipSuccessBonus;
12001
12213
  estimatedRate = Math.min(estimatedRate, 1) * 100;
12002
12214
  return [
@@ -12004,7 +12216,8 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
12004
12216
  `⏱️ 开始时间:${(/* @__PURE__ */ new Date()).toLocaleString("zh-CN", { hour12: false })}`,
12005
12217
  `⏳ 持续时间:12小时`,
12006
12218
  `📊 预计成功率:${estimatedRate.toFixed(0)}%`,
12007
- "💡 探索可获得50-100的基础金币"
12219
+ `📦 可探索物品:${galaxyData.available.join("、") || "无"}`,
12220
+ "💰 预计可获得50-100金币"
12008
12221
  ].join("\n");
12009
12222
  });
12010
12223
  const shipIdToName = {};
package/lib/items.d.ts CHANGED
@@ -71,6 +71,24 @@ export declare const SyndicatedItems: {
71
71
  condition: string;
72
72
  effects: string;
73
73
  };
74
+ 莫洛托夫燃烧弹: {
75
+ id: number;
76
+ type: string;
77
+ description: string;
78
+ price: number;
79
+ redCrystalCost: number;
80
+ condition: string;
81
+ effects: string;
82
+ };
83
+ 铝热炸弹: {
84
+ id: number;
85
+ type: string;
86
+ description: string;
87
+ price: number;
88
+ redCrystalCost: number;
89
+ condition: string;
90
+ effects: string;
91
+ };
74
92
  };
75
93
  export declare const initDefaultItems: {
76
94
  咕咕币: {
@@ -37,21 +37,21 @@ export declare const galaxy: {
37
37
  description: string;
38
38
  success: number;
39
39
  bonus: number;
40
- available: string;
40
+ available: string[];
41
41
  effect: string;
42
42
  };
43
43
  辛迪加星系: {
44
44
  description: string;
45
45
  success: number;
46
46
  bonus: number;
47
- available: string;
47
+ available: string[];
48
48
  effect: string;
49
49
  };
50
50
  陨石星系: {
51
51
  description: string;
52
52
  success: number;
53
53
  bonus: number;
54
- available: string;
54
+ available: string[];
55
55
  effect: string;
56
56
  };
57
57
  };
package/lib/tasks.d.ts CHANGED
@@ -21,7 +21,7 @@ export declare const Tasklist: {
21
21
  readonly target: 1;
22
22
  readonly price: 200;
23
23
  readonly redCrystalCost: 0;
24
- readonly condition: "使用【焚烧枪】引爆具有10层及以上[灼烧粘液]的目标";
24
+ readonly condition: "使用【焚烧枪】或【龙息霰弹枪】引爆具有10层及以上[灼烧粘液]的目标";
25
25
  };
26
26
  readonly 脉冲干扰: {
27
27
  readonly id: 4;
@@ -51,7 +51,7 @@ export declare const Tasklist: {
51
51
  readonly id: 7;
52
52
  readonly type: "可重复任务";
53
53
  readonly target: 1;
54
- readonly price: 40;
54
+ readonly price: 25;
55
55
  readonly redCrystalCost: 0;
56
56
  readonly condition: "使用【焚烧枪】或【龙息霰弹枪】攻击目标并成功增加其1层[燃烧]";
57
57
  };
package/lib/utils.d.ts CHANGED
@@ -16,6 +16,7 @@ export declare function calculateTotalPower(ctx: Context, config: Config, handle
16
16
  export declare function applyItemEffect(ctx: Context, session: any, handle: string, itemConfig: any, target?: string): Promise<{
17
17
  success: boolean;
18
18
  message: string;
19
+ isDefeated: boolean;
19
20
  }>;
20
21
  export declare function handleTechUpgrade(ctx: Context, handle: string, target: string): Promise<string>;
21
22
  export declare function handleWeaponUpgrade(ctx: Context, handle: string, target: string): Promise<string>;
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.6.18",
4
+ "version": "1.6.21",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [