Ejemplo n.º 1
0
        public void StartEvent()
        {
            if (currentEvent == null)
            {
                currentEvent = new EventDecisionData();
            }
            if (allowStartEvent)
            {
                Debug.Log("-------------- Start Event --------------");
                if (!string.IsNullOrEmpty(currentEvent.title))
                {
                    SummonGuest();
                }
                else
                {
                    CheckNextEvent();
                }
            }
            else if (queuedEventsList != null && queuedEventsList.Count > 0)
            {
                AllowStartEvent(); // START EVENT
            }

            // RECEIVE EVENT AFTER GUEST REACHED POSITION
            //cardEventController.ReceiveEvent(currentEvent);
        }
Ejemplo n.º 2
0
        public void CheckNextEvent()
        {
            if (queuedEventsList != null && queuedEventsList.Count > 0)
            {
                currentEvent = queuedEventsList[0];
                queuedEventsList.RemoveAt(0);

                if (allowStartEvent)
                {
                    SummonGuest();
                }
                else
                {
                    AllowStartEvent(); // CHECKING NEXT EVENT
                }
            }
            else
            {
                currentEvent = null;
            }

            if (TransitionManager.GetInstance != null)
            {
                if (!TransitionManager.GetInstance.isNewGame)
                {
                    SaveData();
                }
            }
            else
            {
                SaveData();
            }
        }
Ejemplo n.º 3
0
        public void LoadSavedData(List <EventDecisionData> prevQueuedData, EventDecisionData prevCurData, StoryArcEventsData prevStoryData)
        {
            queuedEventsList = new List <EventDecisionData>();
            queuedEventsList.AddRange(prevQueuedData);
            currentEvent    = prevCurData;
            currentStory    = prevStoryData;
            eventFinished   = PlayerGameManager.GetInstance.playerData.eventFinished;
            savedDataLoaded = true;

            weeklyEvents = ((int)playerData.level + 1) * 3;

            ResourceInformationController.GetInstance.currentPanel.weekController.UpdateEndButton(eventFinished, weeklyEvents);
        }
Ejemplo n.º 4
0
        public void RewardEvent(EventDecisionData thisEvent, int rewardIdx)
        {
            if (thisEvent.eventDecision == null || thisEvent.eventDecision[rewardIdx] == null)
            {
                return;
            }
            // This is to release every Reward
            for (int i = 0; i < thisEvent.eventDecision[rewardIdx].rewards.Count; i++)
            {
                // Debug.Log("[REWARD INDEX " + i + " AMOUNT]" + thisEvent.eventDecision[rewardIdx].rewards[i].rewardAmount);
                ResourceReward tmp = thisEvent.eventDecision[rewardIdx].rewards[i];
                if (tmp.rewardAmount > 0)
                {
                    // Debug.Log("Reward Amount: " + tmp.rewardAmount);
                    PlayerGameManager.GetInstance.ReceiveResource(tmp.rewardAmount, tmp.resourceType);
                    ResourceInformationController.GetInstance.currentPanel.UpdateResourceData(tmp.resourceType, tmp.rewardAmount);
                }
                else
                {
                    // Debug.Log("Penalty Amount: " + tmp.rewardAmount);
                    PlayerGameManager.GetInstance.RemoveResource(tmp.rewardAmount, tmp.resourceType);
                    ResourceInformationController.GetInstance.currentPanel.UpdateResourceData(tmp.resourceType, tmp.rewardAmount, false);
                }
            }


            if (currentEvent.isStoryArc)
            {
                if (currentStory == null || string.IsNullOrEmpty(currentStory.storyTitle))
                {
                    SetStoryArc();
                }
                else
                {
                    ProgressStoryArc();
                }
            }

            currentEvent    = null;
            allowStartEvent = false;
            eventFinished  += 1;

            if (PlayerGameManager.GetInstance != null)
            {
                SaveData();
            }

            EndCards();
        }
Ejemplo n.º 5
0
        public void PrologueEvents()
        {
            playerData = PlayerGameManager.GetInstance.playerData;

            EventDecisionData event1 = eventStorage.GetEventByTitle("Scout of the Wilds");
            EventDecisionData event2 = eventStorage.GetEventByTitle("Angered Fur Khan");
            EventDecisionData event3 = eventStorage.GetEventByTitle("Unexpected Crusade");

            queuedEventsList.Add(event1);
            queuedEventsList.Add(event2);
            queuedEventsList.Add(event3);

            eventFinished = PlayerGameManager.GetInstance.playerData.eventFinished;
            weeklyEvents  = 3;
            isPrologue    = true;

            AllowStartEvent(); // PROLOGUE EVENTS

            ResourceInformationController.GetInstance.currentPanel.weekController.UpdateEndButton(0, weeklyEvents, ShowEndWeekPrologue);
        }
Ejemplo n.º 6
0
        public void SaveCurDataEvent(EventDecisionData eventData)
        {
            playerData.curDataEvent = new EventDecisionData();

            if (eventData != null && !string.IsNullOrEmpty(eventData.title))
            {
                playerData.curDataEvent.title          = eventData.title;
                playerData.curDataEvent.description    = eventData.description;
                playerData.curDataEvent.difficultyType = eventData.difficultyType;
                playerData.curDataEvent.arcEnd         = eventData.arcEnd;
                playerData.curDataEvent.eventDecision  = eventData.eventDecision;
                playerData.curDataEvent.eventType      = eventData.eventType;
                playerData.curDataEvent.isStoryArc     = eventData.isStoryArc;
                playerData.curDataEvent.storyArc       = eventData.storyArc;
                playerData.curDataEvent.reporterType   = eventData.reporterType;
            }
            else
            {
                playerData.curDataEvent = null;
            }
        }
Ejemplo n.º 7
0
 public void ClearSavedData()
 {
     queuedDataEventsList.Clear();
     curDataEvent = null;
     curDataStory = null;
 }
Ejemplo n.º 8
0
 public void SaveCurDataEvent(EventDecisionData eventData)
 {
     curDataEvent = eventData;
 }
Ejemplo n.º 9
0
        public void StartWeekEvents()
        {
            if (DramaticActManager.GetInstance.currentDrama != null)
            {
                return;
            }

            weeklyEvents = ((int)playerData.level + 1) * 3;
            int eventsToAdd = weeklyEvents;

            Debug.Log("-------------- STARTING WEEK EVENTS! --------------");
            List <EventDecisionData> temp = new List <EventDecisionData>();

            // IF THERE'S an EXISTING STORY -> GET THE NEXT INDEX FIRST
            if (isInStory)
            {
                // Check if in Story -
                if (isInStory && eventStorage.EnableDebugging)
                {
                    // Check currentStory Interval.
                    if (currentStory.curEventIdx == 0)
                    {
                        // Check if we're past starting week
                        if (currentStory.startingWeek <= playerData.weekCount)
                        {
                            currentEvent = currentStory.storyEvents[currentStory.curEventIdx];
                            eventsToAdd -= 1;
                        }
                    }
                    else
                    {
                        if (currentStory.nextEventWeek <= playerData.weekCount)
                        {
                            currentEvent = currentStory.storyEvents[currentStory.curEventIdx];
                            eventsToAdd -= 1;
                        }
                    }
                }
                else
                {
                    // CHECK WEEK REQUIREMENT
                    int curWeek      = playerData.weekCount;
                    int nextEventIdx = currentStory.curEventIdx;
                    if (curWeek >= currentStory.nextEventWeek)
                    {
                        if (eventStorage.ComputeStoryArcChance(curWeek, currentStory.storyEvents[nextEventIdx].difficultyType))
                        {
                            //Debug.Log("------------- ADDING THRU START WEEK EVENT-------------------");
                            temp.Add(currentStory.storyEvents[nextEventIdx]);
                            eventsToAdd -= 1;
                        }
                    }
                }
            }

            if (queuedEventsList.Count > eventsToAdd)
            {
                return;
            }

            if (TransitionManager.GetInstance.previousScene != SceneType.Courtroom)
            {
                // Check if there's Saved Events.
                PlayerGameManager mgr = PlayerGameManager.GetInstance;
                if (mgr.playerData.queuedDataEventsList.Count <= 0 || mgr.playerData.curDataEvent == null)
                {
                    temp = eventStorage.ObtainWeeklyEvents(playerData.level, eventsToAdd, playerData, isInStory);
                }
                else
                {
                    // if there is
                    LoadSavedData(mgr.playerData.queuedDataEventsList, mgr.playerData.curDataEvent, mgr.playerData.curDataStory);
                    savedDataLoaded = false;
                }
            }
            else
            {
                temp = eventStorage.ObtainWeeklyEvents(playerData.level, eventsToAdd, playerData, isInStory);
            }

            // Set QueueEvents
            queuedEventsList.AddRange(temp);

            if (ResourceInformationController.GetInstance.currentPanel != null)
            {
                ResourceInformationController.GetInstance.currentPanel.weekController.UpdateEndButton(0, weeklyEvents);
            }

            if (TransitionManager.GetInstance.currentSceneManager != null)
            {
                if (CourtroomSceneManager.GetInstance != null)
                {
                    if (TransitionManager.GetInstance.currentSceneManager == CourtroomSceneManager.GetInstance)
                    {
                        CourtroomSceneManager.GetInstance.MakeGuardShow(() => AllowStartEvent());
                    }
                    else
                    {
                        Debug.Log("Item Name: " + TransitionManager.GetInstance.currentSceneManager.gameObject.name + " Manager Name: " + CourtroomSceneManager.GetInstance.gameObject.name);
                    }
                }
            }

            SaveData();
        }