a26b29f9-1c56-42fb-a862-02ba6dff98a2.js
3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
"use strict";
cc._RF.push(module, 'a26b2n5HFZC+6hiArpt/5ii', 'BlockSkillFirework');
// scripts/kernel/battle/map/blockSkill/BlockSkillFirework.ts
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.BlockSkillFirework = void 0;
var BattleConst_1 = require("../../BattleConst");
var BlockSkillBase_1 = require("./BlockSkillBase");
var BlockSkillFirework = /** @class */ (function (_super) {
__extends(BlockSkillFirework, _super);
function BlockSkillFirework(owner, type) {
var _this = _super.call(this, type, owner) || this;
if (type == BattleConst_1.BlockSkill.FIREWORK_VERTICAL) {
_this._skillImg = 'UI_yxz_tsfk_pzjg';
}
else if (type == BattleConst_1.BlockSkill.FIREWORK_HORIZON) {
_this._skillImg = 'UI_yxz_tsfk_pzjg2';
}
else if (type == BattleConst_1.BlockSkill.FIREWORK_DOUBLE) {
_this._skillImg = 'UI_yxz_tsfk_pzjg3';
}
else {
_this._skillImg = '';
}
return _this;
}
// onAddedToBlock(): void {
// this.owner.canSlide = false;
// }
BlockSkillFirework.prototype.onDead = function () {
//清除对应方向的格子
if (this.skillId == BattleConst_1.BlockSkill.FIREWORK_HORIZON || this.skillId == BattleConst_1.BlockSkill.FIREWORK_DOUBLE) {
for (var x = 0; x < this.owner.map.mapGridSize.x; ++x) {
if (x == this.owner.gridPos.x) {
continue;
}
var block = this.owner.map.getBlockByGridPos(x, this.owner.gridPos.y);
var jump = (block && !block.isDead && block.skill && block.skill.skillId >= BattleConst_1.BlockSkill.FIREWORK_VERTICAL && block.skill.skillId <= BattleConst_1.BlockSkill.FIREWORK_DOUBLE);
jump = (jump || (block && block.isProtected)); //增加被保护检测
if (jump) {
continue; //不触发别的烟花
}
if (block && !block.isDead && block.isVisible) {
block.dead();
}
}
}
if (this.skillId == BattleConst_1.BlockSkill.FIREWORK_VERTICAL || this.skillId == BattleConst_1.BlockSkill.FIREWORK_DOUBLE) {
for (var y = 0; y < this.owner.map.mapGridSize.y; ++y) {
if (y == this.owner.gridPos.y) {
continue;
}
var block = this.owner.map.getBlockByGridPos(this.owner.gridPos.x, y);
var jump = (block && !block.isDead && block.skill && block.skill.skillId >= BattleConst_1.BlockSkill.FIREWORK_VERTICAL && block.skill.skillId <= BattleConst_1.BlockSkill.FIREWORK_DOUBLE);
jump = (jump || (block && block.isProtected)); //增加被保护检测
if (jump) {
continue; //不触发别的烟花
}
if (block && !block.isDead && block.isVisible) {
block.dead();
}
}
}
};
return BlockSkillFirework;
}(BlockSkillBase_1.BlockSkillBase));
exports.BlockSkillFirework = BlockSkillFirework;
cc._RF.pop();