e4264377-a1ba-4255-9e7f-bb0c1a96f548.js 3.01 KB
"use strict";
cc._RF.push(module, 'e4264N3obpCVZ5/uwwalvVI', 'UserSkillShuriken');
// scripts/kernel/battle/userSkill/UserSkillShuriken.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.UserSkillShuriken = void 0;
var BattleConst_1 = require("../BattleConst");
var UserSkillBase_1 = require("./UserSkillBase");
var UserSkillShurikenData_1 = require("./UserSkillShurikenData");
var UserSkillShuriken = /** @class */ (function (_super) {
    __extends(UserSkillShuriken, _super);
    function UserSkillShuriken(battle) {
        var _this = _super.call(this, battle, BattleConst_1.UserSkill.SHURIKEN) || this;
        _this._tweenObj = {};
        return _this;
    }
    UserSkillShuriken.prototype.start = function (free) {
        if (free === void 0) { free = false; }
        var maxY = 0;
        this._battle.mapData.blockData.forEach(function (value, key, map) {
            if (value.contentY > maxY) {
                maxY = value.contentY;
            }
        }, this);
        UserSkillShurikenData_1.UserSkillShurikenData.maxY = maxY; //先计算坐标,以便通知显示层时有可用数据
        if (!UserSkillShuriken._isLock && _super.prototype.start.call(this, free)) {
            UserSkillShuriken._isLock = true;
            cc.tween(this._tweenObj).delay(1.7).call(this.doSkill.bind(this)).start();
            // this.doSkill();
            return true;
        }
        return false;
    };
    /**跳过检测,直接使用技能 */
    UserSkillShuriken.prototype.doSkill = function () {
        UserSkillShuriken._isLock = false;
        for (var x = 0; x < this._battle.mapData.mapGridSize.x; ++x) {
            var block = this._battle.mapData.getBlockByGridPos(x, UserSkillShurikenData_1.UserSkillShurikenData.maxY);
            block && block.dead();
        }
    };
    /**复活时调用的接口 */
    UserSkillShuriken.prototype.doSkillRevive = function () {
        var maxY = 0;
        this._battle.mapData.blockData.forEach(function (value, key, map) {
            if (value.contentY > maxY) {
                maxY = value.contentY;
            }
        }, this);
        UserSkillShurikenData_1.UserSkillShurikenData.maxY = maxY; //先计算坐标,以便通知显示层时有可用数据
        this.doSkill();
    };
    UserSkillShuriken._isLock = false;
    return UserSkillShuriken;
}(UserSkillBase_1.UserSkillBase));
exports.UserSkillShuriken = UserSkillShuriken;

cc._RF.pop();