This commit is contained in:
oc 2017-12-15 14:23:27 +08:00
parent 6b2e8cda09
commit 3f10919c00
19 changed files with 345 additions and 208 deletions

Binary file not shown.

BIN
images/hero.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
images/hero2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -6,8 +6,7 @@
<meta name='author' content='ckcz123'> <meta name='author' content='ckcz123'>
<meta name='viewport' <meta name='viewport'
content='width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=yes'> content='width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=yes'>
<!-- 做出塔后需要在这里改成塔本身的名字 --> <title></title>
<title>魔塔样板 - HTML5魔塔</title>
<meta name="apple-mobile-web-app-title" content="魔塔样板"> <meta name="apple-mobile-web-app-title" content="魔塔样板">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
<meta name="screen-orientation" content="portrait"> <meta name="screen-orientation" content="portrait">
@ -30,7 +29,7 @@
</div> </div>
<img id='startBackground' src='images/bg.png'> <img id='startBackground' src='images/bg.png'>
<!-- 标题界面可以改style的color使标题改变颜色 --> <!-- 标题界面可以改style的color使标题改变颜色 -->
<p id='startLogo' style="color: black">魔塔样板</p> <p id='startLogo' style="color: black"></p>
<div id='startButtonGroup'> <div id='startButtonGroup'>
<div id='startButtons'> <div id='startButtons'>
<span class='startButton' id='playGame'>开始游戏</span> <span class='startButton' id='playGame'>开始游戏</span>
@ -96,14 +95,14 @@
<img src="images/toolbox.png" class="tools" id='img-toolbox'> <img src="images/toolbox.png" class="tools" id='img-toolbox'>
<img src="images/shop.png" class="tools" id='img-shop'> <img src="images/shop.png" class="tools" id='img-shop'>
<img src="images/save.png" class="tools" id='img-save'> <img src="images/save.png" class="tools" id='img-save'>
<img src="images/load.png" class="tools" id=img-load> <img src="images/load.png" class="tools" id='img-load'>
<img src="images/settings.png" class="tools" id='img-settings'> <img src="images/settings.png" class="tools" id='img-settings'>
<p class="statusLabel tools" id="hard"></p> <p class="statusLabel tools" id="hard"></p>
</div> </div>
<canvas class='gameCanvas' id='bg' width='416' height='416'></canvas> <canvas class='gameCanvas' id='bg' width='416' height='416'></canvas>
<canvas class='gameCanvas' id='event' width='416' height='416'></canvas> <canvas class='gameCanvas' id='event' width='416' height='416'></canvas>
<canvas class='gameCanvas' id='fg' width='416' height='416'></canvas>
<canvas class='gameCanvas' id='hero' width='416' height='416'></canvas> <canvas class='gameCanvas' id='hero' width='416' height='416'></canvas>
<canvas class='gameCanvas' id='fg' width='416' height='416'></canvas>
<canvas class='gameCanvas' id='ui' width='416' height='416'></canvas> <canvas class='gameCanvas' id='ui' width='416' height='416'></canvas>
<canvas class='gameCanvas' id='data' width='416' height='416'>此浏览器不支持HTML5</canvas> <canvas class='gameCanvas' id='data' width='416' height='416'>此浏览器不支持HTML5</canvas>
</div> </div>

View File

