koishi-plugin-ggcevo-game 1.6.68 → 1.6.70

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.
@@ -136,7 +136,7 @@ export declare const BattleEffectProcessor: {
136
136
  };
137
137
  handleMoldGrowth: (targetBoss: any, activeBosses: any[]) => {
138
138
  messages: string[];
139
- spaceStationUpdates: {
139
+ otherUpdates: {
140
140
  name: string;
141
141
  updates: Partial<BattleStatistics>;
142
142
  } | null;
package/lib/index.js CHANGED
@@ -2261,7 +2261,7 @@ var BattleEffectProcessor = {
2261
2261
  }
2262
2262
  const spaceStationMaxHP = getMaxHPByName(spaceStation.name);
2263
2263
  const healAmount = Math.round(spaceStationMaxHP * 0.01);
2264
- const spaceStationUpdates = {
2264
+ const otherUpdates = {
2265
2265
  name: spaceStation.name,
2266
2266
  updates: {
2267
2267
  hpChange: healAmount
@@ -2270,7 +2270,7 @@ var BattleEffectProcessor = {
2270
2270
  messages.push(`🍄 【霉菌滋生】生效:为「空间站哨枪塔」回复${healAmount}点生命值`);
2271
2271
  return {
2272
2272
  messages,
2273
- spaceStationUpdates
2273
+ otherUpdates
2274
2274
  };
2275
2275
  }, "handleMoldGrowth"),
2276
2276
  // 岗哨机枪处理(累计10次攻击后为其他异形回复10%最大生命值)
@@ -4318,7 +4318,8 @@ function applyPassiveEffects(targetBoss, activeBosses, weaponName, damage, hasCr
4318
4318
  updateStatsByName(result.targetUpdates.name, result.targetUpdates.updates);
4319
4319
  }
4320
4320
  if (result.otherUpdates) {
4321
- for (const update of result.otherUpdates) {
4321
+ const updates = Array.isArray(result.otherUpdates) ? result.otherUpdates : [result.otherUpdates];
4322
+ for (const update of updates) {
4322
4323
  updateStatsByName(update.name, update.updates);
4323
4324
  }
4324
4325
  }
@@ -5963,6 +5964,13 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
5963
5964
  message: "无法对空中目标使用。"
5964
5965
  };
5965
5966
  }
5967
+ const [damageRecords] = await ctx.database.get("ggcevo_boss_damage", { handle });
5968
+ if (!damageRecords) {
5969
+ return {
5970
+ success: false,
5971
+ message: `至少攻击一次后才能使用该物品。`
5972
+ };
5973
+ }
5966
5974
  if (targetBoss.HP === 1) {
5967
5975
  return {
5968
5976
  success: false,
@@ -5989,7 +5997,6 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
5989
5997
  handle,
5990
5998
  totalRewards: (signRecords[0]?.totalRewards || 0) + damage
5991
5999
  }], ["handle"]);
5992
- const [damageRecords] = await ctx.database.get("ggcevo_boss_damage", { handle });
5993
6000
  await ctx.database.upsert("ggcevo_boss_damage", [{
5994
6001
  handle,
5995
6002
  playerName: session.username,
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.68",
4
+ "version": "1.6.70",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [