Merge pull request #1328 from mengxinzxz/PR-Branch

技能调整;minor fix
This commit is contained in:
Spmario233 2024-05-08 19:11:30 +08:00 committed by GitHub
commit eafa5e3f17
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 56 additions and 45 deletions

View File

@ -1017,20 +1017,13 @@ const skills = {
content() { content() {
"step 0"; "step 0";
player.unmarkSkill("clanyuzhi"); player.unmarkSkill("clanyuzhi");
if ( const cards = player.getCards("h", card => {
player.countCards("h", card => { return card.hasGaintag("clanyuzhi") && lib.filter.cardDiscardable(card, player);
return card.hasGaintag("clanyuzhi") && lib.filter.cardDiscardable(card, player); });
}) if (cards.length) {
) {
event.logged = true; event.logged = true;
player.chooseToDiscard( player.logSkill("clanyuzhi");
player.countCards("h"), player.discard(cards);
"h",
(card, player) => {
return card.hasGaintag("clanyuzhi");
},
true
).logSkill = "clanyuzhi";
} }
"step 1"; "step 1";
player.removeGaintag("clanyuzhi"); player.removeGaintag("clanyuzhi");
@ -2186,13 +2179,10 @@ const skills = {
"step 6"; "step 6";
var current = targets.shift(); var current = targets.shift();
current current
.chooseToUse( .chooseToUse(function (card, player, event) {
function (card, player, event) { if (get.name(card) != "sha") return false;
if (get.name(card) != "sha") return false; return lib.filter.filterCard.apply(this, arguments);
return lib.filter.filterCard.apply(this, arguments); }, "联诛:是否对" + get.translation(event.targetx) + "使用一张杀?")
},
"联诛:是否对" + get.translation(event.targetx) + "使用一张杀?"
)
.set("targetRequired", true) .set("targetRequired", true)
.set("complexSelect", true) .set("complexSelect", true)
.set("filterTarget", function (card, player, target) { .set("filterTarget", function (card, player, target) {
@ -2355,21 +2345,24 @@ const skills = {
filter(event, player) { filter(event, player) {
return game.hasPlayer(current => player.canCompare(current)); return game.hasPlayer(current => player.canCompare(current));
}, },
async cost(event, trigger, player){ async cost(event, trigger, player) {
event.result = await player.chooseTarget(get.prompt("clanliuju"), "与一名其他角色拼点,输的角色可以使用任意张拼点牌中的非基本牌", (card, player, target) => { event.result = await player
return player.canCompare(target); .chooseTarget(get.prompt("clanliuju"), "与一名其他角色拼点,输的角色可以使用任意张拼点牌中的非基本牌", (card, player, target) => {
}).set("ai", target => { return player.canCompare(target);
var player = _status.event.player; })
var ts = target.getCards("h").sort((a, b) => get.number(a) - get.number(b)); .set("ai", target => {
if (get.attitude(player, target) < 0) { var player = _status.event.player;
var hs = player.getCards("h").sort((a, b) => get.number(a) - get.number(b)); var ts = target.getCards("h").sort((a, b) => get.number(a) - get.number(b));
if (!hs.length || !ts.length) return 0; if (get.attitude(player, target) < 0) {
if (get.type(hs[0], null, false) == "basic" && get.value(hs[0]) > 6) return 0; var hs = player.getCards("h").sort((a, b) => get.number(a) - get.number(b));
if (get.number(hs[0]) < get.number(ts[0]) || get.type(hs[0], null, false) == "basic") return 1; if (!hs.length || !ts.length) return 0;
return Math.random() - 0.7; 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 get.type(ts[0]) != "basic"; return Math.random() - 0.7;
}).forResult(); }
return get.type(ts[0]) != "basic";
})
.forResult();
}, },
content() { content() {
"step 0"; "step 0";
@ -2381,9 +2374,12 @@ const skills = {
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).name === "chooseToCompare" && evt.getParent(3) === event) cards.addArray(evt.cards.filter(i => { if (evt.getParent(2).name === "chooseToCompare" && evt.getParent(3) === event)
return get.position(i, true) == "d" && get.type(i, null, false) != "basic"; cards.addArray(
})); 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)];
@ -2393,11 +2389,15 @@ const skills = {
"step 2"; "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 event.loser.chooseButton(["留驹:是否使用其中的一张牌?", cardsx]).set("filterButton", button => { else
return _status.event.player.hasUseTarget(button.link); event.loser
}).set("ai", button => { .chooseButton(["留驹:是否使用其中的一张牌?", cardsx])
return _status.event.player.getUseValue(button.link) + 0.1; .set("filterButton", button => {
}); return _status.event.player.hasUseTarget(button.link);
})
.set("ai", button => {
return _status.event.player.getUseValue(button.link) + 0.1;
});
"step 3"; "step 3";
if (result.bool) { if (result.bool) {
var card = result.links[0]; var card = result.links[0];

View File

@ -311,7 +311,18 @@ const skills = {
let cards = []; let cards = [];
for (const target of [player, player.getPrevious()]) { for (const target of [player, player.getPrevious()]) {
const evt = event.getl(target); const evt = event.getl(target);
if (evt && evt.cards2 && evt.cards2.some(i => get.position(i) == "d")) cards.addArray(evt.cards2.filter(i => get.position(i) == "d")); if (evt && evt.cards2 && evt.cards2.some(i => get.position(i) == "d")) {
if (
target == player ||
target
.getHistory("lose", evt => {
return evt.type == "discard" && evt.getlx !== false;
})
.indexOf(event) == 0
) {
cards.addArray(evt.cards2.filter(i => get.position(i) == "d"));
}
}
} }
return cards; return cards;
}, },

View File

@ -57,7 +57,7 @@ const translates = {
ol_yufan: "OL界虞翻", ol_yufan: "OL界虞翻",
ol_yufan_prefix: "OL界", ol_yufan_prefix: "OL界",
olzongxuan: "纵玄", olzongxuan: "纵玄",
olzongxuan_info: "当你或你的上家因弃置而失去牌后,你可以将位于弃牌堆的这些牌中的任意牌以任意顺序置于牌堆顶。", olzongxuan_info: "当你弃置而失去牌后,或你的上家每回合因弃置首次失去牌后,你可以将位于弃牌堆的这些牌中的任意牌以任意顺序置于牌堆顶。",
olzhiyan: "直言", olzhiyan: "直言",
olzhiyan_info: "你或你的上家的结束阶段你可以令一名角色正面朝上摸一张牌然后若此牌为装备牌则其使用此牌并回复1点体力不为装备牌且其体力值大于等于你则其失去1点体力。", olzhiyan_info: "你或你的上家的结束阶段你可以令一名角色正面朝上摸一张牌然后若此牌为装备牌则其使用此牌并回复1点体力不为装备牌且其体力值大于等于你则其失去1点体力。",
ol_chengpu: "OL界程普", ol_chengpu: "OL界程普",