diff --git a/character/sp.js b/character/sp.js index 3e0361707..000ad5c64 100755 --- a/character/sp.js +++ b/character/sp.js @@ -1,5 +1,6 @@ 'use strict'; character.sp={ + connect:true, character:{ yangxiu:['male','wei',3,['jilei','danlao']], chenlin:['male','wei',3,['bifa','songci']], diff --git a/character/yijiang.js b/character/yijiang.js index 6190a9849..9fba622bd 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -4658,6 +4658,7 @@ character.yijiang={ content:function(){ "step 0" player.chooseControl('jiangchi_less','jiangchi_more','cancel',function(){ + var player=_status.event.player; if(player.num('h')>3&&player.num('h','sha')>1){ return 'jiangchi_less'; } @@ -5060,41 +5061,61 @@ character.yijiang={ content:function(){ "step 0" event.cards=get.cards(4); - if(event.isMine()==false){ - event.dialog=ui.create.dialog('称象',event.cards); - game.delay(2); - } + event.videoId=lib.status.videoId++; + game.broadcastAll(function(player,id,cards){ + var str; + if(player==game.me&&!_status.auto){ + str='称象:选择任意张点数小于13的牌'; + } + else{ + str='称象'; + } + var dialog=ui.create.dialog(str,cards); + dialog.videoId=id; + },player,event.videoId,event.cards); + event.time=get.utc(); game.addVideo('showCards',player,['称象',get.cardsInfo(event.cards)]); game.addVideo('delay',null,2); "step 1" - if(event.dialog) event.dialog.close(); - var dialog=ui.create.dialog('称象:选择任意张点数小于13的牌',event.cards); - var next=player.chooseButton([0,4],dialog); - next.filterButton=function(button){ + var next=player.chooseButton([0,4]); + next.set('dialog',event.videoId); + next.set('filterButton',function(button){ var num=0 for(var i=0;i0){ + game.delay(0,time); + } + "step 3" + game.broadcastAll('closeDialog',event.videoId); + var cards2=event.cards2; + player.gain(cards2); + player.$draw(cards2); + game.log(player,'获得了',cards2) + game.delay(2); }, ai:{ maixie:true, @@ -5129,12 +5150,13 @@ character.yijiang={ "step 0" var next=player.chooseToDiscard('是否发动【仁心】?',{type:'equip'},'he'); next.logSkill=['renxin',trigger.player]; - next.ai=function(card){ - if(ai.get.attitude(player,trigger.player)>3){ + next.set('ai',function(card){ + var player=_status.event.player; + if(ai.get.attitude(player,_status.event.getTrigger().player)>3){ return 11-ai.get.value(card); } return -1; - } + }); "step 1" if(result.bool){ player.turnOver(); diff --git a/game/game.js b/game/game.js index 5b4e9fd7b..b7505f66f 100755 --- a/game/game.js +++ b/game/game.js @@ -52,7 +52,7 @@ }; var lib={ configprefix:'noname_0.9_', - versionOL:7, + versionOL:8, updateURL:localStorage.getItem('noname_update_url')||'http://123.206.55.178/', assetURL:'', hallURL:'123.206.55.178', @@ -13136,7 +13136,12 @@ game.broadcast.apply(this,arguments); var args=Array.from(arguments); args.shift(); - func.apply(this,args); + if(typeof func=='string'){ + func=lib.message.client[func]; + } + if(typeof func=='function'){ + func.apply(this,args); + } }, syncState:function(){ var state=null; @@ -23263,7 +23268,7 @@ _status._swipeorigin={ clientX:e.touches[0].clientX, clientY:e.touches[0].clientY, - time:get.currentTime() + time:get.utc() } } }, @@ -23516,7 +23521,7 @@ },500); } else if(_status._swipeorigin&&!_status.paused2&&!_status.mousedragging){ - if(get.currentTime()-_status._swipeorigin.time<500){ + if(get.utc()-_status._swipeorigin.time<500){ var dx=_status._swipeorigin.touches.clientX-_status._swipeorigin.clientX; var dy=_status._swipeorigin.touches.clientY-_status._swipeorigin.clientY; var goswipe=function(action){ @@ -25600,8 +25605,8 @@ return lib.getUTC(new Date())-lib.getUTC(lib.status.date)-lib.status.dateDelayed; } }, - currentTime:function(){ - return lib.getUTC(new Date()); + utc:function(){ + return (new Date()).getTime(); }, evtDistance:function(e1,e2){ return Math.sqrt((e1.x-e2.x)*(e1.x-e2.x)+(e1.y-e2.y)*(e1.y-e2.y));