예제 #1
0
 public void SetLadder(int ladderId, bool isVisible, bool animationEffect, byte animationDelay)
 {
     Field.State.TriggerLadders[ladderId].IsVisible       = isVisible;
     Field.State.TriggerLadders[ladderId].AnimationEffect = animationEffect;
     Field.State.TriggerLadders[ladderId].AnimationDelay  = animationDelay;
     Field.BroadcastPacket(TriggerPacket.UpdateTrigger(Field.State.TriggerLadders[ladderId]));
 }
예제 #2
0
 public void SetCube(int[] triggerIds, bool isVisible, byte randomCount)
 {
     foreach (int triggerId in triggerIds)
     {
         Field.State.TriggerCubes[triggerId].IsVisible = isVisible;
         Field.BroadcastPacket(TriggerPacket.UpdateTrigger(Field.State.TriggerCubes[triggerId]));
     }
 }
예제 #3
0
 public void SetMesh(int[] meshIds, bool isVisible, int arg3, int arg4, float arg5)
 {
     foreach (int triggerMeshId in meshIds)
     {
         Field.State.TriggerMeshes[triggerMeshId].IsVisible = isVisible;
         Field.BroadcastPacket(TriggerPacket.UpdateTrigger(Field.State.TriggerMeshes[triggerMeshId]));
     }
 }
예제 #4
0
 public void SetEffect(int[] triggerIds, bool isVisible, int arg3, byte arg4)
 {
     foreach (int triggerId in triggerIds)
     {
         Field.State.TriggerEffects[triggerId].IsVisible = isVisible;
         Field.BroadcastPacket(TriggerPacket.UpdateTrigger(Field.State.TriggerEffects[triggerId]));
     }
 }
예제 #5
0
 public void SetMesh(int[] meshIds, bool isVisible, int arg3, int arg4, float arg5)
 {
     foreach (int triggerMeshId in meshIds)
     {
         if (Field.State.TriggerMeshes.TryGetValue(triggerMeshId, out TriggerMesh triggerMesh))
         {
             triggerMesh.IsVisible = isVisible;
             Field.BroadcastPacket(TriggerPacket.UpdateTrigger(triggerMesh));
         }
     }
 }
예제 #6
0
 public void SetEffect(int[] triggerIds, bool isVisible, int arg3, byte arg4)
 {
     foreach (int triggerId in triggerIds)
     {
         if (Field.State.TriggerEffects.TryGetValue(triggerId, out TriggerEffect triggerEffect))
         {
             triggerEffect.IsVisible = isVisible;
             Field.BroadcastPacket(TriggerPacket.UpdateTrigger(triggerEffect));
         }
     }
 }
예제 #7
0
    public void SetActor(int actorId, bool isVisible, string stateName, bool arg4, bool arg5)
    {
        if (!Field.State.TriggerActors.TryGetValue(actorId, out TriggerActor stateTriggerActor))
        {
            Logger.Warning("SetActor: Actor not found: {0}", actorId);
            return;
        }

        stateTriggerActor.IsVisible = isVisible;
        stateTriggerActor.StateName = stateName;
        Field.BroadcastPacket(TriggerPacket.UpdateTrigger(stateTriggerActor));
    }
예제 #8
0
    public void SetLadder(int ladderId, bool isVisible, bool animationEffect, byte animationDelay)
    {
        if (!Field.State.TriggerLadders.TryGetValue(ladderId, out TriggerLadder ladder))
        {
            return;
        }

        ladder.IsVisible       = isVisible;
        ladder.AnimationEffect = animationEffect;
        ladder.AnimationDelay  = animationDelay;
        Field.BroadcastPacket(TriggerPacket.UpdateTrigger(ladder));
    }
예제 #9
0
    public void SetRandomMesh(int[] meshIds, bool isVisible, byte meshCount, int arg4, int delayTime)
    {
        Random random = RandomProvider.Get();

        int[] pickedMeshIds = meshIds.OrderBy(x => random.Next()).Take(meshCount).ToArray();
        Task.Run(async() =>
        {
            foreach (int triggerMeshId in pickedMeshIds)
            {
                Field.State.TriggerMeshes[triggerMeshId].IsVisible = isVisible;
                Field.BroadcastPacket(TriggerPacket.UpdateTrigger(Field.State.TriggerMeshes[triggerMeshId]));
                await Task.Delay(delayTime);
            }
        });
    }
예제 #10
0
    public void SetMesh(int[] meshIds, bool isVisible, int arg3, int delay, float arg5)
    {
        Task.Run(async() =>
        {
            foreach (int triggerMeshId in meshIds)
            {
                if (!Field.State.TriggerMeshes.TryGetValue(triggerMeshId, out TriggerMesh triggerMesh))
                {
                    continue;
                }

                triggerMesh.IsVisible = isVisible;
                Field.BroadcastPacket(TriggerPacket.UpdateTrigger(triggerMesh));
                await Task.Delay(delay);
            }
        });
    }
예제 #11
0
    public void SetEffect(int[] triggerIds, bool isVisible, int arg3, byte arg4)
    {
        foreach (int triggerId in triggerIds)
        {
            if (!Field.State.TriggerEffects.TryGetValue(triggerId, out TriggerEffect triggerEffect))
            {
                continue;
            }

            bool oldValue = triggerEffect.IsVisible;
            triggerEffect.IsVisible = isVisible;

            if (oldValue != isVisible) // If the value changed, broadcast the packet.
            {
                Field.BroadcastPacket(TriggerPacket.UpdateTrigger(triggerEffect));
            }
        }
    }
예제 #12
0
 public void SetActor(int actorId, bool isVisible, string stateName, bool arg4, bool arg5)
 {
     Field.State.TriggerActors[actorId].IsVisible = isVisible;
     Field.State.TriggerActors[actorId].StateName = stateName;
     Field.BroadcastPacket(TriggerPacket.UpdateTrigger(Field.State.TriggerActors[actorId]));
 }
예제 #13
0
 public void SetSound(int soundId, bool isEnabled)
 {
     Field.State.TriggerSounds[soundId].IsEnabled = isEnabled;
     Field.BroadcastPacket(TriggerPacket.UpdateTrigger(Field.State.TriggerSounds[soundId]));
 }
 public void CameraSelect(int cameraId, bool enable)
 {
     Field.State.TriggerCameras[cameraId].IsEnabled = enable;
     Field.BroadcastPacket(TriggerPacket.UpdateTrigger(Field.State.TriggerCameras[cameraId]));
 }