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
1 change: 1 addition & 0 deletions EXILED/Exiled.API/Exiled.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<Reference Include="Snake" HintPath="$(EXILED_REFERENCES)\Snake.dll" Private="false" />
<Reference Include="Unity.TextMeshPro" HintPath="$(EXILED_REFERENCES)\Unity.TextMeshPro.dll" Private="false" />
<Reference Include="UnityEngine" HintPath="$(EXILED_REFERENCES)\UnityEngine.dll" Private="false" />
<Reference Include="UnityEngine.AnimationModule" HintPath="$(EXILED_REFERENCES)\UnityEngine.AnimationModule.dll" Private="false" />
<Reference Include="UnityEngine.CoreModule" HintPath="$(EXILED_REFERENCES)\UnityEngine.CoreModule.dll" Private="false" />
<Reference Include="UnityEngine.ParticleSystemModule" HintPath="$(EXILED_REFERENCES)\UnityEngine.ParticleSystemModule.dll" Private="false" />
<Reference Include="UnityEngine.PhysicsModule" HintPath="$(EXILED_REFERENCES)\UnityEngine.PhysicsModule.dll" Private="false" />
Expand Down
24 changes: 24 additions & 0 deletions EXILED/Exiled.API/Features/Roles/FpcRole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,30 @@ public BasicRagdoll Ragdoll
/// </summary>
public SpectatableModuleBase SpectatableModuleBase => FirstPersonController.SpectatorModule;

/// <summary>
/// Tries to get the <see cref="Transform"/> of a specified <see cref="HumanBodyBones"/> bone.
/// </summary>
/// <param name="bone">The bone to get the <see cref="Transform"/> of.</param>
/// <param name="boneTransform">
/// When this method returns, contains the <see cref="Transform"/> of the specified bone, if found;
/// otherwise, <c>null</c>.
/// </param>
/// <returns><c>true</c> if the bone transform was found; otherwise, <c>false</c>.</returns>
public bool TryGetBoneTransform(HumanBodyBones bone, out Transform boneTransform)
{
boneTransform = null;

if (Model is not AnimatedCharacterModel animatedModel)
return false;

Animator animator = animatedModel.Animator;
if (animator == null || animator.avatar == null || !animator.avatar.isValid || !animator.avatar.isHuman)
return false;

boneTransform = animator.GetBoneTransform(bone);
return boneTransform != null;
}

/// <summary>
/// Resets the <see cref="Player"/>'s stamina.
/// </summary>
Expand Down
18 changes: 17 additions & 1 deletion EXILED/Exiled.API/Features/Roles/Scp096Role.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ namespace Exiled.API.Features.Roles
using PlayerRoles.PlayableScps.Scp096;
using PlayerRoles.Subroutines;

using UnityEngine;

using Scp096GameRole = PlayerRoles.PlayableScps.Scp096.Scp096Role;

/// <summary>
Expand Down Expand Up @@ -139,6 +141,20 @@ internal Scp096Role(Scp096GameRole baseRole)
/// </summary>
public bool AttackPossible => AttackAbility.AttackPossible;

/// <summary>
/// Gets the head transform of SCP-096's character model.
/// </summary>
public Transform HeadTransform
{
get
{
if (Model is not Scp096CharacterModel scp96AnimatedCharacterModel)
return null;

return scp96AnimatedCharacterModel.Head;
}
}

/// <summary>
/// Gets or sets the Charge Ability Cooldown.
/// </summary>
Expand Down Expand Up @@ -306,4 +322,4 @@ public void Charge(float cooldown = 1f)
/// <returns>The Spawn Chance.</returns>
public float GetSpawnChance(List<RoleTypeId> alreadySpawned) => Base.GetSpawnChance(alreadySpawned);
}
}
}
Loading