do a lot ig

This commit is contained in:
2025-07-03 22:05:38 +02:00
parent 0aee847089
commit 0615f8aeea
36 changed files with 1867 additions and 125 deletions
+33 -11
View File
@@ -1,11 +1,11 @@
using CustomPlayerEffects;
using HintServiceMeow.Core.Models.Hints;
using InventorySystem.Items.Usables.Scp330;
using LabApi.Events.Arguments.PlayerEvents;
using LabApi.Events.Arguments.Scp0492Events;
using LabApi.Events.Arguments.ServerEvents;
using LabApi.Events.Handlers;
using LabApi.Features;
using LabApi.Features.Console;
using LabApi.Features.Wrappers;
using LabApi.Loader.Features.Plugins;
@@ -23,8 +23,26 @@ public class GrowingZombies : Plugin
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);
Scp0492Events.ConsumedCorpse += OnZombieEat;
ServerEvents.RoundEnded += OnRoundEnd;
PlayerEvents.Left += OnPlayerLeave;
@@ -55,24 +73,28 @@ public class GrowingZombies : Plugin
if (!ev?.Player.ReferenceHub.playerEffectsController)
return;
// Increment corpse count for this zombie
if (!ZombieCorpseCount.ContainsKey(ev.Player))
ZombieCorpseCount[ev.Player] = 0;
ZombieCorpseCount[ev.Player]++;
AteCorpse(ev.Player);
}
var corpsesEaten = ZombieCorpseCount[ev.Player];
public void AteCorpse(Player player)
{
if (!ZombieCorpseCount.ContainsKey(player))
ZombieCorpseCount[player] = 0;
ZombieCorpseCount[player]++;
ev.Player.MaxHealth = Math.Min(1000, ev.Player.MaxHealth + 50);
ev.Player.MaxHumeShield += 10;
var corpsesEaten = ZombieCorpseCount[player];
player.MaxHealth = Math.Min(1000, player.MaxHealth + 50);
player.MaxHumeShield += 10;
var movementBoostIntensity = (byte)Math.Min(1 + corpsesEaten * 0.5f, 5f);
ev.Player.ReferenceHub.playerEffectsController.ChangeState<MovementBoost>(movementBoostIntensity, 120);
player.ReferenceHub.playerEffectsController.ChangeState<MovementBoost>(movementBoostIntensity, 120);
// Add damage resistance after eating multiple corpses
if (corpsesEaten >= 3)
{
var damageReductionIntensity = (byte)Math.Min(corpsesEaten * 2, 100); // Half-Percent
ev.Player.ReferenceHub.playerEffectsController.ChangeState<DamageReduction>(damageReductionIntensity,
player.ReferenceHub.playerEffectsController.ChangeState<DamageReduction>(damageReductionIntensity,
float.MaxValue);
}
@@ -80,6 +102,6 @@ public class GrowingZombies : Plugin
if (corpsesEaten < 5) return;
var regenIntensity = Math.Min(1 + corpsesEaten * 0.2f, 3f);
Scp330Bag.AddSimpleRegeneration(ev.Player.ReferenceHub, regenIntensity, 15f);
Scp330Bag.AddSimpleRegeneration(player.ReferenceHub, regenIntensity, 15f);
}
}
+3
View File
@@ -23,6 +23,9 @@
<Reference Include="Assembly-CSharp">
<HintPath>..\dependencies\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="CommandSystem.Core">
<HintPath>..\dependencies\CommandSystem.Core.dll</HintPath>
</Reference>
<Reference Include="HintServiceMeow">
<HintPath>..\dependencies\HintServiceMeow-LabAPI.dll</HintPath>
</Reference>
+56
View File
@@ -0,0 +1,56 @@
using CommandSystem;
using LabApi.Features.Wrappers;
using PlayerRoles;
using ICommand = CommandSystem.ICommand;
namespace GrowingZombies;
[CommandHandler(typeof(ClientCommandHandler))]
public class SacrificeCommand: ICommand
{
public string Command => "sacrifice";
public string[] Aliases => ["sac"];
public string Description => "Sacrifice yourself to give another zombie an extra corpse count";
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
{
if (!Player.TryGet(sender, out var player))
{
response = "You must be a player to use this command!";
return false;
}
if (player.Role != RoleTypeId.Scp0492)
{
response = "You must be a zombie to use this command!";
return false;
}
var zombies = Player.List.Where(p => p.Role == RoleTypeId.Scp0492 && p != player).ToList();
if (!zombies.Any())
{
response = "There are no other zombies to receive your sacrifice!";
return false;
}
// Select random zombie to receive the bonus
var luckyZombie = zombies[UnityEngine.Random.Range(0, zombies.Count)];
// Add corpse count to the lucky zombie
GrowingZombies.Instance.AteCorpse(luckyZombie);
// Remove corpse count from the sacrificing player
GrowingZombies.Instance.ZombieCorpseCount[player] = 0;
// Kill the sacrificing player
player.Kill("Sacrificed themselves for their zombie brethren");
luckyZombie.SendHint($"You received the sacrifice of {player.Nickname}!", 5);
response = "You sacrificed yourself to give another zombie an extra corpse count!";
var scp049 = Player.List.FirstOrDefault(p => p.Role == RoleTypeId.Scp049);
scp049?.SendHint($"Your zombie {player.Nickname} sacrificed themselves to give {luckyZombie.Nickname} another corpse they ate!", 5);
return true;
}
}