Skip to content

Commit

Permalink
Merge branch 'dev' into scp194
Browse files Browse the repository at this point in the history
  • Loading branch information
Misaka-ZeroTwo authored Dec 11, 2023
2 parents f3a51e3 + 87f5418 commit cf1d701
Show file tree
Hide file tree
Showing 349 changed files with 2,480 additions and 1,974 deletions.
13 changes: 13 additions & 0 deletions Exiled.API/Features/Items/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,19 @@ public virtual Pickup CreatePickup(Vector3 position, Quaternion rotation = defau
/// <returns>A string containing Item-related data.</returns>
public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}* ={Owner}=";

/// <summary>
/// Changes the owner of the <see cref="Item"/>.
/// </summary>
/// <param name="oldOwner">Old <see cref="Item"/> owner.</param>
/// <param name="newOwner">New <see cref="Item"/> owner.</param>
public void ChangeItemOwner(Player oldOwner, Player newOwner)
{
if (oldOwner != null && newOwner != null)
{
ChangeOwner(oldOwner, newOwner);
}
}

/// <summary>
/// Change the owner of the <see cref="Item"/>.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions Exiled.API/Features/Log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ public static void Send(string message, Discord.LogLevel level, ConsoleColor col
/// Sends an <see cref="Error(object)"/> with the provided message if the condition is false and stops the execution.
/// <example> For example:
/// <code>
/// Player ply = Player.Get(2);
/// Log.Assert(ply is not null, "The player with the id 2 is null");
/// Player ply = Player.Get(2);
/// Log.Assert(ply is not null, "The player with the id 2 is null");
/// </code>
/// results in it logging an error if the player is null and not continuing.
/// </example>
Expand Down
14 changes: 12 additions & 2 deletions Exiled.API/Features/Room.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,19 @@ public static Room FindParentRoom(GameObject objectInRoom)
/// <summary>
/// Flickers the room's lights off for a duration.
/// </summary>
/// <param name="duration">Duration in seconds.</param>
public void TurnOffLights(float duration)
/// <param name="duration">Duration in seconds, or -1 for an indefinite duration.</param>
public void TurnOffLights(float duration = -1)
{
if (duration == -1)
{
foreach (RoomLightController light in RoomLightControllers)
{
light.SetLights(false);
}

return;
}

foreach (RoomLightController light in RoomLightControllers)
{
light.ServerFlickerLights(duration);
Expand Down
5 changes: 5 additions & 0 deletions Exiled.API/Features/Scp914.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ public static Scp914Mode ConfigMode
/// </summary>
public static Vector3 OutputPosition => Scp914Controller.OutputChamber.localPosition;

/// <summary>
/// Gets the position offset in which item is moving.
/// </summary>
public static Vector3 MovingVector => OutputPosition - IntakePosition;

/// <summary>
/// Gets a value indicating whether SCP-914 is active and currently processing items.
/// </summary>
Expand Down
4 changes: 1 addition & 3 deletions Exiled.API/Structs/ArmorAmmoLimit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ public static implicit operator ArmorAmmoLimit(BodyArmor.ArmorAmmoLimit armorLim
/// Converts a <see cref="ArmorAmmoLimit"/> to its appropriate base game <see cref="BodyArmor.ArmorAmmoLimit"/>.
/// </summary>
/// <param name="armorLimit">armor limit.</param>
public static explicit operator BodyArmor.ArmorAmmoLimit(ArmorAmmoLimit armorLimit) =>
new()
{ AmmoType = armorLimit.AmmoType.GetItemType(), Limit = armorLimit.Limit };
public static explicit operator BodyArmor.ArmorAmmoLimit(ArmorAmmoLimit armorLimit) => new() { AmmoType = armorLimit.AmmoType.GetItemType(), Limit = armorLimit.Limit };
}
}
118 changes: 59 additions & 59 deletions Exiled.API/Structs/PrimitiveSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,64 @@
// Copyright (c) Exiled Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Structs
{
using UnityEngine;
// -----------------------------------------------------------------------

namespace Exiled.API.Structs
{
using UnityEngine;

/// <summary>
/// Settings for primitives.
/// </summary>
public struct PrimitiveSettings
{
/// <summary>
/// Initializes a new instance of the <see cref="PrimitiveSettings"/> struct.
/// </summary>
/// <param name="primitiveType">The type of the primitive.</param>
/// <param name="color">The color of the primitive.</param>
/// <param name="position">The position of the primitive.</param>
/// <param name="rotation">The rotation of the primitive.</param>
/// <param name="scale">The scale of the primitive.</param>
/// <param name="spawn">Whether or not the primitive should be spawned.</param>
public PrimitiveSettings(PrimitiveType primitiveType, Color color, Vector3 position, Vector3 rotation, Vector3 scale, bool spawn)
{
PrimitiveType = primitiveType;
Color = color;
Position = position;
Rotation = rotation;
Scale = scale;
Spawn = spawn;
}

/// <summary>
/// Gets the primitive type.
/// </summary>
public PrimitiveType PrimitiveType { get; }

/// <summary>
/// Gets the primitive color.
/// </summary>
public Color Color { get; }

/// <summary>
/// Gets the primitive position.
/// </summary>
public Vector3 Position { get; }

/// <summary>
/// Gets the primitive rotation.
/// </summary>
public Vector3 Rotation { get; }

/// <summary>
/// Gets the primitive scale.
/// </summary>
public Vector3 Scale { get; }

/// <summary>
/// Settings for primitives.
/// </summary>
public struct PrimitiveSettings
{
/// <summary>
/// Initializes a new instance of the <see cref="PrimitiveSettings"/> struct.
/// </summary>
/// <param name="primitiveType">The type of the primitive.</param>
/// <param name="color">The color of the primitive.</param>
/// <param name="position">The position of the primitive.</param>
/// <param name="rotation">The rotation of the primitive.</param>
/// <param name="scale">The scale of the primitive.</param>
/// <param name="spawn">Whether or not the primitive should be spawned.</param>
public PrimitiveSettings(PrimitiveType primitiveType, Color color, Vector3 position, Vector3 rotation, Vector3 scale, bool spawn)
{
PrimitiveType = primitiveType;
Color = color;
Position = position;
Rotation = rotation;
Scale = scale;
Spawn = spawn;
}

/// <summary>
/// Gets the primitive type.
/// </summary>
public PrimitiveType PrimitiveType { get; }

/// <summary>
/// Gets the primitive color.
/// </summary>
public Color Color { get; }

/// <summary>
/// Gets the primitive position.
/// </summary>
public Vector3 Position { get; }

/// <summary>
/// Gets the primitive rotation.
/// </summary>
public Vector3 Rotation { get; }

/// <summary>
/// Gets the primitive scale.
/// </summary>
public Vector3 Scale { get; }

/// <summary>
/// Gets a value indicating whether or not the primitive should be spawned.
/// </summary>
public bool Spawn { get; }
}
/// <summary>
/// Gets a value indicating whether or not the primitive should be spawned.
/// </summary>
public bool Spawn { get; }
}
}
18 changes: 9 additions & 9 deletions Exiled.Events/EventArgs/Cassie/SendingCassieMessageEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ namespace Exiled.Events.EventArgs.Cassie
using Interfaces;

/// <summary>
/// Contains all the information after sending a C.A.S.S.I.E. message.
/// Contains all the information after sending a C.A.S.S.I.E. message.
/// </summary>
public class SendingCassieMessageEventArgs : IDeniableEvent
{
/// <summary>
/// Initializes a new instance of the <see cref="SendingCassieMessageEventArgs" /> class.
/// Initializes a new instance of the <see cref="SendingCassieMessageEventArgs" /> class.
/// </summary>
/// <param name="words">
/// <inheritdoc cref="Words" />
/// <inheritdoc cref="Words" />
/// </param>
/// <param name="makeHold">
/// <inheritdoc cref="MakeHold" />
/// <inheritdoc cref="MakeHold" />
/// </param>
/// <param name="makeNoise">
/// <inheritdoc cref="MakeNoise" />
/// <inheritdoc cref="MakeNoise" />
/// </param>
/// <param name="isAllowed">Indicates whether the event can be executed or not.</param>
public SendingCassieMessageEventArgs(string words, bool makeHold, bool makeNoise, bool isAllowed = true)
Expand All @@ -36,22 +36,22 @@ public SendingCassieMessageEventArgs(string words, bool makeHold, bool makeNoise
}

/// <summary>
/// Gets or sets the message.
/// Gets or sets the message.
/// </summary>
public string Words { get; set; }

/// <summary>
/// Gets or sets a value indicating whether or not the message should be held.
/// Gets or sets a value indicating whether or not the message should be held.
/// </summary>
public bool MakeHold { get; set; }

/// <summary>
/// Gets or sets a value indicating whether or not the message should make noise.
/// Gets or sets a value indicating whether or not the message should make noise.
/// </summary>
public bool MakeNoise { get; set; }

/// <summary>
/// Gets or sets a value indicating whether or not the message can be sent.
/// Gets or sets a value indicating whether or not the message can be sent.
/// </summary>
public bool IsAllowed { get; set; }
}
Expand Down
6 changes: 3 additions & 3 deletions Exiled.Events/EventArgs/Interfaces/IAttackerEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ namespace Exiled.Events.EventArgs.Interfaces
using API.Features.DamageHandlers;

/// <summary>
/// Event args for when a player is taking damage.
/// Event args for when a player is taking damage.
/// </summary>
public interface IAttackerEvent : IPlayerEvent
{
/// <summary>
/// Gets the attacker <see cref="Player" />.
/// Gets the attacker <see cref="Player" />.
/// </summary>
public Player Attacker { get; }

/// <summary>
/// Gets or sets the <see cref="DamageHandlerBase" /> managing the damage to the target.
/// Gets or sets the <see cref="DamageHandlerBase" /> managing the damage to the target.
/// </summary>
public CustomDamageHandler DamageHandler { get; set; }
}
Expand Down
4 changes: 2 additions & 2 deletions Exiled.Events/EventArgs/Interfaces/ICameraEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ namespace Exiled.Events.EventArgs.Interfaces
using API.Features;

/// <summary>
/// Event args used for all <see cref="API.Features.Camera" /> related events.
/// Event args used for all <see cref="API.Features.Camera" /> related events.
/// </summary>
public interface ICameraEvent : IExiledEvent
{
/// <summary>
/// Gets or sets the <see cref="API.Features.Camera" /> triggering the event.
/// Gets or sets the <see cref="API.Features.Camera" /> triggering the event.
/// </summary>
public Camera Camera { get; set; }
}
Expand Down
4 changes: 2 additions & 2 deletions Exiled.Events/EventArgs/Interfaces/IDeniableEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
namespace Exiled.Events.EventArgs.Interfaces
{
/// <summary>
/// Event args for events that can be allowed or denied.
/// Event args for events that can be allowed or denied.
/// </summary>
public interface IDeniableEvent : IExiledEvent
{
/// <summary>
/// Gets or sets a value indicating whether or not the event is allowed to continue.
/// Gets or sets a value indicating whether or not the event is allowed to continue.
/// </summary>
public bool IsAllowed { get; set; }
}
Expand Down
4 changes: 2 additions & 2 deletions Exiled.Events/EventArgs/Interfaces/IDoorEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ namespace Exiled.Events.EventArgs.Interfaces
using Exiled.API.Features.Doors;

/// <summary>
/// Event args used for all <see cref="API.Features.Doors.Door" /> related events.
/// Event args used for all <see cref="API.Features.Doors.Door" /> related events.
/// </summary>
public interface IDoorEvent : IExiledEvent
{
/// <summary>
/// Gets the <see cref="API.Features.Doors.Door" /> triggering the event.
/// Gets the <see cref="API.Features.Doors.Door" /> triggering the event.
/// </summary>
public Door Door { get; }
}
Expand Down
2 changes: 1 addition & 1 deletion Exiled.Events/EventArgs/Interfaces/IExiledEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace Exiled.Events.EventArgs.Interfaces
{
/// <summary>
/// The base Exiled Event Args interface to be used by all other event arg interfaces/classes.
/// The base Exiled Event Args interface to be used by all other event arg interfaces/classes.
/// </summary>
public interface IExiledEvent
{
Expand Down
4 changes: 2 additions & 2 deletions Exiled.Events/EventArgs/Interfaces/IFirearmEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ namespace Exiled.Events.EventArgs.Interfaces
using API.Features.Items;

/// <summary>
/// Event args used for all <see cref="API.Features.Items.Firearm" /> related events.
/// Event args used for all <see cref="API.Features.Items.Firearm" /> related events.
/// </summary>
public interface IFirearmEvent : IItemEvent
{
/// <summary>
/// Gets the <see cref="API.Features.Items.Firearm" /> triggering the event.
/// Gets the <see cref="API.Features.Items.Firearm" /> triggering the event.
/// </summary>
public Firearm Firearm { get; }
}
Expand Down
4 changes: 2 additions & 2 deletions Exiled.Events/EventArgs/Interfaces/IGeneratorEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ namespace Exiled.Events.EventArgs.Interfaces
using API.Features;

/// <summary>
/// Event args used for all <see cref="API.Features.Generator" /> related events.
/// Event args used for all <see cref="API.Features.Generator" /> related events.
/// </summary>
public interface IGeneratorEvent : IExiledEvent
{
/// <summary>
/// Gets the <see cref="API.Features.Generator" /> triggering the event.
/// Gets the <see cref="API.Features.Generator" /> triggering the event.
/// </summary>
public Generator Generator { get; }
}
Expand Down
4 changes: 2 additions & 2 deletions Exiled.Events/EventArgs/Interfaces/IItemEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ namespace Exiled.Events.EventArgs.Interfaces
using API.Features.Items;

/// <summary>
/// Event args used for all <see cref="API.Features.Items.Item" /> related events.
/// Event args used for all <see cref="API.Features.Items.Item" /> related events.
/// </summary>
public interface IItemEvent : IExiledEvent
{
/// <summary>
/// Gets the <see cref="API.Features.Items.Item" /> triggering the event.
/// Gets the <see cref="API.Features.Items.Item" /> triggering the event.
/// </summary>
public Item Item { get; }
}
Expand Down
4 changes: 2 additions & 2 deletions Exiled.Events/EventArgs/Interfaces/IPickupEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ namespace Exiled.Events.EventArgs.Interfaces
using Exiled.API.Features.Pickups;

/// <summary>
/// Event args used for all <see cref="API.Features.Pickups.Pickup" /> related events.
/// Event args used for all <see cref="API.Features.Pickups.Pickup" /> related events.
/// </summary>
public interface IPickupEvent : IExiledEvent
{
/// <summary>
/// Gets the <see cref="API.Features.Pickups.Pickup" /> triggering the event.
/// Gets the <see cref="API.Features.Pickups.Pickup" /> triggering the event.
/// </summary>
public Pickup Pickup { get; }
}
Expand Down
Loading

0 comments on commit cf1d701

Please sign in to comment.