Support Callback in Editor

This commit is contained in:
oc committed 2018-03-05 19:37:21 +08:00
1 parent 3ca7c95231
commit 66117ebf08
16 files changed
+84 -137

No files matched your search

+1 -1
View File
@@ -1 +1 @@
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=32)}([function(t,e){function n(t){return"["+t.join(", ")+"]"}function r(t,e){return t.equals(e)}function i(t){return t.hashCode()}function o(t,e){return this.data={},this.hashFunction=t||i,this.equalsFunction=e||r,this}function s(){return this.data=[],this}function a(t,e){return this.data={},this.hashFunction=t||i,this.equalsFunction=e||r,this}function l(){return this.data={},this}function u(){return this}function c(){return this.count=0,this.hash=0,this}String.prototype.seed=String.prototype.seed||Math.round(Math.random()*Math.pow(2,32)),String.prototype.hashCode=function(){var t,e,n,r,i,o,s,a,l=this.toString();for(t=3&l.length,e=l.length-t,n=String.prototype.seed,i=3432918353,o=461845907,a=0;a<e;)s=255&l.charCodeAt(a)|(255&l.charCodeAt(++a))<<8|(255&l.charCodeAt(++a))<<16|(255&l.charCodeAt(++a))<<24,++a,n=27492+(65535&(r=5*(65535&(n=(n^=s=(65535&(s=(s=(65535&s)*i+(((s>>>16)*i&65535)<<16)&4294967295)<<15|s>>>17))*o+(((s>>>16)*o&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(r>>>16)&65535)<<16);switch(s=0,t){case 3:s^=(255&l.charCodeAt(a+2))<<16;case 2:s^=(255&l.charCodeAt(a+1))<<8;case 1:n^=s=(65535&(s=(s=(65535&(s^=255&l.charCodeAt(a)))*i+(((s>>>16)*i&65535)<<16)&4294967295)<<15|s>>>17))*o+(((s>>>16)*o&65535)<<16)&4294967295}return n^=l.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0},Object.defineProperty(o.prototype,"length",{get:function(){var t=0;for(var e in this.data)0===e.indexOf("hash_")&&(t+=this.data[e].length);return t}}),o.prototype.add=function(t){var e="hash_"+this.hashFunction(t);if(e in this.data){for(var n=this.data[e],r=0;r<n.length;r++)if(this.equalsFunction(t,n[r]))return n[r];return n.push(t),t}return this.data[e]=[t],t},o.prototype.contains=function(t){return null!=this.get(t)},o.prototype.get=function(t){var e="hash_"+this.hashFunction(t);if(e in this.data)for(var n=this.data[e],r=0;r<n.length;r++)if(this.equalsFunction(t,n[r]))return n[r];return null},o.prototype.values=function(){var t=[];for(var e in this.data)0===e.indexOf("hash_")&&(t=t.concat(this.data[e]));return t},o.prototype.toString=function(){return n(this.values())},s.prototype.add=function(t){this.data[t]=!0},s.prototype.or=function(t){var e=this;Object.keys(t.data).map(function(t){e.add(t)})},s.prototype.remove=function(t){delete this.data[t]},s.prototype.contains=function(t){return!0===this.data[t]},s.prototype.values=function(){return Object.keys(this.data)},s.prototype.minValue=function(){return Math.min.apply(null,this.values())},s.prototype.hashCode=function(){var t=new c;return t.update(this.values()),t.finish()},s.prototype.equals=function(t){return t instanceof s&&this.hashCode()===t.hashCode()},Object.defineProperty(s.prototype,"length",{get:function(){return this.values().length}}),s.prototype.toString=function(){return"{"+this.values().join(", ")+"}"},Object.defineProperty(a.prototype,"length",{get:function(){var t=0;for(var e in this.data)0===e.indexOf("hash_")&&(t+=this.data[e].length);return t}}),a.prototype.put=function(t,e){var n="hash_"+this.hashFunction(t);if(n in this.data){for(var r=this.data[n],i=0;i<r.length;i++){var o=r[i];if(this.equalsFunction(t,o.key)){var s=o.value;return o.value=e,s}}return r.push({key:t,value:e}),e}return this.data[n]=[{key:t,value:e}],e},a.prototype.containsKey=function(t){var e="hash_"+this.hashFunction(t);if(e in this.data)for(var n=this.data[e],r=0;r<n.length;r++){var i=n[r];if(this.equalsFunction(t,i.key))return!0}return!1},a.prototype.get=function(t){var e="hash_"+this.hashFunction(t);if(e in this.data)for(var n=this.data[e],r=0;r<n.length;r++){var i=n[r];if(this.equalsFunction(t,i.key))return i.value}return null},a.prototype.entries=function(){var t=[];for(var e in this.data)0===e.indexOf("hash_")&&(t=t.concat(this.data[e]));return t},a.prototype.getKeys=function(){return this.entries().map(function(t){return t.key})},a.prototype.getValues=function(){return this.entries().map(function(t){return t.value})},a.prototype.toString=function(){return"["+this.entries().map(function(t){return"{"+t.key+":"+t.value+"}"}).join(", ")+"]"},l.prototype.get=function(t){return(t="k-"+t)in this.data?this.data[t]:null},l.prototype.put=function(t,e){t="k-"+t,this.data[t]=e},l.prototype.values=function(){var t=this.data;return Object.keys(this.data).map(function(e){return t[e]})},c.prototype.update=function(){for(var t=0;t<arguments.length;t++){var e=arguments[t];if(null!=eLine truncated
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=32)}([function(t,e){function n(t){return"["+t.join(", ")+"]"}function r(t,e){return t.equals(e)}function i(t){return t.hashCode()}function o(t,e){return this.data={},this.hashFunction=t||i,this.equalsFunction=e||r,this}function s(){return this.data=[],this}function a(t,e){return this.data={},this.hashFunction=t||i,this.equalsFunction=e||r,this}function l(){return this.data={},this}function u(){return this}function c(){return this.count=0,this.hash=0,this}String.prototype.seed=String.prototype.seed||Math.round(Math.random()*Math.pow(2,32)),String.prototype.hashCode=function(){var t,e,n,r,i,o,s,a,l=this.toString();for(t=3&l.length,e=l.length-t,n=String.prototype.seed,i=3432918353,o=461845907,a=0;a<e;)s=255&l.charCodeAt(a)|(255&l.charCodeAt(++a))<<8|(255&l.charCodeAt(++a))<<16|(255&l.charCodeAt(++a))<<24,++a,n=27492+(65535&(r=5*(65535&(n=(n^=s=(65535&(s=(s=(65535&s)*i+(((s>>>16)*i&65535)<<16)&4294967295)<<15|s>>>17))*o+(((s>>>16)*o&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(r>>>16)&65535)<<16);switch(s=0,t){case 3:s^=(255&l.charCodeAt(a+2))<<16;case 2:s^=(255&l.charCodeAt(a+1))<<8;case 1:n^=s=(65535&(s=(s=(65535&(s^=255&l.charCodeAt(a)))*i+(((s>>>16)*i&65535)<<16)&4294967295)<<15|s>>>17))*o+(((s>>>16)*o&65535)<<16)&4294967295}return n^=l.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0},Object.defineProperty(o.prototype,"length",{get:function(){var t=0;for(var e in this.data)0===e.indexOf("hash_")&&(t+=this.data[e].length);return t}}),o.prototype.add=function(t){var e="hash_"+this.hashFunction(t);if(e in this.data){for(var n=this.data[e],r=0;r<n.length;r++)if(this.equalsFunction(t,n[r]))return n[r];return n.push(t),t}return this.data[e]=[t],t},o.prototype.contains=function(t){return null!=this.get(t)},o.prototype.get=function(t){var e="hash_"+this.hashFunction(t);if(e in this.data)for(var n=this.data[e],r=0;r<n.length;r++)if(this.equalsFunction(t,n[r]))return n[r];return null},o.prototype.values=function(){var t=[];for(var e in this.data)0===e.indexOf("hash_")&&(t=t.concat(this.data[e]));return t},o.prototype.toString=function(){return n(this.values())},s.prototype.add=function(t){this.data[t]=!0},s.prototype.or=function(t){var e=this;Object.keys(t.data).map(function(t){e.add(t)})},s.prototype.remove=function(t){delete this.data[t]},s.prototype.contains=function(t){return!0===this.data[t]},s.prototype.values=function(){return Object.keys(this.data)},s.prototype.minValue=function(){return Math.min.apply(null,this.values())},s.prototype.hashCode=function(){var t=new c;return t.update(this.values()),t.finish()},s.prototype.equals=function(t){return t instanceof s&&this.hashCode()===t.hashCode()},Object.defineProperty(s.prototype,"length",{get:function(){return this.values().length}}),s.prototype.toString=function(){return"{"+this.values().join(", ")+"}"},Object.defineProperty(a.prototype,"length",{get:function(){var t=0;for(var e in this.data)0===e.indexOf("hash_")&&(t+=this.data[e].length);return t}}),a.prototype.put=function(t,e){var n="hash_"+this.hashFunction(t);if(n in this.data){for(var r=this.data[n],i=0;i<r.length;i++){var o=r[i];if(this.equalsFunction(t,o.key)){var s=o.value;return o.value=e,s}}return r.push({key:t,value:e}),e}return this.data[n]=[{key:t,value:e}],e},a.prototype.containsKey=function(t){var e="hash_"+this.hashFunction(t);if(e in this.data)for(var n=this.data[e],r=0;r<n.length;r++){var i=n[r];if(this.equalsFunction(t,i.key))return!0}return!1},a.prototype.get=function(t){var e="hash_"+this.hashFunction(t);if(e in this.data)for(var n=this.data[e],r=0;r<n.length;r++){var i=n[r];if(this.equalsFunction(t,i.key))return i.value}return null},a.prototype.entries=function(){var t=[];for(var e in this.data)0===e.indexOf("hash_")&&(t=t.concat(this.data[e]));return t},a.prototype.getKeys=function(){return this.entries().map(function(t){return t.key})},a.prototype.getValues=function(){return this.entries().map(function(t){return t.value})},a.prototype.toString=function(){return"["+this.entries().map(function(t){return"{"+t.key+":"+t.value+"}"}).join(", ")+"]"},l.prototype.get=function(t){return(t="k-"+t)in this.data?this.data[t]:null},l.prototype.put=function(t,e){t="k-"+t,this.data[t]=e},l.prototype.values=function(){var t=this.data;return Object.keys(this.data).map(function(e){return t[e]})},c.prototype.update=function(){for(var t=0;t<arguments.length;t++){var e=arguments[t];if(null!=eLine truncated
+21 -46
View File
@@ -140,7 +140,7 @@ changeFloor_m
/* changeFloor_m
tooltip : 楼梯, 传送门, 如果目标楼层有多个楼梯, 写upFloor或downFloor可能会导致到达的楼梯不确定, 这时候请使用loc方式来指定具体的点位置
helpUrl : https://ckcz123.github.io/mota-js/#/element?id=%e8%b7%af%e9%9a%9c%ef%bc%8c%e6%a5%bc%e6%a2%af%ef%bc%8c%e4%bc%a0%e9%80%81%e9%97%a8
default : ["MT1",null,0,0,null,500,null]
default : ["MT1",null,0,0,[['不变',''],['上','up'],['下','down'],['左','left'],['右','right']],500,null]
var loc = ', "loc": ['+Int_0+', '+Int_1+']';
if (Stair_List_0!=='loc')loc = ', "stair": "'+Stair_List_0+'"';
DirectionEx_List_0 = DirectionEx_List_0 && (', "direction": "'+DirectionEx_List_0+'"');
@@ -470,7 +470,7 @@ changeFloor_s
/* changeFloor_s
tooltip : changeFloor: 楼层切换,动画时间可不填
helpUrl : https://ckcz123.github.io/mota-js/#/event?id=changefloor-%e6%a5%bc%e5%b1%82%e5%88%87%e6%8d%a2
default : ["MT1",0,0,null,500]
default : ["MT1",0,0,[['不变',''],['上','up'],['下','down'],['左','left'],['右','right']],500]
colour : this.dataColor
DirectionEx_List_0 = DirectionEx_List_0 && (', "direction": "'+DirectionEx_List_0+'"');
Int_2 = Int_2 ?(', "time": '+Int_2):'';
@@ -485,7 +485,7 @@ changePos_0_s
/* changePos_0_s
tooltip : changePos: 当前位置切换
helpUrl : https://ckcz123.github.io/mota-js/#/event?id=changepos-%e5%bd%93%e5%89%8d%e4%bd%8d%e7%bd%ae%e5%88%87%e6%8d%a2%e5%8b%87%e5%a3%ab%e8%bd%ac%e5%90%91
default : [0,0,null]
default : [0,0,[['不变',''],['上','up'],['下','down'],['左','left'],['右','right']]]
colour : this.dataColor
DirectionEx_List_0 = DirectionEx_List_0 && (', "direction": "'+DirectionEx_List_0+'"');
var code = '{"type": "changePos", "loc": ['+Int_0+','+Int_1+']'+DirectionEx_List_0+'},\n';
@@ -500,6 +500,7 @@ changePos_1_s
tooltip : changePos: 勇士转向
helpUrl : https://ckcz123.github.io/mota-js/#/event?id=changepos-%e5%bd%93%e5%89%8d%e4%bd%8d%e7%bd%ae%e5%88%87%e6%8d%a2%e5%8b%87%e5%a3%ab%e8%bd%ac%e5%90%91
colour : this.dataColor
default : [[['上','up'],['下','down'],['左','left'],['右','right']]]
var code = '{"type": "changePos", "direction": "'+Direction_List_0+'"},\n';
return code;
*/
@@ -1037,23 +1038,23 @@ LineComment
;
/* Function_0
//converter.evisitor.recieveOrder='ORDER_NONE';
converter.evisitor.valueColor=330;
converter.evisitor.statementColor=70;
converter.evisitor.entryColor=250;
//this.evisitor.recieveOrder='ORDER_NONE';
this.evisitor.valueColor=330;
this.evisitor.statementColor=70;
this.evisitor.entryColor=250;
converter.evisitor.idstring_eColor=310;
converter.evisitor.subColor=190;
converter.evisitor.printColor=70;
converter.evisitor.dataColor=130;
converter.evisitor.eventColor=220;
converter.evisitor.soundColor=20;
this.evisitor.idstring_eColor=310;
this.evisitor.subColor=190;
this.evisitor.printColor=70;
this.evisitor.dataColor=130;
this.evisitor.eventColor=220;
this.evisitor.soundColor=20;
*/
/* Function_1
delete(converter.evisitor.expressionRules.negate_e.blockjs.inputsInline);
converter.evisitor.expressionRules.idString_1_e.blockjs.output='idString_e';
converter.evisitor.expressionRules.idString_2_e.blockjs.output='idString_e';
delete(this.block('negate_e').inputsInline);
this.block('idString_1_e').output='idString_e';
this.block('idString_2_e').output='idString_e';
*/
/* Functions
@@ -1075,7 +1076,7 @@ ActionParser.prototype.parse = function (obj,type) {
if(!obj)obj={};
if(!this.isset(obj.loc))obj.loc=[0,0];
return MotaActionBlocks['changeFloor_m'].xmlText([
obj.floorId,obj.stair||'loc',obj.loc[0],obj.loc[1],this.Direction(obj.direction),obj.time||0,!this.isset(obj.portalWithoutTrigger)
obj.floorId,obj.stair||'loc',obj.loc[0],obj.loc[1],obj.direction,obj.time||0,!this.isset(obj.portalWithoutTrigger)
]);
case 'point':
@@ -1215,15 +1216,15 @@ ActionParser.prototype.parseAction = function() {
break;
case "changeFloor": // 楼层转换
this.next = MotaActionBlocks['changeFloor_s'].xmlText([
data.floorId,data.loc[0],data.loc[1],this.Direction(data.direction),this.time||0,this.next]);
data.floorId,data.loc[0],data.loc[1],data.direction,this.time||0,this.next]);
break;
case "changePos": // 直接更换勇士位置, 不切换楼层
if(this.isset(data.loc)){
this.next = MotaActionBlocks['changePos_0_s'].xmlText([
data.loc[0],data.loc[1],this.Direction(data.direction),this.next]);
data.loc[0],data.loc[1],data.direction,this.next]);
} else {
this.next = MotaActionBlocks['changePos_1_s'].xmlText([
this.Direction(data.direction),this.next]);
data.direction,this.next]);
}
break;
case "animate": // 显示动画
@@ -1390,18 +1391,6 @@ ActionParser.prototype.StepString = function(steplist) {
return StepString.join('');
}
ActionParser.prototype.Direction = function(Direction) {
var stepchar = {
'up': '上',
'down': '下',
'left': '左',
'right': '右'
}
Direction=stepchar[Direction];
if(!Direction)Direction='不变';
return Direction;
}
ActionParser.prototype.EvalString = function(EvalString) {
return EvalString.split('\b').join('\\b').split('\t').join('\\t').split('\n').join('\\n');
}
@@ -1428,20 +1417,6 @@ MotaActionFunctions.IdString_pre = function(IdString){
return IdString;
}
MotaActionFunctions.DirectionEx_List_pre = function(DirectionEx_List){
var directionchar = {
'上': 'up',
'下': 'down',
'左': 'left',
'右': 'right'
}
Direction=directionchar[DirectionEx_List];
if(!Direction)Direction='';
return Direction;
}
MotaActionFunctions.Direction_List_pre = MotaActionFunctions.DirectionEx_List_pre
MotaActionFunctions.StepString_pre = function(StepString){
//StepString='上右3下2左上左2'
var route = StepString.replace(/上/g,'U').replace(/下/g,'D').replace(/左/g,'L').replace(/右/g,'R');
+14 -14
View File
@@ -20,25 +20,25 @@ editor.prototype.init = function(callback){
if (Boolean(callback))callback();
});
}
var afterMainInit = function(){
editor.main=main;
editor.core=core;
editor.fs=fs;
editor_file = editor_file(editor);
editor.file=editor_file;
editor_mode = editor_mode(editor);
editor.mode=editor_mode;
editor.material.images=core.material.images;
editor.listen(); // 开始监听事件
var hard = 'Hard';
core.resetStatus(core.firstData.hero, hard, core.firstData.floorId, null, core.initStatus.maps);
//core.status.maps = core.clone(core.maps.initMaps(floorIds));
core.changeFloor(core.status.floorId, null, core.firstData.hero.loc, null, function() {
afterCoreReset();
}, true);
core.events.setInitData(hard);
editor_file = editor_file(editor, function() {
editor.file=editor_file;
editor_mode = editor_mode(editor);
editor.mode=editor_mode;
editor.material.images=core.material.images;
editor.listen(); // 开始监听事件
core.resetStatus(core.firstData.hero, null, core.firstData.floorId, null, core.initStatus.maps);
core.changeFloor(core.status.floorId, null, core.firstData.hero.loc, null, function() {
afterCoreReset();
}, true);
core.events.setInitData(null);
});
}
setTimeout(afterMainInit, 500);
afterMainInit();
}
editor.prototype.reset = function(callback){
+2 -2
View File
@@ -239,10 +239,10 @@ editor_blockly.runOne = function (){
//var printf = function(){};
var grammerFile = input_;
converter = new Converter().init();
converter.generBlocks(grammerFile,[]);
converter.generBlocks(grammerFile);
//printf(converter.blocks);
converter.renderGrammerName();
converter.generToolbox();
//converter.generToolbox();
converter.generMainFile();
//printf(converter.mainFile.join(''));
console.log(converter);
+7 -1
View File
@@ -1,7 +1,9 @@
editor_file = function(editor){
editor_file = function(editor, callback){
var editor_file = {};
(function(){
var script = document.createElement('script');
if (window.location.href.indexOf('_server')!==-1)
@@ -12,6 +14,8 @@ editor_file = function(editor){
script.onload = function () {
editor_file.comment=comment_c456ea59_6018_45ef_8bcc_211a24c627dc;
delete(comment_c456ea59_6018_45ef_8bcc_211a24c627dc);
if (editor_file.comment && editor_file.dataComment && callback)
callback();
}
})();
(function(){
@@ -24,6 +28,8 @@ editor_file = function(editor){
script.onload = function () {
editor_file.dataComment=data_comment_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d;
delete(data_comment_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d);
if (editor_file.comment && editor_file.dataComment && callback)
callback();
}
})();
+12 -10
View File
@@ -321,19 +321,21 @@ function hasOwnProp (obj, key) {
</script>
<script src='_server/editor.js'></script>
<script>
main.init('editor');
editor.init(function(){
editor.pos={x: 0, y: 0};
editor.mode.loc();
editor.info=editor.ids[editor.indexs[201]];
editor.mode.emenyitem();
editor.mode.floor();
editor.mode.tower();
editor.mode.listen();
editor_blockly=editor_blockly();
main.init('editor', function() {
editor.init(function(){
editor.pos={x: 0, y: 0};
editor.mode.loc();
editor.info=editor.ids[editor.indexs[201]];
editor.mode.emenyitem();
editor.mode.floor();
editor.mode.tower();
editor.mode.listen();
editor_blockly=editor_blockly();
});
});
//main.listen();
</script>
+4 -1
View File
@@ -151,7 +151,7 @@ function core() {
/////////// 系统事件相关 ///////////
////// 初始化 //////
core.prototype.init = function (coreData) {
core.prototype.init = function (coreData, callback) {
for (var key in coreData) {
core[key] = coreData[key];
}
@@ -281,6 +281,9 @@ core.prototype.init = function (coreData) {
core.material.icons.hero.height = core.material.images.hero.height/4;
core.setRequestAnimationFrame();
core.showStartAnimate();
if (core.isset(callback)) callback();
});
}
+2
View File
@@ -41,6 +41,7 @@ items.prototype.getItemEffect = function(itemId, itemNum) {
var itemCls = core.material.items[itemId].cls;
// 消耗品
if (itemCls === 'items') {
var ratio = parseInt(core.floors[core.status.floorId].item_ratio) || 1;
if (itemId in this.itemEffect)eval(this.itemEffect[itemId]);
}
else {
@@ -50,6 +51,7 @@ items.prototype.getItemEffect = function(itemId, itemNum) {
////// “即捡即用类”道具的文字提示 //////
items.prototype.getItemEffectTip = function(itemId) {
var ratio = parseInt(core.floors[core.status.floorId].item_ratio) || 1;
if (itemId in this.itemEffectTip && (!this.items[itemId].isEquipment || !core.flags.equipment)) {
return eval(this.itemEffectTip[itemId]);
}
+2 -2
View File
@@ -109,7 +109,7 @@ function main() {
this.canvas = {};
}
main.prototype.init = function (mode) {
main.prototype.init = function (mode, callback) {
for (var i = 0; i < main.dom.gameCanvas.length; i++) {
main.canvas[main.dom.gameCanvas[i].id] = main.dom.gameCanvas[i].getContext('2d');
}
@@ -155,7 +155,7 @@ main.prototype.init = function (mode) {
"animates", "bgms", "sounds", "floorIds", "floors"].forEach(function (t) {
coreData[t] = main[t];
})
main.core.init(coreData);
main.core.init(coreData, callback);
main.core.resize(main.dom.body.clientWidth, main.dom.body.clientHeight);
});
});
+1
View File
@@ -43,6 +43,7 @@ comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
"weather": "该层的默认天气。本项可忽略表示晴天,如果写则第一项为\"rain\"或\"snow\"代表雨雪,第二项为1-10之间的数代表强度。 \n$leaf(true)$end",
"bgm": "到达该层后默认播放的BGM。本项可忽略。 ",
//"map": "地图数据,需要是13x13,建议使用地图生成器来生成 ",
"item_ratio": "每一层的宝石/血瓶效果,即获得宝石和血瓶时框内\"ratio\"的值。",
"firstArrive": "第一次到该楼层触发的事件 \n$leaf(true)$end",
},
'loc' : {
+1
View File
@@ -13,6 +13,7 @@ main.floors.MT0 =
// "color": [0,0,0,0.3], // 该层的默认画面色调。本项可不写(代表无色调),如果写需要是一个RGBA数组。
// "weather": ["snow",5], // 该层的默认天气。本项可忽略表示晴天,如果写则第一项为"rain"或"snow"代表雨雪,第二项为1-10之间的数代表强度。
// "bgm": "bgm.mp3", // 到达该层后默认播放的BGM。本项可忽略。
"item_ratio": 1, // 该层的宝石/血瓶倍率
"map": [ // 地图数据,需要是13x13,建议使用地图生成器来生成
],
+1
View File
@@ -13,6 +13,7 @@ main.floors.sample0 =
// "color": [0,0,0,0.3] // 该层的默认画面色调。本项可不写(代表无色调),如果写需要是一个RGBA数组。
// "weather": ["snow",5], // 该层的默认天气。本项可忽略表示晴天,如果写则第一项为"rain"或"snow"代表雨雪,第二项为1-10之间的数代表强度。
"bgm": "bgm.mp3", // 到达该层后默认播放的BGM。本项可忽略。
"item_ratio": 2, // 该层的宝石/血瓶倍率
"map": [ // 地图数据,需要是13x13,建议使用地图生成器来生成
[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],
+1
View File
@@ -13,6 +13,7 @@ main.floors.sample1 =
// "color": [0,0,0,0.3] // 该层的默认画面色调。本项可不写(代表无色调),如果写需要是一个RGBA数组。
"weather": ["snow",6], // 该层的默认天气。本项可忽略表示晴天,如果写则第一项为"rain"或"snow"代表雨雪,第二项为1-10之间的数代表强度。
// "bgm": "bgm.mp3", // 到达该层后默认播放的BGM。本项可忽略。
"item_ratio": 1, // 该层的宝石/血瓶倍率
"map": [ // 地图数据,需要是13x13,建议使用地图生成器来生成
[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],
+1
View File
@@ -13,6 +13,7 @@ main.floors.sample2 =
"color": [255,0,0,0.3], // 该层的默认画面色调。本项可不写(代表无色调),如果写需要是一个RGBA数组。
"weather": ["rain",10], // 该层的默认天气。本项可忽略表示晴天,如果写则第一项为"rain"或"snow"代表雨雪,第二项为1-10之间的数代表强度。
"bgm": "qianjin.mid", // 到达该层后默认播放的BGM。本项可忽略。
"item_ratio": 1, // 该层的宝石/血瓶倍率
"map": [ // 地图数据,需要是13x13,建议使用地图生成器来生成
[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],
-46
View File
@@ -1,46 +0,0 @@
main.floors.test =
{
"floorId": "test", // 这里需要改楼层名,请和文件名及下面的floorId保持完全一致
// 楼层唯一标识符仅能由字母、数字、下划线组成,且不能由数字开头
// 推荐用法:第20层就用MT20,第38层就用MT38,地下6层就用MT_6(用下划线代替负号),隐藏3层用MT3h(h表示隐藏),等等
// 楼层唯一标识符,需要和名字完全一致
"title": "test", // 楼层中文名
"name": "", // 显示在状态栏中的层数
"canFlyTo": true, // 该楼能否被楼传器飞到(不能的话在该楼也不允许使用楼传器)
"canUseQuickShop": true, // 该层是否允许使用快捷商店
"defaultGround": "ground", // 默认地面的图块ID(terrains中)
"map": [ // 地图数据,需要是13x13,建议使用地图生成器来生成
[201,201,201,201,201,201,201,201,201,201,201,201,201],
[201,201,201,201,201,201,201,201,201,201,201,201,201],
[201,201,201,201,201,201,201,201,201,201,201,201,201],
[201,201,201,201,201,201,201,201,201,201,201,201,201],
[201,201,201,201,201,201,201,201,201,201,201,201,201],
[201,201,201,201,201,201,201,201,201,201,201,201,201],
[201,201,201,201,201,201,201,201,201,201,201,201,201],
[201,201,201,201,201,201,201,201,201,201,201,201,201],
[201,201,201,201,201,201,201,201,201,201,201,201,201],
[201,201,201,201,201,201,201,201,201,201,201,201,201],
[201,201,201,201,201,201,201,201,201,201,201,201,201],
[201,201,201,201,201,201, 45,201,201,201,201,201,201],
[201,201,201,201,201,201, 0,201,201,201,201,201,201]
],
"firstArrive": [ // 第一次到该楼层触发的事件
],
"events": { // 该楼的所有可能事件列表
},
"changeFloor": { // 楼层转换事件;该事件不能和上面的events有冲突(同位置点),否则会被覆盖
},
"afterBattle": { // 战斗后可能触发的事件列表
},
"afterGetItem": { // 获得道具后可能触发的事件列表
},
"afterOpenDoor": { // 开完门后可能触发的事件列表
}
}
+14 -14
View File
@@ -62,16 +62,16 @@ items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"itemEffect" : {
"redJewel":"core.status.hero.atk += core.values.redJewel",
"blueJewel":"core.status.hero.def += core.values.blueJewel",
"greenJewel":"core.status.hero.mdef += core.values.greenJewel",
"redJewel":"core.status.hero.atk += core.values.redJewel * ratio",
"blueJewel":"core.status.hero.def += core.values.blueJewel * ratio",
"greenJewel":"core.status.hero.mdef += core.values.greenJewel * ratio",
"yellowJewel":"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",
"bluePotion":"core.status.hero.hp += core.values.bluePotion",
"yellowPotion":"core.status.hero.hp += core.values.yellowPotion",
"greenPotion":"core.status.hero.hp += core.values.greenPotion",
"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",
"sword1":"core.status.hero.atk += core.values.sword1",
"sword2":"core.status.hero.atk += core.values.sword2",
"sword3":"core.status.hero.atk += core.values.sword3",
@@ -91,14 +91,14 @@ items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"itemEffectTip" : {
"redJewel":"',攻击+'+core.values.redJewel",
"blueJewel":"',防御+'+core.values.blueJewel",
"greenJewel":"',魔防+'+core.values.greenJewel",
"redJewel":"',攻击+'+core.values.redJewel * ratio",
"blueJewel":"',防御+'+core.values.blueJewel * ratio",
"greenJewel":"',魔防+'+core.values.greenJewel * ratio",
"yellowJewel":"',全属性提升'",
"redPotion":"',生命+'+core.values.redPotion",
"bluePotion":"',生命+'+core.values.bluePotion",
"yellowPotion":"',生命+'+core.values.yellowPotion",
"greenPotion":"',生命+'+core.values.greenPotion",
"redPotion":"',生命+'+core.values.redPotion * ratio",
"bluePotion":"',生命+'+core.values.bluePotion * ratio",
"yellowPotion":"',生命+'+core.values.yellowPotion * ratio",
"greenPotion":"',生命+'+core.values.greenPotion * ratio",
"sword1":"',攻击+'+core.values.sword1",
"sword2":"',攻击+'+core.values.sword2",
"sword3":"',攻击+'+core.values.sword3",