Ejemplo n.º 1
0
 public void OnReceived(EBEvent e)
 {
     if (e.type == EBEventType.HealthPackCollected)
     {
         --healthPacks;
     }
 }
Ejemplo n.º 2
0
 public void OnReceived(EBEvent e)
 {
     if (e.type == EBEventType.NewWaypointCreated)
     {
         waypointsQueue.Enqueue((e as NewWaypointEvent).waypoint);
     }
 }
Ejemplo n.º 3
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
                 });
             }
         }
     }
 }
Ejemplo n.º 4
0
 public void OnReceived(EBEvent e)
 {
     if (e.type == EBEventType.NewWaypointCreated)
     {
         DrawWaypoint((e as NewWaypointEvent).waypoint.position);
     }
 }
Ejemplo n.º 5
0
    public void OnReceived(EBEvent e)
    {
        switch (e.type)
        {
        case EBEventType.GameLoaded:
            newGameButton.GetComponent <Button>().enabled      = true;
            continueGameButton.GetComponent <Button>().enabled = true;
            isBlockedUntilGameIsLoaded = false;
            break;

        case EBEventType.GameStarted:
            SetMenuVisible(false);
            newGameButton.SetActive(false);
            continueGameButton.SetActive(true);
            break;

        case EBEventType.GamePaused:
            SetMenuVisible(true);
            break;

        case EBEventType.GameResumed:
            SetMenuVisible(false);
            break;
        }
    }
Ejemplo n.º 6
0
    public void OnReceived(EBEvent e)
    {
        switch (e.type)
        {
        case EBEventType.MonsterInFrustum:
            monsterInFrustum = true;
            UpdateEffects();
            break;

        case EBEventType.MonsterOutOfFrustum:
            monsterInFrustum = false;
            UpdateEffects();
            break;

        case EBEventType.MonsterInPlainSight:
            monsterInPlainSight = true;
            UpdateEffects();
            break;

        case EBEventType.MonsterOutOfPlainSight:
            monsterInPlainSight = false;
            UpdateEffects();
            break;
        }
    }
Ejemplo n.º 7
0
    public void OnReceived(EBEvent e)
    {
        switch (e.type)
        {
        case EBEventType.InteractionWithDoor:
        {
            DoorInteractionEvent die = e as DoorInteractionEvent;
            if (!isDoorTriggered && (die.door == door))
            {
                isDoorTriggered = true;
                monster.SetActive(true);
                monster.GetComponent <CameraVisibilityChecker>().SetCamera(camera);
                monster.GetComponent <MonsterBehaviour>().SetMainTarget(controller.transform);
                NoiseEffectsManager noiseEffectsManager = controller.gameObject.GetComponentInChildren <NoiseEffectsManager>();
                noiseEffectsManager.SetMonster(monster.transform);
                noiseEffectsManager.enabled = true;
                dispatcher.Subscribe(EBEventType.CaughtByMonster, address, gameObject);
                dispatcher.Subscribe(EBEventType.MonsterInFrustum, address, gameObject);
            }
        }
        break;

        case EBEventType.CaughtByMonster:
            StartCoroutine(EndingAnimation());
            break;

        case EBEventType.MonsterInFrustum:
            controller.SetMouseLookEnabled(false);
            controller.SetHeadBobEnabled(false);
            controller.enabled = false;
            director.StartAnimating(camera, rotationTarget, camera.transform);
            break;
        }
    }
 public void OnReceived(EBEvent e)
 {
     if (e.type == EBEventType.HallMovingTriggerEntered)
     {
         HallMovingTriggerEnteredEvent hmtee = (e as HallMovingTriggerEnteredEvent);
         StartCoroutine(MoveOnNextUpdate(hmtee));
     }
 }
 public void OnReceived(EBEvent e)
 {
     if (e.type == EBEventType.WorldStateChanged)
     {
         WorldStateChangedEvent wsce = e as WorldStateChangedEvent;
         roomsVisited = wsce.worldState.roomsVisited;
     }
 }
Ejemplo n.º 10
0
 public void OnReceived(EBEvent e)
 {
     if (e.type == EBEventType.CaughtByMonster)
     {
         controller.enabled = false;
         StartCoroutine(AnimateCatch());
     }
 }
Ejemplo n.º 11
0
 public void OnReceived(EBEvent e)
 {
     if (e.type == EBEventType.ItemCollected)
     {
         ItemCollectedEvent ice = e as ItemCollectedEvent;
         if (ice.item.GetItemType() == CollectibleItem.Type.Book)
         {
             StartCoroutine(ShowQuote());
         }
     }
 }
 public void OnReceived(EBEvent e)
 {
     if (e.type == EBEventType.InteractionWithDoor)
     {
         DoorInteractionEvent die = e as DoorInteractionEvent;
         if (die.door == door)
         {
             StartCoroutine(Animation());
         }
     }
 }
    public void OnReceived(EBEvent e)
    {
        switch (e.type)
        {
        case EBEventType.ItemCollected:
            ProcessItemCollectedEvent(e as ItemCollectedEvent);
            break;

        case EBEventType.WorldStateChanged:
            ProcessWorldStateChangedEvent(e as WorldStateChangedEvent);
            break;
        }
    }
Ejemplo n.º 14
0
    public void OnReceived(EBEvent e)
    {
        switch (e.type)
        {
        case EBEventType.ChangeStateToNormalRequest:
            ChangeState(SchoolBell.State.Normal);
            break;

        case EBEventType.ChangeStateToMadRequest:
            ChangeState(SchoolBell.State.Mad);
            break;
        }
    }
    public void OnReceived(EBEvent e)
    {
        switch (e.type)
        {
        case EBEventType.ChangeStateToNormalRequest:
            ChangeLampsStates(normalState);
            break;

        case EBEventType.ChangeStateToMadRequest:
            ChangeLampsStates(madState);
            break;
        }
    }
    public void OnReceived(EBEvent e)
    {
        switch (e.type)
        {
        case EBEventType.ChangeStateToNormalRequest:
            GetComponent <Renderer>().material = normalMaterial;
            break;

        case EBEventType.ChangeStateToMadRequest:
            GetComponent <Renderer>().material = madMaterial;
            break;
        }
    }
    public void OnReceived(EBEvent e)
    {
        switch (e.type)
        {
        case EBEventType.TestDoorTriggerEntered:
            door.Open();
            break;

        case EBEventType.TestDoorTriggerExited:
            door.Close();
            break;
        }
    }
Ejemplo n.º 18
0
    public void OnReceived(EBEvent e)
    {
        switch (e.type)
        {
        case EBEventType.CaughtByMonster:
            this.enabled = false;
            break;

        case EBEventType.ApplyMadnessAfterMonsterCaught:
            this.enabled = true;
            break;
        }
    }
Ejemplo n.º 19
0
    public void OnReceived(EBEvent e)
    {
        switch (e.type)
        {
        case EBEventType.RoomSpawningTrigger:
            RoomSpawningTriggerEvent rstee = (e as RoomSpawningTriggerEvent);
            if (rstee.action == TriggerAction.Enter)
            {
                if ((rstee.roomEntryId == id) && spawningEnabled)
                {
                    roomsManager.DisableAllRoomScenes();
                    RoomScene room = roomsManager.GetRandomRoomScene();
                    AttachRoom(room);
                    SetSpawningEnabled(false);

                    room.ClearCollectibles();
                    Transform itemPlace = room.GetCollectiblePlaceholder();
                    if (itemPlace != null)
                    {
                        CollectibleItem item = itemsManager.GetItem();
                        if (item != null)
                        {
                            item.transform.parent   = itemPlace;
                            item.transform.position = itemPlace.position;
                            item.transform.rotation = itemPlace.rotation;
                            item.SetRoomScene(room);
                            item.gameObject.SetActive(true);
                        }
                    }
                }

                if (rstee.roomEntryId != id)
                {
                    SetSpawningEnabled(true);
                }
            }
            break;

        case EBEventType.DoorClosingTrigger:
            DoorClosingTriggerEvent dcte = (e as DoorClosingTriggerEvent);
            if ((dcte.roomEntryId == id) && (dcte.action == TriggerAction.Exit))
            {
                CloseDoor();
            }
            break;

        case EBEventType.HallMovingTriggerEntered:
            CloseDoor();
            break;
        }
    }
 public void OnReceived(EBEvent e)
 {
     if (e.type == EBEventType.RoomSpawningTrigger)
     {
         RoomSpawningTriggerEvent rste = e as RoomSpawningTriggerEvent;
         if (rste.roomEntryId != roomEntry.GetId())
         {
             door.Unlock();
             roomEntry.SetSpawningEnabled(true);
             RoomsManager manager = RoomsManager.GetManager();
             manager.UnloadPrologue();
             StartCoroutine(UnsubscribeOnNextUpdate());
         }
     }
 }
Ejemplo n.º 21
0
 public void OnReceived(EBEvent e)
 {
     if (finished)
     {
         return;
     }
     if (e.type == EBEventType.HealthChanged)
     {
         if ((e as HealthChanged).value <= 0.0f)
         {
             finished = true;
             StartCoroutine(FinishAndRestart());
         }
     }
 }
Ejemplo n.º 22
0
        /// <summary>
        /// Retrieves a specific Event Brite event information based on a specific event ID
        /// </summary>
        /// <param name="ID">ID of event</param>
        /// <returns></returns>
        public static async Task <EBEvent> GetEBEventData(string eventId)
        {
            string responseContent;

            //string eventId = "33114905574";
            using (HttpClient client = new HttpClient())
            {
                HttpResponseMessage response = await client.GetAsync("https://www.eventbriteapi.com/v3/events/" + eventId + "/?token=XVYY3RQCP54ZJKZ2UF2L");

                response.EnsureSuccessStatusCode();
                responseContent = await response.Content.ReadAsStringAsync();
            }
            EBEvent tempEBEvent = JsonConvert.DeserializeObject <EBEvent>(responseContent);

            return(tempEBEvent);
        }
Ejemplo n.º 23
0
        public void OnImportClick(object sender, EventArgs args)
        {
            Task.Run(async() =>  // body runs asynchronously
            {
                temp = await HttpUtils.GetEBEventData(EventID.Text);
                Device.BeginInvokeOnMainThread(() => // runs body after await operator
                {
                });
            });

            Debug.WriteLine(HttpUtils.PostInfo(new List <KeyValuePair <string, string> > {
                new KeyValuePair <string, string>("event_date", temp.StartLocal),
                new KeyValuePair <string, string>("event_title", temp.NameText),
                new KeyValuePair <string, string>("event_desc", temp.DescriptionText),
                new KeyValuePair <string, string>("event_img", temp.LogoUrl),
                new KeyValuePair <string, string>("event_url", temp.Url),
            }, "http://haydenszymanski.me/softeng05/create_event.php").ResponseSuccess);
        }
Ejemplo n.º 24
0
    public void OnReceived(EBEvent e)
    {
        switch (e.type)
        {
        case EBEventType.GameStarted:
            var gse = e as GameStarted;
            stats[GameDefines.Side.Blue].gameIndex = gse.gameIndex;
            stats[GameDefines.Side.Blue].timestamp = gse.timestamp;
            stats[GameDefines.Side.Red].gameIndex  = gse.gameIndex;
            stats[GameDefines.Side.Red].timestamp  = gse.timestamp;
            break;

        case EBEventType.ControllerInited:
            var cie = e as ControllerInited;
            stats[cie.side].controllerType = cie.controllerType;
            break;

        case EBEventType.NewFrame:
            var nfe = e as NewFrame;
            stats[nfe.side].framesTime += nfe.frameTime;
            ++stats[nfe.side].framesCount;
            break;

        case EBEventType.HealthChanged:
            var hce = e as HealthChanged;
            if (!hce.isHeal)
            {
                stats[hce.side].damageTaken += hce.diff;
                stats[GameDefines.OpposingTo(hce.side)].damageGiven += hce.diff;
                if (hce.value <= 0.0f)
                {
                    stats[hce.side].dead = true;
                }
            }
            break;

        case EBEventType.HealthPackCollected:
            var hpce = e as HealthPackCollected;
            stats[hpce.side].healthPackCollected = true;
            break;
        }
    }
    public void OnReceived(EBEvent e)
    {
        switch (e.type)
        {
        case EBEventType.RoomSpawningTrigger:
            if (attachedDoor == null || (e as RoomSpawningTriggerEvent).roomEntryId != attachedDoor.GetId())
            {
                translationEnabled = true;
            }
            break;

        case EBEventType.ItemCollected:
            ItemCollectedEvent ice = e as ItemCollectedEvent;
            if ((ice.item.GetItemType() == CollectibleItem.Type.Key) && (ice.item.GetRoomScene() == roomScene))
            {
                TranslateRoom();     // translate to ending scene
            }
            break;
        }
    }
Ejemplo n.º 26
0
    public void OnReceived(EBEvent e)
    {
        switch (e.type)
        {
        case EBEventType.ItemCollected:
            ProcessItemCollectedEvent(e as ItemCollectedEvent);
            break;

        case EBEventType.HallMovingTriggerEntered:
            ProcessHallMoveinTriggerEnteredEvent(e as HallMovingTriggerEnteredEvent);
            break;

        case EBEventType.CaughtByMonster:
            ProcessCaughtByMonsterEvent(e);
            break;

        case EBEventType.ApplyMadnessAfterMonsterCaught:
            ProcessApplyMadnessAfterMonsterEvent(e);
            break;

        case EBEventType.PrologueEntered:
            location_ = Location.Prologue;
            break;

        case EBEventType.HallEntered:
            location_ = Location.Hall;
            break;

        case EBEventType.PositiveEpilogueEntered:
            location_ = Location.PositiveEpilogue;
            StartCoroutine(ProcessEnding());
            break;

        case EBEventType.NegativeEpilogueEntered:
            location_ = Location.NegativeEpilogue;
            StartCoroutine(ProcessEnding());
            break;
        }

        dispatcher.SendEvent(new WorldStateChangedEvent(this));
    }
Ejemplo n.º 27
0
    public void OnReceived(EBEvent e)
    {
        switch (e.type)
        {
        case EBEventType.GameStarted:
            GameStarted gse = (e as GameStarted);
            gameIndex.text = "" + gse.gameIndex;
            break;

        case EBEventType.HealthChanged:
            HealthChanged hce = (e as HealthChanged);
            switch (hce.side)
            {
            case GameDefines.Side.Blue:
                SetBlueSoldierHealth(hce.value);
                break;

            case GameDefines.Side.Red:
                SetRedSoldierHealth(hce.value);
                break;
            }
            break;

        case EBEventType.ControllerInited:
            ControllerInited cie = (e as ControllerInited);
            switch (cie.side)
            {
            case GameDefines.Side.Blue:
                blueSoldierControllerTypeText.text = cie.controllerType.ToString();
                break;

            case GameDefines.Side.Red:
                redSoldierControllerTypeText.text = cie.controllerType.ToString();
                break;
            }
            break;
        }
    }
Ejemplo n.º 28
0
 private void ProcessCaughtByMonsterEvent(EBEvent e)
 {
     ++timesCaughtByMonster_;
 }
Ejemplo n.º 29
0
 private void ProcessApplyMadnessAfterMonsterEvent(EBEvent e)
 {
     AddMadness(MADNESS_PER_MONSTER_CAUGHT);
 }
Ejemplo n.º 30
0
 public void OnReceived(EBEvent e)
 {
     Debug.Log("Event received: " + e);
 }