V2.3.3
This commit is contained in:
parent
8908453be2
commit
f5ca89e27a
@ -64,6 +64,8 @@ HTML5 canvas制作的魔塔样板,支持全平台游戏!
|
||||
HTML5魔塔样板V2.3.3
|
||||
|
||||
* [x] 将怪物特殊属性定义和伤害计算函数移动到脚本编辑中
|
||||
* [x] 地图编辑器可以使用矩形方式绘制地图
|
||||
* [x] 瞬间移动可以指定存在事件的点(如怪物、门、楼梯等)
|
||||
* [x] 事件:画面震动
|
||||
* [x] 事件:更新怪物数据
|
||||
* [x] 移动事件和跳跃事件增加“不消失”选项
|
||||
|
||||
@ -236,9 +236,11 @@
|
||||
<option value="tower">全塔属性</option>
|
||||
<option value="functions">脚本编辑</option>
|
||||
<option value="appendpic">追加素材</option>
|
||||
</select><br>
|
||||
</select>
|
||||
<span style="font-size: 12px; margin-left: 10px">
|
||||
<input type="radio" id="brushMod" name="brushMod" value="line" checked="checked" />画线
|
||||
<input type="radio" id="brushMod2" name="brushMod" value="rectangle" />画矩形
|
||||
</span>
|
||||
<br><br><br>
|
||||
<select id="selectFloor"></select>
|
||||
<input type="button" value="保存地图" id='saveFloor'/>
|
||||
|
||||
@ -393,6 +393,20 @@ control.prototype.moveDirectly = function (destX, destY) {
|
||||
return false;
|
||||
}
|
||||
|
||||
////// 尝试瞬间移动 //////
|
||||
control.prototype.tryMoveDirectly = function (destX, destY) {
|
||||
var testMove = function (dx, dy, dir) {
|
||||
if (dx<0 || dx>12 || dy<0 || dy>12) return false;
|
||||
if (core.control.moveDirectly(dx, dy)) {
|
||||
if (core.isset(dir)) core.moveHero(dir, function() {});
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return !(!testMove(destX,destY) && !testMove(destX-1, destY, "right") && !testMove(destX,destY-1,"down")
|
||||
&& !testMove(destX,destY+1,"up") && !testMove(destX+1,destY,"left"));
|
||||
}
|
||||
|
||||
////// 设置自动寻路路线 //////
|
||||
control.prototype.setAutomaticRoute = function (destX, destY, stepPostfix) {
|
||||
if (!core.status.played || core.status.lockControl) {
|
||||
@ -406,7 +420,7 @@ control.prototype.setAutomaticRoute = function (destX, destY, stepPostfix) {
|
||||
core.status.automaticRoute.moveDirectly = true;
|
||||
setTimeout(function () {
|
||||
if (core.status.automaticRoute.moveDirectly && core.status.heroMoving==0) {
|
||||
core.control.moveDirectly(destX, destY);
|
||||
core.control.tryMoveDirectly(destX, destY);
|
||||
}
|
||||
core.status.automaticRoute.moveDirectly = false;
|
||||
}, 100);
|
||||
@ -431,7 +445,7 @@ control.prototype.setAutomaticRoute = function (destX, destY, stepPostfix) {
|
||||
|
||||
// 单击瞬间移动
|
||||
if (core.status.automaticRoute.clickMoveDirectly && core.status.heroStop) {
|
||||
if (core.control.moveDirectly(destX, destY))
|
||||
if (core.control.tryMoveDirectly(destX, destY))
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1841,7 +1855,7 @@ control.prototype.replay = function () {
|
||||
core.useItem(itemId, function () {
|
||||
core.replay();
|
||||
});
|
||||
}, 750 / core.status.replay.speed);
|
||||
}, 750 / Math.max(1, core.status.replay.speed));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -1861,7 +1875,7 @@ control.prototype.replay = function () {
|
||||
core.changeFloor(floorId, stair, null, null, function () {
|
||||
core.replay();
|
||||
});
|
||||
}, 750 / core.status.replay.speed);
|
||||
}, 750 / Math.max(1, core.status.replay.speed));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1894,7 +1908,7 @@ control.prototype.replay = function () {
|
||||
core.status.event.selection = parseInt(selections.shift());
|
||||
core.events.openShop(shopId, false);
|
||||
|
||||
}, 750 / core.status.replay.speed);
|
||||
}, 750 / Math.max(1, core.status.replay.speed));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1927,7 +1941,7 @@ control.prototype.replay = function () {
|
||||
if (core.control.moveDirectly(x,y)) {
|
||||
setTimeout(function () {
|
||||
core.replay();
|
||||
}, 750 / core.status.replay.speed);
|
||||
}, 750 / Math.max(1, core.status.replay.speed));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -744,7 +744,7 @@ events.prototype.doAction = function() {
|
||||
core.status.route.push("choices:"+index);
|
||||
core.events.insertAction(data.choices[index].action);
|
||||
core.events.doAction();
|
||||
}, 750 / core.status.replay.speed)
|
||||
}, 750 / Math.max(1, core.status.replay.speed))
|
||||
}
|
||||
else {
|
||||
core.stopReplay();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user