Compare commits

...

4 Commits

29 changed files with 45 additions and 41 deletions

View File

@ -32,6 +32,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -20,6 +20,6 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -32,7 +32,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -134,18 +134,6 @@ public class BloodFueledHandler : CustomClassHandler
{ {
public override void HandleSpawn(Player player, CustomClassConfig config, Random random) public override void HandleSpawn(Player player, CustomClassConfig config, Random random)
{ {
player.SendBroadcast("You are SCP-939-<color=#C50000>Blood Fueled</color> \n Your stamina bar has been replaced by a <color=#C50000>blood meter</color>. \n You refill it by <color=#C50000>damaging</color> or <color=#C50000>killing</color> Humans. \n <color=#C50000><b>Don't let it run out.</color></b>", CustomClasses.BroadcastDuration);
const string customInfo = "<color=#C50000>Blood Fueled</color>";
if (!Player.ValidateCustomInfo(customInfo, out var reason))
{
Logger.Error($"Invalid custom info for Blood Fueled: {reason}");
}
else
{
player.CustomInfo = customInfo;
player.InfoArea |= PlayerInfoArea.CustomInfo;
}
player.MaxHumeShield = 0; player.MaxHumeShield = 0;
player.HumeShield = 0; player.HumeShield = 0;
player.MaxHealth = 3500; player.MaxHealth = 3500;
@ -154,4 +142,9 @@ public class BloodFueledHandler : CustomClassHandler
player.EnableEffect<DisableStaminaRegenEffect>(1, float.PositiveInfinity); player.EnableEffect<DisableStaminaRegenEffect>(1, float.PositiveInfinity);
player.EnableEffect<BloodFueledStaminaEffect>(1, float.PositiveInfinity); player.EnableEffect<BloodFueledStaminaEffect>(1, float.PositiveInfinity);
} }
public override void SendSpawnMessage(Player player, CustomClassConfig config)
{
player.SendBroadcast("You are SCP-939-<color=#C50000>Blood Fueled</color> \n Your stamina bar has been replaced by a <color=#C50000>blood meter</color>. \n You refill it by <color=#C50000>damaging</color> or <color=#C50000>killing</color> Humans. \n <color=#C50000><b>Don't let it run out.</color></b>", CustomClasses.BroadcastDuration);
}
} }

View File

@ -464,7 +464,7 @@ public abstract class CustomClassHandler: ICustomClassHandler
//Intentionally left blank //Intentionally left blank
} }
protected virtual void SendSpawnMessage(Player player, CustomClassConfig config) public virtual void SendSpawnMessage(Player player, CustomClassConfig config)
{ {
if (config.Name.IsEmpty()) return; if (config.Name.IsEmpty()) return;
player.SendBroadcast($"You are a {config.FullCustomInfo}!", CustomClasses.BroadcastDuration); player.SendBroadcast($"You are a {config.FullCustomInfo}!", CustomClasses.BroadcastDuration);
@ -967,6 +967,8 @@ public sealed class BloodFueledConfig : CustomClassConfig
public override double ChancePerPlayer { get; set; } = 1.0; public override double ChancePerPlayer { get; set; } = 1.0;
public override int MaxSpawns { get; set; } = int.MaxValue; public override int MaxSpawns { get; set; } = int.MaxValue;
public override RoleTypeId RequiredRole { get; set; } = RoleTypeId.Scp939; public override RoleTypeId RequiredRole { get; set; } = RoleTypeId.Scp939;
public override string Name { get; init; } = "Blood Fueled";
public override string Color { get; init; } = "#C50000";
} }
/// <summary> /// <summary>

View File

@ -50,6 +50,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -12,7 +12,7 @@ namespace CustomClasses;
public class NegromancerHandler : CustomClassHandler public class NegromancerHandler : CustomClassHandler
{ {
protected override void SendSpawnMessage(Player player, CustomClassConfig config) public override void SendSpawnMessage(Player player, CustomClassConfig config)
{ {
player.SendBroadcast("You are the <color=#6e2e99>Negromancer</color>! Revived players become your <color=#3c1361>Shadow</color>.", CustomClasses.BroadcastDuration); player.SendBroadcast("You are the <color=#6e2e99>Negromancer</color>! Revived players become your <color=#3c1361>Shadow</color>.", CustomClasses.BroadcastDuration);
} }

View File

@ -6,6 +6,12 @@ public static class PlayerExtensions
{ {
public static string GetExtendedClass(this Player player) public static string GetExtendedClass(this Player player)
{ {
return ""; foreach (var classManagerConfig in CustomClasses.Instance.ClassManager.Configs.Where(classManagerConfig => player.CustomInfo == classManagerConfig.Value.FullCustomInfo &&
!classManagerConfig.Value.Name.IsEmpty()))
{
return classManagerConfig.Value.Name;
}
return player.Role.ToString();
} }
} }

View File

@ -284,10 +284,13 @@ public class SerpentsHandHandler : SimpleAddItemHandler
player.EnableEffect<MovementBoost>(20, 30); player.EnableEffect<MovementBoost>(20, 30);
player.SendBroadcast("You're a <color=#2E8B57>Serpent's Hand</color> member!", CustomClasses.BroadcastDuration);
player.EnableEffect<SpawnProtected>(1, 20f); player.EnableEffect<SpawnProtected>(1, 20f);
} }
public override void SendSpawnMessage(Player player, CustomClassConfig config)
{
player.SendBroadcast("You're a <color=#2E8B57>Serpent's Hand</color> member!", CustomClasses.BroadcastDuration);
}
} }
[CommandHandler(typeof(RemoteAdminCommandHandler))] [CommandHandler(typeof(RemoteAdminCommandHandler))]

View File

@ -36,7 +36,7 @@ public class SetCClassCommand : ICommand
var className = args[arguments.Offset + arguments.Count - 1].ToLower(); var className = args[arguments.Offset + arguments.Count - 1].ToLower();
var playerName = string.Join(" ", args.Skip(arguments.Offset).Take(arguments.Count - 1)); var playerName = string.Join(" ", args.Skip(arguments.Offset).Take(arguments.Count - 1));
var player = Player.ReadyList.FirstOrDefault(x => x.Nickname == playerName || x.UserId == playerName); var player = Player.ReadyList.FirstOrDefault(x => x.Nickname == playerName || x.UserId == playerName || x.NetworkId.ToString() == playerName);
if (player == null) if (player == null)
{ {
response = $"Player {playerName} not found"; response = $"Player {playerName} not found";

View File

@ -35,6 +35,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -35,6 +35,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -41,6 +41,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -35,6 +35,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -21,7 +21,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>

View File

@ -26,6 +26,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -21,7 +21,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>

View File

@ -20,6 +20,6 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -21,7 +21,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>

View File

@ -21,7 +21,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>

View File

@ -38,6 +38,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -36,6 +36,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -35,6 +35,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -25,7 +25,7 @@
<EmbeddedResource Include="Rust/target/x86_64-pc-windows-gnu/release/stats_tracker.dll" /> <EmbeddedResource Include="Rust/target/x86_64-pc-windows-gnu/release/stats_tracker.dll" />
<EmbeddedResource Include="Rust/target/x86_64-unknown-linux-gnu/release/libstats_tracker.so" /> <EmbeddedResource Include="Rust/target/x86_64-unknown-linux-gnu/release/libstats_tracker.so" />
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>
<Target Name="RustBuild" BeforeTargets="PrepareForBuild"> <Target Name="RustBuild" BeforeTargets="PrepareForBuild">

View File

@ -21,7 +21,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>

View File

@ -21,7 +21,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>

View File

@ -21,7 +21,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>

View File

@ -38,6 +38,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -32,6 +32,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/> <PackageReference Include="Northwood.LabAPI" Version="1.1.0"/>
</ItemGroup> </ItemGroup>
</Project> </Project>