function调整

This commit is contained in:
YouWei Zhao 2018-03-10 14:10:42 +08:00
parent 9ee85323df
commit 15cdfa0f23
4 changed files with 12 additions and 10 deletions

View File

@ -23,6 +23,8 @@ editor.prototype.init = function(callback){
var afterMainInit = function(){
core.floors=JSON.parse(JSON.stringify(core.floors,function(k,v){if(v instanceof Function){return v.toString()}else return v}));
core.data=JSON.parse(JSON.stringify(core.data,function(k,v){if(v instanceof Function){return v.toString()}else return v}));
data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d=JSON.parse(JSON.stringify(data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d,function(k,v){if(v instanceof Function){return v.toString()}else return v}));
editor.main=main;
editor.core=core;
editor.fs=fs;

View File

@ -79,7 +79,7 @@ editor_file = function(editor, callback){
}
datastr=datastr.concat(['\n}']);
datastr=datastr.join('');
fs.writeFile(filename,datastr,'utf-8',function(err, data){
fs.writeFile(filename,encode(datastr),'base64',function(err, data){
callback(err);
});
}
@ -482,7 +482,7 @@ editor_file = function(editor, callback){
});
var datastr='icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 = \n';
datastr+=JSON.stringify(icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1,null,4);
fs.writeFile('project/icons.js',datastr,'utf-8',function(err, data){
fs.writeFile('project/icons.js',encode(datastr),'base64',function(err, data){
callback(err);
});
return;
@ -494,7 +494,7 @@ editor_file = function(editor, callback){
});
var datastr='maps_90f36752_8815_4be8_b32b_d7fad1d0542e = \n';
datastr+=JSON.stringify(maps_90f36752_8815_4be8_b32b_d7fad1d0542e,null,4);
fs.writeFile('project/maps.js',datastr,'utf-8',function(err, data){
fs.writeFile('project/maps.js',encode(datastr),'base64',function(err, data){
callback(err);
});
return;
@ -506,7 +506,7 @@ editor_file = function(editor, callback){
});
var datastr='items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = \n';
datastr+=JSON.stringify(items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a,null,4);
fs.writeFile('project/items.js',datastr,'utf-8',function(err, data){
fs.writeFile('project/items.js',encode(datastr),'base64',function(err, data){
callback(err);
});
return;
@ -518,7 +518,7 @@ editor_file = function(editor, callback){
});
var datastr='enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 = \n';
datastr+=JSON.stringify(enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80,null,4);
fs.writeFile('project/enemys.js',datastr,'utf-8',function(err, data){
fs.writeFile('project/enemys.js',encode(datastr),'base64',function(err, data){
callback(err);
});
return;
@ -530,7 +530,7 @@ editor_file = function(editor, callback){
});
var datastr='data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = \n';
datastr+=JSON.stringify(data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d,null,4);
fs.writeFile('project/data.js',datastr,'utf-8',function(err, data){
fs.writeFile('project/data.js',encode(datastr),'base64',function(err, data){
callback(err);
});
return;

View File

@ -102,7 +102,7 @@ data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
]
}
},*/
"levelUp": [
"levelUp": " 经验升级所需要的数值,是一个数组 \n 第一项为初始等级可以简单留空也可以写name \n 每一个里面可以含有三个参数 need, name, effect \n need为所需要的经验数值是一个正整数。请确保need所需的依次递增 \n name为该等级的名称也可以省略代表使用系统默认值本项将显示在状态栏中 \n effect为本次升级所执行的操作可由若干项组成由分号分开 \n 其中每一项写法和上面的商店完全相同同样必须是X+=Y的形式Y是一个表达式同样可以使用status:xxx或item:xxx代表勇士的某项数值/道具个数 \n$leaf(true)$end"/* [
" 经验升级所需要的数值,是一个数组 \n 第一项为初始等级可以简单留空也可以写name \n 每一个里面可以含有三个参数 need, name, effect \n need为所需要的经验数值是一个正整数。请确保need所需的依次递增 \n name为该等级的名称也可以省略代表使用系统默认值本项将显示在状态栏中 \n effect为本次升级所执行的操作可由若干项组成由分号分开 \n 其中每一项写法和上面的商店完全相同同样必须是X+=Y的形式Y是一个表达式同样可以使用status:xxx或item:xxx代表勇士的某项数值/道具个数 \n$leaf(true)$end",
{
"need": "",
@ -113,7 +113,7 @@ data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
"need": "",
"effect": " effect也允许写一个function代表本次升级将会执行的操作 \n 依次往下写需要的数值即可 "
}
]
] */
},
"values": {
"HPMAX": " 各种数值;一些数值可以在这里设置\n /****** 角色相关 ******/ \n HP上限-1则无上限 ",

View File

@ -134,12 +134,12 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
{"need": 20, "name": "第二级", "effect": "status:hp+=2*(status:atk+status:def);status:atk+=10;status:def+=10"}, // 先将生命提升攻防和的2倍再将攻击+10防御+10
{"need": 40, "effect": `function () {
{"need": 40, "effect": function () {
core.drawText("恭喜升级!");
core.status.hero.hp *= 2;
core.status.hero.atk += 100;
core.status.hero.def += 100;
}`}, // effect也允许写一个function代表本次升级将会执行的操作
}}, // effect也允许写一个function代表本次升级将会执行的操作
// 依次往下写需要的数值即可
]