Merge pull request #1439 from mengxinzxz/PR-Branch

cost事件新增skill_popup属性;技能修改
This commit is contained in:
Spmario233 2024-06-05 20:15:14 +08:00 committed by GitHub
commit e792223e08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 67 additions and 51 deletions

View File

@ -7091,38 +7091,46 @@ const skills = {
bingqing: { bingqing: {
audio: 2, audio: 2,
trigger: { player: "useCardAfter" }, trigger: { player: "useCardAfter" },
direct: true, filter(event, player) {
filter: function (event, player) { const evt = event.getParent("phaseUse");
var suit = get.suit(event.card); if (!evt || !evt.player || evt.player != player) return false;
const suit = get.suit(event.card);
if (!lib.suit.includes(suit)) return false; if (!lib.suit.includes(suit)) return false;
var evt = event.getParent("phaseUse"); if (
if (!evt || player != evt.player) return false; player
var list = [], .getHistory("useCard", evtx => {
history = player.getHistory("useCard"); return evtx.getParent("phaseUse") == evt && get.suit(evtx.card) == suit;
if (history.length < 2) return false; })
for (var i of history) { .indexOf(event) != 0
if (i.getParent("phaseUse") != evt) continue; )
var suit2 = get.suit(i.card); return false;
if (!lib.suit.includes(suit2)) continue; return Array.from({ length: 3 })
if (i != event && suit2 == suit) return false; .map((_, i) => i + 2)
if (i.finished) list.add(suit2); .includes(
} player
return list.length > 1 && list.length < 5; .getHistory(
"useCard",
evtx => {
return evtx.getParent("phaseUse") == evt && lib.suit.includes(get.suit(evtx.card));
},
event
)
.reduce((list, evtx) => list.add(get.suit(evtx.card)), []).length
);
}, },
content: function () { async cost(event, trigger, player) {
"step 0"; const evt = trigger.getParent("phaseUse");
var suit = get.suit(trigger.card); const num = player
var evt = event.getParent("phaseUse"); .getHistory(
var list = [], "useCard",
history = player.getHistory("useCard"); evtx => {
for (var i of history) { return evtx.getParent("phaseUse") == evt && lib.suit.includes(get.suit(evtx.card));
if (i.getParent("phaseUse") != evt) continue; },
var suit2 = get.suit(i.card); trigger
if (!lib.suit.includes(suit2)) continue; )
if (i.finished) list.add(suit2); .reduce((list, evtx) => list.add(get.suit(evtx.card)), []).length;
} let prompt, filterTarget, ai;
var prompt, filterTarget, ai; switch (num) {
switch (list.length) {
case 2: case 2:
prompt = "令一名角色摸两张牌"; prompt = "令一名角色摸两张牌";
filterTarget = function (card, player, target) { filterTarget = function (card, player, target) {
@ -7144,7 +7152,7 @@ const skills = {
}; };
ai = function (target) { ai = function (target) {
var player = _status.event.player; var player = _status.event.player;
return get.effect(target, { name: "guohe_copy" }, player, player); return get.effect(target, { name: "guohe" }, player, player);
}; };
break; break;
case 4: case 4:
@ -7158,29 +7166,30 @@ const skills = {
}; };
break; break;
default: default:
event.finish(); event.result = { bool: false };
return; return;
} }
event.num = list.length; let result = await player.chooseTarget(get.prompt("bingqing"), prompt, filterTarget).set("ai", ai).forResult();
player.chooseTarget(get.prompt("bingqing"), prompt, filterTarget).set("ai", ai); result.cost_data = num;
"step 1"; event.result = result;
if (result.bool) { },
var target = result.targets[0]; async content(event, trigger, player) {
player.logSkill("bingqing", target); const target = event.targets[0];
event.target = target; switch (event.cost_data) {
event.goto(num); case 2:
} else event.finish(); await target.draw(2);
"step 2"; break;
target.draw(2); case 3:
event.finish(); await player.discardPlayerCard(target, true, "hej");
"step 3"; break;
player.discardPlayerCard(target, true, "hej"); case 4:
event.finish(); await target.damage();
"step 4"; break;
target.damage(); }
}, },
}, },
yingfeng: { yingfeng: {
audio: 2,
trigger: { player: "phaseZhunbeiBegin" }, trigger: { player: "phaseZhunbeiBegin" },
direct: true, direct: true,
content: function () { content: function () {

View File

@ -541,7 +541,7 @@ const translates = {
spqishe_info: "你可以将一张装备牌当做【酒】使用。你的手牌上限+XX为你装备区内的牌数。", spqishe_info: "你可以将一张装备牌当做【酒】使用。你的手牌上限+XX为你装备区内的牌数。",
sp_maojie: "毛玠", sp_maojie: "毛玠",
bingqing: "秉清", bingqing: "秉清",
bingqing_info: "当你于出牌阶段内使用的牌结算结束后,若你于本阶段内使用的所有已结算结束的其他牌与此牌花色均不相同则你可根据X的值执行对应效果为2你令一名角色摸两张牌为3你弃置一名角色区域内的一张牌为4你对一名其他角色造成1点伤害。X为你本阶段内使用过的已结算结束的牌中包含的花色数", bingqing_info: "当你于出牌阶段内使用的牌结算完毕后,若你于本阶段内此前使用的所有牌的花色与此牌花色均不相同则你可根据X的值执行对应效果为2你令一名角色摸两张牌为3你弃置一名角色区域内的一张牌为4你对一名其他角色造成1点伤害。X为你于本阶段内此前使用的所有牌包含的花色数+1",
yingfeng: "迎奉", yingfeng: "迎奉",
yingfeng_info: "准备阶段,你可以令一名角色获得“奉”标记并移除场上所有其他的“奉”标记。有“奉”标记的角色使用牌没有距离限制。", yingfeng_info: "准备阶段,你可以令一名角色获得“奉”标记并移除场上所有其他的“奉”标记。有“奉”标记的角色使用牌没有距离限制。",
xin_sunxiu: "手杀界孙休", xin_sunxiu: "手杀界孙休",

View File

@ -386,7 +386,13 @@ const skills = {
trigger.increase("num"); trigger.increase("num");
}, },
countSkill(player) { countSkill(player) {
//飞扬跋扈OL你无敌了
const list = [
["feiyang", "飞扬"],
["bahu", "跋扈"],
];
return player.getSkills(null, false, false).filter(i => { return player.getSkills(null, false, false).filter(i => {
if (list.some(text => i.includes(text[0]) && get.translation(i) == text[1])) return true;
const info = get.info(i); const info = get.info(i);
return !info || !info.charlotte; return !info || !info.charlotte;
}).length; }).length;

View File

@ -1255,6 +1255,7 @@ const translates = {
olmaozhu_info: "锁定技。①你的手牌上限和使用【杀】的额定次数+XX为你拥有的技能数。②当你于出牌阶段首次对技能数小于你的角色造成伤害时此伤害+1。", olmaozhu_info: "锁定技。①你的手牌上限和使用【杀】的额定次数+XX为你拥有的技能数。②当你于出牌阶段首次对技能数小于你的角色造成伤害时此伤害+1。",
oljinlan: "尽览", oljinlan: "尽览",
oljinlan_info: "出牌阶段限一次你可以将手牌数摸至Y张Y为场上技能数最多的角色的技能数。", oljinlan_info: "出牌阶段限一次你可以将手牌数摸至Y张Y为场上技能数最多的角色的技能数。",
oljinlan_append: '<span style="font-family: yuanli"><li><span style="text-decoration: line-through;">补丁×</span>注意事项:<br>〖飞扬〗〖跋扈〗计入〖茂著〗〖尽览〗的技能数计算</span>',
caimao: "蔡瑁", caimao: "蔡瑁",
olzuolian: "佐练", olzuolian: "佐练",
olzuolian_tag: "展示牌", olzuolian_tag: "展示牌",

View File

@ -2725,7 +2725,7 @@ export const Content = {
if (get.itemtype(targets) === "player") { if (get.itemtype(targets) === "player") {
targets = [targets]; targets = [targets];
} }
if (info.popup != false && !info.direct) { if (info.popup != false && !info.direct && !("skill_popup" in result && !Boolean(result["skill_popup"]))) {
let popup_info = event.skill; let popup_info = event.skill;
if (typeof info.popup === "string") popup_info = [event.skill, info.popup]; if (typeof info.popup === "string") popup_info = [event.skill, info.popup];
if (info.logLine === false) player.logSkill(popup_info, false, info.line); if (info.logLine === false) player.logSkill(popup_info, false, info.line);