From 054936d0ab080b8f6acca0f14fbfb6b0d3b71a7e Mon Sep 17 00:00:00 2001 From: libccy Date: Thu, 23 Feb 2017 11:22:38 +0800 Subject: [PATCH] 1 --- game/config.js | 1 + game/game.js | 54 +++++++++++++++++++++++++++----------------------- game/update.js | 1 + 3 files changed, 31 insertions(+), 25 deletions(-) diff --git a/game/config.js b/game/config.js index 2fbe9754f..6a901b992 100644 --- a/game/config.js +++ b/game/config.js @@ -79,6 +79,7 @@ window.config={ favouriteCharacter:[], recentCharacter:[], recentIP:[], + alteredSkills:[], theme:'woodden', layout:'mobile', diff --git a/game/game.js b/game/game.js index e867437fc..2f5f5afd9 100644 --- a/game/game.js +++ b/game/game.js @@ -22286,7 +22286,10 @@ finishSkill:function(i){ var j; var mode=get.mode(); - if(lib.translate[i+'_info_'+mode]){ + if(lib.config.alteredSkills.contains(i)){ + lib.translate[i+'_info']=lib.translate[i+'_info_alter']; + } + else if(lib.translate[i+'_info_'+mode]){ lib.translate[i+'_info']=lib.translate[i+'_info_'+mode]; } else if(lib.translate[i+'_info_zhu']&&(mode=='identity'||(mode=='guozhan'&&_status.mode=='four'))){ @@ -22295,32 +22298,33 @@ else if(lib.translate[i+'_info_combat']&&get.is.versus()){ lib.translate[i+'_info']=lib.translate[i+'_info_combat']; } - if(lib.skill[i].forbid&&lib.skill[i].forbid.contains(mode)){ + var info=lib.skill[i]; + if(info.forbid&&info.forbid.contains(mode)){ lib.skill[i]={}; if(lib.translate[i+'_info']){ lib.translate[i+'_info']='此模式下不可用'; } return; } - if(lib.skill[i].mode&&lib.skill[i].mode.contains(mode)==false){ + if(info.mode&&info.mode.contains(mode)==false){ lib.skill[i]={}; if(lib.translate[i+'_info']){ lib.translate[i+'_info']='此模式下不可用'; } return; } - if(lib.skill[i].viewAs){ - if(typeof lib.skill[i].viewAs=='string'){ - lib.skill[i].viewAs={name:lib.skill[i].viewAs}; + if(info.viewAs){ + if(typeof info.viewAs=='string'){ + info.viewAs={name:info.viewAs}; } - if(lib.skill[i].ai==undefined) lib.skill[i].ai={}; - var skill=lib.skill[i].ai; - if(!lib.card[lib.skill[i].viewAs.name]){ + if(!lib.card[info.viewAs.name]){ lib.skill[i]={}; lib.translate[i+'_info']='技能不可用'; return; } - var card=lib.card[lib.skill[i].viewAs.name].ai; + if(info.ai==undefined) info.ai={}; + var skill=info.ai; + var card=lib.card[info.viewAs.name].ai; for(j in card){ if(skill[j]==undefined) skill[j]=card[j]; else if(typeof skill[j]=='object'){ @@ -22330,34 +22334,34 @@ } } } - if(lib.skill[i].inherit){ - var skill=lib.skill[lib.skill[i].inherit]; + if(info.inherit){ + var skill=lib.skill[info.inherit]; for(j in skill){ - if(lib.skill[i][j]==undefined) lib.skill[i][j]=skill[j]; + if(info[j]==undefined) info[j]=skill[j]; } if(lib.translate[i+'_info']==undefined){ - lib.translate[i+'_info']=lib.translate[lib.skill[i].inherit+'_info']; + lib.translate[i+'_info']=lib.translate[info.inherit+'_info']; } } - if(lib.skill[i].subSkill){ - for(var j in lib.skill[i].subSkill){ - lib.skill[i+'_'+j]=lib.skill[i].subSkill[j]; - if(lib.skill[i].subSkill[j].name){ - lib.translate[i+'_'+j]=lib.skill[i].subSkill[j].name; + if(info.subSkill){ + for(var j in info.subSkill){ + lib.skill[i+'_'+j]=info.subSkill[j]; + if(info.subSkill[j].name){ + lib.translate[i+'_'+j]=info.subSkill[j].name; } else{ lib.translate[i+'_'+j]=lib.translate[i]; } - if(lib.skill[i].subSkill[j].description){ - lib.translate[i+'_'+j+'_info']=lib.skill[i].subSkill[j].description; + if(info.subSkill[j].description){ + lib.translate[i+'_'+j+'_info']=info.subSkill[j].description; } - if(lib.skill[i].subSkill[j].marktext){ - lib.translate[i+'_'+j+'_bg']=lib.skill[i].subSkill[j].marktext; + if(info.subSkill[j].marktext){ + lib.translate[i+'_'+j+'_bg']=info.subSkill[j].marktext; } } } - if(lib.skill[i].marktext){ - lib.translate[i+'_bg']=lib.skill[i].marktext; + if(info.marktext){ + lib.translate[i+'_bg']=info.marktext; } if(i[0]=='_'){ game.addGlobalSkill(i); diff --git a/game/update.js b/game/update.js index 53ebb6c1d..6f5b9b260 100644 --- a/game/update.js +++ b/game/update.js @@ -6,6 +6,7 @@ window.noname_update={ ], files:[ 'game/game.js', + 'game/config.js', // 'game/asset.js', // 'card/*', 'character/rank.js',