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;
}