This commit is contained in:
libccy 2018-08-10 17:54:19 +08:00
parent 1c93b97474
commit 8b7cd78596
4 changed files with 64 additions and 43 deletions

View File

@ -1021,14 +1021,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){
},
filterTarget:function(card,player,target){
if(player==target) return false;
return target.countCards('hej',function(card){
return lib.filter.canBeDiscarded(card,player,target);
})>0;
return target.countDiscardableCards(player,'hej');
},
content:function(){
if(target.countCards('hej',function(card){
return lib.filter.canBeDiscarded(card,player,target);
})){
if(target.countDiscardableCards(player,'hej')){
player.discardPlayerCard('hej',target,true);
}
},

View File

@ -1606,7 +1606,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:2,
trigger:{player:['phaseBeginStart','phaseEnd','huashenStart']},
filter:function(event,player,name){
if(name=='phaseBegin'&&game.phaseNumber==1) return false;
if(name=='phaseBeginStart'&&game.phaseNumber==1) return false;
return true;
},
priority:50,

View File

@ -11520,9 +11520,7 @@
var directh=true;
for(var i=0;i<event.position.length;i++){
if(event.position[i]=='h'){
var hs=target.getCards('h',function(card){
return lib.filter.canBeDiscarded(card,player,target);
});
var hs=target.getDiscardableCards(player,'h');
if(hs.length){
event.dialog.addText('手牌区');
hs.randomSort();
@ -11536,9 +11534,7 @@
}
}
else if(event.position[i]=='e'){
var es=target.getCards('e',function(card){
return lib.filter.canBeDiscarded(card,player,target);
});
var es=target.getDiscardableCards(player,'e');
if(es.length){
event.dialog.addText('装备区');
event.dialog.add(es);
@ -11546,9 +11542,7 @@
}
}
else if(event.position[i]=='j'){
var js=target.getCards('j',function(card){
return lib.filter.canBeDiscarded(card,player,target);
});
var js=target.getDiscardableCards(player,'j');
if(js.length){
event.dialog.addText('判定区');
event.dialog.add(js);
@ -11647,28 +11641,36 @@
}
var directh=true;
for(var i=0;i<event.position.length;i++){
if(event.position[i]=='h'&&target.countCards('h')){
event.dialog.addText('手牌区');
var hs=target.getCards('h');
hs.randomSort();
if(event.visible||target.isUnderControl(true)){
event.dialog.add(hs);
if(event.position[i]=='h'){
var hs=target.getGainableCards(player,'h');
if(hs.length){
event.dialog.addText('手牌区');
hs.randomSort();
if(event.visible||target.isUnderControl(true)){
event.dialog.add(hs);
directh=false;
}
else{
event.dialog.add([hs,'blank']);
}
}
}
else if(event.position[i]=='e'){
var es=target.getGainableCards('e');
if(es.length){
event.dialog.addText('装备区');
event.dialog.add(es);
directh=false;
}
else{
event.dialog.add([hs,'blank']);
}
else if(event.position[i]=='j'){
var js=target.getGainableCards('j');
if(js.length){
event.dialog.addText('判定区');
event.dialog.add(js);
directh=false;
}
}
else if(event.position[i]=='e'&&target.countCards('e')){
event.dialog.addText('装备区');
event.dialog.add(target.getCards('e'));
directh=false;
}
else if(event.position[i]=='j'&&target.countCards('j')){
event.dialog.addText('判定区');
event.dialog.add(target.getCards('j'));
directh=false;
}
}
if(event.dialog.buttons.length==0){
event.dialog.close();
@ -14723,9 +14725,33 @@
}
return cards;
},
getDiscardableCards:function(player,arg1,arg2){
var cards=this.getCards(arg1,arg2);
for(var i=0;i<cards.length;i++){
if(!lib.filter.canBeDiscarded(cards[i],player,this)){
cards.splice(i--,1);
}
}
return cards;
},
getGainableCards:function(player,arg1,arg2){
var cards=this.getCards(arg1,arg2);
for(var i=0;i<cards.length;i++){
if(!lib.filter.canBeGained(cards[i],player,this)){
cards.splice(i--,1);
}
}
return cards;
},
countCards:function(arg1,arg2){
return this.getCards(arg1,arg2).length;
},
countDiscardableCards:function(player,arg1,arg2){
return this.getDiscardableCards(player,arg1,arg2).length;
},
countGainableCards:function(player,arg1,arg2){
return this.getGainableCards(player,arg1,arg2).length;
},
getOriginalSkills:function(){
var skills=[];
if(lib.character[this.name]&&!this.isUnseen(0)){
@ -21447,6 +21473,12 @@
if(mod!='unchanged') return mod;
return true;
},
canBeGained:function(card,player,target,event){
event=event||_status.event;
var mod=game.checkMod(card,player,target,event.getParent().name,'unchanged','canBeGained',target);
if(mod!='unchanged') return mod;
return true;
},
cardAiIncluded:function(card){
if(_status.event.isMine()) return true;
return (_status.event._aiexclude.contains(card)==false);

View File

@ -5,15 +5,8 @@ window.noname_update={
'变包武将'
],
files:[
'character/diy.js',
'character/extra.js',
'character/hearth.js',
'card/standard.js',
'character/shenhua.js',
'character/sp.js',
'character/yijiang.js',
'game/asset.js',
'game/directory.js',
'game/game.js',
'mode/guozhan.js'
'game/game.js'
]
};