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

            RolesManager.CleanUp();
            return(true);
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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();
        }
Beispiel #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;
                }
            }
Beispiel #6
0
 public override void Handle(PlayerControl innerNetObject, Data data)
 {
     RolesManager.AssignRole(data.RoleInfo, data.Player);
 }
Beispiel #7
0
 public static void Prefix([HarmonyArgument(0)] Il2CppReferenceArray <GameData.PlayerInfo> infected)
 {
     RolesManager.DispatchRole(infected);
 }
Beispiel #8
0
        public Role GetClosestPlayer()
        {
            var closestPlayer = Utils.GetClosestPlayer(player);

            return(RolesManager.GetPlayerRole(closestPlayer));
        }