Exemplo n.º 1
0
        // Token: 0x06002BF6 RID: 11254 RVA: 0x000B9BAC File Offset: 0x000B7DAC
        public override void OnEnter()
        {
            base.OnEnter();
            Transform parent = base.transform.parent;

            if (parent)
            {
                TeleporterInteraction component = parent.GetComponent <TeleporterInteraction>();
                if (component)
                {
                    this.radius = component.clearRadius;
                }
            }
            TeamFilter component2 = base.GetComponent <TeamFilter>();
            TeamIndex  teamIndex  = component2 ? component2.teamIndex : TeamIndex.None;

            if (NetworkServer.active)
            {
                this.healPulse = new TeleporterHealNovaPulse.HealPulse(base.transform.position, this.radius, 0.5f, TeleporterHealNovaPulse.duration, teamIndex);
            }
            this.effectTransform = base.transform.Find("PulseEffect");
            if (this.effectTransform)
            {
                this.effectTransform.gameObject.SetActive(true);
            }
        }
Exemplo n.º 2
0
        private void Run_OnServerTeleporterPlaced(On.RoR2.Run.orig_OnServerTeleporterPlaced orig, Run self, SceneDirector sceneDirector, GameObject teleporter)
        {
            orig(self, sceneDirector, teleporter);
            TeleporterInteraction teleporterInteraction = teleporter.GetComponent <TeleporterInteraction>();

            teleporterInteraction.NetworkactivationStateInternal = 1; // 1 == idleToChargingState
        }
 // Token: 0x06002898 RID: 10392 RVA: 0x000AC9D0 File Offset: 0x000AABD0
 private void OnTeleporterChargedGlobal(TeleporterInteraction teleporterInteraction)
 {
     if (!this.failed)
     {
         base.Grant();
     }
 }
Exemplo n.º 4
0
        private void Check(TeleporterInteraction teleporterInteraction)
        {
            if (!hasBeenHit)
            {
                for (int i = 0; i < CharacterMaster.readOnlyInstancesList.Count; i++)
                {
                    //body.GetComponent<CharacterBody>()?.inventory.GiveItem(catalogIndex);

                    var player = CharacterMaster.readOnlyInstancesList[i];
                    if (player)
                    {
                        var body = player.GetComponent <CharacterBody>();
                        if (body)
                        {
                            Chat.AddMessage(i.ToString() + "= Gave Master Round to " + player.name);
                            PickupIndex pickupIndex    = PickupCatalog.FindPickupIndex(catalogIndex);
                            Vector3     pickupVelocity = new Vector3(100 * i, 100, 100 * i);
                            PickupDropletController.CreatePickupDroplet(pickupIndex, teleporterInteraction.transform.position, pickupVelocity);
                        }
                    }
                }
            }
            else
            {
                Chat.AddMessage("Players didn't survive the hits");
            }
        }
 // Token: 0x06002921 RID: 10529 RVA: 0x000AD712 File Offset: 0x000AB912
 private void CheckTeleporter(TeleporterInteraction teleporterInteraction)
 {
     if (this.sceneOk && this.characterOk && !this.failed)
     {
         base.Grant();
     }
 }
Exemplo n.º 6
0
 public void RunOnTeleporterBeginChargingGlobal(TeleporterInteraction teleporterInteraction)
 {
     if (NetworkServer.active)
     {
         foreach (var teamComponent in TeamComponent.GetTeamMembers(TeamIndex.Player))
         {
             CharacterBody body = teamComponent.body;
             if (body)
             {
                 CharacterMaster master = teamComponent.body.master;
                 if (master)
                 {
                     int itemCount = master.inventory.GetItemCount(RoR2Content.Items.WardOnLevel);
                     if (itemCount > 0)
                     {
                         GameObject gameObject = Object.Instantiate <GameObject>(LegacyResourcesAPI.Load <GameObject>("Prefabs/NetworkedObjects/WarbannerWard"), body.transform.position, Quaternion.identity);
                         gameObject.GetComponent <TeamFilter>().teamIndex   = TeamIndex.Player;
                         gameObject.GetComponent <BuffWard>().Networkradius = 8f + 8f * (float)itemCount;
                         NetworkServer.Spawn(gameObject);
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 7
0
        //private static void BossGroup_DropRewards(On.RoR2.BossGroup.orig_DropRewards orig, BossGroup self)
        //{
        //    ItemDropAPI.BossDropParticipatingPlayerCount = _bossItems;
        //    orig(self);
        //}

        /// <summary>
        /// // Helper function for Bossloot
        /// </summary>
        private static void OverrideBossLootScaling(On.RoR2.TeleporterInteraction.orig_OnInteractionBegin orig,
                                                    TeleporterInteraction self, Interactor activator)
        {
            _bossItems = ShareSuite.OverrideBossLootScalingEnabled.Value
                ? ShareSuite.BossLootCredit.Value
                : Run.instance.participatingPlayerCount;
            orig(self, activator);
        }
Exemplo n.º 8
0
        private void OnTeleporterBeginCharging(TeleporterInteraction teleporterInteraction)
        {
            //get stage number and multiply the allowed hits

            hasBeenHit         = false;
            teleporterCharging = true;
            Chat.AddMessage("MasterRound: Teleporter Started Charging");
        }
Exemplo n.º 9
0
        static void PreventTeleporterFireworks(On.RoR2.GlobalEventManager.orig_OnInteractionBegin orig, GlobalEventManager self, Interactor interactor, IInteractable interactable, GameObject interactableObject)
        {
            TeleporterInteraction teleporter = interactableObject.GetComponent <TeleporterInteraction>();

            if (!teleporter)
            {
                orig(self, interactor, interactable, interactableObject);
            }
        }
Exemplo n.º 10
0
        private static void FixLunarTp()
        {
            GameObject lunarTeleporter = Resources.Load <GameObject>("prefabs/networkedobjects/TeleporterLunar");
            GameObject teleporter      = Resources.Load <GameObject>("prefabs/networkedobjects/Teleporter1");

            TeleporterInteraction     lunarInteraction         = lunarTeleporter.GetComponent <TeleporterInteraction>();
            HoldoutZoneController     teleporterZoneController = teleporter.GetComponent <HoldoutZoneController>();
            HoldoutZoneController     lunarZoneController      = lunarTeleporter.AddComponent <HoldoutZoneController>();
            OutsideInteractableLocker lunarInteractableLocker  = lunarTeleporter.AddComponent <OutsideInteractableLocker>();
            EntityStateMachine        lunarStateMachine        = lunarTeleporter.AddComponent <EntityStateMachine>();
            EntityStateMachine        stateMachine             = teleporter.GetComponent <EntityStateMachine>();

            LanguageAPI.Add("TELEPORTERLUNAR_HOLDOUT_TOKEN", "Observe.");

            lunarZoneController.baseChargeDuration        = teleporterZoneController.baseChargeDuration;
            lunarZoneController.baseRadius                = 100000;
            lunarZoneController.inBoundsObjectiveToken    = "TELEPORTERLUNAR_HOLDOUT_TOKEN";
            lunarZoneController.outOfBoundsObjectiveToken = teleporterZoneController.outOfBoundsObjectiveToken;
            lunarZoneController.radiusIndicator           = null;
            lunarZoneController.radiusSmoothTime          = teleporterZoneController.radiusSmoothTime;
            lunarZoneController.enabled = true;

            lunarInteractableLocker.updateInterval = 0.1f;
            lunarInteractableLocker.lockPrefab     = Resources.Load <GameObject>("prefabs/networkedobjects/PurchaseLock");

            lunarStateMachine.customName       = "Main";
            lunarStateMachine.initialStateType = stateMachine.initialStateType;
            lunarStateMachine.mainStateType    = stateMachine.mainStateType;
            lunarStateMachine.commonComponents = stateMachine.commonComponents;
            lunarStateMachine.networkIndex     = -1;

            lunarInteraction.mainStateMachine          = lunarStateMachine;
            lunarInteraction.outsideInteractableLocker = lunarInteractableLocker;

            foreach (CombatDirector combatDirector in lunarTeleporter.GetComponents <CombatDirector>())
            {
                if (combatDirector.customName == "Monsters")
                {
                    combatDirector.expRewardCoefficient               = 0.1f;
                    combatDirector.minSeriesSpawnInterval             = 0.5f;
                    combatDirector.maxSeriesSpawnInterval             = 0.5f;
                    combatDirector.minRerollSpawnInterval             = 2;
                    combatDirector.maxRerollSpawnInterval             = 4;
                    combatDirector.creditMultiplier                   = 6;
                    combatDirector.spawnDistanceMultiplier            = 1.5f;
                    combatDirector.shouldSpawnOneWave                 = false;
                    combatDirector.targetPlayers                      = true;
                    combatDirector.skipSpawnIfTooCheap                = true;
                    combatDirector.resetMonsterCardIfFailed           = true;
                    combatDirector.maximumNumberToSpawnBeforeSkipping = 6;
                    combatDirector.eliteBias = 2;
                }
                else if (combatDirector.customName == "Boss")
                {
                }
            }
        }
Exemplo n.º 11
0
 private static void TeleporterInteraction_onTeleporterBeginChargingGlobal(TeleporterInteraction obj)
 {
     if (NetworkServer.active)
     {
         isRoboBallBoss           = false;
         timeSaved                = 0;
         obj.remainingChargeTimer = obj.chargeDuration;
     }
 }
Exemplo n.º 12
0
 private void TeleporterInteraction_onTeleporterChargedGlobal(TeleporterInteraction teleporterInteraction)
 {
     if (MysticsItemsTreasureMapZone.instance && MysticsItemsTreasureMapZone.instance.ShouldBeActive && NetworkServer.active)
     {
         Chat.SendBroadcastChat(new Chat.SimpleChatMessage
         {
             baseToken = "MYSTICSITEMS_TREASUREMAP_WARNING"
         });
     }
 }
Exemplo n.º 13
0
 private void GetMinorThings(TeleporterInteraction teleporterInteraction)
 {
     CurrentTele = teleporterInteraction;
     if (newColor != Color.clear)
     {
         newColor = new Color(rVal, gVal, bVal, 1f);
     }
     new WaitForSeconds(startupDelay);
     OnEnable(teleporterInteraction.holdoutZoneController);
 }
Exemplo n.º 14
0
 private void CheckAchievement(TeleporterInteraction interaction)
 {
     if (base.isUserAlive && base.meetsBodyRequirement)
     {
         if (base.localUser.cachedBody.healthComponent.health <= base.localUser.cachedBody.healthComponent.fullHealth / 5)
         {
             base.Grant();
         }
     }
 }
Exemplo n.º 15
0
        public TeleporterData(TeleporterInteraction teleporter)
        {
            transform        = new SerializableTransform(teleporter.transform);
            remainingCharge  = teleporter.remainingChargeTimer;
            activationState  = (int)getActivationState.GetValue(teleporter);
            bossShrineStacks = teleporter.shrineBonusStacks;

            blueOrb      = teleporter.Network_shouldAttemptToSpawnShopPortal;
            goldOrb      = teleporter.Network_shouldAttemptToSpawnGoldshoresPortal;
            celestialOrb = teleporter.Network_shouldAttemptToSpawnMSPortal;
        }
Exemplo n.º 16
0
        public void Run(string[] args)
        {
            TeleporterInteraction teleporterInteraction = TeleporterInteraction.instance;

            if (teleporterInteraction.NetworkactivationStateInternal != IDLE_ACTIVATION_STATE)
            {
                throw new InvalidOperationException("teleporter must be idle to force tele");
            }

            teleporterInteraction.NetworkactivationStateInternal = IDLE_TO_CHARGING_ACTIVATION_STATE;
        }
Exemplo n.º 17
0
 // Token: 0x060028AE RID: 10414 RVA: 0x000ACC74 File Offset: 0x000AAE74
 private void UpdateStayedInZone()
 {
     if (this.stayedInZone)
     {
         TeleporterInteraction instance    = TeleporterInteraction.instance;
         CharacterBody         currentBody = base.GetCurrentBody();
         if (!instance || !currentBody || !instance.IsInChargingRange(currentBody))
         {
             this.SetStayedInZone(false);
         }
     }
 }
Exemplo n.º 18
0
        IEnumerator WaitForStart(TeleporterInteraction teleporter)
        {
            yield return(null);

            teleporter.shrineBonusStacks = bossShrineStacks;
            teleporter.Network_shouldAttemptToSpawnShopPortal       = blueOrb;
            teleporter.Network_shouldAttemptToSpawnGoldshoresPortal = goldOrb;
            teleporter.Network_shouldAttemptToSpawnMSPortal         = celestialOrb;

            getActivationState.SetValue(teleporter, activationState);
            teleporter.SetFieldValue("previousActivationState", 1);
        }
Exemplo n.º 19
0
 private static void TeleporterInteraction_onTeleporterChargedGlobal(TeleporterInteraction obj)
 {
     if (NetworkServer.active)
     {
         var comps = UnityEngine.Object.FindObjectsOfType <MasterRoundComponent>();
         foreach (var component in comps)
         {
             component.teleporterCharging = false;
         }
         CheckMasterRoundEventResult();
     }
 }
Exemplo n.º 20
0
 private void GiveComponent(TeleporterInteraction interaction)
 {
     if (base.meetsBodyRequirement && base.isUserAlive)
     {
         TraditionalAchievementHandler component = localUser.cachedBody.gameObject.GetComponent <TraditionalAchievementHandler>();
         if (!component)
         {
             component = localUser.cachedBody.gameObject.AddComponent <TraditionalAchievementHandler>();
         }
         component.ResetEligibility();
     }
 }
Exemplo n.º 21
0
            // Token: 0x0600269F RID: 9887 RVA: 0x000B2238 File Offset: 0x000B0438
            private void OnTeleporterCharged(TeleporterInteraction teleporterInteraction)
            {
                SceneCatalog.GetSceneDefForCurrentScene();
                StatSheet currentStats = base.networkUser.masterPlayerStatsComponent.currentStats;

                if (Run.instance && Run.instance.stageClearCount == 0)
                {
                    PlayerStatsComponent masterPlayerStatsComponent = base.networkUser.masterPlayerStatsComponent;
                    if (masterPlayerStatsComponent)
                    {
                        masterPlayerStatsComponent.currentStats.PushStatValue(StatDef.firstTeleporterCompleted, 1UL);
                    }
                }
            }
 private void SwitchCheckTeleport(TeleporterInteraction obj)
 {
     if (base.meetsBodyRequirement)
     {
         ManipulatorController maniController = base.localUser.cachedBodyObject.GetComponent <ManipulatorController>();
         if (maniController)
         {
             if (!maniController.hasSwapped)
             {
                 base.Grant();
             }
         }
     }
 }
Exemplo n.º 23
0
        /// <summary>
        /// // Helper function for Bossloot
        /// </summary>
        private static void OverrideBossLootScaling(On.RoR2.TeleporterInteraction.orig_OnInteractionBegin orig,
                                                    TeleporterInteraction self, Interactor activator)
        {
            if (!ShareSuite.MultitudesIsActive && ShareSuite.OverrideBossLootScalingEnabled.Value)
            {
                _bossItems = ShareSuite.BossLootCredit.Value;
            }
            else
            {
                _bossItems = Run.instance.participatingPlayerCount;
            }

            orig(self, activator);
        }
Exemplo n.º 24
0
        public static void Teleport(TeleporterInteraction self)
        {
            if (!UsedTeleporter)
            {
                if (PVPEnded)
                {
                    ApplyExp();
                    self.GetComponent <SceneExitController>().Begin();
                    UsedTeleporter = true;
                    return;
                }

                Chat.SendBroadcastChat(new Chat.SimpleChatMessage
                {
                    baseToken = "You cannot use the teleporter until all enemy players are dead."
                });
            }
        }
Exemplo n.º 25
0
 private void CheckCaptainComponent(TeleporterInteraction interaction)
 {
     if (base.isUserAlive && base.meetsBodyRequirement)
     {
         SupportAchievementHandler component = base.localUser.cachedMasterController.master.gameObject.GetComponent <SupportAchievementHandler>();
         if (!component)
         {
             component = base.localUser.cachedMasterController.master.gameObject.AddComponent <SupportAchievementHandler>();
         }
         if (component.IsValid())
         {
             PlayerStatsComponent statsComponent = base.localUser.cachedStatsComponent;
             if (statsComponent && statsComponent.currentStats.GetStatValueULong(StatDef.highestStagesCompleted) >= 2UL)
             {
                 base.Grant();
             }
         }
     }
 }
Exemplo n.º 26
0
        private void TeleporterInteractionOnTeleporterBeginChargingGlobal(TeleporterInteraction obj)
        {
            ReadOnlyCollection <TeamComponent> teamMembers = TeamComponent.GetTeamMembers(TeamIndex.Player);
            int count = 0;

            foreach (TeamComponent tc in teamMembers)
            {
                if (Util.LookUpBodyNetworkUser(tc.body))
                {
                    count += tc.body.inventory.GetItemCount(MechanicalTrinket.itemIndex);
                }
            }
            if (count > 0)
            {
                foreach (TeamComponent tc in teamMembers)
                {
                    obj.holdoutZoneController.baseRadius = obj.holdoutZoneController.baseRadius + (count * 3);
                }
            }
        }
Exemplo n.º 27
0
        public static void Reset()
        {
            IsGracePeriod            = true;
            GraceTimer               = Settings.GraceTimerDuration;
            CashGrantTimer           = 0;
            CurrentGraceTimeReminder = GraceTimer;
            PVPEnded            = false;
            UsedTeleporter      = false;
            PreventGameOver     = false;
            SecondaryTeleporter = null;

            if (NetworkServer.active)
            {
                //Spawns a normal teleporter on the stage to prevent being forced to use a specific teleporter or being softlocked ending the run
                if (SceneInfo.instance.sceneDef.baseSceneName == "skymeadow" ||
                    SceneInfo.instance.sceneDef.baseSceneName == "artifactworld" ||
                    SceneInfo.instance.sceneDef.baseSceneName == "goldshores")
                {
                    SecondaryTeleporter = Tools.CustomGenerate("SpawnCards/InteractableSpawnCard/iscTeleporter", -1, Run.instance.stageRng).GetComponent <TeleporterInteraction>();
                }
            }
        }
Exemplo n.º 28
0
        private void TeleporterInteraction_onTeleporterChargedGlobal(TeleporterInteraction obj)
        {
            if (NetworkServer.active)
            {
                Destroy(runUpdate);

                if (timeSaved >= 1)
                {
                    if (AddToRunTime.Value)
                    {
                        Run.instance.fixedTime += timeSaved;
                    }

                    if (ShowMsg.Value)
                    {
                        timeSavedTotal += timeSaved;
                        DisplayTimeSavedMsg();
                    }
                }
                timeSaved = 0;
            }
        }
Exemplo n.º 29
0
 // Token: 0x06002785 RID: 10117 RVA: 0x000AABDE File Offset: 0x000A8DDE
 private void OnTeleporterFinish(TeleporterInteraction teleporterInteraction)
 {
     this.Check();
 }
Exemplo n.º 30
0
 private static void TeleporterInteraction_onTeleporterBeginChargingGlobal(TeleporterInteraction obj)
 {
     StartMasterRoundEvent();
 }