This commit is contained in:
libccy 2015-10-13 19:15:02 +08:00
parent 2633b00bbc
commit ff8178e793
7 changed files with 293 additions and 30 deletions

View File

@ -5,7 +5,7 @@ character.diy={
diy_feishi:['male','shu',3,['shuaiyan','moshou'],['fullskin']], diy_feishi:['male','shu',3,['shuaiyan','moshou'],['fullskin']],
diy_liuyan:['male','shu',3,['juedao','geju'],['fullskin']], diy_liuyan:['male','shu',3,['juedao','geju'],['fullskin']],
// diy_luxun:['male','wu',3,['shaoying','zonghuo'],['fullskin']], // diy_luxun:['male','wu',3,['shaoying','zonghuo'],['fullskin']],
// diy_yuji:['male','qun',3,['diyguhuo','diychanyuan'],['fullskin']], diy_yuji:['male','qun',3,['diyguhuo','diychanyuan'],['fullskin']],
// diy_zhouyu:['male','wu',3,['jieyan','honglian']], // diy_zhouyu:['male','wu',3,['jieyan','honglian']],
diy_zhouyu:['male','wu',3,['xiongzi','yaliang'],['fullskin']], diy_zhouyu:['male','wu',3,['xiongzi','yaliang'],['fullskin']],
diy_caiwenji:['female','qun',3,['beige','guihan'],['fullskin']], diy_caiwenji:['female','qun',3,['beige','guihan'],['fullskin']],

View File

@ -651,7 +651,7 @@ character.gujian={
player.logSkill('qianjun',targets); player.logSkill('qianjun',targets);
for(var i=0;i<targets.length;i++){ for(var i=0;i<targets.length;i++){
trigger.targets.add(targets[i]); trigger.targets.add(targets[i]);
targets[i].classList.add('selected'); // targets[i].classList.add('selected');
} }
} }
} }

View File

