public override void Execute(GameObject actor) { if (_actor != actor) { _actor = actor.GetComponent <CharacterComponent>(); } _actor.Fire(); }
public override void Update(uint time, int ticksPassed) { if (firing) { Character.Fire(time); } Physics.Update(ticksPassed, Services.Game.Level); Character.Update(time, ticksPassed); }
public override void Update(uint time, int ticksPassed) { if (updateTimer.Update(time)) { UpdateTarget(time); } if (Target != null && CanSeeTarget(Target)) { if (!InFiringRange(Target)) { MoveTowardsTarget(); } else { Character.AimAt(Target.Location.ToPoint()); if (Character.Weapon.ReloadNeeded) { MoveToCover(); Character.Weapon.Reload(time); } else { if (fireTimer.Update(time)) { Character.Fire(time, Accuracy); } } } } Physics.Update(ticksPassed, Services.Game.Level); Physics.Impulse = Vector.Zero; Character.Update(time, ticksPassed); }