commit
d1d18579f1
|
@ -151,6 +151,69 @@ const skills = {
|
|||
await player.discardPlayerCard(current, true);
|
||||
}
|
||||
await game.asyncDelayx();
|
||||
let evt = trigger;
|
||||
while (true) {
|
||||
if (!evt.name || lib.phaseName.includes(evt.name)) break;
|
||||
evt = evt.getParent();
|
||||
}
|
||||
if (player.getHistory("custom", evtx => evtx.olqingya === evt.name).length) return;
|
||||
player.getHistory("custom").push({ olqingya: evt.name });
|
||||
player
|
||||
.when({
|
||||
global: lib.phaseName.map(name => name + "End").concat("phaseAfter"),
|
||||
})
|
||||
.filter(evt => {
|
||||
if (evt.name === "phase") return true;
|
||||
let evt2 = trigger;
|
||||
while (true) {
|
||||
if (!evt2.name || lib.phaseName.includes(evt2.name)) break;
|
||||
evt2 = evt2.getParent();
|
||||
}
|
||||
return evt2.name !== evt.name;
|
||||
})
|
||||
.vars({
|
||||
curPhaseName: evt.name,
|
||||
})
|
||||
.then(() => {
|
||||
if (trigger.name === "phase") {
|
||||
return event.finish();
|
||||
}
|
||||
const history = player.getHistory("useSkill", evt => {
|
||||
if (evt.skill !== "olqingya") return false;
|
||||
const evtx = evt.event.getParent(curPhaseName);
|
||||
if (!evtx || evtx.name !== curPhaseName) return false;
|
||||
return true;
|
||||
}),
|
||||
cards = [];
|
||||
history.forEach(evt => {
|
||||
game.countPlayer2(current => {
|
||||
current.checkHistory("lose", evtx => {
|
||||
if (evtx.getParent(4) !== evt.event) return;
|
||||
cards.addArray(evtx.cards.filterInD("d"));
|
||||
});
|
||||
}, true);
|
||||
});
|
||||
if (!cards.length) {
|
||||
return event.finish();
|
||||
}
|
||||
event.cards = cards;
|
||||
player
|
||||
.chooseButton(["倾轧:是否使用其中的一张牌?", event.cards])
|
||||
.set("filterButton", button => {
|
||||
return get.player().hasUseTarget(button.link);
|
||||
})
|
||||
.set("ai", button => {
|
||||
return get.player().getUseValue(button.link);
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
if (result.bool) {
|
||||
const card = result.links[0];
|
||||
player.$gain2(card, false);
|
||||
game.delayx();
|
||||
player.chooseUseTarget(card, true);
|
||||
}
|
||||
});
|
||||
},
|
||||
ai: {
|
||||
effect: {
|
||||
|
|
|
@ -27,7 +27,7 @@ const skills = {
|
|||
const event = get.event(), player = get.player();
|
||||
if (
|
||||
game.hasPlayer(current => {
|
||||
return current !== player && get.attitude(player, current) > 0;
|
||||
return current !== player && get.attitude(player, current) < 0;
|
||||
})
|
||||
)
|
||||
return [0, 1, 2].randomGet();
|
||||
|
@ -51,15 +51,17 @@ const skills = {
|
|||
const [target] = event.targets;
|
||||
const chosenNumber = get.info("dcsbtaozhou_backup").chosenNumber;
|
||||
const cards = await target
|
||||
.chooseToGive(`${get.translation(player)}对你发动了【讨州】`, "你可以交给其至多三张手牌", [1, 3])
|
||||
.chooseToGive(`${get.translation(player)}对你发动了【讨州】`, "你可以交给其至多三张手牌", [1, 3], player)
|
||||
.set("ai", card => {
|
||||
if (get.event("att") > 0) {
|
||||
if (get.event("chosenNumber") < ui.selected.cards.length + (get.event("getRand")() < 0.5)) {
|
||||
return 5 - get.value(card);
|
||||
return 5.1 - get.value(card);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return -get.value(card);
|
||||
if (ui.selected.cards.length > 1) return -get.value(card);
|
||||
if (ui.selected.cards.length > 0) return 3.6 - get.value(card);
|
||||
return 4.6 - get.value(card);
|
||||
})
|
||||
.set("att", get.attitude(target, player))
|
||||
.set("chosenNumber", chosenNumber)
|
||||
|
|
Loading…
Reference in New Issue