Esempio n. 1
0
 public void SetMyStoryArc(StoryArcEventsData thisArc)
 {
     if (storyArc == thisArc.storyTitle)
     {
         return;
     }
     storyArc = thisArc.storyTitle;
 }
Esempio n. 2
0
        // A WHOLE LIST OF STORY ARC EVENTS
        public List <EventDecisionData> ForcedStoryEventsDataToReturn()
        {
            List <EventDecisionData> filteredEventList = new List <EventDecisionData>();

            filteredEventList = kingdomEvents.FindAll(x => x.storyArc == arcForced);
            StoryArcEventsData arc = storyArcEvents.Find(x => x.storyTitle == arcForced);

            return(arc.storyEvents);
        }
Esempio n. 3
0
        public EventDecisionData ForcedInitialStoryEventDataToReturn(string thisArc = "")
        {
            EventDecisionData        thisData          = null;
            List <EventDecisionData> filteredEventList = new List <EventDecisionData>();

            filteredEventList = kingdomEvents.FindAll(x => x.storyArc == arcForced);
            StoryArcEventsData arc = new StoryArcEventsData();

            if (string.IsNullOrEmpty(thisArc))
            {
                arc = storyArcEvents.Find(x => x.storyTitle == arcForced);
            }
            else
            {
                arc = storyArcEvents.Find(x => x.storyTitle == thisArc);
            }

            thisData = arc.storyEvents[0];
            Debug.Log("FORCED EVENT NAME: " + arc.storyEvents[0].title);
            return(thisData);
        }
Esempio n. 4
0
        public bool IsStoryArcAllowed(int currentWeek, string thisStoryTitle)
        {
            StoryArcEventsData thisArc = storyArcEvents.Find(x => x.storyTitle == thisStoryTitle);

            return(currentWeek >= thisArc.startingWeek);
        }
Esempio n. 5
0
 public bool IsStoryArcAllowed(int currentWeek, StoryArcEventsData thisArc)
 {
     return(currentWeek >= thisArc.startingWeek);
 }
Esempio n. 6
0
        public void ShowArcEventsOptions()
        {
            GUILayout.BeginArea(new Rect(10, 375, 400, position.height - 375));
            GUILayout.BeginHorizontal();
            GUILayout.Box("Story Arc Events", titleText, GUILayout.Width(295), GUILayout.Height(20));
            GUILayout.EndHorizontal();
            GUILayout.EndArea();

            GUILayout.BeginArea(new Rect(10, position.height - 215, leftPanelWidth, 315));

            arcEventsScrollPos = EditorGUILayout.BeginScrollView(arcEventsScrollPos, new GUIStyle("RL Background"), GUILayout.Width(650), GUILayout.Height(position.height - 470));



            if (curArc != null && curArc.storyEvents != null)
            {
                string[] count  = new string[curArc.storyEvents.Count];
                int[]    choice = new int[curArc.storyEvents.Count];

                for (int i = 0; i < count.Length; i++)
                {
                    choice[i] = i;
                    count[i]  = i.ToString();
                }
                for (int i = 0; i < curArc.storyEvents.Count; i++)
                {
                    int y = i;
                    EditorGUILayout.BeginHorizontal();
                    y = EditorGUILayout.IntPopup(y, count, choice, GUILayout.Width(40));
                    if (y != i)
                    {
                        SwapArcEvents(y, i);
                        GUI.FocusControl(null);
                        curArc = curKingdomEventData.storyArcEvents[selectedArcIdx];
                    }
                    EditorGUILayout.LabelField(curArc.storyEvents[i].title, GUILayout.Width(150));
                    EditorGUILayout.LabelField("[Difficulty: " + curArc.storyEvents[i].difficultyType + "]", GUILayout.Width(150), GUILayout.Height(20));

                    EditorGUILayout.LabelField(new GUIContent("Boost T:", "Current or Starting(if first Event) Week plus interval equals boost date."), GUILayout.Width(55));
                    curKingdomEventData.storyArcEvents[selectedArcIdx].eventIntervals[i] = EditorGUILayout.IntField(curKingdomEventData.storyArcEvents[selectedArcIdx].eventIntervals[i], GUILayout.Width(50), GUILayout.Height(20));

                    EditorGUILayout.LabelField(new GUIContent("Boost %:", "Amount of Chance Added to the Event being spawned."), GUILayout.Width(55));
                    curKingdomEventData.storyArcEvents[selectedArcIdx].eventBoosts[i] = EditorGUILayout.FloatField(curKingdomEventData.storyArcEvents[selectedArcIdx].eventBoosts[i], GUILayout.Width(50), GUILayout.Height(20));
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginHorizontal();
                    int eventIdx = curKingdomEventData.kingdomEvents.FindIndex(x => x.title == curArc.storyEvents[i].title);
                    if (curArc.storyEvents[i].eventDecision != null && curArc.storyEvents[i].eventDecision.Count > 0)
                    {
                        if (i == 0)
                        {
                            EditorGUILayout.Toggle(new GUIContent("Start:", "Toggle this if this is one of the end results."), true, GUILayout.Width(70));
                        }
                        else
                        {
                            curKingdomEventData.kingdomEvents[eventIdx].arcEnd = EditorGUILayout.Toggle(new GUIContent("End:", "Toggle this if this is one of the end results."), curKingdomEventData.kingdomEvents[eventIdx].arcEnd, GUILayout.Width(70));
                        }
                        EditorGUILayout.LabelField(new GUIContent("[Event Branches :", "Event Decisions that allows you to place what event should they go to after the said decision."), GUILayout.Width(100), GUILayout.Height(20));
                        for (int x = 0; x < curKingdomEventData.kingdomEvents[eventIdx].eventDecision.Count; x++)
                        {
                            int curIdx = curKingdomEventData.kingdomEvents[eventIdx].eventDecision[x].nextArcIdx;
                            EditorGUILayout.LabelField("Option [" + (x + 1) + "]", GUILayout.Width(60));
                            curKingdomEventData.kingdomEvents[eventIdx].eventDecision[x].nextArcIdx = (curIdx == 0 || curIdx >= curKingdomEventData.kingdomEvents.Count) ? i + 1 : curKingdomEventData.kingdomEvents[eventIdx].eventDecision[x].nextArcIdx;
                            curKingdomEventData.kingdomEvents[eventIdx].eventDecision[x].nextArcIdx = EditorGUILayout.IntPopup(curKingdomEventData.kingdomEvents[eventIdx].eventDecision[x].nextArcIdx, count, choice, GUILayout.Width(40));
                        }
                    }
                    EditorGUILayout.EndHorizontal();
                }
            }

            EditorGUILayout.EndScrollView();
            GUILayout.EndArea();
        }
