李婉的联对,周妃、毌丘俭(共八个技能)的step转async
This commit is contained in:
parent
4e7cbc2776
commit
6ac598d617
|
@ -214,12 +214,9 @@ const skills = {
|
||||||
if (event.name == "cardsGotoSpecial") return !event.notrigger;
|
if (event.name == "cardsGotoSpecial") return !event.notrigger;
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
direct: true,
|
|
||||||
usable: 1,
|
usable: 1,
|
||||||
async content(event, trigger, player) {
|
async cost(event, trigger, player) {
|
||||||
const {
|
event.result = await player.chooseTarget(get.prompt("olliangyin"), "选择一名其他角色,你与其各摸一张牌", lib.filter.notMe).set("ai", function (target) {
|
||||||
result: { bool, targets },
|
|
||||||
} = await player.chooseTarget(get.prompt("olliangyin"), "选择一名其他角色,你与其各摸一张牌", lib.filter.notMe).set("ai", function (target) {
|
|
||||||
var player = _status.event.player,
|
var player = _status.event.player,
|
||||||
num = player.getExpansions("olkongsheng").length - 1;
|
num = player.getExpansions("olkongsheng").length - 1;
|
||||||
var att = get.attitude(player, target);
|
var att = get.attitude(player, target);
|
||||||
|
@ -227,19 +224,18 @@ const skills = {
|
||||||
if (target.countCards("h") == num && target.isDamaged() && get.recoverEffect(target, player, player) > 0) return 3 * att;
|
if (target.countCards("h") == num && target.isDamaged() && get.recoverEffect(target, player, player) > 0) return 3 * att;
|
||||||
return att;
|
return att;
|
||||||
});
|
});
|
||||||
if (bool) {
|
},
|
||||||
|
async content(event, trigger, player) {
|
||||||
|
const { targets } = event.result;
|
||||||
const target = targets[0];
|
const target = targets[0];
|
||||||
event.target = target;
|
|
||||||
player.logSkill("olliangyin", target);
|
player.logSkill("olliangyin", target);
|
||||||
await game.asyncDraw([player, target].sortBySeat());
|
await game.asyncDraw([player, target].sortBySeat());
|
||||||
} else return;
|
|
||||||
await game.asyncDelayx();
|
await game.asyncDelayx();
|
||||||
let num = player.getExpansions("olkongsheng").length;
|
let num = player.getExpansions("olkongsheng").length;
|
||||||
let check = player => {
|
let check = player => {
|
||||||
if (!player.isIn() || player.isHealthy()) return false;
|
if (!player.isIn() || player.isHealthy()) return false;
|
||||||
return player.countCards("h") == num;
|
return player.countCards("h") == num;
|
||||||
};
|
};
|
||||||
const { target } = event;
|
|
||||||
if (check(player) || check(target)) {
|
if (check(player) || check(target)) {
|
||||||
const choiceList = ["令自己回复1点体力", "令" + get.translation(target) + "回复1点体力"];
|
const choiceList = ["令自己回复1点体力", "令" + get.translation(target) + "回复1点体力"];
|
||||||
const choices = [];
|
const choices = [];
|
||||||
|
@ -277,7 +273,6 @@ const skills = {
|
||||||
trigger: {
|
trigger: {
|
||||||
global: ["loseAfter", "equipAfter", "addJudgeAfter", "gainAfter", "loseAsyncAfter", "addToExpansionAfter"],
|
global: ["loseAfter", "equipAfter", "addJudgeAfter", "gainAfter", "loseAsyncAfter", "addToExpansionAfter"],
|
||||||
},
|
},
|
||||||
direct: true,
|
|
||||||
filter(event, player) {
|
filter(event, player) {
|
||||||
return game.hasPlayer(function (current) {
|
return game.hasPlayer(function (current) {
|
||||||
var evt = event.getl(current);
|
var evt = event.getl(current);
|
||||||
|
@ -285,11 +280,9 @@ const skills = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
usable: 1,
|
usable: 1,
|
||||||
async content(event, trigger, player) {
|
async cost(event, trigger, player) {
|
||||||
if (!player.countCards("he") || !game.hasPlayer(current => current != player && current.countCards("he") > 0)) return;
|
if (!player.countCards("he") || !game.hasPlayer(current => current != player && current.countCards("he") > 0)) return;
|
||||||
const {
|
event.result = await player.chooseCardTarget({
|
||||||
result: { bool, targets, cards },
|
|
||||||
} = await player.chooseCardTarget({
|
|
||||||
prompt: get.prompt("olliangyin"),
|
prompt: get.prompt("olliangyin"),
|
||||||
prompt2: "弃置一张牌,并令一名其他角色也弃置一张牌",
|
prompt2: "弃置一张牌,并令一名其他角色也弃置一张牌",
|
||||||
position: "he",
|
position: "he",
|
||||||
|
@ -331,20 +324,19 @@ const skills = {
|
||||||
return false;
|
return false;
|
||||||
})(),
|
})(),
|
||||||
});
|
});
|
||||||
if (bool) {
|
},
|
||||||
|
async content(event, trigger, player) {
|
||||||
|
const { targets, cards } = event.result;
|
||||||
const target = targets[0];
|
const target = targets[0];
|
||||||
event.target = target;
|
|
||||||
player.logSkill("olliangyin_gain", target);
|
player.logSkill("olliangyin_gain", target);
|
||||||
await player.discard(cards);
|
await player.discard(cards);
|
||||||
await target.chooseToDiscard("he", true);
|
await target.chooseToDiscard("he", true);
|
||||||
} else return;
|
|
||||||
await game.asyncDelayx();
|
await game.asyncDelayx();
|
||||||
let num = player.getExpansions("olkongsheng").length;
|
const num = player.getExpansions("olkongsheng").length;
|
||||||
let check = player => {
|
const check = player => {
|
||||||
if (!player.isIn() || player.isHealthy()) return false;
|
if (!player.isIn() || player.isHealthy()) return false;
|
||||||
return player.countCards("h") == num;
|
return player.countCards("h") == num;
|
||||||
};
|
};
|
||||||
const { target } = event;
|
|
||||||
if (check(player) || check(target)) {
|
if (check(player) || check(target)) {
|
||||||
const choiceList = ["令自己回复1点体力", "令" + get.translation(target) + "回复1点体力"];
|
const choiceList = ["令自己回复1点体力", "令" + get.translation(target) + "回复1点体力"];
|
||||||
const choices = [];
|
const choices = [];
|
||||||
|
@ -360,9 +352,9 @@ const skills = {
|
||||||
.set("choiceList", choiceList)
|
.set("choiceList", choiceList)
|
||||||
.set("prompt", "良姻:是否令一名角色回复体力?")
|
.set("prompt", "良姻:是否令一名角色回复体力?")
|
||||||
.set("ai", function () {
|
.set("ai", function () {
|
||||||
var player = _status.event.player,
|
const player = _status.event.player,
|
||||||
target = _status.event.getParent().target;
|
target = _status.event.getParent().target;
|
||||||
var list = _status.event.controls.slice(0),
|
let list = _status.event.controls.slice(0),
|
||||||
eff1 = 0,
|
eff1 = 0,
|
||||||
eff2 = 0;
|
eff2 = 0;
|
||||||
if (list.includes("选项一")) eff1 = get.recoverEffect(player, player, player);
|
if (list.includes("选项一")) eff1 = get.recoverEffect(player, player, player);
|
||||||
|
@ -381,20 +373,18 @@ const skills = {
|
||||||
olkongsheng: {
|
olkongsheng: {
|
||||||
audio: "kongsheng",
|
audio: "kongsheng",
|
||||||
trigger: { player: "phaseZhunbeiBegin" },
|
trigger: { player: "phaseZhunbeiBegin" },
|
||||||
direct: true,
|
|
||||||
filter(event, player) {
|
filter(event, player) {
|
||||||
return player.countCards("he") > 0;
|
return player.countCards("he") > 0;
|
||||||
},
|
},
|
||||||
content() {
|
async cost(event, trigger, player) {
|
||||||
"step 0";
|
event.result = await player.chooseCard("he", [1, player.countCards("he")], get.prompt("olkongsheng"), "将任意张牌作为“箜”置于武将牌上").set("ai", function (card) {
|
||||||
player.chooseCard("he", [1, player.countCards("he")], get.prompt("olkongsheng"), "将任意张牌作为“箜”置于武将牌上").set("ai", function (card) {
|
const player = _status.event.player,
|
||||||
var player = _status.event.player,
|
|
||||||
num = player.getExpansions("olkongsheng") + ui.selected.cards.length;
|
num = player.getExpansions("olkongsheng") + ui.selected.cards.length;
|
||||||
if (
|
if (
|
||||||
ui.selected.cards.length > 0 &&
|
ui.selected.cards.length > 0 &&
|
||||||
game.hasPlayer(function (current) {
|
game.hasPlayer(function (current) {
|
||||||
if (current.isHealthy() || get.recoverEffect(current, player, player) <= 0) return false;
|
if (current.isHealthy() || get.recoverEffect(current, player, player) <= 0) return false;
|
||||||
var num2 =
|
const num2 =
|
||||||
current.countCards("h", function (card) {
|
current.countCards("h", function (card) {
|
||||||
if (current != player) return true;
|
if (current != player) return true;
|
||||||
return !ui.selected.cards.includes(card);
|
return !ui.selected.cards.includes(card);
|
||||||
|
@ -404,7 +394,7 @@ const skills = {
|
||||||
)
|
)
|
||||||
return 0;
|
return 0;
|
||||||
if (get.type(card, null, false) == "equip") {
|
if (get.type(card, null, false) == "equip") {
|
||||||
for (var i of ui.selected.cards) {
|
for (const i of ui.selected.cards) {
|
||||||
if (get.type(i, null, false) == "equip") return 0;
|
if (get.type(i, null, false) == "equip") return 0;
|
||||||
}
|
}
|
||||||
return 5 - get.value(card);
|
return 5 - get.value(card);
|
||||||
|
@ -412,14 +402,13 @@ const skills = {
|
||||||
if (!player.hasValueTarget(card)) return 1;
|
if (!player.hasValueTarget(card)) return 1;
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
"step 1";
|
},
|
||||||
if (result.bool) {
|
async content(event, trigger, player) {
|
||||||
player.logSkill("olkongsheng");
|
player.logSkill("olkongsheng");
|
||||||
player.addToExpansion(result.cards, player, "give").gaintag.add("olkongsheng");
|
player.addToExpansion(event.result.cards, player, "give").gaintag.add("olkongsheng");
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onremove(player, skill) {
|
onremove(player, skill) {
|
||||||
var cards = player.getExpansions(skill);
|
const cards = player.getExpansions(skill);
|
||||||
if (cards.length) player.loseToDiscardpile(cards);
|
if (cards.length) player.loseToDiscardpile(cards);
|
||||||
},
|
},
|
||||||
intro: {
|
intro: {
|
||||||
|
@ -439,42 +428,36 @@ const skills = {
|
||||||
}).length > 0
|
}).length > 0
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
content() {
|
async content(event, trigger, player) {
|
||||||
"step 0";
|
let cards = player.getExpansions("olkongsheng").filter(function (card) {
|
||||||
var cards = player.getExpansions("olkongsheng").filter(function (card) {
|
|
||||||
return get.type(card, false) != "equip";
|
return get.type(card, false) != "equip";
|
||||||
});
|
});
|
||||||
if (cards.length) player.gain(cards, "gain2");
|
if (cards.length) await player.gain(cards, "gain2");
|
||||||
"step 1";
|
cards = player.getExpansions("olkongsheng");
|
||||||
var cards = player.getExpansions("olkongsheng");
|
if (cards.length <= 0) return;
|
||||||
if (cards.length > 0) {
|
const { result } = await player.chooseTarget(true, "令一名角色使用以下装备牌", get.translation(cards)).set("ai", function (target) {
|
||||||
player.chooseTarget(true, "令一名角色使用以下装备牌", get.translation(cards)).set("ai", function (target) {
|
const player = _status.event.player;
|
||||||
var player = _status.event.player;
|
|
||||||
return get.effect(target, { name: "losehp" }, player, player);
|
return get.effect(target, { name: "losehp" }, player, player);
|
||||||
});
|
});
|
||||||
} else event.finish();
|
const target = result.targets[0];
|
||||||
"step 2";
|
|
||||||
var target = result.targets[0];
|
|
||||||
event.target = target;
|
|
||||||
player.line(target, "green");
|
player.line(target, "green");
|
||||||
"step 3";
|
while (true) {
|
||||||
var cards = player.getExpansions("olkongsheng").filter(function (i) {
|
const cards = player.getExpansions("olkongsheng").filter(function (i) {
|
||||||
return target.hasUseTarget(i);
|
return target.hasUseTarget(i);
|
||||||
});
|
});
|
||||||
if (cards.length == 1) {
|
if (cards.length) {
|
||||||
event._result = { bool: true, links: cards };
|
const card = cards[0];
|
||||||
} else if (cards.length)
|
if (cards.length > 1) {
|
||||||
target.chooseButton(true, ["选择要使用的装备牌", cards]).set("ai", function (button) {
|
const { result } = await target.chooseButton(true, ["选择要使用的装备牌", cards]).set("ai", function (button) {
|
||||||
return get.order(button.link);
|
return get.order(button.link);
|
||||||
});
|
});
|
||||||
else event.goto(5);
|
if (!result.bool) break;
|
||||||
"step 4";
|
card = result.links[0];
|
||||||
if (result.bool) {
|
|
||||||
target.chooseUseTarget(result.links[0], true);
|
|
||||||
event.goto(3);
|
|
||||||
}
|
}
|
||||||
"step 5";
|
await target.chooseUseTarget(card, true);
|
||||||
target.loseHp();
|
} else break;
|
||||||
|
}
|
||||||
|
await target.loseHp();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -482,7 +465,6 @@ const skills = {
|
||||||
//新毌丘俭
|
//新毌丘俭
|
||||||
zhengrong: {
|
zhengrong: {
|
||||||
trigger: { player: "useCardToPlayered" },
|
trigger: { player: "useCardToPlayered" },
|
||||||
direct: true,
|
|
||||||
audio: "drlt_zhenrong",
|
audio: "drlt_zhenrong",
|
||||||
filter(event, player) {
|
filter(event, player) {
|
||||||
if (!event.isFirstTarget) return false;
|
if (!event.isFirstTarget) return false;
|
||||||
|
@ -493,9 +475,8 @@ const skills = {
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
content() {
|
async cost(event, trigger, player) {
|
||||||
"step 0";
|
event.result = await player
|
||||||
player
|
|
||||||
.chooseTarget(get.prompt("zhengrong"), "将一名手牌数不小于你的目标角色的一张牌置于你的武将牌上,成为「荣」", function (card, player, target) {
|
.chooseTarget(get.prompt("zhengrong"), "将一名手牌数不小于你的目标角色的一张牌置于你的武将牌上,成为「荣」", function (card, player, target) {
|
||||||
return _status.event.targets.includes(target) && target.countCards("h") >= player.countCards("h") && target.countCards("he") > 0;
|
return _status.event.targets.includes(target) && target.countCards("h") >= player.countCards("h") && target.countCards("he") > 0;
|
||||||
})
|
})
|
||||||
|
@ -503,16 +484,15 @@ const skills = {
|
||||||
return (1 - get.attitude(_status.event.player, target)) / target.countCards("he");
|
return (1 - get.attitude(_status.event.player, target)) / target.countCards("he");
|
||||||
})
|
})
|
||||||
.set("targets", trigger.targets);
|
.set("targets", trigger.targets);
|
||||||
"step 1";
|
},
|
||||||
if (result.bool) {
|
async content(event, trigger, player) {
|
||||||
var target = result.targets[0];
|
const target = result.targets[0];
|
||||||
event.target = result.targets[0];
|
|
||||||
player.logSkill("zhengrong", target);
|
player.logSkill("zhengrong", target);
|
||||||
player.choosePlayerCard(target, "he", true).ai = get.buttonValue;
|
const next = player.choosePlayerCard(target, "he", true);
|
||||||
} else event.finish();
|
next.ai = get.buttonValue;
|
||||||
"step 2";
|
const { result } = await next;
|
||||||
if (result.bool) {
|
if (result.bool) {
|
||||||
var card = result.links[0];
|
const card = result.links[0];
|
||||||
player.addToExpansion(card, "give", "log", target).gaintag.add("zhengrong");
|
player.addToExpansion(card, "give", "log", target).gaintag.add("zhengrong");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -538,15 +518,11 @@ const skills = {
|
||||||
filter(event, player) {
|
filter(event, player) {
|
||||||
return player.getExpansions("zhengrong").length >= 3;
|
return player.getExpansions("zhengrong").length >= 3;
|
||||||
},
|
},
|
||||||
content() {
|
async content(event, trigger, player) {
|
||||||
"step 0";
|
|
||||||
player.awakenSkill("hongju");
|
player.awakenSkill("hongju");
|
||||||
var cards = player.getExpansions("zhengrong");
|
const cards = player.getExpansions("zhengrong");
|
||||||
if (!cards.length || !player.countCards("h")) {
|
if (cards.length && player.countCards("h")) {
|
||||||
event.goto(2);
|
const next = player.chooseToMove("征荣:是否交换“荣”和手牌?");
|
||||||
return;
|
|
||||||
}
|
|
||||||
var next = player.chooseToMove("征荣:是否交换“荣”和手牌?");
|
|
||||||
next.set("list", [
|
next.set("list", [
|
||||||
[get.translation(player) + "(你)的“荣”", cards],
|
[get.translation(player) + "(你)的“荣”", cards],
|
||||||
["手牌区", player.getCards("h")],
|
["手牌区", player.getCards("h")],
|
||||||
|
@ -555,27 +531,30 @@ const skills = {
|
||||||
return typeof to != "number";
|
return typeof to != "number";
|
||||||
});
|
});
|
||||||
next.set("processAI", function (list) {
|
next.set("processAI", function (list) {
|
||||||
var player = _status.event.player,
|
const player = _status.event.player,
|
||||||
cards = list[0][1].concat(list[1][1]).sort(function (a, b) {
|
cards = list[0][1].concat(list[1][1]).sort(function (a, b) {
|
||||||
return get.value(a) - get.value(b);
|
return get.value(a) - get.value(b);
|
||||||
}),
|
}),
|
||||||
cards2 = cards.splice(0, player.getExpansions("zhengrong").length);
|
cards2 = cards.splice(0, player.getExpansions("zhengrong").length);
|
||||||
return [cards2, cards];
|
return [cards2, cards];
|
||||||
});
|
});
|
||||||
"step 1";
|
const { result } = await next;
|
||||||
if (result.bool) {
|
if (result.bool) {
|
||||||
var pushs = result.moved[0],
|
const pushs = result.moved[0],
|
||||||
gains = result.moved[1];
|
gains = result.moved[1];
|
||||||
pushs.removeArray(player.getExpansions("zhengrong"));
|
pushs.removeArray(player.getExpansions("zhengrong"));
|
||||||
gains.removeArray(player.getCards("h"));
|
gains.removeArray(player.getCards("h"));
|
||||||
if (!pushs.length || pushs.length != gains.length) return;
|
if (pushs.length && pushs.length == gains.length) {
|
||||||
player.addToExpansion(pushs).gaintag.add("zhengrong");
|
const next = player.addToExpansion(pushs);
|
||||||
player.gain(gains, "gain2", "log");
|
next.gaintag.add("zhengrong");
|
||||||
|
await next;
|
||||||
|
await player.gain(gains, "gain2", "log");
|
||||||
}
|
}
|
||||||
"step 2";
|
}
|
||||||
player.addSkills("qingce");
|
}
|
||||||
|
await player.addSkills("qingce");
|
||||||
game.log(player, "获得了技能", "#g【清侧】");
|
game.log(player, "获得了技能", "#g【清侧】");
|
||||||
player.loseMaxHp();
|
await player.loseMaxHp();
|
||||||
},
|
},
|
||||||
ai: {
|
ai: {
|
||||||
combo: "zhengrong",
|
combo: "zhengrong",
|
||||||
|
@ -625,13 +604,11 @@ const skills = {
|
||||||
return "选择弃置一张手牌,获得" + get.translation(links[0]) + "并弃置一名角色装备区或判定区内的一张牌";
|
return "选择弃置一张手牌,获得" + get.translation(links[0]) + "并弃置一名角色装备区或判定区内的一张牌";
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
contentx() {
|
async contentx(event, player, trigger) {
|
||||||
"step 0";
|
const card = lib.skill.qingce_backup.card;
|
||||||
var card = lib.skill.qingce_backup.card;
|
await player.gain(card, "gain2", "log");
|
||||||
player.gain(card, "gain2", "log");
|
if (event.target.countDiscardableCards(player, "ej") > 0) {
|
||||||
"step 1";
|
await player.discardPlayerCard("ej", true, target);
|
||||||
if (target.countDiscardableCards(player, "ej") > 0) {
|
|
||||||
player.discardPlayerCard("ej", true, target);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ai: {
|
ai: {
|
||||||
|
@ -666,19 +643,17 @@ const skills = {
|
||||||
filter(event, player) {
|
filter(event, player) {
|
||||||
return event.player != player && event.player.countCards("h") > player.countCards("h");
|
return event.player != player && event.player.countCards("h") > player.countCards("h");
|
||||||
},
|
},
|
||||||
direct: true,
|
async cost(event, player, trigger) {
|
||||||
content() {
|
const { result } = await player.choosePlayerCard("hej", get.prompt("drlt_zhenrong"), trigger.player).set("ai", function (button) {
|
||||||
"step 0";
|
|
||||||
player.choosePlayerCard("hej", get.prompt("drlt_zhenrong"), trigger.player).set("ai", function (button) {
|
|
||||||
return -get.attitude(player, trigger.player) + 1;
|
return -get.attitude(player, trigger.player) + 1;
|
||||||
});
|
});
|
||||||
"step 1";
|
|
||||||
if (result && result.links && result.links.length) {
|
if (result && result.links && result.links.length) {
|
||||||
player.line(player, trigger.player);
|
event.result = result;
|
||||||
player.logSkill("drlt_zhenrong");
|
|
||||||
player.addToExpansion(result.links, trigger.player, "give", "log").gaintag.add("drlt_zhenrong");
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async content(event, player, trigger) {
|
||||||
|
player.addToExpansion(event.result.cards, trigger.player, "give", "log").gaintag.add("drlt_zhenrong");
|
||||||
|
},
|
||||||
},
|
},
|
||||||
drlt_hongju: {
|
drlt_hongju: {
|
||||||
skillAnimation: true,
|
skillAnimation: true,
|
||||||
|
@ -694,15 +669,11 @@ const skills = {
|
||||||
filter(event, player) {
|
filter(event, player) {
|
||||||
return player.getExpansions("drlt_zhenrong").length >= 3 && game.dead.length > 0;
|
return player.getExpansions("drlt_zhenrong").length >= 3 && game.dead.length > 0;
|
||||||
},
|
},
|
||||||
content() {
|
async content(event, player, trigger) {
|
||||||
"step 0";
|
|
||||||
player.awakenSkill("drlt_hongju");
|
player.awakenSkill("drlt_hongju");
|
||||||
var cards = player.getExpansions("drlt_zhenrong");
|
const cards = player.getExpansions("drlt_zhenrong");
|
||||||
if (!cards.length || !player.countCards("h")) {
|
if (cards.length && player.countCards("h")) {
|
||||||
event.goto(2);
|
const next = player.chooseToMove("征荣:是否交换“荣”和手牌?");
|
||||||
return;
|
|
||||||
}
|
|
||||||
var next = player.chooseToMove("征荣:是否交换“荣”和手牌?");
|
|
||||||
next.set("list", [
|
next.set("list", [
|
||||||
[get.translation(player) + "(你)的“荣”", cards],
|
[get.translation(player) + "(你)的“荣”", cards],
|
||||||
["手牌区", player.getCards("h")],
|
["手牌区", player.getCards("h")],
|
||||||
|
@ -711,26 +682,29 @@ const skills = {
|
||||||
return typeof to != "number";
|
return typeof to != "number";
|
||||||
});
|
});
|
||||||
next.set("processAI", function (list) {
|
next.set("processAI", function (list) {
|
||||||
var player = _status.event.player,
|
const player = _status.event.player,
|
||||||
cards = list[0][1].concat(list[1][1]).sort(function (a, b) {
|
cards = list[0][1].concat(list[1][1]).sort(function (a, b) {
|
||||||
return get.value(a) - get.value(b);
|
return get.value(a) - get.value(b);
|
||||||
}),
|
}),
|
||||||
cards2 = cards.splice(0, player.getExpansions("drlt_zhenrong").length);
|
cards2 = cards.splice(0, player.getExpansions("drlt_zhenrong").length);
|
||||||
return [cards2, cards];
|
return [cards2, cards];
|
||||||
});
|
});
|
||||||
"step 1";
|
const { result } = await next;
|
||||||
if (result.bool) {
|
if (result.bool) {
|
||||||
var pushs = result.moved[0],
|
const pushs = result.moved[0],
|
||||||
gains = result.moved[1];
|
gains = result.moved[1];
|
||||||
pushs.removeArray(player.getExpansions("drlt_zhenrong"));
|
pushs.removeArray(player.getExpansions("drlt_zhenrong"));
|
||||||
gains.removeArray(player.getCards("h"));
|
gains.removeArray(player.getCards("h"));
|
||||||
if (!pushs.length || pushs.length != gains.length) return;
|
if (pushs.length && pushs.length == gains.length) {
|
||||||
player.addToExpansion(pushs).gaintag.add("drlt_zhenrong");
|
const next = player.addToExpansion(pushs);
|
||||||
player.gain(gains, "gain2", "log");
|
next.gaintag.add("drlt_zhenrong");
|
||||||
|
await next;
|
||||||
|
await player.gain(gains, "gain2", "log");
|
||||||
}
|
}
|
||||||
"step 2";
|
}
|
||||||
player.addSkills("drlt_qingce");
|
}
|
||||||
player.loseMaxHp();
|
await player.addSkills("drlt_qingce");
|
||||||
|
await player.loseMaxHp();
|
||||||
},
|
},
|
||||||
ai: {
|
ai: {
|
||||||
combo: "drlt_zhenrong",
|
combo: "drlt_zhenrong",
|
||||||
|
@ -745,16 +719,14 @@ const skills = {
|
||||||
filterTarget(card, player, target) {
|
filterTarget(card, player, target) {
|
||||||
return target.countDiscardableCards(player, "ej") > 0;
|
return target.countDiscardableCards(player, "ej") > 0;
|
||||||
},
|
},
|
||||||
content() {
|
async content(event, player, trigger) {
|
||||||
"step 0";
|
const next = player.chooseCardButton(player.getExpansions("drlt_zhenrong"), 1, "请选择需要弃置的“荣”", true);
|
||||||
player.chooseCardButton(player.getExpansions("drlt_zhenrong"), 1, "请选择需要弃置的“荣”", true).ai = function (button) {
|
next.ai = button => 6 - get.value(button.link);
|
||||||
return 6 - get.value(button.link);
|
const { result } = await next;
|
||||||
};
|
|
||||||
"step 1";
|
|
||||||
if (result.bool) {
|
if (result.bool) {
|
||||||
var cards = result.links;
|
const cards = result.links;
|
||||||
player.loseToDiscardpile(cards);
|
player.loseToDiscardpile(cards);
|
||||||
player.discardPlayerCard(target, "ej", 1, true);
|
player.discardPlayerCard(event.target, "ej", 1, true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ai: {
|
ai: {
|
||||||
|
|
|
@ -1276,25 +1276,20 @@ const skills = {
|
||||||
if (event.player != player && previous == player) return true;
|
if (event.player != player && previous == player) return true;
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
direct: true,
|
async cost(event, trigger, player) {
|
||||||
content: function () {
|
event.result = { bool: !!trigger.player };
|
||||||
"step 0";
|
},
|
||||||
var history = game.getAllGlobalHistory("useCard");
|
async content(event, trigger, player) {
|
||||||
var index = history.indexOf(trigger);
|
const history = game.getAllGlobalHistory("useCard");
|
||||||
var previous = history[index - 1].player;
|
const index = history.indexOf(trigger);
|
||||||
var user = trigger.player,
|
const previous = history[index - 1].player;
|
||||||
target = previous;
|
const { result } = await trigger.player
|
||||||
event.user = user;
|
.chooseBool("是否对" + get.translation(previous) + "发动【联对】?", "令" + get.translation(previous) + "摸两张牌")
|
||||||
event.target = target;
|
|
||||||
if (user) {
|
|
||||||
user.chooseBool("是否对" + get.translation(target) + "发动【联对】?", "令" + get.translation(target) + "摸两张牌")
|
|
||||||
.set("ai", () => _status.event.bool)
|
.set("ai", () => _status.event.bool)
|
||||||
.set("bool", get.effect(target, { name: "draw" }, user, user) > 0);
|
.set("bool", get.effect(previous, { name: "draw" }, trigger.player, trigger.player) > 0);
|
||||||
}
|
|
||||||
"step 1";
|
|
||||||
if (result.bool) {
|
if (result.bool) {
|
||||||
event.user.logSkill("liandui", target);
|
trigger.player.logSkill("liandui", previous);
|
||||||
target.draw(2);
|
previous.draw(2);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -8379,14 +8374,20 @@ const skills = {
|
||||||
content: function () {
|
content: function () {
|
||||||
"step 0";
|
"step 0";
|
||||||
player.showHandcards();
|
player.showHandcards();
|
||||||
const hs = player.getCards("h"), color = get.color(hs[0], player);
|
const hs = player.getCards("h"),
|
||||||
if (hs.length === 1 || !hs.some((card,index) => {
|
color = get.color(hs[0], player);
|
||||||
|
if (
|
||||||
|
hs.length === 1 ||
|
||||||
|
!hs.some((card, index) => {
|
||||||
return index > 0 && get.color(card) !== color;
|
return index > 0 && get.color(card) !== color;
|
||||||
})) {
|
})
|
||||||
|
) {
|
||||||
event.finish();
|
event.finish();
|
||||||
}
|
}
|
||||||
"step 1";
|
"step 1";
|
||||||
const list = [], bannedList = [], indexs = Object.keys(lib.color);
|
const list = [],
|
||||||
|
bannedList = [],
|
||||||
|
indexs = Object.keys(lib.color);
|
||||||
player.getCards("h").forEach(card => {
|
player.getCards("h").forEach(card => {
|
||||||
const color = get.color(card, player);
|
const color = get.color(card, player);
|
||||||
list.add(color);
|
list.add(color);
|
||||||
|
@ -8396,11 +8397,15 @@ const skills = {
|
||||||
list.sort((a, b) => indexs.indexOf(a) - indexs.indexOf(b));
|
list.sort((a, b) => indexs.indexOf(a) - indexs.indexOf(b));
|
||||||
if (!list.length) event.finish();
|
if (!list.length) event.finish();
|
||||||
else if (list.length === 1) event._result = { control: list[0] };
|
else if (list.length === 1) event._result = { control: list[0] };
|
||||||
else player.chooseControl(list.map(i => `${i}2`)).set("ai", function () {
|
else
|
||||||
|
player
|
||||||
|
.chooseControl(list.map(i => `${i}2`))
|
||||||
|
.set("ai", function () {
|
||||||
var player = _status.event.player;
|
var player = _status.event.player;
|
||||||
if (player.countCards("h", { color: "red" }) == 1 && player.countCards("h", { color: "black" }) > 1) return 1;
|
if (player.countCards("h", { color: "red" }) == 1 && player.countCards("h", { color: "black" }) > 1) return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}).set("prompt", "请选择弃置一种颜色的所有手牌");
|
})
|
||||||
|
.set("prompt", "请选择弃置一种颜色的所有手牌");
|
||||||
"step 2";
|
"step 2";
|
||||||
event.control = result.control.slice(0, result.control.length - 1);
|
event.control = result.control.slice(0, result.control.length - 1);
|
||||||
var cards = player.getCards("h", { color: event.control });
|
var cards = player.getCards("h", { color: event.control });
|
||||||
|
@ -8442,7 +8447,7 @@ const skills = {
|
||||||
return 1;
|
return 1;
|
||||||
},
|
},
|
||||||
result: {
|
result: {
|
||||||
player:(player) => {
|
player: player => {
|
||||||
if (get.color(player.getCards("h")) != "none") return 0;
|
if (get.color(player.getCards("h")) != "none") return 0;
|
||||||
return 1;
|
return 1;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue