369164bb-a5dc-4b9f-8335-08a2b8e33f53.js
2.02 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
"use strict";
cc._RF.push(module, '36916S7pdxLn4M1CKK44z9T', 'BombBlockData');
// scripts/kernel/battle/map/BombBlockData.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.BombBlockData = void 0;
var BlockData_1 = require("./BlockData");
var BombBlockData = /** @class */ (function (_super) {
__extends(BombBlockData, _super);
function BombBlockData() {
return _super !== null && _super.apply(this, arguments) || this;
}
//#region life cycle
BombBlockData.prototype.onDead = function () {
_super.prototype.onDead.call(this);
var startX = cc.clamp(this.gridPos.x - 1, 0, this.map.mapGridSize.x - 1);
var endX = cc.clamp(this.gridPos.x + 1, 0, this.map.mapGridSize.x - 1);
var startY = cc.clamp(this.gridPos.y - 1, 0, this.map.mapGridSize.y - 1);
var endY = cc.clamp(this.gridPos.y + 1, 0, this.map.mapGridSize.y - 1);
for (var x = startX; x <= endX; ++x) {
for (var y = startY; y <= endY; ++y) {
if (x == this.gridPos.x && y == this.gridPos.y) {
continue;
}
var block = this.map.getBlockByGridPos(x, y);
//消除周围的格子
if (block) {
block.dead();
}
}
}
};
return BombBlockData;
}(BlockData_1.BlockData));
exports.BombBlockData = BombBlockData;
cc._RF.pop();