Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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();
            }
        }