npc也支持大素材
This commit is contained in:
parent
f7ef0e9586
commit
a41c91f61d
@ -3891,7 +3891,7 @@ Arithmetic_List
|
|||||||
|
|
||||||
AssignOperator_List
|
AssignOperator_List
|
||||||
: '设为'|'增加'|'减少'|'乘以'|'除以'|'乘方'|'除以并取商'|'除以并取余'|'设为不小于'|'设为不大于'
|
: '设为'|'增加'|'减少'|'乘以'|'除以'|'乘方'|'除以并取商'|'除以并取余'|'设为不小于'|'设为不大于'
|
||||||
/*AssignOperator_List ['=','+=','-=','*=','/=','**=','//=','%=','min=','max=']*/;
|
/*AssignOperator_List ['=','+=','-=','*=','/=','**=','//=','%=','max=','min=']*/;
|
||||||
|
|
||||||
UnaryOperator_List
|
UnaryOperator_List
|
||||||
: '向下取整'|'向上取整'|'四舍五入'|'整数截断'|'绝对值'|'开方'|'变量类型'
|
: '向下取整'|'向上取整'|'四舍五入'|'整数截断'|'绝对值'|'开方'|'变量类型'
|
||||||
|
|||||||
@ -155,7 +155,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
|
|||||||
return current[0];
|
return current[0];
|
||||||
}).toString(),
|
}).toString(),
|
||||||
"_docs": "绑定贴图",
|
"_docs": "绑定贴图",
|
||||||
"_data": "该怪物绑定的怪物贴图"
|
"_data": "该怪物绑定的怪物贴图,用法详见文档"
|
||||||
},
|
},
|
||||||
"hp": {
|
"hp": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
@ -397,6 +397,21 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
|
|||||||
"_event": "faceIds",
|
"_event": "faceIds",
|
||||||
"_docs": "行走图朝向",
|
"_docs": "行走图朝向",
|
||||||
"_data": "行走图朝向。在勇士撞上图块时,或图块在移动时,会自动选择最合适的朝向图块(如果存在定义)来进行绘制。"
|
"_data": "行走图朝向。在勇士撞上图块时,或图块在移动时,会自动选择最合适的朝向图块(如果存在定义)来进行绘制。"
|
||||||
|
},
|
||||||
|
"bigImage": {
|
||||||
|
"_leaf": true,
|
||||||
|
"_type": "material",
|
||||||
|
"_directory": "./project/images/",
|
||||||
|
"_transform": (function (one) {
|
||||||
|
if (one.endsWith('.png')) return one;
|
||||||
|
return null;
|
||||||
|
}).toString(),
|
||||||
|
"_onconfirm": (function (previous, current) {
|
||||||
|
if (current.length == 0) return null;
|
||||||
|
return current[0];
|
||||||
|
}).toString(),
|
||||||
|
"_docs": "绑定贴图",
|
||||||
|
"_data": "该图块绑定的贴图,用法详见文档"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -146,7 +146,7 @@ control.prototype._animationFrame_globalAnimate = function (timestamp) {
|
|||||||
if (core.status.floorId) {
|
if (core.status.floorId) {
|
||||||
// Global Animate
|
// Global Animate
|
||||||
core.status.globalAnimateObjs.forEach(function (block) {
|
core.status.globalAnimateObjs.forEach(function (block) {
|
||||||
core.drawBlock(block, core.status.globalAnimateStatus % (block.event.animate||1));
|
core.drawBlock(block, core.status.globalAnimateStatus);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Global floor images
|
// Global floor images
|
||||||
|
|||||||
@ -386,7 +386,7 @@ enemys.prototype._getCurrentEnemys_getEnemy = function (enemyId) {
|
|||||||
if (!enemy) return null;
|
if (!enemy) return null;
|
||||||
|
|
||||||
// 检查朝向;displayIdInBook
|
// 检查朝向;displayIdInBook
|
||||||
return core.material.enemys[(enemy.faceIds || {}).down] || core.material.enemys[enemy.displayIdInBook] || enemy;
|
return core.material.enemys[enemy.displayIdInBook] || core.material.enemys[(enemy.faceIds || {}).down] || enemy;
|
||||||
}
|
}
|
||||||
|
|
||||||
enemys.prototype._getCurrentEnemys_addEnemy = function (enemyId, enemys, used, x, y, floorId) {
|
enemys.prototype._getCurrentEnemys_addEnemy = function (enemyId, enemys, used, x, y, floorId) {
|
||||||
|
|||||||
11
libs/maps.js
11
libs/maps.js
@ -960,7 +960,7 @@ maps.prototype._getBigImageInfo = function (bigImage, face, animate) {
|
|||||||
var per_width = bigImage.width / 4;
|
var per_width = bigImage.width / 4;
|
||||||
var per_height = bigImage.height / 4;
|
var per_height = bigImage.height / 4;
|
||||||
var sx = animate * per_width, sy;
|
var sx = animate * per_width, sy;
|
||||||
if (per_height < per_width / 2) { // 强制视为 1*4 的怪物
|
if (per_height <= per_width / 2) { // 强制视为 1*4 的怪物
|
||||||
per_height = bigImage.height;
|
per_height = bigImage.height;
|
||||||
sy = 0;
|
sy = 0;
|
||||||
} else {
|
} else {
|
||||||
@ -1968,13 +1968,14 @@ maps.prototype.getBlockInfo = function (block) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (block.event.bigImage) bigImage = core.material.images.images[block.event.bigImage];
|
||||||
if (core.material.enemys[id]) {
|
if (core.material.enemys[id]) {
|
||||||
name = core.material.enemys[id].name;
|
name = core.material.enemys[id].name;
|
||||||
bigImage = core.material.images.images[core.material.enemys[id].bigImage] || null;
|
bigImage = core.material.images.images[core.material.enemys[id].bigImage];
|
||||||
if (bigImage != null) animate = 4;
|
|
||||||
} else if (core.material.items[id]) {
|
} else if (core.material.items[id]) {
|
||||||
name = core.material.items[id].name;
|
name = core.material.items[id].name;
|
||||||
}
|
}
|
||||||
|
if (bigImage != null) animate = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {number: number, id: id, cls: cls, name: name, image: image, posX: posX,
|
return {number: number, id: id, cls: cls, name: name, image: image, posX: posX,
|
||||||
@ -2582,7 +2583,7 @@ maps.prototype.moveBlock = function (x, y, steps, time, keep, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
maps.prototype._moveBlock_doMove = function (blockInfo, canvases, moveInfo, callback) {
|
maps.prototype._moveBlock_doMove = function (blockInfo, canvases, moveInfo, callback) {
|
||||||
var animateTotal = core.icons._getAnimateFrames(blockInfo.cls), animateTime = 0;
|
var animateTotal = blockInfo.animate, animateTime = 0;
|
||||||
var _run = function () {
|
var _run = function () {
|
||||||
var animate = window.setInterval(function () {
|
var animate = window.setInterval(function () {
|
||||||
if (blockInfo.cls != 'tileset') {
|
if (blockInfo.cls != 'tileset') {
|
||||||
@ -2872,7 +2873,7 @@ maps.prototype.addGlobalAnimate = function (block) {
|
|||||||
core.status.autotileAnimateObjs.push(block);
|
core.status.autotileAnimateObjs.push(block);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!block.event.animate || block.event.animate == 1) return;
|
if (!block.event.bigImage && (!block.event.animate || block.event.animate == 1)) return;
|
||||||
core.status.globalAnimateObjs.push(block);
|
core.status.globalAnimateObjs.push(block);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user