You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
40 lines
1.1 KiB
|
3 weeks ago
|
/**
|
||
|
|
* 女巫加血
|
||
|
|
*/
|
||
|
|
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);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|