This commit is contained in:
ckcz123 2018-09-16 04:54:32 +08:00
parent 55baa70d3c
commit d2af698252
16 changed files with 273 additions and 190 deletions

View File

@ -112,7 +112,7 @@ body {
#tip {
float: right;
width: 50%;
width: 45%;
/* height: 95%; */
min-height: 9rem;
padding: 5px 10px 10px 10px;

View File

@ -50,7 +50,7 @@ data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
"equipName": {
"_leaf": true,
"_type": "textarea",
"_data": "装备位名称,为不超过6个的数组此项的顺序与equiptype数值关联"
"_data": "装备位名称为不超过6个的数组此项的顺序与equiptype数值关联;例如可写[\"武器\",\"防具\",\"首饰\"]等等。"
},
"statusLeftBackground": {
"_leaf": true,
@ -152,7 +152,7 @@ data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
"equipment": {
"_leaf": true,
"_type": "textarea",
"_data": "初始装备"
"_data": "初始装上的装,此处建议请直接留空数组"
},
"items": {
"_leaf": false,
@ -429,11 +429,11 @@ data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
"_bool": "bool",
"_data": "剑和盾是否作为装备。如果此项为true则作为装备需要在装备栏使用否则将直接加属性。"
},
"equipboxBotton": {
"equipboxButton": {
"_leaf": true,
"_type": "checkbox",
"_bool": "bool",
"_data": "若此项为true则将状态栏中的楼层转换器按钮换为装备栏按钮同时启用装备栏无论equipment是否为true"
"_data": "若此项为true则将状态栏中的楼层转换器按钮换为装备栏按钮"
},
/*
"enableDeleteItem": {

View File

@ -55,6 +55,12 @@ functions_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
"_lint": true,
"_data": "开一个门后触发的事件"
},
"afterGetItem": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "获得一个道具后触发的事件"
},
"afterChangeLight": {
"_leaf": true,
"_type": "textarea",
@ -103,6 +109,12 @@ functions_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
"_lint": true,
"_data": "获得战斗伤害信息(实际伤害计算函数)"
},
"updateCheckBlock": {
"_leaf": true,
"_type": "textarea",
"_lint": true,
"_data": "领域、阻击、夹击的伤害计算函数"
},
"updateEnemys": {
"_leaf": true,
"_type": "textarea",

View File

@ -248,6 +248,7 @@
<span id='mobileview'>
<input type="button" value="数据区"/>
<input type="button" value="地图区"/>
<br />
<input type="button" value="素材库"/>
<input type="button" value="前往游戏" onclick="window.location='./index.html'"/>
</span>
@ -273,10 +274,10 @@
<option value="line">画线</option>
<option value="rectangle">画矩形</option>
</select>
<select id="layerMod" style="float:left;margin-right:6px">
<option value="fgmap">前景</option>
<option value="map" selected="selected">事件</option>
<option value="bgmap">背景</option>
<select id="layerMod" style="float:left;margin-right:3px">
<option value="bgmap">背景层</option>
<option value="map" selected>事件</option>
<option value="fgmap">前景层</option>
</select>
<div id="viewportButtons" style="float:left">
<input type="button" style="padding:1px 1px" value="←"/>

View File

@ -246,11 +246,11 @@
<input type="radio" id="brushMod" name="brushMod" value="line" checked="checked" />画线
<input type="radio" id="brushMod2" name="brushMod" value="rectangle" />画矩形
</span>
<span style="font-size: 12px; margin-left: 5px">
图层:
<input type="radio" id="layerMod3" name="layerMod" value="fgmap" />前景
<input type="radio" id="layerMod" name="layerMod" value="map" checked="checked" />事件
<input type="radio" id="layerMod2" name="layerMod" value="bgmap" />背景
<br/>
<span style="font-size: 12px">
<input type="radio" id="layerMod2" name="layerMod" value="bgmap" />背景层
<input type="radio" id="layerMod" name="layerMod" value="map" checked="checked" style="margin-left: 5px" />事件
<input type="radio" id="layerMod3" name="layerMod" value="fgmap" style="margin-left: 5px" />前景层
</span>
<br>
<div id="viewportButtons">

View File

@ -1183,116 +1183,7 @@ control.prototype.updateFollowers = function () {
////// 更新领域、夹击、阻击的伤害地图 //////
control.prototype.updateCheckBlock = function() {
core.status.checkBlock = {};
if (!core.isset(core.status.thisMap)) return;
var blocks = core.status.thisMap.blocks;
// Step1: 更新怪物地图
core.status.checkBlock.map = []; // 记录怪物地图
for (var n=0;n<blocks.length;n++) {
var block = blocks[n];
if (core.isset(block.event) && !block.disable && block.event.cls.indexOf('enemy')==0) {
var id = block.event.id, enemy = core.material.enemys[id];
if (core.isset(enemy)) {
core.status.checkBlock.map[block.x+core.bigmap.width*block.y]=id;
}
}
// 血网
if (core.isset(block.event) && !block.disable &&
block.event.id=='lavaNet' && block.event.trigger=='passNet' && !core.hasItem("shoes")) {
core.status.checkBlock.map[block.x+core.bigmap.width*block.y]="lavaNet";
}
}
// Step2: 更新领域、阻击伤害
core.status.checkBlock.damage = []; // 记录(x,y)点的伤害
for (var x=0;x<core.bigmap.width*core.bigmap.height;x++) core.status.checkBlock.damage[x]=0;
for (var x=0;x<core.bigmap.width;x++) {
for (var y=0;y<core.bigmap.height;y++) {
var id = core.status.checkBlock.map[x+core.bigmap.width*y];
if (core.isset(id)) {
if (id=="lavaNet") {
core.status.checkBlock.damage[x+core.bigmap.width*y]+=core.values.lavaDamage||0;
continue;
}
var enemy = core.material.enemys[id];
// 存在领域
if (core.enemys.hasSpecial(enemy.special, 15)) {
var range = enemy.range || 1;
var zoneSquare = false;
if (core.isset(enemy.zoneSquare)) zoneSquare=enemy.zoneSquare;
for (var dx=-range;dx<=range;dx++) {
for (var dy=-range;dy<=range;dy++) {
if (dx==0 && dy==0) continue;
var nx=x+dx, ny=y+dy;
if (nx<0 || nx>=core.bigmap.width || ny<0 || ny>=core.bigmap.height) continue;
if (!zoneSquare && Math.abs(dx)+Math.abs(dy)>range) continue;
core.status.checkBlock.damage[nx+ny*core.bigmap.width]+=enemy.value||0;
}
}
}
// 存在激光
if (core.enemys.hasSpecial(enemy.special, 24)) {
for (var nx=0;nx<core.bigmap.width;nx++) {
if (nx!=x) core.status.checkBlock.damage[nx+y*core.bigmap.width]+=enemy.value||0;
}
for (var ny=0;ny<core.bigmap.height;ny++) {
if (ny!=y) core.status.checkBlock.damage[x+ny*core.bigmap.width]+=enemy.value||0;
}
}
// 存在阻击
if (core.enemys.hasSpecial(enemy.special, 18)) {
for (var dx=-1;dx<=1;dx++) {
for (var dy=-1;dy<=1;dy++) {
if (dx==0 && dy==0) continue;
var nx=x+dx, ny=y+dy;
if (nx<0 || nx>=core.bigmap.width || ny<0 || ny>=core.bigmap.height || Math.abs(dx)+Math.abs(dy)>1) continue;
core.status.checkBlock.damage[nx+ny*core.bigmap.width]+=enemy.value||0;
}
}
}
}
}
}
// Step3: 更新夹击点坐标并将夹击伤害加入到damage中
core.status.checkBlock.betweenAttack = []; // 记录(x,y)点是否有夹击
for (var x=0;x<core.bigmap.width;x++) {
for (var y=0;y<core.bigmap.height;y++) {
var has=false;
if (x>0 && x<core.bigmap.width-1) {
var id1=core.status.checkBlock.map[x-1+core.bigmap.width*y],
id2=core.status.checkBlock.map[x+1+core.bigmap.height*y];
if (core.isset(id1) && core.isset(id2) && id1==id2) {
var enemy = core.material.enemys[id1];
if (core.isset(enemy) && core.enemys.hasSpecial(enemy.special, 16)) {
has = true;
}
}
}
if (y>0 && y<core.bigmap.height-1) {
var id1=core.status.checkBlock.map[x+core.bigmap.width*(y-1)],
id2=core.status.checkBlock.map[x+core.bigmap.width*(y+1)];
if (core.isset(id1) && core.isset(id2) && id1==id2) {
var enemy = core.material.enemys[id1];
if (core.isset(enemy) && core.enemys.hasSpecial(enemy.special, 16)) {
has = true;
}
}
}
// 存在夹击
if (has) {
core.status.checkBlock.betweenAttack[x+core.bigmap.width*y]=true;
var leftHp = core.status.hero.hp - core.status.checkBlock.damage[x+core.bigmap.width*y];
if (leftHp>1)
core.status.checkBlock.damage[x+core.bigmap.width*y] += Math.floor((leftHp+(core.flags.betweenAttackCeil?0:1))/2);
}
}
}
return core.enemys.updateCheckBlock();
}
////// 检查并执行领域、夹击、阻击事件 //////
@ -1944,23 +1835,25 @@ control.prototype.replay = function () {
if (core.canUseItem(itemId)) {
var tools = Object.keys(core.status.hero.items.tools).sort();
var constants = Object.keys(core.status.hero.items.constants).sort();
var index;
var index=-1;
if ((index=tools.indexOf(itemId))>=0) {
core.status.event.data = {"toolsPage":Math.floor(index/12)+1, "constantsPage":1, "selectId":null}
core.status.event.data = {"toolsPage":Math.floor(index/12)+1, "constantsPage":1, "selectId":null};
index = index%12;
}
else if (index=constants.indexOf(itemId)>=0) {
core.status.event.data = {"toolsPage":1, "constantsPage":Math.floor(index/12)+1, "selectId":null}
core.status.event.data = {"toolsPage":1, "constantsPage":Math.floor(index/12)+1, "selectId":null};
index = index%12+12;
}
core.ui.drawToolbox(index);
if (index>=0) {
core.ui.drawToolbox(index);
setTimeout(function () {
core.ui.closePanel();
core.useItem(itemId, function () {
core.replay();
});
}, 750 / Math.max(1, core.status.replay.speed));
return;
return;
}
}
}
else if (action.indexOf("unEquip:")==0) {
@ -1979,16 +1872,18 @@ control.prototype.replay = function () {
var equipId = action.substring(6);
var ownEquipment = Object.keys(core.status.hero.items.equips).sort();
var index = ownEquipment.indexOf(equipId);
core.status.event.data = {"page":Math.floor(index/12)+1, "selectId":null}
index = index%12+12;
core.ui.drawEquipbox(index);
setTimeout(function () {
core.ui.closePanel();
core.loadEquip(equipId, function () {
core.replay();
});
}, 750 / Math.max(1, core.status.replay.speed));
return;
if (index>=0) {
core.status.event.data = {"page":Math.floor(index/12)+1, "selectId":null};
index = index%12+12;
core.ui.drawEquipbox(index);
setTimeout(function () {
core.ui.closePanel();
core.loadEquip(equipId, function () {
core.replay();
});
}, 750 / Math.max(1, core.status.replay.speed));
return;
}
}
else if (action.indexOf("fly:")==0) {
var floorId=action.substring(4);
@ -2691,7 +2586,7 @@ control.prototype.clearStatusBar = function() {
core.statusBar[e].innerHTML = "&nbsp;";
});
core.statusBar.image.book.style.opacity = 0.3;
if (!core.flags.equipboxBotton) {
if (!core.flags.equipboxButton) {
core.statusBar.image.fly.style.opacity = 0.3;
}
}
@ -2769,7 +2664,7 @@ control.prototype.updateStatusBar = function () {
core.statusBar.image.book.src = core.statusBar.icons.book.src;
core.statusBar.image.book.style.opacity = core.hasItem('book')?1:0.3;
if (!core.flags.equipboxBotton) {
if (!core.flags.equipboxButton) {
core.statusBar.image.fly.src = core.statusBar.icons.fly.src;
core.statusBar.image.fly.style.opacity = core.hasItem('fly')?1:0.3;
}

View File

@ -221,6 +221,11 @@ 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

@ -988,12 +988,7 @@ events.prototype.getItem = function (itemId, itemNum, itemX, itemY, callback) {
core.canvas.event.clearRect(itemX * 32, itemY * 32, 32, 32);
core.updateStatusBar();
// 检查处理后的事件。
var event = core.floors[core.status.floorId].afterGetItem[itemX+","+itemY];
if (core.isset(event)) {
core.events.doEvents(event, itemX, itemY, callback);
}
else if (core.isset(callback)) callback();
this.eventdata.afterGetItem(itemId, itemX, itemY, callback);
}
////// 开门 //////
@ -1087,17 +1082,17 @@ events.prototype.battle = function (id, x, y, force, callback) {
}
else {
var nowEquipment = 'hand';
if (core.flags.equipment) {
var equipId = core.status.hero.equipment[0];
if (core.isset(equipId))
if (core.isset(core.material.items[equipId].equip.animate))
core.drawAnimate(core.material.items[equipId].equip.animate, x, y);
}
else {
core.playSound('attack.mp3');
core.drawAnimate('hand', x, y);
var equipId = (core.status.hero.equipment||[])[0];
if (core.isset(equipId) && core.isset(core.material.items[equipId])
&& core.isset(core.material.items[equipId].equip.animate))
nowEquipment = core.material.items[equipId].equip.animate;
}
core.playSound('attack.mp3');
core.drawAnimate(nowEquipment, x, y);
core.events.afterBattle(id, x, y, callback);
}
}

View File

@ -98,8 +98,12 @@ items.prototype.hasItem = function (itemId) {
////// 是否装备某件装备 //////
items.prototype.hasEquip = function (equipId) {
if (!core.isset(equipId)) return null;
if (!core.isset((core.material.items[equipId]||{}).equip)) return null;
var equiptype = core.material.items[equipId].equip.type;
return core.status.hero.equipment[equiptype] == equipId;
return equipId == (core.status.hero.equipment||[])[equiptype];
}
////// 设置某个物品的个数 //////
@ -149,10 +153,16 @@ items.prototype.addItem = function (itemId, itemNum) {
////// 换上 //////
items.prototype.loadEquip = function (equipId, callback) {
if (!core.isset(core.status.hero.equipment)) core.status.hero.equipment = [];
core.playSound('equip.mp3');
var loadEquip = core.material.items[equipId];
if (!core.isset(loadEquip)) {
if (core.isset(callback)) callback();
return;
}
var loadEquipType = loadEquip.equip.type;
var unloadEquipId = core.status.hero.equipment[loadEquipType];
@ -171,23 +181,29 @@ items.prototype.loadEquip = function (equipId, callback) {
core.status.route.push("equip:"+equipId);
// 装备更换完毕:删除换上的装备
core.status.hero.items["equips"][equipId]--;
if (core.status.hero.items["equips"][equipId]==0)
delete core.status.hero.items["equips"][equipId];
core.removeItem(equipId);
// 装备更换完毕:增加卸下的装备
if (core.isset(unloadEquipId))
core.addItem(unloadEquipId, 1);
core.log("已装备上"+loadEquip.name, core.material.icons.items[equipId]);
if (core.isset(callback)) callback();
}
////// 卸下 //////
items.prototype.unloadEquip = function (equipType, callback) {
if (!core.isset(core.status.hero.equipment)) core.status.hero.equipment = [];
core.playSound('equip.mp3');
var unloadEquipId = core.status.hero.equipment[equipType];
if (!core.isset(unloadEquipId)) {
if (core.isset(callback)) callback();
return;
}
var unloadEquip = core.material.items[unloadEquipId];
// 处理能力值改变
@ -206,6 +222,8 @@ items.prototype.unloadEquip = function (equipType, callback) {
// 装备更换完毕:增加卸下的装备
core.addItem(unloadEquipId, 1);
core.drawTip("已卸下"+unloadEquip.name, core.material.icons.items[unloadEquipId]);
if (core.isset(callback)) callback();
}
@ -213,15 +231,15 @@ items.prototype.compareEquipment = function (compareEquipId, beComparedEquipId)
var compareAtk = 0, compareDef = 0, compareMdef = 0;
if (core.isset(compareEquipId)) {
var compareEquip = core.material.items[compareEquipId];
compareAtk += compareEquip.equip.atk || 0;
compareDef += compareEquip.equip.def || 0;
compareMdef += compareEquip.equip.mdef || 0;
compareAtk += (compareEquip.equip||{}).atk || 0;
compareDef += (compareEquip.equip||{}).def || 0;
compareMdef += (compareEquip.equip||{}).mdef || 0;
}
if (core.isset(beComparedEquipId)) {
var beComparedEquip = core.material.items[beComparedEquipId];
compareAtk -= beComparedEquip.equip.atk || 0;
compareDef -= beComparedEquip.equip.def || 0;
compareMdef -= beComparedEquip.equip.mdef || 0;
compareAtk -= (beComparedEquip.equip||{}).atk || 0;
compareDef -= (beComparedEquip.equip||{}).def || 0;
compareMdef -= (beComparedEquip.equip||{}).mdef || 0;
}
return {"atk":compareAtk,"def":compareDef,"mdef":compareMdef};
}

View File

@ -397,7 +397,7 @@ main.statusBar.image.fly.onclick = function () {
}
if (main.core.isPlaying()) {
if (!main.core.flags.equipboxBotton) {
if (!main.core.flags.equipboxButton) {
main.core.useFly(true);
}
else {

@ -1 +0,0 @@
Subproject commit 45645884940c700b6121ffdd3624f9ed0ed062cb

View File

@ -72,10 +72,7 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"mdef": 100,
"money": 100,
"experience": 0,
"equipment": [
null,
null
],
"equipment": [],
"items": {
"keys": {
"yellowKey": 0,
@ -204,7 +201,7 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"snowFourDirections": false,
"bigKeyIsBox": false,
"equipment": true,
"equipboxBotton": false,
"equipboxButton": false,
"enableAddPoint": false,
"enableNegativeDamage": false,
"hatredDecrease": true,

View File

@ -16,7 +16,7 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
if (core.flags.snowFourDirections)
core.material.items.bomb.text = "可以将四周的熔岩变成平地";
// 是否启用装备栏
if (core.flags.equipboxBotton) {
if (core.flags.equipboxButton) {
core.statusBar.image.fly.src = core.statusBar.icons.equipbox.src;
core.flags.equipment = true;
}
@ -221,9 +221,9 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
// 在这里增加其他的自定义事件需求
/*
if (enemyId=='xxx') {
core.unshift(todo, [
{"type": "...", ...},
]);
core.unshift(todo, [
{"type": "...", ...},
]);
}
*/
@ -266,6 +266,24 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
}
if (core.isset(callback)) callback();
},
////// 获得一个道具后触发的事件 //////
"afterGetItem" : function(itemId,x,y,callback) {
// 获得一个道具后触发的事件
var todo = [];
if (core.isset(x) && core.isset(y)) {
var event = core.floors[core.status.floorId].afterGetItem[x+","+y];
if (core.isset(event)) {
core.unshift(todo, event);
}
}
if (todo.length>0) {
core.events.insertAction(todo,x,y);
}
if (core.isset(callback)) callback();
},
////// 改变亮灯之后,可以触发的事件 //////
"afterChangeLight" : function(x,y) {
// 改变亮灯之后,可以触发的事件
@ -449,6 +467,125 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
"damage": damage
};
},
"updateCheckBlock": function () {
// 领域、夹击、阻击等的伤害值计算
core.status.checkBlock = {};
if (!core.isset(core.status.thisMap)) return;
var blocks = core.status.thisMap.blocks;
// Step1: 更新怪物地图
core.status.checkBlock.map = []; // 记录怪物地图
for (var n=0;n<blocks.length;n++) {
var block = blocks[n];
if (core.isset(block.event) && !block.disable && block.event.cls.indexOf('enemy')==0) {
var id = block.event.id, enemy = core.material.enemys[id];
if (core.isset(enemy)) {
core.status.checkBlock.map[block.x+core.bigmap.width*block.y]=id;
}
}
// 血网
if (core.isset(block.event) && !block.disable &&
block.event.id=='lavaNet' && block.event.trigger=='passNet' && !core.hasItem("shoes")) {
core.status.checkBlock.map[block.x+core.bigmap.width*block.y]="lavaNet";
}
}
// Step2: 更新领域、阻击伤害
core.status.checkBlock.damage = []; // 记录(x,y)点的伤害;(x,y)对应的值是 x+y*core.bigmap
for (var x=0;x<core.bigmap.width*core.bigmap.height;x++) core.status.checkBlock.damage[x]=0;
for (var x=0;x<core.bigmap.width;x++) {
for (var y=0;y<core.bigmap.height;y++) {
var id = core.status.checkBlock.map[x+core.bigmap.width*y];
if (core.isset(id)) {
if (id=="lavaNet") {
core.status.checkBlock.damage[x+core.bigmap.width*y]+=core.values.lavaDamage||0;
continue;
}
var enemy = core.material.enemys[id];
// 存在领域
// 如果要防止领域伤害,可以直接简单的将 flag:no_zone 设为true
if (core.enemys.hasSpecial(enemy.special, 15) && !core.hasFlag("no_zone")) {
var range = enemy.range || 1;
var zoneSquare = false;
if (core.isset(enemy.zoneSquare)) zoneSquare=enemy.zoneSquare;
for (var dx=-range;dx<=range;dx++) {
for (var dy=-range;dy<=range;dy++) {
if (dx==0 && dy==0) continue;
var nx=x+dx, ny=y+dy;
if (nx<0 || nx>=core.bigmap.width || ny<0 || ny>=core.bigmap.height) continue;
if (!zoneSquare && Math.abs(dx)+Math.abs(dy)>range) continue;
core.status.checkBlock.damage[nx+ny*core.bigmap.width]+=enemy.value||0;
}
}
}
// 存在激光
// 如果要防止激光伤害,可以直接简单的将 flag:no_laser 设为true
if (core.enemys.hasSpecial(enemy.special, 24) && !core.hasFlag("no_laser")) {
for (var nx=0;nx<core.bigmap.width;nx++) {
if (nx!=x) core.status.checkBlock.damage[nx+y*core.bigmap.width]+=enemy.value||0;
}
for (var ny=0;ny<core.bigmap.height;ny++) {
if (ny!=y) core.status.checkBlock.damage[x+ny*core.bigmap.width]+=enemy.value||0;
}
}
// 存在阻击
// 如果要防止阻击伤害,可以直接简单的将 flag:no_snipe 设为true
if (core.enemys.hasSpecial(enemy.special, 18) && !core.hasFlag("no_snipe")) {
for (var dx=-1;dx<=1;dx++) {
for (var dy=-1;dy<=1;dy++) {
if (dx==0 && dy==0) continue;
var nx=x+dx, ny=y+dy;
if (nx<0 || nx>=core.bigmap.width || ny<0 || ny>=core.bigmap.height || Math.abs(dx)+Math.abs(dy)>1) continue;
core.status.checkBlock.damage[nx+ny*core.bigmap.width]+=enemy.value||0;
}
}
}
}
}
}
// Step3: 更新夹击点坐标并将夹击伤害加入到damage中
core.status.checkBlock.betweenAttack = []; // 记录(x,y)点是否有夹击
// 如果要防止夹击伤害,可以简单的将 flag:no_betweenAttack 设为true
if (!core.hasFlag('no_betweenAttack')) {
for (var x=0;x<core.bigmap.width;x++) {
for (var y=0;y<core.bigmap.height;y++) {
var has=false;
if (x>0 && x<core.bigmap.width-1) {
var id1=core.status.checkBlock.map[x-1+core.bigmap.width*y],
id2=core.status.checkBlock.map[x+1+core.bigmap.height*y];
if (core.isset(id1) && core.isset(id2) && id1==id2) {
var enemy = core.material.enemys[id1];
if (core.isset(enemy) && core.enemys.hasSpecial(enemy.special, 16)) {
has = true;
}
}
}
if (y>0 && y<core.bigmap.height-1) {
var id1=core.status.checkBlock.map[x+core.bigmap.width*(y-1)],
id2=core.status.checkBlock.map[x+core.bigmap.width*(y+1)];
if (core.isset(id1) && core.isset(id2) && id1==id2) {
var enemy = core.material.enemys[id1];
if (core.isset(enemy) && core.enemys.hasSpecial(enemy.special, 16)) {
has = true;
}
}
}
// 计算夹击伤害
if (has) {
core.status.checkBlock.betweenAttack[x+core.bigmap.width*y]=true;
var leftHp = core.status.hero.hp - core.status.checkBlock.damage[x+core.bigmap.width*y];
if (leftHp>1)
core.status.checkBlock.damage[x+core.bigmap.width*y] += Math.floor((leftHp+(core.flags.betweenAttackCeil?0:1))/2);
}
}
}
}
},
"updateEnemys" : function () {
// 更新怪物数据,可以在这里对怪物属性和数据进行动态更新,详见文档——事件——怪物数据的动态修改
// 比如下面这个例子如果flag:xxx为真则将绿头怪的攻击设为100金币设为20

View File

@ -203,12 +203,13 @@ icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 =
'greenPotion': 22,
'yellowPotion': 23,
'lifeWand': 33,
'blank': 60,
"sword0": 60,
'sword1': 50,
'sword2': 51,
'sword3': 52,
'sword4': 53,
'sword5': 54,
"shield0": 61,
'shield1': 55,
'shield2': 56,
'shield3': 57,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -45,8 +45,18 @@ items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"cls": "items",
"name": "绿血瓶"
},
"sword0": {
"cls": "items",
"name": "破旧的剑",
"text": "一把已经生锈的剑",
"equip": {
"type": 0,
"atk": 0,
"animate": "sword"
}
},
"sword1": {
"cls": "item",
"cls": "items",
"name": "铁剑",
"text": "一把很普通的铁剑",
"equip":{
@ -95,6 +105,15 @@ items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"animate": "sword"
}
},
"shield0": {
"cls": "items",
"name": "破旧的盾",
"text": "一个很破旧的铁盾",
"equip": {
"type": 1,
"def": 0
}
},
"shield1": {
"cls": "items",
"name": "铁盾",
@ -279,11 +298,13 @@ items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"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",
"sword0": "core.status.hero.atk += 0",
"sword1": "core.status.hero.atk += 10",
"sword2": "core.status.hero.atk += 20",
"sword3": "core.status.hero.atk += 40",
"sword4": "core.status.hero.atk += 80",
"sword5": "core.status.hero.atk += 100",
"shield0": "core.status.hero.def += 0",
"shield1": "core.status.hero.def += 10",
"shield2": "core.status.hero.def += 20",
"shield3": "core.status.hero.def += 40",
@ -302,16 +323,18 @@ items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"bluePotion": "',生命+'+core.values.bluePotion * ratio",
"yellowPotion": "',生命+'+core.values.yellowPotion * ratio",
"greenPotion": "',生命+'+core.values.greenPotion * ratio",
"sword1": ",攻击+10",
"sword2": ",攻击+20",
"sword3": ",攻击+40",
"sword4": ",攻击+80",
"sword5": ",攻击+100",
"shield1": ",防御+10",
"shield2": ",防御+20",
"shield3": ",防御+40",
"shield4": ",防御+80",
"shield5": ",防御+100魔防+100",
"sword0": "',攻击+0'",
"sword1": "',攻击+10'",
"sword2": "',攻击+20'",
"sword3": "',攻击+40'",
"sword4": "',攻击+80'",
"sword5": "',攻击+100'",
"shield0": "',防御+0'",
"shield1": "',防御+10'",
"shield2": "',防御+20'",
"shield3": "',防御+40'",
"shield4": "',防御+80'",
"shield5": "',防御+100魔防+100'",
"bigKey": "',全钥匙+1'",
"superPotion": "',生命值翻倍'",
"moneyPocket": "',金币+'+core.values.moneyPocket"