Skip to content

Commit

Permalink
#newrelease
Browse files Browse the repository at this point in the history
  • Loading branch information
VALERA771 authored Dec 18, 2023
2 parents c8d5cda + 4f49c47 commit f210858
Show file tree
Hide file tree
Showing 11 changed files with 244 additions and 327 deletions.
66 changes: 32 additions & 34 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,39 @@
name: Build

name: CI Build
on:
push:
branches:
- master
pull_request:
branches:
- master
- dev
workflow_dispatch:

env:
REFERENCES_URL: https://misaka-zerotwo.github.io/SL-References/Dev.zip
REFERENCES_PATH: ${{ github.workspace }}/References
jobs:

build:

runs-on: windows-latest

steps:

- name: Setup .NET
uses: actions/[email protected]

- name: Checkout
uses: actions/[email protected]

- name: Restore projects
run: dotnet restore CustomUnit

- name: Build
env:
EXILED_REFERENCES: D:\a\CustomUnit\CustomUnit\.github\workflows\Refs
shell: pwsh
run: dotnet build CustomUnit -c release

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Build Results
path: bin/Release

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3

- uses: actions/[email protected]

- name: Restore Packages
run: nuget restore

- name: Get Build References
shell: pwsh
run: |
Invoke-WebRequest -Uri ${{ env.REFERENCES_URL }} -OutFile ${{ github.workspace }}/Dev.zip
Expand-Archive -Path Dev.zip -DestinationPath ${{ env.REFERENCES_PATH }}
- name: Setup MSBuild.exe
uses: microsoft/Setup-MSBuild@v1
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'

- name: Build
run: |
msbuild CustomUnit\CustomUnit.csproj -t:rebuild -property:Configuration=Release -property:ReferencePath="${{ env.REFERENCES_PATH }}"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: Build Result
path: "CustomUnit/bin/Release/CustomUnit.dll"
23 changes: 12 additions & 11 deletions CustomUnit/Additions/RoomSpawnPoint.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
using System.ComponentModel;
using MapGeneration;

namespace CustomUnit.Additions;

public struct RoomSpawnPoint
namespace CustomUnit.Additions
{
public RoomSpawnPoint(RoomName roomName, int chance)
public struct RoomSpawnPoint
{
RoomName = roomName;
Chance = chance;
}
public RoomSpawnPoint(RoomName roomName, int chance)
{
RoomName = roomName;
Chance = chance;
}

[Description("The room name")]
public RoomName RoomName { get; }
[Description("The room name")]
public RoomName RoomName { get; }

[Description("The chance to spawn unit there")]
public float Chance { get; }
[Description("The chance to spawn unit there")]
public float Chance { get; }
}
}
33 changes: 0 additions & 33 deletions CustomUnit/Additions/SpawnLocation.cs

This file was deleted.

19 changes: 10 additions & 9 deletions CustomUnit/Additions/SpawnPosition.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
using UnityEngine;

namespace CustomUnit.Additions;

public struct SpawnPosition
namespace CustomUnit.Additions
{
public SpawnPosition(Vector3 position, float chance)
public struct SpawnPosition
{
Position = position;
Chance = chance;
}
public SpawnPosition(Vector3 position, float chance)
{
Position = position;
Chance = chance;
}

public Vector3 Position { get; }
public Vector3 Position { get; }

public float Chance { get; }
public float Chance { get; }
}
}
8 changes: 4 additions & 4 deletions CustomUnit/Commands/Spawn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
if (cond)
{
Log.Info(2);
EventHadlers.Spawn(unit,
EventHandlers.Spawn(unit,
spawn.GetRange(num,
RespawnManager.SpawnableTeams[unit.Team].MaxWaveSize > spawn.Count
? spawn.Count
Expand All @@ -102,7 +102,7 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
{
if (Random.Range(0, 101) < unit.SpawnChance)
{
EventHadlers.Spawn(unit,
EventHandlers.Spawn(unit,
spawn.GetRange(num,
RespawnManager.SpawnableTeams[unit.Team].MaxWaveSize > spawn.Count
? RespawnManager.SpawnableTeams[unit.Team].MaxWaveSize - spawn.Count
Expand All @@ -122,12 +122,12 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
switch (unit.Team)
{
case SpawnableTeamType.NineTailedFox when Respawn.NtfTickets < Plugin.Tickets[unit]:
EventHadlers.Spawn(unit, spawn.GetRange(num, RespawnManager.SpawnableTeams[unit.Team].MaxWaveSize - num), unit.Team);
EventHandlers.Spawn(unit, spawn.GetRange(num, RespawnManager.SpawnableTeams[unit.Team].MaxWaveSize - num), unit.Team);

response = "Successfully spawned!";
return true;
case SpawnableTeamType.ChaosInsurgency when Respawn.ChaosTickets < Plugin.Tickets[unit]:
EventHadlers.Spawn(unit, spawn.GetRange(num, RespawnManager.SpawnableTeams[unit.Team].MaxWaveSize - num), unit.Team);
EventHandlers.Spawn(unit, spawn.GetRange(num, RespawnManager.SpawnableTeams[unit.Team].MaxWaveSize - num), unit.Team);

response = "Successfully spawned!";
return true;
Expand Down
59 changes: 11 additions & 48 deletions CustomUnit/CustomUnit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -30,53 +31,16 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>$(EXILED_REFERENCES)\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>$(EXILED_REFERENCES)\Assembly-CSharp-Publicized.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(EXILED_REFERENCES)\Assembly-CSharp-Publicized.dll</HintPath>
<Reference Include="Assembly-CSharp-Publicized, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Assembly-CSharp-Publicized.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(EXILED_REFERENCES)\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="CommandSystem.Core, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(EXILED_REFERENCES)\CommandSystem.Core.dll</HintPath>
</Reference>
<Reference Include="Exiled.API, Version=7.0.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>$(EXILED_REFERENCES)\Exiled.API.dll</HintPath>
</Reference>
<Reference Include="Exiled.CreditTags, Version=7.0.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>$(EXILED_REFERENCES)\Exiled.CreditTags.dll</HintPath>
</Reference>
<Reference Include="Exiled.CustomItems, Version=7.0.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>$(EXILED_REFERENCES)\Exiled.CustomItems.dll</HintPath>
</Reference>
<Reference Include="Exiled.CustomRoles, Version=7.0.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>$(EXILED_REFERENCES)\Exiled.CustomRoles.dll</HintPath>
</Reference>
<Reference Include="Exiled.Events, Version=7.0.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>$(EXILED_REFERENCES)\Exiled.Events.dll</HintPath>
</Reference>
<Reference Include="Exiled.Loader, Version=7.0.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>$(EXILED_REFERENCES)\Exiled.Loader.dll</HintPath>
</Reference>
<Reference Include="Exiled.Permissions, Version=7.0.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>$(EXILED_REFERENCES)\Exiled.Permissions.dll</HintPath>
</Reference>
<Reference Include="Exiled.Updater, Version=3.1.2.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>$(EXILED_REFERENCES)\Exiled.Updater.dll</HintPath>
</Reference>
<Reference Include="NorthwoodLib, Version=1.2.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(EXILED_REFERENCES)\NorthwoodLib.dll</HintPath>
</Reference>
<Reference Include="PluginAPI, Version=12.0.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>$(EXILED_REFERENCES)\PluginAPI.dll</HintPath>
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -97,21 +61,17 @@
<Reference Include="Mirror, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>$(EXILED_REFERENCES)\Mirror.dll</HintPath>
</Reference>
<Reference Include="YamlDotNet">
<HintPath>$(EXILED_REFERENCES)\YamlDotNet.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Additions\SpawnPosition.cs" />
<Compile Include="Additions\RoomSpawnPoint.cs" />
<Compile Include="Additions\SpawnLocation.cs" />
<Compile Include="Commands\List.cs" />
<Compile Include="Commands\Reload.cs" />
<Compile Include="Commands\Spawn.cs" />
<Compile Include="Commands\Tickets.cs" />
<Compile Include="Configs\Plugin.cs" />
<Compile Include="Configs\Unit.cs" />
<Compile Include="EventHadlers.cs" />
<Compile Include="EventHandlers.cs" />
<Compile Include="EventOptions\Options.cs" />
<Compile Include="Extensions.cs" />
<Compile Include="Methods.cs" />
Expand All @@ -122,5 +82,8 @@
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="EXILED" Version="8.4.3" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Loading

0 comments on commit f210858

Please sign in to comment.