跳跃音效;怪物手册48高度

This commit is contained in:
ckcz123 2020-06-02 22:47:27 +08:00
parent 7bc2a868b4
commit fdd65bc028
5 changed files with 18 additions and 10 deletions

View File

@ -2950,7 +2950,6 @@ events.prototype.jumpHero = function (ex, ey, time, callback) {
var sx=core.status.hero.loc.x, sy=core.status.hero.loc.y;
if (!core.isset(ex)) ex=sx;
if (!core.isset(ey)) ey=sy;
core.playSound('jump.mp3');
var jumpInfo = core.maps.__generateJumpInfo(sx, sy, ex, ey, time || 500);
jumpInfo.icon = core.material.icons.hero[core.getHeroLoc('direction')];
jumpInfo.width = core.material.icons.hero.width || 32;

View File

@ -1976,7 +1976,6 @@ maps.prototype.jumpBlock = function (sx, sy, ex, ey, time, keep, callback) {
var block = blockArr[0], blockInfo = blockArr[1];
var canvases = this._initDetachedBlock(blockInfo, sx, sy, block.event.animate !== false);
this._moveDetachedBlock(blockInfo, 32 * sx, 32 * sy, 1, canvases);
core.playSound('jump.mp3');
var jumpInfo = this.__generateJumpInfo(sx, sy, ex, ey, time);
jumpInfo.keep = keep;
@ -2164,7 +2163,7 @@ maps.prototype.drawBoxAnimate = function () {
core.clearMap('ui', obj.bgx, obj.bgy, obj.bgWidth, obj.bgHeight);
core.fillRect('ui', obj.bgx, obj.bgy, obj.bgWidth, obj.bgHeight, core.material.groundPattern);
core.drawImage('ui', obj.image, core.status.globalAnimateStatus % obj.animate * 32, obj.pos,
32, obj.height, obj.x, obj.y, 32, obj.height);
32, obj.height, obj.x, obj.y, obj.dw || 32, obj.dh || obj.height);
});
}

View File

@ -1915,11 +1915,21 @@ ui.prototype._drawBook_drawBox = function (index, enemy, top, pageinfo) {
var img_top = border_top + 5, img_left = border_left + 5;
core.strokeRect('ui', 22, border_top, 42, 42, '#DDDDDD', 2);
var blockInfo = core.getBlockInfo(enemy.id);
core.status.boxAnimateObjs.push({
'bgx': border_left, 'bgy': border_top, 'bgWidth': 42, 'bgHeight': 42,
'x': img_left, 'y': img_top, 'height': 32, 'animate': blockInfo.animate,
'image': blockInfo.image, 'pos': blockInfo.posY * blockInfo.height
});
if (blockInfo.height >= 42) {
var drawWidth = 42 * 32 / blockInfo.height;
core.status.boxAnimateObjs.push({
'bgx': border_left, 'bgy': border_top, 'bgWidth': 42, 'bgHeight': 42,
'x': img_left - 5 + (42 - drawWidth) / 2, 'y': img_top - 5, 'dw': drawWidth, 'dh': 42,
'height': blockInfo.height, 'animate': blockInfo.animate,
'image': blockInfo.image, 'pos': blockInfo.posY * blockInfo.height
});
} else {
core.status.boxAnimateObjs.push({
'bgx': border_left, 'bgy': border_top, 'bgWidth': 42, 'bgHeight': 42,
'x': img_left, 'y': img_top, 'height': 32, 'animate': blockInfo.animate,
'image': blockInfo.image, 'pos': blockInfo.posY * blockInfo.height
});
}
}
ui.prototype._drawBook_drawName = function (index, enemy, top, left, width) {

View File

@ -228,7 +228,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
if (guards.length > 0) {
// 记录flag当前要参与支援的怪物
core.setFlag("__guards__" + x + "_" + y, guards);
var actions = [];
var actions = [{ "type": "playSound", "name": "jump.mp3" }];
// 增加支援的特效动画(图块跳跃)
guards.forEach(function (g) {
core.push(actions, { "type": "jump", "from": [g[0], g[1]], "to": [x, y], "time": 300, "keep": false, "async": true });

View File

@ -498,7 +498,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "tools",
"name": "跳跃靴",
"text": "能跳跃到前方两格处",
"useItemEffect": "core.insertAction({ \"type\": \"jumpHero\", \"loc\": [core.nextX(2), core.nextY(2)] });",
"useItemEffect": "core.playSound(\"jump.mp3\"); core.insertAction({ \"type\": \"jumpHero\", \"loc\": [core.nextX(2), core.nextY(2)] });",
"canUseItemEffect": "(function () {\n\tvar nx = core.nextX(2),\n\t\tny = core.nextY(2);\n\treturn nx >= 0 && nx < core.bigmap.width && ny >= 0 && ny < core.bigmap.height && core.getBlockId(nx, ny) == null;\n})();"
},
"skill1": {