085ded7f-72d3-4c85-92a5-f5f26745dd89.js
4.13 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
"use strict";
cc._RF.push(module, '085de1/ctNMhZKl9fJnRd2J', 'BlcokSkillFireworkView');
// scripts/prefabs/BlcokSkillFireworkView.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.BlockSkillFireworkView = void 0;
var BattleConst_1 = require("../kernel/battle/BattleConst");
var BlockSkillViewBase_1 = require("./BlockSkillViewBase");
var BlockSkillFireworkView = /** @class */ (function (_super) {
__extends(BlockSkillFireworkView, _super);
function BlockSkillFireworkView() {
return _super !== null && _super.apply(this, arguments) || this;
}
BlockSkillFireworkView.prototype.onDead = function () {
_super.prototype.onDead.call(this);
//播放特效
if (this._owner.owner.skill.skillId == BattleConst_1.BlockSkill.FIREWORK_VERTICAL || this._owner.owner.skill.skillId == BattleConst_1.BlockSkill.FIREWORK_DOUBLE) {
var startPixel = this._owner.owner.map.getPixelPosByGridPos(this._owner.owner.gridPos);
var upEffect_1 = cc.instantiate(this._mapView.prefabCollection.getChildByName('spineFirework'));
upEffect_1.setPosition(startPixel.x, startPixel.y + 2);
upEffect_1.active = true;
var downEffect_1 = cc.instantiate(this._mapView.prefabCollection.getChildByName('spineFirework'));
downEffect_1.setPosition(startPixel.x, startPixel.y - 2);
downEffect_1.angle = 180;
downEffect_1.active = true;
this._mapView.effectLayer.addChild(upEffect_1);
this._mapView.effectLayer.addChild(downEffect_1);
upEffect_1.getComponent(sp.Skeleton).setCompleteListener(function () {
upEffect_1.destroy();
});
upEffect_1.getComponent(sp.Skeleton).setAnimation(0, 'animation', false);
downEffect_1.getComponent(sp.Skeleton).setCompleteListener(function () {
downEffect_1.destroy();
});
downEffect_1.getComponent(sp.Skeleton).setAnimation(0, 'animation', false);
}
if (this._owner.owner.skill.skillId == BattleConst_1.BlockSkill.FIREWORK_HORIZON || this._owner.owner.skill.skillId == BattleConst_1.BlockSkill.FIREWORK_DOUBLE) {
var startPixel = this._owner.owner.map.getPixelPosByGridPos(this._owner.owner.gridPos);
var leftEffect_1 = cc.instantiate(this._mapView.prefabCollection.getChildByName('spineFirework'));
leftEffect_1.setPosition(startPixel.x + 2, startPixel.y);
leftEffect_1.angle = 270;
leftEffect_1.active = true;
var rightEffect_1 = cc.instantiate(this._mapView.prefabCollection.getChildByName('spineFirework'));
rightEffect_1.setPosition(startPixel.x - 2, startPixel.y);
;
rightEffect_1.angle = 90;
rightEffect_1.active = true;
this._mapView.effectLayer.addChild(leftEffect_1);
this._mapView.effectLayer.addChild(rightEffect_1);
leftEffect_1.getComponent(sp.Skeleton).setCompleteListener(function () {
leftEffect_1.destroy();
});
leftEffect_1.getComponent(sp.Skeleton).setAnimation(0, 'animation', false);
rightEffect_1.getComponent(sp.Skeleton).setCompleteListener(function () {
rightEffect_1.destroy();
});
rightEffect_1.getComponent(sp.Skeleton).setAnimation(0, 'animation', false);
}
};
return BlockSkillFireworkView;
}(BlockSkillViewBase_1.BlcokSkillViewBase));
exports.BlockSkillFireworkView = BlockSkillFireworkView;
cc._RF.pop();