void StageStart(On.RoR2.Stage.orig_Start orig, RoR2.Stage stage) { orig(stage); if (Data.modEnabled) { if (Data.mode == DataShop.mode) { foreach (Coroutine coroutine in characterMasterCoroutines) { if (coroutine != null) { StopCoroutine(coroutine); } } characterMasterCoroutines.Clear(); characterBody = null; inventoryLocal = null; latestInteractionName = ""; stageClearCountOld = -1; if (NetworkClient.active) { foreach (NetworkUser networkUser in RoR2.NetworkUser.readOnlyInstancesList) { if (networkUser.isLocalPlayer) { characterMasterCoroutines.Add(StartCoroutine(GetMasterController(networkUser))); } } } } } }
private void Stage_onStageStartGlobal(RoR2.Stage obj) { var gameObj = obj.gameObject; if (!gameObj.GetComponent <BulletstormPickupsComponent>()) { gameObj.AddComponent <BulletstormPickupsComponent>(); } }
private void Stage_onServerStageBegin(RoR2.Stage obj) { var presence = new DiscordRpc.RichPresence { largeImageKey = "generic_icon", startTimestamp = DateTimeOffset.Now.ToUnixTimeSeconds() }; try { presence.state = $"Exploring {_stageNames[obj.sceneDef.sceneName]}"; } catch (KeyNotFoundException) { presence.state = $"Exploring unknown stage {obj.sceneDef.sceneName}"; } DiscordRpc.UpdatePresence(presence); }