From 58f7e36c3bfab689ef093c1647591c04e279ff09 Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Thu, 28 Dec 2017 11:50:25 +0800 Subject: [PATCH 01/12] Update main.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 可以选择不监听事件,给GUI调用提供可能性 --- index.html | 1 + main.js | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 44c759a0..fa25ac90 100644 --- a/index.html +++ b/index.html @@ -113,5 +113,6 @@ 此浏览器不支持HTML5 + \ No newline at end of file diff --git a/main.js b/main.js index fe644e79..b9891a99 100644 --- a/main.js +++ b/main.js @@ -195,8 +195,9 @@ main.prototype.setMainTipsText = function (text) { main.dom.mainTips.innerHTML = text; } -var main = new main(); -main.init(); + + +main.prototype.listen = function () { window.onresize = function () { try { @@ -366,3 +367,7 @@ main.dom.normalLevel.onclick = function () { main.dom.hardLevel.onclick = function () { core.events.startGame('Hard'); } + +}//listen end + +var main = new main(); \ No newline at end of file From 8873991004740c3fe9e9adc47dbecfa5fa116cc0 Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Thu, 28 Dec 2017 16:19:38 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E6=95=B0=E6=8D=AEjson=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- drawMapGUI.html | 3 +- libs/data.js | 166 +------------------------------ libs/enemys.js | 64 +----------- libs/floors/data.js | 175 +++++++++++++++++++++++++++++++++ libs/floors/enemys.js | 63 ++++++++++++ libs/floors/icons.js | 215 ++++++++++++++++++++++++++++++++++++++++ libs/floors/items.js | 113 +++++++++++++++++++++ libs/floors/maps.js | 194 ++++++++++++++++++++++++++++++++++++ libs/floors/sample0.js | 2 +- libs/floors/sample1.js | 4 +- libs/icons.js | 216 +---------------------------------------- libs/items.js | 111 ++------------------- libs/maps.js | 197 +------------------------------------ main.js | 54 +++++++---- 14 files changed, 817 insertions(+), 760 deletions(-) create mode 100644 libs/floors/data.js create mode 100644 libs/floors/enemys.js create mode 100644 libs/floors/icons.js create mode 100644 libs/floors/items.js create mode 100644 libs/floors/maps.js diff --git a/drawMapGUI.html b/drawMapGUI.html index 663d824e..7b2fcad2 100644 --- a/drawMapGUI.html +++ b/drawMapGUI.html @@ -420,7 +420,7 @@ editor.prototype.init = function() { editor.prototype.loadMod = function (callback) { main={'instance':{}}; var loadedNum=0; - ['libs/icons.js','libs/maps.js'].forEach( function (value,ii,aa) { + ['libs/floors/icons.js','libs/floors/maps.js','libs/icons.js','libs/maps.js'].forEach( function (value,ii,aa) { var script = document.createElement('script'); script.src = value + '?' + editor.version; document.body.appendChild(script); @@ -435,6 +435,7 @@ editor.prototype.loadMod = function (callback) { editor.prototype.afterLoadMod = function (callback) { main.instance.icons.init(); + main.instance.maps.init(); var icons=main.instance.icons.getIcons(); editor.ids = []; diff --git a/libs/data.js b/libs/data.js index d8ad6961..1e68480b 100644 --- a/libs/data.js +++ b/libs/data.js @@ -3,168 +3,10 @@ function data() { } data.prototype.init = function() { - this.firstData = { - "title": "魔塔样板", // 游戏名,将显示在标题页面以及切换楼层的界面中 - "name": "template", // 游戏的唯一英文标识符。由英文、数字、下划线组成,不能超过20个字符。 - "version": "Ver 1.0.0 (Beta)", // 当前游戏版本;版本不一致的存档不能通用。 - "floorId": "sample0", // 初始楼层ID - "hero": { // 勇士初始数据 - "name": "阳光", // 勇士名;可以改成喜欢的 - 'lv': 1, // 初始等级,该项必须为正整数 - "hp": 1000, // 初始生命值 - "atk": 100, // 初始攻击 - "def": 100, // 初始防御 - "mdef": 100, // 初始魔防 - "money": 100, // 初始金币 - "experience": 0, // 初始经验 - "items": { // 初始道具个数 - "keys": { - "yellowKey": 0, - "blueKey": 0, - "redKey": 0 - }, - "constants": {}, - "tools": {} - }, - "flyRange": [], // 初始可飞的楼层;一般留空数组即可 - "loc": {"direction": "up", "x": 6, "y": 10}, // 勇士初始位置 - "flags": { // 游戏过程中的变量或flags - "poison": false, // 毒 - "weak": false, // 衰 - "curse": false, // 咒 - } - }, - "startText": [ // 游戏开始前剧情。如果无剧情直接留一个空数组即可。 - "Hi,欢迎来到 HTML5 魔塔样板!\n\n本样板由艾之葵制作,可以让你在不会写任何代码\n的情况下也能做出属于自己的H5魔塔!", - "这里游戏开始时的剧情。\n定义在data.js的startText处。\n\n你可以在这里写上自己的内容。", - "赶快来试一试吧!" - ], - "shops": { // 定义全局商店(即快捷商店) - "moneyShop1": { // 商店唯一ID - "name": "贪婪之神", // 商店名称(标题) - "icon": "blueShop", // 商店图标,blueShop为蓝色商店,pinkShop为粉色商店 - "textInList": "1F金币商店", // 在快捷商店栏中显示的名称 - "use": "money", // 商店所要使用的。只能是"money"或"experience"。 - "need": "20+10*times*(times+1)", // 商店需要的金币/经验数值;可以是一个表达式,以times作为参数计算。 - // 这里用到的times为该商店的已经的访问次数。首次访问该商店时times的值为0。 - // 上面的例子是50层商店的计算公式。你也可以写任意其他的计算公式,只要以times作为参数即可。 - // 例如: "need": "25" 就是恒定需要25金币的商店; "need": "20+2*times" 就是第一次访问要20金币,以后每次递增2金币的商店。 - // 如果是对于每个选项有不同的计算公式,写 "need": "-1" 即可。可参见下面的经验商店。 - "text": "勇敢的武士啊,给我${need}金币就可以:", // 显示的文字,需手动加换行符。可以使用${need}表示上面的need值。 - "choices": [ // 商店的选项 - {"text": "生命+800", "effect": "status:hp+=800"}, - // 如果有多个effect以分号分开,参见下面的经验商店 - {"text": "攻击+4", "effect": "status:atk+=4"}, - {"text": "防御+4", "effect": "status:def+=4"}, - {"text": "魔防+10", "effect": "status:mdef+=10"} - // effect只能对status和item进行操作,不能修改flag值。 - // 必须是X+=Y的形式,其中Y可以是一个表达式,以status:xxx或item:xxx为参数 - // 其他effect样例: - // "item:yellowKey+=1" 黄钥匙+1 - // "item:pickaxe+=3" 破墙镐+3 - // "status:hp+=2*(status:atk+status:def)" 将生命提升攻防和的数值的两倍 - ] - }, - "expShop1": { // 商店唯一ID - "name": "经验之神", - "icon": "pinkShop", - "textInList": "1F经验商店", - "use": "experience", // 该商店使用的是经验进行计算 - "need": "-1", // 如果是对于每个选项所需要的数值不同,这里直接写-1,然后下面选项里给定具体数值 - "text": "勇敢的武士啊,给我若干经验就可以:", - "choices": [ - // 在choices中写need,可以针对每个选项都有不同的需求。 - // 这里的need同样可以以times作为参数,比如 "need": "100+20*times" - {"text": "等级+1", "need": "100", "effect": "status:lv+=1;status:hp+=1000;status:atk+=7;status:def+=7"}, - // 多个effect直接以分号分开即可。如上面的意思是生命+1000,攻击+7,防御+7。 - {"text": "攻击+5", "need": "30", "effect": "status:atk+=5"}, - {"text": "防御+5", "need": "30", "effect": "status:def+=5"}, - ] - }, - }, - "levelUp": [ // 经验升级所需要的数值,是一个数组 - {}, // 第一项为初始等级,可以简单留空,也可以写name - - // 每一个里面可以含有三个参数 name, need, effect - // need为所需要的经验数值,是一个正整数。请确保need所需的依次递增 - // name为该等级的名称,也可以省略代表使用系统默认值;本项将显示在状态栏中 - // effect为本次升级所执行的操作,可由若干项组成,由分号分开 - // 其中每一项写法和上面的商店完全相同,同样必须是X+=Y的形式,Y是一个表达式,同样可以使用status:xxx或item:xxx代表勇士的某项数值/道具个数 - {"need": 20, "name": "第二级", "effect": "status:hp+=2*(status:atk+status:def);status:atk+=10;status:def+=10"}, // 先将生命提升攻防和的2倍;再将攻击+10,防御+10 - - // effect也允许写一个function,代表本次升级将会执行的操作 - {"need": 40, "effect": function () { - core.drawText("恭喜升级!"); - core.status.hero.hp *= 2; - core.status.hero.atk += 100; - core.status.hero.def += 100; - }}, - - // 依次往下写需要的数值即可 - ] - } - // 各种数值;一些数值可以在这里设置 - this.values = { - /****** 角色相关 ******/ - "HPMAX": 999999, // HP上限;-1则无上限 - "lavaDamage": 100, // 经过血网受到的伤害 - "poisonDamage": 10, // 中毒后每步受到的伤害 - "weakValue": 20, // 衰弱状态下攻防减少的数值 - /****** 道具相关 ******/ - "redJewel": 3, // 红宝石加攻击的数值 - "blueJewel": 3, // 蓝宝石加防御的数值 - "greenJewel": 5, // 绿宝石加魔防的数值 - "redPotion": 100, // 红血瓶加血数值 - "bluePotion": 250, // 蓝血瓶加血数值 - "yellowPotion": 500, // 黄血瓶加血数值 - "greenPotion": 800, // 绿血瓶加血数值 - "sword1": 10, // 铁剑加攻数值 - "shield1": 10, // 铁盾加防数值 - "sword2": 20, // 银剑加攻数值 - "shield2": 20, // 银盾加防数值 - "sword3": 40, // 骑士剑加攻数值 - "shield3": 40, // 骑士盾加防数值 - "sword4": 80, // 圣剑加攻数值 - "shield4": 80, // 圣盾加防数值 - "sword5": 160, // 神圣剑加攻数值 - "shield5": 160, // 神圣盾加防数值 - "moneyPocket": 500, // 金钱袋加金币的数值 - /****** 怪物相关 ******/ - 'breakArmor': 0.9, // 破甲的比例(战斗前,怪物附加角色防御的x%作为伤害) - 'counterAttack': 0.1, // 反击的比例(战斗时,怪物每回合附加角色攻击的x%作为伤害,无视角色防御) - 'purify': 3, // 净化的比例(战斗前,怪物附加勇士魔防的x倍作为伤害) - 'hatred': 2, // 仇恨属性中,每杀死一个怪物获得的仇恨值 - /****** 系统相关 ******/ - 'animateSpeed': 500, // 动画时间 - } - // 系统FLAG,在游戏运行中中请不要修改它。 - this.flags = { - /****** 角色状态相关 ******/ - "enableNegativeDamage": true, // 是否支持负伤害(回血) - "enableFloor": false, // 是否在状态栏显示当前楼层 - "enableLv": true, // 是否在状态栏显示当前等级 - "enableMDef": true, // 是否在状态栏及战斗界面显示魔防(护盾) - "enableMoney": true, // 是否在状态栏、怪物手册及战斗界面显示金币 - "enableExperience": true, // 是否在状态栏、怪物手册及战斗界面显示经验 - "enableLevelUp": false, // 是否允许等级提升(进阶);如果上面enableExperience为false,则此项恒视为false - "enableDebuff": true, // 是否涉及毒衰咒;如果此项为false则不会在状态栏中显示毒衰咒的debuff - ////// 上述的几个开关将直接影响状态栏的显示效果 ////// - /****** 道具相关 ******/ - "flyNearStair": true, // 是否需要在楼梯边使用传送器 - "pickaxeFourDirections": true, // 使用破墙镐是否四个方向都破坏;如果false则只破坏面前的墙壁 - "bombFourDirections": true, // 使用炸弹是否四个方向都会炸;如果false则只炸面前的怪物(即和圣锤等价) - "bigKeyIsBox": false, // 如果此项为true,则视为钥匙盒,红黄蓝钥匙+1;若为false,则视为大黄门钥匙 - /****** 系统相关 ******/ - "startDirectly": false, // 点击“开始游戏”后是否立刻开始游戏而不显示难度选择界面 - "canOpenBattleAnimate": true, // 是否允许用户开启战斗过程;如果此项为false,则下面两项均强制视为false - "showBattleAnimateConfirm": true, // 是否在游戏开始时提供“是否开启战斗动画”的选项 - "battleAnimate": true, // 是否默认显示战斗动画;用户可以手动在菜单栏中开关 - "displayEnemyDamage": true, // 是否地图怪物显伤;用户可以手动在菜单栏中开关 - "displayExtraDamage": false, // 是否地图高级显伤(领域、夹击等);用户可以手动在菜单栏中开关 - "enableGentleClick": true, // 是否允许轻触(获得面前物品) - "portalWithoutTrigger": true, // 经过楼梯、传送门时是否能“穿透”。穿透的意思是,自动寻路得到的的路径中间经过了楼梯,行走时是否触发楼层转换事件 - "potionWhileRouting": false, // 寻路算法是否经过血瓶;如果该项为false,则寻路算法会自动尽量绕过血瓶 - } + 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; + delete(data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d); } data.prototype.getFirstData = function() { diff --git a/libs/enemys.js b/libs/enemys.js index f236d68d..56b4de1c 100644 --- a/libs/enemys.js +++ b/libs/enemys.js @@ -4,68 +4,8 @@ function enemys() { enemys.prototype.init = function () { // 怪物属性初始化定义: - this.enemys = { - 'greenSlime': {'name': '绿头怪', 'hp': 100, 'atk': 120, 'def': 0, 'money': 1, 'experience': 1, 'special': 0}, - 'redSlime': {'name': '红头怪', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'blackSlime': {'name': '青头怪', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'slimelord': {'name': '怪王', 'hp': 100, 'atk': 120, 'def': 0, 'money': 10, 'experience': 0, 'special': 9}, - 'bat': {'name': '小蝙蝠', 'hp': 100, 'atk': 120, 'def': 0, 'money': 2, 'experience': 0, 'special': 1}, - 'bigBat': {'name': '大蝙蝠', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'redBat': {'name': '红蝙蝠', 'hp': 100, 'atk': 120, 'def': 0, 'money': 5, 'experience': 0, 'special': 4}, - 'vampire': {'name': '冥灵魔王', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'skeleton': {'name': '骷髅人', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'skeletonSoilder': {'name': '骷髅士兵', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'skeletonCaptain': {'name': '骷髅队长', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'ghostSkeleton': {'name': '冥队长', 'hp': 100, 'atk': 120, 'def': 0, 'money': 8, 'experience': 0, 'special': 7}, - 'zombie': {'name': '兽人', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'zombieKnight': {'name': '兽人武士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'rock': {'name': '石头人', 'hp': 100, 'atk': 120, 'def': 0, 'money': 4, 'experience': 0, 'special': 3}, - 'slimeMan': {'name': '影子战士', 'hp': 100, 'atk': 0, 'def': 0, 'money': 11, 'experience': 0, 'special': 10}, // 模仿怪的攻防设为0就好 - 'bluePriest': {'name': '初级法师', 'hp': 100, 'atk': 120, 'def': 0, 'money': 3, 'experience': 0, 'special': 2}, - 'redPriest': {'name': '高级法师', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'brownWizard': {'name': '初级巫师', 'hp': 100, 'atk': 120, 'def': 0, 'money': 16, 'experience': 0, 'special': 15, 'value': 100}, // 领域怪需要加value表示领域伤害的数值 - 'redWizard': {'name': '高级巫师', 'hp': 1000, 'atk': 1200, 'def': 0, 'money': 160, 'experience': 0, 'special': 15, 'value': 200}, - 'yellowGuard': {'name': '初级卫兵', 'hp': 100, 'atk': 120, 'def': 0, 'money': 10, 'experience': 0, 'special': 0}, - 'blueGuard': {'name': '中级卫兵', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'redGuard': {'name': '高级卫兵', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'swordsman': {'name': '双手剑士', 'hp': 100, 'atk': 120, 'def': 0, 'money': 6, 'experience': 0, 'special': 5}, - 'soldier': {'name': '冥战士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'yellowKnight': {'name': '金骑士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'redKnight': {'name': '红骑士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'darkKnight': {'name': '黑骑士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'blackKing': {'name': '黑衣魔王', 'hp': 1000, 'atk': 500, 'def': 0, 'money': 1000, 'experience': 1000, 'special': 0, 'bomb': false}, // 加入 'bomb': false 代表该怪物不可被炸弹或圣锤炸掉 - 'yellowKing': {'name': '黄衣魔王', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'greenKing': {'name': '青衣武士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'blueKnight': {'name': '蓝骑士', 'hp': 100, 'atk': 120, 'def': 0, 'money': 9, 'experience': 0, 'special': 8}, - 'goldSlime': {'name': '黄头怪', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'poisonSkeleton': {'name': '紫骷髅', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'poisonBat': {'name': '紫蝙蝠', 'hp': 100, 'atk': 120, 'def': 0, 'money': 14, 'experience': 0, 'special': 13}, - 'steelRock': {'name': '铁面人', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'skeletonPriest': {'name': '骷髅法师', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'skeletonKing': {'name': '骷髅王', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'skeletonWizard': {'name': '骷髅巫师', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'redSkeletonCaption': {'name': '骷髅武士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'special': 0}, - 'badHero': {'name': '迷失勇者', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'demon': {'name': '魔神武士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'demonPriest': {'name': '魔神法师', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'goldHornSlime': {'name': '金角怪', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'redKing': {'name': '红衣魔王', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'whiteKing': {'name': '白衣武士', 'hp': 100, 'atk': 120, 'def': 0, 'money': 17, 'experience': 0, 'special': 16}, - 'blackMagician': {'name': '黑暗大法师', 'hp': 100, 'atk': 120, 'def': 0, 'money': 12, 'experience': 0, 'special': 11, 'value': 1/3, 'bomb': false}, // 吸血怪需要在后面添加value代表吸血比例 - 'silverSlime': {'name': '银头怪', 'hp': 100, 'atk': 120, 'def': 0, 'money': 15, 'experience': 0, 'special': 14}, - 'swordEmperor': {'name': '剑圣', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'whiteHornSlime': {'name': '尖角怪', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'badPrincess': {'name': '痛苦魔女', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'badFairy': {'name': '黑暗仙子', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'grayPriest': {'name': '中级法师', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'redSwordsman': {'name': '剑王', 'hp': 100, 'atk': 120, 'def': 0, 'money': 7, 'experience': 0, 'special': 6}, - 'whiteGhost': {'name': '水银战士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'poisonZombie': {'name': '绿兽人', 'hp': 100, 'atk': 120, 'def': 0, 'money': 13, 'experience': 0, 'special': 12}, - 'magicDragon': {'name': '魔龙', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'octopus': {'name': '血影', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'darkFairy': {'name': '仙子', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - 'greenKnight': {'name': '强盾骑士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, - } + this.enemys = enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80; + delete(enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80); } enemys.prototype.getEnemys = function (enemyId) { diff --git a/libs/floors/data.js b/libs/floors/data.js new file mode 100644 index 00000000..5a943f27 --- /dev/null +++ b/libs/floors/data.js @@ -0,0 +1,175 @@ +data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = +{ + "main" : { + "useCompress" : false, // 是否使用压缩文件 + // 当你即将发布你的塔时,请使用“JS代码压缩工具”将所有js代码进行压缩,然后将这里的useCompress改为true。 + // 请注意,只有useCompress是false时才会读取floors目录下的文件,为true时会直接读取libs目录下的floors.min.js文件。 + // 如果要进行剧本的修改请务必将其改成false。 + + "floorIds" : [ // 在这里按顺序放所有的楼层;其顺序直接影响到楼层传送器的顺序和上楼器/下楼器的顺序 + "sample0", "sample1", "sample2", "test" + ] + }, + "firstData" : { + "title": "魔塔样板", // 游戏名,将显示在标题页面以及切换楼层的界面中 + "name": "template", // 游戏的唯一英文标识符。由英文、数字、下划线组成,不能超过20个字符。 + "version": "Ver 1.0.0 (Beta)", // 当前游戏版本;版本不一致的存档不能通用。 + "floorId": "sample0", // 初始楼层ID + "hero": { // 勇士初始数据 + "name": "阳光", // 勇士名;可以改成喜欢的 + "lv": 1, // 初始等级,该项必须为正整数 + "hp": 2000, // 初始生命值 + "atk": 100, // 初始攻击 + "def": 100, // 初始防御 + "mdef": 100, // 初始魔防 + "money": 100, // 初始金币 + "experience": 0, // 初始经验 + "items": { // 初始道具个数 + "keys": { + "yellowKey": 0, + "blueKey": 0, + "redKey": 0 + }, + "constants": {}, + "tools": {} + }, + "flyRange": [], // 初始可飞的楼层;一般留空数组即可 + "loc": {"direction": "up", "x": 6, "y": 10}, // 勇士初始位置 + "flags": { // 游戏过程中的变量或flags + "poison": false, // 毒 + "weak": false, // 衰 + "curse": false, // 咒 + } + }, + "startText": [ // 游戏开始前剧情。如果无剧情直接留一个空数组即可。 + "Hi,欢迎来到 HTML5 魔塔样板!\n\n本样板由艾之葵制作,可以让你在不会写任何代码\n的情况下也能做出属于自己的H5魔塔!", + "这里游戏开始时的剧情。\n定义在data.js的startText处。\n\n你可以在这里写上自己的内容。", + "赶快来试一试吧!" + ], + "shops": { // 定义全局商店(即快捷商店) + "moneyShop1": { // 商店唯一ID + "name": "贪婪之神", // 商店名称(标题) + "icon": "blueShop", // 商店图标,blueShop为蓝色商店,pinkShop为粉色商店 + "textInList": "1F金币商店", // 在快捷商店栏中显示的名称 + "use": "money", // 商店所要使用的。只能是"money"或"experience"。 + "need": "20+10*times*(times+1)", // 商店需要的金币/经验数值;可以是一个表达式,以times作为参数计算。 + // 这里用到的times为该商店的已经的访问次数。首次访问该商店时times的值为0。 + // 上面的例子是50层商店的计算公式。你也可以写任意其他的计算公式,只要以times作为参数即可。 + // 例如: "need": "25" 就是恒定需要25金币的商店; "need": "20+2*times" 就是第一次访问要20金币,以后每次递增2金币的商店。 + // 如果是对于每个选项有不同的计算公式,写 "need": "-1" 即可。可参见下面的经验商店。 + "text": "勇敢的武士啊,给我${need}金币就可以:", // 显示的文字,需手动加换行符。可以使用${need}表示上面的need值。 + "choices": [ // 商店的选项 + {"text": "生命+800", "effect": "status:hp+=800"}, + // 如果有多个effect以分号分开,参见下面的经验商店 + {"text": "攻击+4", "effect": "status:atk+=4"}, + {"text": "防御+4", "effect": "status:def+=4"}, + {"text": "魔防+10", "effect": "status:mdef+=10"} + // effect只能对status和item进行操作,不能修改flag值。 + // 必须是X+=Y的形式,其中Y可以是一个表达式,以status:xxx或item:xxx为参数 + // 其他effect样例: + // "item:yellowKey+=1" 黄钥匙+1 + // "item:pickaxe+=3" 破墙镐+3 + // "status:hp+=2*(status:atk+status:def)" 将生命提升攻防和的数值的两倍 + ] + }, + "expShop1": { // 商店唯一ID + "name": "经验之神", + "icon": "pinkShop", + "textInList": "1F经验商店", + "use": "experience", // 该商店使用的是经验进行计算 + "need": "-1", // 如果是对于每个选项所需要的数值不同,这里直接写-1,然后下面选项里给定具体数值 + "text": "勇敢的武士啊,给我若干经验就可以:", + "choices": [ + // 在choices中写need,可以针对每个选项都有不同的需求。 + // 这里的need同样可以以times作为参数,比如 "need": "100+20*times" + {"text": "等级+1", "need": "100", "effect": "status:lv+=1;status:hp+=1000;status:atk+=7;status:def+=7"}, + // 多个effect直接以分号分开即可。如上面的意思是生命+1000,攻击+7,防御+7。 + {"text": "攻击+5", "need": "30", "effect": "status:atk+=5"}, + {"text": "防御+5", "need": "30", "effect": "status:def+=5"}, + ] + }, + }, + "levelUp": [ // 经验升级所需要的数值,是一个数组 + {}, // 第一项为初始等级,可以简单留空,也可以写name + + // 每一个里面可以含有三个参数 name, need, effect + // need为所需要的经验数值,是一个正整数。请确保need所需的依次递增 + // name为该等级的名称,也可以省略代表使用系统默认值;本项将显示在状态栏中 + // effect为本次升级所执行的操作,可由若干项组成,由分号分开 + // 其中每一项写法和上面的商店完全相同,同样必须是X+=Y的形式,Y是一个表达式,同样可以使用status:xxx或item:xxx代表勇士的某项数值/道具个数 + {"need": 20, "name": "第二级", "effect": "status:hp+=2*(status:atk+status:def);status:atk+=10;status:def+=10"}, // 先将生命提升攻防和的2倍;再将攻击+10,防御+10 + + // effect也允许写一个function,代表本次升级将会执行的操作 + {"need": 40, "effect": function () { + core.drawText("恭喜升级!"); + core.status.hero.hp *= 2; + core.status.hero.atk += 100; + core.status.hero.def += 100; + }}, + + // 依次往下写需要的数值即可 + ] + }, + // 各种数值;一些数值可以在这里设置 + "values" : { + /****** 角色相关 ******/ + "HPMAX": 999999, // HP上限;-1则无上限 + "lavaDamage": 100, // 经过血网受到的伤害 + "poisonDamage": 10, // 中毒后每步受到的伤害 + "weakValue": 20, // 衰弱状态下攻防减少的数值 + /****** 道具相关 ******/ + "redJewel": 3, // 红宝石加攻击的数值 + "blueJewel": 3, // 蓝宝石加防御的数值 + "greenJewel": 5, // 绿宝石加魔防的数值 + "redPotion": 100, // 红血瓶加血数值 + "bluePotion": 250, // 蓝血瓶加血数值 + "yellowPotion": 500, // 黄血瓶加血数值 + "greenPotion": 800, // 绿血瓶加血数值 + "sword1": 10, // 铁剑加攻数值 + "shield1": 10, // 铁盾加防数值 + "sword2": 20, // 银剑加攻数值 + "shield2": 20, // 银盾加防数值 + "sword3": 40, // 骑士剑加攻数值 + "shield3": 40, // 骑士盾加防数值 + "sword4": 80, // 圣剑加攻数值 + "shield4": 80, // 圣盾加防数值 + "sword5": 160, // 神圣剑加攻数值 + "shield5": 160, // 神圣盾加防数值 + "moneyPocket": 500, // 金钱袋加金币的数值 + /****** 怪物相关 ******/ + "breakArmor": 0.9, // 破甲的比例(战斗前,怪物附加角色防御的x%作为伤害) + "counterAttack": 0.1, // 反击的比例(战斗时,怪物每回合附加角色攻击的x%作为伤害,无视角色防御) + "purify": 3, // 净化的比例(战斗前,怪物附加勇士魔防的x倍作为伤害) + "hatred": 2, // 仇恨属性中,每杀死一个怪物获得的仇恨值 + /****** 系统相关 ******/ + "animateSpeed": 500, // 动画时间 + }, + // 系统FLAG,在游戏运行中中请不要修改它。 + "flags" : { + /****** 角色状态相关 ******/ + "enableNegativeDamage": true, // 是否支持负伤害(回血) + "enableFloor": false, // 是否在状态栏显示当前楼层 + "enableLv": true, // 是否在状态栏显示当前等级 + "enableMDef": true, // 是否在状态栏及战斗界面显示魔防(护盾) + "enableMoney": true, // 是否在状态栏、怪物手册及战斗界面显示金币 + "enableExperience": true, // 是否在状态栏、怪物手册及战斗界面显示经验 + "enableLevelUp": false, // 是否允许等级提升(进阶);如果上面enableExperience为false,则此项恒视为false + "enableDebuff": true, // 是否涉及毒衰咒;如果此项为false则不会在状态栏中显示毒衰咒的debuff + ////// 上述的几个开关将直接影响状态栏的显示效果 ////// + /****** 道具相关 ******/ + "flyNearStair": true, // 是否需要在楼梯边使用传送器 + "pickaxeFourDirections": true, // 使用破墙镐是否四个方向都破坏;如果false则只破坏面前的墙壁 + "bombFourDirections": true, // 使用炸弹是否四个方向都会炸;如果false则只炸面前的怪物(即和圣锤等价) + "bigKeyIsBox": false, // 如果此项为true,则视为钥匙盒,红黄蓝钥匙+1;若为false,则视为大黄门钥匙 + /****** 系统相关 ******/ + "startDirectly": false, // 点击“开始游戏”后是否立刻开始游戏而不显示难度选择界面 + "canOpenBattleAnimate": true, // 是否允许用户开启战斗过程;如果此项为false,则下面两项均强制视为false + "showBattleAnimateConfirm": true, // 是否在游戏开始时提供“是否开启战斗动画”的选项 + "battleAnimate": true, // 是否默认显示战斗动画;用户可以手动在菜单栏中开关 + "displayEnemyDamage": true, // 是否地图怪物显伤;用户可以手动在菜单栏中开关 + "displayExtraDamage": false, // 是否地图高级显伤(领域、夹击等);用户可以手动在菜单栏中开关 + "enableGentleClick": true, // 是否允许轻触(获得面前物品) + "portalWithoutTrigger": true, // 经过楼梯、传送门时是否能“穿透”。穿透的意思是,自动寻路得到的的路径中间经过了楼梯,行走时是否触发楼层转换事件 + "potionWhileRouting": false, // 寻路算法是否经过血瓶;如果该项为false,则寻路算法会自动尽量绕过血瓶 + } +} \ No newline at end of file diff --git a/libs/floors/enemys.js b/libs/floors/enemys.js new file mode 100644 index 00000000..7952ffd1 --- /dev/null +++ b/libs/floors/enemys.js @@ -0,0 +1,63 @@ +enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 = //1:先攻,2:魔攻,3:坚固,4:2连击,5:3连击,6:4连击,7:破甲,8:反击,9:净化,10:模仿,11:吸血,12:中毒,13:衰弱,14:诅咒,15:领域,16:夹击,17:仇恨 +{ + "greenSlime": {"name": "绿头怪", "hp": 100, "atk": 120, "def": 0, "money": 1, "experience": 1, "special": 0}, + "redSlime": {"name": "红头怪", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "blackSlime": {"name": "青头怪", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "slimelord": {"name": "怪王", "hp": 100, "atk": 120, "def": 0, "money": 10, "experience": 0, "special": 9}, + "bat": {"name": "小蝙蝠", "hp": 100, "atk": 120, "def": 0, "money": 2, "experience": 0, "special": 1}, + "bigBat": {"name": "大蝙蝠", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "redBat": {"name": "红蝙蝠", "hp": 100, "atk": 120, "def": 0, "money": 5, "experience": 0, "special": 4}, + "vampire": {"name": "冥灵魔王", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "skeleton": {"name": "骷髅人", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "skeletonSoilder": {"name": "骷髅士兵", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "skeletonCaptain": {"name": "骷髅队长", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "ghostSkeleton": {"name": "冥队长", "hp": 100, "atk": 120, "def": 0, "money": 8, "experience": 0, "special": 7}, + "zombie": {"name": "兽人", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "zombieKnight": {"name": "兽人武士", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "rock": {"name": "石头人", "hp": 100, "atk": 120, "def": 0, "money": 4, "experience": 0, "special": 3}, + "slimeMan": {"name": "影子战士", "hp": 100, "atk": 0, "def": 0, "money": 11, "experience": 0, "special": 10}, // 模仿怪的攻防设为0就好 + "bluePriest": {"name": "初级法师", "hp": 100, "atk": 120, "def": 0, "money": 3, "experience": 0, "special": 2}, + "redPriest": {"name": "高级法师", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "brownWizard": {"name": "初级巫师", "hp": 100, "atk": 120, "def": 0, "money": 16, "experience": 0, "special": 15, "value": 100}, // 领域怪需要加value表示领域伤害的数值 + "redWizard": {"name": "高级巫师", "hp": 1000, "atk": 1200, "def": 0, "money": 160, "experience": 0, "special": 15, "value": 200}, + "yellowGuard": {"name": "初级卫兵", "hp": 100, "atk": 120, "def": 0, "money": 10, "experience": 0, "special": 0}, + "blueGuard": {"name": "中级卫兵", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "redGuard": {"name": "高级卫兵", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "swordsman": {"name": "双手剑士", "hp": 100, "atk": 120, "def": 0, "money": 6, "experience": 0, "special": 5}, + "soldier": {"name": "冥战士", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "yellowKnight": {"name": "金骑士", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "redKnight": {"name": "红骑士", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "darkKnight": {"name": "黑骑士", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "blackKing": {"name": "黑衣魔王", "hp": 1000, "atk": 500, "def": 0, "money": 1000, "experience": 1000, "special": 0, "bomb": false}, // 加入 "bomb": false 代表该怪物不可被炸弹或圣锤炸掉 + "yellowKing": {"name": "黄衣魔王", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "greenKing": {"name": "青衣武士", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "blueKnight": {"name": "蓝骑士", "hp": 100, "atk": 120, "def": 0, "money": 9, "experience": 0, "special": 8}, + "goldSlime": {"name": "黄头怪", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "poisonSkeleton": {"name": "紫骷髅", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "poisonBat": {"name": "紫蝙蝠", "hp": 100, "atk": 120, "def": 0, "money": 14, "experience": 0, "special": 13}, + "steelRock": {"name": "铁面人", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "skeletonPriest": {"name": "骷髅法师", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "skeletonKing": {"name": "骷髅王", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "skeletonWizard": {"name": "骷髅巫师", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "redSkeletonCaption": {"name": "骷髅武士", "hp": 0, "atk": 0, "def": 0, "money": 0, "special": 0}, + "badHero": {"name": "迷失勇者", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "demon": {"name": "魔神武士", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "demonPriest": {"name": "魔神法师", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "goldHornSlime": {"name": "金角怪", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "redKing": {"name": "红衣魔王", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "whiteKing": {"name": "白衣武士", "hp": 100, "atk": 120, "def": 0, "money": 17, "experience": 0, "special": 16}, + "blackMagician": {"name": "黑暗大法师", "hp": 100, "atk": 120, "def": 0, "money": 12, "experience": 0, "special": 11, "value": 1/3, "bomb": false}, // 吸血怪需要在后面添加value代表吸血比例 + "silverSlime": {"name": "银头怪", "hp": 100, "atk": 120, "def": 0, "money": 15, "experience": 0, "special": 14}, + "swordEmperor": {"name": "剑圣", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "whiteHornSlime": {"name": "尖角怪", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "badPrincess": {"name": "痛苦魔女", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "badFairy": {"name": "黑暗仙子", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "grayPriest": {"name": "中级法师", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "redSwordsman": {"name": "剑王", "hp": 100, "atk": 120, "def": 0, "money": 7, "experience": 0, "special": 6}, + "whiteGhost": {"name": "水银战士", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "poisonZombie": {"name": "绿兽人", "hp": 100, "atk": 120, "def": 0, "money": 13, "experience": 0, "special": 12}, + "magicDragon": {"name": "魔龙", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "octopus": {"name": "血影", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "darkFairy": {"name": "仙子", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + "greenKnight": {"name": "强盾骑士", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, +} \ No newline at end of file diff --git a/libs/floors/icons.js b/libs/floors/icons.js new file mode 100644 index 00000000..f9a0e1b1 --- /dev/null +++ b/libs/floors/icons.js @@ -0,0 +1,215 @@ +icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 = +{ + "hero": { + "down": {"loc": 0, "stop": 0, "leftFoot": 1, "rightFoot": 3}, + "left": {"loc": 1, "stop": 0, "leftFoot": 1, "rightFoot": 3}, + "right": {"loc": 2, "stop": 0, "leftFoot": 1, "rightFoot": 3}, + "up": {"loc": 3, "stop": 0, "leftFoot": 1, "rightFoot": 3} + }, + "terrains": { + "ground": 0, + "grass": 1, + "grass2": 2, + "snowGround": 3, + "ground2": 4, + "ground3": 5, + "ground4": 6, + "sand": 7, + "ground5": 8, + "yellowWall2": 9, + "whiteWall2": 10, + "blueWall2": 11, + "blockWall": 12, + "grayWall": 13, + "white": 14, + "ground6": 15, + "soil": 16, + "yellowWall": 17, + "whiteWall": 18, + "blueWall": 19, + "star": 20, + "lava": 21, + "ice": 22, + "downFloor": 23, + "upFloor": 24, + "yellowDoor": 25, + "blueDoor": 26, + "redDoor": 27, + "greenDoor": 28, + "specialDoor": 29, + "steelDoor": 30, + "blueShop-left": 31, + "blueShop-right": 32, + "pinkShop-left": 33, + "pinkShop-right": 34, + "arrowUp": 35, + "arrowDown": 36, + "arrowLeft": 37, + "arrowRight": 38, + "light": 39, + "darkLight": 40 + }, + "animates": { + "star": 0, + "lava": 1, + "waterWall": 2, + "yellowDoor": 3, + "blueDoor": 4, + "redDoor": 5, + "greenDoor": 6, + "specialDoor": 7, + "blueWallDoor": 8, + "yellowWallDoor": 9, + "whiteWallDoor": 10, + "steelDoor": 11, + "lavaDoor": 12, + "grayLavaDoor": 13, + "starDoor": 14, + "mockBlueWallDoor": 15, + "mockYellowWallDoor": 16, + "mockWhiteWallDoor": 17, + "iceYellowWallDoor": 18, + "starPortal": 19, + "exclamation": 20, + "portal": 21, + "switch": 22, + "lavaNet": 23, + "poisonNet": 24, + "weakNet": 25, + "curseNet": 26, + "downPortal": 27, + "leftPortal": 28, + "rightPortal": 29, + "upPortal": 30, + "water": 31, + }, + "npcs": { + "man": 0, + "woman": 1, + "thief": 2, + "fairy": 3, + "magician": 4, + "womanMagician": 5, + "oldMan": 6, + "child": 7, + "wood": 8, + "pinkShop": 9, + "blueShop": 10, + "princess": 11 + }, + "enemys": { + "greenSlime": 0, + "redSlime": 1, + "blackSlime": 2, + "slimelord": 3, + "bat": 4, + "bigBat": 5, + "redBat": 6, + "vampire": 7, + "skeleton": 8, + "skeletonSoilder": 9, + "skeletonCaptain": 10, + "ghostSkeleton": 11, + "zombie": 12, + "zombieKnight": 13, + "rock": 14, + "slimeMan": 15, + "bluePriest": 16, + "redPriest": 17, + "brownWizard": 18, + "redWizard": 19, + "yellowGuard": 20, + "blueGuard": 21, + "redGuard": 22, + "swordsman": 23, + "soldier": 24, + "yellowKnight": 25, + "redKnight": 26, + "darkKnight": 27, + "blackKing": 28, + "yellowKing": 29, + "greenKing": 30, + "blueKnight": 31, + "goldSlime": 32, + "poisonSkeleton": 33, + "poisonBat": 34, + "steelRock": 35, + "skeletonPriest": 36, + "skeletonKing": 37, + "skeletonWizard": 38, + "redSkeletonCaption": 39, + "badHero": 40, + "demon": 41, + "demonPriest": 42, + "goldHornSlime": 43, + "redKing": 44, + "whiteKing": 45, + "blackMagician": 46, + "silverSlime": 47, + "swordEmperor": 48, + "whiteHornSlime": 49, + "badPrincess": 50, + "badFairy": 51, + "grayPriest": 52, + "redSwordsman": 53, + "whiteGhost": 54, + "poisonZombie": 55, + "magicDragon": 56, + "octopus": 57, + "darkFairy": 58, + "greenKnight": 59, + }, + "items": { + "yellowKey": 0, + "blueKey": 1, + "redKey": 2, + "greenKey": 3, + "steelKey": 4, + "bigKey": 6, + "redJewel": 16, + "blueJewel": 17, + "greenJewel": 18, + "yellowJewel": 19, + "redPotion": 20, + "bluePotion": 21, + "greenPotion": 22, + "yellowPotion": 23, + "sword1": 50, + "sword2": 51, + "sword3": 52, + "sword4": 53, + "sword5": 54, + "shield1": 55, + "shield2": 56, + "shield3": 57, + "shield4": 58, + "shield5": 59, + "book": 9, + "fly": 12, + "pickaxe": 45, + "icePickaxe": 44, + "bomb": 43, + "centerFly": 13, + "upFly": 15, + "downFly": 14, + "coin": 11, + "snow": 41, + "cross": 40, + "superPotion": 29, + "earthquake": 8, + "poisonWine": 24, + "weakWine": 25, + "curseWine": 27, + "superWine": 28, + "knife": 42, + "moneyPocket": 46, + "shoes": 47, + "hammer": 48 + }, + "autotile": { // 所有的Autotile列表;后面的index简单取0即可 + "autotile": 0, + "autotile1": 0, + "autotile2": 0, + "autotile3": 0, + } +} \ No newline at end of file diff --git a/libs/floors/items.js b/libs/floors/items.js new file mode 100644 index 00000000..a181532d --- /dev/null +++ b/libs/floors/items.js @@ -0,0 +1,113 @@ +items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = +{ + +"items" : { + // 钥匙 + 'yellowKey': {'cls': 'keys', 'name': '黄钥匙'}, + 'blueKey': {'cls': 'keys', 'name': '蓝钥匙'}, + 'redKey': {'cls': 'keys', 'name': '红钥匙'}, + + // 宝石、血瓶 + 'redJewel': {'cls': 'items', 'name': '红宝石'}, + 'blueJewel': {'cls': 'items', 'name': '蓝宝石'}, + 'greenJewel': {'cls': 'items', 'name': '绿宝石'}, + 'yellowJewel': {'cls': 'items', 'name': '黄宝石'}, + 'redPotion': {'cls': 'items', 'name': '红血瓶'}, + 'bluePotion': {'cls': 'items', 'name': '蓝血瓶'}, + 'yellowPotion': {'cls': 'items', 'name': '黄血瓶'}, + 'greenPotion': {'cls': 'items', 'name': '绿血瓶'}, + 'sword1': {'cls': 'items', 'name': '铁剑'}, + 'sword2': {'cls': 'items', 'name': '银剑'}, + 'sword3': {'cls': 'items', 'name': '骑士剑'}, + 'sword4': {'cls': 'items', 'name': '圣剑'}, + 'sword5': {'cls': 'items', 'name': '神圣剑'}, + 'shield1': {'cls': 'items', 'name': '铁盾'}, + 'shield2': {'cls': 'items', 'name': '银盾'}, + 'shield3': {'cls': 'items', 'name': '骑士盾'}, + 'shield4': {'cls': 'items', 'name': '圣盾'}, + 'shield5': {'cls': 'items', 'name': '神圣盾'}, + 'superPotion': {'cls': 'items', 'name': '圣水'}, + 'moneyPocket': {'cls': 'items', 'name': '金钱袋'}, + + // 物品 + 'book': {'cls': 'constants', 'name': '怪物手册', 'text': '可以查看当前楼层各怪物属性'}, + 'fly': {'cls': 'constants', 'name': '楼层传送器', 'text': '可以自由往来去过的楼层'}, + 'coin': {'cls': 'constants', 'name': '幸运金币', 'text': '持有时打败怪物可得双倍金币'}, + 'snow': {'cls': 'constants', 'name': '冰冻徽章', 'text': '可以将四周的熔岩变成平地'}, + 'cross': {'cls': 'constants', 'name': '十字架', 'text': '该道具尚未被定义'}, + 'knife': {'cls': 'constants', 'name': '屠龙匕首', 'text': '该道具尚未被定义'}, + 'shoes': {'cls': 'constants', 'name': '绿鞋', 'text': '持有时无视负面地形'}, + + // 道具 + 'bigKey': {'cls': 'tools', 'name': '大黄门钥匙', 'text': '可以开启当前层所有黄门'}, + 'greenKey': {'cls': 'tools', 'name': '绿钥匙', 'text': '可以打开一扇绿门'}, + 'steelKey': {'cls': 'tools', 'name': '铁门钥匙', 'text': '可以打开一扇铁门'}, + 'pickaxe': {'cls': 'tools', 'name': '破墙镐', 'text': '可以破坏勇士面前的墙'}, + 'icePickaxe': {'cls': 'tools', 'name': '破冰镐', 'text': '可以破坏勇士面前的一堵冰墙'}, + 'bomb': {'cls': 'tools', 'name': '炸弹', 'text': '可以炸掉勇士面前的怪物'}, + 'centerFly': {'cls': 'tools', 'name': '中心对称飞行器', 'text': '可以飞向当前楼层中心对称的位置'}, + 'upFly': {'cls': 'tools', 'name': '上楼器', 'text': '可以飞往楼上的相同位置'}, + 'downFly': {'cls': 'tools', 'name': '下楼器', 'text': '可以飞往楼下的相同位置'}, + 'earthquake': {'cls': 'tools', 'name': '地震卷轴', 'text': '可以破坏当前层的所有墙'}, + 'poisonWine': {'cls': 'tools', 'name': '解毒药水', 'text': '可以解除中毒状态'}, + 'weakWine': {'cls': 'tools', 'name': '解衰药水', 'text': '可以解除衰弱状态'}, + 'curseWine': {'cls': 'tools', 'name': '解咒药水', 'text': '可以解除诅咒状态'}, + 'superWine': {'cls': 'tools', 'name': '万能药水', 'text': '可以解除所有不良状态'}, + 'hammer': {'cls': 'tools', 'name': '圣锤', 'text': '可以炸掉勇士面前的怪物'} +}, + + + + +"itemEffect" : { + "redJewel":"core.status.hero.atk += core.values.redJewel", + "blueJewel":"core.status.hero.def += core.values.blueJewel", + "greenJewel":"core.status.hero.mdef += core.values.greenJewel", + // 黄宝石属性:需自己定义 + "yellowJewel":"core.status.hero.hp+=1000;core.status.hero.atk+=6;core.status.hero.def+=6;core.status.hero.mdef+=10;", + "redPotion":"core.status.hero.hp += core.values.redPotion", + "bluePotion":"core.status.hero.hp += core.values.bluePotion", + "yellowPotion":"core.status.hero.hp += core.values.yellowPotion", + "greenPotion":"core.status.hero.hp += core.values.greenPotion", + "sword1":"core.status.hero.atk += core.values.sword1", + "sword2":"core.status.hero.atk += core.values.sword2", + "sword3":"core.status.hero.atk += core.values.sword3", + "sword4":"core.status.hero.atk += core.values.sword4", + "sword5":"core.status.hero.atk += core.values.sword5", + "shield1":"core.status.hero.def += core.values.shield1", + "shield2":"core.status.hero.def += core.values.shield2", + "shield3":"core.status.hero.def += core.values.shield3", + "shield4":"core.status.hero.def += core.values.shield4", + "shield5":"core.status.hero.def += core.values.shield5", + // 只有是钥匙盒才会执行这一步 + "bigKey":"core.status.hero.items.keys.yellowKey++;core.status.hero.items.keys.blueKey++;core.status.hero.items.keys.redKey++;", + "superPotion":"core.status.hero.hp *= 2", + "moneyPocket":"core.status.hero.money += core.values.moneyPocket", +}, + + +"itemEffectTip" : { + "redJewel":"',攻击+'+core.values.redJewel", + "blueJewel":"',防御+'+core.values.blueJewel", + "greenJewel":"',魔防+'+core.values.greenJewel", + "yellowJewel":"',全属性提升'", + "redPotion":"',生命+'+core.values.redPotion", + "bluePotion":"',生命+'+core.values.bluePotion", + "yellowPotion":"',生命+'+core.values.yellowPotion", + "greenPotion":"',生命+'+core.values.greenPotion", + "sword1":"',攻击+'+core.values.sword1", + "sword2":"',攻击+'+core.values.sword2", + "sword3":"',攻击+'+core.values.sword3", + "sword4":"',攻击+'+core.values.sword4", + "sword5":"',攻击+'+core.values.sword5", + "shield1":"',防御+'+core.values.shield1", + "shield2":"',防御+'+core.values.shield2", + "shield3":"',防御+'+core.values.shield3", + "shield4":"',防御+'+core.values.shield4", + "shield5":"',防御+'+core.values.shield5", + "bigKey":"',全钥匙+1'", + "superPotion":"',生命值翻倍'", + "moneyPocket":"',金币+'+core.values.moneyPocket", +} + +} \ No newline at end of file diff --git a/libs/floors/maps.js b/libs/floors/maps.js new file mode 100644 index 00000000..30ef090a --- /dev/null +++ b/libs/floors/maps.js @@ -0,0 +1,194 @@ +maps_90f36752_8815_4be8_b32b_d7fad1d0542e = +{ + ////////////////////////// 地形部分 ////////////////////////// + + // 0-20 地形 + "1":{"cls": "terrains", "id": "yellowWall"}, // 黄墙 + "2":{"cls": "terrains", "id": "whiteWall"}, // 白墙 + "3":{"cls": "terrains", "id": "blueWall"}, // 白墙 + "4":{"cls": "animates", "id": "star", "noPass": true}, // 星空 + "5":{"cls": "animates", "id": "lava", "noPass": true}, // 岩浆 + "6":{"cls": "terrains", "id": "ice"}, // 岩浆 + "7":{"cls": "terrains", "id": "blueShop-left"}, // 蓝色商店左 + "8":{"cls": "terrains", "id": "blueShop-right"}, // 蓝色商店右 + "9":{"cls": "terrains", "id": "pinkShop-left"}, // 粉色商店左 + "10":{"cls": "terrains", "id": "pinkShop-right"}, // 粉色商店左 + "11":{"cls": "animates", "id": "lavaNet", "noPass": false, "trigger": "passNet"}, // 血网 + "12":{"cls": "animates", "id": "poisonNet", "noPass": false, "trigger": "passNet"}, // 毒网 + "13":{"cls": "animates", "id": "weakNet", "noPass": false, "trigger": "passNet"}, // 衰网 + "14":{"cls": "animates", "id": "curseNet", "noPass": false, "trigger": "passNet"}, // 咒网 + "15":{"cls": "animates", "id": "water", "noPass": true}, // 水 + // 在这里添加更多地形 + // 如果空地不足,可以从180以后开始继续放,只要不和现有的数字冲突即可 + + // Autotile + "20":{"cls": "autotile", "id": "autotile", "noPass": true}, // autotile + // 更多的autotile从151到160,只要不和现有的数字冲突即可 + "151":{"cls": "autotile", "id": "autotile1", "noPass": true}, + "152":{"cls": "autotile", "id": "autotile2", "noPass": true}, + "153":{"cls": "autotile", "id": "autotile3", "noPass": true}, + + + ////////////////////////// 物品部分 ////////////////////////// + + // 21-80 物品 + "21":{"cls": "items", "id": "yellowKey"}, // 黄钥匙 + "22":{"cls": "items", "id": "blueKey"}, // 蓝钥匙 + "23":{"cls": "items", "id": "redKey"}, // 红钥匙 + "24":{"cls": "items", "id": "greenKey"}, // 绿钥匙 + "25":{"cls": "items", "id": "steelKey"}, // 铁门钥匙 + "26":{"cls": "items", "id": "bigKey"}, // 大黄门钥匙(钥匙盒) + "27":{"cls": "items", "id": "redJewel"}, // 红宝石 + "28":{"cls": "items", "id": "blueJewel"}, // 蓝宝石 + "29":{"cls": "items", "id": "greenJewel"}, // 绿宝石 + "30":{"cls": "items", "id": "yellowJewel"}, // 黄宝石 + "31":{"cls": "items", "id": "redPotion"}, // 红血瓶 + "32":{"cls": "items", "id": "bluePotion"}, // 蓝血瓶 + "33":{"cls": "items", "id": "greenPotion"}, // 绿血瓶 + "34":{"cls": "items", "id": "yellowPotion"}, // 黄血瓶 + "35":{"cls": "items", "id": "sword1"}, // 铁剑 + "36":{"cls": "items", "id": "shield1"}, // 铁盾 + "37":{"cls": "items", "id": "sword2"}, // 银剑 + "38":{"cls": "items", "id": "shield2"}, // 银盾 + "39":{"cls": "items", "id": "sword3"}, // 骑士剑 + "40":{"cls": "items", "id": "shield3"}, // 骑士盾 + "41":{"cls": "items", "id": "sword4"}, // 圣剑 + "42":{"cls": "items", "id": "shield4"}, // 圣盾 + "43":{"cls": "items", "id": "sword5"}, // 神圣剑 + "44":{"cls": "items", "id": "shield5"}, // 神圣盾 + "45":{"cls": "items", "id": "book"}, // 怪物手册 + "46":{"cls": "items", "id": "fly"}, // 楼层传送器 + "47":{"cls": "items", "id": "pickaxe"}, // 破墙镐 + "48":{"cls": "items", "id": "icePickaxe"}, // 破冰镐 + "49":{"cls": "items", "id": "bomb"}, // 炸弹 + "50":{"cls": "items", "id": "centerFly"}, // 中心对称 + "51":{"cls": "items", "id": "upFly"}, // 上楼器 + "52":{"cls": "items", "id": "downFly"}, // 下楼器 + "53":{"cls": "items", "id": "coin"}, // 幸运金币 + "54":{"cls": "items", "id": "snow"}, // 冰冻徽章 + "55":{"cls": "items", "id": "cross"}, // 十字架 + "56":{"cls": "items", "id": "superPotion"}, // 圣水 + "57":{"cls": "items", "id": "earthquake"}, // 地震卷轴 + "58":{"cls": "items", "id": "poisonWine"}, // 解毒药水 + "59":{"cls": "items", "id": "weakWine"}, // 解衰药水 + "60":{"cls": "items", "id": "curseWine"}, // 解咒药水 + "61":{"cls": "items", "id": "superWine"}, // 万能药水 + "62":{"cls": "items", "id": "knife"}, // 屠龙匕首 + "63":{"cls": "items", "id": "moneyPocket"}, // 金钱袋 + "64":{"cls": "items", "id": "shoes"}, // 绿鞋 + "65":{"cls": "items", "id": "hammer"}, // 圣锤 + + + ////////////////////////// 门、楼梯、传送点部分 ////////////////////////// + + // 81-100 门 + "81":{"cls": "terrains", "id": "yellowDoor", "trigger": "openDoor"}, // 黄门 + "82":{"cls": "terrains", "id": "blueDoor", "trigger": "openDoor"}, // 蓝门 + "83":{"cls": "terrains", "id": "redDoor", "trigger": "openDoor"}, // 红门 + "84":{"cls": "terrains", "id": "greenDoor", "trigger": "openDoor"}, // 绿门 + "85":{"cls": "terrains", "id": "specialDoor", "trigger": "openDoor"}, // 机关门左 + "86":{"cls": "terrains", "id": "steelDoor", "trigger": "openDoor"}, // 铁门 + "87":{"cls": "terrains", "id": "upFloor", "noPass": false}, // 上楼梯 + "88":{"cls": "terrains", "id": "downFloor", "noPass": false}, // 下楼梯 + "89":{"cls": "animates", "id": "portal", "noPass": false}, // 传送门 + "90":{"cls": "animates", "id": "starPortal", "noPass": false}, // 星空传送门 + "91":{"cls": "animates", "id": "upPortal", "noPass": false}, // 上箭头 + "92":{"cls": "animates", "id": "leftPortal", "noPass": false}, // 左箭头 + "93":{"cls": "animates", "id": "downPortal", "noPass": false}, // 下箭头 + "94":{"cls": "animates", "id": "rightPortal", "noPass": false}, // 右箭头 + + + ////////////////////////// NPC部分 ////////////////////////// + + // 121-150 NPC + "121":{"cls": "npcs", "id": "man"}, + "122":{"cls": "npcs", "id": "woman"}, + "123":{"cls": "npcs", "id": "thief"}, + "124":{"cls": "npcs", "id": "fairy"}, + "125":{"cls": "npcs", "id": "magician"}, + "126":{"cls": "npcs", "id": "womanMagician"}, + "127":{"cls": "npcs", "id": "oldMan"}, + "128":{"cls": "npcs", "id": "child"}, + "129":{"cls": "npcs", "id": "wood"}, + "130":{"cls": "npcs", "id": "pinkShop"}, + "131":{"cls": "npcs", "id": "blueShop"}, + "132":{"cls": "npcs", "id": "princess"}, + + ////////////////////////// 其他部分 ////////////////////////// + + // 161-200 其他(单向箭头、灯、箱子等等) + "161":{"cls": "terrains", "id": "arrowUp", "noPass": false}, // 单向上箭头 + "162":{"cls": "terrains", "id": "arrowDown", "noPass": false}, // 单向下箭头 + "163":{"cls": "terrains", "id": "arrowLeft", "noPass": false}, // 单向左箭头 + "164":{"cls": "terrains", "id": "arrowRight", "noPass": false}, // 单向右箭头 + "165":{"cls": "terrains", "id": "light", "trigger": "changeLight", "noPass": false}, // 灯 + "166":{"cls": "terrains", "id": "darkLight", "noPass": true}, // 暗灯 + + + ////////////////////////// 怪物部分 ////////////////////////// + + // 201-300 怪物 + "201":{"cls": "enemys", "id": "greenSlime"}, + "202":{"cls": "enemys", "id": "redSlime"}, + "203":{"cls": "enemys", "id": "blackSlime"}, + "204":{"cls": "enemys", "id": "slimelord"}, + "205":{"cls": "enemys", "id": "bat"}, + "206":{"cls": "enemys", "id": "bigBat"}, + "207":{"cls": "enemys", "id": "redBat"}, + "208":{"cls": "enemys", "id": "vampire"}, + "209":{"cls": "enemys", "id": "skeleton"}, + "210":{"cls": "enemys", "id": "skeletonSoilder"}, + "211":{"cls": "enemys", "id": "skeletonCaptain"}, + "212":{"cls": "enemys", "id": "ghostSkeleton"}, + "213":{"cls": "enemys", "id": "zombie"}, + "214":{"cls": "enemys", "id": "zombieKnight"}, + "215":{"cls": "enemys", "id": "rock"}, + "216":{"cls": "enemys", "id": "slimeMan"}, + "217":{"cls": "enemys", "id": "bluePriest"}, + "218":{"cls": "enemys", "id": "redPriest"}, + "219":{"cls": "enemys", "id": "brownWizard"}, + "220":{"cls": "enemys", "id": "redWizard"}, + "221":{"cls": "enemys", "id": "yellowGuard"}, + "222":{"cls": "enemys", "id": "blueGuard"}, + "223":{"cls": "enemys", "id": "redGuard"}, + "224":{"cls": "enemys", "id": "swordsman"}, + "225":{"cls": "enemys", "id": "soldier"}, + "226":{"cls": "enemys", "id": "yellowKnight"}, + "227":{"cls": "enemys", "id": "redKnight"}, + "228":{"cls": "enemys", "id": "darkKnight"}, + "229":{"cls": "enemys", "id": "blackKing"}, + "230":{"cls": "enemys", "id": "yellowKing"}, + "231":{"cls": "enemys", "id": "greenKing"}, + "232":{"cls": "enemys", "id": "blueKnight"}, + "233":{"cls": "enemys", "id": "goldSlime"}, + "234":{"cls": "enemys", "id": "poisonSkeleton"}, + "235":{"cls": "enemys", "id": "poisonBat"}, + "236":{"cls": "enemys", "id": "steelRock"}, + "237":{"cls": "enemys", "id": "skeletonPriest"}, + "238":{"cls": "enemys", "id": "skeletonKing"}, + "239":{"cls": "enemys", "id": "skeletonWizard"}, + "240":{"cls": "enemys", "id": "redSkeletonCaption"}, + "241":{"cls": "enemys", "id": "badHero"}, + "242":{"cls": "enemys", "id": "demon"}, + "243":{"cls": "enemys", "id": "demonPriest"}, + "244":{"cls": "enemys", "id": "goldHornSlime"}, + "245":{"cls": "enemys", "id": "redKing"}, + "246":{"cls": "enemys", "id": "whiteKing"}, + "247":{"cls": "enemys", "id": "blackMagician"}, + "248":{"cls": "enemys", "id": "silverSlime"}, + "249":{"cls": "enemys", "id": "swordEmperor"}, + "250":{"cls": "enemys", "id": "whiteHornSlime"}, + "251":{"cls": "enemys", "id": "badPrincess"}, + "252":{"cls": "enemys", "id": "badFairy"}, + "253":{"cls": "enemys", "id": "grayPriest"}, + "254":{"cls": "enemys", "id": "redSwordsman"}, + "255":{"cls": "enemys", "id": "whiteGhost"}, + "256":{"cls": "enemys", "id": "poisonZombie"}, + "257":{"cls": "enemys", "id": "magicDragon"}, + "258":{"cls": "enemys", "id": "octopus"}, + "259":{"cls": "enemys", "id": "darkFairy"}, + "260":{"cls": "enemys", "id": "greenKnight"}, + + ////////////////////////// 待定... ////////////////////////// + // 目前ID暂时不要超过400 +} \ No newline at end of file diff --git a/libs/floors/sample0.js b/libs/floors/sample0.js index a32e0d7d..4535039c 100644 --- a/libs/floors/sample0.js +++ b/libs/floors/sample0.js @@ -41,7 +41,7 @@ main.floors.sample0 = { "10,11": [ // 守着门的老人 "\t[老人,woman]这些是门,需要对应的钥匙打开。\n机关门必须使用特殊的开法。", "\t[老人,woman]开门后可触发 afterOpenDoor 事件。\n\n有关事件的各种信息在下一层会有更为详细的说明。", - {'type': 'hide', "time": 500} + {"type": "hide", "time": 500} ], "2,10": [ // 守着楼梯、传送门、路障的老人 "\t[老人,womanMagician]这些是路障、楼梯、传送门。", diff --git a/libs/floors/sample1.js b/libs/floors/sample1.js index b28c41d1..c9d53d4b 100644 --- a/libs/floors/sample1.js +++ b/libs/floors/sample1.js @@ -61,9 +61,9 @@ main.floors.sample1 = { {"type": "hide", "loc": [1,8]}, {"type": "hide", "loc": [1,5], "time": 500}, // 隐藏红衣魔王,动画500ms {"type": "hide"}, // 隐藏本事件 - {"type": "setFg", "color": [0,0,0], 'time': 1250}, // 渐变为白色 + {"type": "setFg", "color": [0,0,0], "time": 1250}, // 渐变为白色 {"type": "sleep", "time": 700}, - {"type": "changeFloor", "floorId": "sample1", "loc": [1,11], 'direction': 'right', 'time': 1000}, // 楼层切换。changeFloor必须指定floorId和loc。 + {"type": "changeFloor", "floorId": "sample1", "loc": [1,11], "direction": "right", "time": 1000}, // 楼层切换。changeFloor必须指定floorId和loc。 // 备注:这里也可以下面的这种写法: // {"type": "changePos", "loc": [1,11]} // 使用这种写法将不会有“楼层切换动画”,而是直接让勇士到达本层的loc位置。 diff --git a/libs/icons.js b/libs/icons.js index 4aced479..a614cded 100644 --- a/libs/icons.js +++ b/libs/icons.js @@ -3,220 +3,8 @@ function icons() { } icons.prototype.init = function () { - this.icons = { - 'hero': { - 'down': {'loc': 0, 'stop': 0, 'leftFoot': 1, 'rightFoot': 3}, - 'left': {'loc': 1, 'stop': 0, 'leftFoot': 1, 'rightFoot': 3}, - 'right': {'loc': 2, 'stop': 0, 'leftFoot': 1, 'rightFoot': 3}, - 'up': {'loc': 3, 'stop': 0, 'leftFoot': 1, 'rightFoot': 3} - }, - 'terrains': { - 'ground': 0, - 'grass': 1, - 'grass2': 2, - 'snowGround': 3, - 'ground2': 4, - 'ground3': 5, - 'ground4': 6, - 'sand': 7, - 'ground5': 8, - 'yellowWall2': 9, - 'whiteWall2': 10, - 'blueWall2': 11, - 'blockWall': 12, - 'grayWall': 13, - 'white': 14, - 'ground6': 15, - 'soil': 16, - 'yellowWall': 17, - 'whiteWall': 18, - 'blueWall': 19, - 'star': 20, - 'lava': 21, - 'ice': 22, - 'downFloor': 23, - 'upFloor': 24, - 'yellowDoor': 25, - 'blueDoor': 26, - 'redDoor': 27, - 'greenDoor': 28, - 'specialDoor': 29, - 'steelDoor': 30, - 'blueShop-left': 31, - 'blueShop-right': 32, - 'pinkShop-left': 33, - 'pinkShop-right': 34, - 'arrowUp': 35, - 'arrowDown': 36, - 'arrowLeft': 37, - 'arrowRight': 38, - 'light': 39, - 'darkLight': 40 - }, - 'animates': { - 'star': 0, - 'lava': 1, - 'waterWall': 2, - 'yellowDoor': 3, - 'blueDoor': 4, - 'redDoor': 5, - 'greenDoor': 6, - 'specialDoor': 7, - 'blueWallDoor': 8, - 'yellowWallDoor': 9, - 'whiteWallDoor': 10, - 'steelDoor': 11, - 'lavaDoor': 12, - 'grayLavaDoor': 13, - 'starDoor': 14, - 'mockBlueWallDoor': 15, - 'mockYellowWallDoor': 16, - 'mockWhiteWallDoor': 17, - 'iceYellowWallDoor': 18, - 'starPortal': 19, - 'exclamation': 20, - 'portal': 21, - 'switch': 22, - 'lavaNet': 23, - 'poisonNet': 24, - 'weakNet': 25, - 'curseNet': 26, - 'downPortal': 27, - 'leftPortal': 28, - 'rightPortal': 29, - 'upPortal': 30, - 'water': 31, - }, - 'npcs': { - 'man': 0, - 'woman': 1, - 'thief': 2, - 'fairy': 3, - 'magician': 4, - 'womanMagician': 5, - 'oldMan': 6, - 'child': 7, - 'wood': 8, - 'pinkShop': 9, - 'blueShop': 10, - 'princess': 11 - }, - 'enemys': { - 'greenSlime': 0, - 'redSlime': 1, - 'blackSlime': 2, - 'slimelord': 3, - 'bat': 4, - 'bigBat': 5, - 'redBat': 6, - 'vampire': 7, - 'skeleton': 8, - 'skeletonSoilder': 9, - 'skeletonCaptain': 10, - 'ghostSkeleton': 11, - 'zombie': 12, - 'zombieKnight': 13, - 'rock': 14, - 'slimeMan': 15, - 'bluePriest': 16, - 'redPriest': 17, - 'brownWizard': 18, - 'redWizard': 19, - 'yellowGuard': 20, - 'blueGuard': 21, - 'redGuard': 22, - 'swordsman': 23, - 'soldier': 24, - 'yellowKnight': 25, - 'redKnight': 26, - 'darkKnight': 27, - 'blackKing': 28, - 'yellowKing': 29, - 'greenKing': 30, - 'blueKnight': 31, - 'goldSlime': 32, - 'poisonSkeleton': 33, - 'poisonBat': 34, - 'steelRock': 35, - 'skeletonPriest': 36, - 'skeletonKing': 37, - 'skeletonWizard': 38, - 'redSkeletonCaption': 39, - 'badHero': 40, - 'demon': 41, - 'demonPriest': 42, - 'goldHornSlime': 43, - 'redKing': 44, - 'whiteKing': 45, - 'blackMagician': 46, - 'silverSlime': 47, - 'swordEmperor': 48, - 'whiteHornSlime': 49, - 'badPrincess': 50, - 'badFairy': 51, - 'grayPriest': 52, - 'redSwordsman': 53, - 'whiteGhost': 54, - 'poisonZombie': 55, - 'magicDragon': 56, - 'octopus': 57, - 'darkFairy': 58, - 'greenKnight': 59, - }, - 'items': { - 'yellowKey': 0, - 'blueKey': 1, - 'redKey': 2, - 'greenKey': 3, - 'steelKey': 4, - 'bigKey': 6, - 'redJewel': 16, - 'blueJewel': 17, - 'greenJewel': 18, - 'yellowJewel': 19, - 'redPotion': 20, - 'bluePotion': 21, - 'greenPotion': 22, - 'yellowPotion': 23, - 'sword1': 50, - 'sword2': 51, - 'sword3': 52, - 'sword4': 53, - 'sword5': 54, - 'shield1': 55, - 'shield2': 56, - 'shield3': 57, - 'shield4': 58, - 'shield5': 59, - 'book': 9, - 'fly': 12, - 'pickaxe': 45, - 'icePickaxe': 44, - 'bomb': 43, - 'centerFly': 13, - 'upFly': 15, - 'downFly': 14, - 'coin': 11, - 'snow': 41, - 'cross': 40, - 'superPotion': 29, - 'earthquake': 8, - 'poisonWine': 24, - 'weakWine': 25, - 'curseWine': 27, - 'superWine': 28, - 'knife': 42, - 'moneyPocket': 46, - 'shoes': 47, - 'hammer': 48 - }, - 'autotile': { // 所有的Autotile列表;后面的index简单取0即可 - 'autotile': 0, - 'autotile1': 0, - 'autotile2': 0, - 'autotile3': 0, - } - } + this.icons = icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1; + delete(icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1); } icons.prototype.getIcons = function () { diff --git a/libs/items.js b/libs/items.js index e2a36c8a..1d6a0201 100644 --- a/libs/items.js +++ b/libs/items.js @@ -3,60 +3,10 @@ function items() { } items.prototype.init = function () { - this.items = { - // 钥匙 - 'yellowKey': {'cls': 'keys', 'name': '黄钥匙'}, - 'blueKey': {'cls': 'keys', 'name': '蓝钥匙'}, - 'redKey': {'cls': 'keys', 'name': '红钥匙'}, - - // 宝石、血瓶 - 'redJewel': {'cls': 'items', 'name': '红宝石'}, - 'blueJewel': {'cls': 'items', 'name': '蓝宝石'}, - 'greenJewel': {'cls': 'items', 'name': '绿宝石'}, - 'yellowJewel': {'cls': 'items', 'name': '黄宝石'}, - 'redPotion': {'cls': 'items', 'name': '红血瓶'}, - 'bluePotion': {'cls': 'items', 'name': '蓝血瓶'}, - 'yellowPotion': {'cls': 'items', 'name': '黄血瓶'}, - 'greenPotion': {'cls': 'items', 'name': '绿血瓶'}, - 'sword1': {'cls': 'items', 'name': '铁剑'}, - 'sword2': {'cls': 'items', 'name': '银剑'}, - 'sword3': {'cls': 'items', 'name': '骑士剑'}, - 'sword4': {'cls': 'items', 'name': '圣剑'}, - 'sword5': {'cls': 'items', 'name': '神圣剑'}, - 'shield1': {'cls': 'items', 'name': '铁盾'}, - 'shield2': {'cls': 'items', 'name': '银盾'}, - 'shield3': {'cls': 'items', 'name': '骑士盾'}, - 'shield4': {'cls': 'items', 'name': '圣盾'}, - 'shield5': {'cls': 'items', 'name': '神圣盾'}, - 'superPotion': {'cls': 'items', 'name': '圣水'}, - 'moneyPocket': {'cls': 'items', 'name': '金钱袋'}, - - // 物品 - 'book': {'cls': 'constants', 'name': '怪物手册', 'text': '可以查看当前楼层各怪物属性'}, - 'fly': {'cls': 'constants', 'name': '楼层传送器', 'text': '可以自由往来去过的楼层'}, - 'coin': {'cls': 'constants', 'name': '幸运金币', 'text': '持有时打败怪物可得双倍金币'}, - 'snow': {'cls': 'constants', 'name': '冰冻徽章', 'text': '可以将四周的熔岩变成平地'}, - 'cross': {'cls': 'constants', 'name': '十字架', 'text': '该道具尚未被定义'}, - 'knife': {'cls': 'constants', 'name': '屠龙匕首', 'text': '该道具尚未被定义'}, - 'shoes': {'cls': 'constants', 'name': '绿鞋', 'text': '持有时无视负面地形'}, - - // 道具 - 'bigKey': {'cls': 'tools', 'name': '大黄门钥匙', 'text': '可以开启当前层所有黄门'}, - 'greenKey': {'cls': 'tools', 'name': '绿钥匙', 'text': '可以打开一扇绿门'}, - 'steelKey': {'cls': 'tools', 'name': '铁门钥匙', 'text': '可以打开一扇铁门'}, - 'pickaxe': {'cls': 'tools', 'name': '破墙镐', 'text': '可以破坏勇士面前的墙'}, - 'icePickaxe': {'cls': 'tools', 'name': '破冰镐', 'text': '可以破坏勇士面前的一堵冰墙'}, - 'bomb': {'cls': 'tools', 'name': '炸弹', 'text': '可以炸掉勇士面前的怪物'}, - 'centerFly': {'cls': 'tools', 'name': '中心对称飞行器', 'text': '可以飞向当前楼层中心对称的位置'}, - 'upFly': {'cls': 'tools', 'name': '上楼器', 'text': '可以飞往楼上的相同位置'}, - 'downFly': {'cls': 'tools', 'name': '下楼器', 'text': '可以飞往楼下的相同位置'}, - 'earthquake': {'cls': 'tools', 'name': '地震卷轴', 'text': '可以破坏当前层的所有墙'}, - 'poisonWine': {'cls': 'tools', 'name': '解毒药水', 'text': '可以解除中毒状态'}, - 'weakWine': {'cls': 'tools', 'name': '解衰药水', 'text': '可以解除衰弱状态'}, - 'curseWine': {'cls': 'tools', 'name': '解咒药水', 'text': '可以解除诅咒状态'}, - 'superWine': {'cls': 'tools', 'name': '万能药水', 'text': '可以解除所有不良状态'}, - 'hammer': {'cls': 'tools', 'name': '圣锤', 'text': '可以炸掉勇士面前的怪物'} - } + 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; + delete(items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a); } // 初始化道具 @@ -79,36 +29,7 @@ items.prototype.getItemEffect = function(itemId, itemNum) { var itemCls = core.material.items[itemId].cls; // 消耗品 if (itemCls === 'items') { - if (itemId === 'redJewel') core.status.hero.atk += core.values.redJewel; - if (itemId === 'blueJewel') core.status.hero.def += core.values.blueJewel; - if (itemId === 'greenJewel') core.status.hero.mdef += core.values.greenJewel; - if (itemId == 'yellowJewel') { // 黄宝石属性:需自己定义 - core.status.hero.hp+=1000; - core.status.hero.atk+=6; - core.status.hero.def+=6; - core.status.hero.mdef+=10; - } - if (itemId === 'redPotion') core.status.hero.hp += core.values.redPotion; - if (itemId === 'bluePotion') core.status.hero.hp += core.values.bluePotion; - if (itemId === 'yellowPotion') core.status.hero.hp += core.values.yellowPotion; - if (itemId === 'greenPotion') core.status.hero.hp += core.values.greenPotion; - if (itemId === 'sword1') core.status.hero.atk += core.values.sword1; - if (itemId === 'sword2') core.status.hero.atk += core.values.sword2; - if (itemId == 'sword3') core.status.hero.atk += core.values.sword3; - if (itemId == 'sword4') core.status.hero.atk += core.values.sword4; - if (itemId === 'sword5') core.status.hero.atk += core.values.sword5; - if (itemId === 'shield1') core.status.hero.def += core.values.shield1; - if (itemId === 'shield2') core.status.hero.def += core.values.shield2; - if (itemId === 'shield3') core.status.hero.def += core.values.shield3; - if (itemId === 'shield4') core.status.hero.def += core.values.shield4; - if (itemId === 'shield5') core.status.hero.def += core.values.shield5; - if (itemId === 'bigKey') { // 只有是钥匙盒才会执行这一步 - core.status.hero.items.keys.yellowKey++; - core.status.hero.items.keys.blueKey++; - core.status.hero.items.keys.redKey++; - } - if (itemId == 'superPotion') core.status.hero.hp *= 2; - if (itemId == 'moneyPocket') core.status.hero.money += core.values.moneyPocket; + if (itemId in this.itemEffect)eval(this.itemEffect[itemId]); } else { core.addItem(itemId, itemNum); @@ -116,27 +37,7 @@ items.prototype.getItemEffect = function(itemId, itemNum) { } items.prototype.getItemEffectTip = function(itemId) { - if (itemId === 'redJewel') return ",攻击+"+core.values.redJewel; - if (itemId === 'blueJewel') return ",防御+"+core.values.blueJewel; - if (itemId === 'greenJewel') return ",魔防+"+core.values.greenJewel; - if (itemId == 'yellowJewel') return ",全属性提升"; - if (itemId === 'redPotion') return ",生命+"+core.values.redPotion; - if (itemId === 'bluePotion') return ",生命+"+core.values.bluePotion; - if (itemId === 'yellowPotion') return ",生命+"+core.values.yellowPotion; - if (itemId === 'greenPotion') return ",生命+"+core.values.greenPotion; - if (itemId === 'sword1') return ",攻击+"+core.values.sword1; - if (itemId === 'sword2') return ",攻击+"+core.values.sword2; - if (itemId === 'sword3') return ",攻击+"+core.values.sword3; - if (itemId === 'sword4') return ",攻击+"+core.values.sword4; - if (itemId === 'sword5') return ",攻击+"+core.values.sword5; - if (itemId === 'shield1') return ",防御+"+core.values.shield1; - if (itemId === 'shield2') return ",防御+"+core.values.shield2; - if (itemId === 'shield3') return ",防御+"+core.values.shield3; - if (itemId === 'shield4') return ",防御+"+core.values.shield4; - if (itemId === 'shield5') return ",防御+"+core.values.shield5; - if (itemId === 'bigKey') return ",全钥匙+1"; - if (itemId === 'superPotion') return ",生命值翻倍"; - if (itemId == 'moneyPocket') return ",金币+"+core.values.moneyPocket; + if (itemId in this.itemEffectTip)return eval(this.itemEffectTip[itemId]); return ""; } diff --git a/libs/maps.js b/libs/maps.js index 0557f07a..7704e7a3 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -1,5 +1,8 @@ function maps() {} -maps.prototype.init = function() {} +maps.prototype.init = function() { + this.blocksInfo = maps_90f36752_8815_4be8_b32b_d7fad1d0542e; + delete(maps_90f36752_8815_4be8_b32b_d7fad1d0542e); +} maps.prototype.loadFloor = function (floorId, map) { var floor = core.floors[floorId]; @@ -61,197 +64,7 @@ maps.prototype.getBlock = function (x, y, id) { var tmp = {'x': x, 'y': y, 'id': id}; if (enable!=null) tmp.enable = enable; - ////////////////////////// 地形部分 ////////////////////////// - - // 0-20 地形 - if (id == 1) tmp.event = {'cls': 'terrains', 'id': 'yellowWall'}; // 黄墙 - if (id == 2) tmp.event = {'cls': 'terrains', 'id': 'whiteWall'}; // 白墙 - if (id == 3) tmp.event = {'cls': 'terrains', 'id': 'blueWall'}; // 白墙 - if (id == 4) tmp.event = {'cls': 'animates', 'id': 'star', 'noPass': true}; // 星空 - if (id == 5) tmp.event = {'cls': 'animates', 'id': 'lava', 'noPass': true}; // 岩浆 - if (id == 6) tmp.event = {'cls': 'terrains', 'id': 'ice'}; // 岩浆 - if (id == 7) tmp.event = {'cls': 'terrains', 'id': 'blueShop-left'}; // 蓝色商店左 - if (id == 8) tmp.event = {'cls': 'terrains', 'id': 'blueShop-right'}; // 蓝色商店右 - if (id == 9) tmp.event = {'cls': 'terrains', 'id': 'pinkShop-left'}; // 粉色商店左 - if (id == 10) tmp.event = {'cls': 'terrains', 'id': 'pinkShop-right'}; // 粉色商店左 - if (id == 11) tmp.event = {'cls': 'animates', 'id': 'lavaNet', 'noPass': false, 'trigger': 'passNet'}; // 血网 - if (id == 12) tmp.event = {'cls': 'animates', 'id': 'poisonNet', 'noPass': false, 'trigger': 'passNet'}; // 毒网 - if (id == 13) tmp.event = {'cls': 'animates', 'id': 'weakNet', 'noPass': false, 'trigger': 'passNet'}; // 衰网 - if (id == 14) tmp.event = {'cls': 'animates', 'id': 'curseNet', 'noPass': false, 'trigger': 'passNet'}; // 咒网 - if (id == 15) tmp.event = {'cls': 'animates', 'id': 'water', 'noPass': true}; // 水 - // 在这里添加更多地形 - // 如果空地不足,可以从180以后开始继续放,只要不和现有的数字冲突即可 - - // Autotile - if (id == 20) tmp.event = {'cls': 'autotile', 'id': 'autotile', 'noPass': true}; // autotile - // 更多的autotile从151到160,只要不和现有的数字冲突即可 - if (id == 151) tmp.event = {'cls': 'autotile', 'id': 'autotile1', 'noPass': true}; - if (id == 152) tmp.event = {'cls': 'autotile', 'id': 'autotile2', 'noPass': true}; - if (id == 153) tmp.event = {'cls': 'autotile', 'id': 'autotile3', 'noPass': true}; - - - ////////////////////////// 物品部分 ////////////////////////// - - // 21-80 物品 - if (id == 21) tmp.event = {'cls': 'items', 'id': 'yellowKey'}; // 黄钥匙 - if (id == 22) tmp.event = {'cls': 'items', 'id': 'blueKey'}; // 蓝钥匙 - if (id == 23) tmp.event = {'cls': 'items', 'id': 'redKey'}; // 红钥匙 - if (id == 24) tmp.event = {'cls': 'items', 'id': 'greenKey'}; // 绿钥匙 - if (id == 25) tmp.event = {'cls': 'items', 'id': 'steelKey'}; // 铁门钥匙 - if (id == 26) tmp.event = {'cls': 'items', 'id': 'bigKey'}; // 大黄门钥匙(钥匙盒) - if (id == 27) tmp.event = {'cls': 'items', 'id': 'redJewel'}; // 红宝石 - if (id == 28) tmp.event = {'cls': 'items', 'id': 'blueJewel'}; // 蓝宝石 - if (id == 29) tmp.event = {'cls': 'items', 'id': 'greenJewel'}; // 绿宝石 - if (id == 30) tmp.event = {'cls': 'items', 'id': 'yellowJewel'}; // 黄宝石 - if (id == 31) tmp.event = {'cls': 'items', 'id': 'redPotion'}; // 红血瓶 - if (id == 32) tmp.event = {'cls': 'items', 'id': 'bluePotion'}; // 蓝血瓶 - if (id == 33) tmp.event = {'cls': 'items', 'id': 'greenPotion'}; // 绿血瓶 - if (id == 34) tmp.event = {'cls': 'items', 'id': 'yellowPotion'}; // 黄血瓶 - if (id == 35) tmp.event = {'cls': 'items', 'id': 'sword1'}; // 铁剑 - if (id == 36) tmp.event = {'cls': 'items', 'id': 'shield1'}; // 铁盾 - if (id == 37) tmp.event = {'cls': 'items', 'id': 'sword2'}; // 银剑 - if (id == 38) tmp.event = {'cls': 'items', 'id': 'shield2'}; // 银盾 - if (id == 39) tmp.event = {'cls': 'items', 'id': 'sword3'}; // 骑士剑 - if (id == 40) tmp.event = {'cls': 'items', 'id': 'shield3'}; // 骑士盾 - if (id == 41) tmp.event = {'cls': 'items', 'id': 'sword4'}; // 圣剑 - if (id == 42) tmp.event = {'cls': 'items', 'id': 'shield4'}; // 圣盾 - if (id == 43) tmp.event = {'cls': 'items', 'id': 'sword5'}; // 神圣剑 - if (id == 44) tmp.event = {'cls': 'items', 'id': 'shield5'}; // 神圣盾 - if (id == 45) tmp.event = {'cls': 'items', 'id': 'book'}; // 怪物手册 - if (id == 46) tmp.event = {'cls': 'items', 'id': 'fly'}; // 楼层传送器 - if (id == 47) tmp.event = {'cls': 'items', 'id': 'pickaxe'}; // 破墙镐 - if (id == 48) tmp.event = {'cls': 'items', 'id': 'icePickaxe'}; // 破冰镐 - if (id == 49) tmp.event = {'cls': 'items', 'id': 'bomb'}; // 炸弹 - if (id == 50) tmp.event = {'cls': 'items', 'id': 'centerFly'}; // 中心对称 - if (id == 51) tmp.event = {'cls': 'items', 'id': 'upFly'}; // 上楼器 - if (id == 52) tmp.event = {'cls': 'items', 'id': 'downFly'}; // 下楼器 - if (id == 53) tmp.event = {'cls': 'items', 'id': 'coin'}; // 幸运金币 - if (id == 54) tmp.event = {'cls': 'items', 'id': 'snow'}; // 冰冻徽章 - if (id == 55) tmp.event = {'cls': 'items', 'id': 'cross'}; // 十字架 - if (id == 56) tmp.event = {'cls': 'items', 'id': 'superPotion'}; // 圣水 - if (id == 57) tmp.event = {'cls': 'items', 'id': 'earthquake'} // 地震卷轴 - if (id == 58) tmp.event = {'cls': 'items', 'id': 'poisonWine'} // 解毒药水 - if (id == 59) tmp.event = {'cls': 'items', 'id': 'weakWine'} // 解衰药水 - if (id == 60) tmp.event = {'cls': 'items', 'id': 'curseWine'} // 解咒药水 - if (id == 61) tmp.event = {'cls': 'items', 'id': 'superWine'} // 万能药水 - if (id == 62) tmp.event = {'cls': 'items', 'id': 'knife'} // 屠龙匕首 - if (id == 63) tmp.event = {'cls': 'items', 'id': 'moneyPocket'} // 金钱袋 - if (id == 64) tmp.event = {'cls': 'items', 'id': 'shoes'} // 绿鞋 - if (id == 65) tmp.event = {'cls': 'items', 'id': 'hammer'} // 圣锤 - - - ////////////////////////// 门、楼梯、传送点部分 ////////////////////////// - - // 81-100 门 - if (id == 81) tmp.event = {'cls': 'terrains', 'id': 'yellowDoor', 'trigger': 'openDoor'}; // 黄门 - if (id == 82) tmp.event = {'cls': 'terrains', 'id': 'blueDoor', 'trigger': 'openDoor'}; // 蓝门 - if (id == 83) tmp.event = {'cls': 'terrains', 'id': 'redDoor', 'trigger': 'openDoor'}; // 红门 - if (id == 84) tmp.event = {'cls': 'terrains', 'id': 'greenDoor', 'trigger': 'openDoor'}; // 绿门 - if (id == 85) tmp.event = {'cls': 'terrains', 'id': 'specialDoor', 'trigger': 'openDoor'}; // 机关门左 - if (id == 86) tmp.event = {'cls': 'terrains', 'id': 'steelDoor', 'trigger': 'openDoor'}; // 铁门 - if (id == 87) tmp.event = {'cls': 'terrains', 'id': 'upFloor', 'noPass': false}; // 上楼梯 - if (id == 88) tmp.event = {'cls': 'terrains', 'id': 'downFloor', 'noPass': false}; // 下楼梯 - if (id == 89) tmp.event = {'cls': 'animates', 'id': 'portal', 'noPass': false}; // 传送门 - if (id == 90) tmp.event = {'cls': 'animates', 'id': 'starPortal', 'noPass': false}; // 星空传送门 - if (id == 91) tmp.event = {'cls': 'animates', 'id': 'upPortal', 'noPass': false}; // 上箭头 - if (id == 92) tmp.event = {'cls': 'animates', 'id': 'leftPortal', 'noPass': false}; // 左箭头 - if (id == 93) tmp.event = {'cls': 'animates', 'id': 'downPortal', 'noPass': false}; // 下箭头 - if (id == 94) tmp.event = {'cls': 'animates', 'id': 'rightPortal', 'noPass': false}; // 右箭头 - - - ////////////////////////// NPC部分 ////////////////////////// - - // 121-150 NPC - if (id == 121) tmp.event = {'cls': 'npcs', 'id': 'man'}; - if (id == 122) tmp.event = {'cls': 'npcs', 'id': 'woman'}; - if (id == 123) tmp.event = {'cls': 'npcs', 'id': 'thief'}; - if (id == 124) tmp.event = {'cls': 'npcs', 'id': 'fairy'}; - if (id == 125) tmp.event = {'cls': 'npcs', 'id': 'magician'}; - if (id == 126) tmp.event = {'cls': 'npcs', 'id': 'womanMagician'}; - if (id == 127) tmp.event = {'cls': 'npcs', 'id': 'oldMan'}; - if (id == 128) tmp.event = {'cls': 'npcs', 'id': 'child'}; - if (id == 129) tmp.event = {'cls': 'npcs', 'id': 'wood'}; - if (id == 130) tmp.event = {'cls': 'npcs', 'id': 'pinkShop'}; - if (id == 131) tmp.event = {'cls': 'npcs', 'id': 'blueShop'}; - if (id == 132) tmp.event = {'cls': 'npcs', 'id': 'princess'}; - - ////////////////////////// 其他部分 ////////////////////////// - - // 161-200 其他(单向箭头、灯、箱子等等) - if (id == 161) tmp.event = {'cls': 'terrains', 'id': 'arrowUp', 'noPass': false}; // 单向上箭头 - if (id == 162) tmp.event = {'cls': 'terrains', 'id': 'arrowDown', 'noPass': false}; // 单向下箭头 - if (id == 163) tmp.event = {'cls': 'terrains', 'id': 'arrowLeft', 'noPass': false}; // 单向左箭头 - if (id == 164) tmp.event = {'cls': 'terrains', 'id': 'arrowRight', 'noPass': false}; // 单向右箭头 - if (id == 165) tmp.event = {'cls': 'terrains', 'id': 'light', 'trigger': 'changeLight', 'noPass': false}; // 灯 - if (id == 166) tmp.event = {'cls': 'terrains', 'id': 'darkLight', 'noPass': true}; // 暗灯 - - - ////////////////////////// 怪物部分 ////////////////////////// - - // 201-300 怪物 - if (id == 201) tmp.event = {'cls': 'enemys', 'id': 'greenSlime'}; - if (id == 202) tmp.event = {'cls': 'enemys', 'id': 'redSlime'}; - if (id == 203) tmp.event = {'cls': 'enemys', 'id': 'blackSlime'}; - if (id == 204) tmp.event = {'cls': 'enemys', 'id': 'slimelord'}; - if (id == 205) tmp.event = {'cls': 'enemys', 'id': 'bat'}; - if (id == 206) tmp.event = {'cls': 'enemys', 'id': 'bigBat'}; - if (id == 207) tmp.event = {'cls': 'enemys', 'id': 'redBat'}; - if (id == 208) tmp.event = {'cls': 'enemys', 'id': 'vampire'}; - if (id == 209) tmp.event = {'cls': 'enemys', 'id': 'skeleton'}; - if (id == 210) tmp.event = {'cls': 'enemys', 'id': 'skeletonSoilder'}; - if (id == 211) tmp.event = {'cls': 'enemys', 'id': 'skeletonCaptain'}; - if (id == 212) tmp.event = {'cls': 'enemys', 'id': 'ghostSkeleton'}; - if (id == 213) tmp.event = {'cls': 'enemys', 'id': 'zombie'}; - if (id == 214) tmp.event = {'cls': 'enemys', 'id': 'zombieKnight'}; - if (id == 215) tmp.event = {'cls': 'enemys', 'id': 'rock'}; - if (id == 216) tmp.event = {'cls': 'enemys', 'id': 'slimeMan'}; - if (id == 217) tmp.event = {'cls': 'enemys', 'id': 'bluePriest'}; - if (id == 218) tmp.event = {'cls': 'enemys', 'id': 'redPriest'}; - if (id == 219) tmp.event = {'cls': 'enemys', 'id': 'brownWizard'}; - if (id == 220) tmp.event = {'cls': 'enemys', 'id': 'redWizard'}; - if (id == 221) tmp.event = {'cls': 'enemys', 'id': 'yellowGuard'}; - if (id == 222) tmp.event = {'cls': 'enemys', 'id': 'blueGuard'}; - if (id == 223) tmp.event = {'cls': 'enemys', 'id': 'redGuard'}; - if (id == 224) tmp.event = {'cls': 'enemys', 'id': 'swordsman'}; - if (id == 225) tmp.event = {'cls': 'enemys', 'id': 'soldier'}; - if (id == 226) tmp.event = {'cls': 'enemys', 'id': 'yellowKnight'}; - if (id == 227) tmp.event = {'cls': 'enemys', 'id': 'redKnight'}; - if (id == 228) tmp.event = {'cls': 'enemys', 'id': 'darkKnight'}; - if (id == 229) tmp.event = {'cls': 'enemys', 'id': 'blackKing'}; - if (id == 230) tmp.event = {'cls': 'enemys', 'id': 'yellowKing'}; - if (id == 231) tmp.event = {'cls': 'enemys', 'id': 'greenKing'}; - if (id == 232) tmp.event = {'cls': 'enemys', 'id': 'blueKnight'}; - if (id == 233) tmp.event = {'cls': 'enemys', 'id': 'goldSlime'}; - if (id == 234) tmp.event = {'cls': 'enemys', 'id': 'poisonSkeleton'}; - if (id == 235) tmp.event = {'cls': 'enemys', 'id': 'poisonBat'}; - if (id == 236) tmp.event = {'cls': 'enemys', 'id': 'steelRock'}; - if (id == 237) tmp.event = {'cls': 'enemys', 'id': 'skeletonPriest'}; - if (id == 238) tmp.event = {'cls': 'enemys', 'id': 'skeletonKing'}; - if (id == 239) tmp.event = {'cls': 'enemys', 'id': 'skeletonWizard'}; - if (id == 240) tmp.event = {'cls': 'enemys', 'id': 'redSkeletonCaption'}; - if (id == 241) tmp.event = {'cls': 'enemys', 'id': 'badHero'}; - if (id == 242) tmp.event = {'cls': 'enemys', 'id': 'demon'}; - if (id == 243) tmp.event = {'cls': 'enemys', 'id': 'demonPriest'}; - if (id == 244) tmp.event = {'cls': 'enemys', 'id': 'goldHornSlime'}; - if (id == 245) tmp.event = {'cls': 'enemys', 'id': 'redKing'}; - if (id == 246) tmp.event = {'cls': 'enemys', 'id': 'whiteKing'}; - if (id == 247) tmp.event = {'cls': 'enemys', 'id': 'blackMagician'}; - if (id == 248) tmp.event = {'cls': 'enemys', 'id': 'silverSlime'}; - if (id == 249) tmp.event = {'cls': 'enemys', 'id': 'swordEmperor'}; - if (id == 250) tmp.event = {'cls': 'enemys', 'id': 'whiteHornSlime'}; - if (id == 251) tmp.event = {'cls': 'enemys', 'id': 'badPrincess'}; - if (id == 252) tmp.event = {'cls': 'enemys', 'id': 'badFairy'}; - if (id == 253) tmp.event = {'cls': 'enemys', 'id': 'grayPriest'}; - if (id == 254) tmp.event = {'cls': 'enemys', 'id': 'redSwordsman'}; - if (id == 255) tmp.event = {'cls': 'enemys', 'id': 'whiteGhost'}; - if (id == 256) tmp.event = {'cls': 'enemys', 'id': 'poisonZombie'}; - if (id == 257) tmp.event = {'cls': 'enemys', 'id': 'magicDragon'}; - if (id == 258) tmp.event = {'cls': 'enemys', 'id': 'octopus'}; - if (id == 259) tmp.event = {'cls': 'enemys', 'id': 'darkFairy'}; - if (id == 260) tmp.event = {'cls': 'enemys', 'id': 'greenKnight'}; - - ////////////////////////// 待定... ////////////////////////// - // 目前ID暂时不要超过400 + if (id in this.blocksInfo) tmp.event = JSON.parse(JSON.stringify(this.blocksInfo[id])); return tmp; } diff --git a/main.js b/main.js index b9891a99..0e07327f 100644 --- a/main.js +++ b/main.js @@ -43,6 +43,9 @@ function main() { this.loadList = [ 'items', 'icons', 'maps', 'enemys', 'events', 'data', 'ui', 'core' ]; + this.pureData = [ + "data","enemys","icons","maps","items" + ]; this.images = [ 'animates', 'enemys', 'hero', 'items', 'npcs', 'terrains' // Autotile 动态添加 @@ -90,15 +93,6 @@ function main() { //------------------------ 用户修改内容 ------------------------// this.version = "0.1"; // 游戏版本号;如果更改了游戏内容建议修改此version以免造成缓存问题。 - - this.useCompress = false; // 是否使用压缩文件 - // 当你即将发布你的塔时,请使用“JS代码压缩工具”将所有js代码进行压缩,然后将这里的useCompress改为true。 - // 请注意,只有useCompress是false时才会读取floors目录下的文件,为true时会直接读取libs目录下的floors.min.js文件。 - // 如果要进行剧本的修改请务必将其改成false。 - - this.floorIds = [ // 在这里按顺序放所有的楼层;其顺序直接影响到楼层传送器的顺序和上楼器/下楼器的顺序 - "sample0", "sample1", "sample2", "test" - ] //------------------------ 用户修改内容 END ------------------------// this.floors = {} @@ -110,18 +104,22 @@ main.prototype.init = function () { for (var i = 0; i < main.dom.gameCanvas.length; i++) { main.canvas[main.dom.gameCanvas[i].id] = main.dom.gameCanvas[i].getContext('2d'); } - main.loaderJs(function () { - var coreData = {}; - for (i = 0; i < main.loadList.length; i++) { - var name = main.loadList[i]; - if (name === 'core') continue; - main[name].init(main.dom); - coreData[name] = main[name]; - } - main.loaderFloors(function() { - main.core.init(main.dom, main.statusBar, main.canvas, main.images, main.sounds, main.floorIds, main.floors, coreData); - main.core.resize(main.dom.body.clientWidth, main.dom.body.clientHeight); - }) + main.loadPureData(function(){ + main.useCompress=data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.main.useCompress; + main.floorIds=data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.main.floorIds; + main.loaderJs(function () { + var coreData = {}; + for (i = 0; i < main.loadList.length; i++) { + var name = main.loadList[i]; + if (name === 'core') continue; + main[name].init(main.dom); + coreData[name] = main[name]; + } + main.loaderFloors(function() { + main.core.init(main.dom, main.statusBar, main.canvas, main.images, main.sounds, main.floorIds, main.floors, coreData); + main.core.resize(main.dom.body.clientWidth, main.dom.body.clientHeight); + }); + }); }); } @@ -191,6 +189,20 @@ main.prototype.loadFloor = function(floorId, callback) { } } +main.prototype.loadPureData = function(callback) { + var loadedNum = 0; + main.pureData.forEach(function(name){ + var script = document.createElement('script'); + script.src = 'libs/floors/' + name +'.js?' + this.version; + main.dom.body.appendChild(script); + script.onload = function () { + loadedNum++; + if (loadedNum == main.pureData.length)callback(); + } + }); + +} + main.prototype.setMainTipsText = function (text) { main.dom.mainTips.innerHTML = text; } From d8ea628f111d6e3d636a9bcf9766fabb36b6838b Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Thu, 28 Dec 2017 17:15:45 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/{floors => project}/data.js | 0 libs/{floors => project}/enemys.js | 0 libs/{ => project}/floors/MT0.js | 0 libs/{ => project}/floors/sample0.js | 0 libs/{ => project}/floors/sample1.js | 0 libs/{ => project}/floors/sample2.js | 0 libs/{ => project}/floors/test.js | 0 libs/{floors => project}/icons.js | 0 libs/{floors => project}/items.js | 0 libs/{floors => project}/maps.js | 0 main.js | 6 +++--- 11 files changed, 3 insertions(+), 3 deletions(-) rename libs/{floors => project}/data.js (100%) rename libs/{floors => project}/enemys.js (100%) rename libs/{ => project}/floors/MT0.js (100%) rename libs/{ => project}/floors/sample0.js (100%) rename libs/{ => project}/floors/sample1.js (100%) rename libs/{ => project}/floors/sample2.js (100%) rename libs/{ => project}/floors/test.js (100%) rename libs/{floors => project}/icons.js (100%) rename libs/{floors => project}/items.js (100%) rename libs/{floors => project}/maps.js (100%) diff --git a/libs/floors/data.js b/libs/project/data.js similarity index 100% rename from libs/floors/data.js rename to libs/project/data.js diff --git a/libs/floors/enemys.js b/libs/project/enemys.js similarity index 100% rename from libs/floors/enemys.js rename to libs/project/enemys.js diff --git a/libs/floors/MT0.js b/libs/project/floors/MT0.js similarity index 100% rename from libs/floors/MT0.js rename to libs/project/floors/MT0.js diff --git a/libs/floors/sample0.js b/libs/project/floors/sample0.js similarity index 100% rename from libs/floors/sample0.js rename to libs/project/floors/sample0.js diff --git a/libs/floors/sample1.js b/libs/project/floors/sample1.js similarity index 100% rename from libs/floors/sample1.js rename to libs/project/floors/sample1.js diff --git a/libs/floors/sample2.js b/libs/project/floors/sample2.js similarity index 100% rename from libs/floors/sample2.js rename to libs/project/floors/sample2.js diff --git a/libs/floors/test.js b/libs/project/floors/test.js similarity index 100% rename from libs/floors/test.js rename to libs/project/floors/test.js diff --git a/libs/floors/icons.js b/libs/project/icons.js similarity index 100% rename from libs/floors/icons.js rename to libs/project/icons.js diff --git a/libs/floors/items.js b/libs/project/items.js similarity index 100% rename from libs/floors/items.js rename to libs/project/items.js diff --git a/libs/floors/maps.js b/libs/project/maps.js similarity index 100% rename from libs/floors/maps.js rename to libs/project/maps.js diff --git a/main.js b/main.js index 0e07327f..7653d2cf 100644 --- a/main.js +++ b/main.js @@ -149,7 +149,7 @@ main.prototype.loaderFloors = function (callback) { main.setMainTipsText('正在加载楼层文件...') if (this.useCompress) { // 读取压缩文件 var script = document.createElement('script'); - script.src = 'libs/floors.min.js?' + this.version; + script.src = 'libs/project/floors.min.js?' + this.version; main.dom.body.appendChild(script); script.onload = function () { main.dom.mainTips.style.display = 'none'; @@ -182,7 +182,7 @@ main.prototype.loadMod = function (modName, callback) { main.prototype.loadFloor = function(floorId, callback) { var script = document.createElement('script'); - script.src = 'libs/floors/' + floorId +'.js?' + this.version; + script.src = 'libs/project/floors/' + floorId +'.js?' + this.version; main.dom.body.appendChild(script); script.onload = function () { callback(floorId); @@ -193,7 +193,7 @@ main.prototype.loadPureData = function(callback) { var loadedNum = 0; main.pureData.forEach(function(name){ var script = document.createElement('script'); - script.src = 'libs/floors/' + name +'.js?' + this.version; + script.src = 'libs/project/' + name +'.js?' + this.version; main.dom.body.appendChild(script); script.onload = function () { loadedNum++; From f92124e16238482a222d511bb8dca4dd54865dee Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Sat, 30 Dec 2017 12:02:19 +0800 Subject: [PATCH 04/12] editor.file demo --- _server/editor_file.js | 89 ++++++++++++++++++++++++++++++++++++++++++ drawMapGUI.html | 5 +++ 2 files changed, 94 insertions(+) create mode 100644 _server/editor_file.js diff --git a/_server/editor_file.js b/_server/editor_file.js new file mode 100644 index 00000000..f245b77a --- /dev/null +++ b/_server/editor_file.js @@ -0,0 +1,89 @@ +(function(){ + + editor_file = {}; + + editor_file.getFloorFileList = function(editor,callback){ + if (isset(callback)) callback(['simple0.js','simple1.js','simple2.js'],null); + } + //callback(Array,err:String) + editor_file.loadFloorFile = function(editor,filename,callback){ + if (isset(callback)) callback('',null); + } + //callback(String,err:String) + editor_file.saveFloorFile = function(editor,callback){ + if (isset(callback)) callback(null); + } + //callback(err:String) + editor_file.saveFloorFile = function(editor,saveAsFilename,callback){ + if (isset(callback)) callback(null); + } + //callback(err:String) + + //////////////////////////////////////////////////////////////////// + + editor_file.changeIdAndIdnum = function(editor,id,idnum,callback){ + if (isset(callback)) callback(null); + } + //callback(err:String) + editor_file.editItem = function(editor,id,obj,callback){ + //obj形式同callback的obj,为null或undefined时只查询不修改 + if (isset(callback)) callback( + {'items':{'cls': 'items', 'name': '红宝石'},'itemEffect':'core.status.hero.atk += core.values.redJewel','itemEffectTip':"',攻击+'+core.values.redJewel"}, + {'items':'','itemEffect':'','itemEffectTip':''}, + null); + //只有items.cls是items的才有itemEffect和itemEffectTip,keys和constants和tools只有items + } + //callback(obj,commentObj,err:String) + editor_file.editEnemy = function(editor,id,obj,callback){ + //obj形式同callback的obj,为null或undefined时只查询不修改 + if (isset(callback)) callback( + {'name': '初级巫师', 'hp': 100, 'atk': 120, 'def': 0, 'money': 16, 'experience': 0, 'special': 15, 'value': 100, "bomb": false}, + {'name': '名称', 'hp': '生命值', 'atk': '攻击力', 'def': '防御力', 'money': '金币', 'experience': '经验', 'special': '特殊属性\n1:先攻,2:魔攻,3:坚固,4:2连击,5:3连击,6:4连击,7:破甲,8:反击,9:净化,10:模仿,11:吸血,12:中毒,13:衰弱,14:诅咒,15:领域,16:夹击,17:仇恨\n多个属性例如用010411表示先攻2连击吸血\n模仿怪的攻防设为0就好\n', 'value': '特殊属性的数值\n领域怪需要加value表示领域伤害的数值\n吸血怪需要在后面添加value代表吸血比例', 'bomb':' 加入 "bomb": false 代表该怪物不可被炸弹或圣锤炸掉'}, + null); + } + //callback(obj,commentObj,err:String) + + //////////////////////////////////////////////////////////////////// + + editor_file.editLoc = function(editor,x,y,obj,callback){ + //obj形式同callback的obj,为null或undefined时只查询不修改 + if (isset(callback)) callback( + {"events":['\t[老人,man]这些是本样板支持的所有的道具。\n\n道具分为三类:items, constants, tools。\nitems 为即捡即用类道具,例如宝石、血瓶、剑盾等。\nconstants 为永久道具,例如怪物手册、楼层传送器、幸运金币等。\ntools 为消耗类道具,例如破墙镐、炸弹、中心对称飞行器等。\n\n后两类道具在工具栏中可以看到并使用。', '\t[老人,man]有关道具效果,定义在items.js中。\n目前大多数道具已有默认行为,如有自定义的需求则需在items.js中修改代码。', '\t[老人,man]constants 和 tools 各最多只允许12种,多了会导致图标溢出。', '\t[老人,man]拾取道具结束后可触发 afterGetItem 事件。\n\n有关事件的各种信息在下一层会有更为详细的说明。', {'type': 'hide', 'time': 500}],"changeFloor":"","afterBattle":"","afterGetItem":"","afterOpenDoor":""}, + {"events":['', '', '', '', {'type': '', 'time': ' // 消失 \n // 守着门的老人 '}],"changeFloor":"","afterBattle":"","afterGetItem":"","afterOpenDoor":""}, + null); + } + //callback(obj,commentObj,err:String) + + //////////////////////////////////////////////////////////////////// + + editor_file.editFloor = function(editor,obj,callback){ + //obj形式同callback的obj,为null或undefined时只查询不修改 + if (isset(callback)) callback( + {'floorId': 'sample0', 'title': '样板 0 层', 'name': '0', 'canFlyTo': True, 'canUseQuickShop': True, 'defaultGround': 'ground', 'firstArrive': ['\t[样板提示]首次到达某层可以触发 firstArrive 事件,该事件可类似于RMXP中的“自动执行脚本”。\n\n本事件支持一切的事件类型,常常用来触发对话,例如:', '\t[hero]我是谁?我从哪来?我又要到哪去?', '\t[仙子,fairy]你问我...?我也不知道啊...', '本层主要对道具、门、怪物等进行介绍,有关事件的各种信息在下一层会有更为详细的说明。']}, + {'floorId': '// 这里需要改楼层名,请和文件名及下面的floorId保持完全一致 // 楼层唯一标识符仅能由字母、数字、下划线组成,且不能由数字开头 // 推荐用法:第20层就用MT20,第38层就用MT38,地下6层就用MT_6(用下划线代替负号),隐藏3层用MT3h(h表示隐藏),等等 \n // 楼层唯一标识符,需要和名字完全一致 ', 'title': ' // 楼层中文名 ', 'name': ' // 显示在状态栏中的层数 ', 'canFlyTo': ' // 该楼能否被楼传器飞到(不能的话在该楼也不允许使用楼传器) ', 'canUseQuickShop': ' // 该层是否允许使用快捷商店 ', 'defaultGround': ' // 默认地面的图块ID(terrains中) \n // 地图数据,需要是13x13,建议使用地图生成器来生成 ', 'firstArrive': ['', '', '', ' // 该楼的所有可能事件列表 \n // 守着道具的老人 ']}, + null); + } + //callback(obj,commentObj,err:String) + + //////////////////////////////////////////////////////////////////// + + + + editor_file.editTower = function(editor,obj,callback){ + //obj形式同callback的obj,为null或undefined时只查询不修改 + if (isset(callback)) callback( + {'main': {'useCompress': False, 'floorIds': ['sample0', 'sample1', 'sample2', 'test']}, 'firstData': {'title': '魔塔样板', 'name': 'template', 'version': 'Ver 1.0.0 (Beta)', 'floorId': 'sample0', 'hero': {'name': '阳光', 'lv': 1, 'hp': 2000, 'atk': 100, 'def': 100, 'mdef': 100, 'money': 100, 'experience': 0, 'items': {'keys': {'yellowKey': 0, 'blueKey': 0, 'redKey': 0}, 'constants': {}, 'tools': {}}, 'flyRange': [], 'loc': {'direction': 'up', 'x': 6, 'y': 10}, 'flags': {'poison': False, 'weak': False, 'curse': False}}, 'startText': ['Hi,欢迎来到 HTML5 魔塔样板!\n\n本样板由艾之葵制作,可以让你在不会写任何代码\n的情况下也能做出属于自己的H5魔塔!', '这里游戏开始时的剧情。\n定义在data.js的startText处。\n\n你可以在这里写上自己的内容。', '赶快来试一试吧!'], 'shops': {'moneyShop1': {'name': '贪婪之神', 'icon': 'blueShop', 'textInList': '1F金币商店', 'use': 'money', 'need': '20+10*times*(times+1)', 'text': '勇敢的武士啊,给我${need}金币就可以:', 'choices': [{'text': '生命+800', 'effect': 'status:hp+=800'}, {'text': '攻击+4', 'effect': 'status:atk+=4'}, {'text': '防御+4', 'effect': 'status:def+=4'}, {'text': '魔防+10', 'effect': 'status:mdef+=10'}]}, 'expShop1': {'name': '经验之神', 'icon': 'pinkShop', 'textInList': '1F经验商店', 'use': 'experience', 'need': '-1', 'text': '勇敢的武士啊,给我若干经验就可以:', 'choices': [{'text': '等级+1', 'need': '100', 'effect': 'status:lv+=1;status:hp+=1000;status:atk+=7;status:def+=7'}, {'text': '攻击+5', 'need': '30', 'effect': 'status:atk+=5'}, {'text': '防御+5', 'need': '30', 'effect': 'status:def+=5'}]}}, 'levelUp': [{}, {'need': 20, 'name': '第二级', 'effect': 'status:hp+=2*(status:atk+status:def);status:atk+=10;status:def+=10'}, {'need': 40, 'effect': 'function () {\n core.drawText("恭喜升级!");\n core.status.hero.hp *= 2;\n core.status.hero.atk += 100;\n core.status.hero.def += 100;\n }'}]}, 'values': {'HPMAX': 999999, 'lavaDamage': 100, 'poisonDamage': 10, 'weakValue': 20, 'redJewel': 3, 'blueJewel': 3, 'greenJewel': 5, 'redPotion': 100, 'bluePotion': 250, 'yellowPotion': 500, 'greenPotion': 800, 'sword1': 10, 'shield1': 10, 'sword2': 20, 'shield2': 20, 'sword3': 40, 'shield3': 40, 'sword4': 80, 'shield4': 80, 'sword5': 160, 'shield5': 160, 'moneyPocket': 500, 'breakArmor': 0.9, 'counterAttack': 0.1, 'purify': 3, 'hatred': 2, 'animateSpeed': 500}, 'flags': {'enableNegativeDamage': True, 'enableFloor': False, 'enableLv': True, 'enableMDef': True, 'enableMoney': True, 'enableExperience': True, 'enableLevelUp': False, 'enableDebuff': True, 'flyNearStair': True, 'pickaxeFourDirections': True, 'bombFourDirections': True, 'bigKeyIsBox': False, 'startDirectly': False, 'canOpenBattleAnimate': True, 'showBattleAnimateConfirm': True, 'battleAnimate': True, 'displayEnemyDamage': True, 'displayExtraDamage': False, 'enableGentleClick': True, 'portalWithoutTrigger': True, 'potionWhileRouting': False}}, + {'main': {'useCompress': ' // 是否使用压缩文件 // 当你即将发布你的塔时,请使用“JS代码压缩工具”将所有js代码进行压缩,然后将这里的useCompress改为true。 // 请注意,只有useCompress是false时才会读取floors目录下的文件,为true时会直接读取libs目录下的floors.min.js文件。 // 如果要进行剧本的修改请务必将其改成false。 \n // 在这里按顺序放所有的楼层;其顺序直接影响到楼层传送器的顺序和上楼器/下楼器的顺序 ', 'floorIds': ['', '', '', '']}, 'firstData': {'title': ' // 游戏名,将显示在标题页面以及切换楼层的界面中 ', 'name': ' // 游戏的唯一英文标识符。由英文、数字、下划线组成,不能超过20个字符。 ', 'version': ' // 当前游戏版本;版本不一致的存档不能通用。 ', 'floorId': ' // 初始楼层ID \n // 勇士初始数据 ', 'hero': {'name': ' // 勇士名;可以改成喜欢的 ', 'lv': ' // 初始等级,该项必须为正整数 ', 'hp': ' // 初始生命值 ', 'atk': ' // 初始攻击 ', 'def': ' // 初始防御 ', 'mdef': ' // 初始魔防 ', 'money': ' // 初始金币 ', 'experience': ' // 初始经验 \n // 初始道具个数 ', 'items': {'keys': {'yellowKey': '', 'blueKey': '', 'redKey': ''}, 'constants': '', 'tools': ''}, 'flyRange': ' // 初始可飞的楼层;一般留空数组即可 ', 'loc': {'direction': '', 'x': '', 'y': ' // 勇士初始位置 \n // 游戏过程中的变量或flags '}, 'flags': {'poison': ' // 毒 ', 'weak': ' // 衰 ', 'curse': ' // 咒 \n // 游戏开始前剧情。如果无剧情直接留一个空数组即可。 '}}, 'startText': ['', '', ' // 定义全局商店(即快捷商店) \n // 商店唯一ID '], 'shops': {'moneyShop1': {'name': ' // 商店名称(标题) ', 'icon': ' // 商店图标,blueShop为蓝色商店,pinkShop为粉色商店 ', 'textInList': ' // 在快捷商店栏中显示的名称 ', 'use': ' // 商店所要使用的。只能是"money"或"experience"。 ', 'need': ' // 商店需要的金币/经验数值;可以是一个表达式,以times作为参数计算。 // 这里用到的times为该商店的已经的访问次数。首次访问该商店时times的值为0。 // 上面的例子是50层商店的计算公式。你也可以写任意其他的计算公式,只要以times作为参数即可。 // 例如: "need": "25" 就是恒定需要25金币的商店; "need": "20+2*times" 就是第一次访问要20金币,以后每次递增2金币的商店。 // 如果是对于每个选项有不同的计算公式,写 "need": "-1" 即可。可参见下面的经验商店。 ', 'text': ' // 显示的文字,需手动加换行符。可以使用${need}表示上面的need值。 \n // 商店的选项 ', 'choices': [{'text': '', 'effect': ' // 如果有多个effect以分号分开,参见下面的经验商店 '}, {'text': '', 'effect': ''}, {'text': '', 'effect': ''}, {'text': '', 'effect': ' // effect只能对status和item进行操作,不能修改flag值。 // 必须是X+=Y的形式,其中Y可以是一个表达式,以status:xxx或item:xxx为参数 // 其他effect样例: // "item:yellowKey+=1" 黄钥匙+1 // "item:pickaxe+=3" 破墙镐+3 // "status:hp+=2*(status:atk+status:def)" 将生命提升攻防和的数值的两倍 \n // 商店唯一ID '}]}, 'expShop1': {'name': '', 'icon': '', 'textInList': '', 'use': ' // 该商店使用的是经验进行计算 ', 'need': ' // 如果是对于每个选项所需要的数值不同,这里直接写-1,然后下面选项里给定具体数值 ', 'text': ' // 在choices中写need,可以针对每个选项都有不同的需求。 // 这里的need同样可以以times作为参数,比如 "need": "100+20*times" ', 'choices': [{'text': '', 'need': '', 'effect': ' // 多个effect直接以分号分开即可。如上面的意思是生命+1000,攻击+7,防御+7。 '}, {'text': '', 'need': '', 'effect': ''}, {'text': '', 'need': '', 'effect': ' // 经验升级所需要的数值,是一个数组 '}]}}, 'levelUp': [' // 第一项为初始等级,可以简单留空,也可以写name // 每一个里面可以含有三个参数 name, need, effect // need为所需要的经验数值,是一个正整数。请确保need所需的依次递增 // name为该等级的名称,也可以省略代表使用系统默认值;本项将显示在状态栏中 // effect为本次升级所执行的操作,可由若干项组成,由分号分开 // 其中每一项写法和上面的商店完全相同,同样必须是X+=Y的形式,Y是一个表达式,同样可以使用status:xxx或item:xxx代表勇士的某项数值/道具个数 ', {'need': '', 'name': '', 'effect': ' // 先将生命提升攻防和的2倍;再将攻击+10,防御+10 // effect也允许写一个function,代表本次升级将会执行的操作 '}, {'need': '', 'effect': ' // 依次往下写需要的数值即可 \n // 各种数值;一些数值可以在这里设置 \n /****** 角色相关 ******/ '}]}, 'values': {'HPMAX': ' // HP上限;-1则无上限 ', 'lavaDamage': ' // 经过血网受到的伤害 ', 'poisonDamage': ' // 中毒后每步受到的伤害 ', 'weakValue': ' // 衰弱状态下攻防减少的数值 /****** 道具相关 ******/ ', 'redJewel': ' // 红宝石加攻击的数值 ', 'blueJewel': ' // 蓝宝石加防御的数值 ', 'greenJewel': ' // 绿宝石加魔防的数值 ', 'redPotion': ' // 红血瓶加血数值 ', 'bluePotion': ' // 蓝血瓶加血数值 ', 'yellowPotion': ' // 黄血瓶加血数值 ', 'greenPotion': ' // 绿血瓶加血数值 ', 'sword1': ' // 铁剑加攻数值 ', 'shield1': ' // 铁盾加防数值 ', 'sword2': ' // 银剑加攻数值 ', 'shield2': ' // 银盾加防数值 ', 'sword3': ' // 骑士剑加攻数值 ', 'shield3': ' // 骑士盾加防数值 ', 'sword4': ' // 圣剑加攻数值 ', 'shield4': ' // 圣盾加防数值 ', 'sword5': ' // 神圣剑加攻数值 ', 'shield5': ' // 神圣盾加防数值 ', 'moneyPocket': ' // 金钱袋加金币的数值 /****** 怪物相关 ******/ ', 'breakArmor': ' // 破甲的比例(战斗前,怪物附加角色防御的x%作为伤害) ', 'counterAttack': ' // 反击的比例(战斗时,怪物每回合附加角色攻击的x%作为伤害,无视角色防御) ', 'purify': ' // 净化的比例(战斗前,怪物附加勇士魔防的x倍作为伤害) ', 'hatred': ' // 仇恨属性中,每杀死一个怪物获得的仇恨值 /****** 系统相关 ******/ ', 'animateSpeed': ' // 动画时间 \n // 系统FLAG,在游戏运行中中请不要修改它。 \n /****** 角色状态相关 ******/ '}, 'flags': {'enableNegativeDamage': ' // 是否支持负伤害(回血) ', 'enableFloor': ' // 是否在状态栏显示当前楼层 ', 'enableLv': ' // 是否在状态栏显示当前等级 ', 'enableMDef': ' // 是否在状态栏及战斗界面显示魔防(护盾) ', 'enableMoney': ' // 是否在状态栏、怪物手册及战斗界面显示金币 ', 'enableExperience': ' // 是否在状态栏、怪物手册及战斗界面显示经验 ', 'enableLevelUp': ' // 是否允许等级提升(进阶);如果上面enableExperience为false,则此项恒视为false ', 'enableDebuff': ' // 是否涉及毒衰咒;如果此项为false则不会在状态栏中显示毒衰咒的debuff ////// 上述的几个开关将直接影响状态栏的显示效果 ////// /****** 道具相关 ******/ ', 'flyNearStair': ' // 是否需要在楼梯边使用传送器 ', 'pickaxeFourDirections': ' // 使用破墙镐是否四个方向都破坏;如果false则只破坏面前的墙壁 ', 'bombFourDirections': ' // 使用炸弹是否四个方向都会炸;如果false则只炸面前的怪物(即和圣锤等价) ', 'bigKeyIsBox': ' // 如果此项为true,则视为钥匙盒,红黄蓝钥匙+1;若为false,则视为大黄门钥匙 /****** 系统相关 ******/ ', 'startDirectly': ' // 点击“开始游戏”后是否立刻开始游戏而不显示难度选择界面 ', 'canOpenBattleAnimate': ' // 是否允许用户开启战斗过程;如果此项为false,则下面两项均强制视为false ', 'showBattleAnimateConfirm': ' // 是否在游戏开始时提供“是否开启战斗动画”的选项 ', 'battleAnimate': ' // 是否默认显示战斗动画;用户可以手动在菜单栏中开关 ', 'displayEnemyDamage': ' // 是否地图怪物显伤;用户可以手动在菜单栏中开关 ', 'displayExtraDamage': ' // 是否地图高级显伤(领域、夹击等);用户可以手动在菜单栏中开关 ', 'enableGentleClick': ' // 是否允许轻触(获得面前物品) ', 'portalWithoutTrigger': ' // 经过楼梯、传送门时是否能“穿透”。穿透的意思是,自动寻路得到的的路径中间经过了楼梯,行走时是否触发楼层转换事件 ', 'potionWhileRouting': ' // 寻路算法是否经过血瓶;如果该项为false,则寻路算法会自动尽量绕过血瓶 '}}, + null); + } + //callback(obj,commentObj,err:String) + + //////////////////////////////////////////////////////////////////// + + var isset = function (val) { + if (val == undefined || val == null) { + return false; + } + return true + } +})(); \ No newline at end of file diff --git a/drawMapGUI.html b/drawMapGUI.html index 7b2fcad2..c49a6b66 100644 --- a/drawMapGUI.html +++ b/drawMapGUI.html @@ -373,6 +373,7 @@ + + + + + \ No newline at end of file From fd8a03a90de04f3240de946b466cc6c7afaa5368 Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Sun, 31 Dec 2017 10:49:57 +0800 Subject: [PATCH 07/12] merge 1.3 into 2.0 merge data --- libs/project/data.js | 26 ++-- libs/project/enemys.js | 120 ++++++++-------- libs/project/items.js | 2 +- libs/project/maps.js | 317 ++++++++++++++++++++--------------------- 4 files changed, 233 insertions(+), 232 deletions(-) diff --git a/libs/project/data.js b/libs/project/data.js index 1bbe4e26..9ea2276b 100644 --- a/libs/project/data.js +++ b/libs/project/data.js @@ -17,8 +17,8 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "floorId": "sample0", // 初始楼层ID "hero": { // 勇士初始数据 "name": "阳光", // 勇士名;可以改成喜欢的 - "lv": 1, // 初始等级,该项必须为正整数 - "hp": 2000, // 初始生命值 + 'lv': 1, // 初始等级,该项必须为正整数 + "hp": 1000, // 初始生命值 "atk": 100, // 初始攻击 "def": 100, // 初始防御 "mdef": 100, // 初始魔防 @@ -92,7 +92,7 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "levelUp": [ // 经验升级所需要的数值,是一个数组 {}, // 第一项为初始等级,可以简单留空,也可以写name - // 每一个里面可以含有三个参数 name, need, effect + // 每一个里面可以含有三个参数 need, name, effect // need为所需要的经验数值,是一个正整数。请确保need所需的依次递增 // name为该等级的名称,也可以省略代表使用系统默认值;本项将显示在状态栏中 // effect为本次升级所执行的操作,可由若干项组成,由分号分开 @@ -137,19 +137,18 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "shield5": 160, // 神圣盾加防数值 "moneyPocket": 500, // 金钱袋加金币的数值 /****** 怪物相关 ******/ - "breakArmor": 0.9, // 破甲的比例(战斗前,怪物附加角色防御的x%作为伤害) - "counterAttack": 0.1, // 反击的比例(战斗时,怪物每回合附加角色攻击的x%作为伤害,无视角色防御) - "purify": 3, // 净化的比例(战斗前,怪物附加勇士魔防的x倍作为伤害) - "hatred": 2, // 仇恨属性中,每杀死一个怪物获得的仇恨值 + 'breakArmor': 0.9, // 破甲的比例(战斗前,怪物附加角色防御的x%作为伤害) + 'counterAttack': 0.1, // 反击的比例(战斗时,怪物每回合附加角色攻击的x%作为伤害,无视角色防御) + 'purify': 3, // 净化的比例(战斗前,怪物附加勇士魔防的x倍作为伤害) + 'hatred': 2, // 仇恨属性中,每杀死一个怪物获得的仇恨值 /****** 系统相关 ******/ - "animateSpeed": 500, // 动画时间 + 'animateSpeed': 500, // 动画时间 }, // 系统FLAG,在游戏运行中中请不要修改它。 "flags" : { - /****** 角色状态相关 ******/ - "enableNegativeDamage": true, // 是否支持负伤害(回血) - "enableFloor": false, // 是否在状态栏显示当前楼层 - "enableLv": true, // 是否在状态栏显示当前等级 + /****** 状态栏相关 ******/ + "enableFloor": true, // 是否在状态栏显示当前楼层 + "enableLv": false, // 是否在状态栏显示当前等级 "enableMDef": true, // 是否在状态栏及战斗界面显示魔防(护盾) "enableMoney": true, // 是否在状态栏、怪物手册及战斗界面显示金币 "enableExperience": true, // 是否在状态栏、怪物手册及战斗界面显示经验 @@ -161,6 +160,9 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "pickaxeFourDirections": true, // 使用破墙镐是否四个方向都破坏;如果false则只破坏面前的墙壁 "bombFourDirections": true, // 使用炸弹是否四个方向都会炸;如果false则只炸面前的怪物(即和圣锤等价) "bigKeyIsBox": false, // 如果此项为true,则视为钥匙盒,红黄蓝钥匙+1;若为false,则视为大黄门钥匙 + /****** 怪物相关 ******/ + "enableNegativeDamage": true, // 是否支持负伤害(回血) + "zoneSquare": false, // 领域类型。如果此项为true则为九宫格伤害,为false则为十字伤害 /****** 系统相关 ******/ "startDirectly": false, // 点击“开始游戏”后是否立刻开始游戏而不显示难度选择界面 "canOpenBattleAnimate": true, // 是否允许用户开启战斗过程;如果此项为false,则下面两项均强制视为false diff --git a/libs/project/enemys.js b/libs/project/enemys.js index 7952ffd1..dd9cdae5 100644 --- a/libs/project/enemys.js +++ b/libs/project/enemys.js @@ -1,63 +1,63 @@ enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 = //1:先攻,2:魔攻,3:坚固,4:2连击,5:3连击,6:4连击,7:破甲,8:反击,9:净化,10:模仿,11:吸血,12:中毒,13:衰弱,14:诅咒,15:领域,16:夹击,17:仇恨 { - "greenSlime": {"name": "绿头怪", "hp": 100, "atk": 120, "def": 0, "money": 1, "experience": 1, "special": 0}, - "redSlime": {"name": "红头怪", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "blackSlime": {"name": "青头怪", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "slimelord": {"name": "怪王", "hp": 100, "atk": 120, "def": 0, "money": 10, "experience": 0, "special": 9}, - "bat": {"name": "小蝙蝠", "hp": 100, "atk": 120, "def": 0, "money": 2, "experience": 0, "special": 1}, - "bigBat": {"name": "大蝙蝠", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "redBat": {"name": "红蝙蝠", "hp": 100, "atk": 120, "def": 0, "money": 5, "experience": 0, "special": 4}, - "vampire": {"name": "冥灵魔王", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "skeleton": {"name": "骷髅人", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "skeletonSoilder": {"name": "骷髅士兵", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "skeletonCaptain": {"name": "骷髅队长", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "ghostSkeleton": {"name": "冥队长", "hp": 100, "atk": 120, "def": 0, "money": 8, "experience": 0, "special": 7}, - "zombie": {"name": "兽人", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "zombieKnight": {"name": "兽人武士", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "rock": {"name": "石头人", "hp": 100, "atk": 120, "def": 0, "money": 4, "experience": 0, "special": 3}, - "slimeMan": {"name": "影子战士", "hp": 100, "atk": 0, "def": 0, "money": 11, "experience": 0, "special": 10}, // 模仿怪的攻防设为0就好 - "bluePriest": {"name": "初级法师", "hp": 100, "atk": 120, "def": 0, "money": 3, "experience": 0, "special": 2}, - "redPriest": {"name": "高级法师", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "brownWizard": {"name": "初级巫师", "hp": 100, "atk": 120, "def": 0, "money": 16, "experience": 0, "special": 15, "value": 100}, // 领域怪需要加value表示领域伤害的数值 - "redWizard": {"name": "高级巫师", "hp": 1000, "atk": 1200, "def": 0, "money": 160, "experience": 0, "special": 15, "value": 200}, - "yellowGuard": {"name": "初级卫兵", "hp": 100, "atk": 120, "def": 0, "money": 10, "experience": 0, "special": 0}, - "blueGuard": {"name": "中级卫兵", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "redGuard": {"name": "高级卫兵", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "swordsman": {"name": "双手剑士", "hp": 100, "atk": 120, "def": 0, "money": 6, "experience": 0, "special": 5}, - "soldier": {"name": "冥战士", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "yellowKnight": {"name": "金骑士", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "redKnight": {"name": "红骑士", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "darkKnight": {"name": "黑骑士", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "blackKing": {"name": "黑衣魔王", "hp": 1000, "atk": 500, "def": 0, "money": 1000, "experience": 1000, "special": 0, "bomb": false}, // 加入 "bomb": false 代表该怪物不可被炸弹或圣锤炸掉 - "yellowKing": {"name": "黄衣魔王", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "greenKing": {"name": "青衣武士", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "blueKnight": {"name": "蓝骑士", "hp": 100, "atk": 120, "def": 0, "money": 9, "experience": 0, "special": 8}, - "goldSlime": {"name": "黄头怪", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "poisonSkeleton": {"name": "紫骷髅", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "poisonBat": {"name": "紫蝙蝠", "hp": 100, "atk": 120, "def": 0, "money": 14, "experience": 0, "special": 13}, - "steelRock": {"name": "铁面人", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "skeletonPriest": {"name": "骷髅法师", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "skeletonKing": {"name": "骷髅王", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "skeletonWizard": {"name": "骷髅巫师", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "redSkeletonCaption": {"name": "骷髅武士", "hp": 0, "atk": 0, "def": 0, "money": 0, "special": 0}, - "badHero": {"name": "迷失勇者", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "demon": {"name": "魔神武士", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "demonPriest": {"name": "魔神法师", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "goldHornSlime": {"name": "金角怪", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "redKing": {"name": "红衣魔王", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "whiteKing": {"name": "白衣武士", "hp": 100, "atk": 120, "def": 0, "money": 17, "experience": 0, "special": 16}, - "blackMagician": {"name": "黑暗大法师", "hp": 100, "atk": 120, "def": 0, "money": 12, "experience": 0, "special": 11, "value": 1/3, "bomb": false}, // 吸血怪需要在后面添加value代表吸血比例 - "silverSlime": {"name": "银头怪", "hp": 100, "atk": 120, "def": 0, "money": 15, "experience": 0, "special": 14}, - "swordEmperor": {"name": "剑圣", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "whiteHornSlime": {"name": "尖角怪", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "badPrincess": {"name": "痛苦魔女", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "badFairy": {"name": "黑暗仙子", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "grayPriest": {"name": "中级法师", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "redSwordsman": {"name": "剑王", "hp": 100, "atk": 120, "def": 0, "money": 7, "experience": 0, "special": 6}, - "whiteGhost": {"name": "水银战士", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "poisonZombie": {"name": "绿兽人", "hp": 100, "atk": 120, "def": 0, "money": 13, "experience": 0, "special": 12}, - "magicDragon": {"name": "魔龙", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "octopus": {"name": "血影", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "darkFairy": {"name": "仙子", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, - "greenKnight": {"name": "强盾骑士", "hp": 0, "atk": 0, "def": 0, "money": 0, "experience": 0, "special": 0}, + 'greenSlime': {'name': '绿头怪', 'hp': 100, 'atk': 120, 'def': 0, 'money': 1, 'experience': 1, 'special': [1,5,7,8]}, + 'redSlime': {'name': '红头怪', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'blackSlime': {'name': '青头怪', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'slimelord': {'name': '怪王', 'hp': 100, 'atk': 120, 'def': 0, 'money': 10, 'experience': 0, 'special': [1,9]}, + 'bat': {'name': '小蝙蝠', 'hp': 100, 'atk': 120, 'def': 0, 'money': 2, 'experience': 0, 'special': 1}, + 'bigBat': {'name': '大蝙蝠', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'redBat': {'name': '红蝙蝠', 'hp': 100, 'atk': 120, 'def': 0, 'money': 5, 'experience': 0, 'special': 4}, + 'vampire': {'name': '冥灵魔王', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'skeleton': {'name': '骷髅人', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'skeletonSoilder': {'name': '骷髅士兵', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'skeletonCaptain': {'name': '骷髅队长', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'ghostSkeleton': {'name': '冥队长', 'hp': 100, 'atk': 120, 'def': 0, 'money': 8, 'experience': 0, 'special': 7}, + 'zombie': {'name': '兽人', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'zombieKnight': {'name': '兽人武士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'rock': {'name': '石头人', 'hp': 100, 'atk': 120, 'def': 0, 'money': 4, 'experience': 0, 'special': 3}, + 'slimeMan': {'name': '影子战士', 'hp': 100, 'atk': 0, 'def': 0, 'money': 11, 'experience': 0, 'special': 10}, // 模仿怪的攻防设为0就好 + 'bluePriest': {'name': '初级法师', 'hp': 100, 'atk': 120, 'def': 0, 'money': 3, 'experience': 0, 'special': 2}, + 'redPriest': {'name': '高级法师', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'brownWizard': {'name': '初级巫师', 'hp': 100, 'atk': 120, 'def': 0, 'money': 16, 'experience': 0, 'special': 15, 'value': 100, 'zoneSquare': true}, // 领域怪需要加value表示领域伤害的数值;zoneSquare代表是否九宫格伤害 + 'redWizard': {'name': '高级巫师', 'hp': 1000, 'atk': 1200, 'def': 0, 'money': 160, 'experience': 0, 'special': 15, 'value': 200, 'range': 2}, // range可选,代表领域伤害的范围;不加默认为1 + 'yellowGuard': {'name': '初级卫兵', 'hp': 100, 'atk': 120, 'def': 0, 'money': 10, 'experience': 0, 'special': 0}, + 'blueGuard': {'name': '中级卫兵', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'redGuard': {'name': '高级卫兵', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'swordsman': {'name': '双手剑士', 'hp': 100, 'atk': 120, 'def': 0, 'money': 6, 'experience': 0, 'special': 5}, + 'soldier': {'name': '冥战士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'yellowKnight': {'name': '金骑士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'redKnight': {'name': '红骑士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'darkKnight': {'name': '黑骑士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'blackKing': {'name': '黑衣魔王', 'hp': 1000, 'atk': 500, 'def': 0, 'money': 1000, 'experience': 1000, 'special': 0, 'bomb': false}, // 加入 'bomb': false 代表该怪物不可被炸弹或圣锤炸掉 + 'yellowKing': {'name': '黄衣魔王', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'greenKing': {'name': '青衣武士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'blueKnight': {'name': '蓝骑士', 'hp': 100, 'atk': 120, 'def': 0, 'money': 9, 'experience': 0, 'special': 8}, + 'goldSlime': {'name': '黄头怪', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'poisonSkeleton': {'name': '紫骷髅', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'poisonBat': {'name': '紫蝙蝠', 'hp': 100, 'atk': 120, 'def': 0, 'money': 14, 'experience': 0, 'special': 13}, + 'steelRock': {'name': '铁面人', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'skeletonPriest': {'name': '骷髅法师', 'hp': 100, 'atk': 100, 'def': 0, 'money': 0, 'experience': 0, 'special': 18, 'value': 20}, + 'skeletonKing': {'name': '骷髅王', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'skeletonWizard': {'name': '骷髅巫师', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'redSkeletonCaption': {'name': '骷髅武士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'special': 0}, + 'badHero': {'name': '迷失勇者', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'demon': {'name': '魔神武士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'demonPriest': {'name': '魔神法师', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'goldHornSlime': {'name': '金角怪', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'redKing': {'name': '红衣魔王', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'whiteKing': {'name': '白衣武士', 'hp': 100, 'atk': 120, 'def': 0, 'money': 17, 'experience': 0, 'special': 16}, + 'blackMagician': {'name': '黑暗大法师', 'hp': 100, 'atk': 120, 'def': 0, 'money': 12, 'experience': 0, 'special': 11, 'value': 1/3, 'bomb': false}, // 吸血怪需要在后面添加value代表吸血比例 + 'silverSlime': {'name': '银头怪', 'hp': 100, 'atk': 120, 'def': 0, 'money': 15, 'experience': 0, 'special': 14}, + 'swordEmperor': {'name': '剑圣', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'whiteHornSlime': {'name': '尖角怪', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'badPrincess': {'name': '痛苦魔女', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'badFairy': {'name': '黑暗仙子', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'grayPriest': {'name': '中级法师', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'redSwordsman': {'name': '剑王', 'hp': 100, 'atk': 120, 'def': 0, 'money': 7, 'experience': 0, 'special': 6, 'n': 8}, // 多连击需要在后面指定n代表是几连击 + 'whiteGhost': {'name': '水银战士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'poisonZombie': {'name': '绿兽人', 'hp': 100, 'atk': 120, 'def': 0, 'money': 13, 'experience': 0, 'special': 12}, + 'magicDragon': {'name': '魔龙', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'octopus': {'name': '血影', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'darkFairy': {'name': '仙子', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, + 'greenKnight': {'name': '强盾骑士', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0}, } \ No newline at end of file diff --git a/libs/project/items.js b/libs/project/items.js index a181532d..c42662bd 100644 --- a/libs/project/items.js +++ b/libs/project/items.js @@ -34,7 +34,7 @@ items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = 'fly': {'cls': 'constants', 'name': '楼层传送器', 'text': '可以自由往来去过的楼层'}, 'coin': {'cls': 'constants', 'name': '幸运金币', 'text': '持有时打败怪物可得双倍金币'}, 'snow': {'cls': 'constants', 'name': '冰冻徽章', 'text': '可以将四周的熔岩变成平地'}, - 'cross': {'cls': 'constants', 'name': '十字架', 'text': '该道具尚未被定义'}, + 'cross': {'cls': 'constants', 'name': '十字架', 'text': '持有后无视怪物的无敌属性'}, 'knife': {'cls': 'constants', 'name': '屠龙匕首', 'text': '该道具尚未被定义'}, 'shoes': {'cls': 'constants', 'name': '绿鞋', 'text': '持有时无视负面地形'}, diff --git a/libs/project/maps.js b/libs/project/maps.js index 30ef090a..0865925e 100644 --- a/libs/project/maps.js +++ b/libs/project/maps.js @@ -3,191 +3,190 @@ maps_90f36752_8815_4be8_b32b_d7fad1d0542e = ////////////////////////// 地形部分 ////////////////////////// // 0-20 地形 - "1":{"cls": "terrains", "id": "yellowWall"}, // 黄墙 - "2":{"cls": "terrains", "id": "whiteWall"}, // 白墙 - "3":{"cls": "terrains", "id": "blueWall"}, // 白墙 - "4":{"cls": "animates", "id": "star", "noPass": true}, // 星空 - "5":{"cls": "animates", "id": "lava", "noPass": true}, // 岩浆 - "6":{"cls": "terrains", "id": "ice"}, // 岩浆 - "7":{"cls": "terrains", "id": "blueShop-left"}, // 蓝色商店左 - "8":{"cls": "terrains", "id": "blueShop-right"}, // 蓝色商店右 - "9":{"cls": "terrains", "id": "pinkShop-left"}, // 粉色商店左 - "10":{"cls": "terrains", "id": "pinkShop-right"}, // 粉色商店左 - "11":{"cls": "animates", "id": "lavaNet", "noPass": false, "trigger": "passNet"}, // 血网 - "12":{"cls": "animates", "id": "poisonNet", "noPass": false, "trigger": "passNet"}, // 毒网 - "13":{"cls": "animates", "id": "weakNet", "noPass": false, "trigger": "passNet"}, // 衰网 - "14":{"cls": "animates", "id": "curseNet", "noPass": false, "trigger": "passNet"}, // 咒网 - "15":{"cls": "animates", "id": "water", "noPass": true}, // 水 + '1':{'cls': 'terrains', 'id': 'yellowWall'}, // 黄墙 + '2':{'cls': 'terrains', 'id': 'whiteWall'}, // 白墙 + '3':{'cls': 'terrains', 'id': 'blueWall'}, // 白墙 + '4':{'cls': 'animates', 'id': 'star', 'noPass': true}, // 星空 + '5':{'cls': 'animates', 'id': 'lava', 'noPass': true}, // 岩浆 + '6':{'cls': 'terrains', 'id': 'ice'}, // 岩浆 + '7':{'cls': 'terrains', 'id': 'blueShop-left'}, // 蓝色商店左 + '8':{'cls': 'terrains', 'id': 'blueShop-right'}, // 蓝色商店右 + '9':{'cls': 'terrains', 'id': 'pinkShop-left'}, // 粉色商店左 + '10':{'cls': 'terrains', 'id': 'pinkShop-right'}, // 粉色商店左 + '11':{'cls': 'animates', 'id': 'lavaNet', 'noPass': false, 'trigger': 'passNet'}, // 血网 + '12':{'cls': 'animates', 'id': 'poisonNet', 'noPass': false, 'trigger': 'passNet'}, // 毒网 + '13':{'cls': 'animates', 'id': 'weakNet', 'noPass': false, 'trigger': 'passNet'}, // 衰网 + '14':{'cls': 'animates', 'id': 'curseNet', 'noPass': false, 'trigger': 'passNet'}, // 咒网 + '15':{'cls': 'animates', 'id': 'water', 'noPass': true}, // 水 // 在这里添加更多地形 - // 如果空地不足,可以从180以后开始继续放,只要不和现有的数字冲突即可 + // 如果空位不足,可以从180以后开始继续放,只要不和现有的数字冲突即可 // Autotile - "20":{"cls": "autotile", "id": "autotile", "noPass": true}, // autotile - // 更多的autotile从151到160,只要不和现有的数字冲突即可 - "151":{"cls": "autotile", "id": "autotile1", "noPass": true}, - "152":{"cls": "autotile", "id": "autotile2", "noPass": true}, - "153":{"cls": "autotile", "id": "autotile3", "noPass": true}, - + '20':{'cls': 'autotile', 'id': 'autotile', 'noPass': true}, // autotile + // 更多的autotile从151到160等,只要不和现有的数字冲突即可 + '151':{'cls': 'autotile', 'id': 'autotile1', 'noPass': true}, + '152':{'cls': 'autotile', 'id': 'autotile2', 'noPass': true}, + '153':{'cls': 'autotile', 'id': 'autotile3', 'noPass': true}, ////////////////////////// 物品部分 ////////////////////////// // 21-80 物品 - "21":{"cls": "items", "id": "yellowKey"}, // 黄钥匙 - "22":{"cls": "items", "id": "blueKey"}, // 蓝钥匙 - "23":{"cls": "items", "id": "redKey"}, // 红钥匙 - "24":{"cls": "items", "id": "greenKey"}, // 绿钥匙 - "25":{"cls": "items", "id": "steelKey"}, // 铁门钥匙 - "26":{"cls": "items", "id": "bigKey"}, // 大黄门钥匙(钥匙盒) - "27":{"cls": "items", "id": "redJewel"}, // 红宝石 - "28":{"cls": "items", "id": "blueJewel"}, // 蓝宝石 - "29":{"cls": "items", "id": "greenJewel"}, // 绿宝石 - "30":{"cls": "items", "id": "yellowJewel"}, // 黄宝石 - "31":{"cls": "items", "id": "redPotion"}, // 红血瓶 - "32":{"cls": "items", "id": "bluePotion"}, // 蓝血瓶 - "33":{"cls": "items", "id": "greenPotion"}, // 绿血瓶 - "34":{"cls": "items", "id": "yellowPotion"}, // 黄血瓶 - "35":{"cls": "items", "id": "sword1"}, // 铁剑 - "36":{"cls": "items", "id": "shield1"}, // 铁盾 - "37":{"cls": "items", "id": "sword2"}, // 银剑 - "38":{"cls": "items", "id": "shield2"}, // 银盾 - "39":{"cls": "items", "id": "sword3"}, // 骑士剑 - "40":{"cls": "items", "id": "shield3"}, // 骑士盾 - "41":{"cls": "items", "id": "sword4"}, // 圣剑 - "42":{"cls": "items", "id": "shield4"}, // 圣盾 - "43":{"cls": "items", "id": "sword5"}, // 神圣剑 - "44":{"cls": "items", "id": "shield5"}, // 神圣盾 - "45":{"cls": "items", "id": "book"}, // 怪物手册 - "46":{"cls": "items", "id": "fly"}, // 楼层传送器 - "47":{"cls": "items", "id": "pickaxe"}, // 破墙镐 - "48":{"cls": "items", "id": "icePickaxe"}, // 破冰镐 - "49":{"cls": "items", "id": "bomb"}, // 炸弹 - "50":{"cls": "items", "id": "centerFly"}, // 中心对称 - "51":{"cls": "items", "id": "upFly"}, // 上楼器 - "52":{"cls": "items", "id": "downFly"}, // 下楼器 - "53":{"cls": "items", "id": "coin"}, // 幸运金币 - "54":{"cls": "items", "id": "snow"}, // 冰冻徽章 - "55":{"cls": "items", "id": "cross"}, // 十字架 - "56":{"cls": "items", "id": "superPotion"}, // 圣水 - "57":{"cls": "items", "id": "earthquake"}, // 地震卷轴 - "58":{"cls": "items", "id": "poisonWine"}, // 解毒药水 - "59":{"cls": "items", "id": "weakWine"}, // 解衰药水 - "60":{"cls": "items", "id": "curseWine"}, // 解咒药水 - "61":{"cls": "items", "id": "superWine"}, // 万能药水 - "62":{"cls": "items", "id": "knife"}, // 屠龙匕首 - "63":{"cls": "items", "id": "moneyPocket"}, // 金钱袋 - "64":{"cls": "items", "id": "shoes"}, // 绿鞋 - "65":{"cls": "items", "id": "hammer"}, // 圣锤 + '21':{'cls': 'items', 'id': 'yellowKey'}, // 黄钥匙 + '22':{'cls': 'items', 'id': 'blueKey'}, // 蓝钥匙 + '23':{'cls': 'items', 'id': 'redKey'}, // 红钥匙 + '24':{'cls': 'items', 'id': 'greenKey'}, // 绿钥匙 + '25':{'cls': 'items', 'id': 'steelKey'}, // 铁门钥匙 + '26':{'cls': 'items', 'id': 'bigKey'}, // 大黄门钥匙(钥匙盒) + '27':{'cls': 'items', 'id': 'redJewel'}, // 红宝石 + '28':{'cls': 'items', 'id': 'blueJewel'}, // 蓝宝石 + '29':{'cls': 'items', 'id': 'greenJewel'}, // 绿宝石 + '30':{'cls': 'items', 'id': 'yellowJewel'}, // 黄宝石 + '31':{'cls': 'items', 'id': 'redPotion'}, // 红血瓶 + '32':{'cls': 'items', 'id': 'bluePotion'}, // 蓝血瓶 + '33':{'cls': 'items', 'id': 'greenPotion'}, // 绿血瓶 + '34':{'cls': 'items', 'id': 'yellowPotion'}, // 黄血瓶 + '35':{'cls': 'items', 'id': 'sword1'}, // 铁剑 + '36':{'cls': 'items', 'id': 'shield1'}, // 铁盾 + '37':{'cls': 'items', 'id': 'sword2'}, // 银剑 + '38':{'cls': 'items', 'id': 'shield2'}, // 银盾 + '39':{'cls': 'items', 'id': 'sword3'}, // 骑士剑 + '40':{'cls': 'items', 'id': 'shield3'}, // 骑士盾 + '41':{'cls': 'items', 'id': 'sword4'}, // 圣剑 + '42':{'cls': 'items', 'id': 'shield4'}, // 圣盾 + '43':{'cls': 'items', 'id': 'sword5'}, // 神圣剑 + '44':{'cls': 'items', 'id': 'shield5'}, // 神圣盾 + '45':{'cls': 'items', 'id': 'book'}, // 怪物手册 + '46':{'cls': 'items', 'id': 'fly'}, // 楼层传送器 + '47':{'cls': 'items', 'id': 'pickaxe'}, // 破墙镐 + '48':{'cls': 'items', 'id': 'icePickaxe'}, // 破冰镐 + '49':{'cls': 'items', 'id': 'bomb'}, // 炸弹 + '50':{'cls': 'items', 'id': 'centerFly'}, // 中心对称 + '51':{'cls': 'items', 'id': 'upFly'}, // 上楼器 + '52':{'cls': 'items', 'id': 'downFly'}, // 下楼器 + '53':{'cls': 'items', 'id': 'coin'}, // 幸运金币 + '54':{'cls': 'items', 'id': 'snow'}, // 冰冻徽章 + '55':{'cls': 'items', 'id': 'cross'}, // 十字架 + '56':{'cls': 'items', 'id': 'superPotion'}, // 圣水 + '57':{'cls': 'items', 'id': 'earthquake'}, // 地震卷轴 + '58':{'cls': 'items', 'id': 'poisonWine'}, // 解毒药水 + '59':{'cls': 'items', 'id': 'weakWine'}, // 解衰药水 + '60':{'cls': 'items', 'id': 'curseWine'}, // 解咒药水 + '61':{'cls': 'items', 'id': 'superWine'}, // 万能药水 + '62':{'cls': 'items', 'id': 'knife'}, // 屠龙匕首 + '63':{'cls': 'items', 'id': 'moneyPocket'}, // 金钱袋 + '64':{'cls': 'items', 'id': 'shoes'}, // 绿鞋 + '65':{'cls': 'items', 'id': 'hammer'}, // 圣锤 ////////////////////////// 门、楼梯、传送点部分 ////////////////////////// // 81-100 门 - "81":{"cls": "terrains", "id": "yellowDoor", "trigger": "openDoor"}, // 黄门 - "82":{"cls": "terrains", "id": "blueDoor", "trigger": "openDoor"}, // 蓝门 - "83":{"cls": "terrains", "id": "redDoor", "trigger": "openDoor"}, // 红门 - "84":{"cls": "terrains", "id": "greenDoor", "trigger": "openDoor"}, // 绿门 - "85":{"cls": "terrains", "id": "specialDoor", "trigger": "openDoor"}, // 机关门左 - "86":{"cls": "terrains", "id": "steelDoor", "trigger": "openDoor"}, // 铁门 - "87":{"cls": "terrains", "id": "upFloor", "noPass": false}, // 上楼梯 - "88":{"cls": "terrains", "id": "downFloor", "noPass": false}, // 下楼梯 - "89":{"cls": "animates", "id": "portal", "noPass": false}, // 传送门 - "90":{"cls": "animates", "id": "starPortal", "noPass": false}, // 星空传送门 - "91":{"cls": "animates", "id": "upPortal", "noPass": false}, // 上箭头 - "92":{"cls": "animates", "id": "leftPortal", "noPass": false}, // 左箭头 - "93":{"cls": "animates", "id": "downPortal", "noPass": false}, // 下箭头 - "94":{"cls": "animates", "id": "rightPortal", "noPass": false}, // 右箭头 + '81':{'cls': 'terrains', 'id': 'yellowDoor', 'trigger': 'openDoor'}, // 黄门 + '82':{'cls': 'terrains', 'id': 'blueDoor', 'trigger': 'openDoor'}, // 蓝门 + '83':{'cls': 'terrains', 'id': 'redDoor', 'trigger': 'openDoor'}, // 红门 + '84':{'cls': 'terrains', 'id': 'greenDoor', 'trigger': 'openDoor'}, // 绿门 + '85':{'cls': 'terrains', 'id': 'specialDoor', 'trigger': 'openDoor'}, // 机关门左 + '86':{'cls': 'terrains', 'id': 'steelDoor', 'trigger': 'openDoor'}, // 铁门 + '87':{'cls': 'terrains', 'id': 'upFloor', 'noPass': false}, // 上楼梯 + '88':{'cls': 'terrains', 'id': 'downFloor', 'noPass': false}, // 下楼梯 + '89':{'cls': 'animates', 'id': 'portal', 'noPass': false}, // 传送门 + '90':{'cls': 'animates', 'id': 'starPortal', 'noPass': false}, // 星空传送门 + '91':{'cls': 'animates', 'id': 'upPortal', 'noPass': false}, // 上箭头 + '92':{'cls': 'animates', 'id': 'leftPortal', 'noPass': false}, // 左箭头 + '93':{'cls': 'animates', 'id': 'downPortal', 'noPass': false}, // 下箭头 + '94':{'cls': 'animates', 'id': 'rightPortal', 'noPass': false}, // 右箭头 ////////////////////////// NPC部分 ////////////////////////// // 121-150 NPC - "121":{"cls": "npcs", "id": "man"}, - "122":{"cls": "npcs", "id": "woman"}, - "123":{"cls": "npcs", "id": "thief"}, - "124":{"cls": "npcs", "id": "fairy"}, - "125":{"cls": "npcs", "id": "magician"}, - "126":{"cls": "npcs", "id": "womanMagician"}, - "127":{"cls": "npcs", "id": "oldMan"}, - "128":{"cls": "npcs", "id": "child"}, - "129":{"cls": "npcs", "id": "wood"}, - "130":{"cls": "npcs", "id": "pinkShop"}, - "131":{"cls": "npcs", "id": "blueShop"}, - "132":{"cls": "npcs", "id": "princess"}, + '121':{'cls': 'npcs', 'id': 'man'}, + '122':{'cls': 'npcs', 'id': 'woman'}, + '123':{'cls': 'npcs', 'id': 'thief'}, + '124':{'cls': 'npcs', 'id': 'fairy'}, + '125':{'cls': 'npcs', 'id': 'magician'}, + '126':{'cls': 'npcs', 'id': 'womanMagician'}, + '127':{'cls': 'npcs', 'id': 'oldMan'}, + '128':{'cls': 'npcs', 'id': 'child'}, + '129':{'cls': 'npcs', 'id': 'wood'}, + '130':{'cls': 'npcs', 'id': 'pinkShop'}, + '131':{'cls': 'npcs', 'id': 'blueShop'}, + '132':{'cls': 'npcs', 'id': 'princess'}, ////////////////////////// 其他部分 ////////////////////////// // 161-200 其他(单向箭头、灯、箱子等等) - "161":{"cls": "terrains", "id": "arrowUp", "noPass": false}, // 单向上箭头 - "162":{"cls": "terrains", "id": "arrowDown", "noPass": false}, // 单向下箭头 - "163":{"cls": "terrains", "id": "arrowLeft", "noPass": false}, // 单向左箭头 - "164":{"cls": "terrains", "id": "arrowRight", "noPass": false}, // 单向右箭头 - "165":{"cls": "terrains", "id": "light", "trigger": "changeLight", "noPass": false}, // 灯 - "166":{"cls": "terrains", "id": "darkLight", "noPass": true}, // 暗灯 + '161':{'cls': 'terrains', 'id': 'arrowUp', 'noPass': false}, // 单向上箭头 + '162':{'cls': 'terrains', 'id': 'arrowDown', 'noPass': false}, // 单向下箭头 + '163':{'cls': 'terrains', 'id': 'arrowLeft', 'noPass': false}, // 单向左箭头 + '164':{'cls': 'terrains', 'id': 'arrowRight', 'noPass': false}, // 单向右箭头 + '165':{'cls': 'terrains', 'id': 'light', 'trigger': 'changeLight', 'noPass': false}, // 灯 + '166':{'cls': 'terrains', 'id': 'darkLight', 'noPass': true}, // 暗灯 ////////////////////////// 怪物部分 ////////////////////////// // 201-300 怪物 - "201":{"cls": "enemys", "id": "greenSlime"}, - "202":{"cls": "enemys", "id": "redSlime"}, - "203":{"cls": "enemys", "id": "blackSlime"}, - "204":{"cls": "enemys", "id": "slimelord"}, - "205":{"cls": "enemys", "id": "bat"}, - "206":{"cls": "enemys", "id": "bigBat"}, - "207":{"cls": "enemys", "id": "redBat"}, - "208":{"cls": "enemys", "id": "vampire"}, - "209":{"cls": "enemys", "id": "skeleton"}, - "210":{"cls": "enemys", "id": "skeletonSoilder"}, - "211":{"cls": "enemys", "id": "skeletonCaptain"}, - "212":{"cls": "enemys", "id": "ghostSkeleton"}, - "213":{"cls": "enemys", "id": "zombie"}, - "214":{"cls": "enemys", "id": "zombieKnight"}, - "215":{"cls": "enemys", "id": "rock"}, - "216":{"cls": "enemys", "id": "slimeMan"}, - "217":{"cls": "enemys", "id": "bluePriest"}, - "218":{"cls": "enemys", "id": "redPriest"}, - "219":{"cls": "enemys", "id": "brownWizard"}, - "220":{"cls": "enemys", "id": "redWizard"}, - "221":{"cls": "enemys", "id": "yellowGuard"}, - "222":{"cls": "enemys", "id": "blueGuard"}, - "223":{"cls": "enemys", "id": "redGuard"}, - "224":{"cls": "enemys", "id": "swordsman"}, - "225":{"cls": "enemys", "id": "soldier"}, - "226":{"cls": "enemys", "id": "yellowKnight"}, - "227":{"cls": "enemys", "id": "redKnight"}, - "228":{"cls": "enemys", "id": "darkKnight"}, - "229":{"cls": "enemys", "id": "blackKing"}, - "230":{"cls": "enemys", "id": "yellowKing"}, - "231":{"cls": "enemys", "id": "greenKing"}, - "232":{"cls": "enemys", "id": "blueKnight"}, - "233":{"cls": "enemys", "id": "goldSlime"}, - "234":{"cls": "enemys", "id": "poisonSkeleton"}, - "235":{"cls": "enemys", "id": "poisonBat"}, - "236":{"cls": "enemys", "id": "steelRock"}, - "237":{"cls": "enemys", "id": "skeletonPriest"}, - "238":{"cls": "enemys", "id": "skeletonKing"}, - "239":{"cls": "enemys", "id": "skeletonWizard"}, - "240":{"cls": "enemys", "id": "redSkeletonCaption"}, - "241":{"cls": "enemys", "id": "badHero"}, - "242":{"cls": "enemys", "id": "demon"}, - "243":{"cls": "enemys", "id": "demonPriest"}, - "244":{"cls": "enemys", "id": "goldHornSlime"}, - "245":{"cls": "enemys", "id": "redKing"}, - "246":{"cls": "enemys", "id": "whiteKing"}, - "247":{"cls": "enemys", "id": "blackMagician"}, - "248":{"cls": "enemys", "id": "silverSlime"}, - "249":{"cls": "enemys", "id": "swordEmperor"}, - "250":{"cls": "enemys", "id": "whiteHornSlime"}, - "251":{"cls": "enemys", "id": "badPrincess"}, - "252":{"cls": "enemys", "id": "badFairy"}, - "253":{"cls": "enemys", "id": "grayPriest"}, - "254":{"cls": "enemys", "id": "redSwordsman"}, - "255":{"cls": "enemys", "id": "whiteGhost"}, - "256":{"cls": "enemys", "id": "poisonZombie"}, - "257":{"cls": "enemys", "id": "magicDragon"}, - "258":{"cls": "enemys", "id": "octopus"}, - "259":{"cls": "enemys", "id": "darkFairy"}, - "260":{"cls": "enemys", "id": "greenKnight"}, + '201':{'cls': 'enemys', 'id': 'greenSlime'}, + '202':{'cls': 'enemys', 'id': 'redSlime'}, + '203':{'cls': 'enemys', 'id': 'blackSlime'}, + '204':{'cls': 'enemys', 'id': 'slimelord'}, + '205':{'cls': 'enemys', 'id': 'bat'}, + '206':{'cls': 'enemys', 'id': 'bigBat'}, + '207':{'cls': 'enemys', 'id': 'redBat'}, + '208':{'cls': 'enemys', 'id': 'vampire'}, + '209':{'cls': 'enemys', 'id': 'skeleton'}, + '210':{'cls': 'enemys', 'id': 'skeletonSoilder'}, + '211':{'cls': 'enemys', 'id': 'skeletonCaptain'}, + '212':{'cls': 'enemys', 'id': 'ghostSkeleton'}, + '213':{'cls': 'enemys', 'id': 'zombie'}, + '214':{'cls': 'enemys', 'id': 'zombieKnight'}, + '215':{'cls': 'enemys', 'id': 'rock'}, + '216':{'cls': 'enemys', 'id': 'slimeMan'}, + '217':{'cls': 'enemys', 'id': 'bluePriest'}, + '218':{'cls': 'enemys', 'id': 'redPriest'}, + '219':{'cls': 'enemys', 'id': 'brownWizard'}, + '220':{'cls': 'enemys', 'id': 'redWizard'}, + '221':{'cls': 'enemys', 'id': 'yellowGuard'}, + '222':{'cls': 'enemys', 'id': 'blueGuard'}, + '223':{'cls': 'enemys', 'id': 'redGuard'}, + '224':{'cls': 'enemys', 'id': 'swordsman'}, + '225':{'cls': 'enemys', 'id': 'soldier'}, + '226':{'cls': 'enemys', 'id': 'yellowKnight'}, + '227':{'cls': 'enemys', 'id': 'redKnight'}, + '228':{'cls': 'enemys', 'id': 'darkKnight'}, + '229':{'cls': 'enemys', 'id': 'blackKing'}, + '230':{'cls': 'enemys', 'id': 'yellowKing'}, + '231':{'cls': 'enemys', 'id': 'greenKing'}, + '232':{'cls': 'enemys', 'id': 'blueKnight'}, + '233':{'cls': 'enemys', 'id': 'goldSlime'}, + '234':{'cls': 'enemys', 'id': 'poisonSkeleton'}, + '235':{'cls': 'enemys', 'id': 'poisonBat'}, + '236':{'cls': 'enemys', 'id': 'steelRock'}, + '237':{'cls': 'enemys', 'id': 'skeletonPriest'}, + '238':{'cls': 'enemys', 'id': 'skeletonKing'}, + '239':{'cls': 'enemys', 'id': 'skeletonWizard'}, + '240':{'cls': 'enemys', 'id': 'redSkeletonCaption'}, + '241':{'cls': 'enemys', 'id': 'badHero'}, + '242':{'cls': 'enemys', 'id': 'demon'}, + '243':{'cls': 'enemys', 'id': 'demonPriest'}, + '244':{'cls': 'enemys', 'id': 'goldHornSlime'}, + '245':{'cls': 'enemys', 'id': 'redKing'}, + '246':{'cls': 'enemys', 'id': 'whiteKing'}, + '247':{'cls': 'enemys', 'id': 'blackMagician'}, + '248':{'cls': 'enemys', 'id': 'silverSlime'}, + '249':{'cls': 'enemys', 'id': 'swordEmperor'}, + '250':{'cls': 'enemys', 'id': 'whiteHornSlime'}, + '251':{'cls': 'enemys', 'id': 'badPrincess'}, + '252':{'cls': 'enemys', 'id': 'badFairy'}, + '253':{'cls': 'enemys', 'id': 'grayPriest'}, + '254':{'cls': 'enemys', 'id': 'redSwordsman'}, + '255':{'cls': 'enemys', 'id': 'whiteGhost'}, + '256':{'cls': 'enemys', 'id': 'poisonZombie'}, + '257':{'cls': 'enemys', 'id': 'magicDragon'}, + '258':{'cls': 'enemys', 'id': 'octopus'}, + '259':{'cls': 'enemys', 'id': 'darkFairy'}, + '260':{'cls': 'enemys', 'id': 'greenKnight'}, ////////////////////////// 待定... ////////////////////////// // 目前ID暂时不要超过400 From fb7749a67eb3c0eeced7ae1c8c52975984e1fb6c Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Sun, 31 Dec 2017 10:54:11 +0800 Subject: [PATCH 08/12] fix bug --- drawMapGUI.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drawMapGUI.html b/drawMapGUI.html index 78373784..5505e776 100644 --- a/drawMapGUI.html +++ b/drawMapGUI.html @@ -438,8 +438,8 @@ editor.prototype.init = function(){ var p1 = editor.loadjs(mapsjsUrl).then(function(){ // 加载maps.js var maps_ = new maps(); //实例化maps - maps.init(); - return maps + maps_.init(); + return maps_ }); var p2 = editor.loadjs(iconsjsUrl) // 加载icons.js .then(function(){ // 实例化并获取icons From ba7bbbc7bec041acdc2a5b2b3a4b5306e0aaafb8 Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Sun, 31 Dec 2017 12:15:19 +0800 Subject: [PATCH 09/12] editor: import main.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 目前状态是都能工作,需要重写editor的方法 --- drawMapGUI.html | 160 +++++++++++++++++++++++++++++++++------ libs/core.js | 14 ++-- main.js | 2 +- test_main_init_mode.html | 150 ++++++++++++++++++++++++++++++++++++ 4 files changed, 294 insertions(+), 32 deletions(-) create mode 100644 test_main_init_mode.html diff --git a/drawMapGUI.html b/drawMapGUI.html index 5505e776..0f0c0ba7 100644 --- a/drawMapGUI.html +++ b/drawMapGUI.html @@ -328,8 +328,8 @@
- - + +
@@ -362,13 +362,111 @@
+ + + + + + + \ No newline at end of file From 5438001ea07cfd69e9a4703021c631476b31ff21 Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Sun, 31 Dec 2017 15:29:44 +0800 Subject: [PATCH 10/12] editor: import main.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 画图部分完美结合 --- drawMapGUI.html | 27 ++++++++++++++++------ libs/core.js | 20 ++++++++++++----- libs/maps.js | 60 ++++++++++++++++++++++++++++--------------------- 3 files changed, 68 insertions(+), 39 deletions(-) diff --git a/drawMapGUI.html b/drawMapGUI.html index 0f0c0ba7..c50086f8 100644 --- a/drawMapGUI.html +++ b/drawMapGUI.html @@ -520,7 +520,7 @@ function editor() { this.material = {}; } // 重构这一堆回调 -editor.prototype.init = function(){ +editor.prototype.init = function(callback){ var mapsdatajsUrl = 'libs/project/maps.js'; var iconsdatajsUrl = 'libs/project/icons.js'; var mapsjsUrl = 'libs/maps.js'; @@ -558,6 +558,7 @@ editor.prototype.init = function(){ editor.idsInit(maps, icons); // 初始化图片素材信息 editor.drawInitData(icons); // 初始化绘图 editor.listen(); // 开始监听事件 + if(Boolean(callback))callback(); }) }); @@ -719,6 +720,10 @@ editor.prototype.mapInit = function(){ } editor.prototype.drawMapBg = function(){ var bgc = bg.getContext('2d'); + if (editor.bgY == 0){ + editor.main.editor.drawMapBg(); + return; + } for (var ii = 0; ii < 13; ii++) for (var jj = 0; jj < 13; jj++) { @@ -728,10 +733,13 @@ editor.prototype.drawMapBg = function(){ } editor.prototype.updateMap = function(){ + var blocks = main.editor.mapIntoBlocks(editor.map.map(function(v){return v.map(function(v){return v.idnum||v||0})}),{'events':{},'changeFloor':{},'defaultGround':null}); + core.status.thisMap.blocks = blocks; + main.editor.updateMap(); var drawTile = function(ctx, x, y, tileInfo){ // 绘制一个普通块 - ctx.clearRect(x*32, y*32, 32, 32); + //ctx.clearRect(x*32, y*32, 32, 32); if(tileInfo == 0) return; if(typeof(tileInfo) == typeof([][0]) || !hasOwnProp(tileInfo, 'idnum')) {//未定义块画红块 @@ -748,9 +756,9 @@ editor.prototype.updateMap = function(){ ctx.fillText("?", x*32+16, y*32+27); return; } - ctx.drawImage(editor.material.images[tileInfo.images], 0, tileInfo.y*32, 32, 32, x*32, y*32, 32, 32); + //ctx.drawImage(editor.material.images[tileInfo.images], 0, tileInfo.y*32, 32, 32, x*32, y*32, 32, 32); } - + /* // autotile的相关处理 var indexArrs = [ //16种组合的图块索引数组; // 将autotile分割成48块16*16的小块; 数组索引即对应各个小块 // +----+----+----+----+----+----+ @@ -835,13 +843,13 @@ editor.prototype.updateMap = function(){ drawBlockByIndex(ctx, dx, dy, editor.material.images[info.images][info.id], index); } } - + */ // 绘制地图 start var eventCtx = document.getElementById('event').getContext("2d"); for(var y=0; y<13; y++) for(var x=0; x<13; x++){ var tileInfo = editor.map[y][x]; - if(isAutotile(tileInfo)){ + if(false && isAutotile(tileInfo)){ addIndexToAutotileInfo(x, y); drawAutotile(eventCtx, x, y, tileInfo); }else drawTile(eventCtx, x, y, tileInfo); @@ -1060,14 +1068,19 @@ editor = new editor(); main.init('editor'); //main.listen(); var afterMainInit = function(){ + //main.editor.mapIntoBlocks(editor.map.map(function(v){return v.map(function(v){return v.idnum||v||0})}),{'events':{},'changeFloor':{},'defaultGround':null}); //main.editor.drawMapBg(); //main.editor.updateMap(); + main.instance={}; editor.main=main; editor.core=core; editor.fs=fs; editor.file=editor_file; - editor.init(); + + main.editor.disableGlobalAnimate=false; + //core.status.maps = core.clone(core.maps.initMaps(floorIds)); + editor.init(editor.updateMap); } var startgame = function(){ var hard = 'Hard'; diff --git a/libs/core.js b/libs/core.js index 02d53cab..67fcb80b 100644 --- a/libs/core.js +++ b/libs/core.js @@ -1997,19 +1997,21 @@ core.prototype.drawMap = function (mapName, callback) { } } } - drawBg(); if (main.mode=='editor'){ main.editor.drawMapBg = function(){ core.clearMap('bg', 0, 0, 416, 416); drawBg(); } + } else { + drawBg(); } + core.status.floorId = mapName; + core.status.thisMap = core.status.maps[mapName]; var drawEvent = function(){ - var mapData = core.status.maps[mapName]; + var mapData = core.status.maps[core.status.floorId]; var mapBlocks = mapData.blocks; - core.status.floorId = mapName; - core.status.thisMap = mapData; + var autotileMaps = []; for (var b = 0; b < mapBlocks.length; b++) { // 事件启用 @@ -2030,12 +2032,16 @@ core.prototype.drawMap = function (mapName, callback) { } core.drawAutotile(mapName, 'event', autotileMaps, 0, 0, 32); } - drawEvent(); + if (main.mode=='editor'){ main.editor.updateMap = function(){ + core.removeGlobalAnimate(null, null, true); core.clearMap('event', 0, 0, 416, 416); drawEvent(); + core.setGlobalAnimate(core.values.animateSpeed); } + } else { + drawEvent(); } core.setGlobalAnimate(core.values.animateSpeed); @@ -2467,11 +2473,13 @@ core.prototype.addGlobalAnimate = function (animateMore, x, y, loc, image) { ////// 删除一个或所有全局动画 ////// core.prototype.removeGlobalAnimate = function (x, y, all) { - if (main.mode=='editor' && main.editor.disableGlobalAnimate) return; if (all == true) { core.status.twoAnimateObjs = []; core.status.fourAnimateObjs = []; } + + if (main.mode=='editor' && main.editor.disableGlobalAnimate) return; + for (var t = 0; t < core.status.twoAnimateObjs.length; t++) { if (core.status.twoAnimateObjs[t].x == x * 32 && core.status.twoAnimateObjs[t].y == y * 32) { core.status.twoAnimateObjs.splice(t, 1); diff --git a/libs/maps.js b/libs/maps.js index 79a3e07e..45ad3349 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -13,38 +13,46 @@ maps.prototype.loadFloor = function (floorId, map) { content['title'] = floor.title; content['canFlyTo'] = floor.canFlyTo; if (!core.isset(map)) map=floor.map; - var blocks = []; - for (var i = 0; i < 13; i++) { - for (var j = 0; j < 13; j++) { - var block = this.getBlock(j, i, map[i][j]); - if (block.event != undefined) { - if (block.event.cls == 'enemys' && block.event.trigger==undefined) { - block.event.trigger = 'battle'; - } - if (block.event.cls == 'items' && block.event.trigger==undefined) { - block.event.trigger = 'getItem'; - } - if (block.event.noPass == undefined) { - if (block.event.cls=='enemys' || block.event.cls=='terrains' || block.event.cls=='npcs') { - block.event.noPass = true; - } - } - if (block.event.animate == undefined) { - if (block.event.cls=='enemys' || block.event.cls=='npcs') { - block.event.animate = 2; - } - if (block.event.cls == 'animates') { - block.event.animate = 4; + var mapIntoBlocks = function(map,maps,floor){ + var blocks = []; + for (var i = 0; i < 13; i++) { + for (var j = 0; j < 13; j++) { + var block = maps.getBlock(j, i, map[i][j]); + if (block.event != undefined) { + if (block.event.cls == 'enemys' && block.event.trigger==undefined) { + block.event.trigger = 'battle'; + } + if (block.event.cls == 'items' && block.event.trigger==undefined) { + block.event.trigger = 'getItem'; + } + if (block.event.noPass == undefined) { + if (block.event.cls=='enemys' || block.event.cls=='terrains' || block.event.cls=='npcs') { + block.event.noPass = true; + } + } + if (block.event.animate == undefined) { + if (block.event.cls=='enemys' || block.event.cls=='npcs') { + block.event.animate = 2; + } + if (block.event.cls == 'animates') { + block.event.animate = 4; + } } } + maps.addEvent(block,j,i,floor.events[j+","+i],floor.defaultGround || "ground") + maps.addChangeFloor(block,j,i,floor.changeFloor[j+","+i]); + if (core.isset(block.event)) blocks.push(block); } - this.addEvent(block,j,i,floor.events[j+","+i],floor.defaultGround || "ground") - this.addChangeFloor(block,j,i,floor.changeFloor[j+","+i]); - if (core.isset(block.event)) blocks.push(block); + } + return blocks; + } + if (main.mode=='editor'){ + main.editor.mapIntoBlocks = function(map,floor){ + return mapIntoBlocks(map,core.maps,floor); } } // 事件处理 - content['blocks'] = blocks; + content['blocks'] = mapIntoBlocks(map,this,floor); return content; } From 4f6bf850f8f9fc3c095e984d88b9c14f69a27850 Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Sun, 31 Dec 2017 15:49:03 +0800 Subject: [PATCH 11/12] editor: import main.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit editor完全使用core的数据 --- drawMapGUI.html | 123 +++++------------------------------------------- 1 file changed, 11 insertions(+), 112 deletions(-) diff --git a/drawMapGUI.html b/drawMapGUI.html index c50086f8..cd84aa5a 100644 --- a/drawMapGUI.html +++ b/drawMapGUI.html @@ -519,105 +519,19 @@ function editor() { this.version = "1.2"; this.material = {}; } -// 重构这一堆回调 + editor.prototype.init = function(callback){ - var mapsdatajsUrl = 'libs/project/maps.js'; - var iconsdatajsUrl = 'libs/project/icons.js'; - var mapsjsUrl = 'libs/maps.js'; - var iconsjsUrl = 'libs/icons.js'; - - var p1_data = editor.loadjs(mapsdatajsUrl).then(function(){ // 加载maps.js的数据 - return 'complete'; - }); - var p2_data = editor.loadjs(iconsdatajsUrl).then(function(){ // 加载icons.js的数据 - return 'complete'; - }); - - Promise.all([p1_data, p2_data]).then(function([p1_data, p2_data]){ - - var p1 = editor.loadjs(mapsjsUrl).then(function(){ // 加载maps.js - var maps_ = new maps(); //实例化maps - maps_.init(); - return maps_ - }); - var p2 = editor.loadjs(iconsjsUrl) // 加载icons.js - .then(function(){ // 实例化并获取icons - var ic = new icons(); - ic.init(); - return ic.getIcons(); - }); - var p3 = p2.then(function(icons){ // 加载所有图片 - return editor.loadAllImgs(icons); - }) - .catch(function(err){ - console.log('发生错误!', err); - }); - - Promise.all([p1, p2, p3]) - .then(function([maps, icons, img]){ - editor.idsInit(maps, icons); // 初始化图片素材信息 - editor.drawInitData(icons); // 初始化绘图 - editor.listen(); // 开始监听事件 - if(Boolean(callback))callback(); - }) - - }); + editor.main=main; + editor.core=core; + editor.fs=fs; + editor.file=editor_file; + editor.material.images=core.material.images; + editor.idsInit(core.maps, core.icons.icons); // 初始化图片素材信息 + editor.drawInitData(core.icons.icons); // 初始化绘图 + editor.listen(); // 开始监听事件 + if(Boolean(callback))callback(); } -editor.prototype.loadjs = function(url){ - return new Promise(function(resolve, reject){ - var script = document.createElement('script'); - script.src = url + '?' + editor.version; - document.body.appendChild(script); - script.onload = function () { - resolve( console.log(url+"加载完成")); - } - script.onerror = function(){ - reject(new Error('Load js error at '+url)) - } - }); -} -editor.prototype.loadImg = function(url){ - return new Promise(function(resolve, reject){ - var img = new Image(); - img.src = url; - img.onload = function(){ - resolve(img); - } - img.onerror = function(){ - reject(new Error('Load image error at '+url)); - } - }) -} - -editor.prototype.loadAllImgs = function(icons){ - editor.material.images = {}; - var imgs = Object.keys(icons); - var autotiles = null; - if(hasOwnProp(icons, 'hero')){ // hero 图片不加载 - var index = imgs.indexOf('hero'); - imgs.splice(index, 1); - } - if(hasOwnProp(icons, 'autotile')){ - editor.material.images['autotile'] = {}; - var index = imgs.indexOf('autotile'); - imgs.splice(index, 1); - autotiles = Object.keys(icons.autotile); - imgs = imgs.concat(autotiles); - } - var p = imgs.map(function(im){ - var url = 'images/'+im+'.png' - return editor.loadImg(url).then(function(image){ - if(autotiles.indexOf(im) >= 0){ - editor.material.images['autotile'][im] = image; - }else editor.material.images[im] = image; - }).catch(function(err){ - console.log('发生错误!', err); - }); - }); - - return Promise.all(p); -} editor.prototype.idsInit = function(maps, icons){ editor.ids = []; editor.indexs = []; @@ -1068,15 +982,6 @@ editor = new editor(); main.init('editor'); //main.listen(); var afterMainInit = function(){ - //main.editor.mapIntoBlocks(editor.map.map(function(v){return v.map(function(v){return v.idnum||v||0})}),{'events':{},'changeFloor':{},'defaultGround':null}); - //main.editor.drawMapBg(); - //main.editor.updateMap(); - - main.instance={}; - editor.main=main; - editor.core=core; - editor.fs=fs; - editor.file=editor_file; main.editor.disableGlobalAnimate=false; //core.status.maps = core.clone(core.maps.initMaps(floorIds)); @@ -1094,12 +999,6 @@ var startgame = function(){ setTimeout(startgame, 300); - + From 62b11fc3a0ab5e87dca34bc2d8a55e209bdb9e36 Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Mon, 1 Jan 2018 02:07:55 +0800 Subject: [PATCH 12/12] Update editor_file.js --- _server/editor_file.js | 88 +++++++++++++++++++++++++++++++++++------- 1 file changed, 74 insertions(+), 14 deletions(-) diff --git a/_server/editor_file.js b/_server/editor_file.js index 99bd334f..8ce40c89 100644 --- a/_server/editor_file.js +++ b/_server/editor_file.js @@ -3,8 +3,8 @@ editor_file = {}; editor_file.getFloorFileList = function(editor,callback){ + if (!isset(callback)) throw('未设置callback'); var fs = editor.fs; - if (isset(callback)) fs.readdir('libs/project/floors',function(err, data){ callback([data,err]); }); @@ -12,12 +12,12 @@ //callback([Array,err:String]) editor_file.loadFloorFile = function(editor,filename,callback){ //filename不含'/'不含'.js' + if (!isset(callback)) throw('未设置callback'); var fs = editor.fs; - if (isset(callback)) fs.readFile('libs/project/floors/'+filename+'.js','utf-8',function(err, data){ if (err!=null){callback(err);return;} - data=data.split('=') - data=[data[0],data.slice(1).join('=')] + data=data.split('='); + data=[data[0],data.slice(1).join('=')]; var varnameId = data[0].split('.').slice(-1)[0].trim(); var filenameId = filename.split('/').slice(-1)[0].split('\\').slice(-1)[0]; eval('b3917d1d_71c2_41f2_a8aa_481b215ffb99='+data[1]); @@ -35,8 +35,9 @@ } //callback(err:String) editor_file.saveFloorFile = function(editor,callback){ + if (!isset(callback)) throw('未设置callback'); if (!isset(editor.currentFloorId) || !isset(editor.currentfloorData)) { - if (isset(callback)) callback('未选中文件或无数据'); + callback('未选中文件或无数据'); } var filename = 'libs/project/floors/' + editor.currentFloorId + '.js'; var datastr = ['main.floors.' , editor.currentFloorId , '=\n{']; @@ -50,14 +51,15 @@ datastr=datastr.concat(['\n}']); datastr=datastr.join(''); fs.writeFile(filename,datastr,'utf-8',function(err, data){ - if (isset(callback)) callback(err); + callback(err); }); } //callback(err:String) editor_file.saveFloorFileAs = function(editor,saveAsFilename,callback){ //saveAsFilename不含'/'不含'.js' + if (!isset(callback)) throw('未设置callback'); if (!isset(editor.currentfloorData)) { - if (isset(callback)) callback('无数据'); + callback('无数据'); } editor.currentfloorData.floorId=saveAsFilename; editor.currentFloorId=saveAsFilename; @@ -67,22 +69,77 @@ //////////////////////////////////////////////////////////////////// - editor_file.changeIdAndIdnum = function(editor,id,idnum,callback){ - if (isset(callback)) callback('尚未实现'); + editor_file.changeIdAndIdnum = function(editor,id,idnum,info,callback){ + if (!isset(callback)) throw('未设置callback'); + //检查maps中是否有重复的idnum或id + var change = -1; + for(var ii in core.maps.blocksInfo){ + if (ii==idnum) { + if (info.idnum==idnum){change=ii;break;}//修改id + callback('idnum重复了'); + return; + } + if (core.maps.blocksInfo[ii].id==id) { + if (info.id==id){change=ii;break;}//修改idnum + callback('id重复了'); + return; + } + } + if (change!=-1 && change!=idnum){//修改idnum + core.maps.blocksInfo[idnum] = core.maps.blocksInfo[change]; + delete(core.maps.blocksInfo[change]); + } else if (change==idnum) {//修改id + var oldid = core.maps.blocksInfo[idnum].id; + core.maps.blocksInfo[idnum].id = id; + for(var ii in core.icons.icons){ + if (ii.hasOwnProperty(oldid)){ + ii[id]=ii[oldid]; + delete(ii[oldid]); + } + } + } else {//创建新的 + core.maps.blocksInfo[idnum]={'cls': info.images, 'id':id}; + core.icons.icons[info.images][id]=info.y; + } + + throw('尚未实现:save(core.maps.blocksInfo,map.js);save(core.icons.icons,icons.js);') + callback(null); } //callback(err:String) editor_file.editItem = function(editor,id,obj,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 - if (isset(callback)) callback( + if (!isset(callback)) throw('未设置callback'); + callback( {'items':{'cls': 'items', 'name': '红宝石'},'itemEffect':'core.status.hero.atk += core.values.redJewel','itemEffectTip':"',攻击+'+core.values.redJewel"}, {'items':'','itemEffect':'','itemEffectTip':''}, null); //只有items.cls是items的才有itemEffect和itemEffectTip,keys和constants和tools只有items } + /* + << + {'items':{'cls': 'items', 'name': '红宝石'},'itemEffect':'core.status.hero.atk += core.values.redJewel','itemEffectTip':"',攻击+'+core.values.redJewel"} + == + [ + ["change","['items']['name']","红宝石的新名字"], + ["add","['items']['新的和name同级的属性']",123], + ["change","['itemEffectTip']","',攻击力+'+core.values.redJewel"], + ] + >> + 'yellowKey': {'cls': 'keys' \*只能取keys items constants tools\n$range(thiseval in ['keys','items','constants','tools'])\n*\ , 'name': '黄钥匙'} + + $range((function(){typeof(thiseval)==typeof(0)||})()) + if( 注释.indexof('$range(')!= -1){ + thiseval = 新值; + evalstr = 注释.split('$range')[1].split('\n')[0]; + if(eval(evalstr) !== true)alert('不在取值范围内') + } + */ + //callback(obj,commentObj,err:String) editor_file.editEnemy = function(editor,id,obj,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 - if (isset(callback)) callback( + if (!isset(callback)) throw('未设置callback'); + callback( {'name': '初级巫师', 'hp': 100, 'atk': 120, 'def': 0, 'money': 16, 'experience': 0, 'special': 15, 'value': 100, "bomb": false}, {'name': '名称', 'hp': '生命值', 'atk': '攻击力', 'def': '防御力', 'money': '金币', 'experience': '经验', 'special': '特殊属性\n1:先攻,2:魔攻,3:坚固,4:2连击,5:3连击,6:4连击,7:破甲,8:反击,9:净化,10:模仿,11:吸血,12:中毒,13:衰弱,14:诅咒,15:领域,16:夹击,17:仇恨\n多个属性例如用010411表示先攻2连击吸血\n模仿怪的攻防设为0就好\n', 'value': '特殊属性的数值\n领域怪需要加value表示领域伤害的数值\n吸血怪需要在后面添加value代表吸血比例', 'bomb':' 加入 "bomb": false 代表该怪物不可被炸弹或圣锤炸掉'}, null); @@ -93,7 +150,8 @@ editor_file.editLoc = function(editor,x,y,obj,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 - if (isset(callback)) callback( + if (!isset(callback)) throw('未设置callback'); + callback( {"events":['\t[老人,man]这些是本样板支持的所有的道具。\n\n道具分为三类:items, constants, tools。\nitems 为即捡即用类道具,例如宝石、血瓶、剑盾等。\nconstants 为永久道具,例如怪物手册、楼层传送器、幸运金币等。\ntools 为消耗类道具,例如破墙镐、炸弹、中心对称飞行器等。\n\n后两类道具在工具栏中可以看到并使用。', '\t[老人,man]有关道具效果,定义在items.js中。\n目前大多数道具已有默认行为,如有自定义的需求则需在items.js中修改代码。', '\t[老人,man]constants 和 tools 各最多只允许12种,多了会导致图标溢出。', '\t[老人,man]拾取道具结束后可触发 afterGetItem 事件。\n\n有关事件的各种信息在下一层会有更为详细的说明。', {'type': 'hide', 'time': 500}],"changeFloor":"","afterBattle":"","afterGetItem":"","afterOpenDoor":""}, {"events":['', '', '', '', {'type': '', 'time': ' // 消失 \n // 守着门的老人 '}],"changeFloor":"","afterBattle":"","afterGetItem":"","afterOpenDoor":""}, null); @@ -104,7 +162,8 @@ editor_file.editFloor = function(editor,obj,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 - if (isset(callback)) callback( + if (!isset(callback)) throw('未设置callback'); + callback( {'floorId': 'sample0', 'title': '样板 0 层', 'name': '0', 'canFlyTo': True, 'canUseQuickShop': True, 'defaultGround': 'ground', 'firstArrive': ['\t[样板提示]首次到达某层可以触发 firstArrive 事件,该事件可类似于RMXP中的“自动执行脚本”。\n\n本事件支持一切的事件类型,常常用来触发对话,例如:', '\t[hero]我是谁?我从哪来?我又要到哪去?', '\t[仙子,fairy]你问我...?我也不知道啊...', '本层主要对道具、门、怪物等进行介绍,有关事件的各种信息在下一层会有更为详细的说明。']}, {'floorId': '// 这里需要改楼层名,请和文件名及下面的floorId保持完全一致 // 楼层唯一标识符仅能由字母、数字、下划线组成,且不能由数字开头 // 推荐用法:第20层就用MT20,第38层就用MT38,地下6层就用MT_6(用下划线代替负号),隐藏3层用MT3h(h表示隐藏),等等 \n // 楼层唯一标识符,需要和名字完全一致 ', 'title': ' // 楼层中文名 ', 'name': ' // 显示在状态栏中的层数 ', 'canFlyTo': ' // 该楼能否被楼传器飞到(不能的话在该楼也不允许使用楼传器) ', 'canUseQuickShop': ' // 该层是否允许使用快捷商店 ', 'defaultGround': ' // 默认地面的图块ID(terrains中) \n // 地图数据,需要是13x13,建议使用地图生成器来生成 ', 'firstArrive': ['', '', '', ' // 该楼的所有可能事件列表 \n // 守着道具的老人 ']}, null); @@ -117,7 +176,8 @@ editor_file.editTower = function(editor,obj,callback){ //obj形式同callback的obj,为null或undefined时只查询不修改 - if (isset(callback)) callback( + if (!isset(callback)) throw('未设置callback'); + callback( {'main': {'useCompress': False, 'floorIds': ['sample0', 'sample1', 'sample2', 'test']}, 'firstData': {'title': '魔塔样板', 'name': 'template', 'version': 'Ver 1.0.0 (Beta)', 'floorId': 'sample0', 'hero': {'name': '阳光', 'lv': 1, 'hp': 2000, 'atk': 100, 'def': 100, 'mdef': 100, 'money': 100, 'experience': 0, 'items': {'keys': {'yellowKey': 0, 'blueKey': 0, 'redKey': 0}, 'constants': {}, 'tools': {}}, 'flyRange': [], 'loc': {'direction': 'up', 'x': 6, 'y': 10}, 'flags': {'poison': False, 'weak': False, 'curse': False}}, 'startText': ['Hi,欢迎来到 HTML5 魔塔样板!\n\n本样板由艾之葵制作,可以让你在不会写任何代码\n的情况下也能做出属于自己的H5魔塔!', '这里游戏开始时的剧情。\n定义在data.js的startText处。\n\n你可以在这里写上自己的内容。', '赶快来试一试吧!'], 'shops': {'moneyShop1': {'name': '贪婪之神', 'icon': 'blueShop', 'textInList': '1F金币商店', 'use': 'money', 'need': '20+10*times*(times+1)', 'text': '勇敢的武士啊,给我${need}金币就可以:', 'choices': [{'text': '生命+800', 'effect': 'status:hp+=800'}, {'text': '攻击+4', 'effect': 'status:atk+=4'}, {'text': '防御+4', 'effect': 'status:def+=4'}, {'text': '魔防+10', 'effect': 'status:mdef+=10'}]}, 'expShop1': {'name': '经验之神', 'icon': 'pinkShop', 'textInList': '1F经验商店', 'use': 'experience', 'need': '-1', 'text': '勇敢的武士啊,给我若干经验就可以:', 'choices': [{'text': '等级+1', 'need': '100', 'effect': 'status:lv+=1;status:hp+=1000;status:atk+=7;status:def+=7'}, {'text': '攻击+5', 'need': '30', 'effect': 'status:atk+=5'}, {'text': '防御+5', 'need': '30', 'effect': 'status:def+=5'}]}}, 'levelUp': [{}, {'need': 20, 'name': '第二级', 'effect': 'status:hp+=2*(status:atk+status:def);status:atk+=10;status:def+=10'}, {'need': 40, 'effect': 'function () {\n core.drawText("恭喜升级!");\n core.status.hero.hp *= 2;\n core.status.hero.atk += 100;\n core.status.hero.def += 100;\n }'}]}, 'values': {'HPMAX': 999999, 'lavaDamage': 100, 'poisonDamage': 10, 'weakValue': 20, 'redJewel': 3, 'blueJewel': 3, 'greenJewel': 5, 'redPotion': 100, 'bluePotion': 250, 'yellowPotion': 500, 'greenPotion': 800, 'sword1': 10, 'shield1': 10, 'sword2': 20, 'shield2': 20, 'sword3': 40, 'shield3': 40, 'sword4': 80, 'shield4': 80, 'sword5': 160, 'shield5': 160, 'moneyPocket': 500, 'breakArmor': 0.9, 'counterAttack': 0.1, 'purify': 3, 'hatred': 2, 'animateSpeed': 500}, 'flags': {'enableNegativeDamage': True, 'enableFloor': False, 'enableLv': True, 'enableMDef': True, 'enableMoney': True, 'enableExperience': True, 'enableLevelUp': False, 'enableDebuff': True, 'flyNearStair': True, 'pickaxeFourDirections': True, 'bombFourDirections': True, 'bigKeyIsBox': False, 'startDirectly': False, 'canOpenBattleAnimate': True, 'showBattleAnimateConfirm': True, 'battleAnimate': True, 'displayEnemyDamage': True, 'displayExtraDamage': False, 'enableGentleClick': True, 'portalWithoutTrigger': True, 'potionWhileRouting': False}}, {'main': {'useCompress': ' // 是否使用压缩文件 // 当你即将发布你的塔时,请使用“JS代码压缩工具”将所有js代码进行压缩,然后将这里的useCompress改为true。 // 请注意,只有useCompress是false时才会读取floors目录下的文件,为true时会直接读取libs目录下的floors.min.js文件。 // 如果要进行剧本的修改请务必将其改成false。 \n // 在这里按顺序放所有的楼层;其顺序直接影响到楼层传送器的顺序和上楼器/下楼器的顺序 ', 'floorIds': ['', '', '', '']}, 'firstData': {'title': ' // 游戏名,将显示在标题页面以及切换楼层的界面中 ', 'name': ' // 游戏的唯一英文标识符。由英文、数字、下划线组成,不能超过20个字符。 ', 'version': ' // 当前游戏版本;版本不一致的存档不能通用。 ', 'floorId': ' // 初始楼层ID \n // 勇士初始数据 ', 'hero': {'name': ' // 勇士名;可以改成喜欢的 ', 'lv': ' // 初始等级,该项必须为正整数 ', 'hp': ' // 初始生命值 ', 'atk': ' // 初始攻击 ', 'def': ' // 初始防御 ', 'mdef': ' // 初始魔防 ', 'money': ' // 初始金币 ', 'experience': ' // 初始经验 \n // 初始道具个数 ', 'items': {'keys': {'yellowKey': '', 'blueKey': '', 'redKey': ''}, 'constants': '', 'tools': ''}, 'flyRange': ' // 初始可飞的楼层;一般留空数组即可 ', 'loc': {'direction': '', 'x': '', 'y': ' // 勇士初始位置 \n // 游戏过程中的变量或flags '}, 'flags': {'poison': ' // 毒 ', 'weak': ' // 衰 ', 'curse': ' // 咒 \n // 游戏开始前剧情。如果无剧情直接留一个空数组即可。 '}}, 'startText': ['', '', ' // 定义全局商店(即快捷商店) \n // 商店唯一ID '], 'shops': {'moneyShop1': {'name': ' // 商店名称(标题) ', 'icon': ' // 商店图标,blueShop为蓝色商店,pinkShop为粉色商店 ', 'textInList': ' // 在快捷商店栏中显示的名称 ', 'use': ' // 商店所要使用的。只能是"money"或"experience"。 ', 'need': ' // 商店需要的金币/经验数值;可以是一个表达式,以times作为参数计算。 // 这里用到的times为该商店的已经的访问次数。首次访问该商店时times的值为0。 // 上面的例子是50层商店的计算公式。你也可以写任意其他的计算公式,只要以times作为参数即可。 // 例如: "need": "25" 就是恒定需要25金币的商店; "need": "20+2*times" 就是第一次访问要20金币,以后每次递增2金币的商店。 // 如果是对于每个选项有不同的计算公式,写 "need": "-1" 即可。可参见下面的经验商店。 ', 'text': ' // 显示的文字,需手动加换行符。可以使用${need}表示上面的need值。 \n // 商店的选项 ', 'choices': [{'text': '', 'effect': ' // 如果有多个effect以分号分开,参见下面的经验商店 '}, {'text': '', 'effect': ''}, {'text': '', 'effect': ''}, {'text': '', 'effect': ' // effect只能对status和item进行操作,不能修改flag值。 // 必须是X+=Y的形式,其中Y可以是一个表达式,以status:xxx或item:xxx为参数 // 其他effect样例: // "item:yellowKey+=1" 黄钥匙+1 // "item:pickaxe+=3" 破墙镐+3 // "status:hp+=2*(status:atk+status:def)" 将生命提升攻防和的数值的两倍 \n // 商店唯一ID '}]}, 'expShop1': {'name': '', 'icon': '', 'textInList': '', 'use': ' // 该商店使用的是经验进行计算 ', 'need': ' // 如果是对于每个选项所需要的数值不同,这里直接写-1,然后下面选项里给定具体数值 ', 'text': ' // 在choices中写need,可以针对每个选项都有不同的需求。 // 这里的need同样可以以times作为参数,比如 "need": "100+20*times" ', 'choices': [{'text': '', 'need': '', 'effect': ' // 多个effect直接以分号分开即可。如上面的意思是生命+1000,攻击+7,防御+7。 '}, {'text': '', 'need': '', 'effect': ''}, {'text': '', 'need': '', 'effect': ' // 经验升级所需要的数值,是一个数组 '}]}}, 'levelUp': [' // 第一项为初始等级,可以简单留空,也可以写name // 每一个里面可以含有三个参数 name, need, effect // need为所需要的经验数值,是一个正整数。请确保need所需的依次递增 // name为该等级的名称,也可以省略代表使用系统默认值;本项将显示在状态栏中 // effect为本次升级所执行的操作,可由若干项组成,由分号分开 // 其中每一项写法和上面的商店完全相同,同样必须是X+=Y的形式,Y是一个表达式,同样可以使用status:xxx或item:xxx代表勇士的某项数值/道具个数 ', {'need': '', 'name': '', 'effect': ' // 先将生命提升攻防和的2倍;再将攻击+10,防御+10 // effect也允许写一个function,代表本次升级将会执行的操作 '}, {'need': '', 'effect': ' // 依次往下写需要的数值即可 \n // 各种数值;一些数值可以在这里设置 \n /****** 角色相关 ******/ '}]}, 'values': {'HPMAX': ' // HP上限;-1则无上限 ', 'lavaDamage': ' // 经过血网受到的伤害 ', 'poisonDamage': ' // 中毒后每步受到的伤害 ', 'weakValue': ' // 衰弱状态下攻防减少的数值 /****** 道具相关 ******/ ', 'redJewel': ' // 红宝石加攻击的数值 ', 'blueJewel': ' // 蓝宝石加防御的数值 ', 'greenJewel': ' // 绿宝石加魔防的数值 ', 'redPotion': ' // 红血瓶加血数值 ', 'bluePotion': ' // 蓝血瓶加血数值 ', 'yellowPotion': ' // 黄血瓶加血数值 ', 'greenPotion': ' // 绿血瓶加血数值 ', 'sword1': ' // 铁剑加攻数值 ', 'shield1': ' // 铁盾加防数值 ', 'sword2': ' // 银剑加攻数值 ', 'shield2': ' // 银盾加防数值 ', 'sword3': ' // 骑士剑加攻数值 ', 'shield3': ' // 骑士盾加防数值 ', 'sword4': ' // 圣剑加攻数值 ', 'shield4': ' // 圣盾加防数值 ', 'sword5': ' // 神圣剑加攻数值 ', 'shield5': ' // 神圣盾加防数值 ', 'moneyPocket': ' // 金钱袋加金币的数值 /****** 怪物相关 ******/ ', 'breakArmor': ' // 破甲的比例(战斗前,怪物附加角色防御的x%作为伤害) ', 'counterAttack': ' // 反击的比例(战斗时,怪物每回合附加角色攻击的x%作为伤害,无视角色防御) ', 'purify': ' // 净化的比例(战斗前,怪物附加勇士魔防的x倍作为伤害) ', 'hatred': ' // 仇恨属性中,每杀死一个怪物获得的仇恨值 /****** 系统相关 ******/ ', 'animateSpeed': ' // 动画时间 \n // 系统FLAG,在游戏运行中中请不要修改它。 \n /****** 角色状态相关 ******/ '}, 'flags': {'enableNegativeDamage': ' // 是否支持负伤害(回血) ', 'enableFloor': ' // 是否在状态栏显示当前楼层 ', 'enableLv': ' // 是否在状态栏显示当前等级 ', 'enableMDef': ' // 是否在状态栏及战斗界面显示魔防(护盾) ', 'enableMoney': ' // 是否在状态栏、怪物手册及战斗界面显示金币 ', 'enableExperience': ' // 是否在状态栏、怪物手册及战斗界面显示经验 ', 'enableLevelUp': ' // 是否允许等级提升(进阶);如果上面enableExperience为false,则此项恒视为false ', 'enableDebuff': ' // 是否涉及毒衰咒;如果此项为false则不会在状态栏中显示毒衰咒的debuff ////// 上述的几个开关将直接影响状态栏的显示效果 ////// /****** 道具相关 ******/ ', 'flyNearStair': ' // 是否需要在楼梯边使用传送器 ', 'pickaxeFourDirections': ' // 使用破墙镐是否四个方向都破坏;如果false则只破坏面前的墙壁 ', 'bombFourDirections': ' // 使用炸弹是否四个方向都会炸;如果false则只炸面前的怪物(即和圣锤等价) ', 'bigKeyIsBox': ' // 如果此项为true,则视为钥匙盒,红黄蓝钥匙+1;若为false,则视为大黄门钥匙 /****** 系统相关 ******/ ', 'startDirectly': ' // 点击“开始游戏”后是否立刻开始游戏而不显示难度选择界面 ', 'canOpenBattleAnimate': ' // 是否允许用户开启战斗过程;如果此项为false,则下面两项均强制视为false ', 'showBattleAnimateConfirm': ' // 是否在游戏开始时提供“是否开启战斗动画”的选项 ', 'battleAnimate': ' // 是否默认显示战斗动画;用户可以手动在菜单栏中开关 ', 'displayEnemyDamage': ' // 是否地图怪物显伤;用户可以手动在菜单栏中开关 ', 'displayExtraDamage': ' // 是否地图高级显伤(领域、夹击等);用户可以手动在菜单栏中开关 ', 'enableGentleClick': ' // 是否允许轻触(获得面前物品) ', 'portalWithoutTrigger': ' // 经过楼梯、传送门时是否能“穿透”。穿透的意思是,自动寻路得到的的路径中间经过了楼梯,行走时是否触发楼层转换事件 ', 'potionWhileRouting': ' // 寻路算法是否经过血瓶;如果该项为false,则寻路算法会自动尽量绕过血瓶 '}}, null);