This commit is contained in:
parent
157ad13caa
commit
01b4e4abef
55
card/sp.js
55
card/sp.js
|
@ -6,7 +6,18 @@ card.sp={
|
|||
fullskin:true,
|
||||
type:'trick',
|
||||
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
|
||||
}
|
||||
},
|
||||
|
@ -99,7 +110,47 @@ card.sp={
|
|||
fulei:{
|
||||
fullskin:true,
|
||||
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:{
|
||||
fullskin:true,
|
||||
|
|
|
@ -1147,7 +1147,7 @@ card.standard={
|
|||
return lib.filter.judge(card,player,target);
|
||||
},
|
||||
enable:function(card,player){
|
||||
return (lib.filter.judge(card,player,player));
|
||||
return player.canAddJudge(card);
|
||||
},
|
||||
filterTarget:function(card,player,target){
|
||||
return (lib.filter.judge(card,player,target)&&player==target);
|
||||
|
@ -1162,59 +1162,11 @@ card.standard={
|
|||
player.damage(3,'thunder','nosource');
|
||||
}
|
||||
else{
|
||||
if(!card.expired){
|
||||
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;
|
||||
}
|
||||
player.addJudgeNext(card);
|
||||
}
|
||||
},
|
||||
cancel:function(){
|
||||
if(!card.expired){
|
||||
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;
|
||||
}
|
||||
player.addJudgeNext(card);
|
||||
},
|
||||
ai:{
|
||||
basic:{
|
||||
|
|
|
@ -713,7 +713,7 @@ card.yunchou={
|
|||
return lib.filter.judge(card,player,target);
|
||||
},
|
||||
enable:function(card,player){
|
||||
return (lib.filter.judge(card,player,player));
|
||||
return player.canAddJudge(card);
|
||||
},
|
||||
filterTarget:function(card,player,target){
|
||||
return (lib.filter.judge(card,player,target)&&player==target);
|
||||
|
@ -735,59 +735,11 @@ card.yunchou={
|
|||
}
|
||||
}
|
||||
else{
|
||||
if(!card.expired){
|
||||
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;
|
||||
}
|
||||
player.addJudgeNext(card);
|
||||
}
|
||||
},
|
||||
cancel:function(){
|
||||
if(!card.expired){
|
||||
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;
|
||||
}
|
||||
player.addJudgeNext(card);
|
||||
},
|
||||
ai:{
|
||||
basic:{
|
||||
|
@ -810,7 +762,7 @@ card.yunchou={
|
|||
hongshui:{
|
||||
type:'delay',
|
||||
enable:function(card,player){
|
||||
return (lib.filter.judge(card,player,player));
|
||||
return player.canAddJudge(card);
|
||||
},
|
||||
modTarget:function(card,player,target){
|
||||
return lib.filter.judge(card,player,target);
|
||||
|
|
40
game/game.js
40
game/game.js
|
@ -14444,6 +14444,46 @@
|
|||
next.setContent('addJudge');
|
||||
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(){
|
||||
var next=game.createEvent('judge');
|
||||
next.player=this;
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 63 KiB |
Loading…
Reference in New Issue