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

[Exiled::API] Adding new properties for FpcRole #65

Merged
merged 4 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
42 changes: 39 additions & 3 deletions EXILED/Exiled.API/Features/Roles/FpcRole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ namespace Exiled.API.Features.Roles
using System.Reflection;

using Exiled.API.Features.Pools;

using HarmonyLib;
using PlayerRoles;
using PlayerRoles.FirstPersonControl;

using PlayerRoles.Spectating;
using PlayerRoles.Visibility;
using PlayerRoles.Voice;
using PlayerStatsSystem;
using RelativePositioning;

using UnityEngine;

/// <summary>
Expand Down Expand Up @@ -243,6 +243,42 @@ public bool IsNoclipEnabled
set => Owner.ReferenceHub.playerStats.GetModule<AdminFlagsStat>().SetFlag(AdminFlags.Noclip, value);
}

/// <summary>
/// Gets or sets <see cref="API.Features.Ragdoll"/> for this role.
/// </summary>
public Ragdoll Ragdoll
{
get => Ragdoll.Get(FirstPersonController.Ragdoll);
set => FirstPersonController.Ragdoll = value.Base;
}
VALERA771 marked this conversation as resolved.
Show resolved Hide resolved

/// <summary>
/// Gets or sets voice module for this role.
/// </summary>
public VoiceModuleBase VoiceModule
{
get => FirstPersonController.VoiceModule;
set => FirstPersonController.VoiceModule = value;
}
VALERA771 marked this conversation as resolved.
Show resolved Hide resolved

/// <summary>
/// Gets or sets <see cref="VisibilityController"/> for this role.
/// </summary>
public VisibilityController VisibilityController
{
get => FirstPersonController.VisibilityController;
set => FirstPersonController.VisibilityController = value;
}

/// <summary>
/// Gets or sets <see cref="SpectatableModuleBase"/> for this role.
/// </summary>
public SpectatableModuleBase SpectatableModuleBase
{
get => FirstPersonController.SpectatorModule;
set => FirstPersonController.SpectatorModule = value;
}

/// <summary>
/// Resets the <see cref="Player"/>'s stamina.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion EXILED/Exiled.API/Features/Roles/Scp3114Role.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public RoleTypeId StolenRole
/// <summary>
/// Gets or sets the SCP-3114's Ragdoll used for it's FakeIdentity.
/// </summary>
public Ragdoll Ragdoll
public new Ragdoll Ragdoll
VALERA771 marked this conversation as resolved.
Show resolved Hide resolved
{
get => Ragdoll.Get(Identity.CurIdentity.Ragdoll);
set
Expand Down
Loading