fix
This commit is contained in:
parent
7d6234ba61
commit
18fbb2e73c
|
@ -187,55 +187,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
equipSkill:true,
|
||||
direct:true,
|
||||
createDialog:function (player,target,onlylist){
|
||||
var names=[];
|
||||
var list=[];
|
||||
if(target.name&&!target.isUnseen(0)) names.add(target.name);
|
||||
if(target.name1&&!target.isUnseen(0)) names.add(target.name1);
|
||||
if(target.name2&&!target.isUnseen(1)) names.add(target.name2);
|
||||
var pss=player.getSkills();
|
||||
for(var i=0;i<names.length;i++){
|
||||
var info=lib.character[names[i]];
|
||||
if(info){
|
||||
var skills=info[3];
|
||||
for(var j=0;j<skills.length;j++){
|
||||
if(lib.translate[skills[j]+'_info']&&lib.skill[skills[j]]&&
|
||||
!lib.skill[skills[j]].unique&&
|
||||
!pss.contains(skills[j])){
|
||||
list.push(skills[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(onlylist) return list;
|
||||
var dialog=ui.create.dialog('forcebutton');
|
||||
dialog.add('选择获得一项技能');
|
||||
_status.event.list=list;
|
||||
var clickItem=function(){
|
||||
_status.event._result=this.link;
|
||||
if(dialog) dialog.close();
|
||||
_status.imchoosing=false;
|
||||
game.resume();
|
||||
};
|
||||
for(i=0;i<list.length;i++){
|
||||
if(lib.translate[list[i]+'_info']){
|
||||
var translation=get.translation(list[i]);
|
||||
if(translation[0]=='新'&&translation.length==3){
|
||||
translation=translation.slice(1,3);
|
||||
}
|
||||
else{
|
||||
translation=translation.slice(0,2);
|
||||
}
|
||||
var item=dialog.add('<div class="popup pointerdiv" style="width:80%;display:inline-block"><div class="skill">【'+
|
||||
translation+'】</div><div>'+lib.translate[list[i]+'_info']+'</div></div>');
|
||||
item.firstChild.addEventListener('click',clickItem);
|
||||
item.firstChild.link=list[i];
|
||||
}
|
||||
}
|
||||
dialog.add(ui.create.div('.placeholder'));
|
||||
return dialog;
|
||||
},
|
||||
content:function (){
|
||||
content:function(){
|
||||
'step 0'
|
||||
player.chooseTarget(get.prompt2('xuelunyang'),function(card,player,target){
|
||||
var names=[];
|
||||
|
@ -268,46 +220,30 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
|||
event.finish();
|
||||
}
|
||||
'step 2'
|
||||
event.skillai=function(list){
|
||||
return get.max(list,get.skillRank,'item');
|
||||
};
|
||||
if(event.isMine()){
|
||||
event.dialog=lib.skill.xuelunyang.createDialog(player,target);//tianshu
|
||||
event.switchToAuto=function(){
|
||||
event._result=event.skillai(event.list);
|
||||
event.dialog.close();
|
||||
_status.imchoosing=false;
|
||||
game.resume();
|
||||
};
|
||||
_status.imchoosing=true;
|
||||
game.pause();
|
||||
var names=[];
|
||||
var list=[];
|
||||
if(target.name&&!target.isUnseen(0)) names.add(target.name);
|
||||
if(target.name1&&!target.isUnseen(0)) names.add(target.name1);
|
||||
if(target.name2&&!target.isUnseen(1)) names.add(target.name2);
|
||||
var pss=player.getSkills();
|
||||
for(var i=0;i<names.length;i++){
|
||||
var info=lib.character[names[i]];
|
||||
if(info){
|
||||
var skills=info[3];
|
||||
for(var j=0;j<skills.length;j++){
|
||||
if(lib.translate[skills[j]+'_info']&&lib.skill[skills[j]]&&
|
||||
!lib.skill[skills[j]].unique&&
|
||||
!pss.contains(skills[j])){
|
||||
list.push(skills[j]);
|
||||
}
|
||||
else if(event.isOnline()){
|
||||
event.player.send(function(){
|
||||
var event=_status.event;
|
||||
event.skillai=function(list){
|
||||
return get.max(list,get.skillRank,'item');
|
||||
};
|
||||
event.dialog=lib.skill.xuelunyang.createDialog(player,target);//tianshu
|
||||
event.switchToAuto=function(){
|
||||
event._result=event.skillai(event.list);
|
||||
event.dialog.close();
|
||||
_status.imchoosing=false;
|
||||
game.resume();
|
||||
};
|
||||
_status.imchoosing=true;
|
||||
game.pause();
|
||||
})
|
||||
event.player.wait();
|
||||
game.pause();
|
||||
}
|
||||
else{
|
||||
event._result=event.skillai(lib.skill.xuelunyang.createDialog(player,target,true));
|
||||
}
|
||||
}
|
||||
player.chooseControl(list).set('prompt','选择获得一个技能').set('choice',get.max(list,get.skillRank,'item')).set('ai',function(){return _status.event.choice})
|
||||
'step 3'
|
||||
player.addTempSkill(result);
|
||||
player.popup(result);
|
||||
game.log(player,'获得了','【'+get.translation(result)+'】');
|
||||
player.addTempSkill(result.control);
|
||||
player.popup(result.control);
|
||||
game.log(player,'获得了','#g【'+get.translation(result.control)+'】');
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
window.noname_update={
|
||||
version:'1.9.108.4.2',
|
||||
update:'1.9.108.4.1',
|
||||
version:'1.9.108.4.2.1',
|
||||
update:'1.9.108.4.2',
|
||||
changeLog:[
|
||||
'成神阳太、凤千早、七濑留美',
|
||||
'小酒表情包',
|
||||
|
@ -12,7 +12,7 @@ window.noname_update={
|
|||
//'card/gujian.js',
|
||||
//'card/guozhan.js',
|
||||
//'card/gwent.js',
|
||||
//'card/huanlekapai.js',
|
||||
'card/huanlekapai.js',
|
||||
//'card/mtg.js',
|
||||
//'card/sp.js',
|
||||
//'card/standard.js',
|
||||
|
@ -21,7 +21,7 @@ window.noname_update={
|
|||
//'card/yingbian.js',
|
||||
//'card/zhenfa.js',
|
||||
//'card/zhulu.js',
|
||||
'character/diy.js',
|
||||
//'character/diy.js',
|
||||
//'character/extra.js',
|
||||
//'character/hearth.js',
|
||||
//'character/gujian.js',
|
||||
|
@ -31,12 +31,12 @@ window.noname_update={
|
|||
//'character/mtg.js',
|
||||
//'character/old.js',
|
||||
//'character/ow.js',
|
||||
'character/rank.js',
|
||||
//'character/rank.js',
|
||||
//'character/refresh.js',
|
||||
//'character/shenhua.js',
|
||||
'character/sp.js',
|
||||
//'character/sp.js',
|
||||
//'character/sp2.js',
|
||||
'character/tw.js',
|
||||
//'character/tw.js',
|
||||
//'character/standard.js',
|
||||
//'character/swd.js',
|
||||
//'character/xianjian.js',
|
||||
|
@ -47,17 +47,17 @@ window.noname_update={
|
|||
//'layout/default/layout.css',
|
||||
//'layout/default/menu.css',
|
||||
//'layout/nova/layout.css',
|
||||
//'mode/identity.js',
|
||||
'mode/identity.js',
|
||||
//'mode/doudizhu.js',
|
||||
'mode/guozhan.js',
|
||||
//'mode/guozhan.js',
|
||||
//'mode/chess.js',
|
||||
//'mode/tafang.js',
|
||||
'mode/single.js',
|
||||
//'mode/single.js',
|
||||
//'mode/stone.js',
|
||||
//'mode/brawl.js',
|
||||
//'mode/versus.js',
|
||||
//'mode/boss.js',
|
||||
'game/game.js',
|
||||
//'game/game.js',
|
||||
//'game/keyWords.js',
|
||||
//'game/NoSleep.js',
|
||||
//'game/config.js',
|
||||
|
|
|
@ -1964,7 +1964,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
zhu.hp++;
|
||||
zhu.update();
|
||||
}
|
||||
},game.zhu,game.zhu.name,game.zhu.name2,game.players.length>4);
|
||||
},game.zhu,result.links[0],result.links[1],game.players.length>4);
|
||||
|
||||
if(game.zhu.group=='shen'&&!game.zhu.isUnseen(0)){
|
||||
var list=['wei','shu','wu','qun','jin','key'];
|
||||
|
@ -2038,7 +2038,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
result[i]=event.list2.randomRemove(lib.configOL.double_character?2:1);
|
||||
for(var j=0;j<result[i].length;j++){
|
||||
var listx=lib.characterReplace[result[i][j]];
|
||||
if(listx&&listx.length) listc[j]=listx.randomGet();
|
||||
if(listx&&listx.length) result[i][j]=listx.randomGet();
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
@ -2061,22 +2061,41 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
}).set('switchToAuto',function(){
|
||||
_status.event.result='ai';
|
||||
}).set('processAI',function(){
|
||||
var buttons=_status.event.dialog.buttons;
|
||||
return {
|
||||
bool:true,
|
||||
links:buttons.randomGets(1),
|
||||
}
|
||||
return 'ai';
|
||||
});
|
||||
}
|
||||
else event._result={};
|
||||
"step 5"
|
||||
if(!result) result={};
|
||||
for(var i in result){
|
||||
if(result[i]&&result[i].links) result[i]=result[i].links[0][2].slice(6);
|
||||
else if(result[i]=='ai') result[i]=function(){
|
||||
var player=lib.playerOL[i];
|
||||
var list=['wei','shu','wu','qun','jin','key'];
|
||||
for(var i=0;i<list.length;i++){
|
||||
if(!lib.group.contains(list[i])) list.splice(i--,1);
|
||||
}
|
||||
if(_status.mode!='zhong'&&game.zhu&&game.zhu.group){
|
||||
if(['re_zhangjiao','liubei','re_liubei','caocao','re_caocao','sunquan','re_sunquan','zhangjiao','sp_zhangjiao','caopi','re_caopi','liuchen','caorui','sunliang','sunxiu','sunce','re_sunben','ol_liushan','re_liushan','key_akane','dongzhuo','re_dongzhuo','ol_dongzhuo','jin_simashi'].contains(game.zhu.name)) return game.zhu.group;
|
||||
if(game.zhu.name=='yl_yuanshu'){
|
||||
if(player.identity=='zhong') list.remove('qun');
|
||||
else return 'qun';
|
||||
}
|
||||
if(['sunhao','xin_yuanshao','re_yuanshao','re_sunce','ol_yuanshao','yuanshu','jin_simazhao','liubian'].contains(game.zhu.name)){
|
||||
if(player.identity!='zhong') list.remove(game.zhu.group);
|
||||
else return game.zhu.group;
|
||||
}
|
||||
}
|
||||
return list.randomGet();
|
||||
}();
|
||||
}
|
||||
var result2=event.result2;
|
||||
game.broadcast(function(result,result2){
|
||||
for(var i in result){
|
||||
if(!lib.playerOL[i].name){
|
||||
lib.playerOL[i].init(result[i][0],result[i][1]);
|
||||
}
|
||||
if(result2[i]&&result2[i].links) lib.playerOL[i].changeGroup(result2[i].links[0][2].slice(6),false,false);
|
||||
if(result2[i]&&result2[i].length) lib.playerOL[i].changeGroup(result2[i],false,false);
|
||||
}
|
||||
setTimeout(function(){
|
||||
ui.arena.classList.remove('choose-character');
|
||||
|
@ -2087,7 +2106,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
if(!lib.playerOL[i].name){
|
||||
lib.playerOL[i].init(result2[i][0],result2[i][1]);
|
||||
}
|
||||
if(result[i]&&result[i].links) lib.playerOL[i].changeGroup(result[i].links[0][2].slice(6),false,false);
|
||||
if(result[i]&&result[i].length) lib.playerOL[i].changeGroup(result[i],false,false);
|
||||
}
|
||||
|
||||
if(event.special_identity){
|
||||
|
|
Loading…
Reference in New Issue