Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // StardewValley.Dialogue
- private void parseDialogueString(string masterString)
- {
- bool flag = masterString == null;
- if (flag)
- {
- masterString = "...";
- }
- this.temporaryDialogue = null;
- bool flag2 = this.playerResponses != null;
- if (flag2)
- {
- this.playerResponses.Clear();
- }
- string[] array = masterString.Split(new char[]
- {
- '#'
- });
- int num2;
- for (int i = 0; i < array.Count<string>(); i = num2 + 1)
- {
- bool flag3 = array[i].Count<char>() >= 2;
- if (flag3)
- {
- array[i] = this.checkForSpecialCharacters(array[i]);
- string text;
- try
- {
- text = array[i].Substring(0, 2);
- }
- catch (Exception)
- {
- text = " ";
- }
- bool flag4 = !text.Equals("$e");
- if (flag4)
- {
- bool flag5 = text.Equals("$b");
- if (flag5)
- {
- bool flag6 = this.dialogues.Count<string>() > 0;
- if (flag6)
- {
- List<string> list;
- int index;
- (list = this.dialogues)[index = this.dialogues.Count<string>() - 1] = list[index] + "{";
- }
- }
- else
- {
- bool flag7 = text.Equals("$k");
- if (flag7)
- {
- this.dialogueToBeKilled = true;
- }
- else
- {
- bool flag8 = text.Equals("$1") && array[i].Split(new char[]
- {
- ' '
- }).Count<string>() > 1;
- if (flag8)
- {
- string text2 = array[i].Split(new char[]
- {
- ' '
- })[1];
- bool flag9 = !Game1.player.mailReceived.Contains(text2);
- if (flag9)
- {
- array[i + 1] = this.checkForSpecialCharacters(array[i + 1]);
- this.dialogues.Add(text2 + "}" + array[i + 1]);
- i = 99999;
- break;
- }
- i += 3;
- array[i] = this.checkForSpecialCharacters(array[i]);
- }
- else
- {
- bool flag10 = text.Equals("$c") && array[i].Split(new char[]
- {
- ' '
- }).Count<string>() > 1;
- if (flag10)
- {
- double num = Convert.ToDouble(array[i].Split(new char[]
- {
- ' '
- })[1]);
- bool flag11 = Game1.random.NextDouble() > num;
- if (flag11)
- {
- num2 = i;
- i = num2 + 1;
- }
- else
- {
- this.dialogues.Add(array[i + 1]);
- i += 2;
- }
- }
- else
- {
- bool flag12 = text.Equals("$q");
- if (flag12)
- {
- bool flag13 = this.dialogues.Count<string>() > 0;
- if (flag13)
- {
- List<string> list2;
- int index2;
- (list2 = this.dialogues)[index2 = this.dialogues.Count<string>() - 1] = list2[index2] + "{";
- }
- string[] array2 = array[i].Split(new char[]
- {
- ' '
- });
- string[] array3 = array2[1].Split(new char[]
- {
- '/'
- });
- bool flag14 = false;
- for (int j = 0; j < array3.Count<string>(); j = num2 + 1)
- {
- bool flag15 = Game1.player.DialogueQuestionsAnswered.Contains(Convert.ToInt32(array3[j]));
- if (flag15)
- {
- flag14 = true;
- break;
- }
- num2 = j;
- }
- bool flag16 = flag14 && Convert.ToInt32(array3[0]) != -1;
- if (flag16)
- {
- bool flag17 = !array2[2].Equals("null");
- if (flag17)
- {
- array = array.Take(i).ToArray<string>().Concat(this.speaker.Dialogue[array2[2]].Split(new char[]
- {
- '#'
- })).ToArray<string>();
- num2 = i;
- i = num2 - 1;
- }
- }
- else
- {
- this.isLastDialogueInteractive = true;
- }
- }
- else
- {
- bool flag18 = text.Equals("$r");
- if (flag18)
- {
- string[] array4 = array[i].Split(new char[]
- {
- ' '
- });
- bool flag19 = this.playerResponses == null;
- if (flag19)
- {
- this.playerResponses = new List<Response>();
- }
- this.isLastDialogueInteractive = true;
- this.playerResponses.Add(new Response(Convert.ToInt32(array4[1]), Convert.ToInt32(array4[2]), array4[3], array[i + 1]));
- num2 = i;
- i = num2 + 1;
- }
- else
- {
- bool flag20 = text.Equals("$p");
- if (flag20)
- {
- string[] array5 = array[i].Split(new char[]
- {
- ' '
- });
- string[] array6 = array[i + 1].Split(new char[]
- {
- '|'
- });
- bool flag21 = false;
- for (int k = 1; k < array5.Count<string>(); k = num2 + 1)
- {
- bool flag22 = Game1.player.DialogueQuestionsAnswered.Contains(Convert.ToInt32(array5[1]));
- if (flag22)
- {
- flag21 = true;
- break;
- }
- num2 = k;
- }
- bool flag23 = flag21;
- if (flag23)
- {
- array = array6[0].Split(new char[]
- {
- '#'
- });
- i = -1;
- }
- else
- {
- array[i + 1] = array[i + 1].Split(new char[]
- {
- '|'
- }).Last<string>();
- }
- }
- else
- {
- bool flag24 = text.Equals("$d");
- if (flag24)
- {
- string[] array7 = array[i].Split(new char[]
- {
- ' '
- });
- string text3 = masterString.Substring(masterString.IndexOf('#') + 1);
- bool flag25 = false;
- string a;
- bool flag26 = (a = array7[1].ToLower()) != null;
- if (flag26)
- {
- bool flag27 = !(a == "joja");
- if (flag27)
- {
- bool flag28 = !(a == "cc") && !(a == "communitycenter");
- if (flag28)
- {
- bool flag29 = a == "bus";
- if (flag29)
- {
- flag25 = Game1.player.mailReceived.Contains("ccVault");
- }
- }
- else
- {
- flag25 = Game1.isLocationAccessible("CommunityCenter");
- }
- }
- else
- {
- flag25 = Game1.isLocationAccessible("JojaMart");
- }
- }
- char c = text3.Contains('|') ? '|' : '#';
- bool flag30 = flag25;
- if (flag30)
- {
- array = new string[]
- {
- text3.Split(new char[]
- {
- c
- })[0]
- };
- }
- else
- {
- array = new string[]
- {
- text3.Split(new char[]
- {
- c
- })[1]
- };
- }
- num2 = i;
- i = num2 - 1;
- }
- else
- {
- bool flag31 = text.Equals("$y");
- if (flag31)
- {
- this.quickResponse = true;
- this.isLastDialogueInteractive = true;
- bool flag32 = this.quickResponses == null;
- if (flag32)
- {
- this.quickResponses = new List<string>();
- }
- bool flag33 = this.playerResponses == null;
- if (flag33)
- {
- this.playerResponses = new List<Response>();
- }
- string text4 = array[i].Substring(array[i].IndexOf('\'') + 1);
- text4 = text4.Substring(0, text4.Length - 1);
- string[] array8 = text4.Split(new char[]
- {
- '_'
- });
- this.dialogues.Add(array8[0]);
- for (int l = 1; l < array8.Count<string>(); l += 2)
- {
- this.playerResponses.Add(new Response(-1, -1, null, Game1.parseText(array8[l])));
- this.quickResponses.Add(array8[l + 1].Replace("*", "#$b#"));
- }
- }
- else
- {
- bool flag34 = array[i].Contains("^");
- if (flag34)
- {
- bool isMale = Game1.player.IsMale;
- if (isMale)
- {
- this.dialogues.Add(array[i].Substring(0, array[i].IndexOf("^")));
- }
- else
- {
- this.dialogues.Add(array[i].Substring(array[i].IndexOf("^") + 1));
- }
- }
- else
- {
- this.dialogues.Add(array[i]);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- num2 = i;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement