删除setInitData并移动到startText中

This commit is contained in:
ckcz123 2020-05-06 14:40:18 +08:00
parent 5ab15d998d
commit 8961dd9a58
6 changed files with 68 additions and 25 deletions

View File

@ -269,15 +269,14 @@ editor_table_wrapper = function (editor) {
// >td[title=comment,cobj=cobj:json]
// >td>div>input[value=thiseval]
var thisTr = document.getElementById(guid);
var inputs = thisTr.children[2].children[0].children;
var input = thisTr.children[2].children[0].children[0];
var inputs = thisTr.children[2].children[0].children;
var field = thisTr.children[0].getAttribute('title');
var cobj = JSON.parse(thisTr.children[1].getAttribute('cobj'));
var modeNode = thisTr.parentNode;
while (!editor_mode._ids.hasOwnProperty(modeNode.getAttribute('id'))) {
modeNode = modeNode.parentNode;
}
for (var i in inputs) {
for (var i = 0; i < inputs.length; ++i) {
var input = inputs[i];
if (input.nodeName == 'INPUT' || input.nodeName == 'SELECT' || input.nodeName == 'TEXTAREA') {
input.onchange = function () {

View File

@ -16,12 +16,6 @@ var functions_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_lint": true,
"_data": "重置整个游戏"
},
"setInitData": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "设置初始属性"
},
"win": {
"_leaf": true,
"_type": "textarea",

View File

@ -292,9 +292,6 @@ enemys.prototype._getDamage = function (enemy, hero, x, y, floorId) {
return info.damage;
}
////// 更新怪物数据。已经不再使用,这里留空进行兼容。 //////
enemys.prototype.updateEnemys = function () {}
////// 获得当前楼层的怪物列表 //////
enemys.prototype.getCurrentEnemys = function (floorId) {
floorId = floorId || core.status.floorId;

View File

@ -702,11 +702,13 @@ events.prototype.afterChangeFloor = function (floorId, fromLoad) {
////// 是否到达过某个楼层 //////
events.prototype.hasVisitedFloor = function (floorId) {
if (!core.hasFlag("__visited__")) core.setFlag("__visited__", {});
return core.getFlag("__visited__")[floorId] || false;
}
////// 到达某楼层 //////
events.prototype.visitFloor = function (floorId) {
if (!core.hasFlag("__visited__")) core.setFlag("__visited__", {});
core.getFlag("__visited__")[floorId] = true;
}

View File

@ -128,8 +128,6 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
0,
0
],
"dw": 100,
"dh": 100,
"opacity": 1,
"time": 0
},
@ -165,11 +163,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"true": [
{
"type": "comment",
"text": "直接开始游戏,设置初始化数据"
},
{
"type": "function",
"function": "function(){\ncore.events.setInitData('')\n}"
"text": "直接开始游戏"
}
],
"false": [
@ -179,7 +173,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
},
{
"type": "function",
"function": "function(){\nvar choices = [];\nmain.levelChoose.forEach(function (one) {\n\tchoices.push({\"text\": one[0], \"action\": [\n\t\t{\"type\": \"function\", \"function\": \"function() { core.status.hard = '\"+one[1]+\"'; core.events.setInitData('\"+one[1]+\"'); }\"}\n\t]});\n})\ncore.insertAction({\"type\": \"choices\", \"choices\": choices});\n}"
"function": "function(){\nvar choices = [];\nmain.levelChoose.forEach(function (one) {\n\tchoices.push({\n\t\t\"text\": one[0],\n\t\t\"action\": [\n\t\t\t{ \"type\": \"function\", \"function\": \"function() { core.status.hard = '\" + one[1] + \"'; }\" }\n\t\t]\n\t});\n})\ncore.insertAction({ \"type\": \"choices\", \"choices\": choices });\n}"
}
]
},
@ -232,8 +226,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"type": "function",
"function": "function(){\ncore.chooseReplayFile()\n}"
}
],
"false": []
]
}
]
}
@ -247,9 +240,66 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
}
],
"startText": [
{
"type": "comment",
"text": "根据难度分歧设置<flag:hard>并给其他初始值"
},
{
"type": "switch",
"condition": "core.status.hard",
"caseList": [
{
"case": "'Easy'",
"action": [
{
"type": "setValue",
"name": "flag:hard",
"value": "1"
},
{
"type": "comment",
"text": "可以在这里修改初始道具或属性,比如赠送黄钥匙等"
}
]
},
{
"case": "'Normal'",
"action": [
{
"type": "setValue",
"name": "flag:hard",
"value": "2"
}
]
},
{
"case": "'Hard'",
"action": [
{
"type": "setValue",
"name": "flag:hard",
"value": "3"
}
]
},
{
"case": "'Hell'",
"action": [
{
"type": "setValue",
"name": "flag:hard",
"value": "4"
}
]
}
]
},
{
"type": "comment",
"text": "初始剧情"
},
"Hi欢迎来到 HTML5 魔塔样板!\n\n本样板由艾之葵制作可以让你在不会写任何代码\n的情况下也能做出属于自己的H5魔塔",
"这里游戏开始时的剧情。\n定义在data.js的startText处。\n\n你可以在这里写上自己的内容。",
"赶快来试一试吧!"
"这里游戏开始时的剧情。\n\n你可以在这里写上自己的内容。\n赶快来试一试吧"
],
"shops": [
{

View File

@ -25,6 +25,7 @@
(已完成!) 删除绘图模式
(已完成!) 清除最近使用图块
(已完成!) cannotIn / cannotOut使用选项框
(已完成!) noPass->canPass改成选择框
(不处理) 0. 部分文案的修改,如“地图编辑器”(启动服务.exe中、“enemys”、“snipe”
@ -107,7 +108,7 @@
75. 建议修复“绘制多行文本”时行距比字号大不太多会导致各行下缘丢失的bug加大行距又会导致第一行的纵坐标难以估计此bug在道具商店和1.3倍行距英文看的很明显
76. (来自群友)建议给第一代全局商店像“显示选择项”一样提供图标、颜色和出现条件
(不处理) 77. 建议给core.searchBlock()新增问号通配符(匹配一个任意字符)
78. 建议移除core.setInitData()并将其内容写在startText以方便作者仿照修改
(已完成!) 78. 建议移除core.setInitData()并将其内容写在startText以方便作者仿照修改
79. 建议给core.drawHero()添加纵横两个偏移参数(目前只有一个),以用于做一些斜向移动的演出
(文档都给秋橙) 80. 在线文档中“系统使用的flag变量”不够完整建议加以补充
(不处理,新增样板非常麻烦) 81. 来自群友建议做一个17*13的纯横屏样板大地图只能纵向实现状态栏自绘在最右边四列从而彻底摆脱乱七八糟的dom操作