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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user