From 9d4e856e5f478512ee42354555a79c2aedf34b30 Mon Sep 17 00:00:00 2001
From: mengxinzxz <2223529500@qq.com>
Date: Thu, 9 May 2024 23:13:51 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E6=9D=80=E8=B0=8B=E8=B4=BE?=
=?UTF-8?q?=E8=AF=A9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
character/xianding/character.js | 1 +
character/xianding/dynamicTranslate.js | 11 ++
character/xianding/skill.js | 203 +++++++++++++++++++++++++
character/xianding/translate.js | 8 +
4 files changed, 223 insertions(+)
diff --git a/character/xianding/character.js b/character/xianding/character.js
index 571cd68b6..1a03dbc6f 100644
--- a/character/xianding/character.js
+++ b/character/xianding/character.js
@@ -1,4 +1,5 @@
const characters = {
+ dc_sb_jiaxu: ["male", "qun", 3, ["dcsbsushen", "dcsbrushi", "dcsbfumou"]],
guanyue: ["male", "shu", 4, ["dcshouzhi", "dcfenhui"]],
sp_zhenji: ["female", "qun", 3, ["dcjijie", "dchuiji"]],
wu_guanyu: ["male", "shu", 5, ["dcjuewu", "dcwuyou", "dcyixian"]],
diff --git a/character/xianding/dynamicTranslate.js b/character/xianding/dynamicTranslate.js
index bebb6e081..09a8171ac 100644
--- a/character/xianding/dynamicTranslate.js
+++ b/character/xianding/dynamicTranslate.js
@@ -96,5 +96,16 @@ const dynamicTranslates = {
if (player.storage.dcshouzhi_modified) skillName += "_modified";
return lib.translate[`${skillName}_info`];
},
+ dcsbfumou(player) {
+ const storage = player.storage.dcsbfumou;
+ var str = "转换技,出牌阶段限一次,你可以观看一名其他角色A的手牌并展示其一半手牌:";
+ if (!storage) str += '';
+ str += "阴,并将这些牌交给另一名其他角色B,然后你与A各摸X张牌(X为A以此法失去的手牌数);";
+ if (!storage) str += "";
+ if (storage) str += '';
+ str += "阳,令A依次使用这些牌中所有其可以使用的牌。";
+ if (storage) str += "";
+ return str;
+ },
};
export default dynamicTranslates;
diff --git a/character/xianding/skill.js b/character/xianding/skill.js
index f9679030e..e804070d9 100644
--- a/character/xianding/skill.js
+++ b/character/xianding/skill.js
@@ -2,6 +2,209 @@ import { lib, game, ui, get, ai, _status } from "../../noname.js";
/** @type { importCharacterConfig['skill'] } */
const skills = {
+ //谋贾诩
+ dcsbsushen: {
+ unique: true,
+ limited: true,
+ audio: 2,
+ audioname: ["dc_sb_jiaxu_shadow"],
+ enable: "phaseUse",
+ skillAnimation: true,
+ animationColor: "soil",
+ content() {
+ player.awakenSkill("dcsbsushen");
+ player.storage.dcsbsushen_reload = [Boolean(player.storage.dcsbfumou), player.countCards("h"), player.getHp()];
+ player.addSkill("dcsbsushen_reload");
+ player.addSkillLog("dcsbrushi");
+ },
+ derivation: "dcsbrushi",
+ subSkill: {
+ reload: {
+ charlotte: true,
+ onremove: true,
+ mark: true,
+ intro: {
+ content(storage) {
+ return ["【覆谋】状态:" + ["阳", "阴"][storage[0] ? 1 : 0], "手牌数:" + storage[1], "体力值:" + storage[2]].join("
");
+ },
+ },
+ },
+ },
+ ai: {
+ //waiting for PZ157
+ },
+ },
+ dcsbrushi: {
+ unique: true,
+ limited: true,
+ audio: 2,
+ audioname: ["dc_sb_jiaxu_shadow"],
+ enable: "phaseUse",
+ filter(event, player) {
+ return Array.isArray(player.storage.dcsbsushen_reload);
+ },
+ skillAnimation: true,
+ animationColor: "thunder",
+ *content(event, map) {
+ const player = map.player,
+ storage = player.storage.dcsbsushen_reload;
+ player.awakenSkill("dcsbrushi");
+ player.removeSkill("dcsbsushen_reload");
+ if (Boolean(player.storage.dcsbfumou) !== storage[0]) {
+ if (player.hasSkill("dcsbfumou", null, null, false)) {
+ player.changeZhuanhuanji("dcsbfumou");
+ }
+ }
+ if (player.countCards("h") != storage[1]) {
+ if (player.countCards("h") < storage[1]) {
+ yield player.drawTo(storage[1]);
+ } else {
+ yield player.chooseToDiscard("h", true, storage[1] - player.countCards("h"));
+ }
+ }
+ if (player.getHp() != storage[2]) {
+ yield player[player.getHp() > storage[2] ? "loseHp" : "recover"](Math.abs(player.getHp() - storage[2]));
+ }
+ },
+ ai: {
+ //waiting for PZ157
+ },
+ },
+ dcsbfumou: {
+ audio: 2,
+ audioname: ["dc_sb_jiaxu_shadow"],
+ enable: "phaseUse",
+ filter(event, player) {
+ return (
+ game.hasPlayer(target => {
+ return target != player && target.countCards("h");
+ }) && game.countPlayer(target => target != player) >= (player.storage.dcsbfumou ? 1 : 2)
+ );
+ },
+ filterTarget(card, player, target) {
+ if (target == player) return false;
+ if (!ui.selected.targets.length) return target.countCards("h");
+ return !player.storage.dcsbfumou;
+ },
+ selectTarget() {
+ const player = get.event("player");
+ return player.storage.dcsbfumou ? [1, 2] : 2;
+ },
+ targetprompt() {
+ const player = get.event("player");
+ return player.storage.dcsbfumou ? "" : ["看牌角色", "得牌角色"][ui.selected.targets.length-1];
+ },
+ prompt() {
+ const player = get.event("player");
+ return lib.skill.dcsbfumou.intro.content(player.storage.dcsbfumou);
+ },
+ usable: 1,
+ complexTarget: true,
+ complexSelect: true,
+ multitarget: true,
+ async content(event, trigger, player) {
+ const storage = player.storage.dcsbfumou,
+ target = event.targets[0],
+ num = Math.ceil(target.countCards("h")/2);
+ player.changeZhuanhuanji("dcsbfumou");
+ let cards = await player
+ .choosePlayerCard("覆谋:展示" + get.translation(target) + "的至多" + get.cnNumber(num) + "张牌", target, "h", num, true)
+ .set("ai", card => {
+ const player = get.event("player"),
+ storage = get.event("storage"),
+ target = get.event().getParent().targets[0];
+ if (!storage) return get.value(card) * -get.attitude(player, target);
+ return target.getUseValue(card) * get.attitude(player, target);
+ })
+ .set("visible", true)
+ .set("storage", storage)
+ .forResult("cards");
+ if (!cards.length) return;
+ await player.showCards(cards, get.translation(player) + "发动了【覆谋】");
+ if (!storage) {
+ const aim = event.targets[1];
+ cards = cards.filter(card => lib.filter.canBeGained(card, aim, target));
+ if (cards.length) {
+ await aim.gain(cards, target, "give");
+ await game.asyncDraw([player, target], cards.length);
+ } else {
+ aim.popup("杯具");
+ aim.chat("555一张都拿不到~");
+ }
+ } else {
+ cards = cards.filter(card => {
+ return target.hasUseTarget(card) && get.owner(card) == target && get.position(card) == "h";
+ });
+ while (
+ cards.some(card => {
+ return target.hasUseTarget(card) && get.owner(card) == target && get.position(card) == "h";
+ })
+ ) {
+ const result = await target
+ .chooseToUse(
+ true,
+ function (card) {
+ const event = get.event();
+ if (!lib.filter.cardEnabled(card, event.player, event)) return false;
+ return get.event("cards").includes(card);
+ },
+ "覆谋:请依次使用展示的牌"
+ )
+ .set("cards", cards)
+ .forResult();
+ if (result.bool) {
+ cards = cards.filter(card => {
+ return target.hasUseTarget(card) && get.owner(card) == target && get.position(card) == "h";
+ });
+ } else break;
+ }
+ }
+ },
+ zhuanhuanji: true,
+ marktext: "☯",
+ mark: true,
+ intro: {
+ content(storage) {
+ if (storage) return "转换技,出牌阶段限一次,你可以观看一名其他角色的手牌并展示其一半手牌,令其依次使用这些牌中所有其可以使用的牌。";
+ return "转换技,出牌阶段限一次,你可以观看一名其他角色A的手牌并展示其一半手牌并将这些牌交给另一名其他角色B,然后你与A各摸X张牌(X为A以此法失去的手牌数)。";
+ },
+ },
+ ai: {
+ order: 7,
+ result: {
+ target(player, target) {
+ const storage = player.storage.dcsbfumou;
+ const sgn = get.sgn(get.attitude(player, target));
+ if (!storage && !ui.selected.targets.length) {
+ return (sgn * (2 + sgn)) / (target.countCards("h") + 1);
+ }
+ return (sgn * (2 + sgn)) / (target.countCards("h") + 1);
+ },
+ },
+ },
+ group: "dcsbfumou_change",
+ subSkill: {
+ change: {
+ audio: "dcsbfumou",
+ audioname: ["dc_sb_jiaxu_shadow"],
+ trigger: {
+ global: "phaseBefore",
+ player: "enterGame",
+ },
+ filter(event, player) {
+ return event.name != "phase" || game.phaseNumber == 0;
+ },
+ prompt2(event, player) {
+ return "切换【腹谋】为状态" + (player.storage.dcsbfumou ? "阳" : "阴");
+ },
+ check: () => Math.random() > 0.5,
+ content() {
+ player.changeZhuanhuanji("dcsbfumou");
+ //player.changeSkin("dcsbfumou", "dc_sb_jiaxu" + (player.storage.dcsbfumou ? "_shadow" : ""));
+ },
+ },
+ },
+ },
//关樾
dcshouzhi: {
audio: 2,
diff --git a/character/xianding/translate.js b/character/xianding/translate.js
index 072272d33..9f206083b 100644
--- a/character/xianding/translate.js
+++ b/character/xianding/translate.js
@@ -591,6 +591,14 @@ const translates = {
dcfenhui_info: "限定技。出牌阶段,你可以令一名角色获得X枚“恨”标记,你摸等量的牌(X为本局游戏你使用黑色牌指定其为目标的次数,至多为5)。你获得如下效果:⒈当你对其造成伤害时,你移去其1枚“恨”,令此伤害+1;⒉当其死亡时,若其有“恨”,你减1点体力上限,修改〖守执〗并获得〖兴门〗。",
dcxingmen: "兴门",
dcxingmen_info: "①当你因〖守执〗弃置而失去牌后,你可以回复1点体力。②当你因摸牌而得到牌后,若这些牌均为红色且牌数不小于2,则你使用这些牌时不能被响应。",
+ dc_sb_jiaxu: "新杀谋贾诩",
+ dc_sb_jiaxu_prefix: "新杀谋",
+ dcsbsushen: "肃身",
+ dcsbsushen_info: "限定技,出牌阶段,你可以记录你当前〖覆谋〗的状态、你的手牌数和你的体力值,然后获得技能〖入世〗。",
+ dcsbrushi: "入世",
+ dcsbrushi_info: "限定技,出牌阶段,你可以将你当前〖覆谋〗的状态、你的手牌数和你的体力值调整为你发动〖肃身〗时的记录。",
+ dcsbfumou: "覆谋",
+ dcsbfumou_info: "转换技,出牌阶段限一次,你可以观看一名其他角色A的手牌并展示其一半手牌:阴,并将这些牌交给另一名其他角色B,然后你与A各摸X张牌(X为A以此法失去的手牌数);阳,令A依次使用这些牌中所有其可以使用的牌。",
};
export default translates;
From e69cbf677bca4b64942e6543a87a973a75115602 Mon Sep 17 00:00:00 2001
From: mengxinzxz <2223529500@qq.com>
Date: Thu, 9 May 2024 23:17:11 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E6=9D=8E=E4=B8=B0=E3=80=90=E5=9B=A4?=
=?UTF-8?q?=E5=82=A8=E3=80=91bugfix?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
character/huicui/skill.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/character/huicui/skill.js b/character/huicui/skill.js
index 7c9d7d41e..f20849c60 100644
--- a/character/huicui/skill.js
+++ b/character/huicui/skill.js
@@ -77,7 +77,7 @@ const skills = {
if (card.cards && (card.cards || []).some(i => get.position(i) == "h")) return false;
},
cardSavable() {
- return lib.skill.dctunchu_subSkill.debuff.mod.cardEnabled2.apply(this, arguments);
+ return lib.skill.dctunchu.subSkill.debuff.mod.cardEnabled2.apply(this, arguments);
},
},
},