@@ -67,21 +67,21 @@ static public void ProcessEvents(RemnantCharacter character, string eventsText,
6767 {
6868 Dictionary < string , Dictionary < string , string > > zones = new Dictionary < string , Dictionary < string , string > > ( ) ;
6969 Dictionary < string , List < RemnantWorldEvent > > zoneEvents = new Dictionary < string , List < RemnantWorldEvent > > ( ) ;
70+ List < RemnantWorldEvent > churchEvents = new List < RemnantWorldEvent > ( ) ;
7071 foreach ( string z in GameInfo . Zones )
7172 {
7273 zones . Add ( z , new Dictionary < string , string > ( ) ) ;
7374 zoneEvents . Add ( z , new List < RemnantWorldEvent > ( ) ) ;
7475 }
7576
77+ string zone = null ;
7678 string currentMainLocation = "Fairview" ;
7779 string currentSublocation = null ;
7880
7981 string eventName = null ;
80- MatchCollection matches = Regex . Matches ( eventsText , "(?:/[a-zA-Z0-9_]+){3}/([a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+)" ) ;
82+ MatchCollection matches = Regex . Matches ( eventsText , "(?:/[a-zA-Z0-9_]+){3}/(( [a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+)|Quest_Church )" ) ;
8183 foreach ( Match match in matches )
8284 {
83- RemnantWorldEvent se = new RemnantWorldEvent ( ) ;
84- string zone = null ;
8585 string eventType = null ;
8686 string lastEventname = eventName ;
8787 eventName = null ;
@@ -98,6 +98,7 @@ static public void ProcessEvents(RemnantCharacter character, string eventsText,
9898 eventType = getEventType ( textLine ) ;
9999 if ( textLine . Contains ( "Overworld_Zone" ) )
100100 {
101+ //process overworld zone marker
101102 currentMainLocation = textLine . Split ( '/' ) [ 4 ] . Split ( '_' ) [ 1 ] + " " + textLine . Split ( '/' ) [ 4 ] . Split ( '_' ) [ 2 ] + " " + textLine . Split ( '/' ) [ 4 ] . Split ( '_' ) [ 3 ] ;
102103 if ( GameInfo . MainLocations . ContainsKey ( currentMainLocation ) )
103104 {
@@ -107,9 +108,18 @@ static public void ProcessEvents(RemnantCharacter character, string eventsText,
107108 {
108109 currentMainLocation = null ;
109110 }
111+ continue ;
112+ }
113+ else if ( textLine . Contains ( "Quest_Church" ) )
114+ {
115+ //process Root Mother event
116+ currentMainLocation = "Chapel Station" ;
117+ eventName = "RootMother" ;
118+ currentSublocation = "Church of the Harbinger" ;
110119 }
111120 else if ( eventType != null )
112121 {
122+ //process other events, if they're recognized by getEventType
113123 eventName = textLine . Split ( '/' ) [ 4 ] . Split ( '_' ) [ 2 ] ;
114124 if ( textLine . Contains ( "OverworldPOI" ) || textLine . Contains ( "Sketterling" ) )
115125 {
@@ -126,12 +136,23 @@ static public void ProcessEvents(RemnantCharacter character, string eventsText,
126136 currentSublocation = null ;
127137 }
128138 }
139+ if ( "Chapel Station" . Equals ( currentMainLocation ) )
140+ {
141+ if ( textLine . Contains ( "Quest_Boss" ) )
142+ {
143+ currentMainLocation = "Westcourt" ;
144+ } else
145+ {
146+ currentSublocation = null ;
147+ }
148+ }
129149 }
130150
131151 if ( mode == ProcessMode . Adventure ) currentMainLocation = null ;
132152
133153 if ( eventName != lastEventname )
134154 {
155+ RemnantWorldEvent se = new RemnantWorldEvent ( ) ;
135156 // Replacements
136157 if ( eventName != null )
137158 {
@@ -156,7 +177,13 @@ static public void ProcessEvents(RemnantCharacter character, string eventsText,
156177 se . Location = string . Join ( ": " , locationList ) ;
157178 se . Type = eventType ;
158179 se . setMissingItems ( character ) ;
159- zoneEvents [ zone ] . Add ( se ) ;
180+ if ( ! "Chapel Station" . Equals ( currentMainLocation ) ) {
181+ zoneEvents [ zone ] . Add ( se ) ;
182+ }
183+ else
184+ {
185+ churchEvents . Insert ( 0 , se ) ;
186+ }
160187
161188 // rings drop with the Cryptolith on Rhom
162189 if ( eventName . Equals ( "Cryptolith" ) && zone . Equals ( "Rhom" ) )
@@ -207,7 +234,6 @@ static public void ProcessEvents(RemnantCharacter character, string eventsText,
207234 bool navunAdded = false ;
208235 RemnantWorldEvent ward13 = new RemnantWorldEvent ( ) ;
209236 RemnantWorldEvent hideout = new RemnantWorldEvent ( ) ;
210- RemnantWorldEvent church = new RemnantWorldEvent ( ) ;
211237 RemnantWorldEvent undying = new RemnantWorldEvent ( ) ;
212238 RemnantWorldEvent queen = new RemnantWorldEvent ( ) ;
213239 RemnantWorldEvent navun = new RemnantWorldEvent ( ) ;
@@ -228,12 +254,6 @@ static public void ProcessEvents(RemnantCharacter character, string eventsText,
228254 hideout . setMissingItems ( character ) ;
229255 if ( hideout . MissingItems . Length > 0 ) orderedEvents . Add ( hideout ) ;
230256
231- church . setKey ( "RootMother" ) ;
232- church . Name = "Root Mother" ;
233- church . Location = "Earth: Church of the Harbinger" ;
234- church . Type = "Siege" ;
235- church . setMissingItems ( character ) ;
236-
237257 undying . setKey ( "UndyingKing" ) ;
238258 undying . Name = "Undying King" ;
239259 undying . Location = "Rhom: Undying Throne" ;
@@ -263,7 +283,10 @@ static public void ProcessEvents(RemnantCharacter character, string eventsText,
263283 {
264284 if ( mode == ProcessMode . Campaign && ! churchAdded && zoneEvents [ "Earth" ] [ i ] . Location . Contains ( "Westcourt" ) )
265285 {
266- if ( church . MissingItems . Length > 0 ) orderedEvents . Add ( church ) ;
286+ foreach ( RemnantWorldEvent rwe in churchEvents )
287+ {
288+ orderedEvents . Add ( rwe ) ;
289+ }
267290 churchAdded = true ;
268291 }
269292 orderedEvents . Add ( zoneEvents [ "Earth" ] [ i ] ) ;
@@ -313,7 +336,7 @@ static public void ProcessEvents(RemnantCharacter character, string eventsText,
313336 static private string getZone ( string textLine )
314337 {
315338 string zone = null ;
316- if ( textLine . Contains ( "World_City" ) )
339+ if ( textLine . Contains ( "World_City" ) || textLine . Contains ( "Quest_Church" ) )
317340 {
318341 zone = "Earth" ;
319342 }
@@ -343,7 +366,7 @@ static private string getEventType(string textLine)
343366 {
344367 eventType = "World Boss" ;
345368 }
346- else if ( textLine . Contains ( "Siege" ) )
369+ else if ( textLine . Contains ( "Siege" ) || textLine . Contains ( "Quest_Church" ) )
347370 {
348371 eventType = "Siege" ;
349372 }
0 commit comments