Elin Decompiled Documentation EA 23.153 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 Dictionary<string, int> dict = new Dictionary<string, int>();
10 List<SourceQuest.Row> list = EClass.sources.quests.rows.Where((SourceQuest.Row q) => IsAvailable(q)).ToList();
11 EClass.ui.AddLayer<LayerList>().SetSize().SetList2(list, (SourceQuest.Row a) => GetTitle(a), delegate(SourceQuest.Row a, ItemGeneral b)
12 {
13 EClass.ui.GetLayer<LayerList>().SetActive(enable: false);
14 LayerDrama.fromBook = true;
15 string text3 = a.drama[0];
16 string idStep = "quest_" + a.id;
17 if (a.id == "pre_debt_runaway")
18 {
19 idStep = "loytelEscaped";
20 }
21 LayerDrama.Activate(text3, text3, idStep, GetChara(text3)).SetOnKill(delegate
22 {
23 EClass.ui.GetLayer<LayerList>().SetActive(enable: true);
24 });
25 }, delegate
26 {
27 }, autoClose: false);
28 static Chara GetChara(string id)
29 {
31 }
32 string GetTitle(SourceQuest.Row r)
33 {
34 string name = r.GetName();
35 string text = Regex.Replace(r.id, "([0-9]*$)", "");
36 string str = r.id.Replace(text, "");
37 if (!str.IsEmpty())
38 {
39 str.ToInt();
40 }
41 if (name.IsEmpty())
42 {
43 r = EClass.sources.quests.map.TryGetValue(text);
44 if (r != null)
45 {
46 name = r.GetName();
47 }
48 }
49 if (!dict.ContainsKey(name))
50 {
51 dict.Add(name, 0);
52 }
53 dict[name]++;
54 return name + " " + dict[name];
55 }
56 static bool IsAvailable(SourceQuest.Row r)
57 {
58 if (r.drama.IsEmpty() || GetChara(r.drama[0]) == null)
59 {
60 return false;
61 }
62 if (!EClass.debug.showExtra && r.tags.Contains("debug"))
63 {
64 return false;
65 }
66 string text2 = Regex.Replace(r.id, "([0-9]*$)", "");
67 if (EClass.game.quests.completedIDs.Contains(r.id) || EClass.game.quests.completedIDs.Contains(text2))
68 {
69 return true;
70 }
71 string str2 = r.id.Replace(text2, "");
72 int num = 0;
73 if (!str2.IsEmpty())
74 {
75 num = str2.ToInt();
76 }
77 Quest quest = EClass.game.quests.Get(text2);
78 if (quest != null && num <= quest.phase)
79 {
80 return true;
81 }
82 return EClass.debug.showExtra;
83 }
84 }
85}
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:1209
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
Layer SetOnKill(Action action)
Definition: Layer.cs:579
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)