Elin Decompiled Documentation EA 23.339.0 Nightly
Loading...
Searching...
No Matches
QuestManager Class Reference
Inheritance diagram for QuestManager:
EClass

Public Member Functions

Quest Add (string id, string idGlobalChara=null)
 
Quest Start (string id, string idGlobalChara)
 
Quest Start (string id, Chara c=null, bool assignQuest=true)
 
Quest Start (Quest q)
 
void Remove (Quest q)
 
void RemoveGlobal (Quest q)
 
void RemoveAll (Chara c)
 
void Complete (Quest q)
 
bool OnShowDialog (Chara c)
 
void OnAdvanceHour ()
 
bool IsCompleted (string id)
 
bool IsCompleted< T > ()
 
bool IsAdded (string id)
 
bool IsAdded< T > ()
 
bool IsStarted< T > ()
 
bool IsStarted (string id)
 
int GetPhase< T > ()
 
int GetPhase (string id)
 
Get< T > ()
 
Quest Get (string id)
 
Quest Get (int uid)
 
Quest GetGlobal (string id)
 
int CountNew ()
 
int CountRandomQuest ()
 
void UpdateJournal ()
 
bool IsDeliverTarget (Chara c)
 
void AddQuestAsh ()
 
void AddQuestFiama ()
 
bool HasFarAwayEscort (bool execute=false)
 
void OnEnterZone ()
 

Public Attributes

List< Questlist = new List<Quest>()
 
List< QuestglobalList = new List<Quest>()
 
HashSet< string > completedIDs = new HashSet<string>()
 
HashSet< string > completedTypes = new HashSet<string>()
 
int uid
 

Static Public Attributes

const int MaxRandomQuest = 5
 
- Static Public Attributes inherited from EClass
static Core core
 

Properties

QuestMain Main [get]
 
new QuestHome Home [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]
 

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)
 

Detailed Description

Definition at line 6 of file QuestManager.cs.

Member Function Documentation

◆ Add()

Quest QuestManager.Add ( string  id,
string  idGlobalChara = null 
)
inline

Definition at line 29 of file QuestManager.cs.

30 {
31 Quest quest = Quest.Create(id);
32 if (idGlobalChara.IsEmpty())
33 {
34 idGlobalChara = quest.source.drama[0];
35 }
36 quest.SetClient(EClass.game.cards.globalCharas.Find(idGlobalChara), assignQuest: false);
37 EClass.game.quests.globalList.Add(quest);
38 return quest;
39 }
Chara Find(string id)
Definition: CardManager.cs:20
GlobalCharaList globalCharas
Definition: CardManager.cs:46
Definition: EClass.cs:6
static Game game
Definition: EClass.cs:9
CardManager cards
Definition: Game.cs:156
QuestManager quests
Definition: Game.cs:183
List< Quest > globalList
Definition: QuestManager.cs:14
Definition: Quest.cs:7
static Quest Create(string _id, string _idPerson=null, Chara c=null, bool assignQuest=true)
Definition: Quest.cs:241
Quest SetClient(Chara c, bool assignQuest=true)
Definition: Quest.cs:380
virtual SourceQuest.Row source
Definition: Quest.cs:107

References Game.cards, Quest.Create(), CardManager.GlobalCharaList.Find(), EClass.game, CardManager.globalCharas, globalList, Game.quests, Quest.SetClient(), and Quest.source.

Referenced by GameDate.AdvanceDay(), SurvivalManager.CheckLoytelDebt(), QuestLoytelFarm.OnComplete(), QuestShippingChest.OnComplete(), QuestVernis.OnComplete(), QuestDialog.OnDropReward(), QuestIntoDarkness.OnStart(), CoreDebug.QuickStart(), Chara.ShowDialog(), and CoreDebug.UpdateInput().

◆ AddQuestAsh()

void QuestManager.AddQuestAsh ( )
inline

Definition at line 308 of file QuestManager.cs.

309 {
310 Chara c = EClass.game.cards.globalCharas.Find("ashland");
311 QuestCraft obj = Quest.Create("ash1") as QuestCraft;
312 obj.SetClient(c);
313 obj.req1.Add(new QuestCraft.Req("rock", 1));
314 obj.req1.Add(new QuestCraft.Req("branch", 1));
315 obj.req2.Add(new QuestCraft.Req("axe", 1));
316 }
Definition: Chara.cs:10
List< Req > req1
Definition: QuestCraft.cs:27
List< Req > req2
Definition: QuestCraft.cs:30

References Game.cards, Quest.Create(), CardManager.GlobalCharaList.Find(), EClass.game, CardManager.globalCharas, QuestCraft.req1, QuestCraft.req2, and Quest.SetClient().

◆ AddQuestFiama()

void QuestManager.AddQuestFiama ( )
inline

Definition at line 318 of file QuestManager.cs.

319 {
320 Chara c = EClass.game.cards.globalCharas.Find("fiama");
321 QuestCraft obj = Quest.Create("fiama1") as QuestCraft;
322 obj.SetClient(c);
323 obj.req1.Add(new QuestCraft.Req("crim", 3));
324 obj.req2.Add(new QuestCraft.Req("hotcrim", 1));
325 }

References Game.cards, Quest.Create(), CardManager.GlobalCharaList.Find(), EClass.game, CardManager.globalCharas, QuestCraft.req1, QuestCraft.req2, and Quest.SetClient().

◆ Complete()

void QuestManager.Complete ( Quest  q)
inline

Definition at line 98 of file QuestManager.cs.

99 {
100 q.Complete();
101 }
void Complete()
Definition: Quest.cs:473

References Quest.Complete().

Referenced by QuestCraft.Deliver(), QuestDeliver.Deliver(), Quest.OnCompleteTask(), and DramaManager.ParseLine().

◆ CountNew()

int QuestManager.CountNew ( )
inline

Definition at line 264 of file QuestManager.cs.

265 {
266 int num = 0;
267 foreach (Quest item in list)
268 {
269 if (item.isNew)
270 {
271 num++;
272 }
273 }
274 return num;
275 }
List< Quest > list
Definition: QuestManager.cs:11

References item, and list.

◆ CountRandomQuest()

int QuestManager.CountRandomQuest ( )
inline

Definition at line 277 of file QuestManager.cs.

278 {
279 int num = 0;
280 foreach (Quest item in list)
281 {
282 if (item is QuestRandom)
283 {
284 num++;
285 }
286 }
287 return num;
288 }

References item, and list.

Referenced by LayerQuestBoard.RefreshQuest().

◆ Get() [1/2]

Quest QuestManager.Get ( int  uid)
inline

Definition at line 240 of file QuestManager.cs.

241 {
242 foreach (Quest item in list)
243 {
244 if (item.uid == uid)
245 {
246 return item;
247 }
248 }
249 return null;
250 }

References item, list, and uid.

◆ Get() [2/2]

◆ Get< T >()

T QuestManager.Get< T > ( )
inline
Type Constraints
T :Quest 

Definition at line 216 of file QuestManager.cs.

216 : Quest
217 {
218 foreach (Quest item in list)
219 {
220 if (item is T)
221 {
222 return item as T;
223 }
224 }
225 return null;
226 }

References item, and list.

◆ GetGlobal()

Quest QuestManager.GetGlobal ( string  id)
inline

Definition at line 252 of file QuestManager.cs.

253 {
254 foreach (Quest global in globalList)
255 {
256 if (global.GetType().ToString() == id || global.id == id)
257 {
258 return global;
259 }
260 }
261 return null;
262 }
string id
Definition: Quest.cs:31

References globalList, and Quest.id.

Referenced by GameDate.AdvanceDay().

◆ GetPhase()

int QuestManager.GetPhase ( string  id)
inline

Definition at line 200 of file QuestManager.cs.

