private void SiphonNearbyController_SearchForTargets(On.RoR2.SiphonNearbyController.orig_SearchForTargets orig, SiphonNearbyController self, List <HurtBox> dest) { orig(self, dest); self.sphereSearch.ClearCandidates(); self.sphereSearch.RefreshCandidates(); self.sphereSearch.FilterCandidatesByHurtBoxTeam(TeamMask.GetEnemyTeams(self.networkedBodyAttachment.attachedBody.teamComponent.teamIndex)); var destCopy = new List <HurtBox>(dest); foreach (var hurtBox in destCopy) { //Debug.Log("Mired Urn: Checking " + hurtBox.healthComponent.body.GetDisplayName()); if ((bool)hurtBox.healthComponent?.body?.hasCloakBuff) { dest.Remove(hurtBox); //Debug.Log("Removed"); } else { //Debug.Log("Kept"); } } self.sphereSearch.OrderCandidatesByDistance(); self.sphereSearch.FilterCandidatesByDistinctHurtBoxEntities(); self.sphereSearch.GetHurtBoxes(dest); self.sphereSearch.ClearCandidates(); }
private void SiphonNearbyController_Tick(On.RoR2.SiphonNearbyController.orig_Tick orig, SiphonNearbyController self) { bool hasBody = self && self.networkedBodyAttachment && self.networkedBodyAttachment.attachedBody; if (hasBody) { healingSourceStack.Push(self.networkedBodyAttachment.attachedBody); } orig(self); if (hasBody) { healingSourceStack.Pop(); } }