noname/character/ddd.js

6883 lines
218 KiB
JavaScript
Raw Normal View History

2024-04-15 18:10:02 +00:00
import { lib, game, ui, get, ai, _status } from "../noname.js";
game.import("character", function () {
2023-07-27 09:56:09 +00:00
return {
2024-04-15 18:10:02 +00:00
name: "ddd",
connect: true,
character: {
ddd_handang: ["male", "wu", 4, ["dddxianxi"]],
2023-11-12 08:16:18 +00:00
// ddd_wuzhi:["male","wei",3,["dddlingyong","dddxuxiao"]],
2024-04-15 18:10:02 +00:00
ddd_xujing: ["male", "shu", 3, ["dddxuyu", "dddshijian"]],
2023-11-12 08:16:18 +00:00
// ddd_caomao:["male","wei",3,["dddtaisi","dddquche","dddqianlong"],["zhu"]],
// ddd_xinxianying:["female","wei",3,["ddddongcha","dddzhijie"]],
2024-04-15 18:31:36 +00:00
ddd_xianglang: ["male", "shu", 3, ["dddqiahua", "dddfusi", "dddtuoji"]],
2024-04-15 18:10:02 +00:00
ddd_yujin: ["male", "wei", 4, ["dddzhengjun"]],
ddd_liuye: ["male", "wei", 3, ["dddchashi", "dddqice"]],
ddd_baosanniang: ["female", "shu", 3, ["dddzhilian", "dddjijian"]],
2023-11-12 08:16:18 +00:00
// ddd_zhenji:['female','wei',3,['dddmiaoxing','dddfushi']],
2024-04-15 18:10:02 +00:00
ddd_zhaoang: ["male", "wei", 4, ["dddfenji"]],
ddd_zhouchu: ["male", "wu", 5, ["dddxiaheng"]],
ddd_liuba: ["male", "shu", 3, ["dddfengzheng", "dddyulv"]],
ddd_jianshuo: ["male", "qun", 4, ["dddfenye", "dddshichao"]],
ddd_guanning: ["male", "qun", 3, ["dddyouxue", "dddchengjing"]],
ddd_dingfeng: ["male", "wu", 4, ["dddduanbing"]],
ddd_caoshuang: ["male", "wei", 5, ["dddzhuanshe", "dddweiqiu"]],
ddd_xuelingyun: ["female", "wei", 3, ["dddlianer", "dddanzhi"]],
2024-04-15 18:31:36 +00:00
ddd_liuhong: ["male", "qun", 4, ["dddshixing", "ddddanggu", "dddfuzong"], ["zhu"]],
2024-04-15 18:10:02 +00:00
ddd_xiahouxuan: ["male", "wei", 3, ["dddlanghuai", "dddxuanlun"]],
ddd_zhangkai: ["male", "qun", "3/4", ["dddjiexing", "dddbailei"]],
ddd_liangxi: ["male", "wei", 4, ["dddtongyu"]],
ddd_wangkanglvkai: ["male", "shu", 4, ["dddbingjian"]],
2023-11-12 08:16:18 +00:00
// ddd_sunliang:['male','wu',3,['ddddiedang','dddanliu','dddguiying'],['zhu']],
2024-04-15 18:10:02 +00:00
ddd_lie: ["female", "wu", 3, ["dddyeshen", "dddqiaoduan"]],
2024-04-15 18:31:36 +00:00
ddd_kebineng: ["male", "qun", 4, ["dddxiaoxing", "dddlangzhi", "dddfuyi"], ["zhu"]],
2024-04-15 18:10:02 +00:00
ddd_qianzhao: ["male", "wei", 4, ["dddyuanzhen", "dddzhishu"]],
ddd_zhangmiao: ["male", "qun", 4, ["dddxiaxing"]],
ddd_zhangcheng: ["male", "wu", 3, ["dddjuxian", "dddjungui"]],
ddd_liuchong: ["male", "qun", 4, ["dddjinggou", "dddmoyan"]],
ddd_luoxian: ["male", "shu", 4, ["dddshilie"]],
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
characterFilter: {},
characterSort: {},
characterTitle: {
ddd_handang: "#g晓ャ绝对",
ddd_wuzhi: "#g沸治·克里夫",
ddd_xujing: "#g沸治·克里夫",
ddd_caomao: "#gRocxu",
ddd_xinxianying: "#g好孩子系我",
ddd_xianglang: "#g会乱武的袁绍",
ddd_liuye: "#g好孩子系我",
ddd_baosanniang: "#g会乱武的袁绍",
ddd_wangkanglvkai: "#g扬林",
ddd_yujin: "#g虎鲸",
ddd_caoshuang: "#g辰木",
ddd_zhenji: "#g巴德",
ddd_zhaoang: "#g君腾天下",
ddd_xuelingyun: "#gGENTOVA07",
ddd_liuhong: "#g拉普拉斯",
ddd_xiahouxuan: "#g好孩子系我",
ddd_zhouchu: "#g志文",
ddd_kebineng: "#g晨星",
ddd_zhangkai: "#g拼音",
ddd_liuba: "#g浅水",
ddd_jianshuo: "#g浅水",
ddd_guanning: "#g虎鲸",
ddd_lie: "#gyyuaN",
ddd_liangxi: "#g先負",
2023-11-12 08:16:18 +00:00
// ddd_liuchong:'#g',
2024-04-15 18:10:02 +00:00
ddd_luoxian: "#g绝代倾国倾城貌",
2023-07-30 15:42:21 +00:00
},
/** @type { importCharacterConfig['skill'] } */
2024-04-15 18:10:02 +00:00
skill: {
2023-11-12 08:16:18 +00:00
//牵招
2024-04-15 18:10:02 +00:00
dddyuanzhen: {
audio: 2,
trigger: { player: "useCardToPlayered" },
forced: true,
filter(event, player) {
return (
event.target != player &&
get.distance(player, event.target) != 1 &&
event.isFirstTarget &&
event.targets.length == 1
);
},
logTarget: "target",
*content(event, map) {
const player = map.player,
trigger = map.trigger,
target = trigger.target;
2023-11-12 08:16:18 +00:00
let result;
game.delayex();
2024-04-15 18:10:02 +00:00
if (!target.countCards("he")) result = { bool: false };
else
result = yield target
.chooseToDiscard(
"he",
`${get.translation(player)}对你使用了【远振】`,
"请弃置一张牌,或点击“取消”令其摸一张牌"
)
.set("ai", (card) => {
2024-04-15 18:31:36 +00:00
if (get.event("goon")) return 4.5 - get.value(card);
2024-04-15 18:10:02 +00:00
})
.set("goon", get.attitude(target, player) > 0);
if (!result.bool) {
2023-11-12 08:16:18 +00:00
target.line(player);
player.draw();
}
},
},
2024-04-15 18:10:02 +00:00
dddzhishu: {
audio: 2,
trigger: { player: "phaseUseBegin" },
filter(event, player) {
return player.canMoveCard(null, true);
},
check(event, player) {
return player.canMoveCard(true, true);
},
*content(event, map) {
const player = map.player;
let result = yield player.moveCard();
const targets = result.targets;
const guohe = new lib.element.VCard({
name: "guohe",
isCard: true,
});
2024-04-15 18:31:36 +00:00
if (targets[0].canUse(guohe, targets[1])) targets[0].useCard(guohe, targets[1], "noai");
2024-04-15 18:10:02 +00:00
},
2023-11-12 08:16:18 +00:00
},
//张邈
2024-04-15 18:10:02 +00:00
dddxiaxing: {
audio: 2,
enable: "chooseToUse",
hiddenCard(player, name) {
if (player.hasSkill("dddxiaxing_used")) return false;
return name == "tao";
},
filter(event, player) {
if (event.type != "dying") return false;
if (!player.countCards("he")) return false;
const evt = get.event().getParent("_save");
if (!evt || !evt.dying || !evt.dying.isIn()) return false;
return !player.hasSkill("dddxiaxing_used");
},
check: (card) => {
return 7 - get.value(card);
},
filterCard: true,
position: "he",
discard: false,
delay: false,
lose: false,
group: ["dddxiaxing_begin", "dddxiaxing_viewas"],
prompt() {
const evt = get.event().getParent("_save");
2024-04-15 18:31:36 +00:00
return `将一张牌置于牌堆顶,视为${get.translation(evt.dying)}使用一张【桃】`;
2024-04-15 18:10:02 +00:00
},
*content(event, map) {
const player = map.player,
cards = event.cards;
player.addTempSkill("dddxiaxing_used", "roundStart");
game.log(player, "将一张牌置于了牌堆顶");
player.$throw(cards.length, 1000);
yield player.lose(cards, ui.cardPile, "insert");
const evt = event.getParent("_save");
yield evt.dying.chooseUseTarget("tao", true);
2024-04-15 18:31:36 +00:00
if (!player.hasMark("dddxiaxing")) player.addMark("dddxiaxing");
2024-04-15 18:10:02 +00:00
},
marktext: "侠",
intro: {
markcount: () => 0,
name: "侠行",
name2: "侠",
content: "已拥有“侠”标记",
},
ai: {
order: 4,
result: {
player(player) {
2024-04-15 18:31:36 +00:00
if (_status.event.dying) return get.attitude(player, _status.event.dying);
2023-11-12 08:16:18 +00:00
return 1;
},
2024-04-15 18:10:02 +00:00
},
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
subSkill: {
begin: {
audio: 2,
trigger: { global: "phaseZhunbeiBegin" },
filter(event, player) {
if (!player.countCards("he")) return false;
return !player.hasSkill("dddxiaxing_used");
},
direct: true,
*content(event, map) {
const player = map.player,
trigger = map.trigger,
target = trigger.player;
let result = yield player
.chooseCard(
get.prompt("dddxiaxing"),
2024-04-15 18:31:36 +00:00
`将一张牌置于牌堆顶,视为${get.translation(target)}使用一张【酒】`,
2024-04-15 18:10:02 +00:00
"he"
)
.set("ai", (card) => {
2024-04-15 18:31:36 +00:00
if (get.event("goon")) return 5 - get.value(card);
2024-04-15 18:10:02 +00:00
return 0;
})
2024-04-15 18:31:36 +00:00
.set("goon", get.effect(target, { name: "jiu" }, player, player) > 0);
2024-04-15 18:10:02 +00:00
if (!result.bool) return event.finish();
const cards = result.cards;
player.logSkill("dddxiaxing_begin", target);
2024-04-15 18:31:36 +00:00
player.addTempSkill("dddxiaxing_used", "roundStart");
2024-04-15 18:10:02 +00:00
game.log(player, "将一张牌置于了牌堆顶");
player.$throw(cards.length, 1000);
yield player.lose(cards, ui.cardPile, "insert");
yield target.chooseUseTarget("jiu", true);
2024-04-15 18:31:36 +00:00
if (!player.hasMark("dddxiaxing")) player.addMark("dddxiaxing");
2023-11-12 08:16:18 +00:00
},
},
2024-04-15 18:10:02 +00:00
used: { charlotte: true },
viewas: {
audio: "dddxiaxing",
enable: "chooseToUse",
filter(event, player) {
2024-04-15 18:31:36 +00:00
if (event.type == "wuxie" || !player.hasMark("dddxiaxing")) return false;
2024-04-15 18:10:02 +00:00
for (const name of ["sha", "shan"]) {
2024-04-15 18:31:36 +00:00
if (event.filterCard({ name: name, isCard: true }, player, event))
2024-04-15 18:10:02 +00:00
return true;
2023-11-12 08:16:18 +00:00
}
return false;
},
2024-04-15 18:10:02 +00:00
chooseButton: {
dialog(event, player) {
const vcards = [];
for (const name of ["sha", "shan"]) {
const card = { name: name, isCard: true };
if (event.filterCard(card, player, event))
vcards.push(["基本", "", name]);
2023-11-12 08:16:18 +00:00
}
2024-04-15 18:31:36 +00:00
const dialog = ui.create.dialog("侠行", [vcards, "vcard"], "hidden");
2024-04-15 18:10:02 +00:00
dialog.direct = true;
2023-11-12 08:16:18 +00:00
return dialog;
},
2024-04-15 18:10:02 +00:00
backup(links, player) {
2023-11-12 08:16:18 +00:00
return {
2024-04-15 18:10:02 +00:00
filterCard: () => false,
selectCard: -1,
viewAs: {
name: links[0][2],
isCard: true,
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
popname: true,
precontent() {
player.logSkill("dddxiaxing_viewas");
player.clearMark("dddxiaxing");
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
};
},
prompt(links, player) {
return (
2024-04-15 18:31:36 +00:00
"侠行:移去“侠”标记,视为使用一张【" + get.translation(links[0][2]) + "】"
2024-04-15 18:10:02 +00:00
);
2023-11-12 08:16:18 +00:00
},
},
2024-04-15 18:10:02 +00:00
ai: {
order(item, player) {
const event = get.event();
2024-04-15 18:31:36 +00:00
if (event.filterCard({ name: "sha" }, player, event)) {
2024-04-15 18:10:02 +00:00
if (
!player.hasShan() &&
!game.hasPlayer(function (current) {
return (
player.canUse("sha", current) &&
current.hp == 1 &&
2024-04-15 18:31:36 +00:00
get.effect(current, { name: "sha" }, player, player) > 0
2024-04-15 18:10:02 +00:00
);
})
) {
2023-11-12 08:16:18 +00:00
return 0;
}
return 2.95;
2024-04-15 18:10:02 +00:00
} else return 3.15;
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
respondSha: true,
respondShan: true,
skillTagFilter(player, tag, arg) {
if (!player.hasMark("dddxiaxing")) return false;
if (arg != "use") return false;
},
result: {
player: 1,
2023-11-12 08:16:18 +00:00
},
},
},
2024-04-15 18:10:02 +00:00
},
2023-11-12 08:16:18 +00:00
},
//张承
2024-04-15 18:10:02 +00:00
dddjuxian: {
enable: "phaseUse",
usable: 2,
filter(event, player) {
return !player.hasSkill("dddjuxian_ban");
},
chooseButton: {
dialog(event, player) {
2024-04-15 18:31:36 +00:00
var dialog = ui.create.dialog("聚贤:请选择一项", "hidden");
2024-04-15 18:10:02 +00:00
dialog.add([
[
["top", "展示一张牌,然后将此牌置于牌堆顶"],
2024-04-15 18:31:36 +00:00
["hand", "展示一张牌,然后将此牌交给一名其他角色"],
2024-04-15 18:10:02 +00:00
],
"textbutton",
]);
2023-11-12 08:16:18 +00:00
return dialog;
},
2024-04-15 18:10:02 +00:00
filter(button, player) {
2024-04-15 18:31:36 +00:00
return !player.hasSkill("dddjuxian_" + button.link, null, null, false);
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
check(button) {
2023-11-12 08:16:18 +00:00
return 1;
},
2024-04-15 18:10:02 +00:00
backup(links) {
return get.copy(lib.skill["dddjuxian_" + links[0]]);
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
prompt(links) {
2024-04-15 18:31:36 +00:00
if (links[0] == "top") return "展示一张牌,然后将此牌置于牌堆顶";
2024-04-15 18:10:02 +00:00
return "展示一张牌,然后将此牌交给一名其他角色";
2023-11-12 08:16:18 +00:00
},
},
2024-04-15 18:10:02 +00:00
ai: {
order: 10,
threaten: 1.7,
result: { player: 1 },
},
subSkill: {
backup: { audio: "dddjuxian" },
ban: { charlotte: true },
top: {
audio: "dddjuxian",
filterCard: true,
selectCard: 1,
position: "he",
discard: false,
delay: false,
lose: false,
*content(event, map) {
const player = map.player,
cards = event.cards;
2024-04-15 18:31:36 +00:00
player.addTempSkill("dddjuxian_top", "phaseUseAfter");
2023-11-12 08:16:18 +00:00
player.showCards(cards);
2024-04-15 18:10:02 +00:00
const color1 = get.color(cards);
player.$throw(cards, 1000);
game.log(player, "将", cards, "置于了牌堆顶");
yield player.lose(cards, ui.cardPile, "insert");
const targets = game.filterPlayer((target) =>
target.countGainableCards(player, "he")
);
2023-11-12 08:16:18 +00:00
let result;
2024-04-15 18:10:02 +00:00
if (!targets.length) return event.finish();
2024-04-15 18:31:36 +00:00
else if (targets.length == 1) result = { bool: true, targets: targets };
2024-04-15 18:10:02 +00:00
else
result = yield player
.chooseTarget(
"聚贤:获得一名其他角色的一张牌",
(card, player, target) => {
if (target == player) return false;
2024-04-15 18:31:36 +00:00
return target.countGainableCards(player, "he");
2024-04-15 18:10:02 +00:00
},
true
)
.set("ai", (target) => {
const player = get.player();
2024-04-15 18:31:36 +00:00
return get.effect(target, { name: "shunshou" }, player, player);
2024-04-15 18:10:02 +00:00
});
if (!result.bool) return event.finish();
const target = result.targets[0];
2023-11-12 08:16:18 +00:00
player.line(target);
2024-04-15 18:31:36 +00:00
result = yield player.gainPlayerCard(target, "he", true);
2024-04-15 18:10:02 +00:00
if (!result.bool) return event.finish();
const cards2 = result.links;
const color2 = get.color(cards2);
2024-04-15 18:31:36 +00:00
if (color1 && color2 && color1 != color2) player.addTempSkill("dddjuxian_ban");
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
ai: {
result: {
player: 1,
2023-11-12 08:16:18 +00:00
},
},
},
2024-04-15 18:10:02 +00:00
hand: {
audio: "dddjuxian",
filterTarget: lib.filter.notMe,
filterCard: true,
selectCard: 1,
position: "he",
discard: false,
delay: false,
lose: false,
*content(event, map) {
const player = map.player,
cards = event.cards,
target = event.targets[0];
2024-04-15 18:31:36 +00:00
player.addTempSkill("dddjuxian_hand", "phaseUseAfter");
2023-11-12 08:16:18 +00:00
player.showCards(cards);
2024-04-15 18:10:02 +00:00
const color1 = get.color(cards);
2023-11-12 08:16:18 +00:00
let result;
2024-04-15 18:10:02 +00:00
yield player.give(cards, target);
result = yield player.draw();
const cards2 = result.filter(
2024-04-15 18:31:36 +00:00
(i) => get.owner(i) == player && get.position(i) == "h"
2024-04-15 18:10:02 +00:00
);
if (!cards.length) return event.finish();
const color2 = get.color(cards2);
2023-11-12 08:16:18 +00:00
player.showCards(cards2);
2024-04-15 18:31:36 +00:00
if (color1 && color2 && color1 != color2) player.addTempSkill("dddjuxian_ban");
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
ai: {
result: {
player: 1,
target: 1,
2023-11-12 08:16:18 +00:00
},
},
},
},
},
2024-04-15 18:10:02 +00:00
dddjungui: {
audio: 2,
trigger: { player: "phaseJieshuBegin" },
direct: true,
*content(event, map) {
const player = map.player;
2024-04-15 18:31:36 +00:00
let result = yield player.chooseTarget(get.prompt2("dddjungui"));
2024-04-15 18:10:02 +00:00
if (!result.bool) return event.finish();
const target = result.targets[0];
player.logSkill("dddjungui", target);
2023-11-12 08:16:18 +00:00
target.draw(2);
yield target.showHandcards();
2024-04-15 18:10:02 +00:00
const targetSuitsCount = target
.getCards("h")
.map((card) => {
return get.suit(card);
})
.toUniqued().length;
const usedCount = player
.getHistory("useCard")
.map((evt) => {
return get.suit(evt.card);
})
.toUniqued().length;
let decreasedCount = 0;
if (usedCount > 0) {
2024-04-15 18:31:36 +00:00
const numbers = Array.from({ length: usedCount }, (_, i) =>
get.cnNumber(i + 1, true)
2024-04-15 18:10:02 +00:00
);
result = yield player
.chooseControl(numbers, "cancel2")
2024-04-15 18:31:36 +00:00
.set("prompt", `是否令${get.translation(target)}少弃置任意张牌?`)
2024-04-15 18:10:02 +00:00
.set("ai", () => {
return get.event("choice");
})
2024-04-15 18:31:36 +00:00
.set("choice", get.attitude(player, target) > 0 ? numbers.lastItem : "cancel2");
2024-04-15 18:10:02 +00:00
if (result.control != "cancel") {
decreasedCount = result.index + 1;
game.log(
player,
"选择令",
target,
"少弃置",
get.cnNumber(decreasedCount),
"张牌"
);
2023-11-12 08:16:18 +00:00
}
}
2024-04-15 18:10:02 +00:00
const toDiscardNum = targetSuitsCount - decreasedCount;
if (toDiscardNum <= 0) return event.finish();
target
.chooseToDiscard(
2024-04-15 18:31:36 +00:00
`隽轨:请弃置${get.cnNumber(toDiscardNum)}张花色不同的手牌`,
2024-04-15 18:10:02 +00:00
toDiscardNum,
true,
(card, player) => {
const suit = get.suit(card);
for (const cardx of ui.selected.cards) {
if (get.suit(cardx) == suit) return false;
}
return true;
}
)
.set("complexCard", true);
},
2023-11-12 08:16:18 +00:00
},
//刘宠
2024-04-15 18:10:02 +00:00
dddjinggou: {
audio: 2,
trigger: { player: "useCardAfter" },
forced: true,
filter(event, player) {
if (get.type(event.card) != "equip") return false;
if (get.subtype(event.card) != "equip1") return false;
const range = player.getAttackRange();
return !game.hasPlayer((current) => {
return current.getAttackRange() > range;
2023-11-12 08:16:18 +00:00
});
},
2024-04-15 18:10:02 +00:00
direct: true,
*content(event, map) {
const player = map.player;
let result = yield player
2024-04-15 18:31:36 +00:00
.chooseTarget("精彀对一名其他角色造成1点伤害", true, lib.filter.notMe)
2024-04-15 18:10:02 +00:00
.set("ai", (target) => {
var player = get.player();
return get.damageEffect(target, player, player);
});
if (result.bool) {
const target = result.targets[0];
player.logSkill("dddjinggou", target);
2023-11-12 08:16:18 +00:00
target.damage();
}
},
},
2024-04-15 18:10:02 +00:00
dddmoyan: {
audio: 2,
trigger: { global: "roundStart" },
*content(event, map) {
const player = map.player;
const cards = game.cardsGotoOrdering(get.cards(3)).cards;
2024-04-15 18:31:36 +00:00
yield player.showCards(cards, `${get.translation(player)}发动了【末焱】`);
2024-04-15 18:10:02 +00:00
let result = yield player
.chooseTarget("末焱:选择一名角色获得其中至少一张牌")
2024-04-15 18:31:36 +00:00
.set("ai", (target) => get.attitude(get.player(), target));
2024-04-15 18:10:02 +00:00
if (!result.bool) return event.finish();
const target = result.targets[0];
result = yield target
2024-04-15 18:31:36 +00:00
.chooseButton(["末焱:获得至少一张牌", cards], true, [1, cards.length])
2024-04-15 18:10:02 +00:00
.set("ai", (button) => {
return get.value(button.link);
});
if (!result.bool) return event.finish();
const gains = result.links;
target.gain(gains, "gain2");
2024-04-15 18:31:36 +00:00
player.setStorage("dddmoyan_target", [target, gains.length]);
2024-04-15 18:10:02 +00:00
player.addTempSkill("dddmoyan_target", "roundStart");
},
subSkill: {
target: {
onremove: true,
trigger: { player: "damageBegin3" },
filter(event, player) {
const info = player.getStorage("dddmoyan_target");
2024-04-15 18:31:36 +00:00
return info[0] && info[0].isIn() && info[0].countCards("h") <= info[1];
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
forced: true,
charlotte: true,
content() {
trigger.increase("num");
2023-11-12 08:16:18 +00:00
},
},
},
},
//罗宪
2024-04-15 18:10:02 +00:00
dddshilie: {
audio: 2,
enable: "chooseToUse",
hiddenCard(player, name) {
if (!player.countCards("h")) return false;
return name == "sha" || name == "shan";
},
filter(event, player) {
2024-04-15 18:31:36 +00:00
if (event.type == "wuxie" || !_status.currentPhase) return false;
if (!player.countCards("h") || player.hasSkill("dddshilie_used", null, null, false))
2024-04-15 18:10:02 +00:00
return false;
for (var name of ["sha", "shan"]) {
2024-04-15 18:31:36 +00:00
if (event.filterCard({ name: name, isCard: true }, player, event)) return true;
2023-11-12 08:16:18 +00:00
}
return false;
},
2024-04-15 18:10:02 +00:00
chooseButton: {
dialog(event, player) {
var vcards = [];
for (var name of ["sha", "shan"]) {
var card = { name: name, isCard: true };
2024-04-15 18:31:36 +00:00
if (event.filterCard(card, player, event)) vcards.push(["基本", "", name]);
2023-11-12 08:16:18 +00:00
}
2024-04-15 18:31:36 +00:00
const dialog = ui.create.dialog("示烈", [vcards, "vcard"], "hidden");
2024-04-15 18:10:02 +00:00
dialog.direct = true;
2023-11-12 08:16:18 +00:00
return dialog;
},
2024-04-15 18:10:02 +00:00
check(button) {
2023-11-12 08:16:18 +00:00
return 1;
},
2024-04-15 18:10:02 +00:00
backup(links, player) {
2023-11-12 08:16:18 +00:00
return {
2024-04-15 18:10:02 +00:00
filterCard(card) {
2023-11-12 08:16:18 +00:00
return !get.is.shownCard(card);
},
2024-04-15 18:10:02 +00:00
filterOk: () => {
return (
ui.selected.cards
.map((card) => {
return get.number(card);
})
.reduce((p, c) => {
return p + c;
}, 0) >=
get.player().getHp() +
2024-04-15 18:31:36 +00:00
(_status.currentPhase ? _status.currentPhase.getHp() : 0)
2024-04-15 18:10:02 +00:00
);
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
selectCard: [1, Infinity],
viewAs: {
name: links[0][2],
isCard: true,
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
popname: true,
ignoreMod: true,
ai1(card) {
const need =
get.player().getHp() +
2024-04-15 18:31:36 +00:00
(_status.currentPhase ? _status.currentPhase.getHp() : 0);
2024-04-15 18:10:02 +00:00
let num = 0;
2024-04-15 18:31:36 +00:00
for (var i = 0; i < ui.selected.cards.length; i++) {
2024-04-15 18:10:02 +00:00
num += get.number(ui.selected.cards[i]);
2023-11-12 08:16:18 +00:00
}
2024-04-15 18:31:36 +00:00
if (num + get.number(card) == need) return 20 - get.value(card);
2024-04-15 18:10:02 +00:00
if (ui.selected.cards.length == 0) {
2024-04-15 18:31:36 +00:00
var cards = _status.event.player.getCards("h");
2024-04-15 18:10:02 +00:00
for (var i = 0; i < cards.length; i++) {
2024-04-15 18:31:36 +00:00
for (var j = i + 1; j < cards.length; j++) {
if (cards[i].number + cards[j].number >= need) {
if (cards[i] == card || cards[j] == card)
2024-04-15 18:10:02 +00:00
return 15 - get.value(card);
2023-11-12 08:16:18 +00:00
}
}
}
}
return 0.1;
},
2024-04-15 18:10:02 +00:00
precontent() {
"step 0";
player.logSkill("dddshilie");
player.addTempSkill("dddshilie_used");
var cards = event.result.cards.slice();
2024-04-15 18:31:36 +00:00
player.addShownCards(cards, "visible_dddshilie");
2023-11-12 08:16:18 +00:00
delete event.result.skill;
2024-04-15 18:31:36 +00:00
player.showCards(cards, get.translation(player) + "发动了【示烈】");
2024-04-15 18:10:02 +00:00
if (
cards
.map((card) => {
return get.number(card);
})
.reduce((p, c) => {
return p + c;
}, 0) ==
2024-04-15 18:31:36 +00:00
player.getHp() + (_status.currentPhase ? _status.currentPhase.getHp() : 0)
2024-04-15 18:10:02 +00:00
) {
2023-11-12 08:16:18 +00:00
player.draw(cards.length);
}
2024-04-15 18:10:02 +00:00
event.result.card = new lib.element.VCard({
name: event.result.card.name,
isCard: true,
});
event.result.cards = [];
2023-11-12 08:16:18 +00:00
game.delayx();
},
2024-04-15 18:10:02 +00:00
};
},
prompt(links, player) {
return `###示烈###明置任意张点数之和不小于${
2024-04-15 18:31:36 +00:00
player.getHp() + (_status.currentPhase ? _status.currentPhase.getHp() : 0)
2024-04-15 18:10:02 +00:00
}的牌视为使用${get.translation(links[0][2])}`;
2023-11-12 08:16:18 +00:00
},
},
2024-04-15 18:10:02 +00:00
subSkill: { used: { charlotte: true } },
ai: {
order(item, player) {
const evt = get.event();
for (var name of ["sha", "shan"]) {
if (evt.filterCard({ name: name }, player, evt))
return get.order({ name: name }) + 0.1;
2023-11-12 08:16:18 +00:00
}
return 1;
},
2024-04-15 18:10:02 +00:00
respondSha: true,
respondShan: true,
skillTagFilter(player, tag, arg) {
if (!player.countCards("h")) return false;
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
result: {
player(player) {
2023-11-12 08:16:18 +00:00
return 1;
2024-04-15 18:10:02 +00:00
},
},
},
2023-11-12 08:16:18 +00:00
},
2023-07-30 15:42:21 +00:00
//李娥
2024-04-15 18:10:02 +00:00
dddyeshen: {
trigger: { global: "phaseJieshuBegin" },
logTarget: "player",
prompt2(event, player) {
var num = player.countMark("dddyeshen");
var str =
"亮出牌堆底的" +
get.cnNumber(3 - num) +
"张牌,然后其将其中的一张牌当作【铁索连环】使用或打出。";
2024-04-15 18:31:36 +00:00
if (num >= 2) str += "然后你受到1点火属性伤害并重置此技能。";
2023-07-30 15:42:21 +00:00
return str;
},
2024-04-15 18:10:02 +00:00
check(event, player) {
if (
player.countMark("dddyeshen") >= 2 &&
get.damageEffect(player, player, player, "fire") < 0
)
return false;
return get.attitude(player, event.player) > 0;
},
content() {
"step 0";
event.target = trigger.player;
2024-04-15 18:31:36 +00:00
var cards = get.bottomCards(3 - player.countMark("dddyeshen"));
2024-04-15 18:10:02 +00:00
event.cards = cards;
2023-07-30 15:42:21 +00:00
game.cardsGotoOrdering(cards);
2024-04-15 18:10:02 +00:00
player.showCards(
cards,
2024-04-15 18:31:36 +00:00
get.translation(player) + "对" + get.translation(target) + "发动了【冶身】"
2024-04-15 18:10:02 +00:00
);
2024-04-15 18:31:36 +00:00
if (!cards.some((card) => get.color(card) == "black")) event.goto(4);
"step 1";
2024-04-15 18:10:02 +00:00
if (target.isIn()) {
2024-04-15 18:31:36 +00:00
var blacks = cards.filter((card) => get.color(card) == "black");
2024-04-15 18:10:02 +00:00
if (blacks.length > 1)
target
2024-04-15 18:31:36 +00:00
.chooseButton(["选择一张牌当作【铁索连环】使用或重铸", blacks], true)
.set("ai", (button) => get.translation(button.link.name).length);
2024-04-15 18:10:02 +00:00
else
event._result = {
bool: true,
links: blacks,
};
} else event.goto(4);
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (result.bool) {
event.links = result.links.slice(0);
2024-04-15 18:31:36 +00:00
var card = get.autoViewAs({ name: "tiesuo" }, result.links);
var maxNum = get.translation(result.links[0].name).length;
if (!game.hasPlayer((current) => target.canUse(card, current))) {
2024-04-15 18:10:02 +00:00
event._result = { bool: false };
} else
target
.chooseTarget(
"请选择【铁索连环】的目标,或点“取消”重铸",
function (card, player, target) {
var card = _status.event.card;
return player.canUse(card, target);
},
[1, Math.min(maxNum, game.countPlayer())]
)
.set("card", card)
.set("ai", function (target) {
var player = _status.event.player,
card = _status.event.card;
2024-04-15 18:31:36 +00:00
return get.effect_use(target, card, player, player);
2024-04-15 18:10:02 +00:00
});
2023-07-30 15:42:21 +00:00
}
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
if (result.bool && result.targets.length > 0) {
2024-04-15 18:31:36 +00:00
var card = get.autoViewAs({ name: "tiesuo" }, event.links);
2024-04-15 18:10:02 +00:00
target.useCard(result.targets, card, event.links);
} else {
2024-04-15 18:31:36 +00:00
target.recast(event.links, (player, cards) => game.cardsDiscard(cards));
2024-04-15 18:10:02 +00:00
}
2024-04-15 18:31:36 +00:00
"step 4";
2024-04-15 18:10:02 +00:00
for (var card of cards) {
if (get.position(card, true) == "o")
2024-04-15 18:31:36 +00:00
ui.cardPile.insertBefore(card, ui.cardPile.firstChild);
2024-04-15 18:10:02 +00:00
}
2024-04-15 18:31:36 +00:00
"step 5";
2024-04-15 18:10:02 +00:00
var num = player.countMark("dddyeshen");
if (num < 2) {
player.addMark("dddyeshen", 1, false);
game.log(player, "的", "#g【冶身】", "的亮出牌数-1");
} else {
player.removeMark("dddyeshen", num, false);
game.log(player, "还原了", "#g【冶身】", "的亮出牌数");
player.damage("fire", "nocard");
2023-07-30 15:42:21 +00:00
}
},
},
2024-04-15 18:10:02 +00:00
dddqiaoduan: {
trigger: { global: "linkAfter" },
direct: true,
usable: 1,
filter(event, player) {
var num = game.countPlayer((current) => current.isLinked());
if (event.player.isLinked()) {
return (
2024-04-15 18:31:36 +00:00
player.countCards("he") >= num && game.hasPlayer((current) => current.isDamaged())
2024-04-15 18:10:02 +00:00
);
} else {
return num > 0;
}
},
content() {
"step 0";
if (trigger.player.isLinked()) {
2024-04-15 18:31:36 +00:00
var num = game.countPlayer((current) => current.isLinked());
2023-07-30 15:42:21 +00:00
player.chooseCardTarget({
2024-04-15 18:10:02 +00:00
prompt: get.prompt("dddqiaoduan"),
prompt2:
"操作提示:选择" +
get.cnNumber(num) +
"张牌和一名已受伤的角色。将这些牌置于牌堆底先选择的在上然后该角色回复1点体力。",
filterCard: true,
selectCard: num,
2024-04-15 18:31:36 +00:00
filterTarget: (card, player, target) => target.isDamaged(),
2024-04-15 18:10:02 +00:00
ai1: (card) => 5 - get.value(card),
ai2: (target) => {
var player = _status.event.player;
2024-04-15 18:31:36 +00:00
return get.recoverEffect(target, player, player);
2024-04-15 18:10:02 +00:00
},
});
} else event.goto(2);
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
player.logSkill("dddqiaoduan", result.targets[0]);
player.loseToDiscardpile(result.cards, ui.cardPile);
2023-07-30 15:42:21 +00:00
result.targets[0].recover();
2024-04-15 18:10:02 +00:00
} else player.storage.counttrigger.dddqiaoduan--;
2023-07-30 15:42:21 +00:00
event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
var num = game.countPlayer((current) => current.isLinked());
player
.chooseTarget(
get.prompt("dddqiaoduan"),
[1, num],
"令至多" + get.cnNumber(num) + "名角色各摸一张牌"
)
.set("ai", function (target) {
var player = _status.event.player;
2024-04-15 18:31:36 +00:00
var att = get.attitude(player, target) / Math.sqrt(1 + target.countCards("h"));
2024-04-15 18:10:02 +00:00
if (target.hasSkillTag("nogain")) att /= 10;
return att;
});
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var targets = result.targets.sortBySeat();
player.logSkill("dddqiaoduan", targets);
2023-07-30 15:42:21 +00:00
game.asyncDraw(targets);
game.delayex();
2024-04-15 18:10:02 +00:00
} else player.storage.counttrigger.dddqiaoduan--;
2023-07-30 15:42:21 +00:00
},
},
2023-07-28 17:28:39 +00:00
//孙亮
2024-04-15 18:10:02 +00:00
ddddiedang: {
enable: "phaseUse",
usable: 1,
filter(event, player) {
2024-04-15 18:31:36 +00:00
if (player.storage.ddddiedang) return player.countCards("he") >= 3;
2023-07-28 17:28:39 +00:00
return true;
},
2024-04-15 18:10:02 +00:00
filterCard: true,
position: "he",
selectCard() {
var player = _status.event.player;
return player.storage.ddddiedang ? 3 : 0;
},
prompt() {
var player = _status.event.player;
2024-04-15 18:31:36 +00:00
if (player.storage.ddddiedang) return "弃置三张牌,然后摸一张牌";
2024-04-15 18:10:02 +00:00
return "摸三张牌,然后弃置一张牌";
},
check: (card) => 5 - get.value(card),
content() {
"step 0";
if (player.storage.ddddiedang) {
2023-07-28 17:28:39 +00:00
player.draw();
2024-04-15 18:10:02 +00:00
} else {
2023-07-28 17:28:39 +00:00
player.draw(3);
2024-04-15 18:10:02 +00:00
player.chooseToDiscard(true, "he");
}
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (player.isMaxHandcard() || player.isMinHandcard())
player.storage.ddddiedang = !player.storage.ddddiedang;
},
ai: {
order: 1,
result: {
player(player) {
if (ui.selected.cards.length) {
var num =
2024-04-15 18:31:36 +00:00
1 + player.countCards("h", (card) => !ui.selected.cards.includes(card));
2024-04-15 18:10:02 +00:00
if (
!game.hasPlayer((current) => {
2024-04-15 18:31:36 +00:00
return current != player && current.countCards("h") > num;
2024-04-15 18:10:02 +00:00
}) ||
!game.hasPlayer((current) => {
2024-04-15 18:31:36 +00:00
return current != player && current.countCards("h") < num;
2024-04-15 18:10:02 +00:00
})
)
return 1;
2023-07-28 17:28:39 +00:00
return -1;
}
return 1;
},
},
},
},
2024-04-15 18:10:02 +00:00
dddanliu: {
trigger: { player: "phaseJieshuBegin" },
direct: true,
filter(event, player) {
return (
player.countCards("h") > 0 &&
game.hasPlayer(function (current) {
2024-04-15 18:31:36 +00:00
return current != player && current.countCards("h") > 0;
2024-04-15 18:10:02 +00:00
})
);
},
content() {
"step 0";
player
2024-04-15 18:31:36 +00:00
.chooseTarget(get.prompt2("dddanliu"), function (card, player, target) {
return target != player && target.countCards("h") > 0;
})
2024-04-15 18:10:02 +00:00
.set("ai", function (target) {
2024-04-15 18:31:36 +00:00
return get.attitude(get.player(), target) * Math.sqrt(1 + target.countCards("h"));
2024-04-15 18:10:02 +00:00
});
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var target = result.targets[0];
player.logSkill("dddanliu", target);
event.target = target;
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
player
.choosePlayerCard(target, true, "h", "visible", [0, 1])
.set("filterOk", () => ui.selected.buttons.length > 0)
.set("ai", (button) => {
var player = get.player(),
target = _status.event.target;
var color = get.color(button.link);
if (
player.hasCard(function (card) {
return get.color(card) == color;
}, "h")
) {
if (color == "red")
return (
2024-04-15 18:31:36 +00:00
get.recoverEffect(player, player, player) +
2024-04-15 18:10:02 +00:00
2 / Math.max(2, get.value(button.link))
);
if (color == "black")
return (
2024-04-15 18:31:36 +00:00
2 * get.effect(target, { name: "draw" }, target, player) +
2024-04-15 18:10:02 +00:00
2 / Math.max(2, get.value(button.link))
);
2023-07-28 17:28:39 +00:00
}
2024-04-15 18:10:02 +00:00
return get.value(button.link) / 3;
});
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
if (result.bool) {
event.card1 = result.cards[0];
target
.choosePlayerCard(
player,
true,
"h",
"visible",
[0, 1],
get.translation(player) +
"选择了你的" +
get.translation(event.card1) +
"。请选择其的一张牌"
)
.set("ai", function (button) {
var evt = _status.event.getParent();
var player = evt.target,
card = evt.card1,
source = evt.player;
var color = get.color(card);
if (get.attitude(player, target) > 0) {
2024-04-15 18:31:36 +00:00
if (get.color(button.link) == color) return 20 - get.value(card);
2024-04-15 18:10:02 +00:00
return -get.value(card);
} else {
2024-04-15 18:31:36 +00:00
if (get.color(button.link) == "black") return 20 + get.value(card);
2024-04-15 18:10:02 +00:00
return get.value(card);
}
})
2024-04-15 18:31:36 +00:00
.set("filterOk", () => ui.selected.buttons.length > 0);
2024-04-15 18:10:02 +00:00
}
2024-04-15 18:31:36 +00:00
"step 4";
2024-04-15 18:10:02 +00:00
if (result.bool) {
event.card2 = result.cards[0];
var color = get.color(event.card1);
2024-04-15 18:31:36 +00:00
if (color != "none" && get.color(event.card2) == color) {
2024-04-15 18:10:02 +00:00
event.color = color;
2024-04-15 18:31:36 +00:00
var next = player.chooseBool("是否与" + get.translation(target) + "交换展示牌");
2024-04-15 18:10:02 +00:00
var prompt2 =
"用" +
get.translation(event.card1) +
"交换对方的" +
get.translation(event.card2);
if (color == "black") {
prompt2 += ",然后对方摸两张牌";
next.set(
"goon",
2024-04-15 18:31:36 +00:00
2 * get.effect(target, { name: "draw" }, target, player) > 0
2024-04-15 18:10:02 +00:00
);
} else if (color == "red" && player.isDamaged()) {
prompt2 += "然后你回复1点体力";
2024-04-15 18:31:36 +00:00
next.set("goon", get.recoverEffect(player, player, player) > 0);
2023-07-28 17:28:39 +00:00
}
2024-04-15 18:10:02 +00:00
next.set("prompt2", prompt2);
next.set("ai", () => Boolean(_status.event.goon));
} else event.finish();
}
2024-04-15 18:31:36 +00:00
"step 5";
2024-04-15 18:10:02 +00:00
if (result.bool) {
2024-04-15 18:31:36 +00:00
player.swapHandcards(target, [event.card2], [event.card1]);
2024-04-15 18:10:02 +00:00
if (event.color == "black") {
2023-07-28 17:28:39 +00:00
target.draw(2);
2024-04-15 18:10:02 +00:00
} else if (event.color == "red") {
2023-07-28 17:28:39 +00:00
player.recover();
}
}
},
},
2024-04-15 18:10:02 +00:00
dddguiying: {
zhuSkill: true,
trigger: { player: "phaseZhunbeiBegin" },
direct: true,
filter(event, player) {
return (
player.hasZhuSkill("dddguiying") &&
game.hasPlayer(function (current) {
return (
current != player &&
current.group == "wu" &&
player.hasZhuSkill("dddguiying", current) &&
current.countCards("h") > 0
);
})
);
},
gainEffect(player) {
2024-04-15 18:31:36 +00:00
var gainers = game.filterPlayer((current) => current.countCards("ej"));
2024-04-15 18:10:02 +00:00
if (!gainers.length) return 0;
var min = Math.min.apply(
Math,
gainers.map((current) => {
return Math.min.apply(
Math,
current.getCards("ej").map(function (card) {
return get.number(card, current);
})
);
})
);
return Math.max.apply(
Math,
game
.filterPlayer(function (target) {
return target.hasCard(function (card) {
return (
get.number(card, target) == min &&
2024-04-15 18:31:36 +00:00
lib.filter.canBeGained(card, player, target)
2024-04-15 18:10:02 +00:00
);
}, "ej");
})
.map(function (target) {
2024-04-15 18:31:36 +00:00
var cards = target.getCards("ej", function (card) {
return (
get.number(card, target) == min &&
lib.filter.canBeGained(card, player, target)
);
}),
2024-04-15 18:10:02 +00:00
att = get.attitude(player, target);
return Math.max.apply(
Math,
cards.map((card) => {
2024-04-15 18:31:36 +00:00
if (target.getCards("j").includes(card)) {
2024-04-15 18:10:02 +00:00
var efff = get.effect(
target,
{
2024-04-15 18:31:36 +00:00
name: card.viewAs || card.name,
2024-04-15 18:10:02 +00:00
cards: [card],
},
player,
player
);
if (efff > 0) return -0.5 * att;
if (efff == 0) return 0;
return 1.5 * att;
}
2024-04-15 18:31:36 +00:00
if (target.getCards("e").includes(card)) {
var evalue = get.value(card, target);
2024-04-15 18:10:02 +00:00
if (target.hasSkillTag("noe")) {
if (evalue >= 7) {
return (-evalue / 6) * att;
}
return (-evalue / 10) * att;
}
return (-evalue / 3) * att;
2023-07-28 17:28:39 +00:00
}
2024-04-15 18:10:02 +00:00
})
);
})
);
},
content() {
"step 0";
event.targets = game
.filterPlayer(function (current) {
return (
current != player &&
current.group == "wu" &&
player.hasZhuSkill("dddguiying", current)
);
})
.sortBySeat();
if (!event.targets.length) event.finish();
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
var target = event.targets.shift();
event.target = target;
2024-04-15 18:31:36 +00:00
if (target.isIn() && target.group == "wu" && target.countCards("h") > 0) {
2024-04-15 18:10:02 +00:00
target
.chooseBool(
2024-04-15 18:31:36 +00:00
"归萤:是否响应" + get.translation(player) + "的主公技?",
2024-04-15 18:10:02 +00:00
"你可以展示所有手牌,将点数最大的牌交给该角色;然后你可以获得场上点数最小的一张牌"
)
.set("ai", function () {
var player = get.player(),
source = _status.event.getParent().player;
if (_status.event.gainEffect <= 0) return 0;
return get.attitude(player, source) > 0;
})
2024-04-15 18:31:36 +00:00
.set("gainEffect", lib.skill.dddguiying.gainEffect(target));
2024-04-15 18:10:02 +00:00
} else event.goto(7);
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (result.bool) {
target.logSkill("dddguiying", player);
2024-04-15 18:31:36 +00:00
target.showHandcards(get.translation(target) + "响应了〖归萤〗");
2024-04-15 18:10:02 +00:00
} else event.goto(7);
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
if (target.isIn()) {
var cards = target.getCards("he");
if (!cards.length) event.goto(7);
var max = Math.max.apply(
Math,
cards.map((card) => get.number(card, target))
);
2024-04-15 18:31:36 +00:00
var gives = cards.filter((card) => get.number(card, target) == max);
if (gives.length <= 1) event._result = { bool: true, cards: gives };
2024-04-15 18:10:02 +00:00
else
target
2024-04-15 18:31:36 +00:00
.chooseCard("he", true, "选择给出一张点数最大的牌", function (card) {
return _status.event.cards.includes(card);
})
2024-04-15 18:10:02 +00:00
.set("cards", gives);
} else event.goto(7);
2024-04-15 18:31:36 +00:00
"step 4";
2024-04-15 18:10:02 +00:00
if (result.bool) {
target.give(result.cards, player, "visible");
} else event.goto(7);
2024-04-15 18:31:36 +00:00
"step 5";
var gainers = game.filterPlayer((current) => current.countCards("ej"));
2024-04-15 18:10:02 +00:00
if (target.isIn() && gainers.length > 0) {
var min = Math.min.apply(
Math,
gainers.map((current) => {
return Math.min.apply(
Math,
current.getCards("ej").map(function (card) {
return get.number(card, current);
})
);
})
);
target
2024-04-15 18:31:36 +00:00
.chooseTarget("是否获得场上点数最小的一张牌?", function (card, player, target) {
var num = _status.event.minNum;
return target.hasCard(function (card) {
return (
get.number(card, target) == num &&
lib.filter.canBeGained(card, player, target)
);
}, "ej");
})
2024-04-15 18:10:02 +00:00
.set("minNum", min)
.set("ai", function (target) {
var player = get.player(),
min = _status.event.minNum;
2024-04-15 18:31:36 +00:00
var cards = target.getCards("ej", function (card) {
return (
get.number(card, target) == min &&
lib.filter.canBeGained(card, player, target)
);
}),
2024-04-15 18:10:02 +00:00
att = get.attitude(player, target);
return Math.max.apply(
Math,
cards.map((card) => {
2024-04-15 18:31:36 +00:00
if (target.getCards("j").includes(card)) {
2024-04-15 18:10:02 +00:00
var efff = get.effect(
target,
{
2024-04-15 18:31:36 +00:00
name: card.viewAs || card.name,
2024-04-15 18:10:02 +00:00
cards: [card],
},
player,
player
);
if (efff > 0) return -0.5 * att;
if (efff == 0) return 0;
return 1.5 * att;
}
2024-04-15 18:31:36 +00:00
if (target.getCards("e").includes(card)) {
var evalue = get.value(card, target);
2024-04-15 18:10:02 +00:00
if (target.hasSkillTag("noe")) {
if (evalue >= 7) {
return (-evalue / 6) * att;
}
return (-evalue / 10) * att;
}
return (-evalue / 3) * att;
}
})
);
});
} else event.goto(7);
2024-04-15 18:31:36 +00:00
"step 6";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var target2 = result.targets[0];
target.line(target2, "green");
var min = Math.min.apply(
Math,
target2.getCards("ej").map(function (card) {
return get.number(card, target2);
})
),
2024-04-15 18:31:36 +00:00
cards = target2.getCards("ej", (card) => get.number(card, target2) == min);
if (cards.length <= 1) target.gain(cards, target2, "give", "bySelf");
2024-04-15 18:10:02 +00:00
else
target
.gainPlayerCard(target2, "ej", true)
.set("filterButton", function (button) {
2024-04-15 18:31:36 +00:00
return _status.event.cards.includes(button.link);
2024-04-15 18:10:02 +00:00
})
.set("cards", cards);
2023-07-28 17:28:39 +00:00
}
2024-04-15 18:31:36 +00:00
"step 7";
2024-04-15 18:10:02 +00:00
if (targets.length > 0) event.goto(1);
2023-07-28 17:28:39 +00:00
},
},
//王伉吕凯
2024-04-15 18:10:02 +00:00
dddbingjian: {
enable: ["chooseToUse", "chooseToRespond"],
filter(event, player) {
if (event.type == "wuxie") return false;
if (player.countMark("dddbingjian_used") >= 2) return false;
if (player.countCards("h") == 2) return false;
return (
event.filterCard(
{
name: "sha",
isCard: true,
},
player,
event
) ||
event.filterCard(
{
name: "shan",
isCard: true,
},
player,
event
)
);
},
chooseButton: {
dialog(event, player) {
2023-07-28 17:28:39 +00:00
return ui.create.dialog(
2024-04-15 18:10:02 +00:00
"并肩",
2023-11-12 08:16:18 +00:00
// [[
// [2,'调整至2张'],
// [4,'调整至4张']
// ],'tdnodes'],
2024-04-15 18:10:02 +00:00
[["sha", "shan"], "vcard"],
"hidden"
);
2023-07-28 17:28:39 +00:00
},
2023-11-12 08:16:18 +00:00
// select:2,
2024-04-15 18:10:02 +00:00
filter(button, player) {
if (ui.selected.buttons.length) {
2024-04-15 18:31:36 +00:00
if (typeof button.link == typeof ui.selected.buttons[0].link) return false;
2023-07-28 17:28:39 +00:00
}
2023-11-12 08:16:18 +00:00
// if(typeof button.link=='number'){
// return button.link!=player.countCards('h');
// }
2023-07-28 17:28:39 +00:00
return _status.event.getParent().filterCard({
2024-04-15 18:10:02 +00:00
name: button.link[2],
isCard: true,
2023-07-28 17:28:39 +00:00
});
},
2024-04-15 18:10:02 +00:00
check(button) {
2023-11-12 08:16:18 +00:00
// if(typeof button.link=='number') return button.link;
return 1;
2023-07-28 17:28:39 +00:00
},
2024-04-15 18:10:02 +00:00
backup(links, player) {
2023-11-12 08:16:18 +00:00
// if(typeof links[0]=='number') links.reverse();
2024-04-15 18:10:02 +00:00
var skill = {
viewAs: {
name: links[0][2],
suit: "none",
number: null,
isCard: true,
},
};
var num = 2 - player.countCards("h");
if (num > 0) {
skill.draw = num;
skill.filterCard = function () {
2023-07-28 17:28:39 +00:00
return false;
2024-04-15 18:10:02 +00:00
};
skill.selectCard = -1;
2024-04-15 18:31:36 +00:00
skill.precontent = lib.skill.dddbingjian.content_draw;
2024-04-15 18:10:02 +00:00
} else {
skill.selectCard = -num;
skill.ignoreMod = true;
skill.filterCard = lib.filter.cardDiscardable;
2024-04-15 18:31:36 +00:00
skill.precontent = lib.skill.dddbingjian.content_discard;
2024-04-15 18:10:02 +00:00
skill.check = function (card) {
return 5 - get.value(card);
2023-07-28 17:28:39 +00:00
};
}
return skill;
},
2024-04-15 18:10:02 +00:00
prompt(links, player) {
2023-11-12 08:16:18 +00:00
// if(typeof links[0]=='number') links.reverse();
2024-04-15 18:10:02 +00:00
var num = 2 - player.countCards("h");
if (num > 0) {
2024-04-15 18:31:36 +00:00
return "摸" + get.cnNumber(num) + "张牌并视为使用" + get.translation(links[0][2]);
2024-04-15 18:10:02 +00:00
} else {
return (
2024-04-15 18:31:36 +00:00
"弃置" + get.cnNumber(-num) + "张牌并视为使用" + get.translation(links[0][2])
2024-04-15 18:10:02 +00:00
);
2023-07-28 17:28:39 +00:00
}
2024-04-15 18:10:02 +00:00
},
2023-07-28 17:28:39 +00:00
},
2024-04-15 18:10:02 +00:00
ai: {
pretao: true,
order(item, player) {
2024-04-15 18:31:36 +00:00
if (player.countCards("h") < 4) return get.order({ name: "sha" }, player) + 0.2;
2023-07-28 17:28:39 +00:00
return 1;
},
2024-04-15 18:10:02 +00:00
result: {
player: 1,
2023-07-28 17:28:39 +00:00
},
},
2024-04-15 18:10:02 +00:00
content_draw() {
"step 0";
2023-11-12 08:16:18 +00:00
delete event.result.skill;
2024-04-15 18:10:02 +00:00
player.logSkill("dddbingjian");
2023-11-12 08:16:18 +00:00
player.draw(lib.skill.dddbingjian_backup.draw);
2024-04-15 18:10:02 +00:00
player.addTempSkill("dddbingjian_used");
player.addMark("dddbingjian_used", 1, false);
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
player
2024-04-15 18:31:36 +00:00
.chooseTarget("是否令一名其他角色摸等量的牌?", lib.filter.notMe)
2024-04-15 18:10:02 +00:00
.set("ai", (target) => {
var player = get.player();
2024-04-15 18:31:36 +00:00
return get.effect(target, { name: "draw" }, player, player);
2024-04-15 18:10:02 +00:00
});
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var target = result.targets[0];
player.line(target, "green");
2023-11-12 08:16:18 +00:00
target.draw(lib.skill.dddbingjian_backup.draw);
}
},
2024-04-15 18:10:02 +00:00
content_discard() {
"step 0";
2023-11-12 08:16:18 +00:00
delete event.result.skill;
2024-04-15 18:10:02 +00:00
player.logSkill("dddbingjian");
2023-11-12 08:16:18 +00:00
player.discard(event.result.cards);
2024-04-15 18:10:02 +00:00
event.num = event.result.cards.length;
player.addTempSkill("dddbingjian_used");
player.addMark("dddbingjian_used", 1, false);
event.result.card = {
name: event.result.card.name,
isCard: true,
};
event.result.cards = [];
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
player
2024-04-15 18:31:36 +00:00
.chooseTarget("是否弃置一名其他角色等量的牌?", lib.filter.notMe)
2024-04-15 18:10:02 +00:00
.set("ai", (target) => {
var player = get.player(),
2024-04-15 18:31:36 +00:00
num = target.countCards("he") - get.event("num");
2024-04-15 18:10:02 +00:00
if (num >= 0) num = 1;
else num = 1 - num / 5;
2024-04-15 18:31:36 +00:00
var eff = get.effect(target, { name: "guohe_copy2" }, player, player);
2024-04-15 18:10:02 +00:00
return eff / num;
})
.set("num", event.num);
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var target = result.targets[0];
player.line(target, "fire");
player.discardPlayerCard(target, "he", true, event.num);
2023-11-12 08:16:18 +00:00
}
},
2024-04-15 18:10:02 +00:00
content_draw_old() {
"step 0";
2023-07-28 17:28:39 +00:00
delete event.result.skill;
2024-04-15 18:10:02 +00:00
player.logSkill("dddbingjian");
player.addTempSkill("dddbingjian_round", "roundStart");
2023-07-28 17:28:39 +00:00
player.draw(lib.skill.dddbingjian_backup.draw);
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
player
.chooseTarget(
2024-04-15 18:31:36 +00:00
"是否令一名角色本轮内不能使用或打出" + get.translation(event.result.card) + ""
2024-04-15 18:10:02 +00:00
)
.set("ai", function (target) {
var player = _status.event.player;
return (
-get.attitude(player, target) *
get.threaten(target, player) *
Math.sqrt(1 + target.countCards("h"))
);
});
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var target = result.targets[0];
player.line(target, "fire");
2024-04-15 18:31:36 +00:00
player.chat("你不许使用" + get.translation(event.result.card));
target.addTempSkill("dddbingjian_blocker", "roundStart");
target.markAuto("dddbingjian_blocker", [event.result.card.name]);
2023-07-28 17:28:39 +00:00
game.delayx();
}
},
2024-04-15 18:10:02 +00:00
content_discard_old() {
"step 0";
2023-07-28 17:28:39 +00:00
delete event.result.skill;
2024-04-15 18:10:02 +00:00
player.logSkill("dddbingjian");
2023-07-28 17:28:39 +00:00
player.discard(event.result.cards);
2024-04-15 18:10:02 +00:00
event.result.card = {
name: event.result.card.name,
isCard: true,
};
event.result.cards = [];
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
var hs = player.countCards("h");
2024-04-15 18:31:36 +00:00
if (!game.hasPlayer((current) => current.countCards("h") != hs)) {
2023-07-28 17:28:39 +00:00
event.finish();
2024-04-15 18:10:02 +00:00
} else {
player
.chooseTarget(
2024-04-15 18:31:36 +00:00
"是否令一名角色将手牌调整至" + get.cnNumber(player.countCards("h")) + "张?",
2024-04-15 18:10:02 +00:00
function (card, player, target) {
2024-04-15 18:31:36 +00:00
return target.countCards("h") != player.countCards("h");
2024-04-15 18:10:02 +00:00
}
)
.set("ai", function (target) {
var player = _status.event.player,
2024-04-15 18:31:36 +00:00
num = target.countCards("h") - player.countCards("h");
2024-04-15 18:10:02 +00:00
if (num > 0)
2024-04-15 18:31:36 +00:00
return get.attitude(player, target) * Math.sqrt(1 + Math.abs(num));
return -get.attitude(player, target) * Math.sqrt(-num);
2024-04-15 18:10:02 +00:00
});
2023-07-28 17:28:39 +00:00
}
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var target = result.targets[0];
player.line(target, "fire");
2024-04-15 18:31:36 +00:00
var num = target.countCards("h") - player.countCards("h");
2024-04-15 18:10:02 +00:00
if (num > 0) target.chooseToDiscard("h", true, num);
else target.draw(Math.min(5, -num));
}
},
subSkill: {
round: { charlotte: true },
blocker: {
charlotte: true,
mod: {
cardEnabled(card, player) {
2024-04-15 18:31:36 +00:00
if (player.getStorage("dddbingjian_blocker").includes(card.name))
2024-04-15 18:10:02 +00:00
return false;
2023-07-28 17:28:39 +00:00
},
2024-04-15 18:10:02 +00:00
cardRespondable(card, player) {
2024-04-15 18:31:36 +00:00
if (player.getStorage("dddbingjian_blocker").includes(card.name))
2024-04-15 18:10:02 +00:00
return false;
2023-07-28 17:28:39 +00:00
},
2024-04-15 18:10:02 +00:00
cardSavable(card, player) {
2024-04-15 18:31:36 +00:00
if (player.getStorage("dddbingjian_blocker").includes(card.name))
2024-04-15 18:10:02 +00:00
return false;
2023-07-28 17:28:39 +00:00
},
},
2024-04-15 18:10:02 +00:00
mark: true,
intro: {
content: "本轮内不能使用或打出$",
2023-07-28 17:28:39 +00:00
},
},
2024-04-15 18:10:02 +00:00
used: {
charlotte: true,
onremove: true,
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
},
2023-07-28 17:28:39 +00:00
},
//梁习
2024-04-15 18:10:02 +00:00
dddtongyu: {
enable: "phaseUse",
usable: 1,
filter(event, player) {
return player.countCards("hs") > 0;
},
viewAs: {
name: "wugu",
},
selectCard: [1, 4],
filterCard(card) {
var suit = get.suit(card);
if (suit == "none") return false;
if (!ui.selected.cards.length) return true;
for (var card of ui.selected.cards) {
if (get.suit(card) == suit) return false;
2023-07-28 17:28:39 +00:00
}
return true;
},
2024-04-15 18:10:02 +00:00
complexCard: true,
position: "hs",
prompt: "将任意张花色不同的牌当做【五谷丰登】使用",
check(card) {
return 5 - get.value(card);
},
precontent() {
2024-04-15 18:31:36 +00:00
if (!event.result.card.storage) event.result.card.storage = {};
2024-04-15 18:10:02 +00:00
event.result.card.storage.chooseDirection = true;
2024-04-15 18:31:36 +00:00
event.result.card.storage.extraCardsNum = event.result.cards.length;
2024-04-15 18:10:02 +00:00
player.addTempSkill("dddtongyu_effect");
},
ai: {
order: 1,
},
subSkill: {
effect: {
trigger: { global: "useCardToTargeted" },
forced: true,
charlotte: true,
popup: false,
filter(event, player) {
2024-04-15 18:31:36 +00:00
return event.skill == "dddtongyu" && event.isFirstTarget;
2023-07-28 17:28:39 +00:00
},
2024-04-15 18:10:02 +00:00
content() {
"step 0";
event.targets = trigger.targets
.slice()
.sortBySeat(_status.currentPhase || player);
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
var target = targets.shift();
event.target = target;
2024-04-15 18:31:36 +00:00
if (!target.isUnderControl(true) && !target.isOnline()) game.delayx();
2024-04-15 18:10:02 +00:00
target
.chooseControl()
.set("choiceList", [
"本回合不能使用或打出手牌",
2024-04-15 18:31:36 +00:00
"令" + get.translation(trigger.card) + "对自己无效",
2024-04-15 18:10:02 +00:00
])
.set("ai", function () {
var player = _status.event.player;
2024-04-15 18:31:36 +00:00
var source = _status.event.getTrigger().player;
2024-04-15 18:10:02 +00:00
return player == source ? 1 : 0;
});
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (result.index == 0) {
target.chat("接受五谷");
target.addTempSkill("dddtongyu_blocker");
game.log(target, "本回合不能使用或打出手牌");
} else {
target.chat("拒绝五谷");
2023-07-28 17:28:39 +00:00
trigger.excluded.add(target);
2024-04-15 18:10:02 +00:00
var evt = trigger.getParent();
2024-04-15 18:31:36 +00:00
if (!evt.dddtongyu_targets) evt.dddtongyu_targets = [];
2023-07-28 17:28:39 +00:00
evt.dddtongyu_targets.add(target);
2024-04-15 18:31:36 +00:00
game.log(target, "令", trigger.card, "对其无效");
2023-07-28 17:28:39 +00:00
}
2024-04-15 18:10:02 +00:00
if (targets.length) event.goto(1);
2023-07-28 17:28:39 +00:00
},
2024-04-15 18:10:02 +00:00
group: "dddtongyu_give",
2023-07-28 17:28:39 +00:00
},
2024-04-15 18:10:02 +00:00
give: {
trigger: { player: "wuguRemained" },
direct: true,
filter(event, player) {
2024-04-15 18:31:36 +00:00
if (event.skill != "dddtongyu" || event.remained.filterInD().length == 0)
2024-04-15 18:10:02 +00:00
return false;
var list = event.getParent().dddtongyu_targets;
return list.some((target) => target.isIn());
2023-07-28 17:28:39 +00:00
},
2024-04-15 18:10:02 +00:00
content() {
"step 0";
event.cards = trigger.remained.filterInD();
player
.chooseTarget(
2024-04-15 18:31:36 +00:00
"仝御:令一名角色获得" + get.translation(event.cards),
2024-04-15 18:10:02 +00:00
function (card, player, target) {
2024-04-15 18:31:36 +00:00
return _status.event.targets.includes(target);
2024-04-15 18:10:02 +00:00
}
)
2024-04-15 18:31:36 +00:00
.set("targets", trigger.getParent().dddtongyu_targets)
2024-04-15 18:10:02 +00:00
.set("ai", function (target) {
2024-04-15 18:31:36 +00:00
var att = get.attitude(_status.event.player, target);
2024-04-15 18:10:02 +00:00
if (att < 3) return 0;
if (target.hasJudge("lebu")) att /= 2;
if (target.hasSkillTag("nogain")) att /= 10;
2024-04-15 18:31:36 +00:00
return att / (1 + get.distance(player, target, "absolute"));
2024-04-15 18:10:02 +00:00
});
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var target = result.targets[0];
player.logSkill("dddtongyu_give", target);
target.gain(cards, "gain2");
2023-07-28 17:28:39 +00:00
}
},
},
2024-04-15 18:10:02 +00:00
blocker: {
mark: true,
intro: { content: "本回合不能使用或打出手牌" },
mod: {
cardEnabled2(card) {
2023-07-28 17:28:39 +00:00
return false;
},
},
},
},
},
2024-04-15 18:10:02 +00:00
dddzhilian: {
trigger: { global: "phaseEnd" },
direct: true,
filter(event, player) {
var targets = game.filterPlayer2(function (current) {
return (
2024-04-15 18:31:36 +00:00
current.getHistory("useCard").length + current.getHistory("respond").length > 0
2024-04-15 18:10:02 +00:00
);
2023-07-27 09:56:09 +00:00
});
2024-04-15 18:10:02 +00:00
if (
!targets.includes(player) ||
2024-04-15 18:31:36 +00:00
!targets.some((target) => target != player && target.hasSex("male"))
2024-04-15 18:10:02 +00:00
)
return false;
2024-04-15 18:31:36 +00:00
return targets.length == 2 && !targets.some((target) => !target.isIn());
2024-04-15 18:10:02 +00:00
},
content() {
"step 0";
var targets = game
.filterPlayer(function (current) {
return (
2024-04-15 18:31:36 +00:00
current.getHistory("useCard").length + current.getHistory("respond").length >
2024-04-15 18:10:02 +00:00
0
);
})
.sortBySeat(trigger.player);
event.targets = targets;
var choices = ["摸牌"];
var prompt2 = "令";
for (var i = 0; i < 2; i++) {
if (targets[i] == player) prompt2 += "你";
else prompt2 += get.translation(targets[i]);
if (i == 0) prompt2 += "和";
}
prompt2 += "各摸一张牌";
if (targets.some((target) => target.countCards("he") > 0)) {
prompt2 += "或各弃置一张牌";
choices.push("弃牌");
}
player
.chooseControl(choices, "cancel2")
.set("prompt", get.prompt("dddzhilian"))
.set("prompt2", prompt2)
.set("ai", function () {
var player = _status.event.player;
2024-04-15 18:31:36 +00:00
var targets = _status.event.getParent().targets.slice(0);
2024-04-15 18:10:02 +00:00
if (targets.includes(player)) {
targets.remove(player);
2024-04-15 18:31:36 +00:00
if (get.attitude(player, targets[0]) > 0) return 0;
2024-04-15 18:10:02 +00:00
if (
targets[0].countCards("he") > 0 &&
2024-04-15 18:31:36 +00:00
!targets[0].hasCard((card) => get.value(card, targets[0]) <= 0, "e") &&
2024-04-15 18:10:02 +00:00
player.countCards("h", "sha") > 0
)
return 1;
return "cancel2";
} else {
var att1 = get.attitude(player, targets[0]),
att2 = get.attitude(player, targets[1]);
2024-04-15 18:31:36 +00:00
if (get.sgn(att1) != get.sgn(att2)) return "cancel2";
2024-04-15 18:10:02 +00:00
return att1 > 0 ? 0 : 1;
}
});
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.control != "cancel2") {
player.logSkill("dddzhilian", targets);
if (result.control == "摸牌") {
2023-07-27 09:56:09 +00:00
game.asyncDraw(targets);
game.delayex();
2024-04-15 18:10:02 +00:00
} else {
2024-04-15 18:31:36 +00:00
for (var target of targets) target.chooseToDiscard("he", true);
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
if (!targets.includes(player)) event.finish();
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
var cards = [];
game.getGlobalHistory("cardMove", function (evt) {
if (
2024-04-15 18:31:36 +00:00
(evt.name == "lose" && evt.position == ui.discardPile) ||
2024-04-15 18:10:02 +00:00
evt.name == "cardsDiscard"
)
cards.addArray(evt.cards);
2023-07-27 09:56:09 +00:00
});
2024-04-15 18:31:36 +00:00
cards = cards.filter((card) => card.name == "sha" && get.position(card, true) == "d");
2024-04-15 18:10:02 +00:00
if (cards.length > 0) player.gain(cards, "gain2");
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
dddjijian: {
enable: "phaseUse",
usable: 1,
filterCard: { name: "sha" },
position: "h",
discard: false,
delay: false,
lose: false,
filter: (event, player) =>
2024-04-15 18:31:36 +00:00
game.hasPlayer((current) => lib.skill.dddjijian.filterTarget(null, player, current)),
filterTarget: (card, player, target) => target != player && target.hasSex("male"),
2024-04-15 18:10:02 +00:00
content() {
"step 0";
2023-11-12 08:16:18 +00:00
player.showCards(cards);
2024-04-15 18:10:02 +00:00
player.give(cards, target);
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
var cards = target.getCards("h");
if (!cards.length) event.finish();
2024-04-15 18:31:36 +00:00
else if (cards.length == 1) event._result = { bool: true, cards: cards };
2024-04-15 18:10:02 +00:00
else
target
.chooseCard(
"h",
true,
[1, 2],
"请展示一至两张颜色相同的【杀】或普通锦囊牌",
(card, player) => {
var color = get.color(card);
for (var cardx of ui.selected.cards) {
2024-04-15 18:31:36 +00:00
if (get.color(cardx) != color) return false;
2024-04-15 18:10:02 +00:00
}
2024-04-15 18:31:36 +00:00
return get.name(card) == "sha" || get.type(card) == "trick";
2024-04-15 18:10:02 +00:00
}
)
.set("complexCard", true)
.set("ai", function (card) {
var player = _status.event.player,
source = _status.event.getParent().player;
2024-04-15 18:31:36 +00:00
if (get.attitude(source, player) <= 0) return -get.value(card);
2024-04-15 18:10:02 +00:00
var name = get.name(card),
color = get.color(card);
if (
name == "sha" ||
player.getUseValue(card) <= 0 ||
player.hasCard((card2) => {
return (
card2 != card &&
2024-04-15 18:31:36 +00:00
!ui.selected.cards.includes(card2) &&
2024-04-15 18:10:02 +00:00
get.name(card2) == name
);
})
) {
2024-04-15 18:31:36 +00:00
if (!ui.selected.cards.length && color == "black")
2024-04-15 18:10:02 +00:00
return 1 + Math.random();
return Math.random();
}
2024-04-15 18:31:36 +00:00
if (!ui.selected.cards.length || get.color(ui.selected.cards[0] == "red")) {
2024-04-15 18:10:02 +00:00
if (color == "black")
2024-04-15 18:31:36 +00:00
return 0.2 - player.getUseValue(card) / 100 + Math.random();
2024-04-15 18:10:02 +00:00
}
return 0.1 - player.getUseValue(card) / 100;
});
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var cards = result.cards;
event.cards = cards;
target.showCards(
cards,
2024-04-15 18:31:36 +00:00
get.translation(player) + "对" + get.translation(target) + "发动了【赍剑】"
2024-04-15 18:10:02 +00:00
);
event.usedName = [];
2024-04-15 18:31:36 +00:00
event.targets = [player, target].sortBySeat(_status.currentPhase || player);
2024-04-15 18:10:02 +00:00
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
var current = event.targets.shift();
if (!current.isIn()) {
2023-11-12 08:16:18 +00:00
event.goto(5);
return;
}
2024-04-15 18:10:02 +00:00
event.current = current;
var list = event.cards
.filter((card) => {
return (
!event.usedName.includes(get.name(card)) &&
current.hasUseTarget({
name: get.name(card),
nature: get.nature(card),
})
);
})
.map((card) => {
2024-04-15 18:31:36 +00:00
return [get.type(card), "", get.name(card), get.nature(card)];
2023-11-12 08:16:18 +00:00
});
2024-04-15 18:10:02 +00:00
if (!list.length) event.finish();
else
current
2024-04-15 18:31:36 +00:00
.chooseButton(["赍剑:视为使用一张牌", [list, "vcard"]], true)
2024-04-15 18:10:02 +00:00
.set("ai", function (button) {
2024-04-15 18:31:36 +00:00
return get.player().getUseValue({
name: button.link[2],
nature: button.link[3],
});
2024-04-15 18:10:02 +00:00
});
2024-04-15 18:31:36 +00:00
"step 4";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var name = result.links[0][2];
2023-11-12 08:16:18 +00:00
event.usedName.add(name);
2024-04-15 18:10:02 +00:00
event.current.chooseUseTarget(
{
name: name,
nature: result.links[0][3],
isCard: true,
},
true,
false
);
}
2024-04-15 18:31:36 +00:00
"step 5";
2024-04-15 18:10:02 +00:00
if (event.targets.length) event.goto(3);
},
ai: {
order: 4,
result: {
player(player, target) {
if (
get.attitude(player, target) > 0 &&
2024-04-15 18:31:36 +00:00
player.hasCard((card) => get.name(card) == "sha", "h")
2024-04-15 18:10:02 +00:00
)
return target.countCards("h");
return 0.1 / target.countCards("h");
2023-11-12 08:16:18 +00:00
},
},
},
},
2024-04-15 18:10:02 +00:00
dddjijian_old: {
enable: "phaseUse",
usable: 1,
filter: (event, player) =>
2024-04-15 18:31:36 +00:00
game.hasPlayer((current) => lib.skill.dddjijian_old.filterTarget(null, player, current)),
2024-04-15 18:10:02 +00:00
filterTarget: (card, player, target) =>
2024-04-15 18:31:36 +00:00
target != player && target.hasSex("male") && target.countCards("h") > 0,
2024-04-15 18:10:02 +00:00
content() {
"step 0";
2024-04-15 18:31:36 +00:00
target.chooseCard("h", true, [1, 2], "请展示一至两张手牌").set("ai", function (card) {
var player = _status.event.player,
source = _status.event.getParent().player;
if (get.attitude(source, player) <= 0) return -get.value(card);
var name = get.name(card),
color = get.color(card);
if (
name == "sha" ||
player.getUseValue(card) <= 0 ||
player.hasCard((card2) => {
return (
card2 != card &&
!ui.selected.cards.includes(card2) &&
get.name(card2) == name
);
})
) {
if (!ui.selected.cards.length && color == "black") return 1 + Math.random();
return Math.random();
}
if (!ui.selected.cards.length || get.color(ui.selected.cards[0] == "red")) {
if (color == "black") return 0.2 - player.getUseValue(card) / 100 + Math.random();
}
return 0.1 - player.getUseValue(card) / 100;
});
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var cards = result.cards;
event.cards = cards;
target.showCards(
cards,
2024-04-15 18:31:36 +00:00
get.translation(player) + "对" + get.translation(target) + "发动了【赍剑】"
2024-04-15 18:10:02 +00:00
);
if (
!player.hasCard((card) => {
if (_status.connectMode) return true;
return get.name(card, player) == "sha";
}, "h")
)
event.finish();
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
var colors = [];
for (var card of cards) colors.add(get.color(card, target));
colors.sort();
var str = "若你给出的【杀】为";
for (var i = 0; i < colors.length; i++) {
str += get.translation(colors[i]);
if (i < colors.length - 1) str += "或";
}
str += ",则其获得后续增益效果";
player
.chooseCard(
"h",
(card, player) => get.name(card, player) == "sha",
2024-04-15 18:31:36 +00:00
"是否交给" + get.translation(target) + "一张【杀】?",
2024-04-15 18:10:02 +00:00
str
)
.set("colors", colors)
.set("ai", function (card) {
var player = _status.event.player,
target = _status.event.getParent().target;
if (get.attitude(player, target) < 0) return false;
2024-04-15 18:31:36 +00:00
if (!_status.event.colors.includes(get.color(card, player))) return 0;
2024-04-15 18:10:02 +00:00
if (game.hasNature(card)) return 1.2;
return 1;
});
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
if (result.bool) {
player.give(result.cards, target, "giveAuto");
var num = 0,
color = get.color(result.cards[0], player);
for (var card of cards) {
if (get.color(card, target) == color) num++;
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
if (!num) event.finish();
else event.num = num;
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 4";
2024-04-15 18:10:02 +00:00
var cards = target.getCards("h");
cards.removeArray(event.cards);
var names = [];
for (var card of cards) {
var name = get.name(card, target),
type = get.type(card);
if (type != "basic" && type != "trick") continue;
if (name == "sha") {
var natures = get.natureList(card, target);
for (var nature of natures) {
2024-04-15 18:31:36 +00:00
if (nature && lib.nature.has(nature)) name += "|" + nature;
2024-04-15 18:10:02 +00:00
}
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
names.push(name);
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
if (!names.length) event.finish();
else event.names = names;
2024-04-15 18:31:36 +00:00
"step 5";
2023-07-27 09:56:09 +00:00
event.num--;
2024-04-15 18:10:02 +00:00
target
.chooseButton([
"是否视为使用一张牌?",
[
event.names.map((name) => {
if (name.indexOf("sha|") == 0) {
2024-04-15 18:31:36 +00:00
return ["基本", "", "sha", name.slice(4).split("|")];
2024-04-15 18:10:02 +00:00
}
return [get.type(name), "", name];
}),
"vcard",
],
])
.set("filterButton", function (button) {
var card = {
name: button.link[2],
nature: button.link[3],
isCard: true,
},
player = _status.event.player;
return player.hasUseTarget(card);
})
.set("ai", function (button) {
var card = {
name: button.link[2],
nature: button.link[3],
isCard: true,
},
player = _status.event.player;
return player.getUseValue(card);
});
2024-04-15 18:31:36 +00:00
"step 6";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var card = {
name: result.links[0][2],
nature: result.links[0][3],
isCard: true,
};
target.chooseUseTarget(card, true, false);
if (event.num > 0) {
var name = card.name;
if (name == "sha") {
var natures = get.natureList(card, target);
for (var nature of natures) {
2024-04-15 18:31:36 +00:00
if (nature && lib.nature.has(nature)) name += "|" + nature;
}
}
2023-07-27 09:56:09 +00:00
event.names.remove(name);
2024-04-15 18:10:02 +00:00
if (event.names.length > 0) event.goto(5);
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
} else event.finish();
},
ai: {
order: 4,
result: {
player(player, target) {
if (
get.attitude(player, target) > 0 &&
2024-04-15 18:31:36 +00:00
player.hasCard((card) => get.name(card) == "sha", "h")
2024-04-15 18:10:02 +00:00
)
return target.countCards("h");
return 0.1 / target.countCards("h");
2023-07-27 09:56:09 +00:00
},
},
},
},
2024-04-15 18:10:02 +00:00
dddzhengjun: {
trigger: {
global: [
"damageEnd",
"loseHpEnd",
"recoverEnd",
"loseAfter",
"equipAfter",
"addJudgeAfter",
"gainAfter",
"loseAsyncAfter",
"addToExpansionAfter",
],
},
filter(event, player) {
if (!player.isPhaseUsing()) return false;
2024-04-15 18:31:36 +00:00
if (event.name == "damage" || event.name == "loseHp" || event.name == "recover") {
2024-04-15 18:10:02 +00:00
if (player.hasSkill("dddzhengjun_hp")) return false;
return event.player.getHp() == player.getHp();
}
const info = get.info("dddzhengjun");
const hs_check = info.hs_check,
es_check = info.es_check;
return game.hasPlayer((target) => {
if (
event.getg &&
event.getg(target) &&
event.getg(target).length &&
hs_check(player, target)
)
return true;
const evt = event.getl(target);
2024-04-15 18:31:36 +00:00
if (evt && evt.hs && evt.hs.length && hs_check(player, target)) return true;
2024-04-15 18:10:02 +00:00
if (
event.name == "equip" &&
event.player == target &&
(!evt || evt.cards.length != 1) &&
es_check(player, target)
)
return true;
2024-04-15 18:31:36 +00:00
return evt && evt.es && evt.es.length && es_check(player, target);
2023-07-27 09:56:09 +00:00
});
},
2024-04-15 18:10:02 +00:00
hs_check(player, target) {
return (
2024-04-15 18:31:36 +00:00
!player.hasSkill("dddzhengjun_hs") && target.countCards("h") == player.countCards("h")
2024-04-15 18:10:02 +00:00
);
},
es_check(player, target) {
return (
2024-04-15 18:31:36 +00:00
!player.hasSkill("dddzhengjun_es") && target.countCards("e") == player.countCards("e")
2024-04-15 18:10:02 +00:00
);
},
async cost(event, trigger, player) {
2024-04-15 18:31:36 +00:00
if (trigger.name == "damage" || trigger.name == "loseHp" || trigger.name == "recover") {
2024-04-15 18:10:02 +00:00
let list = ["失去体力", "cancel2"];
2024-04-15 18:31:36 +00:00
if (trigger.player.isDamaged()) list.unshift("回复体力");
2024-04-15 18:10:02 +00:00
const {
result: { control },
} = await player
.chooseControl(list)
2024-04-15 18:31:36 +00:00
.set("prompt", get.prompt("dddzhengjun", trigger.player))
.set("prompt2", "令" + get.translation(event.player) + "执行其中一项")
2024-04-15 18:10:02 +00:00
.set("ai", () => {
const player = get.event("player"),
target = get.event().getTrigger().player;
if (
2024-04-15 18:31:36 +00:00
get.event("controls").includes("回复体力") &&
get.recoverEffect(target, player, player) > 0
2024-04-15 18:10:02 +00:00
)
return "回复体力";
2024-04-15 18:31:36 +00:00
return get.effect(target, { name: "losehp" }, player, player) > 0
2024-04-15 18:10:02 +00:00
? "失去体力"
: "cancel2";
});
event.result = {
bool: control != "cancel2",
targets: [trigger.player],
cost_data: control,
};
2024-04-15 18:10:02 +00:00
} else {
let map = {};
const hs_targets = game.filterPlayer((target) => {
2024-04-15 18:31:36 +00:00
if (!get.info("dddzhengjun").hs_check(player, target)) return false;
if (trigger.getg && trigger.getg(target) && trigger.getg(target).length)
2024-04-15 18:10:02 +00:00
return true;
const evt = trigger.getl(target);
return evt && evt.hs && evt.hs.length;
2023-11-12 08:16:18 +00:00
});
2024-04-15 18:10:02 +00:00
const es_targets = game.filterPlayer((target) => {
2024-04-15 18:31:36 +00:00
if (!get.info("dddzhengjun").es_check(player, target)) return false;
2024-04-15 18:10:02 +00:00
const evt = trigger.getl(target);
if (
trigger.name == "equip" &&
trigger.player == target &&
(!evt || evt.cards.length != 1)
)
return true;
return evt && evt.es && evt.es.length;
});
2024-04-15 18:10:02 +00:00
if (hs_targets.length) {
let target;
2024-04-15 18:10:02 +00:00
if (hs_targets.length == 1) target = hs_targets[0];
else {
let targets = await player
.chooseTarget(
get.prompt("dddzhengjun"),
"令其中一名角色摸一张牌或弃置一张牌",
(card, player, target) => {
2024-04-15 18:31:36 +00:00
return get.event("targets").includes(target);
2024-04-15 18:10:02 +00:00
}
)
.set("ai", (target) => {
const player = get.event("player");
return Math.max(
2024-04-15 18:31:36 +00:00
get.effect(target, { name: "guohe_copy2" }, target, player),
get.effect(target, { name: "draw" }, player, player)
2024-04-15 18:10:02 +00:00
);
})
.set("targets", hs_targets)
.forResultTargets();
2024-04-15 18:31:36 +00:00
if (targets && targets.length) target = targets[0];
}
2024-04-15 18:10:02 +00:00
if (target) {
let list = ["摸牌"];
if (target.countCards("h")) list.push("弃牌");
const {
result: { control },
} = await player
.chooseControl(list, "cancel2")
2024-04-15 18:31:36 +00:00
.set("prompt", get.prompt("dddzhengjun", target))
.set("prompt2", "令" + get.translation(target) + "执行其中一项")
2024-04-15 18:10:02 +00:00
.set("ai", () => {
const player = get.event("player"),
2024-04-15 18:31:36 +00:00
target = get.event().getTrigger().player;
2024-04-15 18:10:02 +00:00
if (
2024-04-15 18:31:36 +00:00
get.event("controls").includes("弃牌") &&
get.effect(target, { name: "guohe_copy2" }, player, player) > 0
2024-04-15 18:10:02 +00:00
)
return "弃牌";
2024-04-15 18:31:36 +00:00
return get.effect(target, { name: "draw" }, player, player) > 0
2024-04-15 18:10:02 +00:00
? "摸牌"
: "cancel2";
});
if (control != "cancel2") {
map.hs_target = [target, control];
}
}
2023-11-12 08:16:18 +00:00
}
2024-04-15 18:10:02 +00:00
if (es_targets.length) {
let target;
2024-04-15 18:10:02 +00:00
if (hs_targets.length == 1) {
const {
result: { bool },
} = await player
.chooseBool()
2024-04-15 18:31:36 +00:00
.set("prompt", get.prompt("dddzhengjun", hs_targets[0]))
.set("prompt2", "移动" + get.translation(hs_targets[0]) + "的一张装备牌")
.set("choice", () => player.canMoveCard(true, true, hs_targets[0]));
2024-04-15 18:10:02 +00:00
if (bool) target = hs_targets[0];
} else {
let targets = await player
.chooseTarget(
get.prompt("dddzhengjun"),
"移动其中一名角色的一张装备牌",
(card, player, target) => {
2024-04-15 18:31:36 +00:00
return get.event("targets").includes(target);
2024-04-15 18:10:02 +00:00
}
)
.set("ai", (target) => {
const player = get.event("player");
2024-04-15 18:31:36 +00:00
return player.canMoveCard(true, true, target) ? 1 + Math.random() : 0;
2024-04-15 18:10:02 +00:00
})
.set("targets", es_targets)
.forResultTargets();
2024-04-15 18:31:36 +00:00
if (targets && targets.length) target = targets[0];
}
2024-04-15 18:10:02 +00:00
if (target) {
map.es_target = target;
}
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
event.result = {
bool: map.hs_target || map.es_target,
2024-04-15 18:31:36 +00:00
targets: [(map.hs_target || [])[0]].concat(map.es_target ? [map.es_target] : []),
2024-04-15 18:10:02 +00:00
cost_data: map,
};
2023-07-27 09:56:09 +00:00
}
},
2024-04-15 18:10:02 +00:00
async content(event, trigger, player) {
const data = event.cost_data;
2024-04-15 18:31:36 +00:00
if (trigger.name == "damage" || trigger.name == "loseHp" || trigger.name == "recover") {
2024-04-15 18:10:02 +00:00
player.addTempSkill("dddzhengjun_hp", "phaseUseAfter");
2024-04-15 18:31:36 +00:00
await trigger.player[data == "回复体力" ? "recover" : "loseHp"]();
2024-04-15 18:10:02 +00:00
} else {
if (data.hs_target) {
2024-04-15 18:31:36 +00:00
player.addTempSkill("dddzhengjun_hs", "phaseUseAfter");
if (data.hs_target[1] == "摸牌") await data.hs_target[0].draw();
else await data.hs_target[0].chooseToDiscard("he", true);
}
2024-04-15 18:10:02 +00:00
if (data.es_target) {
2024-04-15 18:31:36 +00:00
player.addTempSkill("dddzhengjun_es", "phaseUseAfter");
2024-04-15 18:10:02 +00:00
await player.moveCard(true, data.es_target);
2023-07-27 09:56:09 +00:00
}
}
},
2024-04-15 18:10:02 +00:00
subSkill: {
hs: { charlotte: true },
es: { charlotte: true },
hp: { charlotte: true },
2023-07-27 09:56:09 +00:00
},
},
2024-04-15 18:10:02 +00:00
dddxianxi: {
trigger: {
player: "useCard2",
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
direct: true,
filter(event, player) {
2024-04-15 18:31:36 +00:00
if (event.card.name != "sha" || !player.isPhaseUsing()) return false;
2024-04-15 18:10:02 +00:00
return game.hasPlayer(function (current) {
return (
!event.targets.includes(current) &&
2024-04-15 18:31:36 +00:00
lib.filter.targetEnabled2(event.card, player, current)
2024-04-15 18:10:02 +00:00
);
2023-07-27 09:56:09 +00:00
});
2024-04-15 18:10:02 +00:00
},
content() {
"step 0";
player
.chooseTarget(
get.prompt("dddxianxi"),
2024-04-15 18:31:36 +00:00
"为" + get.translation(trigger.card) + "增加任意个目标",
2024-04-15 18:10:02 +00:00
function (card, player, target) {
var event = _status.event.getTrigger();
return (
!event.targets.includes(target) &&
2024-04-15 18:31:36 +00:00
lib.filter.targetEnabled2(event.card, player, target)
2024-04-15 18:10:02 +00:00
);
},
[1, Infinity]
)
.set("ai", function (target) {
var evt = _status.event.getTrigger();
2024-04-15 18:31:36 +00:00
if (get.damageEffect(target, evt.player, evt.player) < 0) return 0;
return get.effect(target, evt.card, evt.player, evt.player);
2024-04-15 18:10:02 +00:00
});
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var targets = result.targets.sortBySeat();
event.targets = targets;
if (!event.isMine() && !event.isOnline()) game.delayx();
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
player.logSkill("dddxianxi", targets);
2023-07-27 09:56:09 +00:00
trigger.targets.addArray(targets);
2024-04-15 18:10:02 +00:00
if (!trigger._dddxianxi_map) trigger._dddxianxi_map = {};
trigger._dddxianxi_map[player.playerid] = targets.slice(0);
player.addTempSkill("dddxianxi_delay");
},
subSkill: {
delay: {
charlotte: true,
trigger: {
player: "useCardAfter",
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
forced: true,
filter(event, player) {
2024-04-15 18:31:36 +00:00
if (!event._dddxianxi_map || !event._dddxianxi_map[player.playerid]) return false;
for (var target of event._dddxianxi_map[player.playerid]) {
2024-04-15 18:10:02 +00:00
if (
2024-04-15 18:31:36 +00:00
!target.hasHistory("damage", function (evt) {
return evt.card == event.card;
})
2024-04-15 18:10:02 +00:00
)
return true;
2023-07-27 09:56:09 +00:00
}
return false;
},
2024-04-15 18:10:02 +00:00
content() {
"step 0";
2024-04-15 18:31:36 +00:00
var targets = trigger._dddxianxi_map[player.playerid]
2024-04-15 18:10:02 +00:00
.filter(function (target) {
2024-04-15 18:31:36 +00:00
return !target.hasHistory("damage", function (evt) {
return evt.card == trigger.card;
});
2024-04-15 18:10:02 +00:00
})
.sortBySeat();
event.targets = targets;
var num = targets.length;
player
.chooseToDiscard(
"he",
num,
2024-04-15 18:31:36 +00:00
"险袭:选择弃置" + get.cnNumber(num) + "张牌",
2024-04-15 18:10:02 +00:00
"然后对" +
get.translation(targets) +
"各造成1点伤害。或点击「取消」改为摸" +
get.cnNumber(num) +
"张牌并失去1点体力"
)
.set("ai", function (card) {
return 7 - get.value(card);
2023-07-27 09:56:09 +00:00
});
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
for (var i of targets) {
2023-07-27 09:56:09 +00:00
player.line(i);
i.damage();
}
2024-04-15 18:10:02 +00:00
} else {
2023-07-27 09:56:09 +00:00
player.draw(targets.length);
player.loseHp();
}
},
2024-04-15 18:10:02 +00:00
sub: true,
2023-07-27 09:56:09 +00:00
},
},
},
2024-04-15 18:10:02 +00:00
dddlingyong: {
trigger: {
global: [
"phaseZhunbeiSkipped",
"phaseZhunbeiCancelled",
"phaseDrawSkipped",
"phaseDrawCancelled",
"phaseJudgeSkipped",
"phaseJudgeCancelled",
"phaseUseSkipped",
"phaseUseCancelled",
"phaseDiscardSkipped",
"phaseDiscardCancelled",
"phaseJieshuSkipped",
"phaseJieshuCancelled",
],
},
frequent: true,
content() {
"step 0";
player
.judge(function (card) {
var name = get.name(card, false);
if (name == "sha") return -2;
return 2;
})
.set("callback", function () {
if (event.judgeResult.name != "sha") {
var card = event.judgeResult.card;
2024-04-15 18:31:36 +00:00
if (get.position(card, true) == "o") player.chooseUseTarget(card);
2024-04-15 18:10:02 +00:00
}
}).judge2 = function (result) {
2023-07-27 09:56:09 +00:00
return result.bool;
};
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
2024-04-15 18:31:36 +00:00
player.chooseBool("是否继续进行【灵涌】判定?").set("frequentSkill", "dddlingyong");
2024-04-15 18:10:02 +00:00
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (result.bool) event.goto(0);
2023-07-27 09:56:09 +00:00
},
},
2024-04-15 18:10:02 +00:00
dddxuxiao: {
trigger: {
global: ["loseAfter", "loseAsyncAfter"],
},
direct: true,
filter(event, player) {
if (event.type != "discard") return false;
var cards = event.getd();
for (var i of cards) {
if (
get.position(i, true) == "d" &&
get.color(i, false) == "black" &&
get.type(i, null, true) == "basic"
) {
2024-04-15 18:31:36 +00:00
var card = get.autoViewAs({ name: "bingliang" }, [i]);
2024-04-15 18:10:02 +00:00
if (
game.hasPlayer(function (current) {
return current.canAddJudge(card);
})
)
return true;
2023-07-27 09:56:09 +00:00
}
}
return false;
},
2024-04-15 18:10:02 +00:00
content() {
"step 0";
if (!event.cards) event.cards = [];
var cards = trigger.getd().filter(function (i) {
if (
!event.cards.includes(i) &&
get.position(i, true) == "d" &&
get.color(i, false) == "black" &&
get.type(i, null, true) == "basic"
) {
2024-04-15 18:31:36 +00:00
var card = get.autoViewAs({ name: "bingliang" }, [i]);
2024-04-15 18:10:02 +00:00
if (
game.hasPlayer(function (current) {
return current.canAddJudge(card);
})
)
return true;
2023-07-27 09:56:09 +00:00
}
return false;
});
2024-04-15 18:10:02 +00:00
if (cards.length) {
player.chooseButton([get.prompt("dddxuxiao"), cards]);
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var card = result.links[0];
2023-07-27 09:56:09 +00:00
event.cards.push(card);
2024-04-15 18:10:02 +00:00
event.card = card;
player
.chooseTarget(
true,
"请选择【兵粮寸断】的目标",
2024-04-15 18:31:36 +00:00
"将" + get.translation(card) + "置于一名角色的判定区内,然后其摸两张牌",
2024-04-15 18:10:02 +00:00
function (card, player, target) {
2024-04-15 18:31:36 +00:00
var card = get.autoViewAs({ name: "bingliang" }, [_status.event.card]);
2024-04-15 18:10:02 +00:00
return target.canAddJudge(card);
}
)
.set("card", card)
.set("ai", function (target) {
2024-04-15 18:31:36 +00:00
var card = get.autoViewAs({ name: "bingliang" }, [_status.event.card]),
2024-04-15 18:10:02 +00:00
player = _status.event.player;
return (
get.attitude(player, target) +
2024-04-15 18:31:36 +00:00
Math.max(0, get.effect(target, card, player, player))
2024-04-15 18:10:02 +00:00
);
});
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var target = result.targets[0];
player.logSkill("dddxuxiao", target);
target.addJudge({ name: "bingliang" }, [card]);
2023-07-27 09:56:09 +00:00
target.draw(2);
event.goto(0);
}
},
},
2024-04-15 18:10:02 +00:00
dddxuyu: {
trigger: {
player: "useCardAfter",
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
content() {
2023-11-12 08:16:18 +00:00
player.draw();
2024-04-15 18:10:02 +00:00
player
.when({ player: "useCardAfter", global: "phaseAfter" })
.filter((evt) => evt != trigger)
.then(() => {
2024-04-15 18:31:36 +00:00
if (trigger.name == "useCard") player.chooseToDiscard("he", true);
2024-04-15 18:10:02 +00:00
});
2023-11-12 08:16:18 +00:00
},
},
2024-04-15 18:10:02 +00:00
dddshijian: {
trigger: {
global: "useCardAfter",
},
filter(event, player) {
if (player == event.player) return false;
const evt = event.getParent("phaseUse");
if (!evt || evt.player != event.player) return false;
return (
event.player.getHistory(
"useCard",
(evtx) => {
return evtx.getParent("phaseUse") == evt;
},
event
).length == 2
);
},
direct: true,
*content(event, map) {
const player = map.player,
trigger = map.trigger,
target = trigger.player;
let result = yield player
.chooseCard(
"he",
get.prompt("dddshijian", target),
`交给${get.translation(
target
)}一张牌然后其本回合使用下一张牌指定目标时你令此牌额外结算一次或摸一张牌`
)
.set("ai", (card) => {
if (get.event("goon")) return 6 - get.value(card);
return 0;
})
.set(
"goon",
get.attitude(player, target) > 0 &&
2024-04-15 18:31:36 +00:00
target.hasCard((card) => target.hasValueTarget(card))
2024-04-15 18:10:02 +00:00
);
if (!result.bool) return event.finish();
player.logSkill("dddshijian", target);
player.give(result.cards, target);
player.addTempSkill("dddshijian_extra");
player.markAuto("dddshijian_extra", target);
},
subSkill: {
extra: {
trigger: { global: "useCardToPlayer" },
filter(event, player) {
if (!event.isFirstTarget) return false;
2024-04-15 18:31:36 +00:00
return player.getStorage("dddshijian_extra").includes(event.player);
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
charlotte: true,
forced: true,
onremove: true,
*content(event, map) {
const player = map.player,
trigger = map.trigger,
target = trigger.player;
if (trigger.targets && trigger.targets.length) {
let result = yield player
.chooseControl(["额外结算", "摸一张牌"])
.set("prompt", "实荐:请选择一项")
.set(
"prompt2",
2024-04-15 18:31:36 +00:00
`${get.translation(trigger.card)}额外结算一次,或摸一张牌`
2024-04-15 18:10:02 +00:00
)
.set("ai", () => {
return get.event("choice");
})
.set(
"choice",
(function () {
if (
2024-04-15 18:31:36 +00:00
trigger.card.name === "tiesuo" ||
!["basic", "trick"].includes(get.type(trigger.card))
2024-04-15 18:10:02 +00:00
)
return 1;
if (
2024-04-15 18:31:36 +00:00
trigger.targets.reduce((p, c) => {
return (
p +
get.effect(
c,
trigger.card,
target,
_status.event.player
)
);
}, 0) >=
2024-04-15 18:10:02 +00:00
get.effect(
player,
{ name: "draw" },
player,
_status.event.player
)
)
return 0;
return 1;
})()
);
if (result.index == 0) {
2023-11-12 08:16:18 +00:00
trigger.getParent().effectCount++;
2024-04-15 18:31:36 +00:00
game.log(player, "令", trigger.card, "额外结算一次");
2024-04-15 18:10:02 +00:00
} else player.draw();
} else player.draw();
player.removeSkill("dddshijian_extra");
},
},
2023-11-12 08:16:18 +00:00
},
},
2024-04-15 18:10:02 +00:00
dddxuyu_old: {
trigger: {
player: "useCardAfter",
},
filter(event, player) {
var evt = event.getParent("phaseUse");
if (!evt || evt.player != player) return false;
return (
player.getHistory(
"useCard",
function (evtx) {
return evtx.getParent("phaseUse") == evt;
},
event
).length == 1
);
},
content() {
2023-07-27 09:56:09 +00:00
player.draw(2);
2024-04-15 18:10:02 +00:00
player.addTempSkill("dddxuyu_old_discard", "phaseUseAfter");
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
subSkill: {
discard: {
trigger: {
player: "useCardAfter",
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
filter(event, player) {
if (!player.countCards("he")) return false;
var evt = event.getParent("phaseUse");
if (!evt || evt.player != player) return false;
return (
player.getHistory(
"useCard",
function (evtx) {
2024-04-15 18:31:36 +00:00
return evtx.getParent("phaseUse") == evt;
2024-04-15 18:10:02 +00:00
},
event
).length == 3
);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
forced: true,
charlotte: true,
content() {
player.chooseToDiscard("he", true);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
sub: true,
2023-07-27 09:56:09 +00:00
},
},
},
2024-04-15 18:10:02 +00:00
dddshijian_old: {
trigger: {
global: "useCardAfter",
},
filter(event, player) {
if (player == event.player) return false;
var evt = event.getParent("phaseUse");
if (!evt || evt.player != event.player) return false;
return (
event.player.getHistory(
"useCard",
function (evtx) {
return evtx.getParent("phaseUse") == evt;
},
event
).length == 3
);
},
logTarget: "player",
check(event, player) {
return get.attitude(player, event.player) > 0;
},
content() {
2023-07-27 09:56:09 +00:00
trigger.player.draw();
2024-04-15 18:10:02 +00:00
player.addTempSkill("dddshijian_old_draw", "phaseUseAfter");
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
subSkill: {
draw: {
trigger: {
global: "useCardAfter",
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
filter(event, player) {
if (!event.player.countCards("he")) return false;
var evt = event.getParent("phaseUse");
2024-04-15 18:31:36 +00:00
if (!evt || evt.player != event.player) return false;
2024-04-15 18:10:02 +00:00
return (
event.player.getHistory(
"useCard",
function (evtx) {
2024-04-15 18:31:36 +00:00
return evtx.getParent("phaseUse") == evt;
2024-04-15 18:10:02 +00:00
},
event
).length == 4
);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
forced: true,
charlotte: true,
content() {
2023-07-27 09:56:09 +00:00
player.draw(2);
},
2024-04-15 18:10:02 +00:00
sub: true,
2023-07-27 09:56:09 +00:00
},
},
},
2024-04-15 18:10:02 +00:00
dddtaisi: {
trigger: {
global: "phaseEnd",
},
direct: true,
filter(event, player) {
2024-04-15 18:31:36 +00:00
if (!game.getGlobalHistory("changeHp").some((evt) => evt.player == player)) return false;
return game.getGlobalHistory("cardMove").some(function (evt) {
if (evt.name != "cardsDiscard") {
if (evt.name != "lose" || evt.position != ui.discardPile) return false;
}
return evt.cards.some((card) => get.position(card, true) == "d");
});
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
content() {
"step 0";
player
.chooseTarget(
get.prompt("dddtaisi"),
"你可以令一名角色获得一张于本回合内进入弃牌堆的牌。若该角色于本回合内对你造成过伤害,则你摸两张牌。"
)
.set("ai", function (target) {
var player = _status.event.player,
att = get.attitude(player, target);
2024-04-15 18:31:36 +00:00
if (player.hasHistory("damage", (evt) => evt.source == target)) return 10 + att;
2024-04-15 18:10:02 +00:00
return att;
});
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var target = result.targets[0];
player.logSkill("dddtaisi", target);
event.target = target;
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
var cards = [];
game.getGlobalHistory("cardMove", function (evt) {
if (evt.name != "cardsDiscard") {
2024-04-15 18:31:36 +00:00
if (evt.name != "lose" || evt.position != ui.discardPile) return false;
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:31:36 +00:00
cards.addArray(evt.cards.filter((card) => get.position(card, true) == "d"));
2023-07-27 09:56:09 +00:00
});
2024-04-15 18:10:02 +00:00
if (!cards.length) event.finish();
2024-04-15 18:31:36 +00:00
else if (cards.length == 1) event._result = { bool: true, links: cards };
2024-04-15 18:10:02 +00:00
else
player
2024-04-15 18:31:36 +00:00
.chooseButton(["令" + get.translation(target) + "获得一张牌", cards], true)
2024-04-15 18:10:02 +00:00
.set("ai", function (button) {
var player = _status.event.player,
target = _status.event.getParent().target;
var att = get.attitude(player, target) - 0.1;
2024-04-15 18:31:36 +00:00
return get.sgn(att) * get.value(button.link, target);
2024-04-15 18:10:02 +00:00
});
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
if (result.bool) {
target.gain(result.links, "gain2");
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 4";
if (player.hasHistory("damage", (evt) => evt.source == target)) player.draw(2);
2023-07-27 09:56:09 +00:00
},
},
2024-04-15 18:10:02 +00:00
dddquche: {
enable: "phaseUse",
limited: true,
skillAnimation: true,
animationColor: "thunder",
filter(event, player) {
return player.hasCard({ color: "red" }, "he");
},
filterCard: {
color: "red",
},
filterTarget(card, player, target) {
return player != target;
},
discard: false,
delay: false,
lose: false,
content() {
"step 0";
event.count = 1;
player.awakenSkill("dddquche");
player.addTempSkill("dddquche_effect");
player.addMark("dddquche_effect", 1, false);
player.give(cards, target);
2023-07-27 09:56:09 +00:00
event.goto(3);
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (
player.hasCard(function (card) {
2024-04-15 18:31:36 +00:00
if (_status.connectMode && get.position(card) == "h") return true;
2024-04-15 18:10:02 +00:00
return get.color(card) == "red";
}, "he")
) {
2023-07-27 09:56:09 +00:00
player.chooseCardTarget({
2024-04-15 18:10:02 +00:00
prompt: "是否将一张红色牌交给一名其他角色?",
filterCard: { color: "red" },
filterTarget: lib.filter.notMe,
position: "he",
2023-07-27 09:56:09 +00:00
});
2024-04-15 18:10:02 +00:00
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (result.bool) {
player.addMark("dddquche_effect", 1, false);
player.give(result.cards, result.targets[0]);
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
if (
player.hasCard(function (card) {
2024-04-15 18:31:36 +00:00
if (_status.connectMode && get.position(card) == "h") return true;
2024-04-15 18:10:02 +00:00
return get.color(card) == "black";
}, "hes")
) {
2023-07-27 09:56:09 +00:00
player.chooseCardTarget({
2024-04-15 18:10:02 +00:00
prompt: "是否将一张黑色牌当做【杀】使用?",
position: "he",
filterCard(card, player) {
if (get.color(card) != "black") return false;
2024-04-15 18:31:36 +00:00
var card = get.autoViewAs({ name: "sha" }, [card]);
2024-04-15 18:10:02 +00:00
return lib.filter.cardEnabled(card, player);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
selectTarget() {
2024-04-15 18:31:36 +00:00
var card = get.autoViewAs({ name: "sha" }, ui.selected.cards);
return lib.filter.selectTarget(card, _status.event.player);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
filterTarget(card, player, target) {
2024-04-15 18:31:36 +00:00
var card = get.autoViewAs({ name: "sha" }, ui.selected.cards);
2024-04-15 18:10:02 +00:00
return (
2024-04-15 18:31:36 +00:00
lib.filter.targetEnabled(card, player, target) &&
lib.filter.targetInRange(card, player, target)
2024-04-15 18:10:02 +00:00
);
2023-07-27 09:56:09 +00:00
},
});
2024-04-15 18:10:02 +00:00
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 4";
2024-04-15 18:10:02 +00:00
if (result.bool) {
player.addMark("dddquche_effect", 1, false);
2024-04-15 18:31:36 +00:00
player.useCard({ name: "sha" }, result.cards, result.targets, false);
2023-07-27 09:56:09 +00:00
event.goto(1);
2024-04-15 18:10:02 +00:00
} else event.finish();
},
subSkill: {
effect: {
charlotte: true,
onremove: true,
mod: {
globalFrom(from, to, distance) {
2024-04-15 18:31:36 +00:00
return distance - from.countMark("dddquche_effect");
2023-07-27 09:56:09 +00:00
},
},
2024-04-15 18:10:02 +00:00
intro: {
content: "至其他角色的距离-#",
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
sub: true,
2023-07-27 09:56:09 +00:00
},
},
2024-04-15 18:10:02 +00:00
mark: true,
intro: {
content: "limited",
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
init(player, skill) {
player.storage[skill] = false;
2023-07-27 09:56:09 +00:00
},
},
2024-04-15 18:10:02 +00:00
dddqianlong: {
zhuSkill: true,
trigger: {
source: "dieAfter",
},
forced: true,
filter: (event, player) => player.hasZhuSkill("dddqianlong"),
content() {
2023-07-27 09:56:09 +00:00
player.draw(3);
},
2024-04-15 18:10:02 +00:00
group: "dddqianlong_cancel",
subSkill: {
cancel: {
trigger: {
player: ["drawBefore", "discardBefore"],
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
forced: true,
popup: false,
filter(event, player) {
2024-04-15 18:31:36 +00:00
if (!player.hasZhuSkill("dddqianlong")) return false;
2024-04-15 18:10:02 +00:00
var evt = event.getParent();
2024-04-15 18:31:36 +00:00
return evt && evt.name == "die" && evt.source == player;
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
content() {
2023-07-27 09:56:09 +00:00
trigger.cancel();
},
2024-04-15 18:10:02 +00:00
sub: true,
2023-07-27 09:56:09 +00:00
},
},
},
2024-04-15 18:10:02 +00:00
ddddongcha: {
trigger: {
global: "phaseBegin",
},
logTarget: "player",
filter(event, player) {
return (
player != event.player &&
player.countCards("h") > 0 &&
event.player.countCards("h") > 0
);
},
check(event, player) {
return get.attitude(player, event.player) <= 0;
},
content() {
"step 0";
event.target = trigger.player;
player.addTempSkill("ddddongcha_effect");
2024-04-15 18:31:36 +00:00
if (player.countCards("h") > 0) player.chooseCard("h", true, "选择一张牌作为“鉴”");
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
2024-04-15 18:31:36 +00:00
player.addToExpansion(result.cards, player, "give").gaintag.add("ddddongcha_effect");
2024-04-15 18:10:02 +00:00
}
2024-04-15 18:31:36 +00:00
"step 2";
if (target.countCards("h") > 0) target.chooseCard("h", true, "选择一张牌作为“鉴”");
"step 3";
2024-04-15 18:10:02 +00:00
if (result.bool) {
2024-04-15 18:31:36 +00:00
player.addToExpansion(result.cards, target, "give").gaintag.add("ddddongcha_effect");
2024-04-15 18:10:02 +00:00
}
},
subSkill: {
effect: {
charlotte: true,
trigger: {
global: "phaseEnd",
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
forced: true,
filter(event, player) {
2024-04-15 18:31:36 +00:00
return player.getExpansions("ddddongcha_effect").length > 0;
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
content() {
"step 0";
2024-04-15 18:31:36 +00:00
var cards = player.getExpansions("ddddongcha_effect");
2024-04-15 18:10:02 +00:00
if (cards.length > 0) {
if (cards.length == 1)
event._result = {
bool: true,
links: cards,
};
2024-04-15 18:31:36 +00:00
else player.chooseButton(["选择获得一张“鉴”", cards], true);
2024-04-15 18:10:02 +00:00
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) player.gain(result.links, "gain2");
2024-04-15 18:31:36 +00:00
"step 2";
var cards = player.getExpansions("ddddongcha_effect");
2024-04-15 18:10:02 +00:00
if (cards.length > 0 && trigger.player.isIn()) {
if (cards.length == 1)
event._result = {
bool: true,
links: cards,
};
else
trigger.player
2024-04-15 18:31:36 +00:00
.chooseButton(["选择获得一张“鉴”", cards], true)
2024-04-15 18:10:02 +00:00
.set("ai", function (button) {
2024-04-15 18:31:36 +00:00
return get.value(button.link, _status.event.player);
2024-04-15 18:10:02 +00:00
});
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 3";
if (result.bool) trigger.player.gain(result.links, player, "give");
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
marktext: "鉴",
intro: {
content: "expansion",
markcount: "expansion",
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
sub: true,
2023-07-27 09:56:09 +00:00
},
},
},
2024-04-15 18:10:02 +00:00
dddzhijie: {
enable: "chooseToUse",
filter(event, player) {
if (event.type == "phase") return false;
var cards = player.getExpansions("ddddongcha_effect");
if (cards.length < 2) return false;
var shan = false,
wuxie = false;
for (var i = 0; i < cards.length; i++) {
for (var j = i + 1; j < cards.length; j++) {
2024-04-15 18:31:36 +00:00
if (get.color(cards[i], false) == get.color(cards[j], false)) shan = true;
2024-04-15 18:10:02 +00:00
else wuxie = true;
2023-07-27 09:56:09 +00:00
}
}
2024-04-15 18:31:36 +00:00
if (shan && event.filterCard(get.autoViewAs({ name: "shan" }, "unsure"), player, event))
2024-04-15 18:10:02 +00:00
return true;
2024-04-15 18:31:36 +00:00
if (wuxie && event.filterCard(get.autoViewAs({ name: "wuxie" }, "unsure"), player, event))
2024-04-15 18:10:02 +00:00
return true;
2023-07-27 09:56:09 +00:00
return false;
},
2024-04-15 18:10:02 +00:00
hiddenCard(player, name) {
if (name != "shan" && name != "wuxie") return false;
var cards = player.getExpansions("ddddongcha_effect");
if (cards.length < 2) return false;
var shan = false,
wuxie = false;
for (var i = 0; i < cards.length; i++) {
for (var j = i + 1; j < cards.length; j++) {
2024-04-15 18:31:36 +00:00
if (get.color(cards[i], false) == get.color(cards[j], false)) shan = true;
2024-04-15 18:10:02 +00:00
else wuxie = true;
2023-07-27 09:56:09 +00:00
}
}
2024-04-15 18:10:02 +00:00
if (shan && name == "shan") return true;
if (wuxie && name == "wuxie") return true;
2023-07-27 09:56:09 +00:00
return false;
},
2024-04-15 18:10:02 +00:00
chooseButton: {
dialog(event, player) {
2024-04-15 18:31:36 +00:00
return ui.create.dialog("智解", player.getExpansions("ddddongcha_effect"), "hidden");
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
select: 2,
filter(button, player) {
if (!ui.selected.buttons.length) return true;
var evt = _status.event.getParent(),
buttons = ui.selected.buttons;
return evt.filterCard(
get.autoViewAs(
{
name:
2024-04-15 18:31:36 +00:00
get.color(buttons[0].link) == get.color(button.link)
2024-04-15 18:10:02 +00:00
? "shan"
: "wuxie",
},
[button.link, buttons[0].link]
)
);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
check: () => 1,
backup(links, player) {
2023-07-27 09:56:09 +00:00
return {
2024-04-15 18:10:02 +00:00
viewAs: {
2024-04-15 18:31:36 +00:00
name: get.color(links[0]) == get.color(links[1]) ? "shan" : "wuxie",
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
cards: links,
selectCard: -1,
position: "x",
2024-04-15 18:31:36 +00:00
filterCard: (card) => lib.skill["dddzhijie_backup"].cards.includes(card),
2024-04-15 18:10:02 +00:00
popname: true,
precontent() {
player.addTempSkill("dddzhijie_draw");
},
};
2023-07-27 09:56:09 +00:00
},
},
2024-04-15 18:10:02 +00:00
ai: {
combo: "ddddongcha",
respondShan: true,
skillTagFilter(player) {
2024-04-15 18:31:36 +00:00
return lib.skill["dddzhijie"].hiddenCard(player, "shan");
2024-04-15 18:10:02 +00:00
},
order: 10,
result: { player: 1 },
effect: {
target: (card, player, target) => {
if (
card.name === "sha" &&
2024-04-15 18:31:36 +00:00
target.getExpansions("ddddongcha_effect").length < 2 &&
lib.skill["dddzhijie"].hiddenCard(target, "shan")
2024-04-15 18:10:02 +00:00
)
2024-04-15 18:31:36 +00:00
return [1, 1, 1, -get.sgn(get.attitude(player, _status.currentPhase))];
2024-04-15 18:10:02 +00:00
},
2023-07-27 09:56:09 +00:00
},
},
2024-04-15 18:10:02 +00:00
subSkill: {
draw: {
trigger: {
player: "useCardAfter",
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
forced: true,
charlotte: true,
popup: false,
filter(event, player) {
return event.skill == "dddzhijie_backup";
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
content() {
2023-07-27 09:56:09 +00:00
player.draw(2);
},
2024-04-15 18:10:02 +00:00
sub: true,
2023-07-27 09:56:09 +00:00
},
},
},
2024-04-15 18:10:02 +00:00
dddqiahua: {
trigger: {
global: "phaseBegin",
},
direct: true,
filter(event, player) {
return (
player != event.player &&
event.player.hp > 0 &&
player.countCards("h", function (card) {
return !get.is.shownCard(card);
}) >= event.player.hp
);
},
content() {
"step 0";
var target = trigger.player;
player
.chooseCard(
"h",
target.hp,
get.prompt("dddqiahua", target),
"选择明置" +
get.cnNumber(target.hp) +
"张手牌,然后" +
get.translation(target) +
"获得技能〖恂恂〗直到本回合结束。",
function (card) {
return !get.is.shownCard(card);
}
)
.set("goon", get.attitude(player, target) > 0)
.set("ai", function (card) {
if (_status.event.goon) return 1 + Math.random();
return 0;
});
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var target = trigger.player,
cards = result.cards;
player.logSkill("dddqiahua", target);
target.addTempSkills("dddxunxun");
player.addShownCards(cards, "visible_dddxianglang");
game.log(player, "选择了", cards, "作为“明”");
player.showCards(
cards,
2024-04-15 18:31:36 +00:00
get.translation(player) + "对" + get.translation(target) + "发动了【恰化】"
2024-04-15 18:10:02 +00:00
);
}
},
ai: {
expose: 0.15,
},
derivation: "dddxunxun",
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
dddxunxun: {
inherit: "xunxun",
audio: 2,
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
dddfusi: {
mod: {
ignoredHandcard(card, player) {
if (get.is.shownCard(card)) return true;
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
cardDiscardable(card, player, name) {
2024-04-15 18:31:36 +00:00
if (name == "phaseDiscard" && get.is.shownCard(card)) return false;
2023-07-27 09:56:09 +00:00
},
},
2024-04-15 18:10:02 +00:00
global: "dddfusi_global",
subSkill: {
refused: {
charlotte: true,
sub: true,
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
allowed: {
charlotte: true,
sub: true,
2023-07-27 09:56:09 +00:00
},
},
},
2024-04-15 18:10:02 +00:00
dddfusi_global: {
mod: {
cardEnabled2(card, player) {
var source = _status.currentPhase;
if (
!source ||
source == player ||
!source.hasSkill("dddfusi") ||
source.countCards("h") == 0 ||
source.hasCard(function (card) {
return !get.is.shownCard(card);
}, "h")
)
return;
if (player.getCards("h").includes(card)) return false;
2023-07-27 09:56:09 +00:00
},
},
2024-04-15 18:10:02 +00:00
enable: "chooseToUse",
filter(event, player) {
2024-04-15 18:31:36 +00:00
if (event._dddfusi_refused || player.hasSkill("dddfusi_refused")) return false;
2024-04-15 18:10:02 +00:00
var players = game.filterPlayer(function (current) {
return current != player && current.hasSkill("dddfusi");
2023-07-27 09:56:09 +00:00
});
2024-04-15 18:10:02 +00:00
for (var source of players) {
var cards = source.getShownCards();
for (var i of cards) {
var card = get.autoViewAs(i);
2024-04-15 18:31:36 +00:00
if (event.filterCard(card, player, event)) return true;
2023-07-27 09:56:09 +00:00
}
}
return false;
},
2024-04-15 18:10:02 +00:00
hiddenCard(player, name) {
if (player.hasSkill("dddfusi_refused")) return false;
var players = game.filterPlayer(function (current) {
return current != player && current.hasSkill("dddfusi");
2023-07-27 09:56:09 +00:00
});
2024-04-15 18:10:02 +00:00
for (var source of players) {
var cards = source.getShownCards();
for (var i of cards) {
var card = get.autoViewAs(i);
if (name == card.name) return true;
2023-07-27 09:56:09 +00:00
}
}
return false;
},
2024-04-15 18:10:02 +00:00
chooseButton: {
dialog(event, player) {
var dialog = ui.create.dialog("腹笥", "hidden");
var players = game
.filterPlayer(function (current) {
2024-04-15 18:31:36 +00:00
return current != player && current.hasSkill("dddfusi");
2024-04-15 18:10:02 +00:00
})
.sortBySeat();
for (var source of players) {
var cards = source.getShownCards();
if (cards.length) {
var str = '<div class="text center">';
str += get.translation(source);
var num = source.getSeatNum();
2024-04-15 18:31:36 +00:00
if (num > 0) str += "" + get.cnNumber(num, true) + "号位)";
2024-04-15 18:10:02 +00:00
str += "</div>";
2023-07-27 09:56:09 +00:00
dialog.add(str);
dialog.add(cards);
}
}
return dialog;
},
2024-04-15 18:10:02 +00:00
filter(button, player) {
var card = get.autoViewAs(button.link),
evt = _status.event.getParent();
return evt.filterCard(card, player, evt);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
check(button) {
if (_status.event.getParent().type != "phase") return 1;
2024-04-15 18:31:36 +00:00
return _status.event.player.getUseValue(get.autoViewAs(button.link), null, true);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
backup(links, player) {
2023-07-27 09:56:09 +00:00
return {
2024-04-15 18:10:02 +00:00
card: links[0],
viewAs: get.autoViewAs(links[0]),
filterCard: () => false,
selectCard: -1,
precontent() {
"step 0";
2024-04-15 18:31:36 +00:00
var card = lib.skill["dddfusi_global_backup"].card;
2024-04-15 18:10:02 +00:00
event.card = card;
event.result.cards = [card];
event.source = get.owner(card);
2024-04-15 18:31:36 +00:00
if (!event.result.card.storage) event.result.card.storage = {};
event.result.card.storage._dddfusi_owner = event.source;
2023-07-27 09:56:09 +00:00
delete event.result.skill;
2024-04-15 18:10:02 +00:00
player.logSkill("dddfusi_global", event.source);
2024-04-15 18:31:36 +00:00
if (player.hasSkill("dddfusi_allowed")) event.finish();
"step 1";
if (event.result.targets && event.result.targets.length)
player.line(event.result.targets, event.result.card.nature);
2024-04-15 18:10:02 +00:00
player.showCards(
[card],
2024-04-15 18:31:36 +00:00
get.translation(player) + "向" + get.translation(source) + "发动【腹笥】"
2024-04-15 18:10:02 +00:00
);
source
.chooseButton(
[
"是否同意" +
get.translation(player) +
"使用" +
get.translation(card) +
"",
'<div class="text center">' +
(function () {
2024-04-15 18:31:36 +00:00
if (event.result.targets && event.result.targets.length)
2024-04-15 18:10:02 +00:00
return (
"(目标角色:" +
2024-04-15 18:31:36 +00:00
get.translation(event.result.targets) +
2024-04-15 18:10:02 +00:00
""
);
return "(无目标角色)";
})() +
"</div>",
2024-04-15 18:31:36 +00:00
[["   同意   ", "  不同意  "], "tdnodes"],
[["   同意且本回合内不再提示   "], "tdnodes"],
[["  不同意且本回合内不再提示  "], "tdnodes"],
2024-04-15 18:10:02 +00:00
"forcebutton",
],
true
)
.set("forceAuto", true);
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (result.links[0].indexOf("不同意") == -1) {
source.chat("同意");
2024-04-15 18:31:36 +00:00
if (result.links[0].indexOf("本回合内不再提示") > 0)
2024-04-15 18:10:02 +00:00
player.addTempSkill("dddfusi_allowed");
2024-04-15 18:31:36 +00:00
} else if (result.links[0].indexOf("不同意") != -1) {
2024-04-15 18:10:02 +00:00
source.chat("不同意");
2024-04-15 18:31:36 +00:00
if (result.links[0].indexOf("本回合内不再提示") > 0)
2024-04-15 18:10:02 +00:00
player.addTempSkill("dddfusi_refused");
else if (event.result.card.name == "wuxie")
2024-04-15 18:31:36 +00:00
player.addTempSkill("dddfusi_refused", "_wuxieAfter");
2024-04-15 18:10:02 +00:00
var evt = event.getParent();
evt.set("_dddfusi_refused", true);
2023-07-27 09:56:09 +00:00
evt.goto(0);
}
},
2024-04-15 18:10:02 +00:00
};
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
prompt(links, player) {
return "请选择" + get.translation(links[0]) + "的目标";
2023-07-27 09:56:09 +00:00
},
},
2024-04-15 18:10:02 +00:00
ai: {
order: 10,
result: {
player(player, target) {
if (
!game.hasPlayer(function (current) {
return (
current != player &&
current.hasSkill("dddfusi") &&
get.attitude(player, current) >= 0
);
})
)
return 0;
2024-04-15 18:31:36 +00:00
if (_status.event.dying) return get.attitude(player, _status.event.dying);
2023-07-27 09:56:09 +00:00
return 1;
},
},
2024-04-15 18:10:02 +00:00
respondSha: true,
respondShan: true,
skillTagFilter(player, tag, arg) {
2023-07-27 09:56:09 +00:00
var name;
2024-04-15 18:10:02 +00:00
switch (tag) {
case "respondSha":
name = "sha";
break;
case "respondShan":
name = "shan";
break;
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:31:36 +00:00
return lib.skill["dddfusi_global"].hiddenCard(player, name);
2023-07-27 09:56:09 +00:00
},
},
},
2024-04-15 18:10:02 +00:00
dddtuoji: {
trigger: { global: "useCardAfter" },
frequent: true,
filter(event, player) {
return (
event.card.storage &&
event.card.storage._dddfusi_owner == player &&
!player.hasCard(function (card) {
return !get.is.shownCard(card);
}, "h")
);
},
content() {
2023-07-29 18:57:41 +00:00
player.draw(3);
},
2024-04-19 11:36:34 +00:00
ai: {
combo: "dddfusi"
},
2023-07-29 18:57:41 +00:00
},
2024-04-15 18:10:02 +00:00
dddchashi: {
trigger: { global: "phaseUseBegin" },
direct: true,
filter(event, player) {
2024-04-15 18:31:36 +00:00
return player != event.player && player.countCards("he") > 0;
2024-04-15 18:10:02 +00:00
},
*content(event, map) {
const player = map.player,
trigger = map.trigger,
target = trigger.player;
2024-04-15 18:31:36 +00:00
const valuableCards = target.getCards("hs", (card) => target.hasValueTarget(card));
2024-04-15 18:10:02 +00:00
let result = yield player
.chooseToDiscard(
get.prompt("dddchashi", target),
"弃置一张牌,若其使用的下一张牌的花色或类型与此牌相同,你与其各摸一张牌",
"he"
)
.set("logSkill", ["dddchashi", target])
.set("ai", (card) => {
if (!get.event("goon")) return 0;
var list = get.event("list");
2024-04-15 18:31:36 +00:00
return list[0].includes(get.suit(card)) || list[1].includes(get.type2(card));
2024-04-15 18:10:02 +00:00
})
.set("list", [
2024-04-15 18:31:36 +00:00
valuableCards.map((card) => get.suit(card)).toUniqued(),
valuableCards.map((card) => get.type2(card)).toUniqued(),
2024-04-15 18:10:02 +00:00
])
.set("goon", get.attitude(player, target) > 0);
if (!result.bool) return event.finish();
player.storage["dddchashi"] = [result.cards[0], target];
player.addTempSkill("dddchashi_effect", "phaseUseAfter");
target.addTempSkill("dddchashi_ai", {
player: ["phaseUseAfter", "useCard1"],
2023-07-27 09:56:09 +00:00
});
2024-04-15 18:10:02 +00:00
},
content_old() {
"step 0";
var target = trigger.player,
history = target.getHistory("useCard", function (evt) {
return evt.getParent("phaseUse") == trigger;
2023-07-27 09:56:09 +00:00
});
2024-04-15 18:10:02 +00:00
event.target = target;
if (history.length > 0) {
var suit = get.suit(history[0].card);
event.suit = suit;
player
.chooseCard(
"he",
get.prompt("dddchashi", target),
"你可以展示一张牌。若此牌花色为" +
get.translation(suit) +
",则" +
get.translation(target) +
"获得你展示的牌,然后你摸一张牌。"
)
.set("goon", get.sgn(get.attitude(player, target)))
.set("ai", function (card) {
if (_status.event.goon <= 0)
2024-04-15 18:31:36 +00:00
return _status.event.goon * (get.value(card) + 0.01);
2024-04-15 18:10:02 +00:00
return 2 / Math.max(0.1, get.value(card));
});
} else event.goto(2);
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
player.logSkill("dddchashi", target);
var card = result.cards[0];
player.showCards(
card,
2024-04-15 18:31:36 +00:00
get.translation(player) + "对" + get.translation(target) + "发动了【察势】"
2024-04-15 18:10:02 +00:00
);
if (get.color(card) == event.suit) {
target.gain(card, player, "give");
2023-07-27 09:56:09 +00:00
player.draw();
}
}
event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
player
.chooseCard(
"he",
get.prompt("dddchashi", target),
"你可以展示一张牌。若其本阶段内使用的第一张牌与此牌花色相同,则" +
get.translation(target) +
"获得你展示的牌,然后你摸一张牌。"
)
.set("goon", get.sgn(get.attitude(player, target)))
.set("ai", function (card) {
2024-04-15 18:31:36 +00:00
if (_status.event.goon <= 0) return _status.event.goon * (get.value(card) + 0.01);
2024-04-15 18:10:02 +00:00
return 2 / Math.max(0.1, get.value(card));
});
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
if (result.bool) {
player.logSkill("dddchashi", target);
var card = result.cards[0];
player.showCards(
card,
2024-04-15 18:31:36 +00:00
get.translation(player) + "对" + get.translation(target) + "发动了【察势】"
2024-04-15 18:10:02 +00:00
);
2024-04-15 18:31:36 +00:00
player.addTempSkill("dddchashi_effect", "phaseUseAfter");
2024-04-15 18:10:02 +00:00
player.addGaintag([card], "dddchashi");
player.storage["dddchashi"] = [card, target];
target.addTempSkill("dddchashi_ai", {
player: ["phaseUseAfter", "useCard1"],
});
2023-07-27 09:56:09 +00:00
}
},
2024-04-15 18:10:02 +00:00
subSkill: {
effect: {
trigger: { global: "useCard" },
forced: true,
charlotte: true,
filter(event, player) {
var storage = player.getStorage("dddchashi");
if (!storage || !storage.length) return false;
2024-04-15 18:31:36 +00:00
if (event.player != storage[1] || !event.player.isIn()) return false;
// if(!player.getCards('he').includes(storage[0])||!storage[0].hasGaintag('dddchashi')) return false;
2024-04-15 18:10:02 +00:00
if (
get.suit(event.card) != get.suit(storage[0]) &&
get.type2(event.card) != get.type2(storage[0])
)
return false;
2023-11-12 08:16:18 +00:00
// var evt=event.getParent('phaseUse');
// if(evt.player)
// if(event.player.getHistory('useCard',function(evtx){
// return evtx.getParent('phaseUse')==evt;
// }).indexOf(event)!=0) return false;
2023-07-27 09:56:09 +00:00
return true;
},
2024-04-15 18:10:02 +00:00
content() {
var storage = player.getStorage("dddchashi");
2023-11-12 08:16:18 +00:00
// storage[1].gain(storage[0],player,'give');
// player.draw();
2024-04-15 18:31:36 +00:00
game.asyncDraw([player, storage[1]].sortBySeat(_status.currentPhase));
2024-04-15 18:10:02 +00:00
player.removeSkill("dddchashi_effect");
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
onremove(player, storage) {
delete player.storage["dddchashi"];
2023-11-12 08:16:18 +00:00
// player.removeGaintag('dddchashi');
2023-07-27 09:56:09 +00:00
},
},
2024-04-15 18:10:02 +00:00
ai: {
charlotte: true,
2023-07-27 09:56:09 +00:00
},
},
},
2024-04-15 18:10:02 +00:00
dddqice: {
trigger: { player: "phaseZhunbeiBegin" },
filter(event, player) {
return !player.storage["dddqice"];
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
content() {
2023-07-27 09:56:09 +00:00
player.draw(2);
2023-11-12 08:16:18 +00:00
// player.addTempSkill('dddqice_effect');
2024-04-15 18:10:02 +00:00
player.setStorage("dddqice", true);
player
.when("useCard1")
.filter((evt) => get.type2(evt.card) == "trick")
.then(() => {
delete player.storage["dddqice"];
});
},
subSkill: {
effect: {
trigger: { player: "phaseJieshuBegin" },
forced: true,
charlotte: true,
content() {
"step 0";
var list = [];
player.getHistory("useCard", function (evt) {
2024-04-15 18:31:36 +00:00
if (get.type(evt.card) == "trick") list.add(evt.card.name);
2023-07-27 09:56:09 +00:00
});
list.sort();
2024-04-15 18:10:02 +00:00
if (list.length > 0) {
player
.chooseButton(
2024-04-15 18:31:36 +00:00
["齐策:是否视为使用一张牌?", [list, "vcard"]],
2024-04-15 18:10:02 +00:00
function (button) {
2024-04-15 18:31:36 +00:00
return _status.event.player.hasUseTarget({
name: button.link[2],
isCard: true,
});
2024-04-15 18:10:02 +00:00
}
)
.set("ai", function (button) {
var card = {
name: button.link[2],
nature: button.link[3],
isCard: true,
},
player = _status.event.player;
return player.getUseValue(card);
});
} else {
player.removeSkills("dddqice");
2023-07-27 09:56:09 +00:00
event.finish();
}
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
player.chooseUseTarget(true, {
name: result.links[0][2],
isCard: true,
2023-07-27 09:56:09 +00:00
});
}
},
},
},
},
//甄姬
2024-04-15 18:10:02 +00:00
dddmiaoxing: {
audio: 2,
trigger: { global: "gameDrawBegin" },
forced: true,
content() {
var me = player;
var numx = trigger.num;
trigger.num =
typeof numx == "function"
? function (player) {
if (player == me) {
return 3 * numx(player);
}
return numx(player);
}
: function (player) {
if (player == me) {
return 3 * numx;
}
return numx;
};
player._dddmiaoxing = true;
},
group: ["dddmiaoxing_out", "dddmiaoxing_balance"],
marktext: "水",
intro: {
name: "水相",
markcount(storage, player) {
return (
"" +
player.getExpansions("dddmiaoxing_1").length +
"/" +
player.getExpansions("dddmiaoxing_2").length
);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
mark(dialog, content, player) {
var content1 = player.getExpansions("dddmiaoxing_1");
var content2 = player.getExpansions("dddmiaoxing_2");
2024-04-15 18:31:36 +00:00
if ((content1 && content1.length) || (content2 && content2.length)) {
2024-04-15 18:10:02 +00:00
if (player == game.me || player.isUnderControl()) {
dialog.addText("第一组");
2023-07-27 09:56:09 +00:00
dialog.addAuto(content1);
2024-04-15 18:10:02 +00:00
dialog.addText("第二组");
2023-07-27 09:56:09 +00:00
dialog.addAuto(content2);
2024-04-15 18:10:02 +00:00
} else {
return (
"第一组“水相”有" +
get.cnNumber(content1.length) +
"张;" +
"第二组“水相”有" +
get.cnNumber(content2.length) +
"张"
);
2023-07-27 09:56:09 +00:00
}
}
2024-04-15 18:10:02 +00:00
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
subSkill: {
out: {
trigger: {
global: "phaseBefore",
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
forced: true,
filter(event, player) {
return game.phaseNumber == 0 && player._dddmiaoxing;
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
content() {
"step 0";
2023-07-27 09:56:09 +00:00
delete player._dddmiaoxing;
2024-04-15 18:10:02 +00:00
var cardsx = player.getCards("h"),
num = Math.ceil(cardsx.length / 3);
var cards = [
cardsx.slice(0, num),
cardsx.slice(num, 2 * num),
cardsx.slice(2 * num),
];
event.cards = cards;
player
.chooseControl("第一组", "第二组", "第三组")
.set("dialog", [
"淼形:选择一组作为你的手牌",
'<span class="text center">第一组</span>',
cards[0],
'<span class="text center">第二组</span>',
cards[1],
'<span class="text center">第三组</span>',
cards[2],
]);
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
event.cards.splice(result.index, 1);
var cards = event.cards;
player
2024-04-15 18:31:36 +00:00
.addToExpansion(cards[0], player, "giveAuto", false)
2024-04-15 18:10:02 +00:00
.gaintag.add("dddmiaoxing_1");
2024-04-15 18:31:36 +00:00
player.addToExpansion(cards[1], player, "giveAuto").gaintag.add("dddmiaoxing_2");
2024-04-15 18:10:02 +00:00
player.markSkill("dddmiaoxing");
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
balance: {
trigger: { player: "phaseDrawAfter" },
forced: true,
content() {
"step 0";
var forced =
2024-04-15 18:31:36 +00:00
player.getExpansions("dddmiaoxing_1").length != player.countCards("h") &&
player.getExpansions("dddmiaoxing_2").length != player.countCards("h");
2024-04-15 18:10:02 +00:00
var next = player.chooseButton(
[1, 2],
[
"淼形:将至少一组“水相”调整至与手牌数相等",
[["第一组", "第二组"], "tdnodes"],
'<span class="text center">第一组</span>',
player.getExpansions("dddmiaoxing_1"),
'<span class="text center">第二组</span>',
player.getExpansions("dddmiaoxing_2"),
],
forced
);
next.set("filterButton", (button) => {
var type = typeof button.link;
return type != "object";
});
next.set("ai", (button) => {
var player = _status.event.player;
2024-04-15 18:31:36 +00:00
var ind = ["第一组", "第二组"].indexOf(button.link) + 1;
2024-04-15 18:10:02 +00:00
if (ind == -1) return -100;
return (
2024-04-15 18:31:36 +00:00
player.countCards("h") - player.getExpansions("dddmiaoxing_" + ind).length
2024-04-15 18:10:02 +00:00
);
});
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var choices = result.links;
event.choices = choices;
2023-07-27 09:56:09 +00:00
// var hs=result.moved[0],sx1=result.moved[1],sx2=result.moved[2];
// hs.removeArray(player.getCards('h'));
// sx1.removeArray(player.getExpansions('dddmiaoxing_1'));
// sx2.removeArray(player.getExpansions('dddmiaoxing_2'));
// if(!hs.length&&!sx1.length&&!sx2.length) return;
// player.gain(hs,'gain2');
// player.addToExpansion(sx1,player,'giveAuto').gaintag.add('dddmiaoxing_1');
// player.addToExpansion(sx2,player,'giveAuto').gaintag.add('dddmiaoxing_2');
2024-04-15 18:10:02 +00:00
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (event.choices.includes("第一组")) {
var del =
2024-04-15 18:31:36 +00:00
player.countCards("h") - player.getExpansions("dddmiaoxing_1").length;
2024-04-15 18:10:02 +00:00
if (del >= 0) {
if (del != 0)
player
2024-04-15 18:31:36 +00:00
.addToExpansion(get.cards(del), player, "draw")
2024-04-15 18:10:02 +00:00
.gaintag.add("dddmiaoxing_1");
2023-07-27 09:56:09 +00:00
event.goto(4);
2024-04-15 18:10:02 +00:00
} else {
player
.chooseButton(
[
2024-04-15 18:31:36 +00:00
"淼形:移除" + get.cnNumber(-del) + "张第一组的“水相”",
player.getExpansions("dddmiaoxing_1"),
2024-04-15 18:10:02 +00:00
],
-del,
true
)
.set("ai", (button) => {
return -get.buttonValue(button);
});
2023-07-27 09:56:09 +00:00
}
}
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
if (result.bool) {
2023-07-27 09:56:09 +00:00
player.loseToDiscardpile(result.links);
}
2024-04-15 18:31:36 +00:00
"step 4";
2024-04-15 18:10:02 +00:00
player.markSkill("dddmiaoxing");
if (event.choices.includes("第二组")) {
var del =
2024-04-15 18:31:36 +00:00
player.countCards("h") - player.getExpansions("dddmiaoxing_2").length;
2024-04-15 18:10:02 +00:00
if (del >= 0) {
if (del != 0)
player
2024-04-15 18:31:36 +00:00
.addToExpansion(get.cards(del), player, "draw")
2024-04-15 18:10:02 +00:00
.gaintag.add("dddmiaoxing_2");
2023-07-27 09:56:09 +00:00
event.goto(6);
2024-04-15 18:10:02 +00:00
} else {
player
.chooseButton(
[
2024-04-15 18:31:36 +00:00
"淼形:移除" + get.cnNumber(-del) + "张第二组的“水相”",
player.getExpansions("dddmiaoxing_2"),
2024-04-15 18:10:02 +00:00
],
-del,
true
)
.set("ai", (button) => {
return -get.buttonValue(button);
});
2023-07-27 09:56:09 +00:00
}
}
2024-04-15 18:31:36 +00:00
"step 5";
2024-04-15 18:10:02 +00:00
if (result.bool) {
2023-07-27 09:56:09 +00:00
player.loseToDiscardpile(result.links);
}
2024-04-15 18:31:36 +00:00
"step 6";
2024-04-15 18:10:02 +00:00
player.markSkill("dddmiaoxing");
},
},
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
dddfushi: {
audio: 2,
trigger: { player: ["useCardAfter", "respondAfter"] },
filter(event, player) {
2024-04-15 18:31:36 +00:00
return get.type(event.card) == "basic" && !player.hasSkill("dddfushi_used");
2024-04-15 18:10:02 +00:00
},
direct: true,
content() {
"step 0";
player
.chooseControl("第一组", "第二组", "cancel2")
.set("dialog", [
get.prompt("dddfushi"),
'<span class="text center">用所有手牌交换一组“水相”</span>',
2023-07-27 09:56:09 +00:00
'<span class="text center">第一组</span>',
2024-04-15 18:10:02 +00:00
player.getExpansions("dddmiaoxing_1"),
2023-07-27 09:56:09 +00:00
'<span class="text center">第二组</span>',
2024-04-15 18:10:02 +00:00
player.getExpansions("dddmiaoxing_2"),
])
.set("ai", () => {
2023-07-27 09:56:09 +00:00
return _status.event.choice;
2024-04-15 18:10:02 +00:00
})
.set(
"choice",
(function () {
2024-04-15 18:31:36 +00:00
var fn = player == _status.currentPhase ? "useful" : "value";
2024-04-15 18:10:02 +00:00
var list = [
[
1,
player
.getExpansions("dddmiaoxing_1")
2024-04-15 18:31:36 +00:00
.reduce((p, c) => p + get[fn](c), 0),
2024-04-15 18:10:02 +00:00
],
[
2,
player
.getExpansions("dddmiaoxing_2")
2024-04-15 18:31:36 +00:00
.reduce((p, c) => p + get[fn](c), 0),
2024-04-15 18:10:02 +00:00
],
2024-04-15 18:31:36 +00:00
[3, player.getCards("h").reduce((p, c) => p + get[fn](c), 0)],
2024-04-15 18:10:02 +00:00
].sort((a, b) => b[1] - a[1]);
return list[0][0] - 1;
})()
);
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.control == "cancel2") event.finish();
else {
player.logSkill("dddfushi");
player.addTempSkill("dddfushi_used");
var index = result.index + 1;
player
2024-04-15 18:31:36 +00:00
.addToExpansion(player.getCards("h"), player, "giveAuto")
2024-04-15 18:10:02 +00:00
.gaintag.add("dddmiaoxing_" + index);
2024-04-15 18:31:36 +00:00
player.gain(player.getExpansions("dddmiaoxing_" + index), "draw");
2024-04-15 18:10:02 +00:00
game.log(
player,
"获得了" +
2024-04-15 18:31:36 +00:00
get.cnNumber(player.getExpansions("dddmiaoxing_" + index).length) +
2024-04-15 18:10:02 +00:00
"张“水相”"
);
}
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
player.markSkill("dddmiaoxing");
player
2024-04-15 18:31:36 +00:00
.chooseTarget("是否令一名男性角色选择是否交换“水相”?", (card, player, target) => {
return target.hasSex("male");
})
.set("ai", (target) => get.attitude(_status.event.player, target));
"step 3";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var target = result.targets[0];
event.target = target;
player.line(target);
target
.chooseControl("第一组", "第二组", "cancel2")
.set("dialog", [
"浮世:是否用所有手牌交换一组“水相”?",
'<span class="text center">第一组</span>',
player.getExpansions("dddmiaoxing_1"),
'<span class="text center">第二组</span>',
player.getExpansions("dddmiaoxing_2"),
])
.set("ai", () => {
return _status.event.choice;
})
.set(
"choice",
(function () {
2024-04-15 18:31:36 +00:00
var fn = target == _status.currentPhase ? "useful" : "value";
2024-04-15 18:10:02 +00:00
var list = [
[
1,
player
.getExpansions("dddmiaoxing_1")
2024-04-15 18:31:36 +00:00
.reduce((p, c) => p + get[fn](c), 0),
2024-04-15 18:10:02 +00:00
],
[
2,
player
.getExpansions("dddmiaoxing_2")
2024-04-15 18:31:36 +00:00
.reduce((p, c) => p + get[fn](c), 0),
2024-04-15 18:10:02 +00:00
],
2024-04-15 18:31:36 +00:00
[3, target.getCards("h").reduce((p, c) => p + get[fn](c), 0)],
2024-04-15 18:10:02 +00:00
].sort((a, b) => b[1] - a[1]);
return list[0] - 1;
})()
);
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 4";
2024-04-15 18:10:02 +00:00
if (result.control == "cancel2") event.finish();
else {
var index = result.index + 1;
player
2024-04-15 18:31:36 +00:00
.addToExpansion(target.getCards("h"), target, "giveAuto")
2024-04-15 18:10:02 +00:00
.gaintag.add("dddmiaoxing_" + index);
2024-04-15 18:31:36 +00:00
target.gain(player.getExpansions("dddmiaoxing_" + index), player, "giveAuto");
2024-04-15 18:10:02 +00:00
}
2024-04-15 18:31:36 +00:00
"step 5";
2024-04-15 18:10:02 +00:00
player.markSkill("dddmiaoxing");
},
subSkill: {
used: { charlotte: true },
2023-07-27 09:56:09 +00:00
},
},
//赵昂
2024-04-15 18:10:02 +00:00
dddfenji: {
audio: 2,
trigger: { player: ["phaseDrawBegin1", "phaseDiscardBegin"] },
direct: true,
filter(event, player) {
2024-04-15 18:31:36 +00:00
if (event.name == "phaseDraw" && event.numFixed) return false;
2024-04-15 18:10:02 +00:00
return (
lib.inpile
.filter((i) => get.type(i) == "trick")
2024-04-15 18:31:36 +00:00
.removeArray(player.getStorage("dddfenji")).length > 0
2024-04-15 18:10:02 +00:00
);
},
content() {
"step 0";
var cards = lib.inpile
.filter((i) => {
2024-04-15 18:31:36 +00:00
return get.type(i) == "trick" && !player.getStorage("dddfenji").includes(i);
2024-04-15 18:10:02 +00:00
})
.map((i) => ["锦囊", "", i]);
player
2024-04-15 18:31:36 +00:00
.chooseButton([get.prompt("dddfenji"), [cards, "vcard"]])
2024-04-15 18:10:02 +00:00
.set("ai", (button) => {
var evt = _status.event.getTrigger();
if (evt.name == "phaseDraw") {
2024-04-15 18:31:36 +00:00
if (!get.tag({ name: button.link[2] }, "damage")) return 0;
2024-04-15 18:10:02 +00:00
} else {
if (
lib.skill.xunshi.isXunshi({
name: button.link[2],
})
)
return 0;
}
return _status.event.player.getUseValue({
name: button.link[2],
2023-07-27 09:56:09 +00:00
});
})
2024-04-15 18:10:02 +00:00
.set("filterButton", (button) => {
return player.hasUseTarget(button.link[2]);
});
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
player.logSkill("dddfenji");
player.markAuto("dddfenji", [result.links[0][2]]);
player.chooseUseTarget(result.links[0][2], true);
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (trigger.name == "phaseDraw") {
trigger.changeToZero();
var num = 0;
game.filterPlayer((current) => {
current.getHistory("sourceDamage", (evt) => {
if (evt.getParent(4) == event) num += evt.num;
});
});
if (num > 0) player.draw(num);
} else {
2023-07-27 09:56:09 +00:00
trigger.cancel();
2024-04-15 18:10:02 +00:00
var num = 0;
player.getHistory("useCard", (evt) => {
2024-04-15 18:31:36 +00:00
if (evt.getParent(2) == event) num = evt.targets.length;
2023-07-27 09:56:09 +00:00
});
2024-04-15 18:31:36 +00:00
if (num > 0 && player.countCards("he")) player.chooseToDiscard(num, true);
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
},
2023-07-27 09:56:09 +00:00
},
//周处
2024-04-15 18:10:02 +00:00
dddxiaheng: {
audio: 2,
trigger: { player: "phaseUseBegin" },
forced: true,
onremove: ["dddxiaheng", "dddxiaheng_del"],
intro: { content: "已因此技能对$造成过伤害" },
content() {
"step 0";
event.targets = [];
2024-04-15 18:31:36 +00:00
player.chooseTarget("侠横:令一名角色弃置两张牌", true).set("ai", (target) => {
var player = _status.event.player,
eff = get.effect(target, { name: "guohe_copy2" }, player, player),
eff2 = get.damageEffect(target, player, player);
if (player.storage["dddxiaheng_del"]) return eff;
var toself = false;
if (eff2 > eff * 2) {
toself =
!player.isDamaged() &&
player.countCards("he", (card) => get.value(card, player) < 5) >= 2;
}
if (toself) return target == player ? 100 : 0;
return eff * (eff2 > eff * 2 ? 0.5 : 1.5);
});
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var target = result.targets[0];
2023-07-27 09:56:09 +00:00
event.targets.add(target);
player.line(target);
2024-04-15 18:10:02 +00:00
target.chooseToDiscard(2, true, "he");
}
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
player
.chooseTarget("侠横对一名角色造成1点伤害", true)
.set("ai", (target) => {
var player = _status.event.player,
eff = get.damageEffect(target, player, player),
targetx = _status.event.targetx;
if (player.storage["dddxiaheng_del"]) return eff;
2024-04-15 18:31:36 +00:00
var fix = player.getStorage("dddxiaheng").includes(target) ? 0.75 : 1;
2024-04-15 18:10:02 +00:00
if (
target == player &&
targetx != player &&
player.isHealthy() &&
2024-04-15 18:31:36 +00:00
!player.getStorage("dddxiaheng").includes(player) &&
2024-04-15 18:10:02 +00:00
player.hp > 2
)
return 100;
2024-04-15 18:31:36 +00:00
return eff * (player.hp == 1 || target == targetx ? 0.1 : 1) * fix;
2024-04-15 18:10:02 +00:00
})
.set("targetx", targets[0]);
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var target = result.targets[0];
2023-07-27 09:56:09 +00:00
event.targets.add(target);
player.line(target);
target.damage();
2024-04-15 18:10:02 +00:00
player.markAuto("dddxiaheng", [target]);
}
2024-04-15 18:31:36 +00:00
"step 4";
2024-04-15 18:10:02 +00:00
if (player.storage["dddxiaheng_del"]) event.finish();
else {
if (!targets.includes(player)) player.loseMaxHp();
if (targets.length == 1) {
player.removeSkills("dddxiaheng");
2023-11-12 08:16:18 +00:00
}
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:31:36 +00:00
"step 5";
2024-04-15 18:10:02 +00:00
if (player.getStorage("dddxiaheng").length >= 3) {
player.storage["dddxiaheng_del"] = true;
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
},
2023-07-27 09:56:09 +00:00
},
//刘巴
2024-04-15 18:10:02 +00:00
dddfengzheng: {
audio: 2,
global: "dddfengzheng_global",
trigger: {
global: "roundStart",
},
filter(event, player) {
return game.hasPlayer((current) => {
var history = current.actionHistory;
for (var i = history.length - 2; i >= 0; i--) {
var evts = history[i].useSkill;
for (var evt of evts) {
2024-04-15 18:31:36 +00:00
if (evt.skill == "dddfengzheng_global") return true;
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
if (history[i].isRound) break;
2023-07-27 09:56:09 +00:00
}
return false;
});
},
2024-04-15 18:10:02 +00:00
prompt2(event, player) {
var num = game.countPlayer((current) => {
var history = current.actionHistory;
for (var i = history.length - 2; i >= 0; i--) {
var evts = history[i].useSkill;
for (var evt of evts) {
2024-04-15 18:31:36 +00:00
if (evt.skill == "dddfengzheng_global") return true;
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
if (history[i].isRound) break;
2023-07-27 09:56:09 +00:00
}
return false;
});
2024-04-15 18:10:02 +00:00
return "观看并分配牌堆顶的" + get.cnNumber(num) + "张牌";
},
content() {
"step 0";
var num = game.countPlayer((current) => {
var history = current.actionHistory;
for (var i = history.length - 2; i >= 0; i--) {
var evts = history[i].useSkill;
for (var evt of evts) {
2024-04-15 18:31:36 +00:00
if (evt.skill == "dddfengzheng_global") return true;
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
if (history[i].isRound) break;
2023-07-27 09:56:09 +00:00
}
return false;
});
2024-04-15 18:10:02 +00:00
var cards = game.cardsGotoOrdering(get.cards(num)).cards;
event.cards = cards;
if (_status.connectMode)
game.broadcastAll(function () {
_status.noclearcountdown = true;
2023-07-27 09:56:09 +00:00
});
2024-04-15 18:10:02 +00:00
event.given_map = {};
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (event.cards.length > 1) {
player
2024-04-15 18:31:36 +00:00
.chooseCardButton("丰政:请选择要分配的牌", true, event.cards, [
1,
event.cards.length,
])
2024-04-15 18:10:02 +00:00
.set("ai", function (button) {
if (ui.selected.buttons.length == 0) return 1;
return 0;
});
} else if (event.cards.length == 1)
event._result = {
links: event.cards.slice(0),
bool: true,
};
2023-07-27 09:56:09 +00:00
else event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (result.bool) {
2023-07-27 09:56:09 +00:00
event.cards.removeArray(result.links);
2024-04-15 18:10:02 +00:00
event.togive = result.links.slice(0);
player
2024-04-15 18:31:36 +00:00
.chooseTarget("选择一名角色获得" + get.translation(result.links), true)
2024-04-15 18:10:02 +00:00
.set("ai", function (target) {
2024-04-15 18:31:36 +00:00
var fix = (_status.event.getParent().given_map[target.playerid] || 0) + 1;
var att = get.attitude(_status.event.player, target) / Math.sqrt(fix);
2024-04-15 18:10:02 +00:00
if (_status.event.enemy) return -att;
2024-04-15 18:31:36 +00:00
else if (att > 0) return att / (1 + target.countCards("h"));
2024-04-15 18:10:02 +00:00
else return att / 100;
})
2024-04-15 18:31:36 +00:00
.set("enemy", get.value(event.togive[0], player, "raw") < 0);
2024-04-15 18:10:02 +00:00
}
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
if (result.targets.length) {
var id = result.targets[0].playerid,
map = event.given_map;
if (!map[id]) map[id] = [];
2023-07-27 09:56:09 +00:00
map[id].addArray(event.togive);
}
2024-04-15 18:10:02 +00:00
if (cards.length > 0) event.goto(1);
2024-04-15 18:31:36 +00:00
"step 4";
2024-04-15 18:10:02 +00:00
if (_status.connectMode) {
game.broadcastAll(function () {
delete _status.noclearcountdown;
game.stopCountChoose();
});
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
var list = [],
lose = false;
for (var i in event.given_map) {
2024-04-15 18:31:36 +00:00
var source = (_status.connectMode ? lib.playerOL : game.playerMap)[i];
2024-04-15 18:10:02 +00:00
player.line(source, "green");
list.push([source, event.given_map[i]]);
if (event.given_map[i].length > 2) lose = true;
2023-07-27 09:56:09 +00:00
}
game.loseAsync({
2024-04-15 18:10:02 +00:00
gain_list: list,
giver: player,
animate: "draw",
}).setContent("gaincardMultiple");
if (!lose) event.finish();
2024-04-15 18:31:36 +00:00
"step 5";
2024-04-15 18:10:02 +00:00
player.removeSkills("dddfengzheng");
},
subSkill: {
global: {
audio: "dddfengzheng",
enable: "phaseUse",
usable: 1,
filter(event, player) {
2024-04-15 18:31:36 +00:00
return game.hasPlayer((current) => current.hasSkill("dddfengzheng"));
},
2024-04-15 18:10:02 +00:00
filterCard(card, player) {
var num = 0;
for (var i = 0; i < ui.selected.cards.length; i++) {
num += get.number(ui.selected.cards[i]);
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
return get.number(card) + num <= 13;
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
selectCard: [1, Infinity],
filterOk() {
var num = 0;
for (var i = 0; i < ui.selected.cards.length; i++) {
num += get.number(ui.selected.cards[i]);
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
return num == 13;
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
popname: true,
complexCard: true,
prompt: "将任意张点数和为13的手牌当【无中生有】使用",
check(card) {
var num = 0;
for (var i = 0; i < ui.selected.cards.length; i++) {
num += get.number(ui.selected.cards[i]);
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:31:36 +00:00
if (num + get.number(card) == 13) return 5.5 - get.value(card);
2024-04-15 18:10:02 +00:00
if (ui.selected.cards.length == 0) {
var cards = _status.event.player.getCards("h");
for (var i = 0; i < cards.length; i++) {
for (var j = i + 1; j < cards.length; j++) {
2024-04-15 18:31:36 +00:00
if (get.number(cards[i]) + get.number(cards[j]) == 13) {
if (cards[i] == card || cards[j] == card)
2024-04-15 18:10:02 +00:00
return 6 - get.value(card);
2023-07-27 09:56:09 +00:00
}
}
}
}
return 0;
},
2024-04-15 18:10:02 +00:00
position: "hs",
viewAs: { name: "wuzhong" },
},
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
dddyulv: {
audio: 2,
trigger: {
global: "phaseBefore",
player: "enterGame",
},
forced: true,
filter(event, player) {
return event.name != "phase" || game.phaseNumber == 0;
},
group: "dddyulv_enter",
content() {
"step 0";
2023-11-12 08:16:18 +00:00
player.draw();
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (!player.countCards("he")) event.finish();
else player.chooseCard("玉律:将一张牌置于武将牌上", true);
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (result.bool) {
2024-04-15 18:31:36 +00:00
player.addToExpansion(result.cards, player, "give").gaintag.add("dddyulv");
2024-04-15 18:10:02 +00:00
}
},
marktext: "律",
intro: {
markcount: "expansion",
content: "expansion",
},
subSkill: {
enter: {
trigger: {
2024-04-15 18:31:36 +00:00
global: ["loseAfter", "cardsDiscardAfter", "loseAsyncAfter", "equipAfter"],
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
forced: true,
direct: true,
filter(event, player) {
var cards = event.getd();
if (!cards.length) return false;
const card = player.getExpansions("dddyulv")[0];
if (!card) return false;
const number = get.number(card, false);
2024-04-15 18:31:36 +00:00
if (!_status.currentPhase || !_status.currentPhase.isIn()) return false;
return cards.some((i) => get.number(i, false) == number);
2024-04-15 18:10:02 +00:00
},
content() {
"step 0";
player
.chooseControl("摸牌", "弃牌")
.set(
"prompt",
"玉律:令" +
get.translation(_status.currentPhase) +
"摸一张牌或弃置一张牌"
)
.set("ai", () => {
2024-04-15 18:31:36 +00:00
return get.attitude(_status.event.player, _status.currentPhase) > 0
2024-04-15 18:10:02 +00:00
? "摸牌"
: "弃牌";
});
2024-04-15 18:31:36 +00:00
"step 1";
player.logSkill("dddyulv_enter", _status.currentPhase);
2024-04-15 18:10:02 +00:00
var reset = false;
if (result.index == 0) _status.currentPhase.draw();
2024-04-15 18:31:36 +00:00
else _status.currentPhase.chooseToDiscard(true, "he");
2024-04-15 18:10:02 +00:00
var reset =
player.getHistory("useSkill", (evt) => {
return evt.skill == "dddyulv_enter";
}).length == 2;
if (!reset) event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (!player.countCards("h")) player.draw();
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
if (!player.countCards("h")) event.finish();
else
player.chooseCard(
"玉律:选择一张手牌交换“玉律”(" +
2024-04-15 18:31:36 +00:00
get.translation(player.getExpansions("dddyulv")) +
2024-04-15 18:10:02 +00:00
"",
true
);
2024-04-15 18:31:36 +00:00
"step 4";
2024-04-15 18:10:02 +00:00
if (result.bool) {
2024-04-15 18:31:36 +00:00
player.gain(player.getExpansions("dddyulv"), player, "give");
2024-04-15 18:10:02 +00:00
player
2024-04-15 18:31:36 +00:00
.addToExpansion(result.cards, player, "log", "give")
2024-04-15 18:10:02 +00:00
.gaintag.add("dddyulv");
2023-11-12 08:16:18 +00:00
}
2024-04-15 18:10:02 +00:00
},
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
},
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
dddyulv_old: {
audio: 2,
trigger: {
global: "phaseBefore",
player: "enterGame",
},
forced: true,
filter(event, player) {
return event.name != "phase" || game.phaseNumber == 0;
},
group: "dddyulv_old_enter",
content() {
"step 0";
player
2024-04-15 18:31:36 +00:00
.chooseControl(Array.from({ length: 13 }, (_, i) => get.strNumber(i + 1)))
2024-04-15 18:10:02 +00:00
.set("prompt", "玉律:声明一个点数")
.set("ai", () => _status.event.controls.randomGet());
2024-04-15 18:31:36 +00:00
"step 1";
2023-07-27 09:56:09 +00:00
player.popup(result.control);
2024-04-15 18:10:02 +00:00
var number = result.index + 1;
player.storage["dddyulv_old"] = number;
player.markSkill("dddyulv_old");
},
intro: {
content: "声明的点数为#",
},
subSkill: {
enter: {
trigger: {
2024-04-15 18:31:36 +00:00
global: ["loseAfter", "cardsDiscardAfter", "loseAsyncAfter", "equipAfter"],
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
forced: true,
direct: true,
filter(event, player) {
var cards = event.getd();
2024-04-15 18:31:36 +00:00
if (!cards.length || !player.storage["dddyulv_old"]) return false;
if (!_status.currentPhase || !_status.currentPhase.isIn()) return false;
return cards.some((i) => get.number(i, false) == player.storage["dddyulv_old"]);
2024-04-15 18:10:02 +00:00
},
content() {
"step 0";
player
.chooseControl("摸牌", "弃牌")
.set(
"prompt",
"玉律:令" +
get.translation(_status.currentPhase) +
"摸一张牌或弃置一张牌"
)
.set("ai", () => {
2024-04-15 18:31:36 +00:00
return get.attitude(_status.event.player, _status.currentPhase) > 0
2024-04-15 18:10:02 +00:00
? "摸牌"
: "弃牌";
});
2024-04-15 18:31:36 +00:00
"step 1";
player.logSkill("dddyulv_old_enter", _status.currentPhase);
2024-04-15 18:10:02 +00:00
var reset = false;
if (result.index == 0) _status.currentPhase.draw();
2024-04-15 18:31:36 +00:00
else _status.currentPhase.chooseToDiscard(true, "he");
if (_status.currentPhase.hasSkill("dddyulv_old_" + result.index)) reset = true;
2024-04-15 18:10:02 +00:00
_status.currentPhase.removeSkill("dddyulv_old_0");
_status.currentPhase.removeSkill("dddyulv_old_1");
2024-04-15 18:31:36 +00:00
_status.currentPhase.addSkill("dddyulv_old_" + result.index);
2024-04-15 18:10:02 +00:00
if (!reset) event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
player
2024-04-15 18:31:36 +00:00
.chooseControl(Array.from({ length: 13 }, (_, i) => get.strNumber(i + 1)))
2024-04-15 18:10:02 +00:00
.set("prompt", "玉律:重新声明一个点数")
2024-04-15 18:31:36 +00:00
.set("ai", () => _status.event.controls.randomGet());
"step 3";
2023-07-27 09:56:09 +00:00
player.popup(result.control);
2024-04-15 18:10:02 +00:00
var number = result.index + 1;
player.storage["dddyulv_old"] = number;
player.markSkill("dddyulv_old");
2024-04-15 18:31:36 +00:00
"step 4";
2024-04-15 18:10:02 +00:00
var evt = trigger.getParent("phaseUse");
if (evt && evt.name == "phaseUse") {
evt.skipped = true;
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
var evt = trigger.getParent("phase");
if (evt && evt.name == "phase") {
game.log(evt.player, "结束了回合");
2023-07-27 09:56:09 +00:00
evt.finish();
evt.untrigger(true);
}
2024-04-15 18:10:02 +00:00
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
0: { charlotte: true },
1: { charlotte: true },
},
2023-07-27 09:56:09 +00:00
},
//蹇硕
2024-04-15 18:10:02 +00:00
dddfenye: {
audio: 2,
enable: "phaseUse",
usable: 1,
filterTarget(card, player, target) {
2023-07-27 09:56:09 +00:00
return player.canCompare(target);
},
2024-04-15 18:10:02 +00:00
filter(event, player) {
return player.countCards("h") > 0;
},
content() {
"step 0";
2024-04-15 18:31:36 +00:00
player.chooseToCompare([target]).setContent(lib.skill["dddfenye"].chooseToCompareFenye);
"step 1";
2024-04-15 18:10:02 +00:00
result.winner.forEach((i) => i.addExpose(0.05));
result.loser.forEach((i) => i.addExpose(0.05));
if (result.winner.length && result.loser.length) {
var players = result.winner;
event.players = players.sortBySeat();
event.targets = result.loser;
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
var current = event.players.shift();
event.current = current;
current
2024-04-15 18:31:36 +00:00
.chooseTarget("是否视为对一名没赢的角色使用一张【杀】?", (card, player, target) => {
return (
player.canUse("sha", target, false) && _status.event.targets.includes(target)
2024-04-15 18:10:02 +00:00
);
})
2024-04-15 18:31:36 +00:00
.set("ai", (target) => {
return get.effect(target, { name: "sha" }, get.player(), get.player());
})
2024-04-15 18:10:02 +00:00
.set("targets", event.targets);
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
if (result.bool) {
if (!event.isMine() && !event.isOnline()) game.delayx();
var target = result.targets[0];
2024-04-15 18:31:36 +00:00
event.current.useCard({ name: "sha", isCard: true }, target, false);
2023-07-27 09:56:09 +00:00
event.targets.remove(target);
}
2024-04-15 18:31:36 +00:00
if (event.targets.length && event.players.length) event.goto(2);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
chooseToCompareFenye() {
"step 0";
var target = event.targets[0];
2023-07-27 09:56:09 +00:00
event.targets.unshift(player);
2024-04-15 18:10:02 +00:00
event.targetx = target;
2024-04-15 18:31:36 +00:00
if (player.countCards("h") == 0 || target.countCards("h") == 0) {
2024-04-15 18:10:02 +00:00
event.result = { cancelled: true, bool: false };
2023-07-27 09:56:09 +00:00
event.finish();
return;
}
2024-04-15 18:10:02 +00:00
game.log(player, "对", target, "发起拼点");
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
var send = function (targets) {
var next = game.createEvent("dddfenye_choose", false);
2023-07-27 09:56:09 +00:00
// next.player=game.me;
2024-04-15 18:10:02 +00:00
next.targets = targets;
next.ai = event.ai;
next.fixedResult = event.fixedResult;
next.setContent(lib.skill["dddfenye"].contentx);
2023-07-27 09:56:09 +00:00
game.resume();
};
2024-04-15 18:10:02 +00:00
var sendback = function (result, player) {
if (!Array.isArray(result)) {
result = [null, null];
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
event.results.push([player, result]);
2023-07-27 09:56:09 +00:00
};
2024-04-15 18:10:02 +00:00
event.ai_targets = [];
event.results = [];
var players = game.filterPlayer().sortBySeat();
var time = 10000;
if (lib.configOL && lib.configOL.choose_timeout)
time = parseInt(lib.configOL.choose_timeout) * 1000;
for (var i = 0; i < players.length; i++) {
2023-07-27 09:56:09 +00:00
players[i].showTimer(time);
2024-04-15 18:10:02 +00:00
if (players[i].isOnline()) {
event.withol = true;
players[i].send(send, targets);
2023-07-27 09:56:09 +00:00
players[i].wait(sendback);
2024-04-15 18:10:02 +00:00
} else if (players[i] == game.me) {
event.withme = true;
2024-04-15 18:31:36 +00:00
var next = game.createEvent("dddfenye_choose", false);
2024-04-15 18:10:02 +00:00
next.player = game.me;
next.targets = targets;
next.ai = event.ai;
next.fixedResult = event.fixedResult;
next.setContent(lib.skill["dddfenye"].contentx);
if (_status.connectMode) game.me.wait(sendback);
} else {
2023-07-27 09:56:09 +00:00
event.ai_targets.push(players[i]);
}
}
2024-04-15 18:10:02 +00:00
if (event.ai_targets.length) {
for (var i = 0; i < event.ai_targets.length; i++) {
if (targets.includes(event.ai_targets[i])) {
var target = event.ai_targets[i];
2024-04-15 18:31:36 +00:00
var cards = target.getCards("h").sort((a, b) => {
return event.ai(b) - event.ai(a);
});
2024-04-15 18:10:02 +00:00
sendback([target, cards[0]], target);
event.ai_targets.splice(i--, 1);
2023-07-27 09:56:09 +00:00
}
}
2024-04-15 18:10:02 +00:00
if (event.ai_targets.length) {
2023-07-27 09:56:09 +00:00
event.ai_targets.randomSort();
2024-04-15 18:10:02 +00:00
setTimeout(function () {
event.interval = setInterval(
function () {
var target = event.ai_targets.shift();
var cards = target
2024-04-15 18:31:36 +00:00
.getCards("h", (card) => get.value(card) < 4)
2024-04-15 18:10:02 +00:00
.sort((a, b) => {
2024-04-15 18:31:36 +00:00
return event.ai(b) - event.ai(a);
2023-07-27 09:56:09 +00:00
});
2024-04-15 18:10:02 +00:00
if (!cards.length) {
sendback([null, null], target);
} else {
2024-04-15 18:31:36 +00:00
if (Math.abs(get.number(cards[0]) - 7) <= 2) {
2024-04-15 18:10:02 +00:00
sendback([null, null], target);
} else {
2024-04-15 18:31:36 +00:00
var sgn = get.number(cards[0]) >= 7 ? 1 : -1;
var targetsx = targets.slice().sort((a, b) => {
var attA = get.attitude(target, a),
attB = get.attitude(target, b);
return sgn * (attB - attA);
});
sendback([targetsx[0], cards[0]], target);
2024-04-15 18:10:02 +00:00
}
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
if (!event.ai_targets.length) {
clearInterval(event.interval);
if (event.withai) game.resume();
}
},
_status.connectMode ? 750 : 75
);
}, 500);
2023-07-27 09:56:09 +00:00
}
}
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (event.withme) {
2024-04-15 18:31:36 +00:00
if (_status.connectMode) game.me.unwait(result, game.me);
2024-04-15 18:10:02 +00:00
else {
if (!Array.isArray(result)) {
result = [null, null];
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
event.results.push([game.me, result]);
2023-07-27 09:56:09 +00:00
}
}
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
if (event.withol && !event.resultOL) {
2023-07-27 09:56:09 +00:00
game.pause();
}
2024-04-15 18:31:36 +00:00
"step 4";
2024-04-15 18:10:02 +00:00
if (event.ai_targets.length > 0) {
event.withai = true;
2023-07-27 09:56:09 +00:00
game.pause();
}
2024-04-15 18:31:36 +00:00
"step 5";
2023-07-27 09:56:09 +00:00
delete event._global_waiting;
2024-04-15 18:10:02 +00:00
for (var i of game.players) i.hideTimer();
var cards = [];
var targets = [];
var lose_list = [];
event.results.sort((a, b) => lib.sort.seat(a[0], b[0]));
for (var res of event.results) {
var target = res[0],
card = res[1][1],
skill = res[1][2];
if (!target || !card) continue;
2024-04-15 18:31:36 +00:00
if (skill && lib.skill[skill] && lib.skill[skill].onCompare) {
2023-07-27 09:56:09 +00:00
target.logSkill(skill);
2024-04-15 18:10:02 +00:00
res[1][1] = lib.skill[skill].onCompare(target);
if (target != player) cards.push(res[1][1]);
} else {
if (target != player) cards.push(card);
lose_list.push([target, [card]]);
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
if (target != player) targets.push(target);
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
if (lose_list.length) {
2023-07-27 09:56:09 +00:00
game.loseAsync({
2024-04-15 18:10:02 +00:00
lose_list: lose_list,
}).setContent("chooseToCompareLose");
}
event.lose_list = lose_list;
event.getNum = function (card) {
for (var i of event.lose_list) {
2024-04-15 18:31:36 +00:00
if (i[1].includes && i[1].includes(card)) return get.number(card, i[0]);
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
return get.number(card, false);
};
event.cardlist = cards;
event.cards = cards;
event.card1 = event.results[0][1][1];
event.num1 = event.getNum(event.card1);
event.iwhile = 0;
event.targets = targets;
event.tempplayer = event.player;
event.players = event.results
.filter((i) => i[1][0] == player && i[1][1])
.map((i) => i[0]);
event.targetsx = event.results
.filter((i) => i[1][0] == event.targetx && i[1][1])
.map((i) => i[0]);
event.result = {
player: event.card1,
targets: event.cardlist.slice(0),
num1: [event.num1],
num2: [],
winner: [],
loser: [],
2023-07-27 09:56:09 +00:00
};
2024-04-15 18:10:02 +00:00
game.log(player, "的拼点牌为", event.card1);
2024-04-15 18:31:36 +00:00
"step 6";
2024-04-15 18:10:02 +00:00
event.target = null;
event.trigger("compare");
lib.skill["dddfenye"].$compareFenye(
event.players,
2024-04-15 18:31:36 +00:00
event.results.filter((i) => i[1][0] == player).map((i) => i[1][1]),
2024-04-15 18:10:02 +00:00
event.targetsx,
2024-04-15 18:31:36 +00:00
event.results.filter((i) => i[1][0] == event.targetx).map((i) => i[1][1])
2024-04-15 18:10:02 +00:00
);
2024-04-15 18:31:36 +00:00
"step 7";
2024-04-15 18:10:02 +00:00
if (event.iwhile < targets.length) {
event.target = targets[event.iwhile];
event.target.addTempClass("target");
event.card2 = event.cardlist[event.iwhile];
event.num2 = event.getNum(event.card2);
game.log(event.target, "的拼点牌为", event.card2);
2023-07-27 09:56:09 +00:00
delete event.player;
2024-04-15 18:10:02 +00:00
event.trigger("compare");
} else {
game.delay(0, 1000);
2023-07-27 09:56:09 +00:00
event.goto(9);
}
2024-04-15 18:31:36 +00:00
"step 8";
2024-04-15 18:10:02 +00:00
var key = event.players.includes(target) ? "num1" : "num2";
2023-07-27 09:56:09 +00:00
event.result[key].push(event.num2);
event.iwhile++;
event.goto(7);
2024-04-15 18:31:36 +00:00
"step 9";
2024-04-15 18:10:02 +00:00
event.player = event.tempplayer;
2023-07-27 09:56:09 +00:00
delete event.tempplayer;
var str;
2024-04-15 18:31:36 +00:00
var num1 = event.result.num1.reduce((p, c) => p + c, 0) / event.result.num1.length,
num2 = event.result.num2.reduce((p, c) => p + c, 0) / event.result.num2.length;
game.log(event.player, "方的点数均值为", "#y" + Math.floor(num1 * 100) / 100);
game.log(event.targetx, "方的点数均值为", "#y" + Math.floor(num2 * 100) / 100);
2024-04-15 18:10:02 +00:00
if (num1 > num2) {
str = get.translation(event.players) + "拼点成功";
event.players.forEach((i) => i.popup("胜"));
event.targetsx.forEach((i) => i.popup("负"));
event.result.winner = event.players;
event.result.loser = event.targetsx;
} else {
str = get.translation(event.players) + "拼点失败";
if (num1 == num2) {
event.players.forEach((i) => i.popup("平"));
event.targetsx.forEach((i) => i.popup("平"));
2024-04-15 18:31:36 +00:00
event.result.loser = event.players.addArray(event.targetsx);
2024-04-15 18:10:02 +00:00
} else {
event.players.forEach((i) => i.popup("负"));
event.targetsx.forEach((i) => i.popup("胜"));
event.result.winner = event.targetsx;
event.result.loser = event.players;
2023-07-27 09:56:09 +00:00
}
}
2024-04-15 18:10:02 +00:00
game.broadcastAll(function (str) {
var dialog = ui.create.dialog(str);
dialog.classList.add("center");
setTimeout(function () {
2023-07-27 09:56:09 +00:00
dialog.close();
2024-04-15 18:10:02 +00:00
}, 1000);
}, str);
2023-07-27 09:56:09 +00:00
game.delay(3);
2024-04-15 18:31:36 +00:00
"step 10";
2023-07-27 09:56:09 +00:00
game.broadcastAll(ui.clear);
2024-04-15 18:31:36 +00:00
"step 11";
2023-07-27 09:56:09 +00:00
event.cards.add(event.card1);
},
2024-04-15 18:10:02 +00:00
contentx() {
"step 0";
var player = game.me;
event.player = player;
event._global_waiting = true;
event.result = [];
if (targets.includes(player)) {
2024-04-15 18:31:36 +00:00
if (event.fixedResult && event.fixedResult[player.playerid]) {
2024-04-15 18:10:02 +00:00
event.result[0] = player;
2024-04-15 18:31:36 +00:00
event.result[1] = event.fixedResult[player.playerid];
2023-07-27 09:56:09 +00:00
event.finish();
2024-04-15 18:10:02 +00:00
} else
player
.chooseCard("请选择拼点牌", true)
.set("type", "compare")
.set("glow_result", true)
.set("_global_waiting", true).ai = event.ai;
} else {
2023-07-27 09:56:09 +00:00
player.chooseCardTarget({
2024-04-15 18:10:02 +00:00
targets: targets,
filterTarget(card, player, target) {
return _status.event.targets.includes(target);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
selectCard: 1,
prompt: "是否于此次拼点加入其中一方?",
position: "h",
_global_waiting: true,
ai1: event.ai,
ai2(target) {
var player = _status.event.player,
sgn = -1;
2024-04-15 18:31:36 +00:00
if (player.hasCard((card) => get.number(card) > 10 && get.value(card) < 5))
2024-04-15 18:10:02 +00:00
sgn = 1;
return sgn * get.attitude(player, target);
2023-07-27 09:56:09 +00:00
},
});
}
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (targets.includes(player)) {
event.result[0] = player;
event.result[1] = result.cards[0];
event.result[2] = result.skill;
} else {
if (result.bool) {
event.result[0] = result.targets[0];
event.result[1] = result.cards[0];
} else {
event.result = [null, null];
2023-07-27 09:56:09 +00:00
}
}
},
2024-04-15 18:10:02 +00:00
$compareFenye(players, cards1, targets, cards2) {
game.broadcast(
function (players, cards1, targets, cards2) {
2024-04-15 18:31:36 +00:00
lib.skill["dddfenye"].$compareFenye(players, cards1, targets, cards2);
2024-04-15 18:10:02 +00:00
},
players,
cards1,
targets,
cards2
);
var left0 = -players.length * 52 - (players.length - 1) * 8;
for (var i = 0; i < players.length; i++) {
(function (target, card1, i) {
var left = left0 + i * 120;
2023-07-27 09:56:09 +00:00
var node1;
2024-04-15 18:10:02 +00:00
if (left < 0) {
node1 = target.$throwxy2(
card1,
"calc(50% - " + -left + "px)",
"calc(50% + 10px)",
"perspective(600px) rotateY(180deg)",
true
2023-07-27 09:56:09 +00:00
);
2024-04-15 18:10:02 +00:00
} else {
node1 = target.$throwxy2(
card1,
"calc(50% + " + left + "px)",
"calc(50% + 10px)",
"perspective(600px) rotateY(180deg)",
true
2023-07-27 09:56:09 +00:00
);
}
2024-04-15 18:10:02 +00:00
if (lib.config.cardback_style != "default") {
node1.style.transitionProperty = "none";
2023-07-27 09:56:09 +00:00
ui.refresh(node1);
2024-04-15 18:10:02 +00:00
node1.classList.add("infohidden");
2023-07-27 09:56:09 +00:00
ui.refresh(node1);
2024-04-15 18:10:02 +00:00
node1.style.transitionProperty = "";
} else {
node1.classList.add("infohidden");
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:31:36 +00:00
node1.style.transform = "perspective(600px) rotateY(180deg) translateX(0)";
2024-04-15 18:10:02 +00:00
var onEnd02 = function () {
2024-04-15 18:31:36 +00:00
node1.removeEventListener("webkitTransitionEnd", onEnd02);
2024-04-15 18:10:02 +00:00
setTimeout(function () {
node1.style.transition = "all ease-in 0.3s";
node1.style.transform =
"perspective(600px) rotateY(270deg) translateX(52px)";
var onEnd = function () {
node1.classList.remove("infohidden");
node1.style.transition = "all 0s";
2023-07-27 09:56:09 +00:00
ui.refresh(node1);
2024-04-15 18:10:02 +00:00
node1.style.transform =
"perspective(600px) rotateY(-90deg) translateX(52px)";
2023-07-27 09:56:09 +00:00
ui.refresh(node1);
2024-04-15 18:10:02 +00:00
node1.style.transition = "";
2023-07-27 09:56:09 +00:00
ui.refresh(node1);
2024-04-15 18:10:02 +00:00
node1.style.transform = "";
2024-04-15 18:31:36 +00:00
node1.removeEventListener("webkitTransitionEnd", onEnd);
2024-04-15 18:10:02 +00:00
};
2023-07-27 09:56:09 +00:00
node1.listenTransition(onEnd);
2024-04-15 18:10:02 +00:00
}, 200);
2023-07-27 09:56:09 +00:00
};
node1.listenTransition(onEnd02);
2024-04-15 18:10:02 +00:00
})(players[i], cards1[i], i);
}
setTimeout(function () {
2024-04-15 18:31:36 +00:00
var left0 = -targets.length * 52 - (targets.length - 1) * 8;
2024-04-15 18:10:02 +00:00
for (var i = 0; i < targets.length; i++) {
(function (target, card2, i) {
var left = left0 + i * 120;
2023-07-27 09:56:09 +00:00
var node2;
2024-04-15 18:10:02 +00:00
if (left < 0) {
node2 = target.$throwxy2(
card2,
"calc(50% - " + -left + "px)",
"calc(50% - 114px)",
"perspective(600px) rotateY(180deg)",
true
2023-07-27 09:56:09 +00:00
);
2024-04-15 18:10:02 +00:00
} else {
node2 = target.$throwxy2(
card2,
"calc(50% + " + left + "px)",
"calc(50% - 114px)",
"perspective(600px) rotateY(180deg)",
true
2023-07-27 09:56:09 +00:00
);
}
2024-04-15 18:10:02 +00:00
if (lib.config.cardback_style != "default") {
node2.style.transitionProperty = "none";
2023-07-27 09:56:09 +00:00
ui.refresh(node2);
2024-04-15 18:10:02 +00:00
node2.classList.add("infohidden");
2023-07-27 09:56:09 +00:00
ui.refresh(node2);
2024-04-15 18:10:02 +00:00
node2.style.transitionProperty = "";
} else {
node2.classList.add("infohidden");
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:31:36 +00:00
node2.style.transform = "perspective(600px) rotateY(180deg) translateX(0)";
2024-04-15 18:10:02 +00:00
var onEnd02 = function () {
2024-04-15 18:31:36 +00:00
node2.removeEventListener("webkitTransitionEnd", onEnd02);
2024-04-15 18:10:02 +00:00
setTimeout(function () {
2024-04-15 18:31:36 +00:00
node2.style.transition = "all ease-in 0.3s";
2024-04-15 18:10:02 +00:00
node2.style.transform =
"perspective(600px) rotateY(270deg) translateX(52px)";
var onEnd = function () {
2024-04-15 18:31:36 +00:00
node2.classList.remove("infohidden");
2024-04-15 18:10:02 +00:00
node2.style.transition = "all 0s";
2023-07-27 09:56:09 +00:00
ui.refresh(node2);
2024-04-15 18:10:02 +00:00
node2.style.transform =
"perspective(600px) rotateY(-90deg) translateX(52px)";
2023-07-27 09:56:09 +00:00
ui.refresh(node2);
2024-04-15 18:10:02 +00:00
node2.style.transition = "";
2023-07-27 09:56:09 +00:00
ui.refresh(node2);
2024-04-15 18:10:02 +00:00
node2.style.transform = "";
2024-04-15 18:31:36 +00:00
node2.removeEventListener("webkitTransitionEnd", onEnd);
2024-04-15 18:10:02 +00:00
};
2023-07-27 09:56:09 +00:00
node2.listenTransition(onEnd);
2024-04-15 18:10:02 +00:00
}, 200);
2023-07-27 09:56:09 +00:00
};
node2.listenTransition(onEnd02);
2024-04-15 18:10:02 +00:00
})(targets[i], cards2[i], i);
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
}, 200);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
ai: {
order: 1,
result: {
target: -1,
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
threaten: 1.3,
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
dddshichao: {
audio: 2,
trigger: {
player: "phaseZhunbeiBegin",
},
filter(event, player) {
2024-04-15 18:31:36 +00:00
return player.countMark("dddshichao") + 1 <= game.countPlayer();
2024-04-15 18:10:02 +00:00
},
onremove: true,
forced: true,
content() {
"step 0";
var N = player.countMark("dddshichao") + 1;
player
.chooseTarget(
2024-04-15 18:31:36 +00:00
"逝潮:选择一名手牌数第" + get.cnNumber(N) + "大的角色",
2024-04-15 18:10:02 +00:00
true,
(card, player, target) => {
return _status.event.targets.includes(target);
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
)
.set("ai", (target) => {
2024-04-15 18:31:36 +00:00
var zhu = get.zhu(player) || game.filterPlayer((i) => i.getSeatNum() == 1)[0];
2024-04-15 18:10:02 +00:00
return Math.min(
target.countCards("h") - player.countCards("h"),
zhu.maxHp - player.countCards("h")
);
})
.set(
"targets",
(function () {
var list = game
.filterPlayer()
.map((i) => [i, i.countCards("h")])
.sort((a, b) => b[1] - a[1]);
var targets = [];
var ind = 0,
tmp = Infinity;
for (var i of list) {
if (i[1] < tmp) {
ind++;
tmp = i[1];
}
if (ind == N) {
targets.push(i[0]);
}
if (ind > N) break;
}
if (!targets.length)
targets = game.filterPlayer(
2024-04-15 18:31:36 +00:00
(i) => i.countCards("h") == list[list.length - 1][1]
2024-04-15 18:10:02 +00:00
);
return targets;
})()
);
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var target = result.targets[0];
player.logSkill("dddshichao", target);
2024-04-15 18:31:36 +00:00
var zhu = get.zhu(player) || game.filterPlayer((i) => i.getSeatNum() == 1)[0];
2024-04-15 18:10:02 +00:00
var del = Math.min(
target.countCards("h") - player.countCards("h"),
zhu.maxHp - player.countCards("h")
);
if (del > 0) player.draw(del);
if (del < 0) player.chooseToDiscard(-del, true);
target.addSkill("dddshichao_up");
target.markAuto("dddshichao_up", [player]);
player.addTempSkill("dddshichao_clear", {
player: "phaseBegin",
});
player.markAuto("dddshichao_clear", [target]);
2023-07-27 09:56:09 +00:00
}
},
2024-04-15 18:10:02 +00:00
subSkill: {
up: {
trigger: { source: "damageBegin2" },
filter(event, player) {
2024-04-15 18:31:36 +00:00
return player.getStorage("dddshichao_up").includes(event.player);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
charlotte: true,
check(event, player) {
2024-04-15 18:31:36 +00:00
var eff = get.damageEffect(event.player, player, player);
2024-04-15 18:10:02 +00:00
return (
2024-04-15 18:31:36 +00:00
(event.player.hasSkill("dddshichao") && eff < 0) ||
2024-04-15 18:10:02 +00:00
(event.num == 1 && eff < 13)
);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
logTarget: "player",
content() {
"step 0";
2023-07-27 09:56:09 +00:00
trigger.cancel();
2024-04-15 18:10:02 +00:00
if (trigger.player.hasSkill("dddshichao")) {
trigger.player.addMark("dddshichao", 1, false);
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
clear: {
charlotte: true,
onremove(player) {
game.filterPlayer((current) => {
current.unmarkAuto("dddshichao_up", [player]);
2023-07-27 09:56:09 +00:00
});
2024-04-15 18:10:02 +00:00
},
},
},
2023-07-27 09:56:09 +00:00
},
//管宁
2024-04-15 18:10:02 +00:00
dddyouxue: {
audio: 2,
trigger: { global: "roundStart" },
forced: true,
content() {
"step 0";
2024-04-15 18:31:36 +00:00
if (!game.hasPlayer((current) => current.hasMark("dddyouxue")))
2024-04-15 18:10:02 +00:00
player.addMark("dddyouxue");
2024-04-15 18:31:36 +00:00
if (!game.hasPlayer((current) => !current.hasMark("dddyouxue"))) event.finish();
"step 1";
2024-04-15 18:10:02 +00:00
player
2024-04-15 18:31:36 +00:00
.chooseTarget("游学:将“游学”标记交给另一名角色", true, (card, player, target) => {
return !target.hasMark("dddyouxue");
})
2024-04-15 18:10:02 +00:00
.set("ai", (target) => {
return get.distance(
2024-04-15 18:31:36 +00:00
game.findPlayer((current) => current.hasMark("dddyouxue")),
2024-04-15 18:10:02 +00:00
target
);
});
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var target = result.targets[0];
2024-04-15 18:31:36 +00:00
var source = game.findPlayer((current) => current.hasMark("dddyouxue"));
2024-04-15 18:10:02 +00:00
if (source == player) player.line(target, "green");
else player.line2([source, target], "green");
source.clearMark("dddyouxue");
target.addMark("dddyouxue");
player.draw(get.distance(source, target));
}
},
marktext: "游",
intro: {
name: "游学",
content: () =>
2024-04-15 18:31:36 +00:00
get.translation(game.filterPlayer((current) => current.hasSkill("dddyouxue"))) +
"到此一游",
2023-11-12 08:16:18 +00:00
},
},
2024-04-15 18:10:02 +00:00
dddchengjing: {
audio: 2,
trigger: { global: "phaseEnd" },
filter(event, player) {
if (!event.player.hasMark("dddyouxue")) return false;
return event.player.hasHistory("useCard", (evt) => {
2024-04-15 18:31:36 +00:00
if (!["basic", "trick"].includes(get.type(evt.card))) return false;
if (!evt.card.isCard || evt.cards.length != 1) return false;
2024-04-15 18:10:02 +00:00
return get.position(evt.cards[0], true) == "d";
2023-11-12 08:16:18 +00:00
});
},
2024-04-15 18:10:02 +00:00
forced: true,
locked: false,
group: "dddchengjing_use",
logTarget: "player",
*content(event, map) {
const player = map.player,
trigger = map.trigger,
target = trigger.player;
let history = target.getHistory("useCard").reverse();
let cards = [];
for (var evt of history) {
2024-04-15 18:31:36 +00:00
if (!["basic", "trick"].includes(get.type(evt.card))) continue;
2024-04-15 18:10:02 +00:00
if (!evt.card.isCard || evt.cards.length != 1) continue;
if (get.position(evt.cards[0], true) == "d") {
2023-11-12 08:16:18 +00:00
cards.addArray(evt.cards);
break;
}
}
2024-04-15 18:10:02 +00:00
const jing = player.getExpansions("dddchengjing");
if (jing.length) player.loseToDiscardpile(jing);
2024-04-15 18:31:36 +00:00
player.addToExpansion(cards, "log", "gain2").gaintag.add("dddchengjing");
2024-04-15 18:10:02 +00:00
},
marktext: "经",
intro: {
name: "经(承经)",
name2: "经",
markcount: "expansion",
content: "expansion",
},
subSkill: {
use: {
audio: "dddchengjing",
enable: "phaseUse",
usable: 1,
filterCard: true,
position: "hes",
filter(event, player) {
2024-04-15 18:31:36 +00:00
return player.getExpansions("dddchengjing").length > 0;
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
viewAs(cards, player) {
2024-04-15 18:31:36 +00:00
const card = player.getExpansions("dddchengjing")[0];
2023-11-12 08:16:18 +00:00
return new lib.element.VCard({
2024-04-15 18:10:02 +00:00
name: get.name(card, false),
nature: get.nature(card, false),
storage: { dddchengjing: true },
2023-11-12 08:16:18 +00:00
});
},
2024-04-15 18:10:02 +00:00
popname: true,
prompt() {
2024-04-15 18:31:36 +00:00
const card = get.player().getExpansions("dddchengjing")[0];
2024-04-15 18:10:02 +00:00
return (
"将一张牌当" +
get.translation({
name: get.name(card, false),
nature: get.nature(card, false),
}) +
"使用"
);
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
precontent() {
player
.when("useCardAfter")
.filter((evt) => evt.card.storage.dddchengjing)
.then(() => {
var cards = trigger.cards.filterInD("od");
if (!cards.length) {
event.finish();
return;
}
2024-04-15 18:31:36 +00:00
var target = game.findPlayer((current) => current.hasMark("dddyouxue"));
2024-04-15 18:10:02 +00:00
if (!target) {
event.finish();
return;
}
target = target.getNext();
event.target = target;
player
.chooseBool(
2024-04-15 18:31:36 +00:00
`承经:是否将${get.translation(cards)}交给${get.translation(
target
)}`
2024-04-15 18:10:02 +00:00
)
2024-04-15 18:31:36 +00:00
.set("choice", get.attitude(player, target) > 0);
2024-04-15 18:10:02 +00:00
})
.then(() => {
if (result.bool) {
player.line(event.target);
player.addExpose(0.1);
2024-04-15 18:31:36 +00:00
event.target.gain(trigger.cards.filterInD("od"), "gain2");
2024-04-15 18:10:02 +00:00
}
});
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
},
2023-11-12 08:16:18 +00:00
},
2024-04-19 11:36:34 +00:00
ai: {
combo: "dddyouxue"
},
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
dddyouxue_old: {
audio: 2,
trigger: { global: "roundStart" },
forced: true,
content() {
"step 0";
var vpos = player.hasMark("dddyouxue_old")
2024-04-15 18:31:36 +00:00
? game.filterPlayer2((i) => i.getSeatNum() == player.countMark("dddyouxue_old"))[0]
2024-04-15 18:10:02 +00:00
: player;
event.vpos = vpos;
player
.chooseTarget("游学:选择你的行动次序", true)
.set("ai", (target) => {
return get.distance(_status.event.vpos, target);
})
.set("vpos", vpos);
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var target = result.targets[0];
if (event.vpos == player) player.line(target, "green");
else player.line2([event.vpos, target], "green");
event.num = get.distance(event.vpos, target);
player.storage["dddyouxue_old"] = target.getSeatNum();
player.addSkill("dddyouxue_old_act");
player.markSkill("dddyouxue_old");
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
var next = player.phaseDraw();
next.set("num", num);
2023-07-27 09:56:09 +00:00
delete next.skill;
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
player.skip("phaseDraw");
},
marktext: "虚",
intro: {
name: "虚位",
content: "当前虚位为#号",
},
subSkill: {
act: {
trigger: {
2024-04-15 18:31:36 +00:00
global: ["phaseBefore", "phaseAfter", "phaseYouxueed"],
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
forced: true,
firstDo: true,
charlotte: true,
filter(event, player, name) {
if (event.skill) return false;
var vseat = player.countMark("dddyouxue_old");
if (name != "phaseBefore") {
2024-04-15 18:31:36 +00:00
if (player.hasSkill("dddyouxue_old_acted", null, false, false)) return false;
2024-04-15 18:10:02 +00:00
var seat = event.player.getSeatNum();
var next = event.player.next;
2024-04-15 18:31:36 +00:00
if (!game.players.includes(next)) next = game.findNext(next);
2024-04-15 18:10:02 +00:00
var seat2 = next.getSeatNum();
if (seat == seat2) return false;
2024-04-15 18:31:36 +00:00
if (seat < seat2) return vseat > seat && vseat <= seat2;
2024-04-15 18:10:02 +00:00
return seat2 >= vseat;
} else {
return event.player == player;
2023-08-03 06:46:53 +00:00
}
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
content() {
if (event.triggername == "phaseBefore") {
2023-07-27 09:56:09 +00:00
trigger.finish();
trigger.untrigger(true);
2024-04-15 18:10:02 +00:00
trigger._triggered = 5;
trigger.trigger("phaseYouxueed");
} else {
player.insertPhase("dddyouxue_old_act");
2024-04-15 18:31:36 +00:00
player.addTempSkill("dddyouxue_old_acted", "roundStart");
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
acted: { charlotte: true },
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
dddchengjing_old: {
audio: 2,
usable: 1,
enable: "phaseUse",
filter(event, player) {
return (
player.countCards("hes") > 0 &&
player.countMark("dddyouxue_old") > 0 &&
lib.skill["dddchengjing_old"].getList(player).length > 0
);
},
getList(player) {
var vpos = player.hasMark("dddyouxue_old")
2024-04-15 18:31:36 +00:00
? game.filterPlayer2((i) => i.getSeatNum() == player.countMark("dddyouxue_old"))[0]
2024-04-15 18:10:02 +00:00
: player;
if (!vpos || !vpos.isIn()) return [];
var vcard = [];
var history = vpos
.getPrevious()
2024-04-15 18:31:36 +00:00
.actionHistory.filter((evt) => !evt.custom.some((i) => i["dddyouxue_old"]));
2024-04-15 18:10:02 +00:00
history = history[history.length - 2];
var evts = history.useCard;
for (var evt of evts) {
var card = evt.card;
var type = get.type(card);
if (type != "basic" && type != "trick") continue;
if (card.name == "sha") {
vcard.push(["基本", "", card.name, card.nature]);
} else vcard.push([type, "", card.name]);
2023-07-27 09:56:09 +00:00
}
return vcard;
},
2024-04-15 18:10:02 +00:00
chooseButton: {
dialog(event, player) {
2024-04-15 18:31:36 +00:00
var list = lib.skill["dddchengjing_old"].getList(player);
2024-04-15 18:10:02 +00:00
list.sort((a, b) => {
return (
2024-04-15 18:31:36 +00:00
100 * (lib.inpile.indexOf(a[2]) - lib.inpile.indexOf(b[2])) +
2024-04-15 18:10:02 +00:00
lib.inpile_nature.indexOf(a[3]) -
lib.inpile_nature.indexOf(b[3])
);
2023-07-27 09:56:09 +00:00
});
2024-04-15 18:10:02 +00:00
list.filter((vcard) => {
2024-04-15 18:31:36 +00:00
return event.filterCard({ name: vcard[2], nature: vcard[3] }, player, event);
2024-04-15 18:10:02 +00:00
});
return ui.create.dialog("承经", [list, "vcard"]);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
filter(button, player) {
return _status.event
.getParent()
2024-04-15 18:31:36 +00:00
.filterCard({ name: button.link[2] }, player, _status.event.getParent());
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
check(button) {
if (_status.event.getParent().type != "phase") return 1;
var player = _status.event.player;
2023-07-27 09:56:09 +00:00
return player.getUseValue({
2024-04-15 18:10:02 +00:00
name: button.link[2],
nature: button.link[3],
2023-07-27 09:56:09 +00:00
});
},
2024-04-15 18:10:02 +00:00
backup(links, player) {
2023-07-27 09:56:09 +00:00
return {
2024-04-15 18:10:02 +00:00
filterCard: true,
audio: "dddchengjing_old",
popname: true,
check(card) {
return 8 - get.value(card);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
position: "hes",
viewAs: {
name: links[0][2],
nature: links[0][3],
storage: { dddchengjing_old: true },
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
precontent() {
player.addTempSkill("dddchengjing_old_effect");
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
};
},
prompt(links, player) {
return (
"将一张牌当做" +
(get.translation(links[0][3]) || "") +
get.translation(links[0][2]) +
"使用"
);
2023-07-27 09:56:09 +00:00
},
},
2024-04-15 18:10:02 +00:00
ai: {
combo: "dddyouxue_old",
order: 1,
result: {
player: 1,
2023-07-27 09:56:09 +00:00
},
},
2024-04-15 18:10:02 +00:00
subSkill: {
effect: {
audio: "dddchengjing_old",
trigger: { global: "useCardAfter" },
charlotte: true,
direct: true,
filter(event, player) {
2024-04-15 18:31:36 +00:00
return event.card && event.card.storage && event.card.storage["dddchengjing_old"];
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
content() {
"step 0";
var damaged = game.hasPlayer2((current) =>
2024-04-15 18:31:36 +00:00
current.hasHistory("damage", (evt) => evt.card == trigger.card)
2024-04-15 18:10:02 +00:00
);
event.damaged = damaged;
var vpos = player.hasMark("dddyouxue_old")
? game.filterPlayer2(
2024-04-15 18:31:36 +00:00
(i) => i.getSeatNum() == player.countMark("dddyouxue_old")
2024-04-15 18:10:02 +00:00
)[0]
: player;
var target = vpos.getNext();
event.target = target;
player
.chooseControl(" +1 ", " -1 ", "cancel2")
.set(
"prompt",
"是否令“虚位”下家(" +
get.translation(target) +
")下回合的" +
(damaged ? "摸牌数" : "手牌上限") +
"+1或-1"
)
.set("ai", function () {
var sgn = get.sgn(
2024-04-15 18:31:36 +00:00
get.attitude(_status.event.player, _status.event.target)
2024-04-15 18:10:02 +00:00
);
if (sgn == 0) return 2;
if (sgn == 1) return 0;
return 1;
})
.set("target", target);
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.index != 2) {
2024-04-15 18:31:36 +00:00
player.logSkill("dddchengjing_old_effect", target);
var name = (event.damaged ? "draw" : "limit") + result.index;
2024-04-15 18:10:02 +00:00
target.addTempSkill("dddchengjing_old_check", {
player: "phaseAfter",
});
2024-04-15 18:31:36 +00:00
target.addMark("dddchengjing_old_" + name, 1, false);
2024-04-15 18:10:02 +00:00
game.log(
target,
2024-04-15 18:31:36 +00:00
"下回合的" + (event.damaged ? "摸牌数" : "手牌上限"),
2024-04-15 18:10:02 +00:00
"#y" + ["+1", "-1"][result.index]
);
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
check: {
trigger: { player: "phaseDrawBegin2" },
charlotte: true,
forced: true,
filter(event, player) {
return (
2024-04-15 18:31:36 +00:00
player.countMark("dddchengjing_old_draw0") > 0 ||
2024-04-15 18:10:02 +00:00
player.countMark("dddchengjing_old_draw1") > 0
);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
content() {
trigger.num +=
player.countMark("dddchengjing_old_draw0") -
player.countMark("dddchengjing_old_draw1");
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
mod: {
maxHandcard(player, num) {
return (
num +
2024-04-15 18:31:36 +00:00
player.countMark("dddchengjing_old_limit0") -
2024-04-15 18:10:02 +00:00
player.countMark("dddchengjing_old_limit1")
);
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
onremove(player) {
delete player.storage["dddchengjing_old_draw0"];
delete player.storage["dddchengjing_old_draw1"];
delete player.storage["dddchengjing_old_limit0"];
delete player.storage["dddchengjing_old_limit1"];
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
mark: true,
marktext: "承",
intro: {
name: "承经",
content(storage, player) {
var str = "";
if (
2024-04-15 18:31:36 +00:00
player.countMark("dddchengjing_old_draw0") ||
2024-04-15 18:10:02 +00:00
player.countMark("dddchengjing_old_draw1")
) {
var num =
2024-04-15 18:31:36 +00:00
player.countMark("dddchengjing_old_draw0") -
player.countMark("dddchengjing_old_draw1");
str += "<li>摸牌阶段摸牌数" + (num >= 0 ? "+" : "") + num;
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
if (
2024-04-15 18:31:36 +00:00
player.countMark("dddchengjing_old_limit0") ||
2024-04-15 18:10:02 +00:00
player.countMark("dddchengjing_old_limit1")
) {
var num =
2024-04-15 18:31:36 +00:00
player.countMark("dddchengjing_old_limit0") -
player.countMark("dddchengjing_old_limit1");
str += "<li>手牌上限" + (num >= 0 ? "+" : "") + num;
2023-07-27 09:56:09 +00:00
}
return str;
2024-04-15 18:10:02 +00:00
},
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
draw0: { charlotte: true },
draw1: { charlotte: true },
limit0: { charlotte: true },
limit1: { charlotte: true },
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
dddduanbing: {
enable: "phaseUse",
filter(event, player) {
return (
player.canAddJudge("bingliang") &&
2024-04-15 18:31:36 +00:00
player.hasCard((card) => lib.skill["dddduanbing"].filterCard(card, player), "he")
2024-04-15 18:10:02 +00:00
);
},
filterCard(card, player) {
2024-04-15 18:31:36 +00:00
if (get.color(card) != "black" || get.type2(card) == "trick") return false;
return player.canAddJudge(get.autoViewAs({ name: "bingliang" }, [card]));
2024-04-15 18:10:02 +00:00
},
check(card) {
return 8.2 - get.value(card);
},
discard: false,
lose: false,
delay: false,
prepare: "throw",
group: "dddduanbing_effect",
position: "he",
content() {
"step 0";
player.addJudge({ name: "bingliang" }, cards);
2024-04-15 18:31:36 +00:00
"step 1";
2023-07-27 09:56:09 +00:00
game.delayx();
player.draw(2);
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
player.chooseUseTarget(
{
name: "sha",
isCard: true,
storage: { _dddduanbing: true },
},
false,
"nodistance"
);
},
ai: {
order(item, player) {
return get.order({ name: "sha" }) - 0.1;
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
result: {
player(player) {
return player.getUseValue({ name: "sha" }, false);
2023-07-27 09:56:09 +00:00
},
},
},
2024-04-15 18:10:02 +00:00
subSkill: {
effect: {
trigger: { source: "damageSource" },
charlotte: true,
filter(event, player) {
2024-04-15 18:31:36 +00:00
if (event.getParent().type != "card" || !event.player.isIn()) return false;
2024-04-15 18:10:02 +00:00
return player.hasCard((card) => {
return (
(card.viewAs || card.name) == "bingliang" &&
event.player.canAddJudge(card)
);
}, "j");
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:31:36 +00:00
prompt: (event) => "是否将【兵粮寸断】转移给" + get.translation(event.player) + "",
2024-04-15 18:10:02 +00:00
check(event, player) {
return player.hasCard((card) => {
return (
(card.viewAs || card.name) == "bingliang" &&
event.player.canAddJudge(card) &&
get.effect(
event.player,
new lib.element.VCard({
name: "bingliang",
cards: [card],
}),
player,
_status.event.player
) >= 0
);
}, "j");
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
content() {
var cards = player.getCards("j", (card) => {
return (
(card.viewAs || card.name) == "bingliang" &&
trigger.player.canAddJudge(card)
);
2023-11-12 08:16:18 +00:00
});
2024-04-15 18:10:02 +00:00
var target = trigger.player;
2023-07-27 09:56:09 +00:00
player.line(target);
2024-04-15 18:10:02 +00:00
player.$give(cards, target, false);
cards.forEach((card) => {
target.addJudge({ name: "bingliang" }, card);
2023-11-12 08:16:18 +00:00
});
2023-07-27 09:56:09 +00:00
},
},
},
},
//轲比能
2024-04-15 18:10:02 +00:00
dddxiaoxing: {
audio: 2,
trigger: { global: "gameDrawBegin" },
forced: true,
group: "dddxiaoxing_remove",
init(player, skill) {
if (game.online) return;
var bool = get.event().getParent("phaseLoop", true);
if (!bool) return;
if (player.hasSkill(skill)) {
player.logSkill("dddxiaoxing");
2023-11-12 08:16:18 +00:00
player.draw(3);
}
},
2024-04-15 18:10:02 +00:00
content() {
var me = player;
var numx = trigger.num;
trigger.num =
typeof numx == "function"
? function (player) {
if (player == me) {
return 3 + numx(player);
}
return numx(player);
}
: function (player) {
if (player == me) {
return 3 + numx;
}
return numx;
};
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
mod: {
attackRange: (player, num) => num + 3,
maxHandcard: (player, num) => num + 3,
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
subSkill: {
remove: {
trigger: { player: "dying" },
forced: true,
2023-11-12 08:16:18 +00:00
// direct:true,
// filter(event,player){
2023-11-12 08:16:18 +00:00
// return event.source&&event.source.isIn()&&event.source.getEquips(1).length>0;
// },
2024-04-15 18:10:02 +00:00
content() {
player.removeSkills("dddxiaoxing");
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
content_old() {
"step 0";
trigger.source
2024-04-15 18:31:36 +00:00
.chooseBool(get.prompt("dddxiaoxing", player), "废除武器栏,令其失去〖枭行〗")
2024-04-15 18:10:02 +00:00
.set("ai", () => {
2024-04-15 18:31:36 +00:00
if (_status.event.maybe) return Math.random() < 0.5;
2024-04-15 18:10:02 +00:00
return false;
})
.set(
"maybe",
player.countCards("hs", {
name: ["tao", "jiu"],
}) && player.countCards("h") >= 3
);
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
trigger.source.logSkill("dddxiaoxing", player);
2023-07-27 09:56:09 +00:00
trigger.source.disableEquip(1);
2024-04-15 18:10:02 +00:00
player.removeSkills("dddxiaoxing");
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
},
},
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
dddlangzhi: {
audio: 2,
trigger: { player: "phaseJieshuBegin" },
logTarget(event, player) {
return game.filterPlayer(
2024-04-15 18:31:36 +00:00
(current) => player.inRange(current) && current.countCards("he")
2024-04-15 18:10:02 +00:00
);
},
prompt: "是否发动【狼志】?",
prompt2(event, player) {
return `展示${get.translation(
2024-04-15 18:31:36 +00:00
game.filterPlayer((current) => player.inRange(current) && current.countCards("he"))
2024-04-15 18:10:02 +00:00
)}的各一张牌然后选择一项1.用任意张牌替换其中等量张牌2.获得所有展示牌失去狼志`;
},
content() {
"step 0";
event.targets = game.filterPlayer(
2024-04-15 18:31:36 +00:00
(current) => player.inRange(current) && current.countCards("he")
2024-04-15 18:10:02 +00:00
);
event.cards = [];
event.num = 0;
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
var target = targets[num];
2023-07-27 09:56:09 +00:00
event.num++;
2024-04-15 18:10:02 +00:00
event.target = target;
player.choosePlayerCard(
"狼志:展示" + get.translation(target) + "一张牌",
"he",
target,
true
);
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var card = result.links[0];
2024-04-15 18:31:36 +00:00
player.showCards(card, get.translation(target) + "被展示");
2023-07-27 09:56:09 +00:00
event.cards.push(card);
}
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
if (num < targets.length) event.goto(1);
else {
event.videoId = lib.status.videoId++;
if (event.isMine()) {
event.dialog = ui.create.dialog(
'###是否替换其中的任意张牌?###<div class="text center">或点击“取消”,获得所有展示牌,然后失去〖狼志〗</div>',
cards
);
event.dialog.videoId = event.videoId;
} else if (player.isOnline2()) {
player.send(
function (cards, id) {
var dialog = ui.create.dialog(
'###是否替换其中的任意张牌?###<div class="text center">或点击“取消”,获得所有展示牌,然后失去〖狼志〗</div>',
cards
);
dialog.videoId = id;
},
cards,
event.videoId
);
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
player
.chooseCard([1, cards.length], "he")
.set("ai", (card) => {
2024-04-15 18:31:36 +00:00
if (ui.selected.cards.length >= _status.event.num) return 0;
2024-04-15 18:10:02 +00:00
return 100 - get.value(card);
})
.set(
"num",
(function () {
2024-04-15 18:31:36 +00:00
if (cards.length < Math.floor(game.countPlayer() / 2 - 0.5)) return 0;
var val = cards.reduce((p, c) => p + get.value(c), 0);
2024-04-15 18:10:02 +00:00
if (val < cards.length * 6) return 0;
2024-04-15 18:31:36 +00:00
var list1 = player.getCards("he").map((card) => get.value(card, player)),
2024-04-15 18:10:02 +00:00
list2 = cards.map(
(card, i) =>
get.value(card, targets[i]) *
2024-04-15 18:31:36 +00:00
get.sgnAttitude(player, targets[i])
2024-04-15 18:10:02 +00:00
);
list1.sort((a, b) => a[1] - b[1]);
list2.sort((a, b) => b[1] - a[1]);
list2 = list2.filter((i) => i > 0);
var count = 0;
for (var i of list2) {
for (var j = 0; j < list1.length; j++) {
if (i > list1[j]) {
count++;
list1.splice(j, 1);
break;
}
}
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
return count;
})()
)
.set("prompt", false);
}
2024-04-15 18:31:36 +00:00
"step 4";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var cards2 = result.cards;
event.cards2 = cards2;
var func = function (id) {
var dialog = get.idDialog(id);
if (dialog)
dialog.content.childNodes[1].innerHTML =
'<div class="text center">选择要交换的牌(按选择的顺序一一交换)</div>';
2023-07-27 09:56:09 +00:00
};
2024-04-15 18:10:02 +00:00
if (event.isMine()) func(event.videoId);
2024-04-15 18:31:36 +00:00
else if (player.isOnline2()) player.send(func, event.videoId);
2024-04-15 18:10:02 +00:00
player
.chooseButton(cards2.length, true)
.set("dialog", event.videoId)
.set("ai", (button) => {
return get.value(button.link);
});
2023-07-27 09:56:09 +00:00
event.goto(6);
2024-04-15 18:10:02 +00:00
} else {
for (var i = 0; i < cards.length; i++) {
targets[i].$give(cards[i], player, false);
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
player.gain(cards, "log");
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:31:36 +00:00
"step 5";
2024-04-15 18:10:02 +00:00
player.removeSkills("dddlangzhi");
2023-07-27 09:56:09 +00:00
event.finish();
2024-04-15 18:31:36 +00:00
"step 6";
2024-04-15 18:10:02 +00:00
game.broadcastAll("closeDialog", event.videoId);
if (result.bool) {
var cards2 = event.cards2,
cards3 = result.links;
if (cards2.length != cards3.length) return;
for (var i = 0; i < cards2.length; i++) {
2024-04-15 18:31:36 +00:00
player.swapHandcards(get.owner(cards3[i]), [cards2[i]], [cards3[i]]);
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 7";
2023-07-27 09:56:09 +00:00
game.delayx();
2024-04-15 18:10:02 +00:00
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
dddfuyi: {
audio: 2,
zhuSkill: true,
trigger: {
2023-11-12 08:16:18 +00:00
// global:['discardBegin','drawBegin'],
2024-04-15 18:10:02 +00:00
global: "dieAfter",
},
filter(event, player) {
2024-04-15 18:31:36 +00:00
if (!event.source || !event.source.isIn() || event.source.group != "qun") return false;
2024-04-15 18:10:02 +00:00
if (!event.source.countCards("he") < 2) return false;
2024-04-15 18:31:36 +00:00
if (!player.hasZhuSkill("dddfuyi", event.source)) return false;
const skills = player.getStockSkills(true, true).filter((skill) => {
return !player.hasSkill(skill, null, false, false);
});
2024-04-15 18:10:02 +00:00
return skills.length > 0;
},
filter_old(event, player) {
var evt = event.getParent();
2024-04-15 18:31:36 +00:00
if (evt.name != "die" || evt.source != event.player || event.player == player)
2024-04-15 18:10:02 +00:00
return false;
2024-04-15 18:31:36 +00:00
if (!player.hasZhuSkill("dddfuyi", event.player)) return false;
var skills = player.getSkills("dddxiaoxing", null, false, false);
return !skills.includes("dddxiaoxing") || !skills.includes("dddlangzhi");
2024-04-15 18:10:02 +00:00
},
direct: true,
global: "dddfuyi_sha",
content() {
"step 0";
trigger.source
.chooseCard(
2024-04-15 18:31:36 +00:00
"是否响应" + get.translation(player) + "的【附义】?",
2024-04-15 18:10:02 +00:00
"弃置两张牌,令其获得其武将牌上的一个技能",
"he",
2,
lib.filter.cardDiscardable
)
.set("ai", () => {
2024-04-15 18:31:36 +00:00
if (get.attitude(_status.event.player, _status.event.getParent().player) <= 2)
2024-04-15 18:10:02 +00:00
return 0;
return 6 - get.value(card);
2023-11-12 08:16:18 +00:00
});
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
player.logSkill("dddfuyi", trigger.source);
2024-04-15 18:31:36 +00:00
trigger.source.discard(result.cards).discarder = trigger.source;
var skills = player.getStockSkills(true, true).filter((skill) => {
return !player.hasSkill(skill, null, false, false);
});
if (skills.length == 1) event._result = { control: skills[0] };
2024-04-15 18:10:02 +00:00
else
trigger.source
.chooseControl(skills)
.set(
"choiceList",
skills.map((skill) => {
return (
'<div class="skill">【' +
get.translation(
lib.translate[skill + "_ab"] ||
2024-04-15 18:31:36 +00:00
get.translation(skill).slice(0, 2)
2024-04-15 18:10:02 +00:00
) +
"】</div><div>" +
2024-04-15 18:31:36 +00:00
get.skillInfoTranslation(skill, player) +
2024-04-15 18:10:02 +00:00
"</div>"
);
})
)
.set("displayIndex", false)
2024-04-15 18:31:36 +00:00
.set("prompt", `附义:选择令${get.translation(player)}获得一个技能`)
2024-04-15 18:10:02 +00:00
.set("ai", () => {
var controls = get.event("controls");
2024-04-15 18:31:36 +00:00
if (controls.includes("dddxiaoxing")) return "dddxiaoxing";
2024-04-15 18:10:02 +00:00
return controls.sort((a, b) => {
2024-04-15 18:31:36 +00:00
return get.skillrank(b, "inout") - get.skillrank(a, "inout");
2024-04-15 18:10:02 +00:00
})[0];
});
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
var skill = result.control;
2024-02-13 16:53:45 +00:00
player.addSkills(skill);
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
content_old() {
"step 0";
var str = "取消此次奖惩,令其获得";
2024-04-15 18:31:36 +00:00
var skills = player.getSkills("dddxiaoxing", null, false, false);
2024-04-15 18:10:02 +00:00
var bool1 = !skills.includes("dddxiaoxing"),
bool2 = !skills.includes("dddlangzhi");
var choices = [];
if (bool1) {
str += "〖枭行〗";
choices.push("dddxiaoxing");
}
if (bool1 && bool2) str += "/";
if (bool2) {
str += "〖狼志〗";
choices.push("dddlangzhi");
}
if (bool1 && bool2) {
str += "中的一或两个";
choices.push("dddfuyi_both");
}
choices.push("cancel2");
trigger.player
.chooseControl(choices)
2024-04-15 18:31:36 +00:00
.set("prompt", "是否对" + get.translation(player) + "发动【附义】?")
2024-04-15 18:10:02 +00:00
.set("prompt2", str)
.set("ai", () => {
2024-04-15 18:31:36 +00:00
if (get.attitude(_status.event.player, _status.event.getParent().player) <= 2)
2024-04-15 18:10:02 +00:00
return "cancel2";
2024-04-15 18:31:36 +00:00
if (_status.event.choices.includes("dddfuyi_both")) return "dddfuyi_both";
if (_status.event.choices.includes("dddlangzhi")) return "dddlangzhi";
return Math.random() < 0.5 ? "dddxiaoxing" : "cancel2";
2024-04-15 18:10:02 +00:00
});
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.control != "cancel2") {
trigger.player.logSkill("dddfuyi", player);
2023-07-27 09:56:09 +00:00
trigger.cancel();
2024-04-15 18:10:02 +00:00
var skills = [result.control];
if (result.control == "dddfuyi_both") {
skills = ["dddxiaoxing", "dddlangzhi"];
2023-07-27 09:56:09 +00:00
player.draw(3);
2024-04-15 18:10:02 +00:00
} else event.finish();
2024-02-13 16:53:45 +00:00
player.addSkills(skills);
2024-04-15 18:10:02 +00:00
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
player.removeSkills("dddfuyi");
},
subSkill: {
sha: {
mod: {
cardUsable(card, player, num) {
if (card.name == "sha") {
if (player.group != "qun") return;
return (
num +
game.countPlayer((current) => {
2024-04-15 18:31:36 +00:00
return current.hasZhuSkill("dddfuyi", player);
2024-04-15 18:10:02 +00:00
})
);
2023-11-12 08:16:18 +00:00
}
},
},
},
},
2023-07-27 09:56:09 +00:00
},
//曹爽
2024-04-15 18:10:02 +00:00
dddzhuanshe: {
audio: 2,
trigger: { global: "phaseUseBegin" },
filter(event, player) {
return player.countCards("h") > 0 && event.player != player;
},
direct: true,
content() {
"step 0";
player
.chooseCard(get.prompt2("dddzhuanshe", trigger.player))
.set("ai", (card) => {
var target = _status.event.getTrigger().player;
if (!_status.event.goon) {
2024-04-15 18:31:36 +00:00
if (get.value(card) < 4) return -target.getUseValue(card) + 0.001;
2024-04-15 18:10:02 +00:00
return 0;
}
return target.getUseValue(card);
})
.set("goon", get.attitude(player, trigger.player));
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var card = result.cards[0];
player.logSkill("dddzhuanshe", trigger.player);
player.give(card, trigger.player, true);
player.addTempSkill("dddzhuanshe_effect");
player.markAuto("dddzhuanshe_effect", [card.name]);
}
},
subSkill: {
effect: {
audio: "dddzhuanshe",
trigger: { global: "useCard2" },
filter(event, player) {
2024-04-15 18:31:36 +00:00
if (!player.getStorage("dddzhuanshe_effect").includes(event.card.name))
2024-04-15 18:10:02 +00:00
return false;
2024-04-15 18:31:36 +00:00
if (event.player != _status.currentPhase) return false;
2024-04-15 18:10:02 +00:00
var type = get.type(event.card, null, false);
2024-04-15 18:31:36 +00:00
if (type != "basic" && type != "trick") return false;
2024-04-15 18:10:02 +00:00
var info = get.info(event.card);
if (info.allowMultiple == false) return false;
if (event.targets && !info.multitarget) {
if (
game.hasPlayer(function (current) {
return (
!event.targets.includes(current) &&
2024-04-15 18:31:36 +00:00
lib.filter.targetEnabled2(event.card, event.player, current)
2024-04-15 18:10:02 +00:00
);
})
) {
2023-07-27 09:56:09 +00:00
return true;
}
}
return false;
},
2024-04-15 18:10:02 +00:00
direct: true,
group: "dddzhuanshe_damage",
charlotte: true,
onremove: true,
content() {
"step 0";
2024-04-15 18:31:36 +00:00
var prompt2 = "为" + get.translation(trigger.card) + "增加一个目标";
2024-04-15 18:10:02 +00:00
player
.chooseTarget(
get.prompt("dddzhuanshe_effect"),
function (card, player, target) {
var player = _status.event.source;
return (
2024-04-15 18:31:36 +00:00
!_status.event.targets.includes(target) &&
lib.filter.targetEnabled2(_status.event.card, player, target)
2024-04-15 18:10:02 +00:00
);
}
)
.set("prompt2", prompt2)
.set("ai", function (target) {
var trigger = _status.event.getTrigger();
var player = _status.event.source;
2024-04-15 18:31:36 +00:00
return get.effect(target, trigger.card, player, _status.event.player);
2024-04-15 18:10:02 +00:00
})
.set("targets", trigger.targets)
.set("card", trigger.card)
.set("source", trigger.player);
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
2024-04-15 18:31:36 +00:00
if (!event.isMine() && !event.isOnline()) game.delayx();
2024-04-15 18:10:02 +00:00
event.targets = result.targets;
} else {
2023-07-27 09:56:09 +00:00
event.finish();
}
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (event.targets) {
player.logSkill(event.name, event.targets);
2023-07-27 09:56:09 +00:00
trigger.targets.addArray(event.targets);
2024-04-15 18:31:36 +00:00
game.log(event.targets, "也成为了", trigger.card, "的目标");
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
damage: {
audio: "dddzhuanshe",
trigger: { global: "phaseEnd" },
filter(event, player) {
2024-04-15 18:31:36 +00:00
var list = player.getStorage("dddzhuanshe_effect").slice();
2024-04-15 18:10:02 +00:00
event.player.getHistory("useCard", (evt) => {
2023-07-27 09:56:09 +00:00
list.remove(evt.card.name);
2024-04-15 18:10:02 +00:00
});
2023-07-27 09:56:09 +00:00
return list.length;
},
2024-04-15 18:10:02 +00:00
charlotte: true,
logTarget: "player",
prompt2: "对其造成1点伤害",
check(event, player) {
2024-04-15 18:31:36 +00:00
return get.damageEffect(event.player, player, player) >= 0;
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
content() {
2023-07-27 09:56:09 +00:00
trigger.player.damage(player);
2024-04-15 18:10:02 +00:00
},
},
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
dddweiqiu: {
audio: 2,
trigger: { global: "recoverBefore" },
filter(event, player) {
return !player.countCards("h");
},
forced: true,
direct: true,
content() {
trigger.player.logSkill("dddweiqiu", player);
2023-07-27 09:56:09 +00:00
trigger.cancel();
player.draw();
2024-04-15 18:10:02 +00:00
},
2023-07-27 09:56:09 +00:00
},
//薛灵芸
2024-04-15 18:10:02 +00:00
dddlianer: {
audio: 2,
trigger: { player: "useCardAfter" },
filter(event, player) {
2024-04-15 18:31:36 +00:00
return event.cards.filterInD("od").length > 0 && get.color(event.card) == "red";
2024-04-15 18:10:02 +00:00
},
content() {
"step 0";
var cards = trigger.cards.filterInD("od");
event.cards = cards;
player.gain(cards, "gain2");
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
var number = get.number(cards[0]);
if (cards.length == 1 && typeof number == "number") {
player.addTempSkill("dddlianer_ceiling");
player.storage["dddlianer_ceiling"] = number;
}
},
mod: {
aiOrder(player, card, num) {
2024-04-15 18:31:36 +00:00
if (get.itemtype(card) == "card" && get.color(card) == "red") {
2024-04-15 18:10:02 +00:00
if (!player.storage["dddlianer_ceiling"]) return;
var numx = get.number(card);
if (typeof numx == "number") {
2024-04-15 18:31:36 +00:00
return num + 10 / Math.max(1, player.storage["dddlianer_ceiling"] - numx);
2023-07-27 09:56:09 +00:00
}
}
2024-04-15 18:10:02 +00:00
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
subSkill: {
ceiling: {
onremove: true,
charlotte: true,
mod: {
cardEnabled(card, player) {
2024-04-15 18:31:36 +00:00
if (!player.storage["dddlianer_ceiling"]) return;
2024-04-15 18:10:02 +00:00
var num = get.number(card);
if (
num != "unsure" &&
2024-04-15 18:31:36 +00:00
(typeof num != "number" || player.storage["dddlianer_ceiling"] <= num)
2024-04-15 18:10:02 +00:00
)
return false;
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
cardRespondable(card, player) {
2024-04-15 18:31:36 +00:00
if (!player.storage["dddlianer_ceiling"]) return;
2024-04-15 18:10:02 +00:00
var num = get.number(card);
if (
num != "unsure" &&
2024-04-15 18:31:36 +00:00
(typeof num != "number" || player.storage["dddlianer_ceiling"] <= num)
2024-04-15 18:10:02 +00:00
)
return false;
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
cardSavable(card, player) {
2024-04-15 18:31:36 +00:00
if (!player.storage["dddlianer_ceiling"]) return;
2024-04-15 18:10:02 +00:00
var num = get.number(card);
if (
num != "unsure" &&
2024-04-15 18:31:36 +00:00
(typeof num != "number" || player.storage["dddlianer_ceiling"] <= num)
2024-04-15 18:10:02 +00:00
)
return false;
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
},
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
},
dddanzhi: {
audio: 2,
trigger: { global: "phaseBegin" },
filter(event, player) {
var evts = game.getAllGlobalHistory("everything", (evt) =>
["useCard", "respond"].includes(evt.name)
);
if (!evts.length) return false;
const color = get.color(evts.lastItem.card, false);
return color == "black";
},
direct: true,
content() {
"step 0";
player
.chooseTarget(
get.prompt("dddanzhi"),
"选择一名角色,此回合其第一次成为黑色牌的目标时,此牌对其无效"
)
.set("ai", (target) => {
return get.attitude(_status.event.player, target);
});
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var target = result.targets[0];
player.logSkill("dddanzhi", target);
target.addTempSkill("dddanzhi_effect");
}
},
subSkill: {
effect: {
trigger: { target: "useCardToTarget" },
filter(event, player) {
return get.color(event.card) == "black";
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
forced: true,
charlotte: true,
content() {
2023-07-27 09:56:09 +00:00
trigger.targets.remove(player);
2024-04-15 18:31:36 +00:00
trigger.getParent().triggeredTargets2.remove(player);
2023-07-27 09:56:09 +00:00
trigger.untrigger();
2024-04-15 18:10:02 +00:00
game.log(trigger.card, "对", player, "无效了");
2023-07-27 09:56:09 +00:00
game.delayx();
2024-04-15 18:10:02 +00:00
player.removeSkill("dddanzhi_effect");
},
},
},
2023-07-27 09:56:09 +00:00
},
//刘宏
2024-04-15 18:10:02 +00:00
dddshixing: {
audio: 2,
trigger: {
global: ["changeHp", "useCard1", "phaseBefore"],
},
forced: true,
onremove: true,
filter(event, player) {
var num = player.countMark("dddshixing");
if (event.name == "changeHp") {
if (event.player.hasSex("female")) {
var bool = !event.player.isDamaged();
2024-04-15 18:31:36 +00:00
if ((bool && (num & 1) == 0) || (!bool && (num & 1) == 1)) {
2023-07-27 09:56:09 +00:00
return true;
}
}
return false;
}
2024-04-15 18:10:02 +00:00
if (event.name == "useCard") {
var bool =
2024-04-15 18:31:36 +00:00
game.getGlobalHistory("useCard", (evt) => get.type2(evt.card) == "trick")
.length == 0;
if ((bool && (num & 2) == 0) || (!bool && (num & 2) == 2)) {
2023-07-27 09:56:09 +00:00
return true;
}
return false;
}
return true;
},
2024-04-15 18:10:02 +00:00
content() {
lib.skill["dddshixing"].applyChange(player);
},
applyChange(player) {
player.removeAdditionalSkill("dddshixing");
2024-04-15 18:31:36 +00:00
var bool1 = game.hasPlayer((current) => !current.isDamaged() && current.hasSex("female")),
2024-04-15 18:10:02 +00:00
bool2 =
2024-04-15 18:31:36 +00:00
game.getGlobalHistory("useCard", (evt) => get.type2(evt.card) == "trick")
.length == 0;
2024-04-15 18:10:02 +00:00
player.storage["dddshixing"] = bool1 + 2 * bool2;
var list = [];
if (bool1) list.push("xiangle");
if (bool2) list.push("jiushi");
if (!bool1 && !bool2) list.push("rezhiheng");
player.addAdditionalSkill("dddshixing", list);
},
derivation: ["xiangle", "jiushi", "rezhiheng"],
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
ddddanggu: {
audio: 2,
trigger: { player: "phaseJieshuBegin" },
filter(event, player) {
return (
game.countPlayer((current) => current.isLinked()) <
game.countPlayer((current) => current.group == "qun")
);
},
forced: true,
group: "ddddanggu_negative",
content() {
"step 0";
if (!event.loop) event.loop = 0;
var num =
game.countPlayer((current) => current.group == "qun") -
game.countPlayer((current) => current.isLinked());
player
.chooseTarget(
"党锢:横置至少" + get.cnNumber(num) + "名角色",
[num, Infinity],
true,
(card, player, target) => {
return !target.isLinked();
}
)
.set("ai", (target) => {
2024-04-15 18:31:36 +00:00
return get.effect(target, { name: "tiesuo" }, _status.event.player);
2024-04-15 18:10:02 +00:00
});
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var targets = result.targets.sortBySeat();
player.logSkill("ddddanggu", targets);
targets.forEach((i) => i.link());
}
},
discard() {
"step 0";
game.log(player, "进入了弃牌阶段");
event.num = Math.max(
0,
2024-04-15 18:31:36 +00:00
player.countCards("he", (card) => !player.canIgnoreHandcard(card)) -
player.getHandcardLimit()
2024-04-15 18:10:02 +00:00
);
if (event.num <= 0) event.finish();
else {
if (lib.config.show_phase_prompt) {
player.popup("弃牌阶段");
2023-07-27 09:56:09 +00:00
}
}
2024-04-15 18:10:02 +00:00
event.trigger("phaseDiscard");
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
player.chooseToDiscard(num, true, "he");
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
event.cards = result.cards;
},
subSkill: {
negative: {
trigger: { global: "phaseDiscardBegin" },
filter(event, player) {
2024-04-15 18:31:36 +00:00
return event.player != player && event.player.isLinked();
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
forced: true,
logTarget: "player",
content() {
trigger.setContent(lib.skill["ddddanggu"].discard);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
},
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
dddfuzong: {
audio: 2,
zhuSkill: true,
forced: true,
trigger: {
global: "phaseBefore",
player: "enterGame",
},
forced: true,
filter(event, player) {
if (!player.hasZhuSkill("dddfuzong")) return false;
return event.name != "phase" || game.phaseNumber == 0;
},
group: "dddfuzong_discard",
content() {
player.draw(
game.countPlayer((current) => {
return current.group == "qun";
})
);
},
subSkill: {
discard: {
trigger: { global: "die" },
filter(event, player) {
if (!player.hasZhuSkill("dddfuzong")) return false;
return event.player.group == "qun";
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
zhuSkill: true,
forced: true,
logTarget: "player",
content() {
2024-04-15 18:31:36 +00:00
trigger.player.discardPlayerCard(player, "he", true).set("forceDie", true);
2023-11-12 08:16:18 +00:00
},
2024-04-15 18:10:02 +00:00
},
},
2023-11-12 08:16:18 +00:00
},
2023-07-27 09:56:09 +00:00
//夏侯玄
2024-04-15 18:10:02 +00:00
dddlanghuai: {
audio: 2,
trigger: { player: "phaseDrawBegin1" },
zhuanhuanji: true,
direct: true,
content() {
"step 0";
2024-04-15 18:31:36 +00:00
if (player.hasMark("dddxuanlun_del")) event._result = { bool: true };
2024-04-15 18:10:02 +00:00
else
player
.chooseBool(
get.prompt("dddlanghuai"),
"展示手牌(无牌则不展示),并改为摸其中" +
2024-04-15 18:31:36 +00:00
(!player.storage["dddlanghuai"] ? "包含" : "缺少") +
2024-04-15 18:10:02 +00:00
"花色数的牌"
)
.set("ai", () => _status.event.bool)
.set(
"bool",
(function () {
var list = [],
cards = player.getCards("h");
for (var i of cards) {
var suit = get.suit(i, player);
if (!lib.suit.includes(suit)) continue;
list.add(suit);
}
if (player.storage["dddlanghuai"]) {
list = list.removeArray(lib.suit);
}
return (
2024-04-15 18:31:36 +00:00
(list.length == 2 && !player.storage["dddlanghuai"]) ||
2024-04-15 18:10:02 +00:00
list.length > 2
);
})()
);
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
player.logSkill("dddlanghuai");
delete player.storage["dddxuanlun_del"];
if (player.countCards("h")) player.showHandcards();
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
var list = [],
cards = player.getCards("h");
for (var i of cards) {
var suit = get.suit(i, player);
if (!lib.suit.includes(suit)) continue;
2023-07-27 09:56:09 +00:00
list.add(suit);
}
2024-04-15 18:10:02 +00:00
if (player.storage["dddlanghuai"]) {
list = lib.suit.slice().removeArray(list);
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
player.changeZhuanhuanji("dddlanghuai");
2023-07-27 09:56:09 +00:00
trigger.changeToZero();
2024-04-15 18:10:02 +00:00
if (list.length) player.draw(list.length);
},
mark: true,
intro: {
content(storage, player) {
return (
"摸牌阶段,你可展示手牌(无牌则不展示),并改为摸其中" +
(!storage ? "包含" : "缺少") +
"花色数的牌。"
);
2023-07-27 09:56:09 +00:00
},
},
2024-04-15 18:10:02 +00:00
marktext: "☯",
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
dddxuanlun: {
audio: 2,
trigger: { player: "damageEnd" },
content() {
2023-07-27 09:56:09 +00:00
player.draw(4);
2024-04-15 18:10:02 +00:00
player.addTempSkill("dddxuanlun_choose");
},
ai: {
maixie: true,
maixie_hp: true,
result: {
effect(card, player, target) {
if (get.tag(card, "damage")) {
2024-04-15 18:31:36 +00:00
if (player.hasSkillTag("jueqing", false, target)) return [1, -2];
2024-04-15 18:10:02 +00:00
if (!target.hasFriend()) return;
var num = 1;
if (get.attitude(player, target) > 0) {
if (player.needsToDiscard()) num = 0.7;
else num = 0.5;
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
if (target.hp >= 4) return [1, num * 2.5];
if (target.hp == 3) return [1, num * 1.5];
if (target.hp == 2) return [1, num * 0.5];
2023-07-27 09:56:09 +00:00
}
},
},
2024-04-15 18:10:02 +00:00
threaten: 0.6,
},
subSkill: {
choose: {
trigger: { global: "phaseEnd" },
forced: true,
charlotte: true,
filter(event, player) {
2024-04-15 18:31:36 +00:00
if (player.hasMark("dddxuanlun_del") && !player.countCards("h")) return false;
2023-07-27 09:56:09 +00:00
return true;
},
2024-04-15 18:10:02 +00:00
content() {
"step 0";
var choices = [];
var choiceList = [
"将四张牌以任意顺序置于牌堆顶或底",
"删去此项和〖朗怀〗中的“可”,直到你发动〖朗怀〗",
];
2024-04-15 18:31:36 +00:00
if (player.countCards("he") >= 4 || player.hasMark("dddxuanlun_del"))
2024-04-15 18:10:02 +00:00
choices.push("选项一");
2024-04-15 18:31:36 +00:00
else choiceList[0] = '<span style="opacity:0.5; ">' + choiceList[0] + "</span>";
if (!player.hasMark("dddxuanlun_del")) choices.push("选项二");
2024-04-15 18:10:02 +00:00
else
choiceList[1] =
'<span style="opacity:0.5; text-decoration:line-through; ">' +
choiceList[1] +
"</span>";
if (choices.length == 1 && choices[0] == "选项一")
event._result = { control: "选项一" };
else
player
.chooseControl(choices)
.set("choiceList", choiceList)
.set("ai", () => {
2024-04-15 18:31:36 +00:00
if (!_status.event.controls.includes("选项一")) return 1;
if (!_status.event.controls.includes("选项二")) return 0;
2024-04-15 18:10:02 +00:00
var player = _status.event.player;
var num = 0;
2024-04-15 18:31:36 +00:00
for (var card of player.getCards("he")) {
if (get.value(card, player) <= 5) num++;
2024-04-15 18:10:02 +00:00
if (num >= 4) break;
}
return num >= 4 ? 0 : 1;
});
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
game.log(player, "选择了", "#y" + result.control);
if (result.control == "选项一") {
var cards = player.getCards("he");
if (cards.length <= 4)
event._result = {
bool: true,
cards: cards,
};
2024-04-15 18:31:36 +00:00
else player.chooseCard("玄论:将四张牌置于牌堆顶或牌堆底", "he", true, 4);
2024-04-15 18:10:02 +00:00
} else {
player.addMark("dddxuanlun_del", 1, false);
2023-07-27 09:56:09 +00:00
event.finish();
}
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var cards = result.cards;
event.cards = cards;
player
.chooseToMove()
2024-04-15 18:31:36 +00:00
.set("list", [["牌堆顶", cards], ["牌堆底"]])
.set("prompt", "玄论:将这些牌置于牌堆顶或牌堆底")
2024-04-15 18:10:02 +00:00
.set("processAI", function (list) {
var cards = list[0][1],
player = _status.event.player;
var target = _status.currentPhase.next;
2024-04-15 18:31:36 +00:00
var att = get.sgn(get.attitude(player, target));
2024-04-15 18:10:02 +00:00
var top = [];
var judges = target.getCards("j");
var stopped = false;
2024-04-15 18:31:36 +00:00
if (player != target || !target.hasWuxie()) {
for (var i = 0; i < judges.length; i++) {
var judge = get.judge(judges[i]);
2024-04-15 18:10:02 +00:00
cards.sort(function (a, b) {
2024-04-15 18:31:36 +00:00
return (judge(b) - judge(a)) * att;
2024-04-15 18:10:02 +00:00
});
if (judge(cards[0]) * att < 0) {
stopped = true;
break;
} else {
top.unshift(cards.shift());
}
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
}
var bottom;
if (!stopped) {
cards.sort(function (a, b) {
2024-04-15 18:31:36 +00:00
return (get.value(b, player) - get.value(a, player)) * att;
2024-04-15 18:10:02 +00:00
});
while (cards.length) {
2024-04-15 18:31:36 +00:00
if (get.value(cards[0], player) <= 5 == att > 0) break;
2023-07-27 09:56:09 +00:00
top.unshift(cards.shift());
}
}
2024-04-15 18:10:02 +00:00
bottom = cards;
return [top, bottom];
});
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var top = result.moved[0];
var bottom = result.moved[1];
2023-07-27 09:56:09 +00:00
top.reverse();
2024-04-15 18:10:02 +00:00
player.popup(
2024-04-15 18:31:36 +00:00
get.cnNumber(top.length) + "上" + get.cnNumber(bottom.length) + "下"
2024-04-15 18:10:02 +00:00
);
var cards = top.addArray(bottom);
player.$throw(cards.length, 1000);
2024-04-15 18:31:36 +00:00
player.lose(cards, ui.cardPile).set("top", top).insert_index = function (
2024-04-15 18:10:02 +00:00
event,
card
) {
2024-04-15 18:31:36 +00:00
if (event.top.includes(card)) return ui.cardPile.firstChild;
2023-07-27 09:56:09 +00:00
return null;
};
}
2024-04-15 18:10:02 +00:00
},
},
},
2023-07-27 09:56:09 +00:00
},
//张闿
2024-04-15 18:10:02 +00:00
dddjiexing: {
audio: 2,
trigger: {
global: ["recoverBegin", "useCard"],
},
filter(event, player) {
if (event.player == player) return false;
if (event.name == "recover") return player.isDamaged();
return (
get.type(event.card, false) == "equip" &&
2024-04-15 18:31:36 +00:00
event.cards.some((i) => get.position(i, true) == "o" && player.canEquip(i, true))
2024-04-15 18:10:02 +00:00
);
},
limited: true,
skillAnimation: true,
animationColor: "legend",
logTarget: "player",
check(event, player) {
if (get.attitude(player, event.player) >= 0) return false;
if (event.name == "recover")
return (
get.recoverEffect(event.player, player, player) <
get.recoverEffect(player, player, player)
);
return (
2024-04-15 18:31:36 +00:00
get.effect(event.targets[0], event.card, player, player) <
get.effect(player, event.card, player, player)
2024-04-15 18:10:02 +00:00
);
},
content() {
player.awakenSkill("dddjiexing");
player.addSkill("dddjiexing_reset");
if (trigger.name == "recover") {
2023-07-27 09:56:09 +00:00
trigger.cancel();
player.recover(trigger.num);
2024-04-15 18:10:02 +00:00
} else {
trigger.all_excluded = true;
trigger.targets.length = 0;
var cards = trigger.cards.filterInD();
for (var i of cards) {
if (player.canEquip(i, true)) player.equip(i);
2023-07-27 09:56:09 +00:00
}
}
},
2024-04-15 18:10:02 +00:00
subSkill: {
reset: {
audio: "dddjiexing",
trigger: { player: ["recoverAfter", "useCardAfter"] },
filter(event, player) {
2024-04-15 18:31:36 +00:00
if (event.getParent().name == "dddjiexing") return false;
if (event.name == "useCard") return get.type(event.card, false) == "equip";
2023-07-27 09:56:09 +00:00
return true;
},
2024-04-15 18:10:02 +00:00
forced: true,
charlotte: true,
content() {
player.restoreSkill("dddjiexing");
player.removeSkill("dddjiexing_reset");
},
},
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
dddbailei: {
audio: 2,
trigger: { player: "phaseZhunbeiBegin" },
filter(event, player) {
return (
game.hasPlayer(
2024-04-15 18:31:36 +00:00
(current) => current.isMaxEquip(true) && current.countGainableCards(player, "he")
2024-04-15 18:10:02 +00:00
) || game.hasPlayer((current) => current.getHp() == 1)
);
},
direct: true,
content() {
"step 0";
player
2024-04-15 18:31:36 +00:00
.chooseTarget(get.prompt2("dddbailei"), (card, player, target) => {
return (
(target.isMaxEquip(true) && target.countGainableCards(player, "he")) ||
target.getHp() == 1
2024-04-15 18:10:02 +00:00
);
2024-04-15 18:31:36 +00:00
})
.set("ai", (target) => {
var att = get.attitude(_status.event.player, target);
2024-04-15 18:10:02 +00:00
if (att >= 3) return false;
if (target.hp == 1) return 100;
return 1;
});
2024-04-15 18:31:36 +00:00
"step 1";
2024-04-15 18:10:02 +00:00
if (result.bool) {
var target = result.targets[0];
event.target = target;
player.logSkill("dddbailei", target);
if (target.isMaxEquip(true) && target.hp == 1) {
if (target.countGainableCards(player, "he")) {
player.gainPlayerCard(
"拜泪:获得" +
get.translation(target) +
"一张牌或点击“取消”对其造成1点伤害",
"he",
target
);
} else event._result = { bool: false };
} else if (target.isMaxEquip(true))
player.gainPlayerCard(
2024-04-15 18:31:36 +00:00
"拜泪:获得" + get.translation(target) + "一张牌",
2024-04-15 18:10:02 +00:00
"he",
target,
true
);
else {
event._result = { bool: false };
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 2";
2024-04-15 18:10:02 +00:00
if (!result.bool) {
2023-07-27 09:56:09 +00:00
player.line(target);
2023-11-12 08:16:18 +00:00
// player.trySkillAnimate('dddbailei_animate','dddbailei_animate',player.checkShow('dddbailei'));
target.damage();
2023-07-27 09:56:09 +00:00
game.delayx();
2024-04-15 18:10:02 +00:00
} else event.finish();
2024-04-15 18:31:36 +00:00
"step 3";
2024-04-15 18:10:02 +00:00
if (target.isIn()) {
event.finish();
return;
2023-07-27 09:56:09 +00:00
}
2024-04-15 18:10:02 +00:00
player.removeSkills("dddbailei");
},
subSkill: {
animate: {
skillAnimation: true,
animationColor: "fire",
},
},
2023-07-27 09:56:09 +00:00
},
},
2024-04-15 18:10:02 +00:00
dynamicTranslate: {
dddxiaheng(player) {
return (
"锁定技。出牌阶段开始时你选择一名角色其弃置两张牌然后你对一名角色造成1点伤害。" +
(player.storage["dddxiaheng_del"]
? ""
2024-04-19 11:36:34 +00:00
: "“若两名角色:均不为你,你失去一点体力上限;为同一名角色,你失去一点体力;然后若以此法对包括你在内三名不同的角色造成伤害,删除双引号里的描述内容”")
2024-04-15 18:10:02 +00:00
);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
dddshichao(player) {
return (
"锁定技,准备阶段,你选择一名手牌数为全场第(" +
(1 + player.countMark("dddshichao")) +
")大的角色,将手牌数调整至与其相等且至多等于主公的体力上限;其于你的下回合开始前对你造成伤害时,其可防止之,然后令()内的数字+1。"
);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
dddlanghuai(player) {
return (
"转换技,摸牌阶段,你" +
(player.hasMark("dddxuanlun_del") ? "" : "可") +
2024-04-19 11:36:34 +00:00
"展示手牌(无牌则不展示),并改为摸其中:" +
(player.storage["dddlanghuai"] ? '阴:包含花色数的牌;<span class="bluetext">阳:缺少花色数的牌。</span>' : '<span class="bluetext">阴:包含花色数的牌;</span>阳:缺少花色数的牌。')
2024-04-15 18:10:02 +00:00
);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
dddxuanlun(player) {
var deleted = player.hasMark("dddxuanlun_del");
return (
"你受到伤害后,你可摸四张牌;你发动此技能的回合结束时," +
(deleted ? "你" : "须选择一项:") +
"将四张牌以任意顺序置于牌堆顶或底" +
2024-04-15 18:31:36 +00:00
(deleted ? "。" : ";或删去此项和“朗怀”中的“可”,直到你发动“朗怀”。")
2024-04-15 18:10:02 +00:00
);
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
ddddiedang(player) {
if (player.storage.ddddiedang)
return "出牌阶段限一次,你可以弃置三张牌,然后摸一张牌;然后若你的手牌数为全场最多或最少,则你交换上述描述中的“弃置”和“摸”。";
return "出牌阶段限一次,你可以摸三张牌,然后弃置一张牌;然后若你的手牌数为全场最多或最少,则你交换上述描述中的“摸”和“弃置”。";
2023-07-28 17:28:39 +00:00
},
2024-04-15 18:10:02 +00:00
dddyeshen(player) {
return (
"一名角色的结束阶段,你可以亮出牌堆底" +
get.cnNumber(3 - player.countMark("dddyeshen")) +
"张牌,令其将其中一张黑色牌当做最大目标数为牌名字数的【铁索连环】使用或重铸,其余牌置于牌堆顶,然后此技能亮出牌数-1若减至零张或其中没有黑色牌你复原此技能并对自己造成1点火焰伤害。"
);
2023-07-30 15:42:21 +00:00
},
2023-07-27 09:56:09 +00:00
},
2024-04-15 18:10:02 +00:00
translate: {
ddd_handang: "韩当",
dddxianxi: "险袭",
dddxianxi_info:
"出牌阶段你使用【杀】时可无视距离额外指定任意名角色为目标此【杀】结算后若额外指定的目标中有未受到此【杀】伤害的你须选择一项弃置X张牌对其各造成1点伤害或摸X张牌并失去1点体力X为未受到此【杀】伤害的目标数。",
ddd_wuzhi: "吴质",
dddlingyong: "灵涌",
dddlingyong_info:
"一名角色跳过其的阶段时,你可进行判定。若结果不为【杀】,则你可以使用判定牌,然后重复此流程。",
dddxuxiao: "虚孝",
dddxuxiao_info:
"当有黑色基本牌因弃置而进入弃牌堆后,你可将其当做【兵粮寸断】置于一名角色的判定区,然后其摸两张牌。",
ddd_xujing: "许靖",
dddxuyu: "虚誉",
dddxuyu_info:
"当你使用牌结算结束后,你可以摸一张牌。若如此做,当你于本回合使用下一张牌结算结束后,你弃置一张牌。",
dddshijian: "实荐",
dddshijian_info:
"其他角色于其出牌阶段使用的第二张牌结算结束后你可以交给其一张牌。若如此做其本回合使用的下一张牌指定第一个目标时你选择一项1.令此牌额外结算一次2.你摸一张牌。",
ddd_caomao: "曹髦",
dddtaisi: "太思",
dddtaisi_info:
"一名角色的回合结束时,若你的体力值于本回合内发生过变化,则你可以令一名角色获得一张于本回合内进入弃牌堆的牌。然后若该角色于本回合内对你造成过伤害,则你摸两张牌。",
dddquche: "驱车",
dddquche_info:
"限定技。出牌阶段你可依次执行大括号内的流程至多X次X为你的体力上限[⒈将一张牌交给一名其他角色]+[将一张黑色牌当做【杀】使用(不计入次数限制)]}。你每执行一个中括号内的选项,本回合内至其他角色的距离便-1。",
dddqianlong: "潜龙",
dddqianlong_info:
"主公技,锁定技。当你因执行奖惩而摸牌或弃置牌时,取消之;当你杀死一名角色后,你摸三张牌。",
ddd_xinxianying: "辛宪英",
ddddongcha: "洞察",
ddddongcha_info:
"其他角色的回合开始时,你可以令你和其依次将一张手牌置于你的武将牌上,称为“鉴”。若如此做,本回合结束时,你与其依次选择获得一张“鉴”。",
dddzhijie: "智解",
dddzhijie_info:
"你可以将两张颜色相同的“鉴”当做【闪】使用,或将两张颜色不同的“鉴”当做【无懈可击】使用;然后你摸两张牌。",
ddd_xianglang: "向朗",
dddqiahua: "恰化",
dddqiahua_info:
"其他角色的回合开始时你可明置X张手牌X为其体力值然后其于本回合内获得〖恂恂〗。",
dddfusi: "腹笥",
dddfusi_info:
"锁定技。①你的明置手牌不计入手牌上限。②其他角色需要使用牌时,可以改为使用你的明置手牌(需经过你的确认)。③你的回合内,若你的手牌均为明置手牌,则其他角色不能使用各自的手牌。",
dddfusi_global: "腹笥",
dddtuoji: "拓籍",
2024-04-15 18:31:36 +00:00
dddtuoji_info: "其他角色因〖腹笥〗而使用你的牌后,若你的手牌均为明置手牌,则你可以摸三张牌。",
2024-04-15 18:10:02 +00:00
visible_dddxianglang: "明",
ddd_yujin: "于禁",
dddzhengjun: "整军",
dddzhengjun_info:
"出牌阶段内每项各限一次。当有角色的手牌数/体力值/装备区内牌数变化后若其的对应数值与你相同则你可以执行对应的选项。体力值你令其回复或失去1点体力手牌数你令其摸或弃置一张牌装备区内牌数你移动其的一张装备牌。",
ddd_liuye: "刘晔",
dddchashi: "察势",
dddchashi_info:
"其他角色的出牌阶段开始时你可弃置一张牌A。当其于本阶段内使用下一张牌结算结束后若此牌与A花色或类型相同你与其各摸一张牌。",
dddqice: "齐策",
2024-04-15 18:31:36 +00:00
dddqice_info: "准备阶段开始时,你可以摸两张牌,然后你的〖齐策〗失效直到你使用锦囊牌。",
2024-04-15 18:10:02 +00:00
ddd_baosanniang: "鲍三娘",
dddzhilian: "枝连",
dddzhilian_info:
"一名角色的回合结束时,若本回合仅有你与另一名男性角色使用或打出过牌,则你可以令你与其各摸一张牌或各弃置一张牌,然后你获得本回合内进入弃牌堆的所有【杀】。",
dddjijian: "赍剑",
dddjijian_info:
"出牌阶段限一次。你可以展示一张【杀】并交给一名其他男性角色,然后其展示至多两张颜色相同的【杀】或普通锦囊牌,你与其依次视为使用一张其展示的牌(不能重复使用同一张展示牌)。",
ddd_zhenji: "甄姬",
dddmiaoxing: "淼形",
dddmiaoxing_info:
"锁定技。①分发起始手牌时,你额外获得两份起始手牌,然后将其中的两份移出游戏,称为“水相”。②摸牌阶段结束后,你须将至少一份“水相”调整至与你的手牌数相等。",
dddfushi: "浮世",
dddfushi_info:
"每回合限一次。当你使用或打出基本牌结算结束后,你可以用所有手牌交换一份“水相”,然后你可令一名男性角色选择是否用其所有手牌交换一份“水相”。",
ddd_zhaoang: "赵昂",
dddfenji: "奋计",
dddfenji_info:
"摸牌/弃牌阶段开始时,你可视为使用一张未以此法使用过的普通锦囊牌,然后将此阶段摸牌/弃牌数改为此牌造成的伤害值/此牌的目标数。",
ddd_zhouchu: "周处",
dddxiaheng: "侠横",
dddxiaheng_info:
"锁定技。出牌阶段开始时你选择一名角色其弃置两张牌然后你对一名角色造成1点伤害。“若这两名角色均不为你你减1点体力上限为同一名角色你失去〖侠横〗然后若你以此法对三名不同的角色造成过伤害删除该技能双引号里的描述。”",
ddd_liuba: "刘巴",
dddfengzheng: "丰政",
dddfengzheng_info:
"①每名角色的出牌阶段限一次。其可将点数之和为13的任意张手牌当一张【无中生有】使用。②一轮游戏开始时你可观看并分配牌堆顶的X张牌X为上一轮发动过〖丰政〗的角色数若有角色以此法得到的牌数多于两张你失去〖丰政〗。",
dddyulv: "玉律",
dddyulv_info:
"锁定技。①游戏开始时,你摸一张牌。将一张手牌置于武将牌上,称为“玉律”。②当有与“玉律”牌点数相同的牌进入弃牌堆后,你令当前回合角色摸一张牌或弃置一张牌。然后若本次为此回合使用的第二次〖玉律②〗,你用一张手牌交换“玉律”牌(若你没有手牌则先摸一张牌)。",
ddd_jianshuo: "蹇硕",
dddfenye: "分野",
dddfenye_info:
"出牌阶段限一次。你可与一名其他角色拼点,其余角色于此次拼点中可加入其中一方并扣置一张手牌作为其拼点牌,本次拼点判断胜负的条件改为比较双方点数均值。然后拼点胜方角色依次可视为对一名不同的拼点败方角色使用【杀】。",
dddshichao: "逝潮",
dddshichao_info:
"锁定技。准备阶段你选择一名手牌数为全场第1大的角色将手牌数调整至与其相等且至多等于主公的体力上限。然后当其于你的下回合开始前对你造成伤害时其可防止之令你〖逝潮〗的内的数字+1。",
ddd_guanning: "管宁",
dddyouxue: "游学",
dddyouxue_info:
"锁定技。一轮游戏开始时你将场上的“游学”标记交给一名其他角色若场上没有“游学”你获得“游学”然后摸X张牌X为本次失去“游学”的角色至获得“游学”的角色的距离。",
dddchengjing: "承经",
dddchengjing_info:
"①一名角色的回合结束时,若其有“游学”,你将其于此回合内使用的最后一张{非转化且对应的实体牌数为1且均位于弃牌堆中}的基本牌或普通锦囊牌对应的所有实体牌置于武将牌上,称为“经”(若你此前有“经”,你先将这些“经”置入弃牌堆)。②出牌阶段限一次,你可以将一张牌当“经”使用,然后可以将该牌交给有“游学”的角色的下家。",
ddd_dingfeng: "丁奉",
dddduanbing: "短兵",
dddduanbing_info:
"①出牌阶段,你可将一张黑色非锦囊牌当一张【兵粮寸断】置入自己的判定区,摸两张牌,然后视为使用一张无视距离限制的【杀】。②当你使用【杀】对目标角色造成伤害后,若你判定区里有【兵粮寸断】,你可将【兵粮寸断】移至目标角色的判定区。",
ddd_kebineng: "轲比能",
dddxiaoxing: "枭行",
dddxiaoxing_info:
"锁定技。①你的初始手牌,攻击范围和手牌上限+3。②当你进入濒死状态时你失去〖枭行〗。③当你获得〖枭行〗后你摸三张牌。",
dddlangzhi: "狼志",
dddlangzhi_info:
"结束阶段你可展示你攻击范围内的所有角色各一张牌然后选择一项1.用任意张牌替换其中等量张牌2.获得所有展示牌,失去〖狼志〗。",
dddfuyi: "附义",
dddfuyi_both: "〖枭行〗和〖狼志〗",
dddfuyi_info:
"主公技,锁定技。①群势力角色使用【杀】的次数上限+1。②当一名群势力角色杀死角色后其可以弃置两张牌令你获得你武将牌上的一个技能。",
ddd_caoshuang: "曹爽",
ddd_xuelingyun: "薛灵芸",
ddd_liuhong: "刘宏",
ddd_xiahouxuan: "夏侯玄",
ddd_zhangkai: "张闿",
dddzhuanshe: "专摄",
dddzhuanshe_info:
"其他角色的出牌阶段开始时你可将一张手牌正面朝上交给该角色则当其在此回合内使用与之名称相同的基本牌或普通锦囊牌时你可无视距离限制为之额外选择一个目标此回合结束时若其未使用与之名称相同的牌你可以对其造成1点伤害。",
dddweiqiu: "危秋",
2024-04-15 18:31:36 +00:00
dddweiqiu_info: "锁定技。一名角色回复体力前,若你没有手牌,改为令你摸一张牌。",
2024-04-15 18:10:02 +00:00
dddlianer: "涟洏",
dddlianer_info:
"当你使用红色牌结算后,你可以获得之,然后你只能使用点数小于此牌的牌直到回合结束。",
dddanzhi: "暗织",
dddanzhi_info:
"一名角色的回合开始时,若上一张被使用或打出的牌为黑色,你可以指定一名角色,此回合其第一次成为黑色牌的目标时,此牌对其无效。",
dddshixing: "失兴",
dddshixing_info:
"锁定技。若有未受伤的女性角色,你视为拥有〖享乐〗;若当前回合没有锦囊牌被使用,你视为拥有〖酒诗〗;若你没有上述技能,你视为拥有〖制衡〗。",
ddddanggu: "党锢",
ddddanggu_info:
"锁定技。①结束阶段你横置任意名角色的武将牌直到场上已横置的角色数不少于XX为群势力角色数。②其他角色的弃牌阶段若其处于连环状态其装备区里的牌视为手牌。",
dddfuzong: "覆宗",
dddfuzong_info:
"主公技,锁定技。①游戏开始时,你摸等同于场上群势力角色数的牌。②一名群势力角色死亡时,其弃置你的一张牌。",
dddlanghuai: "朗怀",
dddlanghuai_info:
"转换技。摸牌阶段,你可展示手牌(无牌则不展示),并改为摸其中:阴,包含花色数的牌;阳,缺少花色数的牌。",
dddxuanlun: "玄论",
dddxuanlun_info:
"当你受到伤害后你可摸四张牌然后该回合结束时你选择一项1.将四张牌以任意顺序置于牌堆顶或底2.删去此项和〖郎怀〗中的“可”直到你发动〖郎怀〗。",
dddjiexing: "劫行",
dddjiexing_info:
"限定技。其他角色回复体力时,你可改为你回复等量体力;其他角色使用装备牌时,你可改为将此牌置入你的装备区。当你不以此法回复体力后或使用装备牌后,重置此技能。",
dddbailei: "拜泪",
dddbailei_info:
"准备阶段你可以选择一项1.获得装备区牌数唯一最多的角色的一张牌2.对一名体力值为1的角色造成1点伤害若其因此死亡你失去此技能。",
ddd_liangxi: "梁习",
dddtongyu: "仝御",
dddtongyu_info:
"出牌阶段限一次,你可以将任意张花色不同的牌当做【五谷丰登】使用,且你为此牌选择结算方向,此牌的亮出牌数+XX为此牌对应的实体牌数量。此牌的所有目标角色在被指定目标后选择一项⒈本回合不能再使用或打出手牌。⒉令此【五谷丰登】对其无效。此【五谷丰登】的多余展示牌置入弃牌堆前你可以令一名选择了选项二的角色获得这些牌。",
ddd_wangkanglvkai: "王伉吕凯",
dddbingjian: "并肩",
dddbingjian_info:
"每回合限两次。你可以将手牌数调整至2至少调整一张视为使用或打出一张【杀】或【闪】。若你因此摸牌则你可以令一名其他角色摸等量的牌因此弃牌则你可以弃置一名其他角色等量的牌。",
ddd_sunliang: "孙亮",
ddddiedang: "迭宕",
ddddiedang_info:
"出牌阶段限一次,你可以摸三张牌,然后弃置一张牌;然后若你的手牌数为全场最多或最少,则你交换上述描述中的“摸”和“弃”。",
dddanliu: "暗流",
dddanliu_info:
"结束阶段你可以与一名其他角色依次观看并选择对方的一张手牌然后交换这两张牌。若这两张牌颜色相同则你可以逾期交换这两张牌若此牌为红色则你回复1点体力若此牌为黑色则其摸两张牌。",
dddguiying: "归萤",
dddguiying_info:
"主公技。准备阶段,其他吴势力角色可依次展示其一张手牌,然后将其点数最大的一张牌交给你,然后其可以获得场上点数最小的一张牌。",
ddd_qianzhao: "牵招",
dddyuanzhen: "远振",
dddyuanzhen_info:
"锁定技。当你使用牌指定其他角色为唯一目标后若你至其距离不为1你令其选择一项1.弃置一张牌2.令你摸一张牌。",
dddzhishu: "制戍",
dddzhishu_info:
"出牌阶段开始时,你可以移动场上的一张装备牌,然后以此法失去牌的角色视为对以此法装备区被置入牌的角色使用一张【过河拆桥】。",
ddd_zhangmiao: "张邈",
dddxiaxing: "侠行",
dddxiaxing_info:
"①每轮限一次。一名角色处于濒死状态时/回合开始时,你可以将一张牌置于牌堆顶,视为其使用一张【桃】/【酒】。若你没有“侠”标记,你获得“侠”。②你可以移去“侠”,视为使用一张【杀】或【闪】。",
ddd_zhangcheng: "张承",
dddjuxian: "聚贤",
dddjuxian_info:
"出牌阶段每项各限一次。你可以展示一张牌然后1.将其置于牌堆顶然后获得其他角色的一张牌并展示之2.将此牌交给一名其他角色,然后摸一张牌并展示之。若你以此法展示的两张牌颜色不同,此技能本回合失效。",
dddjungui: "隽轨",
dddjungui_info:
"结束阶段你可以令一名角色摸两张牌然后其展示所有手牌你选择一个不大于X的值。若Y大于0你令其弃置Y张花色各不同的手牌X为你于本回合使用过的牌的花色数Y为其手牌中包含的花色数-X。",
ddd_liuchong: "刘宠",
dddjinggou: "精彀",
dddjinggou_info:
"锁定技。当你使用武器牌结算结束后若你的攻击范围为全场最大你对一名其他角色造成1点伤害。",
dddmoyan: "末焱",
dddmoyan_info:
"一轮游戏开始时你可以亮出牌堆顶三张牌令一名角色选择获得其中至少一张牌然后当你于本轮受到伤害时若其手牌数不大于X此伤害+1X为其本次获得的牌数。",
ddd_luoxian: "罗宪",
dddshilie: "示烈",
visible_dddshilie: "明",
dddshilie_info:
"每回合限一次。当你需要使用一张【杀】或【闪】时你可以明置任意点数之和不小于X的手牌视为你使用之。若本次明置的牌点数等于X你摸等同于本次明置的牌数的牌X为你与当前回合角色的体力值之和。",
ddd_lie: "李娥",
dddyeshen: "冶身",
dddyeshen_info:
"一名角色的结束阶段,你可以亮出牌堆底三张牌,令其将其中一张黑色牌当做最大目标数为牌名字数的【铁索连环】使用或重铸,其余牌置于牌堆顶,然后此技能亮出牌数-1若减至零张或其中没有黑色牌你复原此技能并对自己造成1点火焰伤害。",
dddqiaoduan: "巧锻",
dddqiaoduan_info:
"每回合限一次。当有角色重置后你可以令至多X名角色各摸一张牌横置后你可以将X张牌置于牌堆底并令一名角色回复1点体力X为横置角色数。",
2023-07-27 09:56:09 +00:00
},
};
});