201 {
202 if (IsCompleted(id))
203 {
204 return 999;
205 }
206 foreach (Quest item in list)
207 {
208 if (item.id == id)
209 {
210 return item.phase;
211 }
212 }
213 return -1;
214 }
bool IsCompleted(string id)

References IsCompleted(), item, and list.

Referenced by TraitDamnPool.CanUse(), IsAdded(), IsStarted(), RecipeManager.ListSources(), Zone_DungeonDead.OnActivate(), Zone_Exile.OnActivate(), Trait.OnBarter(), Player.Flags.OnEnterZone(), TCOrbitChara.RefreshAll(), RecipeUpdater.RunRecipe(), CardRenderer.ShowBossText(), Chara.ShowDialog(), ActThrow.Throw(), and Chara.TryDropBossLoot().

◆ GetPhase< T >()

int QuestManager.GetPhase< T > ( )
inline
Type Constraints
T :Quest 

Definition at line 184 of file QuestManager.cs.

184 : Quest
185 {
186 if (completedTypes.Contains(typeof(T).ToString()))
187 {
188 return 999;
189 }
190 foreach (Quest item in list)
191 {
192 if (item is T)
193 {
194 return item.phase;
195 }
196 }
197 return -1;
198 }
HashSet< string > completedTypes
Definition: QuestManager.cs:20

References completedTypes, item, and list.

Referenced by IsAdded< T >(), and IsStarted< T >().

◆ HasFarAwayEscort()

bool QuestManager.HasFarAwayEscort ( bool  execute = false)
inline

Definition at line 327 of file QuestManager.cs.

328 {
329 bool has = false;
331 {
332 return false;
333 }
334 EClass._map.charas.ForeachReverse(delegate(Chara m)
335 {
336 if (m.IsEscorted() && EClass.pc.Dist(m) >= 5)
337 {
338 has = true;
339 if (execute)
340 {
341 m.Destroy();
342 }
343 }
344 });
345 if (has && execute)
346 {
347 OnEnterZone();
348 }
349 return has;
350 }
int Dist(Card c)
Definition: Card.cs:8197
bool IsEscorted()
Definition: Chara.cs:2627
static Zone _zone
Definition: EClass.cs:21
static Map _map
Definition: EClass.cs:19
static Chara pc
Definition: EClass.cs:15
List< Chara > charas
Definition: Map.cs:81
void OnEnterZone()
virtual bool HasLaw
Definition: Zone.cs:233
bool IsInstance
Definition: Zone.cs:493
virtual bool IsTown
Definition: Zone.cs:227
bool IsPCFaction
Definition: Zone.cs:477

References EClass._map, EClass._zone, Map.charas, Card.Dist(), Zone.HasLaw, Chara.IsEscorted(), Zone.IsInstance, Zone.IsPCFaction, Zone.IsTown, and EClass.pc.

Referenced by Player.ExitBorder().

◆ IsAdded()

bool QuestManager.IsAdded ( string  id)
inline

Definition at line 142 of file QuestManager.cs.

143 {
144 if (IsStarted(id) || GetPhase(id) == 999)
145 {
146 return true;
147 }
148 foreach (Quest global in globalList)
149 {
150 if (global.id == id)
151 {
152 return true;
153 }
154 }
155 return false;
156 }
bool IsStarted(string id)
int GetPhase(string id)

References GetPhase(), globalList, Quest.id, and IsStarted().

Referenced by GameDate.AdvanceDay(), and SurvivalManager.CheckLoytelDebt().

◆ IsAdded< T >()

bool QuestManager.IsAdded< T > ( )
inline
Type Constraints
T :Quest 

Definition at line 158 of file QuestManager.cs.

158 : Quest
159 {
160 if (IsStarted<T>() || GetPhase<T>() == 999)
161 {
162 return true;
163 }
164 foreach (Quest global in globalList)
165 {
166 if (global is T)
167 {
168 return true;
169 }
170 }
171 return false;
172 }
int GetPhase< T >()
bool IsStarted< T >()

References GetPhase< T >(), globalList, and IsStarted< T >().

◆ IsCompleted()

bool QuestManager.IsCompleted ( string  id)
inline

◆ IsCompleted< T >()

bool QuestManager.IsCompleted< T > ( )
inline
Type Constraints
T :Quest 

Definition at line 137 of file QuestManager.cs.

137 : Quest
138 {
139 return completedTypes.Contains(typeof(T).ToString());
140 }

References completedTypes.

◆ IsDeliverTarget()

bool QuestManager.IsDeliverTarget ( Chara  c)
inline

Definition at line 296 of file QuestManager.cs.

297 {
298 foreach (Quest item in list)
299 {
300 if (item.IsDeliverTarget(c))
301 {
302 return true;
303 }
304 }
305 return false;
306 }

References item, and list.

Referenced by ActPlan._Update().

◆ IsStarted()

bool QuestManager.IsStarted ( string  id)
inline

Definition at line 179 of file QuestManager.cs.

180 {
181 return GetPhase(id) != -1;
182 }

References GetPhase().

Referenced by GameDate.AdvanceDay(), IsAdded(), LayerShippingResult.Refresh(), and Chara.TryDropBossLoot().

◆ IsStarted< T >()

bool QuestManager.IsStarted< T > ( )
inline
Type Constraints
T :Quest 

Definition at line 174 of file QuestManager.cs.

174 : Quest
175 {
176 return GetPhase<T>() != -1;
177 }

References GetPhase< T >().

Referenced by IsAdded< T >().

◆ OnAdvanceHour()

void QuestManager.OnAdvanceHour ( )
inline

Definition at line 120 of file QuestManager.cs.

121 {
122 list.ForeachReverse(delegate(Quest q)
123 {
124 if (q.IsExpired)
125 {
126 Msg.Say("questExpired", q.GetTitle());
127 q.Fail();
128 }
129 });
130 }
bool IsExpired
Definition: Quest.cs:112

References Quest.IsExpired, and list.

Referenced by GameDate.AdvanceHour().

◆ OnEnterZone()

void QuestManager.OnEnterZone ( )
inline

Definition at line 352 of file QuestManager.cs.

353 {
354 list.ForeachReverse(delegate(Quest q)
355 {
356 q.OnEnterZone();
357 });
358 }
virtual void OnEnterZone()
Definition: Quest.cs:418

References Quest.OnEnterZone().

Referenced by Scene.Init().

◆ OnShowDialog()

bool QuestManager.OnShowDialog ( Chara  c)
inline

Definition at line 103 of file QuestManager.cs.

104 {
105 foreach (Quest item in list)
106 {
107 if (!item.person.hasChara && item is QuestExploration && item.phase == 5 && c.id == "ashland")
108 {
109 EClass.ui.Say("Bug: Quest Ash not found");
110 item.person.uidChara = c.uid;
111 }
112 if (item.person.chara == c && (item.CanUpdateOnTalk(c) || (item.CanAutoAdvance && EClass.debug.autoAdvanceQuest)))
113 {
114 return item.UpdateOnTalk();
115 }
116 }
117 return false;
118 }
string id
Definition: Card.cs:36
int uid
Definition: Card.cs:125
bool autoAdvanceQuest
Definition: CoreDebug.cs:226
static CoreDebug debug
Definition: EClass.cs:49
static UI ui
Definition: EClass.cs:17

References CoreDebug.autoAdvanceQuest, EClass.debug, item, list, and EClass.ui.

Referenced by Chara.ShowDialog().

◆ Remove()

void QuestManager.Remove ( Quest  q)
inline

Definition at line 67 of file QuestManager.cs.

68 {
69 if (!list.Remove(q))
70 {
71 Debug.Log("exception: Failed to remove quest:" + q?.ToString() + "/" + q.uid + "/" + q.source.id + "/" + q.deadline + "/" + q.Hours);
72 q = Get(q.uid);
73 Debug.Log(q);
74 if (q != null && q.IsRandomQuest)
75 {
76 list.Remove(q);
77 }
78 }
79 }
Quest Get(string id)
virtual bool IsRandomQuest
Definition: Quest.cs:237
int uid
Definition: Quest.cs:34
int Hours
Definition: Quest.cs:124
int deadline
Definition: Quest.cs:46

