public override void Tick(TickContext context) { _deathRunBehaviour.Tick(context); _pos += context.DeltaTimeSeconds * (float)(Math.PI / 10f); _positionChaserBehaviour.Target = _playerShip.Entity.Get <Transform>().Location + new Vector3( (float)Math.Cos(_pos) * _circleRadius, 0f, (float)Math.Sin(_pos) * _circleRadius ) + _playerOffset; _positionChaserBehaviour.Tick(context); _takeAimBehaviour.Tick(context); _fireTimer.Tick(context.DeltaTime); if (_fireTimer.Completed) { WeaponCapability.StandardFire(); _fireTimer.Restart(); } _changeAimTimer.Tick(context.DeltaTime); if (_changeAimTimer.Completed) { _oscillateMode = !_oscillateMode; _changeAimTimer.Restart(); _takeAimBehaviour.SetRandomAimOffset((float)Math.PI / 3); } }
public override void Tick(TickContext context) { if (!Active) { return; } _deathRunBehaviour.Tick(context); if (!_deathRunBehaviour.Running) { _positionChaserBehaviour.Target = _playerShip.Entity.Get <Transform>().Location + _playerOffset; } _positionChaserBehaviour.Tick(context); _speedAlternateTimer.Tick(context.DeltaTime); if (_speedAlternateTimer.Completed) { _speedAlternateTimer.Restart(); _speedMode = !_speedMode; //_positionChaserBehaviour.CatchupSpeed = _speedMode ? 0f : 2f; _speedAlternateTimer.ChangeTarget(_speedMode ? TimeSpan.FromSeconds(9999) : TimeSpan.FromSeconds(1)); } _alternateTimer.Tick(context.DeltaTime); if (_alternateTimer.Completed) { _alternateTimer.Restart(); _shootMode = !_shootMode; } _fireTimer.Tick(context.DeltaTime); if (_fireTimer.Completed) { if (_shootMode) { WeaponCapability.StandardFire(); } _fireTimer.Restart(); } _shieldTimer.Tick(context.DeltaTime); if (_shieldTimer.Completed) { _playerShip.AddEnergy(100); WeaponCapability.ShieldDeploy(); } }
public override void Tick(TickContext context) { if (!_iniTimer.Completed) { _iniTimer.Tick(context.DeltaTime); return; } _pos += context.DeltaTimeSeconds * (float)(Math.PI / 10f); _positionChaserBehaviour.Target = _playerShip.Entity.Get <Transform>().Location + new Vector3( (float)Math.Cos(_pos) * _circleRadius, 0f, (float)Math.Sin(_pos) * _circleRadius ) + _playerOffset; _positionChaserBehaviour.Tick(context); //_takeAimBehaviour.Tick(context); _fireTimer.Tick(context.DeltaTime); if (_fireTimer.Completed) { WeaponCapability.StandardFire(); _fireTimer.Restart(); } //_changeAimTimer.Tick(context.DeltaTime); //if (_changeAimTimer.Completed) //{ // _oscillateMode = !_oscillateMode; // _changeAimTimer.Restart(); // _takeAimBehaviour.SetRandomAimOffset((float)Math.PI/3); //} _shieldDeployTimer.Tick(context.DeltaTime); if (_shieldDeployTimer.Completed) { WeaponCapability.ShieldDeploy(); _shieldDeployTimer.Restart(); } _bombardTimer.Tick(context.DeltaTime); if (_bombardTimer.Completed) { _bombardTimer.Restart(); WeaponCapability.BombardFire(); } _fireTimer.Tick(context.DeltaTime); if (_fireTimer.Completed) { _shotCount++; if (_shotCount % 5 == 0) { WeaponCapability.HeavyFire(); } else { WeaponCapability.StandardFire(); } _fireTimer.Restart(); } WeaponCapability.RocketBlast(); FlightShip.Update(() => { FlightShip.Rotation += 0.01f * context.DeltaTimeSeconds; FlightShip.AddEnergy(100); }); }