From f6d0aad37534c31c709c34fd519c2414c753f888 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Sun, 22 Jul 2018 15:01:55 +0800 Subject: [PATCH 1/2] V2.3.3 --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 7f6628d2..6b1eb5c6 100644 --- a/README.md +++ b/README.md @@ -61,8 +61,6 @@ HTML5 canvas制作的魔塔样板,支持全平台游戏! ### 2018.7.21 V2.3.3 -HTML5魔塔样板V2.3.3 - * [x] 将怪物特殊属性定义和伤害计算函数移动到脚本编辑中 * [x] 地图编辑器可以使用矩形方式绘制地图 * [x] 瞬间移动可以指定存在事件的点(如怪物、门、楼梯等) From d4bf4ec02989c087e12cb2ba2fdc5b3c4b049f71 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Sun, 22 Jul 2018 15:11:33 +0800 Subject: [PATCH 2/2] V2.3.3 --- libs/core.js | 15 +++++++++++++++ libs/enemys.js | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/libs/core.js b/libs/core.js index 9707a9fb..f199fa24 100644 --- a/libs/core.js +++ b/libs/core.js @@ -764,6 +764,21 @@ core.prototype.updateFg = function () { core.control.updateFg(); } +////// 测试是否拥有某个特殊属性 ////// +core.prototype.hasSpecial = function (special, test) { + return core.enemys.hasSpecial(special, test); +} + +////// 判断能否战斗 ////// +core.prototype.canBattle = function(enemyId) { + return core.enemys.canBattle(enemyId); +} + +////// 获得伤害数值 ////// +core.prototype.getDamage = function(enemy) { + return core.enemys.getDamage(enemy); +} + ////// 获得某个物品的个数 ////// core.prototype.itemCount = function (itemId) { return core.items.itemCount(itemId); diff --git a/libs/enemys.js b/libs/enemys.js index 57a48049..058389a4 100644 --- a/libs/enemys.js +++ b/libs/enemys.js @@ -6,7 +6,7 @@ function enemys() { enemys.prototype.init = function () { this.enemys = enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80; this.enemydata = functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a.enemys; - this.enemydata.hasSpecial = function (a, b) {return core.enemys.hasSpecial(a, b)}; + if (main.mode=='play') this.enemydata.hasSpecial = function (a, b) {return core.enemys.hasSpecial(a, b)}; } ////// 获得一个或所有怪物数据 //////