do a lot ig
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
using CustomPlayerEffects;
|
||||
using LabApi.Events.Arguments.PlayerEvents;
|
||||
using LabApi.Events.Handlers;
|
||||
using LabApi.Features;
|
||||
using LabApi.Loader.Features.Plugins;
|
||||
using MEC;
|
||||
using PlayerRoles;
|
||||
using PlayerRoles.PlayableScps.Scp3114;
|
||||
using Logger = LabApi.Features.Console.Logger;
|
||||
|
||||
namespace SCPBalance;
|
||||
|
||||
public class ScpBalance : Plugin
|
||||
{
|
||||
public override string Name => "SCPBalance";
|
||||
public override string Author => "Code002Lover";
|
||||
public override Version Version { get; } = new(1, 0, 0);
|
||||
public override string Description => "Rethink SCP balance";
|
||||
public override Version RequiredApiVersion { get; } = new(LabApiProperties.CompiledVersion);
|
||||
|
||||
private const string Message = "PAf4jcb1UobNURH4USLKhBQtgR/GTRD1isf6h9DvUSGmFMbdh9b/isrtgBKmGpa4HMbAhAX4gRf0Cez4h9L6UR/qh9DsUSCyCAfyhcb4gRjujBGmisQ5USD8URK0";
|
||||
|
||||
public override void Enable()
|
||||
{
|
||||
const string customAlphabet = "abcdefABCDEFGHIJKLMNPQRSTUghijklmnopqrstuvwxyz0123456789+/=VWXYZ";
|
||||
const string standardAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
|
||||
var standardized = "";
|
||||
foreach (var c in Message)
|
||||
{
|
||||
var index = customAlphabet.IndexOf(c);
|
||||
standardized += index >= 0 ? standardAlphabet[index] : c;
|
||||
}
|
||||
|
||||
// Then decode using standard base64
|
||||
var decodedBytes = Convert.FromBase64String(standardized);
|
||||
var decodedMessage = System.Text.Encoding.UTF8.GetString(decodedBytes);
|
||||
|
||||
Logger.Info(decodedMessage);
|
||||
|
||||
|
||||
PlayerEvents.Spawned += HandleSpawn;
|
||||
PlayerEvents.Hurting += OnPlayerHurting;
|
||||
}
|
||||
|
||||
public override void Disable()
|
||||
{
|
||||
PlayerEvents.Spawned -= HandleSpawn;
|
||||
PlayerEvents.Hurting -= OnPlayerHurting;
|
||||
}
|
||||
|
||||
private static void OnPlayerHurting(PlayerHurtingEventArgs ev)
|
||||
{
|
||||
if (ev.DamageHandler is not Scp3114DamageHandler scp3114DamageHandler) return;
|
||||
if (scp3114DamageHandler.Subtype != Scp3114DamageHandler.HandlerType.Slap) return;
|
||||
if (ev.Attacker != null) ev.Attacker.HumeShield -= 15;
|
||||
}
|
||||
|
||||
private static void HandleSpawn(PlayerSpawnedEventArgs ev)
|
||||
{
|
||||
Timing.CallDelayed(1f, () =>
|
||||
{
|
||||
Logger.Debug("Handling Balance");
|
||||
if (ev.Role.RoleTypeId == RoleTypeId.Scp049)
|
||||
{
|
||||
ev.Player.ReferenceHub.playerEffectsController.ChangeState<MovementBoost>(5, float.MaxValue);
|
||||
}
|
||||
|
||||
if (ev.Role.RoleTypeId == RoleTypeId.Scp3114)
|
||||
{
|
||||
ev.Player.ReferenceHub.playerEffectsController.ChangeState<Slowness>(6, float.MaxValue);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>disable</Nullable>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<Optimize>true</Optimize>
|
||||
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
|
||||
<DebugType>full</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<Optimize>true</Optimize>
|
||||
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
|
||||
<DebugType>none</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>..\dependencies\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>..\dependencies\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp-firstpass">
|
||||
<HintPath>..\dependencies\Assembly-CSharp-firstpass.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CommandSystem.Core">
|
||||
<HintPath>..\dependencies\CommandSystem.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="HintServiceMeow">
|
||||
<HintPath>..\dependencies\HintServiceMeow-LabAPI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mirror">
|
||||
<HintPath>..\dependencies\Mirror.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NorthwoodLib">
|
||||
<HintPath>..\dependencies\NorthwoodLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Pooling">
|
||||
<HintPath>..\dependencies\Pooling.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>..\dependencies\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user