koishi-plugin-ggcevo-game 1.4.36 → 1.4.38

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.
@@ -1,12 +1,13 @@
1
1
  import { Context } from 'koishi';
2
2
  import { Config } from '../index';
3
- export declare function handlePrimaryAttack(ctx: Context, session: any, handle: any, config: Config, equippedWeapon: any, targetBoss: any, activeBosses: any[], weaponName: string): Promise<{
3
+ export declare function handlePrimaryAttack(ctx: Context, session: any, handle: string, config: Config, equippedWeapon: any, targetBoss: any, activeBosses: any[], weaponName: string): Promise<{
4
4
  initialDamage: number;
5
5
  currentHP: number;
6
6
  isDefeated: boolean;
7
7
  hasCrit: boolean;
8
8
  effectMessage: string[];
9
9
  passiveMessages: string[];
10
+ ignoreMessage: any[];
10
11
  radiationApplied: boolean;
11
12
  freezing: boolean;
12
13
  bileStacks: boolean;
@@ -15,6 +16,7 @@ export declare function handlePrimaryAttack(ctx: Context, session: any, handle:
15
16
  }>;
16
17
  export declare function handleScatterAttack(ctx: Context, session: any, handle: string, config: Config, equippedWeapon: any, targetBoss: any, weaponName: string, activeBosses: any[]): Promise<{
17
18
  scatterEffectMessages: string[];
19
+ ignoreMessage: string[];
18
20
  extraDamages: {
19
21
  name: string;
20
22
  damage: number;
@@ -36,8 +38,8 @@ export declare function calculateRewards(ctx: Context, handle: string, totalDama
36
38
  techMessage: string;
37
39
  }>;
38
40
  export declare function updateSignRecord(ctx: Context, handle: string, reward: number): Promise<void>;
39
- export declare function buildResultMessage(session: any, weaponName: string, targetBoss: any, primaryResult: any, scatterResult: any, finalReward: number, maxHP: number, careerMessage: string, techMessage: string, redcrystalMessage: string): string;
40
- export declare function handleBroadcasts(ctx: Context, groupIds: string[], bossEventBroadcast: string[] | string | null, cleanerRewardBroadcast: string[] | null, isPrimaryAttack: boolean): Promise<void>;
41
+ export declare function buildResultMessage(session: any, weaponName: string, targetBoss: any, primaryResult: any, scatterResult: any, finalReward: number, careerMessage: string, techMessage: string, redcrystalMessage: string): string;
42
+ export declare function handleBroadcasts(ctx: Context, groupIds: string[], bossEventBroadcast: string[] | string | null, cleanerRewardBroadcast: string[] | null): Promise<void>;
41
43
  export declare function updateBossDamageRecord(ctx: Context, handle: string, playerName: string, bossGroupId: number, damageAmount: number): Promise<void>;
42
44
  export declare function updateTaskProgress(ctx: Context, handle: string, taskUpdates: {
43
45
  taskId: number;
package/lib/index.js CHANGED
@@ -3650,8 +3650,7 @@ var BattleEffectProcessor = {
3650
3650
  ancientOmenBoost = totalBoost;
3651
3651
  psychicForgeBoost = totalBoost;
3652
3652
  if (totalBoost > 0) {
3653
- messages.push(`⚡ 【闪电冲锋】生效:每层光影之刃提升0.5%概率`);
3654
- messages.push(` → 当前${lightBladeStacks}层,远古预兆+${(ancientOmenBoost * 100).toFixed(1)}%,灵能构造炉+${(psychicForgeBoost * 100).toFixed(1)}%`);
3653
+ messages.push(`⚡ 【闪电冲锋】生效:当前${lightBladeStacks}层,远古预兆+${(ancientOmenBoost * 100).toFixed(1)}%,灵能构造炉+${(psychicForgeBoost * 100).toFixed(1)}%`);
3655
3654
  }
3656
3655
  return { ancientOmenBoost, psychicForgeBoost, messages };
3657
3656
  }, "handleLightningCharge"),
@@ -3817,9 +3816,9 @@ var BattleEffectProcessor = {
3817
3816
  const effectiveLayers = Math.min(currentLayers, 20);
3818
3817
  const buffMultiplier = effectiveLayers * 0.025;
3819
3818
  if (effectiveLayers > 0) {
3820
- messages.push(`☢️ 【辐射增伤】:当前${currentLayers}层,伤害提升${(effectiveLayers * 2.5).toFixed(1)}%`);
3819
+ messages.push(`☢️ 【辐射增伤】:当前${currentLayers}层,所受伤害提升${(effectiveLayers * 2.5).toFixed(1)}%`);
3821
3820
  if (currentLayers > 20) {
3822
- messages.push(`☢️ 注意:超过20层的辐射无效,不会提供额外增伤`);
3821
+ messages.push(`☢️ 注意:超过20层的辐射不会提供额外增伤`);
3823
3822
  }
3824
3823
  }
3825
3824
  let targetUpdates = null;
@@ -3834,7 +3833,7 @@ var BattleEffectProcessor = {
3834
3833
  }
3835
3834
  };
3836
3835
  const newLayers = currentLayers + 1;
3837
- messages.push(`☢️ 满足辐射条件,获得1层"辐射"效果,累计${newLayers}层`);
3836
+ messages.push(`☢️ 获得1层"辐射"效果,累计${newLayers}层`);
3838
3837
  layerAdded = true;
3839
3838
  }
3840
3839
  return {
@@ -3853,9 +3852,9 @@ var BattleEffectProcessor = {
3853
3852
  const effectiveLayers = Math.min(currentLayers, 20);
3854
3853
  const buffMultiplier = effectiveLayers * 0.025;
3855
3854
  if (effectiveLayers > 0) {
3856
- messages.push(`❄️ 【寒冷增伤】:当前${currentLayers}层,伤害提升${(effectiveLayers * 2.5).toFixed(1)}%`);
3855
+ messages.push(`❄️ 【寒冷增伤】:当前${currentLayers}层,所受伤害提升${(effectiveLayers * 2.5).toFixed(1)}%`);
3857
3856
  if (currentLayers > 20) {
3858
- messages.push(`❄️ 注意:超过20层的寒冷无效,不会提供额外增伤`);
3857
+ messages.push(`❄️ 注意:超过20层的寒冷不会提供额外增伤`);
3859
3858
  }
3860
3859
  }
3861
3860
  let targetUpdates = null;
@@ -3868,7 +3867,7 @@ var BattleEffectProcessor = {
3868
3867
  }
3869
3868
  };
3870
3869
  const newLayers = currentLayers + 1;
3871
- messages.push(`❄️ 满足寒冷条件,获得1层"寒冷"效果,累计${newLayers}层`);
3870
+ messages.push(`❄️ 获得1层"寒冷"效果,累计${newLayers}层`);
3872
3871
  layerAdded = true;
3873
3872
  }
3874
3873
  return {
@@ -4188,7 +4187,7 @@ function applyPassiveEffects(targetBoss, activeBosses, weaponName, damage, ignor
4188
4187
  if (!immune) {
4189
4188
  let adjustedNerfMultiplier = totalNerfMultiplier * (1 - ignoreRate);
4190
4189
  if (ignoreRate > 0 && totalNerfMultiplier > 0) {
4191
- messages.push(`🛡️ 无视减伤: 无视了${(ignoreRate * 100).toFixed(1)}%减伤效果`);
4190
+ messages.push(`🗡️ 无视减伤: 无视了${(ignoreRate * 100).toFixed(1)}%减伤效果`);
4192
4191
  messages.push(` 减伤系数由${(totalNerfMultiplier * 100).toFixed(1)}%降低至${(adjustedNerfMultiplier * 100).toFixed(1)}%`);
4193
4192
  }
4194
4193
  const damageMultiplier = 1 + totalBuffMultiplier - adjustedNerfMultiplier;
@@ -4387,6 +4386,7 @@ async function handlePrimaryAttack(ctx, session, handle, config, equippedWeapon,
4387
4386
  hasCrit: damageResult.hasCrit,
4388
4387
  effectMessage: damageResult.effectMessage,
4389
4388
  passiveMessages: EffectProcessor.messages,
4389
+ ignoreMessage: ignoreReduction.messages,
4390
4390
  radiationApplied: EffectProcessor.radiationLayerAdded,
4391
4391
  freezing: EffectProcessor.coldLayerAdded,
4392
4392
  bileStacks: EffectProcessor.bileDetonationTrigger,
@@ -4398,6 +4398,7 @@ __name(handlePrimaryAttack, "handlePrimaryAttack");
4398
4398
  async function handleScatterAttack(ctx, session, handle, config, equippedWeapon, targetBoss, weaponName, activeBosses) {
4399
4399
  const secondaryTargets = activeBosses.filter((boss) => boss.name !== targetBoss.name);
4400
4400
  const scatterEffectMessages = [];
4401
+ const ignoreMessage = [];
4401
4402
  const extraDamages = [];
4402
4403
  const actuallyDead = [];
4403
4404
  const taskUpdates = [];
@@ -4418,11 +4419,11 @@ async function handleScatterAttack(ctx, session, handle, config, equippedWeapon,
4418
4419
  secondaryTarget
4419
4420
  );
4420
4421
  const secondaryDamage = Math.round(damageResult.damage * scatterRatio);
4421
- const ignoreReduction = await handleIgnoreReductionEffects(ctx, handle, weaponName, targetBoss);
4422
- const EffectProcessor = applyPassiveEffects(targetBoss, activeBosses, weaponName, secondaryDamage, ignoreReduction.ignoreRate);
4422
+ const ignoreReduction = await handleIgnoreReductionEffects(ctx, handle, weaponName, secondaryTarget);
4423
+ const EffectProcessor = applyPassiveEffects(secondaryTarget, activeBosses, weaponName, secondaryDamage, ignoreReduction.ignoreRate);
4423
4424
  const actualDamage = EffectProcessor.finalDamage;
4424
4425
  await saveAndClearStats(ctx);
4425
- const [currentboss] = await ctx.database.get("ggcevo_boss", { name: targetBoss.name });
4426
+ const [currentboss] = await ctx.database.get("ggcevo_boss", { name: secondaryTarget.name });
4426
4427
  const currentHP = currentboss.HP;
4427
4428
  extraDamages.push({
4428
4429
  name: secondaryTarget.name,
@@ -4445,12 +4446,14 @@ async function handleScatterAttack(ctx, session, handle, config, equippedWeapon,
4445
4446
  }
4446
4447
  const isDead = currentHP <= 0;
4447
4448
  scatterEffectMessages.push(...EffectProcessor.messages.map((m) => ` 对 ${secondaryTarget.name} ${m}`));
4449
+ ignoreMessage.push(...ignoreReduction.messages.map((m) => ` 对 ${secondaryTarget.name} ${m}`));
4448
4450
  if (isDead) {
4449
4451
  actuallyDead.push(secondaryTarget.name);
4450
4452
  }
4451
4453
  }
4452
4454
  return {
4453
4455
  scatterEffectMessages,
4456
+ ignoreMessage,
4454
4457
  extraDamages,
4455
4458
  actuallyDead,
4456
4459
  taskUpdates
@@ -4539,7 +4542,6 @@ async function calculateRewards(ctx, handle, totalDamage) {
4539
4542
  careerMessage,
4540
4543
  redcrystalMessage,
4541
4544
  techMessage
4542
- // 新增:独立返回科技奖励信息
4543
4545
  };
4544
4546
  }
4545
4547
  __name(calculateRewards, "calculateRewards");
@@ -4551,12 +4553,17 @@ async function updateSignRecord(ctx, handle, reward) {
4551
4553
  }], ["handle"]);
4552
4554
  }
4553
4555
  __name(updateSignRecord, "updateSignRecord");
4554
- function buildResultMessage(session, weaponName, targetBoss, primaryResult, scatterResult, finalReward, maxHP, careerMessage, techMessage, redcrystalMessage) {
4556
+ function buildResultMessage(session, weaponName, targetBoss, primaryResult, scatterResult, finalReward, careerMessage, techMessage, redcrystalMessage) {
4557
+ const maxHP = getMaxHPByName2(targetBoss.name);
4555
4558
  const messages = [
4556
4559
  `🔥 ${session.username} 使用武器 ${weaponName} 对 ${targetBoss.name} 发起攻击!`,
4557
4560
  ...primaryResult.effectMessage.length > 0 ? [
4558
4561
  `⚡ 攻击效果:
4559
4562
  ${primaryResult.effectMessage.map((m) => `▸ ${m}`).join("\n")}`
4563
+ ] : [],
4564
+ ...primaryResult.ignoreMessage.length > 0 ? [
4565
+ `🗡️ 无视减伤效果:
4566
+ ${primaryResult.ignoreMessage.map((m) => `▸ ${m}`).join("\n")}`
4560
4567
  ] : [],
4561
4568
  ...primaryResult.passiveMessages.length > 0 ? [
4562
4569
  `🛡️ 被动效果:
@@ -4566,6 +4573,10 @@ ${primaryResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
4566
4573
  ];
4567
4574
  if (scatterResult) {
4568
4575
  messages.push(
4576
+ ...scatterResult.ignoreMessage.length > 0 ? [
4577
+ `🗡️ 无视减伤效果:
4578
+ ${scatterResult.ignoreMessage.map((m) => `▸ ${m}`).join("\n")}`
4579
+ ] : [],
4569
4580
  `⚡ 散射效果:
4570
4581
  ${scatterResult.scatterEffectMessages.map((m) => `▸ ${m}`).join("\n")}`,
4571
4582
  `散射伤害:`,
@@ -4596,7 +4607,7 @@ ${scatterResult.scatterEffectMessages.map((m) => `▸ ${m}`).join("\n")}`,
4596
4607
  return messages.filter((line) => line).join("\n");
4597
4608
  }
4598
4609
  __name(buildResultMessage, "buildResultMessage");
4599
- async function handleBroadcasts(ctx, groupIds, bossEventBroadcast, cleanerRewardBroadcast, isPrimaryAttack) {
4610
+ async function handleBroadcasts(ctx, groupIds, bossEventBroadcast, cleanerRewardBroadcast) {
4600
4611
  const broadcastMessages = [];
4601
4612
  if (bossEventBroadcast) {
4602
4613
  const bossMsg = Array.isArray(bossEventBroadcast) ? bossEventBroadcast.join("\n") : bossEventBroadcast;
@@ -7287,11 +7298,6 @@ ${validTypes.join("、")}`;
7287
7298
  if (!weaponData.isantiair && targetBoss.groupId === 5) {
7288
7299
  return "您当前装备的武器无法攻击空中目标!";
7289
7300
  }
7290
- const bossGroup = bossPool.find(
7291
- (g) => g.main.name === targetBoss.name || g.minions.some((m) => m.name === targetBoss.name)
7292
- );
7293
- if (!bossGroup) return "无法获取异形组配置。";
7294
- const maxHP = targetBoss.type === "主宰" ? bossGroup.main.maxHP : bossGroup.minions.find((m) => m.name === targetBoss.name)?.maxHP || 0;
7295
7301
  const primaryAttackResult = await handlePrimaryAttack(
7296
7302
  ctx,
7297
7303
  session,
@@ -7374,7 +7380,6 @@ ${validTypes.join("、")}`;
7374
7380
  primaryAttackResult,
7375
7381
  scatterResult,
7376
7382
  finalReward,
7377
- maxHP,
7378
7383
  careerMessage,
7379
7384
  techMessage,
7380
7385
  redcrystalMessage
@@ -7385,8 +7390,7 @@ ${validTypes.join("、")}`;
7385
7390
  ctx,
7386
7391
  groupId,
7387
7392
  bossEventBroadcast,
7388
- cleanerRewardBroadcast,
7389
- !isScatterAttack
7393
+ cleanerRewardBroadcast
7390
7394
  );
7391
7395
  });
7392
7396
  ctx.command("ggcevo/攻击假人").option("tags", "-t <tags:string> 添加BOSS标签(逗号分隔)").action(async (argv) => {
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.36",
4
+ "version": "1.4.38",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [