一将成名2024一系列bugfix

This commit is contained in:
mengxinzxz 2024-05-01 15:29:52 +08:00
parent 74e6903d84
commit 236402ad64
1 changed files with 16 additions and 16 deletions

View File

@ -115,7 +115,7 @@ game.import("character", function () {
linghuyu: ["male", "wei", 4, ["xvzhi"]], linghuyu: ["male", "wei", 4, ["xvzhi"]],
yj_simafu: ["male", "wei", 3, ["beiyu", "duchi"]], yj_simafu: ["male", "wei", 3, ["beiyu", "duchi"]],
yj_xuangongzhu: ["female", "wei", 3, ["qimei", "zhuiji"]], yj_xuangongzhu: ["female", "wei", 3, ["yjqimei", "yjzhuiji"]],
xukun: ["male", "wu", 4, ["fazhu"]], xukun: ["male", "wu", 4, ["fazhu"]],
}, },
characterIntro: { characterIntro: {
@ -242,7 +242,10 @@ game.import("character", function () {
const stat = player.getStat("xvzhi"); const stat = player.getStat("xvzhi");
return target.countCards("h") && (!stat || !stat.includes(target)); return target.countCards("h") && (!stat || !stat.includes(target));
}, },
selectTarget:2,
usable: 1, usable: 1,
multiline: true,
multitarget: true,
async content(event, trigger, player) { async content(event, trigger, player) {
const targets = event.targets; const targets = event.targets;
if (targets.some(i => !i.countCards("h"))) return; if (targets.some(i => !i.countCards("h"))) return;
@ -250,27 +253,24 @@ game.import("character", function () {
.chooseCardOL(targets, "h", true, [1, Infinity], "蓄志:选择任意张手牌并与对方交换") .chooseCardOL(targets, "h", true, [1, Infinity], "蓄志:选择任意张手牌并与对方交换")
.set("ai", card => { .set("ai", card => {
const player = get.event("player"), const player = get.event("player"),
target = get target = get.event().getParent(2).targets.find(i => i != player);
.event()
.getParent(2)
.targets.find(i => i != player);
const sha = new lib.element.VCard({ name: "sha" }); const sha = new lib.element.VCard({ name: "sha" });
const playerEffect = player.hasUseTarget(sha, false) const playerEffect = player.hasUseTarget(sha, false)
? Math.max( ? Math.max(
...game.filterPlayer(current => ...game.filterPlayer(current =>
player.canUse(sha, current, false).map(current => { player.canUse(sha, current, false)
return get.effect(current, sha, player, player); ).map(current => {
}) return get.effect(current, sha, player, player);
) })
) )
: 0; : 0;
const targetEffect = target.hasUseTarget(sha, false) const targetEffect = target.hasUseTarget(sha, false)
? Math.max( ? Math.max(
...game.filterPlayer(current => ...game.filterPlayer(current =>
target.canUse(sha, current, false).map(current => { target.canUse(sha, current, false)
return get.effect(current, sha, target, target); ).map(current => {
}) return get.effect(current, sha, player, player);
) })
) )
: 0; : 0;
return 5 + 3 * get.sgn(playerEffect - targetEffect) - get.value(card); return 5 + 3 * get.sgn(playerEffect - targetEffect) - get.value(card);
@ -374,12 +374,12 @@ game.import("character", function () {
await player.showHandcards(get.translation(player) + "发动了【督持】"); await player.showHandcards(get.translation(player) + "发动了【督持】");
const colors = player.getCards("h").reduce((list, card) => list.add(get.color(card)), []); const colors = player.getCards("h").reduce((list, card) => list.add(get.color(card)), []);
if (colors.length == 1) { if (colors.length == 1) {
player.chat("洗具"); player.popup("洗具");
trigger.getParent().excluded.add(player); trigger.getParent().excluded.add(player);
return; return;
} }
} }
player.chat("杯具"); player.popup("杯具");
}, },
ai: { threaten: 0.8 }, ai: { threaten: 0.8 },
}, },
@ -389,7 +389,7 @@ game.import("character", function () {
enable: "phaseUse", enable: "phaseUse",
filter(event, player) { filter(event, player) {
const count = player.getStat("skill").yjqimei; const count = player.getStat("skill").yjqimei;
if (count && count > 0 && !player.hasSkill("yjqimei")) return false; if (count && count > 0 && !player.hasSkill("yjqimei_rewrite")) return false;
return true; return true;
}, },
filterTarget: lib.filter.notMe, filterTarget: lib.filter.notMe,