Skip to content
This repository has been archived by the owner on Dec 28, 2024. It is now read-only.

Commit

Permalink
Upload to GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAfitol committed Mar 26, 2023
1 parent e5fbd0a commit f81dce8
Show file tree
Hide file tree
Showing 18 changed files with 931 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
.vs

# NuGet Packages
*.nupkg

# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*

# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
25 changes: 25 additions & 0 deletions BetterDrops-CursedMod.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.4.33103.184
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BetterDrops-CursedMod", "BetterDrops-CursedMod\BetterDrops-CursedMod.csproj", "{C487D4E1-848D-4540-87BE-63805EA64593}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C487D4E1-848D-4540-87BE-63805EA64593}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C487D4E1-848D-4540-87BE-63805EA64593}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C487D4E1-848D-4540-87BE-63805EA64593}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C487D4E1-848D-4540-87BE-63805EA64593}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {89811D18-94F1-40DC-BBF3-1ED11C064D6B}
EndGlobalSection
EndGlobal
85 changes: 85 additions & 0 deletions BetterDrops-CursedMod/BetterDrops-CursedMod.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?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>{C487D4E1-848D-4540-87BE-63805EA64593}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BetterDrops_CursedMod</RootNamespace>
<AssemblyName>BetterDrops-CursedMod</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-firstpass">
<HintPath>..\..\..\SCPSL\Plugins\Dependencies\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-Publicized">
<HintPath>..\..\..\SCPSL\Plugins\Dependencies\Assembly-CSharp-Publicized.dll</HintPath>
</Reference>
<Reference Include="CommandSystem.Core">
<HintPath>..\..\..\SCPSL\Plugins\Dependencies\CommandSystem.Core.dll</HintPath>
</Reference>
<Reference Include="CursedMod, Version=0.0.0.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\SCPSL\Plugins\Dependencies\CursedMod.dll</HintPath>
</Reference>
<Reference Include="Mirror">
<HintPath>..\..\..\SCPSL\Plugins\Dependencies\Mirror.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">
<HintPath>..\..\..\SCPSL\Plugins\Dependencies\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\SCPSL\Plugins\Dependencies\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>..\..\..\SCPSL\Plugins\Dependencies\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Commands\BetterDropsCommand.cs" />
<Compile Include="Commands\ChaosCommand.cs" />
<Compile Include="Commands\MtfCommand.cs" />
<Compile Include="Commands\SpawnCommand.cs" />
<Compile Include="Config.cs" />
<Compile Include="Configs\DropConfig.cs" />
<Compile Include="Configs\RandomDropConfigs.cs" />
<Compile Include="Features\Components\BalloonController.cs" />
<Compile Include="Features\Components\DisappearController.cs" />
<Compile Include="Features\Components\DropController.cs" />
<Compile Include="Features\EventHandlers.cs" />
<Compile Include="Features\Extensions\DropExtensions.cs" />
<Compile Include="Plugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
28 changes: 28 additions & 0 deletions BetterDrops-CursedMod/Commands/BetterDropsCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace BetterDrops_CursedMod.Commands
{
using System;
using CommandSystem;

[CommandHandler(typeof(RemoteAdminCommandHandler))]
public class BetterDropsCommand : ParentCommand
{
public BetterDropsCommand() => LoadGeneratedCommands();

public sealed override void LoadGeneratedCommands()
{
RegisterCommand(SpawnCommand.Instance);
RegisterCommand(ChaosCommand.Instance);
RegisterCommand(MtfCommand.Instance);
}

protected override bool ExecuteParent(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
response = "Please, specify a valid subcommand! Available ones: spawn, mtf, chaos";
return false;
}

public override string Command { get; } = "BetterDrops";
public override string[] Aliases { get; } = Array.Empty<string>();
public override string Description { get; } = "BetterDrops parent command.";
}
}
30 changes: 30 additions & 0 deletions BetterDrops-CursedMod/Commands/ChaosCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
namespace BetterDrops_CursedMod.Commands
{
using System;
using Features.Extensions;
using CommandSystem;
using PlayerRoles;

public class ChaosCommand : ICommand
{
public static ChaosCommand Instance { get; } = new ChaosCommand();

public string Command { get; } = "chaos";
public string[] Aliases { get; } = Array.Empty<string>();
public string Description { get; } = "Spawn a drop";

public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
if (!sender.CheckPermission(PlayerPermissions.FacilityManagement))
{
response = "You don't have perms to do that!";
return false;
}

Team.ChaosInsurgency.SpawnDrops(Plugin.Instance.Config.ChaosDropWave, Plugin.Instance.Config.ChaosDropWave.NumberOfDrops);

response = "Spawned!";
return true;
}
}
}
30 changes: 30 additions & 0 deletions BetterDrops-CursedMod/Commands/MtfCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
namespace BetterDrops_CursedMod.Commands
{
using System;
using Features.Extensions;
using CommandSystem;
using PlayerRoles;

public class MtfCommand : ICommand
{
public static MtfCommand Instance { get; } = new MtfCommand();

public string Command { get; } = "mtf";
public string[] Aliases { get; } = Array.Empty<string>();
public string Description { get; } = "Spawn a drop";

public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
if (!sender.CheckPermission(PlayerPermissions.FacilityManagement))
{
response = "You don't have perms to do that!";
return false;
}

Team.FoundationForces.SpawnDrops(Plugin.Instance.Config.MtfDropWave, Plugin.Instance.Config.MtfDropWave.NumberOfDrops);

response = "Spawned!";
return true;
}
}
}
32 changes: 32 additions & 0 deletions BetterDrops-CursedMod/Commands/SpawnCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
namespace BetterDrops_CursedMod.Commands
{
using System;
using Features.Extensions;
using CommandSystem;
using UnityEngine;
using Random = UnityEngine.Random;
using CursedMod.Features.Wrappers.Player;

public class SpawnCommand : ICommand
{
public static SpawnCommand Instance { get; } = new SpawnCommand();

public string Command { get; } = "spawn";
public string[] Aliases { get; } = Array.Empty<string>();
public string Description { get; } = "Spawn a drop";

public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
if (!sender.CheckPermission(PlayerPermissions.FacilityManagement))
{
response = "You don't have perms to do that!";
return false;
}

DropExtensions.SpawnDrop(CursedPlayer.Get(((CommandSender)sender).SenderId).Position + Vector3.up * 10f, Random.ColorHSV(), new[] { ItemType.Coin }, false, false);

response = "Spawned!";
return true;
}
}
}
20 changes: 20 additions & 0 deletions BetterDrops-CursedMod/Config.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace BetterDrops_CursedMod
{
using System.ComponentModel;
using Configs;

public class Config
{
[Description("How long to wait before drops open themselves.")]
public float AutoOpen { get; set; } = 15f;

[Description("The configs of random drops")]
public RandomDropConfigs RandomDrops { get; set; } = new RandomDropConfigs();

[Description("The configs of the MTF drop waves.")]
public DropConfig MtfDropWave { get; set; } = new DropConfig();

[Description("The configs of the Chaos drop waves.")]
public DropConfig ChaosDropWave { get; set; } = new DropConfig();
}
}
32 changes: 32 additions & 0 deletions BetterDrops-CursedMod/Configs/DropConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
namespace BetterDrops_CursedMod.Configs
{
using System.Collections.Generic;
using System.ComponentModel;

public class DropConfig
{
[Description("Is the drop wave enabled.")]
public bool IsEnabled { get; set; } = true;

[Description("Number of drops in the spawn wave.")]
public uint NumberOfDrops { get; set; } = 5;

[Description("Items per drop, I suggest low values, if you do stupid things with this config it is your fault.")]
public uint ItemsPerDrop { get; set; } = 1;

[Description("Drop color. (It accepts Random or hex values like '#ffffff')")]
public string Color { get; set; } = "Random";

[Description("Cassie message on spawn drop. (Leave blank to disable)")]
public string Cassie { get; set; } = "pitch_0.2 .g4... pitch_1 Supply jam_020_2 has been arrival";

[Description("Will the gun have a full ammo?")]
public bool FillMaxAmmo { get; set; } = true;

[Description("Will the gun have a random attachments?")]
public bool RandomAttachments { get; set; } = true;

[Description("The possible items inside the drop")]
public List<ItemType> PossibleItems { get; set; } = new List<ItemType> { ItemType.Adrenaline, ItemType.Coin, ItemType.Medkit, ItemType.GrenadeFlash, ItemType.GrenadeHE, ItemType.Radio, ItemType.Painkillers, ItemType.ArmorCombat, ItemType.ArmorHeavy, ItemType.ArmorLight, ItemType.GunRevolver, ItemType.GunShotgun, ItemType.GunAK, ItemType.GunCOM15, ItemType.GunFSP9, ItemType.GunE11SR };
}
}
19 changes: 19 additions & 0 deletions BetterDrops-CursedMod/Configs/RandomDropConfigs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace BetterDrops_CursedMod.Configs
{
using System.ComponentModel;

public class RandomDropConfigs
{
[Description("The minimum time that has to happen until the first random drop.")]
public ushort FirstRandomDropOffset { get; set; } = 120;

[Description("Minimum time between random drops.")]
public ushort MinRandomDropsInterval { get; set; } = 120;

[Description("Maximum time between random drops.")]
public ushort MaxRandomDropsInterval { get; set; } = 240;

[Description("Random drop wave settings. (Here you can disable them)")]
public DropConfig WaveSettings { get; set; } = new DropConfig();
}
}
19 changes: 19 additions & 0 deletions BetterDrops-CursedMod/Features/Components/BalloonController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace BetterDrops_CursedMod.Features.Components
{
using UnityEngine;

public class BalloonController : MonoBehaviour
{
private float _counter;

private void Update()
{
transform.position += 7 * Time.deltaTime * Vector3.up;

_counter += Time.deltaTime;

if (_counter > 10)
Destroy(gameObject);
}
}
}
18 changes: 18 additions & 0 deletions BetterDrops-CursedMod/Features/Components/DisappearController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace BetterDrops_CursedMod.Features.Components
{
using UnityEngine;

public class DisappearController : MonoBehaviour
{
public Vector3 startPos;

private void Start()
{
Rigidbody r = gameObject.AddComponent<Rigidbody>();

Vector3 dir = transform.position - startPos;

r.AddForce(dir * 10, ForceMode.Impulse);
}
}
}
Loading

0 comments on commit f81dce8

Please sign in to comment.