Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

CursedDecontamination, CursedVoiceChat & CursedVoicePlayBack #16

Merged
merged 3 commits into from
Jan 24, 2023
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
3 changes: 3 additions & 0 deletions CursedMod/CursedMod.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<Compile Include="Features\Wrappers\AdminToys\CursedShootingTarget.cs" />
<Compile Include="Features\Wrappers\CursedPrefabManager.cs" />
<Compile Include="Features\Wrappers\Facility\CursedCassie.cs" />
<Compile Include="Features\Wrappers\Facility\CursedDecontamination.cs" />
<Compile Include="Features\Wrappers\Facility\CursedFacility.cs" />
<Compile Include="Features\Wrappers\Facility\CursedWarhead.cs" />
<Compile Include="Features\Wrappers\Facility\Doors\CursedAirlockController.cs" />
Expand Down Expand Up @@ -121,6 +122,8 @@
<Compile Include="Features\Wrappers\Player\Dummies\FakeConnection.cs" />
<Compile Include="Features\Wrappers\Player\RagDolls\CursedRagDoll.cs" />
<Compile Include="Features\Wrappers\Player\Roles\CursedRoleManager.cs" />
<Compile Include="Features\Wrappers\Player\VoiceChat\CursedVoiceChat.cs" />
<Compile Include="Features\Wrappers\Player\VoiceChat\CursedVoicePlayback.cs" />
<Compile Include="Features\Wrappers\Round\CursedRound.cs" />
<Compile Include="Features\Wrappers\Server\CursedServer.cs" />
<Compile Include="Loader\Configurations\CursedModConfiguration.cs" />
Expand Down
35 changes: 35 additions & 0 deletions CursedMod/Features/Wrappers/Facility/CursedDecontamination.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using LightContainmentZoneDecontamination;
using PhaseFunction = LightContainmentZoneDecontamination.DecontaminationController.DecontaminationPhase.PhaseFunction;
using DecontaminationStatus = LightContainmentZoneDecontamination.DecontaminationController.DecontaminationStatus;

namespace CursedMod.Features.Wrappers.Facility;

public class CursedDecontamination
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static

{
public DecontaminationController DecontaminationController { get; }

public CursedDecontamination(DecontaminationController decontaminationController)
{
DecontaminationController = decontaminationController;
}

public double StartTime
{
get => DecontaminationController.NetworkRoundStartTime;
set => DecontaminationController.NetworkRoundStartTime = value;
}

public bool IsDecontaminating => DecontaminationController.IsDecontaminating;

public bool IsAnnouncementHearable => DecontaminationController.IsAnnouncementHearable;

public PhaseFunction CurrentFunction => DecontaminationController.Singleton._curFunction;

public DecontaminationStatus Status => DecontaminationController.Singleton.DecontaminationOverride;

public void StopDecontamination() => DecontaminationController.NetworkRoundStartTime = -1f;

public void StartDecontamination() => DecontaminationController.NetworkRoundStartTime = 1f;

public void SetStatus(DecontaminationStatus status) => DecontaminationController.Singleton.DecontaminationOverride = status;
}
4 changes: 4 additions & 0 deletions CursedMod/Features/Wrappers/Facility/Rooms/CursedRoom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ public CursedRoom(RoomIdentifier room)

public Quaternion Rotation => Room.transform.rotation;

public GameObject GameObject => Room.gameObject;

public Transform Transform => Room.transform;

public RoomName Name => Room.Name;

public FacilityZone Zone => Room.Zone;
Expand Down
30 changes: 30 additions & 0 deletions CursedMod/Features/Wrappers/Player/VoiceChat/CursedVoiceChat.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using PlayerRoles.Voice;
using VoiceChat;

namespace CursedMod.Features.Wrappers.Player.VoiceChat;

public class CursedVoiceChat
{
public VoiceModuleBase VoiceModule { get; }

public CursedVoiceChat(VoiceModuleBase voiceModule)
{
VoiceModule = voiceModule;
}

public VoiceChatChannel LastChannel => VoiceModule._lastChannel;

public VoiceChatChannel CurrentChannel
{
get => VoiceModule.CurrentChannel;
set => VoiceModule.CurrentChannel = value;
}

public bool IsSpeaking => VoiceModule.IsSpeaking;

public void CheckRateLimit() => VoiceModule.CheckRateLimit();

public void ValidateReceive(ReferenceHub refHub, VoiceChatChannel channel) => VoiceModule.ValidateReceive(refHub, channel);

public void ValidateSend(VoiceChatChannel channel) => VoiceModule.ValidateSend(channel);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using VoiceChat.Playbacks;

namespace CursedMod.Features.Wrappers.Player.VoiceChat;

public class CursedVoicePlayback
{
public VoiceChatPlaybackBase VoiceChatPlayback { get; }

public CursedVoicePlayback(VoiceChatPlaybackBase voiceChatPlayback)
{
VoiceChatPlayback = voiceChatPlayback;
}

public float Loudness
{
get => VoiceChatPlayback.Loudness;
set => VoiceChatPlayback.Loudness = value;
}

public float VolumeScale
{
get => VoiceChatPlayback.VolumeScale;
set => VoiceChatPlayback.VolumeScale = value;
}
}