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,
multitarget:true,
targetprompt:['被借刀','出杀目标'],
complexTarget:true,
filterTarget:function(card,player,target){
if(ui.selected.targets.length==0){
return (player!=target&&target.get('e',{subtype:'equip1'}).length);

View File

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

View File

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

View File

@ -781,7 +781,7 @@ character.gujian={
return get.color(card)==get.color(ui.selected.cards[0]);
}
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){
return 8-ai.get.value(card);
}

View File

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

View File

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

View File

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

View File

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

View File

@ -897,6 +897,7 @@ character.sp={
}
return get.number(card)+num<=13;
},
complexCard:true,
selectCard:function(){
var num=0;
for(var i=0;i<ui.selected.cards.length;i++){
@ -1075,6 +1076,7 @@ character.sp={
init:function(player){
player.storage.jianshu=false;
},
complexTarget:true,
filterTarget:function(card,player,target){
if(ui.selected.targets.length){
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)},
filterCard:true,
position:'he',
complexTarget:true,
filterTarget:function(card,player,target){
if(player==target) return false;
if(target.sex!='male') return false;

View File

@ -4435,6 +4435,7 @@ character.swd={
}
return true;
},
complexCard:true,
selectCard:[1,4],
check:function(card){
return 7-ai.get.value(card)
@ -6984,6 +6985,8 @@ character.swd={
}
return true;
},
complexCard:true,
complexTarget:true,
selectCard:[1,Infinity],
filterTarget:function(card,player,target){
if(player==target) return false;
@ -7126,39 +7129,6 @@ character.swd={
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:{
group:['guxing1','guxing3']
},

View File

@ -1398,7 +1398,7 @@ character.yijiang={
return 1;
}
return 2;
}).set('nontrick',n2.length>=2);
}).set('nontrick',n2.length>=2).set('complexCard',true);
}
else{
if(n1.length){
@ -5337,6 +5337,7 @@ character.yijiang={
return false;
},
selectTarget:2,
complexTarget:true,
content:function(){
'step 0'
var gainner,giver;
@ -5418,6 +5419,7 @@ character.yijiang={
selectTarget:2,
multitarget:true,
discard:false,
complexTarget:true,
targetprompt:['得到牌','出杀目标'],
prepare:'give',
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;
},
multitarget:true,
complexTarget:true,
content:function(){
"step 0"
event.cards=[targets[0].get('e'),targets[1].get('e')];

View File

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

View File

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

View File

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

View File

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

View File

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