Merge pull request #1374 from mengxinzxz/PR-Branch

OL界法正,修改所有character\onlyOL\skill.js中的step写法
This commit is contained in:
Spmario233 2024-05-21 11:39:04 +08:00 committed by GitHub
commit 717b985a16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 160 additions and 31 deletions

View File

@ -10,6 +10,7 @@ const characters = {
ol_yufan: ["male", "wu", 3, ["olzongxuan", "olzhiyan"], ["tempname:re_yufan", "die_audio:re_yufan"]],
ol_chengpu: ["male", "wu", 4, ["dclihuo", "olchunlao"], ["tempname:xin_chengpu", "die_audio:xin_chengpu"]],
ol_wangyi: ["female", "wei", 3, ["olzhenlie", "olmiji"]],
ol_fazheng: ["male", "shu", 3, ["olxuanhuo", "olenyuan"]],
};
export default characters;

View File

@ -2,6 +2,134 @@ import { lib, game, ui, get, ai, _status } from "../../noname.js";
/** @type { importCharacterConfig['skill'] } */
const skills = {
//法正
olxuanhuo: {
audio: 2,
trigger: { player: "phaseDrawEnd" },
filter(event, player) {
return player.countCards("he") > 1 && game.hasPlayer(target => target != player);
},
async cost(event, trigger, player) {
const ai2 = function (target) {
const player = _status.event.player;
if (
!game.hasPlayer(current => {
return current != player && current != target;
})
)
return get.effect(target, new lib.element.VCard({ name: "shunshou_copy2" }), player, player);
if (get.attitude(player, target) <= 0) return 0;
const num = target.getUseValue(new lib.element.VCard({ name: "sha" }), false);
if (target.hasSkillTag("nogain")) num /= 4;
return num;
};
event.result = await player
.chooseCardTarget({
prompt: get.prompt2("olxuanhuo"),
filterCard: true,
selectCard: 2,
position: "he",
filterTarget: lib.filter.notMe,
goon: game.hasPlayer(function (current) {
return current != player && ai2(player, current) > 0;
}),
ai1(card) {
if (!_status.event.goon && game.countPlayer(target => target != _status.event.player) > 1) return 0;
return 7 - get.value(card);
},
ai2: ai2,
})
.forResult();
},
async content(event, trigger, player) {
const target = event.targets[0];
await player.give(event.cards, target);
if (
game.hasPlayer(function (current) {
return current != player && current != target;
})
) {
const result2 = await player
.chooseTarget(
function (card, player, target) {
return target != player && target != _status.event.target;
},
"请选择" + get.translation(target) + "使用【杀】的目标",
true
)
.set("target", target)
.set("ai", function (target) {
const evt = _status.event,
card = new lib.element.VCard({ name: "sha" });
if (!evt.target.canUse(card, target, false)) return 0;
return get.effect(target, card, evt.target, evt.player);
})
.set("target", target)
.forResult();
if (result2.bool) {
const target2 = result2.targets[0];
const sha = new lib.element.VCard({ name: "sha" });
player.line(target2);
if (target.canUse(sha, target2, false)) {
const index = await target
.chooseControl()
.set("choiceList", ["视为对" + get.translation(target2) + "使用一张【杀】", "令" + get.translation(player) + "观看你的手牌并获得你的两张牌"])
.set("ai", () => {
const player = get.event("player"),
target = get.event("target"),
source = get.event("source");
const sha = new lib.element.VCard({ name: "sha" }),
shunshou = new lib.element.VCard({ name: "shunshou_copy2" });
return get.effect(target, sha, player, player) > get.effect(player, shunshou, source, player) * Math.min(2, player.countGainableCards(source, "he")) ? 0 : 1;
})
.set("source", player)
.set("target", target2)
.forResult("index");
if (index == 0) {
await target.useCard(sha, false, target2);
return;
}
}
}
}
await player.gainPlayerCard(target, 2, "he", true, "visible");
},
ai: { expose: 0.15 },
},
olenyuan: {
audio: 2,
group: ["olenyuan1", "olenyuan2"],
},
olenyuan1: {
inherit: "xinenyuan1",
},
olenyuan2: {
inherit: "xinenyuan2",
prompt2: event => "令" + get.translation(event.source) + "交给你一张红色手牌或失去1点体力",
getIndex: event => event.num,
async content(event, trigger, player) {
const result = await trigger.source
.chooseToGive(
"恩怨:交给" + get.translation(player) + "一张红色手牌或失去1点体力",
(card, player) => {
return get.color(card) == "red";
},
"h",
player
)
.set("ai", card => {
const player = _status.event.getParent().player,
source = _status.event.player;
if (get.effect(source, { name: "losehp" }, source, source) >= 0) return 0;
if (get.attitude(player, source) > 0) return 11 - get.value(card);
return 7 - get.value(card);
})
.forResult();
if (!result.bool) {
await trigger.source.loseHp();
}
},
},
//王异
olzhenlie: {
audio: 2,
@ -1425,13 +1553,12 @@ const skills = {
olqiaoshui: {
audio: "reqiaoshui",
inherit: "reqiaoshui",
filter: function (event, player) {
filter(event, player) {
return player.countCards("h") > 0 && !player.hasSkill("olqiaoshui_used");
},
content: function () {
"step 0";
player.chooseToCompare(target);
"step 1";
async content(event, trigger, player) {
const target = event.target;
const result = await player.chooseToCompare(target).forResult();
if (result.bool) player.addTempSkill("qiaoshui3", { player: "phaseUseAfter" });
else {
player.addTempSkill("qiaoshui2");
@ -1459,35 +1586,26 @@ const skills = {
player: ["loseAfter"],
global: ["equipAfter", "addJudgeAfter", "gainAfter", "loseAsyncAfter", "addToExpansionAfter"],
},
filter: function (event, player) {
var evt = event.getl(player);
filter(event, player) {
const evt = event.getl(player);
return evt && (evt.es.length || evt.cards2.length > 1);
},
direct: true,
content: function () {
"step 0";
event.count = 2;
event.logged = false;
"step 1";
player
.chooseTarget(get.prompt("olxuanfeng"), "弃置一名其他角色的一张牌", function (card, player, target) {
getIndex: () => 2,
async cost(event, trigger, player) {
event.result = await player
.chooseTarget(get.prompt("olxuanfeng"), "弃置一名其他角色的一张牌", (card, player, target) => {
if (player == target) return false;
return target.countDiscardableCards(player, "he");
})
.set("ai", function (target) {
return -get.attitude(_status.event.player, target);
});
"step 2";
if (result.bool) {
if (!event.logged) {
player.logSkill("olxuanfeng", result.targets);
event.logged = true;
} else player.line(result.targets[0], "green");
player.discardPlayerCard(result.targets[0], "he", true);
event.count--;
} else event.finish();
"step 3";
if (event.count) event.goto(1);
.set("ai", target => {
const player = get.event("player");
return get.effect(target, { name: "guohe_copy2" }, player, player);
})
.forResult();
},
content() {
const target = event.targets[0];
player.discardPlayerCard(target, "he", true);
},
ai: {
reverseEquip: true,

View File

@ -1,5 +1,5 @@
const characterSort = {
onlyOL_yijiang1: ["ol_jianyong", "ol_lingtong", "ol_gaoshun"],
onlyOL_yijiang1: ["ol_jianyong", "ol_lingtong", "ol_gaoshun", "ol_fazheng"],
onlyOL_yijiang2: ["ol_caozhang", "ol_chengpu", "ol_wangyi"],
onlyOL_yijiang3: ["ol_yufan"],
onlyOL_sb: ["ol_sb_jiangwei", "ol_sb_guanyu", "ol_sb_taishici", "ol_sb_yuanshao"],

View File

@ -72,6 +72,14 @@ const translates = {
olzhenlie_info: "当你成为其他角色使用【杀】或普通锦囊牌的目标后你可以失去1点体力并令此牌对你无效然后你选择一项①获得使用者的一张牌②发动一次〖秘计〗。",
olmiji: "秘计",
olmiji_info: "结束阶段若你已受伤则你可以摸X张牌然后你可以将至多X张牌任意分配给其他角色X为你已损失的体力值。",
ol_fazheng:'OL界法正',
ol_fazheng_prefix:'OL界',
olxuanhuo:'眩惑',
olxuanhuo_info:'摸牌阶段结束时你可以交给一名其他角色两张牌然后其选择一项1.视为对你选择的另一名其他角色使用一张【杀】2.令你观看并获得其两张牌。',
olenyuan:'恩怨',
olenyuan1:'恩怨',
olenyuan2:'恩怨',
olenyuan_info:'①当你一次性获得一名其他角色超过一张牌后你可以令其摸一张牌。②当你受到1点伤害后你可以令伤害来源选择一项1.将一张红色手牌交给你2.失去1点体力。',
};
export default translates;

View File

@ -586,6 +586,7 @@ window.noname_character_rank = {
"wangrong",
"re_fazheng",
"tw_re_fazheng",
"ol_fazheng",
"huaxin",
"re_chunyuqiong",
"ns_luyusheng",
@ -2532,6 +2533,7 @@ window.noname_character_rank = {
"zhanghuyuechen",
"re_fazheng",
"tw_re_fazheng",
"ol_fazheng",
"re_fuhuanghou",
"gongsunkang",
"xin_panzhangmazhong",

View File

@ -4,7 +4,7 @@ const characterReplaces = {
yujin: ["yujin", "yujin_yujin", "ol_yujin", "sb_yujin", "xin_yujin", "re_yujin"],
dc_xushu: ["re_xushu", "dc_xushu"],
xushu: ["xin_xushu", "xushu"],
fazheng: ["xin_fazheng", "re_fazheng", "sb_fazheng", "tw_re_fazheng", "fazheng"],
fazheng: ["xin_fazheng", "ol_fazheng", "re_fazheng", "sb_fazheng", "tw_re_fazheng", "fazheng"],
masu: ["xin_masu", "re_masu", "masu"],
xusheng: ["xusheng", "xin_xusheng", "re_xusheng", "old_xusheng"],
wuguotai: ["wuguotai", "xin_wuguotai", "re_wuguotai"],

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB