Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
TraitStoryBookHome.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using System.Linq;
3using System.Text.RegularExpressions;
4
6{
7 public override void OnRead(Chara c)
8 {
9 List<SourceQuest.Row> list = EClass.sources.quests.rows.Where((SourceQuest.Row q) => IsAvailable(q)).ToList();
10 EClass.ui.AddLayer<LayerList>().SetSize().SetList2(list, (SourceQuest.Row a) => GetTitle(a), delegate(SourceQuest.Row a, ItemGeneral b)
11 {
12 LayerDrama.fromBook = true;
13 string text3 = a.drama[0];
14 string idStep = "quest_" + a.id;
15 if (a.id == "pre_debt_runaway")
16 {
17 idStep = "loytelEscaped";
18 }
19 LayerDrama.Activate(text3, text3, idStep, GetChara(text3));
20 }, delegate
21 {
22 }, autoClose: false);
23 static Chara GetChara(string id)
24 {
26 }
27 static string GetTitle(SourceQuest.Row r)
28 {
29 string name = r.GetName();
30 string text = Regex.Replace(r.id, "([0-9]*$)", "");
31 string str = r.id.Replace(text, "");
32 int num = 1;
33 if (!str.IsEmpty())
34 {
35 num = 1 + str.ToInt();
36 }
37 if (name.IsEmpty())
38 {
39 r = EClass.sources.quests.map.TryGetValue(text);
40 if (r != null)
41 {
42 name = r.GetName();
43 }
44 }
45 return name + " " + num;
46 }
47 static bool IsAvailable(SourceQuest.Row r)
48 {
49 if (r.drama.IsEmpty() || GetChara(r.drama[0]) == null)
50 {
51 return false;
52 }
53 if (!EClass.debug.showExtra && r.tags.Contains("debug"))
54 {
55 return false;
56 }
57 string text2 = Regex.Replace(r.id, "([0-9]*$)", "");
58 if (EClass.game.quests.completedIDs.Contains(r.id) || EClass.game.quests.completedIDs.Contains(text2))
59 {
60 return true;
61 }
62 string str2 = r.id.Replace(text2, "");
63 int num2 = 0;
64 if (!str2.IsEmpty())
65 {
66 num2 = str2.ToInt();
67 }
68 Quest quest = EClass.game.quests.Get(text2);
69 if (quest != null && num2 <= quest.phase)
70 {
71 return true;
72 }
73 return EClass.debug.showExtra;
74 }
75 }
76}
Chara Find(string id)
Definition: CardManager.cs:20
GlobalCharaList globalCharas
Definition: CardManager.cs:46
Definition: Chara.cs:10
override string GetName(NameStyle style, int num=-1)
Definition: Chara.cs:1166
bool showExtra
Definition: CoreDebug.cs:167
Definition: EClass.cs:5
static Game game
Definition: EClass.cs:8
static SourceManager sources
Definition: EClass.cs:42
static CoreDebug debug
Definition: EClass.cs:48
static UI ui
Definition: EClass.cs:16
CardManager cards
Definition: Game.cs:155
QuestManager quests
Definition: Game.cs:179
static LayerDrama Activate(string book, string idSheet, string idStep, Chara target=null, Card ref1=null, string tag="")
Definition: LayerDrama.cs:66
HashSet< string > completedIDs
Definition: QuestManager.cs:17
Quest Get(string id)
Definition: Quest.cs:7
int phase
Definition: Quest.cs:40
SourceQuest quests
override void OnRead(Chara c)