Merge pull request #629 from copcap/dev-ddd

3D8新将+改将
This commit is contained in:
Spmario233 2023-11-13 19:06:33 +08:00 committed by GitHub
commit 34bb27e52e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1366 additions and 181 deletions

View File

@ -718,11 +718,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){
event.finish(); event.finish();
return; return;
} }
if(get.is.versus()){ if(card.storage&&card.storage.chooseDirection||get.is.versus()){
player.chooseControl('顺时针','逆时针',function(event,player){ player.chooseControl('顺时针','逆时针',function(event,player){
if(player.next.side==player.side) return '逆时针'; if(get.event('isVersus')&&player.next.side==player.side||get.attitude(player,player.next)>get.attitude(player,player.previous)) return '逆时针';
return '顺时针'; return '顺时针';
}).set('prompt','选择'+get.translation(card)+'的结算方向'); }).set('prompt','选择'+get.translation(card)+'的结算方向').set('isVersus',get.is.versus());
} }
else{ else{
event.goto(2); event.goto(2);

File diff suppressed because it is too large Load Diff

View File

@ -18233,29 +18233,32 @@
}, },
moveCard:function(){ moveCard:function(){
'step 0' 'step 0'
if(!player.canMoveCard(null,event.nojudge)){ if(!player.canMoveCard(null,event.nojudge,event.sourceTargets,event.aimTargets,event.filter)){
event.finish(); event.finish();
return; return;
} }
var next=player.chooseTarget(2,function(card,player,target){ var next=player.chooseTarget(2,function(card,player,target){
var filterCard=get.event('filter');
if(ui.selected.targets.length){ if(ui.selected.targets.length){
if(!get.event('aimTargets').includes(target)) return false;
var from=ui.selected.targets[0]; var from=ui.selected.targets[0];
var js=from.getCards('j'); var js=from.getCards('j',filterCard);
for(var i=0;i<js.length;i++){ for(var i=0;i<js.length;i++){
if(_status.event.nojudge) break; if(_status.event.nojudge) break;
if(target.canAddJudge(js[i])) return true; if(target.canAddJudge(js[i])) return true;
} }
if(target.isMin()) return false; if(target.isMin()) return false;
var es=from.getCards('e'); var es=from.getCards('e',filterCard);
for(var i=0;i<es.length;i++){ for(var i=0;i<es.length;i++){
if(target.canEquip(es[i])) return true; if(target.canEquip(es[i])) return true;
} }
return false; return false;
} }
else{ else{
if(!get.event('sourceTargets').includes(target)) return false;
var range='ej'; var range='ej';
if(_status.event.nojudge) range='e'; if(_status.event.nojudge) range='e';
return target.countCards(range)>0; return target.countCards(range,filterCard)>0;
} }
}); });
next.set('nojudge',event.nojudge||false); next.set('nojudge',event.nojudge||false);
@ -18311,6 +18314,9 @@
next.set('multitarget',true); next.set('multitarget',true);
next.set('targetprompt',_status.event.targetprompt||['被移走','移动目标']); next.set('targetprompt',_status.event.targetprompt||['被移走','移动目标']);
next.set('prompt',event.prompt||'移动场上的一张牌'); next.set('prompt',event.prompt||'移动场上的一张牌');
next.set('filter',event.filter);
next.set('sourceTargets',event.sourceTargets||game.filterPlayer());
next.set('aimTargets',event.aimTargets||game.filterPlayer());
if(event.prompt2) next.set('prompt2',event.prompt2); if(event.prompt2) next.set('prompt2',event.prompt2);
if(event.forced) next.set('forced',true); if(event.forced) next.set('forced',true);
'step 1' 'step 1'
@ -18341,6 +18347,7 @@
} }
},targets[0]).set('nojudge',event.nojudge||false).set('targets0',targets[0]).set('targets1',targets[1]).set('filterButton',function(button){ },targets[0]).set('nojudge',event.nojudge||false).set('targets0',targets[0]).set('targets1',targets[1]).set('filterButton',function(button){
var targets1=_status.event.targets1; var targets1=_status.event.targets1;
if(!get.event('filter')(button.link)) return false;
if(get.position(button.link)=='j'){ if(get.position(button.link)=='j'){
if(_status.event.nojudge) return false; if(_status.event.nojudge) return false;
return targets1.canAddJudge(button.link); return targets1.canAddJudge(button.link);
@ -18348,7 +18355,7 @@
else{ else{
return targets1.canEquip(button.link); return targets1.canEquip(button.link);
} }
}); }).set('filter',event.filter);
} }
else{ else{
event.finish(); event.finish();
@ -24878,13 +24885,33 @@
} }
} }
canMoveCard(withatt,nojudge){ canMoveCard(withatt,nojudge){
var player=this; const player=this;
return game.hasPlayer(function(current){ const args=Array.from(arguments).slice(2);
var att=get.sgn(get.attitude(player,current)); let sourceTargets,aimTargets,filterCard;
args.forEach(arg=>{
if(get.itemtype(arg)=='players'){
if(!sourceTargets) sourceTargets=arg;
else if(!aimTargets) aimTargets=arg;
}
else if(get.itemtype(arg)=='player'){
if(!sourceTargets) sourceTargets=[arg];
else if(!aimTargets) aimTargets=[arg];
}
else if(typeof arg=='function'){
filterCard=arg;
}
else if(typeof arg=='object'&&arg){
filterCard=get.filter(arg);
}
});
if(!sourceTargets) sourceTargets=game.filterPlayer();
if(!aimTargets) aimTargets=game.filterPlayer();
return sourceTargets.some(current=>{
const att=get.sgn(get.attitude(player,current));
if(!withatt||att!=0){ if(!withatt||att!=0){
var es=current.getCards('e'); var es=current.getCards('e',filterCard);
for(var i=0;i<es.length;i++){ for(var i=0;i<es.length;i++){
if(game.hasPlayer(function(current2){ if(aimTargets.some(current2=>{
if(withatt){ if(withatt){
if(get.sgn(get.value(es[i],current))!=-att) return false; if(get.sgn(get.value(es[i],current))!=-att) return false;
var att2=get.sgn(get.attitude(player,current2)); var att2=get.sgn(get.attitude(player,current2));
@ -24897,7 +24924,7 @@
} }
} }
if(!nojudge&&(!withatt||att>0)){ if(!nojudge&&(!withatt||att>0)){
var js=current.getCards('j'); var js=current.getCards('j',filterCard);
for(var i=0;i<js.length;i++){ for(var i=0;i<js.length;i++){
if(game.hasPlayer(function(current2){ if(game.hasPlayer(function(current2){
if(withatt){ if(withatt){
@ -24919,6 +24946,14 @@
if(typeof arguments[i]=='boolean'){ if(typeof arguments[i]=='boolean'){
next.forced=arguments[i]; next.forced=arguments[i];
} }
else if(get.itemtype(arguments[i])=='players'){
if(!next.sourceTargets) next.sourceTargets=arguments[i];
else if(!next.aimTargets) next.aimTargets=arguments[i];
}
else if(get.itemtype(arguments[i])=='player'){
if(!next.sourceTargets) next.sourceTargets=[arguments[i]];
else if(!next.aimTargets) next.aimTargets=[arguments[i]];
}
else if(typeof arguments[i]=='string'){ else if(typeof arguments[i]=='string'){
get.evtprompt(next,arguments[i]); get.evtprompt(next,arguments[i]);
} }
@ -24930,7 +24965,16 @@
next.targetprompt=arguments[i]; next.targetprompt=arguments[i];
} }
} }
else if(typeof arguments[i]=='function'){
next.filter=arguments[i];
}
else if(typeof arguments[i]=='object'&&arguments[i]){
next.filter=get.filter(arguments[i]);
}
} }
if(!next.sourceTargets) next.sourceTargets=game.filterPlayer();
if(!next.aimTargets) next.aimTargets=game.filterPlayer();
if(next.filter==undefined) next.filter=lib.filter.all;
next.setContent('moveCard'); next.setContent('moveCard');
next._args=Array.from(arguments); next._args=Array.from(arguments);
return next; return next;