@@ -38,6 +38,7 @@ public class ReactiveWeatherProcessor : LayerProcessor
3838 internal static int _previousOffset = 0 ;
3939 internal static bool dutyComplete = false ;
4040 internal static bool raidEffectsRunning = false ;
41+ internal static string [ ] bossNames = null ;
4142
4243 public override void Process ( IMappingLayer layer )
4344 {
@@ -147,29 +148,38 @@ public override void Process(IMappingLayer layer)
147148
148149 if ( chatLogEntries . Count > 0 )
149150 {
150- //Debug.WriteLine($"{chatLogEntries.First().Code}: {chatLogEntries.First().Message}");
151-
152- if ( chatLogEntries . First ( ) . Code == "0840" && Regex . IsMatch ( chatLogEntries . First ( ) . Message , @"completion time: (\d+:\d+)" ) )
151+
152+ if ( chatLogEntries . First ( ) . Code == "0840" && Regex . IsMatch ( chatLogEntries . First ( ) . Message , @"completion time: (\d+:\d+)" , RegexOptions . IgnoreCase ) )
153153 {
154154 dutyComplete = true ;
155155 raidEffectsRunning = false ;
156+ bossNames = null ;
156157 }
157158
158- else if ( chatLogEntries . First ( ) . Code == "0839" && Regex . IsMatch ( chatLogEntries . First ( ) . Message , @"has begun\." ) )
159+ else if ( chatLogEntries . First ( ) . Code == "0839" && Regex . IsMatch ( chatLogEntries . First ( ) . Message , @"has begun\." , RegexOptions . IgnoreCase ) )
159160 {
160161 dutyComplete = false ;
161162 }
162163
163- else if ( chatLogEntries . First ( ) . Code == "083E" && Regex . IsMatch ( chatLogEntries . First ( ) . Message , @"You obtain \d+ Allagan tomestones of \w+\." ) )
164+ else if ( chatLogEntries . First ( ) . Code == "083E" && Regex . IsMatch ( chatLogEntries . First ( ) . Message , @"You obtain \d+ Allagan tomestones of \w+\." , RegexOptions . IgnoreCase ) )
165+ {
166+ dutyComplete = true ;
167+ raidEffectsRunning = false ;
168+ bossNames = null ;
169+ }
170+
171+ else if ( chatLogEntries . First ( ) . Code == "0839" && Regex . IsMatch ( chatLogEntries . First ( ) . Message , @"has ended\." , RegexOptions . IgnoreCase ) )
164172 {
165173 dutyComplete = true ;
166174 raidEffectsRunning = false ;
175+ bossNames = null ;
167176 }
168177
169- else if ( chatLogEntries . First ( ) . Code == "0839" && Regex . IsMatch ( chatLogEntries . First ( ) . Message , @"has ended \." ) )
178+ else if ( bossNames != null && ( chatLogEntries . First ( ) . Code == "133A" || chatLogEntries . First ( ) . Code == "0B3A" ) && Regex . IsMatch ( chatLogEntries . First ( ) . Message , @"(.* defeats|You defeat|You defeat the) (" + string . Join ( "|" , bossNames . Select ( Regex . Escape ) ) + @") \.", RegexOptions . IgnoreCase ) )
170179 {
171180 dutyComplete = true ;
172181 raidEffectsRunning = false ;
182+ bossNames = null ;
173183 }
174184
175185 }
@@ -193,14 +203,6 @@ public override void Process(IMappingLayer layer)
193203 currentWeather = weatherService . GetCurrentWeather ( currentZone ) . Item1 . ToString ( ) ;
194204 }
195205
196- /*
197- if (raidEffectsRunning)
198- {
199- model._currentWeather = currentWeather;
200-
201- }
202- */
203-
204206
205207 //var currentWeather = weatherService.GetCurrentWeather(currentZone).Item1.ToString();
206208
@@ -209,10 +211,10 @@ public override void Process(IMappingLayer layer)
209211
210212
211213 //layergroup.Brush = weather_brush;
212- effectApplied = SetReactiveWeather ( layergroup , currentZone , currentWeather , weather_brush , _colorPalette , surface , ledArray , model . _gradientEffects , DutyFinderBellExtension . InInstance ( ) ) ;
214+ effectApplied = SetReactiveWeather ( layergroup , currentZone , currentWeather , weather_brush , _colorPalette , surface , ledArray , model . _gradientEffects , DutyFinderBellExtension . InInstance ( ) , layer . deviceGuid ) ;
213215
214216 #if DEBUG
215- Debug . WriteLine ( $ "{ layer . deviceType } Zone Lookup: { currentZone } . Weather: { currentWeather } ") ;
217+ // Debug.WriteLine($"{layer.deviceGuid } Zone Lookup: {currentZone}. Weather: {currentWeather}");
216218 #endif
217219
218220 model . _currentWeather = currentWeather ;
@@ -317,7 +319,7 @@ private static void StopEffects(ListLedGroup layer, HashSet<LinearGradient> _gra
317319 layer . RemoveAllDecorators ( ) ;
318320 }
319321
320- private static bool SetReactiveWeather ( ListLedGroup layer , string zone , string weather , SolidColorBrush weather_brush , PaletteColorModel _colorPalette , RGBSurface surface , Led [ ] ledArray , HashSet < LinearGradient > _gradientEffects , bool inInstance )
322+ private static bool SetReactiveWeather ( ListLedGroup layer , string zone , string weather , SolidColorBrush weather_brush , PaletteColorModel _colorPalette , RGBSurface surface , Led [ ] ledArray , HashSet < LinearGradient > _gradientEffects , bool inInstance , Guid deviceGuid )
321323 {
322324 var effectSettings = RGBController . GetEffectsSettings ( ) ;
323325 var runningEffects = RGBController . GetRunningEffects ( ) ;
@@ -344,6 +346,7 @@ private static bool SetReactiveWeather(ListLedGroup layer, string zone, string w
344346 SetEffect ( starfield , layer , runningEffects ) ;
345347
346348 raidEffectsRunning = true ;
349+ bossNames = [ "Zoraal Ja" ] ;
347350
348351 return true ;
349352 }
@@ -373,6 +376,7 @@ private static bool SetReactiveWeather(ListLedGroup layer, string zone, string w
373376
374377 runningEffects . Add ( layer ) ;
375378 raidEffectsRunning = true ;
379+ bossNames = [ "Queen Eternal" ] ;
376380
377381 return true ;
378382 }
@@ -402,6 +406,7 @@ private static bool SetReactiveWeather(ListLedGroup layer, string zone, string w
402406
403407 runningEffects . Add ( layer ) ;
404408 raidEffectsRunning = true ;
409+ bossNames = [ "Black Cat" ] ;
405410
406411 return true ;
407412 }
@@ -417,6 +422,7 @@ private static bool SetReactiveWeather(ListLedGroup layer, string zone, string w
417422 layer . Brush = new SolidColorBrush ( baseCol ) ;
418423 SetEffect ( arenaLightShow , layer , runningEffects ) ;
419424 raidEffectsRunning = true ;
425+ bossNames = [ "Honey B. Lovely" ] ;
420426
421427 return true ;
422428 }
@@ -445,11 +451,13 @@ private static bool SetReactiveWeather(ListLedGroup layer, string zone, string w
445451
446452 runningEffects . Add ( layer ) ;
447453 raidEffectsRunning = true ;
454+ bossNames = [ "Brute Bomber" ] ;
448455
449456 return true ;
450457 }
451458 break ;
452459 case "The Thundering" :
460+ case "Dalamud's Shadow" :
453461 //Raid Zone Effect
454462 if ( effectSettings . effect_raideffects && ! raidEffectsRunning )
455463 {
@@ -460,6 +468,9 @@ private static bool SetReactiveWeather(ListLedGroup layer, string zone, string w
460468 layer . Brush = new SolidColorBrush ( baseCol ) ;
461469 SetEffect ( bpmArenaLightShow , layer , runningEffects ) ;
462470 raidEffectsRunning = true ;
471+ bossNames = [ "Wicked Thunder" , "Rafflesia" ] ;
472+
473+ //Logger.WriteConsole(Enums.LoggerTypes.FFXIV, $"Catch X4: Effect Run ({deviceGuid})");
463474
464475 return true ;
465476 }
@@ -469,6 +480,7 @@ private static bool SetReactiveWeather(ListLedGroup layer, string zone, string w
469480 }
470481
471482 raidEffectsRunning = false ;
483+ bossNames = null ;
472484
473485 switch ( zone )
474486 {
0 commit comments