“蓄谋”牌,判定区机制修改

This commit is contained in:
Spmario233 2024-01-13 00:41:41 +08:00
parent 07c3dbd6d4
commit 79be76e569
7 changed files with 117 additions and 13 deletions

View File

@ -1926,7 +1926,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
content:function(){ content:function(){
var trigger=event.getParent(2)._trigger; var trigger=event.getParent(2)._trigger;
if(trigger.name=='phaseJudge'){ if(trigger.name=='phaseJudge'){
trigger.untrigger(); trigger.untrigger('currentOnly');
trigger.cancelled=true; trigger.cancelled=true;
} }
else{ else{

View File

@ -66,6 +66,23 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
perfectPair:{}, perfectPair:{},
card:{ card:{
xumou_jsrg:{
type:'delay',
allowDuplicate:true,
blankCard:true,
effect:function(){
'step 0'
var card=event.cards[0];
player.chooseUseTarget(card,`蓄谋:是否使用${get.translation(card)}`,`请选择要使用的目标。若不使用此牌,则判定区内的所有“蓄谋”牌都将被置入弃牌堆。`);
'step 1'
if(!result.bool){
var cards=player.getCards('j',card=>{
return (card.viewAs||card.name)=='xumou_jsrg';
});
if(cards.length>0) player.loseToDiscardpile(cards);
}
},
},
ying:{ ying:{
audio:true, audio:true,
fullskin:true, fullskin:true,
@ -6312,6 +6329,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
jsrgfushan:'负山', jsrgfushan:'负山',
jsrgfushan_info:'出牌阶段开始时,所有其他角色可以依次交给你一张牌并令你此阶段使用【杀】的次数上限+1。此阶段结束时若你使用【杀】的次数未达到上限且此阶段以此法交给你牌的角色均存活你失去2点体力否则你将手牌摸至体力上限。', jsrgfushan_info:'出牌阶段开始时,所有其他角色可以依次交给你一张牌并令你此阶段使用【杀】的次数上限+1。此阶段结束时若你使用【杀】的次数未达到上限且此阶段以此法交给你牌的角色均存活你失去2点体力否则你将手牌摸至体力上限。',
xumou_jsrg:'蓄谋',
xumou_jsrg_info:'“蓄谋”牌可在判定区内重复存在。判定阶段开始时,你选择一项:⒈使用此牌对应的实体牌,然后本阶段不能再使用此牌名的牌;⒉将所有的“蓄谋”牌置入弃牌堆。',
jiangshanrugu_qi:'江山如故·起', jiangshanrugu_qi:'江山如故·起',
jiangshanrugu_cheng:'江山如故·承', jiangshanrugu_cheng:'江山如故·承',
jiangshanrugu_zhuan:'江山如故·转', jiangshanrugu_zhuan:'江山如故·转',

View File

@ -1653,7 +1653,7 @@ export class Get extends Uninstantable {
} }
} }
} }
if (obj instanceof lib.element.Button) return 'button'; if (obj instanceof lib.element.Button || obj instanceof HTMLDivElement && obj.classList.contains('button') ) return 'button';
if (obj instanceof lib.element.Card) return 'card'; if (obj instanceof lib.element.Card) return 'card';
if (obj instanceof lib.element.Player) return 'player'; if (obj instanceof lib.element.Player) return 'player';
if (obj instanceof lib.element.Dialog) return 'dialog'; if (obj instanceof lib.element.Dialog) return 'dialog';
@ -3319,7 +3319,12 @@ export class Get extends Uninstantable {
} }
if (get.position(node) == 'j' && node.viewAs && node.viewAs != name) { if (get.position(node) == 'j' && node.viewAs && node.viewAs != name) {
uiintro.add(get.translation(node.viewAs)); uiintro.add(get.translation(node.viewAs));
uiintro.add('<div class="text center">' + get.translation(get.translation(node)) + '</div>'); var cardInfo = lib.card[node.viewAs], showCardIntro=true;
if (cardInfo.blankCard) {
var cardOwner = get.owner(node);
if (cardOwner && !cardOwner.isUnderControl(true)) showCardIntro = false;
}
if (showCardIntro) uiintro.add('<div class="text center">' + get.translation(get.translation(node)) + '</div>');
// uiintro.add(get.translation(node.viewAs)+'<br><div class="text center" style="padding-top:5px;">'+get.translation(node)+'</div>'); // uiintro.add(get.translation(node.viewAs)+'<br><div class="text center" style="padding-top:5px;">'+get.translation(node)+'</div>');
uiintro.nosub = true; uiintro.nosub = true;
name = node.viewAs; name = node.viewAs;

View File

@ -2646,8 +2646,9 @@ export const Content = {
event.cards = player.getCards('j'); event.cards = player.getCards('j');
if (!event.cards.length) event.finish(); if (!event.cards.length) event.finish();
"step 1"; "step 1";
if (cards.length && player.getCards('j').includes(cards[0])) { if (cards.length) {
event.card = cards.shift(); event.card = cards.shift();
var cardName = event.card.viewAs || event.card.name, cardInfo=lib.card[cardName];
if (event.card.classList.contains('removing')) { if (event.card.classList.contains('removing')) {
event.card.remove(); event.card.remove();
delete event.card; delete event.card;
@ -2657,21 +2658,26 @@ export const Content = {
event.finish(); event.finish();
return; return;
} }
else if (cardInfo.noEffect || !player.getCards('j').includes(event.card)) {
event.redo();
}
else { else {
player.lose(event.card, 'visible', ui.ordering); player.lose(event.card, 'visible', ui.ordering);
player.$phaseJudge(event.card); player.$phaseJudge(event.card);
event.cancelled = false; event.cancelled = false;
event.trigger('phaseJudge'); event.trigger('phaseJudge');
var name = event.card.viewAs || event.card.name; player.popup(cardName, 'thunder');
player.popup(name, 'thunder'); if (!cardInfo.effect) {
if (!lib.card[name].effect) {
game.delay(); game.delay();
event.redo(); event.redo();
} }
else if (!lib.card[name].judge) { else if (!cardInfo.judge) {
game.delay(); game.delay();
event.nojudge = true; event.nojudge = true;
} }
else{
event.nojudge = false;
}
} }
} }
else event.finish(); else event.finish();
@ -5193,7 +5199,27 @@ export const Content = {
var title = event.dialog.add('<div class="text center" style="margin: 0px;">判定区</div>'); var title = event.dialog.add('<div class="text center" style="margin: 0px;">判定区</div>');
title.style.margin = '0px'; title.style.margin = '0px';
title.style.padding = '0px'; title.style.padding = '0px';
var shown = js.filter(card => {
var name = (card.viewAs || card.name), info = lib.card[name];
if (!info || !info.blankCard) return true;
return false;
});
if (shown.length < js.length) {
var hidden = js.filter(card => !shown.includes(card));
var buttons = ui.create.div('.buttons', event.dialog.content);
event.dialog.buttons = event.dialog.buttons.concat(ui.create.buttons(shown, 'card', buttons));
event.dialog.buttons = event.dialog.buttons.concat(ui.create.buttons(hidden, 'blank', buttons));
if (event.dialog.forcebutton !== false) event.dialog.forcebutton = true;
if (event.dialog.buttons.length > 3) {
event.dialog.classList.remove('forcebutton-auto');
}
else if (!event.dialog.noforcebutton) {
event.dialog.classList.add('forcebutton-auto');
}
}
else{
event.dialog.add(js); event.dialog.add(js);
}
directh = false; directh = false;
} }
} }
@ -5348,7 +5374,27 @@ export const Content = {
var title = event.dialog.add('<div class="text center" style="margin: 0px;">判定区</div>'); var title = event.dialog.add('<div class="text center" style="margin: 0px;">判定区</div>');
title.style.margin = '0px'; title.style.margin = '0px';
title.style.padding = '0px'; title.style.padding = '0px';
var shown = js.filter(card => {
var name = (card.viewAs || card.name), info = lib.card[name];
if (!info || !info.blankCard) return true;
return false;
});
if (shown.length < js.length) {
var hidden = js.filter(card => !shown.includes(card));
var buttons = ui.create.div('.buttons', event.dialog.content);
event.dialog.buttons = event.dialog.buttons.concat(ui.create.buttons(shown, 'card', buttons));
event.dialog.buttons = event.dialog.buttons.concat(ui.create.buttons(hidden, 'blank', buttons));
if (event.dialog.forcebutton !== false) event.dialog.forcebutton = true;
if (event.dialog.buttons.length > 3) {
event.dialog.classList.remove('forcebutton-auto');
}
else if (!event.dialog.noforcebutton) {
event.dialog.classList.add('forcebutton-auto');
}
}
else{
event.dialog.add(js); event.dialog.add(js);
}
directh = false; directh = false;
} }
} }
@ -5528,7 +5574,27 @@ export const Content = {
var title = event.dialog.add('<div class="text center" style="margin: 0px;">判定区</div>'); var title = event.dialog.add('<div class="text center" style="margin: 0px;">判定区</div>');
title.style.margin = '0px'; title.style.margin = '0px';
title.style.padding = '0px'; title.style.padding = '0px';
var shown = js.filter(card => {
var name = (card.viewAs || card.name), info = lib.card[name];
if (!info || !info.blankCard) return true;
return false;
});
if (shown.length < js.length) {
var hidden = js.filter(card => !shown.includes(card));
var buttons = ui.create.div('.buttons', event.dialog.content);
event.dialog.buttons = event.dialog.buttons.concat(ui.create.buttons(shown, 'card', buttons));
event.dialog.buttons = event.dialog.buttons.concat(ui.create.buttons(hidden, 'blank', buttons));
if (event.dialog.forcebutton !== false) event.dialog.forcebutton = true;
if (event.dialog.buttons.length > 3) {
event.dialog.classList.remove('forcebutton-auto');
}
else if (!event.dialog.noforcebutton) {
event.dialog.classList.add('forcebutton-auto');
}
}
else{
event.dialog.add(js); event.dialog.add(js);
}
directh = false; directh = false;
} }
} }

View File

@ -749,6 +749,11 @@ export class GameEvent {
// const doing=evt.doingList.find(doing=>doing.player==player); // const doing=evt.doingList.find(doing=>doing.player==player);
// if(doing) doing.todoList=[]; // if(doing) doing.todoList=[];
} }
else if (all==='currentOnly'){
if (evt && evt.doingList) {
evt.doingList.forEach(doing => doing.todoList = []);
}
}
return this; return this;
} }
/** /**

View File

@ -5646,7 +5646,7 @@ export class Player extends HTMLDivElement {
} }
canAddJudge(card) { canAddJudge(card) {
if (this.isDisabledJudge()) return false; if (this.isDisabledJudge()) return false;
var name; let name;
if (typeof card == 'string') { if (typeof card == 'string') {
name = card; name = card;
} }
@ -5654,7 +5654,9 @@ export class Player extends HTMLDivElement {
name = card.viewAs || card.name; name = card.viewAs || card.name;
} }
if (!name) return false; if (!name) return false;
if (this.hasJudge(name)) return false; const cardInfo = lib.card[name];
if(!cardInfo) return false;
if (!cardInfo.allowDuplicate && this.hasJudge(name)) return false;
if (this.isOut()) return false; if (this.isOut()) return false;
var mod = game.checkMod(card, this, this, 'unchanged', 'targetEnabled', this); var mod = game.checkMod(card, this, this, 'unchanged', 'targetEnabled', this);
if (mod != 'unchanged') return mod; if (mod != 'unchanged') return mod;

View File

@ -9621,6 +9621,12 @@ class Create extends Uninstantable {
blank: (item, type, position, noclick, node) => { blank: (item, type, position, noclick, node) => {
node = ui.create.div('.button.card', position); node = ui.create.div('.button.card', position);
node.link = item; node.link = item;
if (get.position(item) == 'j' && item.viewAs && lib.config.cardtempname != 'off') {
node.classList.add('infoflip');
node.classList.add('infohidden')
ui.create.cardTempName(item, node).style.setProperty('display','block','important')
}
return node; return node;
}, },
/** /**