Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
almightylks committed Nov 21, 2020
1 parent 654474a commit 79ba95a
Show file tree
Hide file tree
Showing 4 changed files with 185 additions and 0 deletions.
56 changes: 56 additions & 0 deletions PeanutInfection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using CustomGamemode;
using Synapse.Api;
using Synapse.Api.Events.SynapseEventArguments;
using System.Linq;

namespace PeanutInfection
{
public class PeanutInfection : IGamemode
{
public string Name { get; set; }
public string Author { get; set; }
public string GitHubRepo { get; set; }
public string Version { get; set; }
public PeanutInfection()
{
Author = "AlmightyLks";
Name = "PeanutInfection";
GitHubRepo = "https://github.com/AlmightyLks/PeanutInfection";
Version = "1.0.0.0";
}

public void Start()
{
Synapse.Api.Events.EventHandler.Get.Round.SpawnPlayersEvent += Round_SpawnPlayersEvent;
Synapse.Api.Events.EventHandler.Get.Player.PlayerDeathEvent += Player_PlayerDeathEvent;

SynapseController.Server.Logger.Info("PeanutInfection Started");
}
public void End()
{
Synapse.Api.Events.EventHandler.Get.Round.SpawnPlayersEvent -= Round_SpawnPlayersEvent;
Synapse.Api.Events.EventHandler.Get.Player.PlayerDeathEvent -= Player_PlayerDeathEvent;

SynapseController.Server.Logger.Info("PeanutInfection Ended");
}

private void Round_SpawnPlayersEvent(SpawnPlayersEventArgs ev)
{
SynapseController.Server.Map.Round.RoundLock = true;

foreach (var player in ev.SpawnPlayers.Keys.ToArray())
ev.SpawnPlayers[player] = (int)RoleType.ClassD;

Player rndPeen = SynapseController.Server.Players[UnityEngine.Random.Range(0, SynapseController.Server.Players.Count)];

ev.SpawnPlayers[rndPeen] = (int)RoleType.Scp173;

SynapseController.Server.Map.Round.RoundLock = false;
}
private void Player_PlayerDeathEvent(PlayerDeathEventArgs ev)
{
if (ev.Victim.RoleID != 0)
ev.Victim.RoleID = (int)RoleType.Scp173;
}
}
}
86 changes: 86 additions & 0 deletions PeanutInfection.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{90B6764B-EF2F-4114-BE3C-F79B7EE8E6EB}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PeanutInfection</RootNamespace>
<AssemblyName>PeanutInfection</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony, Version=2.0.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Lib.Harmony.2.0.4\lib\net472\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.1.0\lib\net472\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.1.0\lib\net472\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="CustomGamemode, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\GamemodeManager\CustomGamemode\bin\Release\CustomGamemode.dll</HintPath>
</Reference>
<Reference Include="LiteDB, Version=5.0.9.0, Culture=neutral, PublicKeyToken=4ee40123013c9f27, processorArchitecture=MSIL">
<HintPath>..\packages\LiteDB.5.0.9\lib\net45\LiteDB.dll</HintPath>
</Reference>
<Reference Include="Mirror, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.1.0\lib\net472\Mirror.dll</HintPath>
</Reference>
<Reference Include="Synapse, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.1.0\lib\net472\Synapse.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.1.0\lib\net472\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.1.0\lib\net472\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SynapseSL.2.1.0\lib\net472\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
<Reference Include="YamlDotNet, Version=8.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
<HintPath>..\packages\YamlDotNet.8.1.2\lib\net45\YamlDotNet.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="PeanutInfection.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
36 changes: 36 additions & 0 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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("PeanutInfection")]
[assembly: AssemblyDescription("A Gamemode for the Synapse-Gamemode Manager")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("AlmightyLks")]
[assembly: AssemblyProduct("PeanutInfection")]
[assembly: AssemblyCopyright("Copyright © AlmightyLks 2020")]
[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("90b6764b-ef2f-4114-be3c-f79b7ee8e6eb")]

// 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")]
7 changes: 7 additions & 0 deletions packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Lib.Harmony" version="2.0.4" targetFramework="net472" />
<package id="LiteDB" version="5.0.9" targetFramework="net472" />
<package id="SynapseSL" version="2.1.0" targetFramework="net472" />
<package id="YamlDotNet" version="8.1.2" targetFramework="net472" />
</packages>

0 comments on commit 79ba95a

Please sign in to comment.