工作内容:
针对网上现存的有关实现战棋战斗形式方面的插件进行了整理,并对其中的技能范围进行了增添,
在原有的菱形(diamond)方形(rect)十字形(line)的基础上增添了直线型的技能范围。
Game_Map.prototype.createArea = function(x, y, param) {
var area = {};
if (param[0] === 'diamond') {
this.setArea(area, this.isAreaValidDiamond, x, y, +param[1], true);
} else if (param[0] === 'rect') {
this.setArea(area, this.isAreaValidRect, x, y, +param[1], true);
} else if (param[0] === 'line') {
this.setArea(area, this.isAreaValidLine, x, y, +param[1], true);
} else if (param[0] === 'straight') {
this.setArea(area, this.isAreaValidPortrait, x, y, +param[1], true);
} else if (param[0] === 'x') {
this.setArea(area, this.isAreaValidX, x, y, +param[1], true);
} else if (param[0] === 'T') {
this.setArea(area, this.isAreaValidT, x, y, +param[1], true);
} else if (param[0] === 'foward') {
this.setArea(area, this.isAreaValidFoward, x, y, +param[1], true);
}
if (param[2] === 'diamond') {
this.deleteArea(area, this.isAreaValidDiamond, x, y, +param[3], false);
} else if (param[2] === 'rect') {
this.deleteArea(area, this.isAreaValidRect, x, y, +param[3], false);
} else if (param[2] === 'line') {
this.deleteArea(area, this.isAreaValidLine, x, y, +param[3], false);
} else if (param[2] === 'straight') {
this.deleteArea(area, this.isAreaValidPortrait, x, y, +param[3], false);
} else if (param[2] === 'x') {
this.deleteArea(area, this.isAreaValidX, x, y, +param[3], false);
} else if (param[2] === 'T') {
this.deleteArea(area, this.isAreaValidT, x, y, +param[3], false);
} else if (param[2] === 'foward') {
this.deleteArea(area, this.isAreaValidFoward, x, y, +param[3], false);
}
return area;
};
对四元素领域增添了场景特效,效果图如下。