Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New events for SCP-049, SCP-049-2 and Player #211

Open
wants to merge 1 commit into
base: 13.1
Choose a base branch
from
Open
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
46 changes: 46 additions & 0 deletions NwPluginAPI/Enums/ServerEventType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ namespace PluginAPI.Enums
using Interactables.Interobjects.DoorUtils;
using Interactables.Interobjects;
using Scp914;
using Hazards;
using PlayerRoles.PlayableScps.Scp049;

/// <summary>
/// Represents server event types.
Expand Down Expand Up @@ -1087,5 +1089,49 @@ public enum ServerEventType : int
/// Parameters: <see cref="IPlayer"/> player, <see cref="ItemType"/> type. <see cref="int"/> amount.
/// </remarks>
PlayerDroppedAmmo = 131,

/// <summary>
/// Executed when player enters a <see cref="EnvironmentalHazard"/>.
/// </summary>
/// <remarks>
/// Parameters: <see cref="IPlayer"/> player, <see cref="EnvironmentalHazard"/> hazard.
/// </remarks>
PlayerEnterEnvironmentalHazard = 132,

/// <summary>
/// Executed when player stays in an <see cref="EnvironmentalHazard"/>.
/// </summary>
/// <remarks>
/// Parameters: <see cref="IPlayer"/> player, <see cref="EnvironmentalHazard"/> hazard.
/// </remarks>
PlayerStayOnEnvironmentalHazard = 133,

/// <summary>
/// Executed when player exits a <see cref="EnvironmentalHazard"/>.
/// </summary>
/// <remarks>
/// Parameters: <see cref="IPlayer"/> player, <see cref="EnvironmentalHazard"/> hazard.
/// </remarks>
PlayerExitEnvironmentalHazard = 134,

/// <summary>
/// Executed when player consume a corpse as SCP-049-2
/// </summary>
Scp0492ConsumeCorpse = 135,

/// <summary>
/// Executed when a player as SCP-049 mark a player with SenseAbilty.
/// </summary>
Scp049MarkPlayer = 136,

/// <summary>
/// Executed when a player as SCP-049 lose a player with SenseAbility.
/// </summary>
Scp049LosingPlayer = 137,

/// <summary>
/// Executed when a player as SCP-049 use <see cref="Scp049CallAbility"/>
/// </summary>
Scp049CallProgeny = 138
}
}
31 changes: 31 additions & 0 deletions NwPluginAPI/Events/Args/Player/PlayerEnterEnvironmentalHazard.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using PluginAPI.Core.Attributes;
using PluginAPI.Enums;
using Hazards;

namespace PluginAPI.Events.Args.Player
{
public class PlayerEnterEnvironmentalHazard : IEventArguments
{
public ServerEventType BaseType { get; } = ServerEventType.PlayerEnterEnvironmentalHazard;

/// <summary>
/// Gets the player who is entering the enviromental hazard.
/// </summary>
[EventArgument]
public Core.Player Player { get; }

/// <summary>
/// Gets the enviromental hazard which the player is entering.
/// </summary>
[EventArgument]
public EnvironmentalHazard EnvironmentalHazard { get; }

public PlayerEnterEnvironmentalHazard(ReferenceHub hub, EnvironmentalHazard hazard)
{
Player = Core.Player.Get(hub);
EnvironmentalHazard = hazard;
}

PlayerEnterEnvironmentalHazard() { }
}
}
31 changes: 31 additions & 0 deletions NwPluginAPI/Events/Args/Player/PlayerExitEnviromantalHazard.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Hazards;
using PluginAPI.Core.Attributes;
using PluginAPI.Enums;

namespace PluginAPI.Events.Args.Player
{
public class PlayerExitEnviromantalHazard : IEventArguments
{
public ServerEventType BaseType { get; } = ServerEventType.PlayerExitEnvironmentalHazard;

/// <summary>
/// Gets the player who is exiting the enviromental hazard.
/// </summary>
[EventArgument]
public Core.Player Player { get; }

/// <summary>
/// Gets the enviromental hazard which the player is exiting.
/// </summary>
[EventArgument]
public EnvironmentalHazard EnvironmentalHazard { get; }

public PlayerExitEnviromantalHazard(ReferenceHub hub, EnvironmentalHazard hazard)
{
Player = Core.Player.Get(hub);
EnvironmentalHazard = hazard;
}

public PlayerExitEnviromantalHazard() { }
}
}
31 changes: 31 additions & 0 deletions NwPluginAPI/Events/Args/Player/PlayerStayOnEnvironmentalHazard.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Hazards;
using PluginAPI.Core.Attributes;
using PluginAPI.Enums;

namespace PluginAPI.Events.Args.Player
{
public class PlayerStayOnEnvironmentalHazard : IEventArguments
{
public ServerEventType BaseType { get; } = ServerEventType.PlayerStayOnEnvironmentalHazard;

/// <summary>
/// Gets the player who is staying the enviromental hazard.
/// </summary>
[EventArgument]
public Core.Player Player { get; }

/// <summary>
/// Gets the enviromental hazard which the player is staying.
/// </summary>
[EventArgument]
public EnvironmentalHazard EnvironmentalHazard { get; }

public PlayerStayOnEnvironmentalHazard(ReferenceHub hub, EnvironmentalHazard hazard)
{
Player = Core.Player.Get(hub);
EnvironmentalHazard = hazard;
}

public PlayerStayOnEnvironmentalHazard() { }
}
}
35 changes: 35 additions & 0 deletions NwPluginAPI/Events/Args/Scp049/Scp049CallProgeny.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using PluginAPI.Core.Attributes;
using PluginAPI.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PluginAPI.Events.Args.Scp049
{
public class Scp049CallProgeny : IEventArguments
{
public ServerEventType BaseType { get; } = ServerEventType.Scp049CallProgeny;

/// <summary>
/// Gets the player who is playing as SCP-049.
/// </summary>
[EventArgument]
public Core.Player Scp049 { get; }

/// <summary>
/// Gets or set the duration of the ability.
/// </summary>
[EventArgument]
public double Duration { get; set; }

public Scp049CallProgeny(ReferenceHub scp049, double duration)
{
Scp049 = Core.Player.Get(scp049);
Duration = duration;
}

Scp049CallProgeny() { }
}
}
39 changes: 39 additions & 0 deletions NwPluginAPI/Events/Args/Scp049/Scp049LoseMarkedPlayer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using PluginAPI.Core.Attributes;
using PluginAPI.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PluginAPI.Events.Args.Scp049
{
public class Scp049LoseMarkedPlayer : IEventArguments
{
public ServerEventType BaseType { get; } = ServerEventType.Scp049LosingPlayer;

/// <summary>
/// Gets the player who is playing as SCP-049.
/// </summary>
[EventArgument]
public Core.Player Scp049 { get; }

/// <summary>
/// Gets the player who escaped from SCP-049.
/// </summary>
[EventArgument]
public Core.Player Target { get; }

/// <summary>
/// Get or set the cooldown for losing a target.
/// </summary>
[EventArgument]
public double Cooldown { get; set; }

public Scp049LoseMarkedPlayer(ReferenceHub scp049, ReferenceHub target)
{
Scp049 = Core.Player.Get(scp049);
Target = Core.Player.Get(target);
}
}
}
43 changes: 43 additions & 0 deletions NwPluginAPI/Events/Args/Scp049/Scp049MarkPlayer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using Hazards;
using PluginAPI.Core.Attributes;
using PluginAPI.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PluginAPI.Events.Args.Scp049
{
public class Scp049MarkPlayer : IEventArguments
{
public ServerEventType BaseType { get; } = ServerEventType.Scp049MarkPlayer;

/// <summary>
/// Gets the player playing as SCP-049.
/// </summary>
[EventArgument]
public Core.Player Scp049 { get; }

/// <summary>
/// Gets the player marked.
/// </summary>
[EventArgument]
public Core.Player Target { get; }

/// <summary>
/// Get or set mark duration.
/// </summary>
[EventArgument]
public double Duration { get; set; }

public Scp049MarkPlayer(ReferenceHub scp049, ReferenceHub target, double duration)
{
Scp049 = Core.Player.Get(scp049);
Target = Core.Player.Get(target);
Duration = duration;
}

Scp049MarkPlayer() { }
}
}
37 changes: 37 additions & 0 deletions NwPluginAPI/Events/Args/Scp0492/Scp0492ConsumeCorpse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using PluginAPI.Core.Attributes;
using PluginAPI.Enums;

namespace PluginAPI.Events.Args.Scp0492
{
public class Scp0492ConsumeCorpse : IEventArguments
{
public ServerEventType BaseType { get; } = ServerEventType.Scp0492ConsumeCorpse;

/// <summary>
/// Gets the player who is playing as SCP-049-2.
/// </summary>
[EventArgument]
public Core.Player Player { get; }

/// <summary>
/// Gets the corpse consumed.
/// </summary>
[EventArgument]
public BasicRagdoll CorpseConsumed { get; }

/// <summary>
/// Gets or sets the amount of healing for consuming a corpse.
/// </summary>
[EventArgument]
public float Heal { get; set; }

public Scp0492ConsumeCorpse(ReferenceHub zombie, BasicRagdoll corpseConsumed, float healAmount)
{
Player = Core.Player.Get(zombie);
CorpseConsumed = corpseConsumed;
Heal = healAmount;
}

Scp0492ConsumeCorpse() { }
}
}