This commit is contained in:
libccy 2017-02-10 14:05:14 +08:00
parent 5c15b56f4a
commit cd554129cd
17 changed files with 149 additions and 75 deletions

View File

@ -1032,6 +1032,7 @@ card.standard={
singleCard:true, singleCard:true,
multitarget:true, multitarget:true,
targetprompt:['被借刀','出杀目标'], targetprompt:['被借刀','出杀目标'],
complexTarget:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(ui.selected.targets.length==0){ if(ui.selected.targets.length==0){
return (player!=target&&target.get('e',{subtype:'equip1'}).length); return (player!=target&&target.get('e',{subtype:'equip1'}).length);

View File

@ -4074,6 +4074,7 @@ card.swd={
return name; return name;
}, },
selectCard:2, selectCard:2,
complexCard:true,
filter:function(event,player){ filter:function(event,player){
if(!player.num('h',{type:['hslingjian','jiqi']})) return false; if(!player.num('h',{type:['hslingjian','jiqi']})) return false;
var es=player.get('he',{type:'equip'}); var es=player.get('he',{type:'equip'});

View File

@ -855,6 +855,7 @@ character.extra={
} }
return true; return true;
}, },
complexCard:true,
mark:true, mark:true,
selectCard:[0,4], selectCard:[0,4],
line:'fire', line:'fire',

View File

@ -781,7 +781,7 @@ character.gujian={
return get.color(card)==get.color(ui.selected.cards[0]); return get.color(card)==get.color(ui.selected.cards[0]);
} }
return player.num('h',{color:get.color(card)})>1; return player.num('h',{color:get.color(card)})>1;
}).ai=function(card){ }).set('complexCard',true).ai=function(card){
if(ai.get.damageEffect(trigger.source,player,player,'thunder')>0){ if(ai.get.damageEffect(trigger.source,player,player,'thunder')>0){
return 8-ai.get.value(card); return 8-ai.get.value(card);
} }

View File

@ -1903,6 +1903,7 @@ character.hearth={
} }
return true; return true;
}, },
complexCard:true,
position:'he', position:'he',
check:function(card){ check:function(card){
return 8-ai.get.value(card); return 8-ai.get.value(card);

View File

@ -953,6 +953,7 @@ character.ow={
} }
return true; return true;
}, },
complexCard:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&target.num('h')>0; return target!=player&&target.num('h')>0;
}, },
@ -1195,6 +1196,7 @@ character.ow={
return true; return true;
}, },
selectCard:[1,Infinity], selectCard:[1,Infinity],
complexCard:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return !target.hasSkill('bingqiang2')&&!target.hasSkill('bingqiang5')&& return !target.hasSkill('bingqiang2')&&!target.hasSkill('bingqiang5')&&
!target.next.hasSkill('bingqiang2')&&!target.next.hasSkill('bingqiang5')&& !target.next.hasSkill('bingqiang2')&&!target.next.hasSkill('bingqiang5')&&

View File

