public void OnReceived()
 {
     if (Util.HasEffectiveAuthority(target) || NetworkServer.active)
     {
         TeleportHelper.TeleportBody(target.GetComponent <CharacterBody>(), position);
         if (!fromServer)
         {
             NetMessageExtensions.Send(new CRTeleportNetworkMessage {
                 target = target, position = position, fromServer = true
             }, R2API.Networking.NetworkDestination.Clients);
         }
     }
 }
 public void OnInteract(Interactor interactor)
 {
     if (teleportTarget && interactor.gameObject.GetComponent <CharacterBody>())
     {
         EffectManager.SpawnEffect(GenericCharacterDeath.voidDeathEffect, new EffectData
         {
             origin = interactor.gameObject.transform.position,
             scale  = 5f
         }, true);
         if (Util.HasEffectiveAuthority(interactor.gameObject))
         {
             TeleportHelper.TeleportBody(interactor.gameObject.GetComponent <CharacterBody>(), teleportTarget.transform.position);
         }
         else
         {
             if (NetworkServer.active)
             {
                 NetMessageExtensions.Send(new CRTeleportNetworkMessage {
                     target = interactor.gameObject, position = teleportTarget.transform.position, fromServer = true
                 }, R2API.Networking.NetworkDestination.Clients);
             }
             else
             {
                 NetMessageExtensions.Send(new CRTeleportNetworkMessage {
                     target = interactor.gameObject, position = teleportTarget.transform.position, fromServer = false
                 }, R2API.Networking.NetworkDestination.Server);
             }
         }
         EffectManager.SpawnEffect(DeathState.deathExplosionEffect, new EffectData
         {
             origin = teleportTarget.transform.position + new Vector3(0, 3, 0),
             scale  = 5f
         }, true);
     }
     else
     {
         this.outer.SetNextStateToMain();
         base.gameObject.GetComponent <PurchaseInteraction>().available = false;
     }
 }
        public void FixedUpdate()
        {
            //Make protection ward match teleported bubble, and void bubble up to twice the full radius.
            protectionWard.radius = target.holdoutZoneController.currentRadius;

            switch (roundsCleared)
            {
            case 0:
                break;

            case 4:
                if (orbLocator.FindChild("OrbW").gameObject.activeSelf == false)
                {
                    orbLocator.FindChild("OrbW").gameObject.SetActive(true);
                }
                break;

            case 3:
                if (orbLocator.FindChild("OrbE").gameObject.activeSelf == false)
                {
                    orbLocator.FindChild("OrbE").gameObject.SetActive(true);
                }
                break;

            case 2:
                if (orbLocator.FindChild("OrbS").gameObject.activeSelf == false)
                {
                    orbLocator.FindChild("OrbS").gameObject.SetActive(true);
                }
                break;

            case 1:
                if (orbLocator.FindChild("OrbN").gameObject.activeSelf == false)
                {
                    orbLocator.FindChild("OrbN").gameObject.SetActive(true);
                }
                break;

            case 5:
                if (orbLocator.transform.GetChild(0).GetComponent <ParticleSystem>().isStopped == false)
                {
                    orbLocator.transform.GetChild(0).GetComponent <ParticleSystem>().Stop(true, ParticleSystemStopBehavior.StopEmitting);
                }
                if (orbLocator.FindChild("OrbN").gameObject.activeSelf == false)
                {
                    orbLocator.FindChild("OrbN").gameObject.SetActive(true);
                }
                if (orbLocator.FindChild("OrbS").gameObject.activeSelf == false)
                {
                    orbLocator.FindChild("OrbS").gameObject.SetActive(true);
                }
                if (orbLocator.FindChild("OrbE").gameObject.activeSelf == false)
                {
                    orbLocator.FindChild("OrbE").gameObject.SetActive(true);
                }
                if (orbLocator.FindChild("OrbW").gameObject.activeSelf == false)
                {
                    orbLocator.FindChild("OrbW").gameObject.SetActive(true);
                }
                break;
            }


            if (!target.isCharged)
            {
                voidWard.radius = (protectionWard.radius * 2) + 100 + (15 * roundsCleared);
            }
            else if (voidWard.radius > 0.001)
            {
                voidWard.radius /= 1.05f;
                if (orbLocator)
                {
                    orbLocator.transform.localScale /= 1.05f;
                }
            }
            else if (orbLocator)
            {
                orbLocator.transform.localScale /= 1.01f;
            }


            if (NetworkServer.active)
            {
                NetMessageExtensions.Send(new CRMissionNetworkMessage {
                    riftsCompleted = this.roundsCleared
                }, R2API.Networking.NetworkDestination.Clients);

                this.degenTimer += Time.fixedDeltaTime;
                if (this.degenTimer > 1f / degenTickFrequency)
                {
                    this.degenTimer -= 1f / degenTickFrequency;
                    foreach (TeamComponent teamComponent in TeamComponent.GetTeamMembers(TeamIndex.Player))
                    {
                        if (!teamComponent.body.HasBuff(BuffCatalog.FindBuffIndex("CRVoidProtectionBuff")) && teamComponent.body.HasBuff(BuffCatalog.FindBuffIndex("CRVoidDebuff")) && !(teamComponent.body.baseNameToken.Contains("DRONE") || teamComponent.body.baseNameToken.Contains("TURRET")))
                        {
                            float damage = (CRCore3.voidDegenerationRate.Value / 100f) / degenTickFrequency * teamComponent.body.healthComponent.fullCombinedHealth;
                            teamComponent.body.healthComponent.TakeDamage(new DamageInfo
                            {
                                damage     = damage,
                                position   = teamComponent.body.corePosition,
                                damageType = DamageType.Silent
                            });
                        }
                    }
                }
            }
            else
            {
                if (roundsCleared >= roundsCount)
                {
                    ObjectivePanelController.collectObjectiveSources -= OnCollectObjectives;
                }
            }
        }