Elin Decompiled Documentation EA 23.316 Nightly
Loading...
Searching...
No Matches
CustomDramaExpansionHelper.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using System.Linq;
3
4public static class CustomDramaExpansionHelper
5{
6 public static void AddTempTalk(this DramaManager dm, string text, string actor = "tg", string? jump = null)
7 {
8 if (jump == null || dm.sequence.steps.ContainsKey(jump))
9 {
11 {
12 idActor = actor,
13 idJump = jump,
14 text = text,
15 temp = true,
16 sequence = dm.sequence
17 };
18 dm.sequence.tempEvents.Add(item);
19 }
20 }
21
22 public static void Goto(this DramaManager dm, string step)
23 {
24 if (dm.sequence.steps.ContainsKey(step))
25 {
26 dm.sequence.Play(step);
27 }
28 }
29
30 public static void InjectUniqueRumor(this DramaManager dm, Chara chara = null)
31 {
32 if (chara == null)
33 {
34 chara = dm.tg.chara;
35 }
36 if (chara == null)
37 {
38 return;
39 }
41 bool flag = chara.IsHumanSpeak || EClass.pc.HasElement(1640);
42 if ((!chara.IsUnique && !cs.HasTopic("unique", chara.id)) || !flag)
43 {
44 return;
45 }
47 DramaChoice choice = new DramaChoice("letsTalk".lang(), dm.sequence.steps.Last().Key.IsEmpty(dm.setup.step));
48 dm.lastTalk.choices.Add(choice);
49 dm._choices.Add(choice);
50 string rumor = (chara.IsPCParty ? chara.GetTalkText("sup") : cs.GetRumor(chara));
51 choice.SetOnClick(delegate
52 {
53 dm.sequence.firstTalk.funcText = () => rumor;
54 List<Hobby> list = chara.ListHobbies();
55 Hobby hobby = ((list.Count > 0) ? list[0] : null);
56 if (EClass.rnd(20) == 0 || EClass.debug.showFav)
57 {
58 if (EClass.rnd(2) == 0 || hobby == null)
59 {
60 GameLang.refDrama1 = chara.GetFavCat().GetName().ToLower();
61 GameLang.refDrama2 = chara.GetFavFood().GetName();
62 rumor = cs.GetText(chara, "general", "talk_fav");
63 chara.knowFav = true;
64 }
65 else
66 {
67 GameLang.refDrama1 = hobby.Name.ToLower();
68 rumor = cs.GetText(chara, "general", "talk_hobby");
69 }
70 }
71 else
72 {
73 rumor = cs.GetRumor(chara);
74 }
75 chara.affinity.OnTalkRumor();
76 choice.forceHighlight = true;
77 }).SetCondition(() => chara.interest > 0);
78 }
79}
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6285
Definition: Chara.cs:10
bool showFav
Definition: CoreDebug.cs:241
static void Goto(this DramaManager dm, string step)
static void AddTempTalk(this DramaManager dm, string text, string actor="tg", string? jump=null)
static void InjectUniqueRumor(this DramaManager dm, Chara chara=null)
DramaChoice SetOnClick(Action action)
Definition: DramaChoice.cs:56
bool HasTopic(string idSheet, string idTopic)
string GetText(Chara c, string idSheet, string idTopic)
List< DramaChoice > choices
DramaSequence sequence
Definition: DramaManager.cs:28
DramaEvent CustomEvent(Action func, string step=null, float duration=0f, bool halt=false)
List< DramaChoice > _choices
Definition: DramaManager.cs:50
DramaEventTalk lastTalk
Definition: DramaManager.cs:67
DramaSetup setup
Definition: DramaManager.cs:34
void Play(string id)
List< DramaEvent > tempEvents
Dictionary< string, int > steps
string step
Definition: DramaSetup.cs:7
Definition: EClass.cs:6
static int rnd(long a)
Definition: EClass.cs:59
static Chara pc
Definition: EClass.cs:15
static CoreDebug debug
Definition: EClass.cs:49
Definition: Hobby.cs:5
string Name
Definition: Hobby.cs:10
Chara chara
Definition: Person.cs:36