Esempio n. 7
0
        public void ShowStoryArcList()
        {
            bool addArc    = false;
            bool saveArc   = false;
            bool removeArc = false;

            GUILayout.BeginArea(new Rect(680, 275, 400, position.height - 375));
            GUILayout.BeginHorizontal();
            GUILayout.Box("Story Arcs", titleText, GUILayout.Width(295), GUILayout.Height(20));
            GUILayout.EndHorizontal();

            arcScrollPos = EditorGUILayout.BeginScrollView(arcScrollPos, new GUIStyle("RL Background"), GUILayout.Width(300), GUILayout.Height(position.height - 10));

            if (curKingdomEventData.storyArcEvents != null && curKingdomEventData.storyArcEvents.Count > 0)
            {
                for (int i = 0; i < curKingdomEventData.storyArcEvents.Count; i++)
                {
                    bool isClicked = false;
                    isClicked = GUILayout.Button(curKingdomEventData.storyArcEvents[i].storyTitle, (selectedArc != null && curKingdomEventData.storyArcEvents[i].storyTitle == selectedArc.storyTitle) ? selectedText : notSelectedText);
                    if (isClicked)
                    {
                        if (curKingdomEventData.storyArcEvents[i] != null)
                        {
                            selectedArc    = curKingdomEventData.storyArcEvents[i];
                            selectedArcIdx = i;
                            curArc         = selectedArc;
                        }
                        isClicked = false;
                    }
                }
            }

            EditorGUILayout.EndScrollView();
            GUILayout.EndArea();

            GUILayout.BeginArea(new Rect(680, position.height - 95, 400, 225));

            GUILayout.BeginHorizontal();
            saveArc = GUILayout.Button((curArc == selectedArc) ? "Modify" : "Save", GUILayout.MaxWidth(100));
            if (curKingdomEventData.storyArcEvents == null)
            {
                curKingdomEventData.storyArcEvents = new List <StoryArcEventsData>();
            }
            if (curKingdomEventData.storyArcEvents.Find(x => x.storyTitle == curArc.storyTitle) != null)
            {
                addArc = GUILayout.Button("Create New", GUILayout.MaxWidth(100));
            }
            if (curKingdomEventData.storyArcEvents.Find(x => x.storyTitle == curArc.storyTitle) != null)
            {
                removeArc = GUILayout.Button("Remove", GUILayout.MaxWidth(100));
            }
            GUILayout.EndHorizontal();

            GUILayout.EndArea();

            // ADD BUTTON
            if (addArc)
            {
                curEvent      = new EventDecisionData();
                selectedEvent = null;
            }
            // REMOVE BUTTON
            if (removeArc)
            {
                GUI.FocusControl(null);
                removeArc = false;
                if (selectedEvent != null)
                {
                    curKingdomEventData.storyArcEvents.RemoveAt(selectedArcIdx);
                    selectedEvent = null;
                    curEvent      = new EventDecisionData();
                }
            }
            // SAVE BUTTON
            if (saveArc && !string.IsNullOrEmpty(curArc.storyTitle))
            {
                GUI.FocusControl(null);
                if (curKingdomEventData.storyArcEvents == null)
                {
                    curKingdomEventData.storyArcEvents = new List <StoryArcEventsData>();
                }
                if (curKingdomEventData.storyArcEvents.Find(x => x.storyTitle == curArc.storyTitle) == null)
                {
                    curKingdomEventData.storyArcEvents.Add(curArc);
                    curArc = new StoryArcEventsData();
                }
                else
                {
                    // MODIFY CURRENT EVENT
                    if ((curArc == selectedArc))
                    {
                        curKingdomEventData.storyArcEvents[selectedArcIdx] = curArc;
                        curArc      = new StoryArcEventsData();
                        selectedArc = null;
                    }
                    else
                    {
                        Debug.LogError("MULTIPLE ARCS WITH SAME TITLE OCCURRED, PLEACE CHECK LIST!");
                    }
                }
                saveArc = false;
            }
        }