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

View File

@ -109,12 +109,6 @@ functions_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
"_lint": true,
"_data": "获得战斗伤害信息(实际伤害计算函数)"
},
"updateCheckBlock": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "领域、阻击、夹击的伤害计算函数"
},
"updateEnemys": {
"_leaf": true,
"_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": {
"_leaf": false,
"_type": "object",

View File

@ -9,7 +9,7 @@ function control() {
}
control.prototype.init = function () {
this.controldata = functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a.control;
}
////// 设置requestAnimationFrame //////
@ -1183,7 +1183,7 @@ control.prototype.updateFollowers = 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 () {
// 检查等级
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;
this.controldata.updateStatusBar();
// 回放
if (core.status.replay.replaying) {

View File

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

View File

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

View File

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

View File

@ -1,8 +1,7 @@
functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
{
"events":{
////// 游戏开始前的一些初始化操作 //////
"initGame": function() {
"events": {
"initGame": function() {
// 游戏开始前的一些初始化操作
// 根据flag来对道具进行修改
@ -33,8 +32,7 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
core.material.items.shield5.cls = 'equips';
}
},
////// 不同难度分别设置初始属性 //////
"setInitData":function (hard) {
"setInitData": function (hard) {
// 不同难度分别设置初始属性
if (hard=='Easy') { // 简单难度
core.setFlag('hard', 1); // 可以用flag:hard来获得当前难度
@ -54,8 +52,7 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
}
core.events.afterLoadData();
},
////// 游戏获胜事件 //////
"win" : function(reason, norank) {
"win": function(reason, norank) {
// 游戏获胜事件
core.ui.closePanel();
var replaying = core.status.replay.replaying;
@ -74,8 +71,7 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
})
});
},
////// 游戏失败事件 //////
"lose" : function(reason) {
"lose": function(reason) {
// 游戏失败事件
core.ui.closePanel();
var replaying = core.status.replay.replaying;
@ -88,8 +84,7 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
});
})
},
////// 转换楼层结束的事件 //////
"afterChangeFloor" : function (floorId, fromLoad) {
"afterChangeFloor": function (floorId, fromLoad) {
// 转换楼层结束的事件
// floorId是切换到的楼层fromLoad若为true则代表是从读档行为造成的楼层切换
if (!core.hasFlag("visited_"+floorId)) {
@ -97,8 +92,7 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
core.setFlag("visited_"+floorId, true);
}
},
////// 加点事件 //////
"addPoint" : function (enemy) {
"addPoint": function (enemy) {
// 加点事件
var point = enemy.point;
if (!core.flags.enableAddPoint || !core.isset(point) || point<=0) return [];
@ -120,8 +114,7 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
}
];
},
////// 战斗结束后触发的事件 //////
"afterBattle" : function(enemyId,x,y,callback) {
"afterBattle": function(enemyId,x,y,callback) {
// 战斗结束后触发的事件
var enemy = core.material.enemys[enemyId];
@ -242,8 +235,7 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
if (core.isset(callback)) callback();
},
////// 开一个门后触发的事件 //////
"afterOpenDoor" : function(doorId,x,y,callback) {
"afterOpenDoor": function(doorId,x,y,callback) {
// 开一个门后触发的事件
var todo = [];
@ -266,8 +258,7 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
}
if (core.isset(callback)) callback();
},
////// 获得一个道具后触发的事件 //////
"afterGetItem" : function(itemId,x,y,callback) {
"afterGetItem": function(itemId,x,y,callback) {
// 获得一个道具后触发的事件
var todo = [];
@ -284,13 +275,11 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
if (core.isset(callback)) callback();
},
////// 改变亮灯之后,可以触发的事件 //////
"afterChangeLight" : function(x,y) {
"afterChangeLight": function(x,y) {
// 改变亮灯之后,可以触发的事件
},
////// 推箱子后的事件 //////
"afterPushBox" : function () {
"afterPushBox": function () {
// 推箱子后的事件
var noBoxLeft = function () {
@ -313,8 +302,7 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
*/
}
},
////// 使用炸弹/圣锤后的事件 //////
"afterUseBomb" : function () {
"afterUseBomb": function () {
// 使用炸弹/圣锤后的事件
// 这是一个使用炸弹也能开门的例子
@ -329,21 +317,19 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
*/
},
////// 即将存档前可以执行的操作 //////
"beforeSaveData" : function(data) {
"beforeSaveData": function(data) {
// 即将存档前可以执行的操作
},
////// 读档事件后,载入事件前,可以执行的操作 //////
"afterLoadData" : function(data) {
"afterLoadData": function(data) {
// 读档事件后,载入事件前,可以执行的操作
// 怪物数据的动态修改迁移到了“脚本编辑 - updateEnemys”中详见文档说明
core.enemys.updateEnemys();
}
},
"enemys": {
"getSpecials" : function() {
},
"enemys": {
"getSpecials": function() {
// 获得怪物的特殊属性,每一行定义一个特殊属性。
// 分为三项,第一项为该特殊属性的数字,第二项为特殊属性的名字,第三项为特殊属性的描述
// 可以直接写字符串也可以写个function将怪物传进去
@ -374,7 +360,7 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
[24, "激光", function (enemy) {return "经过怪物同行或同列时自动减生命"+(enemy.value||0)+"点";}]
];
},
"getDamageInfo" : function (enemy, hero_hp, hero_atk, hero_def, hero_mdef) {
"getDamageInfo": function (enemy, hero_hp, hero_atk, hero_def, hero_mdef) {
// 获得战斗伤害信息(实际伤害计算函数)
// 怪物生命,怪物攻击、防御、特殊属性
@ -467,7 +453,70 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
"damage": damage
};
},
"updateCheckBlock": function () {
"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 () {
// 领域、夹击、阻击等的伤害值计算
core.status.checkBlock = {};
@ -585,22 +634,10 @@ 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":{
////// 绘制“关于”界面 //////
"drawAbout" : function() {
},
"ui": {
"drawAbout": function() {
// 绘制“关于”界面
if (!core.isPlaying()) {
core.status.event = {'id': null, 'data': null};
@ -627,9 +664,9 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
core.fillText('ui', 'HTML5魔塔交流群539113091', text_start, top+112+32);
// TODO: 写自己的“关于”页面每次增加32像素即可
}
},
"plugins": {
"plugin": function () {
},
"plugins": {
"plugin": function () {
////// 插件编写,可以在这里写自己额外需要执行的脚本 //////
// 在这里写的代码,在所有模块加载完毕后,游戏开始前会被执行
@ -647,5 +684,5 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
// 可以在任何地方如afterXXX或自定义脚本事件调用函数方法为 core.plugin.xxx();
}
}
}
}