Example #1
0
        void OnItemExploded(ExplosiveDynamicServer ItemExploded, IExplosion Explosion)
        {
            if (ItemExploded.name == "C4DynamicObject(Clone)" || ItemExploded.name == "TerritoryC4DynamicObject(Clone)")
            {
                bool    bZoneInterfering  = false;
                Vector3 ExplosionLocation = ItemExploded.networkView.InitialPosition;

                foreach (RaidBlockZone RBZ in RaidBlockedZones)
                {
                    double Distance = Math.Sqrt(Math.Pow(ExplosionLocation.x - RBZ.Location.x, 2) + Math.Pow(ExplosionLocation.y - RBZ.Location.y, 2));

                    if (Distance <= ZoneSize)
                    {
                        bZoneInterfering = true;
                    }
                }

                if (!bZoneInterfering)
                {
                    RaidBlockedZones.Add(new RaidBlockZone(ExplosionLocation, RaidTimer));

                    if (RaidBlockTimer == null)
                    {
                        StartTimer();
                    }

                    Puts("Created new raid zone: " + ExplosionLocation.ToString());
                }
            }
        }