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
5 changes: 5 additions & 0 deletions .idea/.idea.SillySCP/.idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using SecretAPI.Features.UserSettings;
using SillySCP.API.Modules;

namespace SillySCP.API.Features
namespace SillySCP.API.Settings
{
public class ExclusiveColorSetting : CustomDropdownSetting
{
Expand Down
22 changes: 22 additions & 0 deletions SillySCP/API/Settings/JailbirdSetting.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using LabApi.Features.Wrappers;
using SecretAPI.Features.UserSettings;
using SillySCP.API.Modules;

namespace SillySCP.API.Settings
{
public class JailbirdSetting : CustomTwoButtonSetting
{
public const int SettingId = 837;

public JailbirdSetting()
: base(SettingId, "Meow on Jailbird swing", "Yes", "No", hint: "When you or someone else swings the jailbird, should you hear the meow?")
{}

protected override CustomSetting CreateDuplicate() => new JailbirdSetting();

public override CustomHeader Header { get; } = SSSSModule.Header;

protected override void HandleSettingUpdate(Player player)
{}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using Player = LabApi.Features.Wrappers.Player;
using Scp3114Role = Exiled.API.Features.Roles.Scp3114Role;

namespace SillySCP.API.Features
namespace SillySCP.API.Settings
{
public class StruggleSetting : CustomKeybindSetting
{
Expand Down
52 changes: 49 additions & 3 deletions SillySCP/Handlers/SSSSHandler.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
using Exiled.Events.EventArgs.Player;
using Exiled.API.Enums;
using Exiled.API.Extensions;
using Exiled.API.Features;
using Exiled.Events.EventArgs.Item;
using Exiled.Events.EventArgs.Player;
using PlayerRoles.PlayableScps.Scp079.Cameras;
using SecretAPI.Features.UserSettings;
using SillySCP.API.Features;
using SillySCP.API.Interfaces;
using SillySCP.API.Modules;
using SillySCP.API.Settings;
using UnityEngine;
using UserSettings.ServerSpecific;
using Camera = Exiled.API.Features.Camera;

namespace SillySCP.Handlers
{
Expand All @@ -14,12 +21,51 @@ public void Init()
Exiled.Events.Handlers.Player.Verified += OnVerified;
ServerSpecificSettingsSync.ServerOnSettingValueReceived += SettingRecieved;

CustomSetting.Register(new ExclusiveColorSetting(), new StruggleSetting());
CustomSetting.Register(new ExclusiveColorSetting(), new StruggleSetting(), new JailbirdSetting());

// jailbird handler

Exiled.Events.Handlers.Item.Swinging += OnJailbirdSwing;

string sillyAudiosLocation = Path.Combine(Paths.Configs, "Silly Audios");

AudioClipStorage.LoadClip(Path.Combine(sillyAudiosLocation, "kali 1.ogg"), "meow 1");
AudioClipStorage.LoadClip(Path.Combine(sillyAudiosLocation, "kali 2.ogg"), "meow 2");
AudioClipStorage.LoadClip(Path.Combine(sillyAudiosLocation, "cyn 1.ogg"), "meow 3");
AudioClipStorage.LoadClip(Path.Combine(sillyAudiosLocation, "cyn 2.ogg"), "meow 4");
}

public void Unregister()
{
Exiled.Events.Handlers.Player.Verified -= OnVerified;

Exiled.Events.Handlers.Item.Swinging -= OnJailbirdSwing;
}

private void OnJailbirdEvent(Exiled.API.Features.Player player)
{
AudioPlayer audioPlayer = AudioPlayer.CreateOrGet($"Jailbird {player.Nickname}",
condition: hub =>
{
LabApi.Features.Wrappers.Player plr = LabApi.Features.Wrappers.Player.Get(hub);
if (plr == null) return true;
JailbirdSetting setting = CustomSetting.GetPlayerSetting<JailbirdSetting>(JailbirdSetting.SettingId, plr);
return setting == null || setting.IsOptionA;
},
onIntialCreation: p =>
{
p.transform.parent = player.Transform;
Speaker speaker = p.AddSpeaker("Jailbird Speaker", isSpatial: true, minDistance: 5f, maxDistance: 15f);
speaker.transform.parent = player.Transform;
speaker.transform.localPosition = Vector3.zero;
}
);
audioPlayer.AddClip(AudioClipStorage.AudioClips.Values.GetRandomValue(data => data.Name.Contains("meow")).Name, 3);
}

private void OnJailbirdSwing(SwingingEventArgs ev)
{
OnJailbirdEvent(ev.Player);
}

private void OnVerified(VerifiedEventArgs ev)
Expand Down
2 changes: 1 addition & 1 deletion SillySCP/Patches/RueISendHint.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using HarmonyLib;
using Hints;
using RueI;
using SillySCP.API.Features;
using SillySCP.API.Settings;

namespace SillySCP.Patches
{
Expand Down
1 change: 1 addition & 0 deletions SillySCP/Patches/SkeletonDamageStrangle.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using HarmonyLib;
using PlayerRoles.PlayableScps.Scp3114;
using SillySCP.API.Features;
using SillySCP.API.Settings;

namespace SillySCP.Patches
{
Expand Down
9 changes: 2 additions & 7 deletions SillySCP/Patches/SkeletonStrangle.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
using CustomPlayerEffects;
using Exiled.API.Features;
using HarmonyLib;
using HarmonyLib;
using LabApi.Features.Wrappers;
using PlayerRoles.PlayableScps.Scp3114;
using PlayerRoles.Subroutines;
using RueI.Elements;
using SecretAPI.Features.UserSettings;
using SillySCP.API.Features;
using Utils.NonAllocLINQ;
using SillySCP.API.Settings;
using Player = LabApi.Features.Wrappers.Player;

namespace SillySCP.Patches
Expand Down
1 change: 0 additions & 1 deletion SillySCP/Patches/SnakePatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using InventorySystem.Items.Keycards.Snake;
using static HarmonyLib.AccessTools;
using MEC;
using Mirror;

namespace SillySCP.Patches
{
Expand Down
7 changes: 6 additions & 1 deletion SillySCP/SillySCP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,20 @@
<DebugType>embedded</DebugType>
</PropertyGroup>
<ItemGroup>
<!-- All can be got from Exiled references: https://exslmod-team.github.io/SL-References/Dev.zip -->
<Reference Include="Assembly-CSharp-firstpass" HintPath="$(EXILED_REFERENCES)\Assembly-CSharp-firstpass.dll" Private="false" />
<Reference Include="Pooling" HintPath="$(EXILED_REFERENCES)\Pooling.dll" Private="false" />
<Reference Include="Mirror" HintPath="$(EXILED_REFERENCES)\Mirror.dll" Private="false" />
<Reference Include="Snake" HintPath="$(EXILED_REFERENCES)\Snake.dll" Private="false" />
<Reference Include="UnityEngine" HintPath="$(EXILED_REFERENCES)\UnityEngine.dll" Private="false" />
<Reference Include="UnityEngine.CoreModule" HintPath="$(EXILED_REFERENCES)\UnityEngine.CoreModule.dll" Private="false" />
<Reference Include="UnityEngine.PhysicsModule" HintPath="$(EXILED_REFERENCES)\UnityEngine.PhysicsModule.dll" Private="false" />
<Reference Include="SecretAPI" HintPath="$(EXILED_REFERENCES)\SecretAPI.dll" Private="false" />
<Reference Include="LabApi" HintPath="$(EXILED_REFERENCES)\LabApi.dll" Private="false" />

<!-- Can be got from: https://github.com/Misfiy/SecretAPI -->
<Reference Include="SecretAPI" HintPath="$(EXILED_REFERENCES)\SecretAPI.dll" Private="false" />
<!-- Can be got from: https://github.com/Killers0992/AudioPlayerApi -->
<Reference Include="AudioPlayerApi" HintPath="$(EXILED_REFERENCES)\AudioPlayerApi.dll" Private="false" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Costura.Fody" Version="6.0.0-beta0000" PrivateAssets="All" />
Expand Down
Loading