diff --git a/character/diy.js b/character/diy.js index 0c0282922..6983ed602 100755 --- a/character/diy.js +++ b/character/diy.js @@ -643,7 +643,7 @@ character.diy={ }, }, translate:{ - diy_caocao:'曹操', + // diy_caocao:'曹操', diy_menghuo:'孟获', diy_huangzhong:'黄汉升', diy_xuhuang:'徐公明', diff --git a/game/game.js b/game/game.js index 661aa055c..2b6dd85e1 100755 --- a/game/game.js +++ b/game/game.js @@ -36,6 +36,7 @@ onwash:[], onover:[], arenaReady:[], + packageReady:[], onDB:function(func){ if(lib.db){ func(); @@ -3019,7 +3020,9 @@ } } try{ + _status.extension=game.importedPack.name; game.importedPack.content(cfg); + delete _status.extension; } catch(e){ console.log(e); @@ -11710,6 +11713,61 @@ (triggerevent||_status.event).next.push(next); return next; }, + addCharacter:function(name,info){ + var character=[info.sex,info.group,info.hp,info.skills||[],['db:extension-'+_status.extension+':'+name+'.jpg']]; + if(info.tags){ + character[4]=character[4].concat(info.tags); + } + lib.character[name]=character; + var packname='mode_extension_'+_status.extension; + if(!lib.characterPack[packname]){ + lib.characterPack[packname]={}; + lib.translate[name]=info.translate; + } + lib.characterPack[packname][name]=character; + lib.translate[packname+'_character_config']=_status.extension; + }, + addCard:function(name,info,info2){ + if(info.fullskin){ + info.image='db:extension-'+_status.extension+':'+name+'.png'; + } + else if(info.fullimage){ + info.image='db:extension-'+_status.extension+':'+name+'.jpg'; + } + lib.card[name]=info; + lib.translate[name]=info2.translate; + lib.translate[name+'_info']=info2.description; + if(typeof info2.number=='number'){ + var suits=['heart','spade','diamond','club']; + if(info2.color=='red'){ + suits=['heart','diamond']; + } + else if(info2.color=='black'){ + suits=['club','spade']; + } + for(var i=0;i