예제 #1
0
        public virtual void ApplyLaserBoost(LaserCannon src, float pwr)
        {
            if (Fraction.IsNeutral)
            {
                return;
            }

            if (pwr > 0)
            {
                counterAttackingLasersFriends++;
            }

            CannonHealth.Inc(pwr);
            if (CannonHealth.Limit(0f, 1f) == 1)
            {
                foreach (var boost in _laserBoosts)
                {
                    if (boost.Source == src)
                    {
                        boost.RemainingTime = LASER_BOOSTER_LIFETIME;
                        return;
                    }
                }
                _laserBoosts.Add(new CannonLaserBoost {
                    Source = src, RemainingTime = LASER_BOOSTER_LIFETIME
                });
            }
        }
예제 #2
0
        public override void ApplyLaserBoost(LaserCannon src, float pwr)
        {
            if (Fraction.IsNeutral)
            {
                return;
            }

            if (pwr > 0)
            {
                counterAttackingLasersFriends++;

                if (Fraction.IsNeutral && !src.Fraction.IsNeutral)
                {
                    CannonHealth.Set(1);
                    SetFraction(src.Fraction);
                }
                else if (!Fraction.IsNeutral && src.Fraction != Fraction)
                {
                    CannonHealth.Set(0);
                    SetFraction(Fraction.GetNeutral());
                }
            }
        }