koishi-plugin-ggcevo-game 1.4.74 → 1.4.75

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.
@@ -501,13 +501,24 @@ export declare const BattleEffectProcessor: {
501
501
  messages: string[];
502
502
  buffMultiplier?: undefined;
503
503
  };
504
- handleBurrowAmbush: (targetBoss: any, nestlingNames?: string[]) => {
504
+ handleBurrowAmbush: (targetBoss: any, activeBosses: any[], nestlingNames?: string[]) => {
505
505
  messages: string[];
506
506
  targetUpdates: {
507
507
  name: any;
508
- updates: Partial<BattleStatistics>;
508
+ updates: {
509
+ skillsRemoved: string[];
510
+ };
509
511
  };
510
- spawnNewBossMark: string;
512
+ spawnNewBossMark?: undefined;
513
+ } | {
514
+ messages: string[];
515
+ targetUpdates: {
516
+ name: any;
517
+ updates: {
518
+ skillsRemoved: string[];
519
+ };
520
+ };
521
+ spawnNewBossMark: string[];
511
522
  };
512
523
  handleWeakeningSpit: (targetBoss: any, activeBosses: any[]) => any;
513
524
  handleHealingSwarm: (targetBoss: any, activeBosses: any[]) => {
@@ -51,4 +51,4 @@ export declare function testAttackFunction(ctx: Context, session: any, handle: s
51
51
  passiveMessages: string[];
52
52
  ignoreMessage: any[];
53
53
  }>;
54
- export declare function createNestlingBosses(ctx: any, nestlingName: string): Promise<any>;
54
+ export declare function createNestlingBosses(ctx: any, nestlingNames: string | string[]): Promise<any[]>;
package/lib/index.js CHANGED
@@ -356,7 +356,7 @@ var weaponConfig = {
356
356
  redCrystalCost: 200,
357
357
  isantiair: true,
358
358
  tagEffects: {
359
- "重甲": 1.75
359
+ "重甲": 1.5
360
360
  }
361
361
  },
362
362
  "龙息霰弹枪": {
@@ -426,7 +426,7 @@ var weaponConfig = {
426
426
  damage: 80,
427
427
  armorDamageReduction: 0,
428
428
  description: "一件传奇武器",
429
- specialeffect: "每次攻击有33%概率发射一枚特殊的榴弹,造成50%的额外伤害,并减少目标0.25护甲;若连续2次攻击没发射榴弹,则下一次攻击必定发射",
429
+ specialeffect: "无视50%减伤;每次攻击有33%概率发射一枚特殊的榴弹,额外造成50%的伤害并减少目标0.5护甲",
430
430
  price: 6400,
431
431
  redCrystalCost: 200,
432
432
  isantiair: true,
@@ -1506,7 +1506,7 @@ var bossPool = [
1506
1506
  {
1507
1507
  name: "巢穴雷兽",
1508
1508
  type: "子代",
1509
- maxHP: 4e3,
1509
+ maxHP: 2500,
1510
1510
  maxShield: 0,
1511
1511
  maxEnergy: 0,
1512
1512
  armor: 15,
@@ -1518,7 +1518,7 @@ var bossPool = [
1518
1518
  {
1519
1519
  name: "巢穴战士",
1520
1520
  type: "子代",
1521
- maxHP: 2e3,
1521
+ maxHP: 1500,
1522
1522
  maxShield: 0,
1523
1523
  maxEnergy: 0,
1524
1524
  armor: 4,
@@ -1530,7 +1530,7 @@ var bossPool = [
1530
1530
  {
1531
1531
  name: "巢穴甲虫",
1532
1532
  type: "子代",
1533
- maxHP: 3e3,
1533
+ maxHP: 2e3,
1534
1534
  maxShield: 0,
1535
1535
  maxEnergy: 0,
1536
1536
  armor: 10,
@@ -3428,29 +3428,41 @@ var BattleEffectProcessor = {
3428
3428
  const messages = [`🐛 【虫巢思维】生效:存在${livingNestlings}只巢穴子代,受到的伤害-${nerfMultiplier * 100}%`];
3429
3429
  return { nerfMultiplier, messages };
3430
3430
  }, "handleHiveMind"),
3431
- // 爆虫伏击 - 血量低于50%时,立即随机孵化1只巢穴子代并移除技能
3432
- handleBurrowAmbush: /* @__PURE__ */ __name(function(targetBoss, nestlingNames = ["巢穴雷兽", "巢穴战士", "巢穴甲虫"]) {
3431
+ // 爆虫伏击 - 血量低于50%时,立即孵化巢穴子代直至上限(生效后移除)
3432
+ handleBurrowAmbush: /* @__PURE__ */ __name(function(targetBoss, activeBosses, nestlingNames = ["巢穴雷兽", "巢穴战士", "巢穴甲虫"]) {
3433
3433
  if (!targetBoss.skills.includes("爆虫伏击")) return null;
3434
3434
  const maxHP = getMaxHPByName(targetBoss.name);
3435
3435
  const hpPercent = targetBoss.HP / maxHP;
3436
3436
  if (hpPercent >= 0.5) return null;
3437
- const randomBossName = nestlingNames[Math.floor(Math.random() * nestlingNames.length)];
3438
- const messages = [
3439
- `🕳️ 【爆虫伏击】触发:生命值≤50%,需要孵化1只${randomBossName}`,
3440
- `🕳️ 【爆虫伏击】技能移除`
3441
- ];
3437
+ const existingTypes = activeBosses.filter((boss) => boss.isActive && nestlingNames.includes(boss.name)).map((boss) => boss.name);
3438
+ const needSpawn = nestlingNames.filter(
3439
+ (name2) => !existingTypes.includes(name2)
3440
+ // 当前尚未存在
3441
+ );
3442
+ if (needSpawn.length === 0) {
3443
+ return {
3444
+ messages: [
3445
+ "🕳️ 【爆虫伏击】触发:生命值≤50%,但所有巢穴子代已存在,无需孵化",
3446
+ "🕳️ 【爆虫伏击】技能移除"
3447
+ ],
3448
+ targetUpdates: {
3449
+ name: targetBoss.name,
3450
+ updates: { skillsRemoved: ["爆虫伏击"] }
3451
+ }
3452
+ };
3453
+ }
3454
+ const spawnMessages = needSpawn.map(
3455
+ (name2) => `🕳️ 【爆虫伏击】触发:孵化1只${name2}`
3456
+ );
3457
+ spawnMessages.push("🕳️ 【爆虫伏击】技能移除");
3442
3458
  return {
3443
- messages,
3459
+ messages: spawnMessages,
3444
3460
  targetUpdates: {
3445
- // 添加目标boss更新数据
3446
3461
  name: targetBoss.name,
3447
- updates: {
3448
- skillsRemoved: ["爆虫伏击"]
3449
- // 移除此技能
3450
- }
3462
+ updates: { skillsRemoved: ["爆虫伏击"] }
3451
3463
  },
3452
- spawnNewBossMark: randomBossName
3453
- // 返回生成标记
3464
+ spawnNewBossMark: needSpawn
3465
+ // 返回需要孵化的子代名称数组
3454
3466
  };
3455
3467
  }, "handleBurrowAmbush"),
3456
3468
  // 虚弱喷吐 - 孵化场存活时减伤80%,死亡时增伤20%
@@ -3463,7 +3475,7 @@ var BattleEffectProcessor = {
3463
3475
  if (hatcheryExists) {
3464
3476
  effect = { nerfMultiplier: 0.8, messages: ["🤢 【虚弱喷吐】生效:孵化场存活,受到的伤害-80%"] };
3465
3477
  } else {
3466
- effect = { buffMultiplier: 0.2, messages: ["☠️ 【虚弱喷吐】生效:孵化场死亡,受到的伤害+20%"] };
3478
+ effect = { buffMultiplier: 0, messages: [] };
3467
3479
  }
3468
3480
  return effect;
3469
3481
  }, "handleWeakeningSpit"),
@@ -3512,7 +3524,7 @@ var BattleEffectProcessor = {
3512
3524
  }, "handleHealingSwarm"),
3513
3525
  // 释放信息素 - 所有存活巢穴子代减伤20%
3514
3526
  handleReleasePheromones: /* @__PURE__ */ __name(function(targetBoss) {
3515
- if (!targetBoss.name.includes("巢穴雷兽") && !targetBoss.name.includes("巢穴战士") && !targetBoss.name.includes("巢穴甲虫") && !targetBoss.name.includes("孵化场")) return null;
3527
+ if (!targetBoss.name.includes("巢穴雷兽") && !targetBoss.name.includes("巢穴战士") && !targetBoss.name.includes("巢穴甲虫") && !targetBoss.name.includes("孵化场") && !targetBoss.name.includes("虫群女王")) return null;
3516
3528
  const messages = [`🌬️ 【释放信息素】生效:受到的伤害-20%`];
3517
3529
  const nerfMultiplier = 0.2;
3518
3530
  return { messages, nerfMultiplier };
@@ -3791,7 +3803,7 @@ function applyPassiveEffects(targetBoss, activeBosses, weaponName, damage, hasCr
3791
3803
  // 6. 淬毒撕咬
3792
3804
  { effect: BattleEffectProcessor.handlePoisonedBite, args: [targetBoss] },
3793
3805
  { effect: BattleEffectProcessor.handleHealingSwarm, args: [targetBoss, activeBosses] },
3794
- { effect: BattleEffectProcessor.handleBurrowAmbush, args: [targetBoss] }
3806
+ { effect: BattleEffectProcessor.handleBurrowAmbush, args: [targetBoss, activeBosses] }
3795
3807
  ];
3796
3808
  for (const effectItem of healingEffects) {
3797
3809
  processEffect(effectItem.effect, ...effectItem.args);
@@ -4207,11 +4219,11 @@ var passiveConfig = {
4207
4219
  },
4208
4220
  "爆虫伏击": {
4209
4221
  type: "",
4210
- description: "血量低于50%时,立即随机孵化1只巢穴子代(生效后移除)"
4222
+ description: "血量低于50%时,立即孵化巢穴子代直至上限(生效后移除)"
4211
4223
  },
4212
4224
  "虚弱喷吐": {
4213
4225
  type: "",
4214
- description: "当孵化场存活时,受到的伤害降低80%;孵化场死亡时,受到的伤害提高20%"
4226
+ description: "当孵化场存活时,受到的伤害降低80%"
4215
4227
  },
4216
4228
  "治愈虫群": {
4217
4229
  type: "",
@@ -4219,7 +4231,7 @@ var passiveConfig = {
4219
4231
  },
4220
4232
  "释放信息素": {
4221
4233
  type: "",
4222
- description: "所有存活的其他异形受到的伤害降低20%"
4234
+ description: "所有存活的异形受到的伤害降低20%"
4223
4235
  },
4224
4236
  "恐吓尖啸": {
4225
4237
  type: "",
@@ -5419,10 +5431,11 @@ async function handleDeathTargets(ctx, deadTargets, killerName, killerHandle) {
5419
5431
  ...rewardMessages
5420
5432
  );
5421
5433
  } else {
5422
- await ctx.database.set("ggcevo_boss", { groupId: deadBoss.groupId }, {
5434
+ await ctx.database.upsert("ggcevo_boss", [{
5435
+ name: deadBoss.name,
5423
5436
  isActive: false,
5424
5437
  HP: 0
5425
- });
5438
+ }], ["name"]);
5426
5439
  }
5427
5440
  }
5428
5441
  return {
@@ -5719,31 +5732,37 @@ async function testAttackFunction(ctx, session, handle, config, equippedWeapon,
5719
5732
  };
5720
5733
  }
5721
5734
  __name(testAttackFunction, "testAttackFunction");
5722
- async function createNestlingBosses(ctx, nestlingName) {
5723
- let foundMinion = null;
5724
- let groupId = null;
5725
- for (const bossGroup of bossPool) {
5726
- const minion = bossGroup.minions.find((m) => m.name === nestlingName);
5727
- if (minion) {
5728
- foundMinion = minion;
5729
- groupId = bossGroup.id;
5730
- break;
5735
+ async function createNestlingBosses(ctx, nestlingNames) {
5736
+ const names = Array.isArray(nestlingNames) ? nestlingNames : [nestlingNames];
5737
+ const createdBosses = [];
5738
+ for (const name2 of names) {
5739
+ let foundMinion = null;
5740
+ let groupId = null;
5741
+ for (const bossGroup of bossPool) {
5742
+ const minion = bossGroup.minions.find((m) => m.name === name2);
5743
+ if (minion) {
5744
+ foundMinion = minion;
5745
+ groupId = bossGroup.id;
5746
+ break;
5747
+ }
5731
5748
  }
5749
+ if (!foundMinion) {
5750
+ throw new Error(`未知的巢穴子代名称: ${name2}`);
5751
+ }
5752
+ const createdBoss = await ctx.database.create("ggcevo_boss", {
5753
+ name: foundMinion.name,
5754
+ type: foundMinion.type,
5755
+ HP: foundMinion.maxHP,
5756
+ tags: foundMinion.tags,
5757
+ skills: [...foundMinion.passive],
5758
+ energy: foundMinion.maxEnergy,
5759
+ groupId,
5760
+ isActive: true,
5761
+ respawnTime: /* @__PURE__ */ new Date()
5762
+ });
5763
+ createdBosses.push(createdBoss);
5732
5764
  }
5733
- if (!foundMinion) {
5734
- throw new Error(`未知的巢穴子代名称: ${nestlingName}`);
5735
- }
5736
- return ctx.database.create("ggcevo_boss", {
5737
- name: foundMinion.name,
5738
- type: foundMinion.type,
5739
- HP: foundMinion.maxHP,
5740
- tags: foundMinion.tags,
5741
- skills: [...foundMinion.passive],
5742
- energy: foundMinion.maxEnergy,
5743
- groupId,
5744
- isActive: true,
5745
- respawnTime: /* @__PURE__ */ new Date()
5746
- });
5765
+ return createdBosses;
5747
5766
  }
5748
5767
  __name(createNestlingBosses, "createNestlingBosses");
5749
5768
 
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.74",
4
+ "version": "1.4.75",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [