Exemplo n.º 1
0
 /// <summary>
 /// Removes a trigger volume from the world
 /// </summary>
 /// <param name="triggerVolume"></param>
 public void RemoveTriggerVolume(ITriggerVolume triggerVolume)
 {
     lock (this)
     {
         var runeTriggerVolume = triggerVolume as RuneTriggerVolume;
         if (runeTriggerVolume != null)
         {
             this.simulation.CollisionDomain.CollisionObjects.Remove(runeTriggerVolume.CollisionObject);
             this.triggerVolumes.Remove(runeTriggerVolume);
         }
     }
 }
Exemplo n.º 2
0
        /// <summary>returns true if any of the specified objects are within the specified volume. trigger volume must have been postprocessed</summary>
        public bool volume_test_objects(ITriggerVolume trigger_volume, GameObjectList object_list)
        {
            foreach (var o in object_list)
            {
                if (trigger_volume.Contains(o))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 3
0
        /// <summary>returns true if all of the specified objects are within the specified volume. trigger volume must have been postprocessed</summary>
        public bool volume_test_objects_all(ITriggerVolume trigger_volume, GameObjectList object_list)
        {
            var allIn = true;

            foreach (var o in object_list)
            {
                if (trigger_volume.Contains(o) == false)
                {
                    allIn = false;
                }
            }

            return(allIn);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new doorway
        /// </summary>
        /// <remarks>
        /// This must be called prior to using the <see cref="Dynamic"/> object
        /// </remarks>
        public void InitializeNewDoorway(Vector3 size, GlobalPosition teleportTo)
        {
            this.dynamicType        = DynamicType.Doorway;
            this.teleportToLocation = teleportTo;
            // we will publish builtProperties right after subscribing
            // since dynamic types are short lived and does not usually contain too many (or any) builtProperties
            // we can safely send builtProperties right after subscription
            // this will also prevent the client from caching our builtProperties which would be useless
            this.Flags = MmoObjectFlags.SendPropertiesOnSubscribe;

            // cleanup before adding properties
            this.Refresh();
            // making sure to remove the object type if it was provided already
            this.Properties.Clear();
            this.Properties.Add((byte)PropertyCode.DynamicType, (byte)dynamicType);

            this.doorwayTrigger = CurrentZone.Physics.CreateTriggerVolume(new TriggerVolumeDescription {
                NameOfTarget = "character", Size = size
            },
                                                                          guid => OnEnterDoorway((MmoGuid)guid));
            // this will be checked at subscription and prevents sending revision value
            this.Flags |= MmoObjectFlags.HasProperties;
        }
Exemplo n.º 5
0
 /// <summary>
 /// Removes a trigger volume from the world
 /// </summary>
 /// <param name="triggerVolume"></param>
 public void RemoveTriggerVolume(ITriggerVolume triggerVolume)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 6
0
 /// <summary>returns true if all of the specified objects are within the specified volume. trigger volume must have been postprocessed</summary>
 public bool volume_test_objects_all(ITriggerVolume trigger, IAiActorDefinition actor)
 {
     return(trigger.Contains(actor.Actor));
 }
Exemplo n.º 7
0
 /// <summary>returns true if all of the specified objects are within the specified volume. trigger volume must have been postprocessed</summary>
 public bool volume_test_objects_all(ITriggerVolume trigger, IGameObject entity)
 {
     return(trigger.Contains(entity));
 }
Exemplo n.º 8
0
 /// <summary>returns true if the specified object is within the specified volume.</summary>
 public bool volume_test_object(ITriggerVolume trigger_volume, IGameObject entity)
 {
     return(trigger_volume.Contains(entity));
 }
Exemplo n.º 9
0
 /// <summary>moves all players outside a specified trigger volume to a specified flag.</summary>
 public void volume_teleport_players_not_inside(ITriggerVolume trigger_volume, ILocationFlag cutscene_flag)
 {
 }
Exemplo n.º 10
0
        /// <summary>returns list of objects in volume or (max 128).</summary>
        public GameObjectList volume_return_objects_by_type(ITriggerVolume trigger_volume, int value)
        {
            var items = trigger_volume.GetObjects((TypeFlags)value);

            return(new GameObjectList(items));
        }
Exemplo n.º 11
0
        /// <summary>returns list of objects in volume or (max 128).</summary>
        public GameObjectList volume_return_objects(ITriggerVolume trigger_volume)
        {
            var items = trigger_volume.GetObjects();

            return(new GameObjectList(items));
        }
Exemplo n.º 12
0
 /// <summary>enables a kill volume</summary>
 public void kill_volume_enable(ITriggerVolume trigger_volume)
 {
     trigger_volume.KillOnEnter(true);
 }
Exemplo n.º 13
0
 /// <summary>disables a kill volume</summary>
 public void kill_volume_disable(ITriggerVolume trigger_volume)
 {
     trigger_volume.KillOnEnter(false);
 }