mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-19 15:51:58 +00:00
Fix errors
This commit is contained in:
1 parent
4f67cbd0be
commit
65bf9f9bf6
6 files changed
+19
-12
No files matched your search
@@ -16,6 +16,7 @@
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HP/@EntryIndexedValue">HP</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HUD/@EntryIndexedValue">HUD</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=KCD/@EntryIndexedValue">KCD</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LI/@EntryIndexedValue">LI</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NB/@EntryIndexedValue">NB</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NC/@EntryIndexedValue">NC</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NE/@EntryIndexedValue">NE</s:String>
|
||||
|
||||
+2
-1
@@ -430,8 +430,9 @@ public static class Utils
|
||||
0 => CustomRoles.ImpostorEHR,
|
||||
1 => Enum.GetValues<CustomRoles>().Where(x => x.IsEnable() && x.IsImpostor() && x != CustomRoles.LovingImpostor && !HnSManager.AllHnSRoles.Contains(x)).Shuffle()[0],
|
||||
_ => CustomRoles.LovingImpostor
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
string RoleText = GetRoleName(isHnsAgentOverride ? CustomRoles.Hider : targetMainRole);
|
||||
Color RoleColor = GetRoleColor(targetMainRole);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class SetUpRoleTextPatch
|
||||
|
||||
// After showing team for non-modded clients update player names.
|
||||
IsInIntro = false;
|
||||
Utils.NotifyRoles(NoCache: true);
|
||||
Utils.DoNotifyRoles(NoCache: true);
|
||||
|
||||
LateTask.New(() =>
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ internal class ChangeRoleSettings
|
||||
public static void Postfix(AmongUsClient __instance)
|
||||
{
|
||||
SetUpRoleTextPatch.IsInIntro = true;
|
||||
Utils.NotifyRoles(NoCache: true);
|
||||
Utils.DoNotifyRoles(NoCache: true);
|
||||
|
||||
Main.OverrideWelcomeMsg = string.Empty;
|
||||
try
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace EHR.Roles.AddOns.Common
|
||||
"Impostor",
|
||||
"RandomONImpRole",
|
||||
"LovingImpostor"
|
||||
]
|
||||
];
|
||||
|
||||
public AddonTypes Type => AddonTypes.Mixed;
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace EHR.Roles.AddOns.Common
|
||||
.SetParent(LegacyLovers)
|
||||
.SetValueFormat(OptionFormat.Percent)
|
||||
.SetGameMode(customGameMode);
|
||||
|
||||
|
||||
LovingImpostorRoleForOtherImps = new StringOptionItem(id + 12, "LIRoleForOtherImps", LIRole, 2, TabGroup.Addons)
|
||||
.SetParent(LovingImpostorSpawnChance)
|
||||
.SetGameMode(customGameMode);
|
||||
|
||||
+12
-7
@@ -1,5 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AmongUs.GameOptions;
|
||||
using UnityEngine;
|
||||
|
||||
namespace EHR.Roles.Crewmate
|
||||
{
|
||||
@@ -8,14 +10,15 @@ namespace EHR.Roles.Crewmate
|
||||
private const int Id = 640200;
|
||||
public static Dictionary<byte, long> ShieldedPlayers = [];
|
||||
|
||||
public byte TargetId;
|
||||
|
||||
public static OptionItem AidDur;
|
||||
public static OptionItem AidCD;
|
||||
public static OptionItem TargetKnowsShield;
|
||||
public static OptionItem UseLimitOpt;
|
||||
public static OptionItem UsePet;
|
||||
public override bool IsEnable => playerIdList.Count > 0;
|
||||
private static bool On;
|
||||
|
||||
public byte TargetId;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
@@ -27,7 +30,7 @@ namespace EHR.Roles.Crewmate
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Aid])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
TargetKnowsShield = new BooleanOptionItem(Id + 14, "AidTargetKnowsAboutShield", true, TabGroup.CrewmateRoles)
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Aid])
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Aid]);
|
||||
UseLimitOpt = new IntegerOptionItem(Id + 12, "AbilityUseLimit", new(1, 20, 1), 5, TabGroup.CrewmateRoles)
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Aid])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
@@ -36,11 +39,13 @@ namespace EHR.Roles.Crewmate
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
On = false;
|
||||
ShieldedPlayers = [];
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
playerId.SetAbilityUseLimit(UseLimitOpt.GetInt());
|
||||
TargetId = byte.MaxValue;
|
||||
|
||||
@@ -85,7 +90,7 @@ namespace EHR.Roles.Crewmate
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnCoEnterVent(PlayerPhysics physics, Vent vent)
|
||||
public override void OnCoEnterVent(PlayerPhysics physics, int ventId)
|
||||
{
|
||||
var pc = physics.myPlayer;
|
||||
if (pc.GetAbilityUseLimit() >= 1 && TargetId != byte.MaxValue)
|
||||
@@ -98,10 +103,10 @@ namespace EHR.Roles.Crewmate
|
||||
TargetId = byte.MaxValue;
|
||||
}
|
||||
|
||||
LateTask.New(() => physics.RpcBootFromVent(vent), 0.5f, log: false);
|
||||
LateTask.New(() => physics.RpcBootFromVent(ventId), 0.5f, log: false);
|
||||
}
|
||||
|
||||
public override GetSuffix(PlayerControl seer, PlayerControl target, bool hud = false, bool meeting = false)
|
||||
public override string GetSuffix(PlayerControl seer, PlayerControl target, bool hud = false, bool meeting = false)
|
||||
{
|
||||
if (seer.PlayerId != target.PlayerId || (seer.IsModClient() && !hud)) return string.Empty;
|
||||
if (TargetKnowsShield.GetBool() && ShieldedPlayers.TryGetValue(seer.PlayerId, out var ts))
|
||||
|
||||
Reference in new issue
Block a user