diff --git a/_server/blockly/MotaAction.g4 b/_server/blockly/MotaAction.g4 index 99783b0b..470e7b10 100644 --- a/_server/blockly/MotaAction.g4 +++ b/_server/blockly/MotaAction.g4 @@ -338,7 +338,7 @@ return code; */; setValue_s - : '变量操作' ':' '名称' idString_e '值' expression Newline + : '变量设置' ':' '名称' idString_e '值' expression Newline /* setValue_s diff --git a/libs/control.js b/libs/control.js index b848ec69..2162ffd2 100644 --- a/libs/control.js +++ b/libs/control.js @@ -2225,6 +2225,7 @@ control.prototype.loadData = function (data, callback) { ////// 设置勇士属性 ////// control.prototype.setStatus = function (statusName, statusVal) { + if (statusName == 'exp') statusName = 'experience'; if (core.isset(core.status.hero.loc[statusName])) core.status.hero.loc[statusName] = statusVal; else @@ -2236,6 +2237,7 @@ control.prototype.getStatus = function (statusName) { // support status:x if (core.isset(core.status.hero.loc[statusName])) return core.status.hero.loc[statusName]; + if (statusName == 'exp') statusName = 'experience'; return core.status.hero[statusName]; } @@ -2446,7 +2448,6 @@ control.prototype.updateStatusBar = function () { core.statusBar.hard.innerHTML = core.status.hard; - // 回放 if (core.status.replay.replaying) { core.statusBar.image.book.src = core.status.replay.pausing?core.statusBar.icons.play.src:core.statusBar.icons.pause.src; diff --git a/libs/enemys.js b/libs/enemys.js index 8cb4b43f..d02cdef3 100644 --- a/libs/enemys.js +++ b/libs/enemys.js @@ -254,13 +254,13 @@ enemys.prototype.getDamageInfo = function(monster, hero_hp, hero_atk, hero_def, mon_atk = hero_atk; mon_def = hero_def; } - // 魔攻 - if (this.hasSpecial(mon_special,2)) hero_def = 0; // 坚固 if (this.hasSpecial(mon_special,3) && mon_def < hero_atk - 1) mon_def = hero_atk - 1; if (hero_atk <= mon_def) return null; // 不可战斗时请直接返回null var per_damage = mon_atk - hero_def; + // 魔攻 + if (this.hasSpecial(mon_special,2)) per_damage = mon_atk; if (per_damage < 0) per_damage = 0; // 2连击 & 3连击 & N连击 diff --git a/libs/events.js b/libs/events.js index b82df54e..3e5d1470 100644 --- a/libs/events.js +++ b/libs/events.js @@ -1082,9 +1082,19 @@ events.prototype.changeFloor = function (floorId, stair, heroLoc, time, callback var floorName = core.status.maps[floorId].name; if (!core.isset(floorName) || floorName=="") floorName=" " core.statusBar.floor.innerHTML = floorName; - if (/^[+-]?\d+$/.test(floorName)) + if (/^[+-]?\d+$/.test(floorName)) { core.statusBar.floor.style.fontStyle = 'italic'; - else core.statusBar.floor.style.fontStyle = 'normal'; + core.statusBar.floor.style.fontSize = '1.1em'; + } + else { + core.statusBar.floor.style.fontStyle = 'normal'; + if (floorName.length<=5) + core.statusBar.floor.style.fontSize = '1.1em'; + else if (floorName.length==6) + core.statusBar.floor.style.fontSize = '0.9em'; + else + core.statusBar.floor.style.fontSize = '0.7em'; + } // 更改BGM if (core.isset(core.floors[floorId].bgm)) { diff --git a/libs/utils.js b/libs/utils.js index 062772ac..71da66d9 100644 --- a/libs/utils.js +++ b/libs/utils.js @@ -631,6 +631,49 @@ utils.prototype.hide = function (obj, speed, callback) { }, speed); } +utils.prototype.export = function (floorIds) { + if (!core.isset(floorIds)) floorIds = [core.status.floorId]; + else if (floorIds=='all') floorIds = core.clone(core.floorIds); + else if (typeof floorIds == 'string') floorIds = [floorIds]; + + var monsterMap = {}; + + // map + var content = floorIds.length+"\n13 13\n\n"; + floorIds.forEach(function (floorId) { + var arr = core.maps.getMapArray(core.status.maps[floorId].blocks); + content += arr.map(function (x) { + // check monster + x.forEach(function (t) { + var block = core.maps.initBlock(null, null, t); + if (core.isset(block.event) && block.event.cls.indexOf("enemy")==0) { + monsterMap[t] = block.event.id; + } + }) + return x.join("\t"); + }).join("\n") + "\n\n"; + }) + + // values + content += ["redJewel", "blueJewel", "greenJewel", "redPotion", "bluePotion", + "yellowPotion", "greenPotion", "sword1", "shield1"].map(function (x) {return core.values[x]}).join(" ") + "\n\n"; + + // monster + content += Object.keys(monsterMap).length + "\n"; + for (var t in monsterMap) { + var id = monsterMap[t], monster = core.material.enemys[id]; + content += t + " " + monster.hp + " " + monster.atk + " " + + monster.def + " " + monster.money + " " + monster.special + "\n"; + } + content += "\n0 0 0 0 0 0\n\n"; + content += core.status.hero.hp + " " + core.status.hero.atk + " " + + core.status.hero.def + " " + core.status.hero.mdef + " " + core.status.hero.money + " " + + core.itemCount('yellowKey') + " " + core.itemCount("blueKey") + " " + core.itemCount("redKey") + " 0 " + + core.status.hero.loc.x + " " + core.status.hero.loc.y + "\n"; + + console.log(content); +} + utils.prototype.http = function (type, url, formData, success, error, mimeType, responseType) { var xhr = new XMLHttpRequest(); xhr.open(type, url, true); diff --git a/styles.css b/styles.css index 2021c874..2cf08287 100644 --- a/styles.css +++ b/styles.css @@ -195,6 +195,7 @@ margin: 0; color: white; font: bold italic 1.1em Verdana; + white-space: nowrap; } #toolBar { position: absolute; diff --git a/更新说明.txt b/更新说明.txt index ef07cf76..8601bc08 100644 --- a/更新说明.txt +++ b/更新说明.txt @@ -1,4 +1,17 @@ -HTML5魔塔样板V2.3.1 +HTML5魔塔样板V2.3.2 + +启动服务的多开版本 √ +怪物数据导出器 +gif播放可随着分辨率自动放缩 √ +状态栏可随文字长度自动调整放缩 √ +也可以用status:exp来代替经验值的写法 √ +破炸在周围只有一个目标时无需转向面对它 √ +道具效果中,无需再将null改成""才能双击编辑了 √ +各个已知Bug的修复,部分细节优化 √ + +----------------------------------------------------------------------- + +HTML5魔塔样板V2.3.1 存档采用高比率压缩,单个大小是原来的1/10! 默认存档数改成100页500个