public override void Tick(TickContext context) { if (!Active) { return; } _alternateTimer.Tick(context.DeltaTime); if (_alternateTimer.Completed) { _alternateTimer.Restart(); _shootMode = !_shootMode; } _fireTimer.Tick(context.DeltaTime); if (_fireTimer.Completed) { if (_shootMode) { WeaponCapability.StandardFire(); } else { WeaponCapability.HeavyFire(); } _fireTimer.Restart(); } _shieldTimer.Tick(context.DeltaTime); if (_shieldTimer.Completed) { _playerShip.AddEnergy(100); WeaponCapability.ShieldDeploy(); } _despawnTimer.Tick(context.DeltaTime); if (_despawnTimer.Completed) { Entity.Delete(); } }
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); }); }