-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
190 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
//欢迎来到 我的项目 OpenHobbyPower 本人第一次写C#的插件 如有问题 请多多包涵谢谢 | ||
//Email:scpslgame@dingtalk.com | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using Exiled.API.Features; | ||
using Exiled.Events.EventArgs; | ||
using Exiled.API.Enums; | ||
using Exiled.API.Extensions; | ||
using Exiled.API.Interfaces; | ||
using Exiled.Loader; | ||
using Exiled.API.Features.Items; | ||
using MEC; | ||
|
||
namespace OpenHobbyPower | ||
{ | ||
public class OpenHobbyPower : Plugin<Config> | ||
{ | ||
public override string Name => "OpenHobbyPower"; | ||
public override string Author => "Lively-Xuan"; | ||
public override Version Version => new Version(1, 0, 0); | ||
public override Version RequiredExiledVersion => new Version(3, 0, 0); | ||
|
||
public override void OnEnabled() | ||
{ | ||
Exiled.Events.Handlers.Server.RoundStarted += OnRoundStarted; | ||
Exiled.Events.Handlers.Server.WaitingForPlayers += OnWaitingForPlayers; | ||
LogMessage(); | ||
base.OnEnabled(); | ||
} | ||
|
||
public override void OnDisabled() | ||
{ | ||
Exiled.Events.Handlers.Server.RoundStarted -= OnRoundStarted; | ||
Exiled.Events.Handlers.Server.WaitingForPlayers -= OnWaitingForPlayers; | ||
base.OnDisabled(); | ||
} | ||
|
||
private void OnRoundStarted() | ||
{ | ||
Map.TurnOffAllLights(42f); | ||
|
||
foreach (var player in Player.List) | ||
{ | ||
var flashlight = (Flashlight)Item.Create(ItemType.Flashlight, player); | ||
player.AddItem(flashlight); | ||
player.ShowHint("<color=#E4080A>因SCP突破收容 正在切换到备用电源 请使用手电筒! ", 10); | ||
Timing.CallDelayed(42f, () => player.ShowHint("<color=#7DDA58>已切换到备用电源 ", 5)); | ||
} | ||
} | ||
|
||
private void OnWaitingForPlayers() | ||
{ | ||
} | ||
|
||
private void LogMessage() | ||
{ | ||
Log.Info("开局掐灯已开启 From.Lively-Xuan"); | ||
|
||
} | ||
} | ||
|
||
public class Config : IConfig | ||
{ | ||
public bool IsEnabled { get; set; } = true; | ||
public bool Debug { get; set; } = false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<?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>{65E351A6-03D7-42E2-B61F-5014EB7779B0}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>OpenHobbyPower</RootNamespace> | ||
<AssemblyName>OpenHobbyPower</AssemblyName> | ||
<TargetFrameworkVersion>v4.8</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>D:\VS\SCP 181 999 3035 008\bin\Debug\Assembly-CSharp.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Assembly-CSharp-firstpass"> | ||
<HintPath>D:\VS\SCP 181 999 3035 008\bin\Debug\Assembly-CSharp-firstpass.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Assembly-CSharp-Publicized"> | ||
<HintPath>D:\VS\SCP 181 999 3035 008\bin\Debug\Assembly-CSharp-Publicized.dll</HintPath> | ||
</Reference> | ||
<Reference Include="CommandSystem.Core, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\ExMod.Exiled.9.1.1\lib\net48\CommandSystem.Core.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Exiled.API, Version=9.1.1.0, Culture=neutral, processorArchitecture=AMD64"> | ||
<HintPath>..\packages\ExMod.Exiled.9.1.1\lib\net48\Exiled.API.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Exiled.CreditTags, Version=9.1.1.0, Culture=neutral, processorArchitecture=AMD64"> | ||
<HintPath>..\packages\ExMod.Exiled.9.1.1\lib\net48\Exiled.CreditTags.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Exiled.CustomItems, Version=9.1.1.0, Culture=neutral, processorArchitecture=AMD64"> | ||
<HintPath>..\packages\ExMod.Exiled.9.1.1\lib\net48\Exiled.CustomItems.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Exiled.CustomRoles, Version=9.1.1.0, Culture=neutral, processorArchitecture=AMD64"> | ||
<HintPath>..\packages\ExMod.Exiled.9.1.1\lib\net48\Exiled.CustomRoles.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Exiled.Events, Version=9.1.1.0, Culture=neutral, processorArchitecture=AMD64"> | ||
<HintPath>..\packages\ExMod.Exiled.9.1.1\lib\net48\Exiled.Events.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Exiled.Loader, Version=9.1.1.0, Culture=neutral, processorArchitecture=AMD64"> | ||
<HintPath>..\packages\ExMod.Exiled.9.1.1\lib\net48\Exiled.Loader.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Exiled.Permissions, Version=9.1.1.0, Culture=neutral, processorArchitecture=AMD64"> | ||
<HintPath>..\packages\ExMod.Exiled.9.1.1\lib\net48\Exiled.Permissions.dll</HintPath> | ||
</Reference> | ||
<Reference Include="NorthwoodLib, Version=1.3.1.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\ExMod.Exiled.9.1.1\lib\net48\NorthwoodLib.dll</HintPath> | ||
</Reference> | ||
<Reference Include="PluginAPI, Version=13.1.5.0, Culture=neutral, processorArchitecture=AMD64"> | ||
<HintPath>..\packages\ExMod.Exiled.9.1.1\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="UnityEngine.CoreModule"> | ||
<HintPath>E:\SteamLibrary\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\UnityEngine.CoreModule.dll</HintPath> | ||
</Reference> | ||
<Reference Include="YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\ExMod.Exiled.9.1.1\lib\net48\YamlDotNet.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="OpenHobbyPower.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="ExMod.Exiled" version="9.1.1" targetFramework="net48" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.12.35527.113 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenHobbyPower", "ClassLibrary1\OpenHobbyPower.csproj", "{65E351A6-03D7-42E2-B61F-5014EB7779B0}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{65E351A6-03D7-42E2-B61F-5014EB7779B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{65E351A6-03D7-42E2-B61F-5014EB7779B0}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{65E351A6-03D7-42E2-B61F-5014EB7779B0}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{65E351A6-03D7-42E2-B61F-5014EB7779B0}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |