Banana Man

This commit is contained in:
Gurge44 committed 2025-07-07 16:14:56 +02:00
1 parent 5ebc01a926
commit a9813a5b80
10 files changed
+44 -1

No files matched your search

+1
View File
@@ -459,6 +459,7 @@ public enum CustomRoles
Autopsy,
Avanger,
Bait,
BananaMan,
Trapper, // Beartrap
Bewilder,
Blind,
+1
View File
@@ -619,6 +619,7 @@ public class Main : BasePlugin
{ CustomRoles.Messenger, "#28b573" },
{ CustomRoles.Dynamo, "#ebe534" },
{ CustomRoles.AntiTP, "#fcba03" },
{ CustomRoles.BananaMan, "#ffe135" },
{ CustomRoles.Blind, "#666666" },
{ CustomRoles.Shy, "#9582f5" },
{ CustomRoles.Blocked, "#B7A627" },
+4
View File
@@ -1,6 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using AmongUs.Data;
using EHR.AddOns.Common;
using EHR.Impostor;
using EHR.Modules;
using EHR.Neutral;
@@ -183,6 +184,9 @@ public static class Camouflage
}
}
if (target.Is(CustomRoles.BananaMan))
newOutfit = BananaMan.GetOutfit(Main.AllPlayerNames.GetValueOrDefault(target.PlayerId, "Banana"));
SetPetForOutfitIfNecessary(newOutfit);
if (Options.RemovePetsAtDeadPlayers.GetBool() && !target.IsAlive())
+1
View File
@@ -1033,6 +1033,7 @@ internal static class CustomRolesHelper
CustomRoles.Oblivious when pc.Is(CustomRoles.Altruist) => false,
CustomRoles.AntiTP when pc.GetCustomRole() is CustomRoles.Transmitter or CustomRoles.Miner or CustomRoles.Escapee or CustomRoles.Tunneler => false,
CustomRoles.Swift when pc.Is(CustomRoles.Stealth) => false,
CustomRoles.BananaMan when pc.Is(CustomRoles.Disco) => false,
CustomRoles.Disco when pc.GetCustomRole() is CustomRoles.Chameleon or CustomRoles.Swooper or CustomRoles.Wraith or CustomRoles.Alchemist => false,
CustomRoles.Egoist when pc.Is(CustomRoles.Gangster) => false,
CustomRoles.Nimble when pc.Is(CustomRoles.Oxyman) => false,
+1
View File
@@ -318,6 +318,7 @@ public static class GuessManager
case CustomRoles.Disco:
case CustomRoles.Glow:
case CustomRoles.LastImpostor:
case CustomRoles.BananaMan:
ShowMessage("GuessObviousAddon");
return true;
case CustomRoles.GM:
+9
View File
@@ -2559,6 +2559,9 @@ public static class Utils
string seerRealName = seer.GetRealName(forMeeting);
if (seer.Is(CustomRoles.BananaMan))
seerRealName = seerRealName.Insert(0, $"{GetString("Prefix.BananaMan")} ");
if (!GameStates.IsLobby)
{
if ((Options.CurrentGameMode == CustomGameMode.FFA && FreeForAll.FFATeamMode.GetBool()) || Options.CurrentGameMode == CustomGameMode.HotPotato)
@@ -2803,6 +2806,9 @@ public static class Utils
string targetPlayerName = target.GetRealName(forMeeting);
if (target.Is(CustomRoles.BananaMan))
targetPlayerName = targetPlayerName.Insert(0, $"{GetString("Prefix.BananaMan")} ");
if (GameStates.IsLobby) goto End;
if (Options.CurrentGameMode != CustomGameMode.Standard) goto BeforeEnd;
@@ -2989,6 +2995,9 @@ public static class Utils
public static bool RpcChangeSkin(PlayerControl pc, NetworkedPlayerInfo.PlayerOutfit newOutfit, CustomRpcSender writer = null, SendOption sendOption = SendOption.Reliable)
{
if (pc.Is(CustomRoles.BananaMan))
newOutfit = BananaMan.GetOutfit(Main.AllPlayerNames.GetValueOrDefault(pc.PlayerId, "Banana"));
if (newOutfit.Compare(pc.Data.DefaultOutfit)) return false;
Camouflage.SetPetForOutfitIfNecessary(newOutfit);
+4 -1
View File
@@ -864,6 +864,9 @@ internal static class StartGameHostPatch
if (!state.MainRole.IsImpostor() && !(state.MainRole == CustomRoles.Traitor && Traitor.CanGetImpostorOnlyAddons.GetBool()))
state.SubRoles.RemoveAll(x => x.IsImpOnlyAddon());
if (state.SubRoles.Contains(CustomRoles.BananaMan))
Utils.RpcChangeSkin(state.Player, new());
}
foreach (KeyValuePair<byte, PlayerState> pair in Main.PlayerStates)
@@ -1046,7 +1049,7 @@ internal static class StartGameHostPatch
}
LoadingBarManager loadingBarManager = FastDestroyableSingleton<LoadingBarManager>.Instance;
yield return loadingBarManager.WaitAndSmoothlyUpdate(90f, 100f, 2f, GetString("LoadingBarText.1"));
yield return loadingBarManager.WaitAndSmoothlyUpdate(90f, 100f, 1f, GetString("LoadingBarText.1"));
loadingBarManager.ToggleLoadingBar(false);
Main.AllPlayerControls.Do(SetRoleSelf);
+3
View File
@@ -1672,6 +1672,9 @@ internal static class FixedUpdatePatch
string realName = target.GetRealName();
if (target.Is(CustomRoles.BananaMan))
realName = realName.Insert(0, $"{GetString("Prefix.BananaMan")} ");
if (target.AmOwner && inTask)
{
if (target.Is(CustomRoles.Arsonist) && target.IsDouseDone())
+4
View File
@@ -4682,6 +4682,10 @@
"JournalistError.IndexOutOfRange": "You didn't provide enough arguments.",
"JournalistError.ArgumentOutOfRange": "The index you provided is out of range. Use <b>/note view</b> to see the indexes of your notes.",
"JournalistError.Unknown": "An unknown error occurred.",
"BananaMan": "Banana Man",
"BananaManInfo": "You're the Banana Man",
"BananaManInfoLong": "(Add-ons):\\nAs the Banana Man, you are a banana.",
"Prefix.BananaMan": "Banana",
"Grappler": "Grappler",
"GrapplerInfo": "Prevent kills and pull players towards you",
"GrapplerInfoLong": "(Crewmates):\\nAs the Grappler, you can prevent 1 kill in each round if you have an ability use left at the end of the last round. The first kill attempt will be blocked and the target will be teleported to you and not die. Your ability doesn't work during sabotages.",
+16
View File
@@ -0,0 +1,16 @@
namespace EHR.AddOns.Common;
public class BananaMan : IAddon
{
public AddonTypes Type => AddonTypes.Mixed;
public void SetupCustomOption()
{
Options.SetupAdtRoleOptions(652700, CustomRoles.BananaMan, canSetNum: true, teamSpawnOptions: true);
}
public static NetworkedPlayerInfo.PlayerOutfit GetOutfit(string name)
{
return new NetworkedPlayerInfo.PlayerOutfit().Set(name, 14, "hat_pk04_Banana", "", "", "", "nameplate_shh");
}
}