koishi-plugin-ggcevo-game 1.4.32 → 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.
package/lib/index.js CHANGED
@@ -1054,20 +1054,16 @@ var Tasklist = {
1054
1054
  };
1055
1055
 
1056
1056
  // src/boss/boss.ts
1057
- var asBossTags = /* @__PURE__ */ __name((arr) => arr, "asBossTags");
1058
- var asPassives = /* @__PURE__ */ __name((arr) => arr, "asPassives");
1059
- var defineBoss = /* @__PURE__ */ __name((config) => config, "defineBoss");
1060
1057
  var bossPool = [
1061
- defineBoss({
1058
+ {
1062
1059
  id: 1,
1063
- // ID放在BOSS组层级
1064
1060
  main: {
1065
1061
  name: "异齿猛兽首领",
1066
1062
  type: "主宰",
1067
1063
  maxHP: 15e3,
1068
1064
  maxEnergy: 0,
1069
- tags: asBossTags(["重甲", "生物", "异形"]),
1070
- passive: asPassives(["异形甲壳"])
1065
+ tags: ["重甲", "生物", "异形"],
1066
+ passive: ["异形甲壳"]
1071
1067
  },
1072
1068
  minions: [
1073
1069
  {
@@ -1075,20 +1071,20 @@ var bossPool = [
1075
1071
  type: "子代",
1076
1072
  maxHP: 5e3,
1077
1073
  maxEnergy: 0,
1078
- tags: asBossTags(["重甲", "生物", "重型", "异形"]),
1079
- passive: asPassives(["弱化形态", "异形甲壳"])
1074
+ tags: ["重甲", "生物", "重型", "异形"],
1075
+ passive: ["弱化形态", "异形甲壳"]
1080
1076
  }
1081
1077
  ]
1082
- }),
1083
- defineBoss({
1078
+ },
1079
+ {
1084
1080
  id: 2,
1085
1081
  main: {
1086
1082
  name: "寒冰王蛇",
1087
1083
  type: "主宰",
1088
1084
  maxHP: 15e3,
1089
1085
  maxEnergy: 0,
1090
- tags: asBossTags(["重甲", "生物", "惧热", "重型", "异形"]),
1091
- passive: asPassives(["冰霜环绕", "冰霜进化"])
1086
+ tags: ["重甲", "生物", "惧热", "重型", "异形"],
1087
+ passive: ["冰霜环绕", "冰霜进化"]
1092
1088
  },
1093
1089
  minions: [
1094
1090
  {
@@ -1096,20 +1092,20 @@ var bossPool = [
1096
1092
  type: "子代",
1097
1093
  maxHP: 5e3,
1098
1094
  maxEnergy: 0,
1099
- tags: asBossTags(["生物", "惧热", "异形"]),
1100
- passive: asPassives(["弱化形态", "冰霜回复", "冰霜进化"])
1095
+ tags: ["生物", "惧热", "异形"],
1096
+ passive: ["弱化形态", "冰霜回复", "冰霜进化"]
1101
1097
  }
1102
1098
  ]
1103
- }),
1104
- defineBoss({
1099
+ },
1100
+ {
1105
1101
  id: 3,
1106
1102
  main: {
1107
1103
  name: "莽兽",
1108
1104
  type: "主宰",
1109
1105
  maxHP: 12e3,
1110
1106
  maxEnergy: 0,
1111
- tags: asBossTags(["重甲", "生物", "重型", "异形"]),
1112
- passive: asPassives(["应激甲壳II", "求生本能II", "冷适应"])
1107
+ tags: ["重甲", "生物", "重型", "异形"],
1108
+ passive: ["应激甲壳II", "求生本能II", "冷适应"]
1113
1109
  },
1114
1110
  minions: [
1115
1111
  {
@@ -1117,28 +1113,28 @@ var bossPool = [
1117
1113
  type: "子代",
1118
1114
  maxHP: 4e3,
1119
1115
  maxEnergy: 0,
1120
- tags: asBossTags(["重甲", "生物", "重型", "异形"]),
1121
- passive: asPassives(["弱化形态", "应激甲壳I", "求生本能I", "冷适应"])
1116
+ tags: ["重甲", "生物", "重型", "异形"],
1117
+ passive: ["弱化形态", "应激甲壳I", "求生本能I", "冷适应"]
1122
1118
  },
1123
1119
  {
1124
1120
  name: "剧毒畸变体",
1125
1121
  type: "子代",
1126
1122
  maxHP: 4e3,
1127
1123
  maxEnergy: 0,
1128
- tags: asBossTags(["重甲", "生物", "重型", "异形"]),
1129
- passive: asPassives(["弱化形态", "应激甲壳I", "求生本能I", "冷适应"])
1124
+ tags: ["重甲", "生物", "重型", "异形"],
1125
+ passive: ["弱化形态", "应激甲壳I", "求生本能I", "冷适应"]
1130
1126
  }
1131
1127
  ]
1132
- }),
1133
- defineBoss({
1128
+ },
1129
+ {
1134
1130
  id: 4,
1135
1131
  main: {
1136
1132
  name: "空间站感染虫",
1137
1133
  type: "主宰",
1138
1134
  maxHP: 1e4,
1139
1135
  maxEnergy: 0,
1140
- tags: asBossTags(["重甲", "生物", "机械", "异形"]),
1141
- passive: asPassives(["感染空间站", "病毒云", "霉菌滋生"])
1136
+ tags: ["重甲", "生物", "机械", "异形"],
1137
+ passive: ["感染空间站", "病毒云", "霉菌滋生"]
1142
1138
  },
1143
1139
  minions: [
1144
1140
  {
@@ -1146,28 +1142,28 @@ var bossPool = [
1146
1142
  type: "子代",
1147
1143
  maxHP: 3e3,
1148
1144
  maxEnergy: 0,
1149
- tags: asBossTags(["重甲", "生物", "机械", "异形"]),
1150
- passive: asPassives(["弱化形态", "病毒云", "霉菌滋生"])
1145
+ tags: ["重甲", "生物", "机械", "异形"],
1146
+ passive: ["弱化形态", "病毒云", "霉菌滋生"]
1151
1147
  },
1152
1148
  {
1153
1149
  name: "空间站哨枪塔",
1154
1150
  type: "子代",
1155
1151
  maxHP: 5e3,
1156
1152
  maxEnergy: 0,
1157
- tags: asBossTags(["重甲", "机械", "建筑"]),
1158
- passive: asPassives(["岗哨机枪", "结构装甲"])
1153
+ tags: ["重甲", "机械", "建筑"],
1154
+ passive: ["岗哨机枪", "结构装甲"]
1159
1155
  }
1160
1156
  ]
1161
- }),
1162
- defineBoss({
1157
+ },
1158
+ {
1163
1159
  id: 5,
1164
1160
  main: {
1165
1161
  name: "吸血蝙蝠首领",
1166
1162
  type: "主宰",
1167
1163
  maxHP: 12e3,
1168
1164
  maxEnergy: 0,
1169
- tags: asBossTags(["生物", "异形"]),
1170
- passive: asPassives(["吸血唾液", "进食", "吐血", "嗜血狂暴"])
1165
+ tags: ["生物", "异形"],
1166
+ passive: ["吸血唾液", "进食", "吐血", "嗜血狂暴"]
1171
1167
  },
1172
1168
  minions: [
1173
1169
  {
@@ -1175,20 +1171,20 @@ var bossPool = [
1175
1171
  type: "子代",
1176
1172
  maxHP: 4e3,
1177
1173
  maxEnergy: 0,
1178
- tags: asBossTags(["生物", "异形"]),
1179
- passive: asPassives(["弱化形态", "吸血唾液", "进食", "吐血"])
1174
+ tags: ["生物", "异形"],
1175
+ passive: ["弱化形态", "吸血唾液", "进食", "吐血"]
1180
1176
  }
1181
1177
  ]
1182
- }),
1183
- defineBoss({
1178
+ },
1179
+ {
1184
1180
  id: 6,
1185
1181
  main: {
1186
1182
  name: "亚电主宰者",
1187
1183
  type: "主宰",
1188
1184
  maxHP: 2e4,
1189
1185
  maxEnergy: 1e3,
1190
- tags: asBossTags(["护盾", "灵能", "重型", "异形"]),
1191
- passive: asPassives(["超导体", "能源虹吸", "电能冲击波", "电能立场", "脉冲", "能量黑洞"])
1186
+ tags: ["护盾", "灵能", "重型", "异形"],
1187
+ passive: ["超导体", "能源虹吸", "电能冲击波", "电能立场", "脉冲", "能量黑洞"]
1192
1188
  },
1193
1189
  minions: [
1194
1190
  {
@@ -1196,20 +1192,20 @@ var bossPool = [
1196
1192
  type: "子代",
1197
1193
  maxHP: 6e3,
1198
1194
  maxEnergy: 0,
1199
- tags: asBossTags(["护盾", "灵能", "异形"]),
1200
- passive: asPassives(["弱化形态", "超导体", "能量虹吸", "能量黑洞"])
1195
+ tags: ["护盾", "灵能", "异形"],
1196
+ passive: ["弱化形态", "超导体", "能源虹吸", "能量黑洞"]
1201
1197
  }
1202
1198
  ]
1203
- }),
1204
- defineBoss({
1199
+ },
1200
+ {
1205
1201
  id: 7,
1206
1202
  main: {
1207
1203
  name: "烈焰庞兽",
1208
1204
  type: "主宰",
1209
1205
  maxHP: 2e4,
1210
1206
  maxEnergy: 0,
1211
- tags: asBossTags(["重甲", "生物", "惧寒", "重型", "异形"]),
1212
- passive: asPassives(["火焰异形", "庞兽狂暴", "灼烧粘液", "炼狱爆弹", "火焰吐息", "太阳耀斑"])
1207
+ tags: ["重甲", "生物", "惧寒", "重型", "异形"],
1208
+ passive: ["火焰异形", "庞兽狂暴", "灼烧粘液", "炼狱爆弹", "火焰吐息", "太阳耀斑"]
1213
1209
  },
1214
1210
  minions: [
1215
1211
  {
@@ -1217,20 +1213,20 @@ var bossPool = [
1217
1213
  type: "子代",
1218
1214
  maxHP: 5e3,
1219
1215
  maxEnergy: 0,
1220
- tags: asBossTags(["重甲", "生物", "惧寒", "异形"]),
1221
- passive: asPassives(["弱化形态", "火焰异形", "灼烧粘液", "腐蚀胆汁", "燃烧潜地"])
1216
+ tags: ["重甲", "生物", "惧寒", "异形"],
1217
+ passive: ["弱化形态", "火焰异形", "灼烧粘液", "腐蚀胆汁", "燃烧潜地"]
1222
1218
  }
1223
1219
  ]
1224
- }),
1225
- defineBoss({
1220
+ },
1221
+ {
1226
1222
  id: 8,
1227
1223
  main: {
1228
1224
  name: "狂猎猛禽首领",
1229
1225
  type: "主宰",
1230
1226
  maxHP: 2e4,
1231
1227
  maxEnergy: 0,
1232
- tags: asBossTags(["生物", "异形"]),
1233
- passive: asPassives(["猎手异形", "致命一击", "狂暴", "伪装"])
1228
+ tags: ["生物", "异形"],
1229
+ passive: ["猎手异形", "致命一击", "狂暴", "伪装"]
1234
1230
  },
1235
1231
  minions: [
1236
1232
  {
@@ -1238,28 +1234,28 @@ var bossPool = [
1238
1234
  type: "子代",
1239
1235
  maxHP: 5e3,
1240
1236
  maxEnergy: 0,
1241
- tags: asBossTags(["生物", "异形"]),
1242
- passive: asPassives(["弱化形态", "猎手异形", "狂暴", "伪装"])
1237
+ tags: ["生物", "异形"],
1238
+ passive: ["弱化形态", "猎手异形", "狂暴", "伪装"]
1243
1239
  },
1244
1240
  {
1245
1241
  name: "狂猎猛禽2",
1246
1242
  type: "子代",
1247
1243
  maxHP: 5e3,
1248
1244
  maxEnergy: 0,
1249
- tags: asBossTags(["生物", "异形"]),
1250
- passive: asPassives(["弱化形态", "猎手异形", "狂暴", "伪装"])
1245
+ tags: ["生物", "异形"],
1246
+ passive: ["弱化形态", "猎手异形", "狂暴", "伪装"]
1251
1247
  }
1252
1248
  ]
1253
- }),
1254
- defineBoss({
1249
+ },
1250
+ {
1255
1251
  id: 9,
1256
1252
  main: {
1257
1253
  name: "宇宙界主",
1258
1254
  type: "主宰",
1259
1255
  maxHP: 2e4,
1260
1256
  maxEnergy: 1e3,
1261
- tags: asBossTags(["重甲", "护盾", "生物", "灵能", "异形"]),
1262
- passive: asPassives(["宇宙能量", "复苏", "光影之刃", "闪电冲锋", "远古预兆", "星界之风", "超视距穿梭"])
1257
+ tags: ["重甲", "护盾", "生物", "灵能", "异形"],
1258
+ passive: ["宇宙能量", "复苏", "光影之刃", "闪电冲锋", "远古预兆", "星界之风", "超视距穿梭"]
1263
1259
  },
1264
1260
  minions: [
1265
1261
  {
@@ -1267,284 +1263,222 @@ var bossPool = [
1267
1263
  type: "子代",
1268
1264
  maxHP: 5e3,
1269
1265
  maxEnergy: 0,
1270
- tags: asBossTags(["重甲", "护盾", "生物", "灵能", "异形"]),
1271
- passive: asPassives(["弱化形态", "心灵狂热", "星界之风"])
1266
+ tags: ["重甲", "护盾", "生物", "灵能", "异形"],
1267
+ passive: ["弱化形态", "心灵狂热", "星界之风"]
1272
1268
  }
1273
1269
  ]
1274
- })
1270
+ }
1275
1271
  ];
1276
1272
 
1277
1273
  // src/boss/passive.ts
1278
1274
  var passiveConfig = {
1279
1275
  "弱化形态": {
1280
- effect: 0.1,
1281
- maxStacks: 0,
1276
+ type: "伤害增减(负面)",
1282
1277
  description: "子代防御脆弱,所受伤害提升10%"
1283
1278
  },
1284
1279
  "异形甲壳": {
1285
- effect: -0.2,
1286
- maxStacks: 0,
1280
+ type: "伤害增减(正面)",
1287
1281
  description: "强化生物甲壳提供防护,所受伤害降低20%"
1288
1282
  },
1289
- "孤立无援": {
1290
- effect: 0.2,
1291
- maxStacks: 0,
1292
- description: "无存活子代时,所受伤害提升20%"
1293
- },
1294
1283
  "冰霜回复": {
1295
- effect: 0,
1296
- maxStacks: 0,
1284
+ type: "生存强化(生命回复)",
1297
1285
  description: "生命值降至30%以下时触发,立即回复自身40%最大生命值,并为其他存活异形回复10%最大生命值(触发后效果移除)"
1298
1286
  },
1299
1287
  "冰霜进化": {
1300
- effect: 0,
1301
- maxStacks: 0,
1302
- description: "免疫冰霜类伤害,受到冰霜伤害时额外回复生命值"
1288
+ type: "状态免疫(寒冷伤害免疫)",
1289
+ description: "免疫寒冷类伤害,受到寒冷伤害时额外回复生命值"
1303
1290
  },
1304
1291
  "冰霜环绕": {
1305
- effect: 0,
1306
- maxStacks: 0,
1307
- description: "生命值降至30%以下时触发,立即回复自身45%最大生命值(触发后效果移除)"
1292
+ type: "生存强化(生命回复+群体增益)",
1293
+ description: "生命值降至30%以下时触发,立即回复自身45%最大生命值,并使所有存活异形获得「寒霜地狱」技能(自身效果触发后移除)"
1308
1294
  },
1309
1295
  "寒霜地狱": {
1310
- effect: -0.3,
1311
- maxStacks: 0,
1296
+ type: "伤害增减(正面)",
1312
1297
  description: "暴风雪笼罩战场,所受伤害降低30%"
1313
1298
  },
1314
1299
  "应激甲壳I": {
1315
- effect: -0.2,
1316
- maxStacks: 0,
1300
+ type: "伤害增减(正面)",
1317
1301
  description: "基础应激甲壳生效,所受伤害降低20%"
1318
1302
  },
1319
1303
  "应激甲壳II": {
1320
- effect: -0.25,
1321
- maxStacks: 0,
1304
+ type: "伤害增减(正面)",
1322
1305
  description: "进阶应激甲壳生效,所受伤害降低25%"
1323
1306
  },
1324
1307
  "求生本能I": {
1325
- effect: 0,
1326
- maxStacks: 0,
1308
+ type: "生存强化(生命回复)",
1327
1309
  description: "濒死状态下,快速回复30%最大生命值(触发后效果移除)"
1328
1310
  },
1329
1311
  "求生本能II": {
1330
- effect: 0,
1331
- maxStacks: 0,
1312
+ type: "生存强化(生命回复)",
1332
1313
  description: "濒死状态下,快速回复50%最大生命值(触发后效果移除)"
1333
1314
  },
1334
1315
  "冷适应": {
1335
- effect: 0,
1336
- maxStacks: 10,
1316
+ type: "状态免疫(寒冷伤害免疫)",
1337
1317
  description: "累计承受10次寒冷伤害后,获得「惧热」标签并获得寒冷伤害免疫"
1338
1318
  },
1339
1319
  "感染空间站": {
1340
- effect: 0,
1341
- maxStacks: 0,
1342
- description: "若「空间站哨枪塔」存活(该单位不计入子代),自身所受伤害降低50%"
1320
+ type: "伤害增减(正面)",
1321
+ description: "若「空间站哨枪塔」存活,自身所受伤害降低50%"
1343
1322
  },
1344
1323
  "病毒云": {
1345
- effect: -0.1,
1346
- maxStacks: 0,
1324
+ type: "伤害增减(正面)",
1347
1325
  description: "释放病毒云雾形成保护,所受伤害降低10%"
1348
1326
  },
1349
1327
  "霉菌滋生": {
1350
- effect: 0,
1351
- maxStacks: 0,
1352
- description: "受到攻击后,若「空间站哨枪塔」存活,为其恢复1%最大生命值"
1328
+ type: "生存强化(生命回复)",
1329
+ description: "受到攻击后,若「空间站哨枪塔」存活,为其回复1%最大生命值"
1353
1330
  },
1354
1331
  "岗哨机枪": {
1355
- effect: 0,
1356
- maxStacks: 10,
1357
- description: "累计承受10次攻击后,为所有存活异形恢复其10%最大生命值(可重复触发)"
1332
+ type: "生存强化(生命回复)",
1333
+ description: "每累计承受10次攻击后,为所有其他存活异形回复其10%最大生命值"
1358
1334
  },
1359
1335
  "结构装甲": {
1360
- effect: 0,
1361
- maxStacks: 0,
1336
+ type: "伤害增减(正面)",
1362
1337
  description: "装备结构装甲,常规伤害降低20%;若伤害来源为热能武器,伤害降低提升至40%"
1363
1338
  },
1364
1339
  "吸血唾液": {
1365
- effect: 0,
1366
- maxStacks: 20,
1367
- description: "受到攻击时叠加「吸血」层数,每层提供5%减伤(最多叠加20层)"
1340
+ type: "伤害增减(正面)",
1341
+ description: "受到攻击时叠加「吸血唾液」层数,每层提供5%减伤(最多叠加20层)"
1368
1342
  },
1369
1343
  "进食": {
1370
- effect: 0,
1371
- maxStacks: 0,
1372
- description: "当「吸血」层数达到20层时,下一次受击消耗所有层数并回复20%最大生命值"
1344
+ type: "生存强化(生命回复)",
1345
+ description: "当「吸血唾液」层数达到20层时,下一次受击消耗所有层数并回复20%最大生命值"
1373
1346
  },
1374
1347
  "嗜血狂暴": {
1375
- effect: 0,
1376
- maxStacks: 0,
1377
- description: "生命值低于50%时触发狂暴状态,每次受击额外叠加1层「吸血」,同时所受伤害降低20%"
1348
+ type: "伤害增减(正面)",
1349
+ description: "生命值低于50%时触发狂暴状态,每次受击额外叠加1层「吸血唾液」,同时所受伤害降低20%"
1378
1350
  },
1379
1351
  "吐血": {
1380
- effect: 0,
1381
- maxStacks: 0,
1382
- description: "无「吸血」层数时,所受伤害提升20%"
1383
- },
1384
- "电能导体": {
1385
- effect: 0,
1386
- maxStacks: 0,
1387
- description: "生命值降至10%以下时,「护盾」标签转换为「重甲」标签"
1352
+ type: "伤害增减(负面)",
1353
+ description: "无「吸血唾液」层数时,所受伤害提升20%"
1388
1354
  },
1389
1355
  "超导体": {
1390
- effect: 0,
1391
- maxStacks: 0,
1392
- description: "生命值降至5%以下时,「护盾」标签转换为「重甲」标签"
1356
+ type: "状态转换(护盾→重甲)",
1357
+ description: "生命值降至10%以下时,「护盾」标签转换为「重甲」标签"
1393
1358
  },
1394
1359
  "能量虹吸": {
1395
- effect: 0,
1396
- maxStacks: 0,
1360
+ type: "伤害增减(正面)",
1397
1361
  description: "生命值≥70%时,所受伤害降低40%;生命值≥30%时,伤害降低20%"
1398
1362
  },
1399
1363
  "能源虹吸": {
1400
- effect: 0,
1401
- maxStacks: 0,
1364
+ type: "伤害增减(正面)",
1402
1365
  description: "能量值≥80%时,所受伤害降低50%;能量值≥50%时,伤害降低30%"
1403
1366
  },
1404
1367
  "电能立场": {
1405
- effect: 0,
1406
- maxStacks: 0,
1407
- description: "能量值≥30%时,每次受击有55%概率免疫该次伤害(无法免疫寒冷伤害);每存在1层「寒冷」状态,免疫概率降低5%"
1368
+ type: "状态免疫(伤害免疫)",
1369
+ description: "能量值≥30%时,每次受击有55%概率免疫该次伤害(无法免疫寒冷伤害);每存在1层「寒冷」状态,免疫概率降低5%(至多降低50%)"
1408
1370
  },
1409
1371
  "电能冲击波": {
1410
- effect: 0,
1411
- maxStacks: 0,
1372
+ type: "生存强化(能量回复)",
1412
1373
  description: "每次受击时,回复100点「能量」"
1413
1374
  },
1414
1375
  "脉冲": {
1415
- effect: 0,
1416
- maxStacks: 0,
1417
- description: "能量值≥30%时,每次受击有60%概率为所有存活异形回复100点生命值;每存在1层「寒冷」状态,概率降低5%"
1376
+ type: "生存强化(生命回复)",
1377
+ description: "能量值≥30%时,每次受击有60%概率为所有存活异形回复100点生命值;每存在1层「寒冷」状态,概率降低5%(至多降低50%)"
1418
1378
  },
1419
1379
  "能量黑洞": {
1420
- effect: -0.2,
1421
- maxStacks: 0,
1380
+ type: "伤害增减(正面)",
1422
1381
  description: "存在「能量黑洞」时,所受伤害降低20%"
1423
1382
  },
1424
1383
  "火焰异形": {
1425
- effect: 0,
1426
- maxStacks: 0,
1384
+ type: "状态免疫(火焰伤害免疫)",
1427
1385
  description: "免疫火焰类伤害,受到火焰伤害时额外回复生命值"
1428
1386
  },
1429
1387
  "庞兽狂暴": {
1430
- effect: 0,
1431
- maxStacks: 0,
1388
+ type: "伤害增减(正面)",
1432
1389
  description: "生命值低于50%时触发狂暴状态,所受伤害降低50%"
1433
1390
  },
1434
1391
  "灼烧粘液": {
1435
- effect: 0,
1436
- maxStacks: 20,
1437
- description: "受到伤害时叠加「胆汁」层数;若存在「胆汁」层数时受到火焰攻击,立即清空层数并回复(层数×10)点生命值"
1392
+ type: "生存强化(生命回复)",
1393
+ description: "受到伤害时叠加「灼烧粘液」层数;若存在「灼烧粘液」层数时受到火焰攻击,立即清空层数并回复(层数×10)点生命值"
1438
1394
  },
1439
1395
  "腐蚀胆汁": {
1440
- effect: 0,
1441
- maxStacks: 0,
1442
- description: "「胆汁」层数达到10层时,下一次受击为所有存活异形回复1000点生命值并清空层数"
1396
+ type: "生存强化(生命回复)",
1397
+ description: "「灼烧粘液」层数达到10层时,下一次受击为所有存活异形回复1000点生命值并清空层数"
1443
1398
  },
1444
1399
  "火焰吐息": {
1445
- effect: 0,
1446
- maxStacks: 0,
1447
- description: "「胆汁」层数达到20层时,下一次攻击为所有存活异形回复50%最大生命值并清空层数"
1400
+ type: "生存强化(生命回复)",
1401
+ description: "「灼烧粘液」层数达到20层时,下一次攻击为所有存活异形回复20%最大生命值并清空层数"
1448
1402
  },
1449
1403
  "太阳耀斑": {
1450
- effect: 0,
1451
- maxStacks: 0,
1404
+ type: "状态移除+状态免疫(寒冷伤害免疫)",
1452
1405
  description: "所有子代阵亡后,移除「惧寒」标签及「孤立无援」并获得寒冷伤害免疫"
1453
1406
  },
1454
1407
  "燃烧潜地": {
1455
- effect: 0,
1456
- maxStacks: 0,
1408
+ type: "生存强化(生命回复)",
1457
1409
  description: "生命值降至10%以下时触发,立即回复50%最大生命值(触发后效果移除)"
1458
1410
  },
1459
1411
  "炼狱爆弹": {
1460
- effect: 0,
1461
- maxStacks: 0,
1462
- description: "每存在1层「胆汁」,所受伤害降低5%;若存在存活子代,伤害降低效果额外提升5%(即每层「胆汁」总降低10%)"
1412
+ type: "伤害增减(正面)",
1413
+ description: "每存在1层「灼烧粘液」,所受伤害降低5%;若存在存活子代,伤害降低效果额外提升5%(即每层「灼烧粘液」总降低10%)"
1463
1414
  },
1464
1415
  "猎手异形": {
1465
- effect: 0,
1466
- maxStacks: 0,
1416
+ type: "伤害增减(条件性)+状态免疫(火焰/寒冷伤害免疫)",
1467
1417
  description: "存在其他存活异形时,所受伤害降低20%;无其他存活异形时,所受伤害提升20%;免疫火焰及寒冷伤害"
1468
1418
  },
1469
1419
  "狂暴": {
1470
- effect: 0,
1471
- maxStacks: 0,
1420
+ type: "伤害增减(正面)",
1472
1421
  description: "生命值低于50%时触发狂暴状态,所受伤害降低50%"
1473
1422
  },
1474
1423
  "伪装": {
1475
- effect: 0,
1476
- maxStacks: 0,
1424
+ type: "伤害增减(正面)",
1477
1425
  description: "受击时记录伤害来源的武器名称(仅保留最新),下次受到同名称武器伤害时伤害降低80%"
1478
1426
  },
1479
1427
  "致命一击": {
1480
- effect: 0,
1481
- maxStacks: 0,
1428
+ type: "状态免疫(伤害免疫)",
1482
1429
  description: "受击时有5%概率免疫该次伤害"
1483
1430
  },
1484
1431
  "星界之风": {
1485
- effect: 0,
1486
- maxStacks: 0,
1432
+ type: "生存强化(生命回复)",
1487
1433
  description: "受击时有5%概率为所有存活异形回复200点生命值"
1488
1434
  },
1489
1435
  "心灵狂热": {
1490
- effect: 0,
1491
- maxStacks: 0,
1436
+ type: "伤害增减(正面)",
1492
1437
  description: "生命值低于50%时进入心灵狂热状态,所受伤害降低20%,同时「星界之风」触发概率翻倍"
1493
1438
  },
1494
1439
  "宇宙能量": {
1495
- effect: 0,
1496
- maxStacks: 0,
1440
+ type: "生存强化(能量/生命回复)",
1497
1441
  description: "受击时回复等同于本次伤害值的「能量」;若「能量」已满,则将溢出部分转换为自身生命值"
1498
1442
  },
1499
1443
  "复苏": {
1500
- effect: 0,
1501
- maxStacks: 0,
1444
+ type: "生存强化(生命/能量回复)",
1502
1445
  description: "承受致命伤害时免疫死亡,立即回复50%最大生命值及100%「能量」,并获得「灵能构造炉」技能(触发后效果移除)"
1503
1446
  },
1504
1447
  "光影之刃": {
1505
- effect: 0,
1506
- maxStacks: 0,
1507
- description: "受击后叠加「光影之刃」层数"
1448
+ type: "状态叠加(层数叠加)",
1449
+ description: "受击后叠加「光影之刃」层数(至多50层)"
1508
1450
  },
1509
1451
  "远古预兆": {
1510
- effect: 0,
1511
- maxStacks: 0,
1512
- description: "受击时有1%概率免疫该次伤害并回复100点「能量」"
1452
+ type: "状态免疫(能量伤害免疫)",
1453
+ description: "受击时有1%概率免疫能量武器伤害并回复100点「能量」"
1513
1454
  },
1514
1455
  "闪电冲锋": {
1515
- effect: 0,
1516
- maxStacks: 0,
1456
+ type: "状态增强(触发概率提升)",
1517
1457
  description: "每存在1层「光影之刃」,「远古预兆」「灵能构造炉」触发概率各提升0.5%"
1518
1458
  },
1519
1459
  "超视距穿梭": {
1520
- effect: 0,
1521
- maxStacks: 0,
1460
+ type: "伤害增减(条件性)",
1522
1461
  description: "能量值≥30%时,每层「光影之刃」降低5%所受伤害;能量值≥60%时,每层降低10%;能量值≤10%时,每层提升5%所受伤害"
1523
1462
  },
1524
1463
  "灵能构造炉": {
1525
- effect: 0,
1526
- maxStacks: 0,
1464
+ type: "状态获得(技能获得)",
1527
1465
  description: "受击后有5%概率随机获得以下技能之一:天启超载护盾、塌缩脉冲、地毯式轰炸、轰炸引导"
1528
1466
  },
1529
1467
  "天启超载护盾": {
1530
- effect: 0,
1531
- maxStacks: 0,
1468
+ type: "生存强化(生命回复)",
1532
1469
  description: "受击后有5%概率为所有存活异形回复(「光影之刃」层数×10)点生命值"
1533
1470
  },
1534
1471
  "塌缩脉冲": {
1535
- effect: 0,
1536
- maxStacks: 0,
1472
+ type: "状态叠加(层数叠加)",
1537
1473
  description: "受击后额外叠加1层「光影之刃」"
1538
1474
  },
1539
1475
  "地毯式轰炸": {
1540
- effect: 0,
1541
- maxStacks: 0,
1542
- description: "触发时移除「孤立无援」,并使自身所受伤害降低100%(免疫所有伤害)"
1476
+ type: "状态移除+伤害增减(正面)",
1477
+ description: "触发时移除「孤立无援」,并使自身所受伤害降低100%"
1543
1478
  },
1544
1479
  "轰炸引导": {
1545
- effect: 0,
1546
- maxStacks: 0,
1547
- description: "受击后有10%概率回复(「光影之刃」层数×50)点「能量」"
1480
+ type: "生存强化(能量回复)",
1481
+ description: "受击后有5%概率回复(「光影之刃」层数×50)点「能量」"
1548
1482
  }
1549
1483
  };
1550
1484
 
@@ -2079,7 +2013,7 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
2079
2013
  message: `目标${target}拥有"${targetboss.tags.includes("建筑") ? "建筑" : "重型"}"标签,无法使用此物品。`
2080
2014
  };
2081
2015
  }
2082
- const currentCount = targetboss.Skillcountpoints || 0;
2016
+ const currentCount = targetboss?.skillStacks || 0;
2083
2017
  if (currentCount <= 0) {
2084
2018
  return {
2085
2019
  success: false,
@@ -2091,7 +2025,7 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
2091
2025
  await ctx.database.set(
2092
2026
  "ggcevo_boss",
2093
2027
  { name: target },
2094
- { Skillcountpoints: newCount }
2028
+ { skillStacks: newCount }
2095
2029
  );
2096
2030
  return {
2097
2031
  success: true,
@@ -2443,1862 +2377,1875 @@ async function getRankInfo(ctx, config, handle) {
2443
2377
  }
2444
2378
  __name(getRankInfo, "getRankInfo");
2445
2379
 
2446
- // src/boss/passivehandler.ts
2447
- var PassiveHandler = {
2448
- // 在PassiveHandler中增强统计数组结构
2449
- processingResults: [],
2450
- // 冰霜进化处理(免疫冰霜伤害)
2451
- handleFrostEvolution: /* @__PURE__ */ __name(function(targetBoss, weaponName, damage, maxHP) {
2452
- if (targetBoss.skills.includes("冰霜进化") && weaponName === "零度之下") {
2453
- const actualHeal = Math.min(damage, maxHP - targetBoss.HP);
2380
+ // src/boss/BattleEffectProcessor.ts
2381
+ var battleStatsMap = {};
2382
+ function updateStatsByName(name2, updates) {
2383
+ const existing = battleStatsMap[name2] ?? {
2384
+ name: name2,
2385
+ // 键与 name 一致
2386
+ hpChange: 0,
2387
+ energyChange: 0,
2388
+ tagsAdded: [],
2389
+ tagsRemoved: [],
2390
+ skillsAdded: [],
2391
+ skillsRemoved: [],
2392
+ skillStacksChanged: 0,
2393
+ statusLayersChanged: 0,
2394
+ radiationLayersChange: 0,
2395
+ coldLayersChange: 0,
2396
+ lastWeaponName: ""
2397
+ };
2398
+ battleStatsMap[name2] = {
2399
+ // name 不可变(保持原键)
2400
+ name: existing.name,
2401
+ // 数值类型:累加(支持正负变化)
2402
+ hpChange: existing.hpChange + (updates.hpChange ?? 0),
2403
+ energyChange: existing.energyChange + (updates.energyChange ?? 0),
2404
+ skillStacksChanged: existing.skillStacksChanged + (updates.skillStacksChanged ?? 0),
2405
+ statusLayersChanged: existing.statusLayersChanged + (updates.statusLayersChanged ?? 0),
2406
+ radiationLayersChange: existing.radiationLayersChange + (updates.radiationLayersChange ?? 0),
2407
+ coldLayersChange: existing.coldLayersChange + (updates.coldLayersChange ?? 0),
2408
+ // 数组类型:合并(新增内容追加到现有数组)
2409
+ tagsAdded: [...existing.tagsAdded, ...updates.tagsAdded ?? []],
2410
+ tagsRemoved: [...existing.tagsRemoved, ...updates.tagsRemoved ?? []],
2411
+ skillsAdded: [...existing.skillsAdded, ...updates.skillsAdded ?? []],
2412
+ skillsRemoved: [...existing.skillsRemoved, ...updates.skillsRemoved ?? []],
2413
+ // 字符串类型:覆盖(取最新值)
2414
+ lastWeaponName: updates.lastWeaponName ?? existing.lastWeaponName
2415
+ };
2416
+ }
2417
+ __name(updateStatsByName, "updateStatsByName");
2418
+ function getMaxHPByName(bossName) {
2419
+ for (const boss of bossPool) {
2420
+ if (boss.main.name === bossName) {
2421
+ return boss.main.maxHP;
2422
+ }
2423
+ for (const minion of boss.minions) {
2424
+ if (minion.name === bossName) {
2425
+ return minion.maxHP;
2426
+ }
2427
+ }
2428
+ }
2429
+ return void 0;
2430
+ }
2431
+ __name(getMaxHPByName, "getMaxHPByName");
2432
+ function getMaxEnergyByName(bossName) {
2433
+ for (const boss of bossPool) {
2434
+ if (boss.main.name === bossName) {
2435
+ return boss.main.maxEnergy;
2436
+ }
2437
+ for (const minion of boss.minions) {
2438
+ if (minion.name === bossName) {
2439
+ return minion.maxEnergy;
2440
+ }
2441
+ }
2442
+ }
2443
+ return void 0;
2444
+ }
2445
+ __name(getMaxEnergyByName, "getMaxEnergyByName");
2446
+ var BattleEffectProcessor = {
2447
+ // 弱化形态
2448
+ handleWeakForm: /* @__PURE__ */ __name(function(targetBoss) {
2449
+ if (targetBoss.skills.includes("弱化形态")) {
2450
+ const newBuffMultiplier = 0.1;
2451
+ const messages = [`📚 【弱化形态】生效:子代防御脆弱,所受伤害提升10%`];
2454
2452
  return {
2455
- updatedHP: targetBoss.HP + actualHeal,
2456
- initialDamage: 0,
2457
- // 直接设置伤害为0
2458
- messages: [`❄️ 【冰霜进化】生效:免疫寒冷伤害,${targetBoss.name}回复${actualHeal}生命值`]
2453
+ buffMultiplier: newBuffMultiplier,
2454
+ messages
2459
2455
  };
2460
2456
  }
2461
2457
  return null;
2462
- }, "handleFrostEvolution"),
2463
- // 冰霜环绕处理(主宰专用)
2464
- handleFrostSurround: /* @__PURE__ */ __name(async (ctx, targetBoss, currentHP, maxHP) => {
2465
- if (!targetBoss.skills.includes("冰霜环绕") || currentHP <= 0 || // 新增血量必须大于0的判断
2466
- currentHP / maxHP > 0.3) {
2458
+ }, "handleWeakForm"),
2459
+ // 异形甲壳
2460
+ handleAlienShell: /* @__PURE__ */ __name(function(targetBoss) {
2461
+ if (targetBoss.skills.includes("异形甲壳")) {
2462
+ const newNerfMultiplier = 0.2;
2463
+ const messages = [`🛡️ 【异形甲壳】生效:强化生物甲壳提供防护,所受伤害降低20%`];
2464
+ return {
2465
+ nerfMultiplier: newNerfMultiplier,
2466
+ messages
2467
+ };
2468
+ }
2469
+ return null;
2470
+ }, "handleAlienShell"),
2471
+ // 孤立无援处理(活跃Boss中仅自己时增伤20%)
2472
+ handleIsolated: /* @__PURE__ */ __name(function(targetBoss, activeBosses) {
2473
+ const isIsolated = activeBosses.length === 1 && // 活跃Boss仅1个
2474
+ activeBosses[0].name === targetBoss.name;
2475
+ if (isIsolated) {
2476
+ const newBuffMultiplier = 0.2;
2477
+ const messages = [
2478
+ `🌌 【孤立无援】生效:无存活子代时,所受伤害提升20%`
2479
+ ];
2480
+ return {
2481
+ buffMultiplier: newBuffMultiplier,
2482
+ messages
2483
+ };
2484
+ }
2485
+ return null;
2486
+ }, "handleIsolated"),
2487
+ handleFrostRegeneration: /* @__PURE__ */ __name(function(targetBoss, activeBosses) {
2488
+ const messages = [];
2489
+ const otherUpdates = [];
2490
+ if (!targetBoss.skills.includes("冰霜回复")) {
2491
+ return null;
2492
+ }
2493
+ const targetMaxHP = getMaxHPByName(targetBoss.name);
2494
+ const currentHP = targetBoss.HP;
2495
+ if (currentHP > targetMaxHP * 0.3) {
2467
2496
  return null;
2468
2497
  }
2469
- const healAmount = Math.floor(maxHP * 0.45);
2470
- const updatedHP = Math.min(currentHP + healAmount, maxHP);
2471
- const activeMinions = await ctx.database.get("ggcevo_boss", {
2472
- groupId: targetBoss.groupId,
2473
- type: "子代",
2474
- isActive: true
2498
+ const selfHealAmount = Math.round(targetMaxHP * 0.4);
2499
+ const targetUpdates = {
2500
+ hpChange: selfHealAmount,
2501
+ // 累加HP变化量(正数回复)
2502
+ skillsRemoved: ["冰霜回复"]
2503
+ // 移除技能
2504
+ };
2505
+ messages.push(`❄️ 【冰霜回复】生效:自身回复${selfHealAmount}点生命值`);
2506
+ const otherSurvivingBosses = activeBosses.filter(
2507
+ (boss) => boss.name !== targetBoss.name && boss.isActive
2508
+ );
2509
+ otherSurvivingBosses.forEach((otherBoss) => {
2510
+ const otherName = otherBoss.name;
2511
+ const otherMaxHP = getMaxHPByName(otherName);
2512
+ const otherHealAmount = Math.round(otherMaxHP * 0.1);
2513
+ otherUpdates.push({
2514
+ name: otherName,
2515
+ updates: { hpChange: otherHealAmount }
2516
+ });
2517
+ messages.push(`❄️ 「${otherName}」回复${otherHealAmount}点生命值`);
2475
2518
  });
2476
- const skillUpdates = [
2477
- {
2519
+ messages.push(`❄️ 【冰霜回复】触发后技能移除`);
2520
+ return {
2521
+ messages,
2522
+ targetUpdates: {
2478
2523
  name: targetBoss.name,
2479
- remove: ["冰霜环绕"],
2480
- add: ["寒霜地狱"]
2524
+ updates: targetUpdates
2481
2525
  },
2482
- ...activeMinions.map((m) => ({
2483
- name: m.name,
2484
- add: ["寒霜地狱"]
2485
- }))
2486
- ];
2487
- return {
2488
- updatedHP,
2489
- skillUpdates,
2490
- messages: [
2491
- `❄️ 【冰霜环绕】生效,${targetBoss.name}回复45%最大生命值(+${healAmount}HP)`,
2492
- `🌪️ 警告!【寒霜地狱】降临,所有存活的异形获得30%减伤效果`
2493
- ]
2526
+ otherUpdates
2494
2527
  };
2495
- }, "handleFrostSurround"),
2496
- // 冰霜回复处理(子代专用)
2497
- handleFrostRecovery: /* @__PURE__ */ __name(async (ctx, targetBoss, currentHP, maxHP, activeBosses, bossGroup) => {
2498
- if (!targetBoss.skills.includes("冰霜回复") || currentHP <= 0 || // 新增血量必须大于0的判断
2499
- currentHP / maxHP > 0.3) {
2528
+ }, "handleFrostRegeneration"),
2529
+ handleFrostAura: /* @__PURE__ */ __name(function(targetBoss, activeBosses) {
2530
+ const messages = [];
2531
+ const otherUpdates = [];
2532
+ if (!targetBoss.skills.includes("冰霜环绕")) {
2533
+ return null;
2534
+ }
2535
+ const targetMaxHP = getMaxHPByName(targetBoss.name);
2536
+ const currentHP = targetBoss.HP;
2537
+ const triggerCondition = currentHP <= targetMaxHP * 0.3;
2538
+ if (!triggerCondition) {
2500
2539
  return null;
2501
2540
  }
2502
- const selfHealMax = Math.floor(maxHP * 0.4);
2503
- const actualSelfHeal = Math.min(selfHealMax, maxHP - currentHP);
2504
- const updatedHP = currentHP + actualSelfHeal;
2505
- let mainHeal = 0;
2506
- const mainBoss = activeBosses.find(
2507
- (b) => b.groupId === targetBoss.groupId && b.type === "主宰"
2541
+ const selfHealAmount = Math.round(targetMaxHP * 0.45);
2542
+ const targetUpdates = {
2543
+ hpChange: selfHealAmount,
2544
+ // 累加HP变化量(正数回复)
2545
+ skillsRemoved: ["冰霜环绕"],
2546
+ // 移除自身原有技能
2547
+ skillsAdded: ["寒霜地狱"]
2548
+ // 新增【寒霜地狱】技能(自身)
2549
+ };
2550
+ messages.push(`❄️ 【冰霜环绕】生效:自身回复${selfHealAmount}点生命值`);
2551
+ messages.push(`❄️ 「${targetBoss.name}」获得【寒霜地狱】技能`);
2552
+ const survivingMinions = activeBosses.filter(
2553
+ (boss) => boss.name !== targetBoss.name && boss.isActive
2508
2554
  );
2509
- if (mainBoss) {
2510
- const mainMaxHP = bossGroup.main.maxHP;
2511
- const mainHealMax = Math.floor(mainMaxHP * 0.1);
2512
- mainHeal = Math.min(mainHealMax, mainMaxHP - mainBoss.HP);
2513
- await ctx.database.set(
2514
- "ggcevo_boss",
2515
- { name: mainBoss.name },
2516
- { HP: Math.min(mainBoss.HP + mainHeal, mainMaxHP) }
2517
- );
2555
+ if (survivingMinions.length > 0) {
2556
+ survivingMinions.forEach((minion) => {
2557
+ const minionName = minion.name;
2558
+ const minionUpdates = {
2559
+ skillsAdded: ["寒霜地狱"]
2560
+ // 新增【寒霜地狱】技能(仅异形)
2561
+ };
2562
+ otherUpdates.push({
2563
+ name: minionName,
2564
+ updates: minionUpdates
2565
+ });
2566
+ messages.push(`❄️ 「${minionName}」获得【寒霜地狱】技能`);
2567
+ });
2518
2568
  }
2569
+ messages.push(`❄️ 【冰霜环绕】触发后技能移除`);
2519
2570
  return {
2520
- updatedHP,
2521
- skillUpdates: [{
2571
+ messages,
2572
+ targetUpdates: {
2522
2573
  name: targetBoss.name,
2523
- remove: ["冰霜回复"]
2524
- }],
2525
- messages: [
2526
- `❄️ 【冰霜回复】生效,${targetBoss.name}回复${actualSelfHeal}生命值(理论40%最大HP)`,
2527
- mainBoss ? `,${mainBoss.name}回复${mainHeal}生命值(理论10%最大HP)` : ""
2528
- ].filter(Boolean)
2574
+ updates: targetUpdates
2575
+ },
2576
+ otherUpdates
2529
2577
  };
2530
- }, "handleFrostRecovery"),
2531
- // 冷适应计数处理
2532
- handleColdAdaptation: /* @__PURE__ */ __name(async function(ctx, targetBoss, weaponName) {
2533
- if (weaponName !== "零度之下" || !targetBoss.skills.includes("冷适应") || targetBoss.tags.includes("惧热")) {
2578
+ }, "handleFrostAura"),
2579
+ // 冰霜进化处理(免疫伤害并回复生命值)
2580
+ handleFrostEvolution: /* @__PURE__ */ __name(function(targetBoss, weaponName, damage) {
2581
+ const messages = [];
2582
+ let isImmune = false;
2583
+ if (!targetBoss.skills.includes("冰霜进化")) {
2534
2584
  return null;
2535
2585
  }
2536
- const newCount = (targetBoss.Skillcountpoints || 0) + 1;
2537
- await ctx.database.set("ggcevo_boss", { name: targetBoss.name }, {
2538
- Skillcountpoints: newCount
2539
- });
2540
- if (newCount >= 10 && !targetBoss.tags.includes("惧热")) {
2541
- const newtags = [.../* @__PURE__ */ new Set([...targetBoss.tags, "惧热"])];
2542
- await ctx.database.set("ggcevo_boss", { name: targetBoss.name }, {
2543
- tags: newtags
2544
- });
2586
+ const isColdWeapon = weaponName === "零度之下";
2587
+ if (!isColdWeapon) {
2588
+ return null;
2589
+ }
2590
+ isImmune = true;
2591
+ const healAmount = damage;
2592
+ const targetUpdates = {
2593
+ name: targetBoss.name,
2594
+ updates: {
2595
+ hpChange: healAmount
2596
+ // 生命值变化量
2597
+ }
2598
+ };
2599
+ messages.push(`❄️ 【冰霜进化】生效:「${targetBoss.name}」免疫寒冷伤害`);
2600
+ messages.push(`❄️ 恢复${healAmount}点生命值`);
2601
+ return {
2602
+ isImmune,
2603
+ messages,
2604
+ targetUpdates
2605
+ };
2606
+ }, "handleFrostEvolution"),
2607
+ // 寒霜地狱处理
2608
+ handleFrostHell: /* @__PURE__ */ __name(function(targetBoss) {
2609
+ if (targetBoss.skills.includes("寒霜地狱")) {
2610
+ const newNerfMultiplier = 0.3;
2611
+ const messages = [`❄️ 【寒霜地狱】生效:暴风雪笼罩战场,所受伤害降低30%`];
2545
2612
  return {
2546
- messages: [`❄️ 【冷适应】生效,${targetBoss.name}获得「惧热」标签`]
2613
+ nerfMultiplier: newNerfMultiplier,
2614
+ messages
2547
2615
  };
2548
2616
  }
2549
2617
  return null;
2550
- }, "handleColdAdaptation"),
2551
- // 冷适应免疫处理
2552
- handleColdAdaptationImmunity: /* @__PURE__ */ __name(function(targetBoss, weaponName) {
2553
- if (targetBoss.skills.includes("冷适应") && targetBoss.Skillcountpoints >= 10 && weaponName === "零度之下") {
2618
+ }, "handleFrostHell"),
2619
+ // 应激甲壳I处理(基础减伤20%)
2620
+ handleStressShellI: /* @__PURE__ */ __name(function(targetBoss) {
2621
+ if (targetBoss.skills.includes("应激甲壳I")) {
2622
+ const newNerfMultiplier = 0.2;
2623
+ const messages = [`🛡️ 【应激甲壳I】生效:基础应激甲壳生效,所受伤害降低20%`];
2554
2624
  return {
2555
- initialDamage: 0,
2556
- // 直接设置伤害为0
2557
- messages: [`❄️ 【冷适应】生效:免疫寒冷伤害`]
2625
+ nerfMultiplier: newNerfMultiplier,
2626
+ messages
2558
2627
  };
2559
2628
  }
2560
2629
  return null;
2561
- }, "handleColdAdaptationImmunity"),
2562
- // 求生本能处理
2563
- handleSurvivalInstinct: /* @__PURE__ */ __name(function(targetBoss, currentHP, maxHP) {
2564
- if (currentHP > 0) return null;
2565
- let effect = null;
2566
- if (targetBoss.skills.includes("求生本能I")) {
2567
- effect = { heal: maxHP * 0.3, skill: "求生本能I" };
2568
- } else if (targetBoss.skills.includes("求生本能II")) {
2569
- effect = { heal: maxHP * 0.5, skill: "求生本能II" };
2570
- }
2571
- if (!effect) return null;
2572
- return {
2573
- updatedHP: effect.heal,
2574
- messages: [`【${effect.skill}】生效,${targetBoss.name}濒死时瞬间回复${effect.heal}生命值`],
2575
- skillUpdates: [{
2576
- name: targetBoss.name,
2577
- remove: [effect.skill]
2578
- }]
2579
- };
2580
- }, "handleSurvivalInstinct"),
2581
- // 感染空间站处理(返回减伤系数)
2582
- handleInfectedStation: /* @__PURE__ */ __name(async (ctx, targetBoss) => {
2583
- if (targetBoss.name !== "空间站感染虫" || !targetBoss.skills.includes("感染空间站")) return null;
2584
- const [sentryGun] = await ctx.database.get("ggcevo_boss", { name: "空间站哨枪塔", isActive: true });
2585
- if (sentryGun) {
2630
+ }, "handleStressShellI"),
2631
+ // 应激甲壳II处理(进阶减伤25%)
2632
+ handleStressShellII: /* @__PURE__ */ __name(function(targetBoss) {
2633
+ if (targetBoss.skills.includes("应激甲壳II")) {
2634
+ const newNerfMultiplier = 0.25;
2635
+ const messages = [`🛡️ 【应激甲壳II】生效:进阶应激甲壳生效,所受伤害降低25%`];
2586
2636
  return {
2587
- damageMultiplier: -0.5,
2588
- // 50% 减伤
2589
- messages: ["🛡️ 【感染空间站】生效:空间站哨枪塔存活时,受到的伤害-50%"]
2637
+ nerfMultiplier: newNerfMultiplier,
2638
+ messages
2590
2639
  };
2591
2640
  }
2592
2641
  return null;
2593
- }, "handleInfectedStation"),
2594
- // 霉菌滋生处理
2595
- handleMoldGrowth: /* @__PURE__ */ __name(async (ctx, targetBoss, bossGroup) => {
2596
- if (!targetBoss.skills.includes("霉菌滋生")) {
2642
+ }, "handleStressShellII"),
2643
+ handleSurvivalInstinctI: /* @__PURE__ */ __name(function(targetBoss) {
2644
+ const messages = [];
2645
+ if (!targetBoss.skills.includes("求生本能I")) {
2597
2646
  return null;
2598
2647
  }
2599
- const sentryConfig = bossGroup.minions.find((m) => m.name === "空间站哨枪塔");
2600
- if (!sentryConfig) return null;
2601
- const [sentryGun] = await ctx.database.get("ggcevo_boss", {
2602
- name: "空间站哨枪塔",
2603
- isActive: true
2604
- });
2605
- if (sentryGun) {
2606
- const healAmount = Math.floor(sentryConfig.maxHP * 0.01);
2607
- const newHP = Math.min(sentryGun.HP + healAmount, sentryConfig.maxHP);
2608
- await ctx.database.set(
2609
- "ggcevo_boss",
2610
- { name: "空间站哨枪塔" },
2611
- { HP: newHP }
2612
- );
2613
- return {
2614
- messages: [`🦠 【霉菌滋生】生效:空间站哨枪塔回复1%最大生命值(+${healAmount}HP)`]
2615
- };
2616
- }
2617
- return null;
2618
- }, "handleMoldGrowth"),
2619
- // 岗哨机枪处理
2620
- handleSentryGun: /* @__PURE__ */ __name(async (ctx, targetBoss, bossGroup) => {
2621
- if (!targetBoss.skills.includes("岗哨机枪")) {
2648
+ const targetMaxHP = getMaxHPByName(targetBoss.name);
2649
+ const currentHP = targetBoss.HP;
2650
+ if (currentHP !== 0) {
2622
2651
  return null;
2623
2652
  }
2624
- const currentCount = targetBoss.Skillcountpoints || 0;
2625
- const updates = [];
2626
- let messages = [];
2627
- if (currentCount === 10) {
2628
- const getMaxHP = /* @__PURE__ */ __name((name2) => {
2629
- if (name2 === "空间站感染虫") return bossGroup.main.maxHP;
2630
- const minion = bossGroup.minions.find((m) => m.name === name2);
2631
- return minion?.maxHP || 0;
2632
- }, "getMaxHP");
2633
- const [infectionBug] = await ctx.database.get("ggcevo_boss", {
2634
- name: "空间站感染虫",
2635
- isActive: true
2636
- });
2637
- if (infectionBug) {
2638
- const maxHP = getMaxHP("空间站感染虫");
2639
- const heal = Math.floor(maxHP * 0.1);
2640
- updates.push(
2641
- ctx.database.set(
2642
- "ggcevo_boss",
2643
- { name: infectionBug.name },
2644
- { HP: Math.min(infectionBug.HP + heal, maxHP) }
2645
- )
2646
- );
2647
- messages.push(`空间站感染虫回复${heal}HP`);
2653
+ const selfHealAmount = Math.round(targetMaxHP * 0.3);
2654
+ const updates = {
2655
+ hpChange: selfHealAmount,
2656
+ skillsRemoved: ["求生本能I"]
2657
+ };
2658
+ messages.push(`❤️ 【求生本能I】生效:生命值归零时回复${selfHealAmount}点生命值`);
2659
+ messages.push(`❤️ 「${targetBoss.name}」的【求生本能I】技能已移除`);
2660
+ return {
2661
+ messages,
2662
+ targetUpdates: {
2663
+ name: targetBoss.name,
2664
+ updates
2648
2665
  }
2649
- const [mechaBug] = await ctx.database.get("ggcevo_boss", {
2650
- name: "机械感染虫",
2651
- isActive: true
2652
- });
2653
- if (mechaBug) {
2654
- const maxHP = getMaxHP("机械感染虫");
2655
- const heal = Math.floor(maxHP * 0.1);
2656
- updates.push(
2657
- ctx.database.set(
2658
- "ggcevo_boss",
2659
- { name: mechaBug.name },
2660
- { HP: Math.min(mechaBug.HP + heal, maxHP) }
2661
- )
2662
- );
2663
- messages.push(`机械感染虫回复${heal}HP`);
2664
- }
2665
- updates.push(
2666
- ctx.database.set(
2667
- "ggcevo_boss",
2668
- { name: targetBoss.name },
2669
- { Skillcountpoints: 0 }
2670
- )
2671
- );
2672
- await Promise.all(updates);
2673
- return {
2674
- messages: ["🔫 【岗哨机枪】生效:" + messages.join(",")]
2675
- };
2676
- }
2677
- const newCount = currentCount + 1;
2678
- await ctx.database.set(
2679
- "ggcevo_boss",
2680
- { name: targetBoss.name },
2681
- { Skillcountpoints: newCount }
2682
- );
2683
- if (newCount === 10) {
2684
- return {
2685
- messages: ["🔫 【岗哨机枪】达到10层!下次攻击将清空层数并治疗所有存活的异形"]
2686
- };
2666
+ };
2667
+ }, "handleSurvivalInstinctI"),
2668
+ handleSurvivalInstinctII: /* @__PURE__ */ __name(function(targetBoss) {
2669
+ const messages = [];
2670
+ if (!targetBoss.skills.includes("求生本能II")) {
2671
+ return null;
2687
2672
  }
2688
- return null;
2689
- }, "handleSentryGun"),
2690
- // 结构装甲处理(返回减伤系数)
2691
- handleStructuralArmor: /* @__PURE__ */ __name((targetBoss, weaponData) => {
2692
- if (!targetBoss.skills.includes("结构装甲")) return null;
2693
- let reduction = 0.2;
2694
- let msg = "受到常规武器伤害-20%";
2695
- if (weaponData.type === "热能武器") {
2696
- reduction = 0.4;
2697
- msg = "受到热能武器伤害-40%";
2673
+ const targetMaxHP = getMaxHPByName(targetBoss.name);
2674
+ const currentHP = targetBoss.HP;
2675
+ if (currentHP !== 0) {
2676
+ return null;
2698
2677
  }
2678
+ const selfHealAmount = Math.round(targetMaxHP * 0.5);
2679
+ const updates = {
2680
+ hpChange: selfHealAmount,
2681
+ // 生命值变化量
2682
+ skillsRemoved: ["求生本能II"]
2683
+ // 移除的技能
2684
+ };
2685
+ messages.push(`❤️ 【求生本能II】生效:生命值归零时回复${selfHealAmount}点生命值`);
2686
+ messages.push(`❤️ 「${targetBoss.name}」的【求生本能II】技能已移除`);
2699
2687
  return {
2700
- damageMultiplier: -reduction,
2701
- // 返回减伤系数
2702
- messages: [`🛡️ 【结构装甲】生效:${msg}`]
2688
+ messages,
2689
+ targetUpdates: {
2690
+ name: targetBoss.name,
2691
+ updates
2692
+ }
2703
2693
  };
2704
- }, "handleStructuralArmor"),
2705
- // 修改 handleBloodEffects 函数
2706
- handleBloodEffects: /* @__PURE__ */ __name(function(targetBoss, currentHP, maxHP) {
2707
- if (!targetBoss.skills.includes("吸血唾液")) return null;
2708
- const bloodStacks = targetBoss.Skillcountpoints || 0;
2709
- let buffAmount = 0;
2710
- let nerfAmount = 0;
2694
+ }, "handleSurvivalInstinctII"),
2695
+ // PassiveHandler 对象中添加冷适应技能的处理函数
2696
+ handleColdAdaptation: /* @__PURE__ */ __name(function(targetBoss, weaponName) {
2711
2697
  const messages = [];
2712
- if (bloodStacks > 0) {
2713
- const reduction = bloodStacks * 0.05;
2714
- nerfAmount += reduction;
2715
- messages.push(`🩸 【吸血唾液】生效:受到的伤害-${(reduction * 100).toFixed(0)}%`);
2716
- }
2717
- if (targetBoss.skills.includes("嗜血狂暴") && currentHP / maxHP < 0.5) {
2718
- nerfAmount += 0.2;
2719
- messages.push(`🔥 【嗜血狂暴】生效:进入狂暴状态,受到的伤害-20%`);
2720
- }
2721
- if (targetBoss.skills.includes("吐血") && bloodStacks < 1) {
2722
- buffAmount += 0.2;
2723
- messages.push(`💔 【吐血】生效:无"吸血"层数,受到的伤害+20%`);
2698
+ let isImmune = false;
2699
+ let targetUpdates = null;
2700
+ if (!targetBoss.skills.includes("冷适应")) {
2701
+ return null;
2724
2702
  }
2725
- if (buffAmount > 0 || nerfAmount > 0) {
2703
+ const currentLayers = targetBoss.statusLayers || 0;
2704
+ const hasFearHeatTag = targetBoss.tags.includes("惧热") || false;
2705
+ if (hasFearHeatTag && weaponName === "零度之下") {
2706
+ isImmune = true;
2707
+ messages.push(`🧊 【冷适应】生效:免疫寒冷伤害`);
2726
2708
  return {
2727
- buffAmount,
2728
- // 正值增伤系数
2729
- nerfAmount,
2730
- // 正值减伤系数
2731
- messages
2709
+ isImmune,
2710
+ messages,
2711
+ targetUpdates
2732
2712
  };
2733
2713
  }
2734
- return null;
2735
- }, "handleBloodEffects"),
2736
- handleBloodCount: /* @__PURE__ */ __name(async function(ctx, targetBoss, currentHP, maxHP) {
2737
- if (!targetBoss.skills.includes("吸血唾液")) {
2738
- return null;
2714
+ if (currentLayers < 10) {
2715
+ const newLayers = currentLayers + 1;
2716
+ targetUpdates = {
2717
+ name: targetBoss.name,
2718
+ updates: {
2719
+ statusLayersChanged: 1
2720
+ // 层数+1
2721
+ }
2722
+ };
2723
+ messages.push(`❄️ 【冷适应】叠加状态:当前累计${newLayers}/10次寒冷伤害`);
2724
+ if (newLayers >= 10) {
2725
+ targetUpdates.updates.tagsAdded = ["惧热"];
2726
+ messages.push(`🧊 【冷适应】触发:累计承受10次寒冷伤害,获得「惧热」标签`);
2727
+ messages.push(`🧊 【冷适应】获得永久免疫寒冷伤害效果`);
2728
+ }
2739
2729
  }
2740
- let messages = [];
2741
- let updatedHP = currentHP;
2742
- let newStacks;
2743
- const oldStacks = targetBoss.Skillcountpoints || 0;
2744
- if (oldStacks >= 20 && targetBoss.skills.includes("进食")) {
2745
- const heal = Math.floor(maxHP * 0.2);
2746
- updatedHP = Math.min(currentHP + heal, maxHP);
2747
- await ctx.database.set("ggcevo_boss", { name: targetBoss.name }, { Skillcountpoints: 0 });
2748
- messages.push(`🍽️ 【进食】生效:${targetBoss.name}回复20%最大生命值(+${heal}HP),“吸血”层数清零`);
2749
- return { updatedHP, messages };
2750
- }
2751
- if (targetBoss.skills.includes("吸血唾液")) {
2752
- newStacks = oldStacks + 1;
2753
- messages.push(`🩸 【吸血唾液】生效:获得1层“吸血”`);
2754
- }
2755
- if (targetBoss.skills.includes("嗜血狂暴") && currentHP / maxHP < 0.5) {
2756
- newStacks += 1;
2757
- messages.push(`🔥 【嗜血狂暴】生效:额外获得1层“吸血”`);
2758
- }
2759
- newStacks = Math.min(newStacks, 20);
2760
- if (oldStacks < 20 && newStacks >= 20) {
2761
- messages.push(`🩸 “吸血”达到${newStacks}层,下次受到攻击将触发【进食】`);
2762
- }
2763
- await ctx.database.set("ggcevo_boss", { name: targetBoss.name }, { Skillcountpoints: newStacks });
2764
- return { updatedHP, messages };
2765
- }, "handleBloodCount"),
2766
- // 修改后的伽马枪辐射处理(无限叠层,每层2.5%增伤,有效上限20层)
2767
- handleGammaRadiation: /* @__PURE__ */ __name(async (ctx, targetBoss, weaponName) => {
2768
- if (weaponName !== "伽马枪" || targetBoss.tags.includes("机械") || !targetBoss.tags.includes("生物")) {
2730
+ return {
2731
+ isImmune,
2732
+ messages,
2733
+ targetUpdates
2734
+ };
2735
+ }, "handleColdAdaptation"),
2736
+ // 感染空间站处理(空间站存活时自身减伤50%)
2737
+ handleInfectedSpaceStation: /* @__PURE__ */ __name(function(targetBoss, activeBosses) {
2738
+ const messages = [];
2739
+ if (!targetBoss.skills.includes("感染空间站")) {
2769
2740
  return null;
2770
2741
  }
2771
- const messages = [];
2772
- let radiationApplied = false;
2773
- const currentLayers = targetBoss.Vulnerability || 0;
2774
- const newLayers = currentLayers + 1;
2775
- await ctx.database.set(
2776
- "ggcevo_boss",
2777
- { name: targetBoss.name },
2778
- { Vulnerability: newLayers }
2742
+ const spaceStation = activeBosses.find(
2743
+ (boss) => boss.name === "空间站哨枪塔" && boss.isActive
2779
2744
  );
2780
- messages.push(`☢️ ${targetBoss.name}获得1层“辐射”`);
2781
- radiationApplied = true;
2745
+ if (!spaceStation) {
2746
+ return null;
2747
+ }
2748
+ const newNerfMultiplier = 0.5;
2749
+ messages.push(`🛸 【感染空间站】生效:因「空间站哨枪塔」存活,自身所受伤害降低50%`);
2782
2750
  return {
2783
- messages,
2784
- radiationApplied
2751
+ nerfMultiplier: newNerfMultiplier,
2752
+ // 返回调整后的减伤系数
2753
+ messages
2785
2754
  };
2786
- }, "handleGammaRadiation"),
2787
- // 修改后的辐射伤害计算(每层2.5%增伤,上限20层)
2788
- calculateRadiationDamage: /* @__PURE__ */ __name((targetBoss) => {
2789
- const radiationLayers = targetBoss.Vulnerability || 0;
2790
- if (radiationLayers < 1) return null;
2791
- const effectiveLayers = Math.min(radiationLayers, 20);
2792
- const damageIncrease = effectiveLayers * 2.5;
2793
- const maxIncrease = 50;
2755
+ }, "handleInfectedSpaceStation"),
2756
+ // 病毒云处理(释放病毒云雾减伤10%)
2757
+ handleVirusCloud: /* @__PURE__ */ __name(function(targetBoss) {
2794
2758
  const messages = [];
2795
- let statusMsg = `☢️ 【辐射】生效:当前${radiationLayers}层“辐射”`;
2796
- statusMsg += `,受到的伤害+${damageIncrease}%`;
2797
- if (damageIncrease >= maxIncrease) {
2798
- statusMsg += ``;
2759
+ if (!targetBoss.skills.includes("病毒云")) {
2760
+ return null;
2799
2761
  }
2800
- messages.push(statusMsg);
2762
+ const newNerfMultiplier = 0.1;
2763
+ messages.push(`☁️ 【病毒云】生效:释放病毒云雾形成保护,所受伤害降低10%`);
2801
2764
  return {
2802
- damageMultiplier: effectiveLayers * 0.025,
2803
- // 每层2.5%增伤
2765
+ nerfMultiplier: newNerfMultiplier,
2766
+ // 返回调整后的减伤系数
2804
2767
  messages
2805
2768
  };
2806
- }, "calculateRadiationDamage"),
2807
- // 修改后的寒冷处理(无限叠层,每层2.5%增伤,有效上限20层)
2808
- handleColdEffect: /* @__PURE__ */ __name(async (ctx, targetBoss, weaponName) => {
2809
- if (weaponName !== "零度之下") {
2769
+ }, "handleVirusCloud"),
2770
+ // 霉菌滋生处理(空间站存活时为其回复1%最大生命值)
2771
+ handleMoldGrowth: /* @__PURE__ */ __name(function(targetBoss, activeBosses) {
2772
+ const messages = [];
2773
+ if (!targetBoss.skills.includes("霉菌滋生")) {
2810
2774
  return null;
2811
2775
  }
2812
- const messages = [];
2813
- let freezing = false;
2814
- const currentFreezing = targetBoss.freezing || 0;
2815
- const newFreezing = currentFreezing + 1;
2816
- await ctx.database.set(
2817
- "ggcevo_boss",
2818
- { name: targetBoss.name },
2819
- { freezing: newFreezing }
2776
+ const spaceStation = activeBosses.find(
2777
+ (boss) => boss.name === "空间站哨枪塔" && boss.isActive
2820
2778
  );
2821
- messages.push(`❄️ ${targetBoss.name} 获得1层“寒冷”`);
2822
- freezing = true;
2779
+ if (!spaceStation) {
2780
+ return null;
2781
+ }
2782
+ const spaceStationMaxHP = getMaxHPByName(spaceStation.name);
2783
+ const healAmount = Math.round(spaceStationMaxHP * 0.01);
2784
+ const spaceStationUpdates = {
2785
+ name: spaceStation.name,
2786
+ updates: {
2787
+ hpChange: healAmount
2788
+ }
2789
+ };
2790
+ messages.push(`🍄 【霉菌滋生】生效:为空间站哨枪塔回复${healAmount}点生命值`);
2823
2791
  return {
2824
2792
  messages,
2825
- freezing
2793
+ spaceStationUpdates
2826
2794
  };
2827
- }, "handleColdEffect"),
2828
- // 修改后的寒冷伤害计算(每层2.5%增伤,上限20层)
2829
- calculateColdDamage: /* @__PURE__ */ __name((targetBoss) => {
2830
- const freezingLayers = targetBoss.freezing || 0;
2831
- if (freezingLayers < 1) return null;
2832
- const effectiveLayers = Math.min(freezingLayers, 20);
2833
- const damageIncrease = effectiveLayers * 2.5;
2834
- const maxIncrease = 50;
2795
+ }, "handleMoldGrowth"),
2796
+ // 岗哨机枪处理(累计10次攻击后为其他异形回复10%最大生命值)
2797
+ handleSentryGun: /* @__PURE__ */ __name(function(targetBoss, activeBosses) {
2835
2798
  const messages = [];
2836
- let statusMsg = `❄️ 【寒冷】生效:当前${freezingLayers}层“寒冷”`;
2837
- statusMsg += `,受到的伤害+${damageIncrease}%`;
2838
- if (damageIncrease >= maxIncrease) {
2839
- statusMsg += ``;
2799
+ let targetUpdates = null;
2800
+ const otherUpdates = [];
2801
+ if (!targetBoss.skills.includes("岗哨机枪")) {
2802
+ return null;
2840
2803
  }
2841
- messages.push(statusMsg);
2842
- return {
2843
- damageMultiplier: effectiveLayers * 0.025,
2844
- // 每层2.5%增伤
2845
- messages
2846
- };
2847
- }, "calculateColdDamage"),
2848
- // === 电能相关被动处理 ===
2849
- // 处理导体标签变化(血量低时护盾->重甲)
2850
- handleConductorTagChange: /* @__PURE__ */ __name(async (ctx, targetBoss, currentHP, maxHP) => {
2851
- const triggerThreshold = targetBoss.skills.includes("超导体") ? 0.05 : 0.1;
2852
- const isBelowThreshold = currentHP <= maxHP * triggerThreshold;
2853
- const hasShieldTag = targetBoss.tags.includes("护盾");
2854
- const alreadyHeavyArmor = targetBoss.tags.includes("重甲");
2855
- if (!targetBoss.skills.includes("超导体") && !targetBoss.skills.includes("电能导体")) return null;
2856
- if (isBelowThreshold && hasShieldTag && !alreadyHeavyArmor) {
2857
- const newTags = [
2858
- ...targetBoss.tags.filter((tag) => tag !== "护盾"),
2859
- "重甲"
2860
- ];
2861
- await ctx.database.set(
2862
- "ggcevo_boss",
2863
- { name: targetBoss.name },
2864
- { tags: newTags }
2865
- );
2866
- return {
2867
- messages: [`⚡ 【${targetBoss.skills.includes("超导体") ? "超导体" : "电能导体"}】生效:护盾崩溃,标签变更为「重甲」`]
2804
+ const currentStacks = targetBoss.skillStacks || 0;
2805
+ if (currentStacks < 10) {
2806
+ targetUpdates = {
2807
+ name: targetBoss.name,
2808
+ updates: {
2809
+ skillStacksChanged: 1
2810
+ // 层数+1
2811
+ }
2868
2812
  };
2869
- }
2870
- return null;
2871
- }, "handleConductorTagChange"),
2872
- // 处理能量虹吸减伤(基于血量)
2873
- handleEnergySiphon: /* @__PURE__ */ __name((targetBoss, currentHP, maxHP) => {
2874
- if (!targetBoss.skills.includes("能量虹吸")) return null;
2875
- let reduction = 0;
2876
- if (currentHP >= maxHP * 0.7) {
2877
- reduction = 0.4;
2878
- } else if (currentHP >= maxHP * 0.3) {
2879
- reduction = 0.2;
2880
- }
2881
- if (reduction > 0) {
2813
+ const newStacks = currentStacks + 1;
2814
+ messages.push(`🔫 【岗哨机枪】充能:当前累计${newStacks}/10次攻击`);
2882
2815
  return {
2883
- damageMultiplier: -reduction,
2884
- messages: [`🔋 【能量虹吸】生效:血量${currentHP > maxHP * 0.7 ? ">70%" : ">30%"},受到的伤害-${reduction * 100}%`]
2816
+ messages,
2817
+ targetUpdates,
2818
+ otherUpdates
2885
2819
  };
2886
2820
  }
2887
- return null;
2888
- }, "handleEnergySiphon"),
2889
- // 处理电能冲击波(受击回复能量)
2890
- handleEnergyShockwave: /* @__PURE__ */ __name(async (ctx, targetBoss) => {
2891
- if (!targetBoss.skills.includes("电能冲击波")) return null;
2892
- const energyGain = 100;
2893
- const currentEnergy = targetBoss.energy || 0;
2894
- const newEnergy = Math.min(currentEnergy + energyGain, 1e3);
2895
- await ctx.database.set(
2896
- "ggcevo_boss",
2897
- { name: targetBoss.name },
2898
- { energy: newEnergy }
2821
+ targetUpdates = {
2822
+ name: targetBoss.name,
2823
+ updates: {
2824
+ skillStacksChanged: -currentStacks
2825
+ // 重置层数
2826
+ }
2827
+ };
2828
+ messages.push(`🔫 【岗哨机枪】生效:累计承受10次攻击,为所有其他存活异形回复生命值`);
2829
+ const otherSurvivingBosses = activeBosses.filter(
2830
+ (boss) => boss.name !== targetBoss.name && boss.isActive
2899
2831
  );
2900
- const actualGain = newEnergy - currentEnergy;
2832
+ otherSurvivingBosses.forEach((otherBoss) => {
2833
+ const otherName = otherBoss.name;
2834
+ const otherMaxHP = getMaxHPByName(otherName);
2835
+ const healAmount = Math.round(otherMaxHP * 0.1);
2836
+ otherUpdates.push({
2837
+ name: otherName,
2838
+ updates: {
2839
+ hpChange: healAmount
2840
+ // 生命值回复
2841
+ }
2842
+ });
2843
+ messages.push(`🔫 【岗哨机枪】触发:为「${otherName}」回复${healAmount}点生命值`);
2844
+ });
2901
2845
  return {
2902
- messages: [
2903
- `⚡ 【电能冲击波】生效:${actualGain > 0 ? `回复${actualGain}点能量` : "能量已达上限"}`,
2904
- `当前能量: ${newEnergy}/${1e3}`
2905
- ].filter(Boolean)
2846
+ messages,
2847
+ targetUpdates,
2848
+ otherUpdates
2906
2849
  };
2907
- }, "handleEnergyShockwave"),
2908
- // 处理能源虹吸减伤(基于能量)
2909
- handlePowerSiphon: /* @__PURE__ */ __name((targetBoss) => {
2910
- if (!targetBoss.skills.includes("能源虹吸")) return null;
2911
- const currentEnergy = targetBoss.energy || 0;
2912
- let reduction = 0;
2913
- if (currentEnergy >= 800) {
2914
- reduction = 0.5;
2915
- } else if (currentEnergy >= 500) {
2916
- reduction = 0.3;
2917
- }
2918
- if (reduction > 0) {
2919
- return {
2920
- damageMultiplier: -reduction,
2921
- messages: [`🔋 【能源虹吸】生效:能量${currentEnergy > 800 ? ">80%" : ">50%"},受到的伤害-${reduction * 100}%`]
2922
- };
2923
- }
2924
- return null;
2925
- }, "handlePowerSiphon"),
2926
- // 处理电能立场(概率免疫伤害)
2927
- handleEnergyField: /* @__PURE__ */ __name(async function(ctx, targetBoss, weaponName, initialDamage) {
2928
- if (!targetBoss.skills.includes("电能立场") || initialDamage === 0 || weaponName === "零度之下") {
2850
+ }, "handleSentryGun"),
2851
+ // 结构装甲处理(常规伤害降低20%;热能武器伤害降低40%)
2852
+ handleStructuralArmor: /* @__PURE__ */ __name(function(targetBoss, weaponData) {
2853
+ const messages = [];
2854
+ if (!targetBoss.skills.includes("结构装甲")) {
2929
2855
  return null;
2930
2856
  }
2931
- const currentEnergy = targetBoss.energy || 0;
2932
- const currentFreezing = targetBoss.freezing || 0;
2933
- let immuneChance = 55 - currentFreezing * 5;
2934
- immuneChance = Math.max(immuneChance, 5);
2935
- if (currentEnergy < 300) {
2857
+ const weaponType = weaponData.type;
2858
+ const isHeatWeapon = weaponType === "热能武器";
2859
+ const nerfMultiplier = isHeatWeapon ? 0.4 : 0.2;
2860
+ messages.push(`🛡️ 【结构装甲】生效:${isHeatWeapon ? "热能武器" : "常规武器"}伤害降低${nerfMultiplier * 100}%`);
2861
+ return {
2862
+ nerfMultiplier,
2863
+ messages
2864
+ };
2865
+ }, "handleStructuralArmor"),
2866
+ // 吸血唾液处理(叠加「吸血」层数,每层提供5%减伤,最多20层)
2867
+ handleVampireSaliva: /* @__PURE__ */ __name(function(targetBoss) {
2868
+ const messages = [];
2869
+ if (!targetBoss.skills.includes("吸血唾液")) {
2936
2870
  return null;
2937
2871
  }
2938
- const roll = Math.random() * 100;
2939
- if (roll <= immuneChance) {
2940
- return {
2941
- immune: true,
2942
- messages: [
2943
- `🛡️ 【电能立场】生效:免疫非寒冷伤害!`
2944
- ]
2872
+ const currentStacks = targetBoss.skillStacks || 0;
2873
+ const addStacks = currentStacks < 20 ? 1 : 0;
2874
+ const addedReduction = currentStacks * 0.05;
2875
+ let targetUpdates = null;
2876
+ if (addStacks > 0) {
2877
+ targetUpdates = {
2878
+ name: targetBoss.name,
2879
+ updates: {
2880
+ skillStacksChanged: addStacks
2881
+ // 实际增加的层数(0或1)
2882
+ }
2945
2883
  };
2946
2884
  }
2947
- return null;
2948
- }, "handleEnergyField"),
2949
- // 辅助函数:从配置中获取成员配置
2950
- getMemberConfig: /* @__PURE__ */ __name((name2, bossGroup) => {
2951
- if (bossGroup.main.name === name2) return bossGroup.main;
2952
- for (const minion of bossGroup.minions) {
2953
- if (minion.name === name2) return minion;
2885
+ const stackMessage = currentStacks < 20 ? `当前${currentStacks}层,获得${(addedReduction * 100).toFixed(0)}%减伤,同时层数+1` : `已达到最大20层,获得${(addedReduction * 100).toFixed(0)}%减伤`;
2886
+ messages.push(`🩸 【吸血唾液】${stackMessage}`);
2887
+ return {
2888
+ nerfMultiplier: addedReduction,
2889
+ messages,
2890
+ targetUpdates
2891
+ };
2892
+ }, "handleVampireSaliva"),
2893
+ // 进食处理(吸血层数达到20层时,回复20%最大生命值)
2894
+ handleFeeding: /* @__PURE__ */ __name(function(targetBoss) {
2895
+ const messages = [];
2896
+ if (!targetBoss.skills.includes("进食")) {
2897
+ return null;
2954
2898
  }
2955
- return null;
2956
- }, "getMemberConfig"),
2957
- // 修改后的脉冲处理函数
2958
- handlePulse: /* @__PURE__ */ __name(async function(ctx, targetBoss, activeBosses, bossGroup, currentHP) {
2959
- if (!targetBoss.skills.includes("脉冲")) return null;
2960
- const currentEnergy = targetBoss.energy || 0;
2961
- const currentFreezing = targetBoss.freezing || 0;
2962
- const maxEnergy = 1e3;
2963
- if (currentEnergy < maxEnergy * 0.3) {
2899
+ const currentStacks = targetBoss.skillStacks || 0;
2900
+ if (currentStacks < 20) {
2964
2901
  return null;
2965
2902
  }
2966
- let triggerChance = 60 - currentFreezing * 5;
2967
- triggerChance = Math.max(triggerChance, 5);
2968
- const roll = Math.random() * 100;
2969
- if (roll <= triggerChance) {
2970
- const groupMembers = activeBosses.filter(
2971
- (b) => b.groupId === targetBoss.groupId && b.HP > 0
2972
- // 只包括存活的异形
2973
- );
2974
- const updates = [];
2975
- const healMessages = [];
2976
- let updatedHP = currentHP;
2977
- for (const member of groupMembers) {
2978
- const memberConfig = this.getMemberConfig(member.name, bossGroup);
2979
- if (!memberConfig) continue;
2980
- const maxHP = memberConfig.maxHP;
2981
- const healAmount = member.type === "主宰" ? 100 : 100;
2982
- const newHP = Math.min(member.HP + healAmount, maxHP);
2983
- const actualHeal = newHP - member.HP;
2984
- if (member.name === targetBoss.name) {
2985
- updatedHP = newHP;
2986
- }
2987
- updates.push(
2988
- ctx.database.set(
2989
- "ggcevo_boss",
2990
- { name: member.name },
2991
- { HP: newHP }
2992
- )
2993
- );
2994
- if (actualHeal > 0) {
2995
- healMessages.push(`${member.name}+${actualHeal}HP`);
2996
- }
2903
+ const maxHP = getMaxHPByName(targetBoss.name);
2904
+ const healAmount = Math.round(maxHP * 0.2);
2905
+ const targetUpdates = {
2906
+ name: targetBoss.name,
2907
+ updates: {
2908
+ skillStacksChanged: -currentStacks,
2909
+ // 层数清零
2910
+ hpChange: healAmount
2911
+ // 生命值回复
2997
2912
  }
2998
- if (healMessages.length > 0) {
2999
- await Promise.all(updates);
3000
- return {
3001
- newHP: updatedHP,
3002
- // 返回当前目标的新HP值
3003
- messages: [
3004
- `❤️ 【脉冲】生效:治疗全体异形`,
3005
- ...healMessages
3006
- ]
2913
+ };
2914
+ messages.push(`🍽️ 【进食】生效:消耗20层吸血唾液,回复${healAmount}点生命值`);
2915
+ return {
2916
+ messages,
2917
+ targetUpdates
2918
+ };
2919
+ }, "handleFeeding"),
2920
+ // 嗜血狂暴处理(生命值低于50%时,叠加吸血层数并降低20%伤害)
2921
+ handleBloodlust: /* @__PURE__ */ __name(function(targetBoss) {
2922
+ const messages = [];
2923
+ let targetUpdates = null;
2924
+ let nerfMultiplier = 0;
2925
+ if (!targetBoss.skills.includes("嗜血狂暴")) {
2926
+ return null;
2927
+ }
2928
+ const currentHP = targetBoss.HP;
2929
+ const maxHP = getMaxHPByName(targetBoss.name);
2930
+ const currentStacks = targetBoss.skillStacks || 0;
2931
+ const isLowHP = currentHP <= maxHP * 0.5;
2932
+ if (isLowHP) {
2933
+ if (currentStacks < 20) {
2934
+ targetUpdates = {
2935
+ name: targetBoss.name,
2936
+ updates: {
2937
+ skillStacksChanged: 1
2938
+ // 层数+1
2939
+ }
3007
2940
  };
3008
2941
  }
3009
- return null;
2942
+ nerfMultiplier = 0.2;
2943
+ const stackMessage = currentStacks < 20 ? `额外叠加1层吸血唾液(当前${currentStacks + 1}/20层)` : `已达到最大20层吸血唾液`;
2944
+ messages.push(`🔥 【嗜血狂暴】生效:HP≤50%,${stackMessage},并且获得20%额外减伤`);
3010
2945
  }
3011
- return null;
3012
- }, "handlePulse"),
3013
- // 处理弧焊枪的能量消耗
3014
- handleArcWelderEffect: /* @__PURE__ */ __name(async (ctx, targetBoss, weaponName) => {
3015
- if (weaponName !== "弧焊枪") return null;
3016
- const currentEnergy = targetBoss.energy || 0;
2946
+ return {
2947
+ nerfMultiplier,
2948
+ messages,
2949
+ targetUpdates
2950
+ };
2951
+ }, "handleBloodlust"),
2952
+ // 吐血处理(无「吸血唾液」层数时,所受伤害提升20%)
2953
+ handleVomit: /* @__PURE__ */ __name(function(targetBoss) {
3017
2954
  const messages = [];
3018
- let arcApplied = false;
3019
- if (currentEnergy > 0) {
3020
- const energyDrain = Math.min(200, currentEnergy);
3021
- const newEnergy = currentEnergy - energyDrain;
3022
- await ctx.database.set(
3023
- "ggcevo_boss",
3024
- { name: targetBoss.name },
3025
- { energy: newEnergy }
3026
- );
3027
- arcApplied = true;
3028
- messages.push(`⚡ 【弧焊枪】武器效果:消耗目标200点能量`);
3029
- } else {
2955
+ if (!targetBoss.skills.includes("吐血")) {
3030
2956
  return null;
3031
2957
  }
3032
- return { messages, arcApplied };
3033
- }, "handleArcWelderEffect"),
3034
- // PassiveHandler 对象中添加新的处理函数
3035
- handleArcRifleEffect: /* @__PURE__ */ __name(async function(ctx, targetBoss, weaponName, messages) {
3036
- if (weaponName !== "DG-3电弧步枪") return null;
3037
- const currentEnergy = targetBoss.energy || 0;
3038
- const drainAmount = Math.min(500, currentEnergy);
3039
- const newEnergy = currentEnergy - drainAmount;
3040
- if (drainAmount <= 0) {
3041
- return null;
2958
+ const currentVampireStacks = targetBoss.skillStacks || 0;
2959
+ const isTriggered = currentVampireStacks === 0;
2960
+ const buffMultiplier = isTriggered ? 0.2 : 0;
2961
+ if (isTriggered) {
2962
+ messages.push(`🩸 【吐血】生效:无「吸血唾液」层数,所受伤害提升20%`);
3042
2963
  }
3043
- await ctx.database.set(
3044
- "ggcevo_boss",
3045
- { name: targetBoss.name },
3046
- { energy: newEnergy }
3047
- );
3048
- targetBoss.energy = newEnergy;
3049
- messages.push(`⚡ 【DG-3电弧步枪】武器效果:消耗目标${drainAmount}点能量`);
3050
- return { drainAmount };
3051
- }, "handleArcRifleEffect"),
3052
- // 庞兽狂暴处理(血量低于50%时减伤)
3053
- handleGiantRage: /* @__PURE__ */ __name(function(targetBoss, currentHP, maxHP) {
3054
- if (!targetBoss.skills.includes("庞兽狂暴")) return null;
3055
- if (currentHP / maxHP < 0.5) {
2964
+ return {
2965
+ buffMultiplier,
2966
+ messages
2967
+ };
2968
+ }, "handleVomit"),
2969
+ // 超导体(状态转换:护盾→重甲)
2970
+ handleSuperconductor: /* @__PURE__ */ __name(function(targetBoss) {
2971
+ const messages = [];
2972
+ let targetUpdates = null;
2973
+ if (!targetBoss.skills.includes("超导体")) {
2974
+ return null;
2975
+ }
2976
+ const maxHP = getMaxHPByName(targetBoss.name);
2977
+ const hpPercent = targetBoss.HP / maxHP;
2978
+ const hasShieldTag = targetBoss.tags.includes("护盾") || false;
2979
+ if (hpPercent > 0.1 || !hasShieldTag) {
2980
+ return null;
2981
+ }
2982
+ targetUpdates = {
2983
+ name: targetBoss.name,
2984
+ updates: {
2985
+ tagsRemoved: ["护盾"],
2986
+ // 移除护盾标签
2987
+ tagsAdded: ["重甲"]
2988
+ // 添加重甲标签
2989
+ }
2990
+ };
2991
+ messages.push(`🛡️ 【超导体】生效:生命值≤10%,「护盾」标签转换为「重甲」标签`);
2992
+ return {
2993
+ messages,
2994
+ targetUpdates
2995
+ };
2996
+ }, "handleSuperconductor"),
2997
+ // 能量虹吸(生命值相关减伤)
2998
+ handleEnergySiphon: /* @__PURE__ */ __name(function(targetBoss) {
2999
+ const messages = [];
3000
+ if (!targetBoss.skills.includes("能量虹吸")) return null;
3001
+ const maxHP = getMaxHPByName(targetBoss.name);
3002
+ const hpPercent = targetBoss.HP / maxHP;
3003
+ let nerfMultiplier = 0;
3004
+ if (hpPercent >= 0.7) {
3005
+ nerfMultiplier = 0.4;
3006
+ messages.push(`⚡ 【能量虹吸】生效:生命值≥70%,所受伤害降低40%`);
3007
+ } else if (hpPercent >= 0.3) {
3008
+ nerfMultiplier = 0.2;
3009
+ messages.push(`⚡ 【能量虹吸】生效:生命值≥30%,所受伤害降低20%`);
3010
+ }
3011
+ return { nerfMultiplier, messages };
3012
+ }, "handleEnergySiphon"),
3013
+ // 能源虹吸(能量值相关减伤)
3014
+ handleEnergyAbsorption: /* @__PURE__ */ __name(function(targetBoss) {
3015
+ const messages = [];
3016
+ if (!targetBoss.skills.includes("能源虹吸")) return null;
3017
+ const currentEnergy = targetBoss.energy;
3018
+ const maxEnergy = getMaxEnergyByName(targetBoss.name);
3019
+ const energyPercent = currentEnergy / maxEnergy;
3020
+ let nerfMultiplier = 0;
3021
+ if (energyPercent >= 0.8) {
3022
+ nerfMultiplier = 0.5;
3023
+ messages.push(`⚡ 【能源虹吸】生效:能量≥80%,所受伤害降低50%`);
3024
+ } else if (energyPercent >= 0.5) {
3025
+ nerfMultiplier = 0.3;
3026
+ messages.push(`⚡ 【能源虹吸】生效:能量≥50%,所受伤害降低30%`);
3027
+ }
3028
+ return { nerfMultiplier, messages };
3029
+ }, "handleEnergyAbsorption"),
3030
+ // 电能立场(能量相关免疫)
3031
+ handleElectricField: /* @__PURE__ */ __name(function(targetBoss) {
3032
+ const messages = [];
3033
+ let isImmune = false;
3034
+ if (!targetBoss.skills.includes("电能立场")) return null;
3035
+ const currentEnergy = targetBoss.energy;
3036
+ const maxEnergy = getMaxEnergyByName(targetBoss.name);
3037
+ const energyPercent = currentEnergy / maxEnergy;
3038
+ if (energyPercent < 0.3) {
3039
+ return null;
3040
+ }
3041
+ const coldLayers = targetBoss.coldLayers || 0;
3042
+ const baseChance = 0.55;
3043
+ const coldPenalty = coldLayers * 0.05;
3044
+ const immuneChance = Math.max(baseChance - coldPenalty, 0.05);
3045
+ isImmune = Math.random() < immuneChance;
3046
+ const chancePercent = Math.round(immuneChance * 100);
3047
+ messages.push(`⚡ 【电能立场】生效:能量≥30%,免疫概率${chancePercent}%` + (isImmune ? " → 免疫成功" : " → 未免疫"));
3048
+ return { isImmune, messages };
3049
+ }, "handleElectricField"),
3050
+ // 电能冲击波(能量回复)
3051
+ handleElectricShockwave: /* @__PURE__ */ __name(function(targetBoss) {
3052
+ const messages = [];
3053
+ if (!targetBoss.skills.includes("电能冲击波")) {
3054
+ return null;
3055
+ }
3056
+ const currentEnergy = targetBoss.energy || 0;
3057
+ const maxEnergy = getMaxEnergyByName(targetBoss.name);
3058
+ const maxHealAmount = 100;
3059
+ const actualHealAmount = Math.min(maxHealAmount, maxEnergy - currentEnergy);
3060
+ if (actualHealAmount <= 0) {
3061
+ messages.push(`⚡ 【电能冲击波】生效:能量已达上限`);
3056
3062
  return {
3057
- damageMultiplier: -0.5,
3058
- messages: [`🐗 【庞兽狂暴】生效:进入狂暴状态,受到的伤害-50%`]
3063
+ messages,
3064
+ targetUpdates: null
3059
3065
  };
3060
3066
  }
3061
- return null;
3062
- }, "handleGiantRage"),
3063
- // 修改后的灼烧粘液处理
3064
- handleBileStacking: /* @__PURE__ */ __name(async function(ctx, targetBoss, skipStack) {
3065
- if (!targetBoss.skills.includes("灼烧粘液") || skipStack) return null;
3066
- const currentStacks = targetBoss.Skillcountpoints || 0;
3067
- const newStacks = Math.min(currentStacks + 1, 20);
3068
- let messages = [`💧 【灼烧粘液】生效:获得1层"胆汁"(当前${newStacks}层)`];
3069
- if (currentStacks < 10 && newStacks >= 10) {
3070
- if (targetBoss.skills.includes("腐蚀胆汁")) {
3071
- messages.push(`🟢 胆汁达到10层,下次攻击将触发【腐蚀胆汁】`);
3067
+ const targetUpdates = {
3068
+ name: targetBoss.name,
3069
+ updates: {
3070
+ energyChange: maxHealAmount
3071
+ // 回复量
3072
3072
  }
3073
+ };
3074
+ messages.push(`⚡ 【电能冲击波】生效:回复${maxHealAmount}点能量`);
3075
+ return {
3076
+ messages,
3077
+ targetUpdates
3078
+ };
3079
+ }, "handleElectricShockwave"),
3080
+ // 脉冲(生命回复)
3081
+ handlePulse: /* @__PURE__ */ __name(function(targetBoss, activeBosses) {
3082
+ const messages = [];
3083
+ const otherUpdates = [];
3084
+ if (!targetBoss.skills.includes("脉冲")) {
3085
+ return null;
3086
+ }
3087
+ const currentEnergy = targetBoss.energy || 0;
3088
+ const maxEnergy = getMaxEnergyByName(targetBoss.name);
3089
+ const energyPercent = maxEnergy > 0 ? currentEnergy / maxEnergy : 0;
3090
+ if (energyPercent < 0.3) {
3091
+ return null;
3092
+ }
3093
+ const coldLayers = targetBoss.coldLayers || 0;
3094
+ const baseChance = 0.6;
3095
+ const coldPenalty = coldLayers * 0.05;
3096
+ const triggerChance = Math.max(baseChance - coldPenalty, 0.1);
3097
+ if (Math.random() >= triggerChance) {
3098
+ return null;
3073
3099
  }
3074
- if (currentStacks < 20 && newStacks >= 20) {
3075
- if (targetBoss.skills.includes("火焰吐息")) {
3076
- messages.push(`🐲 胆汁达到20层,下次攻击将触发【火焰吐息】`);
3100
+ const survivors = activeBosses.filter((b) => b.isActive);
3101
+ survivors.forEach((survivor) => {
3102
+ const healAmount = 100;
3103
+ if (healAmount > 0) {
3104
+ otherUpdates.push({
3105
+ name: survivor.name,
3106
+ updates: { hpChange: healAmount }
3107
+ });
3108
+ messages.push(`⚡ 【脉冲】生效:为「${survivor.name}」回复${healAmount}点生命值`);
3077
3109
  }
3110
+ });
3111
+ return {
3112
+ messages,
3113
+ otherUpdates
3114
+ };
3115
+ }, "handlePulse"),
3116
+ // 能量黑洞(固定减伤)
3117
+ handleEnergyBlackhole: /* @__PURE__ */ __name(function(targetBoss) {
3118
+ const messages = [];
3119
+ if (!targetBoss.skills.includes("能量黑洞")) return null;
3120
+ messages.push(`⚡ 【能量黑洞】生效:存在「能量黑洞」时,所受伤害降低20%`);
3121
+ return { nerfMultiplier: 0.2, messages };
3122
+ }, "handleEnergyBlackhole"),
3123
+ // 火焰异形(免疫伤害并回复生命值)
3124
+ handleFlameAlien: /* @__PURE__ */ __name(function(targetBoss, weaponName, damage) {
3125
+ const messages = [];
3126
+ let isImmune = false;
3127
+ if (!targetBoss.skills.includes("火焰异形")) {
3128
+ return null;
3078
3129
  }
3079
- await ctx.database.set(
3080
- "ggcevo_boss",
3081
- { name: targetBoss.name },
3082
- { Skillcountpoints: newStacks }
3083
- );
3084
- return { messages };
3085
- }, "handleBileStacking"),
3086
- // 修改后的太阳耀斑处理(每次受击检测)
3087
- handleSolarFlare: /* @__PURE__ */ __name(async function(ctx, targetBoss, weaponName) {
3088
- if (!targetBoss.skills.includes("太阳耀斑") || targetBoss.type !== "主宰") {
3089
- return { immune: false, messages: [] };
3130
+ const isFireDamage = weaponName === "焚烧枪";
3131
+ if (!isFireDamage) {
3132
+ return null;
3090
3133
  }
3134
+ isImmune = true;
3135
+ const healAmount = damage;
3136
+ const targetUpdates = {
3137
+ name: targetBoss.name,
3138
+ updates: {
3139
+ hpChange: healAmount
3140
+ // 生命值变化量
3141
+ }
3142
+ };
3143
+ messages.push(`🔥 【火焰异形】生效:「${targetBoss.boss}」免疫火焰伤害`);
3144
+ messages.push(`🔥 恢复${healAmount}点生命值`);
3145
+ return {
3146
+ isImmune,
3147
+ messages,
3148
+ targetUpdates
3149
+ };
3150
+ }, "handleFlameAlien"),
3151
+ // 庞兽狂暴 - 低生命时减伤
3152
+ handleColossalRampage: /* @__PURE__ */ __name(function(targetBoss) {
3091
3153
  const messages = [];
3092
- let immune = false;
3093
- const minions = await ctx.database.get("ggcevo_boss", {
3094
- groupId: targetBoss.groupId,
3095
- type: "子代",
3096
- isActive: true
3097
- });
3098
- const aliveMinions = minions.filter((m) => m.HP > 0);
3099
- if (aliveMinions.length === 0) {
3100
- const updates = [];
3101
- if (targetBoss.tags.includes("惧寒")) {
3102
- const newTags = targetBoss.tags.filter((tag) => tag !== "惧寒");
3103
- updates.push(
3104
- ctx.database.set(
3105
- "ggcevo_boss",
3106
- { name: targetBoss.name },
3107
- { tags: newTags }
3108
- )
3109
- );
3110
- targetBoss.tags = newTags;
3111
- messages.push(`☀️ 【太阳耀斑】生效:移除"惧寒"标签`);
3112
- }
3113
- if (targetBoss.skills.includes("孤立无援")) {
3114
- const newSkills = targetBoss.skills.filter((skill) => skill !== "孤立无援");
3115
- updates.push(
3116
- ctx.database.set(
3117
- "ggcevo_boss",
3118
- { name: targetBoss.name },
3119
- { skills: newSkills }
3120
- )
3121
- );
3122
- targetBoss.skills = newSkills;
3123
- messages.push(`☀️ 【太阳耀斑】生效:移除"孤立无援"技能`);
3154
+ if (!targetBoss.skills.includes("庞兽狂暴")) {
3155
+ return null;
3156
+ }
3157
+ const maxHP = getMaxHPByName(targetBoss.name);
3158
+ const hpPercent = targetBoss.HP / maxHP;
3159
+ let nerfMultiplier = 0;
3160
+ if (hpPercent < 0.5) {
3161
+ nerfMultiplier = 0.5;
3162
+ messages.push(`💥 【庞兽狂暴】生效:生命值低于50%,狂暴状态下所受伤害降低50%`);
3163
+ }
3164
+ return { nerfMultiplier, messages };
3165
+ }, "handleColossalRampage"),
3166
+ handleBurningSlime: /* @__PURE__ */ __name(function(targetBoss, weaponName) {
3167
+ const messages = [];
3168
+ let targetUpdates = null;
3169
+ let isHighStackHeal = false;
3170
+ if (!targetBoss.skills.includes("灼烧粘液")) {
3171
+ return null;
3172
+ }
3173
+ const currentStacks = targetBoss.skillStacks || 0;
3174
+ const maxStacks = 20;
3175
+ const isFireDamage = weaponName === "焚烧枪";
3176
+ const updates = {};
3177
+ if (!isFireDamage && currentStacks < maxStacks) {
3178
+ updates.skillStacksChanged = 1;
3179
+ const newStacks = currentStacks + 1;
3180
+ messages.push(`🔥 【灼烧粘液】叠加:当前层数${newStacks}/${maxStacks}`);
3181
+ }
3182
+ if (isFireDamage && currentStacks > 0) {
3183
+ const healAmount = currentStacks * 10;
3184
+ updates.hpChange = healAmount;
3185
+ updates.skillStacksChanged = -currentStacks;
3186
+ if (currentStacks >= 10) {
3187
+ isHighStackHeal = true;
3188
+ messages.push(`🔥 【灼烧粘液】强力回复:消耗${currentStacks}层(≥10),回复${healAmount}点生命值!`);
3189
+ } else {
3190
+ messages.push(`🔥 【灼烧粘液】生效:消耗${currentStacks}层,回复${healAmount}点生命值`);
3124
3191
  }
3125
- await Promise.all(updates);
3126
3192
  }
3127
- if (!targetBoss.tags.includes("惧寒") && weaponName === "零度之下") {
3128
- immune = true;
3129
- messages.push(`☀️ 【太阳耀斑】生效:免疫寒冷伤害`);
3193
+ if (Object.keys(updates).length > 0) {
3194
+ targetUpdates = {
3195
+ name: targetBoss.name,
3196
+ updates
3197
+ };
3198
+ }
3199
+ return {
3200
+ messages,
3201
+ targetUpdates,
3202
+ isHighStackHeal
3203
+ // 新增的标记字段
3204
+ };
3205
+ }, "handleBurningSlime"),
3206
+ // 腐蚀胆汁 - 群体回复机制
3207
+ handleCorrosiveBile: /* @__PURE__ */ __name(function(targetBoss, activeBosses) {
3208
+ const messages = [];
3209
+ const otherUpdates = [];
3210
+ let targetUpdates = null;
3211
+ const requiredStacks = 10;
3212
+ if (!targetBoss.skills.includes("腐蚀胆汁")) {
3213
+ return null;
3130
3214
  }
3131
- return { immune, messages };
3132
- }, "handleSolarFlare"),
3133
- // 辅助函数:从配置中获取成员的最大生命值
3134
- getMemberMaxHP: /* @__PURE__ */ __name(function(name2, bossGroup) {
3135
- if (bossGroup.main.name === name2) return bossGroup.main.maxHP;
3136
- for (const minion of bossGroup.minions) {
3137
- if (minion.name === name2) return minion.maxHP;
3215
+ const currentStacks = targetBoss.skillStacks || 0;
3216
+ if (currentStacks < requiredStacks) {
3217
+ return null;
3138
3218
  }
3139
- return null;
3140
- }, "getMemberMaxHP"),
3141
- // 修改后的腐蚀胆汁处理函数
3142
- handleCorrosiveBile: /* @__PURE__ */ __name(async function(ctx, targetBoss, bossGroup, currentHP) {
3143
- if (!targetBoss.skills.includes("腐蚀胆汁")) return null;
3144
- const bileStacks = targetBoss.Skillcountpoints || 0;
3145
- if (bileStacks < 10) return null;
3146
- await ctx.database.set(
3147
- "ggcevo_boss",
3148
- { name: targetBoss.name },
3149
- { Skillcountpoints: 0 }
3219
+ const otherSurvivingBosses = activeBosses.filter(
3220
+ (boss) => boss.isActive
3150
3221
  );
3151
- const messages = [
3152
- `🟢 【腐蚀胆汁】生效:消耗10层"胆汁",治疗所有存活异形`
3153
- ];
3154
- const updates = [];
3155
- let updatedHP = currentHP;
3156
- const groupMembers = await ctx.database.get("ggcevo_boss", {
3157
- groupId: targetBoss.groupId,
3158
- isActive: true,
3159
- HP: { $gt: 0 }
3160
- });
3161
- for (const member of groupMembers) {
3162
- const maxHP = this.getMemberMaxHP(member.name, bossGroup);
3163
- if (!maxHP) continue;
3222
+ targetUpdates = {
3223
+ name: targetBoss.name,
3224
+ updates: {
3225
+ skillStacksChanged: -currentStacks
3226
+ // 重置层数为0
3227
+ }
3228
+ };
3229
+ messages.push(`🧪 【腐蚀胆汁】触发:灼烧粘液达到${currentStacks}层,为所有存活异形回复生命值`);
3230
+ otherSurvivingBosses.forEach((otherBoss) => {
3231
+ const otherName = otherBoss.name;
3164
3232
  const healAmount = 1e3;
3165
- const newHP = Math.min(member.HP + healAmount, maxHP);
3166
- const actualHeal = newHP - member.HP;
3167
- if (member.name === targetBoss.name) {
3168
- updatedHP = newHP;
3169
- }
3170
- updates.push(
3171
- ctx.database.set(
3172
- "ggcevo_boss",
3173
- { name: member.name },
3174
- { HP: newHP }
3175
- )
3176
- );
3177
- messages.push(`${member.name} 回复${actualHeal}点生命值`);
3178
- }
3179
- await Promise.all(updates);
3180
- return { messages, currentHP: updatedHP };
3233
+ if (healAmount > 0) {
3234
+ otherUpdates.push({
3235
+ name: otherName,
3236
+ updates: { hpChange: healAmount }
3237
+ });
3238
+ messages.push(`🧪 【腐蚀胆汁】生效:为「${otherName}」回复${healAmount}点生命值`);
3239
+ }
3240
+ });
3241
+ return {
3242
+ messages,
3243
+ targetUpdates,
3244
+ otherUpdates
3245
+ };
3181
3246
  }, "handleCorrosiveBile"),
3182
- // 修改后的火焰吐息处理函数
3183
- handleFireBreath: /* @__PURE__ */ __name(async function(ctx, targetBoss, bossGroup, currentHP) {
3184
- if (!targetBoss.skills.includes("火焰吐息")) return null;
3185
- const bileStacks = targetBoss.Skillcountpoints || 0;
3186
- if (bileStacks < 20) return null;
3187
- await ctx.database.set(
3188
- "ggcevo_boss",
3189
- { name: targetBoss.name },
3190
- { Skillcountpoints: 0 }
3247
+ // 火焰吐息 - 高级群体回复机制
3248
+ handleFlameBreath: /* @__PURE__ */ __name(function(targetBoss, activeBosses) {
3249
+ const messages = [];
3250
+ const otherUpdates = [];
3251
+ let targetUpdates = null;
3252
+ const requiredStacks = 20;
3253
+ if (!targetBoss.skills.includes("火焰吐息")) {
3254
+ return null;
3255
+ }
3256
+ const currentStacks = targetBoss.skillStacks || 0;
3257
+ if (currentStacks < requiredStacks) {
3258
+ return null;
3259
+ }
3260
+ const otherSurvivingBosses = activeBosses.filter(
3261
+ (boss) => boss.isActive
3191
3262
  );
3192
- const messages = [
3193
- `🐲 【火焰吐息】生效:消耗20层"胆汁",治疗所有存活异形50%的最大生命值`
3194
- ];
3195
- const updates = [];
3196
- let updatedHP = currentHP;
3197
- const groupMembers = await ctx.database.get("ggcevo_boss", {
3198
- groupId: targetBoss.groupId,
3199
- isActive: true,
3200
- HP: { $gt: 0 }
3201
- });
3202
- for (const member of groupMembers) {
3203
- const maxHP = this.getMemberMaxHP(member.name, bossGroup);
3204
- if (!maxHP) continue;
3205
- const healAmount = Math.floor(maxHP * 0.5);
3206
- const newHP = Math.min(member.HP + healAmount, maxHP);
3207
- const actualHeal = newHP - member.HP;
3208
- if (member.name === targetBoss.name) {
3209
- updatedHP = newHP;
3210
- }
3211
- updates.push(
3212
- ctx.database.set(
3213
- "ggcevo_boss",
3214
- { name: member.name },
3215
- { HP: newHP }
3216
- )
3217
- );
3218
- messages.push(`${member.name} 回复${actualHeal}点生命值`);
3219
- }
3220
- await Promise.all(updates);
3221
- return { messages, currentHP: updatedHP };
3222
- }, "handleFireBreath"),
3223
- // 修改后的火焰异形处理
3224
- handleFireEvolution: /* @__PURE__ */ __name(async function(ctx, targetBoss, weaponName, initialDamage, bossGroup) {
3225
- if (targetBoss.skills.includes("火焰异形") && weaponName === "焚烧枪") {
3226
- const maxHP = this.getMemberMaxHP(targetBoss.name, bossGroup);
3227
- if (!maxHP) return null;
3228
- const actualHeal = Math.min(initialDamage, maxHP - targetBoss.HP);
3229
- let updatedHP = Math.min(targetBoss.HP + actualHeal, maxHP);
3230
- const messages = [
3231
- `🔥 【火焰异形】生效:免疫火焰伤害`,
3232
- actualHeal > 0 ? `${targetBoss.name}回复${actualHeal}点生命值` : ""
3233
- ].filter(Boolean);
3234
- const bileResult = await this.handleBileIgnition(ctx, targetBoss, bossGroup, updatedHP);
3235
- if (bileResult) {
3236
- updatedHP = bileResult.newHP;
3237
- messages.push(...bileResult.messages);
3263
+ targetUpdates = {
3264
+ name: targetBoss.name,
3265
+ updates: {
3266
+ skillStacksChanged: -currentStacks
3267
+ // 重置层数为0
3238
3268
  }
3239
- return {
3240
- updatedHP,
3241
- initialDamage: 0,
3242
- // 免疫伤害
3243
- messages,
3244
- bileStacks: bileResult?.bileStacks || 0
3245
- };
3269
+ };
3270
+ messages.push(`🔥 【火焰吐息】触发:灼烧粘液达到${currentStacks}层,为所有存活异形回复20%最大生命值`);
3271
+ otherSurvivingBosses.forEach((otherBoss) => {
3272
+ const otherName = otherBoss.name;
3273
+ const maxHP = getMaxHPByName(otherName);
3274
+ const healAmount = Math.round(maxHP * 0.2);
3275
+ if (healAmount > 0) {
3276
+ otherUpdates.push({
3277
+ name: otherName,
3278
+ updates: { hpChange: healAmount }
3279
+ });
3280
+ messages.push(`🔥 【火焰吐息】生效:为「${otherName}」回复${healAmount}点生命值`);
3281
+ }
3282
+ });
3283
+ return {
3284
+ messages,
3285
+ targetUpdates,
3286
+ otherUpdates
3287
+ };
3288
+ }, "handleFlameBreath"),
3289
+ // 太阳耀斑 - 移除状态并获得免疫
3290
+ handleSolarFlare: /* @__PURE__ */ __name(function(targetBoss, weaponName, damage, activeBosses) {
3291
+ const messages = [];
3292
+ let isImmune = false;
3293
+ let targetUpdates = null;
3294
+ if (!targetBoss.skills.includes("太阳耀斑")) {
3295
+ return null;
3246
3296
  }
3247
- return null;
3248
- }, "handleFireEvolution"),
3249
- // 修改后的灼烧粘液引爆
3250
- handleBileIgnition: /* @__PURE__ */ __name(async function(ctx, targetBoss, bossGroup, updatedHP) {
3251
- if (!targetBoss.skills.includes("腐蚀胆汁")) return null;
3252
- const bileStacks = targetBoss.Skillcountpoints || 0;
3253
- if (bileStacks < 1) return null;
3254
- const theoreticalHeal = bileStacks * 10;
3255
- const maxHP = this.getMemberMaxHP(targetBoss.name, bossGroup);
3256
- const actualHeal = Math.min(theoreticalHeal, maxHP - updatedHP);
3257
- await ctx.database.set(
3258
- "ggcevo_boss",
3259
- { name: targetBoss.name },
3260
- { Skillcountpoints: 0, HP: updatedHP + actualHeal }
3297
+ const hasLivingOffspring = activeBosses.some(
3298
+ (boss) => boss.name !== targetBoss.name && boss.isActive
3261
3299
  );
3300
+ const hasFearColdTag = targetBoss.tags.includes("惧寒") || false;
3301
+ if (hasLivingOffspring || !hasFearColdTag) {
3302
+ return null;
3303
+ }
3304
+ targetUpdates = {
3305
+ name: targetBoss.name,
3306
+ updates: {
3307
+ tagsRemoved: ["惧寒"]
3308
+ }
3309
+ };
3310
+ messages.push(`☀️ 【太阳耀斑】生效:无存活子代,移除「惧寒」状态`);
3311
+ const isColdWeapon = weaponName === "零度之下";
3312
+ if (isColdWeapon) {
3313
+ isImmune = true;
3314
+ messages.push(`☀️ 【太阳耀斑】触发:免疫寒冷伤害`);
3315
+ }
3262
3316
  return {
3263
- messages: [
3264
- `💥 【腐蚀胆汁】引爆:消耗${bileStacks}层"胆汁",${targetBoss.name}回复${actualHeal}点生命值`
3265
- ],
3266
- newHP: updatedHP + actualHeal,
3267
- bileStacks
3317
+ isImmune,
3318
+ messages,
3319
+ targetUpdates
3268
3320
  };
3269
- }, "handleBileIgnition"),
3270
- // 燃烧潜地处理函数
3271
- handleBurningBurrow: /* @__PURE__ */ __name(async function(ctx, targetBoss, currentHP, maxHP) {
3272
- if (!targetBoss.skills.includes("燃烧潜地") || currentHP <= 0 || // 确保血量大于0
3273
- currentHP / maxHP > 0.1) {
3321
+ }, "handleSolarFlare"),
3322
+ // 燃烧潜地 - 低生命回复
3323
+ handleBurningBurrow: /* @__PURE__ */ __name(function(targetBoss) {
3324
+ const messages = [];
3325
+ let targetUpdates = null;
3326
+ if (!targetBoss.skills.includes("燃烧潜地")) {
3274
3327
  return null;
3275
3328
  }
3276
- const healAmount = Math.floor(maxHP * 0.5);
3277
- const updatedHP = Math.min(currentHP + healAmount, maxHP);
3278
- return {
3279
- updatedHP,
3280
- messages: [`🔥 【燃烧潜地】生效:回复50%最大生命值(+${healAmount}HP)`],
3281
- skillUpdates: [{
3282
- name: targetBoss.name,
3283
- remove: ["燃烧潜地"]
3284
- }]
3329
+ const maxHP = getMaxHPByName(targetBoss.name);
3330
+ const currentHP = targetBoss.HP;
3331
+ const hpPercent = currentHP / maxHP;
3332
+ if (hpPercent >= 0.1) {
3333
+ return null;
3334
+ }
3335
+ const healAmount = Math.round(maxHP * 0.5);
3336
+ targetUpdates = {
3337
+ name: targetBoss.name,
3338
+ updates: {
3339
+ skillsRemoved: ["燃烧潜地"],
3340
+ // 移除技能
3341
+ hpChange: healAmount
3342
+ // 回复生命值
3343
+ }
3285
3344
  };
3286
- }, "handleBurningBurrow"),
3287
- // 修改后的炼狱爆弹处理函数(不再使用 async/await)
3288
- handleHellfireBomb: /* @__PURE__ */ __name(function(targetBoss, activeBosses) {
3289
- if (!targetBoss.skills.includes("炼狱爆弹")) return null;
3290
- const bileStacks = targetBoss.Skillcountpoints || 0;
3291
- if (bileStacks < 1) return null;
3292
- const hasLivingMinions = activeBosses.some(
3293
- (boss) => boss.groupId === targetBoss.groupId && boss.type === "子代" && boss.HP > 0
3294
- );
3295
- const baseReductionPerStack = 0.05;
3296
- const bonusReductionPerStack = hasLivingMinions ? 0.05 : 0;
3297
- const totalReductionPerStack = baseReductionPerStack + bonusReductionPerStack;
3298
- const reduction = bileStacks * totalReductionPerStack;
3299
- const messageParts = [
3300
- `💣 【炼狱爆弹】生效:当前${bileStacks}层胆汁,受到的伤害-${(reduction * 100).toFixed(0)}%`
3301
- ];
3345
+ messages.push(`🔥 【燃烧潜地】生效:生命值低于10%,立即回复${healAmount}点生命值(效果移除)`);
3302
3346
  return {
3303
- damageMultiplier: -reduction,
3304
- messages: messageParts
3347
+ messages,
3348
+ targetUpdates
3305
3349
  };
3306
- }, "handleHellfireBomb"),
3307
- // 猎手异形处理(Hunter Alien)
3308
- handleHunterAlien: /* @__PURE__ */ __name(async function(targetBoss, weaponName, activeBosses) {
3309
- if (!targetBoss.skills.includes("猎手异形")) return null;
3310
- if (weaponName === "焚烧枪" || weaponName === "零度之下") {
3311
- return {
3312
- immune: true,
3313
- messages: [`🛡️ 【猎手异形】生效:免疫${weaponName === "焚烧枪" ? "火焰" : "寒冷"}伤害`]
3314
- };
3350
+ }, "handleBurningBurrow"),
3351
+ // 炼狱爆弹 - 基于层数和子代的减伤
3352
+ handleInfernalBomb: /* @__PURE__ */ __name(function(targetBoss, activeBosses) {
3353
+ const messages = [];
3354
+ let nerfMultiplier = 0;
3355
+ if (!targetBoss.skills.includes("炼狱爆弹")) {
3356
+ return null;
3315
3357
  }
3316
- const otherAlive = activeBosses.some(
3317
- (boss) => boss.groupId === targetBoss.groupId && boss.name !== targetBoss.name && boss.HP > 0
3358
+ const currentStacks = targetBoss.skillStacks || 0;
3359
+ const hasLivingOffspring = activeBosses.some(
3360
+ (boss) => boss.name !== targetBoss.name && boss.isActive
3318
3361
  );
3319
- const multiplier = otherAlive ? -0.2 : 0.2;
3362
+ let baseReduction = currentStacks * 0.05;
3363
+ let extraReduction = 0;
3364
+ if (hasLivingOffspring) {
3365
+ extraReduction = currentStacks * 0.05;
3366
+ }
3367
+ nerfMultiplier = baseReduction + extraReduction;
3368
+ if (nerfMultiplier > 0) {
3369
+ const reductionPercent = Math.round(nerfMultiplier * 100);
3370
+ const offspringMsg = hasLivingOffspring ? "(存在子代,额外加成)" : "";
3371
+ messages.push(`💣 【炼狱爆弹】生效:灼烧粘液${currentStacks}层,获得${reductionPercent}%减伤${offspringMsg}`);
3372
+ }
3373
+ return { nerfMultiplier, messages };
3374
+ }, "handleInfernalBomb"),
3375
+ // 猎手异形处理(条件增减伤 + 火焰/寒冷免疫)
3376
+ handleHunterAlien: /* @__PURE__ */ __name(function(targetBoss, activeBosses, weaponName) {
3377
+ const messages = [];
3378
+ let buffMultiplier = 0;
3379
+ let nerfMultiplier = 0;
3380
+ let isImmune = false;
3381
+ if (!targetBoss.skills.includes("猎手异形")) {
3382
+ return null;
3383
+ }
3384
+ const isFireDamage = weaponName === "焚烧枪";
3385
+ const isColdDamage = weaponName === "零度之下";
3386
+ if (isFireDamage || isColdDamage) {
3387
+ isImmune = true;
3388
+ messages.push(`🦖 【猎手异形】生效:免疫${isFireDamage ? "火焰" : "寒冷"}伤害`);
3389
+ }
3390
+ const otherLivingAliens = activeBosses.filter(
3391
+ (boss) => boss.name !== targetBoss.name && boss.isActive
3392
+ ).length;
3393
+ if (otherLivingAliens > 0) {
3394
+ nerfMultiplier = 0.2;
3395
+ messages.push(`🦖 【猎手异形】生效:存在其他存活异形,所受伤害降低20%`);
3396
+ } else {
3397
+ buffMultiplier = 0.2;
3398
+ messages.push(`🦖 【猎手异形】生效:无其他存活异形,所受伤害提升20%`);
3399
+ }
3320
3400
  return {
3321
- damageMultiplier: multiplier,
3322
- messages: [
3323
- `🕵️ 【猎手异形】生效:${otherAlive ? "有其他存活异形,受到的伤害-20%" : "无其他存活异形,受到的伤害+20%"}`
3324
- ]
3401
+ buffMultiplier,
3402
+ nerfMultiplier,
3403
+ isImmune,
3404
+ messages
3325
3405
  };
3326
3406
  }, "handleHunterAlien"),
3327
- // 狂暴处理(Rage)
3328
- handleRage: /* @__PURE__ */ __name(function(targetBoss, currentHP, maxHP) {
3329
- if (!targetBoss.skills.includes("狂暴")) return null;
3330
- if (currentHP / maxHP < 0.5) {
3331
- return {
3332
- damageMultiplier: -0.5,
3333
- messages: [`🔥 【狂暴】生效:血量低于50%,受到的伤害-50%`]
3334
- };
3407
+ // 狂暴处理(低生命减伤)
3408
+ handleRampage: /* @__PURE__ */ __name(function(targetBoss) {
3409
+ const messages = [];
3410
+ let nerfMultiplier = 0;
3411
+ if (!targetBoss.skills.includes("狂暴")) {
3412
+ return null;
3335
3413
  }
3336
- return null;
3337
- }, "handleRage"),
3338
- // 伪装处理(Disguise)
3339
- handleDisguise: /* @__PURE__ */ __name(async function(ctx, targetBoss, weaponName, initialDamage) {
3340
- if (!targetBoss.skills.includes("伪装")) return null;
3414
+ const maxHP = getMaxHPByName(targetBoss.name);
3415
+ const currentHP = targetBoss.HP;
3416
+ if (currentHP < maxHP * 0.5) {
3417
+ nerfMultiplier = 0.5;
3418
+ messages.push(`💥 【狂暴】生效:生命值低于50%,进入狂暴状态,所受伤害降低50%`);
3419
+ }
3420
+ return { nerfMultiplier, messages };
3421
+ }, "handleRampage"),
3422
+ // 伪装处理(记录武器并触发减伤)
3423
+ handleDisguise: /* @__PURE__ */ __name(function(targetBoss, weaponName) {
3341
3424
  const messages = [];
3342
- let damageMultiplier = 0;
3343
- let recordWeapon = initialDamage > 0;
3344
- if (targetBoss.lastWeaponName === weaponName) {
3345
- damageMultiplier = -0.8;
3346
- messages.push(`🎭 【伪装】生效:已适应武器【${weaponName}】,本次受到的伤害-80%`);
3425
+ let nerfMultiplier = 0;
3426
+ let targetUpdates = null;
3427
+ if (!targetBoss.skills.includes("伪装")) {
3428
+ return null;
3347
3429
  }
3348
- if (recordWeapon) {
3349
- await ctx.database.set(
3350
- "ggcevo_boss",
3351
- { name: targetBoss.name },
3352
- { lastWeaponName: weaponName }
3353
- );
3354
- messages.push(`🎭 【伪装】生效:记录新武器【${weaponName}】`);
3430
+ const lastWeapon = targetBoss.lastWeaponName || null;
3431
+ if (lastWeapon && lastWeapon === weaponName) {
3432
+ nerfMultiplier = 0.8;
3433
+ messages.push(`🎭 【伪装】生效:已适应武器「${weaponName}」,本次伤害降低80%`);
3434
+ } else {
3435
+ targetUpdates = {
3436
+ name: targetBoss.name,
3437
+ updates: {
3438
+ lastWeaponName: weaponName
3439
+ // 记录当前武器
3440
+ }
3441
+ };
3442
+ messages.push(`🎭 【伪装】生效:记录新武器「${weaponName}」,下次同武器攻击伤害降低80%`);
3355
3443
  }
3356
3444
  return {
3357
- damageMultiplier,
3358
- messages
3445
+ nerfMultiplier,
3446
+ messages,
3447
+ targetUpdates
3359
3448
  };
3360
3449
  }, "handleDisguise"),
3361
- // 致命一击处理(Critical Hit)
3362
- handleCriticalHit: /* @__PURE__ */ __name(function(targetBoss, initialDamage) {
3363
- if (!targetBoss.skills.includes("致命一击") || initialDamage === 0) return null;
3364
- if (Math.random() * 100 < 5) {
3365
- return {
3366
- immune: true,
3367
- messages: ["💥 【致命一击】生效:免疫本次伤害"]
3368
- };
3450
+ // 致命一击处理(概率免疫伤害)
3451
+ handleDeadlyHit: /* @__PURE__ */ __name(function(targetBoss) {
3452
+ const messages = [];
3453
+ let isImmune = false;
3454
+ if (!targetBoss.skills.includes("致命一击")) {
3455
+ return null;
3369
3456
  }
3370
- return null;
3371
- }, "handleCriticalHit"),
3372
- // 破甲模块效果处理
3373
- handleCorrosionModule: /* @__PURE__ */ __name((installedMods) => {
3374
- if (!installedMods) return 0;
3375
- return installedMods.includes("破甲模块") ? 0.2 : 0;
3376
- }, "handleCorrosionModule"),
3377
- // 粒子相位枪效果处理
3378
- handleParticlePhaseEffect: /* @__PURE__ */ __name((targetBoss, weaponName) => {
3379
- if (!targetBoss || weaponName !== "粒子相位枪") return 0;
3380
- return targetBoss.tags.includes("护盾") ? 0.5 : 0;
3381
- }, "handleParticlePhaseEffect"),
3382
- // 修改后的无视减伤处理函数
3383
- handleIgnoreReductionEffects: /* @__PURE__ */ __name(async (ctx, handle, weaponName, targetBoss, nerfMultiplier) => {
3384
- if (nerfMultiplier >= 0) return null;
3385
- const ignoreEffects = [];
3386
- let messages = [];
3387
- if (weaponName === "光剑") {
3388
- ignoreEffects.push(1);
3389
- messages.push(`⚔️ 【光剑】武器效果:无视目标100%减伤效果`);
3390
- } else if (weaponName === "M4AE脉冲步枪") {
3391
- ignoreEffects.push(0.8);
3392
- messages.push(`🔫 【M4AE脉冲步枪】武器效果:无视目标80%减伤效果`);
3457
+ if (Math.random() < 0.05) {
3458
+ isImmune = true;
3459
+ messages.push(`💀 【致命一击】生效:5%概率免疫本次伤害`);
3393
3460
  }
3394
- if (weaponName !== "光剑" && weaponName !== "M4AE脉冲步枪") {
3395
- const particleEffect = PassiveHandler.handleParticlePhaseEffect(targetBoss, weaponName);
3396
- if (particleEffect > 0) {
3397
- ignoreEffects.push(particleEffect);
3398
- messages.push(`⚡ 【粒子相位枪】武器效果:无视护盾目标${particleEffect * 100}%减伤效果`);
3399
- }
3400
- const weaponConfigData = weaponConfig[weaponName];
3401
- if (weaponConfigData) {
3402
- const [equippedWeapon] = await ctx.database.get("ggcevo_equipment", {
3403
- weaponId: weaponConfigData.id,
3404
- handle,
3405
- equipped: true
3406
- });
3407
- if (equippedWeapon?.installedMods?.includes("破甲模块")) {
3408
- const corrosionEffect = 0.2;
3409
- ignoreEffects.push(corrosionEffect);
3410
- messages.push(`⚡ 【破甲模块】生效:无视目标${corrosionEffect * 100}%减伤效果`);
3411
- }
3412
- }
3461
+ return { isImmune, messages };
3462
+ }, "handleDeadlyHit"),
3463
+ /** 星界之风处理(概率群体回复)- 修正版 */
3464
+ handleAstralWind: /* @__PURE__ */ __name(function(targetBoss, activeBosses, doubleChance) {
3465
+ const messages = [];
3466
+ const otherUpdates = [];
3467
+ const baseHealAmount = 200;
3468
+ if (!targetBoss.skills.includes("星界之风")) {
3469
+ return null;
3413
3470
  }
3414
- try {
3415
- const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
3416
- if (careerData?.group === "辛迪加海盗") {
3417
- const [radarMask] = await ctx.database.get("ggcevo_warehouse", {
3418
- handle,
3419
- itemId: 6
3420
- // 雷达面罩ID
3471
+ const triggerProbability = doubleChance ? 0.1 : 0.05;
3472
+ if (Math.random() >= triggerProbability) {
3473
+ return null;
3474
+ }
3475
+ const survivingBosses = activeBosses.filter((boss) => boss.isActive);
3476
+ survivingBosses.forEach((boss) => {
3477
+ const bossName = boss.name;
3478
+ if (baseHealAmount > 0) {
3479
+ otherUpdates.push({
3480
+ name: bossName,
3481
+ updates: { hpChange: baseHealAmount }
3421
3482
  });
3422
- if (radarMask && radarMask.quantity > 0) {
3423
- const radarEffect = 0.1;
3424
- ignoreEffects.push(radarEffect);
3425
- messages.push(`🛰️ 【雷达面罩】生效:无视目标${radarEffect * 100}%减伤效果`);
3426
- }
3427
- if (careerData?.career === "猩红杀手" && weaponName === "侦察步枪") {
3428
- const scarletEffect = 0.2;
3429
- ignoreEffects.push(scarletEffect);
3430
- messages.push(`🎯 【猩红杀手】职业效果:无视目标${scarletEffect * 100}%减伤效果`);
3431
- }
3432
3483
  }
3433
- } catch (error) {
3434
- console.error("出错:", error);
3484
+ messages.push(`🌬️ 【星界之风】为「${bossName}」回复${baseHealAmount}点生命值`);
3485
+ });
3486
+ if (doubleChance) {
3487
+ messages.unshift(`🌬️ 【星界之风】生效:心灵狂热状态(触发概率10%)为所有存活异形回复生命值`);
3488
+ } else {
3489
+ messages.unshift(`🌬️ 【星界之风】生效:5%概率触发,为所有存活异形回复生命值`);
3490
+ }
3491
+ return {
3492
+ messages,
3493
+ otherUpdates
3494
+ };
3495
+ }, "handleAstralWind"),
3496
+ /** 心灵狂热处理(低生命减伤和概率强化)- 修正版 */
3497
+ handleMindFrenzy: /* @__PURE__ */ __name(function(targetBoss) {
3498
+ const messages = [];
3499
+ let nerfMultiplier = 0;
3500
+ let doubleAstralWind = false;
3501
+ if (!targetBoss.skills.includes("心灵狂热")) {
3502
+ return null;
3435
3503
  }
3436
- if (ignoreEffects.length === 0) {
3504
+ const maxHP = getMaxHPByName(targetBoss.name);
3505
+ const hpPercent = targetBoss.HP / maxHP;
3506
+ if (hpPercent < 0.5) {
3507
+ nerfMultiplier = 0.2;
3508
+ doubleAstralWind = true;
3509
+ messages.push(`🧠 【心灵狂热】生效:生命值低于50%,进入心灵狂热状态,所受伤害降低20%,星界之风触发概率翻倍`);
3510
+ }
3511
+ return { nerfMultiplier, doubleAstralWind, messages };
3512
+ }, "handleMindFrenzy"),
3513
+ /** 宇宙能量处理(伤害值转能量/生命) */
3514
+ handleCosmicEnergy: /* @__PURE__ */ __name(function(targetBoss, activeBosses, damage) {
3515
+ const messages = [];
3516
+ let targetUpdates = null;
3517
+ if (!targetBoss.skills.includes("宇宙能量")) {
3437
3518
  return null;
3438
3519
  }
3439
- const totalIgnoreRate = Math.min(1, ignoreEffects.reduce((sum, rate) => sum + rate, 0));
3520
+ const maxEnergy = getMaxEnergyByName(targetBoss.name);
3521
+ const currentEnergy = targetBoss.energy || 0;
3522
+ const energyToAdd = damage;
3523
+ const updates = {};
3524
+ if (currentEnergy + energyToAdd <= maxEnergy) {
3525
+ updates.energyChange = energyToAdd;
3526
+ messages.push(`🌌 【宇宙能量】生效:吸收伤害值,获得${energyToAdd}点能量`);
3527
+ } else {
3528
+ const energyGained = maxEnergy - currentEnergy;
3529
+ updates.energyChange = energyGained;
3530
+ const overflowHeal = currentEnergy + energyToAdd - maxEnergy;
3531
+ updates.hpChange = overflowHeal;
3532
+ messages.push(`🌌 【宇宙能量】生效:获得${energyGained}点能量,${overflowHeal}点溢出伤害转为生命回复`);
3533
+ }
3534
+ targetUpdates = {
3535
+ name: targetBoss.name,
3536
+ updates
3537
+ };
3440
3538
  return {
3441
- ignoreRate: totalIgnoreRate,
3442
- messages
3539
+ messages,
3540
+ targetUpdates
3443
3541
  };
3444
- }, "handleIgnoreReductionEffects"),
3445
- // 在PassiveHandler对象中添加处理脉冲扰乱枪效果的方法
3446
- handlePulseDisruptor: /* @__PURE__ */ __name(async function(ctx, targetBoss, weaponName) {
3447
- if (weaponName !== "脉冲扰乱枪") {
3542
+ }, "handleCosmicEnergy"),
3543
+ /** 复苏处理(免疫死亡并回复) */
3544
+ handleRevival: /* @__PURE__ */ __name(function(targetBoss) {
3545
+ const messages = [];
3546
+ if (!targetBoss.skills.includes("复苏")) {
3448
3547
  return null;
3449
3548
  }
3450
- const currentSkillCount = targetBoss.Skillcountpoints || 0;
3451
- let pulseApplied = false;
3452
- if (currentSkillCount <= 0) {
3549
+ if (targetBoss.HP !== 0) {
3453
3550
  return null;
3454
3551
  }
3455
- const newCount = Math.max(0, currentSkillCount - 2);
3456
- await ctx.database.set(
3457
- "ggcevo_boss",
3458
- { name: targetBoss.name },
3459
- { Skillcountpoints: newCount }
3460
- );
3461
- pulseApplied = true;
3552
+ const maxHP = getMaxHPByName(targetBoss.name);
3553
+ const maxEnergy = getMaxEnergyByName(targetBoss.name);
3554
+ const healAmount = Math.round(maxHP * 0.5);
3555
+ const energyGain = maxEnergy;
3556
+ const targetUpdates = {
3557
+ name: targetBoss.name,
3558
+ updates: {
3559
+ hpChange: healAmount,
3560
+ // 回复50%最大生命值
3561
+ energyChange: energyGain,
3562
+ // 回复100%能量
3563
+ skillsRemoved: ["复苏"],
3564
+ // 移除复苏技能
3565
+ skillsAdded: ["灵能构造炉"]
3566
+ // 添加新技能
3567
+ }
3568
+ };
3569
+ messages.push(`🔥 【复苏】生效:免疫致命伤害`);
3570
+ messages.push(`🔥 回复${healAmount}点生命值和${energyGain}点能量`);
3571
+ messages.push(`🔥 获得【灵能构造炉】技能,复苏效果移除`);
3462
3572
  return {
3463
- messages: [
3464
- `⚡ 【脉冲扰乱枪】武器效果:使${targetBoss.name}的技能层数减少2层`
3465
- ],
3466
- pulseApplied
3573
+ messages,
3574
+ targetUpdates
3467
3575
  };
3468
- }, "handlePulseDisruptor"),
3469
- // === 星界之风 ===
3470
- handleStellarWind: /* @__PURE__ */ __name(async (ctx, targetBoss, initialDamage, currentHP, maxHP, activeBosses, bossGroup) => {
3471
- if (!targetBoss.skills.includes("星界之风") || initialDamage === 0) return null;
3472
- let baseChance = 5;
3473
- const hasPsychicFrenzy = targetBoss.skills.includes("心灵狂热");
3474
- const isInFrenzy = targetBoss.HP / maxHP < 0.5;
3475
- if (hasPsychicFrenzy && isInFrenzy) {
3476
- baseChance *= 2;
3477
- }
3478
- let lightbladeStacks = 0;
3479
- if (targetBoss.skills.includes("闪电冲锋")) {
3480
- }
3481
- const triggerChance = baseChance + lightbladeStacks;
3482
- if (Math.random() * 100 < triggerChance) {
3483
- const groupMembers = activeBosses.filter(
3484
- (b) => b.groupId === targetBoss.groupId && b.HP > 0
3485
- );
3486
- const updates = [];
3487
- const messages = [`🌠 【星界之风】生效:治疗所有存活异形`];
3488
- let updatedHP = currentHP;
3489
- for (const member of groupMembers) {
3490
- const memberConfig = PassiveHandler.getMemberConfig(member.name, bossGroup);
3491
- if (!memberConfig) continue;
3492
- const maxMemberHP = memberConfig.maxHP;
3493
- const healAmount = 200;
3494
- const actualHeal = Math.min(healAmount, maxMemberHP - member.HP);
3495
- if (actualHeal <= 0) continue;
3496
- const newHP = member.HP + actualHeal;
3497
- updates.push(
3498
- ctx.database.set(
3499
- "ggcevo_boss",
3500
- { name: member.name },
3501
- { HP: newHP }
3502
- )
3503
- );
3504
- messages.push(`${member.name} +${actualHeal}HP`);
3505
- if (member.name === targetBoss.name) {
3506
- updatedHP = newHP;
3507
- }
3508
- }
3509
- if (updates.length === 0) {
3510
- return null;
3511
- }
3512
- await Promise.all(updates);
3513
- return { messages, updatedHP };
3576
+ }, "handleRevival"),
3577
+ /** 光影之刃处理(层数叠加) */
3578
+ handleBladeOfLight: /* @__PURE__ */ __name(function(targetBoss) {
3579
+ const messages = [];
3580
+ let targetUpdates = null;
3581
+ const maxStacks = 50;
3582
+ if (!targetBoss.skills.includes("光影之刃")) {
3583
+ return null;
3514
3584
  }
3515
- return null;
3516
- }, "handleStellarWind"),
3517
- // === 心灵狂热 ===
3518
- handlePsychicFrenzy: /* @__PURE__ */ __name(function(targetBoss, currentHP, maxHP) {
3519
- if (!targetBoss.skills.includes("心灵狂热")) return null;
3520
- if (currentHP / maxHP < 0.5) {
3585
+ const currentStacks = targetBoss.skillStacks || 0;
3586
+ if (currentStacks >= maxStacks) {
3587
+ messages.push(`✨ 【光影之刃】已达到最大层数(${maxStacks})`);
3521
3588
  return {
3522
- damageMultiplier: -0.2,
3523
- // 受到的伤害-20%
3524
- messages: [
3525
- `🌀 【心灵狂热】生效:进入心灵狂热状态,受到的伤害-20%`
3526
- ]
3589
+ messages,
3590
+ targetUpdates: null
3527
3591
  };
3528
3592
  }
3529
- return null;
3530
- }, "handlePsychicFrenzy"),
3531
- // === 宇宙能量 ===
3532
- handleCosmicEnergy: /* @__PURE__ */ __name(async (ctx, targetBoss, initialDamage, bossGroup) => {
3533
- if (!targetBoss.skills.includes("宇宙能量")) return null;
3534
- const maxEnergy = 1e3;
3535
- const currentEnergy = targetBoss.energy || 0;
3536
- const availableSpace = maxEnergy - currentEnergy;
3537
- const energyToAdd = Math.min(initialDamage, availableSpace);
3538
- const newEnergy = currentEnergy + energyToAdd;
3539
- let healAmount = 0;
3540
- let messages = [];
3541
- if (energyToAdd > 0) {
3542
- messages.push(`获得${energyToAdd}点能量`);
3543
- }
3544
- if (newEnergy >= maxEnergy) {
3545
- const overflow = initialDamage - energyToAdd;
3546
- if (overflow > 0) {
3547
- const memberConfig = PassiveHandler.getMemberConfig(targetBoss.name, bossGroup);
3548
- const maxHP = memberConfig?.maxHP || 0;
3549
- if (maxHP > 0) {
3550
- healAmount = Math.min(overflow, maxHP - targetBoss.HP);
3551
- messages.push(`能量溢出回复${healAmount}点生命值`);
3552
- }
3593
+ targetUpdates = {
3594
+ name: targetBoss.name,
3595
+ updates: {
3596
+ skillStacksChanged: 1
3553
3597
  }
3598
+ };
3599
+ const newStacks = currentStacks + 1;
3600
+ messages.push(`✨ 【光影之刃】叠加:当前${newStacks}/${maxStacks}层`);
3601
+ return {
3602
+ messages,
3603
+ targetUpdates
3604
+ };
3605
+ }, "handleBladeOfLight"),
3606
+ /** 远古预兆处理(概率免疫能量伤害)- 增加boost参数 */
3607
+ handleAncientOmen: /* @__PURE__ */ __name(function(targetBoss, weaponData, boost = 0) {
3608
+ const messages = [];
3609
+ let isImmune = false;
3610
+ let targetUpdates = null;
3611
+ if (!targetBoss.skills.includes("远古预兆")) {
3612
+ return null;
3554
3613
  }
3555
- if (energyToAdd === 0 && healAmount === 0) {
3614
+ if (weaponData.type !== "能量武器") {
3556
3615
  return null;
3557
3616
  }
3558
- await ctx.database.set(
3559
- "ggcevo_boss",
3560
- { name: targetBoss.name },
3561
- { energy: newEnergy }
3562
- );
3563
- return {
3564
- messages: [`🌌 【宇宙能量】生效:${messages.join(",")}`],
3565
- healAmount
3617
+ const baseProbability = 0.01;
3618
+ const actualProbability = Math.min(baseProbability + boost, 1);
3619
+ if (Math.random() >= actualProbability) {
3620
+ return null;
3621
+ }
3622
+ isImmune = true;
3623
+ const energyGained = 100;
3624
+ targetUpdates = {
3625
+ name: targetBoss.name,
3626
+ updates: {
3627
+ energyChange: energyGained
3628
+ // 回复100点能量
3629
+ }
3566
3630
  };
3567
- }, "handleCosmicEnergy"),
3568
- // === 光影之刃 ===
3569
- handleLightblade: /* @__PURE__ */ __name(async (ctx, targetBoss) => {
3570
- if (!targetBoss.skills.includes("光影之刃")) return null;
3571
- const currentStacks = targetBoss.Skillcountpoints || 0;
3572
- const newStacks = currentStacks + 1;
3573
- await ctx.database.set(
3574
- "ggcevo_boss",
3575
- { name: targetBoss.name },
3576
- { Skillcountpoints: newStacks }
3577
- );
3631
+ messages.push(`🔮 【远古预兆】生效:${(actualProbability * 100).toFixed(2)}%概率免疫能量武器伤害`);
3632
+ messages.push(`🔮 回复${energyGained}点能量`);
3578
3633
  return {
3579
- messages: [`✨ 【光影之刃】生效:获得1层“光影之刃”`]
3634
+ isImmune,
3635
+ messages,
3636
+ targetUpdates
3580
3637
  };
3581
- }, "handleLightblade"),
3582
- // === 远古预兆 ===
3583
- handleAncientOmen: /* @__PURE__ */ __name(async (ctx, targetBoss) => {
3584
- if (!targetBoss.skills.includes("远古预兆")) return null;
3585
- let lightbladeStacks = 0;
3586
- if (targetBoss.skills.includes("闪电冲锋")) {
3587
- lightbladeStacks = targetBoss?.Skillcountpoints || 0;
3588
- }
3589
- const totalChance = 1 + lightbladeStacks * 0.5;
3590
- if (Math.random() * 100 < totalChance) {
3591
- const maxEnergy = 1e3;
3592
- const currentEnergy = targetBoss.energy || 0;
3593
- const newEnergy = Math.min(currentEnergy + 100, maxEnergy);
3594
- await ctx.database.set(
3595
- "ggcevo_boss",
3596
- { name: targetBoss.name },
3597
- { energy: newEnergy }
3598
- );
3599
- return {
3600
- immune: true,
3601
- messages: [
3602
- `🔮 【远古预兆】生效:免疫此次伤害,并且回复100点能量`
3603
- ]
3604
- };
3605
- }
3606
- return null;
3607
3638
  }, "handleAncientOmen"),
3608
- // === 超视距穿梭 ===
3609
- handleHyperspaceSkip: /* @__PURE__ */ __name(function(targetBoss) {
3610
- if (!targetBoss.skills.includes("超视距穿梭")) return null;
3611
- const maxEnergy = 1e3;
3639
+ /** 闪电冲锋处理(提升其他技能概率) - 修正版 */
3640
+ handleLightningCharge: /* @__PURE__ */ __name(function(targetBoss) {
3641
+ const messages = [];
3642
+ let ancientOmenBoost = 0;
3643
+ let psychicForgeBoost = 0;
3644
+ if (!targetBoss.skills.includes("闪电冲锋")) {
3645
+ return null;
3646
+ }
3647
+ const lightBladeStacks = targetBoss.skillStacks || 0;
3648
+ const boostPerStack = 5e-3;
3649
+ const totalBoost = lightBladeStacks * boostPerStack;
3650
+ ancientOmenBoost = totalBoost;
3651
+ psychicForgeBoost = totalBoost;
3652
+ if (totalBoost > 0) {
3653
+ messages.push(`⚡ 【闪电冲锋】生效:每层光影之刃提升0.5%概率`);
3654
+ messages.push(` → 当前${lightBladeStacks}层,远古预兆+${(ancientOmenBoost * 100).toFixed(1)}%,灵能构造炉+${(psychicForgeBoost * 100).toFixed(1)}%`);
3655
+ }
3656
+ return { ancientOmenBoost, psychicForgeBoost, messages };
3657
+ }, "handleLightningCharge"),
3658
+ /** 超视距穿梭处理(层数相关伤害调整) */
3659
+ handleHyperRangeShift: /* @__PURE__ */ __name(function(targetBoss) {
3660
+ const messages = [];
3661
+ let nerfMultiplier = 0;
3662
+ let buffMultiplier = 0;
3663
+ if (!targetBoss.skills.includes("超视距穿梭")) {
3664
+ return null;
3665
+ }
3612
3666
  const currentEnergy = targetBoss.energy || 0;
3613
- const lightbladeStacks = targetBoss.Skillcountpoints || 0;
3614
- let reduction = 0;
3615
- let increase = 0;
3667
+ const maxEnergy = getMaxEnergyByName(targetBoss.name);
3668
+ const energyPercent = currentEnergy / maxEnergy;
3669
+ if (energyPercent >= 0.6) {
3670
+ nerfMultiplier = targetBoss.skillStacks * 0.1;
3671
+ messages.push(`🚀 【超视距穿梭】生效:高能量状态(≥60%),受到的伤害-${(nerfMultiplier * 100).toFixed(0)}%`);
3672
+ } else if (energyPercent >= 0.3) {
3673
+ nerfMultiplier = targetBoss.skillStacks * 0.05;
3674
+ messages.push(`🚀 【超视距穿梭】生效:中能量状态(≥30%),受到的伤害-${(nerfMultiplier * 100).toFixed(0)}%`);
3675
+ } else if (energyPercent <= 0.1) {
3676
+ buffMultiplier = targetBoss.skillStacks * 0.05;
3677
+ messages.push(`🚀 【超视距穿梭】生效:低能量状态(≤10%),受到的伤害+${(buffMultiplier * 100).toFixed(0)}%`);
3678
+ }
3679
+ return { nerfMultiplier, buffMultiplier, messages };
3680
+ }, "handleHyperRangeShift"),
3681
+ /** 灵能构造炉处理(随机获得技能)- 增加boost参数 */
3682
+ handlePsychicForge: /* @__PURE__ */ __name(function(targetBoss, boost = 0) {
3616
3683
  const messages = [];
3617
- if (currentEnergy <= maxEnergy * 0.1) {
3618
- increase = lightbladeStacks * 0.05;
3619
- messages.push(`能量≤10%:受到的伤害+${(increase * 100).toFixed(0)}%`);
3620
- } else if (currentEnergy >= maxEnergy * 0.6) {
3621
- reduction = lightbladeStacks * 0.1;
3622
- messages.push(`能量≥60%:受到的伤害-${(reduction * 100).toFixed(0)}%`);
3623
- } else if (currentEnergy >= maxEnergy * 0.3) {
3624
- reduction = lightbladeStacks * 0.05;
3625
- messages.push(`能量≥30%:受到的伤害-${(reduction * 100).toFixed(0)}%`);
3626
- }
3627
- if (reduction > 0 || increase > 0) {
3628
- return {
3629
- reduction,
3630
- increase,
3631
- messages: [
3632
- `🚀 【超视距穿梭】生效:${messages.join(" | ")} (当前${lightbladeStacks}层光影之刃)`
3633
- ]
3634
- };
3684
+ let newSkill = null;
3685
+ let targetUpdates = null;
3686
+ const possibleSkills = [
3687
+ "天启超载护盾",
3688
+ "塌缩脉冲",
3689
+ "地毯式轰炸",
3690
+ "轰炸引导"
3691
+ ];
3692
+ if (!targetBoss.skills.includes("灵能构造炉")) {
3693
+ return null;
3635
3694
  }
3636
- return null;
3637
- }, "handleHyperspaceSkip"),
3638
- // === 复苏 ===
3639
- handleRevival: /* @__PURE__ */ __name(async function(ctx, targetBoss, currentHP, maxHP) {
3640
- if (!targetBoss.skills.includes("复苏") || currentHP > 0) return null;
3641
- const updatedHP = maxHP * 0.5;
3642
- const maxEnergy = 1e3;
3643
- let newSkills = targetBoss.skills;
3644
- if (!newSkills.includes("灵能构造炉")) {
3645
- newSkills = [...newSkills, "灵能构造炉"];
3646
- }
3647
- newSkills = newSkills.filter((skill) => skill !== "复苏");
3648
- await ctx.database.set(
3649
- "ggcevo_boss",
3650
- { name: targetBoss.name },
3651
- {
3652
- HP: updatedHP,
3653
- energy: maxEnergy,
3654
- skills: newSkills
3655
- }
3695
+ const baseProbability = 0.05;
3696
+ const actualProbability = Math.min(baseProbability + boost, 1);
3697
+ if (Math.random() >= actualProbability) {
3698
+ return null;
3699
+ }
3700
+ const availableSkills = possibleSkills.filter(
3701
+ (skill) => !targetBoss.skills.includes(skill)
3656
3702
  );
3703
+ if (availableSkills.length === 0) {
3704
+ return null;
3705
+ }
3706
+ newSkill = availableSkills[Math.floor(Math.random() * availableSkills.length)];
3707
+ targetUpdates = {
3708
+ name: targetBoss.name,
3709
+ updates: {
3710
+ skillsAdded: [newSkill]
3711
+ }
3712
+ };
3713
+ messages.push(`⚙️ 【灵能构造炉】生效:${(actualProbability * 100).toFixed(2)}%概率获得新技能「${newSkill}」`);
3657
3714
  return {
3658
- updatedHP,
3659
- messages: [
3660
- `🔥 【复苏】生效:免于死亡,回复自身50%的最大生命值和100%的“能量”,并且获得新技能【灵能构造炉】`
3661
- ]
3715
+ messages,
3716
+ newSkill,
3717
+ targetUpdates
3662
3718
  };
3663
- }, "handleRevival"),
3664
- // === 灵能构造炉 ===
3665
- handleConstructor: /* @__PURE__ */ __name(async function(ctx, targetBoss) {
3666
- if (!targetBoss.skills.includes("灵能构造炉")) return null;
3667
- const allSkills = ["天启超载护盾", "塌缩脉冲", "地毯式轰炸", "轰炸引导"];
3668
- const hasAllSkills = allSkills.every((skill) => targetBoss.skills.includes(skill));
3669
- if (hasAllSkills) {
3670
- const newSkills = targetBoss.skills.filter((skill) => skill !== "灵能构造炉");
3671
- await ctx.database.set(
3672
- "ggcevo_boss",
3673
- { name: targetBoss.name },
3674
- { skills: newSkills }
3675
- );
3676
- return {
3677
- messages: [
3678
- `⚙️ 【灵能构造炉】生效:所有技能已获取完毕,此技能已移除`
3679
- ]
3680
- };
3681
- }
3682
- let lightbladeStacks = 0;
3683
- if (targetBoss.skills.includes("闪电冲锋")) {
3684
- lightbladeStacks = targetBoss.Skillcountpoints || 0;
3719
+ }, "handlePsychicForge"),
3720
+ /** 天启超载护盾处理(层数相关群体回复) */
3721
+ handleOverdriveShield: /* @__PURE__ */ __name(function(targetBoss, activeBosses) {
3722
+ const messages = [];
3723
+ const otherUpdates = [];
3724
+ if (!targetBoss.skills.includes("天启超载护盾")) {
3725
+ return null;
3685
3726
  }
3686
- const totalChance = 5 + lightbladeStacks * 0.5;
3687
- if (Math.random() * 100 < totalChance) {
3688
- const availableSkills = allSkills.filter(
3689
- (skill) => !targetBoss.skills.includes(skill)
3690
- );
3691
- if (availableSkills.length === 0) return null;
3692
- const randomSkill = availableSkills[Math.floor(Math.random() * availableSkills.length)];
3693
- const newSkills = [...targetBoss.skills, randomSkill];
3694
- await ctx.database.set(
3695
- "ggcevo_boss",
3696
- { name: targetBoss.name },
3697
- { skills: newSkills }
3698
- );
3699
- return {
3700
- messages: [
3701
- `⚙️ 【灵能构造炉】生效:获得新技能【${randomSkill}】`
3702
- ]
3703
- };
3727
+ if (Math.random() >= 0.05) {
3728
+ return null;
3704
3729
  }
3705
- return null;
3706
- }, "handleConstructor"),
3707
- // 修改后 - 移除了层数清零操作
3708
- handleTyrsShield: /* @__PURE__ */ __name(async function(ctx, targetBoss, currentHP, activeBosses, bossGroup) {
3709
- if (!targetBoss.skills.includes("天启超载护盾")) return null;
3710
- const lightbladeStacks = targetBoss.Skillcountpoints || 0;
3711
- if (lightbladeStacks === 0) return null;
3712
- const triggerChance = 5;
3713
- if (Math.random() * 100 < triggerChance) {
3714
- const groupMembers = activeBosses.filter(
3715
- (b) => b.groupId === targetBoss.groupId && b.HP > 0
3716
- );
3717
- const healPerStack = 10;
3718
- const totalHeal = lightbladeStacks * healPerStack;
3719
- const updates = [];
3720
- const messages = [`🛡️ 【天启超载护盾】生效:治疗所有存活异形`];
3721
- let updatedHP = currentHP;
3722
- for (const member of groupMembers) {
3723
- const memberConfig = PassiveHandler.getMemberConfig(member.name, bossGroup);
3724
- if (!memberConfig) continue;
3725
- const maxMemberHP = memberConfig.maxHP;
3726
- const actualHeal = Math.min(totalHeal, maxMemberHP - member.HP);
3727
- if (actualHeal <= 0) continue;
3728
- const newHP = member.HP + actualHeal;
3729
- updates.push(
3730
- ctx.database.set(
3731
- "ggcevo_boss",
3732
- { name: member.name },
3733
- { HP: newHP }
3734
- )
3735
- );
3736
- messages.push(`${member.name} +${actualHeal}HP`);
3737
- if (member.name === targetBoss.name) {
3738
- updatedHP = newHP;
3739
- }
3740
- }
3741
- if (updates.length === 0) {
3742
- return null;
3730
+ const baseHealAmount = (targetBoss.skillStacks || 0) * 10;
3731
+ const survivingBosses = activeBosses.filter((boss) => boss.isActive);
3732
+ survivingBosses.forEach((boss) => {
3733
+ const bossName = boss.name;
3734
+ if (baseHealAmount > 0) {
3735
+ otherUpdates.push({
3736
+ name: bossName,
3737
+ updates: { hpChange: baseHealAmount }
3738
+ });
3743
3739
  }
3744
- await Promise.all(updates);
3745
- return {
3746
- messages,
3747
- updatedHP
3748
- // 返回当前目标的新HP(如果被治疗)
3749
- };
3750
- }
3751
- return null;
3752
- }, "handleTyrsShield"),
3753
- // === 塌缩脉冲 ===
3754
- handleCollapsePulse: /* @__PURE__ */ __name(async function(ctx, targetBoss) {
3755
- if (!targetBoss.skills.includes("塌缩脉冲")) return null;
3756
- const triggerChance = 100;
3757
- if (Math.random() * 100 < triggerChance) {
3758
- const currentStacks = targetBoss.Skillcountpoints || 0;
3759
- const newStacks = currentStacks + 1;
3760
- await ctx.database.set(
3761
- "ggcevo_boss",
3762
- { name: targetBoss.name },
3763
- { Skillcountpoints: newStacks }
3764
- );
3765
- return {
3766
- messages: [`💥 【塌缩脉冲】生效:额外获得1层光影之刃`]
3767
- };
3768
- }
3769
- return null;
3770
- }, "handleCollapsePulse"),
3771
- // === 地毯式轰炸 ===
3772
- handleCarpetBombing: /* @__PURE__ */ __name(async function(ctx, targetBoss) {
3773
- if (!targetBoss.skills.includes("地毯式轰炸")) return null;
3774
- const triggerChance = 100;
3740
+ messages.push(`🛡️ 【天启超载护盾】为「${bossName}」回复${baseHealAmount}点生命值`);
3741
+ });
3742
+ messages.unshift(`🛡️ 【天启超载护盾】生效:5%概率触发,为所有存活异形回复生命值`);
3743
+ return {
3744
+ messages,
3745
+ otherUpdates
3746
+ };
3747
+ }, "handleOverdriveShield"),
3748
+ /** 塌缩脉冲处理(额外叠加层数) */
3749
+ handleCollapsingPulse: /* @__PURE__ */ __name(function(targetBoss) {
3775
3750
  const messages = [];
3776
- let damageMultiplier = 0;
3777
- if (Math.random() * 100 < triggerChance) {
3778
- const hasLoneWolf = targetBoss.skills.includes("孤立无援");
3779
- if (hasLoneWolf) {
3780
- const newSkills = targetBoss.skills.filter((skill) => skill !== "孤立无援");
3781
- await ctx.database.set(
3782
- "ggcevo_boss",
3783
- { name: targetBoss.name },
3784
- { skills: newSkills }
3785
- );
3786
- messages.push(`🔥 【地毯式轰炸】生效:移除“孤立无援”`);
3787
- } else {
3788
- }
3789
- damageMultiplier = -1;
3790
- messages.push(`🔥 【地毯式轰炸】生效:我心中的怒火胜过千万个太阳!受到的伤害-100%`);
3751
+ let targetUpdates = null;
3752
+ const maxStacks = 50;
3753
+ if (!targetBoss.skills.includes("塌缩脉冲")) {
3754
+ return null;
3791
3755
  }
3756
+ const currentStacks = targetBoss.skillStacks || 0;
3757
+ if (currentStacks >= maxStacks) {
3758
+ messages.push(`🌀 【塌缩脉冲】生效:层数已达上限(${maxStacks})`);
3759
+ return {
3760
+ messages,
3761
+ targetUpdates: null
3762
+ };
3763
+ }
3764
+ targetUpdates = {
3765
+ name: targetBoss.name,
3766
+ updates: {
3767
+ skillStacksChanged: 1
3768
+ }
3769
+ };
3770
+ const newStacks = currentStacks + 1;
3771
+ messages.push(`🌀 【塌缩脉冲】生效:额外叠加1层光影之刃,当前${newStacks}/${maxStacks}层`);
3792
3772
  return {
3793
3773
  messages,
3794
- damageMultiplier
3774
+ targetUpdates
3795
3775
  };
3776
+ }, "handleCollapsingPulse"),
3777
+ /** 地毯式轰炸处理 */
3778
+ handleCarpetBombing: /* @__PURE__ */ __name(function(targetBoss) {
3779
+ const messages = [];
3780
+ let nerfMultiplier = 0;
3781
+ if (!targetBoss.skills.includes("地毯式轰炸")) {
3782
+ return null;
3783
+ }
3784
+ nerfMultiplier = 1;
3785
+ messages.push(`💣 【地毯式轰炸】生效:获得100%减伤`);
3786
+ return { nerfMultiplier, messages };
3796
3787
  }, "handleCarpetBombing"),
3797
- // 修改后 - 移除了层数清零操作
3798
- handleBombardmentGuidance: /* @__PURE__ */ __name(async function(ctx, targetBoss) {
3799
- if (!targetBoss.skills.includes("轰炸引导")) return null;
3800
- const lightbladeStacks = targetBoss.Skillcountpoints || 0;
3801
- if (lightbladeStacks === 0) return null;
3802
- const triggerChance = 10;
3803
- if (Math.random() * 100 < triggerChance) {
3804
- const energyGain = lightbladeStacks * 50;
3805
- const maxEnergy = 1e3;
3806
- const currentEnergy = targetBoss.energy || 0;
3807
- const newEnergy = Math.min(currentEnergy + energyGain, maxEnergy);
3808
- await ctx.database.set(
3809
- "ggcevo_boss",
3810
- { name: targetBoss.name },
3811
- { energy: newEnergy }
3812
- );
3813
- return {
3814
- messages: [
3815
- `🎯 【轰炸引导】生效:回复${energyGain}点能量`
3816
- ]
3817
- };
3788
+ /** 轰炸引导处理(层数相关能量回复) */
3789
+ handleBombardmentGuide: /* @__PURE__ */ __name(function(targetBoss) {
3790
+ const messages = [];
3791
+ let targetUpdates = null;
3792
+ if (!targetBoss.skills.includes("轰炸引导")) {
3793
+ return null;
3818
3794
  }
3819
- return null;
3820
- }, "handleBombardmentGuidance"),
3821
- // 修改后的伤害处理函数
3822
- handlePassives: /* @__PURE__ */ __name(async function(ctx, handle, targetBoss, initialDamage, currentHP, maxHP, weaponName, weaponData, bossGroup) {
3823
- let messages = [];
3824
- let skillUpdates = [];
3825
- let buffMultiplier = 0;
3826
- let nerfMultiplier = 0;
3827
- let radiationApplied = false;
3828
- let freezing = false;
3829
- let pulseApplied = false;
3830
- let arcApplied = false;
3831
- let bileStacks = 0;
3832
- let skipBileStacking = false;
3833
- const activeBosses = await ctx.database.get("ggcevo_boss", { isActive: true });
3834
- const solarFlareResult = await this.handleSolarFlare(ctx, targetBoss, weaponName);
3835
- if (solarFlareResult.immune) {
3836
- return {
3837
- currentHP: targetBoss.HP,
3838
- messages: solarFlareResult.messages,
3839
- skillUpdates: [],
3840
- initialDamage: 0
3841
- };
3795
+ if (Math.random() >= 0.05) {
3796
+ return null;
3842
3797
  }
3843
- const frostEvoResult = this.handleFrostEvolution(targetBoss, weaponName, initialDamage, maxHP);
3844
- if (frostEvoResult) {
3845
- return {
3846
- currentHP: frostEvoResult.updatedHP,
3847
- messages: frostEvoResult.messages,
3848
- skillUpdates,
3849
- initialDamage: 0
3798
+ const currentStacks = targetBoss.skillStacks || 0;
3799
+ const energyGained = currentStacks * 50;
3800
+ targetUpdates = {
3801
+ name: targetBoss.name,
3802
+ updates: {
3803
+ energyChange: energyGained
3804
+ }
3805
+ };
3806
+ messages.push(`🎯 【轰炸引导】生效:5%概率触发,获得${energyGained}点能量(基于${currentStacks}层光影之刃)`);
3807
+ return {
3808
+ messages,
3809
+ targetUpdates
3810
+ };
3811
+ }, "handleBombardmentGuide"),
3812
+ // 统一的辐射效果处理函数
3813
+ handleRadiationEffect: /* @__PURE__ */ __name(function(targetBoss, weaponName) {
3814
+ const messages = [];
3815
+ let layerAdded = false;
3816
+ const currentLayers = targetBoss.radiationLayers || 0;
3817
+ const effectiveLayers = Math.min(currentLayers, 20);
3818
+ const buffMultiplier = effectiveLayers * 0.025;
3819
+ if (effectiveLayers > 0) {
3820
+ messages.push(`☢️ 【辐射增伤】:当前${currentLayers}层,伤害提升${(effectiveLayers * 2.5).toFixed(1)}%`);
3821
+ if (currentLayers > 20) {
3822
+ messages.push(`☢️ 注意:超过20层的辐射无效,不会提供额外增伤`);
3823
+ }
3824
+ }
3825
+ let targetUpdates = null;
3826
+ if (weaponName === "伽马枪" && // 使用伽马枪
3827
+ !targetBoss.tags.includes("机械") && // 非机械目标
3828
+ targetBoss.tags.includes("生物")) {
3829
+ targetUpdates = {
3830
+ name: targetBoss.name,
3831
+ updates: {
3832
+ radiationLayersChange: 1
3833
+ // 辐射层数增加1
3834
+ }
3850
3835
  };
3836
+ const newLayers = currentLayers + 1;
3837
+ messages.push(`☢️ 满足辐射条件,获得1层"辐射"效果,累计${newLayers}层`);
3838
+ layerAdded = true;
3851
3839
  }
3852
- const coldImmunityResult = this.handleColdAdaptationImmunity(targetBoss, weaponName);
3853
- if (coldImmunityResult) {
3854
- return {
3855
- currentHP,
3856
- messages: coldImmunityResult.messages,
3857
- skillUpdates,
3858
- initialDamage: 0
3840
+ return {
3841
+ messages,
3842
+ targetUpdates,
3843
+ buffMultiplier,
3844
+ layerAdded
3845
+ // 返回层数增加标记
3846
+ };
3847
+ }, "handleRadiationEffect"),
3848
+ // 统一的寒冷效果处理函数
3849
+ handleColdEffect: /* @__PURE__ */ __name(function(targetBoss, weaponName) {
3850
+ const messages = [];
3851
+ let layerAdded = false;
3852
+ const currentLayers = targetBoss.coldLayers || 0;
3853
+ const effectiveLayers = Math.min(currentLayers, 20);
3854
+ const buffMultiplier = effectiveLayers * 0.025;
3855
+ if (effectiveLayers > 0) {
3856
+ messages.push(`❄️ 【寒冷增伤】:当前${currentLayers}层,伤害提升${(effectiveLayers * 2.5).toFixed(1)}%`);
3857
+ if (currentLayers > 20) {
3858
+ messages.push(`❄️ 注意:超过20层的寒冷无效,不会提供额外增伤`);
3859
+ }
3860
+ }
3861
+ let targetUpdates = null;
3862
+ if (weaponName === "零度之下") {
3863
+ targetUpdates = {
3864
+ name: targetBoss.name,
3865
+ updates: {
3866
+ coldLayersChange: 1
3867
+ // 寒冷层数增加1
3868
+ }
3859
3869
  };
3870
+ const newLayers = currentLayers + 1;
3871
+ messages.push(`❄️ 满足寒冷条件,获得1层"寒冷"效果,累计${newLayers}层`);
3872
+ layerAdded = true;
3860
3873
  }
3861
- const fieldResult = await this.handleEnergyField(ctx, targetBoss, weaponName, initialDamage);
3862
- if (fieldResult) {
3863
- messages.push(...fieldResult.messages);
3864
- if (fieldResult.immune) {
3865
- return {
3866
- currentHP: targetBoss.HP,
3867
- messages,
3868
- skillUpdates,
3869
- initialDamage: 0
3870
- };
3871
- }
3874
+ return {
3875
+ messages,
3876
+ targetUpdates,
3877
+ buffMultiplier,
3878
+ layerAdded
3879
+ // 返回层数增加标记
3880
+ };
3881
+ }, "handleColdEffect"),
3882
+ // 统一的武器能量消耗处理函数
3883
+ handleWeaponEnergyDrain: /* @__PURE__ */ __name(function(targetBoss, weaponName) {
3884
+ const weaponEnergyDrain = {
3885
+ "弧焊枪": 200,
3886
+ "DG-3电弧步枪": 500
3887
+ };
3888
+ const drainValue = weaponEnergyDrain[weaponName];
3889
+ if (!drainValue) {
3890
+ return null;
3872
3891
  }
3873
- const fireEvoResult = await this.handleFireEvolution(
3874
- ctx,
3875
- targetBoss,
3876
- weaponName,
3877
- initialDamage,
3878
- bossGroup
3879
- );
3880
- if (fireEvoResult) {
3881
- return {
3882
- currentHP: fireEvoResult.updatedHP,
3883
- messages: fireEvoResult.messages,
3884
- skillUpdates: [],
3885
- initialDamage: fireEvoResult.initialDamage,
3886
- bileStacks: fireEvoResult.bileStacks
3892
+ const messages = [];
3893
+ const success = drainValue > 0;
3894
+ let targetUpdates = null;
3895
+ if (success) {
3896
+ targetUpdates = {
3897
+ name: targetBoss.name,
3898
+ updates: {
3899
+ energyChange: -drainValue
3900
+ // 消耗能量(负值)
3901
+ }
3887
3902
  };
3888
3903
  }
3889
- const criticalResult = this.handleCriticalHit(targetBoss, initialDamage);
3890
- if (criticalResult?.immune) {
3891
- return {
3892
- currentHP: targetBoss.HP,
3893
- messages: criticalResult.messages,
3894
- skillUpdates: [],
3895
- initialDamage: 0
3896
- };
3904
+ const weaponDisplayName = weaponName === "弧焊枪" ? "弧焊枪" : "DG-3电弧步枪";
3905
+ if (success) {
3906
+ messages.push(`⚡ 【${weaponDisplayName}】武器效果:消耗目标${drainValue}点能量`);
3897
3907
  }
3898
- const hunterImmune = await this.handleHunterAlien(targetBoss, weaponName, activeBosses);
3899
- if (hunterImmune?.immune) {
3900
- return {
3901
- currentHP: targetBoss.HP,
3902
- messages: hunterImmune.messages,
3903
- skillUpdates: [],
3904
- initialDamage: 0
3905
- };
3908
+ return {
3909
+ messages,
3910
+ targetUpdates,
3911
+ success
3912
+ };
3913
+ }, "handleWeaponEnergyDrain"),
3914
+ // 统一的武器层数减少处理函数
3915
+ handleWeaponLayerReduction: /* @__PURE__ */ __name(function(targetBoss, weaponName) {
3916
+ const weaponLayerReduction = {
3917
+ "脉冲扰乱枪": 2
3918
+ // 可以在这里添加其他武器及其减少层数
3919
+ };
3920
+ const reductionAmount = weaponLayerReduction[weaponName];
3921
+ if (!reductionAmount) {
3922
+ return null;
3906
3923
  }
3907
- const ancientOmenResult = await this.handleAncientOmen(ctx, targetBoss);
3908
- if (ancientOmenResult?.immune) {
3909
- return {
3910
- currentHP: targetBoss.HP,
3911
- messages: ancientOmenResult.messages,
3912
- skillUpdates: [],
3913
- initialDamage: 0
3924
+ const messages = [];
3925
+ const reductionSuccess = reductionAmount > 0;
3926
+ let targetUpdates = null;
3927
+ if (reductionSuccess) {
3928
+ targetUpdates = {
3929
+ name: targetBoss.name,
3930
+ updates: {
3931
+ skillStacksChanged: -reductionAmount
3932
+ // 减少层数
3933
+ }
3914
3934
  };
3915
3935
  }
3916
- targetBoss.skills.forEach((skill) => {
3917
- const config = passiveConfig[skill];
3918
- if (config && config.effect !== void 0 && config.effect !== 0) {
3919
- if (config.effect > 0) {
3920
- buffMultiplier += config.effect;
3921
- } else {
3922
- nerfMultiplier += config.effect;
3936
+ if (reductionSuccess) {
3937
+ messages.push(`⚡ 【${weaponName}】武器效果:使${targetBoss.name}的技能层数减少${reductionAmount}层`);
3938
+ }
3939
+ return {
3940
+ messages,
3941
+ targetUpdates,
3942
+ reductionSuccess
3943
+ };
3944
+ }, "handleWeaponLayerReduction")
3945
+ };
3946
+ function applyPassiveEffects(targetBoss, activeBosses, weaponName, damage, ignoreRate) {
3947
+ const messages = [];
3948
+ let immune = false;
3949
+ let totalBuffMultiplier = 0;
3950
+ let totalNerfMultiplier = 0;
3951
+ let radiationLayerAdded = false;
3952
+ let coldLayerAdded = false;
3953
+ let energyDrained = false;
3954
+ let layerReduced = false;
3955
+ let bileDetonationTrigger = false;
3956
+ const weaponData = weaponConfig[weaponName] || { type: "" };
3957
+ let ancientOmenBoost = 0;
3958
+ let psychicForgeBoost = 0;
3959
+ let doubleAstralWind = false;
3960
+ const lightningResult = BattleEffectProcessor.handleLightningCharge(targetBoss);
3961
+ if (lightningResult) {
3962
+ messages.push(...lightningResult.messages);
3963
+ ancientOmenBoost += lightningResult.ancientOmenBoost || 0;
3964
+ psychicForgeBoost += lightningResult.psychicForgeBoost || 0;
3965
+ }
3966
+ const coldImmuneEffects = [
3967
+ BattleEffectProcessor.handleFrostEvolution,
3968
+ BattleEffectProcessor.handleColdAdaptation,
3969
+ BattleEffectProcessor.handleSolarFlare
3970
+ ];
3971
+ const fireImmuneEffects = [
3972
+ BattleEffectProcessor.handleFlameAlien
3973
+ ];
3974
+ if (weaponName === "零度之下") {
3975
+ for (const effect of coldImmuneEffects) {
3976
+ const result = effect(targetBoss, weaponName, damage, activeBosses);
3977
+ if (result && result.isImmune) {
3978
+ immune = true;
3979
+ messages.push(...result.messages);
3980
+ if (result.targetUpdates) {
3981
+ updateStatsByName(result.targetUpdates.name, result.targetUpdates.updates);
3923
3982
  }
3924
- const effectPercent = Math.round(config.effect * 100);
3925
- const effectSign = config.effect > 0 ? "+" : "";
3926
- messages.push(`📚 【${skill}】生效:受到的伤害${effectSign}${effectPercent}%`);
3927
- }
3928
- });
3929
- const radiationCalc = this.calculateRadiationDamage(targetBoss);
3930
- if (radiationCalc) {
3931
- buffMultiplier += radiationCalc.damageMultiplier;
3932
- messages.push(...radiationCalc.messages);
3933
- }
3934
- const coldDamageResult = this.calculateColdDamage(targetBoss);
3935
- if (coldDamageResult) {
3936
- buffMultiplier += coldDamageResult.damageMultiplier;
3937
- messages.push(...coldDamageResult.messages);
3938
- }
3939
- const infectionResult = await this.handleInfectedStation(ctx, targetBoss);
3940
- if (infectionResult) {
3941
- nerfMultiplier += infectionResult.damageMultiplier;
3942
- messages.push(...infectionResult.messages);
3943
- }
3944
- const armorResult = this.handleStructuralArmor(targetBoss, weaponData);
3945
- if (armorResult) {
3946
- nerfMultiplier += armorResult.damageMultiplier;
3947
- messages.push(...armorResult.messages);
3948
- }
3949
- const bloodEffect = this.handleBloodEffects(targetBoss, currentHP, maxHP);
3950
- if (bloodEffect) {
3951
- if (bloodEffect.buffAmount > 0) {
3952
- buffMultiplier += bloodEffect.buffAmount;
3953
- }
3954
- if (bloodEffect.nerfAmount > 0) {
3955
- nerfMultiplier -= bloodEffect.nerfAmount;
3956
- }
3957
- messages.push(...bloodEffect.messages);
3958
- }
3959
- const siphonResult = this.handleEnergySiphon(targetBoss, currentHP, maxHP);
3960
- if (siphonResult) {
3961
- nerfMultiplier += siphonResult.damageMultiplier;
3962
- messages.push(...siphonResult.messages);
3963
- }
3964
- const powerSiphonResult = this.handlePowerSiphon(targetBoss);
3965
- if (powerSiphonResult) {
3966
- nerfMultiplier += powerSiphonResult.damageMultiplier;
3967
- messages.push(...powerSiphonResult.messages);
3968
- }
3969
- const giantRageResult = this.handleGiantRage(targetBoss, currentHP, maxHP);
3970
- if (giantRageResult) {
3971
- nerfMultiplier += giantRageResult.damageMultiplier;
3972
- messages.push(...giantRageResult.messages);
3973
- }
3974
- const hellfireBombResult = this.handleHellfireBomb(targetBoss, activeBosses);
3975
- if (hellfireBombResult) {
3976
- nerfMultiplier += hellfireBombResult.damageMultiplier;
3977
- messages.push(...hellfireBombResult.messages);
3978
- }
3979
- const disguiseResult = await this.handleDisguise(ctx, targetBoss, weaponName, initialDamage);
3980
- if (disguiseResult) {
3981
- nerfMultiplier += disguiseResult.damageMultiplier;
3982
- messages.push(...disguiseResult.messages);
3983
- }
3984
- if (hunterImmune && !hunterImmune.immune) {
3985
- const multiplier = hunterImmune.damageMultiplier;
3986
- if (multiplier > 0) {
3987
- buffMultiplier += multiplier;
3988
- } else {
3989
- nerfMultiplier += multiplier;
3990
3983
  }
3991
- messages.push(...hunterImmune.messages);
3992
- }
3993
- const rageResult = this.handleRage(targetBoss, currentHP, maxHP);
3994
- if (rageResult) {
3995
- nerfMultiplier += rageResult.damageMultiplier;
3996
- messages.push(...rageResult.messages);
3997
3984
  }
3998
- const hyperspaceResult = this.handleHyperspaceSkip(targetBoss);
3999
- if (hyperspaceResult) {
4000
- if (hyperspaceResult.reduction > 0) {
4001
- nerfMultiplier -= hyperspaceResult.reduction;
4002
- }
4003
- if (hyperspaceResult.increase > 0) {
4004
- buffMultiplier += hyperspaceResult.increase;
3985
+ }
3986
+ if (weaponName === "焚烧枪") {
3987
+ for (const effect of fireImmuneEffects) {
3988
+ const result = effect(targetBoss, weaponName, damage);
3989
+ if (result && result.isImmune) {
3990
+ immune = true;
3991
+ messages.push(...result.messages);
3992
+ if (result.targetUpdates) {
3993
+ updateStatsByName(result.targetUpdates.name, result.targetUpdates.updates);
3994
+ }
4005
3995
  }
4006
- messages.push(...hyperspaceResult.messages);
4007
- }
4008
- const frenzyResult = this.handlePsychicFrenzy(targetBoss, currentHP, maxHP);
4009
- if (frenzyResult) {
4010
- nerfMultiplier += frenzyResult.damageMultiplier;
4011
- messages.push(...frenzyResult.messages);
4012
- }
4013
- const bombingResult = await this.handleCarpetBombing(ctx, targetBoss);
4014
- if (bombingResult) {
4015
- nerfMultiplier += bombingResult.damageMultiplier;
4016
- messages.push(...bombingResult.messages);
4017
- }
4018
- if (solarFlareResult.messages.length > 0) {
4019
- messages.push(...solarFlareResult.messages);
4020
- }
4021
- let baseMultiplier = buffMultiplier + nerfMultiplier;
4022
- const ignoreReductionResult = await this.handleIgnoreReductionEffects(
4023
- ctx,
4024
- handle,
4025
- weaponName,
4026
- targetBoss,
4027
- nerfMultiplier
4028
- // 只传入减伤部分
4029
- );
4030
- let effectiveMultiplier = baseMultiplier;
4031
- let appliedIgnoreMessages = [];
4032
- let effectiveNerf = nerfMultiplier;
4033
- if (ignoreReductionResult) {
4034
- appliedIgnoreMessages = ignoreReductionResult.messages;
4035
- effectiveNerf = nerfMultiplier * (1 - ignoreReductionResult.ignoreRate);
4036
- effectiveMultiplier = buffMultiplier + effectiveNerf;
4037
- }
4038
- const originalMultiplier = effectiveMultiplier;
4039
- if (originalMultiplier < -1) {
4040
- messages.push(`⚠️ 触发伤害保底机制:强制造成1点伤害`);
4041
- }
4042
- let finalDamage = initialDamage * (1 + effectiveMultiplier);
4043
- finalDamage = Math.floor(finalDamage);
4044
- finalDamage = Math.max(finalDamage, 1);
4045
- currentHP = targetBoss.HP - finalDamage;
4046
- if (currentHP < 0) {
4047
- currentHP = 0;
4048
- }
4049
- if (appliedIgnoreMessages.length > 0) {
4050
- messages.push(...appliedIgnoreMessages);
4051
- messages.push(
4052
- `⚡ 减伤效果:${(nerfMultiplier * 100).toFixed(0)}% → ${(effectiveNerf * 100).toFixed(0)}%`
4053
- );
4054
3996
  }
4055
- if (currentHP > 0) {
4056
- const frostSurroundResult = await this.handleFrostSurround(ctx, targetBoss, currentHP, maxHP);
4057
- if (frostSurroundResult) {
4058
- currentHP = frostSurroundResult.updatedHP;
4059
- messages.push(...frostSurroundResult.messages);
4060
- skillUpdates.push(...frostSurroundResult.skillUpdates);
4061
- }
4062
- const frostRecoveryResult = await this.handleFrostRecovery(ctx, targetBoss, currentHP, maxHP, activeBosses, bossGroup);
4063
- if (frostRecoveryResult) {
4064
- currentHP = frostRecoveryResult.updatedHP;
4065
- messages.push(...frostRecoveryResult.messages);
4066
- skillUpdates.push(...frostRecoveryResult.skillUpdates);
4067
- }
4068
- const burningBurrowResult = await this.handleBurningBurrow(ctx, targetBoss, currentHP, maxHP);
4069
- if (burningBurrowResult) {
4070
- currentHP = burningBurrowResult.updatedHP;
4071
- messages.push(...burningBurrowResult.messages);
4072
- skillUpdates.push(...burningBurrowResult.skillUpdates);
4073
- }
4074
- const moldResult = await this.handleMoldGrowth(ctx, targetBoss, bossGroup);
4075
- if (moldResult) {
4076
- messages.push(...moldResult.messages);
4077
- }
4078
- const pulseResult = await this.handlePulse(
4079
- ctx,
4080
- targetBoss,
4081
- activeBosses,
4082
- bossGroup,
4083
- currentHP
4084
- // 传入当前HP值
4085
- );
4086
- if (pulseResult) {
4087
- currentHP = pulseResult.newHP;
4088
- messages.push(...pulseResult.messages);
4089
- }
4090
- if (weaponName !== "焚烧枪") {
4091
- if (targetBoss.skills.includes("腐蚀胆汁")) {
4092
- const bileTriggered = await this.handleCorrosiveBile(ctx, targetBoss, bossGroup, currentHP);
4093
- if (bileTriggered) {
4094
- currentHP = bileTriggered.currentHP;
4095
- skipBileStacking = true;
4096
- messages.push(...bileTriggered.messages);
4097
- }
4098
- }
4099
- if (targetBoss.skills.includes("火焰吐息")) {
4100
- const breathTriggered = await this.handleFireBreath(ctx, targetBoss, bossGroup, currentHP);
4101
- if (breathTriggered) {
4102
- currentHP = breathTriggered.currentHP;
4103
- skipBileStacking = true;
4104
- messages.push(...breathTriggered.messages);
4105
- }
3997
+ }
3998
+ const chanceImmuneEffects = [
3999
+ BattleEffectProcessor.handleDeadlyHit,
4000
+ BattleEffectProcessor.handleElectricField,
4001
+ BattleEffectProcessor.handleAncientOmen
4002
+ ];
4003
+ for (const effect of chanceImmuneEffects) {
4004
+ if (effect === BattleEffectProcessor.handleAncientOmen) {
4005
+ const result = effect(targetBoss, weaponData, ancientOmenBoost);
4006
+ if (result && result.isImmune) {
4007
+ immune = true;
4008
+ messages.push(...result.messages);
4009
+ if (result.targetUpdates) {
4010
+ updateStatsByName(result.targetUpdates.name, result.targetUpdates.updates);
4106
4011
  }
4107
4012
  }
4108
- const stellarWindResult = await this.handleStellarWind(ctx, targetBoss, initialDamage, currentHP, maxHP, activeBosses, bossGroup);
4109
- if (stellarWindResult) {
4110
- currentHP = stellarWindResult.updatedHP;
4111
- messages.push(...stellarWindResult.messages);
4112
- }
4113
- const shieldResult = await this.handleTyrsShield(ctx, targetBoss, currentHP, activeBosses, bossGroup);
4114
- if (shieldResult) {
4115
- currentHP = shieldResult.updatedHP;
4116
- messages.push(...shieldResult.messages);
4013
+ } else {
4014
+ const result = effect(targetBoss, weaponData);
4015
+ if (result && result.isImmune) {
4016
+ immune = true;
4017
+ messages.push(...result.messages);
4117
4018
  }
4118
4019
  }
4119
- const survivalResult = this.handleSurvivalInstinct(targetBoss, currentHP, maxHP);
4120
- if (survivalResult) {
4121
- currentHP = survivalResult.updatedHP;
4122
- messages.push(...survivalResult.messages);
4123
- skillUpdates.push(...survivalResult.skillUpdates);
4020
+ }
4021
+ const damageAdjustEffects = [
4022
+ BattleEffectProcessor.handleWeakForm,
4023
+ BattleEffectProcessor.handleAlienShell,
4024
+ BattleEffectProcessor.handleIsolated,
4025
+ BattleEffectProcessor.handleFrostHell,
4026
+ BattleEffectProcessor.handleStressShellI,
4027
+ BattleEffectProcessor.handleStressShellII,
4028
+ BattleEffectProcessor.handleInfectedSpaceStation,
4029
+ BattleEffectProcessor.handleVirusCloud,
4030
+ BattleEffectProcessor.handleStructuralArmor,
4031
+ BattleEffectProcessor.handleVampireSaliva,
4032
+ BattleEffectProcessor.handleBloodlust,
4033
+ BattleEffectProcessor.handleVomit,
4034
+ BattleEffectProcessor.handleEnergySiphon,
4035
+ BattleEffectProcessor.handleEnergyAbsorption,
4036
+ BattleEffectProcessor.handleEnergyBlackhole,
4037
+ BattleEffectProcessor.handleColossalRampage,
4038
+ BattleEffectProcessor.handleInfernalBomb,
4039
+ BattleEffectProcessor.handleHunterAlien,
4040
+ BattleEffectProcessor.handleRampage,
4041
+ BattleEffectProcessor.handleDisguise,
4042
+ BattleEffectProcessor.handleHyperRangeShift,
4043
+ BattleEffectProcessor.handleCarpetBombing
4044
+ ];
4045
+ for (const effect of damageAdjustEffects) {
4046
+ let result;
4047
+ if (effect === BattleEffectProcessor.handleIsolated || effect === BattleEffectProcessor.handleInfectedSpaceStation || effect === BattleEffectProcessor.handleInfernalBomb || effect === BattleEffectProcessor.handleHunterAlien) {
4048
+ result = effect(targetBoss, activeBosses, weaponName);
4049
+ } else if (effect === BattleEffectProcessor.handleStructuralArmor) {
4050
+ result = effect(targetBoss, weaponData);
4051
+ } else if (effect === BattleEffectProcessor.handleBloodlust || effect === BattleEffectProcessor.handleVampireSaliva || effect === BattleEffectProcessor.handleHyperRangeShift) {
4052
+ result = effect(targetBoss, activeBosses);
4053
+ } else {
4054
+ result = effect(targetBoss, activeBosses, weaponName);
4124
4055
  }
4125
- const revivalResult = await this.handleRevival(ctx, targetBoss, currentHP, maxHP);
4126
- if (revivalResult) {
4127
- currentHP = revivalResult.updatedHP;
4128
- messages.push(...revivalResult.messages);
4056
+ if (result) {
4057
+ messages.push(...result.messages);
4058
+ if (result.buffMultiplier !== void 0 && typeof result.buffMultiplier === "number") {
4059
+ totalBuffMultiplier += result.buffMultiplier;
4060
+ }
4061
+ if (result.nerfMultiplier !== void 0 && typeof result.nerfMultiplier === "number") {
4062
+ totalNerfMultiplier += result.nerfMultiplier;
4063
+ }
4129
4064
  }
4130
- const pulseDisruptorResult = await this.handlePulseDisruptor(
4131
- ctx,
4132
- targetBoss,
4133
- weaponName
4134
- );
4135
- if (pulseDisruptorResult) {
4136
- messages.push(...pulseDisruptorResult.messages);
4137
- pulseApplied = pulseDisruptorResult.pulseApplied;
4065
+ }
4066
+ const stateChangeEffects = [
4067
+ BattleEffectProcessor.handleVampireSaliva,
4068
+ BattleEffectProcessor.handleBladeOfLight,
4069
+ BattleEffectProcessor.handleSuperconductor
4070
+ ];
4071
+ for (const effect of stateChangeEffects) {
4072
+ const result = effect(targetBoss);
4073
+ if (result) {
4074
+ messages.push(...result.messages);
4075
+ if (result.targetUpdates) {
4076
+ updateStatsByName(result.targetUpdates.name, result.targetUpdates.updates);
4077
+ }
4138
4078
  }
4139
- const arcResult = await this.handleArcWelderEffect(ctx, targetBoss, weaponName);
4140
- if (arcResult) {
4141
- messages.push(...arcResult.messages);
4142
- arcApplied = arcResult.arcApplied;
4079
+ }
4080
+ const burningSlimeResult = BattleEffectProcessor.handleBurningSlime(targetBoss, weaponName);
4081
+ if (burningSlimeResult) {
4082
+ messages.push(...burningSlimeResult.messages);
4083
+ if (burningSlimeResult.targetUpdates) {
4084
+ updateStatsByName(burningSlimeResult.targetUpdates.name, burningSlimeResult.targetUpdates.updates);
4143
4085
  }
4144
- const arcRifleResult = await this.handleArcRifleEffect(ctx, targetBoss, weaponName, messages);
4145
- if (arcRifleResult) {
4146
- messages.push(...arcRifleResult.messages);
4086
+ bileDetonationTrigger = burningSlimeResult.isHighStackHeal;
4087
+ }
4088
+ const healingEffects = [
4089
+ BattleEffectProcessor.handleFrostRegeneration,
4090
+ BattleEffectProcessor.handleFrostAura,
4091
+ BattleEffectProcessor.handleSurvivalInstinctI,
4092
+ BattleEffectProcessor.handleSurvivalInstinctII,
4093
+ BattleEffectProcessor.handleSentryGun,
4094
+ BattleEffectProcessor.handleFeeding,
4095
+ BattleEffectProcessor.handleMoldGrowth,
4096
+ BattleEffectProcessor.handleElectricShockwave,
4097
+ BattleEffectProcessor.handlePulse,
4098
+ BattleEffectProcessor.handleCorrosiveBile,
4099
+ BattleEffectProcessor.handleFlameBreath,
4100
+ BattleEffectProcessor.handleBurningBurrow,
4101
+ BattleEffectProcessor.handleRevival,
4102
+ BattleEffectProcessor.handleCosmicEnergy,
4103
+ BattleEffectProcessor.handleBombardmentGuide,
4104
+ BattleEffectProcessor.handleOverdriveShield
4105
+ ];
4106
+ for (const effect of healingEffects) {
4107
+ let result;
4108
+ if (effect === BattleEffectProcessor.handleFrostRegeneration || effect === BattleEffectProcessor.handleFrostAura || effect === BattleEffectProcessor.handlePulse || effect === BattleEffectProcessor.handleSentryGun || effect === BattleEffectProcessor.handleCorrosiveBile || effect === BattleEffectProcessor.handleFlameBreath || effect === BattleEffectProcessor.handleOverdriveShield) {
4109
+ result = effect(targetBoss, activeBosses, damage);
4110
+ } else if (effect === BattleEffectProcessor.handleCosmicEnergy) {
4111
+ result = effect(targetBoss, activeBosses, damage);
4112
+ } else {
4113
+ result = effect(targetBoss, activeBosses, damage);
4147
4114
  }
4148
- const coldAdaptResult = await this.handleColdAdaptation(ctx, targetBoss, weaponName);
4149
- if (coldAdaptResult) {
4150
- messages.push(...coldAdaptResult.messages);
4115
+ if (result) {
4116
+ messages.push(...result.messages);
4117
+ if (result.targetUpdates) {
4118
+ updateStatsByName(result.targetUpdates.name, result.targetUpdates.updates);
4119
+ }
4120
+ if (result.otherUpdates) {
4121
+ for (const update of result.otherUpdates) {
4122
+ updateStatsByName(update.name, update.updates);
4123
+ }
4124
+ }
4151
4125
  }
4152
- const bloodCountResult = await this.handleBloodCount(ctx, targetBoss, currentHP, maxHP);
4153
- if (bloodCountResult) {
4154
- currentHP = bloodCountResult.updatedHP;
4155
- messages.push(...bloodCountResult.messages);
4126
+ }
4127
+ const mindFrenzyResult = BattleEffectProcessor.handleMindFrenzy(targetBoss);
4128
+ if (mindFrenzyResult) {
4129
+ messages.push(...mindFrenzyResult.messages);
4130
+ totalNerfMultiplier += mindFrenzyResult.nerfMultiplier || 0;
4131
+ doubleAstralWind = mindFrenzyResult.doubleAstralWind || false;
4132
+ }
4133
+ const radiationResult = BattleEffectProcessor.handleRadiationEffect(targetBoss, weaponName);
4134
+ if (radiationResult) {
4135
+ messages.push(...radiationResult.messages);
4136
+ if (radiationResult.buffMultiplier) {
4137
+ totalBuffMultiplier += radiationResult.buffMultiplier - 1;
4156
4138
  }
4157
- const sentryResult = await this.handleSentryGun(ctx, targetBoss, bossGroup);
4158
- if (sentryResult) {
4159
- messages.push(...sentryResult.messages);
4139
+ if (radiationResult.targetUpdates) {
4140
+ updateStatsByName(radiationResult.targetUpdates.name, radiationResult.targetUpdates.updates);
4160
4141
  }
4161
- const lightbladeResult = await this.handleLightblade(ctx, targetBoss);
4162
- if (lightbladeResult) {
4163
- messages.push(...lightbladeResult.messages);
4142
+ radiationLayerAdded = radiationResult.layerAdded;
4143
+ }
4144
+ const coldResult = BattleEffectProcessor.handleColdEffect(targetBoss, weaponName);
4145
+ if (coldResult) {
4146
+ messages.push(...coldResult.messages);
4147
+ if (coldResult.buffMultiplier) {
4148
+ totalBuffMultiplier += coldResult.buffMultiplier - 1;
4164
4149
  }
4165
- const CollapsepulseResult = await this.handleCollapsePulse(ctx, targetBoss);
4166
- if (CollapsepulseResult) {
4167
- messages.push(...CollapsepulseResult.messages);
4150
+ if (coldResult.targetUpdates) {
4151
+ updateStatsByName(coldResult.targetUpdates.name, coldResult.targetUpdates.updates);
4168
4152
  }
4169
- const bileStackResult = await this.handleBileStacking(ctx, targetBoss, skipBileStacking);
4170
- if (bileStackResult) {
4171
- messages.push(...bileStackResult.messages);
4153
+ coldLayerAdded = coldResult.layerAdded;
4154
+ }
4155
+ const energyDrainResult = BattleEffectProcessor.handleWeaponEnergyDrain(targetBoss, weaponName);
4156
+ if (energyDrainResult) {
4157
+ messages.push(...energyDrainResult.messages);
4158
+ if (energyDrainResult.targetUpdates) {
4159
+ updateStatsByName(energyDrainResult.targetUpdates.name, energyDrainResult.targetUpdates.updates);
4172
4160
  }
4173
- const shockwaveResult = await this.handleEnergyShockwave(ctx, targetBoss);
4174
- if (shockwaveResult) {
4175
- messages.push(...shockwaveResult.messages);
4161
+ energyDrained = energyDrainResult.success;
4162
+ }
4163
+ const layerReduceResult = BattleEffectProcessor.handleWeaponLayerReduction(targetBoss, weaponName);
4164
+ if (layerReduceResult) {
4165
+ messages.push(...layerReduceResult.messages);
4166
+ if (layerReduceResult.targetUpdates) {
4167
+ updateStatsByName(layerReduceResult.targetUpdates.name, layerReduceResult.targetUpdates.updates);
4176
4168
  }
4177
- const cosmicResult = await this.handleCosmicEnergy(ctx, targetBoss, finalDamage, bossGroup);
4178
- if (cosmicResult) {
4179
- messages.push(...cosmicResult.messages);
4180
- if (cosmicResult.healAmount > 0) {
4181
- currentHP = Math.min(targetBoss.HP + cosmicResult.healAmount, maxHP);
4169
+ layerReduced = layerReduceResult.reductionSuccess;
4170
+ }
4171
+ const astralWindResult = BattleEffectProcessor.handleAstralWind(targetBoss, activeBosses, doubleAstralWind);
4172
+ if (astralWindResult) {
4173
+ messages.push(...astralWindResult.messages);
4174
+ if (astralWindResult.otherUpdates) {
4175
+ for (const update of astralWindResult.otherUpdates) {
4176
+ updateStatsByName(update.name, update.updates);
4182
4177
  }
4183
4178
  }
4184
- const guidanceResult = await this.handleBombardmentGuidance(ctx, targetBoss);
4185
- if (guidanceResult) {
4186
- messages.push(...guidanceResult.messages);
4187
- }
4188
- const gammaRadResult = await this.handleGammaRadiation(ctx, targetBoss, weaponName);
4189
- if (gammaRadResult) {
4190
- messages.push(...gammaRadResult.messages);
4191
- radiationApplied = gammaRadResult.radiationApplied;
4192
- }
4193
- const coldEffectResult = await this.handleColdEffect(ctx, targetBoss, weaponName);
4194
- if (coldEffectResult) {
4195
- messages.push(...coldEffectResult.messages);
4196
- freezing = coldEffectResult.freezing;
4197
- }
4198
- const tagChangeResult = await this.handleConductorTagChange(ctx, targetBoss, currentHP, maxHP);
4199
- if (tagChangeResult) {
4200
- messages.push(...tagChangeResult.messages);
4201
- }
4202
- const constructorResult = await this.handleConstructor(ctx, targetBoss);
4203
- if (constructorResult) {
4204
- messages.push(...constructorResult.messages);
4205
- }
4206
- return {
4207
- currentHP,
4208
- messages,
4209
- skillUpdates,
4210
- initialDamage: finalDamage,
4211
- radiationApplied,
4212
- // 新增返回辐射应用标记
4213
- freezing,
4214
- pulseApplied,
4215
- arcApplied
4216
- };
4217
- }, "handlePassives"),
4218
- // 应用技能更新到数据库(优化合并同名boss的更新)
4219
- applySkillUpdates: /* @__PURE__ */ __name(async (ctx, skillUpdates) => {
4220
- const mergedUpdates = skillUpdates.reduce((acc, update) => {
4221
- const existing = acc.find((u) => u.name === update.name);
4222
- if (existing) {
4223
- if (update.remove) {
4224
- existing.remove = [.../* @__PURE__ */ new Set([...existing.remove, ...update.remove])];
4225
- }
4226
- if (update.add) {
4227
- existing.add = [.../* @__PURE__ */ new Set([...existing.add, ...update.add])];
4228
- }
4229
- } else {
4230
- acc.push({
4231
- name: update.name,
4232
- remove: [...new Set(update.remove || [])],
4233
- add: [...new Set(update.add || [])]
4234
- });
4235
- }
4236
- return acc;
4237
- }, []);
4238
- const updates = mergedUpdates.map(async (update) => {
4239
- const [boss] = await ctx.database.get("ggcevo_boss", { name: update.name });
4240
- if (!boss) return;
4241
- let newSkills = [...boss.skills];
4242
- if (update.remove?.length) {
4243
- newSkills = newSkills.filter((s) => !update.remove.includes(s));
4244
- }
4245
- if (update.add?.length) {
4246
- newSkills = [...newSkills, ...update.add];
4247
- newSkills = [...new Set(newSkills)];
4248
- }
4249
- return ctx.database.set(
4250
- "ggcevo_boss",
4251
- { name: update.name },
4252
- { skills: newSkills }
4253
- );
4254
- });
4255
- await Promise.all(updates);
4256
- }, "applySkillUpdates")
4257
- };
4258
-
4259
- // src/boss/attackhandling.ts
4260
- function getBossMaxHP(bossName) {
4261
- for (const bossGroup of bossPool) {
4262
- if (bossGroup.main.name === bossName) {
4263
- return bossGroup.main.maxHP;
4179
+ }
4180
+ const psychicForgeResult = BattleEffectProcessor.handlePsychicForge(targetBoss, psychicForgeBoost);
4181
+ if (psychicForgeResult) {
4182
+ messages.push(...psychicForgeResult.messages);
4183
+ if (psychicForgeResult.targetUpdates) {
4184
+ updateStatsByName(psychicForgeResult.targetUpdates.name, psychicForgeResult.targetUpdates.updates);
4264
4185
  }
4265
- for (const minion of bossGroup.minions) {
4266
- if (minion.name === bossName) {
4267
- return minion.maxHP;
4268
- }
4186
+ }
4187
+ let finalDamage = damage;
4188
+ if (!immune) {
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;
4195
+ finalDamage = Math.max(1, Math.round(damage * damageMultiplier));
4196
+ if (damage !== finalDamage) {
4197
+ const adjustmentPercent = ((damageMultiplier - 1) * 100).toFixed(1);
4198
+ if (damageMultiplier > 1) {
4199
+ messages.push(`⚔️ 伤害增益: 总计增加${adjustmentPercent}%伤害`);
4200
+ } else if (damageMultiplier < 1) {
4201
+ messages.push(`🛡️ 伤害减免: 总计减少${Math.abs(Number(adjustmentPercent))}%伤害`);
4202
+ }
4203
+ }
4204
+ if (finalDamage > 0) {
4205
+ updateStatsByName(targetBoss.name, {
4206
+ hpChange: -finalDamage
4207
+ });
4269
4208
  }
4270
4209
  }
4271
- return 0;
4210
+ if (immune) {
4211
+ finalDamage = 0;
4212
+ }
4213
+ return {
4214
+ finalDamage,
4215
+ messages,
4216
+ radiationLayerAdded,
4217
+ coldLayerAdded,
4218
+ energyDrained,
4219
+ layerReduced,
4220
+ bileDetonationTrigger
4221
+ };
4272
4222
  }
4273
- __name(getBossMaxHP, "getBossMaxHP");
4223
+ __name(applyPassiveEffects, "applyPassiveEffects");
4224
+
4225
+ // src/boss/attackhandling.ts
4274
4226
  async function getCleanerRewardBroadcast(ctx, boss, killerHandle, killerName) {
4275
- try {
4276
- const bossType = boss.type;
4277
- const bossName = boss.name;
4278
- const baseReward = bossType === "主宰" ? 10 : 5;
4279
- const allCleaners = await ctx.database.get("ggcevo_careers", {
4280
- career: "清洁工"
4281
- });
4282
- if (!allCleaners.length) return [];
4283
- let killerBonus = false;
4284
- let killerBonusMessage = "";
4285
- for (const cleaner of allCleaners) {
4286
- let rewardAmount = baseReward;
4287
- if (cleaner.handle === killerHandle) {
4288
- rewardAmount *= 2;
4289
- killerBonus = true;
4290
- }
4291
- await ctx.database.upsert("ggcevo_careers", [{
4292
- handle: cleaner.handle,
4293
- redcrystal: (cleaner.redcrystal || 0) + rewardAmount
4294
- }], ["handle"]);
4227
+ const bossType = boss.type;
4228
+ const bossName = boss.name;
4229
+ const baseReward = bossType === "主宰" ? 10 : 5;
4230
+ const allCleaners = await ctx.database.get("ggcevo_careers", {
4231
+ career: "清洁工"
4232
+ });
4233
+ if (!allCleaners.length) return [];
4234
+ let killerBonus = false;
4235
+ let killerBonusMessage = "";
4236
+ for (const cleaner of allCleaners) {
4237
+ let rewardAmount = baseReward;
4238
+ if (cleaner.handle === killerHandle) {
4239
+ rewardAmount *= 2;
4240
+ killerBonus = true;
4295
4241
  }
4296
- const rewardMessage = `🧹 全体清洁工因清理 ${bossName} 获得 ${baseReward} 红晶${killerBonus ? ` (致命一击双倍奖励者:${killerName})` : ""}`;
4297
- return [rewardMessage];
4298
- } catch (error) {
4299
- ctx.logger("ggcevo").warn("清洁工奖励发放失败", error);
4300
- return [];
4242
+ await ctx.database.upsert("ggcevo_careers", [{
4243
+ handle: cleaner.handle,
4244
+ redcrystal: (cleaner.redcrystal || 0) + rewardAmount
4245
+ }], ["handle"]);
4301
4246
  }
4247
+ const rewardMessage = `🧹 清洁工职业因清理 ${bossName} 获得 ${baseReward} 红晶${killerBonus ? ` (致命一击奖励者:${killerName})` : ""}`;
4248
+ return [rewardMessage];
4302
4249
  }
4303
4250
  __name(getCleanerRewardBroadcast, "getCleanerRewardBroadcast");
4304
4251
  async function handleBossDefeatRewards(ctx, targetBoss) {
@@ -4424,42 +4371,31 @@ async function handleBossDefeatRewards(ctx, targetBoss) {
4424
4371
  return { rewardMessages };
4425
4372
  }
4426
4373
  __name(handleBossDefeatRewards, "handleBossDefeatRewards");
4427
- async function handlePrimaryAttack(ctx, session, config, handle, equippedWeapon, targetBoss, activeBosses, bossGroup, weaponName, weaponData, maxHP) {
4374
+ async function handlePrimaryAttack(ctx, session, handle, config, equippedWeapon, targetBoss, activeBosses, weaponName) {
4428
4375
  const damageResult = await calculateTotalDamage(ctx, session, config, equippedWeapon, targetBoss);
4429
- const passiveResult = await PassiveHandler.handlePassives(
4430
- ctx,
4431
- handle,
4432
- targetBoss,
4433
- damageResult.damage,
4434
- targetBoss.HP,
4435
- maxHP,
4436
- weaponName,
4437
- weaponData,
4438
- bossGroup
4439
- );
4440
- const currentHP = passiveResult.currentHP;
4441
- const initialDamage = passiveResult.initialDamage;
4442
- if (passiveResult.skillUpdates.length > 0) {
4443
- await PassiveHandler.applySkillUpdates(ctx, passiveResult.skillUpdates);
4444
- }
4376
+ const ignoreReduction = await handleIgnoreReductionEffects(ctx, handle, weaponName, targetBoss);
4377
+ const EffectProcessor = applyPassiveEffects(targetBoss, activeBosses, weaponName, damageResult.damage, ignoreReduction.ignoreRate);
4378
+ const initialDamage = EffectProcessor.finalDamage;
4379
+ await saveAndClearStats(ctx);
4380
+ const [currentboss] = await ctx.database.get("ggcevo_boss", { name: targetBoss.name });
4381
+ const currentHP = currentboss.HP;
4445
4382
  const isDefeated = currentHP <= 0;
4446
4383
  return {
4447
4384
  initialDamage,
4448
4385
  currentHP,
4449
4386
  isDefeated,
4450
- damage: initialDamage,
4451
4387
  hasCrit: damageResult.hasCrit,
4452
4388
  effectMessage: damageResult.effectMessage,
4453
- passiveMessages: passiveResult.messages,
4454
- radiationApplied: passiveResult.radiationApplied,
4455
- freezing: passiveResult.freezing,
4456
- bileStacks: passiveResult.bileStacks,
4457
- pulseApplied: passiveResult.pulseApplied,
4458
- arcApplied: passiveResult.arcApplied
4389
+ passiveMessages: EffectProcessor.messages,
4390
+ radiationApplied: EffectProcessor.radiationLayerAdded,
4391
+ freezing: EffectProcessor.coldLayerAdded,
4392
+ bileStacks: EffectProcessor.bileDetonationTrigger,
4393
+ pulseApplied: EffectProcessor.layerReduced,
4394
+ arcApplied: EffectProcessor.energyDrained
4459
4395
  };
4460
4396
  }
4461
4397
  __name(handlePrimaryAttack, "handlePrimaryAttack");
4462
- async function handleScatterAttack(ctx, session, config, handle, equippedWeapon, targetBoss, weaponName, weaponData, activeBosses, bossGroup) {
4398
+ async function handleScatterAttack(ctx, session, handle, config, equippedWeapon, targetBoss, weaponName, activeBosses) {
4463
4399
  const secondaryTargets = activeBosses.filter((boss) => boss.name !== targetBoss.name);
4464
4400
  const scatterEffectMessages = [];
4465
4401
  const extraDamages = [];
@@ -4482,47 +4418,33 @@ async function handleScatterAttack(ctx, session, config, handle, equippedWeapon,
4482
4418
  secondaryTarget
4483
4419
  );
4484
4420
  const secondaryDamage = Math.round(damageResult.damage * scatterRatio);
4485
- const passiveResult = await PassiveHandler.handlePassives(
4486
- ctx,
4487
- handle,
4488
- secondaryTarget,
4489
- secondaryDamage,
4490
- secondaryTarget.HP,
4491
- getBossMaxHP(secondaryTarget.name),
4492
- weaponName,
4493
- weaponData,
4494
- bossGroup
4495
- );
4496
- const actualDamage = Math.min(passiveResult.initialDamage, secondaryTarget.HP);
4497
- const newHP = passiveResult.currentHP;
4421
+ const ignoreReduction = await handleIgnoreReductionEffects(ctx, handle, weaponName, targetBoss);
4422
+ const EffectProcessor = applyPassiveEffects(targetBoss, activeBosses, weaponName, secondaryDamage, ignoreReduction.ignoreRate);
4423
+ const actualDamage = EffectProcessor.finalDamage;
4424
+ await saveAndClearStats(ctx);
4425
+ const [currentboss] = await ctx.database.get("ggcevo_boss", { name: targetBoss.name });
4426
+ const currentHP = currentboss.HP;
4498
4427
  extraDamages.push({
4499
4428
  name: secondaryTarget.name,
4500
4429
  damage: actualDamage
4501
4430
  });
4502
- if (passiveResult.skillUpdates.length > 0) {
4503
- await PassiveHandler.applySkillUpdates(ctx, passiveResult.skillUpdates);
4504
- }
4505
- if (passiveResult.radiationApplied) {
4431
+ if (EffectProcessor.radiationLayerAdded) {
4506
4432
  taskUpdates.push({ taskId: 1, count: 1 });
4507
4433
  }
4508
- if (passiveResult.freezing) {
4434
+ if (EffectProcessor.coldLayerAdded) {
4509
4435
  taskUpdates.push({ taskId: 2, count: 1 });
4510
4436
  }
4511
- if (passiveResult.bileStacks >= 10) {
4437
+ if (EffectProcessor.bileDetonationTrigger) {
4512
4438
  taskUpdates.push({ taskId: 3, count: 1 });
4513
4439
  }
4514
- if (passiveResult.pulseApplied) {
4440
+ if (EffectProcessor.layerReduced) {
4515
4441
  taskUpdates.push({ taskId: 4, count: 1 });
4516
4442
  }
4517
- if (passiveResult.arcApplied) {
4443
+ if (EffectProcessor.energyDrained) {
4518
4444
  taskUpdates.push({ taskId: 5, count: 1 });
4519
4445
  }
4520
- const isDead = newHP <= 0;
4521
- await ctx.database.set("ggcevo_boss", { name: secondaryTarget.name }, {
4522
- HP: Math.max(newHP, 0),
4523
- isActive: !isDead
4524
- });
4525
- scatterEffectMessages.push(...passiveResult.messages.map((m) => ` 对 ${secondaryTarget.name} ${m}`));
4446
+ const isDead = currentHP <= 0;
4447
+ scatterEffectMessages.push(...EffectProcessor.messages.map((m) => ` 对 ${secondaryTarget.name} ${m}`));
4526
4448
  if (isDead) {
4527
4449
  actuallyDead.push(secondaryTarget.name);
4528
4450
  }
@@ -4531,26 +4453,10 @@ async function handleScatterAttack(ctx, session, config, handle, equippedWeapon,
4531
4453
  scatterEffectMessages,
4532
4454
  extraDamages,
4533
4455
  actuallyDead,
4534
- scatterBroadcast: null,
4535
- // 稍后处理广播
4536
4456
  taskUpdates
4537
4457
  };
4538
4458
  }
4539
4459
  __name(handleScatterAttack, "handleScatterAttack");
4540
- async function applyAttackResults(ctx, targetBoss, result) {
4541
- const { currentHP, isDefeated } = result;
4542
- if (isDefeated) {
4543
- await ctx.database.set("ggcevo_boss", { name: targetBoss.name }, {
4544
- isActive: false,
4545
- HP: 0
4546
- });
4547
- } else {
4548
- await ctx.database.set("ggcevo_boss", { name: targetBoss.name }, {
4549
- HP: Math.max(currentHP, 0)
4550
- });
4551
- }
4552
- }
4553
- __name(applyAttackResults, "applyAttackResults");
4554
4460
  async function handleDeathTargets(ctx, deadTargets, killerName, killerHandle) {
4555
4461
  const bossBroadcast = [];
4556
4462
  const cleanerBroadcast = [];
@@ -4580,39 +4486,6 @@ async function handleDeathTargets(ctx, deadTargets, killerName, killerHandle) {
4580
4486
  "🏆 伤害排行榜奖励:",
4581
4487
  ...rewardMessages
4582
4488
  );
4583
- } else {
4584
- if (deadBoss.name === "机械感染虫") {
4585
- const [mainBoss] = await ctx.database.get("ggcevo_boss", {
4586
- groupId: deadBoss.groupId,
4587
- type: "主宰",
4588
- isActive: true
4589
- });
4590
- if (mainBoss && !mainBoss.skills.includes("孤立无援")) {
4591
- await ctx.database.set("ggcevo_boss", { name: mainBoss.name }, {
4592
- skills: [...mainBoss.skills, "孤立无援"]
4593
- });
4594
- bossBroadcast.push("💥 机械感染虫已阵亡,空间站感染虫进入【孤立无援】状态,受到的伤害+20%!");
4595
- }
4596
- } else {
4597
- const remainingMinions = await ctx.database.get("ggcevo_boss", {
4598
- groupId: deadBoss.groupId,
4599
- type: "子代",
4600
- isActive: true
4601
- });
4602
- if (remainingMinions.length === 0) {
4603
- const [mainBoss] = await ctx.database.get("ggcevo_boss", {
4604
- groupId: deadBoss.groupId,
4605
- type: "主宰",
4606
- isActive: true
4607
- });
4608
- if (mainBoss && !mainBoss.skills.includes("孤立无援")) {
4609
- await ctx.database.set("ggcevo_boss", { name: mainBoss.name }, {
4610
- skills: [...mainBoss.skills, "孤立无援"]
4611
- });
4612
- bossBroadcast.push(`💥 所有子代已阵亡,${mainBoss.name}进入【孤立无援】状态,受到的伤害+20%!`);
4613
- }
4614
- }
4615
- }
4616
4489
  }
4617
4490
  }
4618
4491
  return {
@@ -4723,13 +4596,8 @@ ${scatterResult.scatterEffectMessages.map((m) => `▸ ${m}`).join("\n")}`,
4723
4596
  return messages.filter((line) => line).join("\n");
4724
4597
  }
4725
4598
  __name(buildResultMessage, "buildResultMessage");
4726
- async function handleBroadcasts(ctx, groupIds, scatterBroadcast, bossEventBroadcast, cleanerRewardBroadcast, isPrimaryAttack) {
4599
+ async function handleBroadcasts(ctx, groupIds, bossEventBroadcast, cleanerRewardBroadcast, isPrimaryAttack) {
4727
4600
  const broadcastMessages = [];
4728
- if (scatterBroadcast) {
4729
- const scatterMsg = Array.isArray(scatterBroadcast) ? scatterBroadcast.join("\n") : scatterBroadcast;
4730
- broadcastMessages.push(`✨ 散射攻击结果
4731
- ${scatterMsg}`);
4732
- }
4733
4601
  if (bossEventBroadcast) {
4734
4602
  const bossMsg = Array.isArray(bossEventBroadcast) ? bossEventBroadcast.join("\n") : bossEventBroadcast;
4735
4603
  broadcastMessages.push(bossMsg);
@@ -4771,6 +4639,149 @@ async function updateTaskProgress(ctx, handle, taskUpdates) {
4771
4639
  }
4772
4640
  }
4773
4641
  __name(updateTaskProgress, "updateTaskProgress");
4642
+ function getMaxHPByName2(bossName) {
4643
+ for (const boss of bossPool) {
4644
+ if (boss.main.name === bossName) {
4645
+ return boss.main.maxHP;
4646
+ }
4647
+ for (const minion of boss.minions) {
4648
+ if (minion.name === bossName) {
4649
+ return minion.maxHP;
4650
+ }
4651
+ }
4652
+ }
4653
+ return void 0;
4654
+ }
4655
+ __name(getMaxHPByName2, "getMaxHPByName");
4656
+ function getMaxEnergyByName2(bossName) {
4657
+ for (const boss of bossPool) {
4658
+ if (boss.main.name === bossName) {
4659
+ return boss.main.maxEnergy;
4660
+ }
4661
+ for (const minion of boss.minions) {
4662
+ if (minion.name === bossName) {
4663
+ return minion.maxEnergy;
4664
+ }
4665
+ }
4666
+ }
4667
+ return void 0;
4668
+ }
4669
+ __name(getMaxEnergyByName2, "getMaxEnergyByName");
4670
+ async function updateDatabaseWithStats(ctx, stats) {
4671
+ const bossData = await ctx.database.get("ggcevo_boss", { name: stats.name });
4672
+ const maxHP = getMaxHPByName2(stats.name);
4673
+ const maxEnergy = getMaxEnergyByName2(stats.name);
4674
+ if (!bossData || bossData.length === 0) {
4675
+ return;
4676
+ }
4677
+ const boss = bossData[0];
4678
+ const updateData = {};
4679
+ if (stats.hpChange !== 0) {
4680
+ const newHP = boss.HP + stats.hpChange;
4681
+ updateData.HP = Math.max(0, Math.min(maxHP, newHP));
4682
+ }
4683
+ if (stats.energyChange !== 0) {
4684
+ const newEnergy = boss.energy + stats.energyChange;
4685
+ updateData.energy = Math.max(0, Math.min(maxEnergy, newEnergy));
4686
+ }
4687
+ if (stats.skillStacksChanged !== 0) {
4688
+ updateData.skillStacks = Math.max(0, boss.skillStacks + stats.skillStacksChanged);
4689
+ }
4690
+ if (stats.statusLayersChanged !== 0) {
4691
+ updateData.statusLayers = Math.max(0, boss.statusLayers + stats.statusLayersChanged);
4692
+ }
4693
+ if (stats.radiationLayersChange !== 0) {
4694
+ updateData.radiationLayers = Math.max(0, boss.radiationLayers + stats.radiationLayersChange);
4695
+ }
4696
+ if (stats.coldLayersChange !== 0) {
4697
+ updateData.coldLayers = Math.max(0, boss.coldLayers + stats.coldLayersChange);
4698
+ }
4699
+ if (stats.tagsAdded.length > 0 || stats.tagsRemoved.length > 0) {
4700
+ updateData.tags = [
4701
+ ...boss.tags.filter((tag) => !stats.tagsRemoved.includes(tag)),
4702
+ ...stats.tagsAdded.filter((tag) => !boss.tags.includes(tag))
4703
+ ];
4704
+ }
4705
+ if (stats.skillsAdded.length > 0 || stats.skillsRemoved.length > 0) {
4706
+ updateData.skills = [
4707
+ ...boss.skills.filter((skill) => !stats.skillsRemoved.includes(skill)),
4708
+ ...stats.skillsAdded.filter((skill) => !boss.skills.includes(skill))
4709
+ ];
4710
+ }
4711
+ if (stats.lastWeaponName) {
4712
+ updateData.lastWeaponName = stats.lastWeaponName;
4713
+ }
4714
+ if (Object.keys(updateData).length > 0) {
4715
+ await ctx.database.set("ggcevo_boss", { name: stats.name }, updateData);
4716
+ }
4717
+ }
4718
+ __name(updateDatabaseWithStats, "updateDatabaseWithStats");
4719
+ async function saveAndClearStats(ctx) {
4720
+ for (const name2 in battleStatsMap) {
4721
+ const stats = battleStatsMap[name2];
4722
+ await updateDatabaseWithStats(ctx, stats);
4723
+ }
4724
+ Object.keys(battleStatsMap).forEach((key) => delete battleStatsMap[key]);
4725
+ }
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");
4774
4785
 
4775
4786
  // src/index.ts
4776
4787
  var name = "ggcevo-game";
@@ -4958,18 +4969,17 @@ function apply(ctx, config) {
4958
4969
  });
4959
4970
  ctx.model.extend("ggcevo_boss", {
4960
4971
  name: "string",
4972
+ groupId: "unsigned",
4961
4973
  type: "string",
4962
4974
  HP: "unsigned",
4963
4975
  energy: "unsigned",
4964
- tags: { type: "list", initial: [] },
4965
- skills: { type: "list", initial: [] },
4966
- // 明确数组元素类型
4967
- Skillcountpoints: "unsigned",
4968
- Vulnerability: "unsigned",
4969
- freezing: "unsigned",
4976
+ tags: "list",
4977
+ skills: "list",
4978
+ skillStacks: "unsigned",
4979
+ statusLayers: "unsigned",
4980
+ radiationLayers: "unsigned",
4981
+ coldLayers: "unsigned",
4970
4982
  lastWeaponName: "string",
4971
- // 新增字段,记录伪装技能的信息
4972
- groupId: "unsigned",
4973
4983
  isActive: "boolean",
4974
4984
  respawnTime: "timestamp"
4975
4985
  }, {
@@ -7241,7 +7251,6 @@ ${validTypes.join("、")}`;
7241
7251
  ctx.command("ggcevo/攻击 <bossName>").usage("请输入要攻击的异形名称(例如:攻击 异齿猛兽 或 攻击 寒冰王蛇)").action(async (argv, bossName) => {
7242
7252
  const session = argv.session;
7243
7253
  let bossEventBroadcast = null;
7244
- let scatterBroadcast = null;
7245
7254
  let cleanerRewardBroadcast = null;
7246
7255
  const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
7247
7256
  if (!profile) return "🔒 需要先绑定游戏句柄。";
@@ -7286,17 +7295,13 @@ ${validTypes.join("、")}`;
7286
7295
  const primaryAttackResult = await handlePrimaryAttack(
7287
7296
  ctx,
7288
7297
  session,
7289
- config2,
7290
7298
  handle,
7299
+ config2,
7291
7300
  equippedWeapon,
7292
7301
  targetBoss,
7293
7302
  activeBosses,
7294
- bossGroup,
7295
- weaponName,
7296
- weaponData,
7297
- maxHP
7303
+ weaponName
7298
7304
  );
7299
- await applyAttackResults(ctx, targetBoss, primaryAttackResult);
7300
7305
  const allDeadTargets = [];
7301
7306
  if (primaryAttackResult.isDefeated) {
7302
7307
  allDeadTargets.push(targetBoss);
@@ -7308,21 +7313,19 @@ ${validTypes.join("、")}`;
7308
7313
  scatterResult = await handleScatterAttack(
7309
7314
  ctx,
7310
7315
  session,
7311
- config2,
7312
7316
  handle,
7317
+ config2,
7313
7318
  equippedWeapon,
7314
7319
  targetBoss,
7315
7320
  weaponName,
7316
- weaponData,
7317
- activeBosses,
7318
- bossGroup
7321
+ activeBosses
7319
7322
  );
7320
7323
  scatterResult.actuallyDead.forEach((name2) => {
7321
7324
  const deadBoss = activeBosses.find((b) => b.name === name2);
7322
7325
  if (deadBoss) allDeadTargets.push(deadBoss);
7323
7326
  });
7324
7327
  }
7325
- const totalDamage = primaryAttackResult.damage + (scatterResult ? scatterResult.extraDamages.reduce((sum, d) => sum + d.damage, 0) : 0);
7328
+ const totalDamage = primaryAttackResult.initialDamage + (scatterResult ? scatterResult.extraDamages.reduce((sum, d) => sum + d.damage, 0) : 0);
7326
7329
  await updateBossDamageRecord(
7327
7330
  ctx,
7328
7331
  handle,
@@ -7347,7 +7350,7 @@ ${validTypes.join("、")}`;
7347
7350
  if (primaryAttackResult.freezing) {
7348
7351
  taskUpdates.push({ taskId: 2, count: 1 });
7349
7352
  }
7350
- if (primaryAttackResult.bileStacks >= 10) {
7353
+ if (primaryAttackResult.bileStacks) {
7351
7354
  taskUpdates.push({ taskId: 3, count: 1 });
7352
7355
  }
7353
7356
  if (primaryAttackResult.pulseApplied) {
@@ -7381,7 +7384,6 @@ ${validTypes.join("、")}`;
7381
7384
  await handleBroadcasts(
7382
7385
  ctx,
7383
7386
  groupId,
7384
- scatterResult?.scatterBroadcast || null,
7385
7387
  bossEventBroadcast,
7386
7388
  cleanerRewardBroadcast,
7387
7389
  !isScatterAttack
@@ -7483,11 +7485,11 @@ ${validTypes.join("、")}`;
7483
7485
  result.push(`⚡ 能量:${mainBoss.energy}/1000`);
7484
7486
  }
7485
7487
  result.push(`🏷️ 标签:${mainBoss.tags?.join("、") || "无"}`);
7486
- if (mainBoss.Vulnerability > 0) {
7487
- result.push(`☢️ 辐射:${mainBoss.Vulnerability}层`);
7488
+ if (mainBoss.radiationLayers > 0) {
7489
+ result.push(`☢️ 辐射:${mainBoss.radiationLayers}层`);
7488
7490
  }
7489
- if (mainBoss.freezing > 0) {
7490
- result.push(`❄️ 寒冷:${mainBoss.freezing}层`);
7491
+ if (mainBoss.coldLayers > 0) {
7492
+ result.push(`❄️ 寒冷:${mainBoss.coldLayers}层`);
7491
7493
  }
7492
7494
  result.push(`✨ 被动:`);
7493
7495
  if (mainBoss.skills.length > 0) {
@@ -7497,7 +7499,7 @@ ${validTypes.join("、")}`;
7497
7499
  }
7498
7500
  const countingSkill = mainBoss.skills?.find((s) => ["冷适应", "岗哨机枪", "吸血唾液", "灼烧粘液", "光影之刃"].includes(s));
7499
7501
  if (countingSkill) {
7500
- result.push(`📈 ${countingSkill}:${mainBoss.Skillcountpoints}层`);
7502
+ result.push(`📈 ${countingSkill}:${mainBoss.skillStacks}层`);
7501
7503
  }
7502
7504
  if (mainBoss.lastWeaponName) {
7503
7505
  result.push(`🎭 记录武器:${mainBoss.lastWeaponName}`);
@@ -7516,11 +7518,11 @@ ${validTypes.join("、")}`;
7516
7518
  minionInfo.push(`⚡ 能量:${minion.energy}/1000`);
7517
7519
  }
7518
7520
  minionInfo.push(`🏷️ 标签:${minion.tags?.join("、") || "无"}`);
7519
- if (minion.Vulnerability > 0) {
7520
- minionInfo.push(`☢️ 辐射:${minion.Vulnerability}层`);
7521
+ if (minion.radiationLayers > 0) {
7522
+ minionInfo.push(`☢️ 辐射:${minion.radiationLayers}层`);
7521
7523
  }
7522
- if (minion.freezing > 0) {
7523
- minionInfo.push(`❄️ 寒冷:${minion.freezing}层`);
7524
+ if (minion.coldLayers > 0) {
7525
+ minionInfo.push(`❄️ 寒冷:${minion.coldLayers}层`);
7524
7526
  }
7525
7527
  minionInfo.push(`✨ 被动:`);
7526
7528
  if (minion.skills.length > 0) {
@@ -7530,7 +7532,7 @@ ${validTypes.join("、")}`;
7530
7532
  }
7531
7533
  const minionCountingSkill = minion.skills?.find((s) => ["冷适应", "岗哨机枪", "吸血唾液", "灼烧粘液", "光影之刃"].includes(s));
7532
7534
  if (minionCountingSkill) {
7533
- minionInfo.push(`📈 ${minionCountingSkill}:${minion.Skillcountpoints}层`);
7535
+ minionInfo.push(`📈 ${minionCountingSkill}:${minion.skillStacks}层`);
7534
7536
  }
7535
7537
  if (minion.lastWeaponName) {
7536
7538
  minionInfo.push(`🎭 记录武器:${minion.lastWeaponName}`);