コード例 #1
0
        public static void Postfix(RespawnManager __instance, SpawnableTeamType teamToSpawn)
        {
            int counter = 0;

            foreach (Player Ply in Player.List)
            {
                if (Ply.Role.IsNotHuman(true))
                {
                    counter++;
                }
            }
            if (CreativeToolbox.ConfigRef.Config.EnableRandomChaosInsurgencyAnnouncementChance)
            {
                NewChance = CIAnnouncementChance.Next(0, 100);
                if (NewChance < CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncementChance)
                {
                    if (CreativeToolbox.ConfigRef.Config.EnableCustomAnnouncements && teamToSpawn == SpawnableTeamType.ChaosInsurgency)
                    {
                        NineTailedFoxAnnouncer.singleton.ServerOnlyAddGlitchyPhrase(CreativeToolboxEventHandler.FormatMessage(CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncement, counter), CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncementGlitchChance * 0.01f, CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncementJamChance * 0.01f);
                    }
                }
            }
            else
            if (CreativeToolbox.ConfigRef.Config.EnableCustomAnnouncements && teamToSpawn == SpawnableTeamType.ChaosInsurgency)
            {
                NineTailedFoxAnnouncer.singleton.ServerOnlyAddGlitchyPhrase(CreativeToolboxEventHandler.FormatMessage(CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncement, counter), CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncementGlitchChance * 0.01f, CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncementJamChance * 0.01f);
            }
        }
コード例 #2
0
        private static void Postfix(RespawnManager __instance, SpawnableTeamType teamToSpawn)
        {
            int counter = 0;

            foreach (Player ply in Player.List)
            {
                if (ply.Team == Team.SCP)
                {
                    counter++;
                }
            }

            if (Instance.Config.EnableRandomChaosInsurgencyAnnouncementChance)
            {
                _newChance = CiAnnouncementChance.Next(0, 100);
                if (!(_newChance < Instance.Config.ChaosInsurgencyAnnouncementChance))
                {
                    return;
                }

                if (Instance.Config.EnableCustomAnnouncements && teamToSpawn == SpawnableTeamType.ChaosInsurgency)
                {
                    NineTailedFoxAnnouncer.singleton.ServerOnlyAddGlitchyPhrase(
                        CreativeToolboxEventHandler.FormatMessage(Instance.Config.ChaosInsurgencyAnnouncement, counter),
                        Instance.Config.ChaosInsurgencyAnnouncementGlitchChance * 0.01f,
                        Instance.Config.ChaosInsurgencyAnnouncementJamChance * 0.01f);
                }
            }
            else if (Instance.Config.EnableCustomAnnouncements && teamToSpawn == SpawnableTeamType.ChaosInsurgency)
            {
                NineTailedFoxAnnouncer.singleton.ServerOnlyAddGlitchyPhrase(
                    CreativeToolboxEventHandler.FormatMessage(Instance.Config.ChaosInsurgencyAnnouncement, counter),
                    Instance.Config.ChaosInsurgencyAnnouncementGlitchChance * 0.01f,
                    Instance.Config.ChaosInsurgencyAnnouncementJamChance * 0.01f);
            }
        }