Merge branch 'ckcz123/v2.x' into blockly-entrance

This commit is contained in:
YouWei Zhao 2020-05-22 19:57:08 +08:00
commit 5130969bdb
31 changed files with 411 additions and 285 deletions

View File

@ -383,7 +383,7 @@ value为必填项代表要修改到的内容。对于修改名称的必须
{"type": "setFloor", "name": "title", "value": "'主塔 0 层'" } // 设置当前楼层的中文名为主塔0层
{"type": "setFloor", "name": "canFlyTo", "floorId": "MT2", "value": "false" } // 设置MT2层不可飞行
{"type": "setFloor", "name": "cannotViewMap", "floorId": "MT0", "value": "true" } // 设置MT0层不可被浏览地图
{"type": "setFloor", "name": "item_ratio", "value": "5" } // 设置当前楼层的宝石血瓶属性加成为5
{"type": "setFloor", "name": "ratio", "value": "5" } // 设置当前楼层的宝石血瓶属性加成为5
{"type": "setFloor", "name": "images", "value": "[[0,0,'tree.png',2]]" } // 设置当前楼层的楼层贴图
{"type": "setFloor", "name": "upFloor", "value": "[2,3]" } // 设置当前楼层的上楼梯
{"type": "setFloor", "name": "bgm", "floorId": "MT10", "value": "'233.mp3'" } // 设置当前楼层的背景音乐

View File

@ -249,21 +249,18 @@ ID必须由数字字母下划线组成数字在1000以内且均不能和
如果你想要同种宝石在不同层效果不同的话,可以进行如下操作:
1. 在楼层的item_ratio中定义宝石的比率比如1-10的写111-20层写2等
1. 在楼层的ratio中定义宝石的比率比如1-10的写111-20层写2等
2. 修改获得道具的itemEffect函数编辑器中双击进行编辑
``` js
// ratio为楼层的item_ratio值可以进行翻倍宝石属性
core.status.hero.atk += core.values.redGem * ratio
core.status.hero.atk += core.values.redGem * core.status.thisMap.ratio
```
这里我们可以直接写ratio来取用该楼层中定义的`item_ratio`的值。
如果不是倍数增加(比如线性增加)也可以类似来写
``` js
// 一个二倍线性增加的例子
core.status.hero.atk += core.values.redGem + 2*ratio
core.status.hero.atk += core.values.redGem + 2*core.status.thisMap.ratio
```
### 消耗类道具cls: tools永久类道具cls: constants

View File

@ -536,7 +536,7 @@ return '{' + [
IdString_1 && ('"down": "' + IdString_1 +'"'),
IdString_2 && ('"left": "' + IdString_2 +'"'),
IdString_3 && ('"right": "' + IdString_3 +'"'),
].join(', ') + '}\n';
].filter(function (x) { return x; }).join(', ') + '}\n';
*/;
@ -3106,7 +3106,7 @@ Event_List
Floor_Meta_List
: '楼层中文名'|'状态栏名称'|'能否使用楼传'|'能否打开快捷商店'|'是否不可浏览地图'|'是否不可瞬间移动'|'默认地面ID'|'楼层贴图'|'宝石血瓶效果'|'上楼点坐标'|'下楼点坐标'|'背景音乐'|'画面色调'|'天气和强度'|'是否地下层'
/*Floor_Meta_List ['title','name','canFlyTo', 'canUseQuickShop', 'cannotViewMap', 'cannotMoveDirectly', 'defaultGround', 'images', 'item_ratio', 'upFloor', 'downFloor', 'bgm', 'color', 'weather', 'underGround']*/;
/*Floor_Meta_List ['title','name','canFlyTo', 'canUseQuickShop', 'cannotViewMap', 'cannotMoveDirectly', 'defaultGround', 'images', 'ratio', 'upFloor', 'downFloor', 'bgm', 'color', 'weather', 'underGround']*/;
Global_Attribute_List
: '全局字体'|'横屏左侧状态栏背景'|'竖屏上方状态栏背景'|'竖屏下方道具栏背景'|'边框颜色'|'状态栏文字色'|'楼层转换背景'|'楼层转换文字色'|'装备列表'
@ -3173,7 +3173,7 @@ Id_List
EnemyId_List
: '生命'|'攻击'|'防御'|'金币'|'经验'|'加点'|'属性'|'名称'|'映射名'|'value'|'atkValue'|'defValue'|'notBomb'|'zoneSquare'|'range'|'n'|'add'|'damage'
/*EnemyId_List ['hp','atk','def','money','exp','point','special','name','displayInBook','value','atkValue','defValue','notBomb','zoneSquare','range','n','add','damage']*/;
/*EnemyId_List ['hp','atk','def','money','exp','point','special','name','displayInBook','属性值','退化扣攻','退化扣防','不可炸','九宫格领域','领域范围','连击数','吸血到自身','固伤值']*/;
Equip_List
: '生命'|'生命上限'|'攻击'|'防御'|'护盾'|'魔力'|'魔力上限'
@ -3249,6 +3249,6 @@ this.block('idTemp_e').output='idString_e';
/* Functions
MotaActionParse()
MotaActionParser()
*/

View File

@ -1,4 +1,4 @@
MotaActionParse=function(){
MotaActionParser=function(){
function ActionParser(){
}
@ -67,7 +67,7 @@ ActionParser.prototype.parse = function (obj,type) {
Object.keys(obj).sort().forEach(function (key) {
var one = knownEquipListKeys.indexOf(key) >= 0 ? 'equipKnown' : 'equipUnknown';
text_choices = MotaActionBlocks[one].xmlText([
key, obj.key, text_choices
key, obj[key], text_choices
]);
})
return text_choices;
@ -83,7 +83,7 @@ ActionParser.prototype.parse = function (obj,type) {
Object.keys(obj).sort().forEach(function (key) {
var one = knownListKeys.indexOf(key) >= 0 ? 'doorKeyKnown' : 'doorKeyUnknown';
text_choices = MotaActionBlocks[one].xmlText([
key, obj.key, text_choices
one == 'doorKeyUnknown' ? MotaActionFunctions.replaceToName_token(key) : key, obj[key], text_choices
]);
})
return text_choices;
@ -474,11 +474,11 @@ ActionParser.prototype.parseAction = function() {
break;
case "useItem": // 使用道具
this.next = MotaActionBlocks['useItem_s'].xmlText([
data.id,this.next]);
MotaActionFunctions.replaceToName_token(data.id),this.next]);
break;
case "loadEquip": // 装上装备
this.next = MotaActionBlocks['loadEquip_s'].xmlText([
data.id,this.next]);
MotaActionFunctions.replaceToName_token(data.id),this.next]);
break;
case "unloadEquip": // 卸下装备
this.next = MotaActionBlocks['unloadEquip_s'].xmlText([
@ -495,7 +495,7 @@ ActionParser.prototype.parseAction = function() {
case "battle": // 强制战斗
if (data.id) {
this.next = MotaActionBlocks['battle_s'].xmlText([
data.id,this.next]);
MotaActionFunctions.replaceToName_token(data.id),this.next]);
}
else {
data.loc = data.loc || [];
@ -564,7 +564,7 @@ ActionParser.prototype.parseAction = function() {
break;
case "setEnemy":
this.next = MotaActionBlocks['setEnemy_s'].xmlText([
data.id, data.name, this.expandEvalBlock([data.value]), this.next]);
MotaActionFunctions.replaceToName_token(data.id), data.name, this.expandEvalBlock([data.value]), this.next]);
break;
case "setFloor":
this.next = MotaActionBlocks['setFloor_s'].xmlText([
@ -1027,7 +1027,7 @@ ActionParser.prototype.matchEvalAtom = function(args) {
var EnemyId_List=MotaActionBlocks['EnemyId_List'].options; // [["生命", "hp"], ...]
match=new RegExp("^enemy:([a-zA-Z0-9_]+):(" + EnemyId_List.map(function(v){return v[1]}).join('|') + ")$").exec(args[0])
if(match){
args=[match[1],match[2]]
args=[MotaActionFunctions.replaceToName_token(match[1]),match[2]]
return rt(MotaActionBlocks['enemyattr_e'].xmlText, args);
}
// 图块ID
@ -1156,6 +1156,7 @@ MotaActionFunctions.IntString_pre = function (IntString) {
MotaActionFunctions.IdString_pre = function(IdString){
if (IdString.indexOf('__door__')!==-1) throw new Error('请修改开门变量__door__如door1door2door3等依次向后。请勿存在两个门使用相同的开门变量。');
IdString = MotaActionFunctions.replaceFromName(IdString);
IdString = MotaActionFunctions.replaceFromName_token(IdString);
if (IdString && !(MotaActionFunctions.pattern.id.test(IdString)) && !(MotaActionFunctions.pattern.idWithoutFlag.test(IdString)))
throw new Error('id: '+IdString+'中包含了0-9 a-z A-Z _ - :之外的字符');
return IdString;
@ -1241,59 +1242,46 @@ MotaActionFunctions.pattern.replaceStatusList = [
["steps", "步数"],
];
MotaActionFunctions.pattern.replaceItemList = [
// 保证顺序!
["yellowKey", "黄钥匙"],
["blueKey", "蓝钥匙"],
["redKey", "红钥匙"],
["redGem", "红宝石"],
["blueGem", "蓝宝石"],
["greenGem", "绿宝石"],
["yellowGem", "黄宝石"],
["redPotion", "红血瓶"],
["bluePotion", "蓝血瓶"],
["yellowPotion", "黄血瓶"],
["greenPotion", "绿血瓶"],
["sword1", "铁剑"],
["sword2", "银剑"],
["sword3", "骑士剑"],
["sword4", "圣剑"],
["sword5", "神圣剑"],
["shield1", "铁盾"],
["shield2", "银盾"],
["shield3", "骑士盾"],
["shield4", "圣盾"],
["shield5", "神圣盾"],
["superPotion", "圣水"],
["silverCoin", "银币"],
["book", "怪物手册"],
["fly", "楼层传送器"],
["coin", "幸运金币"],
["freezeBadge", "冰冻徽章"],
["cross", "十字架"],
["dagger", "屠龙匕首"],
["amulet", "护符"],
["bigKey", "大黄门钥匙"],
["greenKey", "绿钥匙"],
["steelKey", "铁门钥匙"],
["pickaxe", "破墙镐"],
["icePickaxe", "破冰镐"],
["bomb", "炸弹"],
["centerFly", "中心对称飞行器"],
["upFly", "上楼器"],
["downFly", "下楼器"],
["earthquake", "地震卷轴"],
["poisonWine", "解毒药水"],
["weakWine", "解衰药水"],
["curseWine", "解咒药水"],
["superWine", "万能药水"],
["hammer", "圣锤"],
["lifeWand", "生命魔杖"],
["jumpShoes", "跳跃靴"],
];
MotaActionFunctions.pattern.replaceEnemyList = [
(function() {
// 读道具列表
MotaActionFunctions.pattern.replaceItemList = [];
for (var id in core.material.items) {
var name = core.material.items[id].name;
if (id && name && name != '新物品') {
var hasPrefix = false;
MotaActionFunctions.pattern.replaceItemList.forEach(function (one) {
if (one[0].startsWith(id) || id.startsWith(one[0]) || one[1].startsWith(name) || name.startsWith(one[1])) {
hasPrefix = true;
}
});
if (!hasPrefix) {
MotaActionFunctions.pattern.replaceItemList.push([id, name]);
}
}
}
MotaActionFunctions.pattern.replaceEnemyList = [];
for (var id in core.material.enemys) {
var name = core.material.enemys[id].name;
if (id && name && name != '新敌人') {
var hasPrefix = false;
MotaActionFunctions.pattern.replaceEnemyList.forEach(function (one) {
if (one[0].startsWith(id) || id.startsWith(one[0]) || one[1].startsWith(name) || name.startsWith(one[1])) {
hasPrefix = true;
}
});
if (!hasPrefix) {
MotaActionFunctions.pattern.replaceEnemyList.push([id, name]);
}
}
}
})();
MotaActionFunctions.pattern.replaceEnemyValueList = [
// 保证顺序!
["hp", "生命"],
["name", "名称"],
["atk", "攻击"],
["def", "防御"],
@ -1312,6 +1300,7 @@ MotaActionFunctions.replaceToName_token = function (str) {
list=list.concat(MotaActionFunctions.pattern.replaceStatusList)
list=list.concat(MotaActionFunctions.pattern.replaceItemList)
list=list.concat(MotaActionFunctions.pattern.replaceEnemyList)
list=list.concat(MotaActionFunctions.pattern.replaceEnemyValueList)
for(var index=0,pair;pair=list[index];index++){
if (pair[0]==str) {
return pair[1]
@ -1320,6 +1309,21 @@ MotaActionFunctions.replaceToName_token = function (str) {
return str;
}
MotaActionFunctions.replaceFromName_token = function (str) {
if (!str || MotaActionFunctions.disableReplace) return str;
var list = [];
list=list.concat(MotaActionFunctions.pattern.replaceStatusList)
list=list.concat(MotaActionFunctions.pattern.replaceItemList)
list=list.concat(MotaActionFunctions.pattern.replaceEnemyList)
list=list.concat(MotaActionFunctions.pattern.replaceEnemyValueList)
for(var index=0,pair;pair=list[index];index++){
if (pair[1]==str) {
return pair[0]
}
}
return str;
}
MotaActionFunctions.replaceToName = function (str) {
if (!str || MotaActionFunctions.disableReplace) return str;
var map = {}, list = [];
@ -1338,12 +1342,20 @@ MotaActionFunctions.replaceToName = function (str) {
}).replace(/item:/g, "物品:");
str = str.replace(/flag:/g, "变量:").replace(/switch:/g, "独立开关:").replace(/global:/g, "全局存储:").replace(/temp:/g, "临时变量:");
MotaActionFunctions.pattern.replaceEnemyValueList.forEach(function (v) {
map[v[0]] = v[1]; list.push(v[0]);
});
str = str.replace(new RegExp("enemy:([a-zA-Z0-9_]+)[.:](" + list.join("|") + ")", "g"), function (a, b, c) {
return map[c] ? ("enemy:" + b + "" + map[c]) : c;
}).replace(/(enemy:[a-zA-Z0-9_]+)[.:]/g, '$1');
map = {}; list = [];
MotaActionFunctions.pattern.replaceEnemyList.forEach(function (v) {
map[v[0]] = v[1]; list.push(v[0]);
});
str = str.replace(new RegExp("enemy:([a-zA-Z0-9_]+).(" + list.join("|") + ")", "g"), function (a, b, c) {
return map[c] ? ("怪物:" + b + "" + map[c]) : c;
str = str.replace(new RegExp("enemy:(" + list.join("|") + ")", "g"), function (a, b) {
return map[b] ? ("怪物:" + map[b]) : b;
}).replace(/enemy:/g, "怪物:");
str = str.replace(/blockId:/g, "图块ID").replace(/blockCls:/g, "图块类别:").replace(/equip:/g, "装备孔:");
@ -1366,16 +1378,24 @@ MotaActionFunctions.replaceFromName = function (str) {
str = str.replace(new RegExp("物品[:](" + list.join("|") + ")", "g"), function (a, b) {
return map[b] ? ("item:" + map[b]) : b;
}).replace(/物品[:]/g, "item:");
str = str.replace(/临时变量[:]/g, "temp:").replace(/变量[:]/g, "flag:").replace(/独立开关[:]/g, "switch:").replace(/全局存储[:]/g, "global:");
str = str.replace(/临时变量[:]/g, "temp d:").replace(/变量[:]/g, "flag:").replace(/独立开关[:]/g, "switch:").replace(/全局存储[:]/g, "global:");
map = {}; list = [];
MotaActionFunctions.pattern.replaceEnemyList.forEach(function (v) {
map[v[1]] = v[0]; list.push(v[1]);
});
str = str.replace(new RegExp("(enemy:|怪物[:])([a-zA-Z0-9_]+)[:](" + list.join("|") + ")", "g"), function (a, b, c, d) {
return map[d] ? ("enemy:" + c + ":" + map[d]) : d;
str = str.replace(new RegExp("(enemy:|怪物[:])(" + list.join("|") + ")", "g"), function (a, b, c, d) {
return map[c] ? ("enemy:" + map[c]) : c;
}).replace(/怪物[:]/g, "enemy:");
map = {}; list = [];
MotaActionFunctions.pattern.replaceEnemyValueList.forEach(function (v) {
map[v[1]] = v[0]; list.push(v[1]);
});
str = str.replace(new RegExp("enemy:([a-zA-Z0-9_]+)[:](" + list.join("|") + ")", "g"), function (a, b, c, d) {
return map[c] ? ("enemy:" + b + ":" + map[c]) : c;
}).replace(/(enemy:[a-zA-Z0-9_]+)[:]/g, '$1:');
str = str.replace(/图块I[dD][:]/g, "blockId:").replace(/图块类别[:]/g, "blockCls:").replace(/装备孔[:]/g, "equip:");
return str;

View File

@ -69,6 +69,12 @@ function editor() {
mouseOutCheck : 2,
startPos:null,
endPos:null,
lastMoveE:{buttons:0,clientX:0,clientY:0},
selectedArea: null,
// 材料区拖动有关
lastMoveMaterE:null,
tileSize: [1,1],
startLoc: null,
// 撤销/恢复
preMapData : [],
preMapMax: 10,
@ -101,8 +107,6 @@ function editor() {
},
// tile
tileSize: [1,1],
startLoc: null,
lockMode: false,
// 最近使用的图块

View File

@ -427,7 +427,13 @@ editor_blockly = function () {
return one != token && one.startsWith(token);
}).sort();
} else if (before.endsWith("怪物") || (ch == ':' && before.endsWith("enemy"))) {
return Object.keys(core.material.enemys).filter(function (one) {
var list = Object.keys(core.material.enemys);
if (before.endsWith("怪物") && MotaActionFunctions) {
list = MotaActionFunctions.pattern.replaceEnemyList.map(function (v) {
return v[1];
}).concat(list);
}
return list.filter(function (one) {
return one != token && one.startsWith(token);
})
} else {
@ -438,7 +444,7 @@ editor_blockly = function () {
if (before.endsWith("怪物") || (ch == ':' && ch2 == ':' && before.endsWith("enemy"))) {
var list = ["name", "hp", "atk", "def", "money", "exp", "point", "special"];
if (before.endsWith("怪物") && MotaActionFunctions) {
list = MotaActionFunctions.pattern.replaceEnemyList.map(function (v) {
list = MotaActionFunctions.pattern.replaceEnemyValueList.map(function (v) {
return v[1];
}).concat(list);
}
@ -491,7 +497,17 @@ editor_blockly = function () {
}));
var allImages = Object.keys(core.material.images.images);
var allEnemys = Object.keys(core.material.enemys);
if (MotaActionFunctions && !MotaActionFunctions.disableReplace) {
allEnemys = allEnemys.concat(MotaActionFunctions.pattern.replaceEnemyList.map(function (x) {
return x[1];
}))
}
var allItems = Object.keys(core.material.items);
if (MotaActionFunctions && !MotaActionFunctions.disableReplace) {
allItems = allItems.concat(MotaActionFunctions.pattern.replaceItemList.map(function (x) {
return x[1];
}))
}
var allAnimates = Object.keys(core.material.animates);
var allBgms = Object.keys(core.material.bgms);
var allSounds = Object.keys(core.material.sounds);

View File

@ -212,7 +212,7 @@ editor_file = function (editor, callback) {
canUseQuickShop: currData.canUseQuickShop,
cannotViewMap: currData.cannotViewMap,
cannotMoveDirectly: currData.cannotMoveDirectly,
item_ratio: currData.item_ratio,
ratio: currData.ratio,
defaultGround: currData.defaultGround,
bgm: currData.bgm,
color: currData.color,
@ -260,7 +260,7 @@ editor_file = function (editor, callback) {
canUseQuickShop: currData.canUseQuickShop,
cannotViewMap: currData.cannotViewMap,
cannotMoveDirectly: currData.cannotMoveDirectly,
item_ratio: currData.item_ratio,
ratio: currData.ratio,
defaultGround: currData.defaultGround,
bgm: currData.bgm,
color: currData.color,

View File

@ -75,6 +75,8 @@ editor_mappanel_wrapper = function (editor) {
* + 绘图时画个矩形在那个位置
*/
editor.uifunctions.map_ondown = function (e) {
editor.uivalues.selectedArea = null;
editor.uivalues.lastMoveE=e;
var loc = editor.uifunctions.eToLoc(e);
var pos = editor.uifunctions.locToPos(loc, true);
if (editor.uivalues.bindSpecialDoor.loc != null) {
@ -89,10 +91,10 @@ editor_mappanel_wrapper = function (editor) {
}
return false;
}
if (e.button == 2) {
editor.uifunctions.showMidMenu(e.clientX, e.clientY);
return false;
}
// if (e.buttons == 2) { // 挪到onup
// editor.uifunctions.showMidMenu(e.clientX, e.clientY);
// return false;
// }
if (!selectBox.isSelected()) {
editor_mode.onmode('nextChange');
editor_mode.onmode('loc');
@ -122,6 +124,7 @@ editor_mappanel_wrapper = function (editor) {
* + 绘图模式时找到与队列尾相邻的鼠标方向的点画个矩形
*/
editor.uifunctions.map_onmove = function (e) {
editor.uivalues.lastMoveE=e;
if (!selectBox.isSelected()) {
if (editor.uivalues.startPos == null) return;
//tip.whichShow(1);
@ -136,9 +139,25 @@ editor_mappanel_wrapper = function (editor) {
editor.uivalues.endPos = pos;
if (editor.uivalues.startPos != null) {
if (editor.uivalues.startPos.x != editor.uivalues.endPos.x || editor.uivalues.startPos.y != editor.uivalues.endPos.y) {
core.drawArrow('eui',
32 * editor.uivalues.startPos.x + 16 - core.bigmap.offsetX, 32 * editor.uivalues.startPos.y + 16 - core.bigmap.offsetY,
32 * editor.uivalues.endPos.x + 16 - core.bigmap.offsetX, 32 * editor.uivalues.endPos.y + 16 - core.bigmap.offsetY);
if (e.buttons == 2) {
// 右键拖拽: 画选的区域
var x0 = editor.uivalues.startPos.x;
var y0 = editor.uivalues.startPos.y;
var x1 = editor.uivalues.endPos.x;
var y1 = editor.uivalues.endPos.y;
if (x0 > x1) { x0 ^= x1; x1 ^= x0; x0 ^= x1; }//swap
if (y0 > y1) { y0 ^= y1; y1 ^= y0; y0 ^= y1; }//swap
// draw rect
editor.dom.euiCtx.clearRect(0, 0, editor.dom.euiCtx.canvas.width, editor.dom.euiCtx.canvas.height);
editor.dom.euiCtx.fillStyle = 'rgba(0, 127, 255, 0.4)';
editor.dom.euiCtx.fillRect(32 * x0 - core.bigmap.offsetX, 32 * y0 - core.bigmap.offsetY,
32 * (x1 - x0) + 32, 32 * (y1 - y0) + 32);
}else{
// 左键拖拽: 画箭头
core.drawArrow('eui',
32 * editor.uivalues.startPos.x + 16 - core.bigmap.offsetX, 32 * editor.uivalues.startPos.y + 16 - core.bigmap.offsetY,
32 * editor.uivalues.endPos.x + 16 - core.bigmap.offsetX, 32 * editor.uivalues.endPos.y + 16 - core.bigmap.offsetY);
}
}
}
// editor_mode.onmode('nextChange');
@ -192,17 +211,35 @@ editor_mappanel_wrapper = function (editor) {
* + 非绘图模式时, 交换首末点的内容
* + 绘图模式时, 根据画线/画矩形/画tileset 做对应的绘制
*/
editor.uifunctions.map_onup = function (e) {
editor.uifunctions.map_onup = function (ee) {
editor.uivalues.selectedArea = null;
ee.preventDefault();
ee.stopPropagation();
var e=editor.uivalues.lastMoveE;
if (!selectBox.isSelected()) {
//tip.whichShow(1);
// editor.movePos(editor.uivalues.startPos, editor.uivalues.endPos);
if (editor.layerMod == 'map')
editor.exchangePos(editor.uivalues.startPos, editor.uivalues.endPos);
else
editor.exchangeBgFg(editor.uivalues.startPos, editor.uivalues.endPos, editor.layerMod);
if (e.buttons == 2) {
if (editor.uivalues.endPos==null || (editor.uivalues.startPos.x == editor.uivalues.endPos.x && editor.uivalues.startPos.y == editor.uivalues.endPos.y)) {
// 右键点击: 弹菜单
editor.uifunctions.showMidMenu(e.clientX, e.clientY);
editor.dom.euiCtx.clearRect(0, 0, core.__PIXELS__, core.__PIXELS__);
} else {
// 右键拖拽: 选中区域
printf('已经选中该区域')
editor.uivalues.selectedArea = Object.assign({}, editor.uivalues.startPos, {x1: editor.uivalues.endPos.x, y1: editor.uivalues.endPos.y});
// 后续的处理
}
} else {
// 左键拖拽: 交换
//tip.whichShow(1);
// editor.movePos(editor.uivalues.startPos, editor.uivalues.endPos);
if (editor.layerMod == 'map')
editor.exchangePos(editor.uivalues.startPos, editor.uivalues.endPos);
else
editor.exchangeBgFg(editor.uivalues.startPos, editor.uivalues.endPos, editor.layerMod);
editor.uifunctions.unhighlightSaveFloorButton();
editor.dom.euiCtx.clearRect(0, 0, core.__PIXELS__, core.__PIXELS__);
}
editor.uivalues.startPos = editor.uivalues.endPos = null;
editor.dom.euiCtx.clearRect(0, 0, core.__PIXELS__, core.__PIXELS__);
editor.uifunctions.unhighlightSaveFloorButton();
return false;
}
editor.uivalues.holdingPath = 0;
@ -844,30 +881,51 @@ editor_mappanel_wrapper = function (editor) {
editor.constructor.prototype.copyFromPos = function (pos) {
var fields = Object.keys(editor.file.comment._data.floors._data.loc._data);
pos = pos || editor.pos;
var map = core.clone(editor.map[pos.y][pos.x]);
var events = {};
fields.forEach(function(v){
events[v] = core.clone(editor.currentFloorData[v][pos.x+','+pos.y]);
})
return {map: map, events: events};
var x0 = pos.x, y0 = pos.y, x1 = pos.x1, y1 = pos.y1;
if (x1 == null) x1 = x0;
if (y1 == null) y1 = y0;
if (x0 > x1) { x0 ^= x1; x1 ^= x0; x0 ^= x1; }//swap
if (y0 > y1) { y0 ^= y1; y1 ^= y0; y0 ^= y1; }//swap
var result = {w: x1 - x0 + 1, h: y1 - y0 + 1, layer: editor.layerMod, data: []};
for (var i = x0; i <= x1; ++i) {
for (var j = y0; j<= y1; ++j) {
var map = core.clone(editor[editor.layerMod][j][i]);
var events = {};
fields.forEach(function(v){
events[v] = core.clone(editor.currentFloorData[v][i+','+j]);
})
result.data.push({map: map, events: events});
}
}
return result;
}
editor.constructor.prototype.pasteToPos = function (info, pos) {
if (info == null) return;
var fields = Object.keys(editor.file.comment._data.floors._data.loc._data);
pos = pos || editor.pos;
editor.map[pos.y][pos.x] = core.clone(info.map);
fields.forEach(function(v){
if (info.events[v] == null) delete editor.currentFloorData[v][pos.x+","+pos.y];
else editor.currentFloorData[v][pos.x+","+pos.y] = core.clone(info.events[v]);
});
var w = info.w || 1, h = info.h || 1, layer = info.layer || 'map';
var data = core.clone(info.data || []);
for (var i = pos.x; i < pos.x+w; ++i) {
for (var j = pos.y; j < pos.y+h; ++j) {
var one = data.shift();
if (j >= editor[editor.layerMod].length || i >= editor[editor.layerMod][0].length) continue;
editor[editor.layerMod][j][i] = core.clone(one.map);
if (layer == 'map' && editor.layerMod == 'map') {
fields.forEach(function(v){
if (one.events[v] == null) delete editor.currentFloorData[v][i+","+j];
else editor.currentFloorData[v][i+","+j] = core.clone(one.events[v]);
});
}
}
}
}
editor.constructor.prototype.movePos = function (startPos, endPos, callback) {
if (!startPos || !endPos) return;
if (startPos.x == endPos.x && startPos.y == endPos.y) return;
var copyed = editor.copyFromPos(startPos);
editor.pasteToPos({map:0, events: {}}, startPos);
editor.pasteToPos({w: 1, h: 1, layer: 'map', data: [{map:0, events: {}}]}, startPos);
editor.pasteToPos(copyed, endPos);
editor.updateMap();
editor.file.saveFloorFile(function (err) {
@ -954,16 +1012,28 @@ editor_mappanel_wrapper = function (editor) {
editor.constructor.prototype.clearPos = function (clearPos, pos, callback) {
var fields = Object.keys(editor.file.comment._data.floors._data.loc._data);
pos = pos || editor.pos;
var x0 = pos.x, y0 = pos.y, x1 = pos.x1, y1 = pos.y1;
if (x1 == null) x1 = x0;
if (y1 == null) y1 = y0;
if (x0 > x1) { x0 ^= x1; x1 ^= x0; x0 ^= x1; }//swap
if (y0 > y1) { y0 ^= y1; y1 ^= y0; y0 ^= y1; }//swap
editor.uifunctions.hideMidMenu();
editor.savePreMap();
editor.info = 0;
editor_mode.onmode('');
if (clearPos)
editor.map[pos.y][pos.x]=editor.info;
for (var i = x0; i <= x1; ++i) {
for (var j = y0; j <= y1; ++j) {
if (j >= editor[editor.layerMod].length || i >= editor[editor.layerMod][0].length) continue;
if (clearPos)
editor[editor.layerMod][j][i] = 0;
if (editor.layerMod == 'map') {
fields.forEach(function(v){
delete editor.currentFloorData[v][i+","+j];
});
}
}
}
editor.updateMap();
fields.forEach(function(v){
delete editor.currentFloorData[v][pos.x+','+pos.y];
})
editor.file.saveFloorFile(function (err) {
if (err) {
printe(err);

View File

@ -62,7 +62,6 @@ editor_materialpanel_wrapper = function (editor) {
}
}
var lastmoveE=null;
/**
* editor.dom.iconLib.onmousedown
* 素材区的单击/拖拽事件
@ -70,7 +69,7 @@ editor_materialpanel_wrapper = function (editor) {
editor.uifunctions.material_ondown = function (e) {
e.stopPropagation();
e.preventDefault();
lastmoveE=e;
editor.uivalues.lastMoveMaterE=e;
if (!editor.isMobile && e.clientY >= editor.dom.iconLib.offsetHeight - editor.uivalues.scrollBarHeight) return;
var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
@ -90,7 +89,7 @@ editor_materialpanel_wrapper = function (editor) {
editor.uifunctions.material_onmove = function (e) {
e.stopPropagation();
e.preventDefault();
lastmoveE=e;
editor.uivalues.lastMoveMaterE=e;
if (!editor.uivalues.startLoc) return;
var pos0 = editor.uifunctions.locToPos(editor.uivalues.startLoc);
@ -109,7 +108,7 @@ editor_materialpanel_wrapper = function (editor) {
var startLoc = editor.uivalues.startLoc;
editor.uivalues.startLoc = null;
var e=lastmoveE;
var e=editor.uivalues.lastMoveMaterE;
if (!editor.isMobile && e.clientY >= editor.dom.iconLib.offsetHeight - editor.uivalues.scrollBarHeight) return;
var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;

View File

@ -99,7 +99,6 @@ editor_multi = function () {
editor_multi.isString = false;
editor_multi.lintAutocomplete = false;
if (args.lint === true) editor_multi.lintAutocomplete = true;
if (field.indexOf('Effect') !== -1) editor_multi.lintAutocomplete = true;
if ((!input.value || input.value == 'null') && editor_mode.mode == 'plugins')
input.value = '"function () {\\n\\t// 在此增加新插件\\n\\t\\n}"';
if (input.value.slice(0, 1) === '"' || args.string) {

View File

@ -23,8 +23,8 @@ editor_table_wrapper = function (editor) {
editor_table.prototype.checkbox = function (value) {
return /* html */`<input type='checkbox' class='checkbox' ${(value ? 'checked ' : '')}/>\n`
}
editor_table.prototype.textarea = function (value, indent) {
return /* html */`<textarea spellcheck='false'>${JSON.stringify(value, null, indent || 0)}</textarea>\n`
editor_table.prototype.textarea = function (value, indent, disable) {
return /* html */`<textarea spellcheck='false' ${disable ? 'disabled readonly' : ''}>${JSON.stringify(value, null, indent || 0)}</textarea>\n`
}
editor_table.prototype.checkboxSet = function (value, keys, prefixStrings) {
if (value == null) value = [];
@ -76,7 +76,7 @@ editor_table_wrapper = function (editor) {
<td title="${field}">${shortField}</td>
<td title="${commentHTMLescape}" cobj="${cobjstr}">${shortComment || commentHTMLescape}</td>
<td><div class="etableInputDiv ${type}">${tdstr}</div></td>
<td>${editor.table.editGrid(shortComment, type != 'select' && type != 'checkbox' && type != 'checkboxSet')}</td>
<td>${editor.table.editGrid(shortComment, type != 'select' && type != 'checkbox' && type != 'checkboxSet' && type != 'disable')}</td>
</tr>\n`
}
@ -283,7 +283,7 @@ editor_table_wrapper = function (editor) {
case 'checkboxSet':
return editor.table.checkboxSet(thiseval, cobj._checkboxSet.key, cobj._checkboxSet.prefix);
default:
return editor.table.textarea(thiseval, cobj.indent || 0);
return editor.table.textarea(thiseval, cobj.indent || 0, cobj._type == 'disable');
}
}

View File

@ -343,15 +343,15 @@ editor_ui_wrapper = function (editor) {
// Ctrl+C, Ctrl+X, Ctrl+V
if (e.ctrlKey && e.keyCode == 67 && !selectBox.isSelected()) {
e.preventDefault();
editor.uivalues.copyedInfo = editor.copyFromPos();
printf('该点事件已复制');
editor.uivalues.copyedInfo = editor.copyFromPos(editor.uivalues.selectedArea);
printf('该点事件已复制;请注意右键地图拉框可以复制一个区域;若有时复制失灵请多点几下空白处');
return;
}
if (e.ctrlKey && e.keyCode == 88 && !selectBox.isSelected()) {
e.preventDefault();
editor.uivalues.copyedInfo = editor.copyFromPos();
editor.clearPos(true, null, function () {
printf('该点事件已剪切');
editor.uivalues.copyedInfo = editor.copyFromPos(editor.uivalues.selectedArea);
editor.clearPos(true, editor.uivalues.selectedArea, function () {
printf('该点事件已剪切;请注意右键地图拉框可以剪切一个区域;若有时剪切失灵请多点几下空白处');
editor.uifunctions.unhighlightSaveFloorButton();
})
return;
@ -369,7 +369,7 @@ editor_ui_wrapper = function (editor) {
printe(err);
throw (err)
}
; printf('粘贴事件成功');
; printf('粘贴事件成功;若有时粘贴失灵请多点几下空白处');
editor.uifunctions.unhighlightSaveFloorButton();
editor.drawPosSelection();
});
@ -377,8 +377,10 @@ editor_ui_wrapper = function (editor) {
}
// DELETE
if (e.keyCode == 46 && !selectBox.isSelected()) {
editor.clearPos(true);
editor.uifunctions.unhighlightSaveFloorButton();
editor.clearPos(true, editor.uivalues.selectedArea, function () {
printf('该点事件已删除;请注意右键地图拉框可以删除一个区域;;若有时删除失灵请多点几下空白处');
editor.uifunctions.unhighlightSaveFloorButton();
})
return;
}
// ESC

View File

@ -26,7 +26,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
]
},
"_docs": "道具类别",
"_data": "只能取items(宝石、血瓶) constants(永久物品) tools(消耗道具) equips(装备)"
"_data": "items(宝石、血瓶) constants(永久物品) tools(消耗道具) equips(装备)"
},
"name": {
"_leaf": true,
@ -44,8 +44,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"hideInToolbox": {
"_leaf": true,
"_type": "checkbox",
"_docs": "道具栏中隐藏",
"_data": "是否不显示在道具栏中"
"_docs": "不显示在道具栏",
},
"equip": {
"_leaf": true,
@ -57,7 +56,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_leaf": true,
"_type": "checkbox",
"_docs": "回放不绘制道具栏",
"_data": "是否回放时不绘制道具栏。\n如果此项为true则在回放录像时使用本道具将不会绘制道具栏页面而是直接使用。\n此项建议在会频繁连续多次使用的道具开启(如开启技能,或者《镜子》那样的镜像切换等等)"
"_data": "此项建议在会频繁连续多次使用的道具开启(如开启技能,或者《镜子》那样的镜像切换等等)"
}
}
},
@ -73,7 +72,6 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_lint": true,
"_docs": "即捡即用提示",
"_data": "即捡即用类物品在获得时提示的文字仅对cls为items有效。"
},
@ -82,7 +80,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_type": "event",
"_event": "item",
"_docs": "碰触或使用事件",
"_data": "碰触或使用本道具所执行的事件"
"_data": "碰触或使用本道具所执行的事件对所有cls有效"
},
"useItemEffect": {
"_leaf": true,
@ -97,7 +95,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_type": "textarea",
"_string": true,
"_lint": true,
"_docs": "能否使用条件",
"_docs": "能否使用",
"_data": "当前能否使用该道具仅对cls为tools或constants有效。"
},
"equipCondition": {
@ -105,12 +103,12 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_type": "textarea",
"_string": true,
"_lint": true,
"_docs": "能否装备条件",
"_docs": "能否装备",
"_data": "能装备某个装备的条件仅对cls为equips有效。\n与canUseItemEffect不同这里null代表可以装备。"
}
}
},
"items_template": { 'cls': 'items', 'name': '新物品', 'canPass': true },
"items_template": { 'cls': 'items', 'name': '新物品' },
// --------------------------- 【怪物】相关的表格配置 --------------------------- //
@ -128,7 +126,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_type": "textarea",
"_string": true,
"_docs": "手册映射ID",
"_data": "在怪物手册中映射到的怪物ID。如果此项不为null则在怪物手册中将用目标ID来替换该怪物原本的ID。\n此项应被运用在同一个怪物的多朝向上。\n例如如果想定义同一个怪物的向下和向左的行走图则需要建立两个属性完全相同的怪物。\n但是这样会导致在怪物手册中同时存在向下和向左的两种怪物的显示。\n可以将朝向左的怪物的displayIdInBook项指定为朝向下的怪物ID这样在怪物手册中则会归一化只显示一个。"
"_data": "在怪物手册中映射到的怪物ID。如果此项不为null则在怪物手册中将用目标ID来替换该怪物原本的ID。常被运用在同一个怪物的多朝向上。"
},
"hp": {
"_leaf": true,
@ -182,7 +180,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"value": {
"_leaf": true,
"_type": "textarea",
"_docs": "特殊属性值",
"_docs": "特殊属性值",
"_data": "特殊属性的数值\n如领域/阻激/激光怪的伤害值;吸血怪的吸血比例;光环怪增加生命的比例"
},
"zoneSquare": {
@ -201,7 +199,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"notBomb": {
"_leaf": true,
"_type": "checkbox",
"_docs": "是否不可炸",
"_docs": "不可炸",
"_data": "该怪物不可被炸"
},
"n": {
@ -214,21 +212,21 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"add": {
"_leaf": true,
"_type": "checkbox",
"_docs": "吸血加自身",
"_docs": "吸血加自身",
"_data": "吸血后是否加到自身;光环是否叠加"
},
"atkValue": {
"_leaf": true,
"_type": "textarea",
"_range": "thiseval==~~thiseval||thiseval==null",
"_docs": "退化扣攻击",
"_docs": "退化扣攻击",
"_data": "退化时勇士下降的攻击力点数;光环怪增加攻击的比例"
},
"defValue": {
"_leaf": true,
"_type": "textarea",
"_range": "thiseval==~~thiseval||thiseval==null",
"_docs": "退化扣防御",
"_docs": "退化扣防御",
"_data": "退化时勇士下降的防御力点数;光环怪增加防御的比例"
},
"damage": {
@ -249,20 +247,20 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_data": {
"id": {
"_leaf": true,
"_type": "textarea",
"_type": "disable",
"_range": "false",
"_docs": "图块ID",
"_data": "图块唯一ID可在页面底部修改"
},
"idnum": {
"_leaf": true,
"_type": "textarea",
"_type": "disable",
"_range": "false",
"_data": "图块数字"
},
"cls": {
"_leaf": true,
"_type": "textarea",
"_type": "disable",
"_range": "false",
"_data": "图块类别"
},
@ -291,7 +289,6 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_leaf": true,
"_type": "checkbox",
"_docs": "可通行性",
"_data": "该图块是否可以通行true代表可以通行false代表不可通行"
},
"script": {
"_leaf": true,
@ -309,7 +306,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"key":["up","down","left","right"]
},
"_docs": "不可出方向",
"_data": "该图块的不可出方向\n可以在这里定义在该图块时不能前往哪个方向,可以达到悬崖之类的效果\n例如 [\"up\", \"left\"] 代表在该图块时不能往上和左走\n此值对背景层、事件层、前景层上的图块均有效"
"_data": "该图块的不可出方向\n对背景层、事件层、前景层上的图块均有效"
},
"cannotIn": {
"_leaf": true,
@ -319,7 +316,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"key":["up","down","left","right"]
},
"_docs": "不可入方向",
"_data": "该图块的不可入方向\n可以在这里定义不能朝哪个方向进入该图块,可以达到悬崖之类的效果\n例如 [\"down\"] 代表不能从该图块的上方点朝向下进入此图块\n此值对背景层、事件层、前景层上的图块均有效"
"_data": "该图块的不可入方向\n对背景层、事件层、前景层上的图块均有效"
},
"canBreak": {
"_leaf": true,
@ -329,24 +326,26 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
},
"animate": {
"_leaf": true,
"_type": "textarea",
"_range": "thiseval==~~thiseval||thiseval==null",
"_type": "select",
"_select": {
"values": [1,2,3,4],
},
"_docs": "动画帧数",
"_data": "该图块的全局动画帧数。\n如果此项为null则对于除了npc48外使用素材默认帧数npc48默认是1帧即静止。"
"_data": "null代表素材默认帧数"
},
"doorInfo": {
"_leaf": true,
"_type": "event",
"_event": "doorInfo",
"_docs": "门信息",
"_data": "该图块的门信息,是一个四元数组。\n第一项为所需要的钥匙信息第二项为开关门的毫秒数第三项为开此门时的音效第四项为关此门时的音效。仅对animates生效。"
"_data": "该图块的门信息,仅对animates和npc48生效。"
},
"faceIds": {
"_leaf": true,
"_type": "event",
"_event": "faceIds",
"_docs": "行走图朝向",
"_data": "行走图朝向,仅对NPC有效。可以在这里定义同一个NPC的多个朝向行走图。\n比如 {\"up\":\"N333\",\"down\":\"N334\",\"left\":\"N335\",\"right\":\"N336\"} 就将该素材的上下左右朝向分别绑定到N333,N334,N335和N336四个图块。\n在勇士撞上NPC时或NPC在移动时会自动选择最合适的朝向图块如果存在定义来进行绘制。"
"_data": "行走图朝向,仅对npc48有效。在勇士撞上NPC时或NPC在移动时会自动选择最合适的朝向图块如果存在定义来进行绘制。"
}
}
},
@ -361,15 +360,15 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_data": {
"floorId": {
"_leaf": true,
"_type": "textarea",
"_type": "disable",
"_range": "false",
"_docs": "楼层ID",
"_data": "文件名和floorId需要保持完全一致可在页面底部修改 \n楼层唯一标识符仅能由字母、数字、下划线组成且不能由数字开头 \n推荐用法第20层就用MT20第38层就用MT38地下6层就用MT_6用下划线代替负号隐藏3层用MT3hh表示隐藏等等"
"_data": "文件名和floorId需要保持完全一致可在页面底部修改"
},
"title": {
"_leaf": true,
"_type": "textarea",
"_docs": "楼层中文名",
"_docs": "楼层名",
"_data": "楼层中文名,将在切换楼层和浏览地图时显示"
},
"name": {
@ -380,17 +379,17 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
},
"width": {
"_leaf": true,
"_type": "textarea",
"_type": "disable",
"_range": "false",
"_docs": "宽度",
"_data": "地图x方向大小,请在表格最下方修改,null视为13"
"_data": "地图x方向大小,请在表格最下方修改"
},
"height": {
"_leaf": true,
"_type": "textarea",
"_type": "disable",
"_range": "false",
"_docs": "高度",
"_data": "地图y方向大小,请在表格最下方修改,null视为13"
"_data": "地图y方向大小,请在表格最下方修改"
},
"canFlyTo": {
"_leaf": true,
@ -462,8 +461,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_leaf": true,
"_type": "event",
"_event": "floorImage",
"_docs": "楼层贴图",
"_data": "背景/前景图;你可以选择若干张图片来作为背景/前景素材。详细用法请参见文档“自定义素材”中的说明。"
"_docs": "楼层贴图"
},
"color": {
"_leaf": true,
@ -484,9 +482,9 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"values": [null].concat(Object.keys(editor.core.material.bgms))
},
"_docs": "背景音乐",
"_data": "到达该层后默认播放的BGM。本项可忽略,或者为一个定义过的背景音乐如\"bgm.mp3\"。"
"_data": "到达该层后默认播放的BGM"
},
"item_ratio": {
"ratio": {
"_leaf": true,
"_type": "textarea",
"_range": "(thiseval==~~thiseval && thiseval>=0)||thiseval==null",
@ -583,7 +581,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"cannotViewMap": false,
"cannotMoveDirectly": false,
"images": [],
"item_ratio": 1,
"ratio": 1,
"defaultGround": "ground",
"bgm": null,
"upFloor": null,

View File

@ -27,7 +27,7 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
return one;
return null;
}).toString(),
"_docs": "本塔使用图片",
"_docs": "使用图片",
"_data": "在此存放所有可能使用的图片tilesets除外 \n图片可以被作为背景图的一部分也可以直接用自定义事件进行显示。 \n 图片名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好 \n 建议对于较大的图片,在网上使用在线的“图片压缩工具(http://compresspng.com/zh/)”来进行压缩,以节省流量 \n 依次向后添加",
},
"tilesets": {
@ -50,7 +50,7 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
return j >= 0 ? 1 : -1;
});
}).toString(),
"_docs": "本塔额外素材",
"_docs": "额外素材",
"_data": "在此存放额外素材的图片名, \n可以自定导入任意张素材图片无需PS无需注册即可直接在游戏中使用 \n 形式如[\"1.png\", \"2.png\"] ,将需要的素材图片放在images目录下 \n 素材的宽高必须都是32的倍数且图片上的总图块数不超过1000即最多有1000个32*32的图块在该图片上"
},
"animates": {
@ -62,7 +62,7 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
if (one.endsWith(".animate")) return one.substring(0, one.lastIndexOf('.'));
return null;
}).toString(),
"_docs": "本塔使用动画",
"_docs": "使用动画",
"_data": "在此存放所有可能使用的动画必须是animate格式在这里不写后缀名 \n动画必须放在animates目录下文件名不能使用中文不能带空格或特殊字符 \n \"jianji\", \"thunder\" 根据需求自行添加"
},
"bgms": {
@ -75,7 +75,7 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
return one;
return null;
}).toString(),
"_docs": "本塔使用音乐",
"_docs": "使用音乐",
"_data": "在此存放所有的bgm和文件名一致。 \n音频名不能使用中文不能带空格或特殊字符可以直接改名拼音就好"
},
"sounds": {
@ -88,7 +88,7 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
return one;
return null;
}).toString(),
"_docs": "本塔使用音效",
"_docs": "使用音效",
"_data": "在此存放所有的SE和文件名一致 \n音频名不能使用中文不能带空格或特殊字符可以直接改名拼音就好"
},
"fonts": {
@ -100,13 +100,13 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
if (one.endsWith(".ttf")) return one.substring(0, one.lastIndexOf('.'));
return null;
}).toString(),
"_docs": "本塔使用字体",
"_docs": "使用字体",
"_data": "在此存放所有可能使用的字体 \n 字体名不能使用中文,不能带空格或特殊字符"
},
"nameMap": {
"_leaf": true,
"_type": "textarea",
"_docs": "文件映射",
"_docs": "文件映射",
"_data": "文件名映射目前仅对images, animates, bgms, sounds有效。\n例如定义 {\"精灵石.mp3\":\"jinglingshi.mp3\"} 就可以使用\ncore.playBgm(\"精灵石.mp3\") 或对应的事件来播放该bgm。"
},
"startBackground": {
@ -157,21 +157,21 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_docs": "横状态栏",
"_docs": "横状态栏",
"_data": "横屏时左侧状态栏的背景样式,可以定义背景图、平铺方式等。\n具体请网上搜索\"css background\"了解写法。\n如果弄一张图片作为背景图推荐写法\n\"url(project/images/XXX.png) 0 0/100% 100% no-repeat\"\n图片最好进行一些压缩等操作节省流量。"
},
"statusTopBackground": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_docs": "竖状态栏",
"_docs": "竖状态栏",
"_data": "竖屏时上方状态栏的背景样式,可以定义背景图、平铺方式等。\n具体请网上搜索\"css background\"了解写法。\n如果弄一张图片作为背景图推荐写法\n\"url(project/images/XXX.png) 0 0/100% 100% no-repeat\"\n图片最好进行一些压缩等操作节省流量。"
},
"toolsBackground": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_docs": "竖工具栏",
"_docs": "竖工具栏",
"_data": "竖屏时下方工具栏的背景样式,可以定义背景图、平铺方式等。\n具体请网上搜索\"css background\"了解写法。\n如果弄一张图片作为背景图推荐写法\n\"url(project/images/XXX.png) 0 0/100% 100% no-repeat\"\n图片最好进行一些压缩等操作节省流量。"
},
"borderColor": {
@ -192,14 +192,14 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_docs": "转场背景",
"_docs": "转场背景",
"_data": "楼层转换界面的背景样式可以使用纯色默认值black也可以使用图片参见状态栏的图片写法"
},
"floorChangingTextColor": {
"_leaf": true,
"_type": "textarea",
"_string": true,
"_docs": "转场文字",
"_docs": "转场文字",
"_data": "楼层转换界面的文字颜色,默认是白色"
},
"font": {
@ -257,7 +257,13 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
return name.endsWith('.png');
}))
},
"_data": "勇士行走图"
"_data": "行走图"
},
"animate": {
"_leaf": true,
"_type": "checkbox",
"_docs": "帧动画",
"_data": "是否开启停止状态和对话框的帧动画"
},
"name": {
"_leaf": true,
@ -344,7 +350,7 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_leaf": true,
"_type": "textarea",
"_range": "thiseval instanceof Object && !(thiseval instanceof Array)",
"_docs": "初始装备个数",
"_docs": "初始拥有装备个数",
"_data": "初始装备个数,例如初始送铁剑可以写 {\"sword1\": 1}"
}
}
@ -385,13 +391,12 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
},
"followers": {
"_leaf": true,
"_type": "textarea",
"_range": "thiseval instanceof Array",
"_data": "跟随者列表"
"_type": "disable",
"_data": "跟随者"
},
"steps": {
"_leaf": true,
"_type": "textarea",
"_type": "disable",
"_data": "行走步数"
}
}
@ -401,7 +406,7 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_type": "event",
"_event": "firstArrive",
"_range": "thiseval==null || thiseval instanceof Array",
"_docs": "标题事件",
"_docs": "标题事件",
"_data": "标题界面事件化,可以使用事件流的形式来绘制开始界面等。\n需要开启startUsingCanvas这个开关。\n详见文档-个性化-标题界面事件化。"
},
"startText": {
@ -452,43 +457,43 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"redGem": {
"_leaf": true,
"_type": "textarea",
"_docs": "红宝石效果",
"_docs": "红宝石",
"_data": "红宝石加攻击的数值"
},
"blueGem": {
"_leaf": true,
"_type": "textarea",
"_docs": "蓝宝石效果",
"_docs": "蓝宝石",
"_data": "蓝宝石加防御的数值"
},
"greenGem": {
"_leaf": true,
"_type": "textarea",
"_docs": "绿宝石效果",
"_docs": "绿宝石",
"_data": "绿宝石加护盾的数值"
},
"redPotion": {
"_leaf": true,
"_type": "textarea",
"_docs": "红血瓶效果",
"_docs": "红血瓶",
"_data": "红血瓶加血数值"
},
"bluePotion": {
"_leaf": true,
"_type": "textarea",
"_docs": "蓝血瓶效果",
"_docs": "蓝血瓶",
"_data": "蓝血瓶加血数值"
},
"yellowPotion": {
"_leaf": true,
"_type": "textarea",
"_docs": "黄血瓶效果",
"_docs": "黄血瓶",
"_data": "黄血瓶加血数值"
},
"greenPotion": {
"_leaf": true,
"_type": "textarea",
"_docs": "绿血瓶效果",
"_docs": "绿血瓶",
"_data": "绿血瓶加血数值"
},
"breakArmor": {
@ -518,14 +523,16 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"animateSpeed": {
"_leaf": true,
"_type": "textarea",
"_docs": "全局动画时间",
"_data": "全局动画时间即怪物振动频率一般300比较合适"
"_docs": "全局动画时间",
"_data": "全局动画时间即怪物振动频率一般300比较合适"
},
"statusCanvasRowsOnMobile": {
"_leaf": true,
"_type": "textarea",
"_range": "thiseval==null || (thiseval>0 && thiseval<=4)",
"_docs": "竖屏自绘行数",
"_type": "select",
"_select": {
"values": [1,2,3,4]
},
"_docs": "竖状态栏自绘行数",
"_data": "竖屏模式下顶端状态栏canvas化后的行数。\n此项将决定竖屏的状态栏高度如果设置则不小于1且不大于4。\n仅在statusCanvas开启时才有效"
},
}
@ -578,36 +585,36 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"enableSkill"
]
},
"_data": "状态栏显示"
"_data": "状态栏显示"
},
"flyNearStair": {
"_leaf": true,
"_type": "checkbox",
"_docs": "楼传楼梯边",
"_docs": "楼传需在楼梯边",
"_data": "传送器是否需要在楼梯边使用如果flyRecordPosition开启则此项对箭头也有效。"
},
"flyRecordPosition": {
"_leaf": true,
"_type": "checkbox",
"_docs": "楼传平面模式",
"_docs": "楼传平面模式",
"_data": "传送器平面塔模式;此模式下楼层传送器将飞到上次离开该楼层的位置。"
},
"steelDoorWithoutKey": {
"_leaf": true,
"_type": "checkbox",
"_docs": "铁门不消耗",
"_docs": "铁门不消耗钥匙",
"_data": "铁门是否不需要钥匙开启。如果此项为true则无需钥匙也可以开铁门。"
},
"itemFirstText": {
"_leaf": true,
"_type": "checkbox",
"_docs": "首次道具提示",
"_docs": "首次道具进行提示",
"_data": "首次获得道具是否提示"
},
"equipboxButton": {
"_leaf": true,
"_type": "checkbox",
"_docs": "状态栏装备",
"_docs": "状态栏装备按钮",
"_data": "状态栏的装备按钮。若此项为true则将状态栏中的楼层转换器按钮换为装备栏按钮"
},
"enableAddPoint": {
@ -625,7 +632,7 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"betweenAttackMax": {
"_leaf": true,
"_type": "checkbox",
"_docs": "夹击不超伤害",
"_docs": "夹击不超伤害",
"_data": "夹击伤害是否不超过怪物伤害值。"
},
"useLoop": {
@ -637,13 +644,13 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"startUsingCanvas": {
"_leaf": true,
"_type": "checkbox",
"_docs": "标题事件化",
"_docs": "标题开启事件化",
"_data": "是否开始菜单canvas化如果此项为true则将使用canvas来绘制开始菜单"
},
"statusCanvas": {
"_leaf": true,
"_type": "checkbox",
"_docs": "自绘状态栏",
"_docs": "开启自绘状态栏",
"_data": "是否状态栏canvas化即手动自定义绘制状态栏。\n如果此项开启则可在脚本编辑的drawStatusBar中自定义绘制菜单栏。"
},
"displayEnemyDamage": {

View File

@ -614,7 +614,7 @@
<script src="_server/blockly/blocks_compressed.js"></script>
<script src="_server/blockly/javascript_compressed.js"></script>
<script src="_server/blockly/zh-hans.js"></script>
<script src='_server/MotaActionParse.js'></script>
<script src='_server/MotaActionParser.js'></script>
<script src='_server/editor_blocklyconfig.js'></script>
<script src='_server/editor_blockly.js'></script>
<!-- codemirror -->

View File

@ -598,7 +598,7 @@
<script src="_server/blockly/blocks_compressed.js"></script>
<script src="_server/blockly/javascript_compressed.js"></script>
<script src="_server/blockly/zh-hans.js"></script>
<script src='_server/MotaActionParse.js'></script>
<script src='_server/MotaActionParser.js'></script>
<script src='_server/editor_blocklyconfig.js'></script>
<script src='_server/editor_blockly.js'></script>
<!-- codemirror -->

View File

@ -2068,15 +2068,17 @@ actions.prototype._keyUpSwitchs = function (keycode) {
}
if (keycode == 37) {
switch (core.status.event.selection) {
case 2: return this._clickSwitchs_userVolume(-1);
case 3: return this._clickSwitchs_moveSpeed(-10);
case 4: this._clickSwitchs_floorChangeTime(-100);
case 1: return this._clickSwitchs_userVolume(-1);
case 2: return this._clickSwitchs_moveSpeed(-10);
case 3: return this._clickSwitchs_floorChangeTime(-100);
case 4: return this._clickSwitchs_setSize(-1);
}
} else if (keycode == 39) {
switch (core.status.event.selection) {
case 2: return this._clickSwitchs_userVolume(1);
case 3: return this._clickSwitchs_moveSpeed(10);
case 4: this._clickSwitchs_floorChangeTime(100);
case 1: return this._clickSwitchs_userVolume(1);
case 2: return this._clickSwitchs_moveSpeed(10);
case 3: return this._clickSwitchs_floorChangeTime(100);
case 4: return this._clickSwitchs_setSize(1);
}
}
this._selectChoices(core.status.event.ui.choices.length, keycode, this._clickSwitchs);

View File

@ -146,6 +146,11 @@ control.prototype._animationFrame_globalAnimate = function (timestamp) {
core.status.autotileAnimateObjs.blocks.forEach(function (block) {
core.maps._drawAutotileAnimate(block, core.status.globalAnimateStatus);
});
// Global hero animate
if ((core.status.hero || {}).animate && core.status.heroMoving == 0) {
core.drawHero('stop', null, core.status.globalAnimateStatus);
}
}
// Box animate
core.drawBoxAnimate();
@ -768,7 +773,7 @@ control.prototype.tryMoveDirectly = function (destX, destY) {
}
////// 绘制勇士 //////
control.prototype.drawHero = function (status, offset) {
control.prototype.drawHero = function (status, offset, frame) {
if (!core.isPlaying() || !core.status.floorId || core.status.gameOver) return;
var x = core.getHeroLoc('x'), y = core.getHeroLoc('y'), direction = core.getHeroLoc('direction');
status = status || 'stop';
@ -783,7 +788,7 @@ control.prototype.drawHero = function (status, offset) {
core.status.heroCenter.py = 32 * y + offsetY + 32 - core.material.icons.hero.height / 2;
if (!core.hasFlag('hideHero')) {
this._drawHero_draw(direction, x, y, status, offset);
this._drawHero_draw(direction, x, y, status, offset, frame);
}
this._drawHero_updateViewport();
@ -794,9 +799,9 @@ control.prototype._drawHero_updateViewport = function () {
core.setGameCanvasTranslate('hero', 0, 0);
}
control.prototype._drawHero_draw = function (direction, x, y, status, offset) {
control.prototype._drawHero_draw = function (direction, x, y, status, offset, frame) {
this._drawHero_getDrawObjs(direction, x, y, status, offset).forEach(function (block) {
core.drawImage('hero', block.img, block.heroIcon[block.status]*block.width,
core.drawImage('hero', block.img, (block.heroIcon[block.status] + (frame || 0))%4*block.width,
block.heroIcon.loc * block.height, block.width, block.height,
block.posx+(32-block.width)/2, block.posy+32-block.height, block.width, block.height);
});
@ -2691,7 +2696,7 @@ control.prototype.resize = function() {
core.domStyle.isVertical = false;
core.domStyle.availableScale = [];
[1, 1.25, 1.5, 2].forEach(function (v) {
[1, 1.25, 1.5, 1.75, 2].forEach(function (v) {
if (clientWidth - 3 * BORDER >= v*(CANVAS_WIDTH + BAR_WIDTH) && clientHeight - 2 * BORDER >= v * CANVAS_WIDTH) {
core.domStyle.availableScale.push(v); // 64x64
}

View File

@ -31,7 +31,6 @@ items.prototype.getItemEffect = function (itemId, itemNum) {
var itemCls = core.material.items[itemId].cls;
// 消耗品
if (itemCls === 'items') {
var ratio = parseInt(core.status.thisMap.item_ratio) || 1;
var curr_hp = core.status.hero.hp;
if (itemId in this.itemEffect) {
try {
@ -64,10 +63,9 @@ items.prototype.getItemEffectTip = function (itemId) {
var itemCls = core.material.items[itemId].cls;
// 消耗品
if (itemCls === 'items') {
var ratio = parseInt(core.status.thisMap.item_ratio) || 1;
if (itemId in this.itemEffectTip) {
try {
return eval(this.itemEffectTip[itemId]) || "";
return core.replaceText(this.itemEffectTip[itemId]) || "";
} catch (e) {
main.log(e);
return "";
@ -95,7 +93,6 @@ items.prototype.useItem = function (itemId, noRoute, callback) {
items.prototype._useItemEffect = function (itemId) {
if (itemId in this.useItemEffect) {
try {
var ratio = parseInt(core.status.thisMap.item_ratio) || 1;
eval(this.useItemEffect[itemId]);
}
catch (e) {

View File

@ -1400,10 +1400,18 @@ ui.prototype._drawTextBox_drawTitleAndIcon = function (titleInfo, hPos, vPos, al
core.status.boxAnimateObjs = [];
// --- 勇士
if (titleInfo.image == core.material.images.hero) {
core.clearMap('ui', hPos.left + 15, image_top, 32, titleInfo.height);
core.fillRect('ui', hPos.left + 15, image_top, 32, titleInfo.height, core.material.groundPattern);
core.drawImage('ui', titleInfo.image, 0, 0, core.material.icons.hero.width || 32, core.material.icons.hero.height,
hPos.left + 15, image_top, 32, titleInfo.height);
if (core.status.hero.animate) {
core.status.boxAnimateObjs.push({
'bgx': hPos.left + 15, 'bgy': image_top, 'bgWidth': 32, 'bgHeight': titleInfo.height,
'x': hPos.left + 15, 'y': image_top, 'height': titleInfo.height, 'animate': 4,
'image': titleInfo.image, 'pos': core.material.icons.hero[core.getHeroLoc('direction')].loc * titleInfo.height
})
} else {
core.clearMap('ui', hPos.left + 15, image_top, 32, titleInfo.height);
core.fillRect('ui', hPos.left + 15, image_top, 32, titleInfo.height, core.material.groundPattern);
core.drawImage('ui', titleInfo.image, 0, 0, core.material.icons.hero.width || 32, core.material.icons.hero.height,
hPos.left + 15, image_top, 32, titleInfo.height);
}
}
else {
core.status.boxAnimateObjs.push({
@ -2836,7 +2844,6 @@ ui.prototype._drawStatistics_items = function (floorId, floor, id, obj) {
if (obj.cls[id]=='items' && id!='superPotion') {
var temp = core.clone(core.status.hero);
core.setFlag("__statistics__", true);
var ratio = floor.item_ratio||1;
try { eval(core.items.itemEffect[id]); }
catch (e) {}
hp = core.status.hero.hp - temp.hp;

View File

@ -90,6 +90,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"floorId": "sample0",
"hero": {
"image": "hero.png",
"animate": false,
"name": "阳光",
"lv": 1,
"hpmax": 9999,

View File

@ -8,7 +8,7 @@ main.floors.MT0=
"cannotViewMap": false,
"defaultGround": "ground",
"images": [],
"item_ratio": 1,
"ratio": 1,
"map": [
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],

View File

@ -8,7 +8,7 @@ main.floors.sample0=
"defaultGround": "ground",
"images": [],
"bgm": "bgm.mp3",
"item_ratio": 1,
"ratio": 1,
"map": [
[ 0, 0,220, 0, 0, 20, 87, 3, 65, 64, 44, 43, 42],
[ 0,246, 0,246, 0, 20, 0, 3, 58, 59, 60, 61, 41],

View File

@ -20,7 +20,7 @@ main.floors.sample1=
"snow",
6
],
"item_ratio": 1,
"ratio": 1,
"map": [
[ 7,131, 8,152, 9,130, 10,152,166,165,132,165,166],
[ 0, 0, 0, 0, 0, 0, 0,152,165,164, 0,162,165],

View File

@ -8,7 +8,7 @@ main.floors.sample2=
"cannotViewMap": false,
"defaultGround": "ground",
"images": [],
"item_ratio": 1,
"ratio": 1,
"map": [
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],

View File

@ -18,7 +18,7 @@ main.floors.sample3=
10
],
"bgm": "bgm.mp3",
"item_ratio": 1,
"ratio": 1,
"map": [
[ 5, 5, 5, 5, 5, 5, 87, 5, 5, 5, 5, 5, 5],
[ 5, 4, 4, 4, 4, 1, 0, 1, 4, 4, 4, 4, 5],

View File

@ -22,17 +22,17 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"redGem": {
"cls": "items",
"name": "红宝石",
"text": "'攻击+${core.values.redGem}'"
"text": "攻击+${core.values.redGem}"
},
"blueGem": {
"cls": "items",
"name": "蓝宝石",
"text": "',防御+${core.values.blueGem}'"
"text": ",防御+${core.values.blueGem}"
},
"greenGem": {
"cls": "items",
"name": "绿宝石",
"text": "',护盾+${core.values.greenGem}'"
"text": ",护盾+${core.values.greenGem}"
},
"yellowGem": {
"cls": "items",
@ -42,22 +42,22 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"redPotion": {
"cls": "items",
"name": "红血瓶",
"text": "',生命+${core.values.redPotion}'"
"text": ",生命+${core.values.redPotion}"
},
"bluePotion": {
"cls": "items",
"name": "蓝血瓶",
"text": "',生命+${core.values.bluePotion}'"
"text": ",生命+${core.values.bluePotion}"
},
"yellowPotion": {
"cls": "items",
"name": "黄血瓶",
"text": "',生命+${core.values.yellowPotion'}"
"text": ",生命+${core.values.yellowPotion}"
},
"greenPotion": {
"cls": "items",
"name": "绿血瓶",
"text": "',生命+${core.values.greenPotion}'"
"text": ",生命+${core.values.greenPotion}"
},
"sword0": {
"cls": "items",
@ -341,14 +341,14 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
}
},
"itemEffect": {
"redGem": "core.status.hero.atk += core.values.redGem * ratio",
"blueGem": "core.status.hero.def += core.values.blueGem * ratio",
"greenGem": "core.status.hero.mdef += core.values.greenGem * ratio",
"redGem": "core.status.hero.atk += core.values.redGem * core.status.thisMap.ratio",
"blueGem": "core.status.hero.def += core.values.blueGem * core.status.thisMap.ratio",
"greenGem": "core.status.hero.mdef += core.values.greenGem * core.status.thisMap.ratio",
"yellowGem": "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 * ratio",
"bluePotion": "core.status.hero.hp += core.values.bluePotion * ratio",
"yellowPotion": "core.status.hero.hp += core.values.yellowPotion * ratio",
"greenPotion": "core.status.hero.hp += core.values.greenPotion * ratio",
"redPotion": "core.status.hero.hp += core.values.redPotion * core.status.thisMap.ratio",
"bluePotion": "core.status.hero.hp += core.values.bluePotion * core.status.thisMap.ratio",
"yellowPotion": "core.status.hero.hp += core.values.yellowPotion * core.status.thisMap.ratio",
"greenPotion": "core.status.hero.hp += core.values.greenPotion * core.status.thisMap.ratio",
"sword0": "core.status.hero.atk += 0",
"sword1": "core.status.hero.atk += 10",
"sword2": "core.status.hero.atk += 20",
@ -366,29 +366,29 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"silverCoin": "core.status.hero.money += 500"
},
"itemEffectTip": {
"redGem": "',攻击+'+core.values.redGem * ratio",
"blueGem": "',防御+'+core.values.blueGem * ratio",
"greenGem": "',护盾+'+core.values.greenGem * ratio",
"yellowGem": "',全属性提升'",
"redPotion": "',生命+'+core.values.redPotion * ratio",
"bluePotion": "',生命+'+core.values.bluePotion * ratio",
"yellowPotion": "',生命+'+core.values.yellowPotion * ratio",
"greenPotion": "',生命+'+core.values.greenPotion * ratio",
"sword0": "',攻击+0'",
"sword1": "',攻击+10'",
"sword2": "',攻击+20'",
"sword3": "',攻击+40'",
"sword4": "',攻击+80'",
"sword5": "',攻击+100'",
"shield0": "',防御+0'",
"shield1": "',防御+10'",
"shield2": "',防御+20'",
"shield3": "',防御+40'",
"shield4": "',防御+80'",
"shield5": "',防御+100护盾+100'",
"bigKey": "',全钥匙+1'",
"superPotion": "',生命值翻倍'",
"silverCoin": "',金币+500'"
"redGem": ",攻击+${core.values.redGem * core.status.thisMap.ratio}",
"blueGem": ",防御+${core.values.blueGem * core.status.thisMap.ratio}",
"greenGem": ",护盾+${core.values.greenGem * core.status.thisMap.ratio}",
"yellowGem": ",全属性提升",
"redPotion": ",生命+${core.values.redPotion * core.status.thisMap.ratio}",
"bluePotion": ",生命+${core.values.bluePotion * core.status.thisMap.ratio}",
"yellowPotion": ",生命+${core.values.yellowPotion * core.status.thisMap.ratio}",
"greenPotion": ",生命+${core.values.greenPotion * core.status.thisMap.ratio}",
"sword0": ",攻击+0",
"sword1": ",攻击+10",
"sword2": ",攻击+20",
"sword3": ",攻击+40",
"sword4": ",攻击+80",
"sword5": ",攻击+100",
"shield0": ",防御+0",
"shield1": ",防御+10",
"shield2": ",防御+20",
"shield3": ",防御+40",
"shield4": ",防御+80",
"shield5": ",防御+100护盾+100",
"bigKey": ",全钥匙+1",
"superPotion": ",生命值翻倍",
"silverCoin": ",金币+500"
},
"useItemEffect": {
"book": "core.ui.drawBook(0);",

View File

@ -103,10 +103,10 @@ var maps_90f36752_8815_4be8_b32b_d7fad1d0542e =
"130": {"cls":"npcs","id":"expShop"},
"131": {"cls":"npcs","id":"moneyShop"},
"132": {"cls":"npcs","id":"princess"},
"133": {"cls":"npc48","id":"npc0","faceIds":{"down":"npc0","left":"npc1","right":"npc2","up":"npc3"}},
"134": {"cls":"npc48","id":"npc1","faceIds":{"down":"npc0","left":"npc1","right":"npc2","up":"npc3"}},
"135": {"cls":"npc48","id":"npc2","faceIds":{"down":"npc0","left":"npc1","right":"npc2","up":"npc3"}},
"136": {"cls":"npc48","id":"npc3","faceIds":{"down":"npc0","left":"npc1","right":"npc2","up":"npc3"}},
"133": {"cls":"npc48","id":"npc0","faceIds":{"down":"npc0","left":"npc1","right":"npc2","up":"npc3"},"animate":1},
"134": {"cls":"npc48","id":"npc1","faceIds":{"down":"npc0","left":"npc1","right":"npc2","up":"npc3"},"animate":1},
"135": {"cls":"npc48","id":"npc2","faceIds":{"down":"npc0","left":"npc1","right":"npc2","up":"npc3"},"animate":1},
"136": {"cls":"npc48","id":"npc3","faceIds":{"down":"npc0","left":"npc1","right":"npc2","up":"npc3"},"animate":1},
"137": {"cls":"npcs","id":"greenMan"},
"138": {"cls":"npcs","id":"blueTrader"},
"139": {"cls":"npcs","id":"redMSNpc"},

8
runtime.d.ts vendored
View File

@ -42,7 +42,7 @@ type Animate = {
type Floor = {
title: string,
item_ratio: number
ratio: number
}
type ResolvedMap = {
@ -651,9 +651,9 @@ declare class events {
/**
*
* @example core.setFloorInfo('item_ratio', 2, 'MT0'); // 把主塔0层的血瓶和宝石变为双倍效果
* @param name 'title','name','canFlyTo','canUseQuickShop','cannotViewMap','cannotMoveDirectly','upFloor','downFloor','defaultGround','images','color','weather','bgm','item_ratio','underGround'
* @param values 'title''name''defaultGround''bgm''underGround''canXxx''xxxFloor''item_ratio'
* @example core.setFloorInfo('ratio', 2, 'MT0'); // 把主塔0层的血瓶和宝石变为双倍效果
* @param name 'title','name','canFlyTo','canUseQuickShop','cannotViewMap','cannotMoveDirectly','upFloor','downFloor','defaultGround','images','color','weather','bgm','ratio','underGround'
* @param values 'title''name''defaultGround''bgm''underGround''canXxx''xxxFloor''ratio'
* @param floorId id
* @param prefix
*/

View File

@ -64,10 +64,10 @@
(已完成!) 右键图块选择复制/粘贴事件
(已完成!) showImage, drawImage立绘等加上对称选项
(已完成!) 更多的图块blockly化
勇士帧
怪物名和特殊属性自动缩小
行走动画?
(已完成!) 勇士帧动
(不处理;现在静止状态可以有帧动画了,所以不考虑行走过程动画) 行走动画
合并main中一些设置内容
\t[this], 勇士朝下flag:arg清理瞬移扣血
-------------

View File

@ -89,4 +89,6 @@ V2.6.6 -> V2.7 接档说明:
其他:
Jewel改名Gem
道具效果提示文字replaceText