Merge branch 'libccy:PR-Branch' into PR-Branch
This commit is contained in:
commit
ecf06fa7ac
|
@ -2355,72 +2355,60 @@ const skills = {
|
||||||
filter(event, player) {
|
filter(event, player) {
|
||||||
return game.hasPlayer(current => player.canCompare(current));
|
return game.hasPlayer(current => player.canCompare(current));
|
||||||
},
|
},
|
||||||
direct: true,
|
async cost(event, trigger, player){
|
||||||
|
event.result = await player.chooseTarget(get.prompt("clanliuju"), "与一名其他角色拼点,输的角色可以使用任意张拼点牌中的非基本牌", (card, player, target) => {
|
||||||
|
return player.canCompare(target);
|
||||||
|
}).set("ai", target => {
|
||||||
|
var player = _status.event.player;
|
||||||
|
var ts = target.getCards("h").sort((a, b) => get.number(a) - get.number(b));
|
||||||
|
if (get.attitude(player, target) < 0) {
|
||||||
|
var hs = player.getCards("h").sort((a, b) => get.number(a) - get.number(b));
|
||||||
|
if (!hs.length || !ts.length) return 0;
|
||||||
|
if (get.type(hs[0], null, false) == "basic" && get.value(hs[0]) > 6) return 0;
|
||||||
|
if (get.number(hs[0]) < get.number(ts[0]) || get.type(hs[0], null, false) == "basic") return 1;
|
||||||
|
return Math.random() - 0.7;
|
||||||
|
}
|
||||||
|
return get.type(ts[0]) != "basic";
|
||||||
|
}).forResult();
|
||||||
|
},
|
||||||
content() {
|
content() {
|
||||||
"step 0";
|
"step 0";
|
||||||
player
|
var target = targets[0];
|
||||||
.chooseTarget(get.prompt("clanliuju"), "与一名其他角色拼点,输的角色可以使用任意张拼点牌中的非基本牌", (card, player, target) => {
|
event.target = target;
|
||||||
return player.canCompare(target);
|
player.chooseToCompare(target).set("small", true);
|
||||||
})
|
|
||||||
.set("ai", target => {
|
|
||||||
var player = _status.event.player;
|
|
||||||
var ts = target.getCards("h").sort((a, b) => get.number(a) - get.number(b));
|
|
||||||
if (get.attitude(player, target) < 0) {
|
|
||||||
var hs = player.getCards("h").sort((a, b) => get.number(a) - get.number(b));
|
|
||||||
if (!hs.length || !ts.length) return 0;
|
|
||||||
if (get.type(hs[0], null, false) == "basic" && get.value(hs[0]) > 6) return 0;
|
|
||||||
if (get.number(hs[0]) < get.number(ts[0]) || get.type(hs[0], null, false) == "basic") return 1;
|
|
||||||
return Math.random() - 0.7;
|
|
||||||
}
|
|
||||||
return get.type(ts[0]) != "basic";
|
|
||||||
});
|
|
||||||
"step 1";
|
"step 1";
|
||||||
if (result.bool) {
|
|
||||||
var target = result.targets[0];
|
|
||||||
event.target = target;
|
|
||||||
player.logSkill("clanliuju", target);
|
|
||||||
player.chooseToCompare(target).set("small", true);
|
|
||||||
} else event.finish();
|
|
||||||
"step 2";
|
|
||||||
if (!result.tie) {
|
if (!result.tie) {
|
||||||
var loser = result.bool ? target : player;
|
var loser = result.bool ? target : player;
|
||||||
var cards = [];
|
var cards = [];
|
||||||
game.getGlobalHistory("cardMove", evt => {
|
game.getGlobalHistory("cardMove", evt => {
|
||||||
if (evt.getParent(2) == event)
|
if (evt.getParent(2).name === "chooseToCompare" && evt.getParent(3) === event) cards.addArray(evt.cards.filter(i => {
|
||||||
cards.addArray(
|
return get.position(i, true) == "d" && get.type(i, null, false) != "basic";
|
||||||
evt.cards.filter(i => {
|
}));
|
||||||
return get.position(i, true) == "d" && get.type(i, null, false) != "basic";
|
|
||||||
})
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
event.loser = loser;
|
event.loser = loser;
|
||||||
event.distance = [get.distance(player, target), get.distance(target, player)];
|
event.distance = [get.distance(player, target), get.distance(target, player)];
|
||||||
if (cards.length) event.cards = cards;
|
if (cards.length) event.cards = cards;
|
||||||
else event.finish();
|
else event.finish();
|
||||||
} else event.finish();
|
} else event.finish();
|
||||||
"step 3";
|
"step 2";
|
||||||
var cardsx = cards.filter(i => get.position(i, true) == "d" && event.loser.hasUseTarget(i));
|
var cardsx = cards.filter(i => get.position(i, true) == "d" && event.loser.hasUseTarget(i));
|
||||||
if (!cardsx.length) event.goto(6);
|
if (!cardsx.length) event.goto(6);
|
||||||
else
|
else event.loser.chooseButton(["留驹:是否使用其中的一张牌?", cardsx]).set("filterButton", button => {
|
||||||
event.loser
|
return _status.event.player.hasUseTarget(button.link);
|
||||||
.chooseButton(["留驹:是否使用其中的一张牌?", cardsx])
|
}).set("ai", button => {
|
||||||
.set("filterButton", button => {
|
return _status.event.player.getUseValue(button.link) + 0.1;
|
||||||
return _status.event.player.hasUseTarget(button.link);
|
});
|
||||||
})
|
"step 3";
|
||||||
.set("ai", button => {
|
|
||||||
return _status.event.player.getUseValue(button.link) + 0.1;
|
|
||||||
});
|
|
||||||
"step 4";
|
|
||||||
if (result.bool) {
|
if (result.bool) {
|
||||||
var card = result.links[0];
|
var card = result.links[0];
|
||||||
event.cards.remove(card);
|
event.cards.remove(card);
|
||||||
event.loser.$gain2(card, false);
|
event.loser.$gain2(card, false);
|
||||||
game.delayx();
|
game.delayx();
|
||||||
event.loser.chooseUseTarget(true, card, false);
|
event.loser.chooseUseTarget(true, card, false);
|
||||||
} else event.goto(6);
|
} else event.goto(5);
|
||||||
"step 5";
|
"step 4";
|
||||||
if (cards.filter(i => get.position(i, true) == "d" && event.loser.hasUseTarget(i)).length) event.goto(3);
|
if (cards.filter(i => get.position(i, true) == "d" && event.loser.hasUseTarget(i)).length) event.goto(3);
|
||||||
"step 6";
|
"step 5";
|
||||||
if (get.distance(player, target) != event.distance[0] || get.distance(target, player) != event.distance[1]) {
|
if (get.distance(player, target) != event.distance[0] || get.distance(target, player) != event.distance[1]) {
|
||||||
player.restoreSkill("clanxumin");
|
player.restoreSkill("clanxumin");
|
||||||
game.log(player, "重置了", "#g【恤民】");
|
game.log(player, "重置了", "#g【恤民】");
|
||||||
|
|
|
@ -20,9 +20,7 @@ const skills = {
|
||||||
const map = lib.skill.dcbenxi.getMap(),
|
const map = lib.skill.dcbenxi.getMap(),
|
||||||
list = Object.keys(map);
|
list = Object.keys(map);
|
||||||
if (list.length > 0) {
|
if (list.length > 0) {
|
||||||
const skill = list.randomGet(),
|
const skill = list.randomGet(), voiceMap = game.parseSkillTextMap(skill, map[skill]);
|
||||||
voiceMap = game.parseSkillTextMap(skill, map[skill]);
|
|
||||||
console.log(voiceMap);
|
|
||||||
player.storage.dcbenxi_pending = skill;
|
player.storage.dcbenxi_pending = skill;
|
||||||
findaudio: for (let data of voiceMap) {
|
findaudio: for (let data of voiceMap) {
|
||||||
if(!data.text) continue;
|
if(!data.text) continue;
|
||||||
|
|
|
@ -743,7 +743,7 @@ const skills = {
|
||||||
const evtx = evt.event;
|
const evtx = evt.event;
|
||||||
if (evtx.givenCards) names.addArray(evtx.givenCards.map(card => get.name(card, false)));
|
if (evtx.givenCards) names.addArray(evtx.givenCards.map(card => get.name(card, false)));
|
||||||
});
|
});
|
||||||
return names.length >= 5;
|
return names.length > 5;
|
||||||
},
|
},
|
||||||
forced: true,
|
forced: true,
|
||||||
juexingji: true,
|
juexingji: true,
|
||||||
|
@ -2793,8 +2793,12 @@ const skills = {
|
||||||
trigger: { player: ["gainAfter", "loseAsyncAfter"] },
|
trigger: { player: ["gainAfter", "loseAsyncAfter"] },
|
||||||
forced: true,
|
forced: true,
|
||||||
filter: (event, player) => {
|
filter: (event, player) => {
|
||||||
if (event.getParent("phaseDraw", true)) return false;
|
const phaseDraw = event.getParent("phaseDraw");
|
||||||
const evt = player.getHistory("gain", i => !i.getParent("phaseDraw", true))[0];
|
if (phaseDraw && phaseDraw.player === player) return false;
|
||||||
|
const evt = player.getHistory("gain").find(i => {
|
||||||
|
const phaseDraw = i.getParent("phaseDraw");
|
||||||
|
return (!phaseDraw || phaseDraw.player !== player);
|
||||||
|
});
|
||||||
if (!evt) return false;
|
if (!evt) return false;
|
||||||
if (event.name == "gain") {
|
if (event.name == "gain") {
|
||||||
if (evt != event || event.getlx === false) return false;
|
if (evt != event || event.getlx === false) return false;
|
||||||
|
@ -6442,7 +6446,8 @@ const skills = {
|
||||||
"step 0";
|
"step 0";
|
||||||
player.give(cards, targets[0], "give");
|
player.give(cards, targets[0], "give");
|
||||||
"step 1";
|
"step 1";
|
||||||
targets[0].chooseToCompare(targets[1]);
|
if (targets[0].canCompare(targets[1])) targets[0].chooseToCompare(targets[1]);
|
||||||
|
else event.finish();
|
||||||
"step 2";
|
"step 2";
|
||||||
player.addTempSkill("dcjianshu_check", "phaseUseAfter");
|
player.addTempSkill("dcjianshu_check", "phaseUseAfter");
|
||||||
if (result.bool) {
|
if (result.bool) {
|
||||||
|
|
|
@ -504,7 +504,7 @@ const translates = {
|
||||||
dcjichou: "集筹",
|
dcjichou: "集筹",
|
||||||
dcjichou_info: "出牌阶段结束时,若你于此阶段使用过牌且这些牌的牌名均不同,你可以观看位于弃牌堆中的这些牌,选择任意张牌并选择等量角色,将这些牌交给这些角色各一张,然后你摸X张牌(X为你本局游戏首次发动〖集筹〗给出的牌数)。",
|
dcjichou_info: "出牌阶段结束时,若你于此阶段使用过牌且这些牌的牌名均不同,你可以观看位于弃牌堆中的这些牌,选择任意张牌并选择等量角色,将这些牌交给这些角色各一张,然后你摸X张牌(X为你本局游戏首次发动〖集筹〗给出的牌数)。",
|
||||||
dcmouli: "谋立",
|
dcmouli: "谋立",
|
||||||
dcmouli_info: "觉醒技。回合结束时,若你因〖集筹〗给出的牌的牌名总数不小于5,你加1点体力上限并回复1点体力,然后获得〖自缚〗。",
|
dcmouli_info: "觉醒技。回合结束时,若你因〖集筹〗给出的牌的牌名总数大于5,你加1点体力上限并回复1点体力,然后获得〖自缚〗。",
|
||||||
dczifu: "自缚",
|
dczifu: "自缚",
|
||||||
dczifu_info: "锁定技。出牌阶段开始时,你将手牌摸至体力上限(至多摸至五张)。若你以此法得到牌,你须选择手牌中不同牌名的牌各一张,然后弃置其余的手牌。",
|
dczifu_info: "锁定技。出牌阶段开始时,你将手牌摸至体力上限(至多摸至五张)。若你以此法得到牌,你须选择手牌中不同牌名的牌各一张,然后弃置其余的手牌。",
|
||||||
dc_simashi: "司马师",
|
dc_simashi: "司马师",
|
||||||
|
|
|
@ -3340,29 +3340,16 @@ const skills = {
|
||||||
charlotte: true,
|
charlotte: true,
|
||||||
direct: true,
|
direct: true,
|
||||||
check: function (event, player) {
|
check: function (event, player) {
|
||||||
return (
|
return (player.getCards("h").map(i => get.value(i)).reduce((p, c) => p + c, 0) < event.player.getCards("h").map(i => get.value(i)).reduce((p, c) => p + c, 0) + 4 * Math.random());
|
||||||
player
|
|
||||||
.getCards("h")
|
|
||||||
.map(i => get.value(i))
|
|
||||||
.reduce((p, c) => p + c, 0) <
|
|
||||||
event.player
|
|
||||||
.getCards("h")
|
|
||||||
.map(i => get.value(i))
|
|
||||||
.reduce((p, c) => p + c, 0) +
|
|
||||||
4 * Math.random()
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
content: function () {
|
content: function () {
|
||||||
"step 0";
|
"step 0";
|
||||||
|
player.unmarkAuto("jsrgguiji_swapback", [trigger.player]);
|
||||||
if (trigger.name == "phaseUse") {
|
if (trigger.name == "phaseUse") {
|
||||||
player
|
player.chooseBool(get.prompt("jsrgguiji_swapback", trigger.player), "与其交换手牌。").set("ai", () => {
|
||||||
.chooseBool(get.prompt("jsrgguiji_swapback", trigger.player), "与其交换手牌。")
|
return get.event("bool");
|
||||||
.set("ai", () => {
|
}).set("bool", lib.skill.jsrgguiji_swapback.check(trigger, player) > 0);
|
||||||
return get.event("bool");
|
|
||||||
})
|
|
||||||
.set("bool", lib.skill.jsrgguiji_swapback.check(trigger, player) > 0);
|
|
||||||
} else {
|
} else {
|
||||||
player.unmarkAuto("jsrgguiji_swapback", [trigger.player]);
|
|
||||||
event.finish();
|
event.finish();
|
||||||
}
|
}
|
||||||
"step 1";
|
"step 1";
|
||||||
|
@ -3370,7 +3357,6 @@ const skills = {
|
||||||
player.logSkill("jsrgguiji_swapback", trigger.player);
|
player.logSkill("jsrgguiji_swapback", trigger.player);
|
||||||
player.swapHandcards(trigger.player);
|
player.swapHandcards(trigger.player);
|
||||||
}
|
}
|
||||||
player.unmarkAuto("jsrgguiji_swapback", [trigger.player]);
|
|
||||||
},
|
},
|
||||||
intro: {
|
intro: {
|
||||||
content: "$的下个出牌阶段结束时,你可以与其交换手牌",
|
content: "$的下个出牌阶段结束时,你可以与其交换手牌",
|
||||||
|
|
|
@ -1251,15 +1251,17 @@ const skills = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async content(event, trigger, player) {
|
async content(event, trigger, player) {
|
||||||
await player.addToExpansion(event.cards, player, "give").gaintag.add("kud_qiaoshou_equip");
|
const next = player.addToExpansion(event.cards, player, "give");
|
||||||
|
next.gaintag.add("kud_qiaoshou_equip");
|
||||||
|
await next;
|
||||||
if (!player.getExpansions("kud_qiaoshou_equip").length) return;
|
if (!player.getExpansions("kud_qiaoshou_equip").length) return;
|
||||||
player.addTempSkill("kud_qiaoshou_equip", {
|
player.addTempSkill("kud_qiaoshou_equip", {
|
||||||
player: ["phaseUseEnd", "phaseZhunbeiBegin"],
|
player: ["phaseUseEnd", "phaseZhunbeiBegin"],
|
||||||
});
|
});
|
||||||
var name = event.cost_data.cardname;
|
const name = event.cost_data.cardname;
|
||||||
player.storage.kud_qiaoshou_equip2 = name;
|
player.storage.kud_qiaoshou_equip2 = name;
|
||||||
player.markAuto("kud_qiaoshou_equip", cards);
|
player.markAuto("kud_qiaoshou_equip", event.cards);
|
||||||
var info = lib.card[name].skills;
|
const info = lib.card[name].skills;
|
||||||
if (info && info.length) player.addAdditionalSkill("kud_qiaoshou_equip", info);
|
if (info && info.length) player.addAdditionalSkill("kud_qiaoshou_equip", info);
|
||||||
game.log(player, "声明了", "#y" + get.translation(name));
|
game.log(player, "声明了", "#y" + get.translation(name));
|
||||||
await player.draw();
|
await player.draw();
|
||||||
|
|
|
@ -13939,24 +13939,20 @@ const skills = {
|
||||||
} else event.finish();
|
} else event.finish();
|
||||||
"step 2";
|
"step 2";
|
||||||
player.gain(event.cards, "gain2");
|
player.gain(event.cards, "gain2");
|
||||||
player
|
"step 3"
|
||||||
.chooseControl()
|
if (!player.countCards("he")) event.finish();
|
||||||
.set("choiceList", ["将" + get.cnNumber(event.num) + "张牌交给一名其他角色", "弃置" + get.cnNumber(event.num) + "张牌"])
|
else player.chooseControl().set("choiceList", ["将" + get.cnNumber(event.num) + "张牌交给一名其他角色", "弃置" + get.cnNumber(event.num) + "张牌"]).set("ai", function () {
|
||||||
.set("ai", function () {
|
if (game.hasPlayer(function (current) {
|
||||||
if (
|
return current != player && get.attitude(player, current) > 2;
|
||||||
game.hasPlayer(function (current) {
|
})) return 0;
|
||||||
return current != player && get.attitude(player, current) > 2;
|
return 1;
|
||||||
})
|
});
|
||||||
)
|
"step 4";
|
||||||
return 0;
|
|
||||||
return 1;
|
|
||||||
});
|
|
||||||
"step 3";
|
|
||||||
if (result.index == 0) {
|
if (result.index == 0) {
|
||||||
player.chooseCardTarget({
|
player.chooseCardTarget({
|
||||||
position: "he",
|
position: "he",
|
||||||
filterCard: true,
|
filterCard: true,
|
||||||
selectCard: event.num,
|
selectCard: Math.min(event.num, player.countCards("he")),
|
||||||
filterTarget: function (card, player, target) {
|
filterTarget: function (card, player, target) {
|
||||||
return player != target;
|
return player != target;
|
||||||
},
|
},
|
||||||
|
@ -13976,7 +13972,7 @@ const skills = {
|
||||||
player.chooseToDiscard(event.num, true, "he");
|
player.chooseToDiscard(event.num, true, "he");
|
||||||
event.finish();
|
event.finish();
|
||||||
}
|
}
|
||||||
"step 4";
|
"step 5";
|
||||||
if (result.bool) {
|
if (result.bool) {
|
||||||
var target = result.targets[0];
|
var target = result.targets[0];
|
||||||
player.give(result.cards, target);
|
player.give(result.cards, target);
|
||||||
|
|
|
@ -4064,7 +4064,8 @@ const skills = {
|
||||||
"step 0";
|
"step 0";
|
||||||
player.give(cards, targets[0], "give");
|
player.give(cards, targets[0], "give");
|
||||||
"step 1";
|
"step 1";
|
||||||
targets[0].chooseToCompare(targets[1]);
|
if (targets[0].canCompare(targets[1])) targets[0].chooseToCompare(targets[1]);
|
||||||
|
else event.finish();
|
||||||
"step 2";
|
"step 2";
|
||||||
if (result.bool) {
|
if (result.bool) {
|
||||||
targets[1].loseHp();
|
targets[1].loseHp();
|
||||||
|
|
|
@ -7237,25 +7237,34 @@ const skills = {
|
||||||
content: function () {
|
content: function () {
|
||||||
"step 0";
|
"step 0";
|
||||||
player.showHandcards();
|
player.showHandcards();
|
||||||
if (get.color(player.getCards("h")) != "none") {
|
const hs = player.getCards("h"), color = get.color(hs[0], player);
|
||||||
|
if (hs.length === 1 || !hs.some((card,index) => {
|
||||||
|
return index > 0 && get.color(card) !== color;
|
||||||
|
})) {
|
||||||
player.draw();
|
player.draw();
|
||||||
player.addTempSkill("rehuaiyi2", "phaseUseEnd");
|
player.addTempSkill("rehuaiyi2", "phaseUseEnd");
|
||||||
event.finish();
|
event.finish();
|
||||||
}
|
}
|
||||||
"step 1";
|
"step 1";
|
||||||
player.chooseControl("红色", "黑色").set("ai", function () {
|
|
||||||
var player = _status.event.player;
|
const list = [], bannedList = [], indexs = Object.keys(lib.color);
|
||||||
if (player.countCards("h", { color: "red" }) == 1 && player.countCards("h", { color: "black" }) > 1) return "红色";
|
player.getCards("h").forEach(card => {
|
||||||
return "黑色";
|
const color = get.color(card, player);
|
||||||
|
list.add(color);
|
||||||
|
if (!lib.filter.cardDiscardable(card, player, "rehuaiyi")) bannedList.add(color);
|
||||||
});
|
});
|
||||||
|
list.removeArray(bannedList);
|
||||||
|
list.sort((a, b) => indexs.indexOf(a) - indexs.indexOf(b));
|
||||||
|
if (!list.length) event.finish();
|
||||||
|
else if(list.length === 1) event._result = {control: list[0]};
|
||||||
|
else player.chooseControl(list.map(i => `${i}2`)).set("ai", function () {
|
||||||
|
var player = _status.event.player;
|
||||||
|
if (player.countCards("h", { color: "red" }) == 1 && player.countCards("h", { color: "black" }) > 1) return 1;
|
||||||
|
return 0;
|
||||||
|
}).set("prompt", "请选择弃置一种颜色的所有手牌");
|
||||||
"step 2";
|
"step 2";
|
||||||
event.control = result.control;
|
event.control = result.control.slice(0, result.control.length - 1);
|
||||||
var cards;
|
var cards = player.getCards("h", {color: event.control});
|
||||||
if (event.control == "红色") {
|
|
||||||
cards = player.getCards("h", { color: "red" });
|
|
||||||
} else {
|
|
||||||
cards = player.getCards("h", { color: "black" });
|
|
||||||
}
|
|
||||||
player.discard(cards);
|
player.discard(cards);
|
||||||
event.num = cards.length;
|
event.num = cards.length;
|
||||||
"step 3";
|
"step 3";
|
||||||
|
|
|
@ -677,7 +677,8 @@ const skills = {
|
||||||
content: "expansion",
|
content: "expansion",
|
||||||
markcount: "expansion",
|
markcount: "expansion",
|
||||||
mark(dialog, storage, player) {
|
mark(dialog, storage, player) {
|
||||||
return "共扣置" + get.cnNumber(player.getExpansions("olqushi_effect").length) + "张“趋”";
|
if (storage.some(source => source.isUnderControl(true))) dialog.add(player.getExpansions("olqushi_effect"));
|
||||||
|
else return "共扣置" + get.cnNumber(player.getExpansions("olqushi_effect").length) + "张“趋”";
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
trigger: { player: "phaseJieshuBegin" },
|
trigger: { player: "phaseJieshuBegin" },
|
||||||
|
@ -687,29 +688,18 @@ const skills = {
|
||||||
const cards = player.getExpansions("olqushi_effect");
|
const cards = player.getExpansions("olqushi_effect");
|
||||||
if (cards.length) {
|
if (cards.length) {
|
||||||
await player.loseToDiscardpile(cards);
|
await player.loseToDiscardpile(cards);
|
||||||
const targets = player
|
const targets = player.getStorage("olqushi_effect").filter(i => {
|
||||||
.getStorage("olqushi_effect")
|
return i.isIn();
|
||||||
.filter(i => {
|
}).sortBySeat();
|
||||||
return i.isIn();
|
const num = Math.min(player.getHistory("useCard", evt => {
|
||||||
})
|
return evt.targets && evt.targets.length;
|
||||||
.sortBySeat();
|
}).reduce((targets, evt) => {
|
||||||
const num = Math.min(
|
targets.addArray(evt.targets);
|
||||||
player
|
return targets;
|
||||||
.getHistory("useCard", evt => {
|
}, []).length, 5);
|
||||||
return evt.targets && evt.targets.length;
|
if (targets.length && num>0 && player.getHistory("useCard", evt => {
|
||||||
})
|
return cards.some(card => get.type2(card) == get.type2(evt.card));
|
||||||
.reduce((sum, evt) => {
|
}).length) {
|
||||||
return sum + evt.targets.length;
|
|
||||||
}, 0),
|
|
||||||
5
|
|
||||||
);
|
|
||||||
if (
|
|
||||||
targets.length &&
|
|
||||||
player.getHistory("useCard", evt => {
|
|
||||||
return cards.some(card => get.type2(card) == get.type2(evt.card));
|
|
||||||
}).length &&
|
|
||||||
num
|
|
||||||
) {
|
|
||||||
for (const target of targets) await target.draw(num);
|
for (const target of targets) await target.draw(num);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3416,30 +3406,28 @@ const skills = {
|
||||||
return player.hasCard(card => lib.filter.cardDiscardable(card, player), "he");
|
return player.hasCard(card => lib.filter.cardDiscardable(card, player), "he");
|
||||||
},
|
},
|
||||||
check: function (card) {
|
check: function (card) {
|
||||||
var player = _status.event.player;
|
var player = get.player();
|
||||||
return (5 - get.value(card)) / Math.pow(Math.max(0.1, player.getUseValue(card)), 0.33);
|
return (5 - get.value(card)) / Math.pow(Math.max(0.1, player.getUseValue(card)), 0.33);
|
||||||
},
|
},
|
||||||
content: function () {
|
content: function () {
|
||||||
"step 0";
|
"step 0";
|
||||||
player
|
player.judge(card => {
|
||||||
.judge(card => {
|
var evt = get.event().getParent("olweifu");
|
||||||
var evt = _status.event.getParent();
|
if (evt.name !== "olweifu") return 0;
|
||||||
var cardx = evt.cards[0];
|
var cardx = evt.cards[0];
|
||||||
if (get.type2(card) == get.type2(cardx)) return 0.5;
|
if (get.type2(card) == get.type2(cardx)) return 0.5;
|
||||||
return 0.1;
|
return 0.1;
|
||||||
})
|
}).set("callback", function () {
|
||||||
.set("callback", function () {
|
var card = event.judgeResult.card;
|
||||||
var card = event.judgeResult.card;
|
player.addTempSkill("olweifu_clear");
|
||||||
player.addTempSkill("olweifu_clear");
|
player.addTempSkill("olweifu_add");
|
||||||
player.addTempSkill("olweifu_add");
|
if (!get.is.object(player.storage.olweifu_add)) player.storage.olweifu_add = {};
|
||||||
if (!get.is.object(player.storage.olweifu_add)) player.storage.olweifu_add = {};
|
var type = get.type2(card, player);
|
||||||
var type = get.type2(card, player);
|
if (typeof player.storage.olweifu_add[type] != "number") player.storage.olweifu_add[type] = 0;
|
||||||
if (typeof player.storage.olweifu_add[type] != "number") player.storage.olweifu_add[type] = 0;
|
player.storage.olweifu_add[type]++;
|
||||||
player.storage.olweifu_add[type]++;
|
player.markSkill("olweifu_add");
|
||||||
player.markSkill("olweifu_add");
|
if (type == get.type2(event.getParent(2).cards[0], player)) player.draw();
|
||||||
if (type == get.type2(event.getParent(2).cards[0], player)) player.draw();
|
}).set("judge2", result => result.bool);
|
||||||
})
|
|
||||||
.set("judge2", result => result.bool);
|
|
||||||
},
|
},
|
||||||
ai: {
|
ai: {
|
||||||
order: 7,
|
order: 7,
|
||||||
|
@ -3457,9 +3445,7 @@ const skills = {
|
||||||
1 >
|
1 >
|
||||||
(get.is.object(player.storage.olweifu_add) ? player.storage.olweifu_add[type] || 0 : 0)
|
(get.is.object(player.storage.olweifu_add) ? player.storage.olweifu_add[type] || 0 : 0)
|
||||||
);
|
);
|
||||||
}, "hs")
|
}, "hs") ? 1 : 0;
|
||||||
? 1
|
|
||||||
: 0;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -20480,7 +20466,8 @@ const skills = {
|
||||||
player.storage.jianshu = true;
|
player.storage.jianshu = true;
|
||||||
player.give(cards, targets[0], "give");
|
player.give(cards, targets[0], "give");
|
||||||
"step 1";
|
"step 1";
|
||||||
targets[0].chooseToCompare(targets[1]);
|
if (targets[0].canCompare(targets[1])) targets[0].chooseToCompare(targets[1]);
|
||||||
|
else event.finish();
|
||||||
"step 2";
|
"step 2";
|
||||||
if (result.bool) {
|
if (result.bool) {
|
||||||
targets[0].chooseToDiscard("he", 2, true);
|
targets[0].chooseToDiscard("he", 2, true);
|
||||||
|
|
|
@ -849,7 +849,7 @@ const translates = {
|
||||||
sp_ol_zhanghe: "SP张郃",
|
sp_ol_zhanghe: "SP张郃",
|
||||||
sp_ol_zhanghe_prefix: "SP",
|
sp_ol_zhanghe_prefix: "SP",
|
||||||
spolzhouxuan: "周旋",
|
spolzhouxuan: "周旋",
|
||||||
spolzhouxuan_info: "①弃牌阶段开始时,你可将任意张置于武将牌上,称为“旋”(你至多拥有五张“旋”)。②当你使用牌时,你随机将一张“旋”置入弃牌堆,然后摸一张牌(若你的手牌数不为全场唯一最多则额外摸X张牌,X为“旋”数)。③出牌阶段结束时,你将所有“旋”置入弃牌堆。",
|
spolzhouxuan_info: "①弃牌阶段开始时,你可将任意张手牌置于武将牌上,称为“旋”(你至多拥有五张“旋”)。②当你使用牌时,你随机将一张“旋”置入弃牌堆,然后摸一张牌(若你的手牌数不为全场唯一最多则额外摸X张牌,X为“旋”数)。③出牌阶段结束时,你将所有“旋”置入弃牌堆。",
|
||||||
wuyan: "吾彦",
|
wuyan: "吾彦",
|
||||||
lanjiang: "澜疆",
|
lanjiang: "澜疆",
|
||||||
lanjiang_info: "结束阶段,你可以选择所有手牌数不小于你的角色。这些角色依次选择是否令你摸一张牌。然后你可以对其中一名手牌数等于你的角色造成1点伤害,随后令其中一名手牌数小于你的角色摸一张牌。",
|
lanjiang_info: "结束阶段,你可以选择所有手牌数不小于你的角色。这些角色依次选择是否令你摸一张牌。然后你可以对其中一名手牌数等于你的角色造成1点伤害,随后令其中一名手牌数小于你的角色摸一张牌。",
|
||||||
|
@ -1218,7 +1218,7 @@ const translates = {
|
||||||
olchongshen_info: "你可以将本轮得到的红色手牌当作【闪】使用。",
|
olchongshen_info: "你可以将本轮得到的红色手牌当作【闪】使用。",
|
||||||
guotu: "郭图",
|
guotu: "郭图",
|
||||||
olqushi: "趋势",
|
olqushi: "趋势",
|
||||||
olqushi_info: "出牌阶段限一次,你可以摸一张牌,然后将一张手牌扣置于一名其他角色的武将牌上,称为“趋”。目标角色于其结束阶段移去武将牌上的所有“趋”,若其于本回合使用过与“趋”相同类别的牌,则你摸X张牌(X为其本回合使用牌指定过的目标数之和且至多为5)。",
|
olqushi_info: "出牌阶段限一次,你可以摸一张牌,然后将一张手牌扣置于一名其他角色的武将牌上,称为“趋”。目标角色于其结束阶段移去武将牌上的所有“趋”,若其于本回合使用过与“趋”相同类别的牌,则你摸X张牌(X为其本回合被其使用牌指定过的角色数总和且至多为5)。",
|
||||||
olweijie: "诿解",
|
olweijie: "诿解",
|
||||||
olweijie_info: "回合外每名角色的回合限一次,当你需要使用或打出一张基本牌时,你可以弃置距离为1的一名角色的一张手牌,若此牌牌名与你需要使用或打出的牌的牌名相同,则视为你使用或打出之。",
|
olweijie_info: "回合外每名角色的回合限一次,当你需要使用或打出一张基本牌时,你可以弃置距离为1的一名角色的一张手牌,若此牌牌名与你需要使用或打出的牌的牌名相同,则视为你使用或打出之。",
|
||||||
liupan: "刘磐",
|
liupan: "刘磐",
|
||||||
|
|
|
@ -66,7 +66,7 @@ const characters = {
|
||||||
tw_daxiaoqiao: ["female", "wu", 3, ["twxingwu", "twpingting"], ["tempname:daxiaoqiao"]],
|
tw_daxiaoqiao: ["female", "wu", 3, ["twxingwu", "twpingting"], ["tempname:daxiaoqiao"]],
|
||||||
tw_furong: ["male", "shu", 4, ["twxuewei", "twliechi"]],
|
tw_furong: ["male", "shu", 4, ["twxuewei", "twliechi"]],
|
||||||
tw_yl_luzhi: ["male", "qun", 3, ["twmingren", "twzhenliang"]],
|
tw_yl_luzhi: ["male", "qun", 3, ["twmingren", "twzhenliang"]],
|
||||||
tw_liuzhang: ["male", "qun", 3, ["jutu", "twyaohu", "rehuaibi"]],
|
tw_liuzhang: ["male", "qun", 3, ["jutu", "twyaohu", "rehuaibi"], ["zhu"]],
|
||||||
tw_zongyu: ["male", "shu", 3, ["twzhibian", "twyuyan"]],
|
tw_zongyu: ["male", "shu", 3, ["twzhibian", "twyuyan"]],
|
||||||
tw_zhouchu: ["male", "wu", 4, ["twguoyi", "twchuhai"]],
|
tw_zhouchu: ["male", "wu", 4, ["twguoyi", "twchuhai"]],
|
||||||
tw_qiaogong: ["male", "wu", 3, ["twyizhu", "twluanchou"]],
|
tw_qiaogong: ["male", "wu", 3, ["twyizhu", "twluanchou"]],
|
||||||
|
|
|
@ -458,19 +458,16 @@ const skills = {
|
||||||
trigger: { global: "damageBegin1" },
|
trigger: { global: "damageBegin1" },
|
||||||
filter(event, player) {
|
filter(event, player) {
|
||||||
if (event.getParent().type != "card" || event.card.name != "juedou" || !event.player.isIn()) return false;
|
if (event.getParent().type != "card" || event.card.name != "juedou" || !event.player.isIn()) return false;
|
||||||
const evt = game.getGlobalHistory("useCard", evt => evt.card == event.card)[0];
|
const evt = event.getParent()
|
||||||
if (evt && evt.targets && (event.player != player || player.countCards("h"))) {
|
if (evt && evt.targets && (event.player != player || player.countCards("h") > 0)) {
|
||||||
if (evt.player == player) {
|
return (evt.player === player || evt.targets.includes(player));
|
||||||
return evt.targets.includes(event.player) && event.player != player;
|
|
||||||
}
|
|
||||||
return evt.targets.includes(player) && evt.player != player;
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
forced: true,
|
forced: true,
|
||||||
popup: false,
|
popup: false,
|
||||||
async content(event, trigger, player) {
|
async content(event, trigger, player) {
|
||||||
await player.logSkill("twxiayong" + (trigger.player === player ? "1" : "2"), trigger.player);
|
player.logSkill("twxiayong" + (trigger.player === player ? "1" : "2"), trigger.player);
|
||||||
if (trigger.player === player) {
|
if (trigger.player === player) {
|
||||||
const cards = player.getCards("h", card => {
|
const cards = player.getCards("h", card => {
|
||||||
return lib.filter.cardDiscardable(card, player, "twxiayong");
|
return lib.filter.cardDiscardable(card, player, "twxiayong");
|
||||||
|
|
|
@ -12693,7 +12693,10 @@ const skills = {
|
||||||
} else event.finish();
|
} else event.finish();
|
||||||
} else if (target.isLinked()) target.link();
|
} else if (target.isLinked()) target.link();
|
||||||
"step 3";
|
"step 3";
|
||||||
if (target.isIn()) target.addMark("baoshu", event.num2);
|
if (target.isIn()){
|
||||||
|
target.addSkill("baoshu_draw");
|
||||||
|
target.addMark("baoshu", event.num2);
|
||||||
|
}
|
||||||
if (num < targets.length - 1) {
|
if (num < targets.length - 1) {
|
||||||
event.num++;
|
event.num++;
|
||||||
event.goto(2);
|
event.goto(2);
|
||||||
|
@ -12703,20 +12706,22 @@ const skills = {
|
||||||
intro: {
|
intro: {
|
||||||
name2: "梳",
|
name2: "梳",
|
||||||
content: "mark",
|
content: "mark",
|
||||||
|
onunmark(storage, player){
|
||||||
|
delete player.storage.baoshu;
|
||||||
|
player.removeSkill("baoshu_draw");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
group: "baoshu_draw",
|
//group: "baoshu_draw",
|
||||||
subSkill: {
|
subSkill: {
|
||||||
draw: {
|
draw: {
|
||||||
trigger: { global: "phaseDrawBegin2" },
|
trigger: { player: "phaseDrawBegin2" },
|
||||||
forced: true,
|
forced: true,
|
||||||
popup: false,
|
charlotte: true,
|
||||||
filter: function (event, player) {
|
filter: function (event, player) {
|
||||||
return !event.numFixed && event.player.hasMark("baoshu");
|
return !event.numFixed && player.hasMark("baoshu");
|
||||||
},
|
},
|
||||||
content: function () {
|
content: function () {
|
||||||
var target = trigger.player,
|
var num = player.countMark("baoshu");
|
||||||
num = target.countMark("baoshu");
|
|
||||||
trigger.player.logSkill("baoshu_draw");
|
|
||||||
trigger.num += num;
|
trigger.num += num;
|
||||||
trigger.player.removeMark("baoshu", num);
|
trigger.player.removeMark("baoshu", num);
|
||||||
},
|
},
|
||||||
|
@ -15523,7 +15528,6 @@ const skills = {
|
||||||
wlcuorui: {
|
wlcuorui: {
|
||||||
audio: 2,
|
audio: 2,
|
||||||
trigger: { player: "phaseUseBegin" },
|
trigger: { player: "phaseUseBegin" },
|
||||||
direct: true,
|
|
||||||
filter: function (event, player) {
|
filter: function (event, player) {
|
||||||
if (!["identity", "guozhan"].includes(get.mode())) {
|
if (!["identity", "guozhan"].includes(get.mode())) {
|
||||||
return game.hasPlayer(function (current) {
|
return game.hasPlayer(function (current) {
|
||||||
|
@ -15534,52 +15538,37 @@ const skills = {
|
||||||
return get.distance(player, current) <= 1 && current.countDiscardableCards(player, "hej") > 0;
|
return get.distance(player, current) <= 1 && current.countDiscardableCards(player, "hej") > 0;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
async cost(event, trigger, player){
|
||||||
|
if (!["identity", "guozhan"].includes(get.mode())) {
|
||||||
|
event.result = await player.chooseTarget(function (card, player, target) {
|
||||||
|
return target.isFriendOf(player) && target.countDiscardableCards(player, "hej") > 0;
|
||||||
|
}, get.prompt2("wlcuorui")).set("ai", function (target) {
|
||||||
|
if (target.countCards("e", function (card) {
|
||||||
|
return card.name != "tengjia" && get.value(card, target) <= 0;
|
||||||
|
})) return 10;
|
||||||
|
if (target.countCards("j", function (card) {
|
||||||
|
return get.effect(target, { name: card.viewAs || card.name }, target, target) < 0;
|
||||||
|
})) return 10;
|
||||||
|
return Math.random() + 0.2 - 1 / target.countCards("hej");
|
||||||
|
}).forResult();
|
||||||
|
} else {
|
||||||
|
event.result = await player.chooseTarget(function (card, player, target) {
|
||||||
|
return get.distance(player, target) <= 1 && target.countDiscardableCards(player, "hej") > 0;
|
||||||
|
}, get.prompt2("wlcuorui")).set("ai", function (target) {
|
||||||
|
if (game.hasPlayer(current => {
|
||||||
|
return current != target && get.attitude(_status.event.player, current) < 0;
|
||||||
|
})) return get.effect(target, { name: "guohe" }, player, player) + 10;
|
||||||
|
return 0;
|
||||||
|
}).forResult();
|
||||||
|
}
|
||||||
|
},
|
||||||
content: function () {
|
content: function () {
|
||||||
"step 0";
|
"step 0";
|
||||||
if (!["identity", "guozhan"].includes(get.mode())) {
|
var target = targets[0];
|
||||||
player
|
event.target = target;
|
||||||
.chooseTarget(function (card, player, target) {
|
player.discardPlayerCard(target, "hej", true);
|
||||||
return target.isFriendOf(player) && target.countDiscardableCards(player, "hej") > 0;
|
if (["identity", "guozhan"].includes(get.mode())) event.goto(6);
|
||||||
}, get.prompt2("wlcuorui"))
|
|
||||||
.set("ai", function (target) {
|
|
||||||
if (
|
|
||||||
target.countCards("e", function (card) {
|
|
||||||
return card.name != "tengjia" && get.value(card, target) <= 0;
|
|
||||||
})
|
|
||||||
)
|
|
||||||
return 10;
|
|
||||||
if (
|
|
||||||
target.countCards("j", function (card) {
|
|
||||||
return get.effect(target, { name: card.viewAs || card.name }, target, target) < 0;
|
|
||||||
})
|
|
||||||
)
|
|
||||||
return 10;
|
|
||||||
return Math.random() + 0.2 - 1 / target.countCards("hej");
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
player
|
|
||||||
.chooseTarget(function (card, player, target) {
|
|
||||||
return get.distance(player, target) <= 1 && target.countDiscardableCards(player, "hej") > 0;
|
|
||||||
}, get.prompt2("wlcuorui"))
|
|
||||||
.set("ai", function (target) {
|
|
||||||
if (
|
|
||||||
game.hasPlayer(current => {
|
|
||||||
return current != target && get.attitude(_status.event.player, current) < 0;
|
|
||||||
})
|
|
||||||
)
|
|
||||||
return get.effect(target, { name: "guohe" }, player, player) + 10;
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
"step 1";
|
"step 1";
|
||||||
if (result.bool) {
|
|
||||||
var target = result.targets[0];
|
|
||||||
event.target = target;
|
|
||||||
player.logSkill("wlcuorui", target);
|
|
||||||
player.discardPlayerCard(target, "hej", true);
|
|
||||||
if (["identity", "guozhan"].includes(get.mode())) event.goto(7);
|
|
||||||
} else event.finish();
|
|
||||||
"step 2";
|
|
||||||
if (!result.cards || !result.cards.length) {
|
if (!result.cards || !result.cards.length) {
|
||||||
event.finish();
|
event.finish();
|
||||||
return;
|
return;
|
||||||
|
@ -15587,64 +15576,46 @@ const skills = {
|
||||||
var color = get.color(result.cards[0], result.cards[0].original == "j" ? false : target);
|
var color = get.color(result.cards[0], result.cards[0].original == "j" ? false : target);
|
||||||
event.color = color;
|
event.color = color;
|
||||||
var list = [];
|
var list = [];
|
||||||
if (
|
if (game.hasPlayer(function (current) {
|
||||||
game.hasPlayer(function (current) {
|
return (get.mode() == "versus" ? current.isEnemyOf(player) : current != player && current != target) && current.countCards("h");
|
||||||
return (get.mode() == "versus" ? current.isEnemyOf(player) : current != player && current != target) && current.countCards("h");
|
})) list.push("展示手牌");
|
||||||
})
|
if (game.hasPlayer(function (current) {
|
||||||
)
|
return (get.mode() == "versus" ? current.isEnemyOf(player) : current != player && current != target) && current.countCards("e", { color: color });
|
||||||
list.push("展示手牌");
|
})) list.push("弃置装备");
|
||||||
if (
|
|
||||||
game.hasPlayer(function (current) {
|
|
||||||
return (get.mode() == "versus" ? current.isEnemyOf(player) : current != player && current != target) && current.countCards("e", { color: color });
|
|
||||||
})
|
|
||||||
)
|
|
||||||
list.push("弃置装备");
|
|
||||||
if (!list.length) {
|
if (!list.length) {
|
||||||
event.finish();
|
event.finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (list.length == 1) event._result = { control: list[0] };
|
if (list.length == 1) event._result = { control: list[0] };
|
||||||
else
|
else player.chooseControl(list).set("prompt", "挫锐:展示对手的至多两张手牌,或弃置对手装备区内至多两张" + get.translation(color) + "牌").set("ai", function () {
|
||||||
player
|
var player = _status.event.player;
|
||||||
.chooseControl(list)
|
var color = _status.event.getParent().color;
|
||||||
.set("prompt", "挫锐:展示对手的至多两张手牌,或弃置对手装备区内至多两张" + get.translation(color) + "牌")
|
if (game.countPlayer(function (current) {
|
||||||
.set("ai", function () {
|
if (!current.isEnemyOf(player)) return false;
|
||||||
var player = _status.event.player;
|
return current.countCards("e", function (card) {
|
||||||
var color = _status.event.getParent().color;
|
return get.color(card) == color && get.value(card) > 0;
|
||||||
if (
|
|
||||||
game.countPlayer(function (current) {
|
|
||||||
if (!current.isEnemyOf(player)) return false;
|
|
||||||
return current.countCards("e", function (card) {
|
|
||||||
return get.color(card) == color && get.value(card) > 0;
|
|
||||||
});
|
|
||||||
}) > 1
|
|
||||||
)
|
|
||||||
return 1;
|
|
||||||
return 0;
|
|
||||||
});
|
});
|
||||||
"step 3";
|
}) > 1) return 1;
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
"step 2";
|
||||||
if (result.control == "弃置装备") event.goto(5);
|
if (result.control == "弃置装备") event.goto(5);
|
||||||
else {
|
else {
|
||||||
var dialog = ["请选择要展示的牌"];
|
var dialog = ["请选择要展示的牌"];
|
||||||
var list = game
|
var list = game.filterPlayer(function (current) {
|
||||||
.filterPlayer(function (current) {
|
return current.isEnemyOf(player) && current.countCards("h");
|
||||||
return current.isEnemyOf(player) && current.countCards("h");
|
}).sortBySeat();
|
||||||
})
|
|
||||||
.sortBySeat();
|
|
||||||
for (var i of list) {
|
for (var i of list) {
|
||||||
dialog.push('<div class="text center">' + get.translation(i) + "</div>");
|
dialog.push('<div class="text center">' + get.translation(i) + "</div>");
|
||||||
if (player.hasSkillTag("viewHandcard", null, i, true)) dialog.push(i.getCards("h"));
|
if (player.hasSkillTag("viewHandcard", null, i, true)) dialog.push(i.getCards("h"));
|
||||||
else dialog.push([i.getCards("h"), "blank"]);
|
else dialog.push([i.getCards("h"), "blank"]);
|
||||||
}
|
}
|
||||||
player
|
player.chooseButton([1, 2], true).set("createDialog", dialog).set("ai", function (button) {
|
||||||
.chooseButton([1, 2], true)
|
var color = get.color(button.link) == _status.event.getParent().color;
|
||||||
.set("createDialog", dialog)
|
return color ? Math.random() : 0.35;
|
||||||
.set("ai", function (button) {
|
});
|
||||||
var color = get.color(button.link) == _status.event.getParent().color;
|
|
||||||
return color ? Math.random() : 0.35;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
"step 4";
|
"step 3";
|
||||||
player.showCards(result.links);
|
player.showCards(result.links);
|
||||||
var map = {};
|
var map = {};
|
||||||
var map2 = {};
|
var map2 = {};
|
||||||
|
@ -15666,34 +15637,27 @@ const skills = {
|
||||||
return lib.sort.seat(a.source || a.player, b.source || b.player);
|
return lib.sort.seat(a.source || a.player, b.source || b.player);
|
||||||
});
|
});
|
||||||
event.finish();
|
event.finish();
|
||||||
"step 5";
|
"step 4";
|
||||||
var dialog = ["请选择要弃置的牌"];
|
var dialog = ["请选择要弃置的牌"];
|
||||||
var list = game
|
var list = game.filterPlayer(function (current) {
|
||||||
.filterPlayer(function (current) {
|
return (
|
||||||
return (
|
current.isEnemyOf(player) &&
|
||||||
current.isEnemyOf(player) &&
|
current.countCards("e", function (card) {
|
||||||
current.countCards("e", function (card) {
|
|
||||||
return get.color(card) == event.color;
|
|
||||||
})
|
|
||||||
);
|
|
||||||
})
|
|
||||||
.sortBySeat();
|
|
||||||
for (var i of list) {
|
|
||||||
dialog.push('<div class="text center">' + get.translation(i) + "</div>");
|
|
||||||
dialog.push(
|
|
||||||
i.getCards("e", function (card) {
|
|
||||||
return get.color(card) == event.color;
|
return get.color(card) == event.color;
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
}).sortBySeat();
|
||||||
|
for (var i of list) {
|
||||||
|
dialog.push('<div class="text center">' + get.translation(i) + "</div>");
|
||||||
|
dialog.push(i.getCards("e", function (card) {
|
||||||
|
return get.color(card) == event.color;
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
player
|
player.chooseButton([1, 2], true).set("createDialog", dialog).set("ai", function (button) {
|
||||||
.chooseButton([1, 2], true)
|
var owner = get.owner(button.link);
|
||||||
.set("createDialog", dialog)
|
return get.value(button.link, owner);
|
||||||
.set("ai", function (button) {
|
});
|
||||||
var owner = get.owner(button.link);
|
"step 5";
|
||||||
return get.value(button.link, owner);
|
|
||||||
});
|
|
||||||
"step 6";
|
|
||||||
var map = {};
|
var map = {};
|
||||||
for (var i of result.links) {
|
for (var i of result.links) {
|
||||||
if (get.color(i) != event.color) continue;
|
if (get.color(i) != event.color) continue;
|
||||||
|
@ -15708,45 +15672,48 @@ const skills = {
|
||||||
return lib.sort.seat(a.player, b.player);
|
return lib.sort.seat(a.player, b.player);
|
||||||
});
|
});
|
||||||
event.finish();
|
event.finish();
|
||||||
"step 7";
|
"step 6";
|
||||||
if (!result.cards || !result.cards.length) {
|
if (!result.cards || !result.cards.length) {
|
||||||
event.finish();
|
event.finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (
|
var color = get.color(result.cards[0], result.cards[0].original == "j" ? false : target);
|
||||||
game.hasPlayer(current => {
|
if (game.hasPlayer(current => {
|
||||||
return current.countCards("he") > 0 && current != player && current != target;
|
return current != player && current != target && current.hasCard(card => {
|
||||||
})
|
const position = get.position(card);
|
||||||
) {
|
if (position === "h") return true;
|
||||||
var color = get.color(result.cards[0], result.cards[0].original == "j" ? false : target);
|
return position === "e" && get.color(card, current) === color;
|
||||||
|
}, "he");
|
||||||
|
})) {
|
||||||
event.color = color;
|
event.color = color;
|
||||||
var next = player.chooseTarget(true, "挫锐:选择另一名其他角色", "弃置该角色装备区里至多两张" + get.translation(event.color) + "牌;或展示该角色的至多两张手牌,然后获得其中的" + get.translation(event.color) + "牌");
|
var next = player.chooseTarget(true, "挫锐:选择另一名其他角色", "弃置该角色装备区里至多两张" + get.translation(event.color) + "牌;或展示该角色的至多两张手牌,然后获得其中的" + get.translation(event.color) + "牌");
|
||||||
next.set("filterTarget", (card, player, target) => {
|
next.set("filterTarget", (card, player, target) => {
|
||||||
return target.countCards("he") > 0 && target != player && target != _status.event.getParent().target;
|
const evt = get.event().getParent(), color = evt.color;
|
||||||
|
return target != player && target != evt.target && target.hasCard(card => {
|
||||||
|
const position = get.position(card);
|
||||||
|
if (position === "h") return true;
|
||||||
|
return position === "e" && get.color(card, target) === color;
|
||||||
|
}, "he");
|
||||||
});
|
});
|
||||||
next.set("ai", target => {
|
next.set("ai", target => {
|
||||||
return -get.attitude(_status.event.player, target) * target.countCards("he") + 0.1;
|
return -get.attitude(_status.event.player, target) * target.countCards("he") + 0.1;
|
||||||
});
|
});
|
||||||
} else event.finish();
|
} else event.finish();
|
||||||
"step 8";
|
"step 7";
|
||||||
if (result.bool) {
|
if (result.bool) {
|
||||||
var targetx = result.targets[0];
|
var targetx = result.targets[0];
|
||||||
event.targetx = targetx;
|
event.targetx = targetx;
|
||||||
player.line(targetx);
|
player.line(targetx);
|
||||||
player
|
player.choosePlayerCard(targetx, "he", true, [1, 2]).set("prompt", "展示至多两张手牌,或弃置至多两张" + get.translation(event.color) + "装备").set("filterButton", button => {
|
||||||
.choosePlayerCard(targetx, "he", true, [1, 2])
|
if (ui.selected.buttons.length) {
|
||||||
.set("prompt", "展示至多两张手牌,或弃置至多两张" + get.translation(event.color) + "装备")
|
var linkx = ui.selected.buttons[0].link;
|
||||||
.set("filterButton", button => {
|
if (get.position(button.link) != get.position(linkx)) return false;
|
||||||
if (ui.selected.buttons.length) {
|
}
|
||||||
var linkx = ui.selected.buttons[0].link;
|
if (get.position(button.link) == "e") return get.color(button.link, _status.event.target) == _status.event.getParent().color;
|
||||||
if (get.position(button.link) != get.position(linkx)) return false;
|
return true;
|
||||||
}
|
}).set("target", targetx);
|
||||||
if (get.position(button.link) == "e") return get.color(button.link, _status.event.target) == _status.event.getParent().color;
|
|
||||||
return true;
|
|
||||||
})
|
|
||||||
.set("target", targetx);
|
|
||||||
} else event.finish();
|
} else event.finish();
|
||||||
"step 9";
|
"step 8";
|
||||||
if (result.bool) {
|
if (result.bool) {
|
||||||
var cards = result.links;
|
var cards = result.links;
|
||||||
if (get.position(cards[0]) == "e") {
|
if (get.position(cards[0]) == "e") {
|
||||||
|
|
|
@ -212,7 +212,7 @@ const translates = {
|
||||||
dcgeyuan: "割圆",
|
dcgeyuan: "割圆",
|
||||||
dcgeyuan_info: "锁定技。①游戏开始时,你将从A至K的所有整数排列为一个环形链表,称为“圆环之理”。②当有一张牌进入弃牌堆后,若此牌的点数在“圆环之理”内,且“圆环之弧”为空或此牌的点数与“圆环之弧”两端的点数相邻,则你将此牌的点数记录进“圆环之弧”;然后若“圆环之弧”与“圆环之理”长度相同,则你从“圆环之理”中移除“圆环之弧”记录的第一个和最后一个数字A和B(当“圆环之理”长度不大于3时则不移除),清空“圆环之弧”,获得场上和牌堆中所有点数为A和B的牌。",
|
dcgeyuan_info: "锁定技。①游戏开始时,你将从A至K的所有整数排列为一个环形链表,称为“圆环之理”。②当有一张牌进入弃牌堆后,若此牌的点数在“圆环之理”内,且“圆环之弧”为空或此牌的点数与“圆环之弧”两端的点数相邻,则你将此牌的点数记录进“圆环之弧”;然后若“圆环之弧”与“圆环之理”长度相同,则你从“圆环之理”中移除“圆环之弧”记录的第一个和最后一个数字A和B(当“圆环之理”长度不大于3时则不移除),清空“圆环之弧”,获得场上和牌堆中所有点数为A和B的牌。",
|
||||||
dcjieshu: "解术",
|
dcjieshu: "解术",
|
||||||
dcjieshu_info: "锁定技。①所有点数不在“圆环之理”中的牌不计入你的手牌上限。②当你使用牌时,若“圆环之弧”为空或此牌的点数与“圆环之弧”两端的点数相邻,则你摸一张牌。",
|
dcjieshu_info: "锁定技。①所有点数不在“圆环之理”中的牌不计入你的手牌上限。②当你使用或打出牌时,若“圆环之弧”为空或此牌的点数与“圆环之弧”两端的点数相邻,则你摸一张牌。",
|
||||||
dcgusuan: "股算",
|
dcgusuan: "股算",
|
||||||
dcgusuan_info: "觉醒技。一名角色的回合结束时,若你的“圆环之理”长度为3,则你减1点体力上限并修改〖割圆〗。",
|
dcgusuan_info: "觉醒技。一名角色的回合结束时,若你的“圆环之理”长度为3,则你减1点体力上限并修改〖割圆〗。",
|
||||||
dcgeyuan_magica: "割圆·改",
|
dcgeyuan_magica: "割圆·改",
|
||||||
|
|
|
@ -8374,25 +8374,36 @@ const skills = {
|
||||||
usable: 1,
|
usable: 1,
|
||||||
delay: false,
|
delay: false,
|
||||||
filter: function (event, player) {
|
filter: function (event, player) {
|
||||||
return player.countCards("h", { color: "red" }) && player.countCards("h", { color: "black" });
|
return player.countCards("h") > 0;
|
||||||
},
|
},
|
||||||
content: function () {
|
content: function () {
|
||||||
"step 0";
|
"step 0";
|
||||||
player.showHandcards();
|
player.showHandcards();
|
||||||
"step 1";
|
const hs = player.getCards("h"), color = get.color(hs[0], player);
|
||||||
player.chooseControl("红色", "黑色").set("ai", function () {
|
if (hs.length === 1 || !hs.some((card,index) => {
|
||||||
var player = _status.event.player;
|
return index > 0 && get.color(card) !== color;
|
||||||
if (player.countCards("h", { color: "red" }) == 1 && player.countCards("h", { color: "black" }) > 1) return "红色";
|
})) {
|
||||||
return "黑色";
|
event.finish();
|
||||||
});
|
|
||||||
"step 2";
|
|
||||||
event.control = result.control;
|
|
||||||
var cards;
|
|
||||||
if (event.control == "红色") {
|
|
||||||
cards = player.getCards("h", { color: "red" });
|
|
||||||
} else {
|
|
||||||
cards = player.getCards("h", { color: "black" });
|
|
||||||
}
|
}
|
||||||
|
"step 1";
|
||||||
|
const list = [], bannedList = [], indexs = Object.keys(lib.color);
|
||||||
|
player.getCards("h").forEach(card => {
|
||||||
|
const color = get.color(card, player);
|
||||||
|
list.add(color);
|
||||||
|
if (!lib.filter.cardDiscardable(card, player, "huaiyi")) bannedList.add(color);
|
||||||
|
});
|
||||||
|
list.removeArray(bannedList);
|
||||||
|
list.sort((a, b) => indexs.indexOf(a) - indexs.indexOf(b));
|
||||||
|
if (!list.length) event.finish();
|
||||||
|
else if(list.length === 1) event._result = {control: list[0]};
|
||||||
|
else player.chooseControl(list.map(i => `${i}2`)).set("ai", function () {
|
||||||
|
var player = _status.event.player;
|
||||||
|
if (player.countCards("h", { color: "red" }) == 1 && player.countCards("h", { color: "black" }) > 1) return 1;
|
||||||
|
return 0;
|
||||||
|
}).set("prompt", "请选择弃置一种颜色的所有手牌");
|
||||||
|
"step 2";
|
||||||
|
event.control = result.control.slice(0, result.control.length - 1);
|
||||||
|
var cards = player.getCards("h", {color: event.control});
|
||||||
player.discard(cards);
|
player.discard(cards);
|
||||||
event.num = cards.length;
|
event.num = cards.length;
|
||||||
"step 3";
|
"step 3";
|
||||||
|
@ -8431,7 +8442,10 @@ const skills = {
|
||||||
return 1;
|
return 1;
|
||||||
},
|
},
|
||||||
result: {
|
result: {
|
||||||
player: 1,
|
player:(player) => {
|
||||||
|
if (get.color(player.getCards("h")) != "none") return 0;
|
||||||
|
return 1;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -2903,7 +2903,7 @@ const skills = {
|
||||||
},
|
},
|
||||||
content: function () {
|
content: function () {
|
||||||
var stat = player.getStat("skill");
|
var stat = player.getStat("skill");
|
||||||
if (this.trigger.name === "phaseUse") {
|
if (trigger.name === "phaseUse") {
|
||||||
delete stat.xinquanbian;
|
delete stat.xinquanbian;
|
||||||
} else {
|
} else {
|
||||||
if (!stat.xinquanbian) stat.xinquanbian = 0;
|
if (!stat.xinquanbian) stat.xinquanbian = 0;
|
||||||
|
|
|
@ -5056,11 +5056,11 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
|
||||||
async content(event, trigger, player) {
|
async content(event, trigger, player) {
|
||||||
trigger.targets.length = 0;
|
trigger.targets.length = 0;
|
||||||
trigger.all_excluded = true;
|
trigger.all_excluded = true;
|
||||||
const cards = trigger.cards.filter(i => !get.owner(i));
|
const cards = trigger.cards.filterInD();
|
||||||
if (cards.length && get.type(trigger.card) == "equip") {
|
if (cards.length && get.type(trigger.card) == "equip") {
|
||||||
await player.gain(cards, "gain2");
|
await player.gain(cards, "gain2");
|
||||||
for (let i of cards) {
|
for (let i of cards) {
|
||||||
if (get.owner(i) == player && player.hasUseTarget(i)) {
|
if (player.getCards("h").includes(i) && player.hasUseTarget(i)) {
|
||||||
await player.chooseUseTarget(i);
|
await player.chooseUseTarget(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6485,30 +6485,32 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
|
||||||
delay: false,
|
delay: false,
|
||||||
content: function () {
|
content: function () {
|
||||||
"step 0";
|
"step 0";
|
||||||
var map = {};
|
|
||||||
player.showHandcards();
|
player.showHandcards();
|
||||||
for (var i of ["red", "black", "none"]) {
|
var hs = player.getCards("h"), color = get.color(hs[0], player);
|
||||||
if (player.countCards("h", { color: i })) map[i] = true;
|
if (hs.length === 1 || !hs.some((card,index) => {
|
||||||
|
return index > 0 && get.color(card) !== color;
|
||||||
|
})) {
|
||||||
|
event.finish();
|
||||||
}
|
}
|
||||||
if (Object.keys(map).length < 2) event.finish();
|
|
||||||
else event.map = map;
|
|
||||||
"step 1";
|
"step 1";
|
||||||
var mapx = { red: "红色", black: "黑色", none: "无色" };
|
const list = [], bannedList = [], indexs = Object.keys(lib.color);
|
||||||
player
|
player.getCards("h").forEach(card => {
|
||||||
.chooseControl(Object.keys(event.map).map((color) => mapx[color]))
|
const color = get.color(card, player);
|
||||||
.set("ai", function () {
|
list.add(color);
|
||||||
var list = _status.event.controls;
|
if (!lib.filter.cardDiscardable(card, player, "gzrehuaiyi")) bannedList.add(color);
|
||||||
var map = { 红色: "red", 黑色: "black", 无色: "none" };
|
});
|
||||||
return list.sort(
|
list.removeArray(bannedList);
|
||||||
(a, b) =>
|
list.sort((a, b) => indexs.indexOf(a) - indexs.indexOf(b));
|
||||||
player.countCards("h", { color: map[a] }) -
|
if (!list.length) event.finish();
|
||||||
player.countCards("h", { color: map[b] })
|
else if(list.length === 1) event._result = {control: list[0]};
|
||||||
)[0];
|
else player.chooseControl(list.map(i => `${i}2`)).set("ai", function () {
|
||||||
})
|
var player = _status.event.player;
|
||||||
.set("prompt", "怀异:弃置一种颜色的所有牌");
|
if (player.countCards("h", { color: "red" }) == 1 && player.countCards("h", { color: "black" }) > 1) return 1;
|
||||||
|
return 0;
|
||||||
|
}).set("prompt", "请选择弃置一种颜色的所有手牌");
|
||||||
"step 2";
|
"step 2";
|
||||||
var map = { 红色: "red", 黑色: "black", 无色: "none" };
|
event.control = result.control.slice(0, result.control.length - 1);
|
||||||
var cards = player.getCards("h", { color: map[result.control] });
|
var cards = player.getCards("h", {color: event.control});
|
||||||
player.discard(cards);
|
player.discard(cards);
|
||||||
event.num = cards.length;
|
event.num = cards.length;
|
||||||
"step 3";
|
"step 3";
|
||||||
|
|
|
@ -9318,6 +9318,8 @@ export class Library {
|
||||||
none2: "无色",
|
none2: "无色",
|
||||||
red: "红色",
|
red: "红色",
|
||||||
black: "黑色",
|
black: "黑色",
|
||||||
|
red2: "红色",
|
||||||
|
black2: "黑色",
|
||||||
ok: "确定",
|
ok: "确定",
|
||||||
ok2: "确定",
|
ok2: "确定",
|
||||||
cancel: "取消",
|
cancel: "取消",
|
||||||
|
|
Loading…
Reference in New Issue