clear status bar

This commit is contained in:
oc 2018-06-01 23:17:36 +08:00
parent 841e56ee21
commit 543f86642b
14 changed files with 3469 additions and 3479 deletions

1
libs/actions.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -2289,7 +2289,8 @@ control.prototype.playSound = function (sound) {
////// 清空状态栏 ////// ////// 清空状态栏 //////
control.prototype.clearStatusBar = function() { control.prototype.clearStatusBar = function() {
var statusList = ['floor', 'lv', 'hp', 'atk', 'def', 'mdef', 'money', 'experience', 'up', 'yellowKey', 'blueKey', 'redKey', 'poison', 'weak', 'curse', 'hard']; var statusList = ['floor', 'lv', 'hpmax', 'hp', 'atk', 'def', 'mdef', 'money', 'experience',
'up', 'yellowKey', 'blueKey', 'redKey', 'poison', 'weak', 'curse', 'hard'];
statusList.forEach(function (e) { statusList.forEach(function (e) {
core.statusBar[e].innerHTML = " "; core.statusBar[e].innerHTML = " ";
}); });

1
libs/control.min.js vendored

File diff suppressed because one or more lines are too long

1
libs/data.min.js vendored
View File

@ -1 +0,0 @@
function data(){this.init()}data.prototype.init=function(){this.firstData=data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.firstData;this.values=data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.values;this.flags=data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.flags};data.prototype.getFirstData=function(){return core.clone(this.firstData)};

1
libs/enemys.min.js vendored

File diff suppressed because one or more lines are too long

1
libs/events.min.js vendored

File diff suppressed because one or more lines are too long

1
libs/icons.min.js vendored
View File

@ -1 +0,0 @@
function icons(){this.init()}icons.prototype.init=function(){this.icons=icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1};icons.prototype.getIcons=function(){return this.icons};

1
libs/items.min.js vendored
View File

@ -1 +0,0 @@
function items(){this.init()}items.prototype.init=function(){this.items=items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a.items;this.itemEffect=items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a.itemEffect;this.itemEffectTip=items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a.itemEffectTip;this.useItemEffect=items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a.useItemEffect;this.canUseItemEffect=items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a.canUseItemEffect};items.prototype.getItems=function(){return this.items};items.prototype.getItemEffect=function(itemId,itemNum){var itemCls=core.material.items[itemId].cls;if(itemCls==="items"){var ratio=parseInt(core.floors[core.status.floorId].item_ratio)||1;var curr_hp=core.status.hero.hp;if(itemId in this.itemEffect){eval(this.itemEffect[itemId])}core.status.hero.statistics.hp+=core.status.hero.hp-curr_hp}else{core.addItem(itemId,itemNum)}};items.prototype.getItemEffectTip=function(itemId){var itemCls=core.material.items[itemId].cls;if(itemCls==="items"){var ratio=parseInt(core.floors[core.status.floorId].item_ratio)||1;if(itemId in this.itemEffectTip){return eval(this.itemEffectTip[itemId])||""}}return""};items.prototype.useItem=function(itemId,callback){if(!this.canUseItem(itemId)){if(core.isset(callback)){callback()}return}var itemCls=core.material.items[itemId].cls;if(itemId in this.useItemEffect){eval(this.useItemEffect[itemId])}core.updateStatusBar();if(itemId!="book"&&itemId!="fly"){core.status.route.push("item:"+itemId)}if(itemCls=="tools"){core.status.hero.items[itemCls][itemId]--}if(core.status.hero.items[itemCls][itemId]==0){delete core.status.hero.items[itemCls][itemId]}if(core.isset(callback)){callback()}};items.prototype.canUseItem=function(itemId){if(!core.hasItem(itemId)){return false}if(itemId in this.canUseItemEffect){return eval(this.canUseItemEffect[itemId])}return false};items.prototype.itemCount=function(b){if(!core.isset(b)||!core.isset(core.material.items[b])){return 0}var a=core.material.items[b].cls;if(a=="items"){return 0}return core.isset(core.status.hero.items[a][b])?core.status.hero.items[a][b]:0};items.prototype.hasItem=function(a){return core.itemCount(a)>0};items.prototype.setItem=function(b,c){var a=core.material.items[b].cls;if(a=="items"){return}if(!core.isset(core.status.hero.items[a])){core.status.hero.items[a]={}}core.status.hero.items[a][b]=c;if(a!="keys"&&c==0){delete core.status.hero.items[a][b]}};items.prototype.removeItem=function(b){if(!core.hasItem(b)){return false}var a=core.material.items[b].cls;core.status.hero.items[a][b]--;if(a!="keys"&&core.status.hero.items[a][b]==0){delete core.status.hero.items[a][b]}core.updateStatusBar();return true};items.prototype.addItem=function(c,d){var b=core.material.items[c];var a=b.cls;if(a=="items"){return}if(!core.isset(core.status.hero.items[a])){core.status.hero.items[a]={};core.status.hero.items[a][c]=0}else{if(!core.isset(core.status.hero.items[a][c])){core.status.hero.items[a][c]=0}}core.status.hero.items[a][c]+=d};

1
libs/loader.min.js vendored
View File

@ -1 +0,0 @@
function loader(){this.init()}loader.prototype.init=function(){};loader.prototype.setStartProgressVal=function(a){core.dom.startTopProgress.style.width=a+"%"};loader.prototype.setStartLoadTipText=function(a){core.dom.startTopLoadTips.innerHTML=a};loader.prototype.load=function(a){core.loader.loadIcons();core.loader.loadImages(core.materials,core.material.images,function(){core.material.images.images={};var b=core.clone(core.images);if(b.indexOf("hero.png")<0){b.push("hero.png")}core.loader.loadImages(b,core.material.images.images,function(){core.material.images.autotile={};core.loader.loadImages(Object.keys(core.material.icons.autotile),core.material.images.autotile,function(){core.loader.loadAnimates();core.loader.loadMusic();if(core.isset(a)){a()}})})})};loader.prototype.loadIcons=function(){this.loadImage("icons.png",function(a,b){var c=core.cropImage(b);for(var d in core.statusBar.icons){if(typeof core.statusBar.icons[d]=="number"){core.statusBar.icons[d]=c[core.statusBar.icons[d]];if(core.isset(core.statusBar.image[d])){core.statusBar.image[d].src=core.statusBar.icons[d].src}}}})};loader.prototype.loadImages=function(d,f,a){if(d.length==0){if(core.isset(a)){a()}return}var c=0;for(var b=0;b<d.length;b++){this.loadImage(d[b],function(g,h){core.loader.setStartLoadTipText("正在加载图片 "+g+"...");f[g]=h;c++;core.loader.setStartProgressVal(c*(100/d.length));if(c==d.length){if(core.isset(a)){a()}}})}};loader.prototype.loadImage=function(d,a){try{var f=d;if(f.indexOf(".")<0){f=f+".png"}var c=new Image();c.src="project/images/"+f+"?v="+main.version;if(c.complete){a(d,c);return}c.onload=function(){a(d,c)}}catch(b){console.log(b)}};loader.prototype.loadAnimates=function(){core.animates.forEach(function(a){core.http("GET","project/animates/"+a+".animate",null,function(b){try{b=JSON.parse(b);var c={};c.ratio=b.ratio;c.images=[];c.images_rev=[];b.bitmaps.forEach(function(h){if(!core.isset(h)||h==""){c.images.push(null)}else{try{var g=new Image();g.src=h;c.images.push(g)}catch(f){c.images.push(null)}}});c.frame=b.frame_max;c.frames=[];b.frames.forEach(function(g){var f=[];g.forEach(function(h){f.push({index:h[0],x:h[1],y:h[2],zoom:h[3],opacity:h[4],mirror:h[5]||0,angle:h[6]||0,})});c.frames.push(f)});core.material.animates[a]=c}catch(d){console.log(d);core.material.animates[a]=null}},function(b){console.log(b);core.material.animates[a]=null},"text/plain; charset=x-user-defined")})};loader.prototype.loadMusic=function(){core.bgms.forEach(function(b){if(/^.*\.mid$/i.test(b)){if(core.musicStatus.audioContext!=null){core.material.bgms[b]="loading";core.http("GET","project/sounds/"+b,null,function(c){try{var f=[];var g=c.length;for(var i=0;i<g;i++){f[i]=String.fromCharCode(c.charCodeAt(i)&255)}var h=core.material.bgms[b]=="starting";core.material.bgms[b]=AudioPlayer(core.musicStatus.audioContext,Replayer(MidiFile(f.join("")),Synth(44100)),true);if(h){core.playBgm(b)}}catch(d){console.log(d);core.material.bgms[b]=null}},function(c){console.log(c);core.material.bgms[b]=null},"text/plain; charset=x-user-defined")}else{core.material.bgms[b]=null}}else{var a=new Audio();a.preload="none";if(main.bgmRemote){a.src=main.bgmRemoteRoot+core.firstData.name+"/"+b}else{a.src="project/sounds/"+b}a.loop="loop";core.material.bgms[b]=a}});core.sounds.forEach(function(b){if(core.musicStatus.audioContext!=null){core.http("GET","project/sounds/"+b,null,function(c){try{core.musicStatus.audioContext.decodeAudioData(c,function(f){core.material.sounds[b]=f},function(f){console.log(f);core.material.sounds[b]=null})}catch(d){console.log(d);core.material.sounds[b]=null}},function(){console.log(e);core.material.sounds[b]=null},null,"arraybuffer")}else{var a=new Audio();a.src="project/sounds/"+b;core.material.sounds[b]=a}});if(core.musicStatus.startDirectly&&core.bgms.length>0){core.playBgm(core.bgms[0])}};

1
libs/maps.min.js vendored

File diff suppressed because one or more lines are too long

1
libs/ui.min.js vendored

File diff suppressed because one or more lines are too long

1
libs/utils.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@ function main() {
//------------------------ 用户修改内容 ------------------------// //------------------------ 用户修改内容 ------------------------//
this.version = "2.2"; // 游戏版本号如果更改了游戏内容建议修改此version以免造成缓存问题。 this.version = "2.3"; // 游戏版本号如果更改了游戏内容建议修改此version以免造成缓存问题。
this.useCompress = false; // 是否使用压缩文件 this.useCompress = false; // 是否使用压缩文件
// 当你即将发布你的塔时请使用“JS代码压缩工具”将所有js代码进行压缩然后将这里的useCompress改为true。 // 当你即将发布你的塔时请使用“JS代码压缩工具”将所有js代码进行压缩然后将这里的useCompress改为true。

View File

@ -26,7 +26,7 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"firstData" : { "firstData" : {
"title": "魔塔样板", "title": "魔塔样板",
"name": "template", "name": "template",
"version": "Ver 2.2", "version": "Ver 2.3",
"floorId": "sample0", "floorId": "sample0",
"hero": { "hero": {
"name": "阳光", "name": "阳光",