Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 3 additions & 1 deletion EXILED/Exiled.API/Features/Roles/Role.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace Exiled.API.Features.Roles
using Scp079GameRole = PlayerRoles.PlayableScps.Scp079.Scp079Role;
using Scp096GameRole = PlayerRoles.PlayableScps.Scp096.Scp096Role;
using Scp106GameRole = PlayerRoles.PlayableScps.Scp106.Scp106Role;
using Scp1507GameRole = PlayerRoles.PlayableScps.Scp1507.Scp1507Role;
using Scp173GameRole = PlayerRoles.PlayableScps.Scp173.Scp173Role;
using Scp3114GameRole = PlayerRoles.PlayableScps.Scp3114.Scp3114Role;
using Scp939GameRole = PlayerRoles.PlayableScps.Scp939.Scp939Role;
Expand Down Expand Up @@ -235,7 +236,8 @@ public virtual void Set(RoleTypeId newRole, SpawnReason reason, RoleSpawnFlags s
FilmmakerGameRole filmmakerRole => new FilmMakerRole(filmmakerRole),
NoneGameRole noneRole => new NoneRole(noneRole),
DestroyedGameRole destroyedRole => new DestroyedRole(destroyedRole),
_ => null,
Scp1507GameRole scp1507 => new Scp1507Role(scp1507),
_ => throw new Exception($"Contact Exiled Support Missing Role ({role?.RoleTypeId}) in Exiled.API::Create"),
};
}
}
67 changes: 67 additions & 0 deletions EXILED/Exiled.API/Features/Roles/Scp1507Role.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// -----------------------------------------------------------------------
// <copyright file="Scp1507Role.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.Roles
{
using System.Collections.Generic;

using Exiled.API.Enums;
using Exiled.API.Features.Pools;

using PlayerRoles;
using PlayerRoles.PlayableScps;
using PlayerRoles.PlayableScps.HumeShield;
using PlayerRoles.PlayableScps.Scp939;
using PlayerRoles.PlayableScps.Scp939.Mimicry;
using PlayerRoles.PlayableScps.Scp939.Ripples;
using PlayerRoles.Subroutines;

using RelativePositioning;

using UnityEngine;

using Scp1507GameRole = PlayerRoles.PlayableScps.Scp1507.Scp1507Role;

/// <summary>
/// Defines a role that represents SCP-1507.
/// </summary>
public class Scp1507Role : FpcRole, ISubroutinedScpRole, IHumeShieldRole, ISpawnableScp
{
/// <summary>
/// Initializes a new instance of the <see cref="Scp1507Role"/> class.
/// </summary>
/// <param name="baseRole">the base <see cref="Scp1507GameRole"/>.</param>
internal Scp1507Role(Scp1507GameRole baseRole)
: base(baseRole)
{
Base = baseRole;
SubroutineModule = baseRole.SubroutineModule;
HumeShieldModule = baseRole.HumeShieldModule;
}

/// <inheritdoc/>
public override RoleTypeId Type => Base._roleTypeId;

/// <inheritdoc/>
public SubroutineManagerModule SubroutineModule { get; }

/// <inheritdoc/>
public HumeShieldModuleBase HumeShieldModule { get; }

/// <summary>
/// Gets the <see cref="Scp1507GameRole"/> instance.
/// </summary>
public new Scp1507GameRole Base { get; }

/// <summary>
/// Gets the Spawn Chance of SCP-939.
/// </summary>
/// <param name="alreadySpawned">The List of Roles already spawned.</param>
/// <returns>The Spawn Chance.</returns>
public float GetSpawnChance(List<RoleTypeId> alreadySpawned) => Base is ISpawnableScp spawnableScp ? spawnableScp.GetSpawnChance(alreadySpawned) : 0;
}
}