mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
Finish Energetic
This commit is contained in:
1 parent
879074d7c6
commit
ca123ac3c8
4 files changed
+15
-17
No files matched your search
@@ -361,6 +361,7 @@ public enum CustomRoles
|
||||
Unreportable, // Disregarded
|
||||
DoubleShot,
|
||||
Egoist,
|
||||
Energetic,
|
||||
EvilSpirit,
|
||||
Flashman,
|
||||
Fool,
|
||||
|
||||
@@ -26,6 +26,7 @@ internal static class CustomRolesHelper
|
||||
CustomRoles.Chemist,
|
||||
CustomRoles.Shifter,
|
||||
CustomRoles.Evolver,
|
||||
CustomRoles.Energetic,
|
||||
|
||||
// HnS
|
||||
CustomRoles.Jet,
|
||||
@@ -770,6 +771,7 @@ internal static class CustomRolesHelper
|
||||
|
||||
public static bool CheckAddonConflict(CustomRoles role, PlayerControl pc) => role.IsAdditionRole() && (!Main.NeverSpawnTogetherCombos.TryGetValue(pc.GetCustomRole(), out var bannedAddonList) || !bannedAddonList.Contains(role)) && pc.GetCustomRole() is not CustomRoles.GuardianAngelEHR and not CustomRoles.God && !pc.Is(CustomRoles.Madmate) && !pc.Is(CustomRoles.Egoist) && !pc.Is(CustomRoles.GM) && role is not CustomRoles.Lovers && !pc.Is(CustomRoles.Needy) && (!pc.HasSubRole() || pc.GetCustomSubRoles().Count < Options.NoLimitAddonsNumMax.GetInt()) && (!Options.AddonCanBeSettings.TryGetValue(role, out var o) || ((o.Imp.GetBool() || !pc.GetCustomRole().IsImpostor()) && (o.Neutral.GetBool() || !pc.GetCustomRole().IsNeutral()) && (o.Crew.GetBool() || !pc.IsCrewmate()))) && role switch
|
||||
{
|
||||
CustomRoles.Energetic when !Options.UsePets.GetBool() => false,
|
||||
CustomRoles.Sidekick when pc.Is(CustomRoles.Madmate) => false,
|
||||
CustomRoles.Madmate when pc.Is(CustomRoles.Sidekick) => false,
|
||||
CustomRoles.Egoist when pc.Is(CustomRoles.Sidekick) => false,
|
||||
|
||||
@@ -117,23 +117,6 @@ class HudManagerPatch
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var role in Main.SetRoles)
|
||||
{
|
||||
if (!Main.SetAddOns.TryGetValue(role.Key, out var addons)) continue;
|
||||
|
||||
var pc = Utils.GetPlayerById(role.Key);
|
||||
if (pc == null) continue;
|
||||
|
||||
foreach (var addon in addons)
|
||||
{
|
||||
if (!CustomRolesHelper.CheckAddonConflict(addon, pc))
|
||||
{
|
||||
resultText[role.Key] += " <#ff0000>(!)</color>";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OverriddenRolesText.text = string.Join(string.Empty, resultText.Values);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace EHR.Roles.AddOns.Common
|
||||
{
|
||||
public class Energetic : IAddon
|
||||
{
|
||||
public AddonTypes Type => AddonTypes.Helpful;
|
||||
|
||||
public void SetupCustomOption()
|
||||
{
|
||||
Options.SetupAdtRoleOptions(644594, CustomRoles.Energetic, canSetNum: true, teamSpawnOptions: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user