public static bool Prefix(EndGameManager __instance) { PluginSingleton <FloofUsPlugin> .Instance.Log.LogInfo("Cleaning Up Game"); RolesManager.CleanUp(); return(true); }
public override Data Read(MessageReader reader) { var killer = RolesManager.GetPlayerRole(reader.ReadByte()); var target = RolesManager.GetPlayerRole(reader.ReadByte()); return(new Data(killer, target)); }
public override Data Read(MessageReader reader) { byte role = reader.ReadByte(); var player = Utils.PlayerById(reader.ReadByte()); return(new Data(RolesManager.GetRoleInfoById(role), player)); }
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(); }
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; } }
public override void Handle(PlayerControl innerNetObject, Data data) { RolesManager.AssignRole(data.RoleInfo, data.Player); }
public static void Prefix([HarmonyArgument(0)] Il2CppReferenceArray <GameData.PlayerInfo> infected) { RolesManager.DispatchRole(infected); }
public Role GetClosestPlayer() { var closestPlayer = Utils.GetClosestPlayer(player); return(RolesManager.GetPlayerRole(closestPlayer)); }