noname/card/zhulu.js

1051 lines
29 KiB
JavaScript
Raw Normal View History

2024-04-15 18:36:20 +00:00
import { lib, game, ui, get, ai, _status } from "../noname.js";
game.import("card", function () {
2020-03-05 13:10:37 +00:00
return {
2024-04-15 18:36:20 +00:00
name: "zhulu",
connect: true,
card: {
zhulu_card: {
audio: true,
fullskin: true,
type: "trick",
enable: true,
cardcolor: "red",
selectTarget: -1,
filterTarget: true,
contentBefore: function () {
"step 0";
if (get.is.versus()) {
player
.chooseControl("顺时针", "逆时针", function (event, player) {
if (player.next.side == player.side) return "逆时针";
return "顺时针";
})
.set("prompt", "选择" + get.translation(card) + "的结算方向");
} else {
2020-03-05 13:10:37 +00:00
event.goto(2);
}
2024-04-15 18:36:20 +00:00
"step 1";
if (result && result.control == "顺时针") {
var evt = event.getParent();
evt.fixedSeat = true;
2020-03-05 13:10:37 +00:00
evt.targets.sortBySeat();
evt.targets.reverse();
2024-04-15 18:36:20 +00:00
if (evt.targets[evt.targets.length - 1] == player) {
2020-03-05 13:10:37 +00:00
evt.targets.unshift(evt.targets.pop());
}
}
2024-04-15 18:36:20 +00:00
"step 2";
2020-03-05 13:10:37 +00:00
ui.clear();
var num;
2024-04-15 18:36:20 +00:00
if (event.targets) {
num = event.targets.length;
} else {
num = game.countPlayer();
2020-03-05 13:10:37 +00:00
}
2024-04-15 18:36:20 +00:00
var cards = [];
for (var i = 0; i < num; i++) {
var cardx = get.cardPile(function (card) {
return get.type(card) == "equip" && !cards.includes(card);
2020-03-05 13:10:37 +00:00
});
2024-04-15 18:36:20 +00:00
if (cardx) cards.push(cardx);
2023-11-06 18:07:27 +00:00
}
2024-04-15 18:36:20 +00:00
if (!cards.length) {
2020-03-05 13:10:37 +00:00
event.finish();
event.getParent().excluded.addArray(game.players);
return;
}
2024-04-15 18:36:20 +00:00
game.cardsGotoOrdering(cards).relatedEvent = event.getParent();
var dialog = ui.create.dialog("逐鹿天下", cards, true);
2020-03-05 13:10:37 +00:00
_status.dieClose.push(dialog);
2024-04-15 18:36:20 +00:00
dialog.videoId = lib.status.videoId++;
game.addVideo("cardDialog", null, ["逐鹿天下", get.cardsInfo(cards), dialog.videoId]);
event.getParent().preResult = dialog.videoId;
game.broadcast(
function (cards, id) {
var dialog = ui.create.dialog("逐鹿天下", cards, true);
_status.dieClose.push(dialog);
dialog.videoId = id;
},
cards,
dialog.videoId
);
game.log(event.card, "亮出了", cards);
},
content: function () {
"step 0";
for (var i = 0; i < ui.dialogs.length; i++) {
if (ui.dialogs[i].videoId == event.preResult) {
event.dialog = ui.dialogs[i];
break;
2020-03-05 13:10:37 +00:00
}
}
2024-04-15 18:36:20 +00:00
if (!event.dialog) {
2020-03-05 13:10:37 +00:00
event.finish();
return;
}
2024-04-15 18:36:20 +00:00
var equips = [];
for (var i = 0; i < event.dialog.buttons.length; i++) {
var card = event.dialog.buttons[i].link;
if (target.canEquip(card, true)) equips.push(card);
2020-03-05 13:10:37 +00:00
}
2024-04-15 18:36:20 +00:00
if (equips.length > 1) {
var next = target.chooseButton(true, function (button) {
var player = _status.event.player;
return get.effect(player, button.link, player, player);
2020-03-05 13:10:37 +00:00
});
2024-04-15 18:36:20 +00:00
next.set("equips", equips);
next.set("filterButton", function (button) {
return _status.event.equips.includes(button.link);
2020-03-05 13:10:37 +00:00
});
2024-04-15 18:36:20 +00:00
next.set("dialog", event.preResult);
next.set("closeDialog", false);
next.set("dialogdisplay", true);
} else if (equips.length) {
event.directButton = equips[0];
} else event.finish();
"step 1";
var dialog = event.dialog;
2020-03-05 13:10:37 +00:00
var card;
2024-04-15 18:36:20 +00:00
if (event.directButton) {
card = event.directButton;
} else {
card = result.links[0];
2020-03-05 13:10:37 +00:00
}
var button;
2024-04-15 18:36:20 +00:00
for (var i = 0; i < dialog.buttons.length; i++) {
if (dialog.buttons[i].link == card) {
button = dialog.buttons[i];
button.querySelector(".info").innerHTML = (function (target) {
if (target._tempTranslate) return target._tempTranslate;
var name = target.name;
if (lib.translate[name + "_ab"]) return lib.translate[name + "_ab"];
2023-11-06 18:07:27 +00:00
return get.translation(name);
2024-04-15 18:36:20 +00:00
})(target);
2020-03-05 13:10:37 +00:00
dialog.buttons.remove(button);
break;
}
}
2024-04-15 18:36:20 +00:00
var capt = get.translation(target) + "选择了" + get.translation(button.link);
if (card) {
2020-03-05 13:10:37 +00:00
target.equip(card);
target.$gain2(card);
2024-04-15 18:36:20 +00:00
game.broadcast(
function (card, id, name, capt) {
var dialog = get.idDialog(id);
if (dialog) {
dialog.content.firstChild.innerHTML = capt;
for (var i = 0; i < dialog.buttons.length; i++) {
if (dialog.buttons[i].link == card) {
dialog.buttons[i].querySelector(".info").innerHTML = name;
dialog.buttons.splice(i--, 1);
break;
}
2020-03-05 13:10:37 +00:00
}
}
2024-04-15 18:36:20 +00:00
},
card,
dialog.videoId,
(function (target) {
if (target._tempTranslate) return target._tempTranslate;
var name = target.name;
if (lib.translate[name + "_ab"]) return lib.translate[name + "_ab"];
return get.translation(name);
})(target),
capt
);
2020-03-05 13:10:37 +00:00
}
2024-04-15 18:36:20 +00:00
dialog.content.firstChild.innerHTML = capt;
game.addVideo("dialogCapt", null, [dialog.videoId, dialog.content.firstChild.innerHTML]);
game.log(target, "选择了", button.link);
2020-03-05 13:10:37 +00:00
game.delay();
},
2024-04-15 18:36:20 +00:00
contentAfter: function () {
for (var i = 0; i < ui.dialogs.length; i++) {
if (ui.dialogs[i].videoId == event.preResult) {
var dialog = ui.dialogs[i];
2020-03-05 13:10:37 +00:00
dialog.close();
_status.dieClose.remove(dialog);
break;
}
}
2024-04-15 18:36:20 +00:00
game.broadcast(function (id) {
var dialog = get.idDialog(id);
if (dialog) {
2020-03-05 13:10:37 +00:00
dialog.close();
_status.dieClose.remove(dialog);
}
2024-04-15 18:36:20 +00:00
}, event.preResult);
game.addVideo("cardDialog", null, event.preResult);
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
ai: {
wuxie: function () {
if (Math.random() < 0.5) return 0;
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
basic: {
order: 3,
useful: 1,
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
result: {
target: function (player, target) {
if (get.is.versus()) {
if (target == player) return 1.5;
2020-03-05 13:10:37 +00:00
return 1;
}
2024-04-15 18:36:20 +00:00
if (player.hasUnknown(2)) {
2020-03-05 13:10:37 +00:00
return 0;
}
2024-04-15 18:36:20 +00:00
return (1 - get.distance(player, target, "absolute") / game.countPlayer()) *
get.attitude(player, target) >
0
? 0.4
: 0.7;
},
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
tag: {
draw: 1,
multitarget: 1,
},
},
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
kaihua: {
enable: true,
fullskin: true,
type: "trick",
selectTarget: -1,
toself: true,
filterTarget: function (card, player, target) {
return target == player;
},
modTarget: true,
content: function () {
"step 0";
if (!target.countCards("he")) {
event.finish();
return;
2020-03-05 13:10:37 +00:00
}
2024-04-15 18:36:20 +00:00
target.chooseToDiscard(true, "he", [1, 2]).set("ai", function (card) {
if (!ui.selected.cards.length && get.type(card) == "equip")
return 8 - get.value(card);
return 6 - get.value(card);
2020-03-05 13:10:37 +00:00
});
2024-04-15 18:36:20 +00:00
"step 1";
if (result.bool && result.cards) {
var bool = 0;
for (var i = 0; i < result.cards.length; i++) {
if (get.type(result.cards[i]) == "equip") {
bool = 1;
break;
}
2020-03-05 13:10:37 +00:00
}
2024-04-15 18:36:20 +00:00
target.draw(result.cards.length + bool);
2020-03-05 13:10:37 +00:00
}
},
2024-04-15 18:36:20 +00:00
ai: {
wuxie: function () {
2020-03-05 13:10:37 +00:00
return 0;
},
2024-04-15 18:36:20 +00:00
basic: {
useful: 3,
value: 3,
order: 5,
},
result: {
target: function (player, target, card) {
var cards = ui.selected.cards.concat(card.cards || []);
var num = player.countCards("he", function (card) {
if (cards.includes(card)) return false;
if (get.type(card) == "equip") return 8 > get.value(card);
return 6 > get.value(card);
});
2024-04-15 18:36:20 +00:00
if (!num) return 0;
if (
player.countCards("he", function (card) {
if (cards.includes(card)) return false;
if (get.type(card) == "equip") return 4 > get.value(card);
return false;
})
)
return 1.6;
if (num < 2) return 0.5;
return 1.2;
2020-03-05 13:10:37 +00:00
},
},
2024-04-15 18:36:20 +00:00
tag: {
loseCard: 1,
discard: 1,
norepeat: 1,
},
2020-03-05 13:10:37 +00:00
},
},
2024-04-15 18:36:20 +00:00
jiejia: {
fullskin: true,
type: "trick",
enable: true,
filterTarget: function (card, player, target) {
return target.countCards("e") > 0;
},
content: function () {
var es = target.getCards("e");
if (es.length) target.gain(es, "gain2", "log");
},
ai: {
order: 10,
tag: {
gain: 1,
2021-03-20 13:29:25 +00:00
//loseCard:1,
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
basic: {
useful: 0.5,
value: 0.5,
},
result: {
target: function (player, target) {
var e5 = target.getEquip("muniu");
if (e5 && e5.name == "muniu" && e5.cards && e5.cards.length > 1) return -1;
if (
target.countCards("e", function (card) {
return get.value(card, target) <= 0;
}) ||
target.hasSkillTag("noe")
)
return 1;
2020-03-05 13:10:37 +00:00
return 0;
},
},
},
},
2024-04-15 18:36:20 +00:00
caochuan: {
fullskin: true,
type: "trick",
wuxieable: true,
global: ["caochuan_skill"],
notarget: true,
content: function () {
var evt2 = event.getParent(3)._trigger;
2022-12-04 16:16:32 +00:00
evt2.neutralize();
2024-04-15 18:36:20 +00:00
var evt = evt2.getParent();
var next = game.createEvent("caochuan_gain");
2020-03-05 13:10:37 +00:00
_status.event.next.remove(next);
2020-10-23 14:35:26 +00:00
evt.after.unshift(next);
2024-04-15 18:36:20 +00:00
next.player = player;
next.setContent(function () {
var cards = event.getParent().cards.filterInD();
if (cards.length) player.gain(cards, "gain2", "log");
2020-03-05 13:10:37 +00:00
});
},
2024-04-15 18:36:20 +00:00
ai: {
basic: {
useful: [6, 4],
value: [6, 4],
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
result: { player: 1 },
2020-03-05 13:10:37 +00:00
},
},
2024-04-15 18:36:20 +00:00
numa: {
fullskin: true,
type: "equip",
subtype: "equip4",
filterTarget: function (card, player, target) {
if (player == target) return false;
return target.canEquip(card, true);
},
selectTarget: 1,
toself: false,
loseThrow: true,
customSwap: function () {
2020-10-15 05:41:31 +00:00
return true;
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
ai: {
order: 9,
value: function (card, player) {
if (player.getEquips(4).includes(card)) return 0;
return 4;
},
2024-04-15 18:36:20 +00:00
equipValue: function (card, player) {
if (player.getCards("e").includes(card)) return 0;
return -get.value(player.getCards("e"));
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
basic: {
equipValue: 5,
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
result: {
keepAI: true,
target: function (player, target) {
var cards = target.getCards("e");
if (cards.length == 1 && cards[0].name == "nvzhuang") return 0;
var val = get.value(cards, target);
if (val > 0) return -val;
2020-03-05 13:10:37 +00:00
return 0;
},
},
},
},
2024-04-15 18:36:20 +00:00
yajiaoqiang: {
fullskin: true,
type: "equip",
subtype: "equip1",
distance: { attackFrom: -2 },
skills: ["yajiaoqiang_skill"],
ai: {
equipValue: function (card, player) {
var skills = [
"longdan",
"kanpo",
"rekanpo",
"qingguo",
"reqingguo",
"ollongdan",
"refanghun",
];
for (var i = 0; i < skills.length; i++) {
if (player.hasSkill(skills[i])) return 5;
2020-03-05 13:10:37 +00:00
}
2024-04-15 18:36:20 +00:00
if (
player.countCards("h", function (card) {
return get.color(card) == "black" && ["wuxie", "caochuan"].includes(card);
})
)
return 5;
2020-03-05 13:10:37 +00:00
return 2;
},
2024-04-15 18:36:20 +00:00
basic: {
equipValue: 5,
2020-03-05 13:10:37 +00:00
},
},
},
2024-04-15 18:36:20 +00:00
wufengjian: {
fullskin: true,
type: "equip",
subtype: "equip1",
filterTarget: function (card, player, target) {
if (player == target) return false;
return target.canEquip(card, true);
},
selectTarget: 1,
toself: false,
skills: ["wufengjian_skill"],
ai: {
order: 9,
equipValue: function (card, player) {
if (get.position(card) == "e") return -2;
return 2;
},
2024-04-15 18:36:20 +00:00
value: function (card, player) {
if (player.getEquips(1).includes(card)) {
if (player.hasSkillTag("noh")) return 0;
2023-12-21 07:50:59 +00:00
return -3.5;
}
return 1.5;
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
basic: {
equipValue: 5,
},
result: {
keepAI: true,
target: function (player, target) {
var val = 2;
var val2 = 0;
var card = target.getEquip(1);
if (card) {
val2 = get.value(card, target);
if (val2 < 0) return 0;
}
2024-04-15 18:36:20 +00:00
return -val - val2;
2020-03-05 13:10:37 +00:00
},
},
},
},
2024-04-15 18:36:20 +00:00
zheji: {
fullskin: true,
type: "equip",
subtype: "equip1",
filterTarget: function (card, player, target) {
if (player == target) return false;
return target.canEquip(card, true);
},
selectTarget: 1,
toself: false,
distance: { attackFrom: 1 },
ai: {
order: 9,
equipValue: function (card, player) {
if (get.position(card) == "e") return -2;
return 2;
},
2024-04-15 18:36:20 +00:00
value: function (card, player) {
if (player.getEquips(1).includes(card)) return -3.5;
return 3;
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
basic: {
equipValue: 5,
},
result: {
keepAI: true,
target: function (player, target) {
var val = 2.5;
var val2 = 0;
var card = target.getEquip(1);
if (card) {
val2 = get.value(card, target);
if (val2 < 0) return 0;
}
2024-04-15 18:36:20 +00:00
return -val - val2;
2020-03-05 13:10:37 +00:00
},
},
},
},
2024-04-15 18:36:20 +00:00
yinfengjia: {
fullskin: true,
type: "equip",
subtype: "equip2",
filterTarget: function (card, player, target) {
if (player == target) return false;
return target.canEquip(card, true);
},
selectTarget: 1,
toself: false,
skills: ["yinfengjia_skill"],
ai: {
order: 9,
equipValue: function (card, player) {
if (get.position(card) == "e") return -7;
2020-03-05 13:10:37 +00:00
return 1;
},
2024-04-15 18:36:20 +00:00
value: function (card, player) {
if (player.getEquips(2).includes(card)) return -9;
return 2.5;
},
2024-04-15 18:36:20 +00:00
basic: {
equipValue: 5,
},
result: {
keepAI: true,
target: function (player, target) {
var val = 2;
var val2 = 0;
var card = target.getEquip(2);
if (card) {
val2 = get.value(card, target);
if (val2 < 0) return 0;
}
2024-04-15 18:36:20 +00:00
return -val - val2;
2020-03-05 13:10:37 +00:00
},
},
},
},
2024-04-15 18:36:20 +00:00
nvzhuang: {
fullskin: true,
type: "equip",
subtype: "equip2",
filterTarget: function (card, player, target) {
if (player == target) return false;
return target.canEquip(card, true);
},
selectTarget: 1,
toself: false,
loseDelay: false,
onEquip: function () {
if (
player.sex == "male" &&
player.countCards("he", function (cardx) {
return cardx != card;
})
)
player
.chooseToDiscard(
true,
function (card) {
return card != _status.event.card;
},
"he"
)
.set("card", card);
},
onLose: function () {
if (player.sex != "male") return;
var next = game.createEvent("nvzhuang_lose");
2020-03-05 13:10:37 +00:00
event.next.remove(next);
2024-04-15 18:36:20 +00:00
var evt = event.getParent();
if (evt.getlx === false) evt = evt.getParent();
2020-10-15 05:41:31 +00:00
evt.after.push(next);
2024-04-15 18:36:20 +00:00
next.player = player;
next.setContent(function () {
if (player.countCards("he")) {
player.popup("nvzhuang");
player.chooseToDiscard(true, "he");
2020-03-05 13:10:37 +00:00
}
});
},
2024-04-15 18:36:20 +00:00
ai: {
order: 9.5,
equipValue: function (card, player) {
if (player.getEquips(2).includes(card)) {
if (player.sex != "male") return 0;
var num = player.countCards("he", function (cardx) {
return cardx != card;
2020-03-25 12:27:23 +00:00
});
2024-04-15 18:36:20 +00:00
if (num == 0) return 0;
return 4 / num;
2020-03-25 12:27:23 +00:00
}
2020-03-05 13:10:37 +00:00
return 1;
},
2024-04-15 18:36:20 +00:00
value: function () {
return lib.card.nvzhuang.ai.equipValue.apply(this, arguments);
},
basic: {
equipValue: 5,
},
result: {
keepAI: true,
target: function (player, target) {
var card = target.getEquip(2);
if (target.sex == "male") {
var val = 0;
var val2 = 0;
if (card) {
val2 = get.value(card, target);
if (val2 < 0) return 0;
}
2024-04-15 18:36:20 +00:00
var num = target.countCards("he", function (cardx) {
return cardx != card;
2020-03-25 12:27:23 +00:00
});
2024-04-15 18:36:20 +00:00
if (num > 0) val += 4 / num;
2020-03-25 12:27:23 +00:00
return -val;
2020-03-05 13:10:37 +00:00
}
2024-04-15 18:36:20 +00:00
if (card) {
var val2 = get.value(card, target);
if (val2 > 0) return -val2 / 4;
}
return 0;
2020-03-05 13:10:37 +00:00
},
},
2024-04-15 18:36:20 +00:00
},
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
yexingyi: {
fullskin: true,
type: "equip",
subtype: "equip2",
skills: ["yexingyi_skill"],
ai: {
equipValue: 4,
basic: {
equipValue: 4,
},
},
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
jinhe: {
fullskin: true,
type: "equip",
subtype: "equip5",
filterTarget: function (card, player, target) {
if (player == target) return false;
return target.canEquip(card, true);
},
selectTarget: 1,
toself: false,
skills: ["jinhe_skill"],
global: ["jinhe_lose"],
loseDelay: false,
onEquip: function () {
"step 0";
player.markSkill("jinhe_skill");
if (event.getParent(2).name != "jinhe") event.finish();
else {
event.target = player;
event.player = event.getParent(2).player;
2020-03-05 13:10:37 +00:00
}
2024-04-15 18:36:20 +00:00
"step 1";
var id = card.cardid;
event.cardid = id;
if (!_status.jinhe) _status.jinhe = {};
if (_status.jinhe[id]) {
2020-03-05 13:10:37 +00:00
game.cardsDiscard(_status.jinhe[id].card);
delete _status.jinhe[id];
}
2024-04-15 18:36:20 +00:00
var cards2 = get.cards(2);
event.cards2 = cards2;
player.chooseButton(["选择一张牌作为「礼」", cards2], true);
"step 2";
var id = event.cardid;
_status.jinhe[id] = {
player: player,
card: result.links[0],
2020-03-05 13:10:37 +00:00
};
2024-04-15 18:36:20 +00:00
game.broadcast(function (jinhe) {
_status.jinhe = jinhe;
}, _status.jinhe);
2020-03-05 13:10:37 +00:00
game.cardsGotoSpecial(result.links[0]);
event.cards2.remove(result.links[0]);
event.cards2[0].fix();
2024-04-15 18:36:20 +00:00
ui.cardPile.insertBefore(event.cards2[0], ui.cardPile.firstChild);
2020-03-05 13:10:37 +00:00
game.updateRoundNumber();
2024-04-15 18:36:20 +00:00
target.markSkill("jinhe_skill");
},
onLose: function () {
player.unmarkSkill("jinhe_skill");
var id = card.cardid;
if (
event.getParent(2) &&
event.getParent(2).name != "swapEquip" &&
get.position(card) != "d" &&
event.parent.type != "equip" &&
_status.jinhe &&
_status.jinhe[id]
) {
var card2 = _status.jinhe[id].card;
player.$throw(card2, 1000);
game.log(card, "掉落了", card2);
2020-03-05 13:10:37 +00:00
game.cardsDiscard(card2);
delete _status.jinhe[id];
}
},
2024-04-15 18:36:20 +00:00
ai: {
order: 9.5,
equipValue: function (card, player) {
if (!player.getEquips(5).includes(card)) return 5;
if (
_status.jinhe &&
_status.jinhe[card.cardid] &&
_status.event.name != "gainPlayerCard"
)
return 3 * player.countCards("h");
2020-03-05 13:10:37 +00:00
return 0;
},
2024-04-15 18:36:20 +00:00
value: function () {
return lib.card.jinhe.ai.equipValue.apply(this, arguments);
},
2024-04-15 18:36:20 +00:00
basic: {
equipValue: 5,
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
result: {
keepAI: true,
target: function (player, target, cardx) {
if (_status.jinhe && _status.jinhe[cardx.cardid])
return -0.5 - 2 * target.countCards("h");
var card = target.getEquip(5);
if (!card) return 0;
return -get.value(card, target);
2020-09-30 07:46:55 +00:00
},
2024-04-15 18:36:20 +00:00
target_use: function (player, target) {
return -0.5 - 2 * target.countCards("h");
2020-03-05 13:10:37 +00:00
},
},
2024-04-15 18:36:20 +00:00
},
2020-03-05 13:10:37 +00:00
},
},
2024-04-15 18:36:20 +00:00
skill: {
jinhe_lose: {
trigger: {
player: ["loseAfter", "equipAfter"],
global: "loseAsyncAfter",
},
equipSkill: true,
forced: true,
filter: function (event, player) {
if (event.getl === false) return false;
if (
!event.getd(player).length ||
!_status.jinhe ||
(event.getParent(2).name == "jinhe_skill" && event.getParent(2).player == player)
)
return false;
var evt = event.getl(player);
if (!evt) return false;
for (var i = 0; i < evt.es.length; i++) {
if (evt.es[i].name == "jinhe" && _status.jinhe[evt.es[i].cardid]) return true;
2020-03-05 13:10:37 +00:00
}
return false;
},
2024-04-15 18:36:20 +00:00
content: function () {
"step 0";
var es = trigger.getl(player).es;
for (var i = 0; i < es.length; i++) {
if (es[i].name == "jinhe" && _status.jinhe[es[i].cardid]) {
var card = _status.jinhe[es[i].cardid].card;
2020-03-05 13:10:37 +00:00
game.cardsDiscard(card);
player.$throw(card);
2024-04-15 18:36:20 +00:00
game.log(card, "进入了弃牌堆");
2020-10-20 13:54:19 +00:00
delete _status.jinhe[es[i].cardid];
2023-11-06 18:07:27 +00:00
}
2020-03-05 13:10:37 +00:00
}
2024-04-15 18:36:20 +00:00
game.broadcastAll(function (jinhe) {
_status.jinhe = jinhe;
}, _status.jinhe);
"step 1";
var hs = player.getCards("h");
if (hs.length) player.discard(hs);
"step 2";
2020-03-05 13:10:37 +00:00
game.broadcastAll(ui.clear);
},
},
2024-04-15 18:36:20 +00:00
jinhe_skill: {
equipSkill: true,
intro: {
mark: function (dialog, storage, player) {
var card = player.getEquip("jinhe");
if (card && _status.jinhe && _status.jinhe[card.cardid]) {
if (
_status.jinhe[card.cardid].player == game.me ||
_status.jinhe[card.cardid].player.isUnderControl()
)
dialog.addAuto([_status.jinhe[card.cardid].card]);
else return "共有一张「礼」";
} else return "没有牌";
2020-03-05 13:10:37 +00:00
},
},
2024-04-15 18:36:20 +00:00
mark: true,
marktext: "礼",
enable: "phaseUse",
filter: function (event, player) {
if (!_status.jinhe) return false;
var card = player.getEquip("jinhe");
return card && card.name == "jinhe" && _status.jinhe[card.cardid] != undefined;
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
prepare: function (cards, player) {
var card = player.getEquip("jinhe");
if (card && card.name == "jinhe" && _status.jinhe[card.cardid]) {
var tothrow = _status.jinhe[card.cardid].card;
2020-03-05 13:10:37 +00:00
player.$throw(tothrow);
2024-04-15 18:36:20 +00:00
game.log(player, "将", tothrow, "置入了弃牌堆");
2020-03-05 13:10:37 +00:00
}
},
2024-04-15 18:36:20 +00:00
content: function () {
"step 0";
var card = player.getEquip("jinhe");
if (card && card.name == "jinhe" && _status.jinhe[card.cardid]) {
2020-03-05 13:10:37 +00:00
game.cardsDiscard(_status.jinhe[card.cardid].card);
2024-04-15 18:36:20 +00:00
event.suit = get.suit(_status.jinhe[card.cardid].card);
2020-03-05 13:10:37 +00:00
delete _status.jinhe[card.cardid];
2024-04-15 18:36:20 +00:00
game.broadcastAll(function (jinhe) {
_status.jinhe = jinhe;
}, _status.jinhe);
} else event.finish();
"step 1";
var cards = player.getCards("he", function (card) {
if (get.position(card) == "h") return get.suit(card) == event.suit;
return get.position(card) == "e" && card.name == "jinhe";
2020-03-05 13:10:37 +00:00
});
2024-04-15 18:36:20 +00:00
if (cards.length) player.discard(cards);
"step 2";
2020-03-05 13:10:37 +00:00
game.broadcastAll(ui.clear);
},
2024-04-15 18:36:20 +00:00
ai: {
order: 1,
result: {
player: function (player) {
var suit = get.suit(_status.jinhe[player.getEquip("jinhe").cardid].card);
var hs = player.getCards("h", function (card) {
return get.suit(card) == suit;
2020-12-02 11:48:23 +00:00
});
2024-04-15 18:36:20 +00:00
if (!hs.length || get.value(hs) < 5) return 1;
2020-12-02 11:48:23 +00:00
return -1;
},
},
},
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
yexingyi_skill: {
equipSkill: true,
mod: {
targetEnabled: function (card, player, target) {
if (
get.color(card) == "black" &&
get.type(card, "trick") == "trick" &&
!target.hasSkillTag("unequip2") &&
!player.hasSkillTag("unequip", false, {
name: card ? card.name : null,
target: target,
card: card,
})
) {
const cards = player.getEquips("yexingyi");
if (
player.hasSkill("yexingyi_skill", null, false) ||
!card.cards ||
!cards.some(
(cardx) => card.cards.includes(cardx) || ui.selected.cards.includes(cardx)
)
)
return false;
2023-11-27 01:36:25 +00:00
}
2020-03-05 13:10:37 +00:00
},
},
},
2024-04-15 18:36:20 +00:00
yinfengjia_skill: {
trigger: { player: "damageBegin3" },
forced: true,
equipSkill: true,
filter: function (event, player) {
if (get.type(event.card, "trick") != "trick") return false;
if (player.hasSkillTag("unequip2")) return false;
if (
event.source &&
event.source.hasSkillTag("unequip", false, {
name: event.card ? event.card.name : null,
target: player,
card: event.card,
})
)
return false;
2020-03-05 13:10:37 +00:00
return true;
},
2024-04-15 18:36:20 +00:00
content: function () {
trigger.num++;
},
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
wufengjian_skill: {
trigger: { player: "useCard" },
forced: true,
filter: function (event, player) {
if (event.card.name != "sha") return false;
var cards = player.getEquips("wufengjian");
return player.hasCard(function (card) {
return !cards.includes(card);
2024-04-15 18:36:20 +00:00
}, "he");
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
content: function () {
if (player != game.me && !player.isUnderControl() && !player.isOnline()) game.delayx();
player
.chooseToDiscard(true, "he", function (card) {
return !_status.event.cards.includes(card);
})
.set("cards", player.getEquips("wufengjian"));
2020-03-05 13:10:37 +00:00
},
},
2024-04-15 18:36:20 +00:00
yajiaoqiang_skill: {
trigger: { player: "useCardAfter" },
filter: function (event, player) {
if (
_status.currentPhase == player ||
get.color(event.card) != "black" ||
event.cards.filterInD().length == 0
)
return false;
return (
player
.getHistory("useCard", function (evt) {
return get.color(evt.card) == "black";
})
.indexOf(event) == 0
);
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
prompt2: function (event, player) {
return "获得" + get.translation(event.cards.filterInD());
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
content: function () {
player.gain(trigger.cards.filterInD(), "gain2", "log");
2020-03-05 13:10:37 +00:00
},
},
2024-04-15 18:36:20 +00:00
caochuan_skill: {
trigger: { target: "useCardToBegin" },
forced: true,
priority: 6,
filter: function (event, player) {
if (
event.directHit ||
!get.tag(event.card, "damage") ||
!["basic", "trick"].includes(get.type(event.card))
)
return false;
return player.hasUsableCard("caochuan");
},
content: function () {
var next = player.chooseToUse();
next.set(
"prompt",
"是否使用【草船借箭】响应" +
get.translation(trigger.player) +
"使用的" +
get.translation(trigger.card) +
""
);
next.set("filterCard", function (card, player) {
if (get.name(card) != "caochuan") return false;
return lib.filter.cardEnabled(card, player, "forceEnable");
2020-03-05 13:10:37 +00:00
});
2024-04-15 18:36:20 +00:00
next.set("respondTo", [trigger.player, trigger.card]);
next.set("goon", -get.effect(player, trigger.card, trigger.player, player));
next.set("ai1", function (card) {
2020-03-05 13:10:37 +00:00
return _status.event.goon;
2024-04-15 18:36:20 +00:00
});
2020-03-05 13:10:37 +00:00
},
},
},
2024-04-15 18:36:20 +00:00
translate: {
jinhe: "锦盒",
jinhe_info:
"此牌的使用目标为其他角色。当你使用【锦盒】时,你将原有的与此牌对应的「礼」置入弃牌堆(若有),然后观看牌堆顶的两张牌并将其中一张置于游戏外与此牌对应,称之为「礼」。<br>出牌阶段,你可以将与此牌对应的「礼」置入弃牌堆,然后弃置【锦盒】以及所有与「礼」花色相同的手牌。当此牌因其他原因进入弃牌堆后,你将与此牌对应的「礼」置入弃牌堆并弃置所有手牌。",
jinhe_skill: "锦盒",
jinhe_lose: "锦盒",
yexingyi: "夜行衣",
yexingyi_info: "锁定技,你不是黑色锦囊牌的合法目标。",
nvzhuang: "女装",
nvzhuang_info:
"此牌的使用目标为其他角色。锁定技,当此牌进入或离开你的装备区时,若你的性别为男性,你弃置一张不为此牌的牌。",
yinfengjia: "引蜂甲",
yinfengjia_info: "此牌的使用目标为其他角色。锁定技,当你受到锦囊牌造成的伤害时,此伤害+1。",
yinfengjia_skill: "引蜂甲",
zheji: "折戟",
zheji_info: "此牌的使用目标为其他角色。这是一把坏掉的武器...",
wufengjian: "无锋剑",
wufengjian_info:
"此牌的使用目标为其他角色。锁定技,当你使用【杀】时,你弃置一张不为装备区内【无锋剑】的牌。",
wufengjian_skill: "无锋剑",
yajiaoqiang_skill: "涯角枪",
yajiaoqiang: "涯角枪",
yajiaoqiang_info:
"当你于一名其他角色的回合内第一次使用的黑色牌结算完成后,你可以获得此牌对应的所有实体牌。",
numa: "驽马",
numa_info:
"此牌的使用目标为其他角色。锁定技,当此牌进入你的装备区时,你弃置装备区内的所有其他牌。",
caochuan: "草船借箭",
caochuan_info:
"当带有「伤害」标签的基本牌或普通锦囊牌对你生效前,对此牌使用。抵消此牌对你产生的效果。当此牌结算完成后,你获得此牌对应的所有实体牌。",
jiejia: "解甲归田",
jiejia_info: "出牌阶段,对一名装备区内有牌的角色使用。该角色获得其装备区内的所有牌。",
kaihua: "树上开花",
kaihua_info:
"出牌阶段,对包含你自己在内的一名角色使用。目标角色弃置一至两张牌,然后摸等量的牌。若其以此法弃置了装备牌,则多摸一张牌。",
zhulu_card: "逐鹿天下",
zhulu_card_info:
"出牌阶段,对所有角色使用。你从牌堆和弃牌堆亮出等同于目标角色数的装备牌,每名目标角色将其中一张牌置于自己的装备区。",
2020-03-05 13:10:37 +00:00
},
2024-04-15 18:36:20 +00:00
list: [
["diamond", 3, "jiejia"],
["diamond", 4, "shan"],
["diamond", 5, "yajiaoqiang"],
["diamond", 6, "sha"],
["diamond", 8, "shan"],
["diamond", 9, "kaihua"],
["diamond", 10, "yinfengjia"],
["diamond", 11, "sha"],
2024-04-15 18:36:20 +00:00
["club", 3, "jiejia"],
["club", 4, "sha", "thunder"],
["club", 5, "zheji"],
["club", 6, "jiu"],
["club", 8, "jiu"],
["club", 9, "zhulu_card"],
["club", 10, "jinhe"],
["club", 11, "sha"],
2024-04-15 18:36:20 +00:00
["heart", 3, "sha", "fire"],
["heart", 4, "shan"],
["heart", 5, "numa"],
["heart", 6, "tao"],
["heart", 8, "shan"],
["heart", 9, "kaihua"],
["heart", 10, "nvzhuang"],
["heart", 11, "kaihua"],
2024-04-15 18:36:20 +00:00
["spade", 3, "caochuan"],
["spade", 4, "sha", "thunder"],
["spade", 5, "wufengjian"],
["spade", 6, "caochuan"],
["spade", 8, "sha"],
["spade", 9, "sha"],
["spade", 10, "yexingyi"],
["spade", 11, "sha"],
2020-03-05 13:10:37 +00:00
],
2024-04-15 18:36:20 +00:00
};
2020-03-05 13:10:37 +00:00
});