This commit is contained in:
libccy 2017-01-14 12:56:52 +08:00
parent e981cd782d
commit 16861b3f84
18 changed files with 135 additions and 135 deletions

View File

@ -778,9 +778,7 @@ card.guozhan={
if(player.identity=='ye') return true; if(player.identity=='ye') return true;
return target.identity!=player.identity; return target.identity!=player.identity;
}, },
prepare:function(cards,player,targets){ prepare:'give',
player.$give(cards,targets[0]);
},
discard:false, discard:false,
// delay:0.5, // delay:0.5,
content:function(){ content:function(){

View File

@ -786,7 +786,11 @@ card.swd={
type:'jiguan', type:'jiguan',
wuxieable:true, wuxieable:true,
enable:function(card,player){ enable:function(card,player){
return player.num('e')>0; var es=player.get('e');
for(var i=0;i<es.length;i++){
if(lib.inpile.contains(es[i].name)) return true;
}
return false;
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target==player; return target==player;
@ -2565,9 +2569,7 @@ card.swd={
return ai.get.value(card); return ai.get.value(card);
}, },
discard:false, discard:false,
prepare:function(cards,player){ prepare:'throw',
player.$throw(cards);
},
content:function(){ content:function(){
"step 0" "step 0"
target.$turn2(); target.$turn2();
@ -3624,9 +3626,7 @@ card.swd={
} }
return false; return false;
}, },
prepare:function(cards,player){ prepare:'throw',
player.$throw(cards);
},
content:function(){ content:function(){
'step 0' 'step 0'
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
@ -4018,9 +4018,7 @@ card.swd={
return player.num('he',{subtype:'equip1'})>0; return player.num('he',{subtype:'equip1'})>0;
}, },
discard:false, discard:false,
prepare:function(cards,player,targets){ prepare:'give',
player.$give(cards,targets[0]);
},
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player==target) return false; if(player==target) return false;
return true; return true;

View File

@ -171,9 +171,7 @@ character.diy={
} }
return false; return false;
}, },
prepare:function(cards,player,targets){ prepare:'throw',
player.$throw(cards);
},
position:'he', position:'he',
filterCard:function(card){ filterCard:function(card){
if(get.color(card)!='black') return false; if(get.color(card)!='black') return false;

View File

@ -3329,7 +3329,7 @@ character.hearth={
}, },
discard:false, discard:false,
prepare:function(cards,player){ prepare:function(cards,player){
player.$give(1,player); player.$give(1,player,false);
}, },
content:function(){ content:function(){
player.storage.bingjia=cards[0]; player.storage.bingjia=cards[0];
@ -3458,9 +3458,7 @@ character.hearth={
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player!=target&&!target.hasSkill('mdzhoufu2'); return player!=target&&!target.hasSkill('mdzhoufu2');
}, },
prepare:function(cards,player){ prepare:'throw',
player.$throw(cards);
},
discard:false, discard:false,
content:function(){ content:function(){
target.$gain2(cards); target.$gain2(cards);

View File

@ -270,9 +270,7 @@ character.ow={
filterCard:true, filterCard:true,
selectCard:-1, selectCard:-1,
discard:false, discard:false,
prepare:function(cards,player,targets){ prepare:'give',
player.$give(cards,targets[0]);
},
content:function(){ content:function(){
target.gain(cards); target.gain(cards);
target.changeHujia(); target.changeHujia();
@ -325,9 +323,7 @@ character.ow={
return 6-ai.get.value(card); return 6-ai.get.value(card);
}, },
discard:false, discard:false,
prepare:function(cards,player,targets){ prepare:'give2',
player.$give(1,targets[0]);
},
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&!target.hasSkill('shoujia2'); return target!=player&&!target.hasSkill('shoujia2');
}, },
@ -838,7 +834,7 @@ character.ow={
}, },
discard:false, discard:false,
prepare:function(cards,player){ prepare:function(cards,player){
player.$give(1,player); player.$give(1,player,false);
}, },
content:function(){ content:function(){
player.storage.dulei=cards[0]; player.storage.dulei=cards[0];

View File

@ -58,6 +58,7 @@ window.characterRank={
'ow_luxiao', 'ow_luxiao',
], ],
a:[ a:[
'dongbai',
'pal_longkui', 'pal_longkui',
'pal_nangonghuang', 'pal_nangonghuang',
'pal_xingxuan', 'pal_xingxuan',

View File

@ -33,9 +33,7 @@ character.refresh={
filterCard:true, filterCard:true,
selectCard:[1,Infinity], selectCard:[1,Infinity],
discard:false, discard:false,
prepare:function(cards,player,targets){ prepare:'give2',
player.$give(cards.length,targets[0]);
},
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player.storage.rerende2&&player.storage.rerende2.contains(target)) return false; if(player.storage.rerende2&&player.storage.rerende2.contains(target)) return false;
return player!=target; return player!=target;
@ -555,9 +553,7 @@ character.refresh={
return 8-ai.get.value(card); return 8-ai.get.value(card);
}, },
discard:false, discard:false,
prepare:function(cards,player,targets){ prepare:'give',
player.$give(cards,targets[0]);
},
content:function(){ content:function(){
"step 0" "step 0"
target.storage.refanjian=cards[0]; target.storage.refanjian=cards[0];
@ -1330,9 +1326,7 @@ character.refresh={
filter:function(event,player){ filter:function(event,player){
return player.num('he',{suit:'diamond'})>0; return player.num('he',{suit:'diamond'})>0;
}, },
prepare:function(cards,player){ prepare:'throw',
player.$throw(cards);
},
position:'he', position:'he',
filterCard:{suit:'diamond'}, filterCard:{suit:'diamond'},
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){

View File

@ -2286,8 +2286,10 @@ character.shenhua={
player.draw(); player.draw();
}, },
discard:false, discard:false,
prompt:'将要重铸的牌置于弃牌堆并摸一张牌',
delay:0.5,
prepare:function(cards,player){ prepare:function(cards,player){
player.$throw(cards); player.$throw(cards,1000);
}, },
ai:{ ai:{
basic:{ basic:{
@ -3289,9 +3291,7 @@ character.shenhua={
enable:'phaseUse', enable:'phaseUse',
discard:false, discard:false,
line:true, line:true,
prepare:function(cards,player,targets){ prepare:'give',
player.$give(cards,targets[0]);
},
filter:function(event,player){ filter:function(event,player){
if(player.group!='qun') return false; if(player.group!='qun') return false;
if(player.num('h','shan')+player.num('h','shandian')==0) return 0; if(player.num('h','shan')+player.num('h','shandian')==0) return 0;

View File

@ -100,6 +100,60 @@ character.sp={
dongbai:['dongzhuo'] dongbai:['dongzhuo']
}, },
skill:{ skill:{
lianzhu:{
enable:'phaseUse',
usable:1,
filterCard:true,
position:'he',
filterTarget:function(card,player,target){
return target!=player;
},
check:function(card){
var num=ai.get.value(card);
if(get.color(card)=='black'){
if(num>=6) return 0;
return 20-num;
}
else{
if(_status.event.player.needsToDiscard()){
return 7-num;
}
}
return 0;
},
discard:false,
prepare:'give',
content:function(){
'step 0'
target.gain(cards,player);
if(get.color(cards[0])=='black'){
target.chooseToDiscard(2,'he','弃置两张牌,或令'+get.translation(player)+'摸两张牌').set('ai',function(card){
if(_status.event.goon) return 7-ai.get.value(card);
return 0;
}).set('goon',ai.get.attitude(target,player)<0);
}
else{
event.finish();
}
'step 1'
if(!result.bool){
player.draw(2);
}
},
ai:{
order:8,
expose:0.2,
result:{
target:function(player,target){
if(ui.selected.cards.length&&get.color(ui.selected.cards[0])=='red'){
if(target.num('h')<player.num('h')) return 1;
return 0.5;
}
return -1;
}
}
}
},
xiehui:{ xiehui:{
mod:{ mod:{
maxHandcard:function(player,num){ maxHandcard:function(player,num){
@ -116,7 +170,7 @@ character.sp={
forced:true, forced:true,
popup:false, popup:false,
filter:function(event,player){ filter:function(event,player){
if(event.player!=player&&event.cards&&event.cards[0]&&get.owner(event.cards[0])==player){ if(event.source==player&&event.player!=player){
for(var i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
if(get.color(event.cards[i])=='black') return true; if(get.color(event.cards[i])=='black') return true;
} }
@ -128,12 +182,18 @@ character.sp={
if(!trigger.player.storage.xiehui2){ if(!trigger.player.storage.xiehui2){
trigger.player.storage.xiehui2=[]; trigger.player.storage.xiehui2=[];
} }
for(var i=0;i<trigger.cards.length;i++){
if(get.color(trigger.cards[i])=='black'){
trigger.player.storage.xiehui2.add(trigger.cards[i]);
}
}
} }
}, },
xiehui2:{ xiehui2:{
mark:true, mark:true,
intro:{ intro:{
content:'cards' content:'不能使用、打出或弃置获得的黑色牌',
nocount:true
}, },
mod:{ mod:{
cardDiscardable:function(card,player){ cardDiscardable:function(card,player){
@ -152,7 +212,7 @@ character.sp={
if(player.storage.xiehui2&&player.storage.xiehui2.contains(card)) return false; if(player.storage.xiehui2&&player.storage.xiehui2.contains(card)) return false;
}, },
}, },
group:'xiehui3' group:['xiehui3','xiehui4']
}, },
xiehui3:{ xiehui3:{
trigger:{player:'changeHp'}, trigger:{player:'changeHp'},
@ -166,6 +226,22 @@ character.sp={
delete player.storage.xiehui2; delete player.storage.xiehui2;
} }
}, },
xiehui4:{
trigger:{player:'loseEnd'},
forced:true,
popup:false,
silent:true,
content:function(){
if(player.storage.xiehui2){
for(var i=0;i<player.storage.xiehui2.length;i++){
if(trigger.cards.contains(player.storage.xiehui2[i])){
player.storage.xiehui2.splice(i--,1);
}
}
}
// player.updateMarks();
}
},
shanjia:{ shanjia:{
init:function(player){ init:function(player){
player.storage.shanjia=0; player.storage.shanjia=0;
@ -7013,6 +7089,7 @@ character.sp={
wanglang:'王朗', wanglang:'王朗',
sp_liubei:'sp刘备', sp_liubei:'sp刘备',
caochun:'曹纯', caochun:'曹纯',
dongbai:'董白',
xiehui:'黠慧', xiehui:'黠慧',
xiehui2:'黠慧', xiehui2:'黠慧',

View File

@ -470,9 +470,7 @@ character.standard={
filterCard:true, filterCard:true,
selectCard:[1,Infinity], selectCard:[1,Infinity],
discard:false, discard:false,
prepare:function(cards,player,targets){ prepare:'give',
player.$give(cards.length,targets[0]);
},
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return player!=target; return player!=target;
}, },

View File

@ -179,10 +179,7 @@ character.swd={
return 6-ai.get.value(card); return 6-ai.get.value(card);
}, },
discard:false, discard:false,
prepare:function(cards,player,targets){ prepare:'give',
player.$give(cards,targets[0]);
player.line(targets[0],'green');
},
content:function(){ content:function(){
"step 0" "step 0"
game.delay(); game.delay();
@ -2476,9 +2473,7 @@ character.swd={
return 6-ai.get.equipValue(card); return 6-ai.get.equipValue(card);
}, },
discard:false, discard:false,
prepare:function(cards,player){ prepare:'throw',
player.$throw(cards);
},
delay:false, delay:false,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return lib.filter.targetEnabled({name:'sha'},player,target); return lib.filter.targetEnabled({name:'sha'},player,target);
@ -2668,9 +2663,7 @@ character.swd={
selectCard:2, selectCard:2,
filterCard:true, filterCard:true,
discard:false, discard:false,
prepare:function(cards,player,targets){ prepare:'throw',
player.$throw(cards);
},
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return lib.filter.targetEnabled({name:'juedou'},player,target); return lib.filter.targetEnabled({name:'juedou'},player,target);
}, },
@ -2833,9 +2826,7 @@ character.swd={
position:'he', position:'he',
filterCard:{suit:'club'}, filterCard:{suit:'club'},
discard:false, discard:false,
prepare:function(cards,player,targets){ prepare:'throw',
player.$throw(cards);
},
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return lib.filter.targetEnabled({name:'guiyoujie'},player,target); return lib.filter.targetEnabled({name:'guiyoujie'},player,target);
}, },
@ -3002,10 +2993,7 @@ character.swd={
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.num('h')>0;
}, },
prepare:function(cards,player,targets){ prepare:'throw',
player.$throw(cards);
player.line(targets);
},
discard:false, discard:false,
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
@ -3947,9 +3935,7 @@ character.swd={
} }
return false; return false;
}, },
prepare:function(cards,player,targets){ prepare:'throw',
player.$throw(cards);
},
// selectTarget:[1,2], // selectTarget:[1,2],
selectCard:[2,2], selectCard:[2,2],
check:function(card){return 6-ai.get.useful(card)}, check:function(card){return 6-ai.get.useful(card)},
@ -5677,9 +5663,7 @@ character.swd={
return get.type(card,'trick')=='trick'; return get.type(card,'trick')=='trick';
}, },
discard:false, discard:false,
prepare:function(cards,player,targets){ prepare:'give',
player.$give(cards,targets[0]);
},
filter:function(event,player){ filter:function(event,player){
return player.num('h',{type:['trick','delay']})>0; return player.num('h',{type:['trick','delay']})>0;
}, },
@ -5986,9 +5970,7 @@ character.swd={
funiao:{ funiao:{
enable:'phaseUse', enable:'phaseUse',
discard:false, discard:false,
prepare:function(cards,player,targets){ prepare:'give2',
player.$give(1,targets[0]);
},
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(player==target) return false; if(player==target) return false;
if(player.num('h')==0) return false; if(player.num('h')==0) return false;
@ -6465,9 +6447,7 @@ character.swd={
filter:function(event,player){ filter:function(event,player){
return player.num('he',{type:'trick'})>0; return player.num('he',{type:'trick'})>0;
}, },
prepare:function(cards,player,targets){ prepare:'throw',
player.$throw(cards);
},
position:'he', position:'he',
filterCard:{type:'trick'}, filterCard:{type:'trick'},
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
@ -6782,10 +6762,7 @@ character.swd={
selectCard:-1, selectCard:-1,
// viewAs:{name:'sha'}, // viewAs:{name:'sha'},
discard:false, discard:false,
prepare:function(cards,player,targets){ prepare:'throw',
player.$throw(cards);
player.line(targets);
},
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return lib.filter.targetEnabled({name:'sha'},player,target); return lib.filter.targetEnabled({name:'sha'},player,target);
}, },
@ -7876,10 +7853,7 @@ character.swd={
return 8-ai.get.value(card); return 8-ai.get.value(card);
}, },
discard:false, discard:false,
prepare:function(cards,player,targets){ prepare:'give',
player.$give(cards,targets[0]);
player.line(targets[0],'green');
},
content:function(){ content:function(){
"step 0" "step 0"
game.delay(); game.delay();

View File

@ -39,7 +39,7 @@ character.xiake={
return player.num('e')>0; return player.num('e')>0;
}, },
filterCard:true, filterCard:true,
prompt:'弃置要重铸的牌并摸一张牌', prompt:'将要重铸的牌置于弃牌堆并摸一张牌',
discard:false, discard:false,
delay:0.5, delay:0.5,
check:function(card,player){ check:function(card,player){

View File

@ -450,9 +450,7 @@ character.xianjian={
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player; return target!=player;
}, },
prepare:function(cards,player,targets){ prepare:'give',
player.$give(cards,targets[0]);
},
discard:false, discard:false,
content:function(){ content:function(){
target.gain(cards,player); target.gain(cards,player);
@ -675,10 +673,7 @@ character.xianjian={
discard:false, discard:false,
line:false, line:false,
multiline:true, multiline:true,
prepare:function(cards,player,targets){ prepare:'throw',
player.$throw(cards);
player.line(targets);
},
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return lib.filter.targetEnabled({name:'sha'},player,target); return lib.filter.targetEnabled({name:'sha'},player,target);
}, },
@ -740,10 +735,7 @@ character.xianjian={
usable:1, usable:1,
filterCard:{name:'shan'}, filterCard:{name:'shan'},
discard:false, discard:false,
prepare:function(cards,player,targets){ prepare:'give',
player.$give(cards,targets[0]);
game.delay();
},
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target!=player&&!target.hasSkill('tianfu2'); return target!=player&&!target.hasSkill('tianfu2');
}, },
@ -758,11 +750,12 @@ character.xianjian={
target.addSkill('tianfu2'); target.addSkill('tianfu2');
}, },
ai:{ ai:{
order:2,
result:{ result:{
target:function(player,target){ target:function(player,target){
var att=ai.get.attitude(player,target); var att=ai.get.attitude(player,target);
if(att>=0) return 0; if(att>=0) return 0;
return ai.get.damageEffect(target,player,target); return ai.get.damageEffect(target,player,target,'thunder');
} }
}, },
expose:0.2 expose:0.2

View File

@ -3194,9 +3194,7 @@ character.yijiang={
huomo_sha:{ huomo_sha:{
enable:'phaseUse', enable:'phaseUse',
discard:false, discard:false,
prepare:function(cards,player){ prepare:'throw',
player.$throw(cards);
},
filter:function(event,player){ filter:function(event,player){
if(!player.storage.huomo) player.storage.huomo={}; if(!player.storage.huomo) player.storage.huomo={};
if(player.storage.huomo.sha) return false; if(player.storage.huomo.sha) return false;
@ -3242,9 +3240,7 @@ character.yijiang={
huomo_tao:{ huomo_tao:{
enable:'chooseToUse', enable:'chooseToUse',
discard:false, discard:false,
prepare:function(cards,player){ prepare:'throw',
player.$throw(cards);
},
filter:function(event,player){ filter:function(event,player){
if(!player.storage.huomo) player.storage.huomo={}; if(!player.storage.huomo) player.storage.huomo={};
if(player.storage.huomo.tao) return false; if(player.storage.huomo.tao) return false;
@ -3308,9 +3304,7 @@ character.yijiang={
huomo_jiu:{ huomo_jiu:{
enable:'chooseToUse', enable:'chooseToUse',
discard:false, discard:false,
prepare:function(cards,player){ prepare:'throw',
player.$throw(cards);
},
filter:function(event,player){ filter:function(event,player){
if(!lib.filter.filterCard({name:'jiu'},player,event)){ if(!lib.filter.filterCard({name:'jiu'},player,event)){
return false; return false;
@ -5248,10 +5242,7 @@ character.yijiang={
multitarget:true, multitarget:true,
discard:false, discard:false,
targetprompt:['得到牌','出杀目标'], targetprompt:['得到牌','出杀目标'],
prepare:function(cards,player,targets){ prepare:'give',
player.$give(cards,targets[0]);
player.line2(targets);
},
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; return player!=target;
@ -6535,9 +6526,7 @@ character.yijiang={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
discard:false, discard:false,
prepare:function(cards,player,targets){ prepare:'give2',
player.$give(1,targets[0]);
},
filterCard:function(card){ filterCard:function(card){
return get.suit(card)=='heart'; return get.suit(card)=='heart';
}, },

View File

@ -58,9 +58,7 @@ character.yxs={
} }
return false; return false;
}, },
prepare:function(cards,player,targets){ prepare:'throw',
player.$throw(cards);
},
content:function(){ content:function(){
player.useCard({name:'tao'},cards,targets[0]).animate=false; player.useCard({name:'tao'},cards,targets[0]).animate=false;
}, },
@ -2552,9 +2550,6 @@ character.yxs={
}, },
discard:false, discard:false,
lose:false, lose:false,
prepare:function(cards,player,targets){
player.line(targets,'green');
},
content:function(){ content:function(){
'step 0' 'step 0'
player.choosePlayerCard(target,'e',true).ai=ai.get.buttonValue; player.choosePlayerCard(target,'e',true).ai=ai.get.buttonValue;

View File

@ -6349,11 +6349,6 @@
} }
} }
"step 1" "step 1"
if(event.rangecards){
for(var i=0;i<event.rangecards.length;i++){
event.rangecards[i].recheck('chooseToDiscard');
}
}
if(event.result=='ai'){ if(event.result=='ai'){
game.check(); game.check();
if(ai.basic.chooseCard(event.ai)||forced){ if(ai.basic.chooseCard(event.ai)||forced){
@ -6370,6 +6365,11 @@
ui.click.cancel(); ui.click.cancel();
} }
} }
if(event.rangecards){
for(var i=0;i<event.rangecards.length;i++){
event.rangecards[i].recheck('chooseToDiscard');
}
}
"step 2" "step 2"
if(event.promptdiscard){ if(event.promptdiscard){
event.promptdiscard.close(); event.promptdiscard.close();

View File

@ -887,10 +887,7 @@ mode.boss={
filter:function(event,player){ filter:function(event,player){
return player.num('h')>0; return player.num('h')>0;
}, },
prepare:function(cards,player,targets){ prepare:'throw',
player.$throw(cards);
player.line(targets);
},
discard:false, discard:false,
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
@ -937,10 +934,7 @@ mode.boss={
return 6-ai.get.value(card); return 6-ai.get.value(card);
}, },
discard:false, discard:false,
prepare:function(cards,player,targets){ prepare:'give',
player.$give(cards,targets[0]);
player.line(targets[0],'green');
},
content:function(){ content:function(){
"step 0" "step 0"
game.delay(); game.delay();

View File

@ -4601,10 +4601,7 @@ mode.chess={
}, },
selectTarget:[1,Infinity], selectTarget:[1,Infinity],
discard:false, discard:false,
prepare:function(cards,player,targets){ prepare:'throw',
player.$throw(cards);
player.line(targets);
},
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return lib.filter.targetEnabled({name:'sha'},player,target)&& return lib.filter.targetEnabled({name:'sha'},player,target)&&
get.distance(player,target,'pure')<=5; get.distance(player,target,'pure')<=5;