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 => {
if (name !== "dc_wuyi") {
const skills = get.character(name).skills;
const skills = get.character(name, 3);
skills.forEach(skill => {
if (skill in _status.dcbenxi_map) return;
const voices = game.parseSkillText(skill, name);

View File

@ -807,11 +807,14 @@ const skills = {
},
noname_duocai2: { charlotte: true },
nsbizhao: {
unique: true,
trigger: { player: "showCharacterAfter" },
forced: true,
hiddenSkill: true,
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() {
player.addTempSkill("nsbizhao2", {

View File

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

View File

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

View File

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

View File

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

View File

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