Elin Decompiled Documentation EA 23.320 Nyaightly Patch 1
Loading...
Searching...
No Matches
DramaSequence Class Reference
Inheritance diagram for DramaSequence:
EClass

Public Types

enum  Template { Default }
 

Public Member Functions

void Clear ()
 
DramaActor GetActor (string id)
 
GetEvent< T > (string idStep)
 
DramaActor AddActor (string id, Person person)
 
void AddStep (string id)
 
DramaEvent AddEvent (DramaEvent e)
 
void PlayNext ()
 
void Play (string id)
 
void Play (int eventID=0)
 
void Exit ()
 
void OnUpdate ()
 

Public Attributes

string id
 
DramaManager manager
 
Dictionary< string, int > steps = new Dictionary<string, int>()
 
Dictionary< string, DramaActoractors = new Dictionary<string, DramaActor>()
 
List< DramaEventevents = new List<DramaEvent>()
 
bool isLoop
 
bool canCancel = true
 
bool isExited
 
bool fullPortrait
 
DramaEventTalk firstTalk
 
List< DramaEventtempEvents = new List<DramaEvent>()
 
string message = ""
 
string skipJump
 
string lastStep
 
string lastlastStep
 
DramaSetup setup
 

Properties

DialogDrama dialog [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Private Attributes

DramaEvent currentEvent
 
int currentEventID
 

Additional Inherited Members

- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (long a)
 
static int rnd (int a)
 
static int curve (long _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 
- Static Public Attributes inherited from EClass
static Core core
 

Detailed Description

Definition at line 4 of file DramaSequence.cs.

Member Enumeration Documentation

◆ Template

Enumerator
Default 

Definition at line 6 of file DramaSequence.cs.

Member Function Documentation

◆ AddActor()

DramaActor DramaSequence.AddActor ( string  id,
Person  person 
)
inline

Definition at line 110 of file DramaSequence.cs.

111 {
112 if (actors.TryGetValue(id, out var value))
113 {
114 return value;
115 }
117 value.Init(this, id, person);
118 actors.Add(id, value);
119 return value;
120 }
Transform actorPos
Definition: DramaManager.cs:22
DramaActor moldActor
Definition: DramaManager.cs:26
Dictionary< string, DramaActor > actors
DramaManager manager
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67

References DramaManager.actorPos, actors, manager, DramaManager.moldActor, and Util.

Referenced by GetActor(), DramaManager.Load(), and DramaManager.ParseLine().

◆ AddEvent()

DramaEvent DramaSequence.AddEvent ( DramaEvent  e)
inline

Definition at line 132 of file DramaSequence.cs.

133 {
134 if (!e.step.IsEmpty())
135 {
136 steps.Add(e.step, events.Count);
137 }
138 e.sequence = this;
139 events.Add(e);
140 return e;
141 }
string step
Definition: DramaEvent.cs:11
List< DramaEvent > events
Dictionary< string, int > steps

References events, DramaEvent.step, and steps.

Referenced by DramaManager.AddEvent().

◆ AddStep()

void DramaSequence.AddStep ( string  id)
inline

Definition at line 122 of file DramaSequence.cs.

123 {
124 steps.Add(id, events.Count);
125 events.Add(new DramaEvent
126 {
127 sequence = this,
128 step = id
129 });
130 }

References events, and steps.

Referenced by DramaManager.ParseLine().

◆ Clear()

void DramaSequence.Clear ( )
inline

Definition at line 49 of file DramaSequence.cs.

50 {
51 steps.Clear();
52 actors.Clear();
53 events.Clear();
54 tempEvents.Clear();
55 }
List< DramaEvent > tempEvents

References actors, events, steps, and tempEvents.

Referenced by DramaManager.Load().

◆ Exit()

void DramaSequence.Exit ( )
inline

Definition at line 196 of file DramaSequence.cs.

197 {
198 isExited = true;
199 currentEvent = null;
200 manager.SetActive(enable: false);
201 }
DramaEvent currentEvent

References currentEvent, isExited, and manager.

Referenced by DramaManager.AddCustomEvents(), CustomDramaExpansionHelper.InjectUniqueRumor(), DramaEventExit.Play(), DramaEventTalk.Play(), and Play().

◆ GetActor()

DramaActor DramaSequence.GetActor ( string  id)
inline

Definition at line 57 of file DramaSequence.cs.

58 {
59 if (actors.TryGetValue(id, out var value))
60 {
61 return value;
62 }
63 if (EClass.sources.persons.map.ContainsKey(id))
64 {
65 return AddActor(id, new Person(id));
66 }
68 {
70 if (chara != null)
71 {
72 return AddActor(id, new Person(chara));
73 }
74 }
75 if (EClass.sources.charas.map.TryGetValue(id, out var value2))
76 {
77 Person person = new Person(id)
78 {
79 name = value2.GetName()
80 };
81 if (Portrait.allIds.Contains("UN_" + id + ".png"))
82 {
83 person.idPortrait = "UN_" + id + ".png";
84 }
85 else
86 {
87 person.SetChara(CharaGen.Create(value2.id));
88 }
89 return AddActor(id, person);
90 }
91 if (actors.Count <= 0)
92 {
93 return GetActor("narrator");
94 }
95 return actors.FirstItem();
96 }
Chara Find(string id)
Definition: CardManager.cs:20
GlobalCharaList globalCharas
Definition: CardManager.cs:46
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Definition: Chara.cs:10
bool IsGameStarted
Definition: Core.cs:87
DramaActor AddActor(string id, Person person)
DramaActor GetActor(string id)
Definition: EClass.cs:6
static Game game
Definition: EClass.cs:9
static Core core
Definition: EClass.cs:7
static Map _map
Definition: EClass.cs:19
static SourceManager sources
Definition: EClass.cs:43
CardManager cards
Definition: Game.cs:156
Chara FindChara(string id)
Definition: Map.cs:2646
Definition: Person.cs:6
void SetChara(Chara c)
Definition: Person.cs:88
static HashSet< string > allIds
Definition: Portrait.cs:20
SourcePerson persons
SourceChara charas

References EClass._map, actors, AddActor(), Portrait.allIds, Game.cards, SourceManager.charas, EClass.core, CharaGen.Create(), CardManager.GlobalCharaList.Find(), Map.FindChara(), EClass.game, GetActor(), CardManager.globalCharas, Core.IsGameStarted, SourceManager.persons, Person.SetChara(), and EClass.sources.

Referenced by DramaManager.AddEvent(), and GetActor().

◆ GetEvent< T >()

T DramaSequence.GetEvent< T > ( string  idStep)
inline
Type Constraints
T :DramaEvent 

Definition at line 98 of file DramaSequence.cs.

99 {
100 foreach (DramaEvent @event in events)
101 {
102 if (@event.step == idStep)
103 {
104 return @event as T;
105 }
106 }
107 return null;
108 }

References events, and DramaEvent.step.

◆ OnUpdate()

void DramaSequence.OnUpdate ( )
inline

Definition at line 203 of file DramaSequence.cs.

204 {
205 if (tempEvents.Count > 0)
206 {
207 if (tempEvents[0].Play() && tempEvents.Count > 0)
208 {
209 tempEvents.RemoveAt(0);
210 }
211 }
212 else
213 {
214 if (currentEvent == null)
215 {
216 return;
217 }
219 {
220 string text = currentEvent.idJump;
221 if (text == "*")
222 {
223 if (setup.step.IsEmpty())
224 {
225 PlayNext();
226 return;
227 }
228 text = setup.step;
229 }
230 Play(text);
231 }
232 else if (!currentEvent.CanPlay() || currentEvent.Play())
233 {
234 PlayNext();
235 }
236 }
237 }
string idJump
Definition: DramaEvent.cs:7
virtual bool Play()
Definition: DramaEvent.cs:27
virtual bool CanPlay()
Definition: DramaEvent.cs:37
DramaSetup setup
void Play(string id)
string step
Definition: DramaSetup.cs:7

References DramaEvent.CanPlay(), currentEvent, DramaEvent.idJump, DramaEvent.Play(), Play(), PlayNext(), setup, DramaSetup.step, and tempEvents.

Referenced by Play(), and DramaManager.Update().

◆ Play() [1/2]

void DramaSequence.Play ( int  eventID = 0)
inline

Definition at line 161 of file DramaSequence.cs.

162 {
163 if (isExited)
164 {
165 return;
166 }
167 if (eventID >= events.Count)
168 {
169 if (!isLoop)
170 {
171 Exit();
172 return;
173 }
174 eventID = 0;
175 }
176 currentEventID = eventID;
177 currentEvent = events[eventID];
179 string text = eventID + "/";
180 foreach (KeyValuePair<string, int> step in steps)
181 {
182 if (step.Value == eventID)
183 {
184 text += step.Key;
185 }
186 if (step.Value == eventID && !step.Key.StartsWith("flag"))
187 {
189 lastStep = step.Key;
190 break;
191 }
192 }
193 OnUpdate();
194 }
virtual void Reset()
Definition: DramaEvent.cs:32
string lastlastStep

References currentEvent, currentEventID, events, Exit(), isExited, isLoop, lastlastStep, lastStep, OnUpdate(), DramaEvent.Reset(), and steps.

◆ Play() [2/2]

void DramaSequence.Play ( string  id)
inline

Definition at line 148 of file DramaSequence.cs.

149 {
150 if (id == "last")
151 {
152 id = lastlastStep;
153 }
154 if (!id.IsEmpty() && !steps.ContainsKey(id))
155 {
156 Debug.Log(id);
157 }
158 Play((!string.IsNullOrEmpty(id)) ? steps[id] : 0);
159 }

References Debug, lastlastStep, Play(), and steps.

Referenced by CustomDramaExpansionHelper.Goto(), OnUpdate(), DramaManager.ParseLine(), DramaEventMethod.Play(), DramaEventTalk.Play(), DramaManager.Play(), Play(), PlayNext(), and DramaCustomSequence.TempGoto().

◆ PlayNext()

void DramaSequence.PlayNext ( )
inline

Definition at line 143 of file DramaSequence.cs.

144 {
145 Play(currentEventID + 1);
146 }

References currentEventID, and Play().

Referenced by OnUpdate(), and DramaEventTalk.Play().

Member Data Documentation

◆ actors

Dictionary<string, DramaActor> DramaSequence.actors = new Dictionary<string, DramaActor>()

Definition at line 17 of file DramaSequence.cs.

Referenced by AddActor(), Clear(), and GetActor().

◆ canCancel

bool DramaSequence.canCancel = true

Definition at line 23 of file DramaSequence.cs.

◆ currentEvent

DramaEvent DramaSequence.currentEvent
private

Definition at line 33 of file DramaSequence.cs.

Referenced by Exit(), OnUpdate(), and Play().

◆ currentEventID

int DramaSequence.currentEventID
private

Definition at line 45 of file DramaSequence.cs.

Referenced by Play(), and PlayNext().

◆ events

List<DramaEvent> DramaSequence.events = new List<DramaEvent>()

Definition at line 19 of file DramaSequence.cs.

Referenced by AddEvent(), AddStep(), Clear(), GetEvent< T >(), DramaManager.ParseLine(), and Play().

◆ firstTalk

DramaEventTalk DramaSequence.firstTalk

Definition at line 29 of file DramaSequence.cs.

Referenced by DramaEventTalk.Play().

◆ fullPortrait

bool DramaSequence.fullPortrait

Definition at line 27 of file DramaSequence.cs.

Referenced by DramaActor.Talk().

◆ id

string DramaSequence.id

Definition at line 11 of file DramaSequence.cs.

◆ isExited

bool DramaSequence.isExited

Definition at line 25 of file DramaSequence.cs.

Referenced by Exit(), LayerDrama.LateUpdate(), and Play().

◆ isLoop

bool DramaSequence.isLoop

Definition at line 21 of file DramaSequence.cs.

Referenced by Play().

◆ lastlastStep

string DramaSequence.lastlastStep

Definition at line 41 of file DramaSequence.cs.

Referenced by Play().

◆ lastStep

string DramaSequence.lastStep

Definition at line 39 of file DramaSequence.cs.

Referenced by Play().

◆ manager

DramaManager DramaSequence.manager

◆ message

string DramaSequence.message = ""

Definition at line 35 of file DramaSequence.cs.

Referenced by DramaEventTalk.Play().

◆ setup

DramaSetup DramaSequence.setup

Definition at line 43 of file DramaSequence.cs.

Referenced by DramaManager.AddCustomEvents(), and OnUpdate().

◆ skipJump

string DramaSequence.skipJump

Definition at line 37 of file DramaSequence.cs.

◆ steps

Dictionary<string, int> DramaSequence.steps = new Dictionary<string, int>()

◆ tempEvents

Property Documentation

◆ dialog

DialogDrama DramaSequence.dialog
get

Definition at line 47 of file DramaSequence.cs.

Referenced by DramaEventMethod.Play(), and DramaEventTalk.Play().


The documentation for this class was generated from the following file: