This commit is contained in:
libccy 2016-05-07 22:55:53 +08:00
parent 3100e884f2
commit 8b35c49f3c
3 changed files with 55 additions and 27 deletions

View File

@ -1,5 +1,6 @@
'use strict'; 'use strict';
character.sp={ character.sp={
connect:true,
character:{ character:{
yangxiu:['male','wei',3,['jilei','danlao']], yangxiu:['male','wei',3,['jilei','danlao']],
chenlin:['male','wei',3,['bifa','songci']], chenlin:['male','wei',3,['bifa','songci']],

View File

@ -4658,6 +4658,7 @@ character.yijiang={
content:function(){ content:function(){
"step 0" "step 0"
player.chooseControl('jiangchi_less','jiangchi_more','cancel',function(){ player.chooseControl('jiangchi_less','jiangchi_more','cancel',function(){
var player=_status.event.player;
if(player.num('h')>3&&player.num('h','sha')>1){ if(player.num('h')>3&&player.num('h','sha')>1){
return 'jiangchi_less'; return 'jiangchi_less';
} }
@ -5060,41 +5061,61 @@ character.yijiang={
content:function(){ content:function(){
"step 0" "step 0"
event.cards=get.cards(4); event.cards=get.cards(4);
if(event.isMine()==false){ event.videoId=lib.status.videoId++;
event.dialog=ui.create.dialog('称象',event.cards); game.broadcastAll(function(player,id,cards){
game.delay(2); 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('showCards',player,['称象',get.cardsInfo(event.cards)]);
game.addVideo('delay',null,2); game.addVideo('delay',null,2);
"step 1" "step 1"
if(event.dialog) event.dialog.close(); var next=player.chooseButton([0,4]);
var dialog=ui.create.dialog('称象选择任意张点数小于13的牌',event.cards); next.set('dialog',event.videoId);
var next=player.chooseButton([0,4],dialog); next.set('filterButton',function(button){
next.filterButton=function(button){
var num=0 var num=0
for(var i=0;i<ui.selected.buttons.length;i++){ for(var i=0;i<ui.selected.buttons.length;i++){
num+=get.number(ui.selected.buttons[i].link); num+=get.number(ui.selected.buttons[i].link);
} }
return (num+get.number(button.link)<=13); return (num+get.number(button.link)<=13);
} });
next.ai=function(button){ next.set('ai',function(button){
return ai.get.value(button.link,_status.event.player); return ai.get.value(button.link,_status.event.player);
}; });
"step 2" "step 2"
if(result.bool&&result.buttons){ if(result.bool&&result.links){
player.logSkill('chengxiang'); player.logSkill('chengxiang');
var cards2=[]; var cards2=[];
for(var i=0;i<result.buttons.length;i++){ for(var i=0;i<result.links.length;i++){
cards2.push(result.buttons[i].link); cards2.push(result.links[i]);
cards.remove(result.buttons[i].link); cards.remove(result.links[i]);
} }
player.gain(cards2);
player.$gain(cards2);
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
ui.discardPile.appendChild(cards[i]); ui.discardPile.appendChild(cards[i]);
} }
game.delay(2); event.cards2=cards2;
} }
else{
event.finish();
}
var time=1000-(get.utc()-event.time);
if(time>0){
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:{ ai:{
maixie:true, maixie:true,
@ -5129,12 +5150,13 @@ character.yijiang={
"step 0" "step 0"
var next=player.chooseToDiscard('是否发动【仁心】?',{type:'equip'},'he'); var next=player.chooseToDiscard('是否发动【仁心】?',{type:'equip'},'he');
next.logSkill=['renxin',trigger.player]; next.logSkill=['renxin',trigger.player];
next.ai=function(card){ next.set('ai',function(card){
if(ai.get.attitude(player,trigger.player)>3){ var player=_status.event.player;
if(ai.get.attitude(player,_status.event.getTrigger().player)>3){
return 11-ai.get.value(card); return 11-ai.get.value(card);
} }
return -1; return -1;
} });
"step 1" "step 1"
if(result.bool){ if(result.bool){
player.turnOver(); player.turnOver();

View File

@ -52,7 +52,7 @@
}; };
var lib={ var lib={
configprefix:'noname_0.9_', configprefix:'noname_0.9_',
versionOL:7, versionOL:8,
updateURL:localStorage.getItem('noname_update_url')||'http://123.206.55.178/', updateURL:localStorage.getItem('noname_update_url')||'http://123.206.55.178/',
assetURL:'', assetURL:'',
hallURL:'123.206.55.178', hallURL:'123.206.55.178',
@ -13136,7 +13136,12 @@
game.broadcast.apply(this,arguments); game.broadcast.apply(this,arguments);
var args=Array.from(arguments); var args=Array.from(arguments);
args.shift(); 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(){ syncState:function(){
var state=null; var state=null;
@ -23263,7 +23268,7 @@
_status._swipeorigin={ _status._swipeorigin={
clientX:e.touches[0].clientX, clientX:e.touches[0].clientX,
clientY:e.touches[0].clientY, clientY:e.touches[0].clientY,
time:get.currentTime() time:get.utc()
} }
} }
}, },
@ -23516,7 +23521,7 @@
},500); },500);
} }
else if(_status._swipeorigin&&!_status.paused2&&!_status.mousedragging){ 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 dx=_status._swipeorigin.touches.clientX-_status._swipeorigin.clientX;
var dy=_status._swipeorigin.touches.clientY-_status._swipeorigin.clientY; var dy=_status._swipeorigin.touches.clientY-_status._swipeorigin.clientY;
var goswipe=function(action){ var goswipe=function(action){
@ -25600,8 +25605,8 @@
return lib.getUTC(new Date())-lib.getUTC(lib.status.date)-lib.status.dateDelayed; return lib.getUTC(new Date())-lib.getUTC(lib.status.date)-lib.status.dateDelayed;
} }
}, },
currentTime:function(){ utc:function(){
return lib.getUTC(new Date()); return (new Date()).getTime();
}, },
evtDistance:function(e1,e2){ evtDistance:function(e1,e2){
return Math.sqrt((e1.x-e2.x)*(e1.x-e2.x)+(e1.y-e2.y)*(e1.y-e2.y)); return Math.sqrt((e1.x-e2.x)*(e1.x-e2.x)+(e1.y-e2.y)*(e1.y-e2.y));