koishi-plugin-ggcevo-game 1.6.58 → 1.6.60
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 +154 -56
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -74,7 +74,7 @@ var weaponConfig = {
|
|
|
74
74
|
damage: 23,
|
|
75
75
|
armorDamageReduction: 0.25,
|
|
76
76
|
description: "基于热能的强大武器,烧烬一切",
|
|
77
|
-
specialeffect: "攻击时为目标附加1层[燃烧]效果,每层使目标受到火焰伤害时额外造成
|
|
77
|
+
specialeffect: "攻击时为目标附加1层[燃烧]效果,每层使目标受到火焰伤害时额外造成1点伤害(至多额外造成100点伤害)",
|
|
78
78
|
price: 450,
|
|
79
79
|
redCrystalCost: 4,
|
|
80
80
|
isantiair: false,
|
|
@@ -388,7 +388,7 @@ var weaponConfig = {
|
|
|
388
388
|
damage: 90,
|
|
389
389
|
armorDamageReduction: 0,
|
|
390
390
|
description: "这是传说中的武器",
|
|
391
|
-
specialeffect: "造成的20%伤害转化为火焰伤害;攻击时为目标附加2层[燃烧]效果,每层使目标受到火焰伤害时额外造成
|
|
391
|
+
specialeffect: "造成的20%伤害转化为火焰伤害;攻击时为目标附加2层[燃烧]效果,每层使目标受到火焰伤害时额外造成1点伤害(至多额外造成100点伤害)",
|
|
392
392
|
price: 6400,
|
|
393
393
|
redCrystalCost: 200,
|
|
394
394
|
isantiair: false,
|
|
@@ -4616,8 +4616,8 @@ function applyPassiveEffects(targetBoss, activeBosses, weaponName, damage, hasCr
|
|
|
4616
4616
|
finalDamage *= 2;
|
|
4617
4617
|
}
|
|
4618
4618
|
if (weaponName === "焚烧枪" || weaponName === "龙息霰弹枪") {
|
|
4619
|
-
const currentBurnLayers = Math.min(targetBoss?.burnLayers || 0,
|
|
4620
|
-
const burnDamage = currentBurnLayers *
|
|
4619
|
+
const currentBurnLayers = Math.min(targetBoss?.burnLayers || 0, 100);
|
|
4620
|
+
const burnDamage = currentBurnLayers * 1;
|
|
4621
4621
|
if (burnDamage > 0) {
|
|
4622
4622
|
messages.push(`🔥 【燃烧】效果造成额外${burnDamage}点伤害`);
|
|
4623
4623
|
}
|
|
@@ -5507,6 +5507,21 @@ var ggcevoUpdates = [
|
|
|
5507
5507
|
- 回调了祈愿“喵喵财源”效果
|
|
5508
5508
|
- 兑换赞助物品新增当前赛季场数要求
|
|
5509
5509
|
`.trim()
|
|
5510
|
+
},
|
|
5511
|
+
{
|
|
5512
|
+
version: "1.6.59",
|
|
5513
|
+
time: "2025-08-2",
|
|
5514
|
+
content: `
|
|
5515
|
+
- 修改铝热炸弹的机制,现在无法直接击杀异形
|
|
5516
|
+
- 削弱了燃烧机制,现在每一层额外造成1点伤害(上限依旧是100点)
|
|
5517
|
+
`.trim()
|
|
5518
|
+
},
|
|
5519
|
+
{
|
|
5520
|
+
version: "1.6.60",
|
|
5521
|
+
time: "2025-08-4",
|
|
5522
|
+
content: `
|
|
5523
|
+
- 新增兑换资源,1张兑换券可以兑换20张资源兑换券
|
|
5524
|
+
`.trim()
|
|
5510
5525
|
}
|
|
5511
5526
|
];
|
|
5512
5527
|
function compareVersions(a, b) {
|
|
@@ -12710,7 +12725,7 @@ ${validBossNames.join("、")}`;
|
|
|
12710
12725
|
return "⚠️ 竞猜提交失败,请重试";
|
|
12711
12726
|
}
|
|
12712
12727
|
});
|
|
12713
|
-
ctx.command("ggcevo/兑换资源 [name] [amount]").usage('输入"兑换资源"
|
|
12728
|
+
ctx.command("ggcevo/兑换资源 [name] [amount]").alias("兑换").usage('输入"兑换资源"查看可兑换物品列表\n输入"兑换资源 物品名称 [数量]"进行兑换').action(async ({ session }, name2, amount) => {
|
|
12714
12729
|
const Curfew = fixedCurfewCheck(session, config);
|
|
12715
12730
|
if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。\n请添加C.O.R.E为好友使用私聊指令,好友验证信息为【咕咕之战】。";
|
|
12716
12731
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
@@ -12719,71 +12734,154 @@ ${validBossNames.join("、")}`;
|
|
|
12719
12734
|
if ((await ctx.database.get("ggcevo_blacklist", { handle })).length) {
|
|
12720
12735
|
return "⛔ 您已被列入黑名单。";
|
|
12721
12736
|
}
|
|
12722
|
-
const
|
|
12723
|
-
|
|
12724
|
-
"
|
|
12737
|
+
const exchangeItems = {
|
|
12738
|
+
// === 特殊资源兑换 ===
|
|
12739
|
+
"金币": {
|
|
12740
|
+
type: "resource",
|
|
12741
|
+
costItemId: 8,
|
|
12742
|
+
costAmount: 1,
|
|
12743
|
+
valuePerCoupon: 100,
|
|
12744
|
+
currencyField: "totalRewards",
|
|
12745
|
+
table: "ggcevo_sign",
|
|
12746
|
+
display: "1张资源兑换券 → 100金币"
|
|
12747
|
+
},
|
|
12748
|
+
"红晶": {
|
|
12749
|
+
type: "resource",
|
|
12750
|
+
costItemId: 8,
|
|
12751
|
+
costAmount: 1,
|
|
12752
|
+
valuePerCoupon: 1,
|
|
12753
|
+
currencyField: "redcrystal",
|
|
12754
|
+
table: "ggcevo_careers",
|
|
12755
|
+
display: "1张资源兑换券 → 1红晶",
|
|
12756
|
+
preCheck: /* @__PURE__ */ __name(async () => {
|
|
12757
|
+
const [career] = await ctx.database.get("ggcevo_careers", { handle });
|
|
12758
|
+
if (!career || career.group !== "辛迪加海盗") {
|
|
12759
|
+
return `⚠️ 兑换失败:仅限【辛迪加海盗】组织成员兑换,您当前属于【${career?.group || "无"}】`;
|
|
12760
|
+
}
|
|
12761
|
+
return null;
|
|
12762
|
+
}, "preCheck")
|
|
12763
|
+
},
|
|
12764
|
+
// === 物品兑换 ===
|
|
12765
|
+
"资源兑换券": {
|
|
12766
|
+
type: "item",
|
|
12767
|
+
costItemId: 2,
|
|
12768
|
+
// 消耗:ItemID=2 (兑换券)
|
|
12769
|
+
costAmount: 1,
|
|
12770
|
+
// 每张兑换券消耗数量
|
|
12771
|
+
gainItemId: 8,
|
|
12772
|
+
// 获得:ItemID=8 (资源兑换券)
|
|
12773
|
+
gainAmount: 20,
|
|
12774
|
+
// 获得数量
|
|
12775
|
+
display: "1张兑换券 → 20张资源兑换券"
|
|
12776
|
+
}
|
|
12777
|
+
// 可在此继续添加其他物品兑换...
|
|
12725
12778
|
};
|
|
12726
12779
|
if (!name2) {
|
|
12727
|
-
const [
|
|
12728
|
-
|
|
12729
|
-
itemId: 8
|
|
12730
|
-
});
|
|
12780
|
+
const [resourceCoupon] = await ctx.database.get("ggcevo_backpack", { handle, itemId: 8 });
|
|
12781
|
+
const [exchangeCoupon] = await ctx.database.get("ggcevo_backpack", { handle, itemId: 2 });
|
|
12731
12782
|
return [
|
|
12732
|
-
"
|
|
12783
|
+
"🛒 资源兑换商店 🛒",
|
|
12733
12784
|
'使用 "兑换资源 物品名称 数量" 进行兑换',
|
|
12734
|
-
`您当前持有: ${coupon?.quantity || 0}张资源兑换券`,
|
|
12735
12785
|
"====================",
|
|
12736
|
-
|
|
12786
|
+
`🪙 资源兑换券: ${resourceCoupon?.quantity || 0}张`,
|
|
12787
|
+
`🎟️ 兑换券: ${exchangeCoupon?.quantity || 0}张`,
|
|
12737
12788
|
"====================",
|
|
12738
|
-
|
|
12789
|
+
...Object.entries(exchangeItems).map(([itemName, config2]) => {
|
|
12790
|
+
return `▸ ${itemName}: ${config2.display}`;
|
|
12791
|
+
}),
|
|
12792
|
+
"====================",
|
|
12793
|
+
"输入示例:",
|
|
12794
|
+
'"兑换资源 金币 5" → 兑换500金币(消耗5张资源券)',
|
|
12795
|
+
'"兑换资源 资源兑换券 2" → 兑换40张资源券(消耗2张兑换券)'
|
|
12739
12796
|
].join("\n");
|
|
12740
12797
|
}
|
|
12741
|
-
const
|
|
12742
|
-
if (!
|
|
12743
|
-
|
|
12744
|
-
|
|
12745
|
-
|
|
12746
|
-
return `⚠️ 兑换红晶失败:仅限【辛迪加海盗】组织成员兑换,您当前属于【${career?.group || "无"}】`;
|
|
12747
|
-
}
|
|
12748
|
-
}
|
|
12749
|
-
const exchangeAmount = parseInt(amount) || 1;
|
|
12750
|
-
if (exchangeAmount <= 0 || exchangeAmount > 100) return "⚠️ 兑换数量需在1-100之间";
|
|
12751
|
-
const [couponItem] = await ctx.database.get("ggcevo_backpack", {
|
|
12752
|
-
handle,
|
|
12753
|
-
itemId: 8
|
|
12754
|
-
});
|
|
12755
|
-
const couponCount = couponItem?.quantity || 0;
|
|
12756
|
-
if (couponCount < exchangeAmount) {
|
|
12757
|
-
return `⚠️ 兑换券不足,需要${exchangeAmount}张,当前持有:${couponCount}张`;
|
|
12758
|
-
}
|
|
12759
|
-
const gainAmount = itemconfig.valuePerCoupon * exchangeAmount;
|
|
12798
|
+
const itemConfig2 = exchangeItems[name2];
|
|
12799
|
+
if (!itemConfig2) return `⚠️ 无效物品名称,可用选项:${Object.keys(exchangeItems).join("、")}`;
|
|
12800
|
+
let exchangeCount = parseInt(amount) || 1;
|
|
12801
|
+
if (exchangeCount <= 0) return "⚠️ 兑换数量必须大于0";
|
|
12802
|
+
if (exchangeCount > 100) return "⚠️ 单次最多兑换100次";
|
|
12760
12803
|
try {
|
|
12761
|
-
|
|
12762
|
-
|
|
12763
|
-
|
|
12764
|
-
|
|
12765
|
-
|
|
12766
|
-
|
|
12767
|
-
|
|
12768
|
-
|
|
12804
|
+
if (itemConfig2.type === "resource") {
|
|
12805
|
+
if (itemConfig2.preCheck) {
|
|
12806
|
+
const checkResult = await itemConfig2.preCheck();
|
|
12807
|
+
if (checkResult) return checkResult;
|
|
12808
|
+
}
|
|
12809
|
+
const [costItem] = await ctx.database.get("ggcevo_backpack", {
|
|
12810
|
+
handle,
|
|
12811
|
+
itemId: itemConfig2.costItemId
|
|
12812
|
+
});
|
|
12813
|
+
const requiredCoupons = exchangeCount * itemConfig2.costAmount;
|
|
12814
|
+
const heldCoupons = costItem?.quantity || 0;
|
|
12815
|
+
if (heldCoupons < requiredCoupons) {
|
|
12816
|
+
return `⚠️ ${name2}不足,需要${requiredCoupons}张资源兑换券,当前持有:${heldCoupons}张`;
|
|
12817
|
+
}
|
|
12818
|
+
const gainAmount = itemConfig2.valuePerCoupon * exchangeCount;
|
|
12819
|
+
await ctx.database.withTransaction(async () => {
|
|
12769
12820
|
await ctx.database.set(
|
|
12770
|
-
|
|
12771
|
-
{ handle },
|
|
12772
|
-
{
|
|
12821
|
+
"ggcevo_backpack",
|
|
12822
|
+
{ handle, itemId: itemConfig2.costItemId },
|
|
12823
|
+
{ quantity: heldCoupons - requiredCoupons }
|
|
12773
12824
|
);
|
|
12774
|
-
|
|
12775
|
-
|
|
12825
|
+
const [record] = await ctx.database.get(itemConfig2.table, { handle });
|
|
12826
|
+
if (record) {
|
|
12827
|
+
await ctx.database.set(
|
|
12828
|
+
itemConfig2.table,
|
|
12829
|
+
{ handle },
|
|
12830
|
+
{ [itemConfig2.currencyField]: record[itemConfig2.currencyField] + gainAmount }
|
|
12831
|
+
);
|
|
12832
|
+
} else {
|
|
12833
|
+
await ctx.database.create(itemConfig2.table, {
|
|
12834
|
+
handle,
|
|
12835
|
+
userId: session.userId,
|
|
12836
|
+
[itemConfig2.currencyField]: gainAmount,
|
|
12837
|
+
...itemConfig2.table === "ggcevo_sign" ? { lastSign: /* @__PURE__ */ new Date() } : {}
|
|
12838
|
+
});
|
|
12839
|
+
}
|
|
12840
|
+
});
|
|
12841
|
+
return `🎉 兑换成功!使用${requiredCoupons}张资源券兑换了${gainAmount}${name2}`;
|
|
12842
|
+
} else if (itemConfig2.type === "item") {
|
|
12843
|
+
const [costItem] = await ctx.database.get("ggcevo_backpack", {
|
|
12844
|
+
handle,
|
|
12845
|
+
itemId: itemConfig2.costItemId
|
|
12846
|
+
});
|
|
12847
|
+
const requiredQuantity = exchangeCount * itemConfig2.costAmount;
|
|
12848
|
+
const heldQuantity = costItem?.quantity || 0;
|
|
12849
|
+
if (heldQuantity < requiredQuantity) {
|
|
12850
|
+
const requiredName = itemConfig2.costItemId === 2 ? "兑换券" : "物品";
|
|
12851
|
+
return `⚠️ ${name2}不足,需要${requiredQuantity}张${requiredName},当前持有:${heldQuantity}张`;
|
|
12852
|
+
}
|
|
12853
|
+
const gainQuantity = exchangeCount * itemConfig2.gainAmount;
|
|
12854
|
+
await ctx.database.withTransaction(async () => {
|
|
12855
|
+
await ctx.database.set(
|
|
12856
|
+
"ggcevo_backpack",
|
|
12857
|
+
{ handle, itemId: itemConfig2.costItemId },
|
|
12858
|
+
{ quantity: heldQuantity - requiredQuantity }
|
|
12859
|
+
);
|
|
12860
|
+
const [targetItem] = await ctx.database.get("ggcevo_backpack", {
|
|
12776
12861
|
handle,
|
|
12777
|
-
|
|
12778
|
-
[itemconfig.currencyField]: gainAmount,
|
|
12779
|
-
...itemconfig.table === "ggcevo_sign" ? { lastSign: /* @__PURE__ */ new Date() } : {}
|
|
12862
|
+
itemId: itemConfig2.gainItemId
|
|
12780
12863
|
});
|
|
12781
|
-
|
|
12782
|
-
|
|
12783
|
-
|
|
12864
|
+
if (targetItem) {
|
|
12865
|
+
await ctx.database.set(
|
|
12866
|
+
"ggcevo_backpack",
|
|
12867
|
+
{ handle, itemId: itemConfig2.gainItemId },
|
|
12868
|
+
{ quantity: targetItem.quantity + gainQuantity }
|
|
12869
|
+
);
|
|
12870
|
+
} else {
|
|
12871
|
+
await ctx.database.create("ggcevo_backpack", {
|
|
12872
|
+
handle,
|
|
12873
|
+
itemId: itemConfig2.gainItemId,
|
|
12874
|
+
quantity: gainQuantity
|
|
12875
|
+
});
|
|
12876
|
+
}
|
|
12877
|
+
});
|
|
12878
|
+
const costName = itemConfig2.costItemId === 2 ? "兑换券" : "物品";
|
|
12879
|
+
return `🔄 兑换成功!使用${requiredQuantity}张${costName}兑换了${gainQuantity}张${name2}`;
|
|
12880
|
+
}
|
|
12881
|
+
return "⚠️ 未知的兑换类型";
|
|
12784
12882
|
} catch (error) {
|
|
12785
|
-
console.error("
|
|
12786
|
-
return "⚠️
|
|
12883
|
+
console.error("兑换失败:", error);
|
|
12884
|
+
return "⚠️ 兑换过程中出错,请稍后再试";
|
|
12787
12885
|
}
|
|
12788
12886
|
});
|
|
12789
12887
|
ctx.command("ggcevo/签到奖励").action(({}) => {
|