@@ -94,34 +94,22 @@ public override void OnKill(NPC npc) {
94
94
/// <summary>
95
95
/// Handles all of BossChecklist's custom downed variables, makring them as defeated and updating all clients when needed.
96
96
/// </summary>
97
- public void HandleDownedNPCs ( int npcType ) {
97
+ /// <returns>If the corresponding flag was flipped.</returns>
98
+ internal static bool HandleDownedNPCs ( int npcType ) {
98
99
if ( ! WorldAssist . TrackingDowns )
99
- return ;
100
+ return false ;
100
101
101
- if ( ( npcType == NPCID . DD2DarkMageT1 || npcType == NPCID . DD2DarkMageT3 ) && ! WorldAssist . downedDarkMage ) {
102
- WorldAssist . downedDarkMage = true ;
103
- if ( Main . netMode == NetmodeID . Server ) {
104
- NetMessage . SendData ( MessageID . WorldData ) ;
105
- }
106
- }
107
- else if ( ( npcType == NPCID . DD2OgreT2 || npcType == NPCID . DD2OgreT3 ) && ! WorldAssist . downedOgre ) {
108
- WorldAssist . downedOgre = true ;
109
- if ( Main . netMode == NetmodeID . Server ) {
110
- NetMessage . SendData ( MessageID . WorldData ) ;
111
- }
112
- }
113
- else if ( npcType == NPCID . PirateShip && ! WorldAssist . downedFlyingDutchman ) {
114
- WorldAssist . downedFlyingDutchman = true ;
115
- if ( Main . netMode == NetmodeID . Server ) {
116
- NetMessage . SendData ( MessageID . WorldData ) ;
117
- }
118
- }
119
- else if ( npcType == NPCID . MartianSaucerCore && ! WorldAssist . downedMartianSaucer ) {
120
- WorldAssist . downedMartianSaucer = true ;
121
- if ( Main . netMode == NetmodeID . Server ) {
122
- NetMessage . SendData ( MessageID . WorldData ) ;
123
- }
124
- }
102
+ return npcType switch {
103
+ NPCID . DD2DarkMageT1 | NPCID . DD2DarkMageT1 => Networking . DownedEntryCheck ( ref WorldAssist . downedDarkMage ) ,
104
+ NPCID . DD2OgreT2 | NPCID . DD2OgreT3 => Networking . DownedEntryCheck ( ref WorldAssist . downedOgre ) ,
105
+ NPCID . PirateShip => Networking . DownedEntryCheck ( ref WorldAssist . downedFlyingDutchman ) ,
106
+ NPCID . MartianSaucerCore => Networking . DownedEntryCheck ( ref WorldAssist . downedMartianSaucer ) ,
107
+ NPCID . LunarTowerVortex => Networking . DownedEntryCheck ( ref NPC . downedTowerVortex ) ,
108
+ NPCID . LunarTowerStardust => Networking . DownedEntryCheck ( ref NPC . downedTowerStardust ) ,
109
+ NPCID . LunarTowerNebula => Networking . DownedEntryCheck ( ref NPC . downedTowerNebula ) ,
110
+ NPCID . LunarTowerSolar => Networking . DownedEntryCheck ( ref NPC . downedTowerSolar ) ,
111
+ _ => false
112
+ } ;
125
113
}
126
114
}
127
115
}
0 commit comments