@ -1358,6 +1358,7 @@ character.refresh={
} }
return target.num('he')>0; return target.num('he')>0;
}, },
complexTarget:true,
filter:function(event,player){ filter:function(event,player){
return player.num('he')>0; return player.num('he')>0;
}, },
@ -1389,16 +1390,17 @@ character.refresh={
xunxun:{ xunxun:{
audio:2, audio:2,
trigger:{player:'phaseDrawBefore'}, trigger:{player:'phaseDrawBefore'},
direct:true, check:function(event,player){
return !player.hasSkill('reyiji2');
},
content:function(){ content:function(){
"step 0" "step 0"
trigger.untrigger();
trigger.finish();
event.cards=get.cards(4); event.cards=get.cards(4);
player.chooseCardButton(event.cards,2,'选择获得两张牌').set('ai',ai.get.buttonValue); player.chooseCardButton(event.cards,2,'选择获得两张牌').set('ai',ai.get.buttonValue);
"step 1" "step 1"
if(result.bool){ if(result.bool){
player.logSkill('xunxun');
trigger.untrigger();
trigger.finish();
var choice=[]; var choice=[];
for(var i=0;i<result.links.length;i++){ for(var i=0;i<result.links.length;i++){
choice.push(result.links[i]); choice.push(result.links[i]);

View File

@ -55,6 +55,7 @@ character.shenhua={
}, },
selectCard:[0,Infinity], selectCard:[0,Infinity],
selectTarget:2, selectTarget:2,
complexTarget:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player==target) return false; if(player==target) return false;
if(ui.selected.targets.length==0) return true; if(ui.selected.targets.length==0) return true;
@ -886,6 +887,7 @@ character.shenhua={
return target.num('ej')>0; return target.num('ej')>0;
} }
}, },
complexTarget:true,
selectTarget:2, selectTarget:2,
filterCard:lib.filter.cardDiscardable, filterCard:lib.filter.cardDiscardable,
prompt:'是否发动巧变跳过出牌阶段?', prompt:'是否发动巧变跳过出牌阶段?',
@ -2077,6 +2079,7 @@ character.shenhua={
}, },
selectCard:[0,Infinity], selectCard:[0,Infinity],
selectTarget:2, selectTarget:2,
complexTarget:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player==target) return false; if(player==target) return false;
if(ui.selected.targets.length==0) return true; if(ui.selected.targets.length==0) return true;
@ -3070,6 +3073,7 @@ character.shenhua={
return false; return false;
}, },
selectCard:2, selectCard:2,
complexCard:true,
check:function(card){ check:function(card){
return 6-ai.get.value(card); return 6-ai.get.value(card);
}, },

View File

@ -897,6 +897,7 @@ character.sp={
} }
return get.number(card)+num<=13; return get.number(card)+num<=13;
}, },
complexCard:true,
selectCard:function(){ selectCard:function(){
var num=0; var num=0;
for(var i=0;i<ui.selected.cards.length;i++){ for(var i=0;i<ui.selected.cards.length;i++){
@ -1075,6 +1076,7 @@ character.sp={
init:function(player){ init:function(player){
player.storage.jianshu=false; player.storage.jianshu=false;
}, },
complexTarget:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(ui.selected.targets.length){ if(ui.selected.targets.length){
return target.num('h')>0&&target.distanceTo(ui.selected.targets[0])<=1; return target.num('h')>0&&target.distanceTo(ui.selected.targets[0])<=1;

View File

@ -1536,6 +1536,7 @@ character.standard={
check:function(card){return 10-ai.get.value(card)}, check:function(card){return 10-ai.get.value(card)},
filterCard:true, filterCard:true,
position:'he', position:'he',
complexTarget:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player==target) return false; if(player==target) return false;
if(target.sex!='male') return false; if(target.sex!='male') return false;

View File

@ -4435,6 +4435,7 @@ character.swd={
} }
return true; return true;
}, },
complexCard:true,
selectCard:[1,4], selectCard:[1,4],
check:function(card){ check:function(card){
return 7-ai.get.value(card) return 7-ai.get.value(card)
@ -6984,6 +6985,8 @@ character.swd={
} }
return true; return true;
}, },
complexCard:true,
complexTarget:true,
selectCard:[1,Infinity], selectCard:[1,Infinity],
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player==target) return false; if(player==target) return false;
@ -7126,39 +7129,6 @@ character.swd={
order:5 order:5
} }
}, },
swd_xiuluo:{
audio:2,
trigger:{player:'phaseBegin'},
direct:true,
filter:function(event,player){
return player.num('j')>0;
},
content:function(){
"step 0"
player.chooseToDiscard(2,'hj',function(card){
if(ui.selected.cards.length==0) return true;
if(get.position(ui.selected.cards[0])=='h'){
if(get.position(card)!='j') return false;
}
if(get.position(ui.selected.cards[0])=='j'){
if(get.position(card)!='h') return false;
}
return get.suit(card)==get.suit(ui.selected.cards[0])
},'是否一张手牌来弃置一张花色相同的判定牌?').ai=function(card){
if(get.position(card)=='h'){
return 11-ai.get.value(card);
}
if(card.name=='lebu') return 5;
if(card.name=='bingliang') return 4;
if(card.name=='guiyoujie') return 3;
return 2;
}
"step 1"
if(result.bool){
player.logSkill('swd_xiuluo');
}
}
},
guxing:{ guxing:{
group:['guxing1','guxing3'] group:['guxing1','guxing3']
}, },

View File

