diff --git a/character/huicui.js b/character/huicui.js index ec313ad49..3e6569979 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -4,16 +4,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ name:'huicui', connect:true, character:{ - dc_sunchen:['male','wu',4,['dczigu','dczuowei'],['unseen']], + dc_sunchen:['male','wu',4,['dczigu','dczuowei']], dc_zhangmancheng:['male','qun',4,['dclvecheng','dczhongji']], yue_zhoufei:['female','wu',3,['dclingkong','dcxianshu']], - dc_wuban:['male','shu',4,['dcyouzhan'],['clan:陈留吴氏','unseen']], + dc_wuban:['male','shu',4,['dcyouzhan'],['clan:陈留吴氏']], yue_caiwenji:['female','qun',3,['dcshuangjia','dcbeifen']], liuchongluojun:['male','qun',3,['dcminze','dcjini']], yuechen:['male','wei',4,['dcporui','dcgonghu']], zhangkai:['male','qun',4,['dcxiangshu']], gaoxiang:['male','shu',4,['dcchiying']], - yuanyin:['male','qun',3,['dcmoshou','dcyunjiu'],['unseen']], + yuanyin:['male','qun',3,['dcmoshou','dcyunjiu']], dongwan:['female','qun',3,['dcshengdu','dcjieling']], zhangchu:['female','qun',3,['dcjizhong','dcrihui','dcguangshi']], peiyuanshao:['male','qun',4,['dcmoyu']], diff --git a/character/mobile.js b/character/mobile.js index 175af643b..ec2d2677a 100644 --- a/character/mobile.js +++ b/character/mobile.js @@ -32,7 +32,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ baoxin:['male','qun',4,['mutao','yimou'],['character:tw_baoxin','die_audio:tw_baoxin']], jiangji:['male','wei',3,['twjichou','jilun'],['character:tw_jiangji','die_audio:tw_jiangji']], liwei:['male','shu',4,['jiaohua'],['character:tw_liwei','die:tw_liwei']], - laimin:['male','shu',3,['laishou','luanqun'],['unseen']], + laimin:['male','shu',3,['laishou','luanqun']], yj_zhoubuyi:['male','wei',3,['mbhuiyao','mbquesong']], xin_guozhao:['female','wei',3,['yichong','wufei']], xin_zhangyi:['male','shu',4,['xinwurong','shizhi']], diff --git a/character/refresh.js b/character/refresh.js index 340ae47ce..86f73e59e 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -23,10 +23,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ re_xushu:['male','shu',4,['zhuhai','qianxin']], re_lidian:['male','wei',3,['xunxun','xinwangxi']], re_zhongyao:['male','wei',3,['rehuomo','zuoding'],['clan:颍川钟氏']], - xin_zhangliang:['male','qun',4,['rejijun','refangtong'],['unseen']], - re_simalang:['male','wei',3,['requji','rejunbing'],['unseen']], - re_zhugedan:['male','wei',4,['regongao','rejuyi'],['unseen']], - re_caorui:['male','wei',3,['huituo','mingjian','rexingshuai'],['unseen','zhu']], + xin_zhangliang:['male','qun',4,['rejijun','refangtong']], + re_simalang:['male','wei',3,['requji','rejunbing']], + re_zhugedan:['male','wei',4,['regongao','rejuyi']], + re_caorui:['male','wei',3,['huituo','mingjian','rexingshuai'],['zhu']], re_caochong:['male','wei',3,['rechengxiang','renxin']], ol_zhangzhang:['male','wu',3,['olzhijian','olguzheng']], re_jsp_huangyueying:['female','qun',3,['rejiqiao','relinglong']], diff --git a/character/sb.js b/character/sb.js index 9a111cfd9..9bc738517 100644 --- a/character/sb.js +++ b/character/sb.js @@ -38,8 +38,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sb_liubiao:['male','qun',3,['sbzishou','sbzongshi']], sb_zhurong:['female','shu',4,['sblieren','sbjuxiang']], sb_menghuo:['male','shu',4,['sbhuoshou','sbzaiqi']], - sb_yl_luzhi:['male','qun',3,['nzry_mingren','sbzhenliang'],['unseen']], - sb_xiaoqiao:['female','wu',3,['sbtianxiang','xinhongyan'],['unseen']], + sb_yl_luzhi:['male','qun',3,['nzry_mingren','sbzhenliang']], + sb_xiaoqiao:['female','wu',3,['sbtianxiang','xinhongyan']], }, characterSort:{ sb:{ diff --git a/character/sp.js b/character/sp.js index ecaf811c8..8072d2887 100755 --- a/character/sp.js +++ b/character/sp.js @@ -49,7 +49,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ haopu:['male','shu',4,['olzhenying']], ol_mengda:['male','shu',4,['olgoude']], ol_wanglang:['male','wei',3,['gushe','oljici']], - ol_liuyan:['male','qun','4/6',['olpianan','olyinji','olkuisi'],['unseen']], + ol_liuyan:['male','qun','4/6',['olpianan','olyinji','olkuisi']], lushi:['female','qun',3,['olzhuyan','olleijie']], zhangshiping:['male','shu',3,['olhongji','olxinggu']], sunhong:['male','wu',3,['olxianbi','olzenrun']], diff --git a/character/sp2.js b/character/sp2.js index 77763cede..a5ad7518e 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -12,7 +12,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dc_mengda:['male','wei',4,['dclibang','dcwujie']], //dc_fuwan:['male','qun',4,['dcmoukui']], guānning:['male','shu',3,['dcxiuwen','dclongsong']], - sunhuan:['male','wu',4,['dcniji'],['unseen']], + sunhuan:['male','wu',4,['dcniji']], sunlang:['male','shu',4,['dctingxian','dcbenshi']], shiyi:['male','wu',3,['dccuichuan','dczhengxu']], dc_hujinding:['female','shu','3/6',['dcdeshi','dcwuyuan','huaizi']], diff --git a/character/xianding.js b/character/xianding.js index 6ecb8175e..d49cd4745 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -14,7 +14,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ old_huangfusong:['male','qun',4,['xinfenyue']], dc_xiahouba:['male','shu',4,['rebaobian']], dc_daxiaoqiao:['female','wu',3,['dcxingwu','dcluoyan']], - tianshangyi:['female','wei',3,['dcposuo','dcxiaoren'],['unseen']], + tianshangyi:['female','wei',3,['dcposuo','dcxiaoren']], sunlingluan:['female','wu',3,['dclingyue','dcpandi']], dc_wangjun:['male','qun',4,['dctongye','dcchangqu']], zhoubuyi:['male','wei',3,['dcshiji','dcsilun']], diff --git a/game/game.js b/game/game.js index c28bef638..7a252074a 100644 --- a/game/game.js +++ b/game/game.js @@ -8571,14 +8571,42 @@ } else if(modeimage) src=`image/mode/${modeimage}/character/${name}${ext}`; else if(type=='character'&&lib.config.skin[name]&&arguments[2]!='noskin') src=`image/skin/${name}/${lib.config.skin[name]}${ext}`; - else if(type=='character') src=`image/character/${gzbool?'gz_':''}${name}${ext}`; + else if(type=='character'){ + src=`image/character/${gzbool?'gz_':''}${name}${ext}`; + } else src=`image/${type}/${subfolder}/${name}${ext}`; } else src=`image/${name}${ext}`; - this.setBackgroundImage(src); - this.style.backgroundPositionX='center'; - this.style.backgroundSize='cover'; - return this; + return new Promise((resolve,reject)=>{ + const image=new Image(); + image.src=`${lib.assetURL}${src}`; + image.onload=resolve; + if(type=='character') image.onerror=reject; + }).then(()=>{ + this.setBackgroundImage(src); + this.style.backgroundPositionX='center'; + this.style.backgroundSize='cover'; + }).catch(()=>new Promise((resolve,reject)=>{ + const nameinfo=get.character(name); + const sex=nameinfo[0]; + src=`image/character/default_silhouette_${sex}${ext}`; + const image=new Image(); + image.src=`${lib.assetURL}${src}`; + image.onload=()=>resolve(src); + image.onerror=reject; + }).catch(()=>new Promise((resolve,reject)=>{ + const nameinfo=get.character(name); + const sex=nameinfo[0]; + src=`image/character/default_silhouette_${sex=='female'?'female':'male'}${ext}`; + const image=new Image(); + image.src=`${lib.assetURL}${src}`; + image.onload=()=>resolve(src); + image.onerror=reject; + })).then((src)=>{ + this.setBackgroundImage(src); + this.style.backgroundPositionX='center'; + this.style.backgroundSize='cover'; + })); } }); HTMLDivElement.prototype.setBackgroundDB=function(img){ diff --git a/image/character/default_silhouette_female.jpg b/image/character/default_silhouette_female.jpg new file mode 100644 index 000000000..e06f56d1b Binary files /dev/null and b/image/character/default_silhouette_female.jpg differ diff --git a/image/character/default_silhouette_male.jpg b/image/character/default_silhouette_male.jpg new file mode 100644 index 000000000..dd0620d2a Binary files /dev/null and b/image/character/default_silhouette_male.jpg differ