Skip to content

Commit

Permalink
v1.0.0 upload
Browse files Browse the repository at this point in the history
  • Loading branch information
XingYeNotFish authored Aug 24, 2024
1 parent 5e35897 commit 1f2e704
Show file tree
Hide file tree
Showing 6 changed files with 228 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Harmless 207.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.7.34221.43
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Harmless 207", "Harmless 207\Harmless 207.csproj", "{01D4D268-2B35-48EC-80CA-DEA0FDA2201B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{01D4D268-2B35-48EC-80CA-DEA0FDA2201B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{01D4D268-2B35-48EC-80CA-DEA0FDA2201B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{01D4D268-2B35-48EC-80CA-DEA0FDA2201B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{01D4D268-2B35-48EC-80CA-DEA0FDA2201B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {054B13D7-994A-47D1-945F-9FC8607DD024}
EndGlobalSection
EndGlobal
95 changes: 95 additions & 0 deletions Harmless 207/Harmless 207.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?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>{01D4D268-2B35-48EC-80CA-DEA0FDA2201B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Harmless_207</RootNamespace>
<AssemblyName>Harmless 207</AssemblyName>
<TargetFrameworkVersion>v4.8.1</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="Assembly-CSharp">
<HintPath>..\..\..\..\..\..\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-Publicized, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\EXILED.8.3.9\lib\net48\Assembly-CSharp-Publicized.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CommandSystem.Core, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\EXILED.8.3.9\lib\net48\CommandSystem.Core.dll</HintPath>
</Reference>
<Reference Include="Exiled.API, Version=8.3.9.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.8.3.9\lib\net48\Exiled.API.dll</HintPath>
</Reference>
<Reference Include="Exiled.CreditTags, Version=8.3.9.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.8.3.9\lib\net48\Exiled.CreditTags.dll</HintPath>
</Reference>
<Reference Include="Exiled.CustomItems, Version=8.3.9.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.8.3.9\lib\net48\Exiled.CustomItems.dll</HintPath>
</Reference>
<Reference Include="Exiled.CustomRoles, Version=8.3.9.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.8.3.9\lib\net48\Exiled.CustomRoles.dll</HintPath>
</Reference>
<Reference Include="Exiled.Events, Version=8.3.9.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.8.3.9\lib\net48\Exiled.Events.dll</HintPath>
</Reference>
<Reference Include="Exiled.Loader, Version=8.3.9.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.8.3.9\lib\net48\Exiled.Loader.dll</HintPath>
</Reference>
<Reference Include="Exiled.Permissions, Version=8.3.9.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.8.3.9\lib\net48\Exiled.Permissions.dll</HintPath>
</Reference>
<Reference Include="Mirror">
<HintPath>..\..\..\..\..\..\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Mirror.dll</HintPath>
</Reference>
<Reference Include="NorthwoodLib, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\EXILED.8.3.9\lib\net48\NorthwoodLib.dll</HintPath>
</Reference>
<Reference Include="PluginAPI, Version=13.1.2.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.8.3.9\lib\net48\PluginAPI.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<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="YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
<HintPath>..\packages\EXILED.8.3.9\lib\net48\YamlDotNet.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Plugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="XYlikeconfig.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
53 changes: 53 additions & 0 deletions Harmless 207/Plugin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using Exiled.API.Enums;
using Exiled.API.Features;
using Exiled.Events.EventArgs.Player;
using System;

namespace Harmless_207
{
public class Plugin : Plugin<XYlikeconfig>
{
public override string Name { get; } = "Harmless 207 / 无害可乐";
public override string Author { get; } = "XingYeNotFish";
public override Version Version { get; } = new Version(1, 0, 2);

private static readonly Lazy<Plugin> LazyInstance = new Lazy<Plugin>(() => new Plugin());
public static Plugin Instance;
public override void OnEnabled()
{
Instance = this;
base.OnEnabled();
Exiled.Events.Handlers.Player.Hurting += OnPlayerHurt;
Log.Info("Plugin has been enabled! / 插件已启用!");
}

public override void OnDisabled()
{
Instance = null;
base.OnDisabled();
Exiled.Events.Handlers.Player.Hurting -= OnPlayerHurt;
Log.Info("Plugin has been disabled! / 插件已关闭!");
}

private static XYlikeconfig config => Instance.Config;

public void OnPlayerHurt(HurtingEventArgs ev)
{
if (ev.Player != null)
{
if (ev.DamageHandler.Type == DamageType.Scp207)
{
ev.IsAllowed = false;
}

if (config.Harmless_1853)
{
if (ev.DamageHandler.Type == DamageType.Poison)
{
ev.IsAllowed = false;
}
}
}
}
}
}
36 changes: 36 additions & 0 deletions Harmless 207/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;

// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Harmless 207")]
[assembly: AssemblyDescription("A plugin to make SCP-207 less harmful.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Takanashi Hoshino")]
[assembly: AssemblyProduct("Harmless 207")]
[assembly: AssemblyCopyright("Copyright © 2023 XingYeNotFish")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]

// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("01d4d268-2b35-48ec-80ca-dea0fda2201b")]

// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]
15 changes: 15 additions & 0 deletions Harmless 207/XYlikeconfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Exiled.API.Interfaces;
using System.ComponentModel;

namespace Harmless_207
{
public sealed class XYlikeconfig : IConfig
{
[Description("Do you want to enable the plugin? / 是否开启此插件?")]
public bool IsEnabled { get; set; } = true;
public bool Debug { get; set; } = false;

[Description("Is 1853 harmless? / 是否开启1853(洗手液)无害?")]
public bool Harmless_1853 { get; set; } = true;
}
}
4 changes: 4 additions & 0 deletions Harmless 207/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EXILED" version="8.3.9" targetFramework="net481" />
</packages>

0 comments on commit 1f2e704

Please sign in to comment.