乐诸葛果

This commit is contained in:
mengxinzxz 2024-06-01 17:00:53 +08:00
parent b37748efdc
commit 6e281249a7
6 changed files with 145 additions and 4 deletions

View File

@ -1,4 +1,5 @@
const characters = {
yue_zhugeguo: ["female", "shu", 3, ["dcxidi", "dcchengyan"]],
yue_zoushi: ["female", "qun", 3, ["dcyunzheng", "dchuoxin"]],
zhupeilan: ["female", "wu", 3, ["dccilv", "dctongdao"]],
yue_miheng: ["male", "qun", 3, ["dcjigu", "dcsirui"]],

View File

@ -1,5 +1,6 @@
const characterReplaces = {
lifeng: ["dc_lifeng", "lifeng"],
zhugeguo: ["yue_zhugeguo", "zhugeguo"],
};
export default characterReplaces;

View File

@ -2,6 +2,136 @@ import { lib, game, ui, get, ai, _status } from "../../noname.js";
/** @type { importCharacterConfig['skill'] } */
const skills = {
//乐诸葛果
dcxidi: {
audio: 2,
trigger: {
global: "phaseBefore",
player: "enterGame",
},
filter(event, player) {
return event.name != "phase" || game.phaseNumber == 0;
},
forced: true,
content() {
const cards = player.getCards("h");
player.addGaintag(cards, "dcxidi_tag");
},
mod: {
ignoredHandcard(card) {
if (card.hasGaintag("dcxidi_tag")) return true;
},
cardDiscardable(card, _, name) {
if (name == "phaseDiscard" && card.hasGaintag("dcxidi_tag")) return false;
},
},
group: "dcxidi_guanxing",
subSkill: {
guanxing: {
audio: "dcxidi",
trigger: { player: "phaseZhunbeiBegin" },
filter(event, player) {
return player.hasCard(card => card.hasGaintag("dcxidi_tag"), "h");
},
forced: true,
locked: false,
preHidden: true,
async content(event, trigger, player) {
const num = player.countCards("h", card => card.hasGaintag("dcxidi_tag"));
const cards = get.cards(Math.min(num, 5));
await game.cardsGotoOrdering(cards);
const next = player.chooseToMove();
next.set("list", [["牌堆顶", cards], ["牌堆底"]]);
next.set("prompt", "羲笛:点击将牌移动到牌堆顶或牌堆底");
next.processAI = list => {
const cards = list[0][1],
player = _status.event.player;
const top = [];
const judges = player.getCards("j");
let stopped = false;
if (!player.hasWuxie()) {
for (let i = 0; i < judges.length; i++) {
const judge = get.judge(judges[i]);
cards.sort((a, b) => judge(b) - judge(a));
if (judge(cards[0]) < 0) {
stopped = true;
break;
} else {
top.unshift(cards.shift());
}
}
}
let bottom;
if (!stopped) {
cards.sort((a, b) => get.value(b, player) - get.value(a, player));
while (cards.length) {
if (get.value(cards[0], player) <= 5) break;
top.unshift(cards.shift());
}
}
bottom = cards;
return [top, bottom];
};
const {
result: { moved },
} = await next;
const top = moved[0];
const bottom = moved[1];
top.reverse();
await game.cardsGotoPile(top.concat(bottom), ["top_cards", top], (event, card) => {
if (event.top_cards.includes(card)) return ui.cardPile.firstChild;
return null;
});
player.popup(get.cnNumber(top.length) + "上" + get.cnNumber(bottom.length) + "下");
game.log(player, "将" + get.cnNumber(top.length) + "张牌置于牌堆顶");
await game.asyncDelayx();
},
},
},
},
dcchengyan: {
audio: 2,
trigger: { player: "useCardToPlayered" },
filter(event, player) {
if (!player.isPhaseUsing()) return false;
if (event.card.name != "sha" && get.type(event.card) != "trick") return false;
return event.target != player;
},
logTarget: "target",
async content(event, trigger, player) {
const target = trigger.target;
const cards = get.cards();
await game.cardsGotoOrdering(cards);
await player.showCards(cards, get.translation(player) + "发动了【乘烟】");
const card = cards[0];
if (card.name == "sha" || (get.type(card) == "trick" && get.info(card).filterTarget)) {
player.addTempSkill("dcchengyan_effect");
player.markAuto("dcchengyan_effect", [[trigger.card, card, target]]);
}
if (card.name != "sha" && get.type(card) != "trick") {
await player.gain(card, "gain2").set("gaintag", ["dcxidi_tag"]);
}
else await game.cardsDiscard(cards);
},
subSkill: {
effect: {
charlotte: true,
onremove: true,
trigger: { player: "useCardToBegin" },
filter(event, player) {
const storage = player.getStorage("dcchengyan_effect");
return storage.some(list => list[0] == event.card && list[2] == event.target);
},
forced: true,
popup: false,
firstDo: true,
async content(event, trigger, player) {
const list = player.getStorage("dcchengyan_effect").find(list => list[0] == trigger.card && list[2] == trigger.target);
trigger.setContent(lib.card[list[1].name].content);
},
},
},
},
//乐邹氏
dcyunzheng: {
audio: 2,
@ -43,13 +173,13 @@ const skills = {
)
return false;
return game.hasPlayer(target => {
return target.hasCard(card => card.hasGaintag("dcyunzheng_tag")) == !target.hasSkill("dcyunzheng_block");
return target.hasCard(card => card.hasGaintag("dcyunzheng_tag"), "h") == !target.hasSkill("dcyunzheng_block");
});
},
logTarget(event, player) {
return game
.filterPlayer(target => {
return target.hasCard(card => card.hasGaintag("dcyunzheng_tag")) == !target.hasSkill("dcyunzheng_block");
return target.hasCard(card => card.hasGaintag("dcyunzheng_tag"), "h") == !target.hasSkill("dcyunzheng_block");
})
.sortBySeat();
},
@ -57,7 +187,7 @@ const skills = {
content() {
const targets = game
.filterPlayer(target => {
return target.hasCard(card => card.hasGaintag("dcyunzheng_tag")) == !target.hasSkill("dcyunzheng_block");
return target.hasCard(card => card.hasGaintag("dcyunzheng_tag"), "h") == !target.hasSkill("dcyunzheng_block");
})
.sortBySeat();
for (const target of targets) {

View File

@ -11,7 +11,7 @@ const characterSort = {
sp_jishi: ["dc_jiben", "zhenghun", "dc_sunhanhua", "liuchongluojun", "wupu"],
sp_raoting: ["dc_huanghao", "dc_sunziliufang", "dc_sunchen", "dc_jiachong"],
sp_yijun: ["gongsundu", "mengyou", "dc_sp_menghuo", "gongsunxiu"],
sp_zhengyin: ["yue_caiwenji", "yue_zhoufei", "yue_caiyong", "yue_xiaoqiao", "yue_daqiao", "yue_miheng", "yue_zoushi"],
sp_zhengyin: ["yue_caiwenji", "yue_zhoufei", "yue_caiyong", "yue_xiaoqiao", "yue_daqiao", "yue_miheng", "yue_zoushi", "yue_zhugeguo"],
huicui_waitforsort: ["chezhou", "zhupeilan"],
};

View File

@ -555,6 +555,13 @@ const translates = {
dcyunzheng_info: "锁定技。①游戏开始时,你将所有手牌标记为“筝”。②你的“筝”牌不计入手牌上限。③手牌中有“筝”的角色的非锁定技失效。",
dchuoxin: "惑心",
dchuoxin_info: "锁定技,当你使用手牌指定其他角色为目标后,你展示其一张手牌。若此牌为“筝”牌或与你使用牌花色相同,你获得之;否则你将此牌标记为“筝”。",
yue_zhugeguo: "乐诸葛果",
yue_zhugeguo_prefix: "乐",
dcxidi: "羲笛",
dcxidi_tag: "笛",
dcxidi_info: "锁定技。①游戏开始时你将所有手牌标记为“笛”。②你的“笛”牌不计入手牌上限。③准备阶段若你的手牌中有“笛”则你观看牌堆顶X张牌然后将这些牌以任意顺序置于牌堆顶和牌堆底X为你手牌中的“笛”数且X至多为5。",
dcchengyan: "乘烟",
dcchengyan_info: "当你于出牌阶段使用【杀】或普通锦囊牌指定其他角色为目标后,你可以亮出牌堆顶的一张牌,若此牌为【杀】或可指定目标的普通锦囊牌,你将此牌对其的结算方式改为此牌牌名的结算方式;若此牌不为【杀】和普通锦囊牌,你获得此牌并将此牌标记为“笛”。",
};
export default translates;

View File

@ -1142,6 +1142,7 @@ window.noname_character_rank = {
"mb_simafu",
],
b: [
"yue_zhugeguo",
"std_dc_yanghu",
"std_re_dengzhi",
"std_mateng",
@ -2279,6 +2280,7 @@ window.noname_character_rank = {
"yue_miheng",
],
rare: [
"yue_zhugeguo",
"yue_zoushi",
"chezhou",
"std_sunhao",