This commit is contained in:
parent
6269723078
commit
968d8b0ee0
|
@ -36,6 +36,8 @@ card.ex={
|
||||||
content:function(){
|
content:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
player.choosePlayerCard('是否发动【寒冰剑】?','he',trigger.target,Math.min(2,trigger.target.num('he')),function(button){
|
player.choosePlayerCard('是否发动【寒冰剑】?','he',trigger.target,Math.min(2,trigger.target.num('he')),function(button){
|
||||||
|
var trigger=_status.event.getParent()._trigger;
|
||||||
|
var player=_status.event.player;
|
||||||
var eff=ai.get.damageEffect(trigger.target,player,player);
|
var eff=ai.get.damageEffect(trigger.target,player,player);
|
||||||
if(ai.get.attitude(player,trigger.target)>0){
|
if(ai.get.attitude(player,trigger.target)>0){
|
||||||
if(eff>=0) return false;
|
if(eff>=0) return false;
|
||||||
|
@ -43,7 +45,8 @@ card.ex={
|
||||||
}
|
}
|
||||||
if(eff<=0) return ai.get.buttonValue(button);
|
if(eff<=0) return ai.get.buttonValue(button);
|
||||||
if(trigger.target.hp==1) return false;
|
if(trigger.target.hp==1) return false;
|
||||||
if(player.skills.contains('jiu')||player.skills.contains('tianxianjiu')) return false;
|
if(player.skills.contains('jiu')||player.skills.contains('tianxianjiu')||
|
||||||
|
player.skills.contains('luoyi2')||player.skills.contains('reluoyi2')) return false;
|
||||||
if(_status.event.dialog.buttons.length<2) return -1;
|
if(_status.event.dialog.buttons.length<2) return -1;
|
||||||
var num=0;
|
var num=0;
|
||||||
for(var i=0;i<_status.event.dialog.buttons.length;i++){
|
for(var i=0;i<_status.event.dialog.buttons.length;i++){
|
||||||
|
@ -55,7 +58,7 @@ card.ex={
|
||||||
if(result.bool){
|
if(result.bool){
|
||||||
trigger.untrigger();
|
trigger.untrigger();
|
||||||
var cards=[];
|
var cards=[];
|
||||||
for(var i=0;i<result.buttons.length;i++) cards.push(result.buttons[i].link);
|
for(var i=0;i<result.links.length;i++) cards.push(result.links[i]);
|
||||||
player.logSkill('hanbing_skill');
|
player.logSkill('hanbing_skill');
|
||||||
trigger.unhurt=true;
|
trigger.unhurt=true;
|
||||||
trigger.target.discard(cards);
|
trigger.target.discard(cards);
|
||||||
|
|
|
@ -21,13 +21,17 @@ card.extra={
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
target.addSkill('jiu');
|
game.broadcastAll(function(target,card){
|
||||||
if(!player.node.jiu&&lib.config.jiu_effect){
|
target.addSkill('jiu');
|
||||||
player.node.jiu=ui.create.div('.playerjiu',player.node.avatar);
|
if(!target.node.jiu&&lib.config.jiu_effect){
|
||||||
player.node.jiu2=ui.create.div('.playerjiu',player.node.avatar2);
|
target.node.jiu=ui.create.div('.playerjiu',target.node.avatar);
|
||||||
}
|
target.node.jiu2=ui.create.div('.playerjiu',target.node.avatar2);
|
||||||
if(card.clone&&card.clone.parentNode==player.parentNode){
|
}
|
||||||
card.clone.moveDelete(target);
|
if(card.clone&&card.clone.parentNode==target.parentNode){
|
||||||
|
card.clone.moveDelete(target);
|
||||||
|
}
|
||||||
|
},target,card);
|
||||||
|
if(card.clone&&card.clone.parentNode==target.parentNode){
|
||||||
game.addVideo('gain2',target,get.cardsInfo([card]));
|
game.addVideo('gain2',target,get.cardsInfo([card]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,7 +60,7 @@ card.extra={
|
||||||
},
|
},
|
||||||
result:{
|
result:{
|
||||||
target:function(player,target){
|
target:function(player,target){
|
||||||
if(target&&target==_status.dying) return 2;
|
if(target&&target.hp<=0) return 2;
|
||||||
if(lib.config.mode=='stone'&&!player.isMin()){
|
if(lib.config.mode=='stone'&&!player.isMin()){
|
||||||
if(player.getActCount()+1>=player.actcount) return false;
|
if(player.getActCount()+1>=player.actcount) return false;
|
||||||
}
|
}
|
||||||
|
@ -116,16 +120,17 @@ card.extra={
|
||||||
return ai.get.value(card);
|
return ai.get.value(card);
|
||||||
};
|
};
|
||||||
"step 1"
|
"step 1"
|
||||||
event.dialog=ui.create.dialog(get.translation(target.name)+'展示的手牌',result.cards);
|
event.dialog=ui.create.dialog(get.translation(target)+'展示的手牌',result.cards);
|
||||||
event.videoId=lib.status.videoId++;
|
event.videoId=lib.status.videoId++;
|
||||||
game.addVideo('cardDialog',null,[get.translation(target.name)+'展示的手牌',get.cardsInfo(result.cards),event.videoId]);
|
|
||||||
|
game.broadcast('createDialog',event.videoId,get.translation(target)+'展示的手牌',result.cards);
|
||||||
|
game.addVideo('cardDialog',null,[get.translation(target)+'展示的手牌',get.cardsInfo(result.cards),event.videoId]);
|
||||||
event.card2=result.cards[0];
|
event.card2=result.cards[0];
|
||||||
game.log(target,'展示了',event.card2);
|
game.log(target,'展示了',event.card2);
|
||||||
player.chooseToDiscard(function(card){
|
player.chooseToDiscard({suit:get.suit(event.card2)},function(card){
|
||||||
return get.suit(card)==get.suit(_status.event.parent.card2);
|
var evt=_status.event.getParent();
|
||||||
},function(card){
|
if(ai.get.damageEffect(evt.target,evt.player,evt.player,'fire')>0){
|
||||||
if(ai.get.damageEffect(target,player,player,'fire')>0){
|
return 7-ai.get.value(card,evt.player);
|
||||||
return 7-ai.get.value(card,_status.event.player);
|
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}).prompt=false;
|
}).prompt=false;
|
||||||
|
@ -137,8 +142,9 @@ card.extra={
|
||||||
else{
|
else{
|
||||||
target.addTempSkill('huogong2','phaseBegin');
|
target.addTempSkill('huogong2','phaseBegin');
|
||||||
}
|
}
|
||||||
game.addVideo('cardDialog',null,event.videoId);
|
|
||||||
event.dialog.close();
|
event.dialog.close();
|
||||||
|
game.addVideo('cardDialog',null,event.videoId);
|
||||||
|
game.broadcast('closeDialog',event.videoId);
|
||||||
},
|
},
|
||||||
ai:{
|
ai:{
|
||||||
basic:{
|
basic:{
|
||||||
|
@ -367,13 +373,15 @@ card.extra={
|
||||||
popup:false,
|
popup:false,
|
||||||
audio:false,
|
audio:false,
|
||||||
content:function(){
|
content:function(){
|
||||||
player.removeSkill('jiu');
|
game.broadcastAll(function(player){
|
||||||
if(player.node.jiu){
|
player.removeSkill('jiu');
|
||||||
player.node.jiu.delete();
|
if(player.node.jiu){
|
||||||
player.node.jiu2.delete();
|
player.node.jiu.delete();
|
||||||
delete player.node.jiu;
|
player.node.jiu2.delete();
|
||||||
delete player.node.jiu2;
|
delete player.node.jiu;
|
||||||
}
|
delete player.node.jiu2;
|
||||||
|
}
|
||||||
|
},player);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
guding_skill:{
|
guding_skill:{
|
||||||
|
|
|
@ -33,6 +33,22 @@ card.refresh={
|
||||||
},
|
},
|
||||||
discard:false,
|
discard:false,
|
||||||
lose:true,
|
lose:true,
|
||||||
|
sync:function(muniu){
|
||||||
|
if(game.online){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!muniu.cards){
|
||||||
|
muniu.cards=[];
|
||||||
|
}
|
||||||
|
for(var i=0;i<muniu.cards.length;i++){
|
||||||
|
if(!muniu.cards[i].parentNode||muniu.cards[i].parentNode.id!='special'){
|
||||||
|
muniu.cards.splice(i--,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
game.broadcast(function(muniu,cards){
|
||||||
|
muniu.cards=cards;
|
||||||
|
},muniu,muniu.cards);
|
||||||
|
},
|
||||||
filter:function(event,player){
|
filter:function(event,player){
|
||||||
return player.num('h')>0;
|
return player.num('h')>0;
|
||||||
},
|
},
|
||||||
|
@ -54,6 +70,9 @@ card.refresh={
|
||||||
}
|
}
|
||||||
if(muniu.cards==undefined) muniu.cards=[];
|
if(muniu.cards==undefined) muniu.cards=[];
|
||||||
muniu.cards.push(cards[0]);
|
muniu.cards.push(cards[0]);
|
||||||
|
game.broadcast(function(muniu,cards){
|
||||||
|
muniu.cards=cards;
|
||||||
|
},muniu,muniu.cards);
|
||||||
var players=[];
|
var players=[];
|
||||||
for(var i=0;i<game.players.length;i++){
|
for(var i=0;i<game.players.length;i++){
|
||||||
if(!game.players[i].get('e','5')&&game.players[i]!=player&&
|
if(!game.players[i].get('e','5')&&game.players[i]!=player&&
|
||||||
|
@ -64,11 +83,14 @@ card.refresh={
|
||||||
}
|
}
|
||||||
players.sort(lib.sort.seat);
|
players.sort(lib.sort.seat);
|
||||||
var choice=players[0];
|
var choice=players[0];
|
||||||
player.chooseTarget('是否移动木牛流马?',function(card,player,target){
|
var next=player.chooseTarget('是否移动木牛流马?',function(card,player,target){
|
||||||
return !target.isMin()&&player!=target&&!target.get('e','5');
|
return !target.isMin()&&player!=target&&!target.get('e','5');
|
||||||
}).ai=function(target){
|
});
|
||||||
return target==choice?1:-1;
|
next.set('ai',function(target){
|
||||||
};
|
console.log(_status.event.choice);
|
||||||
|
return target==_status.event.choice?1:-1;
|
||||||
|
});
|
||||||
|
next.set('choice',choice);
|
||||||
"step 1"
|
"step 1"
|
||||||
if(result.bool){
|
if(result.bool){
|
||||||
var card=player.get('e','5');
|
var card=player.get('e','5');
|
||||||
|
@ -98,11 +120,7 @@ card.refresh={
|
||||||
if(event.responded) return false;
|
if(event.responded) return false;
|
||||||
var muniu=player.get('e','5');
|
var muniu=player.get('e','5');
|
||||||
if(!muniu.cards) return false;
|
if(!muniu.cards) return false;
|
||||||
for(var i=0;i<muniu.cards.length;i++){
|
lib.skill.muniu_skill.sync(muniu);
|
||||||
if(muniu.cards[i].parentNode.id!='special'){
|
|
||||||
muniu.cards.splice(i,1);i--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for(var i=0;i<muniu.cards.length;i++){
|
for(var i=0;i<muniu.cards.length;i++){
|
||||||
if(event.filterCard(muniu.cards[i])) return true;
|
if(event.filterCard(muniu.cards[i])) return true;
|
||||||
}
|
}
|
||||||
|
@ -135,11 +153,7 @@ card.refresh={
|
||||||
filter:function(event,player){
|
filter:function(event,player){
|
||||||
var muniu=player.get('e','5');
|
var muniu=player.get('e','5');
|
||||||
if(!muniu.cards) return false;
|
if(!muniu.cards) return false;
|
||||||
for(var i=0;i<muniu.cards.length;i++){
|
lib.skill.muniu_skill.sync(muniu);
|
||||||
if(muniu.cards[i].parentNode.id!='special'){
|
|
||||||
muniu.cards.splice(i,1);i--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for(var i=0;i<muniu.cards.length;i++){
|
for(var i=0;i<muniu.cards.length;i++){
|
||||||
if(event.filterCard(muniu.cards[i],player)) return true;
|
if(event.filterCard(muniu.cards[i],player)) return true;
|
||||||
}
|
}
|
||||||
|
@ -210,11 +224,7 @@ card.refresh={
|
||||||
hiddenCard:function(player,name){
|
hiddenCard:function(player,name){
|
||||||
var muniu=player.get('e','5');
|
var muniu=player.get('e','5');
|
||||||
if(!muniu.cards) return false;
|
if(!muniu.cards) return false;
|
||||||
for(var i=0;i<muniu.cards.length;i++){
|
lib.skill.muniu_skill.sync(muniu);
|
||||||
if(muniu.cards[i].parentNode.id!='special'){
|
|
||||||
muniu.cards.splice(i,1);i--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for(var i=0;i<muniu.cards.length;i++){
|
for(var i=0;i<muniu.cards.length;i++){
|
||||||
if(muniu.cards[i].name==name) return true;
|
if(muniu.cards[i].name==name) return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1224,13 +1224,15 @@ card.standard={
|
||||||
content:function(){
|
content:function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
if(player.skills.contains('jiu')){
|
if(player.skills.contains('jiu')){
|
||||||
player.removeSkill('jiu');
|
game.broadcastAll(function(player){
|
||||||
if(player.node.jiu){
|
player.removeSkill('jiu');
|
||||||
player.node.jiu.delete();
|
if(player.node.jiu){
|
||||||
player.node.jiu2.delete();
|
player.node.jiu.delete();
|
||||||
delete player.node.jiu;
|
player.node.jiu2.delete();
|
||||||
delete player.node.jiu2;
|
delete player.node.jiu;
|
||||||
}
|
delete player.node.jiu2;
|
||||||
|
}
|
||||||
|
},player);
|
||||||
event.jiu=true;
|
event.jiu=true;
|
||||||
}
|
}
|
||||||
player.chooseToUse('是否发动青龙偃月刀?',{name:'sha'},trigger.target,-1).logSkill='qinglong';
|
player.chooseToUse('是否发动青龙偃月刀?',{name:'sha'},trigger.target,-1).logSkill='qinglong';
|
||||||
|
@ -1554,9 +1556,11 @@ card.standard={
|
||||||
}
|
}
|
||||||
event.goto(3);
|
event.goto(3);
|
||||||
}
|
}
|
||||||
if(withme||withol){
|
if(_status.connectMode){
|
||||||
for(var i=0;i<game.players.length;i++){
|
if(withme||withol){
|
||||||
game.players[i].showTimer();
|
for(var i=0;i<game.players.length;i++){
|
||||||
|
game.players[i].showTimer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
event.withol=withol;
|
event.withol=withol;
|
||||||
|
|
|
@ -234,8 +234,7 @@ character.refresh={
|
||||||
reluoyi2:{
|
reluoyi2:{
|
||||||
trigger:{source:'damageBegin'},
|
trigger:{source:'damageBegin'},
|
||||||
filter:function(event){
|
filter:function(event){
|
||||||
return event.card&&(event.card.name=='sha'||event.card.name=='juedou')&&
|
return event.card&&(event.card.name=='sha'||event.card.name=='juedou')&&event.notLink();
|
||||||
event.parent.name!='_lianhuan'&&event.parent.name!='_lianhuan2';
|
|
||||||
},
|
},
|
||||||
forced:true,
|
forced:true,
|
||||||
content:function(){
|
content:function(){
|
||||||
|
|
|
@ -101,7 +101,7 @@ character.sp={
|
||||||
if(result.bool){
|
if(result.bool){
|
||||||
player.storage.qizhi++;
|
player.storage.qizhi++;
|
||||||
if(!event.isMine()) game.delay();
|
if(!event.isMine()) game.delay();
|
||||||
player.logSkill('qizh',result.targets);
|
player.logSkill('qizhi',result.targets);
|
||||||
player.discardPlayerCard(result.targets[0],true,'he');
|
player.discardPlayerCard(result.targets[0],true,'he');
|
||||||
event.target=result.targets[0];
|
event.target=result.targets[0];
|
||||||
}
|
}
|
||||||
|
|
|
@ -581,6 +581,7 @@ character.standard={
|
||||||
audio:2,
|
audio:2,
|
||||||
audioname:['liushan'],
|
audioname:['liushan'],
|
||||||
enable:'chooseToUse',
|
enable:'chooseToUse',
|
||||||
|
usable:20,
|
||||||
filter:function(event,player){
|
filter:function(event,player){
|
||||||
if(event.filterCard&&!event.filterCard({name:'sha'},player)) return false;
|
if(event.filterCard&&!event.filterCard({name:'sha'},player)) return false;
|
||||||
if(!player.isZhu) return false;
|
if(!player.isZhu) return false;
|
||||||
|
|
|
@ -733,13 +733,15 @@ character.yijiang={
|
||||||
}
|
}
|
||||||
"step 2"
|
"step 2"
|
||||||
if(player.skills.contains('jiu')){
|
if(player.skills.contains('jiu')){
|
||||||
player.removeSkill('jiu');
|
game.broadcastAll(function(player){
|
||||||
if(player.node.jiu){
|
player.removeSkill('jiu');
|
||||||
player.node.jiu.delete();
|
if(player.node.jiu){
|
||||||
player.node.jiu2.delete();
|
player.node.jiu.delete();
|
||||||
delete player.node.jiu;
|
player.node.jiu2.delete();
|
||||||
delete player.node.jiu2;
|
delete player.node.jiu;
|
||||||
}
|
delete player.node.jiu2;
|
||||||
|
}
|
||||||
|
},player);
|
||||||
event.jiu=true;
|
event.jiu=true;
|
||||||
}
|
}
|
||||||
player.chooseToUse('是否对'+get.translation(trigger.target)+'再使用一张杀?',
|
player.chooseToUse('是否对'+get.translation(trigger.target)+'再使用一张杀?',
|
||||||
|
|
205
game/game.js
205
game/game.js
|
@ -1729,6 +1729,12 @@
|
||||||
restart:true,
|
restart:true,
|
||||||
connect:true
|
connect:true
|
||||||
},
|
},
|
||||||
|
observe:{
|
||||||
|
name:'允许旁观',
|
||||||
|
init:true,
|
||||||
|
frequent:true,
|
||||||
|
connect:true
|
||||||
|
},
|
||||||
double_nei:{
|
double_nei:{
|
||||||
name:'双内奸',
|
name:'双内奸',
|
||||||
init:false,
|
init:false,
|
||||||
|
@ -4423,9 +4429,9 @@
|
||||||
}
|
}
|
||||||
game.log(player,'对',target,'发起拼点');
|
game.log(player,'对',target,'发起拼点');
|
||||||
"step 1"
|
"step 1"
|
||||||
player.wait();
|
|
||||||
target.wait();
|
|
||||||
if(player.isOnline()){
|
if(player.isOnline()){
|
||||||
|
player.wait();
|
||||||
|
event.ol=true;
|
||||||
player.send(function(){
|
player.send(function(){
|
||||||
game.me.chooseCard('请选择拼点牌',true).set('glow_result',true).ai=ai;
|
game.me.chooseCard('请选择拼点牌',true).set('glow_result',true).ai=ai;
|
||||||
game.resume();
|
game.resume();
|
||||||
|
@ -4436,6 +4442,8 @@
|
||||||
player.chooseCard('请选择拼点牌',true).set('glow_result',true).ai=event.ai;
|
player.chooseCard('请选择拼点牌',true).set('glow_result',true).ai=event.ai;
|
||||||
}
|
}
|
||||||
if(target.isOnline()){
|
if(target.isOnline()){
|
||||||
|
target.wait();
|
||||||
|
event.ol=true;
|
||||||
target.send(function(){
|
target.send(function(){
|
||||||
game.me.chooseCard('请选择拼点牌',true).set('glow_result',true).ai=ai;
|
game.me.chooseCard('请选择拼点牌',true).set('glow_result',true).ai=ai;
|
||||||
game.resume();
|
game.resume();
|
||||||
|
@ -4446,22 +4454,22 @@
|
||||||
}
|
}
|
||||||
"step 2"
|
"step 2"
|
||||||
if(event.localPlayer){
|
if(event.localPlayer){
|
||||||
player.unwait(result);
|
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('glow_result',true).ai=event.ai;
|
||||||
}
|
}
|
||||||
"step 3"
|
"step 3"
|
||||||
if(event.localTarget){
|
if(event.localTarget){
|
||||||
target.unwait(result);
|
event.card2=result.cards[0];
|
||||||
}
|
}
|
||||||
if(!event.resultOL){
|
if(!event.resultOL&&event.ol){
|
||||||
game.pause();
|
game.pause();
|
||||||
}
|
}
|
||||||
"step 4"
|
"step 4"
|
||||||
try{
|
try{
|
||||||
event.card1=event.resultOL[player.playerid].cards[0];
|
if(!event.card1) event.card1=event.resultOL[player.playerid].cards[0];
|
||||||
event.card2=event.resultOL[target.playerid].cards[0];
|
if(!event.card2) event.card2=event.resultOL[target.playerid].cards[0];
|
||||||
if(!event.card1||!event.card2){
|
if(!event.card1||!event.card2){
|
||||||
throw('err');
|
throw('err');
|
||||||
}
|
}
|
||||||
|
@ -4553,8 +4561,7 @@
|
||||||
},event.dialogid);
|
},event.dialogid);
|
||||||
game.addVideo('thrownhighlight2');
|
game.addVideo('thrownhighlight2');
|
||||||
if(event.clear!==false){
|
if(event.clear!==false){
|
||||||
ui.clear();
|
game.broadcastAll(ui.clear);
|
||||||
game.broadcast(ui.clear);
|
|
||||||
}
|
}
|
||||||
event.dialog.close();
|
event.dialog.close();
|
||||||
},
|
},
|
||||||
|
@ -5242,7 +5249,7 @@
|
||||||
cardaudio=false;
|
cardaudio=false;
|
||||||
}
|
}
|
||||||
if(cardaudio){
|
if(cardaudio){
|
||||||
var audiofunc=function(player,card){
|
game.broadcastAll(function(player,card){
|
||||||
if(lib.config.background_audio){
|
if(lib.config.background_audio){
|
||||||
var sex=player.sex=='female'?'female':'male';
|
var sex=player.sex=='female'?'female':'male';
|
||||||
if(lib.card[card.name].audio||lib.config.background_ogg){
|
if(lib.card[card.name].audio||lib.config.background_ogg){
|
||||||
|
@ -5257,9 +5264,7 @@
|
||||||
game.playAudio('card/default');
|
game.playAudio('card/default');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
},player,card);
|
||||||
audiofunc(player,card);
|
|
||||||
game.broadcast(audiofunc,player,card);
|
|
||||||
}
|
}
|
||||||
if(event.animate!=false){
|
if(event.animate!=false){
|
||||||
if(card.name=='wuxie'&&event.getParent().target){
|
if(card.name=='wuxie'&&event.getParent().target){
|
||||||
|
@ -5424,8 +5429,7 @@
|
||||||
}
|
}
|
||||||
"step 6"
|
"step 6"
|
||||||
if(event.card.name!='wuxie'){
|
if(event.card.name!='wuxie'){
|
||||||
ui.clear();
|
game.broadcastAll(ui.clear);
|
||||||
game.broadcast(ui.clear);
|
|
||||||
}
|
}
|
||||||
if(ui.tempnowuxie&&ui.tempnowuxie._origin==event){
|
if(ui.tempnowuxie&&ui.tempnowuxie._origin==event){
|
||||||
ui.tempnowuxie.close();
|
ui.tempnowuxie.close();
|
||||||
|
@ -5709,7 +5713,7 @@
|
||||||
player.popup(card.name,'wood');
|
player.popup(card.name,'wood');
|
||||||
}
|
}
|
||||||
if(cardaudio&&event.getParent(3).name=='useCard'){
|
if(cardaudio&&event.getParent(3).name=='useCard'){
|
||||||
var audiofunc=function(player,card){
|
game.broadcastAll(function(player,card){
|
||||||
if(lib.config.background_audio){
|
if(lib.config.background_audio){
|
||||||
var sex=player.sex=='female'?'female':'male';
|
var sex=player.sex=='female'?'female':'male';
|
||||||
if(lib.card[card.name].audio||lib.config.background_ogg){
|
if(lib.card[card.name].audio||lib.config.background_ogg){
|
||||||
|
@ -5719,9 +5723,7 @@
|
||||||
game.playAudio('card/default');
|
game.playAudio('card/default');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},player,card);
|
||||||
audiofunc(player,card);
|
|
||||||
game.broadcast(audiofunc,player,card);
|
|
||||||
}
|
}
|
||||||
if(cards.length&&(cards.length>1||cards[0].name!=card.name)){
|
if(cards.length&&(cards.length>1||cards[0].name!=card.name)){
|
||||||
game.log(player,'打出了',card,'(',cards,')');
|
game.log(player,'打出了',card,'(',cards,')');
|
||||||
|
@ -6169,7 +6171,7 @@
|
||||||
delete player.tempSkills[i];
|
delete player.tempSkills[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
var proc=function(player,cards){
|
game.broadcastAll(function(player,cards){
|
||||||
player.classList.add('dead');
|
player.classList.add('dead');
|
||||||
// player.classList.remove('linked');
|
// player.classList.remove('linked');
|
||||||
player.classList.remove('turnedover');
|
player.classList.remove('turnedover');
|
||||||
|
@ -6196,9 +6198,7 @@
|
||||||
game.playAudio('die',player.name.slice(player.name.indexOf('_')+1));
|
game.playAudio('die',player.name.slice(player.name.indexOf('_')+1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},player,event.cards);
|
||||||
proc(player,event.cards);
|
|
||||||
game.broadcast(proc,player,event.cards);
|
|
||||||
|
|
||||||
if(!_status.connectMode&&player==game.me&&!_status.over&&!game.controlOver){
|
if(!_status.connectMode&&player==game.me&&!_status.over&&!game.controlOver){
|
||||||
ui.control.show();
|
ui.control.show();
|
||||||
|
@ -6337,7 +6337,7 @@
|
||||||
player.judging.unshift(get.cards()[0]);
|
player.judging.unshift(get.cards()[0]);
|
||||||
game.addVideo('judge1',player,[get.cardInfo(player.judging[0]),judgestr,event.videoId]);
|
game.addVideo('judge1',player,[get.cardInfo(player.judging[0]),judgestr,event.videoId]);
|
||||||
|
|
||||||
var create=function(player,card,str,id){
|
game.broadcastAll(function(player,card,str,id){
|
||||||
var event;
|
var event;
|
||||||
if(game.online){
|
if(game.online){
|
||||||
event={};
|
event={};
|
||||||
|
@ -6356,9 +6356,7 @@
|
||||||
event.dialog=ui.create.dialog(str);
|
event.dialog=ui.create.dialog(str);
|
||||||
event.dialog.classList.add('center');
|
event.dialog.classList.add('center');
|
||||||
event.dialog.videoId=id;
|
event.dialog.videoId=id;
|
||||||
}
|
},player,player.judging[0],judgestr,event.videoId);
|
||||||
create(player,player.judging[0],judgestr,event.videoId);
|
|
||||||
game.broadcast(create,player,player.judging[0],judgestr,event.videoId);
|
|
||||||
|
|
||||||
game.log(player,'进行'+event.judgestr+'判定,亮出的判定牌为',player.judging[0]);
|
game.log(player,'进行'+event.judgestr+'判定,亮出的判定牌为',player.judging[0]);
|
||||||
game.delay(2);
|
game.delay(2);
|
||||||
|
@ -6382,8 +6380,7 @@
|
||||||
player.popup('杯具');
|
player.popup('杯具');
|
||||||
}
|
}
|
||||||
if(event.clearArena!=false){
|
if(event.clearArena!=false){
|
||||||
ui.clear();
|
game.broadcastAll(ui.clear);
|
||||||
game.broadcast(ui.clear);
|
|
||||||
}
|
}
|
||||||
game.broadcast(function(id){
|
game.broadcast(function(id){
|
||||||
var dialog=get.idDialog(id);
|
var dialog=get.idDialog(id);
|
||||||
|
@ -6651,13 +6648,13 @@
|
||||||
if(refnode){
|
if(refnode){
|
||||||
lib.placePoppedDialog(dialog,{
|
lib.placePoppedDialog(dialog,{
|
||||||
clientX:ui.arena.offsetLeft+this.offsetLeft+refnode.offsetLeft+refnode.offsetWidth/2,
|
clientX:ui.arena.offsetLeft+this.offsetLeft+refnode.offsetLeft+refnode.offsetWidth/2,
|
||||||
clientY:ui.arena.offsetTop+this.offsetTop+refnode.offsetTop+refnode.offsetHeight*3/4
|
clientY:ui.arena.offsetTop+this.offsetTop+refnode.offsetTop+refnode.offsetHeight/4
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
lib.placePoppedDialog(dialog,{
|
lib.placePoppedDialog(dialog,{
|
||||||
clientX:this.offsetLeft+this.offsetWidth/2,
|
clientX:this.offsetLeft+this.offsetWidth/2,
|
||||||
clientY:this.offsetTop+this.offsetHeight*3/4
|
clientY:this.offsetTop+this.offsetHeight/4
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(dialog._mod_height){
|
if(dialog._mod_height){
|
||||||
|
@ -6666,7 +6663,16 @@
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
dialog.delete();
|
dialog.delete();
|
||||||
},2000);
|
},2000);
|
||||||
lib.chatHistory.push([this,str]);
|
var info=[get.translation(this.name)||this.nickname,str];
|
||||||
|
lib.chatHistory.push(info);
|
||||||
|
if(_status.addChatEntry){
|
||||||
|
if(_status.addChatEntry._origin.parentNode){
|
||||||
|
_status.addChatEntry(info);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
delete _status.addChatEntry;
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
getState:function(){
|
getState:function(){
|
||||||
return {
|
return {
|
||||||
|
@ -10643,6 +10649,11 @@
|
||||||
},
|
},
|
||||||
close:function(){
|
close:function(){
|
||||||
lib.node.clients.remove(this);
|
lib.node.clients.remove(this);
|
||||||
|
lib.node.observing.remove(this);
|
||||||
|
if(ui.removeObserve&&!lib.node.observing.length){
|
||||||
|
ui.removeObserve.remove();
|
||||||
|
delete ui.removeObserve;
|
||||||
|
}
|
||||||
this.closed=true;
|
this.closed=true;
|
||||||
if(_status.waitingForPlayer){
|
if(_status.waitingForPlayer){
|
||||||
for(var i=0;i<game.connectPlayers.length;i++){
|
for(var i=0;i<game.connectPlayers.length;i++){
|
||||||
|
@ -11230,12 +11241,34 @@
|
||||||
}
|
}
|
||||||
else if(version!=lib.versionOL){
|
else if(version!=lib.versionOL){
|
||||||
this.send('denied','version');
|
this.send('denied','version');
|
||||||
|
lib.node.clients.remove(this);
|
||||||
|
this.closed=true;
|
||||||
}
|
}
|
||||||
else if(!_status.waitingForPlayer){
|
else if(!_status.waitingForPlayer){
|
||||||
this.send('denied','gaming');
|
if(game.phaseNumber&&lib.configOL.observe){
|
||||||
|
lib.node.observing.push(this);
|
||||||
|
this.send('reinit',lib.configOL,get.arenaState(),game.getState?game.getState():{},game.ip,game.me.playerid);
|
||||||
|
if(!ui.removeObserve){
|
||||||
|
ui.removeObserve=ui.create.system('移除旁观',function(){
|
||||||
|
lib.configOL.observe=false;
|
||||||
|
while(lib.node.observing.length){
|
||||||
|
lib.node.observing.shift().ws.close();
|
||||||
|
}
|
||||||
|
this.remove();
|
||||||
|
delete ui.removeObserve;
|
||||||
|
},true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.send('denied','gaming');
|
||||||
|
lib.node.clients.remove(this);
|
||||||
|
this.closed=true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(lib.node.clients.length>=parseInt(lib.configOL.number)){
|
else if(lib.node.clients.length>=parseInt(lib.configOL.number)){
|
||||||
this.send('denied','number');
|
this.send('denied','number');
|
||||||
|
lib.node.clients.remove(this);
|
||||||
|
this.closed=true;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if(config){
|
if(config){
|
||||||
|
@ -11267,6 +11300,27 @@
|
||||||
player.unwait(result);
|
player.unwait(result);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
chat:function(id,str){
|
||||||
|
var player;
|
||||||
|
if(lib.playerOL[id]){
|
||||||
|
player=lib.playerOL[id];
|
||||||
|
}
|
||||||
|
else if(game.connectPlayers){
|
||||||
|
for(var i=0;i<game.connectPlayers.length;i++){
|
||||||
|
if(game.connectPlayers[i].playerid==id){
|
||||||
|
player=game.connectPlayers[i];break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(player) lib.element.player.chat.call(player,str);
|
||||||
|
},
|
||||||
|
giveup:function(player){
|
||||||
|
game.log(player,'投降');
|
||||||
|
player.popup('投降');
|
||||||
|
setTimeout(function(){
|
||||||
|
player.die('nosource');
|
||||||
|
},1000);
|
||||||
|
},
|
||||||
auto:function(){
|
auto:function(){
|
||||||
var player=lib.playerOL[this.id];
|
var player=lib.playerOL[this.id];
|
||||||
if(player){
|
if(player){
|
||||||
|
@ -11288,11 +11342,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
exec:function(func){
|
exec:function(func){
|
||||||
if(typeof func=='function'){
|
// if(typeof func=='function'){
|
||||||
var args=Array.from(arguments);
|
// var args=Array.from(arguments);
|
||||||
args.shift();
|
// args.shift();
|
||||||
func.apply(this,args);
|
// func.apply(this,args);
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
client:{
|
client:{
|
||||||
|
@ -11370,7 +11424,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
reinit:function(config,state,state2,ip){
|
reinit:function(config,state,state2,ip,observe){
|
||||||
if(ui.ipnode){
|
if(ui.ipnode){
|
||||||
ui.ipnode.delete();
|
ui.ipnode.delete();
|
||||||
delete ui.ipnode;
|
delete ui.ipnode;
|
||||||
|
@ -11385,6 +11439,9 @@
|
||||||
}
|
}
|
||||||
game.online=true;
|
game.online=true;
|
||||||
game.ip=ip;
|
game.ip=ip;
|
||||||
|
if(observe){
|
||||||
|
game.onlineID=null;
|
||||||
|
}
|
||||||
game.saveConfig('reconnect_info',[_status.ip,game.onlineID]);
|
game.saveConfig('reconnect_info',[_status.ip,game.onlineID]);
|
||||||
_status.connectMode=true;
|
_status.connectMode=true;
|
||||||
lib.configOL=config;
|
lib.configOL=config;
|
||||||
|
@ -11422,9 +11479,15 @@
|
||||||
}
|
}
|
||||||
game.clearArena();
|
game.clearArena();
|
||||||
game.finishCards();
|
game.finishCards();
|
||||||
ui.create.chat();
|
if(!observe) ui.create.chat();
|
||||||
|
else{
|
||||||
|
ui.create.system('退出旁观',function(){
|
||||||
|
game.saveConfig('reconnect_info');
|
||||||
|
game.reload();
|
||||||
|
},true);
|
||||||
|
}
|
||||||
ui.arena.dataset.number=state.number;
|
ui.arena.dataset.number=state.number;
|
||||||
var pos=state.players[game.onlineID].position;
|
var pos=state.players[observe||game.onlineID].position;
|
||||||
for(var i in state.players){
|
for(var i in state.players){
|
||||||
var info=state.players[i];
|
var info=state.players[i];
|
||||||
var player=ui.create.player(ui.arena).animate('start');
|
var player=ui.create.player(ui.arena).animate('start');
|
||||||
|
@ -11450,17 +11513,17 @@
|
||||||
if(info.turnedover){
|
if(info.turnedover){
|
||||||
player.classList.add('turnedover');
|
player.classList.add('turnedover');
|
||||||
}
|
}
|
||||||
if(i==game.onlineID){
|
if(i==observe||i==game.onlineID){
|
||||||
game.me=player;
|
game.me=player;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
player.directgain(info.handcards);
|
player.directgain(info.handcards);
|
||||||
lib.playerOL[i]=player;
|
lib.playerOL[i]=player;
|
||||||
for(var i=0;i<info.equips.length;i++){
|
for(var i=0;i<info.equips.length;i++){
|
||||||
player.$equip(info.equips[i]);
|
player.$equip(info.equips[i]);
|
||||||
}
|
}
|
||||||
for(var i=0;i<info.judges.length;i++){
|
for(var i=0;i<info.judges.length;i++){
|
||||||
player.node.judges.appendChild(info.equips[i]);
|
player.node.judges.appendChild(info.judges[i]);
|
||||||
}
|
}
|
||||||
if(player==game.me||player.identityShown){
|
if(player==game.me||player.identityShown){
|
||||||
player.setIdentity();
|
player.setIdentity();
|
||||||
|
@ -11526,6 +11589,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
closeDialog:function(id){
|
||||||
|
var dialog=get.idDialog(id);
|
||||||
|
if(dialog){
|
||||||
|
dialog.close();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
createDialog:function(id){
|
||||||
|
var args=Array.from(arguments);
|
||||||
|
args.shift();
|
||||||
|
ui.create.dialog.apply(this,args).videoId=id;
|
||||||
|
},
|
||||||
gameStart:function(){
|
gameStart:function(){
|
||||||
for(var i=0;i<game.connectPlayers.length;i++){
|
for(var i=0;i<game.connectPlayers.length;i++){
|
||||||
game.connectPlayers[i].delete();
|
game.connectPlayers[i].delete();
|
||||||
|
@ -11577,6 +11651,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
broadcastAll:function(func){
|
||||||
|
if(game.online) return;
|
||||||
|
game.broadcast.apply(this,arguments);
|
||||||
|
var args=Array.from(arguments);
|
||||||
|
args.shift();
|
||||||
|
func.apply(this,args);
|
||||||
|
},
|
||||||
syncState:function(){
|
syncState:function(){
|
||||||
if(game.getState&&game.updateState){
|
if(game.getState&&game.updateState){
|
||||||
game.broadcast(function(state){
|
game.broadcast(function(state){
|
||||||
|
@ -11717,6 +11798,7 @@
|
||||||
},
|
},
|
||||||
createServer:function(){
|
createServer:function(){
|
||||||
lib.node.clients=[];
|
lib.node.clients=[];
|
||||||
|
lib.node.observing=[];
|
||||||
lib.node.torespond={};
|
lib.node.torespond={};
|
||||||
lib.node.torespondtimeout={};
|
lib.node.torespondtimeout={};
|
||||||
lib.configOL={};
|
lib.configOL={};
|
||||||
|
@ -13996,9 +14078,6 @@
|
||||||
dialog.content.firstChild.innerHTML='战斗失败';
|
dialog.content.firstChild.innerHTML='战斗失败';
|
||||||
}
|
}
|
||||||
ui.update();
|
ui.update();
|
||||||
if(!ui.restart){
|
|
||||||
ui.restart=ui.create.control('restart',game.reload);
|
|
||||||
}
|
|
||||||
if(lib.config.background_audio){
|
if(lib.config.background_audio){
|
||||||
if(result2===true){
|
if(result2===true){
|
||||||
game.playAudio('effect','win');
|
game.playAudio('effect','win');
|
||||||
|
@ -14034,7 +14113,7 @@
|
||||||
if(game.addOverDialog){
|
if(game.addOverDialog){
|
||||||
game.addOverDialog(dialog,result);
|
game.addOverDialog(dialog,result);
|
||||||
}
|
}
|
||||||
if(typeof _status.coin=='number'){
|
if(typeof _status.coin=='number'&&!_status.connectMode){
|
||||||
var coeff=Math.random()*0.4+0.8;
|
var coeff=Math.random()*0.4+0.8;
|
||||||
var added=0;
|
var added=0;
|
||||||
var betWin=false;
|
var betWin=false;
|
||||||
|
@ -16082,14 +16161,9 @@
|
||||||
giveup:function(){
|
giveup:function(){
|
||||||
ui.create.system('投降',function(){
|
ui.create.system('投降',function(){
|
||||||
var player=game.me;
|
var player=game.me;
|
||||||
|
this.remove();
|
||||||
if(game.online){
|
if(game.online){
|
||||||
game.send(function(player){
|
game.send('giveup',player);
|
||||||
game.log(player,'投降');
|
|
||||||
player.popup('投降');
|
|
||||||
setTimeout(function(){
|
|
||||||
player.die('nosource');
|
|
||||||
},1000);
|
|
||||||
},player);
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
game.log(player,'投降');
|
game.log(player,'投降');
|
||||||
|
@ -20715,14 +20789,15 @@
|
||||||
list.innerHTML='';
|
list.innerHTML='';
|
||||||
delete list._chatempty;
|
delete list._chatempty;
|
||||||
}
|
}
|
||||||
var name=get.translation(info[0].name)||info[0].nickname;
|
|
||||||
var node=ui.create.div('.text.chat');
|
var node=ui.create.div('.text.chat');
|
||||||
node.innerHTML=name+': '+info[1];
|
node.innerHTML=info[0]+': '+info[1];
|
||||||
list.appendChild(node);
|
list.appendChild(node);
|
||||||
list.scrollTop=list.scrollHeight;
|
list.scrollTop=list.scrollHeight;
|
||||||
uiintro.style.height=uiintro.content.scrollHeight+'px';
|
uiintro.style.height=uiintro.content.scrollHeight+'px';
|
||||||
if(input) input.value='';
|
if(input) input.value='';
|
||||||
}
|
}
|
||||||
|
_status.addChatEntry=addEntry;
|
||||||
|
_status.addChatEntry._origin=uiintro;
|
||||||
if(lib.chatHistory.length){
|
if(lib.chatHistory.length){
|
||||||
for(var i=0;i<lib.chatHistory.length;i++){
|
for(var i=0;i<lib.chatHistory.length;i++){
|
||||||
addEntry(lib.chatHistory[i]);
|
addEntry(lib.chatHistory[i]);
|
||||||
|
@ -20761,25 +20836,11 @@
|
||||||
}
|
}
|
||||||
if(!player) return;
|
if(!player) return;
|
||||||
if(game.online){
|
if(game.online){
|
||||||
game.send(function(id,str){
|
game.send('chat',game.onlineID,str);
|
||||||
var player;
|
|
||||||
if(lib.playerOL[id]){
|
|
||||||
player=lib.playerOL[id];
|
|
||||||
}
|
|
||||||
else if(game.connectPlayers){
|
|
||||||
for(var i=0;i<game.connectPlayers.length;i++){
|
|
||||||
if(game.connectPlayers[i].playerid==id){
|
|
||||||
player=game.connectPlayers[i];break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(player) lib.element.player.chat.call(player,str);
|
|
||||||
},game.onlineID,str);
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
lib.element.player.chat.call(player,str);
|
lib.element.player.chat.call(player,str);
|
||||||
}
|
}
|
||||||
addEntry([player,str]);
|
|
||||||
}
|
}
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
window.noname_update={
|
window.noname_update={
|
||||||
version:'1.8.2.6',
|
version:'1.8.2.8',
|
||||||
changeLog:[
|
changeLog:[
|
||||||
'聊天功能',
|
'旁观',
|
||||||
'修复界面问题',
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,10 +20,14 @@ mode.identity={
|
||||||
lib.configOL.number=lib.configOL.player_number;
|
lib.configOL.number=lib.configOL.player_number;
|
||||||
}
|
}
|
||||||
lib.configOL.characterPack=['standard'];
|
lib.configOL.characterPack=['standard'];
|
||||||
lib.configOL.cardPack=['standard'];
|
lib.configOL.cardPack=['standard','ex','extra'];
|
||||||
lib.configOL.mode='identity';
|
lib.configOL.mode='identity';
|
||||||
|
var cardPackList=[];
|
||||||
|
for(var i=0;i<lib.configOL.cardPack.length;i++){
|
||||||
|
cardPackList=cardPackList.concat(lib.cardPack[lib.configOL.cardPack[i]]);
|
||||||
|
}
|
||||||
for(var i=0;i<lib.card.list.length;i++){
|
for(var i=0;i<lib.card.list.length;i++){
|
||||||
if(!lib.cardPack.standard.contains(lib.card.list[i][2])){
|
if(!cardPackList.contains(lib.card.list[i][2])){
|
||||||
lib.card.list.splice(i--,1);
|
lib.card.list.splice(i--,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue