Skip to content

Commit 1599f25

Browse files
committed
添加项目文件。
0 parents  commit 1599f25

6 files changed

Lines changed: 171 additions & 0 deletions

File tree

InfiniteAmmoEvent.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using LabApi.Events.Arguments.PlayerEvents;
2+
using LabApi.Events.CustomHandlers;
3+
4+
namespace LabAPI_InfiniteAmmo
5+
{
6+
public class InfiniteAmmoEvent : CustomEventsHandler
7+
{
8+
public override void OnPlayerDryFiringWeapon(PlayerDryFiringWeaponEventArgs ev)
9+
{
10+
ev.Player.SetAmmo(ev.FirearmItem.AmmoType, (ushort)(ev.Player.GetAmmo(ev.FirearmItem.AmmoType) + 1));
11+
}
12+
/// <summary>
13+
/// 禁止玩家掉落子弹
14+
/// </summary>
15+
/// <param name="ev">PlayerDroppingAmmoEventArgs</param>
16+
public override void OnPlayerDroppingAmmo(PlayerDroppingAmmoEventArgs ev)
17+
{
18+
ev.IsAllowed = false;
19+
}
20+
}
21+
}

InfiniteAmmoMain.cs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using LabApi.Events.CustomHandlers;
2+
using LabApi.Features;
3+
using LabApi.Loader.Features.Plugins;
4+
using System;
5+
6+
namespace LabAPI_InfiniteAmmo
7+
{
8+
/// <summary>
9+
/// 无限子弹 插件。
10+
/// </summary>
11+
public class InfiniteAmmoMain : Plugin
12+
{
13+
/// <summary>
14+
/// 插件信息。
15+
/// </summary>
16+
public override string Name => "Infinite Ammo Plugin";
17+
public override string Description => "Give Player Infinite Ammo";
18+
public override string Author => "TASA-Ed Studio";
19+
20+
/// <summary>
21+
/// 插件版本。
22+
/// </summary>
23+
public override Version Version => new (0, 1, 0, 0);
24+
25+
/// <summary>
26+
/// 需要的 LabApi 版本。
27+
/// </summary>
28+
public override Version RequiredApiVersion => new (LabApiProperties.CompiledVersion);
29+
30+
/// <summary>
31+
/// Events handler object.
32+
/// </summary>
33+
public InfiniteAmmoEvent Events { get; } = new ();
34+
35+
public override void Enable()
36+
{
37+
CustomHandlersManager.RegisterEventsHandler(Events);
38+
}
39+
40+
public override void Disable()
41+
{
42+
CustomHandlersManager.UnregisterEventsHandler(Events);
43+
}
44+
}
45+
}

LabAPI_InfiniteAmmo.csproj

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{C816C531-3266-4FD4-99F3-D8DA42F5EA02}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>LabAPI_InfiniteAmmo</RootNamespace>
11+
<AssemblyName>LabAPI_InfiniteAmmo</AssemblyName>
12+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
<LangVersion>12</LangVersion>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<DebugType>pdbonly</DebugType>
28+
<Optimize>true</Optimize>
29+
<OutputPath>bin\Release\</OutputPath>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
<LangVersion>12</LangVersion>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="Assembly-CSharp">
37+
<HintPath>..\..\..\..\steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Assembly-CSharp.dll</HintPath>
38+
</Reference>
39+
<Reference Include="LabApi">
40+
<HintPath>..\..\..\..\steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\LabApi.dll</HintPath>
41+
</Reference>
42+
<Reference Include="Mirror">
43+
<HintPath>..\..\..\..\steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Mirror.dll</HintPath>
44+
</Reference>
45+
<Reference Include="System" />
46+
<Reference Include="System.Core" />
47+
<Reference Include="System.Xml.Linq" />
48+
<Reference Include="System.Data.DataSetExtensions" />
49+
<Reference Include="Microsoft.CSharp" />
50+
<Reference Include="System.Data" />
51+
<Reference Include="System.Net.Http" />
52+
<Reference Include="System.Xml" />
53+
<Reference Include="YamlDotNet, Version=16.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
54+
<HintPath>packages\YamlDotNet.16.3.0\lib\net47\YamlDotNet.dll</HintPath>
55+
</Reference>
56+
</ItemGroup>
57+
<ItemGroup>
58+
<Compile Include="InfiniteAmmoEvent.cs" />
59+
<Compile Include="InfiniteAmmoMain.cs" />
60+
<Compile Include="Properties\AssemblyInfo.cs" />
61+
</ItemGroup>
62+
<ItemGroup>
63+
<None Include="packages.config" />
64+
</ItemGroup>
65+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
66+
</Project>

LabAPI_InfiniteAmmo.slnx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Solution>
2+
<Project Path="LabAPI_InfiniteAmmo.csproj" Id="c816c531-3266-4fd4-99f3-d8da42f5ea02" />
3+
</Solution>

Properties/AssemblyInfo.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System.Reflection;
2+
using System.Runtime.InteropServices;
3+
4+
// 有关程序集的一般信息由以下
5+
// 控制。更改这些特性值可修改
6+
// 与程序集关联的信息。
7+
[assembly: AssemblyTitle("LabAPI_InfiniteAmmo")]
8+
[assembly: AssemblyDescription("")]
9+
[assembly: AssemblyConfiguration("")]
10+
[assembly: AssemblyCompany("")]
11+
[assembly: AssemblyProduct("LabAPI_InfiniteAmmo")]
12+
[assembly: AssemblyCopyright("Copyright © 2026")]
13+
[assembly: AssemblyTrademark("")]
14+
[assembly: AssemblyCulture("")]
15+
16+
// 将 ComVisible 设置为 false 会使此程序集中的类型
17+
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
18+
//请将此类型的 ComVisible 特性设置为 true。
19+
[assembly: ComVisible(true)]
20+
21+
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
22+
[assembly: Guid("c816c531-3266-4fd4-99f3-d8da42f5ea02")]
23+
24+
// 程序集的版本信息由下列四个值组成:
25+
//
26+
// 主版本
27+
// 次版本
28+
// 生成号
29+
// 修订号
30+
//
31+
[assembly: AssemblyVersion("0.1.0.0")]
32+
[assembly: AssemblyFileVersion("0.1.0.0")]

packages.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="YamlDotNet" version="16.3.0" targetFramework="net48" />
4+
</packages>

0 commit comments

Comments
 (0)