@ -111,6 +111,8 @@ core.prototype.init = function (dom, statusBar, canvas, images, sounds, floorIds
core.initStatus.shops = core.firstData.shops; core.initStatus.shops = core.firstData.shops;
core.dom.versionLabel.innerHTML = core.firstData.version; core.dom.versionLabel.innerHTML = core.firstData.version;
core.dom.logoLabel.innerHTML = core.firstData.title; core.dom.logoLabel.innerHTML = core.firstData.title;
document.title = core.firstData.title + " - HTML5魔塔";
document.getElementById("startLogo").innerHTML = core.firstData.title;
core.material.items = core.items.getItems(); core.material.items = core.items.getItems();
core.initStatus.maps = core.maps.initMaps(floorIds); core.initStatus.maps = core.maps.initMaps(floorIds);
core.material.enemys = core.clone(core.enemys.getEnemys()); core.material.enemys = core.clone(core.enemys.getEnemys());
@ -132,6 +134,10 @@ core.prototype.init = function (dom, statusBar, canvas, images, sounds, floorIds
core.loader(function () { core.loader(function () {
console.log(core.material); console.log(core.material);
// 设置勇士高度
core.material.icons.hero.height = core.material.images.hero.height/4;
core.showStartAnimate(); core.showStartAnimate();
}); });
} }
@ -1165,11 +1171,12 @@ core.prototype.drawHero = function (direction, x, y, status, offsetX, offsetY) {
offsetX = offsetX || 0; offsetX = offsetX || 0;
offsetY = offsetY || 0; offsetY = offsetY || 0;
core.clearAutomaticRouteNode(x, y); core.clearAutomaticRouteNode(x, y);
var heroIcon = core.material.icons.heros[core.status.hero.id][direction]; var heroIcon = core.material.icons.hero[direction];
x = x * 32; x = x * 32;
y = y * 32; y = y * 32;
core.canvas.hero.clearRect(x - 32, y - 32, 96, 96); core.canvas.hero.clearRect(x - 32, y - 32, 96, 96);
core.canvas.hero.drawImage(core.material.images.heros, heroIcon[status] * 32, heroIcon.loc * 32, 32, 32, x + offsetX, y + offsetY, 32, 32); var height=core.material.icons.hero.height;
core.canvas.hero.drawImage(core.material.images.hero, heroIcon[status] * 32, heroIcon.loc * height, 32, height, x + offsetX, y + offsetY + 32-height, 32, height);
} }
/////////// 自动行走 & 行走控制 END /////////// /////////// 自动行走 & 行走控制 END ///////////
@ -1180,6 +1187,9 @@ core.prototype.drawHero = function (direction, x, y, status, offsetX, offsetY) {
// 开门 // 开门
core.prototype.openDoor = function (id, x, y, needKey, callback) { core.prototype.openDoor = function (id, x, y, needKey, callback) {
if (core.interval.openDoorAnimate!=null) return;
// 是否存在门 // 是否存在门
if (!core.terrainExists(x, y, id)) { if (!core.terrainExists(x, y, id)) {
if (core.isset(callback)) callback(); if (core.isset(callback)) callback();
@ -1216,6 +1226,7 @@ core.prototype.openDoor = function (id, x, y, needKey, callback) {
state++; state++;
if (state == 4) { if (state == 4) {
clearInterval(core.interval.openDoorAnimate); clearInterval(core.interval.openDoorAnimate);
core.interval.openDoorAnimate=null;
core.removeBlock(x, y); core.removeBlock(x, y);
core.events.afterOpenDoor(id,x,y,callback); core.events.afterOpenDoor(id,x,y,callback);
return; return;
@ -1492,6 +1503,7 @@ core.prototype.drawMap = function (mapName, callback) {
} }
} }
core.setGlobalAnimate(core.values.animateSpeed); core.setGlobalAnimate(core.values.animateSpeed);
if (core.isset(callback)) if (core.isset(callback))
callback(); callback();
} }
@ -1838,6 +1850,59 @@ core.prototype.drawBoxAnimate = function (background) {
} }
} }
core.prototype.setFg = function(color, time, callback) {
time = time || 750;
core.setOpacity('fg', 1);
var fromAlpha = 0;
if (core.isset(core.status.event.data.currentColor)) {
fromAlpha = 1;
}
else {
core.status.event.data.currentColor = [0,0,0];
}
var fromColor = core.status.event.data.currentColor;
var toAlpha = 1;
if (!core.isset(color)) {
color = [0,0,0];
toAlpha=0;
}
var step=0;
var changeAnimate = setInterval(function() {
step++;
core.clearMap('fg', 0, 0, 416, 416);
var nowAlpha = fromAlpha+(toAlpha-fromAlpha)*step/25;
var nowR = parseInt(fromColor[0]+(color[0]-fromColor[0])*step/25);
var nowG = parseInt(fromColor[1]+(color[1]-fromColor[1])*step/25);
var nowB = parseInt(fromColor[2]+(color[2]-fromColor[2])*step/25);
if (nowR<0) nowR=0; if (nowR>255) nowR=255;
if (nowG<0) nowG=0; if (nowG>255) nowG=255;
if (nowB<0) nowB=0; if (nowB>255) nowB=255;
core.setAlpha('fg', nowAlpha);
var toRGB = "#"+nowR.toString(16)+nowG.toString(16)+nowB.toString(16);
core.fillRect('fg', 0, 0, 416, 416, toRGB);
if (step>=25) {
clearInterval(changeAnimate);
if (toAlpha==0) {
core.clearMap('fg', 0, 0, 416, 416);
delete core.status.event.data.currentColor;
core.setAlpha('fg', 1);
core.updateFg();
}
else core.status.event.data.currentColor = color;
if (core.isset(callback)) callback();
}
}, time/25);
}
core.prototype.setHeroLoc = function (itemName, itemVal) { core.prototype.setHeroLoc = function (itemName, itemVal) {
if (itemVal == '++') { if (itemVal == '++') {
core.status.hero.loc[itemName]++; core.status.hero.loc[itemName]++;
@ -1879,6 +1944,14 @@ core.prototype.nextY = function () {
* 更新显伤 * 更新显伤
*/ */
core.prototype.updateFg = function () { core.prototype.updateFg = function () {
// 如果存在颜色
if (core.isset(core.status.event.data) && core.isset(core.status.event.data.currentColor)) {
var color=core.status.event.data.currentColor;
core.fillRect("fg",0,0,416,416,"#"+color[0].toString(16)+color[1].toString(16)+color[2].toString(16));
return;
}
if (!core.isset(core.status.thisMap) || !core.isset(core.status.thisMap.blocks)) return; if (!core.isset(core.status.thisMap) || !core.isset(core.status.thisMap.blocks)) return;
// 更新显伤 // 更新显伤
var mapBlocks = core.status.thisMap.blocks; var mapBlocks = core.status.thisMap.blocks;
@ -2110,6 +2183,30 @@ core.prototype.calValue = function (value) {
return eval(value); return eval(value);
} }
core.prototype.splitLines = function(canvas, text, maxLength, font) {
if (core.isset(font)) core.setFont(canvas, font);
var contents = [];
var last = 0;
for (var i=0;i<text.length;i++) {
if (text.charAt(i)=='\n') {
contents.push(text.substring(last, i));
last=i+1;
}
else {
var toAdd = text.substring(last, i+1);
var width = core.canvas[canvas].measureText(toAdd).width;
if (width>maxLength) {
contents.push(text.substring(last, i));
last=i;
}
}
}
contents.push(text.substring(last));
return contents;
}
core.prototype.unshift = function (a,b) { core.prototype.unshift = function (a,b) {
if (!(a instanceof Array) || !core.isset(b)) return; if (!(a instanceof Array) || !core.isset(b)) return;
if (b instanceof Array) { if (b instanceof Array) {
@ -2683,14 +2780,21 @@ core.prototype.resize = function(clientWidth, clientHeight) {
width = clientHeight; width = clientHeight;
} }
// 各元素大小的变量声明 // 各元素大小的变量声明
var gameGroupWidth, gameGroupHeight, var gameGroupWidth, gameGroupHeight, borderRight,
canvasWidth, canvasTop, canvasLeft, canvasWidth, canvasTop, canvasLeft,
statusBarWidth, statusBarHeight, statusBarBorder, statusBarWidth, statusBarHeight, statusBarBorder,
statusWidth, statusHeigth, statusMaxWidth,statusLabelsLH, statusWidth, statusHeight, statusMaxWidth,statusLabelsLH,
toolBarWidth, toolBarHeight, toolBarTop, toolBarBorder, toolBarWidth, toolBarHeight, toolBarTop, toolBarBorder,
toolsWidth, toolsHeight,toolsMargin,toolsPMaxwidth, toolsWidth, toolsHeight,toolsMargin,toolsPMaxwidth,
fontSize, margin; fontSize, margin;
var count = 9;
if (!core.flags.enableMDef) count--;
if (!core.flags.enableExperience) count--;
if (!core.flags.enableDebuff) count--;
var statusLineHeight = BASE_LINEHEIGHT * 9/count;
var shopDisplay, mdefDispaly, expDispaly; var shopDisplay, mdefDispaly, expDispaly;
mdefDispaly = core.flags.enableMDef ? 'block' : 'none'; mdefDispaly = core.flags.enableMDef ? 'block' : 'none';
expDispaly = core.flags.enableExperience ? 'block' : 'none'; expDispaly = core.flags.enableExperience ? 'block' : 'none';
@ -2723,15 +2827,15 @@ core.prototype.resize = function(clientWidth, clientHeight) {
canvasTop = tempTopBarH; canvasTop = tempTopBarH;
canvasLeft = 0; canvasLeft = 0;
toolBarWidth = statusBarWidth = width; toolBarWidth = statusBarWidth = width;
statusBarHeigth = tempTopBarH; //一共有3行加上两个padding空隙 statusBarHeight = tempTopBarH; //一共有3行加上两个padding空隙
statusBarBorder = '3px #fff solid'; statusBarBorder = '3px #fff solid';
statusHeigth = scale*BASE_LINEHEIGHT * .8; statusHeight = scale*BASE_LINEHEIGHT * .8;
statusLabelsLH = .8 * BASE_LINEHEIGHT *scale; statusLabelsLH = .8 * BASE_LINEHEIGHT *scale;
statusMaxWidth = scale * DEFAULT_BAR_WIDTH * .95; statusMaxWidth = scale * DEFAULT_BAR_WIDTH * .95;
toolBarHeight = tempBotBarH; toolBarHeight = tempBotBarH;
toolBarTop = statusBarHeigth + width; toolBarTop = statusBarHeight + width;
toolBarBorder = '3px #fff solid'; toolBarBorder = '3px #fff solid';
toolsHeight = scale * BASE_LINEHEIGHT; toolsHeight = scale * BASE_LINEHEIGHT;
toolsPMaxwidth = scale * DEFAULT_BAR_WIDTH * .4; toolsPMaxwidth = scale * DEFAULT_BAR_WIDTH * .4;
@ -2747,13 +2851,13 @@ core.prototype.resize = function(clientWidth, clientHeight) {
canvasTop = 0; canvasTop = 0;
canvasLeft = DEFAULT_BAR_WIDTH * scale; canvasLeft = DEFAULT_BAR_WIDTH * scale;
toolBarWidth = statusBarWidth = DEFAULT_BAR_WIDTH * scale; toolBarWidth = statusBarWidth = DEFAULT_BAR_WIDTH * scale;
statusBarHeigth = scale * BASE_LINEHEIGHT * 9 + SPACE * 2; //一共有9行加上两个padding空隙 statusBarHeight = scale * statusLineHeight * count + SPACE * 2; //一共有9行加上两个padding空隙
statusBarBorder = '3px #fff solid'; statusBarBorder = '3px #fff solid';
statusHeigth = scale*BASE_LINEHEIGHT * .8; statusHeight = scale*statusLineHeight * .8;
statusLabelsLH = .8 * BASE_LINEHEIGHT *scale; statusLabelsLH = .8 * statusLineHeight *scale;
toolBarHeight = width - statusBarHeigth; toolBarHeight = width - statusBarHeight;
toolBarTop = scale*BASE_LINEHEIGHT * 9 + SPACE * 2; toolBarTop = scale*statusLineHeight * count + SPACE * 2;
toolBarBorder = '3px #fff solid'; toolBarBorder = '3px #fff solid';
toolsHeight = scale * BASE_LINEHEIGHT; toolsHeight = scale * BASE_LINEHEIGHT;
borderRight = ''; borderRight = '';
@ -2768,7 +2872,7 @@ core.prototype.resize = function(clientWidth, clientHeight) {
core.domStyle.scale = 1; core.domStyle.scale = 1;
core.domStyle.screenMode = 'bigScreen'; core.domStyle.screenMode = 'bigScreen';
shopDisplay = 'none'; shopDisplay = 'none';
gameGroupWidth = DEFAULT_CANVAS_WIDTH + DEFAULT_BAR_WIDTH; gameGroupWidth = DEFAULT_CANVAS_WIDTH + DEFAULT_BAR_WIDTH;
gameGroupHeight = DEFAULT_CANVAS_WIDTH; gameGroupHeight = DEFAULT_CANVAS_WIDTH;
canvasWidth = DEFAULT_CANVAS_WIDTH; canvasWidth = DEFAULT_CANVAS_WIDTH;
@ -2776,12 +2880,12 @@ core.prototype.resize = function(clientWidth, clientHeight) {
canvasLeft = DEFAULT_BAR_WIDTH; canvasLeft = DEFAULT_BAR_WIDTH;
toolBarWidth = statusBarWidth = DEFAULT_BAR_WIDTH; toolBarWidth = statusBarWidth = DEFAULT_BAR_WIDTH;
statusBarHeigth = BASE_LINEHEIGHT * 9 + SPACE * 2; //一共有9行 statusBarHeight = statusLineHeight * count + SPACE * 2; //一共有9行
statusHeigth = BASE_LINEHEIGHT * .8; statusHeight = statusLineHeight * .8;
statusLabelsLH = .8 * BASE_LINEHEIGHT; statusLabelsLH = .8 * statusLineHeight;
toolBarHeight = DEFAULT_CANVAS_WIDTH - statusBarHeigth; toolBarHeight = DEFAULT_CANVAS_WIDTH - statusBarHeight;
toolBarTop = BASE_LINEHEIGHT * 9 + SPACE * 2; toolBarTop = statusLineHeight * count + SPACE * 2;
toolsHeight = BASE_LINEHEIGHT; toolsHeight = BASE_LINEHEIGHT;
borderRight = ''; borderRight = '';
@ -2815,7 +2919,7 @@ core.prototype.resize = function(clientWidth, clientHeight) {
{ id: 'statusBar', { id: 'statusBar',
rules:{ rules:{
width: statusBarWidth + unit, width: statusBarWidth + unit,
height: statusBarHeigth + unit, height: statusBarHeight + unit,
top: 0, top: 0,
left: 0, left: 0,
padding: SPACE + unit, padding: SPACE + unit,
@ -2830,7 +2934,7 @@ core.prototype.resize = function(clientWidth, clientHeight) {
rules:{ rules:{
width: '100%', width: '100%',
maxWidth: statusMaxWidth + unit, maxWidth: statusMaxWidth + unit,
height: statusHeigth + unit, height: statusHeight + unit,
margin: margin/2 + unit margin: margin/2 + unit
} }
}, },
@ -2885,6 +2989,10 @@ core.prototype.resize = function(clientWidth, clientHeight) {
} }
core.prototype.domRenderer = function(){ core.prototype.domRenderer = function(){
core.dom.statusBar.style.display = 'block';
core.dom.toolBar.style.display = 'block';
var styles = core.domStyle.styles; var styles = core.domStyle.styles;
for(var i=0; i<styles.length; i++){ for(var i=0; i<styles.length; i++){

View File

@ -9,8 +9,7 @@ data.prototype.init = function() {
"version": "Ver 1.0.0 (Beta)", // 当前游戏版本;版本不一致的存档不能通用。 "version": "Ver 1.0.0 (Beta)", // 当前游戏版本;版本不一致的存档不能通用。
"floorId": "sample0", // 初始楼层ID "floorId": "sample0", // 初始楼层ID
"hero": { // 勇士初始数据 "hero": { // 勇士初始数据
"id": "hero1", // 此项关系到icons中的heroID一般不要改 "name": "阳光", // 勇士名;可以改成喜欢的
"name": "勇士", // 勇士名;可以改成喜欢的
"hp": 1000, // 初始生命值 "hp": 1000, // 初始生命值
"atk": 100, // 初始攻击 "atk": 100, // 初始攻击
"def": 100, // 初始防御 "def": 100, // 初始防御
@ -43,13 +42,14 @@ data.prototype.init = function() {
"moneyShop1": { // 商店唯一ID "moneyShop1": { // 商店唯一ID
"name": "贪婪之神", // 商店名称(标题) "name": "贪婪之神", // 商店名称(标题)
"icon": "blueShop", // 商店图标blueShop为蓝色商店pinkShop为粉色商店 "icon": "blueShop", // 商店图标blueShop为蓝色商店pinkShop为粉色商店
"textInList": "3楼金币商店", // 在快捷商店栏中显示的名称 "textInList": "1F金币商店", // 在快捷商店栏中显示的名称
"use": "money", // 商店所要使用的。只能是"money"或"experience"。 "use": "money", // 商店所要使用的。只能是"money"或"experience"。
"need": "20+10*times*(times+1)", // 商店需要的金币/经验数值可以是一个表达式以times作为参数计算。 "need": "20+10*times*(times+1)", // 商店需要的金币/经验数值可以是一个表达式以times作为参数计算。
// 这里用到的times为该商店的已经的访问次数。首次访问该商店时times的值为0。 // 这里用到的times为该商店的已经的访问次数。首次访问该商店时times的值为0。
// 上面的例子是50层商店的计算公式。你也可以写任意其他的计算公式只要以times作为参数即可。 // 上面的例子是50层商店的计算公式。你也可以写任意其他的计算公式只要以times作为参数即可。
// 例如: "need": "25" 就是恒定需要25金币的商店 "need": "20+2*times" 就是第一次访问要20金币以后每次递增2金币的商店。 // 例如: "need": "25" 就是恒定需要25金币的商店 "need": "20+2*times" 就是第一次访问要20金币以后每次递增2金币的商店。
// 如果是对于每个选项有不同的计算公式,写 "need": "-1" 即可。可参见下面的经验商店。 // 如果是对于每个选项有不同的计算公式,写 "need": "-1" 即可。可参见下面的经验商店。
"text": "勇敢的武士啊,给我${need}金币就可以:", // 显示的文字,需手动加换行符。可以使用${need}表示上面的need值。
"choices": [ // 商店的选项 "choices": [ // 商店的选项
{"text": "生命+800", "effect": "status:hp+=800"}, {"text": "生命+800", "effect": "status:hp+=800"},
// 如果有多个effect以分号分开参见下面的经验商店 // 如果有多个effect以分号分开参见下面的经验商店
@ -66,9 +66,10 @@ data.prototype.init = function() {
"expShop1": { // 商店唯一ID "expShop1": { // 商店唯一ID
"name": "经验之神", "name": "经验之神",
"icon": "pinkShop", "icon": "pinkShop",
"textInList": "5楼经验商店", "textInList": "1F经验商店",
"use": "experience", // 该商店使用的是经验进行计算 "use": "experience", // 该商店使用的是经验进行计算
"need": "-1", // 如果是对于每个选项所需要的数值不同,这里直接写-1然后下面选项里给定具体数值 "need": "-1", // 如果是对于每个选项所需要的数值不同,这里直接写-1然后下面选项里给定具体数值
"text": "勇敢的武士啊,给我若干经验就可以:",
"choices": [ "choices": [
// 在choices中写need可以针对每个选项都有不同的需求。 // 在choices中写need可以针对每个选项都有不同的需求。
// 这里的need同样可以以times作为参数比如 "need": "100+20*times" // 这里的need同样可以以times作为参数比如 "need": "100+20*times"
@ -115,16 +116,14 @@ data.prototype.init = function() {
this.flags = { this.flags = {
/****** 角色状态相关 ******/ /****** 角色状态相关 ******/
"enableMDef": false, // 是否涉及勇士的魔防值如果此项为false则状态栏不会显示勇士的魔防值 "enableMDef": true, // 是否涉及勇士的魔防值如果此项为false则状态栏不会显示勇士的魔防值
"enableExperience": true, // 是否涉及经验值如果此项为false则状态栏和怪物手册均将不会显示经验值 "enableExperience": true, // 是否涉及经验值如果此项为false则状态栏和怪物手册均将不会显示经验值
"enableDebuff": true, // 是否涉及debuff,支持三项"poison" 毒"weak": 衰"curse": 咒 "enableDebuff": true, // 是否涉及毒衰咒如果此项为false则不会在状态栏中显示毒衰咒的debuff
/****** 道具相关 ******/ /****** 道具相关 ******/
"flyNearStair": true, // 是否需要在楼梯边使用传送器 "flyNearStair": true, // 是否需要在楼梯边使用传送器
"bombTrigger": true, // 使用炸弹后是否触发怪物事件(如开门)
"pickaxeFourDirections": true, // 使用破墙镐是否四个方向都破坏如果false则只破坏面前的墙壁 "pickaxeFourDirections": true, // 使用破墙镐是否四个方向都破坏如果false则只破坏面前的墙壁
"bigKeyIsBox": false, // 如果此项为true则视为钥匙盒红黄蓝钥匙+1若为false则视为大黄门钥匙 "bigKeyIsBox": false, // 如果此项为true则视为钥匙盒红黄蓝钥匙+1若为false则视为大黄门钥匙
/****** 系统相关 ******/ /****** 系统相关 ******/
"portalWithoutTrigger": true, // 经过楼梯、传送门时是否能“穿透”。穿透的意思是,自动寻路得到的的路径中间经过了楼梯,行走时是否触发楼层转换事件 "portalWithoutTrigger": true, // 经过楼梯、传送门时是否能“穿透”。穿透的意思是,自动寻路得到的的路径中间经过了楼梯,行走时是否触发楼层转换事件
"potionWhileRouting": false, // 寻路算法是否经过血瓶如果该项为false则寻路算法会自动尽量绕过血瓶 "potionWhileRouting": false, // 寻路算法是否经过血瓶如果该项为false则寻路算法会自动尽量绕过血瓶

View File

@ -51,7 +51,7 @@ enemys.prototype.init = function () {
'goldHornSlime': {'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}, '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}, '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}, // 吸血怪需要在后面添加value代表吸血比例 '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}, '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}, '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}, 'whiteHornSlime': {'name': '尖角怪', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'experience': 0, 'special': 0},

View File

@ -248,12 +248,19 @@ events.prototype.doAction = function() {
break; break;
case "changePos": // 直接更换勇士位置,不切换楼层 case "changePos": // 直接更换勇士位置,不切换楼层
core.clearMap('hero', 0, 0, 416, 416); core.clearMap('hero', 0, 0, 416, 416);
core.setHeroLoc('x', data.loc[0]); if (core.isset(data.loc)) {
core.setHeroLoc('y', data.loc[1]); core.setHeroLoc('x', data.loc[0]);
core.setHeroLoc('y', data.loc[1]);
}
if (core.isset(data.direction)) core.setHeroLoc('direction', data.direction); if (core.isset(data.direction)) core.setHeroLoc('direction', data.direction);
core.drawHero(core.getHeroLoc('direction'), core.getHeroLoc('x'), core.getHeroLoc('y'), 'stop'); core.drawHero(core.getHeroLoc('direction'), core.getHeroLoc('x'), core.getHeroLoc('y'), 'stop');
this.doAction(); this.doAction();
break; break;
case "setFg": // 颜色渐变
core.setFg(data.color, data.time, function() {
core.events.doAction();
});
break;
case "openDoor": // 开一个门,包括暗墙 case "openDoor": // 开一个门,包括暗墙
var floorId=data.floorId || core.status.floorId; var floorId=data.floorId || core.status.floorId;
var block=core.getBlock(data.loc[0], data.loc[1], floorId); var block=core.getBlock(data.loc[0], data.loc[1], floorId);
@ -273,6 +280,9 @@ events.prototype.doAction = function() {
case "openShop": // 打开一个全局商店 case "openShop": // 打开一个全局商店
core.events.openShop(data.id); core.events.openShop(data.id);
break; break;
case "disableShop": // 禁用一个全局商店
core.events.disableQuickShop(data.id);
break;
case "battle": // 强制战斗 case "battle": // 强制战斗
core.battle(data.id,null,null,true,function() { core.battle(data.id,null,null,true,function() {
core.events.doAction(); core.events.doAction();
@ -285,9 +295,14 @@ events.prototype.doAction = function() {
block = block.block; block = block.block;
if (core.isset(block.event) && block.event.trigger=='action') { if (core.isset(block.event) && block.event.trigger=='action') {
// 触发 // 触发
/*
core.status.event = {'id': 'action', 'data': { core.status.event = {'id': 'action', 'data': {
'list': core.clone(block.event.data), 'x': block.x, 'y': block.y, 'callback': core.status.event.data.callback 'list': core.clone(block.event.data), 'x': block.x, 'y': block.y, 'callback': core.status.event.data.callback
}} }}
*/
core.status.event.data.list = core.clone(block.event.data);
core.status.event.data.x=block.x;
core.status.event.data.y=block.y;
} }
} }
this.doAction(); this.doAction();
@ -397,9 +412,13 @@ events.prototype.openShop = function(shopId, needVisited) {
// 拼词 // 拼词
var content = "\t["+shop.name+","+shop.icon+"]"; var content = "\t["+shop.name+","+shop.icon+"]";
var times = shop.times, need=eval(shop.need); var times = shop.times, need=eval(shop.need);
if (need<0) need="若干";
var use=shop.use=="experience"?"经验":"金币"; content = content + shop.text.replace(/\${([^}]+)}/g, function (word, value) {
content = content+"勇敢的武士啊,给我"+need+"\n"+use+",你就可以:" return eval(value);
});
var use = shop.use=='experience'?'经验':'金币';
var choices = []; var choices = [];
for (var i=0;i<shop.choices.length;i++) { for (var i=0;i<shop.choices.length;i++) {
var choice = shop.choices[i]; var choice = shop.choices[i];
@ -414,7 +433,6 @@ events.prototype.openShop = function(shopId, needVisited) {
events.prototype.disableQuickShop = function (shopId) { events.prototype.disableQuickShop = function (shopId) {
core.status.shops[shopId].visited = false; core.status.shops[shopId].visited = false;
} }
////// 降低难度 ////// ////// 降低难度 //////

1
libs/floors.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -22,52 +22,52 @@ main.floors.sample0 = {
[88, 89, 90, 91, 92, 93, 94, 2, 81, 82, 83, 84, 86], [88, 89, 90, 91, 92, 93, 94, 2, 81, 82, 83, 84, 86],
], ],
"firstArrive": [ // 第一次到该楼层触发的事件 "firstArrive": [ // 第一次到该楼层触发的事件
"\t[样板提示]首次到达某层可以触发 firstArrive 事件,\n该事件可类似于RMXP中的“自动执行脚本”。\n\n本事件支持一切的事件类型常常用来触发对话\n例如:", "\t[样板提示]首次到达某层可以触发 firstArrive 事件,该事件可类似于RMXP中的“自动执行脚本”。\n\n本事件支持一切的事件类型常常用来触发对话例如",
"\t[hero]我是谁?\n我从哪来?\n我又要到哪去?", "\t[hero]我是谁?我从哪来?我又要到哪去?",
"\t[仙子,fairy]你问我...?我也不知道啊...", "\t[仙子,fairy]你问我...?我也不知道啊...",
"本层主要对道具、门、怪物等进行介绍,\n有关事件的各种信息在下一层会有更为详细的说明。", "本层主要对道具、门、怪物等进行介绍,有关事件的各种信息在下一层会有更为详细的说明。",
], ],
"events": { // 该楼的所有可能事件列表 "events": { // 该楼的所有可能事件列表
"10,9": [ // 守着道具的老人 "10,9": [ // 守着道具的老人
"\t[老人,man]这些是本样板支持的所有的道具。\n\n道具分为三类items, constants, tools。\nitems 为即捡即用类道具,例如宝石、血瓶、\n剑盾等。\nconstants 为永久道具,例如怪物手册、楼层\n传送器、幸运金币等。\ntools 为消耗类道具,例如破墙镐、炸弹、中\n心对称飞行器等。\n\n后两类道具在工具栏中可以看到并使用。", "\t[老人,man]这些是本样板支持的所有的道具。\n\n道具分为三类items, constants, tools。\nitems 为即捡即用类道具,例如宝石、血瓶、剑盾等。\nconstants 为永久道具,例如怪物手册、楼层传送器、幸运金币等。\ntools 为消耗类道具,例如破墙镐、炸弹、中心对称飞行器等。\n\n后两类道具在工具栏中可以看到并使用。",
"\t[老人,man]有关道具效果定义在items.js中。\n目前大多数道具已有默认行为如有自定义\n的需求则需在items.js中修改代码。", "\t[老人,man]有关道具效果定义在items.js中。\n目前大多数道具已有默认行为如有自定义的需求则需在items.js中修改代码。",
"\t[老人,man]constants 和 tools 各最多只允许12种\n多了会导致图标溢出。", "\t[老人,man]constants 和 tools 各最多只允许12种多了会导致图标溢出。",
"\t[老人,man]拾取道具结束后可触发 afterGetItem 事件。\n\n有关事件的各种信息在下一层会有更为详细的\n说明。", "\t[老人,man]拾取道具结束后可触发 afterGetItem 事件。\n\n有关事件的各种信息在下一层会有更为详细的说明。",
{"type": "hide", "time": 500} // 消失 {"type": "hide", "time": 500} // 消失
], ],
"10,11": [ // 守着门的老人 "10,11": [ // 守着门的老人
"\t[老人,woman]这些是门,需要对应的钥匙打开。\n机关门必须使用特殊的开法。", "\t[老人,woman]这些是门,需要对应的钥匙打开。\n机关门必须使用特殊的开法。",
"\t[老人,woman]开门后可触发 afterOpenDoor 事件。\n\n有关事件的各种信息在下一层会有更为详细的\n说明。", "\t[老人,woman]开门后可触发 afterOpenDoor 事件。\n\n有关事件的各种信息在下一层会有更为详细的说明。",
{'type': 'hide', "time": 500} {'type': 'hide', "time": 500}
], ],
"2,10": [ // 守着楼梯、传送门、路障的老人 "2,10": [ // 守着楼梯、传送门、路障的老人
"\t[老人,womanMagician]这些是路障、楼梯、传送门。", "\t[老人,womanMagician]这些是路障、楼梯、传送门。",
"\t[老人,womanMagician]血网的伤害数值、中毒后每步伤害数值、衰弱\n时攻防下降的数值,都在 data.js 内定义。\n\n路障同样会尽量被自动寻路绕过。", "\t[老人,womanMagician]血网的伤害数值、中毒后每步伤害数值、衰弱时攻防下降的数值,都在 data.js 内定义。\n\n路障同样会尽量被自动寻路绕过。",
"\t[老人,womanMagician]楼梯和传送门需要在changeFloor中定义目标\n楼层和位置,可参见样板里已有的的写法。", "\t[老人,womanMagician]楼梯和传送门需要在changeFloor中定义目标楼层和位置,可参见样板里已有的的写法。",
"\t[老人,womanMagician]楼梯和传送门是否可“穿透”由data.js中的\n全局变量所决定,你也可以单独设置。\n穿透的意思是自动寻路得到的路径中间经\n过了楼梯,行走时是否触发楼层转换事件。\n例如下面的“下箭头”就是不能穿透的。", "\t[老人,womanMagician]楼梯和传送门是否可“穿透”由data.js中的全局变量所决定,你也可以单独设置。\n穿透的意思是自动寻路得到的路径中间经过了楼梯行走时是否触发楼层转换事件。\n例如下面的“下箭头”就是不能穿透的。",
{"type": "hide", "time": 500} {"type": "hide", "time": 500}
], ],
"2,8": [ // 守着第一批怪物的老人 "2,8": [ // 守着第一批怪物的老人
"\t[老人,magician]这些都是各种各样的怪物,\n所有怪物的数据都在enemys.js中设置。\n\n每个怪物最多只能有一个特殊属性。", "\t[老人,magician]这些都是各种各样的怪物,所有怪物的数据都在enemys.js中设置。\n\n每个怪物最多只能有一个特殊属性。",
"\t[老人,magician]这批怪物分别为:普通、先攻、魔攻、坚固、\n2连击、3连击、4连击、破甲、反击、净化。", "\t[老人,magician]这批怪物分别为:普通、先攻、魔攻、坚固、2连击、3连击、4连击、破甲、反击、净化。",
"\t[老人,magician]打败怪物后可触发 afterBattle 事件。\n\n有关事件的各种信息在下一层会有更为详细的\n说明。", "\t[老人,magician]打败怪物后可触发 afterBattle 事件。\n\n有关事件的各种信息在下一层会有更为详细的说明。",
{"type": "hide", "time": 500} {"type": "hide", "time": 500}
], ],
"2,5": [ // 守着第二批怪物的老人 "2,5": [ // 守着第二批怪物的老人
"\t[老人,magician]模仿、吸血、中毒、衰弱、诅咒。\n\n请注意吸血怪需要设置value为吸血数值\n可参见样板中黑暗大法师的写法。", "\t[老人,magician]模仿、吸血、中毒、衰弱、诅咒。\n\n请注意吸血怪需要设置value为吸血数值可参见样板中黑暗大法师的写法。",
{"type": "hide", "time": 500} {"type": "hide", "time": 500}
], ],
"2,3": [ // 守着第三批怪物额老人 "2,3": [ // 守着第三批怪物额老人
"\t[老人,magician]领域、夹击。\n请注意领域怪需要设置value为伤害数值\n可参见样板中初级巫师的写法。", "\t[老人,magician]领域、夹击。\n请注意领域怪需要设置value为伤害数值可参见样板中初级巫师的写法。",
"\t[老人,magician]出于游戏性能的考虑,我们不可能每走一步都\n对领域和夹击进行检查。\n因此我们需要在本楼层的 checkBlock 中指明\n哪些点可能会触发领域和夹击事件,在这些点\n才会对领域和夹击进行检查和处理。\n具体可参见本层 checkBlock 的写法。", "\t[老人,magician]出于游戏性能的考虑,我们不可能每走一步都对领域和夹击进行检查。\n因此我们需要在本楼层的 checkBlock 中指明哪些点可能会触发领域和夹击事件,在这些点才会对领域和夹击进行检查和处理。\n具体可参见本层 checkBlock 的写法。",
"\t[老人,magician]夹击和领域同时发生时先计算领域,再夹击。\n自动寻路同样会尽量绕过你设置的这些点。\n\n另本塔不支持阻击怪。", "\t[老人,magician]夹击和领域同时发生时先计算领域,再夹击。\n自动寻路同样会尽量绕过你设置的这些点。\n\n另本塔不支持阻击怪。",
{"type": "hide", "time": 500} {"type": "hide", "time": 500}
], ],
"12,10": { // 隐藏的仙子 "12,10": { // 隐藏的仙子
"enable": false, // enable: false代表初始时禁用事件 "enable": false, // enable: false代表初始时禁用事件
"data": [ "data": [
"\t[仙子,fairy]只有楼上启用事件后,才能看到我并可以和我\n对话来触发事件。", "\t[仙子,fairy]只有楼上启用事件后,才能看到我并可以和我对话来触发事件。",
{"type": "hide", "time": 500} {"type": "hide", "time": 500}
] ]
}, },
@ -88,22 +88,22 @@ main.floors.sample0 = {
"2,6": ["\t[ghostSkeleton]不可能,你怎么可能打败我!\n一个打败怪物触发的事件"] "2,6": ["\t[ghostSkeleton]不可能,你怎么可能打败我!\n一个打败怪物触发的事件"]
}, },
"afterGetItem": { // 获得道具后可能触发的事件列表 "afterGetItem": { // 获得道具后可能触发的事件列表
"11,8": ["由于状态栏放不下绿钥匙和铁门钥匙均视为tools\n放入工具栏中。\n碰到绿门和铁门仍然会自动使用开门。"], "11,8": ["由于状态栏放不下绿钥匙和铁门钥匙均视为tools放入工具栏中。\n碰到绿门和铁门仍然会自动使用开门。"],
"8,6": ["由于吸血和夹击等的存在,血瓶默认自动被绕路。\n你可以修改data.js中的系统Flag来设置这一项。"], "8,6": ["由于吸血和夹击等的存在,血瓶默认自动被绕路。\n你可以修改data.js中的系统Flag来设置这一项。"],
"8,7": ["如需修改消耗品的效果,请前往 data.js ,找到\n并修改values内对应的具体数值即可。\n\n如果有更高级的需求(如每个区域宝石数值变化)\n详见doc文档内的做法说明。"], "8,7": ["如需修改消耗品的效果,请前往 data.js ,找到并修改values内对应的具体数值即可。\n如果有更高级的需求如每个区域宝石数值变化详见doc文档内的做法说明。"],
"10,7": ["在 data.js 的系统Flag中设置是否启用魔防。\n如果不启用魔防则不会在状态栏显示。"], "10,7": ["在 data.js 的系统Flag中设置是否启用魔防。\n如果不启用魔防则不会在状态栏显示。"],
"9,5": [ "9,5": [
"每层楼的 canFlyTo 决定了该楼层能否被飞到。\n\n不能被飞到的楼层也无法使用楼层传送器。", "每层楼的 canFlyTo 决定了该楼层能否被飞到。\n\n不能被飞到的楼层也无法使用楼层传送器。",
"飞行的楼层顺序由 main.js 中 floorIds 加载顺序\n所决定。\n\n是否必须在楼梯边使用楼传器由 data.js 中的系统\nFlag所决定。" "飞行的楼层顺序由 main.js 中 floorIds 加载顺序所决定。\n\n是否必须在楼梯边使用楼传器由 data.js 中的系统Flag所决定。"
], ],
"10,5": ["破墙镐是破面前的墙壁还是四个方向的墙壁,\n由data.js中的系统Flag所决定。"], "10,5": ["破墙镐是破面前的墙壁还是四个方向的墙壁,由data.js中的系统Flag所决定。"],
"8,4": [ "8,4": [
"炸弹可以炸四个方向的怪物。\n如只需要炸前方怪物请使用上面的圣锤。", "炸弹可以炸四个方向的怪物。\n如只需要炸前方怪物请使用上面的圣锤。",
"不能被炸的怪物在enemys中可以定义。\n可参见样板里黑衣魔王的写法。\n\n炸死怪物是否触发事件由 data.js 中的系统Flag\n所决定。" "不能被炸的怪物在enemys中可以定义可参见样板里黑衣魔王的写法。\n\n炸死怪物是否触发事件由 data.js 中的系统Flag所决定。"
], ],
"10,4": ["“上楼”和“下楼”的目标层由 main.js 的 floorIds\n顺序所决定。"], "10,4": ["“上楼”和“下楼”的目标层由 main.js 的 floorIds顺序所决定。"],
"10,3": ["十字架目前未被定义,可能需要自行实现功能。\n有关如何实现一个道具功能参见doc文档。"], "10,3": ["十字架目前未被定义,可能需要自行实现功能。\n有关如何实现一个道具功能参见doc文档。"],
"9,2": ["该道具默认是大黄门钥匙,如需改为钥匙盒直接\n修改 data.js 中的系统Flag即可。"], "9,2": ["该道具默认是大黄门钥匙,如需改为钥匙盒直接修改 data.js 中的系统Flag即可。"],
"10,2": ["屠龙匕首目前未被定义,可能需要自行实现功能。\n有关如何实现一个道具功能参见doc文档。"], "10,2": ["屠龙匕首目前未被定义,可能需要自行实现功能。\n有关如何实现一个道具功能参见doc文档。"],
}, },
"afterOpenDoor": { // 开完门后可能触发的事件列表 "afterOpenDoor": { // 开完门后可能触发的事件列表

View File

@ -28,15 +28,13 @@ main.floors.sample1 = {
"4,10": [ // 走到中间时的提示 "4,10": [ // 走到中间时的提示
"\t[样板提示]本层楼将会对各类事件进行介绍。", "\t[样板提示]本层楼将会对各类事件进行介绍。",
"左边是一个仿50层的陷阱做法上方是商店、快捷\n商店的使用方法,右上是一个典型的杀怪开门的例\n右下是各类可能的NPC事件。", "左边是一个仿50层的陷阱做法上方是商店、快捷商店的使用方法右上是一个典型的杀怪开门的例子右下是各类可能的NPC事件。",
"本样板目前支持的事件列表大致有:\ntext: 显示一段文字(比如你现在正在看到的)\nshow: 使一个事件有效(可见、可被交互)\nhide: 使一个事件失效(不可见、不可被交互)\ntrigger: 触发另一个地点的事件\nbattle: 强制和某怪物战斗\nopenDoor: 无需钥匙开门(例如机关门、暗墙)\nopenShop: 打开一个全局商店\nchangeFloor: 传送勇士到某层某位置\nchangePos: 传送勇士到当层某位置\nwin: 获得胜利(游戏通关)\nlose: 游戏失败", "本样板目前支持的事件列表大致有:\ntext: 显示一段文字(比如你现在正在看到的)\nshow: 使一个事件有效(可见、可被交互)\nhide: 使一个事件失效(不可见、不可被交互)\ntrigger: 触发另一个地点的事件\nbattle: 强制和某怪物战斗\nopenDoor: 无需钥匙开门(例如机关门、暗墙)\nopenShop: 打开一个全局商店\nchangeFloor: 传送勇士到某层某位置\nchangePos: 传送勇士到当层某位置\nwin: 获得胜利(游戏通关)\nlose: 游戏失败",
"move: 移动事件效果\nplaySound: 播放某个音频\nif: 条件判断\nchoices: 提供选项\nsetValue: 设置勇士属性道具,或某个变量/flag\nupdate: 更新状态栏和地图显伤\nsleep: 等待多少毫秒\nexit: 立刻结束当前事件\nrevisit: 立刻结束事件并重新触发\nfunction: 自定义JS脚本\n\n更多支持的事件还在编写中欢迎您宝贵的意见。", "move: 移动事件效果\nplaySound: 播放某个音频\nif: 条件判断\nchoices: 提供选项\nsetValue: 设置勇士属性道具,或某个变量/flag\nupdate: 更新状态栏和地图显伤\nsleep: 等待多少毫秒\nexit: 立刻结束当前事件\nrevisit: 立刻结束事件并重新触发\nfunction: 自定义JS脚本\n\n更多支持的事件还在编写中欢迎您宝贵的意见。",
"有关各事件的样例可参见本层一些NPC的写法。\n所有事件样例本层都有介绍。\n\n一个自定义事件处理完后需要调用\n{\"type\": \"hide\"}\n该事件才不会再次出现。", "有关各事件的样例可参见本层一些NPC的写法。\n所有事件样例本层都有介绍。\n\n一个自定义事件处理完后需要调用{\"type\": \"hide\"}该事件才不会再次出现。",
{"type": "hide"} {"type": "hide"}
], ],
/****** 左边仿50F陷阱事件 ******/ /****** 左边仿50F陷阱事件 ******/
"1,5": {"enable": false}, // 这几个是白衣武士等怪物,起始时需要隐藏起来 "1,5": {"enable": false}, // 这几个是白衣武士等怪物,起始时需要隐藏起来
"1,6": {"enable": false}, "1,6": {"enable": false},
@ -46,7 +44,7 @@ main.floors.sample1 = {
"1,7": [ // 走到白衣武士中间,触发陷阱事件 "1,7": [ // 走到白衣武士中间,触发陷阱事件
{"type": "show", "loc": [1,5], "time": 1500}, // 显示红衣魔王动画效果1500ms {"type": "show", "loc": [1,5], "time": 1500}, // 显示红衣魔王动画效果1500ms
{"type": "sleep", "time": 500}, // 等待500ms {"type": "sleep", "time": 500}, // 等待500ms
"\t[redKing]欢迎来到魔塔,你是第一百位挑战者。\n若你能打败我所有的手下我就与你一对一\n的决斗。\n现在你必须接受我的安排。", "\t[redKing]欢迎来到魔塔,你是第一百位挑战者。\n若你能打败我所有的手下我就与你一对一的决斗。\n现在你必须接受我的安排。",
{"type": "show", "loc": [1,6], "time": 500}, // 显示四个白衣武士每个动画效果500ms {"type": "show", "loc": [1,6], "time": 500}, // 显示四个白衣武士每个动画效果500ms
{"type": "show", "loc": [0,7], "time": 500}, {"type": "show", "loc": [0,7], "time": 500},
{"type": "show", "loc": [1,8], "time": 500}, {"type": "show", "loc": [1,8], "time": 500},
@ -61,7 +59,9 @@ main.floors.sample1 = {
{"type": "hide", "loc": [1,8]}, {"type": "hide", "loc": [1,8]},
{"type": "hide", "loc": [1,5], "time": 500}, // 隐藏红衣魔王动画500ms {"type": "hide", "loc": [1,5], "time": 500}, // 隐藏红衣魔王动画500ms
{"type": "hide"}, // 隐藏本事件 {"type": "hide"}, // 隐藏本事件
{"type": "changeFloor", "floorId": "sample1", "loc": [1,11]}, // 楼层切换。changeFloor必须指定floorId和loc。 {"type": "setFg", "color": [255,255,255], 'time': 1250}, // 渐变为黑色
{"type": "sleep", "time": 700},
{"type": "changeFloor", "floorId": "sample1", "loc": [1,11], 'direction': 'right', 'time': 1000}, // 楼层切换。changeFloor必须指定floorId和loc。
// 备注:这里也可以下面的这种写法: // 备注:这里也可以下面的这种写法:
// {"type": "changePos", "loc": [1,11]} // {"type": "changePos", "loc": [1,11]}
// 使用这种写法将不会有“楼层切换动画”而是直接让勇士到达本层的loc位置。 // 使用这种写法将不会有“楼层切换动画”而是直接让勇士到达本层的loc位置。
@ -69,8 +69,9 @@ main.floors.sample1 = {
], ],
"2,11": [ // 小偷事件 "2,11": [ // 小偷事件
"\t[杰克,thief]喂!醒醒!快醒醒!", "\t[杰克,thief]喂!醒醒!快醒醒!",
{"type": "setFg", "time": 1500}, // 渐变回来
"\t[hero]额,我这是在什么地方?", "\t[hero]额,我这是在什么地方?",
"\t[杰克,thief]你被魔王抓了起来扔进了监狱,和我关在了一\n起,但是幸运的是我在昨天刚刚挖好一条越狱\n的暗道!", "\t[杰克,thief]你被魔王抓了起来扔进了监狱,和我关在了一起,但是幸运的是我在昨天刚刚挖好一条越狱的暗道!",
{"type": "openDoor", "loc": [3,11]}, // 开门或墙必须指定门/墙的名称,否则不会执行 {"type": "openDoor", "loc": [3,11]}, // 开门或墙必须指定门/墙的名称,否则不会执行
{"type": "sleep", "time": 300}, // 等待300ms {"type": "sleep", "time": 300}, // 等待300ms
"\t[杰克,thief]我先走了,祝你好运!", "\t[杰克,thief]我先走了,祝你好运!",
@ -83,14 +84,13 @@ main.floors.sample1 = {
"\t[hero]怎么跑的这么快..." "\t[hero]怎么跑的这么快..."
], ],
/****** 上方商店事件相关 ******/ /****** 上方商店事件相关 ******/
"4,2": [ // 商店门前的老人 "4,2": [ // 商店门前的老人
"\t[老人,man]本塔的商店有两类,全局商店和非全局商店。\n\n所谓非全局商店就类似于右下角那个卖钥匙\n的老人一样一定要碰到才能触发事件。\n\n而全局商店则能在快捷商店中直接使用。", "\t[老人,man]本塔的商店有两类,全局商店和非全局商店。\n\n所谓非全局商店就类似于右下角那个卖钥匙的老人一样一定要碰到才能触发事件。\n\n而全局商店则能在快捷商店中直接使用。",
"\t[老人,man]要注册一个全局商店,你需要在 data.js 中,\n找到 shops并在内添加你的商店信息。", "\t[老人,man]要注册一个全局商店,你需要在 data.js 中,找到 shops并在内添加你的商店信息。",
"\t[老人,man]商店信息添加后,可以在需要的事件处调用\n{\"type\": \"openShop\"}\n来打开你添加的全局商店。", "\t[老人,man]商店信息添加后,可以在需要的事件处调用{\"type\": \"openShop\"}来打开你添加的全局商店。",
"\t[老人,man]在上面的例子里左边是一个仿50层的金币\n商店右边是一个仿24层的经验商店。\n\n商店被访问后即可在快捷商店中进行使用。", "\t[老人,man]在上面的例子里左边是一个仿50层的金币商店右边是一个仿24层的经验商店。\n\n商店被访问后即可在快捷商店中进行使用。",
"\t[老人,man]如果你需要在某层暂时禁用快捷商店可以在data.js中设置cannotUseQuickShop。\n如果需要永久禁用商店请使用{\"type\":\"disableShop\"}",
{"type": "hide", "time": 500} {"type": "hide", "time": 500}
], ],
"1,0": [ // 金币商店 "1,0": [ // 金币商店
@ -143,23 +143,23 @@ main.floors.sample1 = {
/****** 右下各种NPC事件相关 ******/ /****** 右下各种NPC事件相关 ******/
"6,12": {"enable":false}, // 仙子下面的铁门,初始时是禁用的 "6,12": {"enable":false}, // 仙子下面的铁门,初始时是禁用的
"6,11": [ // 仙子事件 "6,11": [ // 仙子事件
"\t[仙子,fairy]通过调用 {\"type\": \"show\"} 可以使隐藏的\n事件显示出来。\n比如我下面这个机关门。", "\t[仙子,fairy]通过调用 {\"type\": \"show\"} 可以使隐藏的事件显示出来。\n比如我下面这个机关门。",
{"type": "show", "loc": [6,12]}, // 使隐藏的铁门显示出来 {"type": "show", "loc": [6,12]}, // 使隐藏的铁门显示出来
"\t[仙子,fairy]通过调用 {\"type\": \"openDoor\"} 可以无需\n钥匙打开一扇门或暗墙。", "\t[仙子,fairy]通过调用 {\"type\": \"openDoor\"} 可以无需钥匙打开一扇门或暗墙。",
{"type": "openDoor", "loc": [6,12]}, // 开门 {"type": "openDoor", "loc": [6,12]}, // 开门
"\t[仙子,fairy]同时,也可以对其它层进行操作,比如楼下\n的机关门,现在已经为你打开了。", "\t[仙子,fairy]同时,也可以对其它层进行操作,比如楼下的机关门,现在已经为你打开了。",
{"type": "openDoor", "loc": [11,10], "floorId": "sample0"}, // 打开其它层的门需要指定floorId {"type": "openDoor", "loc": [11,10], "floorId": "sample0"}, // 打开其它层的门需要指定floorId
"\t[仙子,fairy]如果 show 或 hide 指定了 time 参数,则\n以动画效果显示,指定的参数作为消失时间\n(毫秒)来计算。", "\t[仙子,fairy]如果 show 或 hide 指定了 time 参数,则以动画效果显示,指定的参数作为消失时间(毫秒)来计算。",
"\t[仙子,fairy]现在到楼下来找我吧~", "\t[仙子,fairy]现在到楼下来找我吧~",
{"type": "show", "loc": [12,10], "floorId": "sample0"}, // 显示其它层的事件需要指定其floorId {"type": "show", "loc": [12,10], "floorId": "sample0"}, // 显示其它层的事件需要指定其floorId
{"type": "hide", "time": 500} {"type": "hide", "time": 500}
], ],
"8,11": [ // 老人事件,勇士状态的显示与变化 "8,11": [ // 老人事件,勇士状态的显示与变化
{"type": "setValue", "name": "flag:man_times", "value": "flag:man_times+1"}, // 设置这个老人的访问次数 {"type": "setValue", "name": "flag:man_times", "value": "flag:man_times+1"}, // 设置这个老人的访问次数
"\t[老人,man]在文字中使用${' ${ '}和 } 可以计算并显示一个\n表达式的结果。\n", "\t[老人,man]在文字中使用${' ${ '}和 } 可以计算并显示一个表达式的结果。\n",
"\t[老人,man]例如:\n你的当前攻击力是${status:atk},防御力是${status:def}。\n攻防和的十倍是${10*(status:atk+status:def)},攻防之积是${status:atk*status:def}。\n你有${item:yellowKey}把黄钥匙,${item:blueKey}把蓝钥匙,${item:redKey}把红钥匙。\n你有${item:pickaxe}个破,${item:bomb}个炸,${item:centerFly}个飞。\n这是你第${flag:man_times}次和我对话。", "\t[老人,man]例如:\n你的当前攻击力是${status:atk},防御力是${status:def}。\n攻防和的十倍是${10*(status:atk+status:def)},攻防之积是${status:atk*status:def}。\n你有${item:yellowKey}把黄钥匙,${item:blueKey}把蓝钥匙,${item:redKey}把红钥匙。\n你有${item:pickaxe}个破,${item:bomb}个炸,${item:centerFly}个飞。\n这是你第${flag:man_times}次和我对话。",
"\t[老人,man]同时,你也可以通过\n{\"type\": \"setValue\"}\n来设置一个勇士的属性、道具或某个Flag。", "\t[老人,man]同时,你也可以通过{\"type\": \"setValue\"}来设置一个勇士的属性、道具或某个Flag。",
"\t[老人,man]例如:\n现在我将让你的攻防提升50%,再将攻防和\n的十倍加到生命值上。", "\t[老人,man]例如:\n现在我将让你的攻防提升50%,再将攻防和的十倍加到生命值上。",
{"type": "setValue", "name": "status:atk", "value": "status:atk*1.5"}, // 攻击提升50%;注意不要加${} {"type": "setValue", "name": "status:atk", "value": "status:atk*1.5"}, // 攻击提升50%;注意不要加${}
{"type": "setValue", "name": "status:def", "value": "status:def*1.5"}, // 防御提升50%;注意不要加${} {"type": "setValue", "name": "status:def", "value": "status:def*1.5"}, // 防御提升50%;注意不要加${}
{"type": "setValue", "name": "status:hp", "value": "status:hp+10*(status:atk+status:def)"}, //生命提升攻防和的十倍 {"type": "setValue", "name": "status:hp", "value": "status:hp+10*(status:atk+status:def)"}, //生命提升攻防和的十倍
@ -169,24 +169,24 @@ main.floors.sample1 = {
{"type": "setValue", "name": "item:pickaxe", "value": "item:pickaxe+1"}, // 1破 {"type": "setValue", "name": "item:pickaxe", "value": "item:pickaxe+1"}, // 1破
{"type": "setValue", "name": "item:bomb", "value": "item:bomb+2"}, // 2炸 {"type": "setValue", "name": "item:bomb", "value": "item:bomb+2"}, // 2炸
{"type": "setValue", "name": "item:centerFly", "value": "item:centerFly+3"}, // 3飞 {"type": "setValue", "name": "item:centerFly", "value": "item:centerFly+3"}, // 3飞
"\t[老人,man]status:xxx 代表勇士的某个属性。\n其中xxx可取hp, atk, def, mdef, money,\nexperience这几项。\n\nitem:xxx 代表勇士的某个道具的个数。\nxxx为道具ID具体可参见items.js中的定义。\n\nflag:xxx 代表某个自定义Flag或变量。\nxxx为Flag/变量名,可以自行定义,由字母、\n数字和下划线组成。\n未定义过而直接取用的Flag默认值为false。", "\t[老人,man]status:xxx 代表勇士的某个属性。\n其中xxx可取hp, atk, def, mdef, money,experience这几项。\n\nitem:xxx 代表勇士的某个道具的个数。\nxxx为道具ID具体可参见items.js中的定义。\n\nflag:xxx 代表某个自定义Flag或变量。\nxxx为Flag/变量名,可以自行定义,由字母、数字和下划线组成。\n未定义过而直接取用的Flag默认值为false。",
// 如果老人不消失,则不要调用 {"type": "hide"} // 如果老人不消失,则不要调用 {"type": "hide"}
"\t[老人,man]你现在可以重新和我进行对话,进一步看到\n属性值的改变。" "\t[老人,man]你现在可以重新和我进行对话,进一步看到属性值的改变。"
], ],
"10,11": [ // 商人事件if语句和choices语句的写法 "10,11": [ // 商人事件if语句和choices语句的写法
// 这部分逻辑相对比较长,细心看,很容易看懂的。 // 这部分逻辑相对比较长,细心看,很容易看懂的。
{"type": "if", "condition": "flag:woman_times==0", // 条件判断:是否从未访问过此商人。 {"type": "if", "condition": "flag:woman_times==0", // 条件判断:是否从未访问过此商人。
"true": [ // 如果从未访问过该商人,显示一段文字 "true": [ // 如果从未访问过该商人,显示一段文字
"\t[老人,woman]这是个很复杂的例子,它将教会你如何使用\nif 语句进行条件判断,以及 choices 提供\n选项来供用户进行选择。", "\t[老人,woman]这是个很复杂的例子,它将教会你如何使用if 语句进行条件判断,以及 choices 提供选项来供用户进行选择。",
"\t[老人,woman]第一次访问我将显示这段文字;从第二次开始\n将会向你出售钥匙。\n钥匙价格将随着访问次数递增。\n当合计出售了七把钥匙后将送你一把大黄门\n钥匙,并消失不再出现。", "\t[老人,woman]第一次访问我将显示这段文字;从第二次开始将会向你出售钥匙。\n钥匙价格将随着访问次数递增。\n当合计出售了七把钥匙后将送你一把大黄门钥匙并消失不再出现。",
"\t[老人,woman]这部分的逻辑比较长,请细心看样板的写法,\n是很容易看懂并理解的。" "\t[老人,woman]这部分的逻辑比较长,请细心看样板的写法,是很容易看懂并理解的。"
// 第一次访问结束 // 第一次访问结束
], ],
"false": [ // 如果已经访问过该商人 "false": [ // 如果已经访问过该商人
{"type": "if", "condition": "flag:woman_times==8", // 条件判断:是否已经出售七把钥匙 {"type": "if", "condition": "flag:woman_times==8", // 条件判断:是否已经出售七把钥匙
"true": [ // 如果已经出售过七把钥匙,则直接结束 "true": [ // 如果已经出售过七把钥匙,则直接结束
"\t[老人,woman]你购买的钥匙已经够多了,再继续卖给你的话\n我会有危险的。", "\t[老人,woman]你购买的钥匙已经够多了,再继续卖给你的话我会有危险的。",
"\t[老人,woman]看在你贡献给我这么多钱的份上,送你一把大\n黄门钥匙吧,希望你能好好用它。", "\t[老人,woman]看在你贡献给我这么多钱的份上,送你一把大黄门钥匙吧,希望你能好好用它。",
{"type": "setValue", "name": "item:bigKey", "value": "item:bigKey+1"}, // 获得一把大黄门钥匙 {"type": "setValue", "name": "item:bigKey", "value": "item:bigKey+1"}, // 获得一把大黄门钥匙
"\t[老人,woman]我先走了,拜拜~", "\t[老人,woman]我先走了,拜拜~",
{"type":"hide", "time": 500}, // 消失 {"type":"hide", "time": 500}, // 消失
@ -249,8 +249,8 @@ main.floors.sample1 = {
{"type": "revisit"} // 立即重新开始这个事件 {"type": "revisit"} // 立即重新开始这个事件
], ],
"12,11": [ // 自定义事件的老人 "12,11": [ // 自定义事件的老人
"\t[老人,womanMagician]使用 {\"type\":\"function\"} 可以写自定义的\nJS脚本。\n本塔支持的所有主要API会在doc文档内给出。", "\t[老人,womanMagician]使用 {\"type\":\"function\"} 可以写自定义的JS脚本。\n本塔支持的所有主要API会在doc文档内给出。",
"\t[老人,womanMagician]例如这个例子:即将弹出一个输入窗口,然后\n会将你的输入结果直接加到你的攻击力上。", "\t[老人,womanMagician]例如这个例子:即将弹出一个输入窗口,然后会将你的输入结果直接加到你的攻击力上。",
{"type": "function", "function": function() { // 自己写JS脚本并执行 {"type": "function", "function": function() { // 自己写JS脚本并执行
var value = prompt("请输入你要加攻击力的数值:"); // 弹出一个输入框让用户输入数据 var value = prompt("请输入你要加攻击力的数值:"); // 弹出一个输入框让用户输入数据
if (value!=null) { if (value!=null) {

View File

@ -23,7 +23,7 @@ main.floors.sample2 = {
], ],
"firstArrive": [ // 第一次到该楼层触发的事件 "firstArrive": [ // 第一次到该楼层触发的事件
"\t[实战!]本楼将尝试复刻《宿命的旋律》40F剧情。", "\t[实战!]本楼将尝试复刻《宿命的旋律》40F剧情。",
"由于暂不支持一些动画效果,例如雷电、振动、天\n气渲染等等,因此做出来的效果远远比不上原版。\n\n不过作为抛砖引玉还是可以展示一下H5的能力。\n开音效食用更加" "由于暂不支持一些动画效果,例如雷电、振动、天气渲染等等,因此做出来的效果远远比不上原版。\n\n不过作为抛砖引玉还是展示一下H5的能力。\n开音效食用更加"
], ],
"events": { // 该楼的所有可能事件列表 "events": { // 该楼的所有可能事件列表
@ -55,27 +55,27 @@ main.floors.sample2 = {
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]我的真名为——黑暗大法师,第四区域的头目。", "\t[blackMagician]我的真名为——黑暗大法师,第四区域的头目。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]呵呵,不知道为什么,我竟然对事情走到\n现在这一步毫不感觉意外。", "\t[hero]呵呵,不知道为什么,我竟然对事情走到现在这一步毫不感觉意外。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]以杰克的名义利用了你这么久,真是抱歉啊。", "\t[blackMagician]以杰克的名义利用了你这么久,真是抱歉啊。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]真正的杰克现在在哪里?", "\t[hero]真正的杰克现在在哪里?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]盗贼杰克这个人类从未存在过,他只是我用来\n接近你的一副皮囊而已。", "\t[blackMagician]盗贼杰克这个人类从未存在过,他只是我用来接近你的一副皮囊而已。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]……这样啊,呵呵。", "\t[hero]……这样啊,呵呵。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]为什么你看上去丝毫不生气?", "\t[blackMagician]为什么你看上去丝毫不生气?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]多亏了鬼帝,我现在的脾气好得连我自己\n都害怕。", "\t[hero]多亏了鬼帝,我现在的脾气好得连我自己都害怕。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]说起来我还得好好感谢你呢,如果没有杰\n克……你的帮助,我早就死在第一区域了。", "\t[hero]说起来我还得好好感谢你呢,如果没有杰克……你的帮助,我早就死在第一区域了。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]不论你的目的如何,你的所作所为都是对\n我有利的。不是吗?", "\t[hero]不论你的目的如何,你的所作所为都是对我有利的。不是吗?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]能够如此淡定的面对背叛,看来跟五年前相比,\n你确实成长了很多啊。", "\t[blackMagician]能够如此淡定的面对背叛,看来跟五年前相比,你确实成长了很多啊。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]五年前?……黑暗大法师,在这之前,我们\n好像素未谋面吧?", "\t[hero]五年前?……黑暗大法师,在这之前,我们好像素未谋面吧?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]五年前那场屠城你应该这一生都不会忘记吧。", "\t[blackMagician]五年前那场屠城你应该这一生都不会忘记吧。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
@ -83,15 +83,15 @@ main.floors.sample2 = {
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]……", "\t[hero]……",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]这么说,击中我双亲的那道紫色闪电,也\n就是你释放的吧……", "\t[hero]这么说,击中我双亲的那道紫色闪电,也就是你释放的吧……",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]你的双亲?这种事情我怎么可能会记得?\n你难道在踩死蚂蚁的时候还会一只只记下\n他们的样子吗?", "\t[blackMagician]你的双亲?这种事情我怎么可能会记得?\n你难道在踩死蚂蚁的时候还会一只只记下他们的样子吗?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]老 子 要 你 的 命", "\t[hero]老 子 要 你 的 命",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]你应该对我心怀感激才对,如果不是那时的\n我看出了你隐藏的稀有勇者体质,你绝对不\n可能活到今天。", "\t[blackMagician]你应该对我心怀感激才对,如果不是那时的我看出了你隐藏的稀有勇者体质,你绝对不可能活到今天。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]在暗中动手脚让你通过勇者选拔的人也是我,\n我一直一直在暗中引导你走到今天这一步。", "\t[blackMagician]在暗中动手脚让你通过勇者选拔的人也是我,我一直一直在暗中引导你走到今天这一步。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]是我救赎了一无是处的你。", "\t[blackMagician]是我救赎了一无是处的你。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
@ -99,13 +99,13 @@ main.floors.sample2 = {
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]为什么偏偏是我!!!!", "\t[hero]为什么偏偏是我!!!!",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]我刚才不是说过了吗?因为我看出了你有\n稀有勇者体质啊。", "\t[blackMagician]我刚才不是说过了吗?因为我看出了你有稀有勇者体质啊。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]你刚刚跟鬼帝交过手,应该已经很清楚这\n稀有勇者体质意味着什么了吧?", "\t[blackMagician]你刚刚跟鬼帝交过手,应该已经很清楚这稀有勇者体质意味着什么了吧?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]……就因为我有这种体质,就不得不背负如此\n残酷的宿命吗?", "\t[hero]……就因为我有这种体质,就不得不背负如此残酷的宿命吗?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]愚蠢!这意味着只要我对你加以引导跟培养,\n你就能成为这世间实力最强的存在!", "\t[blackMagician]愚蠢!这意味着只要我对你加以引导跟培养,你就能成为这世间实力最强的存在!",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]……所以,你究竟想利用我干什么?", "\t[hero]……所以,你究竟想利用我干什么?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
@ -113,37 +113,37 @@ main.floors.sample2 = {
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]……你说什么?", "\t[hero]……你说什么?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]不知不觉间,你已经在我的指引下跟鬼帝\n正面交手并且杀掉了他啊。", "\t[blackMagician]不知不觉间,你已经在我的指引下跟鬼帝正面交手并且杀掉了他啊。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]就连我跟鬼帝的对决……也是被你安排好了的?", "\t[hero]就连我跟鬼帝的对决……也是被你安排好了的?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]你们两个一个是人类勇者,一个是魔物勇者,\n迟早会有交手的一天。", "\t[blackMagician]你们两个一个是人类勇者,一个是魔物勇者,迟早会有交手的一天。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]我只不过是操纵了一系列的连锁事件让这一天\n提早了数十年到来而已。", "\t[blackMagician]我只不过是操纵了一系列的连锁事件让这一天提早了数十年到来而已。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]……你这样做对谁有好处?他可是你们魔物\n世界的救世主啊。", "\t[hero]……你这样做对谁有好处?他可是你们魔物世界的救世主啊。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]一个惧怕征战,爱好和平的懦夫,也配叫\n救世主?", "\t[blackMagician]一个惧怕征战,爱好和平的懦夫,也配叫救世主?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]获得了力量,却只会被动挨打而不主动向\n人类世界出击,龟缩在第二区域惶惶度日,\n他根本就不配拥有稀有勇者体质。", "\t[blackMagician]获得了力量,却只会被动挨打而不主动向人类世界出击,龟缩在第二区域惶惶度日,他根本就不配拥有稀有勇者体质。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]为了不让这种人霸占着积累多年的庞大灵魂\n能量无作为,我设计让你杀掉了他。", "\t[blackMagician]为了不让这种人霸占着积累多年的庞大灵魂能量无作为,我设计让你杀掉了他。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]你没有辜负我的期待,成功战胜了那个废物,\n现在你体内累积的灵魂能量……也就是魔力,\n已经达到了能跟魔王匹敌的地步。", "\t[blackMagician]你没有辜负我的期待,成功战胜了那个废物,现在你体内累积的灵魂能量……也就是魔力,已经达到了能跟魔王匹敌的地步。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]……是吗?现在的我能与魔王匹敌?", "\t[hero]……是吗?现在的我能与魔王匹敌?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]不止如此,你现在的力量之强就算是统治\n世界也是绰绰有余!", "\t[blackMagician]不止如此,你现在的力量之强就算是统治世界也是绰绰有余!",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]怎么样?要不要加入我的麾下,跟随我去\n征战人类世界?", "\t[blackMagician]怎么样?要不要加入我的麾下,跟随我去征战人类世界?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]能与魔王匹敌的话,也就是说。", "\t[hero]能与魔王匹敌的话,也就是说。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]我 现 在 对 付 你 这 种 杂 碎 也 绰 绰 有 余\n", "\t[hero]我 现 在 对 付 你 这 种 杂 碎 也 绰 绰 有 余 ",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]……什么?!", "\t[blackMagician]……什么?!",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]等一下!别冲动!你先等我把这利害关系\n理一理——", "\t[blackMagician]等一下!别冲动!你先等我把这利害关系理一理——",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]你给老子闭嘴。", "\t[hero]你给老子闭嘴。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
@ -167,6 +167,7 @@ main.floors.sample2 = {
"enable":false, "enable":false,
"data": [ "data": [
"\t[blackMagician]听不进去人话的蠢货,就要用疼痛来管教!", "\t[blackMagician]听不进去人话的蠢货,就要用疼痛来管教!",
{"type": "changePos", "direction": "up"},
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]出来吧!禁忌——紫电凶杀阵!", "\t[blackMagician]出来吧!禁忌——紫电凶杀阵!",
{"type": "show", "loc": [4,3], "time": 500}, // 依次显示四个角的法师 {"type": "show", "loc": [4,3], "time": 500}, // 依次显示四个角的法师
@ -188,9 +189,9 @@ main.floors.sample2 = {
{"type": "sleep", "time": 200}, {"type": "sleep", "time": 200},
"\t[hero]唔……!!(吐血)", "\t[hero]唔……!!(吐血)",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]我的魔力可是充足的很啊!我会一直折磨\n到你屈服于我为止!", "\t[blackMagician]我的魔力可是充足的很啊!我会一直折磨到你屈服于我为止!",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]人类!好好感受吧!当初你们施加于我的\n痛苦!如今我要百倍奉还!", "\t[blackMagician]人类!好好感受吧!当初你们施加于我的痛苦!如今我要百倍奉还!",
{"type": "show", "loc": [6,6], "time": 1000}, // 显示妖精 {"type": "show", "loc": [6,6], "time": 1000}, // 显示妖精
{"type": "sleep", "time": 700}, {"type": "sleep", "time": 700},
{"type": "trigger", "loc": [6,6]} // 立刻触发妖精事件 {"type": "trigger", "loc": [6,6]} // 立刻触发妖精事件
@ -213,37 +214,37 @@ main.floors.sample2 = {
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[小妖精,fairy]咱一直,一直都在注视着你。", "\t[小妖精,fairy]咱一直,一直都在注视着你。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[小妖精,fairy]耍小聪明的你、笨笨的你呆呆的你、胆小的\n你、勇敢的你帅气的你……全部全部都是你。", "\t[小妖精,fairy]耍小聪明的你、笨笨的你呆呆的你、胆小的你、勇敢的你帅气的你……全部全部都是你。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[小妖精,fairy]所以放心吧,无论发生什么,咱都会陪伴\n在你身边的。", "\t[小妖精,fairy]所以放心吧,无论发生什么,咱都会陪伴在你身边的。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[小妖精,fairy]因为你要是离开我的话,立刻就会死掉吧?", "\t[小妖精,fairy]因为你要是离开我的话,立刻就会死掉吧?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]…妖精…小姐……其实一直以来,我都非常\n感激你……", "\t[hero]…妖精…小姐……其实一直以来,我都非常感激你……",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[小妖精,fairy]笨蛋!都这种时候了就不要作出像是临终\n遗言的发言了啊!!", "\t[小妖精,fairy]笨蛋!都这种时候了就不要作出像是临终遗言的发言了啊!!",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[小妖精,fairy]喂!那边穿衣品味差到极点的黑暗大法师,\n别左顾右盼说的就是你!你应该知道咱的\n身份吧?\n还不速速退下", "\t[小妖精,fairy]喂!那边穿衣品味差到极点的黑暗大法师,别左顾右盼说的就是你!你应该知道咱的身份吧?\n还不速速退下",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]可恶…多管闲事的妖精族…明明只要再让他\n承受一点疼痛来瓦解他的意志力,我的计\n划就成功了!", "\t[blackMagician]可恶…多管闲事的妖精族…明明只要再让他承受一点疼痛来瓦解他的意志力,我的计划就成功了!",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[小妖精,fairy]哼哼哼~抱歉哦,这个笨蛋的意志力可不像\n你想象的那么薄弱哦!", "\t[小妖精,fairy]哼哼哼~抱歉哦,这个笨蛋的意志力可不像你想象的那么薄弱哦!",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]不甘心!我不甘心!妖精公主又如何!\n只要是阻挡我的不管是谁我都要铲除", "\t[blackMagician]不甘心!我不甘心!妖精公主又如何!\n只要是阻挡我的不管是谁我都要铲除",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[小妖精,fairy]终于露出狐狸尾巴了,其实咱早就看出你有\n谋反的念头。你的计划就是拉拢这家伙入\n伙然后推翻魔王对魔塔的统治对吧?", "\t[小妖精,fairy]终于露出狐狸尾巴了,其实咱早就看出你有谋反的念头。你的计划就是拉拢这家伙入伙然后推翻魔王对魔塔的统治对吧?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]呵呵呵……那个昏庸的魔王,掌握着那么庞大\n的魔物军队却只知道固守魔塔,而不主动侵略\n人类世界扩张领土!", "\t[blackMagician]呵呵呵……那个昏庸的魔王,掌握着那么庞大的魔物军队却只知道固守魔塔,而不主动侵略人类世界扩张领土!",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]我实在是看不过眼,所以我才决定把这个具\n备稀有勇者体质的家伙培养成新一任魔王!\n来让这个世界的势力重新洗牌", "\t[blackMagician]我实在是看不过眼,所以我才决定把这个具备稀有勇者体质的家伙培养成新一任魔王!\n来让这个世界的势力重新洗牌",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[小妖精,fairy]你觉得一个满脑子想着回家种田的废柴勇者\n会成为改变世界的魔王?你晃晃脑袋试试,\n是不是能听到大海的声音?", "\t[小妖精,fairy]你觉得一个满脑子想着回家种田的废柴勇者会成为改变世界的魔王?你晃晃脑袋试试,是不是能听到大海的声音?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]恼人至极的妖精族!呵呵呵……我干脆一不做\n二不休,连你也一块收拾了吧!", "\t[blackMagician]恼人至极的妖精族!呵呵呵……我干脆一不做二不休,连你也一块收拾了吧!",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[小妖精,fairy]别小瞧咱!咱好歹也是妖精族里实力数一\n数二的存在!", "\t[小妖精,fairy]别小瞧咱!咱好歹也是妖精族里实力数一数二的存在!",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]只会耍嘴皮子的恼人苍蝇!我倒要看看一块\n焦炭会不会说话!\n——招雷弹", "\t[blackMagician]只会耍嘴皮子的恼人苍蝇!我倒要看看一块焦炭会不会说话!\n——招雷弹",
{"type": "hide", "loc": [4,3], "time": 150}, // 由于没有动画效果,暂时使用“闪一下”表示 {"type": "hide", "loc": [4,3], "time": 150}, // 由于没有动画效果,暂时使用“闪一下”表示
{"type": "show", "loc": [4,3], "time": 150}, {"type": "show", "loc": [4,3], "time": 150},
{"type": "hide", "loc": [4,6], "time": 150}, // 由于没有动画效果,暂时使用“闪一下”表示 {"type": "hide", "loc": [4,6], "time": 150}, // 由于没有动画效果,暂时使用“闪一下”表示
@ -256,33 +257,33 @@ main.floors.sample2 = {
{"type": "hide", "loc": [6,6], "time": 150}, // 妖精也闪一下表示收到了伤害 {"type": "hide", "loc": [6,6], "time": 150}, // 妖精也闪一下表示收到了伤害
{"type": "show", "loc": [6,6], "time": 150}, // 妖精也闪一下表示收到了伤害 {"type": "show", "loc": [6,6], "time": 150}, // 妖精也闪一下表示收到了伤害
{"type": "sleep", "time": 500}, // 等待500毫秒 {"type": "sleep", "time": 500}, // 等待500毫秒
"\t[小妖精,fairy]切,这点伤痛跟他刚才经历的身心地狱相比\n根本就不算什么。", "\t[小妖精,fairy]切,这点伤痛跟他刚才经历的身心地狱相比根本就不算什么。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]哼!翅膀都被烧焦了还要嘴硬?你难不成\n真以为我不会对你动真格?", "\t[blackMagician]哼!翅膀都被烧焦了还要嘴硬?你难不成真以为我不会对你动真格?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]……你这混蛋!给我离她远点!!", "\t[hero]……你这混蛋!给我离她远点!!",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[小妖精,fairy]!…你现在受了很严重的致命伤,乱动什么?\n乖。别怕这里有咱顶着", "\t[小妖精,fairy]!…你现在受了很严重的致命伤,乱动什么?\n乖。别怕这里有咱顶着",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[小妖精,fairy]对了,咱再问你一遍,你是很珍惜自己性命\n的对吧?", "\t[小妖精,fairy]对了,咱再问你一遍,你是很珍惜自己性命的对吧?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]!…等等…妖精小姐,你不会是……?", "\t[hero]!…等等…妖精小姐,你不会是……?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[小妖精,fairy]喂,黑暗大法师,你作为魔塔里最博学多识\n的蠢货,应该对咱妖精族的特殊能力再清楚\n不过吧?", "\t[小妖精,fairy]喂,黑暗大法师,你作为魔塔里最博学多识的蠢货,应该对咱妖精族的特殊能力再清楚不过吧?",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]什么?!难不成你是想!!不可能……\n就为了一个渺小的人类不可理喻", "\t[blackMagician]什么?!难不成你是想!!不可能……\n就为了一个渺小的人类不可理喻",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[小妖精,fairy]哼哼哼!你害怕的表情可真美味!", "\t[小妖精,fairy]哼哼哼!你害怕的表情可真美味!",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[小妖精,fairy]不过比起这个,咱更期待你吃到“妖精自灭\n冲击”之后的死状哦!~", "\t[小妖精,fairy]不过比起这个,咱更期待你吃到“妖精自灭冲击”之后的死状哦!~",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[blackMagician]不!!不应该是这样的!我完美的计划竟然\n会被一只小小的妖精破坏!", "\t[blackMagician]不!!不应该是这样的!我完美的计划竟然会被一只小小的妖精破坏!",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]不要!……千万不要!……为了我这种人……唔!", "\t[hero]不要!……千万不要!……为了我这种人……唔!",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[小妖精,fairy]笨蛋,动都动不了了就不要强撑着站起来\n了啊。", "\t[小妖精,fairy]笨蛋,动都动不了了就不要强撑着站起来了啊。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[小妖精,fairy]真是的,都到最后一刻了,你这家伙好歹\n也让咱省点心吧。", "\t[小妖精,fairy]真是的,都到最后一刻了,你这家伙好歹也让咱省点心吧。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[小妖精,fairy]那么,再见了……我的勇者大人。", "\t[小妖精,fairy]那么,再见了……我的勇者大人。",
{"type": "move", "time": 700, "steps": [ // 向上移动三个撞上黑暗大大法师本事件的hide会自动被调用 {"type": "move", "time": 700, "steps": [ // 向上移动三个撞上黑暗大大法师本事件的hide会自动被调用
@ -311,7 +312,7 @@ main.floors.sample2 = {
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]我全都想起来了……妖精小姐为了我……\n牺牲了自己的性命。", "\t[hero]我全都想起来了……妖精小姐为了我……\n牺牲了自己的性命。",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]在这颗宝石上,我能感受到你的温度……\n熟悉而又令人安心这就是你最后留给我\n的东西吗……", "\t[hero]在这颗宝石上,我能感受到你的温度……\n熟悉而又令人安心这就是你最后留给我的东西吗……",
{"type": "playSound", "name": "item.ogg"}, {"type": "playSound", "name": "item.ogg"},
"\t[hero]好温暖……", "\t[hero]好温暖……",
{"type": "setValue", "name": "item:yellowJewel", "value": "1"}, // 获得1个黄宝石 {"type": "setValue", "name": "item:yellowJewel", "value": "1"}, // 获得1个黄宝石
@ -338,12 +339,12 @@ main.floors.sample2 = {
{"type": "update"}, // 更新地图显伤 {"type": "update"}, // 更新地图显伤
], ],
"7,5": [ // 和分身1的战斗 "7,5": [ // 和分身1的战斗
"\t[blackMagician]你打败的不过是我众多分身中的其中一个\n而已。", "\t[blackMagician]你打败的不过是我众多分身中的其中一个而已。",
{"type": "show", "loc": [5,4], "time": 500}, {"type": "show", "loc": [5,4], "time": 500},
{"type": "update"}, // 更新地图显伤 {"type": "update"}, // 更新地图显伤
], ],
"5,4": [ // 和分身2的战斗 "5,4": [ // 和分身2的战斗
"\t[blackMagician]你的身体已经伤痕累累了,可我还留有着\n九成多的魔力。", "\t[blackMagician]你的身体已经伤痕累累了,可我还留有着九成多的魔力。",
{"type": "show", "loc": [5,5], "time": 500}, {"type": "show", "loc": [5,5], "time": 500},
{"type": "update"}, // 更新地图显伤 {"type": "update"}, // 更新地图显伤
], ],

View File

@ -4,13 +4,11 @@ function icons() {
icons.prototype.init = function () { icons.prototype.init = function () {
this.icons = { this.icons = {
'heros': { 'hero': {
'hero1': { 'down': {'loc': 0, 'stop': 0, 'leftFoot': 1, 'rightFoot': 3},
'down': {'loc': 0, 'stop': 0, 'leftFoot': 1, 'rightFoot': 2}, 'left': {'loc': 1, 'stop': 0, 'leftFoot': 1, 'rightFoot': 3},
'left': {'loc': 1, 'stop': 0, 'leftFoot': 1, 'rightFoot': 2}, 'right': {'loc': 2, 'stop': 0, 'leftFoot': 1, 'rightFoot': 3},
'right': {'loc': 2, 'stop': 0, 'leftFoot': 1, 'rightFoot': 2}, 'up': {'loc': 3, 'stop': 0, 'leftFoot': 1, 'rightFoot': 3}
'up': {'loc': 3, 'stop': 0, 'leftFoot': 1, 'rightFoot': 2}
}
}, },
'terrains': { 'terrains': {
'ground': 0, 'ground': 0,
@ -192,11 +190,8 @@ icons.prototype.init = function () {
} }
} }
icons.prototype.getIcons = function (iconName) { icons.prototype.getIcons = function () {
if (iconName == undefined) { return this.icons;
return this.icons;
}
return this.icons[iconName];
} }
main.instance.icons = new icons(); main.instance.icons = new icons();

View File

@ -155,12 +155,6 @@ items.prototype.useItem = function (itemId) {
core.drawHero(core.getHeroLoc('direction'), core.getHeroLoc('x'), core.getHeroLoc('y'), 'stop'); core.drawHero(core.getHeroLoc('direction'), core.getHeroLoc('x'), core.getHeroLoc('y'), 'stop');
core.updateFg(); core.updateFg();
core.drawTip(core.material.items[itemId].name + "使用成功"); core.drawTip(core.material.items[itemId].name + "使用成功");
if (itemId == 'bomb' && core.flags.bombTrigger) {
core.events.afterBattle();
}
else if (itemId=='hammer' && core.flags.bombTrigger) {
core.events.afterBattle(core.status.event.data[0]);
}
}); });
} }
if (itemId == 'centerFly') { if (itemId == 'centerFly') {

View File

@ -75,12 +75,18 @@ ui.prototype.drawTextBox = function(content) {
content = core.replaceText(content); content = core.replaceText(content);
var background = core.canvas.ui.createPattern(core.material.ground, "repeat"); var background = core.canvas.ui.createPattern(core.material.ground, "repeat");
var contents = content.split('\n');
core.clearMap('ui', 0, 0, 416, 416); core.clearMap('ui', 0, 0, 416, 416);
// var contents = content.split('\n');
// var contents = core.splitLines('ui', content, );
var left=10, right=416-2*left;
var content_left = left + 25;
if (id=='hero' || core.isset(icon)) content_left=left+63;
var validWidth = right-(content_left-left)-13;
var contents = core.splitLines("ui", content, validWidth, '16px Verdana');
var height = 416 - 10 - Math.min(416-24*(contents.length+1)-65, 250); var height = 416 - 10 - Math.min(416-24*(contents.length+1)-65, 250);
var left=10, top = (416-height)/2, right = 416 - 2*left, bottom = height; var top = (416-height)/2, bottom = height;
// var left = 97, top = 64, right = 416 - 2 * left, bottom = 416 - 2 * top; // var left = 97, top = 64, right = 416 - 2 * left, bottom = 416 - 2 * top;
core.setAlpha('ui', 0.85); core.setAlpha('ui', 0.85);
@ -93,27 +99,24 @@ ui.prototype.drawTextBox = function(content) {
// 名称 // 名称
core.canvas.ui.textAlign = "left"; core.canvas.ui.textAlign = "left";
var content_left = left + 25, content_top = top + 35; var content_top = top + 35;
if (core.isset(id)) { if (core.isset(id)) {
content_top = top+57; content_top = top+57;
// 动画
if (id=='hero' || core.isset(icon)) {
core.strokeRect('ui', left + 15 - 1, top + 40 - 1, 34, 34, '#FFD700', 2);
content_left = left+63;
}
if (id == 'hero') { if (id == 'hero') {
var heroHeight=core.material.icons.hero.height;
core.strokeRect('ui', left + 15 - 1, top + 40 - 1, 34, heroHeight+2, '#FFD700', 2);
core.fillText('ui', core.status.hero.name, content_left, top + 30, '#FFD700', 'bold 22px Verdana'); core.fillText('ui', core.status.hero.name, content_left, top + 30, '#FFD700', 'bold 22px Verdana');
core.clearMap('ui', left + 15, top + 40, 32, 32); core.clearMap('ui', left + 15, top + 40, 32, heroHeight);
core.fillRect('ui', left + 15, top + 40, 32, 32, background); core.fillRect('ui', left + 15, top + 40, 32, heroHeight, background);
var heroIcon = core.material.icons.heros[core.status.hero.id]['down']; var heroIcon = core.material.icons.hero['down'];
core.canvas.ui.drawImage(core.material.images.heros, heroIcon.stop * 32, heroIcon.loc *32, 32, 32, left+15, top+40, 32, 32); core.canvas.ui.drawImage(core.material.images.hero, heroIcon.stop * 32, heroIcon.loc * heroHeight, 32, heroHeight, left+15, top+40, 32, heroHeight);
} }
else { else {
core.fillText('ui', name, content_left, top + 30, '#FFD700', 'bold 22px Verdana'); core.fillText('ui', name, content_left, top + 30, '#FFD700', 'bold 22px Verdana');
if (core.isset(icon)) { if (core.isset(icon)) {
core.strokeRect('ui', left + 15 - 1, top + 40 - 1, 34, 34, '#FFD700', 2);
core.status.boxAnimateObjs = []; core.status.boxAnimateObjs = [];
core.status.boxAnimateObjs.push({ core.status.boxAnimateObjs.push({
'bgx': left + 15, 'bgy': top + 40, 'bgsize': 32, 'bgx': left + 15, 'bgy': top + 40, 'bgsize': 32,
@ -150,6 +153,10 @@ ui.prototype.drawChoices = function(content, choices) {
var choice_top = bottom-height+56; var choice_top = bottom-height+56;
var id=null, name=null, image=null, icon=null; var id=null, name=null, image=null, icon=null;
var contents = null;
var content_left = left + 15;
if (core.isset(content)) { if (core.isset(content)) {
// 获得name, image, icon // 获得name, image, icon
if (content.indexOf("\t[")==0) { if (content.indexOf("\t[")==0) {
@ -187,11 +194,16 @@ ui.prototype.drawChoices = function(content, choices) {
} }
content = core.replaceText(content); content = core.replaceText(content);
if (id=='hero' || core.isset(icon))
content_left = left+60;
contents = core.splitLines('ui', content, width-(content_left-left)-10, 'bold 15px Verdana');
// content部分高度 // content部分高度
var cheight=0; var cheight=0;
// 如果含有标题,标题高度 // 如果含有标题,标题高度
if (name!=null) cheight+=25; if (name!=null) cheight+=25;
cheight += content.split('\n').length*20; cheight += contents.length*20;
height+=cheight; height+=cheight;
} }
var top = bottom-height; var top = bottom-height;
@ -200,9 +212,9 @@ ui.prototype.drawChoices = function(content, choices) {
core.strokeRect('ui', left - 1, top - 1, width + 1, height + 1, '#FFFFFF', 2); core.strokeRect('ui', left - 1, top - 1, width + 1, height + 1, '#FFFFFF', 2);
// 如果有内容 // 如果有内容
if (core.isset(content)) { if (core.isset(contents)) {
var content_left = left + 15, content_top = top + 35; var content_top = top + 35;
if (core.isset(id)) { if (core.isset(id)) {
core.canvas.ui.textAlign = "center"; core.canvas.ui.textAlign = "center";
@ -210,22 +222,22 @@ ui.prototype.drawChoices = function(content, choices) {
content_top = top+55; content_top = top+55;
var title_offset = left+width/2; var title_offset = left+width/2;
// 动画 // 动画
if (id=='hero' || core.isset(icon)) { if (id=='hero' || core.isset(icon))
core.strokeRect('ui', left + 15 - 1, top + 30 - 1, 34, 34, '#DDDDDD', 2);
content_left = left+60;
title_offset += 22; title_offset += 22;
}
if (id == 'hero') { if (id == 'hero') {
var heroHeight = core.material.icons.hero.height;
core.strokeRect('ui', left + 15 - 1, top + 30 - 1, 34, heroHeight+2, '#DDDDDD', 2);
core.fillText('ui', core.status.hero.name, title_offset, top + 27, '#FFD700', 'bold 19px Verdana'); core.fillText('ui', core.status.hero.name, title_offset, top + 27, '#FFD700', 'bold 19px Verdana');
core.clearMap('ui', left + 15, top + 30, 32, 32); core.clearMap('ui', left + 15, top + 30, 32, heroHeight);
core.fillRect('ui', left + 15, top + 30, 32, 32, background); core.fillRect('ui', left + 15, top + 30, 32, heroHeight, background);
var heroIcon = core.material.icons.heros[core.status.hero.id]['down']; var heroIcon = core.material.icons.hero['down'];
core.canvas.ui.drawImage(core.material.images.heros, heroIcon.stop * 32, heroIcon.loc *32, 32, 32, left+15, top+30, 32, 32); core.canvas.ui.drawImage(core.material.images.hero, heroIcon.stop * 32, heroIcon.loc *heroHeight, 32, heroHeight, left+15, top+30, 32, heroHeight);
} }
else { else {
core.fillText('ui', name, title_offset, top + 27, '#FFD700', 'bold 19px Verdana'); core.fillText('ui', name, title_offset, top + 27, '#FFD700', 'bold 19px Verdana');
if (core.isset(icon)) { if (core.isset(icon)) {
core.strokeRect('ui', left + 15 - 1, top + 30 - 1, 34, 34, '#DDDDDD', 2);
core.status.boxAnimateObjs = []; core.status.boxAnimateObjs = [];
core.status.boxAnimateObjs.push({ core.status.boxAnimateObjs.push({
'bgx': left + 15, 'bgy': top + 30, 'bgsize': 32, 'bgx': left + 15, 'bgy': top + 30, 'bgsize': 32,
@ -237,7 +249,6 @@ ui.prototype.drawChoices = function(content, choices) {
} }
core.canvas.ui.textAlign = "left"; core.canvas.ui.textAlign = "left";
var contents=content.split("\n");
for (var i=0;i<contents.length;i++) { for (var i=0;i<contents.length;i++) {
core.fillText('ui', contents[i], content_left, content_top, '#FFFFFF', 'bold 15px Verdana'); core.fillText('ui', contents[i], content_left, content_top, '#FFFFFF', 'bold 15px Verdana');
content_top+=20; content_top+=20;
@ -689,7 +700,7 @@ ui.prototype.drawSLPanel = function(page) {
core.fillText('ui', name+id, (2*i+1)*u, 35, '#FFFFFF', "bold 17px Verdana"); core.fillText('ui', name+id, (2*i+1)*u, 35, '#FFFFFF', "bold 17px Verdana");
core.strokeRect('ui', (2*i+1)*u-size/2, 50, size, size, '#FFFFFF', 2); core.strokeRect('ui', (2*i+1)*u-size/2, 50, size, size, '#FFFFFF', 2);
if (core.isset(data) && core.isset(data.floorId)) { if (core.isset(data) && core.isset(data.floorId)) {
this.drawThumbnail('ui', core.maps.load(data.maps, data.floorId).blocks, (2*i+1)*u-size/2, 50, size, data.hero.loc, data.hero.id); this.drawThumbnail('ui', core.maps.load(data.maps, data.floorId).blocks, (2*i+1)*u-size/2, 50, size, data.hero.loc);
core.fillText('ui', core.formatDate(new Date(data.time)), (2*i+1)*u, 65+size, '#FFFFFF', '10px Verdana'); core.fillText('ui', core.formatDate(new Date(data.time)), (2*i+1)*u, 65+size, '#FFFFFF', '10px Verdana');
} }
else { else {
@ -701,7 +712,7 @@ ui.prototype.drawSLPanel = function(page) {
core.fillText('ui', name+id, (2*i-5)*u, 230, '#FFFFFF', "bold 17px Verdana"); core.fillText('ui', name+id, (2*i-5)*u, 230, '#FFFFFF', "bold 17px Verdana");
core.strokeRect('ui', (2*i-5)*u-size/2, 245, size, size, '#FFFFFF', 2); core.strokeRect('ui', (2*i-5)*u-size/2, 245, size, size, '#FFFFFF', 2);
if (core.isset(data) && core.isset(data.floorId)) { if (core.isset(data) && core.isset(data.floorId)) {
this.drawThumbnail('ui', core.maps.load(data.maps, data.floorId).blocks, (2*i-5)*u-size/2, 245, size, data.hero.loc, data.hero.id); this.drawThumbnail('ui', core.maps.load(data.maps, data.floorId).blocks, (2*i-5)*u-size/2, 245, size, data.hero.loc);
core.fillText('ui', core.formatDate(new Date(data.time)), (2*i-5)*u, 260+size, '#FFFFFF', '10px Verdana'); core.fillText('ui', core.formatDate(new Date(data.time)), (2*i-5)*u, 260+size, '#FFFFFF', '10px Verdana');
} }
else { else {
@ -714,7 +725,7 @@ ui.prototype.drawSLPanel = function(page) {
} }
ui.prototype.drawThumbnail = function(canvas, blocks, x, y, size, heroLoc, heroId) { ui.prototype.drawThumbnail = function(canvas, blocks, x, y, size, heroLoc) {
core.clearMap(canvas, x, y, size, size); core.clearMap(canvas, x, y, size, size);
var persize = size/13; var persize = size/13;
for (var i=0;i<13;i++) { for (var i=0;i<13;i++) {
@ -735,9 +746,10 @@ ui.prototype.drawThumbnail = function(canvas, blocks, x, y, size, heroLoc, heroI
} }
} }
if (core.isset(heroLoc)) { if (core.isset(heroLoc)) {
var id = core.isset(heroId)?heroId:core.status.hero.id; var heroIcon = core.material.icons.hero[heroLoc.direction];
var heroIcon = core.material.icons.heros[id][heroLoc.direction]; var height = core.material.icons.hero.height;
core.canvas[canvas].drawImage(core.material.images.heros, heroIcon.stop * 32, heroIcon.loc * 32, 32, 32, x+persize*heroLoc.x, y+persize*heroLoc.y, persize, persize); var realHeight = persize*height/32;
core.canvas[canvas].drawImage(core.material.images.hero, heroIcon.stop * 32, heroIcon.loc * height, 32, height, x+persize*heroLoc.x, y+persize*heroLoc.y+persize-realHeight, persize, realHeight);
} }
} }

View File

@ -1,5 +1,5 @@
function main() { function main() {
this.version = "0.0.1"; this.version = "0.1";
this.dom = { this.dom = {
'body': document.body, 'body': document.body,
'gameGroup': document.getElementById('gameGroup'), 'gameGroup': document.getElementById('gameGroup'),
@ -41,7 +41,7 @@ function main() {
]; ];
// console.log('加载js文件列表加载完成' + this.loadList); // console.log('加载js文件列表加载完成' + this.loadList);
this.images = [ this.images = [
'animates', 'enemys', 'heros', 'items', 'npcs', 'terrains' 'animates', 'enemys', 'hero', 'items', 'npcs', 'terrains'
]; ];
this.sounds = { this.sounds = {
'mp3': ['bgm-loop', 'floor'], 'mp3': ['bgm-loop', 'floor'],

View File

@ -6,12 +6,12 @@ html, body {
background-color: #000; background-color: #000;
overflow: hidden; overflow: hidden;
} }
/*
@font-face { @font-face {
font-family: number; font-family: number;
src: url("fonts/number.ttf"); src: url("fonts/number.ttf");
} }
*/
#gameGroup { #gameGroup {
position: absolute; position: absolute;
box-sizing: border-box; box-sizing: border-box;
@ -176,6 +176,7 @@ html, body {
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
background: url(images/ground.png) round; background: url(images/ground.png) round;
z-index: 6; z-index: 6;
display: none;
} }
#statusBar .status{ #statusBar .status{
position: relative; position: relative;
@ -206,6 +207,7 @@ html, body {
box-sizing: border-box; box-sizing: border-box;
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
display: none;
} }
#toolBar .tools{ #toolBar .tools{
position: relative; position: relative;
@ -243,11 +245,11 @@ span#poison, span#weak, span#curse {
z-index: 2; z-index: 2;
} }
#fg { #hero {
z-index: 3; z-index: 3;
} }
#hero { #fg {
z-index: 4; z-index: 4;
} }

10
更新说明.txt Normal file
View File

@ -0,0 +1,10 @@
更新说明:
1. 新增战斗过程显示可在全局Flag中开关也可针对某一怪物单独设置。
2. 新增勇士支持48*32大图的行走图。 √
3. 新增:更改画面色调 √
4. 新增:文字显示支持自动换行。 √
5. 部分修改状态栏UI。 √
6. 移除doc和pdf文档现在请参考Web端有很好的索引。
7. 移除不再支持的全局变量中的bombTrigger选项 √
8. 修复键盘开门导致openDoor重复触发的Bug。 √
9. 更新快捷商店(文字显示&禁用) √