@ -1398,7 +1398,7 @@ character.yijiang={
return 1; return 1;
} }
return 2; return 2;
}).set('nontrick',n2.length>=2); }).set('nontrick',n2.length>=2).set('complexCard',true);
} }
else{ else{
if(n1.length){ if(n1.length){
@ -5337,6 +5337,7 @@ character.yijiang={
return false; return false;
}, },
selectTarget:2, selectTarget:2,
complexTarget:true,
content:function(){ content:function(){
'step 0' 'step 0'
var gainner,giver; var gainner,giver;
@ -5418,6 +5419,7 @@ character.yijiang={
selectTarget:2, selectTarget:2,
multitarget:true, multitarget:true,
discard:false, discard:false,
complexTarget:true,
targetprompt:['得到牌','出杀目标'], targetprompt:['得到牌','出杀目标'],
prepare:'give', prepare:'give',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
@ -6750,6 +6752,7 @@ character.yijiang={
return Math.abs(ui.selected.targets[0].num('e')-target.num('e'))<=player.maxHp-player.hp; return Math.abs(ui.selected.targets[0].num('e')-target.num('e'))<=player.maxHp-player.hp;
}, },
multitarget:true, multitarget:true,
complexTarget:true,
content:function(){ content:function(){
"step 0" "step 0"
event.cards=[targets[0].get('e'),targets[1].get('e')]; event.cards=[targets[0].get('e'),targets[1].get('e')];

View File

@ -515,6 +515,7 @@ character.yxs={
} }
return true; return true;
}, },
complexCard:true,
usable:1, usable:1,
selectCard:2, selectCard:2,
check:function(card){ check:function(card){
@ -794,6 +795,7 @@ character.yxs={
} }
return true; return true;
}, },
complexCard:true,
selectCard:2, selectCard:2,
check:function(card){ check:function(card){
return 8-ai.get.value(card); return 8-ai.get.value(card);
@ -1339,6 +1341,7 @@ character.yxs={
} }
return get.color(card)=='black'||card.name=='jiu'; return get.color(card)=='black'||card.name=='jiu';
}; };
next.complexCard=true,
next.logSkill=['zhensha',trigger.player]; next.logSkill=['zhensha',trigger.player];
next.selectCard=function(){ next.selectCard=function(){
if(ui.selected.cards.length){ if(ui.selected.cards.length){
@ -2333,6 +2336,7 @@ character.yxs={
return 7-ai.get.value(card); return 7-ai.get.value(card);
}, },
multitarget:true, multitarget:true,
complexTarget:true,
targetprompt:['被移走','移动目标'], targetprompt:['被移走','移动目标'],
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(ui.selected.targets.length){ if(ui.selected.targets.length){

View File

@ -285,6 +285,7 @@ character.zhuogui={
} }
return true; return true;
}, },
complexCard:true,
selectCard:3, selectCard:3,
position:'he', position:'he',
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){

View File

@ -5771,6 +5771,9 @@
game.me.actused=-99; game.me.actused=-99;
} }
ui.updatehl(); ui.updatehl();
delete _status.event._cardChoice;
delete _status.event._targetChoice;
delete _status.event._skillChoice;
setTimeout(game.check,300); setTimeout(game.check,300);
}, },
gc:function(name,act){ gc:function(name,act){
@ -5780,6 +5783,9 @@
game.me.actused=-99; game.me.actused=-99;
} }
ui.updatehl(); ui.updatehl();
delete _status.event._cardChoice;
delete _status.event._targetChoice;
delete _status.event._skillChoice;
setTimeout(game.check,300); setTimeout(game.check,300);
}, },
aa:function(){ aa:function(){
@ -5857,6 +5863,9 @@
target=target||game.me; target=target||game.me;
var card=cheat.gn(name); var card=cheat.gn(name);
target.node.handcards1.appendChild(card); target.node.handcards1.appendChild(card);
delete _status.event._cardChoice;
delete _status.event._targetChoice;
delete _status.event._skillChoice;
game.check(); game.check();
target.update(); target.update();
ui.updatehl(); ui.updatehl();
@ -5930,6 +5939,9 @@
for(var i=0;i<num;i++){ for(var i=0;i<num;i++){
var card=cards[i]; var card=cards[i];
game.me.node.handcards1.appendChild(card); game.me.node.handcards1.appendChild(card);
delete _status.event._cardChoice;
delete _status.event._targetChoice;
delete _status.event._skillChoice;
game.check(); game.check();
game.me.update(); game.me.update();
ui.updatehl(); ui.updatehl();
@ -5939,6 +5951,9 @@
for(var i=0;i<arguments.length;i++){ for(var i=0;i<arguments.length;i++){
game.me.addSkill(arguments[i],true); game.me.addSkill(arguments[i],true);
} }
delete _status.event._cardChoice;
delete _status.event._targetChoice;
delete _status.event._skillChoice;
game.check(); game.check();
}, },
t:function(num){ t:function(num){
@ -10597,7 +10612,7 @@
next.filterCard=lib.filter.filterCard; next.filterCard=lib.filter.filterCard;
} }
if(next.selectCard==undefined){ if(next.selectCard==undefined){
next.selectCard=lib.filter.selectCard; next.selectCard=[1,1];
} }
if(next.filterTarget==undefined){ if(next.filterTarget==undefined){
next.filterTarget=lib.filter.filterTarget; next.filterTarget=lib.filter.filterTarget;
@ -14763,6 +14778,11 @@
forced:this.forced, forced:this.forced,
aiexclude:this.aiexclude, aiexclude:this.aiexclude,
complexSelect:this.complexSelect, complexSelect:this.complexSelect,
complexCard:this.complexCard,
complexTarget:this.complexTarget,
_cardChoice:this._cardChoice,
_targetChoice:this._targetChoice,
_skillChoice:this._skillChoice,
ai1:this.ai1, ai1:this.ai1,
ai2:this.ai2, ai2:this.ai2,
} }
@ -14780,6 +14800,8 @@
if(info.position!=undefined) this.position=info.position; if(info.position!=undefined) this.position=info.position;
if(info.forced!=undefined) this.forced=info.forced; if(info.forced!=undefined) this.forced=info.forced;
if(info.complexSelect!=undefined) this.complexSelect=info.complexSelect; if(info.complexSelect!=undefined) this.complexSelect=info.complexSelect;
if(info.complexCard!=undefined) this.complexCard=info.complexCard;
if(info.complexTarget!=undefined) this.complexTarget=info.complexTarget;
if(info.ai1!=undefined) this.ai1=info.ai1; if(info.ai1!=undefined) this.ai1=info.ai1;
if(info.ai2!=undefined) this.ai2=info.ai2; if(info.ai2!=undefined) this.ai2=info.ai2;
} }
@ -14793,10 +14815,15 @@
this.position=info.position; this.position=info.position;
this.forced=info.forced; this.forced=info.forced;
this.complexSelect=info.complexSelect; this.complexSelect=info.complexSelect;
this.complexCard=info.complexCard;
this.complexTarget=info.complexTarget;
if(info.ai1!=undefined) this.ai1=info.ai1; if(info.ai1!=undefined) this.ai1=info.ai1;
if(info.ai2!=undefined) this.ai2=info.ai2; if(info.ai2!=undefined) this.ai2=info.ai2;
} }
} }
delete this._cardChoice;
delete this._targetChoice;
delete this._skillChoice;
}, },
restore:function(){ restore:function(){
if(this._backup){ if(this._backup){
@ -14810,8 +14837,13 @@
this.forced=this._backup.forced; this.forced=this._backup.forced;
this.aiexclude=this._backup.aiexclude; this.aiexclude=this._backup.aiexclude;
this.complexSelect=this._backup.complexSelect; this.complexSelect=this._backup.complexSelect;
this.complexCard=this._backup.complexCard;
this.complexTarget=this._backup.complexTarget;
this.ai1=this._backup.ai1; this.ai1=this._backup.ai1;
this.ai2=this._backup.ai2; this.ai2=this._backup.ai2;
this._cardChoice=this._backup._cardChoice;
this._targetChoice=this._backup._targetChoice;
this._skillChoice=this._backup._skillChoice;
} }
delete this.skill; delete this.skill;
}, },
@ -20470,10 +20502,36 @@
} }
else{ else{
var cards=player.get(event.position||'h'); var cards=player.get(event.position||'h');
var firstCheck=false;
range=get.select(event.selectCard); range=get.select(event.selectCard);
if(!event._cardChoice&&typeof event.selectCard!='function'){
if(range[0]==1&&range[1]==1){
event._cardChoice=[];
}
else if(typeof event.filterCard!='function'){
event._cardChoice=[];
}
else if(!event.complexCard){
event._cardChoice=[];
}
if(event._cardChoice){
firstCheck=true;
}
}
var selectableCards=false; var selectableCards=false;
if(range[0]!=range[1]||range[0]>1) auto=false; if(range[0]!=range[1]||range[0]>1) auto=false;
for(i=0;i<cards.length;i++){ for(i=0;i<cards.length;i++){
if(event._cardChoice&&!firstCheck){
if(ui.selected.cards.length>=range[1]||
!event._cardChoice.contains(cards[i])||
!lib.filter.cardAiIncluded(cards[i])){
cards[i].classList.remove('selectable');
}
else{
cards[i].classList.add('selectable');
}
}
else{
if(event.filterCard(cards[i],player)&& if(event.filterCard(cards[i],player)&&
lib.filter.cardAiIncluded(cards[i])&& lib.filter.cardAiIncluded(cards[i])&&
(player.isOut()==false||event.includeOutCard)&& (player.isOut()==false||event.includeOutCard)&&
@ -20481,6 +20539,9 @@
!cards[i].classList.contains('uncheck')){ !cards[i].classList.contains('uncheck')){
if(ui.selected.cards.length<range[1]){ if(ui.selected.cards.length<range[1]){
cards[i].classList.add('selectable'); cards[i].classList.add('selectable');
if(event._cardChoice){
event._cardChoice.push(cards[i]);
}
} }
else if(range[1]==-1){ else if(range[1]==-1){
cards[i].classList.add('selected'); cards[i].classList.add('selected');
@ -20497,6 +20558,7 @@
ui.selected.cards.remove(cards[i]); ui.selected.cards.remove(cards[i]);
} }
} }
}
if(cards[i].classList.contains('selected')){ if(cards[i].classList.contains('selected')){
cards[i].classList.add('selectable'); cards[i].classList.add('selectable');
} }
@ -20586,7 +20648,18 @@
} }
if(!event.skill&&get.noSelected()&&!_status.noconfirm){ if(!event.skill&&get.noSelected()&&!_status.noconfirm){
var skills=[],enable,info; var skills=[],enable,info;
var skills2;
if(event._skillChoice){
skills2=event._skillChoice;
for(var i=0;i<skills2.length;i++){
if(event.isMine()||!event.aiexclude.contains(skills2[i])){
skills.push(skills2[i]);
}
}
}
else{
var skills2=game.filterSkills(player.get('s',true,true,false).concat(lib.skill.global),player); var skills2=game.filterSkills(player.get('s',true,true,false).concat(lib.skill.global),player);
event._skillChoice=[];
game.expandSkills(skills2); game.expandSkills(skills2);
for(i=0;i<skills2.length;i++){ for(i=0;i<skills2.length;i++){
info=get.info(skills2[i]); info=get.info(skills2[i]);
@ -20599,13 +20672,16 @@
if(info.filter&&!info.filter(event,player)) enable=false; if(info.filter&&!info.filter(event,player)) enable=false;
if(info.viewAs&&event.filterCard&&!event.filterCard(info.viewAs,player)) enable=false; if(info.viewAs&&event.filterCard&&!event.filterCard(info.viewAs,player)) enable=false;
if(info.viewAs&&info.viewAsFilter&&info.viewAsFilter(player)==false) enable=false; if(info.viewAs&&info.viewAsFilter&&info.viewAsFilter(player)==false) enable=false;
if(!event.isMine()&&event.aiexclude.contains(skills2[i])) enable=false;
if(info.usable&&get.skillCount(skills2[i])>=info.usable) enable=false; if(info.usable&&get.skillCount(skills2[i])>=info.usable) enable=false;
if(info.chooseButton&&_status.event.noButton) enable=false; if(info.chooseButton&&_status.event.noButton) enable=false;
} }
if(enable){ if(enable){
if(event.isMine()||!event.aiexclude.contains(skills2[i])){
skills.add(skills2[i]); skills.add(skills2[i]);
} }
event._skillChoice.add(skills2[i]);
}
}
} }
var globalskills=[]; var globalskills=[];
@ -32276,6 +32352,9 @@
if(game.onresume){ if(game.onresume){
game.onresume(); game.onresume();
} }
delete _status.event._cardChoice;
delete _status.event._targetChoice;
delete _status.event._skillChoice;
return false; return false;
}, },
config:function(){ config:function(){

View File

@ -4430,6 +4430,7 @@ mode.chess={
} }
return true; return true;
}, },
complexCard:true,
selectCard:4, selectCard:4,
check:function(card){ check:function(card){
return 10-ai.get.value(card); return 10-ai.get.value(card);

View File

@ -4170,6 +4170,7 @@ mode.stone={
} }
return true; return true;
}, },
complexTarget:true,
selectTarget:2, selectTarget:2,
multitarget:true, multitarget:true,
multiline:true, multiline:true,