Exemple #1
0
        public static bool Prefix(EndGameManager __instance)
        {
            PluginSingleton <FloofUsPlugin> .Instance.Log.LogInfo("Cleaning Up Game");

            RolesManager.CleanUp();
            return(true);
        }
Exemple #2
0
        public override Data Read(MessageReader reader)
        {
            var killer = RolesManager.GetPlayerRole(reader.ReadByte());
            var target = RolesManager.GetPlayerRole(reader.ReadByte());

            return(new Data(killer, target));
        }
Exemple #3
0
        public override Data Read(MessageReader reader)
        {
            byte role   = reader.ReadByte();
            var  player = Utils.PlayerById(reader.ReadByte());

            return(new Data(RolesManager.GetRoleInfoById(role), player));
        }
Exemple #4
0
        public override void Load()
        {
            RegisterInIl2CppAttribute.Register();
            RegisterCustomRpcAttribute.Register(this);

            var gameObject = new GameObject(nameof(ReactorPlugin)).DontDestroy();

            gameObject.AddComponent <FloofUsComponent>().Plugin = this;

            Kill = CreateSprite("FloofUs.Resources.Kill.png");

            RolesManager.InitializeRoles();


            Harmony.PatchAll();
        }
Exemple #5
0
            public static void Postfix(IntroCutscene.Nested_0 __instance)
            {
                Role role = RolesManager.GetPlayerRole(PlayerControl.LocalPlayer);

                PluginSingleton <FloofUsPlugin> .Instance.Log.LogInfo(string.Format("Displaying Player Role {0} with Text {1}", role.name, role.ImpostorText.Invoke()));

                var alpha = __instance.__this.Title.color.a;

                if (role != null && !role.IsRoleHidden())
                {
                    __instance.__this.Title.text        = role.name;
                    __instance.__this.Title.color       = role.color;
                    __instance.__this.ImpostorText.text = role.ImpostorText.Invoke();
                    __instance.__this.ImpostorText.gameObject.SetActive(true);
                    __instance.__this.BackgroundBar.material.color = role.color;
                }
            }
Exemple #6
0
 public override void Handle(PlayerControl innerNetObject, Data data)
 {
     RolesManager.AssignRole(data.RoleInfo, data.Player);
 }
Exemple #7
0
 public static void Prefix([HarmonyArgument(0)] Il2CppReferenceArray <GameData.PlayerInfo> infected)
 {
     RolesManager.DispatchRole(infected);
 }
Exemple #8
0
        public Role GetClosestPlayer()
        {
            var closestPlayer = Utils.GetClosestPlayer(player);

            return(RolesManager.GetPlayerRole(closestPlayer));
        }