koishi-plugin-ggcevo-game 1.6.22 → 1.6.25
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/boss/attackhandling.d.ts +4 -0
- package/lib/index.js +166 -35
- package/package.json +1 -1
|
@@ -56,3 +56,7 @@ export declare function testAttackFunction(ctx: Context, session: any, handle: s
|
|
|
56
56
|
ignoreMessage: any[];
|
|
57
57
|
}>;
|
|
58
58
|
export declare function createNestlingBosses(ctx: any, nestlingNames: string | string[]): Promise<any[]>;
|
|
59
|
+
export declare function verifyFinalBlow(ctx: any, session: any, bossName: string, targetBoss: any): Promise<{
|
|
60
|
+
success: boolean;
|
|
61
|
+
updatedBoss?: any;
|
|
62
|
+
}>;
|
package/lib/index.js
CHANGED
|
@@ -662,7 +662,7 @@ var SyndicatedItems = {
|
|
|
662
662
|
description: "一种轻型手榴弹,含有易燃物质",
|
|
663
663
|
price: 0,
|
|
664
664
|
redCrystalCost: 0,
|
|
665
|
-
condition: "
|
|
665
|
+
condition: "无法对免疫燃烧的目标和空中目标使用",
|
|
666
666
|
effects: "使目标的燃烧层数增加5层"
|
|
667
667
|
},
|
|
668
668
|
"铝热炸弹": {
|
|
@@ -672,7 +672,7 @@ var SyndicatedItems = {
|
|
|
672
672
|
price: 0,
|
|
673
673
|
redCrystalCost: 0,
|
|
674
674
|
condition: "无法对空中目标使用",
|
|
675
|
-
effects: "
|
|
675
|
+
effects: "对目标造成100伤害;对建筑目标造成3倍伤害"
|
|
676
676
|
}
|
|
677
677
|
};
|
|
678
678
|
var initDefaultItems = {
|
|
@@ -735,7 +735,7 @@ var spaceStationCrewConfig = [
|
|
|
735
735
|
{
|
|
736
736
|
professionName: "警卫员下士",
|
|
737
737
|
effect: "攻击获得的金币+50%",
|
|
738
|
-
requirements: "当期伤害榜累计造成
|
|
738
|
+
requirements: "当期伤害榜累计造成100及以上伤害",
|
|
739
739
|
Jobtransfer: true,
|
|
740
740
|
costcoins: 3e3
|
|
741
741
|
},
|
|
@@ -827,7 +827,7 @@ var syndicatePirateConfig = [
|
|
|
827
827
|
},
|
|
828
828
|
{
|
|
829
829
|
professionName: "纵火狂",
|
|
830
|
-
effect: "热能武器攻击伤害+20%;
|
|
830
|
+
effect: "热能武器攻击伤害+20%; 探索获得莫洛托夫燃烧弹的概率提高20%并且有10%的概率额外获得1个;使用莫洛托夫燃烧弹的效果提高100%;购买龙息霰弹枪(传奇)享有50%的折扣",
|
|
831
831
|
requirements: "至少拥有一把3级及以上等级的热能武器",
|
|
832
832
|
Jobtransfer: true,
|
|
833
833
|
costredcrystal: 30
|
|
@@ -862,8 +862,8 @@ var syndicatePirateConfig = [
|
|
|
862
862
|
},
|
|
863
863
|
{
|
|
864
864
|
professionName: "破坏者",
|
|
865
|
-
effect: "黑市订购爆破物类享有50
|
|
866
|
-
requirements: "
|
|
865
|
+
effect: "黑市订购爆破物类享有50%折扣;探索获得爆破物的概率提高20%并且有10%的概率额外获得1个;使用爆破物的效果提高50%;购买核聚变重炮(传奇)享有50%的折扣",
|
|
866
|
+
requirements: "仓库中至少拥有一个爆破物类物品",
|
|
867
867
|
Jobtransfer: true,
|
|
868
868
|
costredcrystal: 30
|
|
869
869
|
},
|
|
@@ -923,8 +923,8 @@ async function checkTransferRequirements(ctx, handle, profession) {
|
|
|
923
923
|
case "警卫员下士": {
|
|
924
924
|
if (!mainBoss) return { success: false, message: "当前暂无伤害榜。" };
|
|
925
925
|
return {
|
|
926
|
-
success: totalDamage >=
|
|
927
|
-
message: `需要当期伤害榜累计造成
|
|
926
|
+
success: totalDamage >= 100,
|
|
927
|
+
message: `需要当期伤害榜累计造成100及以上伤害(当前${totalDamage})`
|
|
928
928
|
};
|
|
929
929
|
}
|
|
930
930
|
case "武器中士":
|
|
@@ -987,13 +987,13 @@ async function checkTransferRequirements(ctx, handle, profession) {
|
|
|
987
987
|
};
|
|
988
988
|
case "破坏者":
|
|
989
989
|
const warehouseItems = await ctx.database.get("ggcevo_warehouse", { handle });
|
|
990
|
-
const blackMarketExplosives = Object.values(SyndicatedItems).filter((item) => item.type === "爆破物" && item.redCrystalCost
|
|
990
|
+
const blackMarketExplosives = Object.values(SyndicatedItems).filter((item) => item.type === "爆破物" && item.redCrystalCost >= 0).map((item) => item.id);
|
|
991
991
|
const hasExplosive = warehouseItems.some(
|
|
992
|
-
(item) => blackMarketExplosives.includes(item.itemId) && item.quantity
|
|
992
|
+
(item) => blackMarketExplosives.includes(item.itemId) && item.quantity >= 0
|
|
993
993
|
);
|
|
994
994
|
return {
|
|
995
995
|
success: hasExplosive,
|
|
996
|
-
message: hasExplosive ? "" : "
|
|
996
|
+
message: hasExplosive ? "" : "需要仓库中拥有一个爆破物类物品"
|
|
997
997
|
};
|
|
998
998
|
case "装甲兵": {
|
|
999
999
|
const userWeapons = await ctx.database.get("ggcevo_weapons", {
|
|
@@ -5407,6 +5407,15 @@ var ggcevoUpdates = [
|
|
|
5407
5407
|
- 增强龙息霰弹枪特殊效果,并可引爆“灼烧粘液”
|
|
5408
5408
|
- 增强了人类联盟的总工程师职业效果
|
|
5409
5409
|
`.trim()
|
|
5410
|
+
},
|
|
5411
|
+
{
|
|
5412
|
+
version: "1.6.25",
|
|
5413
|
+
time: "2025-07-14",
|
|
5414
|
+
content: `
|
|
5415
|
+
- 当主宰的血量降低到2000以下时,卡点攻击新增验证码机制
|
|
5416
|
+
- 异形信息新增显示护甲削减值(动力钻头和传奇高斯的削减)
|
|
5417
|
+
- 增强了辛迪加海盗阵营的破坏者和纵火狂
|
|
5418
|
+
`.trim()
|
|
5410
5419
|
}
|
|
5411
5420
|
];
|
|
5412
5421
|
function compareVersions(a, b) {
|
|
@@ -5647,6 +5656,8 @@ async function calculateTotalPower(ctx, config, handle) {
|
|
|
5647
5656
|
__name(calculateTotalPower, "calculateTotalPower");
|
|
5648
5657
|
async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
|
|
5649
5658
|
try {
|
|
5659
|
+
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
5660
|
+
const playerCareer = careerData?.career;
|
|
5650
5661
|
const itemName = Object.entries(SyndicatedItems).find(
|
|
5651
5662
|
([_, item]) => item.id === itemConfig2.id
|
|
5652
5663
|
)?.[0] || "未知物品";
|
|
@@ -5795,6 +5806,14 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
|
|
|
5795
5806
|
message: `目标「${target}」未存活或不存在`,
|
|
5796
5807
|
isDefeated: false
|
|
5797
5808
|
};
|
|
5809
|
+
const aerialTargets = ["吸血蝙蝠首领", "吸血蝙蝠", "猛毒异兽", "剧毒蝙蝠"];
|
|
5810
|
+
if (aerialTargets.includes(targetBoss.name)) {
|
|
5811
|
+
return {
|
|
5812
|
+
success: false,
|
|
5813
|
+
message: "无法对空中目标使用",
|
|
5814
|
+
isDefeated: false
|
|
5815
|
+
};
|
|
5816
|
+
}
|
|
5798
5817
|
const immuneSkills = ["猎手异形", "环境适应"];
|
|
5799
5818
|
const isImmune = immuneSkills.some(
|
|
5800
5819
|
(skill) => targetBoss.skills?.includes(skill)
|
|
@@ -5804,8 +5823,14 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
|
|
|
5804
5823
|
message: `目标「${target}」免疫燃烧效果`,
|
|
5805
5824
|
isDefeated: false
|
|
5806
5825
|
};
|
|
5826
|
+
const baseLayers = 5;
|
|
5827
|
+
let bonusLayers = 0;
|
|
5828
|
+
if (playerCareer === "纵火狂") {
|
|
5829
|
+
bonusLayers = baseLayers;
|
|
5830
|
+
}
|
|
5807
5831
|
const currentLayers = targetBoss?.burnLayers || 0;
|
|
5808
|
-
const
|
|
5832
|
+
const totalLayers = baseLayers + bonusLayers;
|
|
5833
|
+
const newLayers = currentLayers + totalLayers;
|
|
5809
5834
|
await ctx.database.set(
|
|
5810
5835
|
"ggcevo_boss",
|
|
5811
5836
|
{ name: target },
|
|
@@ -5818,11 +5843,12 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
|
|
|
5818
5843
|
await ctx.database.upsert("ggcevo_task", [{
|
|
5819
5844
|
handle,
|
|
5820
5845
|
taskId: 7,
|
|
5821
|
-
progress: (taskRecord?.progress || 0) +
|
|
5846
|
+
progress: (taskRecord?.progress || 0) + totalLayers
|
|
5822
5847
|
}], ["handle", "taskId"]);
|
|
5848
|
+
const careerBonusMsg = playerCareer === "纵火狂" ? `(纵火狂使用莫洛托夫燃烧弹的效果提高100%)` : "";
|
|
5823
5849
|
return {
|
|
5824
5850
|
success: true,
|
|
5825
|
-
message: `成功使用${itemName},目标「${target}
|
|
5851
|
+
message: `成功使用${itemName},目标「${target}」的燃烧层数增加${totalLayers}层${careerBonusMsg}`,
|
|
5826
5852
|
isDefeated: false
|
|
5827
5853
|
};
|
|
5828
5854
|
}
|
|
@@ -5849,7 +5875,10 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
|
|
|
5849
5875
|
isDefeated: false
|
|
5850
5876
|
};
|
|
5851
5877
|
}
|
|
5852
|
-
|
|
5878
|
+
let baseDamage = 100;
|
|
5879
|
+
if (playerCareer === "破坏者") {
|
|
5880
|
+
baseDamage = Math.floor(baseDamage * 1.5);
|
|
5881
|
+
}
|
|
5853
5882
|
const isBuilding = targetBoss.tags?.includes("建筑");
|
|
5854
5883
|
const damage = isBuilding ? baseDamage * 3 : baseDamage;
|
|
5855
5884
|
const actualDamage = Math.min(damage, targetBoss.HP);
|
|
@@ -5870,11 +5899,18 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
|
|
|
5870
5899
|
handle,
|
|
5871
5900
|
totalRewards: (signRecords[0]?.totalRewards || 0) + damage
|
|
5872
5901
|
}], ["handle"]);
|
|
5902
|
+
const [damageRecords] = await ctx.database.get("ggcevo_boss_damage", { handle });
|
|
5903
|
+
await ctx.database.upsert("ggcevo_boss_damage", [{
|
|
5904
|
+
handle,
|
|
5905
|
+
playerName: session.username,
|
|
5906
|
+
totalDamage: (damageRecords?.totalDamage || 0) + damage
|
|
5907
|
+
}], ["handle"]);
|
|
5873
5908
|
});
|
|
5874
5909
|
}
|
|
5910
|
+
const careerBonusMsg = playerCareer === "破坏者" ? `(破坏者使用爆破物的效果提高50%)` : "";
|
|
5875
5911
|
return {
|
|
5876
5912
|
success: true,
|
|
5877
|
-
message: `成功使用${itemName},对${isBuilding ? "建筑目标" : "目标"}「${target}」造成${damage}点伤害${isDefeated ? ",目标已被消灭" : ""}`,
|
|
5913
|
+
message: `成功使用${itemName},对${isBuilding ? "建筑目标" : "目标"}「${target}」造成${damage}点伤害${isDefeated ? ",目标已被消灭" : ""}${careerBonusMsg}`,
|
|
5878
5914
|
isDefeated
|
|
5879
5915
|
};
|
|
5880
5916
|
}
|
|
@@ -7208,6 +7244,48 @@ async function createNestlingBosses(ctx, nestlingNames) {
|
|
|
7208
7244
|
return createdBosses;
|
|
7209
7245
|
}
|
|
7210
7246
|
__name(createNestlingBosses, "createNestlingBosses");
|
|
7247
|
+
async function verifyFinalBlow(ctx, session, bossName, targetBoss) {
|
|
7248
|
+
const isDominationBoss = targetBoss.type === "主宰";
|
|
7249
|
+
const isLowHealth = targetBoss.currentHealth < 2e3;
|
|
7250
|
+
const forbiddenSkills = ["求生本能I", "求生本能II", "复苏"];
|
|
7251
|
+
const hasResurrectionSkill = forbiddenSkills.some(
|
|
7252
|
+
(skill) => targetBoss.skills.includes(skill)
|
|
7253
|
+
);
|
|
7254
|
+
const currentTime = /* @__PURE__ */ new Date();
|
|
7255
|
+
const hours = currentTime.getHours();
|
|
7256
|
+
const minutes = currentTime.getMinutes();
|
|
7257
|
+
const isMidnightWindow = hours === 0 && minutes <= 5;
|
|
7258
|
+
const isNoonWindow = hours === 12 && minutes <= 5;
|
|
7259
|
+
if (!(isDominationBoss && isLowHealth && !hasResurrectionSkill && (isMidnightWindow || isNoonWindow))) {
|
|
7260
|
+
return { success: true, updatedBoss: targetBoss };
|
|
7261
|
+
}
|
|
7262
|
+
const verificationCode = Array(6).fill(0).map(
|
|
7263
|
+
() => Math.floor(Math.random() * 10)
|
|
7264
|
+
).join("");
|
|
7265
|
+
await session.send(
|
|
7266
|
+
`<quote id="${session.messageId}"/>⚠️ ${bossName}进入濒死状态!需完成安全验证
|
|
7267
|
+
请在30秒内输入验证码:【${verificationCode}】`
|
|
7268
|
+
);
|
|
7269
|
+
const userInput = (await session.prompt(3e4))?.trim();
|
|
7270
|
+
if (!userInput) {
|
|
7271
|
+
await session.send("⏱️ 验证超时!请重新发起攻击。");
|
|
7272
|
+
return { success: false };
|
|
7273
|
+
}
|
|
7274
|
+
if (userInput !== verificationCode) {
|
|
7275
|
+
await session.send("❌ 验证码错误!攻击已中断。");
|
|
7276
|
+
return { success: false };
|
|
7277
|
+
}
|
|
7278
|
+
const [updatedBoss] = await ctx.database.get("ggcevo_boss", {
|
|
7279
|
+
name: bossName,
|
|
7280
|
+
isActive: true
|
|
7281
|
+
});
|
|
7282
|
+
if (!updatedBoss) {
|
|
7283
|
+
await session.send(`✅ 验证通过!但${bossName}已被其他玩家消灭。`);
|
|
7284
|
+
return { success: false };
|
|
7285
|
+
}
|
|
7286
|
+
return { success: true, updatedBoss };
|
|
7287
|
+
}
|
|
7288
|
+
__name(verifyFinalBlow, "verifyFinalBlow");
|
|
7211
7289
|
|
|
7212
7290
|
// src/spaceship.ts
|
|
7213
7291
|
var spaceship = {
|
|
@@ -10086,9 +10164,20 @@ ${discountDetails.join("\n")}`;
|
|
|
10086
10164
|
}
|
|
10087
10165
|
const [equippedWeapon] = await ctx.database.get("ggcevo_weapons", { handle, equipped: true });
|
|
10088
10166
|
if (!equippedWeapon) return '请先输入"装备 武器名称"后再攻击。';
|
|
10167
|
+
const verification = await verifyFinalBlow(
|
|
10168
|
+
ctx,
|
|
10169
|
+
session,
|
|
10170
|
+
bossName,
|
|
10171
|
+
targetBoss
|
|
10172
|
+
// 当前目标BOSS
|
|
10173
|
+
);
|
|
10174
|
+
if (!verification.success) {
|
|
10175
|
+
return "攻击已取消";
|
|
10176
|
+
}
|
|
10177
|
+
const verifiedBoss = verification.updatedBoss || targetBoss;
|
|
10089
10178
|
const weaponConfigEntry = Object.entries(weaponConfig).find(([_, c]) => c.id === equippedWeapon.weaponId);
|
|
10090
10179
|
const [weaponName, weaponData] = weaponConfigEntry;
|
|
10091
|
-
if (!weaponData.isantiair && (
|
|
10180
|
+
if (!weaponData.isantiair && (verifiedBoss.groupId === 5 || verifiedBoss.groupId === 10)) {
|
|
10092
10181
|
return "您当前装备的武器无法攻击空中目标!";
|
|
10093
10182
|
}
|
|
10094
10183
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
@@ -10098,17 +10187,17 @@ ${discountDetails.join("\n")}`;
|
|
|
10098
10187
|
handle,
|
|
10099
10188
|
config2,
|
|
10100
10189
|
equippedWeapon,
|
|
10101
|
-
|
|
10190
|
+
verifiedBoss,
|
|
10102
10191
|
activeBosses,
|
|
10103
10192
|
weaponName,
|
|
10104
10193
|
careerData
|
|
10105
10194
|
);
|
|
10106
10195
|
const allDeadTargets = [];
|
|
10107
10196
|
if (primaryAttackResult.isDefeated) {
|
|
10108
|
-
allDeadTargets.push(
|
|
10197
|
+
allDeadTargets.push(verifiedBoss);
|
|
10109
10198
|
}
|
|
10110
10199
|
let scatterResult = null;
|
|
10111
|
-
const hasOtherBosses = activeBosses.some((b) => b.name !==
|
|
10200
|
+
const hasOtherBosses = activeBosses.some((b) => b.name !== verifiedBoss.name);
|
|
10112
10201
|
const isScatterAttack = (equippedWeapon.installedMods?.includes("光束曲射晶片") && weaponName === "碎骨步枪" || weaponName === "中子步枪" || weaponName === "DG-3电弧步枪") && hasOtherBosses;
|
|
10113
10202
|
if (isScatterAttack) {
|
|
10114
10203
|
scatterResult = await handleScatterAttack(
|
|
@@ -10117,7 +10206,7 @@ ${discountDetails.join("\n")}`;
|
|
|
10117
10206
|
handle,
|
|
10118
10207
|
config2,
|
|
10119
10208
|
equippedWeapon,
|
|
10120
|
-
|
|
10209
|
+
verifiedBoss,
|
|
10121
10210
|
weaponName,
|
|
10122
10211
|
activeBosses,
|
|
10123
10212
|
careerData
|
|
@@ -10132,7 +10221,7 @@ ${discountDetails.join("\n")}`;
|
|
|
10132
10221
|
ctx,
|
|
10133
10222
|
handle,
|
|
10134
10223
|
session.username,
|
|
10135
|
-
|
|
10224
|
+
verifiedBoss.groupId,
|
|
10136
10225
|
// 注意:所有伤害都计入同一个BOSS组
|
|
10137
10226
|
totalDamage
|
|
10138
10227
|
);
|
|
@@ -10219,7 +10308,7 @@ ${discountDetails.join("\n")}`;
|
|
|
10219
10308
|
const resultMessage = buildResultMessage(
|
|
10220
10309
|
session,
|
|
10221
10310
|
weaponName,
|
|
10222
|
-
|
|
10311
|
+
verifiedBoss,
|
|
10223
10312
|
primaryAttackResult,
|
|
10224
10313
|
scatterResult,
|
|
10225
10314
|
finalReward,
|
|
@@ -10390,6 +10479,10 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
10390
10479
|
result.push(`⚡ 能量:${mainBoss.energy}/1000`);
|
|
10391
10480
|
}
|
|
10392
10481
|
result.push(`🛡️ 护甲:${bossGroup.main.armor || 0}`);
|
|
10482
|
+
if (mainBoss.armorReductionLayers > 0) {
|
|
10483
|
+
const reductionValue = mainBoss.armorReductionLayers * 0.1;
|
|
10484
|
+
result.push(`🔻 护甲削减:${reductionValue.toFixed(1)}`);
|
|
10485
|
+
}
|
|
10393
10486
|
result.push(`🏷️ 标签:${mainBoss.tags?.join("、") || "无"}`);
|
|
10394
10487
|
if (mainBoss.radiationLayers > 0) {
|
|
10395
10488
|
result.push(`☢️ 辐射:${mainBoss.radiationLayers}层`);
|
|
@@ -10457,6 +10550,10 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
10457
10550
|
minionInfo.push(`⚡ 能量:${minion.energy}/1000`);
|
|
10458
10551
|
}
|
|
10459
10552
|
minionInfo.push(`🛡️ 护甲:${minionConfig?.armor || 0}`);
|
|
10553
|
+
if (minion.armorReductionLayers > 0) {
|
|
10554
|
+
const reductionValue = minion.armorReductionLayers * 0.1;
|
|
10555
|
+
minionInfo.push(`🔻 护甲削减:${reductionValue.toFixed(1)}`);
|
|
10556
|
+
}
|
|
10460
10557
|
minionInfo.push(`🏷️ 标签:${minion.tags?.join("、") || "无"}`);
|
|
10461
10558
|
if (minion.radiationLayers > 0) {
|
|
10462
10559
|
minionInfo.push(`☢️ 辐射:${minion.radiationLayers}层`);
|
|
@@ -11899,10 +11996,10 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
11899
11996
|
});
|
|
11900
11997
|
ctx.command("ggcevo/探索 [galaxyName]").action(async ({ session }, galaxyName) => {
|
|
11901
11998
|
const possibleItems = [
|
|
11902
|
-
{ id: 2, name: "闪光弹", chance: 0.1 },
|
|
11903
|
-
{ id: 4, name: "脉冲手雷", chance: 0.1 },
|
|
11904
|
-
{ id: 9, name: "莫洛托夫燃烧弹", chance: 0.05 },
|
|
11905
|
-
{ id: 10, name: "铝热炸弹", chance: 0.05 }
|
|
11999
|
+
{ id: 2, name: "闪光弹", type: "手榴弹", chance: 0.1 },
|
|
12000
|
+
{ id: 4, name: "脉冲手雷", type: "手榴弹", chance: 0.1 },
|
|
12001
|
+
{ id: 9, name: "莫洛托夫燃烧弹", type: "手榴弹", chance: 0.05 },
|
|
12002
|
+
{ id: 10, name: "铝热炸弹", type: "爆破物", chance: 0.05 }
|
|
11906
12003
|
];
|
|
11907
12004
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
11908
12005
|
if (!profile) return "🔒 需要先绑定游戏句柄。";
|
|
@@ -11915,6 +12012,18 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
11915
12012
|
const careerName = career?.career;
|
|
11916
12013
|
const careerCoinBonus = careerName === "总工程师" ? 50 : 0;
|
|
11917
12014
|
const engineerSuccessBonus = careerName === "总工程师" ? 0.1 : 0;
|
|
12015
|
+
let demolitionsBonus = 0;
|
|
12016
|
+
let bomberBonusItem = "";
|
|
12017
|
+
if (careerName === "破坏者") {
|
|
12018
|
+
demolitionsBonus = 0.2;
|
|
12019
|
+
bomberBonusItem = "爆破物";
|
|
12020
|
+
}
|
|
12021
|
+
let arsonistBonus = 0;
|
|
12022
|
+
let molotovBonusItem = "";
|
|
12023
|
+
if (careerName === "纵火狂") {
|
|
12024
|
+
arsonistBonus = 0.2;
|
|
12025
|
+
molotovBonusItem = "莫洛托夫燃烧弹";
|
|
12026
|
+
}
|
|
11918
12027
|
const [shipRecord] = await ctx.database.get("ggcevo_spaceship", { handle });
|
|
11919
12028
|
let shipBonus = 0;
|
|
11920
12029
|
let plunderRateBonus = 0;
|
|
@@ -12015,6 +12124,12 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
12015
12124
|
if (careerCoinBonus) {
|
|
12016
12125
|
bonusEffects.push(`▸ 🎓 总工程师职业:金币+${careerCoinBonus}%`);
|
|
12017
12126
|
}
|
|
12127
|
+
if (demolitionsBonus > 0) {
|
|
12128
|
+
bonusEffects.push(`▸ 💣 破坏者职业:${bomberBonusItem}获得概率+${demolitionsBonus * 100}%`);
|
|
12129
|
+
}
|
|
12130
|
+
if (arsonistBonus > 0) {
|
|
12131
|
+
bonusEffects.push(`▸ 🔥 纵火狂职业:${molotovBonusItem}获得概率+${arsonistBonus * 100}%`);
|
|
12132
|
+
}
|
|
12018
12133
|
const totalBonusMultiplier = 1 + (galaxyBonusPercent + shipBonus + (record.plunderbonus || 0) + (techBonusRate + careerBonusRate) * 100 + careerCoinBonus) / 100;
|
|
12019
12134
|
let finalCoin = Math.floor(baseCoinReward * totalBonusMultiplier);
|
|
12020
12135
|
const isSuccess = Math.random() < successRate;
|
|
@@ -12040,26 +12155,42 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
12040
12155
|
const availableItems = galaxyData2.available;
|
|
12041
12156
|
for (const item of possibleItems) {
|
|
12042
12157
|
if (availableItems.includes(item.name)) {
|
|
12043
|
-
|
|
12158
|
+
let dropRate = item.chance + itemDropBonus;
|
|
12159
|
+
if (careerName === "破坏者" && item.type === bomberBonusItem) {
|
|
12160
|
+
dropRate += demolitionsBonus;
|
|
12161
|
+
}
|
|
12162
|
+
if (careerName === "纵火狂" && item.name === molotovBonusItem) {
|
|
12163
|
+
dropRate += arsonistBonus;
|
|
12164
|
+
}
|
|
12044
12165
|
if (Math.random() < dropRate) {
|
|
12045
12166
|
const [existing] = await ctx.database.get("ggcevo_warehouse", {
|
|
12046
12167
|
handle,
|
|
12047
12168
|
itemId: item.id
|
|
12048
12169
|
});
|
|
12170
|
+
let extraDrop = 0;
|
|
12171
|
+
if (careerName === "破坏者" && item.type === bomberBonusItem && Math.random() < 0.1) {
|
|
12172
|
+
extraDrop = 1;
|
|
12173
|
+
bonusEffects.push(`▸ 💣 破坏者职业效果:额外获得${item.name}×1`);
|
|
12174
|
+
}
|
|
12175
|
+
if (careerName === "纵火狂" && item.name === molotovBonusItem && Math.random() < 0.1) {
|
|
12176
|
+
extraDrop = 1;
|
|
12177
|
+
bonusEffects.push(`▸ 🔥 纵火狂职业效果:额外获得${item.name}×1`);
|
|
12178
|
+
}
|
|
12179
|
+
const finalQuantity = 1 + extraDrop;
|
|
12049
12180
|
if (existing) {
|
|
12050
12181
|
await ctx.database.set("ggcevo_warehouse", {
|
|
12051
12182
|
handle,
|
|
12052
12183
|
itemId: item.id
|
|
12053
|
-
}, { quantity: existing.quantity +
|
|
12184
|
+
}, { quantity: existing.quantity + finalQuantity });
|
|
12054
12185
|
} else {
|
|
12055
12186
|
await ctx.database.create("ggcevo_warehouse", {
|
|
12056
12187
|
handle,
|
|
12057
12188
|
itemId: item.id,
|
|
12058
|
-
quantity:
|
|
12189
|
+
quantity: finalQuantity,
|
|
12059
12190
|
bonus: 0
|
|
12060
12191
|
});
|
|
12061
12192
|
}
|
|
12062
|
-
itemRewards.push(item.name);
|
|
12193
|
+
itemRewards.push(`${item.name}${extraDrop > 0 ? `×${finalQuantity}` : ""}`);
|
|
12063
12194
|
}
|
|
12064
12195
|
}
|
|
12065
12196
|
}
|
|
@@ -12100,7 +12231,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
12100
12231
|
`【${name3}】`,
|
|
12101
12232
|
`- 成功率:${(info.success * 100).toFixed(0)}%`,
|
|
12102
12233
|
`- 金币加成:${bonusPercent > 0 ? "+" : ""}${bonusPercent}%`,
|
|
12103
|
-
`-
|
|
12234
|
+
`- 可获得物品:${info.available.join("、") || "无"}`,
|
|
12104
12235
|
`- 特殊效果:${info.effect}`
|
|
12105
12236
|
].join("\n"));
|
|
12106
12237
|
}
|
|
@@ -12148,7 +12279,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
12148
12279
|
if (shipRecord?.id === 3) baseSuccessRate += 10;
|
|
12149
12280
|
if (isTargetBehemoth && !isBehemoth) {
|
|
12150
12281
|
baseSuccessRate -= 30;
|
|
12151
|
-
defenseNote = "⚠️ 目标飞船为庞兽号歼星舰,掠夺成功率降低30
|
|
12282
|
+
defenseNote = "⚠️ 目标飞船为庞兽号歼星舰,掠夺成功率降低30%!";
|
|
12152
12283
|
}
|
|
12153
12284
|
baseSuccessRate = Math.max(0, Math.min(baseSuccessRate, 100));
|
|
12154
12285
|
await session.send([
|
|
@@ -12216,7 +12347,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
12216
12347
|
`⏳ 持续时间:12小时`,
|
|
12217
12348
|
`📊 预计成功率:${estimatedRate.toFixed(0)}%`,
|
|
12218
12349
|
`📦 可获得物品:${galaxyData.available.join("、") || "无"}`,
|
|
12219
|
-
|
|
12350
|
+
`💰 预计可获得50-100金币`
|
|
12220
12351
|
].join("\n");
|
|
12221
12352
|
});
|
|
12222
12353
|
const shipIdToName = {};
|
|
@@ -12537,7 +12668,7 @@ ${validBossNames.join("、")}`;
|
|
|
12537
12668
|
"✅ 竞猜成功!",
|
|
12538
12669
|
`项目ID: ${parsedItemId}`,
|
|
12539
12670
|
`项目描述: ${targetItem.description}`,
|
|
12540
|
-
`竞猜内容:
|
|
12671
|
+
`竞猜内容: ${guess}`,
|
|
12541
12672
|
`投入金额: ${betAmount} 金币`,
|
|
12542
12673
|
`如猜中将获得: ${Math.floor(betAmount * targetItem.odds)} 金币`,
|
|
12543
12674
|
"⏳ 每个项目只能下注一次"
|