CanAttack() protected method

protected CanAttack ( Actor self, Target target ) : bool
self Actor
target OpenRA.Traits.Target
return bool
Ejemplo n.º 1
0
            public override Activity Tick(Actor self)
            {
                if (IsCanceled || !attack.CanAttack(self, target))
                {
                    return(NextActivity);
                }

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

                self.Trait <RenderBuildingCharge>().PlayCharge(self);

                return(Util.SequenceActivities(new Wait(attack.info.InitialChargeDelay), new ChargeFire(attack, target), this));
            }
Ejemplo n.º 2
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(Util.SequenceActivities(new Wait(attack.info.ChargeDelay), this));
            }
Ejemplo n.º 3
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 <INotifyCharging>())
                {
                    notify.Charging(self, target);
                }

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

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