Merge pull request #1319 from PZ157/PR-Branch

用当前技能代替”此武将牌“
This commit is contained in:
Spmario233 2024-05-05 21:56:36 +08:00 committed by GitHub
commit 4f4aa3df86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 119 additions and 71 deletions

View File

@ -82,7 +82,7 @@ const skills = {
} }
list.forEach(name => { list.forEach(name => {
if (name !== "dc_wuyi") { if (name !== "dc_wuyi") {
const skills = get.character(name).skills; const skills = get.character(name, 3);
skills.forEach(skill => { skills.forEach(skill => {
if (skill in _status.dcbenxi_map) return; if (skill in _status.dcbenxi_map) return;
const voices = game.parseSkillText(skill, name); const voices = game.parseSkillText(skill, name);

View File

@ -807,11 +807,14 @@ const skills = {
}, },
noname_duocai2: { charlotte: true }, noname_duocai2: { charlotte: true },
nsbizhao: { nsbizhao: {
unique: true,
trigger: { player: "showCharacterAfter" }, trigger: { player: "showCharacterAfter" },
forced: true, forced: true,
hiddenSkill: true, hiddenSkill: true,
filter(event, player) { filter(event, player) {
return event.toShow && event.toShow.includes("ns_yanghu") && player != _status.currentPhase; return event.toShow && event.toShow.some(name => {
return get.character(name, 3).includes("nsbizhao");
}) && player != _status.currentPhase;
}, },
content() { content() {
player.addTempSkill("nsbizhao2", { player.addTempSkill("nsbizhao2", {

View File

@ -12198,7 +12198,9 @@ const skills = {
filter: function (event, player, name) { filter: function (event, player, name) {
if (player.hasSkill("zhiwei2")) return false; if (player.hasSkill("zhiwei2")) return false;
if (!game.hasPlayer(current => current != player)) return false; if (!game.hasPlayer(current => current != player)) return false;
if (get.mode() == "guozhan") return event.name == "showCharacter" && (event.toShow.includes("gz_luyusheng") || event.toShow.includes("luyusheng")); if (get.mode() == "guozhan") return event.name == "showCharacter" && event.toShow(name => {
return get.character(name, 3).includes("zhiwei");
});
return event.name != "showCharacter" && (name != "phaseBefore" || game.phaseNumber == 0); return event.name != "showCharacter" && (name != "phaseBefore" || game.phaseNumber == 0);
}, },
content: function () { content: function () {
@ -12298,8 +12300,8 @@ const skills = {
player.removeSkill("zhiwei2"); player.removeSkill("zhiwei2");
if (trigger.name != "die" || get.mode() != "guozhan") event.finish(); if (trigger.name != "die" || get.mode() != "guozhan") event.finish();
"step 1"; "step 1";
if (player.name1 == "gz_luyusheng" || player.name1 == "luyusheng") player.hideCharacter(0); if (get.character(player.name1, 3).includes("zhiwei")) player.hideCharacter(0);
if (player.name2 == "gz_luyusheng" || player.name2 == "luyusheng") player.hideCharacter(1); if (get.character(player.name2, 3).includes("zhiwei")) player.hideCharacter(1);
}, },
}, },
}, },
@ -12369,49 +12371,53 @@ const skills = {
player: "damageEnd", player: "damageEnd",
source: "damageSource", source: "damageSource",
}, },
direct: true,
filter: function (event, player) { filter: function (event, player) {
return player.hasSkill("wanggui") && !player.hasSkill("wanggui2"); if (player.isUnseen()) return false;
if (!player.isUnseen(2)) return true;
return (
!player.isUnseen(0) && get.character(player.name1, 3).includes("wanggui") ||
!player.isUnseen(1) && get.character(player.name2, 3).includes("wanggui")
);
}, },
usable: 1,
preHidden: true, preHidden: true,
content: function () { async cost(event, trigger, player) {
"step 0"; if (player.isUnseen(2)) event.result = await player
player.addTempSkill("wanggui2"); .chooseTarget(
var bool = player.isUnseen(2); get.prompt("wanggui"),
if (bool) { "望归是否对与你势力不同的一名角色造成1点伤害",
player (card, player, target) => {
.chooseTarget("望归是否对一名势力不同的角色造成1点伤害", function (card, player, target) {
return target.isEnemyOf(player); return target.isEnemyOf(player);
}) }
.set("ai", function (target) { )
var player = _status.event.player; .set("ai", (target) => {
let player = _status.event.player;
return get.damageEffect(target, player, player); return get.damageEffect(target, player, player);
}) })
.setHiddenSkill("wanggui"); .setHiddenSkill("wanggui")
} else event.goto(2); .forResult();
"step 1"; else event.result = await player
if (result.bool) { .chooseBool("望归:是否令与你势力相同的角色各摸一张牌?")
var target = result.targets[0]; .setHiddenSkill("wanggui")
player.logSkill("wanggui", target); .set("logSkill", ["wanggui", game.filterPlayer(current => {
target.damage(); return current.isFriendOf(player);
})])
.forResult();
},
async content(event, trigger, player) {
if (player.isUnseen(2)) {
const target = event.targets[0];
target.damage("nocard");
} }
event.finish(); else {
"step 2"; const targets = game.filterPlayer(current => {
player.chooseBool("望归:是否令所有与自己势力相同的角色各摸一张牌?").setHiddenSkill("wanggui");
"step 3";
if (result.bool) {
var targets = game.filterPlayer(function (current) {
return current.isFriendOf(player); return current.isFriendOf(player);
}); });
targets.sortBySeat(); targets.sortBySeat();
player.logSkill("wanggui", targets);
game.asyncDraw(targets); game.asyncDraw(targets);
} else event.finish(); }
"step 4";
game.delayx();
}, },
}, },
wanggui2: {},
xibing: { xibing: {
audio: 2, audio: 2,
trigger: { global: "useCardToPlayered" }, trigger: { global: "useCardToPlayered" },

View File

@ -463,6 +463,8 @@ const skills = {
}, },
//加纳天善(旧) //加纳天善(旧)
tenzen_yixing: { tenzen_yixing: {
unique: true,
forceunique: true,
trigger: { trigger: {
global: "damageEnd", global: "damageEnd",
}, },
@ -4756,6 +4758,8 @@ const skills = {
}, },
}, },
yukito_yaxiang: { yukito_yaxiang: {
unique: true,
forceunique: true,
enable: "chooseToUse", enable: "chooseToUse",
limited: true, limited: true,
filter(event, player) { filter(event, player) {
@ -10574,9 +10578,15 @@ const skills = {
}, },
}, },
umi_qihuan: { umi_qihuan: {
unique: true,
forceunique: true,
enable: "chooseToUse", enable: "chooseToUse",
filter(summer, umi) { filter(summer, umi) {
return summer.type == "dying" && umi.isDying(); return (
summer.type == "dying" &&
umi.isDying() &&
[umi.name1, umi.name2].includes("key_umi")
);
}, },
limited: true, limited: true,
skillAnimation: true, skillAnimation: true,

View File

@ -5075,6 +5075,7 @@ const skills = {
}, },
}, },
dcxunbie: { dcxunbie: {
unique: true,
audio: 2, audio: 2,
trigger: { trigger: {
player: "dying", player: "dying",
@ -5090,7 +5091,9 @@ const skills = {
characters.remove("dc_mifuren"); characters.remove("dc_mifuren");
} }
}); });
return characters.length; return characters.length && [player.name1, player.name2].some(name => {
return get.character(name, 3).includes("dcxunbie");
});
}, },
check: () => true, check: () => true,
skillAnimation: true, skillAnimation: true,
@ -5100,7 +5103,6 @@ const skills = {
content: function () { content: function () {
"step 0"; "step 0";
player.awakenSkill("dcxunbie"); player.awakenSkill("dcxunbie");
if (player.name1 == "ganfurenmifuren" || player.name2 == "ganfurenmifuren") {
var characters = ["dc_ganfuren", "dc_mifuren"]; var characters = ["dc_ganfuren", "dc_mifuren"];
game.countPlayer(current => { game.countPlayer(current => {
if (current.name1 == "dc_ganfuren" || current.name2 == "dc_ganfuren") { if (current.name1 == "dc_ganfuren" || current.name2 == "dc_ganfuren") {
@ -5117,13 +5119,14 @@ const skills = {
.set("dialog", ["选择要替换成的武将", [characters, "character"]]) .set("dialog", ["选择要替换成的武将", [characters, "character"]])
.set("ai", () => [0, 1].randomGet()); .set("ai", () => [0, 1].randomGet());
} }
} else event.goto(2);
"step 1"; "step 1";
var character = result.control; var character = result.control;
if (!_status.characterlist) { if (!_status.characterlist) {
lib.skill.pingjian.initList(); lib.skill.pingjian.initList();
} }
player.reinitCharacter("ganfurenmifuren", character); player.reinitCharacter((get.character(player.name2, 3).includes("dcxunbie") ?
player.name2 : player.name1
), character);
"step 2"; "step 2";
player.recover(1 - player.hp); player.recover(1 - player.hp);
player.addTempSkill("dcxunbie_muteki", { player: "phaseAfter" }); player.addTempSkill("dcxunbie_muteki", { player: "phaseAfter" });

View File

@ -946,12 +946,15 @@ const skills = {
}, },
}, },
gaoling: { gaoling: {
unique: true,
audio: 2, audio: 2,
trigger: { player: "showCharacterAfter" }, trigger: { player: "showCharacterAfter" },
hiddenSkill: true, hiddenSkill: true,
filter: function (event, player) { filter: function (event, player) {
return ( return (
event.toShow.includes("xuangongzhu") && event.toShow.some(name => {
return get.character(name, 3).includes("gaoling");
}) &&
player != _status.currentPhase && player != _status.currentPhase &&
game.hasPlayer(function (current) { game.hasPlayer(function (current) {
return current.isDamaged(); return current.isDamaged();

View File

@ -2674,8 +2674,15 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
}, },
}, },
fakezhiwei: { fakezhiwei: {
unique: true,
audio: "zhiwei", audio: "zhiwei",
inherit: "zhiwei", inherit: "zhiwei",
filter: function (event, player, name) {
if (!game.hasPlayer(current => current != player)) return false;
return event.name == "showCharacter" && event.toShow(name => {
return get.character(name, 3).includes("fakezhiwei");
});
},
content() { content() {
"step 0"; "step 0";
player player
@ -4914,6 +4921,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
}, },
}, },
fakebaoqie: { fakebaoqie: {
unique: true,
audio: "baoqie", audio: "baoqie",
trigger: { player: "showCharacterEnd" }, trigger: { player: "showCharacterEnd" },
filter(event, player) { filter(event, player) {
@ -5087,6 +5095,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
}, },
}, },
fakehuirong: { fakehuirong: {
unique: true,
audio: "huirong", audio: "huirong",
trigger: { player: "showCharacterEnd" }, trigger: { player: "showCharacterEnd" },
filter(event, player) { filter(event, player) {
@ -5258,6 +5267,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
}, },
}, },
fakeshiren: { fakeshiren: {
unique: true,
audio: "shiren", audio: "shiren",
trigger: { player: "showCharacterEnd" }, trigger: { player: "showCharacterEnd" },
filter(event, player) { filter(event, player) {
@ -6439,8 +6449,8 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
.set("prompt", "近谀:请暗置一张武将牌") .set("prompt", "近谀:请暗置一张武将牌")
.set("ai", function () { .set("ai", function () {
var target = _status.event.player; var target = _status.event.player;
if (target.name == "gz_pengyang") return "主将"; if (get.character(target.name, 3).includes("gzjinyu")) return "主将";
if (target.name2 == "gz_pengyang") return "副将"; if (get.character(target.name2, 3).includes("gzjinyu")) return "副将";
if ( if (
lib.character[target.name][3].some((skill) => { lib.character[target.name][3].some((skill) => {
var info = get.info(skill); var info = get.info(skill);
@ -7526,11 +7536,14 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
}, },
//黄权 //黄权
gzdianhu: { gzdianhu: {
unique: true,
audio: "xinfu_dianhu", audio: "xinfu_dianhu",
trigger: { player: "showCharacterAfter" }, trigger: { player: "showCharacterAfter" },
forced: true, forced: true,
filter: function (event, player) { filter: function (event, player) {
return event.toShow.includes("gz_xf_huangquan") && !player.storage.gzdianhu_effect; return event.toShow.some(name => {
return get.character(name, 3).includes("gzdianhu");
}) && !player.storage.gzdianhu_effect;
}, },
content: function () { content: function () {
"step 0"; "step 0";
@ -8647,7 +8660,9 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
audio: "xuanbei", audio: "xuanbei",
trigger: { player: "showCharacterAfter" }, trigger: { player: "showCharacterAfter" },
filter: function (event, player) { filter: function (event, player) {
return !player.storage.gzxuanbei && event.toShow.includes("gz_yangyan"); return !player.storage.gzxuanbei && event.toShow.some(name => {
return get.character(name, 3).includes("gzxuanbei");
});
}, },
forced: true, forced: true,
locked: false, locked: false,
@ -9567,7 +9582,9 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
trigger: { player: "showCharacterAfter" }, trigger: { player: "showCharacterAfter" },
forced: true, forced: true,
filter: function (event, player) { filter: function (event, player) {
return event.toShow.includes("gz_liaohua") && !player.storage.gzdangxian_draw; return event.toShow.some(name => {
return get.character(name, 3).includes("gzdangxian");
}) && !player.storage.gzdangxian_draw;
}, },
content: function () { content: function () {
player.storage.gzdangxian_draw = true; player.storage.gzdangxian_draw = true;
@ -13040,7 +13057,7 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
}, },
content: function () { content: function () {
trigger.cancel(); trigger.cancel();
player.removeCharacter(player.name1 == "gz_yanbaihu" ? 0 : 1); player.removeCharacter(get.character(player.name1, 3).includes("gzyjili") ? 0 : 1);
}, },
}, },
}, },
@ -14723,7 +14740,9 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
}, },
forced: true, forced: true,
filter: function (event, player) { filter: function (event, player) {
return event.toShow.includes("gz_zuoci") && !player.storage.yigui_init; return event.toShow.some(name => {
return get.character(name, 3).includes("yigui");
}) && !player.storage.yigui_init;
}, },
content: function () { content: function () {
player.storage.yigui_init = true; player.storage.yigui_init = true;
@ -16349,8 +16368,9 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
if (event.filterName(event.current.name2)) list.push("副将"); if (event.filterName(event.current.name2)) list.push("副将");
if (list.length > 1) if (list.length > 1)
event.current.chooseControl(["主将", "副将"]).set("ai", function () { event.current.chooseControl(["主将", "副将"]).set("ai", function () {
if (player.name1 == "gz_fazheng") return 0; let player = _status.event.player;
if (player.name2 == "gz_fazheng") return 1; if (get.character(player.name1, 3).includes("gzxuanhuo")) return 0;
if (get.character(player.name2, 3).includes("gzxuanhuo")) return 1;
return Math.random() > 0.5 ? 0 : 1; return Math.random() > 0.5 ? 0 : 1;
}).prompt = "选择并展示一张武将牌,然后执行军令"; }).prompt = "选择并展示一张武将牌,然后执行军令";
else event._result = { index: list[0] == "主将" ? 0 : 1 }; else event._result = { index: list[0] == "主将" ? 0 : 1 };
@ -17010,9 +17030,9 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
break; break;
} }
} }
if (event.target.name == "gz_zhoutai") { if (get.character(event.target.name, 3).includes("buqu")) {
choice = "主将"; choice = "主将";
} else if (event.target.name2 == "gz_zhoutai") { } else if (get.character(event.target.name2, 3).includes("buqu")) {
choice = "副将"; choice = "副将";
} }
player player
@ -20606,12 +20626,15 @@ game.import("mode", function (lib, game, ui, get, ai, _status) {
}, },
}, },
gzguixiu: { gzguixiu: {
unique: true,
audio: "guixiu", audio: "guixiu",
trigger: { player: ["showCharacterAfter", "removeCharacterBefore"] }, trigger: { player: ["showCharacterAfter", "removeCharacterBefore"] },
filter: function (event, player) { filter: function (event, player) {
if (event.name == "removeCharacter" || event.name == "changeVice") if (event.name == "removeCharacter" || event.name == "changeVice")
return event.toRemove == "gz_mifuren" && player.isDamaged(); return get.character(event.toRemove, 3).includes("gzguixiu") && player.isDamaged();
return event.toShow.includes("gz_mifuren"); return event.toShow.some(name => {
return get.character(name, 3).includes("gzguixiu");
});
}, },
content: function () { content: function () {
if (trigger.name == "showCharacter") { if (trigger.name == "showCharacter") {