This commit is contained in:
libccy 2017-04-02 13:04:48 +08:00
parent 157ad13caa
commit 01b4e4abef
5 changed files with 100 additions and 105 deletions

View File

@ -6,7 +6,18 @@ card.sp={
fullskin:true, fullskin:true,
type:'trick', type:'trick',
ai:{ ai:{
useful:1, useful:function(){
var player=_status.event.player;
if(player.countCards('h','jinchan')>1) return 0;
var num=player.getHandcardLimit();
if(num==1){
return 10;
}
if(num==2){
return 6;
}
return 1;
},
value:5 value:5
} }
}, },
@ -99,7 +110,47 @@ card.sp={
fulei:{ fulei:{
fullskin:true, fullskin:true,
type:'delay', type:'delay',
enable:true, modTarget:function(card,player,target){
return lib.filter.judge(card,player,target);
},
enable:function(card,player){
return player.canAddJudge(card);
},
filterTarget:function(card,player,target){
return (lib.filter.judge(card,player,target)&&player==target);
},
selectTarget:[-1,-1],
judge:function(card){
if(get.suit(card)=='spade') return -6;
return 0;
},
effect:function(){
if(result.judge){
if(!card.storage.fulei){
card.storage.fulei=1;
}
else{
card.storage.fulei++;
}
player.damage(card.storage.fulei,'thunder','nosource');
}
player.addJudgeNext(card);
},
cancel:function(){
player.addJudgeNext(card);
},
ai:{
basic:{
order:1,
useful:0,
value:0,
},
result:{
target:function(player,target){
return lib.card.shandian.ai.result.target(player,target);
}
},
}
}, },
qibaodao:{ qibaodao:{
fullskin:true, fullskin:true,

View File

@ -1147,7 +1147,7 @@ card.standard={
return lib.filter.judge(card,player,target); return lib.filter.judge(card,player,target);
}, },
enable:function(card,player){ enable:function(card,player){
return (lib.filter.judge(card,player,player)); return player.canAddJudge(card);
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return (lib.filter.judge(card,player,target)&&player==target); return (lib.filter.judge(card,player,target)&&player==target);
@ -1162,59 +1162,11 @@ card.standard={
player.damage(3,'thunder','nosource'); player.damage(3,'thunder','nosource');
} }
else{ else{
if(!card.expired){ player.addJudgeNext(card);
var target=player.next;
for(var iwhile=0;iwhile<10;iwhile++){
if(target.hasJudge('shandian')){
target=target.next;
}
else{
break;
}
}
if(target.hasJudge('shandian')||target==player){
ui.discardPile.appendChild(card);
}
else{
if(card.name!='shandian'){
target.addJudge('shandian',card);
}
else{
target.addJudge(card);
}
}
}
else{
card.expired=false;
}
} }
}, },
cancel:function(){ cancel:function(){
if(!card.expired){ player.addJudgeNext(card);
var target=player.next;
for(var iwhile=0;iwhile<10;iwhile++){
if(target.hasJudge('shandian')){
target=target.next;
}
else{
break;
}
}
if(target.hasJudge('shandian')||target==player){
ui.discardPile.appendChild(card);
}
else{
if(card.name!='shandian'){
target.addJudge('shandian',card);
}
else{
target.addJudge(card);
}
}
}
else{
card.expired=false;
}
}, },
ai:{ ai:{
basic:{ basic:{

View File

@ -713,7 +713,7 @@ card.yunchou={
return lib.filter.judge(card,player,target); return lib.filter.judge(card,player,target);
}, },
enable:function(card,player){ enable:function(card,player){
return (lib.filter.judge(card,player,player)); return player.canAddJudge(card);
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return (lib.filter.judge(card,player,target)&&player==target); return (lib.filter.judge(card,player,target)&&player==target);
@ -735,59 +735,11 @@ card.yunchou={
} }
} }
else{ else{
if(!card.expired){ player.addJudgeNext(card);
var target=player.next;
for(var iwhile=0;iwhile<10;iwhile++){
if(target.hasJudge('huoshan')){
target=target.next;
}
else{
break;
}
}
if(target.hasJudge('huoshan')||target==player){
ui.discardPile.appendChild(card);
}
else{
if(card.name!='huoshan'){
target.addJudge('huoshan',card);
}
else{
target.addJudge(card);
}
}
}
else{
card.expired=false;
}
} }
}, },
cancel:function(){ cancel:function(){
if(!card.expired){ player.addJudgeNext(card);
var target=player.next;
for(var iwhile=0;iwhile<10;iwhile++){
if(target.hasJudge('huoshan')){
target=target.next;
}
else{
break;
}
}
if(target.hasJudge('huoshan')||target==player){
ui.discardPile.appendChild(card);
}
else{
if(card.name!='huoshan'){
target.addJudge('huoshan',card);
}
else{
target.addJudge(card);
}
}
}
else{
card.expired=false;
}
}, },
ai:{ ai:{
basic:{ basic:{
@ -810,7 +762,7 @@ card.yunchou={
hongshui:{ hongshui:{
type:'delay', type:'delay',
enable:function(card,player){ enable:function(card,player){
return (lib.filter.judge(card,player,player)); return player.canAddJudge(card);
}, },
modTarget:function(card,player,target){ modTarget:function(card,player,target){
return lib.filter.judge(card,player,target); return lib.filter.judge(card,player,target);

View File

@ -14444,6 +14444,46 @@
next.setContent('addJudge'); next.setContent('addJudge');
return next; return next;
}, },
canAddJudge:function(card){
var name;
if(typeof card=='string'){
name=card;
}
else{
name=card.viewAs||card.name;
}
if(!name) return false;
if(this.hasJudge(name)) return false;
var mod=game.checkMod(card,this,this,'unchanged','targetEnabled',this);
if(mod!='unchanged') return mod;
return true;
},
addJudgeNext:function(card){
if(!card.expired){
var target=this.next;
var name=card.viewAs||card.name;
for(var iwhile=0;iwhile<20;iwhile++){
if(target==this||target.canAddJudge(card)){
break;
}
target=target.next;
}
if(target==this){
ui.discardPile.appendChild(card);
}
else{
if(card.name!=name){
target.addJudge(name,card);
}
else{
target.addJudge(card);
}
}
}
else{
card.expired=false;
}
},
judge:function(){ judge:function(){
var next=game.createEvent('judge'); var next=game.createEvent('judge');
next.player=this; next.player=this;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 63 KiB