Exemplo n.º 1
0
            public override Activity Tick(Actor self)
            {
                if (ChildActivity != null)
                {
                    ChildActivity = ActivityUtils.RunActivityTick(self, ChildActivity);
                    if (ChildActivity != null)
                    {
                        return(this);
                    }
                }

                if (IsCanceling || !attack.CanAttack(self, target))
                {
                    return(NextActivity);
                }

                if (attack.charges == 0)
                {
                    return(NextActivity);
                }

                attack.DoAttack(self, target);

                QueueChild(self, new Wait(attack.info.ChargeDelay), true);
                return(this);
            }
Exemplo n.º 2
0
            public override Activity Tick(Actor self)
            {
                if (ChildActivity != null)
                {
                    ChildActivity = ActivityUtils.RunActivityTick(self, ChildActivity);
                    if (ChildActivity != null)
                    {
                        return(this);
                    }
                }

                if (IsCanceling || !attack.CanAttack(self, target))
                {
                    return(NextActivity);
                }

                if (attack.charges == 0)
                {
                    return(this);
                }

                foreach (var notify in self.TraitsImplementing <INotifyTeslaCharging>())
                {
                    notify.Charging(self, target);
                }

                if (!string.IsNullOrEmpty(attack.info.ChargeAudio))
                {
                    Game.Sound.Play(SoundType.World, attack.info.ChargeAudio, self.CenterPosition);
                }

                QueueChild(self, new Wait(attack.info.InitialChargeDelay), true);
                QueueChild(self, new ChargeFire(attack, target));
                return(this);
            }
Exemplo n.º 3
0
            public override bool Tick(Actor self)
            {
                if (IsCanceling || !attack.CanAttack(self, target))
                {
                    return(true);
                }

                if (attack.charges == 0)
                {
                    return(false);
                }

                foreach (var notify in self.TraitsImplementing <INotifyTeslaCharging>())
                {
                    notify.Charging(self, target);
                }

                if (!string.IsNullOrEmpty(attack.info.ChargeAudio))
                {
                    Game.Sound.Play(SoundType.World, attack.info.ChargeAudio, self.CenterPosition);
                }

                QueueChild(new Wait(attack.info.InitialChargeDelay));
                QueueChild(new ChargeFire(attack, target));
                return(false);
            }
Exemplo n.º 4
0
            public override Activity Tick(Actor self)
            {
                if (IsCanceled || !attack.CanAttack(self, target))
                {
                    return(NextActivity);
                }

                if (attack.charges == 0)
                {
                    return(NextActivity);
                }

                attack.DoAttack(self, target);

                return(ActivityUtils.SequenceActivities(new Wait(attack.info.ChargeDelay), this));
            }
Exemplo n.º 5
0
            public override bool Tick(Actor self)
            {
                if (IsCanceling || !attack.CanAttack(self, target))
                {
                    return(true);
                }

                if (attack.charges == 0)
                {
                    return(true);
                }

                attack.DoAttack(self, target);

                QueueChild(new Wait(attack.info.ChargeDelay));
                return(false);
            }
Exemplo n.º 6
0
            public override Activity Tick(Actor self)
            {
                if (IsCanceled || !attack.CanAttack(self, target))
                {
                    return(NextActivity);
                }

                if (attack.charges == 0)
                {
                    return(this);
                }

                foreach (var notify in self.TraitsImplementing <INotifyTeslaCharging>())
                {
                    notify.Charging(self, target);
                }

                if (!string.IsNullOrEmpty(attack.info.ChargeAudio))
                {
                    Game.Sound.Play(SoundType.World, attack.info.ChargeAudio, self.CenterPosition);
                }

                return(ActivityUtils.SequenceActivities(new Wait(attack.info.InitialChargeDelay), new ChargeFire(attack, target), this));
            }