mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
4f67cbd0be
10 files changed
+85
-24
No files matched your search
@@ -83,7 +83,7 @@ public static class DevManager
|
||||
DevUserList.Add(new(code: "ponyholey#5532", color: "#0000FF", tag: "desenvolvedor", isUp: true, isDev: false, deBug: false, colorCmd: false, upName: "DrawingsZz"));
|
||||
DevUserList.Add(new(code: "akinlaptop#2206", color: "null", tag: "null", isUp: true, isDev: false, deBug: false, colorCmd: false, upName: "MR Carr"));
|
||||
DevUserList.Add(new(code: "fursilty#4676", color: "#0000ff", tag: "arthurzin", isUp: true, isDev: false, deBug: false, colorCmd: false, upName: "arthurzin"));
|
||||
DevUserList.Add(new(code: "stonefuzzy#8673", color: "#00a6ff", tag: "<size=1.6>Ru Translator</size>", isUp: true, isDev: false, deBug: false, colorCmd: false, upName: "HyperAtill"));
|
||||
DevUserList.Add(new(code: "stonefuzzy#8673", color: "#ff0062", tag: "<size=1.6>Ru Translator</size>", isUp: true, isDev: false, deBug: false, colorCmd: false, upName: "HyperAtill"));
|
||||
DevUserList.Add(new(code: "frizzytram#2508", color: "#1C87FF", tag: "RafaelBIT50", isUp: false, isDev: false, deBug: false, colorCmd: false, upName: "RafaelBIT50"));
|
||||
DevUserList.Add(new(code: "foggyzing#6238", color: "null", tag: "null", isUp: true, isDev: false, deBug: false, colorCmd: false, upName: "LdZinnn"));
|
||||
DevUserList.Add(new(code: "onsideblur#3929", color: "#fc3a51", tag: "YouTuber", isUp: true, isDev: false, deBug: false, colorCmd: false, upName: "Manelzin"));
|
||||
|
||||
@@ -197,6 +197,13 @@ public static class GuessManager
|
||||
|
||||
bool forceAllowGuess = role is CustomRoles.LovingCrewmate or CustomRoles.LovingImpostor or CustomRoles.Lovers && Lovers.GuessAbility.GetValue() == 2;
|
||||
|
||||
if (role == CustomRoles.Lovers && Lovers.GuessAbility.GetValue() == 0)
|
||||
{
|
||||
if (!isUI) Utils.SendMessage(GetString("GuessLovers"), pc.PlayerId);
|
||||
else pc.ShowPopUp(GetString("GuessLovers"));
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (pc.GetCustomRole())
|
||||
{
|
||||
case CustomRoles.NiceGuesser when Main.GuesserGuessed[pc.PlayerId] >= Options.GGCanGuessTime.GetInt():
|
||||
@@ -279,10 +286,6 @@ public static class GuessManager
|
||||
if (!isUI) Utils.SendMessage(GetString("GuessVanillaCrewmate"), pc.PlayerId);
|
||||
else pc.ShowPopUp(GetString("GuessVanillaCrewmate"));
|
||||
return true;
|
||||
case CustomRoles.LovingCrewmate or CustomRoles.LovingImpostor when Lovers.GuessAbility.GetValue() == 0:
|
||||
if (!isUI) Utils.SendMessage(GetString("GuessLovers"), pc.PlayerId);
|
||||
else pc.ShowPopUp(GetString("GuessLovers"));
|
||||
return true;
|
||||
case CustomRoles.Workaholic when Workaholic.WorkaholicVisibleToEveryone.GetBool():
|
||||
if (!isUI) Utils.SendMessage(GetString("GuessWorkaholic"), pc.PlayerId);
|
||||
else pc.ShowPopUp(GetString("GuessWorkaholic"));
|
||||
|
||||
@@ -1900,7 +1900,8 @@ public static class Options
|
||||
.SetParent(GuesserMode)
|
||||
.SetColor(Color.green);
|
||||
|
||||
GuesserDoesntDieOnMisguess = new BooleanOptionItem(19718, "GuesserDoesntDieOnMisguess", false, TabGroup.TaskSettings);
|
||||
GuesserDoesntDieOnMisguess = new BooleanOptionItem(19718, "GuesserDoesntDieOnMisguess", false, TabGroup.TaskSettings)
|
||||
.SetGameMode(CustomGameMode.Standard);
|
||||
|
||||
LoadingPercentage = 92;
|
||||
MainLoadingText = "Building game settings";
|
||||
|
||||
@@ -423,6 +423,15 @@ public static class Utils
|
||||
var self = seerId == targetId || Main.PlayerStates[seerId].IsDead;
|
||||
|
||||
bool isHnsAgentOverride = Options.CurrentGameMode == CustomGameMode.HideAndSeek && targetMainRole == CustomRoles.Agent && HnSManager.PlayerRoles[seerId].Interface.Team != Team.Impostor;
|
||||
if (targetMainRole == CustomRoles.LovingImpostor)
|
||||
{
|
||||
targetMainRole = Lovers.LovingImpostorRoleForOtherImps.GetValue() switch
|
||||
{
|
||||
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);
|
||||
|
||||
|
||||
@@ -378,7 +378,7 @@ class GameEndChecker
|
||||
|
||||
if (CustomTeamManager.CheckCustomTeamGameEnd()) return true;
|
||||
|
||||
if (Main.AllAlivePlayerControls.All(p => p.Is(CustomRoles.Lovers)))
|
||||
if (Main.AllAlivePlayerControls.All(p => p.Is(CustomRoles.Lovers)) && !Main.LoversPlayers.All(x => x.Is(CustomRoles.LovingCrewmate)))
|
||||
{
|
||||
ResetAndSetWinner(CustomWinner.Lovers);
|
||||
return true;
|
||||
|
||||
@@ -244,12 +244,10 @@ class BeginCrewmatePatch
|
||||
}
|
||||
else if (role is CustomRoles.LovingCrewmate or CustomRoles.LovingImpostor)
|
||||
{
|
||||
__instance.TeamTitle.text = GetString($"Team{role}");
|
||||
if (role == CustomRoles.LovingImpostor) __instance.TeamTitle.text = $"<size=90%>{__instance.TeamTitle.text}</size>";
|
||||
__instance.TeamTitle.color = __instance.BackgroundBar.material.color = Utils.GetRoleColor(role);
|
||||
PlayerControl.LocalPlayer.Data.Role.IntroSound = GetIntroSound(role.GetRoleTypes());
|
||||
__instance.ImpostorText.gameObject.SetActive(true);
|
||||
byte otherLoverId = Main.LoversPlayers.First(x => x.PlayerId != PlayerControl.LocalPlayer.PlayerId).PlayerId;
|
||||
__instance.ImpostorText.gameObject.SetActive(true);
|
||||
__instance.ImpostorText.text = string.Format(GetString($"SubText.{role}"), Utils.ColorString(Main.PlayerColors.TryGetValue(otherLoverId, out var color) ? color : Color.white, Main.AllPlayerNames[otherLoverId]));
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1338,6 +1338,7 @@
|
||||
"SniperPrecisionShooting": "Precise Shooting",
|
||||
"SniperAimAssist": "Aim Assist",
|
||||
"SniperAimAssistOneshot": "One shot Assist",
|
||||
"RandomONImpRole": "Random Enabled Imp Role",
|
||||
"NameDisplayAddons": "Display Add-Ons next to the role name",
|
||||
"NoLimitAddonsNumMax": "Max Add-ons Per Player",
|
||||
"LoverSpawnChances": "Spawn Chance of <color=#ff9ace>Lovers</color>",
|
||||
@@ -3427,6 +3428,9 @@
|
||||
"AidInfoLong": "(Crewmates):\\nAs the Aid, you may use your kill button on someone to protect them from direct attacks temporarily. Neither you nor your target will know if someone tried to kill your target.",
|
||||
"AidDur": "Shield Duration",
|
||||
"AidCD": "Shield Cooldown",
|
||||
"AidTargetKnowsAboutShield": "Targets Know They're Shielded",
|
||||
"AidCounterSelf": "<#00ffa5>You're shielded for </color>{0}s",
|
||||
"AidCounterTarget": "{0} <#00ffa5>is shielded for </color>{1}s",
|
||||
"GuessManagerRole": "Guess Manager",
|
||||
"GuessManagerRoleInfo": "Receive Additional Info About Guesses",
|
||||
"GuessManagerRoleInfoLong": "(Crewmates):\\nAs the Guess Manager, you know the roles of guessed players, and if someone misguesses, you'll see that.",
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace EHR.Roles.AddOns.Common
|
||||
public static OptionItem NeutralCanBeInLove;
|
||||
public static OptionItem LegacyLovers;
|
||||
public static OptionItem LovingImpostorSpawnChance;
|
||||
public static OptionItem LovingImpostorRoleForOtherImps;
|
||||
public static OptionItem PrivateChat;
|
||||
public static OptionItem GuessAbility;
|
||||
|
||||
@@ -24,6 +25,13 @@ namespace EHR.Roles.AddOns.Common
|
||||
"RoleOn" // 2
|
||||
];
|
||||
|
||||
private static readonly string[] LIRole =
|
||||
[
|
||||
"Impostor",
|
||||
"RandomONImpRole",
|
||||
"LovingImpostor"
|
||||
]
|
||||
|
||||
public AddonTypes Type => AddonTypes.Mixed;
|
||||
|
||||
public void SetupCustomOption()
|
||||
@@ -71,6 +79,10 @@ 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);
|
||||
|
||||
PrivateChat = new BooleanOptionItem(id + 10, "PrivateChat", false, TabGroup.Addons)
|
||||
.SetParent(spawnOption)
|
||||
|
||||
+47
-13
@@ -6,11 +6,13 @@ namespace EHR.Roles.Crewmate
|
||||
public class Aid : RoleBase
|
||||
{
|
||||
private const int Id = 640200;
|
||||
private static List<byte> playerIdList = [];
|
||||
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;
|
||||
@@ -24,6 +26,8 @@ namespace EHR.Roles.Crewmate
|
||||
AidDur = new FloatOptionItem(Id + 11, "AidDur", new(0f, 60f, 1f), 10f, TabGroup.CrewmateRoles)
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Aid])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
TargetKnowsShield = new BooleanOptionItem(Id + 14, "AidTargetKnowsAboutShield", true, TabGroup.CrewmateRoles)
|
||||
.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);
|
||||
@@ -32,14 +36,13 @@ namespace EHR.Roles.Crewmate
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
playerIdList = [];
|
||||
ShieldedPlayers = [];
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
playerIdList.Add(playerId);
|
||||
playerId.SetAbilityUseLimit(UseLimitOpt.GetInt());
|
||||
TargetId = byte.MaxValue;
|
||||
|
||||
if (!AmongUsClient.Instance.AmHost || (Options.UsePets.GetBool() && UsePet.GetBool())) return;
|
||||
if (!Main.ResetCamPlayerList.Contains(playerId))
|
||||
@@ -49,20 +52,15 @@ namespace EHR.Roles.Crewmate
|
||||
public override void SetKillCooldown(byte playerId) => Main.AllPlayerKillCooldown[playerId] = AidCD.GetInt();
|
||||
public override void ApplyGameOptions(IGameOptions opt, byte playerId) => opt.SetVision(false);
|
||||
public override bool CanUseKillButton(PlayerControl pc) => pc.GetAbilityUseLimit() >= 1;
|
||||
public override bool CanUseImpostorVentButton(PlayerControl pc) => pc.GetAbilityUseLimit() >= 1 && TargetId != byte.MaxValue;
|
||||
|
||||
public override bool OnCheckMurder(PlayerControl killer, PlayerControl target)
|
||||
{
|
||||
if (killer == null) return false;
|
||||
if (target == null) return false;
|
||||
|
||||
if (killer.GetAbilityUseLimit() >= 1)
|
||||
{
|
||||
killer.RpcRemoveAbilityUse();
|
||||
ShieldedPlayers.TryAdd(target.PlayerId, Utils.TimeStamp);
|
||||
Utils.NotifyRoles(SpecifySeer: killer, SpecifyTarget: target);
|
||||
return false;
|
||||
}
|
||||
|
||||
TargetId = target.PlayerId;
|
||||
Utils.NotifyRoles(SpecifySeer: killer, SpecifyTarget: target);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -72,9 +70,9 @@ namespace EHR.Roles.Crewmate
|
||||
|
||||
bool change = false;
|
||||
|
||||
foreach (var x in ShieldedPlayers)
|
||||
foreach (var x in ShieldedPlayers.ToArray())
|
||||
{
|
||||
if (x.Value + AidDur.GetInt() < Utils.TimeStamp || !GameStates.IsInTask)
|
||||
if (x.Value + AidDur.GetInt() <= Utils.TimeStamp || !GameStates.IsInTask)
|
||||
{
|
||||
ShieldedPlayers.Remove(x.Key);
|
||||
change = true;
|
||||
@@ -86,5 +84,41 @@ namespace EHR.Roles.Crewmate
|
||||
Utils.NotifyRoles(SpecifySeer: pc);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnCoEnterVent(PlayerPhysics physics, Vent vent)
|
||||
{
|
||||
var pc = physics.myPlayer;
|
||||
if (pc.GetAbilityUseLimit() >= 1 && TargetId != byte.MaxValue)
|
||||
{
|
||||
pc.RpcRemoveAbilityUse();
|
||||
ShieldedPlayers[TargetId] = Utils.TimeStamp;
|
||||
var target = Utils.GetPlayerById(TargetId);
|
||||
Utils.NotifyRoles(SpecifySeer: pc, SpecifyTarget: target);
|
||||
Utils.NotifyRoles(SpecifySeer: target, SpecifyTarget: target);
|
||||
TargetId = byte.MaxValue;
|
||||
}
|
||||
|
||||
LateTask.New(() => physics.RpcBootFromVent(vent), 0.5f, log: false);
|
||||
}
|
||||
|
||||
public override 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))
|
||||
{
|
||||
var timeLeft = AidDur.GetInt() - (Utils.TimeStamp - ts);
|
||||
return string.Format(Translator.GetString("AidCounterSelf"), timeLeft);
|
||||
}
|
||||
|
||||
if (seer.Is(CustomRoles.Aid))
|
||||
{
|
||||
var duration = AidDur.GetInt();
|
||||
var now = Utils.TimeStamp;
|
||||
var formatted = ShieldedPlayers.Select(x => string.Format(Translator.GetString("AidCounterTarget"), Utils.ColorString(Main.PlayerColors.GetValueOrDefault(x.Key, Color.white), Main.AllPlayerNames.GetValueOrDefault(x.Key, "Someone")), duration - (now - x.Value)));
|
||||
return string.Join("\n", formatted);
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ namespace EHR.Roles.Impostor
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
ChargeLossInterval = new IntegerOptionItem(Id + 13, "ChargeLossInterval", new(1, 50, 1), 25, TabGroup.ImpostorRoles)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Chronomancer])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
.SetValueFormat(OptionFormat.Percent);
|
||||
}
|
||||
|
||||
void SendRPC()
|
||||
|
||||
Reference in new issue
Block a user