This commit is contained in:
libccy 2017-11-07 19:58:19 +08:00
parent 9c91c707d3
commit c7b2b60339
3 changed files with 161 additions and 43 deletions

View File

@ -76,12 +76,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
event.shanRequired=1; event.shanRequired=1;
} }
"step 1" "step 1"
if(event.skipShan){ if(event.directHit){
event._result={bool:true};
}
else if(event.directHit){
event._result={bool:false}; event._result={bool:false};
} }
else if(event.skipShan){
event._result={bool:true};
}
else{ else{
var next=target.chooseToRespond({name:'shan'}); var next=target.chooseToRespond({name:'shan'});
if(event.shanRequired>1){ if(event.shanRequired>1){

View File

@ -170,10 +170,105 @@ game.import('character',function(lib,game,ui,get,ai,_status){
liuchen:['liushan'], liuchen:['liushan'],
}, },
skill:{ skill:{
zhuandui:{
group:['zhuandui_respond','zhuandui_use'],
subSkill:{
use:{
trigger:{player:'shaBegin'},
check:function(event,player){
return get.attitude(player,event.target)<0;
},
filter:function(event,player){
return player.countCards('h')>0&&event.target.countCards('h')>0&&event.target!=player;
},
logTarget:'target',
content:function(){
'step 0'
player.chooseToCompare(trigger.target);
'step 1'
if(result.bool){
trigger.directHit=true;
}
}
},
respond:{
trigger:{target:'shaBegin'},
check:function(event,player){
return get.effect(player,event.card,event.player,player)<0;
},
filter:function(event,player){
return player.countCards('h')>0&&event.player.countCards('h')>0&&event.player!=player;
},
logTarget:'player',
content:function(){
'step 0'
player.chooseToCompare(trigger.player);
'step 1'
if(result.bool){
trigger.skipShan=true;
}
}
}
},
ai:{
effect:{
target:{
function(card,player,target,current){
if(card.name=='sha'&&current<0) return 0.7;
}
}
}
}
},
tianbian:{
trigger:{player:'chooseCardBegin'},
check:function(event,player){
return player.hasCard(function(card){
var val=get.value(card);
return val<0||(val<=4&&card.number>=11);
});
},
filter:function(event){
return event.type=='compare'&&!event.directresult;
},
content:function(){
var cards=get.cards();
ui.discardPile.appendChild(cards[0]);
cards[0].vanishtag.add('tianbian');
trigger.directresult=cards;
trigger.untrigger();
},
group:'tianbian_number',
subSkill:{
number:{
trigger:{player:'compare',target:'compare'},
filter:function(event,player){
if(event.iwhile) return false;
if(event.player==player){
return get.suit(event.card1)=='heart'&&event.card1.vanishtag.contains('tianbian');
}
else{
return get.suit(event.card2)=='heart'&&event.card2.vanishtag.contains('tianbian');
}
},
silent:true,
content:function(){
game.log(player,'拼点牌点数视为13');
if(player==trigger.player){
trigger.num1=13;
}
else{
trigger.num2=13;
}
}
}
}
},
jianzheng:{ jianzheng:{
trigger:{global:'useCard'}, trigger:{global:'useCard'},
filter:function(event,player){ filter:function(event,player){
return event.card.name=='sha'&&!event.targets.contains(player)&&get.distance(event.player,player,'attack')<=1; return event.player!=player&&event.card.name=='sha'&&!event.targets.contains(player)&&
get.distance(event.player,player,'attack')<=1;
}, },
direct:true, direct:true,
content:function(){ content:function(){
@ -201,7 +296,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
effect+=6; effect+=6;
} }
} }
player.chooseCard('h',get.prompt2('jianzheng')).set('ai',function(card){ player.chooseCard('h',get.prompt2('jianzheng',trigger.player)).set('ai',function(card){
if(_status.event.effect>=0){ if(_status.event.effect>=0){
var val=get.value(card); var val=get.value(card);
if(val<0) return 10-val; if(val<0) return 10-val;
@ -236,6 +331,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.card.fix(); event.card.fix();
ui.cardPile.insertBefore(event.card,ui.cardPile.firstChild); ui.cardPile.insertBefore(event.card,ui.cardPile.firstChild);
} }
"step 5"
if(get.color(trigger.card)!='black'){
trigger.targets.push(player);
trigger.player.line(player);
game.delay();
trigger.trigger('useCard');
}
} }
}, },
qingxian:{ qingxian:{
@ -8801,6 +8903,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
jianzheng_info:'当一名其他角色使用【杀】指定目标时,若你在其攻击范围内且你不是目标,则你可以将一张手牌置于牌堆顶,取消所有目标,然后若此【杀】不为黑色,你成为目标', jianzheng_info:'当一名其他角色使用【杀】指定目标时,若你在其攻击范围内且你不是目标,则你可以将一张手牌置于牌堆顶,取消所有目标,然后若此【杀】不为黑色,你成为目标',
zhuandui:'专对', zhuandui:'专对',
zhuandui_info:'当你使用【杀】指定目标/成为【杀】的目标后,你可以与目标角色/此【杀】使用者拼点,若你赢,此杀不能被【闪】响应/对你无效', zhuandui_info:'当你使用【杀】指定目标/成为【杀】的目标后,你可以与目标角色/此【杀】使用者拼点,若你赢,此杀不能被【闪】响应/对你无效',
zhuandui_use_info:'当你使用【杀】指定目标后,你可以与目标角色拼点,若你赢,此杀不能被【闪】响应',
zhuandui_respond_info:'当你成为【杀】的目标后,你可以与此【杀】使用者拼点,若你赢,此杀对你无效',
tianbian:'天辩', tianbian:'天辩',
tianbian_info:'你拼点时可以改为用牌堆顶的一张牌进行拼点当你拼点的牌亮出后若此牌花色为红桃则点数视为K', tianbian_info:'你拼点时可以改为用牌堆顶的一张牌进行拼点当你拼点的牌亮出后若此牌花色为红桃则点数视为K',
funan:'复难', funan:'复难',

View File

@ -10148,7 +10148,7 @@
"step 1" "step 1"
event.list=targets.slice(0); event.list=targets.slice(0);
event.list.unshift(player); event.list.unshift(player);
player.chooseCardOL(event.list,'请选择拼点牌',true).set('ai',event.ai).set('source',player).aiCard=function(target){ player.chooseCardOL(event.list,'请选择拼点牌',true).set('type','compare').set('ai',event.ai).set('source',player).aiCard=function(target){
var hs=target.getCards('h'); var hs=target.getCards('h');
var event=_status.event; var event=_status.event;
event.player=target; event.player=target;
@ -10260,19 +10260,19 @@
player.wait(sendback); player.wait(sendback);
event.ol=true; event.ol=true;
player.send(function(ai){ player.send(function(ai){
game.me.chooseCard('请选择拼点牌',true).set('glow_result',true).ai=ai; game.me.chooseCard('请选择拼点牌',true).set('type','compare').set('glow_result',true).ai=ai;
game.resume(); game.resume();
},event.ai); },event.ai);
} }
else{ else{
event.localPlayer=true; event.localPlayer=true;
player.chooseCard('请选择拼点牌',true).set('glow_result',true).ai=event.ai; player.chooseCard('请选择拼点牌',true).set('type','compare').set('glow_result',true).ai=event.ai;
} }
if(target.isOnline()){ if(target.isOnline()){
target.wait(sendback); target.wait(sendback);
event.ol=true; event.ol=true;
target.send(function(ai){ target.send(function(ai){
game.me.chooseCard('请选择拼点牌',true).set('glow_result',true).ai=ai; game.me.chooseCard('请选择拼点牌',true).set('type','compare').set('glow_result',true).ai=ai;
game.resume(); game.resume();
},event.ai); },event.ai);
} }
@ -10284,7 +10284,7 @@
event.card1=result.cards[0]; event.card1=result.cards[0];
} }
if(event.localTarget){ if(event.localTarget){
target.chooseCard('请选择拼点牌',true).set('glow_result',true).ai=event.ai; target.chooseCard('请选择拼点牌',true).set('type','compare').set('glow_result',true).ai=event.ai;
} }
"step 3" "step 3"
if(event.localTarget){ if(event.localTarget){
@ -10336,6 +10336,7 @@
var str; var str;
if(event.num1>event.num2){ if(event.num1>event.num2){
event.result.bool=true; event.result.bool=true;
event.result.winner=player;
str=get.translation(player.name)+'拼点成功'; str=get.translation(player.name)+'拼点成功';
player.popup('胜'); player.popup('胜');
target.popup('负'); target.popup('负');
@ -10349,6 +10350,7 @@
target.popup('平'); target.popup('平');
} }
else{ else{
event.result.winner=target;
player.popup('负'); player.popup('负');
target.popup('胜'); target.popup('胜');
} }
@ -10571,39 +10573,51 @@
}, },
chooseCard:function(){ chooseCard:function(){
"step 0" "step 0"
game.check(); if(event.directresult){
if(event.isMine()){ event.result={
game.pause(); buttons:[],
if(event.prompt!=false){ cards:event.directresult.slice(0),
var str; targets:[],
if(typeof event.prompt=='string') str=event.prompt; confirm:'ok',
else{ bool:true,
str='请选择' links:[]
var range=get.select(event.selectCard); };
if(range[0]==range[1]) str+=get.cnNumber(range[0]); }
else if(range[1]==Infinity) str+='至少'+get.cnNumber(range[0]); else{
else str+=get.cnNumber(range[0])+'至'+get.cnNumber(range[1]); game.check();
str+='张'; if(event.isMine()){
if(event.position=='h'||event.position==undefined) str+='手'; game.pause();
if(event.position=='e') str+='装备'; if(event.prompt!=false){
str+='牌'; var str;
} if(typeof event.prompt=='string') str=event.prompt;
event.dialog=ui.create.dialog(str); else{
if(event.prompt2){ str='请选择'
event.dialog.addText(event.prompt2,event.prompt2.length<=20); var range=get.select(event.selectCard);
} if(range[0]==range[1]) str+=get.cnNumber(range[0]);
event.promptbar=event.dialog.add('0/'+get.numStr(event.selectCard[1],'card')); else if(range[1]==Infinity) str+='至少'+get.cnNumber(range[0]);
event.custom.add.card=function(){ else str+=get.cnNumber(range[0])+'至'+get.cnNumber(range[1]);
_status.event.promptbar.innerHTML= str+='张';
ui.selected.cards.length+'/'+get.numStr(_status.event.selectCard[1],'card'); if(event.position=='h'||event.position==undefined) str+='手';
if(event.position=='e') str+='装备';
str+='牌';
}
event.dialog=ui.create.dialog(str);
if(event.prompt2){
event.dialog.addText(event.prompt2,event.prompt2.length<=20);
}
event.promptbar=event.dialog.add('0/'+get.numStr(event.selectCard[1],'card'));
event.custom.add.card=function(){
_status.event.promptbar.innerHTML=
ui.selected.cards.length+'/'+get.numStr(_status.event.selectCard[1],'card');
}
} }
} }
} else if(event.isOnline()){
else if(event.isOnline()){ event.send();
event.send(); }
} else{
else{ event.result='ai';
event.result='ai'; }
} }
"step 1" "step 1"
if(event.result=='ai'){ if(event.result=='ai'){
@ -10624,7 +10638,7 @@
} }
"step 2" "step 2"
event.resume(); event.resume();
if(event.glow_result&&event.result.cards){ if(event.glow_result&&event.result.cards&&!event.directresult){
for(var i=0;i<event.result.cards.length;i++){ for(var i=0;i<event.result.cards.length;i++){
event.result.cards[i].classList.add('glow'); event.result.cards[i].classList.add('glow');
} }