References Quest.deadline, Debug, Get(), Quest.Hours, Quest.IsRandomQuest, list, Quest.source, and Quest.uid.

Referenced by Quest.Complete(), Quest.Fail(), ItemQuestTracker.OnClickClose(), RemoveAll(), and Recipe.ToggleTrack().

◆ RemoveAll()

void QuestManager.RemoveAll ( Chara  c)
inline

Definition at line 86 of file QuestManager.cs.

87 {
88 foreach (Quest item in list.Where((Quest a) => a.chara == c).ToList())
89 {
90 Remove(item);
91 }
92 foreach (Quest item2 in globalList.Where((Quest a) => a.chara == c).ToList())
93 {
94 RemoveGlobal(item2);
95 }
96 }
void RemoveGlobal(Quest q)
Definition: QuestManager.cs:81
void Remove(Quest q)
Definition: QuestManager.cs:67
Chara chara
Definition: Quest.cs:105

References Quest.chara, globalList, item, list, Remove(), and RemoveGlobal().

Referenced by DramaOutcome.QuestExploration_AfterComplete().

◆ RemoveGlobal()

void QuestManager.RemoveGlobal ( Quest  q)
inline

Definition at line 81 of file QuestManager.cs.

82 {
83 globalList.Remove(q);
84 }

References globalList.

Referenced by RemoveAll().

◆ Start() [1/3]

Quest QuestManager.Start ( Quest  q)
inline

Definition at line 52 of file QuestManager.cs.

53 {
54 list.Insert(0, q);
55 q.Start();
57 {
58 q.UpdateJournal();
60 {
62 }
63 }
64 return q;
65 }
bool IsGameStarted
Definition: Core.cs:87
static Core core
Definition: EClass.cs:7
static Player player
Definition: EClass.cs:13
bool questTracker
Definition: Player.cs:1056
void Start()
Definition: Quest.cs:405
void UpdateJournal()
Definition: Quest.cs:690

References EClass.core, Core.IsGameStarted, list, EClass.player, Player.questTracker, WidgetQuestTracker.Show(), Quest.Start(), and Quest.UpdateJournal().

◆ Start() [2/3]

Quest QuestManager.Start ( string  id,
Chara  c = null,
bool  assignQuest = true 
)
inline

Definition at line 47 of file QuestManager.cs.

48 {
49 return Start(Quest.Create(id).SetClient(c, assignQuest));
50 }
Quest Start(string id, string idGlobalChara)
Definition: QuestManager.cs:41

References Quest.Create(), Quest.SetClient(), and Start().

◆ Start() [3/3]

◆ UpdateJournal()

void QuestManager.UpdateJournal ( )
inline

Definition at line 290 of file QuestManager.cs.

291 {
292 SE.WriteJournal();
293 Msg.Say("journalUpdate");
294 }
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58

References Msg.Say().

Referenced by DramaManager.ParseLine().

Member Data Documentation

◆ completedIDs

HashSet<string> QuestManager.completedIDs = new HashSet<string>()

◆ completedTypes

HashSet<string> QuestManager.completedTypes = new HashSet<string>()

Definition at line 20 of file QuestManager.cs.

Referenced by Quest.Complete(), GetPhase< T >(), and IsCompleted< T >().

◆ globalList

◆ list

◆ MaxRandomQuest

const int QuestManager.MaxRandomQuest = 5
static

Definition at line 8 of file QuestManager.cs.

◆ uid

int QuestManager.uid

Definition at line 23 of file QuestManager.cs.

Referenced by Get(), and Quest.Init().

Property Documentation

◆ Home

new QuestHome QuestManager.Home
get

Definition at line 27 of file QuestManager.cs.

◆ Main

QuestMain QuestManager.Main
get

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