koishi-plugin-ggcevo-game 1.4.29 → 1.4.31

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.
@@ -11,6 +11,8 @@ export declare function handlePrimaryAttack(ctx: Context, session: any, config:
11
11
  radiationApplied: boolean;
12
12
  freezing: boolean;
13
13
  bileStacks: any;
14
+ pulseApplied: boolean;
15
+ arcApplied: boolean;
14
16
  }>;
15
17
  export declare function handleScatterAttack(ctx: Context, session: any, config: Config, handle: string, equippedWeapon: any, targetBoss: any, weaponName: string, weaponData: any, activeBosses: any[], bossGroup: any): Promise<{
16
18
  scatterEffectMessages: string[];
@@ -105,6 +105,7 @@ export declare const PassiveHandler: {
105
105
  }>;
106
106
  handleArcWelderEffect: (ctx: Context, targetBoss: any, weaponName: string) => Promise<{
107
107
  messages: string[];
108
+ arcApplied: boolean;
108
109
  }>;
109
110
  handleArcRifleEffect: (ctx: Context, targetBoss: any, weaponName: string, messages: string[]) => Promise<{
110
111
  drainAmount: number;
@@ -181,6 +182,7 @@ export declare const PassiveHandler: {
181
182
  }>;
182
183
  handlePulseDisruptor: (ctx: Context, targetBoss: any, weaponName: string) => Promise<{
183
184
  messages: string[];
185
+ pulseApplied: boolean;
184
186
  }>;
185
187
  handleStellarWind: (ctx: Context, targetBoss: any, initialDamage: number, currentHP: number, maxHP: number, activeBosses: any[], bossGroup: BossPoolItem) => Promise<{
186
188
  messages: string[];
@@ -235,6 +237,8 @@ export declare const PassiveHandler: {
235
237
  bileStacks?: undefined;
236
238
  radiationApplied?: undefined;
237
239
  freezing?: undefined;
240
+ pulseApplied?: undefined;
241
+ arcApplied?: undefined;
238
242
  } | {
239
243
  currentHP: any;
240
244
  messages: any;
@@ -243,6 +247,8 @@ export declare const PassiveHandler: {
243
247
  bileStacks: any;
244
248
  radiationApplied?: undefined;
245
249
  freezing?: undefined;
250
+ pulseApplied?: undefined;
251
+ arcApplied?: undefined;
246
252
  } | {
247
253
  currentHP: number;
248
254
  messages: string[];
@@ -251,6 +257,18 @@ export declare const PassiveHandler: {
251
257
  radiationApplied: boolean;
252
258
  freezing: boolean;
253
259
  bileStacks?: undefined;
260
+ pulseApplied?: undefined;
261
+ arcApplied?: undefined;
262
+ } | {
263
+ currentHP: number;
264
+ messages: string[];
265
+ skillUpdates: any[];
266
+ initialDamage: number;
267
+ radiationApplied: boolean;
268
+ freezing: boolean;
269
+ pulseApplied: boolean;
270
+ arcApplied: boolean;
271
+ bileStacks?: undefined;
254
272
  }>;
255
273
  applySkillUpdates: (ctx: Context, skillUpdates: any[]) => Promise<void>;
256
274
  };
package/lib/index.js CHANGED
@@ -1009,29 +1009,47 @@ var Tasklist = {
1009
1009
  "伽马辐射": {
1010
1010
  id: 1,
1011
1011
  type: "可重复任务",
1012
- description: "利用【伽马枪】武器对异形目标造成辐射伤害",
1012
+ description: "利用【伽马枪】武器对目标造成辐射伤害",
1013
1013
  target: 1,
1014
1014
  price: 50,
1015
1015
  redCrystalCost: 0,
1016
- condition: "使用伽马枪攻击异形并成功使辐射层数+1"
1016
+ condition: "使用伽马枪攻击目标并成功增加其辐射层数"
1017
1017
  },
1018
1018
  "绝对零度": {
1019
1019
  id: 2,
1020
1020
  type: "可重复任务",
1021
- description: "利用【零度之下】武器对异形目标造成寒冷伤害",
1021
+ description: "利用【零度之下】武器对目标造成寒冷伤害",
1022
1022
  target: 1,
1023
1023
  price: 50,
1024
1024
  redCrystalCost: 0,
1025
- condition: "使用零度之下攻击异形并成功使寒冷层数+1"
1025
+ condition: "使用零度之下攻击目标并成功增加其寒冷层数"
1026
1026
  },
1027
1027
  "胆汁引爆": {
1028
1028
  id: 3,
1029
1029
  type: "可重复任务",
1030
- description: "利用【焚烧枪】武器引爆异形目标的胆汁",
1030
+ description: "利用【焚烧枪】武器引爆目标的胆汁",
1031
1031
  target: 1,
1032
1032
  price: 200,
1033
1033
  redCrystalCost: 0,
1034
- condition: "使用焚烧枪攻击异形并成功引爆≥10层的胆汁"
1034
+ condition: "使用焚烧枪攻击异形并成功引爆其≥10层的胆汁"
1035
+ },
1036
+ "脉冲干扰": {
1037
+ id: 4,
1038
+ type: "可重复任务",
1039
+ description: "利用【脉冲扰乱枪】武器干扰目标的技能释放",
1040
+ target: 1,
1041
+ price: 75,
1042
+ redCrystalCost: 0,
1043
+ condition: "使用脉冲扰乱枪攻击异形并成功减少其技能层数"
1044
+ },
1045
+ "弧能消耗": {
1046
+ id: 5,
1047
+ type: "可重复任务",
1048
+ description: "利用【弧焊枪】武器消耗目标的能量",
1049
+ target: 1,
1050
+ price: 75,
1051
+ redCrystalCost: 0,
1052
+ condition: "使用弧焊枪攻击异形并成功消耗其能量"
1035
1053
  }
1036
1054
  };
1037
1055
 
@@ -2934,6 +2952,7 @@ var PassiveHandler = {
2934
2952
  if (weaponName !== "弧焊枪") return null;
2935
2953
  const currentEnergy = targetBoss.energy || 0;
2936
2954
  const messages = [];
2955
+ let arcApplied = false;
2937
2956
  if (currentEnergy > 0) {
2938
2957
  const energyDrain = Math.min(200, currentEnergy);
2939
2958
  const newEnergy = currentEnergy - energyDrain;
@@ -2942,11 +2961,12 @@ var PassiveHandler = {
2942
2961
  { name: targetBoss.name },
2943
2962
  { energy: newEnergy }
2944
2963
  );
2964
+ arcApplied = true;
2945
2965
  messages.push(`⚡ 【弧焊枪】武器效果:消耗目标200点能量`);
2946
2966
  } else {
2947
2967
  return null;
2948
2968
  }
2949
- return { messages };
2969
+ return { messages, arcApplied };
2950
2970
  }, "handleArcWelderEffect"),
2951
2971
  // 在 PassiveHandler 对象中添加新的处理函数
2952
2972
  handleArcRifleEffect: /* @__PURE__ */ __name(async function(ctx, targetBoss, weaponName, messages) {
@@ -3366,6 +3386,7 @@ var PassiveHandler = {
3366
3386
  return null;
3367
3387
  }
3368
3388
  const currentSkillCount = targetBoss.Skillcountpoints || 0;
3389
+ let pulseApplied = false;
3369
3390
  if (currentSkillCount <= 0) {
3370
3391
  return null;
3371
3392
  }
@@ -3375,11 +3396,12 @@ var PassiveHandler = {
3375
3396
  { name: targetBoss.name },
3376
3397
  { Skillcountpoints: newCount }
3377
3398
  );
3378
- targetBoss.Skillcountpoints = newCount;
3399
+ pulseApplied = true;
3379
3400
  return {
3380
3401
  messages: [
3381
- `⚡ 【脉冲扰乱枪】武器效果:使${targetBoss.name}的技能层数减少2层(当前${newCount}层)`
3382
- ]
3402
+ `⚡ 【脉冲扰乱枪】武器效果:使${targetBoss.name}的技能层数减少2层`
3403
+ ],
3404
+ pulseApplied
3383
3405
  };
3384
3406
  }, "handlePulseDisruptor"),
3385
3407
  // === 星界之风 ===
@@ -3401,12 +3423,16 @@ var PassiveHandler = {
3401
3423
  (b) => b.groupId === targetBoss.groupId && b.HP > 0
3402
3424
  );
3403
3425
  const updates = [];
3404
- const messages = [`🌠 【星界之风】生效:治疗所有存活异形200点血量`];
3426
+ const messages = [`🌠 【星界之风】生效:治疗所有存活异形`];
3427
+ let updatedHP = currentHP;
3405
3428
  for (const member of groupMembers) {
3406
- const maxHP2 = PassiveHandler.getMemberConfig(member.name, bossGroup)?.maxHP;
3407
- if (!maxHP2) continue;
3429
+ const memberConfig = PassiveHandler.getMemberConfig(member.name, bossGroup);
3430
+ if (!memberConfig) continue;
3431
+ const maxMemberHP = memberConfig.maxHP;
3408
3432
  const healAmount = 200;
3409
- const newHP = Math.min(member.HP + healAmount, maxHP2);
3433
+ const actualHeal = Math.min(healAmount, maxMemberHP - member.HP);
3434
+ if (actualHeal <= 0) continue;
3435
+ const newHP = member.HP + actualHeal;
3410
3436
  updates.push(
3411
3437
  ctx.database.set(
3412
3438
  "ggcevo_boss",
@@ -3414,12 +3440,16 @@ var PassiveHandler = {
3414
3440
  { HP: newHP }
3415
3441
  )
3416
3442
  );
3417
- messages.push(`${member.name} +${healAmount}HP`);
3443
+ messages.push(`${member.name} +${actualHeal}HP`);
3444
+ if (member.name === targetBoss.name) {
3445
+ updatedHP = newHP;
3446
+ }
3418
3447
  }
3419
- if (hasPsychicFrenzy && isInFrenzy) {
3448
+ if (updates.length === 0) {
3449
+ return null;
3420
3450
  }
3421
3451
  await Promise.all(updates);
3422
- return { messages, updatedHP: currentHP + 200 };
3452
+ return { messages, updatedHP };
3423
3453
  }
3424
3454
  return null;
3425
3455
  }, "handleStellarWind"),
@@ -3622,30 +3652,38 @@ var PassiveHandler = {
3622
3652
  const groupMembers = activeBosses.filter(
3623
3653
  (b) => b.groupId === targetBoss.groupId && b.HP > 0
3624
3654
  );
3625
- const healAmount = lightbladeStacks * 10;
3655
+ const healPerStack = 10;
3656
+ const totalHeal = lightbladeStacks * healPerStack;
3626
3657
  const updates = [];
3627
3658
  const messages = [`🛡️ 【天启超载护盾】生效:治疗所有存活异形`];
3659
+ let updatedHP = currentHP;
3628
3660
  for (const member of groupMembers) {
3629
- const maxHP = this.getMemberConfig(member.name, bossGroup)?.maxHP;
3630
- if (!maxHP) continue;
3631
- const heal = Math.min(healAmount, maxHP - member.HP);
3632
- if (heal > 0) {
3633
- const newHP = member.HP + heal;
3634
- updates.push(
3635
- ctx.database.set(
3636
- "ggcevo_boss",
3637
- { name: member.name },
3638
- { HP: newHP }
3639
- )
3640
- );
3641
- messages.push(`${member.name} +${heal}HP`);
3661
+ const memberConfig = PassiveHandler.getMemberConfig(member.name, bossGroup);
3662
+ if (!memberConfig) continue;
3663
+ const maxMemberHP = memberConfig.maxHP;
3664
+ const actualHeal = Math.min(totalHeal, maxMemberHP - member.HP);
3665
+ if (actualHeal <= 0) continue;
3666
+ const newHP = member.HP + actualHeal;
3667
+ updates.push(
3668
+ ctx.database.set(
3669
+ "ggcevo_boss",
3670
+ { name: member.name },
3671
+ { HP: newHP }
3672
+ )
3673
+ );
3674
+ messages.push(`${member.name} +${actualHeal}HP`);
3675
+ if (member.name === targetBoss.name) {
3676
+ updatedHP = newHP;
3642
3677
  }
3643
3678
  }
3679
+ if (updates.length === 0) {
3680
+ return null;
3681
+ }
3644
3682
  await Promise.all(updates);
3645
3683
  return {
3646
3684
  messages,
3647
- updatedHP: currentHP + healAmount
3648
- // 不再清除层数
3685
+ updatedHP
3686
+ // 返回当前目标的新HP(如果被治疗)
3649
3687
  };
3650
3688
  }
3651
3689
  return null;
@@ -3726,6 +3764,8 @@ var PassiveHandler = {
3726
3764
  let nerfMultiplier = 0;
3727
3765
  let radiationApplied = false;
3728
3766
  let freezing = false;
3767
+ let pulseApplied = false;
3768
+ let arcApplied = false;
3729
3769
  let bileStacks = 0;
3730
3770
  const activeBosses = await ctx.database.get("ggcevo_boss", { isActive: true });
3731
3771
  const solarFlareResult = await this.handleSolarFlare(ctx, targetBoss, weaponName);
@@ -4040,10 +4080,12 @@ var PassiveHandler = {
4040
4080
  );
4041
4081
  if (pulseDisruptorResult) {
4042
4082
  messages.push(...pulseDisruptorResult.messages);
4083
+ pulseApplied = pulseDisruptorResult.pulseApplied;
4043
4084
  }
4044
4085
  const arcResult = await this.handleArcWelderEffect(ctx, targetBoss, weaponName);
4045
4086
  if (arcResult) {
4046
4087
  messages.push(...arcResult.messages);
4088
+ arcApplied = arcResult.arcApplied;
4047
4089
  }
4048
4090
  const arcRifleResult = await this.handleArcRifleEffect(ctx, targetBoss, weaponName, messages);
4049
4091
  if (arcRifleResult) {
@@ -4114,7 +4156,9 @@ var PassiveHandler = {
4114
4156
  initialDamage: finalDamage,
4115
4157
  radiationApplied,
4116
4158
  // 新增返回辐射应用标记
4117
- freezing
4159
+ freezing,
4160
+ pulseApplied,
4161
+ arcApplied
4118
4162
  };
4119
4163
  }, "handlePassives"),
4120
4164
  // 应用技能更新到数据库(优化合并同名boss的更新)
@@ -4355,7 +4399,9 @@ async function handlePrimaryAttack(ctx, session, config, handle, equippedWeapon,
4355
4399
  passiveMessages: passiveResult.messages,
4356
4400
  radiationApplied: passiveResult.radiationApplied,
4357
4401
  freezing: passiveResult.freezing,
4358
- bileStacks: passiveResult.bileStacks
4402
+ bileStacks: passiveResult.bileStacks,
4403
+ pulseApplied: passiveResult.pulseApplied,
4404
+ arcApplied: passiveResult.arcApplied
4359
4405
  };
4360
4406
  }
4361
4407
  __name(handlePrimaryAttack, "handlePrimaryAttack");
@@ -4411,6 +4457,12 @@ async function handleScatterAttack(ctx, session, config, handle, equippedWeapon,
4411
4457
  if (passiveResult.bileStacks >= 10) {
4412
4458
  taskUpdates.push({ taskId: 3, count: 1 });
4413
4459
  }
4460
+ if (passiveResult.pulseApplied) {
4461
+ taskUpdates.push({ taskId: 4, count: 1 });
4462
+ }
4463
+ if (passiveResult.arcApplied) {
4464
+ taskUpdates.push({ taskId: 5, count: 1 });
4465
+ }
4414
4466
  const isDead = newHP <= 0;
4415
4467
  await ctx.database.set("ggcevo_boss", { name: secondaryTarget.name }, {
4416
4468
  HP: Math.max(newHP, 0),
@@ -7240,6 +7292,12 @@ ${validTypes.join("、")}`;
7240
7292
  if (primaryAttackResult.bileStacks >= 10) {
7241
7293
  taskUpdates.push({ taskId: 3, count: 1 });
7242
7294
  }
7295
+ if (primaryAttackResult.pulseApplied) {
7296
+ taskUpdates.push({ taskId: 4, count: 1 });
7297
+ }
7298
+ if (primaryAttackResult.arcApplied) {
7299
+ taskUpdates.push({ taskId: 5, count: 1 });
7300
+ }
7243
7301
  if (scatterResult && scatterResult.taskUpdates) {
7244
7302
  scatterResult.taskUpdates.forEach((update) => {
7245
7303
  taskUpdates.push(update);
@@ -7318,7 +7376,7 @@ ${validTypes.join("、")}`;
7318
7376
  // 这里添加符号
7319
7377
  ] : [],
7320
7378
  `📊 理论伤害值:${damage}${hasCrit ? " (✨ 暴击)" : ""}`,
7321
- "💡 提示:使用 -t 重甲,生物……(标签之间用英文逗号分隔) 添加测试标签"
7379
+ "💡 提示:添加测试标签: -t 重甲,生物(标签之间用英文逗号分隔)"
7322
7380
  ].filter((line) => line).join("\n");
7323
7381
  });
7324
7382
  ctx.command("ggcevo/伤害榜 [page]", "查看当前主宰伤害排名").usage("输入 伤害榜 [页码] 查看对应页的排行榜,每页10条").action(async (_, page) => {
package/lib/tasks.d.ts CHANGED
@@ -26,4 +26,22 @@ export declare const Tasklist: {
26
26
  redCrystalCost: number;
27
27
  condition: string;
28
28
  };
29
+ 脉冲干扰: {
30
+ id: number;
31
+ type: string;
32
+ description: string;
33
+ target: number;
34
+ price: number;
35
+ redCrystalCost: number;
36
+ condition: string;
37
+ };
38
+ 弧能消耗: {
39
+ id: number;
40
+ type: string;
41
+ description: string;
42
+ target: number;
43
+ price: number;
44
+ redCrystalCost: number;
45
+ condition: string;
46
+ };
29
47
  };
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.29",
4
+ "version": "1.4.31",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [