Skip to content

Commit

Permalink
Fix some intro scenes for some roles & Gamemodes (#211)
Browse files Browse the repository at this point in the history
* Fix some intro scenes

* Update en_US.json

* Update IntroPatch.cs
  • Loading branch information
PEPPERcula authored Dec 10, 2024
1 parent b095aca commit 8f0deb9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
25 changes: 16 additions & 9 deletions Patches/IntroPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static void Postfix(IntroCutscene __instance)
case CustomGameMode.SoloKombat:
{
Color color = ColorUtility.TryParseHtmlString("#f55252", out Color c) ? c : new(255, 255, 255, 255);
__instance.YouAreText.color = color;
__instance.YouAreText.transform.gameObject.SetActive(false);
__instance.RoleText.text = GetString("SoloKombat");
__instance.RoleText.color = Utils.GetRoleColor(lp.GetCustomRole());
__instance.RoleBlurbText.color = color;
Expand Down Expand Up @@ -90,7 +90,7 @@ public static void Postfix(IntroCutscene __instance)
case CustomGameMode.NaturalDisasters:
{
Color color = ColorUtility.TryParseHtmlString("#03fc4a", out Color c) ? c : new(255, 255, 255, 255);
__instance.YouAreText.color = color;
__instance.YouAreText.transform.gameObject.SetActive(false);
__instance.RoleText.text = GetString("NDPlayer");
__instance.RoleText.color = color;
__instance.RoleBlurbText.color = color;
Expand All @@ -100,7 +100,7 @@ public static void Postfix(IntroCutscene __instance)
case CustomGameMode.RoomRush:
{
Color color = ColorUtility.TryParseHtmlString("#ffab1b", out Color c) ? c : new(255, 255, 255, 255);
__instance.YouAreText.color = color;
__instance.YouAreText.transform.gameObject.SetActive(false);
__instance.RoleText.text = GetString("RRPlayer");
__instance.RoleText.color = color;
__instance.RoleBlurbText.color = color;
Expand All @@ -110,7 +110,7 @@ public static void Postfix(IntroCutscene __instance)
case CustomGameMode.AllInOne:
{
Color color = ColorUtility.TryParseHtmlString("#f542ad", out Color c) ? c : new(255, 255, 255, 255);
__instance.YouAreText.color = color;
__instance.YouAreText.transform.gameObject.SetActive(false);
__instance.RoleText.text = GetString("AllInOne");
__instance.RoleText.color = color;
__instance.RoleBlurbText.color = color;
Expand Down Expand Up @@ -473,8 +473,6 @@ CustomRoles.FFF or
=> GetIntroSound(RoleTypes.Impostor),

CustomRoles.SabotageMaster or
CustomRoles.Engineer or
CustomRoles.EngineerEHR or
CustomRoles.Inhibitor or
CustomRoles.Saboteur or
CustomRoles.SecurityGuard or
Expand All @@ -487,7 +485,13 @@ CustomRoles.Randomizer or
CustomRoles.Gambler
=> GetIntroSound(RoleTypes.Shapeshifter),

CustomRoles.Doctor or
CustomRoles.Engineer or
CustomRoles.EngineerEHR
=> GetIntroSound(RoleTypes.Engineer),

CustomRoles.Scientist or
CustomRoles.ScientistEHR or
CustomRoles.Doctor or
CustomRoles.Medic
=> GetIntroSound(RoleTypes.Scientist),

Expand Down Expand Up @@ -519,11 +523,13 @@ CustomRoles.Miner or
=> ShipStatus.Instance.VentMoveSounds.FirstOrDefault(),

CustomRoles.Tracker
or CustomRoles.TrackerEHR
or CustomRoles.EvilTracker
=> GetIntroSound(RoleTypes.Tracker),

CustomRoles.Noisemaker
or CustomRoles.NoisemakerEHR
or CustomRoles.CyberStar
or CustomRoles.DarkHide
or CustomRoles.Specter
=> GetIntroSound(RoleTypes.Noisemaker),
Expand Down Expand Up @@ -554,7 +560,8 @@ or CustomRoles.ShapeshifterEHR
__instance.TeamTitle.text = Utils.GetRoleName(role);
__instance.TeamTitle.color = Utils.GetRoleColor(role);
__instance.BackgroundBar.material.color = Utils.GetRoleColor(role);
__instance.ImpostorText.gameObject.SetActive(false);
__instance.ImpostorText.gameObject.SetActive(true);
__instance.ImpostorText.text = GetString("SubText.GM");
}

if (PlayerControl.LocalPlayer.Is(CustomRoles.Madmate) || PlayerControl.LocalPlayer.Is(CustomRoles.Parasite) || PlayerControl.LocalPlayer.Is(CustomRoles.Crewpostor))
Expand Down Expand Up @@ -971,4 +978,4 @@ public static void Postfix( /*IntroCutscene __instance*/)

Logger.Info("OnDestroy", "IntroCutscene");
}
}
}
1 change: 1 addition & 0 deletions Resources/Lang/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"Icon": "",
"NameColor": "#00ffa5",
"Server": "<#00ffa5>Server:</color> <b>{0}</b>",
"SubText.GM": "Spectate the chaos!",
"SubText.Crewmate": "Find and exile the <color=#ff1919>Impostors</color>",
"SubText.Impostor": "Sabotage and kill everyone",
"SubText.Neutral": "A team on their own",
Expand Down

0 comments on commit 8f0deb9

Please sign in to comment.