Merge branch 'PR-Branch' of https://github.com/libccy/noname into PR-Branch

This commit is contained in:
kuangthree 2024-04-21 12:15:39 +08:00
commit a986b58076
7 changed files with 53 additions and 67 deletions

View File

@ -1007,6 +1007,7 @@ game.import("card", function () {
});
game.loseAsync({
lose_list: lose_list,
visible: true,
}).setContent("chooseToCompareLose");
}
if (cards2.length) game.cardsGotoOrdering(cards2);

View File

@ -126,7 +126,7 @@ game.import("character", function () {
if (!skill || skill === "jingyu") return false;
let info = get.info(skill);
while (true) {
if (!info || info.charlotte) return false;
if (!info || info.charlotte || info.equipSkill) return false;
if (info && !info.sourceSkill) break;
skill = info.sourceSkill;
info = get.info(skill);
@ -235,13 +235,13 @@ game.import("character", function () {
if (["global", "equip"].includes(event.type)) return false;
const skill = event.sourceSkill || event.skill;
const info = get.info(skill);
return info && !info.charlotte;
return info && !info.charlotte && !info.equipSkill;
},
forced: true,
onremove: true,
charlotte: true,
async content(event, trigger, player) {
player.loseHp(player.countMark("lvxin_recover"));
player.recover(player.countMark("lvxin_recover"));
player.removeSkill("lvxin_recover");
},
intro: {
@ -256,7 +256,7 @@ game.import("character", function () {
if (["global", "equip"].includes(event.type)) return false;
const skill = event.sourceSkill || event.skill;
const info = get.info(skill);
return info && !info.charlotte;
return info && !info.charlotte && !info.equipSkill;
},
forced: true,
onremove: true,
@ -746,9 +746,9 @@ game.import("character", function () {
filter(event, player) {
return (
(event.name != "phase" || game.phaseNumber == 0) &&
game.countPlayer(current => {
if (get.mode() != "doudizhu") return !current.isZhu2();
return current.getSeatNum() != 3;
game.countPlayer((current) => {
if (get.mode() === "doudizhu") return current.getSeatNum() !== 3;
return !current.isZhu2();
}) > 1
);
},
@ -757,8 +757,8 @@ game.import("character", function () {
derivation: "tamo_faq",
async content(event, trigger, player) {
const toSortPlayers = game.filterPlayer((current) => {
if (get.mode() != "doudizhu") return !current.isZhu2();
return current.getSeatNum() != 3;
if (get.mode() === "doudizhu") return current.getSeatNum() !== 3;
return !current.isZhu2();
});
toSortPlayers.sortBySeat(game.findPlayer2((current) => current.getSeatNum() == 1, true));
const next = player.chooseToMove("榻谟:是否分配" +
@ -900,7 +900,12 @@ game.import("character", function () {
game.swapSeat(list[0], list[1], false);
}
}, toSwapList);
if (trigger.name === "phase" && !trigger.player.isZhu2() && trigger.player !== toSortPlayers[0] && !trigger._finished) {
if (
trigger.name === "phase" &&
!trigger.player.isZhu2() &&
trigger.player !== toSortPlayers[0] &&
!trigger._finished
) {
trigger.finish();
trigger._triggered = 5;
const evt = toSortPlayers[0].insertPhase();
@ -911,10 +916,7 @@ game.import("character", function () {
}
//跳过新回合的phaseBefore
evt.pushHandler("onPhase", (event, option) => {
if (
event.step === 0 &&
option.state === "begin"
) {
if (event.step === 0 && option.state === "begin") {
event.step = 1;
}
});
@ -929,7 +931,8 @@ game.import("character", function () {
filter(event, player) {
return game.hasPlayer(target => {
if (target == player || target.countCards('h') + player.countCards('h') == 0) return false;
return get.mode() == 'identity' || target.countCards('h') <= player.countCards('h') + 1;
// return get.mode() == 'identity' || target.countCards('h') <= player.countCards('h') + 1;
return true;
});
},
direct: true,
@ -942,7 +945,8 @@ game.import("character", function () {
"与一名其他角色平分手牌",
(card, player, target) => {
if (target == player || target.countCards('h') + player.countCards('h') == 0) return false;
return get.mode() == 'identity' || target.countCards('h') <= player.countCards('h') + 1;
// return get.mode() == 'identity' || target.countCards('h') <= player.countCards('h') + 1;
return true;
}
)
.set("ai", (target) => {
@ -10841,17 +10845,13 @@ game.import("character", function () {
dingzhou_info:
"出牌阶段限一次。你可以将X张牌交给一名场上有牌的角色然后你获得其场上的所有牌X为其场上的牌数。",
tamo: "榻谟",
tamo_info:
"游戏开始时,你可以重新分配除主公外所有角色的座次。",
tamo_info_doudizhu:
"游戏开始时,你可以重新分配除三号位外所有角色的座次。",
tamo_info_doudizhu: "游戏开始时,你可以重新分配除三号位角色外所有角色的座次。",
tamo_info: "游戏开始时,你可以重新分配除主公外所有角色的座次。",
tamo_faq: "FAQ",
tamo_faq_info:
"<br><li>Q在一号位不为主公的情况下〖榻谟〗如何结算</li><li>A该角色可以正常进行座次交换。若受此技能影响导致一号位角色发生了变化则以排列后的一号位角色为起始角色开始本局游戏。</li>",
zhimeng: "智盟",
zhimeng_info:
"回合结束后你可以选择一名手牌数不大于Y的其他角色Y为你的手牌数+1。若如此做你与其将各自所有手牌置于处理区然后你随机获得这些牌中的一半向上取整其获得剩余的牌。",
zhimeng_info_identity:
"回合结束后,你可以选择一名其他角色。若如此做,你与其将各自所有手牌置于处理区,然后你随机获得这些牌中的一半(向上取整),其获得剩余的牌。",
shen_xuzhu: "神许褚",
shen_xuzhu_prefix: "神",

View File

@ -1063,39 +1063,30 @@ game.import("character", function () {
filter(event, player) {
if (!event.isFirstTarget) return false;
if (get.type(event.card) !== "trick") return false;
const evt = event.getParent();
const evts = game.getGlobalHistory("useCard", null, evt).slice().remove(evt);
return event.targets.some((target) => {
return evts.some((evt) => evt.targets.includes(target));
});
return true;
},
direct: true,
async content(event, trigger, player) {
const evt = trigger.getParent();
const evts = game.getGlobalHistory("useCard", null, evt).slice().remove(evt);
const chooseableTargets = trigger.targets.filter((target) => {
return evts.some((evt) => evt.targets.includes(target));
});
const result = await player
.chooseTarget()
.set("prompt", get.prompt("dcyingshi"))
.set(
"prompt2",
`一名可选角色选择本回合未被选择过的一项:⒈令你于此牌结算结束后视为对其使用一张${get.translation(
`其中一名角色选择本回合未被选择过的一项:⒈令你于此牌结算结束后视为对其使用一张${get.translation(
trigger.card.name
)}⒉弃置${get.cnNumber(player.countCards("e"))}张牌此牌对其无效`
)
.set("filterTarget", (card, player, target) => {
return get.event("targets").includes(target);
})
.set("targets", chooseableTargets)
.set("targets", trigger.targets)
.set(
"toFriends",
(() => {
const isPositive = chooseableTargets.some((current) => {
const isPositive = trigger.targets.some((current) => {
return get.effect(current, trigger.card, trigger.player, player) > 0;
}),
isNegative = chooseableTargets.some((current) => {
isNegative = trigger.targets.some((current) => {
return get.effect(current, trigger.card, trigger.player, player) < -5;
});
if (
@ -1536,38 +1527,31 @@ game.import("character", function () {
return evt && evt.hs && evt.hs.length && current.countCards("h") == 0;
});
},
direct: true,
async content(event, trigger, player) {
async cost(event, trigger, player) {
const targetx = _status.currentPhase;
const targets = game
.filterPlayer((current) => {
if (targetx && current == targetx) return false;
if (targetx && current == targetx || !current.isIn()) return false;
let evt = trigger.getl(current);
return evt && evt.hs && evt.hs.length && current.countCards("h") == 0;
})
.sortBySeat(targetx || player);
for (const target of targets) {
if (!target.isIn()) continue;
const {
result: { bool },
} = await player
.chooseBool(get.prompt2("dcshoucheng", target))
.set("choice", get.attitude(player, target) > 0);
if (bool) {
player.logSkill("dcshoucheng", target);
if (target != player) player.addExpose(0.2);
event.result = await player
.chooseTarget("是否对" + (targets.length > 1 ? "其中一名角色" : get.translation(targets[0])) + "发动【守成】?",
"令其摸两张牌",
(card, player, target) => {
return get.event("targets").includes(target);
}
)
.set("targets", targets)
.set("ai", target => get.attitude(get.event("player"), target))
.forResult();
},
usable: 1,
async content(event, trigger, player) {
const target = event.targets[0];
if (get.mode() != "identity" || player.identity != "nei") player.addExpose(0.2);
target.draw(2);
}
}
},
ai: {
threaten(player, target) {
return Math.sqrt(
game.countPlayer((i) => {
return get.attitude(target, i) > 0;
})
);
},
},
subSkill: {
ai: {
@ -16244,7 +16228,7 @@ game.import("character", function () {
dcshengxi: "生息",
dcshengxi_info: "弃牌阶段结束时,若你本回合未造成过伤害,你可以摸两张牌。",
dcshoucheng: "守成",
dcshoucheng_info: "一名角色于其回合外失去最后的手牌后,你可令其摸两张牌。",
dcshoucheng_info: "每回合限一次,当一名角色于其回合外失去手牌后,若其没有手牌,你可令其摸两张牌。",
dc_liuli: "刘理",
dcfuli: "抚黎",
dcfuli_info:
@ -16264,7 +16248,7 @@ game.import("character", function () {
"其他角色的出牌阶段限一次。其可以交给你一张牌,若此牌为装备牌,你可以使用之,然后其本回合攻击范围+XX为你装备区里的牌数。若你以此法替换了装备你与其各摸两张牌。",
dcyingshi: "应时",
dcyingshi_info:
"每回合每项各限一次。当你使用普通锦囊牌指定第一个目标后,若有目标不为本回合第一次成为牌的目标,则你可令其选择一项⒈令你于此牌结算结束后视为对其使用一张与此牌牌名相同的牌⒉弃置X张牌此牌对其无效X为你装备区里的牌数。",
"每回合每项各限一次。当你使用普通锦囊牌指定目标后,你可令其中一个目标选择一项⒈令你于此牌结算结束后视为对其使用一张与此牌牌名相同的牌⒉弃置X张牌此牌对其无效X为你装备区里的牌数。",
dc_wangling: "王淩",
dcjichou: "集筹",
dcjichou_info:

View File

@ -9722,9 +9722,9 @@ game.import("character", function () {
"step 1";
if (result.number < 7) {
var source = trigger.source;
if (source && source.isIn() && source.countCards("he") > 0) {
if (source && source.isIn() && source.countCards("h") > 0) {
player.line(source);
source.chooseToDiscard("he", true);
source.chooseToDiscard("h", true);
}
}
},
@ -20724,7 +20724,7 @@ game.import("character", function () {
simafu: "司马孚",
xunde: "勋德",
xunde_info:
"一名角色受到伤害后若你至其的距离不大于1则你可判定。若判定结果大于5你令该角色获得判定牌小于7你令伤害来源弃置一张牌。",
"一名角色受到伤害后若你至其的距离不大于1则你可判定。若判定结果大于5你令该角色获得判定牌小于7你令伤害来源弃置一张牌。",
chenjie: "臣节",
chenjie_info:
"一名角色的判定牌生效前,你可打出一张花色相同的牌。系统将你打出的牌作为新判定牌,将原判定牌置入弃牌堆。然后你摸两张牌。",

View File

@ -5425,7 +5425,7 @@ game.import("character", function () {
return val;
},
prompt: () => "选择要交出的牌和要交给的目标",
selectCard: 1,
selectCard: [1, Infinity],
discard: false,
lose: false,
delay: false,
@ -20495,7 +20495,7 @@ game.import("character", function () {
tw_jiangji_prefix: "TW",
twjichou: "急筹",
twjichou_info:
"①每回合限一次。你可以视为使用一张未被〖急筹①〗记录过的普通锦囊牌并记录此牌。②你无法响应或{使用对应实体牌包含你的手牌的}〖急筹①〗记录过的锦囊牌。③出牌阶段限一次。你可将手牌中的一张〖急筹①〗记录过的锦囊牌交给其他角色。",
"①每回合限一次。你可以视为使用一张未被〖急筹①〗记录过的普通锦囊牌并记录此牌。②你无法响应或{使用对应实体牌包含你的手牌的}〖急筹①〗记录过的锦囊牌。③出牌阶段限一次。你可将手牌中任意张〖急筹①〗记录过的锦囊牌交给其他角色。",
twjilun: "机论",
twjilun_info:
"当你受到伤害后你可以摸X张牌X为〖急筹①〗记录数且至少为1至多为5或视为使用一张〖急筹①〗记录过且未被〖机论〗记录过的普通锦囊牌并记录此牌。",

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

View File

@ -141,6 +141,7 @@ export class UI {
*/
toastQueue = [];
/**
* @type {HTMLDivElement}
*/
cardPile;