This commit is contained in:
parent
9c91c707d3
commit
c7b2b60339
|
@ -76,12 +76,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
event.shanRequired=1;
|
||||
}
|
||||
"step 1"
|
||||
if(event.skipShan){
|
||||
event._result={bool:true};
|
||||
}
|
||||
else if(event.directHit){
|
||||
if(event.directHit){
|
||||
event._result={bool:false};
|
||||
}
|
||||
else if(event.skipShan){
|
||||
event._result={bool:true};
|
||||
}
|
||||
else{
|
||||
var next=target.chooseToRespond({name:'shan'});
|
||||
if(event.shanRequired>1){
|
||||
|
|
|
@ -170,10 +170,105 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
liuchen:['liushan'],
|
||||
},
|
||||
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'&¤t<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:{
|
||||
trigger:{global:'useCard'},
|
||||
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,
|
||||
content:function(){
|
||||
|
@ -201,7 +296,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
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){
|
||||
var val=get.value(card);
|
||||
if(val<0) return 10-val;
|
||||
|
@ -236,6 +331,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
event.card.fix();
|
||||
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:{
|
||||
|
@ -8801,6 +8903,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
jianzheng_info:'当一名其他角色使用【杀】指定目标时,若你在其攻击范围内且你不是目标,则你可以将一张手牌置于牌堆顶,取消所有目标,然后若此【杀】不为黑色,你成为目标',
|
||||
zhuandui:'专对',
|
||||
zhuandui_info:'当你使用【杀】指定目标/成为【杀】的目标后,你可以与目标角色/此【杀】使用者拼点,若你赢,此杀不能被【闪】响应/对你无效',
|
||||
zhuandui_use_info:'当你使用【杀】指定目标后,你可以与目标角色拼点,若你赢,此杀不能被【闪】响应',
|
||||
zhuandui_respond_info:'当你成为【杀】的目标后,你可以与此【杀】使用者拼点,若你赢,此杀对你无效',
|
||||
tianbian:'天辩',
|
||||
tianbian_info:'你拼点时,可以改为用牌堆顶的一张牌进行拼点;当你拼点的牌亮出后,若此牌花色为红桃,则点数视为K',
|
||||
funan:'复难',
|
||||
|
|
88
game/game.js
88
game/game.js
|
@ -10148,7 +10148,7 @@
|
|||
"step 1"
|
||||
event.list=targets.slice(0);
|
||||
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 event=_status.event;
|
||||
event.player=target;
|
||||
|
@ -10260,19 +10260,19 @@
|
|||
player.wait(sendback);
|
||||
event.ol=true;
|
||||
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();
|
||||
},event.ai);
|
||||
}
|
||||
else{
|
||||
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()){
|
||||
target.wait(sendback);
|
||||
event.ol=true;
|
||||
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();
|
||||
},event.ai);
|
||||
}
|
||||
|
@ -10284,7 +10284,7 @@
|
|||
event.card1=result.cards[0];
|
||||
}
|
||||
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"
|
||||
if(event.localTarget){
|
||||
|
@ -10336,6 +10336,7 @@
|
|||
var str;
|
||||
if(event.num1>event.num2){
|
||||
event.result.bool=true;
|
||||
event.result.winner=player;
|
||||
str=get.translation(player.name)+'拼点成功';
|
||||
player.popup('胜');
|
||||
target.popup('负');
|
||||
|
@ -10349,6 +10350,7 @@
|
|||
target.popup('平');
|
||||
}
|
||||
else{
|
||||
event.result.winner=target;
|
||||
player.popup('负');
|
||||
target.popup('胜');
|
||||
}
|
||||
|
@ -10571,39 +10573,51 @@
|
|||
},
|
||||
chooseCard:function(){
|
||||
"step 0"
|
||||
game.check();
|
||||
if(event.isMine()){
|
||||
game.pause();
|
||||
if(event.prompt!=false){
|
||||
var str;
|
||||
if(typeof event.prompt=='string') str=event.prompt;
|
||||
else{
|
||||
str='请选择'
|
||||
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 str+=get.cnNumber(range[0])+'至'+get.cnNumber(range[1]);
|
||||
str+='张';
|
||||
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');
|
||||
if(event.directresult){
|
||||
event.result={
|
||||
buttons:[],
|
||||
cards:event.directresult.slice(0),
|
||||
targets:[],
|
||||
confirm:'ok',
|
||||
bool:true,
|
||||
links:[]
|
||||
};
|
||||
}
|
||||
else{
|
||||
game.check();
|
||||
if(event.isMine()){
|
||||
game.pause();
|
||||
if(event.prompt!=false){
|
||||
var str;
|
||||
if(typeof event.prompt=='string') str=event.prompt;
|
||||
else{
|
||||
str='请选择'
|
||||
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 str+=get.cnNumber(range[0])+'至'+get.cnNumber(range[1]);
|
||||
str+='张';
|
||||
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()){
|
||||
event.send();
|
||||
}
|
||||
else{
|
||||
event.result='ai';
|
||||
else if(event.isOnline()){
|
||||
event.send();
|
||||
}
|
||||
else{
|
||||
event.result='ai';
|
||||
}
|
||||
}
|
||||
"step 1"
|
||||
if(event.result=='ai'){
|
||||
|
@ -10624,7 +10638,7 @@
|
|||
}
|
||||
"step 2"
|
||||
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++){
|
||||
event.result.cards[i].classList.add('glow');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue