From e5d35123c9296ad4edee98f86e4f73147ab90437 Mon Sep 17 00:00:00 2001 From: libccy Date: Sat, 25 Feb 2017 11:52:59 +0800 Subject: [PATCH] c --- character/sp.js | 35 +++++----- game/game.js | 172 ++++++++++++++++++++++-------------------------- mode/guozhan.js | 13 +++- 3 files changed, 107 insertions(+), 113 deletions(-) diff --git a/character/sp.js b/character/sp.js index e6b6dfa72..111f26f7f 100644 --- a/character/sp.js +++ b/character/sp.js @@ -1993,24 +1993,6 @@ character.sp={ chat:['粗鄙之语','天地不容','谄谀之臣','皓首匹夫,苍髯老贼','二臣贼子','断脊之犬','我从未见过有如此厚顔无耻之人!'], callback:function(){ 'step 0' - event.num1=event.card1.number; - event.num2=event.card2.number; - if(player.hasSkill('jici')&&event.num1<=player.storage.gushe){ - player.chooseBool(get.prompt('jici')); - } - else{ - event.goto(2); - } - 'step 1' - if(result.bool){ - if(event.num1event.num2){ target.chooseToDiscard('he','弃置一张牌,或令'+get.translation(player)+'摸一张牌').set('ai',function(card){ if(_status.event.goon) return 6-ai.get.value(card); @@ -2030,7 +2012,7 @@ character.sp={ event.finish(); } } - 'step 3' + 'step 1' if(!result.bool){ player.draw(); } @@ -2059,7 +2041,20 @@ character.sp={ } } }, - jici:{}, + jici:{ + trigger:{player:'compare'}, + filter:function(event,player){ + return event.getParent().name=='gushe'&&!event.iwhile&&event.num1<=player.storage.gushe; + }, + content:function(){ + if(trigger.num1event.card2.number){ - player.popup('胜'); - event.current.popup('负'); - str=get.translation(player.name)+'拼点成功'; - } - else{ - if(event.card1.number==event.card2.number){ - player.popup('平'); - event.current.popup('平'); - } - else{ - player.popup('负'); - event.current.popup('胜'); - } - str=get.translation(player.name)+'拼点失败'; - } - game.broadcastAll(function(str){ - var dialog=ui.create.dialog(str); - dialog.classList.add('center'); - setTimeout(function(){ - dialog.close(); - },500); - },str); - },1500); + event.card2=event.cardlist[event.iwhile]; + event.num2=event.card2.number; + game.log(event.target,'的拼点牌为',event.card2); + player.line(event.target); + player.$compare(event.card1,event.target,event.card2); + event.trigger('compare'); + game.delay(0,1500); } else{ event.finish(); } - "step 4" + "step 4" + event.result.num1[event.iwhile]=event.num1; + event.result.num2[event.iwhile]=event.num2; + var str; + if(event.num1>event.num2){ + str=get.translation(player.name)+'拼点成功'; + player.popup('胜'); + target.popup('负'); + } + else{ + str=get.translation(player.name)+'拼点失败'; + if(event.num1==event.num2){ + player.popup('平'); + target.popup('平'); + } + else{ + player.popup('负'); + target.popup('胜'); + } + } + game.broadcastAll(function(str){ + var dialog=ui.create.dialog(str); + dialog.classList.add('center'); + setTimeout(function(){ + dialog.close(); + },1000); + },str); + game.delay(2); + "step 5" if(event.callback){ game.broadcastAll(function(card1,card2){ if(card1.clone) card1.clone.style.opacity=0.5; @@ -7567,13 +7577,16 @@ },event.card1,event.card2); var next=game.createEvent('compareMultiple'); next.player=player; - next.target=event.current; + next.target=event.target; next.card1=event.card1; next.card2=event.card2; + next.num1=event.num1; + next.num2=event.num2; next.setContent(event.callback); } - "step 5" + "step 6" game.broadcastAll(ui.clear); + event.iwhile++; event.goto(3); }, chooseToCompare:function(){ @@ -7658,76 +7671,52 @@ player.$compare(event.card1,target,event.card2); game.log(player,'的拼点牌为',event.card1); game.log(target,'的拼点牌为',event.card2); + event.num1=event.card1.number; + event.num2=event.card2.number; + event.trigger('compare'); + game.delay(0,1500); + "step 6" event.result={ player:event.card1, target:event.card2, + num1:event.num1, + num2:event.num2 } - event.dialogid=lib.status.videoId++; - if(get.number(event.card1)>get.number(event.card2)){ + var str; + if(event.num1>event.num2){ event.result.bool=true; - setTimeout(function(){ - var str=get.translation(player.name)+'拼点成功'; - game.broadcast(function(str,id){ - var dialog=ui.create.dialog(str); - dialog.videoId=id; - dialog.classList.add('center'); - },str,event.dialogid); - event.dialog=ui.create.dialog(str); - event.dialog.classList.add('center'); - player.popup('胜'); - target.popup('负'); - game.resume(); - },1500); + str=get.translation(player.name)+'拼点成功'; + player.popup('胜'); + target.popup('负'); } else{ event.result.bool=false; - if(get.number(event.card1)==get.number(event.card2)){ + str=get.translation(player.name)+'拼点失败'; + if(event.num1==event.num2){ event.result.tie=true; - setTimeout(function(){ - var str=get.translation(player.name)+'拼点失败'; - game.broadcast(function(str,id){ - var dialog=ui.create.dialog(str); - dialog.videoId=id; - dialog.classList.add('center'); - },str,event.dialogid); - event.dialog=ui.create.dialog(str); - event.dialog.classList.add('center'); - player.popup('平'); - target.popup('平'); - game.resume(); - },1500); + player.popup('平'); + target.popup('平'); } else{ - setTimeout(function(){ - var str=get.translation(player.name)+'拼点失败'; - game.broadcast(function(str,id){ - var dialog=ui.create.dialog(str); - dialog.videoId=id; - dialog.classList.add('center'); - },str,event.dialogid); - event.dialog=ui.create.dialog(str); - event.dialog.classList.add('center'); - player.popup('负'); - target.popup('胜'); - game.resume(); - },1500); + player.popup('负'); + target.popup('胜'); } } - game.pause(); - "step 6" + game.broadcastAll(function(str){ + var dialog=ui.create.dialog(str); + dialog.classList.add('center'); + setTimeout(function(){ + dialog.close(); + },1000); + },str); game.delay(2); "step 7" if(typeof event.target.ai.shown=='number'&&event.target.ai.shown<=0.85&&event.addToAI){ event.target.ai.shown+=0.1; } - ui.arena.classList.remove('thrownhighlight'); - game.broadcast(function(id){ - var dialog=get.idDialog(id); - if(dialog){ - dialog.close(); - } + game.broadcastAll(function(){ ui.arena.classList.remove('thrownhighlight'); - },event.dialogid); + }); game.addVideo('thrownhighlight2'); if(event.clear!==false){ game.broadcastAll(ui.clear); @@ -7741,7 +7730,6 @@ else if(event.preserve=='lose'){ event.preserve=!event.result.bool; } - event.dialog.close(); }, chooseButton:function(){ "step 0" diff --git a/mode/guozhan.js b/mode/guozhan.js index c4e8b53cb..3713ecafb 100644 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -261,7 +261,18 @@ mode.guozhan={ } }, yingyang:{ - + trigger:{player:'compare',target:'compare'}, + filter:function(event){ + return !event.iwhile; + }, + content:function(){ + if(player==trigger.player){ + trigger.num1+=3; + } + else{ + trigger.num2+=3; + } + } }, gzqianxi:{ audio:'qianxi',