shownCard

This commit is contained in:
Spmario233 2023-09-06 11:26:37 +08:00
parent 34cbcd2448
commit 585d6dab38
4 changed files with 300 additions and 101 deletions

View File

@ -1656,14 +1656,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
direct:true,
filter:function (event,player){
return player!=event.player&&event.player.hp>0&&player.countCards('h',function(card){
return !card.hasGaintag('dddxujing_tag');
return !get.is.shownCard(card);
})>=event.player.hp;
},
content:function (){
'step 0'
var target=trigger.player;
player.chooseCard('h',target.hp,get.prompt('dddqiahua',target),'选择'+get.cnNumber(target.hp)+'张手牌作为“明”,然后'+get.translation(target)+'获得技能〖恂恂〗直到本回合结束。',function(card){
return !card.hasGaintag('dddxujing_tag');
player.chooseCard('h',target.hp,get.prompt('dddqiahua',target),'选择明置'+get.cnNumber(target.hp)+'张手牌,然后'+get.translation(target)+'获得技能〖恂恂〗直到本回合结束。',function(card){
return !get.is.shownCard(card);
}).set('goon',get.attitude(player,target)>0).set('ai',function(card){
if(_status.event.goon) return 1+Math.random();
return 0;
@ -1673,11 +1673,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=trigger.player,cards=result.cards;
player.logSkill('dddqiahua',target);
target.addTempSkill('dddxunxun');
player.addSkill('dddxujing_tag');
player.addGaintag(result.cards,'dddxujing_tag');
player.addShownCards(cards,'visible_dddxianglang');
game.log(player,'选择了',cards,'作为“明”');
player.showCards(cards,get.translation(player)+'对'+get.translation(target)+'发动了【恰化】');
player.markSkill('dddxujing_tag');
}
},
ai:{
@ -1692,10 +1690,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
dddfusi:{
mod:{
ignoredHandcard:function (card,player){
if(card.hasGaintag('dddxujing_tag')) return true;
if(get.is.shownCard(card)) return true;
},
cardDiscardable:function (card,player,name){
if(name=='phaseDiscard'&&card.hasGaintag('dddxujing_tag')) return false;
if(name=='phaseDiscard'&&get.is.shownCard(card)) return false;
},
},
global:"dddfusi_global",
@ -1712,10 +1710,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
dddfusi_global:{
mod:{
"cardEnabled2":function (card,player){
cardEnabled2:function(card,player){
var source=_status.currentPhase;
if(!source||source==player||!source.hasSkill('dddfusi')||source.countCards('h')==0||source.hasCard(function(card){
return !card.hasGaintag('dddxujing_tag');
return !get.is.shownCard(card);
},'h')) return;
if(player.getCards('h').contains(card)) return false;
},
@ -1727,9 +1725,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return current!=player&&current.hasSkill('dddfusi');
});
for(var source of players){
var cards=source.getCards('h',function(card){
return card.hasGaintag('dddxujing_tag');
});
var cards=source.getShownCards();
for(var i of cards){
var card=get.autoViewAs(i);
if(event.filterCard(card,player,event)) return true;
@ -1743,9 +1739,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return current!=player&&current.hasSkill('dddfusi');
});
for(var source of players){
var cards=source.getCards('h',function(card){
return card.hasGaintag('dddxujing_tag');
});
var cards=source.getShownCards();
for(var i of cards){
var card=get.autoViewAs(i);
if(name==card.name) return true;
@ -1760,9 +1754,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return current!=player&&current.hasSkill('dddfusi');
}).sortBySeat();
for(var source of players){
var cards=source.getCards('h',function(card){
return card.hasGaintag('dddxujing_tag');
});
var cards=source.getShownCards();
if(cards.length){
var str='<div class="text center">';
str+=get.translation(source);
@ -1862,7 +1854,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
frequent:true,
filter:function(event,player){
return event.card.storage&&event.card.storage._dddfusi_owner==player&&!player.hasCard(function(card){
return !card.hasGaintag('dddxujing_tag');
return !get.is.shownCard(card);
},'h');
},
content:function(){
@ -4231,13 +4223,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
dddzhijie_info:"你可以将两张颜色相同的“鉴”当做【闪】使用,或将两张颜色不同的“鉴”当做【无懈可击】使用;然后你摸两张牌。",
ddd_xianglang:'向朗',
dddqiahua:"恰化",
dddqiahua_info:"其他角色的回合开始时,你可选择X张不为“明”的手牌作为“明”X为其体力值这些牌对所有角色可见),然后其于本回合内获得〖恂恂〗。",
dddqiahua_info:"其他角色的回合开始时,你可明置X张手牌X为其体力值),然后其于本回合内获得〖恂恂〗。",
dddfusi:"腹笥",
dddfusi_info:"锁定技。①你的“明”不计入手牌上限。②其他角色需要使用牌时,可以改为使用你的“明”(需经过你的确认)。③你的回合内,若你的手牌均为“明”,则其他角色不能使用各自的手牌。",
dddfusi_info:"锁定技。①你的明置手牌不计入手牌上限。②其他角色需要使用牌时,可以改为使用你的明置手牌(需经过你的确认)。③你的回合内,若你的手牌均为明置手牌,则其他角色不能使用各自的手牌。",
dddfusi_global:"腹笥",
dddtuoji:"拓籍",
dddtuoji_info:"其他角色因〖腹笥〗而使用你的牌后,若你的手牌均为“明”,则你可以摸三张牌。",
dddxujing_tag:"明",
dddtuoji_info:"其他角色因〖腹笥〗而使用你的牌后,若你的手牌均为明置手牌,则你可以摸三张牌。",
visible_dddxianglang:"明",
ddd_yujin:'于禁',
dddzhengjun:'整军',
dddzhengjun_info:'出牌阶段内每项各限一次。当有其他角色的手牌数/体力值/装备区内牌数变化后若其的对应数值与你相同则你可以执行对应的选项。体力值你令一名角色回复1点体力手牌数你令一名角色摸一张牌装备区内牌数你移动场上的一张装备牌。',

View File

@ -12910,9 +12910,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var target=result.targets[0];
player.logSkill('nsfengli',target);
var cards=player.getCards('h');
player.addGaintag(cards,'nsfengli2');
player.addShownCards(cards,'visible_nsfengli');
player.addSkill('nsfengli2');
player.showHandcards();
target.addSkill('nsfengli_use');
target.storage.nsfengli_use=player;
}
@ -12924,26 +12923,39 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
nsfengli_draw:{
trigger:{
player:['loseAfter','nsfengliClear'],
player:['loseAfter','hideShownCardsAfter'],
global:['gainAfter','equipAfter','addJudgeAfter','loseAsyncAfter','addToExpansionAfter'],
target:'nsfengliUse',
},
direct:true,
charlotte:true,
filter:function(event,player,name){
if(name!='nsfengliUse'&&name!='nsfengliClear'){
if(event.name=='hideShownCards'){
const hs=player.countCards('h');
return game.hasPlayer(current=>current.countCards('h')<hs);
}
var num=0;
var evt=event.getl(player);
if(!evt||!evt.gaintag_map) return false;
var bool=false;
for(var i in evt.gaintag_map){
if(evt.gaintag_map[i].contains('nsfengli2')) bool=true;break;
if(evt.gaintag_map[i].some(tag=>tag.indexOf('visible_')==0)) num++;
}
if(!bool) return false;
if(event.getg){
if(event.name=='gain'){
if(event.getlx===false&&event.gaintag.some(tag=>tag.indexOf('visible_')==0)) num-=event.cards.length;
}
else{
player.checkHistory('gain',function(evt){
if(evt.parent==event&&evt.gaintag.some(tag=>tag.indexOf('visible_')==0)){
num-=evt.cards.length;
}
var hs=player.countCards('h');
return game.hasPlayer(function(current){
return current!=player&&current.countCards('h')<hs;
});
}
}
if(num>0){
const hs=player.countCards('h');
return game.hasPlayer(current=>current.countCards('h')<hs);
}
},
content:function(){
'step 0'
@ -12970,24 +12982,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.hasSkill('nsfengli2');
},
content:function(){
var hs=player.getCards('h',function(card){
return card.hasGaintag('nsfengli2');
});
if(hs.length) event.trigger('nsfengliClear');
var cards=player.getShownCards();
if(cards.length>0) player.hideShownCards(cards);
player.removeSkill('nsfengli2');
},
},
nsfengli2:{
mark:true,
intro:{
mark:function(dialog,content,player){
var hs=player.getCards('h',function(card){
return card.hasGaintag('nsfengli2');
});
if(hs.length) dialog.addAuto(hs);
else dialog.addText('没有“礼”');
},
},
onremove:function(player){
player.removeGaintag('nsfengli2');
game.countPlayer(function(current){
@ -12999,9 +12999,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
hiddenCard:function(player,name){
if(player==_status.currentPhase) return false;
var target=player.storage.nsfengli_use;
var cards=target.getCards('h',function(card){
return card.hasGaintag('nsfengli2');
});
var cards=target.getShownCards();
for(var i of cards){
if(get.name(i,target)==name) return true;
}
@ -13013,9 +13011,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){
if(player==_status.currentPhase) return false;
var target=player.storage.nsfengli_use;
var cards=target.getCards('h',function(card){
return card.hasGaintag('nsfengli2');
});
var cards=target.getShownCards();
for(var i of cards){
if(event.filterCard({
name:get.name(i,target),
@ -13028,9 +13024,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
chooseButton:{
dialog:function(event,player){
var target=player.storage.nsfengli_use;
var cards=target.getCards('h',function(card){
return card.hasGaintag('nsfengli2');
});
var cards=target.getShownCards();
return ui.create.dialog('奉礼',cards);
},
filter:function(button,player){
@ -13066,8 +13060,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.logSkill('nsfengli',target);
delete event.result.skill;
player.showCards(card,get.translation(player)+'发动了【奉礼】');
card.removeGaintag('nsfengli2');
event.trigger('nsfengliUse');
target.hideShownCards(card);
},
};
},
@ -18674,7 +18667,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
nsfengli_draw:'奉礼',
nsfengli_clear:'奉礼',
nsfengli_use:'奉礼',
nsfengli_info:'回合结束时,你可以选择一名其他角色并展示所有手牌。你将所有手牌标记为“礼”。你的“礼”对所有角色可见。当该角色于回合外需要使用或打出牌时,其可移去一张“礼”的标记,然后视为使用或打出一张与此牌名称相同的牌。当你的“礼”减少时,你可令一名手牌数小于你的角色摸一张牌。你的回合开始时,你移去所有“礼”的标记,然后注销该角色对“礼”的操作权限。',
visible_nsfengli:'奉礼',
nsfengli_info:'回合结束时,你可以选择一名其他角色并展示所有手牌直到你的下回合开始。当该角色于回合外需要使用或打出牌时,其可暗置你的一张明置手牌,然后视为使用或打出之。当你的明置手牌减少时,你可令一名手牌数小于你的角色摸一张牌。',
nsqiyue:'骑钺',
nsqiyue_info:'锁定技,当有角色的武将牌状态改变后,你摸一张牌。',
nsxuezhu:'血逐',

View File

@ -2984,23 +2984,27 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'phaseUseBegin'},
preHidden:true,
content:function(){
player.addTempSkill('zhaoran2','phaseUseEnd');
player.addTempSkill('zhaoran2','phaseUseAfter');
var cards=player.getCards('h');
if(cards.length>0) player.addShownCards(cards,'visible_zhaoran');
},
},
zhaoran2:{
audio:'zhaoran',
global:'zhaoran3',
group:'zhaoran3',
init:(player,skill)=>{
if(!player.storage[skill]) player.storage[skill]=[];
},
onremove:true,
trigger:{
player:'loseAfter',
global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'],
},
forced:true,
charlotte:true,
init:function(player,skill){
if(!player.storage[skill]) player.storage[skill]=[];
},
onremove:true,
filter:function(event,player){
popup:false,
filter:function(event,player,name){
if(name=='gainBegin') return true;
var evt=event.getl(player);
if(!evt||!evt.hs||!evt.hs.length) return false;
var list=player.getStorage('zhaoran2');
@ -3013,6 +3017,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){
'step 0'
if(trigger.delay===false) game.delayx();
'step 1'
var list=[];
var suits=get.copy(player.storage.zhaoran2);
suits.addArray(player.getCards('h').map(function(card){
@ -3042,10 +3047,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return 0;
});
'step 2'
if(!result.bool) player.draw();
if(!result.bool){
player.logSkill('zhaoran2');
player.draw();
}
else{
var target=result.targets[0];
player.line(target,'green');
player.logSkill('zhaoran2',target);
player.discardPlayerCard(target,true,'he');
}
if(event.count>0) event.goto(1);
@ -3055,10 +3063,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
},
zhaoran3:{
ai:{
viewHandcard:true,
skillTagFilter:function(player,arg,target){
return target!=player&&target.hasSkill('zhaoran2');
trigger:{player:['phaseUseEnd','gainBegin']},
forced:true,
charlotte:true,
firstDo:true,
silent:true,
content:function(){
if(event.triggername=='gainBegin'){
trigger.gaintag.add('visible_zhaoran');
}
else{
player.hideShownCards(player.getCards('h'),'visible_zhaoran');
}
},
},
@ -3644,6 +3659,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
zhaoran:'昭然',
zhaoran2:'昭然',
zhaoran_info:'出牌阶段开始时,你可令你的手牌对其他角色可见直到出牌阶段结束。若如此做,当你于此阶段内失去一张手牌后,若你的手牌里没有与此牌花色相同的牌且你本回合内未因该花色的牌触发过此效果,则你选择一项:①摸一张牌。②弃置一名其他角色的一张牌。',
visible_zhaoran:'invisible',
chengwu:'成务',
chengwu_info:'主公技,锁定技,其他晋势力角色攻击范围内的角色视为在你的攻击范围内。',
jin_xiahouhui:'晋夏侯徽',

View File

@ -10960,6 +10960,49 @@
emptyEvent:function(){
event.trigger(event.name);
},
//增加明置手牌
addShownCards:function(){
var hs=player.getCards('h'),cards=event._cards.filter(card=>hs.includes(card));
var shown=player.getShownCards();
for(var tag of event.gaintag) player.addGaintag(cards,tag);
event.cards=cards.filter(card=>!shown.includes(card));
if(event.cards.length>0){
game.log(player,'明置了',event.cards);
event.trigger('addShownCardsAfter')
}
},
//隐藏明置手牌
hideShownCards:function(){
var shown=player.getShownCards(),cards=event._cards.filter(card=>shown.includes(card));
if(cards.length>0){
if(!event.gaintag.length){
var map={};
cards.forEach(card=>{
var tags=card.gaintag.filter(tag=>tag.indexOf('visible_')==0)
if(tags.length){
tags.forEach(tag=>{
if(!map[tag]) map[tag]=[];
map[tag].push(card);
})
}
});
for(var i in map){
player.removeGaintag(i,map[i])
}
}
else{
event.gaintag.forEach(tag=>{
player.removeGaintag(tag,cards);
})
}
cards.removeArray(player.getShownCards());
if(cards.length>0){
event.cards=cards;
game.log(player,'取消明置了',cards);
event.trigger('hideShownCardsAfter');
}
}
},
//Execute the delay card effect
//执行延时锦囊牌效果
executeDelayCardEffect:()=>{
@ -15773,11 +15816,27 @@
event.dialog.add(hs);
directh=false;
}
else{
var shown=hs.filter(card=>get.is.shownCard(card));
if(shown.length){
var hidden=hs.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||(zoom&&event.dialog.buttons.length>5)){
event.dialog.classList.remove('forcebutton-auto');
}
else if(!event.dialog.noforcebutton){
event.dialog.classList.add('forcebutton-auto');
}
}
else{
event.dialog.add([hs,'blank']);
}
}
}
}
else if(event.position[i]=='e'){
var es=target.getCards('e');
if(es.length){
@ -15902,8 +15961,8 @@
for(var i=0;i<event.position.length;i++){
if(event.position[i]=='h'){
var hs=target.getDiscardableCards(player,'h');
if(hs.length){
expand_length+=Math.ceil(hs.length/6);
if(hs.length){
var title=event.dialog.add('<div class="text center" style="margin: 0px;">手牌区</div>');
title.style.margin='0px';
title.style.padding='0px';
@ -15912,11 +15971,27 @@
event.dialog.add(hs);
directh=false;
}
else{
var shown=hs.filter(card=>get.is.shownCard(card));
if(shown.length){
var hidden=hs.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||(zoom&&event.dialog.buttons.length>5)){
event.dialog.classList.remove('forcebutton-auto');
}
else if(!event.dialog.noforcebutton){
event.dialog.classList.add('forcebutton-auto');
}
}
else{
event.dialog.add([hs,'blank']);
}
}
}
}
else if(event.position[i]=='e'){
var es=target.getDiscardableCards(player,'e');
if(es.length){
@ -16075,11 +16150,27 @@
event.dialog.add(hs);
directh=false;
}
else{
var shown=hs.filter(card=>get.is.shownCard(card));
if(shown.length){
var hidden=hs.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||(zoom&&event.dialog.buttons.length>5)){
event.dialog.classList.remove('forcebutton-auto');
}
else if(!event.dialog.noforcebutton){
event.dialog.classList.add('forcebutton-auto');
}
}
else{
event.dialog.add([hs,'blank']);
}
}
}
}
else if(event.position[i]=='e'){
var es=target.getGainableCards(player,'e');
if(es.length){
@ -18795,6 +18886,61 @@
},
player:{
//新函数
//让一名角色明置一些手牌
addShownCards:function(){
const cards=[];
const tags=[];
for(let i=0;i<arguments.length;i++){
let type=get.itemtype(arguments[i]);
if(type=='cards'){
cards.addArray(arguments[i])
}
else if(type=='card'){
card.add(arguments[i])
}
else if(typeof arguments[i]=='string'&&arguments[i].indexOf('visible_')==0){
tags.add(arguments[i])
}
}
if(cards.length&&tags.length){
const next=game.createEvent('addShownCards',false);
next.player=this;
next._cards=cards;
next.gaintag=tags;
next.setContent('addShownCards');
return next;
}
},
hideShownCards:function(){
const cards=[];
const tags=[];
for(let i=0;i<arguments.length;i++){
let type=get.itemtype(arguments[i]);
if(type=='cards'){
cards.addArray(arguments[i])
}
else if(type=='card'){
cards.add(arguments[i])
}
else if(typeof arguments[i]=='string'&&arguments[i].indexOf('visible_')==0){
tags.add(arguments[i])
}
}
if(cards.length){
const next=game.createEvent('hideShownCards',false);
next.player=this;
next._cards=cards;
next.gaintag=tags;
next.setContent('hideShownCards');
return next;
}
},
//获取角色所有的明置手牌
getShownCards:function(){
return this.getCards('h',function(card){
return get.is.shownCard(card);
});
},
//Execute the delay card effect
//执行延时锦囊牌效果
executeDelayCardEffect:function(card,target){
@ -19381,9 +19527,9 @@
},this,cards,tag);
},
removeGaintag:function(tag,cards){
game.addVideo('removeGaintag',this,tag);
cards=cards||this.getCards('h');
game.addVideo('removeGaintag',this,[tag,cards]);
game.broadcastAll(function(player,tag,cards){
cards=cards||player.getCards('h');
for(var i of cards) i.removeGaintag(tag);
},this,tag,cards);
},
@ -22900,8 +23046,8 @@
return cards;
};
next.getl=function(player){
var that=this;
var map={
const that=this;
const map={
player:player,
hs:[],
es:[],
@ -22910,6 +23056,7 @@
xs:[],
cards:[],
cards2:[],
gaintag_map:{},
};
player.checkHistory('lose',function(evt){
if(evt.parent==that){
@ -22920,6 +23067,10 @@
map.xs.addArray(evt.xs);
map.cards.addArray(evt.cards);
map.cards2.addArray(evt.cards2);
for(let key in evt.gaintag_map){
if(!map.gaintag_map[key]) map.gaintag_map[key]=[];
map.gaintag_map[key].addArray(evt.gaintag_map[key]);
}
}
});
return map;
@ -22982,8 +23133,8 @@
return cards;
};
next.getl=function(player){
var that=this;
var map={
const that=this;
const map={
player:player,
hs:[],
es:[],
@ -22992,6 +23143,7 @@
xs:[],
cards:[],
cards2:[],
gaintag_map:{},
};
player.checkHistory('lose',function(evt){
if(evt.parent==that){
@ -23002,6 +23154,10 @@
map.xs.addArray(evt.xs);
map.cards.addArray(evt.cards);
map.cards2.addArray(evt.cards2);
for(let key in evt.gaintag_map){
if(!map.gaintag_map[key]) map.gaintag_map[key]=[];
map.gaintag_map[key].addArray(evt.gaintag_map[key]);
}
}
});
return map;
@ -23079,6 +23235,7 @@
xs:[],
cards:[],
cards2:[],
gaintag_map:{},
};
};
return next;
@ -23465,8 +23622,8 @@
return cards;
};
next.getl=function(player){
var that=this;
var map={
const that=this;
const map={
player:player,
hs:[],
es:[],
@ -23475,6 +23632,7 @@
xs:[],
cards:[],
cards2:[],
gaintag_map:{},
};
player.checkHistory('lose',function(evt){
if(evt.parent==that){
@ -23485,6 +23643,10 @@
map.xs.addArray(evt.xs);
map.cards.addArray(evt.cards);
map.cards2.addArray(evt.cards2);
for(let key in evt.gaintag_map){
if(!map.gaintag_map[key]) map.gaintag_map[key]=[];
map.gaintag_map[key].addArray(evt.gaintag_map[key]);
}
}
});
return map;
@ -23519,8 +23681,8 @@
return cards;
};
next.getl=function(player){
var that=this;
var map={
const that=this;
const map={
player:player,
hs:[],
es:[],
@ -23529,6 +23691,7 @@
xs:[],
cards:[],
cards2:[],
gaintag_map:{},
};
player.checkHistory('lose',function(evt){
if(evt.parent==that){
@ -23539,6 +23702,10 @@
map.xs.addArray(evt.xs);
map.cards.addArray(evt.cards);
map.cards2.addArray(evt.cards2);
for(let key in evt.gaintag_map){
if(!map.gaintag_map[key]) map.gaintag_map[key]=[];
map.gaintag_map[key].addArray(evt.gaintag_map[key]);
}
}
});
return map;
@ -31993,8 +32160,8 @@
return cards;
};
next.getl=function(player){
var that=this;
var map={
const that=this;
const map={
player:player,
hs:[],
es:[],
@ -32003,6 +32170,7 @@
xs:[],
cards:[],
cards2:[],
gaintag_map:{},
};
player.checkHistory('lose',function(evt){
if(evt.parent==that){
@ -32013,6 +32181,10 @@
map.xs.addArray(evt.xs);
map.cards.addArray(evt.cards);
map.cards2.addArray(evt.cards2);
for(let key in evt.gaintag_map){
if(!map.gaintag_map[key]) map.gaintag_map[key]=[];
map.gaintag_map[key].addArray(evt.gaintag_map[key]);
}
}
});
return map;
@ -34240,7 +34412,8 @@
},
removeGaintag:function(player,content){
if(player&&content){
player.removeGaintag(content);
if(Array.isArray(content)) player.removeGaintag.apply(player,content)
else player.removeGaintag(content);
}
else{
console.log(player);
@ -53395,6 +53568,14 @@
return 0;
},
is:{
//判断一张牌是否为明置手牌
shownCard:function(card){
if(card&&Array.isArray(card.gaintag)){
return card.gaintag.some(tag=>tag.indexOf('visible_')==0)
}
return false;
},
//押韵判断
yayun:function(str1,str2){
if(str1==str2) return true;
var pinyin1=get.pinyin(str1,false),pinyin2=get.pinyin(str2,false);
@ -56041,11 +56222,27 @@
uiintro.addText(get.colorspan(lib.characterTitle[node.name]));
}
if(!node.noclick&&(node.isUnderControl()||(!game.observe&&game.me&&game.me.hasSkillTag('viewHandcard',null,node,true)))){
if(!node.noclick){
const allShown=(node.isUnderControl()||(!game.observe&&game.me&&game.me.hasSkillTag('viewHandcard',null,node,true)));
const shownHs=node.getShownCards();
if(shownHs.length){
uiintro.add('<div class="text center">明置的手牌</div>');
uiintro.addSmall(shownHs);
if(allShown){
var hs=node.getCards('h');
hs.removeArray(shownHs)
if(hs.length){
uiintro.add('<div class="text center">其他手牌</div>');
uiintro.addSmall(hs);
}
}
}
else if(allShown){
var hs=node.getCards('h');
if(hs.length){
uiintro.add('<div class="text center">手牌</div>');
uiintro.addSmall(node.getCards('h'));
uiintro.addSmall(hs);
}
}
}