Ejemplo n.º 1
0
 public void OnReceived(EBEvent e)
 {
     if (e.type == EBEventType.WorldStateChanged)
     {
         WorldStateChangedEvent wsce = e as WorldStateChangedEvent;
         if (wsce.worldState.madness >= WorldState.NORMAL_TO_MAD_BOUNDARY)
         {
             if (!isMad)
             {
                 isMad = true;
                 dispatcher.SendEvent(new EBEvent()
                 {
                     type = EBEventType.ChangeStateToMadRequest
                 });
             }
         }
         else
         {
             if (isMad)
             {
                 isMad = false;
                 dispatcher.SendEvent(new EBEvent()
                 {
                     type = EBEventType.ChangeStateToNormalRequest
                 });
             }
         }
     }
 }
 public void OnReceived(EBEvent e)
 {
     if (e.type == EBEventType.WorldStateChanged)
     {
         WorldStateChangedEvent wsce = e as WorldStateChangedEvent;
         roomsVisited = wsce.worldState.roomsVisited;
     }
 }
    private void ProcessWorldStateChangedEvent(WorldStateChangedEvent e)
    {
        WorldState world = e.worldState;

        if ((world.location == WorldState.Location.Prologue) &&
            (sources[currentSourceIndex].clip != prologueMusic))
        {
            ChangeAudio(prologueMusic);
            return;
        }

        if ((world.location == WorldState.Location.Hall) &&
            (world.madness < WorldState.MEDIUM_MADNESS_THRESHOLD) &&
            (sources[currentSourceIndex].clip != coreLowMadnessMusic))
        {
            ChangeAudio(coreLowMadnessMusic);
            return;
        }

        if ((world.location == WorldState.Location.Hall) &&
            ((WorldState.MEDIUM_MADNESS_THRESHOLD <= world.madness) && (world.madness < WorldState.HIGH_MADNESS_THRESHOLD)) &&
            (sources[currentSourceIndex].clip != coreMediumMadnessMusic))
        {
            ChangeAudio(coreMediumMadnessMusic);
            return;
        }

        if ((world.location == WorldState.Location.Hall) &&
            (WorldState.HIGH_MADNESS_THRESHOLD <= world.madness) &&
            (sources[currentSourceIndex].clip != coreHighMadnessMusic))
        {
            ChangeAudio(coreHighMadnessMusic);
            return;
        }

        if ((world.location == WorldState.Location.PositiveEpilogue) &&
            (sources[currentSourceIndex].clip != positiveEpilogueMusic))
        {
            ChangeAudio(positiveEpilogueMusic);
            return;
        }

        if ((world.location == WorldState.Location.NegativeEpilogue) &&
            (sources[currentSourceIndex].clip != negativeEpilogueMusic))
        {
            ChangeAudio(negativeEpilogueMusic);
            return;
        }
    }