/** * 女巫加血 */ import { _decorator, Component, easing, Tween, tween, Vec3 } from 'cc'; import { ChapterNewPlayTypeEnum, IWitchProperty } from '../../../game/ChapterPlayTypes'; import { Monster } from '../Monster'; import { SingleWitch } from './SingleWitch'; const { ccclass, property } = _decorator; @ccclass('MechanismWitchSchedule') export class MechanismWitchSchedule extends Component { /**间隔时间 */ private intervalTime: number = 0; witchInfo: IWitchProperty = null; start() { this.witchInfo = gg.data.project.getChapterNewPlayInfo(ChapterNewPlayTypeEnum.Witch); //BattleManager.Instance.witchHpCoefficient = this.witchInfo.addHpCoefficient; this.intervalTime = this.witchInfo.startTime; } protected update(dt: number): void { if (!gg.game.CurentBattle.canUpdateFrame()) return; this.intervalTime -= dt * gg.game.CurentBattle.TimeScale; if (this.intervalTime <= 0) { this.trigger(); } } trigger() { this.intervalTime = this.witchInfo.intervalTime; // gg.game.CurentBattle.spawnWitchMonster(this.witchInfo); } }