Example #1
0
        public override bool ServerIsTriggerAllowedForBossEvent(ProtoTrigger trigger)
        {
            if (trigger is not null)
            {
                if (this.ServerHasAnyEventOfType <ProtoEventBoss>() ||
                    ServerHasAnyEventOfTypeRunRecently <ProtoEventBoss>(TimeSpan.FromHours(3)))
                {
                    // another boss event is running now or run recently
                    return(false);
                }
            }

            if (trigger is TriggerTimeInterval)
            {
                var delayHoursSinceWipe = ServerEventDelayHours;
                if (!PveSystem.ServerIsPvE)
                {
                    // in PvP spawn Pragmium King not earlier than
                    // T4 specialized tech (containing the necessary weapons) becomes available
                    delayHoursSinceWipe = Math.Max(
                        delayHoursSinceWipe,
                        // convert seconds to hours
                        TechConstants.PvpTechTimeGameTier4Specialized / 3600);
                }

                if (Server.Game.HoursSinceWorldCreation < delayHoursSinceWipe)
                {
                    // too early
                    return(false);
                }
            }

            return(true);
        }
Example #2
0
        public override bool ServerIsTriggerAllowedForBossEvent(ProtoTrigger trigger)
        {
            if (trigger is not null)
            {
                if (this.ServerHasAnyEventOfType <ProtoEventBoss>() ||
                    ServerHasAnyEventOfTypeRunRecently <ProtoEventBoss>(TimeSpan.FromHours(3)))
                {
                    // another boss event is running now or run recently
                    return(false);
                }
            }

            return(true);
        }
Example #3
0
        public sealed override bool ServerIsTriggerAllowed(ProtoTrigger trigger)
        {
            if (this.ServerIsSameEventExist())
            {
                Logger.Error("The same event is already running, cannot start a new one: " + this);
                return(false);
            }

            if (this.ServerSpawnZones.Value.All(z => z.IsEmpty))
            {
                Logger.Error("All zones are empty (not mapped in the world), no place to start the event: " + this);
                return(false);
            }

            return(this.ServerIsTriggerAllowedForBossEvent(trigger));
        }
        public override bool ServerIsTriggerAllowed(ProtoTrigger trigger)
        {
            if (trigger is not null &&
                this.ServerHasAnyEventOfType <ProtoEventBoss>())
            {
                return(false);
            }

            if (ServerSpawnZones.Value.All(z => z.IsEmpty))
            {
                Logger.Error("All zones are empty (not mapped in the world), no place to start the event: " + this);
                return(false);
            }

            if (trigger is TriggerTimeInterval)
            {
                var delayHoursSinceWipe = ServerEventDelayHours;
                if (!PveSystem.ServerIsPvE)
                {
                    // in PvP spawn Pragmium Queen not earlier than
                    // T4 specialized tech (containing the necessary weapons) becomes available
                    delayHoursSinceWipe = Math.Max(
                        delayHoursSinceWipe,
                        // convert seconds to hours
                        TechConstants.PvpTechTimeGameTier4Specialized / 3600);
                }

                if (Server.Game.HoursSinceWorldCreation < delayHoursSinceWipe)
                {
                    // too early
                    return(false);
                }
            }

            if (this.ServerIsSameEventExist())
            {
                Logger.Error("The same event is already running, cannot start a new one: " + this);
                return(false);
            }

            return(true);
        }
Example #5
0
        public override bool ServerIsTriggerAllowed(ProtoTrigger trigger)
        {
            if (trigger != null &&
                this.ServerHasAnyEventOfType <ProtoEventDrop>())
            {
                return(false);
            }

            if (serverSpawnZones.Value.All(z => z.IsEmpty))
            {
                Logger.Error("All zones are empty (not mapped in the world), no place to start the event: " + this);
                return(false);
            }

            if (trigger is TriggerTimeInterval &&
                Server.Game.HoursSinceWorldCreation < 24)
            {
                // too early
                return(false);
            }

            return(true);
        }
Example #6
0
        public override bool ServerIsTriggerAllowed(ProtoTrigger trigger)
        {
            if (trigger is not null &&
                (this.ServerHasAnyEventOfType <IProtoEvent>() ||
                 ServerHasAnyEventOfTypeRunRecently <IProtoEvent>(TimeSpan.FromMinutes(20))))
            {
                // this event cannot run together or start soon after any other event
                return(false);
            }

            if (this.ServerHasAnyEventOfType <EventPsiGroveInfestation>())
            {
                return(false);
            }

            if (serverSpawnZones.Value.All(z => z.IsEmpty))
            {
                Logger.Error("All zones are empty (not mapped in the world), no place to start the event: " + this);
                return(false);
            }

            return(true);
        }
Example #7
0
 public virtual bool ServerIsTriggerAllowed(ProtoTrigger trigger)
 {
     return(true);
 }
 public EmptyTriggerConfig(ProtoTrigger trigger) : base(trigger)
 {
 }
Example #9
0
 public abstract bool ServerIsTriggerAllowedForBossEvent(ProtoTrigger trigger);