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
5 changes: 5 additions & 0 deletions EXILED/Exiled.API/Features/Items/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ namespace Exiled.API.Features.Items
using InventorySystem.Items.ThrowableProjectiles;
using InventorySystem.Items.ToggleableLights;
using InventorySystem.Items.Usables;
using InventorySystem.Items.Usables.Scp1344;
using InventorySystem.Items.Usables.Scp1576;
using InventorySystem.Items.Usables.Scp244;
using InventorySystem.Items.Usables.Scp330;
Expand Down Expand Up @@ -205,6 +206,7 @@ public static Item Get(ItemBase itemBase)
Scp330Bag scp330Bag => new Scp330(scp330Bag),
Scp244Item scp244Item => new Scp244(scp244Item),
Scp1576Item scp1576 => new Scp1576(scp1576),
Scp1344Item scp1344 => new Scp1344(scp1344),
BaseConsumable consumable => new Consumable(consumable),
_ => new Usable(usable),
},
Expand Down Expand Up @@ -272,6 +274,7 @@ public static T Get<T>(ushort serial)
/// <br />- SCP-330 can be casted to <see cref="Scp330"/>.
/// <br />- SCP-2176 can be casted to the <see cref="Scp2176"/> class.
/// <br />- SCP-1576 can be casted to the <see cref="Scp1576"/> class.
/// <br />- SCP-1344 can be casted to the <see cref="Scp1344"/> class.
/// <br />- Jailbird can be casted to the <see cref="Jailbird"/> class.
/// </para>
/// <para>
Expand Down Expand Up @@ -300,6 +303,7 @@ ItemType.KeycardGuard or ItemType.KeycardJanitor or ItemType.KeycardO5 or ItemTy
ItemType.SCP330 => new Scp330(),
ItemType.SCP2176 => new Scp2176(owner),
ItemType.SCP1576 => new Scp1576(),
ItemType.SCP1344 => new Scp1344(),
ItemType.Jailbird => new Jailbird(),
_ => new Item(type),
};
Expand All @@ -325,6 +329,7 @@ ItemType.KeycardGuard or ItemType.KeycardJanitor or ItemType.KeycardO5 or ItemTy
/// <br />- SCP-330 can be casted to <see cref="Scp330"/>.
/// <br />- SCP-2176 can be casted to the <see cref="Scp2176"/> class.
/// <br />- SCP-1576 can be casted to the <see cref="Scp1576"/> class.
/// <br />- SCP-1344 can be casted to the <see cref="Scp1344"/> class.
/// <br />- Jailbird can be casted to the <see cref="Jailbird"/> class.
/// </para>
/// <para>
Expand Down
83 changes: 83 additions & 0 deletions EXILED/Exiled.API/Features/Items/Scp1344.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// -----------------------------------------------------------------------
// <copyright file="Scp1344.cs" company="ExMod Team">
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Features.Items
{
using Exiled.API.Interfaces;
using InventorySystem.Items.Usables;
using InventorySystem.Items.Usables.Scp1344;
using PlayerRoles.FirstPersonControl.Thirdperson.Subcontrollers;

/// <summary>
/// A wrapper class for <see cref="Scp1344Item"/>.
/// </summary>
public class Scp1344 : Usable, IWrapper<Scp1344Item>
{
/// <summary>
/// Initializes a new instance of the <see cref="Scp1344"/> class.
/// </summary>
/// <param name="itemBase">The base <see cref="Scp1344Item"/> class.</param>
public Scp1344(Scp1344Item itemBase)
: base(itemBase)
{
Base = itemBase;
}

/// <summary>
/// Initializes a new instance of the <see cref="Scp1344"/> class.
/// </summary>
internal Scp1344()
: this((Scp1344Item)Server.Host.Inventory.CreateItemInstance(new(ItemType.SCP1344, 0), false))
{
}

/// <summary>
/// Gets the <see cref="UsableItem"/> that this class is encapsulating.
/// </summary>
public new Scp1344Item Base { get; }

/// <summary>
/// Gets a value indicating whether it can be started to use.
/// </summary>
public bool CanStartUsing => Base.CanStartUsing;

/// <summary>
/// Gets or sets the status of Scp1344.
/// </summary>
public Scp1344Status Status
{
get => Base.Status;
set => Base.Status = value;
}

/// <summary>
/// Forcefully Deactivate SCP-1344.
/// </summary>
/// <param name="dropItem">Drop or not the item.</param>
public void Deactivate(bool dropItem = false)
{
if (Status is not(Scp1344Status.Active or Scp1344Status.Stabbing or Scp1344Status.Dropping))
{
return;
}

Base.Owner.DisableWearables(WearableElements.Scp1344Goggles);
Base.ActivateFinalEffects();
Status = Scp1344Status.Idle;

if (dropItem)
{
Base.ServerDropItem(true);
}
}

/// <summary>
/// Forcefully activated SCP-1344.
/// </summary>
public void Actived() => Status = Scp1344Status.Stabbing;
}
}
22 changes: 22 additions & 0 deletions EXILED/Exiled.Events/EventArgs/Interfaces/IScp1344Event.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// -----------------------------------------------------------------------
// <copyright file="IScp1344Event.cs" company="ExMod Team">
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.Events.EventArgs.Interfaces
{
using Exiled.API.Features.Items;

/// <summary>
/// Event args used for all <see cref="API.Features.Items.Scp1344" /> related events.
/// </summary>
public interface IScp1344Event : IItemEvent
{
/// <summary>
/// Gets the <see cref="API.Features.Items.Scp1344" /> triggering the event.
/// </summary>
public Scp1344 Scp1344 { get; }
}
}
55 changes: 55 additions & 0 deletions EXILED/Exiled.Events/EventArgs/Scp1344/ChangedStatusEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// -----------------------------------------------------------------------
// <copyright file="ChangedStatusEventArgs.cs" company="ExMod Team">
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.Events.EventArgs.Scp1344
{
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
using InventorySystem.Items.Usables.Scp1344;

/// <summary>
/// Contains all information after SCP-1344 status changing.
/// </summary>
public class ChangedStatusEventArgs : IScp1344Event, IPlayerEvent, IDeniableEvent
{
/// <summary>
/// Initializes a new instance of the <see cref="ChangedStatusEventArgs" /> class.
/// </summary>
/// <param name="item"><inheritdoc cref="Item"/></param>
/// <param name="scp1344Status"><inheritdoc cref="InventorySystem.Items.Usables.Scp1344.Scp1344Status"/></param>
public ChangedStatusEventArgs(Item item, Scp1344Status scp1344Status)
{
Item = item;
Scp1344 = item as Scp1344;
Player = item.Owner;
Scp1344Status = scp1344Status;
}

/// <summary>
/// Gets the new state.
/// </summary>
public Scp1344Status Scp1344Status { get; }

/// <summary>
/// Gets the item.
/// </summary>
public Item Item { get; }

/// <summary>
/// Gets the player in owner of the item.
/// </summary>
public Exiled.API.Features.Player Player { get; }

/// <summary>
/// Gets Scp1344 item.
/// </summary>
public Scp1344 Scp1344 { get; }

/// <inheritdoc/>
public bool IsAllowed { get; set; }
}
}
64 changes: 64 additions & 0 deletions EXILED/Exiled.Events/EventArgs/Scp1344/ChangingStatusEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// -----------------------------------------------------------------------
// <copyright file="ChangingStatusEventArgs.cs" company="ExMod Team">
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.Events.EventArgs.Scp1344
{
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
using InventorySystem.Items.Usables.Scp1344;

/// <summary>
/// Contains all information before SCP-1344 status changing.
/// </summary>
public class ChangingStatusEventArgs : IPlayerEvent, IScp1344Event, IDeniableEvent
{
/// <summary>
/// Initializes a new instance of the <see cref="ChangingStatusEventArgs" /> class.
/// </summary>
/// <param name="item"><inheritdoc cref="Item"/></param>
/// <param name="scp1344StatusNew"><inheritdoc cref="Scp1344StatusNew"/></param>
/// <param name="scp1344StatusOld"><inheritdoc cref="Scp1344StatusOld"/></param>
/// <param name="isAllowed"><inheritdoc cref="IsAllowed"/></param>
public ChangingStatusEventArgs(Item item, Scp1344Status scp1344StatusNew, Scp1344Status scp1344StatusOld, bool isAllowed = true)
{
Item = item;
Scp1344 = item as Scp1344;
Player = item.Owner;
Scp1344StatusNew = scp1344StatusNew;
Scp1344StatusOld = scp1344StatusOld;
IsAllowed = isAllowed;
}

/// <summary>
/// Gets the current status.
/// </summary>
public Scp1344Status Scp1344StatusOld { get; }

/// <summary>
/// Gets or sets the new state.
/// </summary>
public Scp1344Status Scp1344StatusNew { get; set; }

/// <summary>
/// Gets the item.
/// </summary>
public Item Item { get; }

/// <summary>
/// Gets the player in owner of the item.
/// </summary>
public Exiled.API.Features.Player Player { get; }

/// <summary>
/// Gets Scp1344 item.
/// </summary>
public Scp1344 Scp1344 { get; }

/// <inheritdoc/>
public bool IsAllowed { get; set; }
}
}
44 changes: 44 additions & 0 deletions EXILED/Exiled.Events/EventArgs/Scp1344/DeactivatedEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// -----------------------------------------------------------------------
// <copyright file="DeactivatedEventArgs.cs" company="ExMod Team">
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.Events.EventArgs.Scp1344
{
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;

/// <summary>
/// Contains all information after deactivating.
/// </summary>
public class DeactivatedEventArgs : IPlayerEvent, IScp1344Event
{
/// <summary>
/// Initializes a new instance of the <see cref="DeactivatedEventArgs" /> class.
/// </summary>
/// <param name="item"><inheritdoc cref="Item"/></param>
public DeactivatedEventArgs(Item item)
{
Item = item;
Scp1344 = item as Scp1344;
Player = item.Owner;
}

/// <summary>
/// Gets the item.
/// </summary>
public Item Item { get; }

/// <summary>
/// Gets the player in owner of the item.
/// </summary>
public Exiled.API.Features.Player Player { get; }

/// <summary>
/// Gets Scp1344 item.
/// </summary>
public Scp1344 Scp1344 { get; }
}
}
49 changes: 49 additions & 0 deletions EXILED/Exiled.Events/EventArgs/Scp1344/DeactivatingEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// -----------------------------------------------------------------------
// <copyright file="DeactivatingEventArgs.cs" company="ExMod Team">
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.Events.EventArgs.Scp1344
{
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;

/// <summary>
/// Contains all information before deactivating.
/// </summary>
public class DeactivatingEventArgs : IPlayerEvent, IScp1344Event, IDeniableEvent
{
/// <summary>
/// Initializes a new instance of the <see cref="DeactivatingEventArgs" /> class.
/// </summary>
/// <param name="item"><inheritdoc cref="Item"/></param>
/// <param name="isAllowed"><inheritdoc cref="IsAllowed"/></param>
public DeactivatingEventArgs(Item item, bool isAllowed = true)
{
Item = item;
Scp1344 = item as Scp1344;
Player = item.Owner;
IsAllowed = isAllowed;
}

/// <summary>
/// Gets the item.
/// </summary>
public Item Item { get; }

/// <summary>
/// Gets the player in owner of the item.
/// </summary>
public Exiled.API.Features.Player Player { get; }

/// <summary>
/// Gets Scp1344 item.
/// </summary>
public Scp1344 Scp1344 { get; }

/// <inheritdoc/>
public bool IsAllowed { get; set; }
}
}
Loading