Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
># Update 3.1.0
>
>>## SCP-1289 (formerly <i>'Coin'</i>)
>>> #### Renamed the coin
>>> #### Added death and winning notes
>>>> Due to a limitation of Exiled only the player who gets killed by the coin can see the new effects added by yours truly
>>
>>## Tranq
>>> Made the player who got tranqed invulnerable but unable to use any items (humans)
>>
>>## Genaral code
>>> Added some notes in the 'Util.cs' file for those who want to add on to this
>#Update 3.2.1
80 changes: 0 additions & 80 deletions Commands/CustomKeycard

This file was deleted.

2 changes: 1 addition & 1 deletion Commands/Debug/AdminPlastic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace ExtendedItems.Commands.Debug
[CommandHandler(typeof(ClientCommandHandler))]
class PlasticDebug : ICommand
{

public string Command => "Ddetonate";

public string[] Aliases => ["Ddet", "Dd", "Dboom"];
Expand Down
5 changes: 2 additions & 3 deletions Commands/Debug/Debug.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using CommandSystem;
using Exiled.API.Features;
using ExtendedItems.Commands.GuideBook;

namespace ExtendedItems.Commands.Debug
{
Expand All @@ -11,7 +10,7 @@ internal sealed class Debug : ParentCommand

public static Debug Instance { get; } = new();
public override string Command => "Debug";
public override string[] Aliases => [ "db" ];
public override string[] Aliases => ["db"];
public override string Description => "Overlord command for debugging the ExtendedItems plugin";

public override void LoadGeneratedCommands()
Expand All @@ -20,7 +19,7 @@ public override void LoadGeneratedCommands()
}
protected override bool ExecuteParent(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
if(!sender.CheckPermission(Plugin.Instance!.Config.DebugPermissions))
if (!sender.CheckPermission(Plugin.Instance!.Config.DebugPermissions))
{
response = "<color=red>Permission Denied.</color>";
Log.Error($"{sender} tried to access admin commands!");
Expand Down
8 changes: 2 additions & 6 deletions Commands/Debug/Locate.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
using System.Text;
using CommandSystem;

using Exiled.API.Features;
using Exiled.API.Features.Pools;
using Exiled.CustomItems;
using Exiled.CustomItems.API;
using Exiled.CustomItems.API.Features;
using System.Text;


namespace ExtendedItems.Commands.Debug
{
internal sealed class Locate : ICommand
{
public static Locate Instance { get; } = new();
public Locate() {}
public Locate() { }
public string Command => "Locate";
public string[] Aliases => ["loc", "find"];
public string Description => "Locates all (unless a valid ID is given) Custom Items";
Expand Down
9 changes: 2 additions & 7 deletions Commands/GuideBook/Coin.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommandSystem;
using CommandSystem;

namespace ExtendedItems.Commands.GuideBook
{
Expand All @@ -13,7 +8,7 @@ private Coinc() { }

public static Coinc Instance { get; } = new();
public string Command => "coin";
public string[] Aliases => [ "1289" ];
public string[] Aliases => ["1289"];
public string Description => "Information on SCP-1289 (aka \"Coin\" or \"Colin\") ";
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
Expand Down
7 changes: 1 addition & 6 deletions Commands/GuideBook/Help.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommandSystem;
using CommandSystem;

namespace ExtendedItems.Commands.GuideBook
{
Expand Down
7 changes: 1 addition & 6 deletions Commands/GuideBook/Sniper.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommandSystem;
using CommandSystem;

namespace ExtendedItems.Commands.GuideBook
{
Expand Down
9 changes: 2 additions & 7 deletions Commands/Main.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommandSystem;
using CommandSystem;

namespace ExtendedItems.Commands
{
Expand All @@ -13,7 +8,7 @@ internal sealed class Main : ParentCommand
public Main() { LoadGeneratedCommands(); }

public override string Command => "ExtendedItems";
public override string[] Aliases => [ "ei", "extendeditems", "eis" ];
public override string[] Aliases => ["ei", "extendeditems", "eis"];
public override string Description => "Overlord command for the ExtendedItems plugin";

public override void LoadGeneratedCommands()
Expand Down
10 changes: 6 additions & 4 deletions Commands/Plastic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
namespace ExtendedItems.Commands
{
[CommandHandler(typeof(ClientCommandHandler))]

class Plastic : ICommand
{
public string Command => "detonate";
Expand All @@ -15,6 +16,7 @@ class Plastic : ICommand
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
Player ply = Player.Get(sender);
Log.Debug($"Player: {ply.Nickname} executed the detonate command.");
if (!Items.Plastic.PlacedCharges.ContainsValue(ply))
{
response = "\n<color=red>You've haven't placed any C4 charges!</color>";
Expand All @@ -24,12 +26,12 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
int i = 0;
foreach (var charge in Items.Plastic.PlacedCharges.ToList())
{
float posy = charge.Key.Position.y;
float posy = charge.Key.Position.y;
if (charge.Value != ply) continue;
if (ply.Position.y >= posy - 100 && ply.Position.y <= posy + 100 )

if (ply.Position.y >= posy - 100 && ply.Position.y <= posy + 100)
{
Items.Plastic.Instance.Handler(charge.Key, Items.Plastic.C4RemoveMethod.Detonate);
Items.Plastic.Instance.Handler(charge.Key, Items.Plastic.C4RemoveMethod.Detonate, ply);
i++;
}
else
Expand Down
16 changes: 10 additions & 6 deletions Config.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
using ExtendedItems.Items;
using ExtendedItems.Keycards;
using Exiled.API.Enums;
using Exiled.API.Interfaces;
using ExtendedItems.Items;
using System.ComponentModel;
using UnityEngine;

namespace ExtendedItems
{
public class Config : IConfig
{
public bool IsEnabled { get; set; } = true;
public bool Debug { get; set; } = false;
public bool Debug { get; set; } = true;

#region Config Settings

[Description("Where SCP-1162 spawns")]
public RoomType Scp1162Room { get; set; } = RoomType.Lcz173;

[Description("The offset from Scp1162Room Origin point")]
public Vector3 SpawnOffset = new(16.68f, 11.6f, 8.11f);

[Description("Weather a tranqed target hold the item they had when they were tranqed")]
public bool ReholdItems = false;

Expand Down Expand Up @@ -49,15 +56,12 @@ public class Config : IConfig
#region Custom Items setup

public Coin Coin { get; set; } = new();
public Scp1162 Scp1162 { get; set; } = new();
public Scp1499 Scp1499 { get; set; } = new();
public GrenadeLauncher GrenadeLauncher { get; set; } = new();
public Sniper Sniper { get; set; } = new();
public Tranquilizer Tranquilizer { get; set; } = new();
public Plastic Plastic { get; set; } = new();
public AdminAbuse AdminAbuse { get; set; } = new();
public Site02Card Site02Card { get; set; } = new();
public TaskForceCard TaskForceCard { get; set; } = new();


#endregion
Expand Down
4 changes: 4 additions & 0 deletions ExtendedItems.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>

<PropertyGroup>
<NoWarn>$(NoWarn);MSB3270</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ExMod.Exiled" Version="9.6.0" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3">
Expand Down
13 changes: 7 additions & 6 deletions Items/AdminAbuse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
using Exiled.API.Features.Items;
using Exiled.API.Features.Spawn;
using Exiled.CustomItems.API.Features;
using Exiled.Events.EventArgs.Item;
using Exiled.Events.EventArgs.Player;
using E = ExtendedItems.Utils;
using InventorySystem.Items.Firearms.Attachments;
using ItemEvents = Exiled.Events.Handlers.Item;
using Exiled.Events.EventArgs.Item;
using System.ComponentModel;
using E = ExtendedItems.Utils;
using ItemEvents = Exiled.Events.Handlers.Item;

namespace ExtendedItems.Items
{
Expand All @@ -20,7 +20,7 @@
{
[Description("thanks to hayden for the idea on buckshot or else it wouldnt have worked")]
public override uint Id { get; set; } = 799;
public override string Name { get; set; } = "Regert";
public override string Name { get; set; } = "Regert (dont use this because it crashes the server)";
public override string Description { get; set; } = "you asked for it!";
public override float Weight { get; set; } = 0f;
public override float Damage { get; set; } = 0;
Expand Down Expand Up @@ -52,6 +52,7 @@
{
if (!Check(ev.Item) || ev.Player.NetId < 2) return;

Log.Debug($"Player {ev.Player.Nickname} tried to change attachments for {Name}");
ev.IsAllowed = false;
ev.Player.ShowHint("You are not allowed to change the attachment for this weapon.");
}
Expand All @@ -63,7 +64,7 @@

base.SubscribeEvents();
}

protected override void UnsubscribeEvents()
{
ItemEvents.ChangingAttachments -= OnChangingAttachments;
Expand All @@ -75,7 +76,7 @@
for (; ; )
{
float comp = -2;
var yVelocity = throwable.Projectile.Rigidbody.velocity.y - comp;
var yVelocity = throwable.Projectile.Rigidbody.linearVelocity.y - comp;

Check failure on line 79 in Items/AdminAbuse.cs

View workflow job for this annotation

GitHub Actions / build

'Rigidbody' does not contain a definition for 'linearVelocity' and no accessible extension method 'linearVelocity' accepting a first argument of type 'Rigidbody' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 79 in Items/AdminAbuse.cs

View workflow job for this annotation

GitHub Actions / build

'Rigidbody' does not contain a definition for 'linearVelocity' and no accessible extension method 'linearVelocity' accepting a first argument of type 'Rigidbody' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 79 in Items/AdminAbuse.cs

View workflow job for this annotation

GitHub Actions / build

'Rigidbody' does not contain a definition for 'linearVelocity' and no accessible extension method 'linearVelocity' accepting a first argument of type 'Rigidbody' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 79 in Items/AdminAbuse.cs

View workflow job for this annotation

GitHub Actions / build

'Rigidbody' does not contain a definition for 'linearVelocity' and no accessible extension method 'linearVelocity' accepting a first argument of type 'Rigidbody' could be found (are you missing a using directive or an assembly reference?)

Log.Info(yVelocity);
}
Expand Down
12 changes: 7 additions & 5 deletions Items/Coin.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System.ComponentModel;
using ExtendedItems.Types;
using Exiled.API.Enums;
using Exiled.API.Features;
using Exiled.API.Features.Attributes;
using Exiled.API.Features.Spawn;
using Exiled.CustomItems.API.Features;
using Exiled.Events.EventArgs.Player;
using ExtendedItems.Types;
using MEC;

using System.ComponentModel;
using PlayerEvents = Exiled.Events.Handlers.Player;

namespace ExtendedItems.Items
Expand Down Expand Up @@ -60,8 +60,9 @@ protected override void UnsubscribeEvents()
private void OnFlippingCoin(FlippingCoinEventArgs ev)
{
if (!Check(ev.Item)) return;

Timing.CallDelayed(2f, () => {

Timing.CallDelayed(2f, () =>
{
if (ev.IsTails && !ev.Player.IsDead)
{
ev.Player.IsGodModeEnabled = false;
Expand All @@ -71,6 +72,7 @@ private void OnFlippingCoin(FlippingCoinEventArgs ev)
}

ev.Player.ShowHint($"{Plugin.Instance?.Config.WinHints.RandomItem()}");

Effects.ForEach((effect) => { ev.Player.EnableEffect(effect.Type, effect.Intensity, effect.Duration, true); });
});
}
Expand Down
Loading
Loading