This commit is contained in:
oc 2018-09-16 16:23:27 +08:00
parent d2af698252
commit f95b316ff5
7 changed files with 123 additions and 118 deletions

View File

@ -44,28 +44,28 @@ comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
"type": { "type": {
"_leaf": true, "_leaf": true,
"_type": "textarea", "_type": "textarea",
"_data": "装备的类别与equipName按顺序对应" "_data": "如果是装备其类别与equipName按顺序对应从0开始"
}, },
"atk": { "atk": {
"_leaf": true, "_leaf": true,
"_type": "textarea", "_type": "textarea",
"_data": "装备增加的攻击数值" "_data": "如果是装备,其增加的攻击数值"
}, },
"def": { "def": {
"_leaf": true, "_leaf": true,
"_type": "textarea", "_type": "textarea",
"_data": "装备增加的防御数值" "_data": "如果是装备,其增加的防御数值"
}, },
"mdef": { "mdef": {
"_leaf": true, "_leaf": true,
"_type": "textarea", "_type": "textarea",
"_data": "装备增加的魔防数值" "_data": "如果是装备,其增加的魔防数值"
}, },
"animate": { "animate": {
"_leaf": true, "_leaf": true,
"_type": "textarea", "_type": "textarea",
"_string": true, "_string": true,
"_data": "装备的攻击动画仅对type为0的装备有效" "_data": "如果是装备,其攻击动画仅对type为0的装备有效"
} }
} }
}, },

View File

@ -109,12 +109,6 @@ functions_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
"_lint": true, "_lint": true,
"_data": "获得战斗伤害信息(实际伤害计算函数)" "_data": "获得战斗伤害信息(实际伤害计算函数)"
}, },
"updateCheckBlock": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "领域、阻击、夹击的伤害计算函数"
},
"updateEnemys": { "updateEnemys": {
"_leaf": true, "_leaf": true,
"_type": "textarea", "_type": "textarea",
@ -123,6 +117,24 @@ functions_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
} }
} }
}, },
"control": {
"_leaf": false,
"_type": "object",
"_data": {
"updateStatusBar": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "更新状态栏"
},
"updateCheckBlock": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "阻激夹域的伤害值计算"
},
}
},
"ui": { "ui": {
"_leaf": false, "_leaf": false,
"_type": "object", "_type": "object",

View File

@ -9,7 +9,7 @@ function control() {
} }
control.prototype.init = function () { control.prototype.init = function () {
this.controldata = functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a.control;
} }
////// 设置requestAnimationFrame ////// ////// 设置requestAnimationFrame //////
@ -1183,7 +1183,7 @@ control.prototype.updateFollowers = function () {
////// 更新领域、夹击、阻击的伤害地图 ////// ////// 更新领域、夹击、阻击的伤害地图 //////
control.prototype.updateCheckBlock = function() { control.prototype.updateCheckBlock = function() {
return core.enemys.updateCheckBlock(); return this.controldata.updateCheckBlock();
} }
////// 检查并执行领域、夹击、阻击事件 ////// ////// 检查并执行领域、夹击、阻击事件 //////
@ -2594,52 +2594,7 @@ control.prototype.clearStatusBar = function() {
////// 更新状态栏 ////// ////// 更新状态栏 //////
control.prototype.updateStatusBar = function () { control.prototype.updateStatusBar = function () {
// 检查等级 this.controldata.updateStatusBar();
core.events.checkLvUp();
// 检查HP上限
if (core.flags.enableHPMax) {
core.setStatus('hp', Math.min(core.getStatus('hpmax'), core.getStatus('hp')));
}
// 更新领域、阻击、显伤
core.updateCheckBlock();
var lvName = core.getLvName();
core.statusBar.lv.innerHTML = lvName;
if (/^[+-]?\d+$/.test(lvName))
core.statusBar.lv.style.fontStyle = 'italic';
else core.statusBar.lv.style.fontStyle = 'normal';
var statusList = ['hpmax', 'hp', 'atk', 'def', 'mdef', 'money', 'experience'];
statusList.forEach(function (item) {
if (core.isset(core.status.hero[item]))
core.status.hero[item] = Math.floor(core.status.hero[item]);
core.statusBar[item].innerHTML = core.formatBigNumber(core.getStatus(item));
});
// 进阶
if (core.flags.enableLevelUp && core.status.hero.lv<core.firstData.levelUp.length) {
core.statusBar.up.innerHTML = core.firstData.levelUp[core.status.hero.lv].need || "&nbsp;";
}
else core.statusBar.up.innerHTML = "&nbsp;";
var keys = ['yellowKey', 'blueKey', 'redKey'];
keys.forEach(function (key) {
core.statusBar[key].innerHTML = core.setTwoDigits(core.status.hero.items.keys[key]);
})
if(core.flags.enableDebuff){
core.statusBar.poison.innerHTML = core.hasFlag('poison')?"毒":"";
core.statusBar.weak.innerHTML = core.hasFlag('weak')?"衰":"";
core.statusBar.curse.innerHTML = core.hasFlag('curse')?"咒":"";
}
if (core.flags.enablePZF) {
core.statusBar.pickaxe.innerHTML = "破"+core.itemCount('pickaxe');
core.statusBar.bomb.innerHTML = "炸"+core.itemCount('bomb');
core.statusBar.fly.innerHTML = "飞"+core.itemCount('centerFly');
}
core.statusBar.hard.innerHTML = core.status.hard;
// 回放 // 回放
if (core.status.replay.replaying) { if (core.status.replay.replaying) {

View File

@ -221,11 +221,6 @@ enemys.prototype.updateEnemys = function () {
return this.enemydata.updateEnemys(); return this.enemydata.updateEnemys();
} }
////// 计算领域、夹击、阻击的伤害值 //////
enemys.prototype.updateCheckBlock = function () {
return this.eventdata.updateCheckBlock();
}
////// 获得当前楼层的怪物列表 ////// ////// 获得当前楼层的怪物列表 //////
enemys.prototype.getCurrentEnemys = function (floorId) { enemys.prototype.getCurrentEnemys = function (floorId) {
floorId=floorId||core.status.floorId; floorId=floorId||core.status.floorId;

View File

@ -201,7 +201,7 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"snowFourDirections": false, "snowFourDirections": false,
"bigKeyIsBox": false, "bigKeyIsBox": false,
"equipment": true, "equipment": true,
"equipboxButton": false, "equipboxButton": true,
"enableAddPoint": false, "enableAddPoint": false,
"enableNegativeDamage": false, "enableNegativeDamage": false,
"hatredDecrease": true, "hatredDecrease": true,

View File

@ -212,4 +212,10 @@ main.floors.sample0=
] ]
}, },
"cannotMove": {}, "cannotMove": {},
"bgmap": [
],
"fgmap": [
],
} }

View File

@ -1,7 +1,6 @@
functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
{ {
"events": { "events": {
////// 游戏开始前的一些初始化操作 //////
"initGame": function() { "initGame": function() {
// 游戏开始前的一些初始化操作 // 游戏开始前的一些初始化操作
@ -33,7 +32,6 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
core.material.items.shield5.cls = 'equips'; core.material.items.shield5.cls = 'equips';
} }
}, },
////// 不同难度分别设置初始属性 //////
"setInitData": function (hard) { "setInitData": function (hard) {
// 不同难度分别设置初始属性 // 不同难度分别设置初始属性
if (hard=='Easy') { // 简单难度 if (hard=='Easy') { // 简单难度
@ -54,7 +52,6 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
} }
core.events.afterLoadData(); core.events.afterLoadData();
}, },
////// 游戏获胜事件 //////
"win": function(reason, norank) { "win": function(reason, norank) {
// 游戏获胜事件 // 游戏获胜事件
core.ui.closePanel(); core.ui.closePanel();
@ -74,7 +71,6 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
}) })
}); });
}, },
////// 游戏失败事件 //////
"lose": function(reason) { "lose": function(reason) {
// 游戏失败事件 // 游戏失败事件
core.ui.closePanel(); core.ui.closePanel();
@ -88,7 +84,6 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
}); });
}) })
}, },
////// 转换楼层结束的事件 //////
"afterChangeFloor": function (floorId, fromLoad) { "afterChangeFloor": function (floorId, fromLoad) {
// 转换楼层结束的事件 // 转换楼层结束的事件
// floorId是切换到的楼层fromLoad若为true则代表是从读档行为造成的楼层切换 // floorId是切换到的楼层fromLoad若为true则代表是从读档行为造成的楼层切换
@ -97,7 +92,6 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
core.setFlag("visited_"+floorId, true); core.setFlag("visited_"+floorId, true);
} }
}, },
////// 加点事件 //////
"addPoint": function (enemy) { "addPoint": function (enemy) {
// 加点事件 // 加点事件
var point = enemy.point; var point = enemy.point;
@ -120,7 +114,6 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
} }
]; ];
}, },
////// 战斗结束后触发的事件 //////
"afterBattle": function(enemyId,x,y,callback) { "afterBattle": function(enemyId,x,y,callback) {
// 战斗结束后触发的事件 // 战斗结束后触发的事件
@ -242,7 +235,6 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
if (core.isset(callback)) callback(); if (core.isset(callback)) callback();
}, },
////// 开一个门后触发的事件 //////
"afterOpenDoor": function(doorId,x,y,callback) { "afterOpenDoor": function(doorId,x,y,callback) {
// 开一个门后触发的事件 // 开一个门后触发的事件
@ -266,7 +258,6 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
} }
if (core.isset(callback)) callback(); if (core.isset(callback)) callback();
}, },
////// 获得一个道具后触发的事件 //////
"afterGetItem": function(itemId,x,y,callback) { "afterGetItem": function(itemId,x,y,callback) {
// 获得一个道具后触发的事件 // 获得一个道具后触发的事件
@ -284,12 +275,10 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
if (core.isset(callback)) callback(); if (core.isset(callback)) callback();
}, },
////// 改变亮灯之后,可以触发的事件 //////
"afterChangeLight": function(x,y) { "afterChangeLight": function(x,y) {
// 改变亮灯之后,可以触发的事件 // 改变亮灯之后,可以触发的事件
}, },
////// 推箱子后的事件 //////
"afterPushBox": function () { "afterPushBox": function () {
// 推箱子后的事件 // 推箱子后的事件
@ -313,7 +302,6 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
*/ */
} }
}, },
////// 使用炸弹/圣锤后的事件 //////
"afterUseBomb": function () { "afterUseBomb": function () {
// 使用炸弹/圣锤后的事件 // 使用炸弹/圣锤后的事件
@ -329,12 +317,10 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
*/ */
}, },
////// 即将存档前可以执行的操作 //////
"beforeSaveData": function(data) { "beforeSaveData": function(data) {
// 即将存档前可以执行的操作 // 即将存档前可以执行的操作
}, },
////// 读档事件后,载入事件前,可以执行的操作 //////
"afterLoadData": function(data) { "afterLoadData": function(data) {
// 读档事件后,载入事件前,可以执行的操作 // 读档事件后,载入事件前,可以执行的操作
// 怪物数据的动态修改迁移到了“脚本编辑 - updateEnemys”中详见文档说明 // 怪物数据的动态修改迁移到了“脚本编辑 - updateEnemys”中详见文档说明
@ -466,6 +452,69 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
"turn": turn, "turn": turn,
"damage": damage "damage": damage
}; };
},
"updateEnemys": function () {
// 更新怪物数据,可以在这里对怪物属性和数据进行动态更新,详见文档——事件——怪物数据的动态修改
// 比如下面这个例子如果flag:xxx为真则将绿头怪的攻击设为100金币设为20
/*
if (core.hasFlag('xxx')) {
core.material.enemys.greenSlime.atk = 100;
core.material.enemys.greenSlime.money = 20;
}
*/
// 别忘了在事件中调用“更新怪物数据”事件!
}
},
"control": {
"updateStatusBar": function () {
// 更新状态栏
// 检查等级
core.events.checkLvUp();
// 检查HP上限
if (core.flags.enableHPMax) {
core.setStatus('hp', Math.min(core.getStatus('hpmax'), core.getStatus('hp')));
}
// 更新领域、阻击、显伤
core.updateCheckBlock();
var lvName = core.getLvName();
core.statusBar.lv.innerHTML = lvName;
if (/^[+-]?\d+$/.test(lvName))
core.statusBar.lv.style.fontStyle = 'italic';
else core.statusBar.lv.style.fontStyle = 'normal';
var statusList = ['hpmax', 'hp', 'atk', 'def', 'mdef', 'money', 'experience'];
statusList.forEach(function (item) {
if (core.isset(core.status.hero[item]))
core.status.hero[item] = Math.floor(core.status.hero[item]);
core.statusBar[item].innerHTML = core.formatBigNumber(core.getStatus(item));
});
// 进阶
if (core.flags.enableLevelUp && core.status.hero.lv<core.firstData.levelUp.length) {
core.statusBar.up.innerHTML = core.firstData.levelUp[core.status.hero.lv].need || " ";
}
else core.statusBar.up.innerHTML = " ";
var keys = ['yellowKey', 'blueKey', 'redKey'];
keys.forEach(function (key) {
core.statusBar[key].innerHTML = core.setTwoDigits(core.status.hero.items.keys[key]);
})
if(core.flags.enableDebuff){
core.statusBar.poison.innerHTML = core.hasFlag('poison')?"毒":"";
core.statusBar.weak.innerHTML = core.hasFlag('weak')?"衰":"";
core.statusBar.curse.innerHTML = core.hasFlag('curse')?"咒":"";
}
if (core.flags.enablePZF) {
core.statusBar.pickaxe.innerHTML = "破"+core.itemCount('pickaxe');
core.statusBar.bomb.innerHTML = "炸"+core.itemCount('bomb');
core.statusBar.fly.innerHTML = "飞"+core.itemCount('centerFly');
}
core.statusBar.hard.innerHTML = core.status.hard;
}, },
"updateCheckBlock": function () { "updateCheckBlock": function () {
// 领域、夹击、阻击等的伤害值计算 // 领域、夹击、阻击等的伤害值计算
@ -585,21 +634,9 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
} }
} }
} }
},
"updateEnemys" : function () {
// 更新怪物数据,可以在这里对怪物属性和数据进行动态更新,详见文档——事件——怪物数据的动态修改
// 比如下面这个例子如果flag:xxx为真则将绿头怪的攻击设为100金币设为20
/*
if (core.hasFlag('xxx')) {
core.material.enemys.greenSlime.atk = 100;
core.material.enemys.greenSlime.money = 20;
}
*/
// 别忘了在事件中调用“更新怪物数据”事件!
} }
}, },
"ui": { "ui": {
////// 绘制“关于”界面 //////
"drawAbout": function() { "drawAbout": function() {
// 绘制“关于”界面 // 绘制“关于”界面
if (!core.isPlaying()) { if (!core.isPlaying()) {