예제 #1
0
        public void ActiveNewEvent(int index)
        {
            actualRegionalEvent = groupRegionalEvents[index].GetRandomRegionalEvent();

            //verificated win condition
            if (actualRegionalEvent.GetTypeRegionEvent() == TypeRegionEvent.FinishGame)
            {
                if (controlGameMap.actualCoin >= actualRegionalEvent.winCondition)
                {
                    activeNewEventControlUI();
                    print("Ganaste el juego");
                    textUIEventShow.text = textWin;
                }
                else
                {
                    if (!alreadySeeWinCondiciton)
                    {
                        activeNewEventControlUI();
                        alreadySeeWinCondiciton = true;
                    }
                    else
                    {
                        FinishEventButton();
                    }
                    firstButtonGO.SetActive(false);
                }
            }
            else
            {
                activeNewEventControlUI();
            }
        }
예제 #2
0
        private void DecideTypeEvent(bool confirm)
        {
            desactiveButtonFirstStageEvent();

            switch (actualRegionalEvent.GetTypeRegionEvent())
            {
            case TypeRegionEvent.Coin:
                if (confirm)
                {
                    controlGameMap.EventCoin(actualRegionalEvent.GetCoinTrue());
                }
                else
                {
                    controlGameMap.EventCoin(actualRegionalEvent.GetCoinFalse());
                }
                break;

            case TypeRegionEvent.Move:
                if (confirm)
                {
                    controlGameMap.EventSubtractHalfCoin();
                    controlGameMap.EventMoveNewPosition();
                }
                break;

            case TypeRegionEvent.Combat:
                if (confirm)
                {
                    nextEventIsCombat = true;
                }
                break;

            case TypeRegionEvent.Health:
                if (confirm)
                {
                    controlGameMap.EventHealth(actualRegionalEvent.GetHealthTrue());
                }
                else
                {
                    controlGameMap.EventHealth(actualRegionalEvent.GetHealthFalse());
                }
                break;

            case TypeRegionEvent.FinishGame:
                if (controlGameMap.actualCoin >= actualRegionalEvent.winCondition)
                {
                    controlGameMap.EventFinishGame();
                }
                break;
            }
        }