@ -862,7 +862,7 @@ character.mountain={
}, },
group:['huashen1','huashen2'], group:['huashen1','huashen2'],
intro:{ intro:{
content:function(storage){ content:function(storage,player){
var str=''; var str='';
var slist=storage.owned; var slist=storage.owned;
var list=[]; var list=[];
@ -875,7 +875,26 @@ character.mountain={
str+='、'+get.translation(list[i]); str+='、'+get.translation(list[i]);
} }
} }
var skill=player.additionalSkills.huashen;
if(skill){
str+='<p>当前技能:'+get.translation(skill);
}
return str; return str;
},
mark:function(dialog,content,player){
var slist=content.owned;
var list=[];
for(var i in slist){
list.push(i);
}
if(list.length){
dialog.addSmall([list,'character']);
}
var skill=player.additionalSkills.huashen;
if(skill){
dialog.add('<div><div class="skill">【'+get.translation(skill)+
'】</div><div>'+lib.translate[skill+'_info']+'</div></div>');
}
} }
}, },
mark:true mark:true
@ -899,9 +918,9 @@ character.mountain={
} }
} }
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
delete player.storage.huashen.list[game.players[i].name]; player.storage.huashen.list.remove([game.players[i].name]);
delete player.storage.huashen.list[game.players[i].name1]; player.storage.huashen.list.remove([game.players[i].name1]);
delete player.storage.huashen.list[game.players[i].name2]; player.storage.huashen.list.remove([game.players[i].name2]);
} }
player.storage.huashen.unowned=player.storage.huashen.list.slice(0); player.storage.huashen.unowned=player.storage.huashen.list.slice(0);
player.storage.huashen.unowned.sort(lib.sort.random); player.storage.huashen.unowned.sort(lib.sort.random);
@ -926,17 +945,39 @@ character.mountain={
} }
if(event.isMine()){ if(event.isMine()){
event.dialog=ui.create.dialog('选择获得一项技能',[list,'character']); event.dialog=ui.create.dialog('选择获得一项技能',[list,'character']);
event.control=ui.create.control(['cancel']); if(trigger.name=='game'){
event.control=ui.create.control();
}
else{
event.control=ui.create.control(['cancel']);
}
event.clickControl=function(link){ event.clickControl=function(link){
if(link!='cancel'){ if(link!='cancel'){
if(player.storage.huashen.current){ var currentname=event.dialog.querySelector('.selected.button').link;
player.removeSkill(player.storage.huashen.current); var mark=player.marks.huashen;
delete player.storage.huashen.current; if(trigger.name=='game'){
mark.hide();
mark.style.webkitTransform='scale(0.8)';
mark.style.transition='all 0.3s';
setTimeout(function(){
mark.style.transition='all 0s';
ui.refresh(mark);
mark.setBackground(currentname,'character');
if(mark.firstChild){
mark.firstChild.remove();
}
setTimeout(function(){
mark.style.transition='';
mark.show();
mark.style.webkitTransform='';
},50);
},500);
} }
if(!player.skills.contains(link)){ else{
player.storage.huashen.current=link; mark.setBackground(currentname,'character');
} }
player.addSkill(link);
player.additionalSkills.huashen=link;
player.logSkill('huashen2'); player.logSkill('huashen2');
game.log(get.translation(player)+'获得技能'+get.translation(link)); game.log(get.translation(player)+'获得技能'+get.translation(link));
player.popup(link); player.popup(link);
@ -965,7 +1006,12 @@ character.mountain={
event.custom.replace.button=function(button){ event.custom.replace.button=function(button){
if(button.classList.contains('selected')){ if(button.classList.contains('selected')){
button.classList.remove('selected'); button.classList.remove('selected');
event.control.replace(['cancel']); if(trigger.name=='game'){
event.control.style.opacity=0;
}
else{
event.control.replace(['cancel']);
}
} }
else{ else{
for(var i=0;i<event.dialog.buttons.length;i++){ for(var i=0;i<event.dialog.buttons.length;i++){
@ -973,6 +1019,16 @@ character.mountain={
} }
button.classList.add('selected'); button.classList.add('selected');
event.control.replace(slist[button.link]); event.control.replace(slist[button.link]);
if(trigger.name=='game'&&getComputedStyle(event.control).opacity==0){
event.control.style.transition='opacity 0.5s';
ui.refresh(event.control);
event.control.style.opacity=1;
event.control.style.transition='';
ui.refresh(event.control);
}
else{
event.control.style.opacity=1;
}
} }
event.control.custom=event.clickControl; event.control.custom=event.clickControl;
} }
@ -980,7 +1036,12 @@ character.mountain={
for(var i=0;i<event.dialog.buttons.length;i++){ for(var i=0;i<event.dialog.buttons.length;i++){
if(event.dialog.buttons[i].classList.contains('selected')){ if(event.dialog.buttons[i].classList.contains('selected')){
event.dialog.buttons[i].classList.remove('selected'); event.dialog.buttons[i].classList.remove('selected');
event.control.replace(['cancel']); if(trigger.name=='game'){
event.control.style.opacity=0;
}
else{
event.control.replace(['cancel']);
}
event.control.custom=event.clickControl; event.control.custom=event.clickControl;
return; return;
} }

View File

@ -4865,7 +4865,13 @@
if(this.childNodes.length){ if(this.childNodes.length){
var width=0; var width=0;
for(i=0;i<this.childNodes.length;i++) width+=this.childNodes[i].offsetWidth; for(i=0;i<this.childNodes.length;i++) width+=this.childNodes[i].offsetWidth;
this.style.transition='width 0.2s';
ui.refresh(this);
this.style.width=width+'px'; this.style.width=width+'px';
var that=this;
setTimeout(function(){
that.style.transition='';
},200);
} }
return this; return this;
} }
@ -5284,7 +5290,7 @@
linked:['fire','thunder'], linked:['fire','thunder'],
}; };
var game={ var game={
version:0.912, version:1.31,
playAudio:function(){ playAudio:function(){
var str=''; var str='';
for(var i=0;i<arguments.length;i++){ for(var i=0;i<arguments.length;i++){
@ -7449,6 +7455,18 @@
} }
})); }));
for(i=0;i<lib.config.current_mode.length;i++){ for(i=0;i<lib.config.current_mode.length;i++){
if(typeof lib.config.current_mode[i]==='function'){
var result=lib.config.current_mode[i](game,lib,get,ui);
if(typeof result=='string'){
lib.config.current_mode[i]=result;
}
else{
if(get.objtype(result)=='div'){
modeconfig.push(result);
}
continue;
}
}
switch(lib.config.current_mode[i]){ switch(lib.config.current_mode[i]){
case 'difficulty': case 'difficulty':
modeconfig.push(ui.create.switcher('difficulty',['easy','normal','hard'],get.config('difficulty'),ui.click.sidebar.local));break; modeconfig.push(ui.create.switcher('difficulty',['easy','normal','hard'],get.config('difficulty'),ui.click.sidebar.local));break;
@ -7502,9 +7520,6 @@
if(Array.isArray(lib.config.current_mode[i])){ if(Array.isArray(lib.config.current_mode[i])){
modeconfig.push(ui.create.switcher.apply(this,lib.config.current_mode[i])); modeconfig.push(ui.create.switcher.apply(this,lib.config.current_mode[i]));
} }
else if(typeof lib.config.current_mode[i]==='function'){
modeconfig.push(lib.config.current_mode[i](game,lib,get,ui));
}
else{ else{
modeconfig.push(ui.create.div('.placeholder')); modeconfig.push(ui.create.div('.placeholder'));
} }
@ -7518,7 +7533,6 @@
else if(i=='initshow_draw'&&lib.config.current_mode[i]==true){ else if(i=='initshow_draw'&&lib.config.current_mode[i]==true){
} }
} }
if(lib.config.modeconfig){ if(lib.config.modeconfig){
for(i=0;i<modeconfig.length;i++){ for(i=0;i<modeconfig.length;i++){
@ -7553,7 +7567,7 @@
gameconfig.push(ui.hoverhandcardconfig); gameconfig.push(ui.hoverhandcardconfig);
if(!lib.config.hover_all) ui.hoverhandcardconfig.classList.add('disabled'); if(!lib.config.hover_all) ui.hoverhandcardconfig.classList.add('disabled');
gameconfig.push(ui.create.switcher('touchscreen',lib.config.touchscreen,ui.click.sidebar.touchscreen)); gameconfig.push(ui.create.switcher('touchscreen',lib.config.touchscreen,ui.click.sidebar.touchscreen));
gameconfig.push(ui.create.switcher('no_ios_zoom',lib.config.no_ios_zoom,ui.click.sidebar.global)); // gameconfig.push(ui.create.switcher('no_ios_zoom',lib.config.no_ios_zoom,ui.click.sidebar.global));
ui.handcardmousewheel=ui.create.switcher('mousewheel',lib.config.mousewheel,ui.click.sidebar.mousewheel); ui.handcardmousewheel=ui.create.switcher('mousewheel',lib.config.mousewheel,ui.click.sidebar.mousewheel);
if(lib.config.touchscreen) ui.handcardmousewheel.classList.add('disabled'); if(lib.config.touchscreen) ui.handcardmousewheel.classList.add('disabled');
gameconfig.push(ui.handcardmousewheel); gameconfig.push(ui.handcardmousewheel);
@ -7578,7 +7592,7 @@
case '很大':ui.window.style.zoom=1.1;break; case '很大':ui.window.style.zoom=1.1;break;
default:ui.window.style.zoom=1; default:ui.window.style.zoom=1;
} }
if(lib.config.no_ios_zoom){ if(true||lib.config.no_ios_zoom){
var meta=document.createElement('meta'); var meta=document.createElement('meta');
meta.name='viewport'; meta.name='viewport';
meta.content="user-scalable=0"; meta.content="user-scalable=0";
@ -11632,13 +11646,14 @@
this.classList.remove('removing'); this.classList.remove('removing');
return this; return this;
}; };
HTMLDivElement.prototype.setBackground=function(name,type){ HTMLDivElement.prototype.setBackground=function(name,type,ext){
var src; var src;
ext=ext||'.jpg';
if(type){ if(type){
src='image/'+type+'/default/'+name+'.jpg'; src='image/'+type+'/default/'+name+ext;
} }
else{ else{
src='image/'+name+'.jpg'; src='image/'+name+ext;
} }
this.style.backgroundImage="url('"+src+"')"; this.style.backgroundImage="url('"+src+"')";
this.style.backgroundSize="cover"; this.style.backgroundSize="cover";
@ -12130,7 +12145,11 @@
if(character[i].mode&&character[i].mode.contains(lib.config.mode)==false) continue; if(character[i].mode&&character[i].mode.contains(lib.config.mode)==false) continue;
for(j in character[i]){ for(j in character[i]){
if(j=='mode'||j=='forbid') continue; if(j=='mode'||j=='forbid') continue;
if(j=='character'&&!lib.config.characters.contains(i)) continue; if(j=='character'&&!lib.config.characters.contains(i)){
if(lib.config.mode!='chess'||get.config('chess_mode')!='leader'){
continue;
}
}
for(k in character[i][j]){ for(k in character[i][j]){
if(j=='character'){ if(j=='character'){
if(!character[i][j][k][4]){ if(!character[i][j][k][4]){

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -67,7 +67,6 @@ mode.chess={
if(y>=ui.chessheight){ if(y>=ui.chessheight){
y=ui.chessheight-1; y=ui.chessheight-1;
} }
// console.log(x,y);
var pos=y*ui.chesswidth+x; var pos=y*ui.chesswidth+x;
if(!lib.posmap[pos]){ if(!lib.posmap[pos]){
@ -743,7 +742,19 @@ mode.chess={
ui.chess.appendChild(ui.canvas2); ui.chess.appendChild(ui.canvas2);
ui.ctx2=ui.canvas2.getContext('2d'); ui.ctx2=ui.canvas2.getContext('2d');
game.me=ui.create.player(); game.me=ui.create.player();
game.chooseCharacter(); switch(get.config('chess_mode')){
case 'leader':{
game.leaderView();
break;
}
case 'combat':{
game.chooseCharacter();
break;
}
default:{
game.chooseCharacter();
}
}
"step 1" "step 1"
ui.arena.classList.add('chess'); ui.arena.classList.add('chess');
var num=Math.round((_status.mylist.length+_status.enemylist.length)/2); var num=Math.round((_status.mylist.length+_status.enemylist.length)/2);
@ -942,6 +953,12 @@ mode.chess={
p=p.next; p=p.next;
} }
}, },
initLeaderSave:function(save){
game.save(save,{
money:0,
character:[]
});
},
clickChessInfo:function(e){ clickChessInfo:function(e){
if(this.link.isAlive()){ if(this.link.isAlive()){
this.link.chessFocus(); this.link.chessFocus();
@ -953,6 +970,89 @@ mode.chess={
e.stopPropagation(); e.stopPropagation();
} }
}, },
leaderView:function(){
var next=game.createEvent('leaderView',false);
next.content=function(){
'step 0'
game.characterInfo={
free:[
'caocao',
'simayi',
'xiahoudun',
'zhangliao',
'xuzhu',
'guojia',
'zhenji',
'liubei',
'guanyu',
'zhangfei',
'zhugeliang',
'zhaoyun',
'machao',
'huangyueying',
'sunquan',
'ganning',
'lvmeng',
'huanggai',
'zhouyu',
'daqiao',
'luxun',
'sunshangxiang',
'huatuo',
'lvbu',
'diaochan'
],
rare:[
'diy_xuhuang',
'diy_zhenji',
're_huangyueying',
'diy_lukang',
'zhugeliangwolong',
'taishici',
'gjqt_xiayize',
'gjqt_fengqingxue',
'gjqt_fanglansheng',
'gjqt_yuewuyi',
],
epic:[
'diy_caiwenji',
'old_zhonghui',
'diy_zhouyu',
'xunyu',
'gjqt_bailitusu',
'gjqt_aruan',
],
legend:[
'shen_guanyu',
'shen_zhaoyun',
'shen_zhugeliang',
'shen_lvmeng',
'shen_zhouyu',
'shen_simayi',
'shen_caocao',
'shen_lvbu',
],
common:[],
};
for(var i in lib.character){
if(!game.characterInfo.free.contains('i')&&
!game.characterInfo.rare.contains('i')&&
!game.characterInfo.epic.contains('i')&&
!game.characterInfo.legend.contains('i')){
game.characterInfo.common.push(i);
}
}
var save=get.config('chess_leader_save');
if(!save){
save='save1';
}
if(!lib.storage[save]){
game.initLeaderSave(save);
}
game.pause();
'step 1'
}
},
chooseCharacter:function(){ chooseCharacter:function(){
var next=game.createEvent('chooseCharacter',false); var next=game.createEvent('chooseCharacter',false);
next.showConfig=true; next.showConfig=true;
@ -1755,10 +1855,20 @@ mode.chess={
trueColor:"zhu", trueColor:"zhu",
falseColor:"wei", falseColor:"wei",
_chessmove:'移动', _chessmove:'移动',
leader:'统率',
combat:'对阵',
chessscroll_speed_config:'边缘滚动速度', chessscroll_speed_config:'边缘滚动速度',
chess_character_config:'战棋武将', chess_character_config:'战棋武将',
only_chess_character_config:'只用战棋武将', only_chess_character_config:'只用战棋武将',
chess_ordered_config:'指定行动顺序', chess_ordered_config:'指定行动顺序',
chess_mode_config:'游戏模式',
chess_leader_save_config:'选择历程',
chess_leader_clear_config:'清除进度',
save1:'一',
save2:'二',
save3:'三',
save4:'四',
save5:'五',
chess_caocao:'曹操', chess_caocao:'曹操',
chess_xunyu:'荀彧', chess_xunyu:'荀彧',
@ -1814,7 +1924,7 @@ mode.chess={
guanchuan_info:'当你使用杀指定惟一的目标后,可将攻击射线内的其他角色也加入目标', guanchuan_info:'当你使用杀指定惟一的目标后,可将攻击射线内的其他角色也加入目标',
boss_qiangzheng:'强征', boss_qiangzheng:'强征',
boss_qiangzheng_info:'锁定技,回合结束阶段,你获得每个敌方角色的一张手牌', boss_qiangzheng_info:'锁定技,回合结束阶段,你获得每个其他角色的一张手牌',
boss_baolin:'暴凌', boss_baolin:'暴凌',
boss_moyan:'魔焰', boss_moyan:'魔焰',
boss_moyan_info:'锁定技,回合结束阶段,你对场上所有角色造成一点火焰伤害', boss_moyan_info:'锁定技,回合结束阶段,你对场上所有角色造成一点火焰伤害',
@ -1930,8 +2040,78 @@ mode.chess={
'杀死对方阵营的角色可摸一张牌,杀死本方阵营无惩罚<li>'+ '杀死对方阵营的角色可摸一张牌,杀死本方阵营无惩罚<li>'+
'开启指定行动顺序后双方将交替行动在一方行动完毕进行下一轮行动时若其人数比另一方少另一方可指定至多X名角色名摸一张牌X为人数之差' '开启指定行动顺序后双方将交替行动在一方行动完毕进行下一轮行动时若其人数比另一方少另一方可指定至多X名角色名摸一张牌X为人数之差'
}, },
config:['battle_number','ban_weak','free_choose','change_choice', config:[
function(game,lib,get,ui){ function(game,lib,get,ui){
var current=get.config('chess_mode');
if(typeof current!=='string'){
game.saveConfig('chess_mode','combat',true);
current='combat';
}
return ui.create.switcher('chess_mode',['combat','leader'],current,function(){
ui.click.sidebar.local.apply(this,arguments);
window.location.reload();
});
},
function(game,lib,get,ui){
if(get.config('chess_mode')!='leader') return;
var current=get.config('chess_leader_save');
if(typeof current!=='string'){
current='save1';
game.saveConfig('chess_leader_save',current,true);
}
return ui.create.switcher('chess_leader_save',['save1','save2','save3','save4','save5'],current,function(){
ui.click.sidebar.local.apply(this,arguments);
window.location.reload();
});
},
function(game,lib,get,ui){
if(get.config('chess_mode')!='leader') return;
var switcher=ui.create.line('清除进度',function(){
var node=this;
if(node._clearing){
game.save(get.config('chess_leader_save'),null);
window.location.reload();
return;
}
node._clearing=true;
node.innerHTML='单击以确认 (3)';
setTimeout(function(){
node.innerHTML='单击以确认 (2)';
setTimeout(function(){
node.innerHTML='单击以确认 (1)';
setTimeout(function(){
node.innerHTML='清除进度';
delete node._clearing;
},1000);
},1000);
},1000);
});
return switcher;
},
function(){
if(get.config('chess_mode')!='leader'){
return 'battle_number';
}
},
function(){
if(get.config('chess_mode')!='leader'){
return 'ban_weak';
}
},
function(){
if(get.config('chess_mode')!='leader'){
return 'free_choose';
}
},
function(){
if(get.config('chess_mode')!='leader'){
return 'change_choice';
}
},
function(game,lib,get,ui){
if(get.config('chess_mode')=='leader'){
return;
}
var current=get.config('chess_ordered'); var current=get.config('chess_ordered');
if(typeof current!=='boolean'){ if(typeof current!=='boolean'){
game.saveConfig('chess_ordered',true,true); game.saveConfig('chess_ordered',true,true);
@ -1940,6 +2120,9 @@ mode.chess={
return ui.create.switcher('chess_ordered',current,ui.click.sidebar.local2); return ui.create.switcher('chess_ordered',current,ui.click.sidebar.local2);
}, },
function(game,lib,get,ui){ function(game,lib,get,ui){
if(get.config('chess_mode')=='leader'){
return;
}
var current=get.config('chess_character'); var current=get.config('chess_character');
if(typeof current!=='boolean'){ if(typeof current!=='boolean'){
game.saveConfig('chess_character',true,true); game.saveConfig('chess_character',true,true);