koishi-plugin-ggcevo-game 1.4.33 → 1.4.34

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.
@@ -407,7 +407,7 @@ export declare const BattleEffectProcessor: {
407
407
  * @param activeBosses 当前所有活跃Boss列表
408
408
  * @returns 包含最终伤害值和所有效果消息的对象
409
409
  */
410
- export declare function applyPassiveEffects(targetBoss: any, weaponName: string, damage: number, activeBosses: any[]): {
410
+ export declare function applyPassiveEffects(targetBoss: any, activeBosses: any[], weaponName: string, damage: number, ignoreRate: number): {
411
411
  finalDamage: number;
412
412
  messages: string[];
413
413
  radiationLayerAdded: boolean;
@@ -1,6 +1,6 @@
1
1
  import { Context } from 'koishi';
2
2
  import { Config } from '../index';
3
- export declare function handlePrimaryAttack(ctx: Context, session: any, config: Config, equippedWeapon: any, targetBoss: any, activeBosses: any[], weaponName: string): Promise<{
3
+ export declare function handlePrimaryAttack(ctx: Context, session: any, handle: any, config: Config, equippedWeapon: any, targetBoss: any, activeBosses: any[], weaponName: string): Promise<{
4
4
  initialDamage: number;
5
5
  currentHP: number;
6
6
  isDefeated: boolean;
@@ -13,7 +13,7 @@ export declare function handlePrimaryAttack(ctx: Context, session: any, config:
13
13
  pulseApplied: boolean;
14
14
  arcApplied: boolean;
15
15
  }>;
16
- export declare function handleScatterAttack(ctx: Context, session: any, config: Config, equippedWeapon: any, targetBoss: any, weaponName: string, activeBosses: any[]): Promise<{
16
+ export declare function handleScatterAttack(ctx: Context, session: any, handle: string, config: Config, equippedWeapon: any, targetBoss: any, weaponName: string, activeBosses: any[]): Promise<{
17
17
  scatterEffectMessages: string[];
18
18
  extraDamages: {
19
19
  name: string;
package/lib/index.js CHANGED
@@ -3943,7 +3943,7 @@ var BattleEffectProcessor = {
3943
3943
  };
3944
3944
  }, "handleWeaponLayerReduction")
3945
3945
  };
3946
- function applyPassiveEffects(targetBoss, weaponName, damage, activeBosses) {
3946
+ function applyPassiveEffects(targetBoss, activeBosses, weaponName, damage, ignoreRate) {
3947
3947
  const messages = [];
3948
3948
  let immune = false;
3949
3949
  let totalBuffMultiplier = 0;
@@ -4186,7 +4186,12 @@ function applyPassiveEffects(targetBoss, weaponName, damage, activeBosses) {
4186
4186
  }
4187
4187
  let finalDamage = damage;
4188
4188
  if (!immune) {
4189
- const damageMultiplier = 1 + totalBuffMultiplier - totalNerfMultiplier;
4189
+ let adjustedNerfMultiplier = totalNerfMultiplier * (1 - ignoreRate);
4190
+ if (ignoreRate > 0 && totalNerfMultiplier > 0) {
4191
+ messages.push(`🛡️ 无视减伤: 无视了${(ignoreRate * 100).toFixed(1)}%减伤效果`);
4192
+ messages.push(` 减伤系数由${(totalNerfMultiplier * 100).toFixed(1)}%降低至${(adjustedNerfMultiplier * 100).toFixed(1)}%`);
4193
+ }
4194
+ const damageMultiplier = 1 + totalBuffMultiplier - adjustedNerfMultiplier;
4190
4195
  finalDamage = Math.max(1, Math.round(damage * damageMultiplier));
4191
4196
  if (damage !== finalDamage) {
4192
4197
  const adjustmentPercent = ((damageMultiplier - 1) * 100).toFixed(1);
@@ -4366,9 +4371,10 @@ async function handleBossDefeatRewards(ctx, targetBoss) {
4366
4371
  return { rewardMessages };
4367
4372
  }
4368
4373
  __name(handleBossDefeatRewards, "handleBossDefeatRewards");
4369
- async function handlePrimaryAttack(ctx, session, config, equippedWeapon, targetBoss, activeBosses, weaponName) {
4374
+ async function handlePrimaryAttack(ctx, session, handle, config, equippedWeapon, targetBoss, activeBosses, weaponName) {
4370
4375
  const damageResult = await calculateTotalDamage(ctx, session, config, equippedWeapon, targetBoss);
4371
- const EffectProcessor = applyPassiveEffects(targetBoss, weaponName, damageResult.damage, activeBosses);
4376
+ const ignoreReduction = await handleIgnoreReductionEffects(ctx, handle, weaponName, targetBoss);
4377
+ const EffectProcessor = applyPassiveEffects(targetBoss, activeBosses, weaponName, damageResult.damage, ignoreReduction.ignoreRate);
4372
4378
  const initialDamage = EffectProcessor.finalDamage;
4373
4379
  await saveAndClearStats(ctx);
4374
4380
  const [currentboss] = await ctx.database.get("ggcevo_boss", { name: targetBoss.name });
@@ -4389,7 +4395,7 @@ async function handlePrimaryAttack(ctx, session, config, equippedWeapon, targetB
4389
4395
  };
4390
4396
  }
4391
4397
  __name(handlePrimaryAttack, "handlePrimaryAttack");
4392
- async function handleScatterAttack(ctx, session, config, equippedWeapon, targetBoss, weaponName, activeBosses) {
4398
+ async function handleScatterAttack(ctx, session, handle, config, equippedWeapon, targetBoss, weaponName, activeBosses) {
4393
4399
  const secondaryTargets = activeBosses.filter((boss) => boss.name !== targetBoss.name);
4394
4400
  const scatterEffectMessages = [];
4395
4401
  const extraDamages = [];
@@ -4412,7 +4418,8 @@ async function handleScatterAttack(ctx, session, config, equippedWeapon, targetB
4412
4418
  secondaryTarget
4413
4419
  );
4414
4420
  const secondaryDamage = Math.round(damageResult.damage * scatterRatio);
4415
- const EffectProcessor = applyPassiveEffects(targetBoss, weaponName, secondaryDamage, activeBosses);
4421
+ const ignoreReduction = await handleIgnoreReductionEffects(ctx, handle, weaponName, targetBoss);
4422
+ const EffectProcessor = applyPassiveEffects(targetBoss, activeBosses, weaponName, secondaryDamage, ignoreReduction.ignoreRate);
4416
4423
  const actualDamage = EffectProcessor.finalDamage;
4417
4424
  await saveAndClearStats(ctx);
4418
4425
  const [currentboss] = await ctx.database.get("ggcevo_boss", { name: targetBoss.name });
@@ -4717,6 +4724,64 @@ async function saveAndClearStats(ctx) {
4717
4724
  Object.keys(battleStatsMap).forEach((key) => delete battleStatsMap[key]);
4718
4725
  }
4719
4726
  __name(saveAndClearStats, "saveAndClearStats");
4727
+ async function handleIgnoreReductionEffects(ctx, handle, weaponName, targetBoss) {
4728
+ const ignoreEffects = [];
4729
+ const messages = [];
4730
+ const handleWeaponEffect = /* @__PURE__ */ __name(() => {
4731
+ if (weaponName === "光剑") {
4732
+ ignoreEffects.push(1);
4733
+ messages.push(`⚔️ 【光剑】武器效果:无视目标100%减伤效果`);
4734
+ } else if (weaponName === "M4AE脉冲步枪") {
4735
+ ignoreEffects.push(0.8);
4736
+ messages.push(`🔫 【M4AE脉冲步枪】武器效果:无视目标80%减伤效果`);
4737
+ } else if (weaponName === "粒子相位枪" && targetBoss?.tags.includes("护盾")) {
4738
+ ignoreEffects.push(0.5);
4739
+ messages.push(`⚡ 【粒子相位枪】武器效果:无视护盾目标50%减伤效果`);
4740
+ }
4741
+ }, "handleWeaponEffect");
4742
+ const handlePiercingMod = /* @__PURE__ */ __name(async () => {
4743
+ const weaponConfigData = weaponConfig[weaponName];
4744
+ if (!weaponConfigData) return;
4745
+ const [equippedWeapon] = await ctx.database.get("ggcevo_equipment", {
4746
+ weaponId: weaponConfigData.id,
4747
+ handle,
4748
+ equipped: true
4749
+ });
4750
+ if (equippedWeapon?.installedMods?.includes("破甲模块")) {
4751
+ ignoreEffects.push(0.2);
4752
+ messages.push(`⚡ 【破甲模块】生效:无视目标20%减伤效果`);
4753
+ }
4754
+ }, "handlePiercingMod");
4755
+ handleWeaponEffect();
4756
+ await handlePiercingMod();
4757
+ const handleCareerEffects = /* @__PURE__ */ __name(async () => {
4758
+ const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
4759
+ if (!careerData || careerData.group !== "辛迪加海盗") return;
4760
+ const [radarMask] = await ctx.database.get("ggcevo_warehouse", {
4761
+ handle,
4762
+ itemId: 6
4763
+ });
4764
+ if (radarMask?.quantity > 0) {
4765
+ ignoreEffects.push(0.1);
4766
+ messages.push(`🛰️ 【雷达面罩】生效:无视目标10%减伤效果`);
4767
+ }
4768
+ if (careerData.career === "猩红杀手" && weaponName === "侦察步枪") {
4769
+ ignoreEffects.push(0.2);
4770
+ messages.push(`🎯 【猩红杀手】职业效果:无视目标20%减伤效果`);
4771
+ }
4772
+ }, "handleCareerEffects");
4773
+ await handleCareerEffects();
4774
+ if (ignoreEffects.length === 0) return null;
4775
+ const totalIgnoreRate = Math.min(
4776
+ 1,
4777
+ ignoreEffects.reduce((sum, rate) => sum + rate, 0)
4778
+ );
4779
+ return {
4780
+ ignoreRate: totalIgnoreRate,
4781
+ messages
4782
+ };
4783
+ }
4784
+ __name(handleIgnoreReductionEffects, "handleIgnoreReductionEffects");
4720
4785
 
4721
4786
  // src/index.ts
4722
4787
  var name = "ggcevo-game";
@@ -7230,6 +7295,7 @@ ${validTypes.join("、")}`;
7230
7295
  const primaryAttackResult = await handlePrimaryAttack(
7231
7296
  ctx,
7232
7297
  session,
7298
+ handle,
7233
7299
  config2,
7234
7300
  equippedWeapon,
7235
7301
  targetBoss,
@@ -7247,6 +7313,7 @@ ${validTypes.join("、")}`;
7247
7313
  scatterResult = await handleScatterAttack(
7248
7314
  ctx,
7249
7315
  session,
7316
+ handle,
7250
7317
  config2,
7251
7318
  equippedWeapon,
7252
7319
  targetBoss,
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.33",
4
+ "version": "1.4.34",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [