diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index dfe0770..0000000 --- a/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto diff --git a/GhostSpectator.sln b/GhostSpectator.sln deleted file mode 100644 index 0d600e6..0000000 --- a/GhostSpectator.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.2027 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GhostSpectator", "GhostSpectator\GhostSpectator.csproj", "{0952A53A-A70E-4DAA-86A6-6560F2F3607B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0952A53A-A70E-4DAA-86A6-6560F2F3607B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0952A53A-A70E-4DAA-86A6-6560F2F3607B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0952A53A-A70E-4DAA-86A6-6560F2F3607B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0952A53A-A70E-4DAA-86A6-6560F2F3607B}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {93980AF1-83D2-487D-8CDA-F1CD4AB2B304} - EndGlobalSection -EndGlobal diff --git a/GhostSpectator.zip b/GhostSpectator.zip new file mode 100644 index 0000000..abacfd6 Binary files /dev/null and b/GhostSpectator.zip differ diff --git a/GhostSpectator/.vs/ExamplePlugin/v15/Server/sqlite3/db.lock b/GhostSpectator/.vs/ExamplePlugin/v15/Server/sqlite3/db.lock deleted file mode 100644 index e69de29..0000000 diff --git a/GhostSpectator/.vs/ExamplePlugin/v15/Server/sqlite3/storage.ide b/GhostSpectator/.vs/ExamplePlugin/v15/Server/sqlite3/storage.ide deleted file mode 100644 index bc07f49..0000000 Binary files a/GhostSpectator/.vs/ExamplePlugin/v15/Server/sqlite3/storage.ide and /dev/null differ diff --git a/GhostSpectator/.vs/GhostSpectator/v15/Server/sqlite3/db.lock b/GhostSpectator/.vs/GhostSpectator/v15/Server/sqlite3/db.lock deleted file mode 100644 index e69de29..0000000 diff --git a/GhostSpectator/.vs/GhostSpectator/v15/Server/sqlite3/storage.ide b/GhostSpectator/.vs/GhostSpectator/v15/Server/sqlite3/storage.ide deleted file mode 100644 index adffae8..0000000 Binary files a/GhostSpectator/.vs/GhostSpectator/v15/Server/sqlite3/storage.ide and /dev/null differ diff --git a/GhostSpectator/.vs/GhostSpectator/v15/Server/sqlite3/storage.ide-shm b/GhostSpectator/.vs/GhostSpectator/v15/Server/sqlite3/storage.ide-shm deleted file mode 100644 index 57082e5..0000000 Binary files a/GhostSpectator/.vs/GhostSpectator/v15/Server/sqlite3/storage.ide-shm and /dev/null differ diff --git a/GhostSpectator/.vs/GhostSpectator/v15/Server/sqlite3/storage.ide-wal b/GhostSpectator/.vs/GhostSpectator/v15/Server/sqlite3/storage.ide-wal deleted file mode 100644 index 7830be9..0000000 Binary files a/GhostSpectator/.vs/GhostSpectator/v15/Server/sqlite3/storage.ide-wal and /dev/null differ diff --git a/GhostSpectator/EventHandler.cs b/GhostSpectator/EventHandler.cs deleted file mode 100644 index f6fa83b..0000000 --- a/GhostSpectator/EventHandler.cs +++ /dev/null @@ -1,237 +0,0 @@ -using Smod2; -using Smod2.API; -using Smod2.EventHandlers; -using Smod2.Events; -using Smod2.EventSystem.Events; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Smod.GhostSpectatorPlugin -{ - class EventHandler : IEventHandlerSetConfig, IEventHandlerSpawnRagdoll, IEventHandlerSetRole, IEventHandlerSummonVehicle, IEventHandlerTeamRespawn, IEventHandlerRoundStart, IEventHandlerPlayerHurt, IEventHandlerShoot, IEventHandlerFixedUpdate, IEventHandlerPlayerPickupItem, IEventHandlerPlayerDropItem, IEventHandlerRecallZombie - { - private Plugin plugin; - public static int maxRespawnAmount; - public static bool allowGhostToDamage; - public static bool allowPickup; - - public class ShowGhost - { - public int playerId; - - public float remainingTime; - } - - public class Ghost - { - public int playerId; - - public float remainingTime; - - public Vector spawnPos; - } - - public List ghostList = new List(); - - public List spawnGhost = new List(); - - public EventHandler(Plugin plugin) - { - this.plugin = plugin; - } - - public void OnRoundStart(RoundStartEvent ev) - { - maxRespawnAmount = ConfigManager.Manager.Config.GetIntValue("maximum_MTF_respawn_amount", 15); - allowGhostToDamage = ConfigManager.Manager.Config.GetBoolValue("gs_allow_ghost_to_dmg", false); - allowPickup = ConfigManager.Manager.Config.GetBoolValue("gs_allow_ghost_to_pickup", true); - } - - public void OnSpawnRagdoll(PlayerSpawnRagdollEvent ev) - { - spawnGhost.Add(new Ghost { playerId = ev.Player.PlayerId, remainingTime = 3f, spawnPos = ev.Position }); - } - - public void OnSetConfig(SetConfigEvent ev) - { - if (ev.Key.Equals("scp173_ignored_role") || ev.Key.Equals("scp096_ignored_role")) - { - ev.Value = new List { 2, 14 }; - } - } - - public void OnSetRole(PlayerSetRoleEvent ev) - { - if (ev.Role == Role.SPECTATOR) - { - spawnGhost.Add(new Ghost { playerId = ev.Player.PlayerId, remainingTime = 3f, spawnPos = Vector.Zero }); - } - if (ev.Role == Role.TUTORIAL) - { - ev.Player.SetGhostMode(true); - ev.Player.SetGodmode(true); - ev.Player.GiveItem(ItemType.RADIO); - ev.Player.SetRadioBattery(999); - } - else - { - if (ev.Player.GetGhostMode()) - ev.Player.SetGhostMode(false); - if (ev.Player.GetGodmode()) - ev.Player.SetGodmode(false); - } - } - - public void OnSummonVehicle(SummonVehicleEvent ev) - { - if (!ev.AllowSummon) - { - foreach (Player player in plugin.pluginManager.Server.GetPlayers()) - { - if (player.TeamRole.Team == Team.TUTORIAL) - { - ev.AllowSummon = true; - return; - } - } - } - } - - public void OnTeamRespawn(TeamRespawnEvent ev) - { - List list = (from item in plugin.pluginManager.Server.GetPlayers() - where (item.TeamRole.Role == Role.TUTORIAL || item.TeamRole.Role == Role.SPECTATOR) && !item.OverwatchMode - select item).ToList(); - - Random random = new Random(); - while (list.Count > maxRespawnAmount) - { - list.RemoveAt(random.Next(0, list.Count)); - } - - ev.PlayerList = list; - } - - public void OnPlayerHurt(PlayerHurtEvent ev) - { - if (ev.Attacker.TeamRole.Role == Role.TUTORIAL) - { - if (!allowGhostToDamage) - { - ev.Damage = 0f; - } - } - } - - public void OnShoot(PlayerShootEvent ev) - { - if (ev.Player.TeamRole.Team == Team.TUTORIAL) - { - foreach (ShowGhost ghost in ghostList) - { - if (ghost.playerId == ev.Player.PlayerId) - { - ghost.remainingTime = 3f; - ev.Player.SetGhostMode(false); - return; - } - } - - ghostList.Add(new ShowGhost { playerId = ev.Player.PlayerId, remainingTime = 3f }); - ev.Player.SetGhostMode(false); - } - } - - public void OnFixedUpdate(FixedUpdateEvent ev) - { - for (int i = 0; i < ghostList.Count; i++) - { - ghostList[i].remainingTime -= 0.02f; - if (ghostList[i].remainingTime <= 0) - { - foreach (Player player in (from item in plugin.pluginManager.Server.GetPlayers() - where (item.PlayerId == ghostList[i].playerId && item.TeamRole.Team == Team.TUTORIAL) - select item).ToList()) - { - player.SetGhostMode(true); - } - ghostList.RemoveAt(i); - } - } - - for (int i = 0; i < spawnGhost.Count; i++) - { - spawnGhost[i].remainingTime -= 0.02f; - if (spawnGhost[i].remainingTime <= 0) - { - foreach (Player player in (from item in plugin.pluginManager.Server.GetPlayers() - where (item.PlayerId == spawnGhost[i].playerId) - select item).ToList()) - { - player.ChangeRole(Role.TUTORIAL); - player.SetGhostMode(true); - player.SetGodmode(true); - player.SetRadioBattery(999); - bool hasRadio = false, hasCoin = false; - foreach (Item item in player.GetInventory()) - { - if (item.ItemType == ItemType.RADIO) - { - hasRadio = true; - } - if (item.ItemType == ItemType.COIN) - { - hasCoin = true; - } - } - if (!hasRadio) - player.GiveItem(ItemType.RADIO); - if (!hasCoin) - player.GiveItem(ItemType.COIN); - if (spawnGhost[i].spawnPos != Vector.Zero) - player.Teleport(spawnGhost[i].spawnPos); - } - spawnGhost.RemoveAt(i); - } - } - } - - public void OnPlayerPickupItem(PlayerPickupItemEvent ev) - { - if (!allowPickup && ev.Player.TeamRole.Role == Role.TUTORIAL) - { - ev.Allow = false; - plugin.pluginManager.Server.Map.SpawnItem(ev.Item.ItemType, ev.Player.GetPosition(), Vector.Zero); - } - } - - public void OnPlayerDropItem(PlayerDropItemEvent ev) - { - if (ev.Player.TeamRole.Role == Role.TUTORIAL && ev.Item.ItemType == ItemType.COIN) - { - List list = (from item in plugin.pluginManager.Server.GetPlayers() - where (item.PlayerId != ev.Player.PlayerId && item.TeamRole.Role != Role.TUTORIAL && item.TeamRole.Role != Role.SPECTATOR) && !item.OverwatchMode - select item).ToList(); - - if (list.Count > 0) - { - Random random = new Random(); - ev.Player.Teleport(list[random.Next(0, list.Count)].GetPosition()); - } - - ev.ChangeTo = ItemType.NULL; - ev.Player.GiveItem(ItemType.COIN); - } - } - - public void OnRecallZombie(PlayerRecallZombieEvent ev) - { - if (ev.Target.TeamRole.Team == Team.TUTORIAL) - { - ev.AllowRecall = true; - ev.Target.SetGhostMode(false); - } - } - } -} diff --git a/GhostSpectator/GhostSpectator.cs b/GhostSpectator/GhostSpectator.cs deleted file mode 100644 index 3bfa43b..0000000 --- a/GhostSpectator/GhostSpectator.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Smod.GhostSpectatorPlugin; -using Smod2; -using Smod2.Attributes; - - -namespace GhostSpectator -{ - [PluginDetails( - author = "ShingekiNoRex", - name = "GhostSpectator", - description = "", - id = "rex.ghost.spectator", - version = "1.0", - SmodMajor = 3, - SmodMinor = 1, - SmodRevision = 20 - )] - class GhostSpectator : Plugin - { - public override void OnDisable() - { - } - - public override void OnEnable() - { - this.Info("GhostSpectator has loaded :)"); - } - - public override void Register() - { - // Register Events - this.AddEventHandlers(new EventHandler(this), Smod2.Events.Priority.Low); - } - } -} diff --git a/GhostSpectator/GhostSpectator.csproj b/GhostSpectator/GhostSpectator.csproj deleted file mode 100644 index 6ea8fda..0000000 --- a/GhostSpectator/GhostSpectator.csproj +++ /dev/null @@ -1,50 +0,0 @@ - - - - - Debug - AnyCPU - {0952A53A-A70E-4DAA-86A6-6560F2F3607B} - Library - Properties - GhostSpectator - GhostSpectator - v3.5 - 512 - - - - true - full - false - Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - E:\SteamLibrary\steamapps\common\SCP Secret Laboratory2\SCPSL_Data\Managed\Smod2.dll - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/GhostSpectator/Properties/AssemblyInfo.cs b/GhostSpectator/Properties/AssemblyInfo.cs deleted file mode 100644 index 443f743..0000000 --- a/GhostSpectator/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ExamplePlugin")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ExamplePlugin")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("0952a53a-a70e-4daa-86a6-6560f2f3607b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/GhostSpectator/obj/Debug/GhostSpectator.csproj.CopyComplete b/GhostSpectator/obj/Debug/GhostSpectator.csproj.CopyComplete deleted file mode 100644 index e69de29..0000000 diff --git a/GhostSpectator/obj/Debug/GhostSpectator.csproj.FileListAbsolute.txt b/GhostSpectator/obj/Debug/GhostSpectator.csproj.FileListAbsolute.txt deleted file mode 100644 index 6ae6e23..0000000 --- a/GhostSpectator/obj/Debug/GhostSpectator.csproj.FileListAbsolute.txt +++ /dev/null @@ -1,26 +0,0 @@ -E:\SteamLibrary\steamapps\common\SCP Secret Laboratory2\sm_plugins\GhostSpectator.dll -E:\SteamLibrary\steamapps\common\SCP Secret Laboratory2\sm_plugins\GhostSpectator.pdb -I:\SMOD\Github\GhostSpectator\GhostSpectator\obj\Debug\GhostSpectator.csprojResolveAssemblyReference.cache -I:\SMOD\Github\GhostSpectator\GhostSpectator\obj\Debug\GhostSpectator.csproj.CoreCompileInputs.cache -I:\SMOD\Github\GhostSpectator\GhostSpectator\obj\Debug\GhostSpectator.dll -I:\SMOD\Github\GhostSpectator\GhostSpectator\obj\Debug\GhostSpectator.pdb -I:\SMOD\Github\GhostSpectator\GhostSpectator\Debug\GhostSpectator.dll -I:\SMOD\Github\GhostSpectator\GhostSpectator\Debug\GhostSpectator.pdb -I:\SMOD\Github\GhostSpectator\GhostSpectator\Debug\Smod2.dll -I:\SMOD\Github\GhostSpectator\GhostSpectator\Debug\Smod2.pdb -I:\SMOD\Github\GhostSpectator\GhostSpectator\GhostSpectator\Debug\GhostSpectator.dll -I:\SMOD\Github\GhostSpectator\GhostSpectator\GhostSpectator\Debug\GhostSpectator.pdb -I:\SMOD\Github\GhostSpectator\GhostSpectator\GhostSpectator\Debug\Smod2.pdb -I:\SMOD\Github\GhostSpectator\GhostSpectator\GhostSpectator\obj\Debug\GhostSpectator.csprojResolveAssemblyReference.cache -I:\SMOD\Github\GhostSpectator\GhostSpectator\GhostSpectator\obj\Debug\GhostSpectator.csproj.CoreCompileInputs.cache -I:\SMOD\Github\GhostSpectator\GhostSpectator\GhostSpectator\obj\Debug\GhostSpectator.dll -I:\SMOD\Github\GhostSpectator\GhostSpectator\GhostSpectator\obj\Debug\GhostSpectator.pdb -D:\Github\GhostSpectator\GhostSpectator\Debug\GhostSpectator.dll -D:\Github\GhostSpectator\GhostSpectator\Debug\GhostSpectator.pdb -D:\Github\GhostSpectator\GhostSpectator\Debug\Smod2.dll -D:\Github\GhostSpectator\GhostSpectator\Debug\Smod2.pdb -D:\Github\GhostSpectator\GhostSpectator\obj\Debug\GhostSpectator.csprojResolveAssemblyReference.cache -D:\Github\GhostSpectator\GhostSpectator\obj\Debug\GhostSpectator.csproj.CoreCompileInputs.cache -D:\Github\GhostSpectator\GhostSpectator\obj\Debug\GhostSpectator.csproj.CopyComplete -D:\Github\GhostSpectator\GhostSpectator\obj\Debug\GhostSpectator.dll -D:\Github\GhostSpectator\GhostSpectator\obj\Debug\GhostSpectator.pdb diff --git a/README.md b/README.md index c9cefac..167b02d 100644 --- a/README.md +++ b/README.md @@ -1 +1,26 @@ # GhostSpectator +Players become tutorial, instead of spectator, when they are dead. They cannot interact with most items of the map (lifts, doors, intercom). +They are visible and can talk to others (the problem is in smod, it is no longer possible to turn on ghost mode) +They cannot pickup items or drop them. +When a ghost drops a coin, he is teleported to random player. +Don't worry, tutorials can respawn. + +# Configs + +If ghosts should not interact with doors or elevators + +`gs_block_doors_for_ghosts: true` + +Broadcast, that Ghosts get on spawn + +`gs_spawn_broadcast: You've been spawned as a Ghost! \n Drop the coin to teleport to random player. \n You cannot pickup or drop items. \n You cannot interact with doors or elevators. \n You can talk to others. \n You will respawn soon.` + +Time of broadcast, that ghosts get on spawn + +`gs_spawn_broadcast_time: 20` + + +# Issues +When Ghost is killed by 049, he will become zombie after 6 seconds. No recall needed. Either way, they could not become zombie at all. +Ghosts can start 914, but not change it's mode +I cannot make them invisible due to it is problem of Smod, they did not add ghost mode, it is broken.