[](https://discord.gg/77RkMJHWsM)\r
-\r
-\r
+\r
+\r
\r
\r
# The Other Roles\r
\r
-The **The Other Roles**, is a mod for Amongs Us which adds manny new roles, new [Settings](#settings) and support for [10+ Player Lobbies](#Custom-Servers-and-10+-Players) to the game.\r
+The **The Other Roles**, is a mod for [Amongs Us](https://store.steampowered.com/app/945360/Among_Us) which adds many new roles, new [Settings](#settings), new [Custom Hats](#custom-hats) and support for [10+ Player Lobbies](#Custom-Servers-and-10+-Players) to the game.\r
Even more roles are coming soon :)\r
\r
- [Mafia](#mafia)\r
- [Vampire](#vampire)\r
- [Eraser](#eraser)\r
- [Trickster](#trickster)\r
+- [Cleaner](#cleaner)\r
- [Lovers](#lovers)\r
- Lover\r
- ImpLover\r
-- [Sheriff](#sheriff)\r
+- [Child](#child)\r
+ - Child Impostor\r
+ - Child Crewmate\r
+- [Jackal](#jackal)\r
+- [Sidekick](#sidekick)\r
- [Jester](#jester)\r
+- [Sheriff](#sheriff)\r
- [Seer](#seer)\r
- [Engineer](#engineer)\r
- [Detective](#detective)\r
- [Lighter](#lighter)\r
-- [Child](#child)\r
- - Child Impostor\r
- - Child Crewmate\r
- [Medic](#medic)\r
- [Mayor](#mayor)\r
- [Hacker](#hacker)\r
- [Swapper](#swapper)\r
- [Tracker](#tracker)\r
- [Snitch](#snitch)\r
-- [Jackal](#jackal)\r
-- [Sidekick](#sidekick)\r
- [Spy](#spy)\r
\r
The [Role Assignment](#role-assignment) sections explains how the roles are being distributed among the players.\r
# Releases\r
| Among Us - Version| Mod Version | Link |\r
|----------|-------------|-----------------|\r
+| 2021.4.14s| v2.3.0| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.3.0/TheOtherRoles.zip)\r
| 2021.4.14s| v2.2.2| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.2.2/TheOtherRoles.zip)\r
| 2021.4.12s| v2.2.1| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.2.1/TheOtherRoles.zip)\r
| 2021.4.12s| v2.2.0| [Download](https://github.com/Eisbison/TheOtherRoles/releases/download/v2.2.0/TheOtherRoles.zip)\r
<details>\r
<summary>Click to show the Changelog</summary>\r
\r
+**Version 2.3.0**\r
+- **New Role:** [Cleaner](#cleaner)\r
+- Added 12 new [Colors](#colors)\r
+- We added support for creating [Custom Hats](#custom-hats). New hats are coming with the next version, but you can already create and submit your own hats on [Discord](https://discord.gg/77RkMJHWsM).\r
+- Added the option to hide the name of players with an unknown role\r
+- Added Trickster Box vent animation. Thanks to [Drakoni](https://twitter.com/Drakoni13)\r
+- You can now change the custom server ip/port right inside the game\r
+- The Jackal, the Sidekick and the Jester now have fake tasks\r
+- Added outlines, to show who you're targetting with your ability. Thanks to [Sihaack](https://github.com/sihaack) for part of the code.\r
+- Added a streamer mode to Among Us, which hides lobby codes, the ip of your custom server and the port of your custom server. You can also modify the text that replaces the lobby code, check [Settings](#settings) for more details.\r
+- Changed Meeting Hud Layout when playing with more than 10 players\r
+- Fixed a bug where **ImpLovers** would hardly spawn\r
+- Fixed a bug where players could get stuck on ladders/platforms when being rewinded\r
+- Fixed a bug where players could only use quickchat\r
+- Fixed a bug which prevented to play in Freeplay mode\r
+- Fixed a bug which moved the Ping info off-screen\r
+\r
**Version 2.2.2**\r
- Among Us version 2021.4.14s compatibility\r
- Improved the block votes on emergency meeting option\r
- You can now set the maximum number of meetings in a game: Every player still only has one meeting. The Mayor can always use his meeting (even if the maximum number of meetings was reached). Impostor/Jackal meetings also count.\r
\r
**Hotfix 1.8.2**\r
-- Add map and impostor count to lobby settings.\r
+- Add map and Impostor count to lobby settings.\r
- Fixed bugs where changing players to be the Sidekick didn't reset all the effects of their previous role. \r
\r
**Hotfix 1.8.1** Resolves bugs that occured when the Jackal recruited a Medic, Swapper and Tracker\\r
\\r
**Changes in v1.6:**\r
- This update is a small hotfix, fixing the bug where some people were unable to join lobbies.\r
-- The child can't be voted out anymore before it turns 18, hence games can't end anymore because the child died. \r
+- The Child can't be voted out anymore before it turns 18, hence games can't end anymore because the Child died. \r
- Footprints are no longer visible to the Detective, if players are inside vents.\r
\r
\\r
**Changes in v1.5:**\r
- Time Master - Buff: He is not affected by his rewind anymore, which gives him more utility. Players will now be rewinded out of vents.\r
-- Child - Nerf: The child now grows up (see [child](#child)) and becomes a normal crewmate at some point. A growing child is not killable anymore. Some tasks are still not doable for the small child, we are working on that. But eventually when growing up it can do all the tasks as it's size increases.\r
+- Child - Nerf: The Child now grows up (see [Child](#child)) and becomes a normal Crewmate at some point. A growing Child is not killable anymore. Some tasks are still not doable for the small Child, we are working on that. But eventually when growing up it can do all the tasks as it's size increases.\r
- Seer - Nerf: Added an option that sets how often the Seer mistakes the player for another.\r
-- Hacker - Nerf: The Hacker now only sees the additional information when he activates his "Hacker mode". That should stops the hacker from camping the admin table/vitals.\r
+- Hacker - Nerf: The Hacker now only sees the additional information when he activates his "Hacker mode". That should stops the Hacker from camping the admin table/vitals.\r
- Other: Camouflager/Morphling cooldowns were fixed. Custom regions code was removed to enable 3rd party tools. Some minor bugfixes.\r
\r
**Changes in v1.4:**\r
**Changes in v1.1:**\r
- Morphling: The color of pet now also morphs. The skin animation now starts at the right point.\r
- The game over screen now shows if the Jester/Child/Lovers won.\r
-- A bug was removed where the Jester won together with the crewmates.\r
+- A bug was removed where the Jester won together with the Crewmates.\r
- A bug was removed where the game of the Lovers crashed if they were the last players killed by the host of the lobby.\r
</details>\r
\r
\r
## Windows Manual Installation\r
1. Download and unzip the newest [release](https://github.com/Eisbison/TheOtherRoles/releases/latest)\r
-2. Find the folder of your game, for steams players you can right click in steam, on the game, a menu will appear proposing you to go to the folders.\r
-3. Make a copy of your game, it's not obligatory but advise, put it where you want.\r
+2. Find the folder of your game, for Steam players you can right click in Steam, on the game, a menu will appear proposing you to go to the folders.\r
+3. Make a copy of your game, it's not obligatory but advised, put it where you want.\r
4. Drag or extract the files from the zip into your game, at the .exe level.\r
5. Run the game (the first launch might take a while)\r
\r
\r
\r
**Linux Manual**\r
-1. Install Among Us via steam\r
+1. Install Among Us via Steam\r
2. Download newest [release](https://github.com/Eisbison/TheOtherRoles/releases/latest) and extract it to ~/.steam/steam/steamapps/common/Among Us\r
3. Enable winhttp.dll via the proton winecfg (https://bepinex.github.io/bepinex_docs/master/articles/advanced/steam_interop.html#protonwine)\r
4. Launch the game via Steam\r
We always recommend you to play on custom servers rather than on the official ones. If you want to play with more than 10 players in one lobby, you're required to use a custom server. Credits for the original implementation that allowed 10+ player lobbies go to the creaters of the [Crowded-Mod](https://github.com/CrowdedMods/CrowdedMod).\r
\r
**Setup the Clients:**\r
-1. Run the game one time after you installed TheOtherRoles to generate the config files\r
-2. Open the Among Us folder (or the folder containing the TheOtherRoles mod), go to the subfolder BepInEx/config/ and replace the *Custom Server IP* and *Custom Server Port* in the **me.eisbison.theotherroles.cfg** with the ones of your server\r
-3. Launch the game and select the region *Custom*\r
+1. Open the region menu where you can choose between the different regions\r
+2. Select the region *Custom*\r
+3. Enter the ip/domain and the port of your custom server in the corresponding text fields\r
\r
**Setup the Server:**\r
1. Get the [Impostor](https://github.com/Impostor/Impostor) release for the Among Us version **2021.3.31 - 2021.4.2**\r
\r
\r
# Credits & Resources\r
+[OxygenFilter](https://github.com/NuclearPowered/Reactor.OxygenFilter) - For all versions above v2.3.0, we're using the OxygenFilter for automatic deobfuscation\\r
[Reactor](https://github.com/NuclearPowered/Reactor) - The framework used for all version before v2.0.0\\r
[BepInEx](https://github.com/BepInEx) - Used to hook game functions\\r
[Essentials](https://github.com/DorCoMaNdO/Reactor-Essentials) - Custom game options by **DorCoMaNdO**:\r
\r
# Settings\r
The mod adds a few new settings to Among Us (in addition to the role settings):\r
+- **Streamer Mode:** You can activate the streamer mode in the Among Us settings. It hides the lobby code, the custom server ip and the custom server port. You can set a custom lobby code replacement text, by changing the *Streamer Mode Replacement Text* in the *BepInEx\config\me.eisbison.theotherroles.cfg* file.\r
- **Number of Impostors:** The number of Impostor count be set inside a lobby\r
- **Map:** The map can be changed inside a lobby\r
- **Maximum Number Of Meetings:** You can set the maximum number of meetings that can be called in total (every player still has personal maximum of buttons, but if the maximum number of meetings is reached you can't use your meetings even if you have some left, Impostor and Jackal meetings also count) \r
- **Allow Skips On Emergency Meetings:** If set to false, there will not be a skip button in emergency meetings. If a player does not vote, he'll vote himself.\r
+- **Hide Player Names:** Hides the names of all players that have role which is unknown to you. Team Lovers/Impostors/Jackal still see the names of their teammates. Impostors can alse see the name of the Spy and everyone can still see the age of the child.\r
+\r
+# Custom Hats\r
+## Create and submit new hat designs\r
+We're awaiting your creative hat designs and we'll integrate all the good ones in our mod.\r
+Here are a few instructions, on how to create a custom hat:\r
+\r
+- **Creation:** A hat consists of up to three textures. The aspect ratio of the textures has to be `4:5`, we recommend `300px:375px`:\r
+ - `Main texture (required)`:\r
+ - This is the main texture of your hat. It will usually be rendered in front of the player, if you set the `behind` parameter it will be rendered behind the player.\r
+ - The name of the texture needs to follow the pattern *hatname.png*, but you can also set some additional parameters in the file name by adding *_parametername* to the file name (before the *.png*).\r
+ - Parameter `bounce`: This parameter determines whether the hat will bounce while you're walking or not.\r
+ - Parameter `adaptive`: If this parameter is set, the Among Us coloring shader will be applied (the shader that replaces some colors with the colors that your character is wearing in the game). The color red (#ff0000) will be replaced with the primary color of your player and the color blue (#0000ff) with the secondary color. Also other colors will be affected and changed, you can have a look at the texture of the [Crewmate Hat](https://static.wikia.nocookie.net/among-us-wiki/images/e/e0/Crewmate_hat.png/revision/latest?cb=20210106045508) to see how this feature should be used.\r
+ - Parameter `behind`: If this parameter is set, the main texture will be rendered behind the player.\r
+ - `Back texture (optional)`:\r
+ - This texture will be rendered behind the player.\r
+ - The name of the texture needs to follow the pattern *hatname_back.png*.\r
+ - `Climb texture (optional)`:\r
+ - This texture will be rendered in front of the player, when he's climbing.\r
+ - The name of the texture needs to follow the pattern *hatname_climb.png*.\r
+- **Testing:** You can test your hat design by putting all the files in the *\TheOtherHats\Test* subfolder of your mod folder. Then whenever you start a freeplay game, you and all the dummies will be wearing the new hat. You don't need to restart Among Us if you change the hat files, just exit and reenter the freeplay mode.\r
+\r
+- **Submission:** If you got a hat design, you can submit it on our [Discord server](https://discord.gg/77RkMJHWsM). We'll look at all the hats and add all the good ones to the game.\r
+\r
+# Colors\r
+### **Lighter Colors:** \r
+- Pink, Orange, Yellow, White\r
+- Cyan, Lime, Salmon, Mint\r
+- Lavender, Peach, Wasabi, Hot Pink\r
+\r
+\r
+\r
+### **Darker Colors:** \r
+- Red, Blue, Green, Black\r
+- Purple, Brown, Bordeaux, Olive\r
+- Turqoise, Nougat, Gray, Petrol\r
+\r
+\r
+\r
# Roles\r
\r
## Role Assignment\r
First you need to choose how many special roles you want in the game (one option for Impostor roles and one option for the rest).\r
The count you set will only be reached, if there are enough Crewmates/Impostors in the game and if enough roles are set to be in the game (i.e. they are set to > 0%). The roles are then being distributed as follows:\r
- First all roles that are set to 100% are being assigned to arbitrary players\r
-- After that each role that has 10%-90% selected adds 1-9 tickets to a ticket pool (one pool for Impostors, one for Crewmates). Then the roles will be selected randomly from that pool as long as possible (until the selected number is reached, until there are no more crewmates or until there are no more tickets). If a role is selected from the pool, obviously all the tickets of that role are being removed.\r
+- After that each role that has 10%-90% selected adds 1-9 tickets to a ticket pool (one pool for Impostors, one for Crewmates). Then the roles will be selected randomly from that pool as long as possible (until the selected number is reached, until there are no more Crewmates or until there are no more tickets). If a role is selected from the pool, obviously all the tickets of that role are being removed.\r
\r
**Example:**\\r
-Settings: 2 special crewmate roles, Snitch: 100%, Hacker: 10%, Tracker: 30%\\r
+Settings: 2 special Crewmate roles, Snitch: 100%, Hacker: 10%, Tracker: 30%\\r
Result: Snitch is assigned, then one role out of the pool [Hacker, Tracker, Tracker, Tracker] is being selected\\r
Note: Changing the settings to Hacker: 20%, Tracker: 60% would statistically result in the same outcome .\r
\r
### **Team: Impostors**\r
The Mafia are a group of three Impostors.\\r
The Godfather works like a normal Impostor.\\r
-The Mafioso is an impostor who cannot kill nor sabotage until the Godfather is dead.\\r
-The Janitor is an impostor who cannot kill nor sabotage, but they can hide dead bodies instead.\\r
+The Mafioso is an Impostor who cannot kill nor sabotage until the Godfather is dead.\\r
+The Janitor is an Impostor who cannot kill nor sabotage, but they can hide dead bodies instead.\\r
\\r
**NOTE:**\r
-- There have to be 3 impostors activated for the mafia to spawn.\r
+- There have to be 3 Impostors activated for the mafia to spawn.\r
\r
### Game Options\r
| Name | Description |\r
\r
## Morphling\r
### **Team: Impostors**\r
-The Morphling is an impostor which can additionally scan the appearance of a player. After an arbitrary time they can take on that appearance for 10s.\r
+The Morphling is an Impostor which can additionally scan the appearance of a player. After an arbitrary time they can take on that appearance for 10s.\r
\\r
**NOTE:**\r
-- They shrink to the size of the child when they copies its look.\r
-- The Spy sees their new color on the admin table.\r
+- They shrink to the size of the Child when they copies its look.\r
+- The Hacker sees the new color on the admin table.\r
- The color of the footprints changes accordingly (also the ones that were already on the ground).\r
-- The other impostor still sees that they are an impostor (the name remains red).\r
+- The other Impostor still sees that they are an Impostor (the name remains red).\r
- The shield indicator changes accordingly (the Morphling gains or loses the shield indicator)\r
- Tracker and Snitch arrows keep working.\r
\r
\r
## Camouflager\r
### **Team: Impostors**\r
-The Camouflager is an impostor which can additionally activate a camouflage mode.\r
+The Camouflager is an Impostor which can additionally activate a camouflage mode.\r
The camouflage mode lasts for 10s and while it is active, all player names/pets/hats\r
are hidden and all players have the same color.\\r
\\r
**NOTE**\r
- The Child will look like all the other players\r
- The color of the footprints turns gray (also the ones that were already on the ground).\r
-- The Spy sees gray icons on the admin table\r
+- The Hacker sees gray icons on the admin table\r
- The shield is not visible anymore\r
- Tracker and Snitch arrows keep working\r
\r
\r
## Vampire\r
### **Team: Impostors**\r
-The Vampire is an impostor, that can bite other player. Bitten players die after a configurable amount of time.\\r
+The Vampire is an Impostor, that can bite other player. Bitten players die after a configurable amount of time.\\r
If the Vampire spawn chance is greater 0 (even if there is no Vampire in the game), all players can place one garlic.\\r
If a victim is near a garlic, the "Bite Button" turns into the default "Kill Button" and the Vampire can only perform a normal kill.\\r
\\r
- Erasing a Lover automatically erases the other Lover as well (if the second Lover is an ImpLover, he will turn into an Impostor)\r
- Erasing a Jackal that has a Sidekick, triggers the Sidekick promotion if it's activated in the settings\r
- As the erasing is being triggered before the eject of a player, erasing and voting out a Lover in the same round, would result in the\r
-ex lover surviving as the partnership was erased before. Also a Jester win would not happen, as the erase will be triggered before.\r
+ex Lover surviving as the partnership was erased before. Also a Jester win would not happen, as the erase will be triggered before.\r
\r
### Game Options\r
| Name | Description |\r
## Trickster\r
### **Team: Impostors**\r
The Trickster is an Impostor that can place 3 jack-in-the-boxes that are invisible at first to other players. \\r
-If the Trickster has placed all of his boxes they will be converted into a vent network usable only by the trickster himself, but the boxes are revealed to the others. \\r
-If the boxes are converted to a vent network, the trickster gains a new ability "Lights out" to limit the visibility of Non-Impostors, that cannot be fixed by other players. Lights are automatically restored after a while. \\r
+If the Trickster has placed all of his boxes they will be converted into a vent network usable only by the Trickster himself, but the boxes are revealed to the others. \\r
+If the boxes are converted to a vent network, the Trickster gains a new ability "Lights out" to limit the visibility of Non-Impostors, that cannot be fixed by other players. Lights are automatically restored after a while. \\r
\r
\\r
**NOTE:**\r
-- Impostors will get a text indicator at the bottom of the screen to notify them if the lights are out due to the trickster ability, as there is no sabotage arrows or task to sabotage text to otherwise notify them about it.\r
+- Impostors will get a text indicator at the bottom of the screen to notify them if the lights are out due to the Trickster ability, as there is no sabotage arrows or task to sabotage text to otherwise notify them about it.\r
\r
### Game Options\r
| Name | Description |\r
| Trickster Lights Out Duration | Duration after which the light is automatically restored\r
-----------------------\r
\r
+## Cleaner\r
+### **Team: Impostors**\r
+The Cleaner is an Impostor who has the ability to clean up dead bodies. \\r
+\r
+\\r
+**NOTE:**\r
+- The Kill and Clean cooldown are shared, preventing him from immediately cleaning his own kills.\r
+\r
+### Game Options\r
+| Name | Description |\r
+|----------|:-------------:|\r
+| Cleaner Spawn Chance | -\r
+| Cleaner Cooldown | Cooldown for cleaning dead bodies\r
+-----------------------\r
+\r
## Lovers\r
### **Team: Either Crewmates or Impostors**\r
-There are always two lovers which are linked together.\\r
+There are always two Lovers which are linked together.\\r
Their goal is it to stay alive together until the end of the game.\\r
If one Lover dies (and the option is activated), the other Lover suicides.\\r
-You can specify the chance of one Lover being an impostor.\\r
+You can specify the chance of one Lover being an Impostor.\\r
The Lovers never know the role of their partner, they only see who their partner is.\\r
The Lovers win if they are both alive among the last 3 players, however they can also win with their respective role.\\r
-If both Lovers are crewmates, they can achieve a "double victory" but the crewmates then also win.\\r
-If one Lover is an impostor and one a crewmate, they can only get a "Lovers solo win" where only they win (even if there is another impostor alive).\\r
+If both Lovers are Crewmates, they can achieve a "double victory" but the Crewmates then also win.\\r
+If one Lover is an Impostor and one a Crewmate, they can only get a "Lovers solo win" where only they win (even if there is another Impostor alive).\\r
\\r
**NOTE:**\r
-- If there is an equal amount of impostors and crewmates left in the game and one of the Lovers is an impostor, the game is not automatically over since the Lovers can still achieve a solo win. E.g. if there are the following roles Impostor + ImpLover + Lover + Crewmate left, the game will not end and the next kill will decide if the impostors or Lovers win.\r
+- If there is an equal amount of Impostors and Crewmates left in the game and one of the Lovers is an Impostor, the game is not automatically over since the Lovers can still achieve a solo win. E.g. if there are the following roles Impostor + ImpLover + Lover + Crewmate left, the game will not end and the next kill will decide if the Impostors or Lovers win.\r
- The Lovers can change if the Shifter takes the role of a Lovers\r
\r
### Game Options\r
\r
## Sheriff\r
### **Team: Crewmates**\r
-The Sheriff has the ability to kill impostors.\r
-If they try to kill a crewmate, they die instead.\r
+The Sheriff has the ability to kill Impostors.\r
+If they try to kill a Crewmate, they die instead.\r
\r
**NOTE**\r
- If the Sheriff shoots the person the Medic shielded, the Sheriff and the shielded person **both remain unharmed**.\r
## Engineer\r
### **Team: Crewmates**\r
The Engineer (if alive) can fix one sabotage per game from anywhere on the map.\\r
-The Engineer can use vents. If the Engineer is inside a vent, the impostors will see a blue outline\r
+The Engineer can use vents. If the Engineer is inside a vent, the Impostors will see a blue outline\r
around all vents on the map (in order to warn them).\r
Because of the vents the Engineer might not be able to start some tasks using the "Use" button,\r
you can double click on the tasks instead.\r
The Detective's other feature shows when they report a corpse: they recieve clues about the killer's identity. The type of information they get is based on the time it took them to find the corpse.\r
\\r
**NOTE**\r
-- **Lighter Colors:** Pink, orange, yellow, white, cyan, lime\r
-- **Darker Colors:** Red, blue, green, grey, purple, brown\r
- When people change their colors (because of a morph or camouflage), all the footprints also change their colors (also the ones that were already on the ground). If the effects are over, all footprints switch back to the original color.\r
-- The detective does not see footprints of players that sit in vents\r
+- The Detective does not see footprints of players that sit in vents\r
+- More information about the [colors](#colors)\r
\r
### Game Options\r
| Name | Description |\r
\r
## Lighter\r
### **Team: Crewmates**\r
-The Lighter can turn on his lighter every now and then, which increases his vision by a costumizable amount.\r
+The Lighter can turn on his Lighter every now and then, which increases his vision by a costumizable amount.\r
\r
### Game Options\r
| Name | Description |\r
## Medic\r
### **Team: Crewmates**\r
The Medic can shield (highlighted by an outline around the player) one player per game, which makes the player unkillable.\\r
-The shielded player can still be voted out and might also be an impostor.\\r
+The shielded player can still be voted out and might also be an Impostor.\\r
If set in the options, the shielded player will get a red flash on their screen if someone (Impostor, Sheriff, ...) tried to murder them.\r
If the Medic dies, the shield disappears with them.\\r
-The Sheriff will not die if they try to kill a shielded crewmate and won't perform a kill if they try to kill a shielded impostor.\\r
+The Sheriff will not die if they try to kill a shielded Crewmate and won't perform a kill if they try to kill a shielded Impostor.\\r
The Medic's other feature shows when they report a corpse: they will see how long ago the player died\r
\\r
**NOTE**\r
\r
## Mayor\r
### **Team: Crewmates**\r
-The Mayor leades the crewmates by having a vote that counts twice.\\r
+The Mayor leades the Crewmates by having a vote that counts twice.\\r
The Mayor can always use his meeting, even if the maximum number of meetings was reached.\r
\r
### Game Options\r
### **Team: Crewmates**\r
If the Hacker activates the "Hacker mode", the Hacker gets more information than others from the admin table and vitals for a set duration.\\r
Otherwise he sees the same information as everyone else.\r
-**Admin table:** The hacker can see the colors (or color types) of the players on the table.\\r
-**Vitals**: The hacker can see how long dead players have been dead for.\\r
+**Admin table:** The Hacker can see the colors (or color types) of the players on the table.\\r
+**Vitals**: The Hacker can see how long dead players have been dead for.\\r
\\r
**NOTE:**\r
- If the Morphling morphes or the Camouflager camouflages, the colors on the admin table change accordingly\r
-- **Lighter Colors:** Pink, orange, yellow, white, cyan, lime\r
-- **Darker Colors:** Red, blue, green, grey, purple, brown\r
+- More information about the [colors](#colors)\r
\r
### Game Options\r
| Name | Description |\r
| Hacker Spawn Chance | -\r
| Hacker Cooldown| -\r
| Hacker Duration | Sets how long the "Hacker mode" remains active\r
-| Hacker Only Sees Color Type | Sets if the Hacker sees the player colors on the admin table or only white/gray (for lighter and darker colors) \r
+| Hacker Only Sees Color Type | Sets if the Hacker sees the player colors on the admin table or only white/gray (for Lighter and darker colors) \r
-----------------------\r
\r
\r
The Shift will always be performed at the end of the next meeting right before a player is exiled. The target needs to be chosen during the round.\\r
Even if the Shifter or the target dies before the meeting, the Shift will still be performed.\\r
Swapping roles with a Crewmate or Neutral gives them their role, the other player becomes a Crewmate.\\r
-Swapping roles with an impostor or a custom impostor role fails and the Shifter commits suicide (there won't be a body after the meeting).\\r
+Swapping roles with an Impostor or a custom Impostor role fails and the Shifter commits suicide after the next meeting (there won't be any body).\\r
The Shifter aims to save roles from leaving the game, by e.g. taking over a Sheriff or Medic that is known to the Impostors.\\r
This works especially well against the Eraser, but also gives the Eraser the possiblity to act like a Shifter.\\r
The **special interactions** with the Shifter are noted in the chapters of the respective roles.\\r
**NOTE:**\r
- The Shifter shift will always be triggered before the Erase (hence either the new role of the Shifter will be erased or the Shifter saves the role of his target, depending on who the Eraser erased)\r
- If the Shifter takes over a role, their new cooldowns will start at the maximum cooldown of the ability\r
-- One time use abilities (e.g. shielding a player or engineer sabotage fix) can only used by one player in the game (i.e. the Shifter\r
+- One time use abilities (e.g. shielding a player or Engineer sabotage fix) can only used by one player in the game (i.e. the Shifter\r
can only use them, if the previous player did not used them before)\r
\r
### Game Options\r
\r
## Snitch\r
### **Team: Crewmates**\r
-When the Snitch finishes all the tasks, arrows will appear (only visible to the Snitch) that point to the impostors.\r
-When the Snitch has one task left (configurable) the Snitch will be revealed to the impostors, also with an arrow.\r
+When the Snitch finishes all the tasks, arrows will appear (only visible to the Snitch) that point to the Impostors.\r
+When the Snitch has one task left (configurable) the Snitch will be revealed to the Impostors, also with an arrow.\r
\r
### Game Options\r
| Name | Description\r
**NOTE:**\r
- The Jackal (and his Sidekick) may be killed by a Sheriff.\r
- A Jackal cannot target the Child, while it's growing up. After that he can kill it or select it as its Sidekick\r
-- The Crew can still win, even if all of their members are dead, if they finish their tasks fast enough (that's why converting the last crewmate with tasks left into a Sidekick results in a task win for the crew)\r
+- The Crew can still win, even if all of their members are dead, if they finish their tasks fast enough (that's why converting the last Crewmate with tasks left into a Sidekick results in a task win for the crew)\r
\r
-If both impostors and jackals are in the game the game continues even if all crewmates are dead. Crewmates may still win in this case by completing their tasks. Jackal and Impostor have to kill each other.\r
+If both Impostors and Jackals are in the game the game continues even if all Crewmates are dead. Crewmates may still win in this case by completing their tasks. Jackal and Impostor have to kill each other.\r
\r
\r
\r
|----------|:-------------:|\r
| Jackal Spawn Chance | - |\r
| Jackal/Sidekick Kill Cooldown | Kill cooldown |\r
-| Jackal Create Sidekick Cooldown | Cooldown before a sidekick can be created |\r
+| Jackal Create Sidekick Cooldown | Cooldown before a Sidekick can be created |\r
| Jackal can use vents | Yes/No |\r
-| Jackal can create a sidekick | Yes/No |\r
-| Jackals promoted from sidekick can create a sidekick | Yes/No (to prevent the jackal team from growing) |\r
-| Jackals can make an impostor to his sidekick | Yes/No (to prevent a jackal from turning an impostor into a sidekick, if he uses the ability on an impostor he sees the impostor as sidekick, but the impostor isn't converted to sidekick. If this option is set to "No" Jackal and Sidekick can kill each other ) |\r
+| Jackal can create a Sidekick | Yes/No |\r
+| Jackals promoted from Sidekick can create a Sidekick | Yes/No (to prevent the Jackal team from growing) |\r
+| Jackals can make an Impostor to his Sidekick | Yes/No (to prevent a Jackal from turning an Impostor into a Sidekick, if he uses the ability on an Impostor he sees the Impostor as Sidekick, but the Impostor isn't converted to Sidekick. If this option is set to "No" Jackal and Sidekick can kill each other ) |\r
-----------------------\r
\r
## Sidekick\r
Upon the death of the Jackal (depending on the options), he might get promoted to Jackal himself and potentially even assign a Sidekick of his own.\r
\\r
**NOTE:**\r
-- A player that converts into a Sidekick loses his previous role and tasks (if he had one), except the lover role.\r
+- A player that converts into a Sidekick loses his previous role and tasks (if he had one), except the Lover role.\r
- The Sidekick may be killed by a Sheriff.\r
- The Sidekick cannot target the Child, while it's growing up.\r
\r
\r
# Source code\r
It's bad I know, this is a side project and my second week of modding. So there are no best practices around here.\r
-You can use parts of the codes but don't copy paste the whole thing. Make sure you give credits to the other developers, because some parts of the code are based on theirs.\r
+You can use parts of the code but don't copy paste the whole thing. Make sure you give credits to the other developers, because some parts of the code are based on theirs.\r
\r
# Bugs, suggestions and requests\r
-If you found any bugs, have an idea for an idea for a new role or any other request, join my [Discord server](https://discord.gg/77RkMJHWsM)
\ No newline at end of file
+If you found any bugs, have an idea for a new role or any other request, join our [Discord server](https://discord.gg/77RkMJHWsM)\r
using UnityEngine;
using static TheOtherRoles.TheOtherRoles;
-using Palette = BLMBFIODBKL;
-using TaskTypes = DMOAGPGAFKM;
-using SystemTypes = BCPJLGGNHBC;
-using Constants = LNCOKMACBKP;
-using PhysicsHelpers = FJFJIDCFLDJ;
-using Effects = AEOEPNHOJDP;
-
namespace TheOtherRoles
{
[HarmonyPatch(typeof(HudManager), nameof(HudManager.Start))]
private static CustomButton eraserButton;
private static CustomButton placeJackInTheBoxButton;
private static CustomButton lightsOutButton;
+ public static CustomButton cleanerCleanButton;
public static void setCustomButtonCooldowns() {
engineerRepairButton.MaxTimer = 0f;
eraserButton.MaxTimer = Eraser.cooldown;
placeJackInTheBoxButton.MaxTimer = Trickster.placeBoxCooldown;
lightsOutButton.MaxTimer = Trickster.lightsOutCooldown;
+ cleanerCleanButton.MaxTimer = Cleaner.cooldown;
timeMasterShieldButton.EffectDuration = TimeMaster.shieldDuration;
hackerButton.EffectDuration = Hacker.duration;
vampireKillButton.EffectDuration = Vampire.delay;
lighterButton.EffectDuration = Lighter.duration;
+ camouflagerButton.EffectDuration = Camouflager.duration;
+ morphlingButton.EffectDuration = Morphling.duration;
lightsOutButton.EffectDuration = Trickster.lightsOutDuration;
// Already set the timer to the max, as the button is enabled during the game and not available at the start
public static void resetTimeMasterButton() {
timeMasterShieldButton.Timer = timeMasterShieldButton.MaxTimer;
timeMasterShieldButton.isEffectActive = false;
- timeMasterShieldButton.killButtonManager.TimerText.color = Palette.BJENLBHMKAI;
+ timeMasterShieldButton.killButtonManager.TimerText.color = Palette.EnabledColor;
}
public static void Postfix(HudManager __instance)
}
}
},
- () => { return Engineer.engineer != null && Engineer.engineer == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI; },
+ () => { return Engineer.engineer != null && Engineer.engineer == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead; },
() => {
bool sabotageActive = false;
foreach (PlayerTask task in PlayerControl.LocalPlayer.myTasks)
if (task.TaskType == TaskTypes.FixLights || task.TaskType == TaskTypes.RestoreOxy || task.TaskType == TaskTypes.ResetReactor || task.TaskType == TaskTypes.ResetSeismic || task.TaskType == TaskTypes.FixComms || task.TaskType == TaskTypes.StopCharles)
sabotageActive = true;
- return sabotageActive && !Engineer.usedRepair && PlayerControl.LocalPlayer.POECPOEKKNO;
+ return sabotageActive && !Engineer.usedRepair && PlayerControl.LocalPlayer.CanMove;
},
() => {},
Engineer.getButtonSprite(),
// Janitor Clean
janitorCleanButton = new CustomButton(
() => {
- foreach (Collider2D collider2D in Physics2D.OverlapCircleAll(PlayerControl.LocalPlayer.GetTruePosition(), PlayerControl.LocalPlayer.MaxReportDistance, Constants.ODGOCDBFMFC)) {
+ foreach (Collider2D collider2D in Physics2D.OverlapCircleAll(PlayerControl.LocalPlayer.GetTruePosition(), PlayerControl.LocalPlayer.MaxReportDistance, Constants.PlayersOnlyMask)) {
if (collider2D.tag == "DeadBody")
{
DeadBody component = collider2D.GetComponent<DeadBody>();
if (component && !component.Reported)
{
Vector2 truePosition = PlayerControl.LocalPlayer.GetTruePosition();
- Vector2 truePosition2 = component.AMIPFAILDIF;
- if (Vector2.Distance(truePosition2, truePosition) <= PlayerControl.LocalPlayer.MaxReportDistance && PlayerControl.LocalPlayer.POECPOEKKNO && !PhysicsHelpers.DOAHONIIFJD(truePosition, truePosition2, Constants.LEOCDMEJGPA, false))
+ Vector2 truePosition2 = component.TruePosition;
+ if (Vector2.Distance(truePosition2, truePosition) <= PlayerControl.LocalPlayer.MaxReportDistance && PlayerControl.LocalPlayer.CanMove && !PhysicsHelpers.AnythingBetween(truePosition, truePosition2, Constants.ShipAndObjectsMask, false))
{
- GameData.LGBOMGHJELL LGBOMGHJELL = GameData.Instance.GetPlayerById(component.ParentId);
+ GameData.PlayerInfo playerInfo = GameData.Instance.GetPlayerById(component.ParentId);
- MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.JanitorClean, Hazel.SendOption.Reliable, -1);
- writer.Write(LGBOMGHJELL.FNPNJHNKEBK);
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.CleanBody, Hazel.SendOption.Reliable, -1);
+ writer.Write(playerInfo.PlayerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
- RPCProcedure.janitorClean(LGBOMGHJELL.FNPNJHNKEBK);
+ RPCProcedure.cleanBody(playerInfo.PlayerId);
janitorCleanButton.Timer = janitorCleanButton.MaxTimer;
break;
}
}
},
- () => { return Janitor.janitor != null && Janitor.janitor == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI; },
- () => { return __instance.ReportButton.renderer.color == Palette.BJENLBHMKAI && PlayerControl.LocalPlayer.POECPOEKKNO; },
- () => { janitorCleanButton.Timer = janitorCleanButton.MaxTimer;},
+ () => { return Janitor.janitor != null && Janitor.janitor == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead; },
+ () => { return __instance.ReportButton.renderer.color == Palette.EnabledColor && PlayerControl.LocalPlayer.CanMove; },
+ () => { janitorCleanButton.Timer = janitorCleanButton.MaxTimer; },
Janitor.getButtonSprite(),
new Vector3(-1.3f, 0, 0),
__instance
}
byte targetId = 0;
- if ((Sheriff.currentTarget.PPMOEEPBHJO.FDNMBJOAPFL && (Sheriff.currentTarget != Child.child || Child.isGrownUp())) ||
+ if ((Sheriff.currentTarget.Data.IsImpostor && (Sheriff.currentTarget != Child.child || Child.isGrownUp())) ||
Sheriff.currentTarget == Jackal.jackal ||
Sheriff.currentTarget == Sidekick.sidekick ||
(Sheriff.spyCanDieToSheriff && Spy.spy != null && Spy.spy == Sheriff.currentTarget) ||
sheriffKillButton.Timer = sheriffKillButton.MaxTimer;
Sheriff.currentTarget = null;
},
- () => { return Sheriff.sheriff != null && Sheriff.sheriff == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI; },
- () => { return Sheriff.currentTarget && PlayerControl.LocalPlayer.POECPOEKKNO; },
+ () => { return Sheriff.sheriff != null && Sheriff.sheriff == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead; },
+ () => { return Sheriff.currentTarget && PlayerControl.LocalPlayer.CanMove; },
() => { sheriffKillButton.Timer = sheriffKillButton.MaxTimer;},
__instance.KillButton.renderer.sprite,
new Vector3(-1.3f, 0, 0),
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.timeMasterShield();
},
- () => { return TimeMaster.timeMaster != null && TimeMaster.timeMaster == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI; },
- () => { return PlayerControl.LocalPlayer.POECPOEKKNO; },
+ () => { return TimeMaster.timeMaster != null && TimeMaster.timeMaster == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead; },
+ () => { return PlayerControl.LocalPlayer.CanMove; },
() => {
timeMasterShieldButton.Timer = timeMasterShieldButton.MaxTimer;
timeMasterShieldButton.isEffectActive = false;
- timeMasterShieldButton.killButtonManager.TimerText.color = Palette.BJENLBHMKAI;
+ timeMasterShieldButton.killButtonManager.TimerText.color = Palette.EnabledColor;
},
TimeMaster.getButtonSprite(),
new Vector3(-1.3f, 0, 0),
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.medicSetShielded(Medic.currentTarget.PlayerId);
},
- () => { return Medic.medic != null && Medic.medic == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI; },
- () => { return !Medic.usedShield && Medic.currentTarget && PlayerControl.LocalPlayer.POECPOEKKNO; },
+ () => { return Medic.medic != null && Medic.medic == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead; },
+ () => { return !Medic.usedShield && Medic.currentTarget && PlayerControl.LocalPlayer.CanMove; },
() => {},
Medic.getButtonSprite(),
new Vector3(-1.3f, 0, 0),
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.setFutureShifted(Shifter.currentTarget.PlayerId);
},
- () => { return Shifter.shifter != null && Shifter.shifter == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI; },
- () => { return Shifter.currentTarget && Shifter.futureShift == null && PlayerControl.LocalPlayer.POECPOEKKNO; },
+ () => { return Shifter.shifter != null && Shifter.shifter == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead; },
+ () => { return Shifter.currentTarget && Shifter.futureShift == null && PlayerControl.LocalPlayer.CanMove; },
() => { },
Shifter.getButtonSprite(),
new Vector3(-1.3f, 0, 0),
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.morphlingMorph(Morphling.sampledTarget.PlayerId);
Morphling.sampledTarget = null;
- morphlingButton.EffectDuration = 10f;
+ morphlingButton.EffectDuration = Morphling.duration;
} else if (Morphling.currentTarget != null) {
Morphling.sampledTarget = Morphling.currentTarget;
morphlingButton.Sprite = Morphling.getMorphSprite();
morphlingButton.EffectDuration = 1f;
}
},
- () => { return Morphling.morphling != null && Morphling.morphling == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI; },
- () => { return (Morphling.currentTarget || Morphling.sampledTarget) && PlayerControl.LocalPlayer.POECPOEKKNO; },
+ () => { return Morphling.morphling != null && Morphling.morphling == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead; },
+ () => { return (Morphling.currentTarget || Morphling.sampledTarget) && PlayerControl.LocalPlayer.CanMove; },
() => {
morphlingButton.Timer = morphlingButton.MaxTimer;
morphlingButton.Sprite = Morphling.getSampleSprite();
morphlingButton.isEffectActive = false;
- morphlingButton.killButtonManager.TimerText.color = Palette.BJENLBHMKAI;
+ morphlingButton.killButtonManager.TimerText.color = Palette.EnabledColor;
Morphling.sampledTarget = null;
},
Morphling.getSampleSprite(),
new Vector3(-1.3f, 1.3f, 0f),
__instance,
true,
- 10f,
+ Morphling.duration,
() => {
if (Morphling.sampledTarget == null) {
morphlingButton.Timer = morphlingButton.MaxTimer;
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.camouflagerCamouflage();
},
- () => { return Camouflager.camouflager != null && Camouflager.camouflager == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI; },
- () => { return PlayerControl.LocalPlayer.POECPOEKKNO; },
+ () => { return Camouflager.camouflager != null && Camouflager.camouflager == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead; },
+ () => { return PlayerControl.LocalPlayer.CanMove; },
() => {
camouflagerButton.Timer = camouflagerButton.MaxTimer;
camouflagerButton.isEffectActive = false;
- camouflagerButton.killButtonManager.TimerText.color = Palette.BJENLBHMKAI;
+ camouflagerButton.killButtonManager.TimerText.color = Palette.EnabledColor;
},
Camouflager.getButtonSprite(),
new Vector3(-1.3f, 1.3f, 0f),
__instance,
true,
- 10f,
+ Camouflager.duration,
() => { camouflagerButton.Timer = camouflagerButton.MaxTimer; }
);
() => {
Hacker.hackerTimer = Hacker.duration;
},
- () => { return Hacker.hacker != null && Hacker.hacker == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI; },
- () => { return PlayerControl.LocalPlayer.POECPOEKKNO; },
+ () => { return Hacker.hacker != null && Hacker.hacker == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead; },
+ () => { return PlayerControl.LocalPlayer.CanMove; },
() => {
hackerButton.Timer = hackerButton.MaxTimer;
hackerButton.isEffectActive = false;
- hackerButton.killButtonManager.TimerText.color = Palette.BJENLBHMKAI;
+ hackerButton.killButtonManager.TimerText.color = Palette.EnabledColor;
},
Hacker.getButtonSprite(),
new Vector3(-1.3f, 0, 0),
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.trackerUsedTracker(Tracker.currentTarget.PlayerId);
},
- () => { return Tracker.tracker != null && Tracker.tracker == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI; },
- () => { return PlayerControl.LocalPlayer.POECPOEKKNO && Tracker.currentTarget != null && !Tracker.usedTracker; },
+ () => { return Tracker.tracker != null && Tracker.tracker == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead; },
+ () => { return PlayerControl.LocalPlayer.CanMove && Tracker.currentTarget != null && !Tracker.usedTracker; },
() => { },
Tracker.getButtonSprite(),
new Vector3(-1.3f, 0, 0),
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.vampireSetBitten(Vampire.bitten.PlayerId, 0);
- HudManager.CHNDKKBEIDG.StartCoroutine(Effects.DCHLMIDMBHG(Vampire.delay, new Action<float>((p) => { // Delayed action
+ HudManager.Instance.StartCoroutine(Effects.Lerp(Vampire.delay, new Action<float>((p) => { // Delayed action
if (p == 1f) {
- if (Vampire.bitten != null && !Vampire.bitten.PPMOEEPBHJO.IAGJEKLJCCI && Helpers.handleMurderAttempt(Vampire.bitten)) {
+ if (Vampire.bitten != null && !Vampire.bitten.Data.IsDead && Helpers.handleMurderAttempt(Vampire.bitten)) {
// Perform kill
MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireTryKill, Hazel.SendOption.Reliable, -1);
AmongUsClient.Instance.FinishRpcImmediately(killWriter);
vampireKillButton.HasEffect = false; // Block effect if no action was fired
}
},
- () => { return Vampire.vampire != null && Vampire.vampire == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI; },
+ () => { return Vampire.vampire != null && Vampire.vampire == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead; },
() => {
if (Vampire.targetNearGarlic && Vampire.canKillNearGarlics)
vampireKillButton.killButtonManager.renderer.sprite = __instance.KillButton.renderer.sprite;
else
vampireKillButton.killButtonManager.renderer.sprite = Vampire.getButtonSprite();
- return Vampire.currentTarget != null && PlayerControl.LocalPlayer.POECPOEKKNO && (!Vampire.targetNearGarlic || Vampire.canKillNearGarlics);
+ return Vampire.currentTarget != null && PlayerControl.LocalPlayer.CanMove && (!Vampire.targetNearGarlic || Vampire.canKillNearGarlics);
},
() => {
vampireKillButton.Timer = vampireKillButton.MaxTimer;
vampireKillButton.isEffectActive = false;
- vampireKillButton.killButtonManager.TimerText.color = Palette.BJENLBHMKAI;
+ vampireKillButton.killButtonManager.TimerText.color = Palette.EnabledColor;
},
Vampire.getButtonSprite(),
new Vector3(-1.3f, 0, 0),
writer.EndMessage();
RPCProcedure.placeGarlic(buff);
},
- () => { return !Vampire.localPlacedGarlic && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI && Vampire.garlicsActive; },
- () => { return PlayerControl.LocalPlayer.POECPOEKKNO && !Vampire.localPlacedGarlic; },
+ () => { return !Vampire.localPlacedGarlic && !PlayerControl.LocalPlayer.Data.IsDead && Vampire.garlicsActive; },
+ () => { return PlayerControl.LocalPlayer.CanMove && !Vampire.localPlacedGarlic; },
() => { },
Vampire.getGarlicButtonSprite(),
Vector3.zero,
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.jackalCreatesSidekick(Jackal.currentTarget.PlayerId);
},
- () => { return Jackal.canCreateSidekick && Sidekick.sidekick == null && Jackal.fakeSidekick == null && Jackal.jackal != null && Jackal.jackal == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI; },
- () => { return Sidekick.sidekick == null && Jackal.fakeSidekick == null && Jackal.currentTarget != null && PlayerControl.LocalPlayer.POECPOEKKNO; },
+ () => { return Jackal.canCreateSidekick && Sidekick.sidekick == null && Jackal.fakeSidekick == null && Jackal.jackal != null && Jackal.jackal == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead; },
+ () => { return Sidekick.sidekick == null && Jackal.fakeSidekick == null && Jackal.currentTarget != null && PlayerControl.LocalPlayer.CanMove; },
() => { jackalSidekickButton.Timer = jackalSidekickButton.MaxTimer;},
Jackal.getSidekickButtonSprite(),
new Vector3(-1.3f, 1.3f, 0f),
jackalKillButton.Timer = jackalKillButton.MaxTimer;
Jackal.currentTarget = null;
},
- () => { return Jackal.jackal != null && Jackal.jackal == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI; },
- () => { return Jackal.currentTarget && PlayerControl.LocalPlayer.POECPOEKKNO; },
+ () => { return Jackal.jackal != null && Jackal.jackal == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead; },
+ () => { return Jackal.currentTarget && PlayerControl.LocalPlayer.CanMove; },
() => { jackalKillButton.Timer = jackalKillButton.MaxTimer;},
__instance.KillButton.renderer.sprite,
new Vector3(-1.3f, 0, 0),
sidekickKillButton.Timer = sidekickKillButton.MaxTimer;
Sidekick.currentTarget = null;
},
- () => { return Sidekick.canKill && Sidekick.sidekick != null && Sidekick.sidekick == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI; },
- () => { return Sidekick.currentTarget && PlayerControl.LocalPlayer.POECPOEKKNO; },
+ () => { return Sidekick.canKill && Sidekick.sidekick != null && Sidekick.sidekick == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead; },
+ () => { return Sidekick.currentTarget && PlayerControl.LocalPlayer.CanMove; },
() => { sidekickKillButton.Timer = sidekickKillButton.MaxTimer;},
__instance.KillButton.renderer.sprite,
new Vector3(-1.3f, 0, 0),
() => {
Lighter.lighterTimer = Lighter.duration;
},
- () => { return Lighter.lighter != null && Lighter.lighter == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI; },
- () => { return PlayerControl.LocalPlayer.POECPOEKKNO; },
+ () => { return Lighter.lighter != null && Lighter.lighter == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead; },
+ () => { return PlayerControl.LocalPlayer.CanMove; },
() => {
lighterButton.Timer = lighterButton.MaxTimer;
lighterButton.isEffectActive = false;
- lighterButton.killButtonManager.TimerText.color = Palette.BJENLBHMKAI;
+ lighterButton.killButtonManager.TimerText.color = Palette.EnabledColor;
},
Lighter.getButtonSprite(),
new Vector3(-1.3f, 0f, 0f),
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.setFutureErased(Eraser.currentTarget.PlayerId);
},
- () => { return Eraser.eraser != null && Eraser.eraser == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI; },
- () => { return PlayerControl.LocalPlayer.POECPOEKKNO && Eraser.currentTarget != null; },
+ () => { return Eraser.eraser != null && Eraser.eraser == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead; },
+ () => { return PlayerControl.LocalPlayer.CanMove && Eraser.currentTarget != null; },
() => { eraserButton.Timer = eraserButton.MaxTimer;},
Eraser.getButtonSprite(),
new Vector3(-1.3f, 1.3f, 0f),
writer.EndMessage();
RPCProcedure.placeJackInTheBox(buff);
},
- () => { return Trickster.trickster != null && Trickster.trickster == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI && !JackInTheBox.hasJackInTheBoxLimitReached(); },
- () => { return PlayerControl.LocalPlayer.POECPOEKKNO && !JackInTheBox.hasJackInTheBoxLimitReached(); },
+ () => { return Trickster.trickster != null && Trickster.trickster == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead && !JackInTheBox.hasJackInTheBoxLimitReached(); },
+ () => { return PlayerControl.LocalPlayer.CanMove && !JackInTheBox.hasJackInTheBoxLimitReached(); },
() => { placeJackInTheBoxButton.Timer = placeJackInTheBoxButton.MaxTimer;},
Trickster.getPlaceBoxButtonSprite(),
new Vector3(-1.3f, 1.3f, 0f),
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.lightsOut();
},
- () => { return Trickster.trickster != null && Trickster.trickster == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI && JackInTheBox.hasJackInTheBoxLimitReached() && JackInTheBox.boxesConvertedToVents; },
- () => { return PlayerControl.LocalPlayer.POECPOEKKNO && JackInTheBox.hasJackInTheBoxLimitReached() && JackInTheBox.boxesConvertedToVents; },
+ () => { return Trickster.trickster != null && Trickster.trickster == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead && JackInTheBox.hasJackInTheBoxLimitReached() && JackInTheBox.boxesConvertedToVents; },
+ () => { return PlayerControl.LocalPlayer.CanMove && JackInTheBox.hasJackInTheBoxLimitReached() && JackInTheBox.boxesConvertedToVents; },
() => {
lightsOutButton.Timer = lightsOutButton.MaxTimer;
lightsOutButton.isEffectActive = false;
- lightsOutButton.killButtonManager.TimerText.color = Palette.BJENLBHMKAI;
+ lightsOutButton.killButtonManager.TimerText.color = Palette.EnabledColor;
},
Trickster.getLightsOutButtonSprite(),
new Vector3(-1.3f, 1.3f, 0f),
Trickster.lightsOutDuration,
() => { lightsOutButton.Timer = lightsOutButton.MaxTimer; }
);
+ // Cleaner Clean
+ cleanerCleanButton = new CustomButton(
+ () => {
+ foreach (Collider2D collider2D in Physics2D.OverlapCircleAll(PlayerControl.LocalPlayer.GetTruePosition(), PlayerControl.LocalPlayer.MaxReportDistance, Constants.PlayersOnlyMask)) {
+ if (collider2D.tag == "DeadBody")
+ {
+ DeadBody component = collider2D.GetComponent<DeadBody>();
+ if (component && !component.Reported)
+ {
+ Vector2 truePosition = PlayerControl.LocalPlayer.GetTruePosition();
+ Vector2 truePosition2 = component.TruePosition;
+ if (Vector2.Distance(truePosition2, truePosition) <= PlayerControl.LocalPlayer.MaxReportDistance && PlayerControl.LocalPlayer.CanMove && !PhysicsHelpers.AnythingBetween(truePosition, truePosition2, Constants.ShipAndObjectsMask, false))
+ {
+ GameData.PlayerInfo playerInfo = GameData.Instance.GetPlayerById(component.ParentId);
+
+ MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.CleanBody, Hazel.SendOption.Reliable, -1);
+ writer.Write(playerInfo.PlayerId);
+ AmongUsClient.Instance.FinishRpcImmediately(writer);
+ RPCProcedure.cleanBody(playerInfo.PlayerId);
+
+ Cleaner.cleaner.killTimer = cleanerCleanButton.Timer = cleanerCleanButton.MaxTimer;
+ break;
+ }
+ }
+ }
+ }
+ },
+ () => { return Cleaner.cleaner != null && Cleaner.cleaner == PlayerControl.LocalPlayer && !PlayerControl.LocalPlayer.Data.IsDead; },
+ () => { return __instance.ReportButton.renderer.color == Palette.EnabledColor && PlayerControl.LocalPlayer.CanMove; },
+ () => { cleanerCleanButton.Timer = cleanerCleanButton.MaxTimer; },
+ Cleaner.getButtonSprite(),
+ new Vector3(-1.3f, 1.3f, 0f),
+ __instance
+ );
// Set the default (or settings from the previous game) timers/durations when spawning the buttons
setCustomButtonCooldowns();
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using UnityEngine;
namespace TheOtherRoles
{
{
static void Postfix(PingTracker __instance)
{
- if (AmongUsClient.Instance.GameState == InnerNet.InnerNetClient.GCDONLGCMIL.Started)
- __instance.text.text += "\n<color=#FCCE03FF>TheOtherRoles</color>\nModded by <color=#FCCE03FF>Eisbison</color>";
+ __instance.transform.localPosition = new Vector3(__instance.transform.localPosition.x, 2.675f, __instance.transform.localPosition.z);
+ if (AmongUsClient.Instance.GameState == InnerNet.InnerNetClient.GameStates.Started)
+ __instance.text.text += "<color=#FCCE03FF>TheOtherRoles</color>\nModded by <color=#FCCE03FF>Eisbison</color>";
else
- __instance.text.text += "\n\n<color=#FCCE03FF>TheOtherRoles</color>\nModded by <color=#FCCE03FF>Eisbison</color>\nand <color=#FFEB91FF>Thunderstorm584</color>\nBalanced with <color=#FFEB91FF>Dhalucard</color>\nButton design by <color=#FFEB91FF>Bavari</color>";
+ __instance.text.text += "\n<color=#FCCE03FF>TheOtherRoles</color>\nModded by <color=#FCCE03FF>Eisbison</color>\nand <color=#FFEB91FF>Thunderstorm584</color>\nBalanced with <color=#FFEB91FF>Dhalucard</color>\nButton design by <color=#FFEB91FF>Bavari</color>";
}
}
}
using UnityEngine;
using Hazel;
-using Palette = BLMBFIODBKL;
-using SaveManager = BLCGIFOPMIA;
-using GameOptionsData = CEIOGGEDKAN;
-
namespace TheOtherRoles {
[HarmonyPatch]
static class GameOptionsPatch {
nextButton.gameObject.name = "1" + i;
TMPro.TMP_Text text = nextButton.gameObject.GetComponentInChildren<TMPro.TMP_Text>();
text.text = "1" + i;
- text.color = Helpers.isCustomServer() ? Color.white : Palette.EGHCBLDNCGP;
+ text.color = Helpers.isCustomServer() ? Color.white : Palette.DisabledGrey;
nextButton.transform.position = nextButton.transform.position + new Vector3(i * (maxPlayerButtons[1].transform.position.x - maxPlayerButtons[0].transform.position.x), 0, 0);
var passiveButton = nextButton.GetComponent<PassiveButton>();
foreach (SpriteRenderer renderer in additionalButtons) {
if (renderer != null && renderer.gameObject != null) {
renderer.enabled = false;
- renderer.gameObject.GetComponentInChildren<TMPro.TMP_Text>().color = isCustom ? Color.white : Palette.EGHCBLDNCGP;
+ renderer.gameObject.GetComponentInChildren<TMPro.TMP_Text>().color = isCustom ? Color.white : Palette.DisabledGrey;
}
}
byte value = byte.Parse(nextButton.name);
var targetOptions = __instance.GetTargetOptions();
- if (value <= targetOptions.DIGMGCJMGDB) {
- targetOptions.DIGMGCJMGDB = value - 1;
- __instance.SetImpostorButtons(targetOptions.DIGMGCJMGDB);
+ if (value <= targetOptions.NumImpostors) {
+ targetOptions.NumImpostors = value - 1;
+ __instance.SetImpostorButtons(targetOptions.NumImpostors);
}
__instance.SetMaxPlayersButtons(value);
}
}
public static void setLegalSettings() {
- GameOptionsData hostOptions = SaveManager.LCNLLGFAEJE;
- GameOptionsData searchOptions = SaveManager.HGGNKBMAJLO;
- if (searchOptions.OKAPDMGFNED == 0) searchOptions.PFOGBKICOHD(0); // ToggleMapFilter
+ GameOptionsData hostOptions = SaveManager.GameHostOptions;
+ GameOptionsData searchOptions = SaveManager.GameSearchOptions;
+ if (searchOptions.MapId == 0) searchOptions.ToggleMapFilter(0); // ToggleMapFilter
- hostOptions.DIGMGCJMGDB = searchOptions.DIGMGCJMGDB = 1; // NumImpostors
- hostOptions.OAFCIBONLNJ = searchOptions.OAFCIBONLNJ = 4; // MaxPlayers
+ hostOptions.NumImpostors = searchOptions.NumImpostors = 1; // NumImpostors
+ hostOptions.MaxPlayers = searchOptions.MaxPlayers = 4; // MaxPlayers
- SaveManager.LCNLLGFAEJE = hostOptions;
- SaveManager.HGGNKBMAJLO = searchOptions;
+ SaveManager.GameHostOptions = hostOptions;
+ SaveManager.GameSearchOptions = searchOptions;
}
[HarmonyPatch(typeof(FindGameButton), nameof(FindGameButton.OnClick))]
}
}
- [HarmonyPatch(typeof(SaveManager), nameof(SaveManager.LCNLLGFAEJE), MethodType.Getter)]
+ [HarmonyPatch(typeof(SaveManager), nameof(SaveManager.GameHostOptions), MethodType.Getter)]
public static class SaveManagerGetHostOptions
{
public static bool Prefix(out GameOptionsData __result)
{
- SaveManager.KMHAKICCDOJ ??= SaveManager.DHHFAHODPGO("gameHostOptions");
+ SaveManager.hostOptionsData ??= SaveManager.LoadGameOptions("gameHostOptions");
- SaveManager.KMHAKICCDOJ.DIGMGCJMGDB = Mathf.Clamp(SaveManager.KMHAKICCDOJ.DIGMGCJMGDB, 1, SaveManager.KMHAKICCDOJ.OAFCIBONLNJ - 1);
- SaveManager.KMHAKICCDOJ.OCPGKHJJAHL = Mathf.Clamp(SaveManager.KMHAKICCDOJ.OCPGKHJJAHL, 0, 2);
+ SaveManager.hostOptionsData.NumImpostors = Mathf.Clamp(SaveManager.hostOptionsData.NumImpostors, 1, SaveManager.hostOptionsData.MaxPlayers - 1);
+ SaveManager.hostOptionsData.KillDistance = Mathf.Clamp(SaveManager.hostOptionsData.KillDistance, 0, 2);
- __result = SaveManager.KMHAKICCDOJ;
+ __result = SaveManager.hostOptionsData;
return false;
}
}
public static class GameDataGetAvailableIdPatch {
public static bool Prefix(ref GameData __instance, out sbyte __result) {
for (sbyte i = 0; i <= 15; i++)
- if (!__instance.AllPlayers.ToArray().Any(p => p.FNPNJHNKEBK == i)) {
+ if (!__instance.AllPlayers.ToArray().Any(p => p.PlayerId == i)) {
__result = i;
return false;
}
[HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.CmdCheckColor))]
public static class PlayerControlCmdCheckColorPatch {
- public static bool Prefix(PlayerControl __instance, byte CKNNKEMNHAK) {
+ public static bool Prefix(PlayerControl __instance, [HarmonyArgument(0)]byte bodyColor) {
if (!Helpers.isCustomServer()) return true;
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SetUncheckedColor, Hazel.SendOption.Reliable, -1);
- writer.Write(CKNNKEMNHAK);
+ writer.Write(bodyColor);
writer.Write(__instance.PlayerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
- RPCProcedure.setUncheckedColor(CKNNKEMNHAK, __instance.PlayerId);
+ RPCProcedure.setUncheckedColor(bodyColor, __instance.PlayerId);
return false;
}
}
public static bool Prefix(PlayerTab __instance) {
if (!Helpers.isCustomServer()) return true;
- PlayerControl.SetPlayerMaterialColors(PlayerControl.LocalPlayer.PPMOEEPBHJO.IMMNCAGJJJC, __instance.DemoImage);
- for (int i = 0; i < Palette.AEDCMKGJKAG.Length; i++)
- __instance.HDGKLGFNEIB.Add(i);
+ PlayerControl.SetPlayerMaterialColors(PlayerControl.LocalPlayer.Data.ColorId, __instance.DemoImage);
+ for (int i = 0; i < Palette.PlayerColors.Length; i++)
+ __instance.AvailableColors.Add(i);
return false;
}
}
public static class SecurityLoggerAwakePatch
{
public static void Postfix(SecurityLogger __instance) {
- __instance.DLAMJHGNEIF = new float[15];
+ __instance.Timers = new float[15];
}
}
{
public static bool Prefix(KeyMinigame __instance)
{
- __instance.CKEKJGDMNDB = (PlayerControl.LocalPlayer != null) ? PlayerControl.LocalPlayer.PlayerId % 10 : 0;
- __instance.Slots[__instance.CKEKJGDMNDB].Image.sprite = __instance.Slots[__instance.CKEKJGDMNDB].Highlit;
+ __instance.targetSlotId = (PlayerControl.LocalPlayer != null) ? PlayerControl.LocalPlayer.PlayerId % 10 : 0;
+ __instance.Slots[__instance.targetSlotId].Image.sprite = __instance.Slots[__instance.targetSlotId].Highlit;
return false;
}
}
using System.Reflection;
using UnityEngine;
-using Palette = BLMBFIODBKL;
-
public class CustomButton
{
public static List<CustomButton> buttons = new List<CustomButton>();
private void Update()
{
- if (PlayerControl.LocalPlayer.PPMOEEPBHJO == null || MeetingHud.Instance || ExileController.Instance || !HasButton()) {
+ if (PlayerControl.LocalPlayer.Data == null || MeetingHud.Instance || ExileController.Instance || !HasButton()) {
setActive(false);
return;
}
if (hudManager.KillButton != null) hudManager.KillButton.transform.localPosition = hudManager.UseButton.transform.localPosition - new Vector3(1.3f, 0, 0); // Align the kill button (because it's on another position depending on the screen resolution)
}
if (CouldUse()) {
- killButtonManager.renderer.color = Palette.BJENLBHMKAI;
+ killButtonManager.renderer.color = Palette.EnabledColor;
killButtonManager.renderer.material.SetFloat("_Desat", 0f);
} else {
- killButtonManager.renderer.color = Palette.ILFJLECIGDB;
+ killButtonManager.renderer.color = Palette.DisabledClear;
killButtonManager.renderer.material.SetFloat("_Desat", 1f);
}
if (Timer <= 0 && HasEffect && isEffectActive) {
isEffectActive = false;
- killButtonManager.TimerText.color = Palette.BJENLBHMKAI;
+ killButtonManager.TimerText.color = Palette.EnabledColor;
OnEffectEnds();
}
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using UnityEngine;
+using Il2CppSystem;
+using HarmonyLib;
+using UnhollowerBaseLib;
+using Assets.CoreScripts;
+
+namespace TheOtherRoles {
+ public class CustomColors {
+ protected static Dictionary<int, string> ColorStrings = new Dictionary<int, string>();
+ public static List<int> lighterColors = new List<int>(){ 3, 4, 5, 7, 10, 11};
+ public static int pickableColors = 12;
+
+ public static void Load() {
+ List<StringNames> longlist = Enumerable.ToList<StringNames>(Palette.ColorNames);
+ List<StringNames> shortlist = Enumerable.ToList<StringNames>(Palette.ShortColorNames);
+ List<Color32> colorlist = Enumerable.ToList<Color32>(Palette.PlayerColors);
+ List<Color32> shadowlist = Enumerable.ToList<Color32>(Palette.ShadowColors);
+
+ List<CustomColor> colors = new List<CustomColor>();
+
+ colors.Add(new CustomColor { longname = "Salmon", shortname = "SALMN",
+ color = new Color32(239, 191, 192, byte.MaxValue),
+ shadow = new Color32(182, 119, 114, byte.MaxValue),
+ isLighterColor = true });
+ colors.Add(new CustomColor { longname = "Bordeaux", shortname = "BRDX",
+ color = new Color32(109, 7, 26, byte.MaxValue),
+ shadow = new Color32(54, 2, 11, byte.MaxValue),
+ isLighterColor = false });
+ colors.Add(new CustomColor { longname = "Olive", shortname = "OLIVE",
+ color = new Color32(154, 140, 61, byte.MaxValue),
+ shadow = new Color32(104, 95, 40, byte.MaxValue),
+ isLighterColor = false });
+ colors.Add(new CustomColor { longname = "Turqoise", shortname = "TURQ",
+ color = new Color32(22, 132, 176, byte.MaxValue),
+ shadow = new Color32(15, 89, 117, byte.MaxValue),
+ isLighterColor = false });
+ colors.Add(new CustomColor { longname = "Mint", shortname = "MINT",
+ color = new Color32(111, 192, 156, byte.MaxValue),
+ shadow = new Color32(65, 148, 111, byte.MaxValue),
+ isLighterColor = true });
+ colors.Add(new CustomColor { longname = "Lavender", shortname = "LVNDR",
+ color = new Color32(173, 126, 201, byte.MaxValue),
+ shadow = new Color32(131, 58, 203, byte.MaxValue),
+ isLighterColor = true });
+ colors.Add(new CustomColor { longname = "Nougat", shortname = "NOUGT",
+ color = new Color32(160, 101, 56, byte.MaxValue),
+ shadow = new Color32(115, 15, 78, byte.MaxValue),
+ isLighterColor = false });
+ colors.Add(new CustomColor { longname = "Peach", shortname = "PEACH",
+ color = new Color32(255, 164, 119, byte.MaxValue),
+ shadow = new Color32(238, 128, 100, byte.MaxValue),
+ isLighterColor = true });
+ colors.Add(new CustomColor { longname = "Wasabi", shortname = "WSBI",
+ color = new Color32(112, 143, 46, byte.MaxValue),
+ shadow = new Color32(72, 92, 29, byte.MaxValue),
+ isLighterColor = true });
+ colors.Add(new CustomColor { longname = "Hot Pink", shortname = "HTPNK",
+ color = new Color32(255, 51, 102, byte.MaxValue),
+ shadow = new Color32(232, 0, 58, byte.MaxValue),
+ isLighterColor = true });
+ colors.Add(new CustomColor { longname = "Gray", shortname = "GRAY",
+ color = new Color32(147, 147, 147, byte.MaxValue),
+ shadow = new Color32(120, 120, 120, byte.MaxValue),
+ isLighterColor = false });
+ colors.Add(new CustomColor { longname = "Petrol", shortname = "PTRL",
+ color = new Color32(0, 99, 105, byte.MaxValue),
+ shadow = new Color32(0, 61, 54, byte.MaxValue),
+ isLighterColor = false });
+
+ pickableColors += colors.Count; // Colors to show in Tab
+ /** Hidden Colors **/
+ colors.Add(new CustomColor { longname = "Panda", shortname = "PANDA",
+ color = new Color32(255, 255, 255, 0),
+ shadow = new Color32(12, 12, 12, 0),
+ isLighterColor = true });
+ colors.Add(new CustomColor { longname = "Midnight", shortname = "MDNT",
+ color = new Color32(64, 8, 71, 0),
+ shadow = new Color32(24, 32, 116, 0),
+ isLighterColor = false });
+ /** Add Colors **/
+ int id = 50000;
+ foreach (CustomColor cc in colors) {
+ longlist.Add((StringNames)id);
+ CustomColors.ColorStrings[id++] = cc.longname;
+ shortlist.Add((StringNames)id);
+ CustomColors.ColorStrings[id++] = cc.shortname;
+ colorlist.Add(cc.color);
+ shadowlist.Add(cc.shadow);
+ if (cc.isLighterColor)
+ lighterColors.Add(colorlist.Count - 1);
+ }
+
+ Palette.ShortColorNames = shortlist.ToArray();
+ Palette.ColorNames = longlist.ToArray();
+ Palette.PlayerColors = colorlist.ToArray();
+ Palette.ShadowColors = shadowlist.ToArray();
+ MedScanMinigame.ColorNames = Palette.ColorNames;
+ Telemetry.ColorNames = Palette.ColorNames;
+ }
+
+ protected internal struct CustomColor {
+ public string longname;
+ public string shortname;
+ public Color32 color;
+ public Color32 shadow;
+ public bool isLighterColor;
+ }
+
+ [HarmonyPatch]
+ public static class CustomColorPatches {
+ [HarmonyPatch(typeof(TranslationController), nameof(TranslationController.GetString), new[] {
+ typeof(StringNames),
+ typeof(Il2CppReferenceArray<Il2CppSystem.Object>)
+ })]
+ private class ColorStringPatch {
+ public static bool Prefix(ref string __result, [HarmonyArgument(0)] StringNames name) {
+ if ((int)name >= 50000) {
+ string text = CustomColors.ColorStrings[(int)name];
+ if (text != null) {
+ __result = text;
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ [HarmonyPatch(typeof(PlayerTab), nameof(PlayerTab.OnEnable))]
+ private static class PlayerTabEnablePatch {
+ public static void Postfix(PlayerTab __instance) { // Replace instead
+ Il2CppArrayBase<ColorChip> chips = __instance.ColorChips.ToArray();
+ int cols = 4; // TODO: Design an algorithm to dynamically position chips to optimally fill space
+ for (int i = 0; i < chips.Length; i++) {
+ ColorChip chip = chips[i];
+ int row = i / cols, col = i % cols; // Dynamically do the positioning
+ chip.transform.localPosition = new Vector3(1.46f + (col * 0.6f), -0.43f - (row * 0.55f), chip.transform.localPosition.z);
+ chip.transform.localScale *= 0.9f;
+
+ if (i >= pickableColors)
+ chip.transform.localScale *= 0f; // Needs to exist for PlayerTab
+ }
+ }
+ }
+ }
+ }
+}
--- /dev/null
+using System;
+using BepInEx;
+using BepInEx.Configuration;
+using BepInEx.IL2CPP;
+using HarmonyLib;
+using UnityEngine;
+using System.Collections.Generic;
+using System.IO;
+using System.Reflection;
+using System.Collections;
+using UnhollowerBaseLib;
+using System.Linq;
+
+namespace TheOtherRoles {
+ [HarmonyPatch]
+ public class CustomHats {
+ private static bool LOADED = false;
+ public static Material hatShader;
+
+ protected internal struct CustomHat {
+ public string name;
+ public string resource;
+ public string backresource;
+ public string climbresource;
+ public bool bounce;
+ public bool adaptive;
+ public bool behind;
+ }
+
+ private static List<CustomHat> createCustomHatDetails(string[] hats, bool fromDisk = false) {
+ Dictionary<string, CustomHat> fronts = new Dictionary<string, CustomHat>();
+ Dictionary<string, string> backs = new Dictionary<string, string>();
+ Dictionary<string, string> climbs = new Dictionary<string, string>();
+
+ for (int i = 0; i < hats.Length; i++) {
+ string s = fromDisk ? hats[i].Substring(hats[i].LastIndexOf("\\") + 1).Split('.')[0] : hats[i].Split('.')[3];
+ string[] p = s.Split('_');
+
+ HashSet<string> options = new HashSet<string>();
+ for (int j = 1; j < p.Length; j++)
+ options.Add(p[j]);
+
+ if (options.Contains("climb"))
+ climbs.Add(p[0], hats[i]);
+ if (options.Contains("back"))
+ backs.Add(p[0], hats[i]);
+
+ if (!options.Contains("back") && !options.Contains("climb")) {
+ CustomHat custom = new CustomHat { resource = hats[i] };
+ custom.name = p[0].Replace('-', ' ');
+ custom.bounce = options.Contains("bounce");
+ custom.adaptive = options.Contains("adaptive");
+ custom.behind = options.Contains("behind");
+
+ fronts.Add(p[0], custom);
+ }
+ }
+
+ List<CustomHat> customhats = new List<CustomHat>();
+
+ foreach (string k in fronts.Keys) {
+ CustomHat hat = fronts[k];
+ backs.TryGetValue(k, out hat.backresource);
+ climbs.TryGetValue(k, out hat.climbresource);
+ if (hat.backresource != null)
+ hat.behind = true;
+ customhats.Add(hat);
+ }
+
+ return customhats;
+ }
+
+ private static Sprite CreateHatSprite(string path, bool fromDisk = false) {
+ Texture2D texture = fromDisk ? Helpers.loadTextureFromDisk(path) : Helpers.loadTextureFromResources(path);
+ return texture == null ? null : Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.8f), texture.width * 0.75f);
+ }
+
+ private static HatBehaviour CreateHatBehaviour(CustomHat ch, bool fromDisk = false) {
+ HatBehaviour hat = new HatBehaviour();
+ hat.MainImage = CreateHatSprite(ch.resource, fromDisk);
+ if (ch.backresource != null)
+ hat.BackImage = CreateHatSprite(ch.backresource, fromDisk);
+ if (ch.climbresource != null)
+ hat.ClimbImage = CreateHatSprite(ch.climbresource, fromDisk);
+ hat.name = ch.name;
+ hat.Order = 99;
+ hat.ProductId = "hat_" + ch.name.Replace(' ', '_');
+ hat.InFront = !ch.behind;
+ hat.NoBounce = !ch.bounce;
+ hat.ChipOffset = new Vector2(0f, 0.35f);
+
+ if (ch.adaptive && hatShader != null)
+ hat.AltShader = hatShader;
+
+ return hat;
+ }
+
+ private static void loadHatShader() {
+ if (hatShader != null || !DestroyableSingleton<HatManager>.InstanceExists) return;
+
+ foreach (HatBehaviour hat in DestroyableSingleton<HatManager>.Instance.AllHats) {
+ if (hat.AltShader != null) {
+ hatShader = hat.AltShader;
+ break;
+ }
+ }
+ }
+
+ [HarmonyPatch(typeof(HatManager), nameof(HatManager.GetHatById))]
+ private static class HatManagerPatch {
+ static bool Prefix(HatManager __instance) {
+ try {
+ if (!LOADED) {
+ loadHatShader();
+
+ Assembly assembly = Assembly.GetExecutingAssembly();
+ string hatres = $"{assembly.GetName().Name}.Resources.CustomHats";
+ string[] hats = (from r in assembly.GetManifestResourceNames()
+ where r.StartsWith(hatres) && r.EndsWith(".png")
+ select r).ToArray<string>();
+
+ List<CustomHat> customhats = createCustomHatDetails(hats);
+ foreach (CustomHat ch in customhats)
+ __instance.AllHats.Add(CreateHatBehaviour(ch));
+
+ LOADED = true;
+ }
+ return true;
+ } catch (Exception e) {
+ System.Console.WriteLine("Unable to add Custom Hats\n" + e);
+ return false;
+ }
+ }
+ }
+
+ [HarmonyPatch(typeof(HatParent), nameof(HatParent.SetHat), new Type[] { typeof(uint), typeof(int) })]
+ private static class HatParentSetHatPatch {
+ static void Postfix(HatParent __instance, [HarmonyArgument(0)]uint hatId, [HarmonyArgument(1)]int color) {
+ if (DestroyableSingleton<TutorialManager>.InstanceExists) {
+ try {
+ string filePath = Path.GetDirectoryName(Application.dataPath) + @"\TheOtherHats\Test";
+ DirectoryInfo d = new DirectoryInfo(filePath);
+ string[] filePaths = d.GetFiles("*.png").Select(x => x.FullName).ToArray(); // Getting Text files
+ List<CustomHat> customHats = createCustomHatDetails(filePaths, true);
+ if (customHats.Count > 0) {
+ loadHatShader();
+ __instance.Hat = CreateHatBehaviour(customHats[0], true);
+ __instance.SetHat(color);
+ }
+ } catch (Exception e) {
+ System.Console.WriteLine("Unable to create test hat\n" + e);
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
using System.Collections.Generic;
using System;
-using Effects = AEOEPNHOJDP;
-
namespace TheOtherRoles{
public class CustomMessage {
private static List<CustomMessage> customMessages = new List<CustomMessage>();
public CustomMessage(string message, float duration) {
- RoomTracker roomTracker = HudManager.CHNDKKBEIDG?.roomTracker;
+ RoomTracker roomTracker = HudManager.Instance?.roomTracker;
if (roomTracker != null) {
GameObject gameObject = UnityEngine.Object.Instantiate(roomTracker.gameObject);
- gameObject.transform.SetParent(HudManager.CHNDKKBEIDG.transform);
+ gameObject.transform.SetParent(HudManager.Instance.transform);
UnityEngine.Object.DestroyImmediate(gameObject.GetComponent<RoomTracker>());
text = gameObject.GetComponent<TMPro.TMP_Text>();
text.text = message;
gameObject.transform.localPosition = new Vector3(0, -1.8f, gameObject.transform.localPosition.z);
customMessages.Add(this);
- HudManager.CHNDKKBEIDG.StartCoroutine(Effects.DCHLMIDMBHG(duration, new Action<float>((p) => {
+ HudManager.Instance.StartCoroutine(Effects.Lerp(duration, new Action<float>((p) => {
bool even = ((int)(p * duration / 0.25f)) % 2 == 0; // Bool flips every 0.25 seconds
string prefix = (even ? "<color=#FCBA03FF>" : "<color=#FF0000FF>");
text.text = prefix + message + "</color>";
if (text != null) text.color = even ? Color.yellow : Color.red;
- if (p == 1f && text?.gameObject != null) {
+ if (p == 1f && text != null && text.gameObject != null) {
UnityEngine.Object.Destroy(text.gameObject);
customMessages.Remove(this);
}
public static CustomOption morphlingSpawnRate;
public static CustomOption morphlingCooldown;
+ public static CustomOption morphlingDuration;
public static CustomOption camouflagerSpawnRate;
public static CustomOption camouflagerCooldown;
+ public static CustomOption camouflagerDuration;
public static CustomOption vampireSpawnRate;
public static CustomOption vampireKillDelay;
public static CustomOption tricksterLightsOutCooldown;
public static CustomOption tricksterLightsOutDuration;
+ public static CustomOption cleanerSpawnRate;
+ public static CustomOption cleanerCooldown;
+
public static CustomOption maxNumberOfMeetings;
public static CustomOption blockSkippingInEmergencyMeetings;
public static CustomOption noVoteIsSelfVote;
+ public static CustomOption hidePlayerNames;
public static string cs(Color c, string s) {
return string.Format("<color=#{0:X2}{1:X2}{2:X2}{3:X2}>{4}</color>", ToByte(c.r), ToByte(c.g), ToByte(c.b), ToByte(c.a), s);
morphlingSpawnRate = CustomOption.Create(20, cs(Morphling.color, "Morphling"), rates, null, true);
morphlingCooldown = CustomOption.Create(21, "Morphling Cooldown", 30f, 10f, 60f, 2.5f, morphlingSpawnRate);
+ morphlingDuration = CustomOption.Create(22, "Morph Duration", 10f, 1f, 20f, 0.5f, morphlingSpawnRate);
camouflagerSpawnRate = CustomOption.Create(30, cs(Camouflager.color, "Camouflager"), rates, null, true);
camouflagerCooldown = CustomOption.Create(31, "Camouflager Cooldown", 30f, 10f, 60f, 2.5f, camouflagerSpawnRate);
+ camouflagerDuration = CustomOption.Create(32, "Camo Duration", 10f, 1f, 20f, 0.5f, camouflagerSpawnRate);
vampireSpawnRate = CustomOption.Create(40, cs(Vampire.color, "Vampire"), rates, null, true);
vampireKillDelay = CustomOption.Create(41, "Vampire Kill Delay", 10f, 1f, 20f, 1f, vampireSpawnRate);
tricksterLightsOutCooldown = CustomOption.Create(252, "Trickster Lights Out Cooldown", 30f, 10f, 60f, 5f, tricksterSpawnRate);
tricksterLightsOutDuration = CustomOption.Create(253, "Trickster Lights Out Duration", 15f, 5f, 60f, 2.5f, tricksterSpawnRate);
+ cleanerSpawnRate = CustomOption.Create(260, cs(Cleaner.color, "Cleaner"), rates, null, true);
+ cleanerCooldown = CustomOption.Create(261, "Cleaner Cooldown", 30f, 10f, 60f, 2.5f, cleanerSpawnRate);
+
childSpawnRate = CustomOption.Create(180, cs(Child.color, "Child"), rates, null, true);
childGrowingUpDuration = CustomOption.Create(181, "Child Growing Up Duration", 400f, 100f, 1500f, 100f, childSpawnRate);
loversSpawnRate = CustomOption.Create(50, cs(Lovers.color, "Lovers"), rates, null, true);
- loversImpLoverRate = CustomOption.Create(51, "Chance That One Lover Is Impostor", 30f, 0f, 100f, 10f, loversSpawnRate);
+ loversImpLoverRate = CustomOption.Create(51, "Chance That One Lover Is Impostor", rates, loversSpawnRate);
loversBothDie = CustomOption.Create(52, "Both Lovers Die", true, loversSpawnRate);
jesterSpawnRate = CustomOption.Create(60, cs(Jester.color, "Jester"), rates, null, true);
maxNumberOfMeetings = CustomOption.Create(3, "Number Of Meetings (excluding Mayor meeting)", 10, 0, 15, 1, null, true);
blockSkippingInEmergencyMeetings = CustomOption.Create(4, "Block Skipping In Emergency Meetings", false);
noVoteIsSelfVote = CustomOption.Create(5, "No Vote Is Self Vote", false, blockSkippingInEmergencyMeetings);
+ hidePlayerNames = CustomOption.Create(6, "Hide Player Names", false);
}
}
option.entry = TheOtherRolesPlugin.Instance.Config.Bind($"Preset{preset}", option.id.ToString(), option.defaultSelection);
option.selection = Mathf.Clamp(option.entry.Value, 0, option.selections.Length - 1);
if (option.optionBehaviour != null && option.optionBehaviour is StringOption stringOption) {
- stringOption.LCDAKOCANPH = stringOption.Value = option.selection;
+ stringOption.oldValue = stringOption.Value = option.selection;
stringOption.ValueText.text = option.selections[option.selection].ToString();
}
}
}
public static void ShareOptionSelections() {
- if (PlayerControl.AllPlayerControls.Count <= 1 || AmongUsClient.Instance?.HHBLOCGKFAB == false && PlayerControl.LocalPlayer == null) return;
+ if (PlayerControl.AllPlayerControls.Count <= 1 || AmongUsClient.Instance?.AmHost == false && PlayerControl.LocalPlayer == null) return;
foreach (CustomOption option in CustomOption.options) {
MessageWriter messageWriter = AmongUsClient.Instance.StartRpc(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ShareOptionSelection, Hazel.SendOption.Reliable);
messageWriter.WritePacked((uint)option.id);
public void updateSelection(int newSelection) {
selection = Mathf.Clamp((newSelection + selections.Length) % selections.Length, 0, selections.Length - 1);
if (optionBehaviour != null && optionBehaviour is StringOption stringOption) {
- stringOption.LCDAKOCANPH = stringOption.Value = selection;
+ stringOption.oldValue = stringOption.Value = selection;
stringOption.ValueText.text = selections[selection].ToString();
- if (AmongUsClient.Instance?.HHBLOCGKFAB == true && PlayerControl.LocalPlayer) {
+ if (AmongUsClient.Instance?.AmHost == true && PlayerControl.LocalPlayer) {
if (id == 0) switchPreset(selection); // Switch presets
else if (entry != null) entry.Value = selection; // Save selection to config
var template = UnityEngine.Object.FindObjectsOfType<StringOption>().FirstOrDefault();
if (template == null) return;
- List<OptionBehaviour> allOptions = __instance.MCAHCPOHNFI.ToList();
+ List<OptionBehaviour> allOptions = __instance.Children.ToList();
for (int i = 0; i < CustomOption.options.Count; i++) {
CustomOption option = CustomOption.options[i];
if (option.optionBehaviour == null) {
stringOption.OnValueChanged = new Action<OptionBehaviour>((o) => {});
stringOption.TitleText.text = option.name;
- stringOption.Value = stringOption.LCDAKOCANPH = option.selection;
+ stringOption.Value = stringOption.oldValue = option.selection;
stringOption.ValueText.text = option.selections[option.selection].ToString();
option.optionBehaviour = stringOption;
}
option.optionBehaviour.gameObject.SetActive(true);
}
- __instance.MCAHCPOHNFI = allOptions.ToArray();
+ __instance.Children = allOptions.ToArray();
}
}
__instance.OnValueChanged = new Action<OptionBehaviour>((o) => {});
__instance.TitleText.text = option.name;
- __instance.Value = __instance.LCDAKOCANPH = option.selection;
+ __instance.Value = __instance.oldValue = option.selection;
__instance.ValueText.text = option.selections[option.selection].ToString();
return false;
{
private static float timer = 1f;
public static void Postfix(GameOptionsMenu __instance) {
- __instance.GetComponentInParent<Scroller>().YBounds.max = -0.5F + __instance.MCAHCPOHNFI.Length * 0.55F;
+ __instance.GetComponentInParent<Scroller>().YBounds.max = -0.5F + __instance.Children.Length * 0.55F;
timer += Time.deltaTime;
if (timer < 0.1f) return;
timer = 0f;
float offset = -7.85f;
foreach (CustomOption option in CustomOption.options) {
- if (option?.optionBehaviour?.gameObject != null) {
+ if (option?.optionBehaviour != null && option.optionBehaviour.gameObject != null) {
bool enabled = true;
var parent = option.parent;
while (parent != null && enabled) {
class GameOptionsDataPatch
{
private static IEnumerable<MethodBase> TargetMethods() {
- return typeof(CEIOGGEDKAN).GetMethods().Where(x => x.ReturnType == typeof(string) && x.GetParameters().Length == 1 && x.GetParameters()[0].ParameterType == typeof(int));
+ return typeof(GameOptionsData).GetMethods().Where(x => x.ReturnType == typeof(string) && x.GetParameters().Length == 1 && x.GetParameters()[0].ParameterType == typeof(int));
}
private static void Postfix(ref string __result)
var hudString = sb.ToString();
int defaultSettingsLines = 19;
- int roleSettingsLines = 19 + 27;
- int detailedSettingsLines = 19 + 27 + 37;
+ int roleSettingsLines = defaultSettingsLines + 28;
+ int detailedSettingsP1 = roleSettingsLines + 34;
+ int detailedSettingsP2 = detailedSettingsP1 + 34;
int end1 = hudString.TakeWhile(c => (defaultSettingsLines -= (c == '\n' ? 1 : 0)) > 0).Count();
int end2 = hudString.TakeWhile(c => (roleSettingsLines -= (c == '\n' ? 1 : 0)) > 0).Count();
- int end3 = hudString.TakeWhile(c => (detailedSettingsLines -= (c == '\n' ? 1 : 0)) > 0).Count();
+ int end3 = hudString.TakeWhile(c => (detailedSettingsP1 -= (c == '\n' ? 1 : 0)) > 0).Count();
+ int end4 = hudString.TakeWhile(c => (detailedSettingsP2 -= (c == '\n' ? 1 : 0)) > 0).Count();
int counter = TheOtherRolesPlugin.optionsPage;
if (counter == 0) {
hudString = hudString.Substring(0, end1) + "\n";
gap = 4;
index = hudString.TakeWhile(c => (gap -= (c == '\n' ? 1 : 0)) > 0).Count();
hudString = hudString.Insert(index, "\n");
- gap = 11;
+ gap = 12;
index = hudString.TakeWhile(c => (gap -= (c == '\n' ? 1 : 0)) > 0).Count();
hudString = hudString.Insert(index + 1, "\n");
- gap = 15;
+ gap = 16;
index = hudString.TakeWhile(c => (gap -= (c == '\n' ? 1 : 0)) > 0).Count();
hudString = hudString.Insert(index + 1, "\n");
} else if (counter == 2) {
hudString = hudString.Substring(end2 + 1, end3 - end2);
} else if (counter == 3) {
- hudString = hudString.Substring(end3 + 1);
+ hudString = hudString.Substring(end3 + 1, end4 - end3);
+ } else if (counter == 4) {
+ hudString = hudString.Substring(end4 + 1);
}
- hudString += $"\n Press tab for more... ({counter+1}/4)";
+ hudString += $"\n Press tab for more... ({counter+1}/5)";
__result = hudString;
}
}
public static void Postfix(KeyboardJoystick __instance)
{
if(Input.GetKeyDown(KeyCode.Tab)) {
- TheOtherRolesPlugin.optionsPage = (TheOtherRolesPlugin.optionsPage + 1) % 4;
+ TheOtherRolesPlugin.optionsPage = (TheOtherRolesPlugin.optionsPage + 1) % 5;
}
}
}
using System;
using System.Text;
-using GameOverReason = AMGMAKBHCMN;
-using TempData = MFEGHOFFKKA;
-using WinningPlayerData = FDAHKHEDJPN;
-using DeathReason = EGHDCAKGMKI;
-using SystemTypes = BCPJLGGNHBC;
-using ISystemType = JBBCJFNFOBB;
-using LifeSuppSystemType = GIICFCLBGOD;
-using ICriticalSabotage = KMBJMPDCFJE;
-
namespace TheOtherRoles {
enum CustomGameOverReason {
LoversWin = 10,
}
}
- [HarmonyPatch(typeof(AmongUsClient), nameof(AmongUsClient.DDIEDPFFHOG))]
+ [HarmonyPatch(typeof(AmongUsClient), nameof(AmongUsClient.OnGameEnd))]
public class OnGameEndPatch {
private static GameOverReason gameOverReason;
- public static void Prefix(AmongUsClient __instance, ref GameOverReason NEPMFBMGGLF, bool FBEKDLNKNLL) {
- gameOverReason = NEPMFBMGGLF;
- if ((int)NEPMFBMGGLF >= 10) NEPMFBMGGLF = GameOverReason.ImpostorByKill;
+ public static void Prefix(AmongUsClient __instance, [HarmonyArgument(0)]ref GameOverReason reason, [HarmonyArgument(1)]bool showAd) {
+ gameOverReason = reason;
+ if ((int)reason >= 10) reason = GameOverReason.ImpostorByKill;
}
- public static void Postfix(AmongUsClient __instance, GameOverReason NEPMFBMGGLF, bool FBEKDLNKNLL) {
+ public static void Postfix(AmongUsClient __instance, [HarmonyArgument(0)]ref GameOverReason reason, [HarmonyArgument(1)]bool showAd) {
AdditionalTempData.clear();
// Remove Jester from winners (on Jester win he will be added again, see below)
if (Jester.jester != null) {
WinningPlayerData jesterWinner = null;
- foreach (WinningPlayerData winner in TempData.BPDANAHEJDD)
- if (winner.NNMPJKHJLMB == Jester.jester.PPMOEEPBHJO.PCLLABJCIPC) jesterWinner = winner;
+ foreach (WinningPlayerData winner in TempData.winners)
+ if (winner.Name == Jester.jester.Data.PlayerName) jesterWinner = winner;
- if (jesterWinner != null) TempData.BPDANAHEJDD.Remove(jesterWinner);
+ if (jesterWinner != null) TempData.winners.Remove(jesterWinner);
}
// Remove Jackal and Sidekick from winners (on Jackal win he will be added again, see below)
if (Jackal.jackal != null || Sidekick.sidekick != null) {
List<WinningPlayerData> winnersToRemove = new List<WinningPlayerData>();
- foreach (WinningPlayerData winner in TempData.BPDANAHEJDD) {
- if (winner.NNMPJKHJLMB == Jackal.jackal?.PPMOEEPBHJO?.PCLLABJCIPC) winnersToRemove.Add(winner);
- if (winner.NNMPJKHJLMB == Sidekick.sidekick?.PPMOEEPBHJO?.PCLLABJCIPC) winnersToRemove.Add(winner);
+ foreach (WinningPlayerData winner in TempData.winners) {
+ if (winner.Name == Jackal.jackal?.Data?.PlayerName) winnersToRemove.Add(winner);
+ if (winner.Name == Sidekick.sidekick?.Data?.PlayerName) winnersToRemove.Add(winner);
foreach(var player in Jackal.formerJackals) {
- if (winner.NNMPJKHJLMB == player.PPMOEEPBHJO.PCLLABJCIPC) {
+ if (winner.Name == player.Data.PlayerName) {
winnersToRemove.Add(winner);
}
}
}
foreach (var winner in winnersToRemove) {
- TempData.BPDANAHEJDD.Remove(winner);
+ TempData.winners.Remove(winner);
}
}
bool jesterWin = Jester.jester != null && gameOverReason == (GameOverReason)CustomGameOverReason.JesterWin;
bool childLose = Child.child != null && gameOverReason == (GameOverReason)CustomGameOverReason.ChildLose;
- bool loversWin = Lovers.existingAndAlive() && (gameOverReason == (GameOverReason)CustomGameOverReason.LoversWin || (TempData.OMHNAMNPJCP(gameOverReason) && Lovers.existingAndCrewLovers())); // Either they win if they are among the last 3 players, or they win if they are both Crewmates and both alive and the Crew wins (Team Imp/Jackal Lovers can only win solo wins)
- bool teamJackalWin = gameOverReason == (GameOverReason)CustomGameOverReason.TeamJackalWin && ((Jackal.jackal != null && !Jackal.jackal.PPMOEEPBHJO.IAGJEKLJCCI) || (Sidekick.sidekick != null && !Sidekick.sidekick.PPMOEEPBHJO.IAGJEKLJCCI));
+ bool loversWin = Lovers.existingAndAlive() && (gameOverReason == (GameOverReason)CustomGameOverReason.LoversWin || (TempData.DidHumansWin(gameOverReason) && Lovers.existingAndCrewLovers())); // Either they win if they are among the last 3 players, or they win if they are both Crewmates and both alive and the Crew wins (Team Imp/Jackal Lovers can only win solo wins)
+ bool teamJackalWin = gameOverReason == (GameOverReason)CustomGameOverReason.TeamJackalWin && ((Jackal.jackal != null && !Jackal.jackal.Data.IsDead) || (Sidekick.sidekick != null && !Sidekick.sidekick.Data.IsDead));
// Child lose
if (childLose) {
- TempData.BPDANAHEJDD = new Il2CppSystem.Collections.Generic.List<WinningPlayerData>();
- WinningPlayerData wpd = new WinningPlayerData(Child.child.PPMOEEPBHJO);
- wpd.APIPIPIKLCE = false; // If "no one is the Child", it will display the Child, but also show defeat to everyone
- TempData.BPDANAHEJDD.Add(wpd);
+ TempData.winners = new Il2CppSystem.Collections.Generic.List<WinningPlayerData>();
+ WinningPlayerData wpd = new WinningPlayerData(Child.child.Data);
+ wpd.IsYou = false; // If "no one is the Child", it will display the Child, but also show defeat to everyone
+ TempData.winners.Add(wpd);
AdditionalTempData.winCondition = WinCondition.ChildLose;
}
// Jester win
else if (jesterWin) {
- TempData.BPDANAHEJDD = new Il2CppSystem.Collections.Generic.List<WinningPlayerData>();
- WinningPlayerData wpd = new WinningPlayerData(Jester.jester.PPMOEEPBHJO);
- TempData.BPDANAHEJDD.Add(wpd);
+ TempData.winners = new Il2CppSystem.Collections.Generic.List<WinningPlayerData>();
+ WinningPlayerData wpd = new WinningPlayerData(Jester.jester.Data);
+ TempData.winners.Add(wpd);
AdditionalTempData.winCondition = WinCondition.JesterWin;
}
// Double win for lovers, crewmates also win
if (Lovers.existingAndCrewLovers()) {
AdditionalTempData.winCondition = WinCondition.LoversTeamWin;
- TempData.BPDANAHEJDD = new Il2CppSystem.Collections.Generic.List<WinningPlayerData>();
+ TempData.winners = new Il2CppSystem.Collections.Generic.List<WinningPlayerData>();
foreach (PlayerControl p in PlayerControl.AllPlayerControls) {
if (p == null) continue;
if (p == Lovers.lover1 || p == Lovers.lover2)
- TempData.BPDANAHEJDD.Add(new WinningPlayerData(p.PPMOEEPBHJO));
- else if (p != Jester.jester && p != Jackal.jackal && p != Sidekick.sidekick && !p.PPMOEEPBHJO.FDNMBJOAPFL)
- TempData.BPDANAHEJDD.Add(new WinningPlayerData(p.PPMOEEPBHJO));
+ TempData.winners.Add(new WinningPlayerData(p.Data));
+ else if (p != Jester.jester && p != Jackal.jackal && p != Sidekick.sidekick && !p.Data.IsImpostor)
+ TempData.winners.Add(new WinningPlayerData(p.Data));
}
}
// Lovers solo win
else {
AdditionalTempData.winCondition = WinCondition.LoversSoloWin;
- TempData.BPDANAHEJDD = new Il2CppSystem.Collections.Generic.List<WinningPlayerData>();
- TempData.BPDANAHEJDD.Add(new WinningPlayerData(Lovers.lover1.PPMOEEPBHJO));
- TempData.BPDANAHEJDD.Add(new WinningPlayerData(Lovers.lover2.PPMOEEPBHJO));
+ TempData.winners = new Il2CppSystem.Collections.Generic.List<WinningPlayerData>();
+ TempData.winners.Add(new WinningPlayerData(Lovers.lover1.Data));
+ TempData.winners.Add(new WinningPlayerData(Lovers.lover2.Data));
}
}
else if (teamJackalWin) {
// Jackal wins if nobody except jackal is alive
AdditionalTempData.winCondition = WinCondition.JackalWin;
- TempData.BPDANAHEJDD = new Il2CppSystem.Collections.Generic.List<WinningPlayerData>();
- WinningPlayerData wpd = new WinningPlayerData(Jackal.jackal.PPMOEEPBHJO);
- wpd.FDNMBJOAPFL = false;
- TempData.BPDANAHEJDD.Add(wpd);
+ TempData.winners = new Il2CppSystem.Collections.Generic.List<WinningPlayerData>();
+ WinningPlayerData wpd = new WinningPlayerData(Jackal.jackal.Data);
+ wpd.IsImpostor = false;
+ TempData.winners.Add(wpd);
// If there is a sidekick. The sidekick also wins
if (Sidekick.sidekick != null) {
- WinningPlayerData wpdSidekick = new WinningPlayerData(Sidekick.sidekick.PPMOEEPBHJO);
- wpdSidekick.FDNMBJOAPFL = false;
- TempData.BPDANAHEJDD.Add(wpdSidekick);
+ WinningPlayerData wpdSidekick = new WinningPlayerData(Sidekick.sidekick.Data);
+ wpdSidekick.IsImpostor = false;
+ TempData.winners.Add(wpdSidekick);
}
foreach(var player in Jackal.formerJackals) {
- WinningPlayerData wpdFormerJackal = new WinningPlayerData(player.PPMOEEPBHJO);
- wpdFormerJackal.FDNMBJOAPFL = false;
- TempData.BPDANAHEJDD.Add(wpdFormerJackal);
+ WinningPlayerData wpdFormerJackal = new WinningPlayerData(player.Data);
+ wpdFormerJackal.IsImpostor = false;
+ TempData.winners.Add(wpdFormerJackal);
}
}
}
}
- [HarmonyPatch(typeof(EndGameManager), nameof(EndGameManager.CMELCNKGDDP))]
+ [HarmonyPatch(typeof(EndGameManager), nameof(EndGameManager.SetEverythingUp))]
public class EndGameManagerSetUpPatch {
public static void Postfix(EndGameManager __instance) {
GameObject bonusText = UnityEngine.Object.Instantiate(__instance.WinText.gameObject);
}
}
- [HarmonyPatch(typeof(ShipStatus), nameof(ShipStatus.KMPKPPGPNIH))]
+ [HarmonyPatch(typeof(ShipStatus), nameof(ShipStatus.CheckEndCriteria))]
class CheckEndCriteriaPatch {
public static bool Prefix(ShipStatus __instance) {
if (!GameData.Instance) return false;
- if (DestroyableSingleton<TutorialManager>.BMHJGNNOGDM) // InstanceExists | Don't check Custom Criteria when in Tutorial
+ if (DestroyableSingleton<TutorialManager>.InstanceExists) // InstanceExists | Don't check Custom Criteria when in Tutorial
return true;
var statistics = new PlayerStatistics(__instance);
if (CheckAndEndGameForChildLose(__instance)) return false;
private static bool CheckAndEndGameForChildLose(ShipStatus __instance) {
if (Child.triggerChildLose) {
__instance.enabled = false;
- ShipStatus.EABBNOODFGL((GameOverReason)CustomGameOverReason.ChildLose, false);
+ ShipStatus.RpcEndGame((GameOverReason)CustomGameOverReason.ChildLose, false);
return true;
}
return false;
private static bool CheckAndEndGameForJesterWin(ShipStatus __instance) {
if (Jester.triggerJesterWin) {
__instance.enabled = false;
- ShipStatus.EABBNOODFGL((GameOverReason)CustomGameOverReason.JesterWin, false);
+ ShipStatus.RpcEndGame((GameOverReason)CustomGameOverReason.JesterWin, false);
return true;
}
return false;
ISystemType systemType = __instance.Systems.ContainsKey(SystemTypes.LifeSupp) ? __instance.Systems[SystemTypes.LifeSupp] : null;
if (systemType != null) {
LifeSuppSystemType lifeSuppSystemType = systemType.TryCast<LifeSuppSystemType>();
- if (lifeSuppSystemType != null && lifeSuppSystemType.GPBBPGOINOF < 0f) {
+ if (lifeSuppSystemType != null && lifeSuppSystemType.Countdown < 0f) {
EndGameForSabotage(__instance);
- lifeSuppSystemType.GPBBPGOINOF = 10000f;
+ lifeSuppSystemType.Countdown = 10000f;
return true;
}
}
}
if (systemType2 != null) {
ICriticalSabotage criticalSystem = systemType2.TryCast<ICriticalSabotage>();
- if (criticalSystem != null && criticalSystem.GPBBPGOINOF < 0f) {
+ if (criticalSystem != null && criticalSystem.Countdown < 0f) {
EndGameForSabotage(__instance);
criticalSystem.ClearSabotage();
return true;
private static bool CheckAndEndGameForTaskWin(ShipStatus __instance) {
if (GameData.Instance.TotalTasks <= GameData.Instance.CompletedTasks) {
__instance.enabled = false;
- ShipStatus.EABBNOODFGL(GameOverReason.HumansByTask, false);
+ ShipStatus.RpcEndGame(GameOverReason.HumansByTask, false);
return true;
}
return false;
private static bool CheckAndEndGameForLoverWin(ShipStatus __instance, PlayerStatistics statistics) {
if (statistics.TeamLoversAlive == 2 && statistics.TotalAlive <= 3) {
__instance.enabled = false;
- ShipStatus.EABBNOODFGL((GameOverReason)CustomGameOverReason.LoversWin, false);
+ ShipStatus.RpcEndGame((GameOverReason)CustomGameOverReason.LoversWin, false);
return true;
}
return false;
private static bool CheckAndEndGameForJackalWin(ShipStatus __instance, PlayerStatistics statistics) {
if (statistics.TeamJackalAlive >= statistics.TotalAlive - statistics.TeamJackalAlive && statistics.TeamImpostorsAlive == 0 && !(statistics.TeamJackalHasAliveLover && statistics.TeamLoversAlive == 2)) {
__instance.enabled = false;
- ShipStatus.EABBNOODFGL((GameOverReason)CustomGameOverReason.TeamJackalWin, false);
+ ShipStatus.RpcEndGame((GameOverReason)CustomGameOverReason.TeamJackalWin, false);
return true;
}
return false;
if (statistics.TeamImpostorsAlive >= statistics.TotalAlive - statistics.TeamImpostorsAlive && statistics.TeamJackalAlive == 0 && !(statistics.TeamImpostorHasAliveLover && statistics.TeamLoversAlive == 2)) {
__instance.enabled = false;
GameOverReason endReason;
- switch (TempData.PJPCCFAPCKJ) {
+ switch (TempData.LastDeathReason) {
case DeathReason.Exile:
endReason = GameOverReason.ImpostorByVote;
break;
endReason = GameOverReason.ImpostorByVote;
break;
}
- ShipStatus.EABBNOODFGL(endReason, false);
+ ShipStatus.RpcEndGame(endReason, false);
return true;
}
return false;
private static bool CheckAndEndGameForCrewmateWin(ShipStatus __instance, PlayerStatistics statistics) {
if (statistics.TeamImpostorsAlive == 0 && statistics.TeamJackalAlive == 0) {
__instance.enabled = false;
- ShipStatus.EABBNOODFGL(GameOverReason.HumansByVote, false);
+ ShipStatus.RpcEndGame(GameOverReason.HumansByVote, false);
return true;
}
return false;
private static void EndGameForSabotage(ShipStatus __instance) {
__instance.enabled = false;
- ShipStatus.EABBNOODFGL(GameOverReason.ImpostorBySabotage, false);
+ ShipStatus.RpcEndGame(GameOverReason.ImpostorBySabotage, false);
return;
}
public bool TeamJackalHasAliveLover {get;set;}
public PlayerStatistics(ShipStatus __instance) {
- GetMFDAIFHGKMGs();
+ GetPlayerCounts();
}
- private bool isLover(GameData.LGBOMGHJELL p) {
- return (Lovers.lover1 != null && Lovers.lover1.PlayerId == p.FNPNJHNKEBK) || (Lovers.lover2 != null && Lovers.lover2.PlayerId == p.FNPNJHNKEBK);
+ private bool isLover(GameData.PlayerInfo p) {
+ return (Lovers.lover1 != null && Lovers.lover1.PlayerId == p.PlayerId) || (Lovers.lover2 != null && Lovers.lover2.PlayerId == p.PlayerId);
}
- private void GetMFDAIFHGKMGs() {
+ private void GetPlayerCounts() {
int numJackalAlive = 0;
int numImpostorsAlive = 0;
int numLoversAlive = 0;
bool impLover = false;
bool jackalLover = false;
- for (int i = 0; i < GameData.Instance.MFDAIFHGKMG; i++)
+ for (int i = 0; i < GameData.Instance.PlayerCount; i++)
{
- GameData.LGBOMGHJELL LGBOMGHJELL = GameData.Instance.AllPlayers[i];
- if (!LGBOMGHJELL.MFFAGDHDHLO)
+ GameData.PlayerInfo playerInfo = GameData.Instance.AllPlayers[i];
+ if (!playerInfo.Disconnected)
{
- if (!LGBOMGHJELL.IAGJEKLJCCI)
+ if (!playerInfo.IsDead)
{
numTotalAlive++;
- bool lover = isLover(LGBOMGHJELL);
+ bool lover = isLover(playerInfo);
if (lover) numLoversAlive++;
- if (LGBOMGHJELL.FDNMBJOAPFL) {
+ if (playerInfo.IsImpostor) {
numImpostorsAlive++;
if (lover) impLover = true;
}
- if (Jackal.jackal != null && Jackal.jackal.PlayerId == LGBOMGHJELL.FNPNJHNKEBK) {
+ if (Jackal.jackal != null && Jackal.jackal.PlayerId == playerInfo.PlayerId) {
numJackalAlive++;
if (lover) jackalLover = true;
}
- if (Sidekick.sidekick != null && Sidekick.sidekick.PlayerId == LGBOMGHJELL.FNPNJHNKEBK) {
+ if (Sidekick.sidekick != null && Sidekick.sidekick.PlayerId == playerInfo.PlayerId) {
numJackalAlive++;
if (lover) jackalLover = true;
}
--- /dev/null
+using HarmonyLib;
+using static TheOtherRoles.TheOtherRoles;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace TheOtherRoles {
+ [HarmonyPatch]
+ public static class FakeTasksForEveryone {
+ [HarmonyPatch(typeof(GameData), nameof(GameData.RecomputeTaskCounts))]
+ private static class GameDataRecomputeTaskCountsPatch {
+ private static bool Prefix(GameData __instance) {
+ __instance.TotalTasks = 0;
+ __instance.CompletedTasks = 0;
+ for (int i = 0; i < __instance.AllPlayers.Count; i++) {
+ GameData.PlayerInfo playerInfo = __instance.AllPlayers[i]; // PlayerInfo
+ if (!playerInfo.Disconnected && playerInfo.Tasks != null && // Disconnected | // Tasks
+ playerInfo.Object && // Object -> PlayerControl
+ (PlayerControl.GameOptions.GhostsDoTasks || !playerInfo.IsDead) && // GhostsDoTasks | IsDead
+ !playerInfo.IsImpostor && // IsImpostor
+ !Helpers.hasFakeTasks(playerInfo.Object)
+ ) {
+
+ for (int j = 0; j < playerInfo.Tasks.Count; j++) {
+ __instance.TotalTasks++;
+ if (playerInfo.Tasks[j].Complete) { // Complete
+ __instance.CompletedTasks++;
+ }
+ }
+ }
+ }
+ return false;
+ }
+ }
+
+ [HarmonyPatch(typeof(Console), nameof(Console.CanUse))]
+ private static class ConsoleCanUsePatch {
+ private static bool Prefix(ref float __result, Console __instance, [HarmonyArgument(0)] GameData.PlayerInfo pc, [HarmonyArgument(1)] out bool canUse, [HarmonyArgument(2)] out bool couldUse) {
+ canUse = couldUse = false;
+ if (__instance.AllowImpostor) return true;
+ if (!Helpers.hasFakeTasks(pc.Object)) return true;
+ __result = float.MaxValue;
+ return false;
+ }
+ }
+ }
+}
using UnityEngine;
using static TheOtherRoles.TheOtherRoles;
-using Palette = BLMBFIODBKL;
-using Effects = AEOEPNHOJDP;
-
namespace TheOtherRoles{
class Footprint {
private static List<Footprint> footprints = new List<Footprint>();
this.owner = player;
this.anonymousFootprints = anonymousFootprints;
if (anonymousFootprints)
- this.color = Palette.AEDCMKGJKAG[6];
+ this.color = Palette.PlayerColors[6];
else
- this.color = Palette.AEDCMKGJKAG[(int) player.PPMOEEPBHJO.IMMNCAGJJJC];
+ this.color = Palette.PlayerColors[(int) player.Data.ColorId];
footprint = new GameObject("Footprint");
Vector3 position = new Vector3(player.transform.position.x, player.transform.position.y, player.transform.position.z + 1f);
footprint.SetActive(true);
footprints.Add(this);
- HudManager.CHNDKKBEIDG.StartCoroutine(Effects.DCHLMIDMBHG(footprintDuration, new Action<float>((p) => {
+ HudManager.Instance.StartCoroutine(Effects.Lerp(footprintDuration, new Action<float>((p) => {
Color c = color;
if (!anonymousFootprints && owner != null) {
- if (owner == Morphling.morphling && Morphling.morphTimer > 0 && Morphling.morphTarget?.PPMOEEPBHJO != null)
- c = Palette.PHFOPNDOEMD[Morphling.morphTarget.PPMOEEPBHJO.IMMNCAGJJJC];
+ if (owner == Morphling.morphling && Morphling.morphTimer > 0 && Morphling.morphTarget?.Data != null)
+ c = Palette.ShadowColors[Morphling.morphTarget.Data.ColorId];
else if (Camouflager.camouflageTimer > 0)
- c = Palette.AEDCMKGJKAG[6];
+ c = Palette.PlayerColors[6];
}
if (spriteRenderer) spriteRenderer.color = new Color(c.r, c.g, c.b, Mathf.Clamp01(1 - p));
using UnityEngine;
using static TheOtherRoles.TheOtherRoles;
-using DeathReason = EGHDCAKGMKI;
-
namespace TheOtherRoles{
public class DeadPlayer
{
}
static class GameHistory {
- public static List<Tuple<Vector3, DateTime>> localPlayerPositions = new List<Tuple<Vector3, DateTime>>();
+ public static List<Tuple<Vector3, bool>> localPlayerPositions = new List<Tuple<Vector3, bool>>();
public static List<DeadPlayer> deadPlayers = new List<DeadPlayer>();
- public static DateTime localVentEnterTimePoint = DateTime.MinValue;
public static void clearGameHistory() {
- localPlayerPositions = new List<Tuple<Vector3, DateTime>>();
+ localPlayerPositions = new List<Tuple<Vector3, bool>>();
deadPlayers = new List<DeadPlayer>();
- localVentEnterTimePoint = DateTime.MinValue;
}
}
}
\ No newline at end of file
using System.Collections.Generic;
using Hazel;
using System;
-
-using Palette = BLMBFIODBKL;
+using UnhollowerBaseLib;
namespace TheOtherRoles {
public class GameStartManagerPatch {
public static Dictionary<int, Tuple<byte, byte, byte>> playerVersions = new Dictionary<int, Tuple<byte, byte, byte>>();
private static float timer = 600f;
private static bool versionSent = false;
+ private static string lobbyCodeText = "";
[HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.Start))]
public class GameStartManagerStartPatch {
- public static void Postfix() {
+ public static void Postfix(GameStartManager __instance) {
// Trigger version refresh
versionSent = false;
// Reset lobby countdown timer
timer = 600f;
+ // Copy lobby code
+ string code = InnerNet.GameCode.IntToGameName(AmongUsClient.Instance.GameId);
+ GUIUtility.systemCopyBuffer = code;
+ lobbyCodeText = DestroyableSingleton<TranslationController>.Instance.GetString(StringNames.RoomCode, new Il2CppReferenceArray<Il2CppSystem.Object>(0)) + "\r\n" + code;
}
}
private static string currentText = "";
public static void Prefix(GameStartManager __instance) {
- if (!AmongUsClient.Instance.HHBLOCGKFAB || !GameData.Instance) return; // Not host or no instance
- update = GameData.Instance.MFDAIFHGKMG != __instance.OBFONKJNJFF;
+ if (!AmongUsClient.Instance.AmHost || !GameData.Instance) return; // Not host or no instance
+ update = GameData.Instance.PlayerCount != __instance.LastPlayerCount;
}
public static void Postfix(GameStartManager __instance) {
}
// Host update with version handshake infos
- if (AmongUsClient.Instance.HHBLOCGKFAB) {
+ if (AmongUsClient.Instance.AmHost) {
bool blockStart = false;
string message = "";
foreach (InnerNet.ClientData client in AmongUsClient.Instance.allClients) {
continue;
else if (!playerVersions.ContainsKey(client.Id)) {
blockStart = true;
- message += $"<color=#FF0000FF>{client.Character.PPMOEEPBHJO.PCLLABJCIPC} has an outdated or no version of The Other Roles\n</color>";
+ message += $"<color=#FF0000FF>{client.Character.Data.PlayerName} has an outdated or no version of The Other Roles\n</color>";
} else if (playerVersions[client.Id].Item1 != TheOtherRolesPlugin.Major || playerVersions[client.Id].Item2 != TheOtherRolesPlugin.Minor || playerVersions[client.Id].Item3 != TheOtherRolesPlugin.Patch) {
blockStart = true;
- message += $"<color=#FF0000FF>{client.Character.PPMOEEPBHJO.PCLLABJCIPC} has an outdated version (v{playerVersions[client.Id].Item1}.{playerVersions[client.Id].Item2}.{playerVersions[client.Id].Item3}) of The Other Roles\n</color>";
+ message += $"<color=#FF0000FF>{client.Character.Data.PlayerName} has an outdated version (v{playerVersions[client.Id].Item1}.{playerVersions[client.Id].Item2}.{playerVersions[client.Id].Item3}) of The Other Roles\n</color>";
}
}
if (blockStart) {
- // __instance.StartButton.color = Palette.ILFJLECIGDB; // Allow the start for this version to test the feature, blocking it with the next version
+ // __instance.StartButton.color = Palette.DisabledClear; // Allow the start for this version to test the feature, blocking it with the next version
__instance.GameStartText.text = message;
__instance.GameStartText.transform.localPosition = __instance.StartButton.transform.localPosition + Vector3.up * 2;
} else {
- // __instance.StartButton.color = ((__instance.OBFONKJNJFF >= __instance.MinPlayers) ? Palette.BJENLBHMKAI : Palette.ILFJLECIGDB); // Allow the start for this version to test the feature, blocking it with the next version
+ // __instance.StartButton.color = ((__instance.LastPlayerCount >= __instance.MinPlayers) ? Palette.EnabledColor : Palette.DisabledClear); // Allow the start for this version to test the feature, blocking it with the next version
__instance.GameStartText.transform.localPosition = __instance.StartButton.transform.localPosition;
}
}
// Lobby timer
- if (!AmongUsClient.Instance.HHBLOCGKFAB || !GameData.Instance) return; // Not host or no instance
+ if (!AmongUsClient.Instance.AmHost || !GameData.Instance) return; // Not host or no instance
if (update) currentText = __instance.PlayerCounter.text;
__instance.PlayerCounter.text = currentText + suffix;
__instance.PlayerCounter.autoSizeTextContainer = true;
+
+ // Lobby code replacement
+ __instance.GameRoomName.text = TheOtherRolesPlugin.StreamerMode.Value ? $"<color={TheOtherRolesPlugin.StreamerModeReplacementColor.Value}>{TheOtherRolesPlugin.StreamerModeReplacementText.Value}</color>" : lobbyCodeText;
}
}
bool continueStart = true;
// Allow the start for this version to test the feature, blocking it with the next version
- // if (AmongUsClient.Instance.HHBLOCGKFAB) {
+ // if (AmongUsClient.Instance.AmHost) {
// foreach (InnerNet.ClientData client in AmongUsClient.Instance.allClients) {
// if (client.Character == null) continue;
// var dummyComponent = client.Character.GetComponent<DummyBehaviour>();
}
}
}
-}
\ No newline at end of file
+}
using HarmonyLib;
using Hazel;
-using TaskTypes = DMOAGPGAFKM;
-
namespace TheOtherRoles {
public static class Helpers {
public static Sprite loadSpriteFromResources(string path, float pixelsPerUnit) {
try {
- Texture2D texture = new Texture2D(2, 2, TextureFormat.ARGB32, true);
- Assembly assembly = Assembly.GetExecutingAssembly();
- Stream stream = assembly.GetManifestResourceStream(path);
- var byteTexture = new byte[stream.Length];
- var read = stream.Read(byteTexture, 0, (int) stream.Length);
- LoadImage(texture, byteTexture, false);
- return Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f), pixelsPerUnit);
+ Texture2D texture = loadTextureFromResources(path);
+ return Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f), pixelsPerUnit);
} catch {
System.Console.WriteLine("Error loading sprite from path: " + path);
}
return null;
}
+ public static Texture2D loadTextureFromResources(string path) {
+ try {
+ Texture2D texture = new Texture2D(2, 2, TextureFormat.ARGB32, true);
+ Assembly assembly = Assembly.GetExecutingAssembly();
+ Stream stream = assembly.GetManifestResourceStream(path);
+ var byteTexture = new byte[stream.Length];
+ var read = stream.Read(byteTexture, 0, (int) stream.Length);
+ LoadImage(texture, byteTexture, false);
+ return texture;
+ } catch {
+ System.Console.WriteLine("Error loading texture from resources: " + path);
+ }
+ return null;
+ }
+
+ public static Texture2D loadTextureFromDisk(string path) {
+ try {
+ if (File.Exists(path)) {
+ Texture2D texture = new Texture2D(2, 2, TextureFormat.ARGB32, true);
+ byte[] byteTexture = File.ReadAllBytes(path);
+ LoadImage(texture, byteTexture, false);
+ return texture;
+ }
+ } catch {
+ System.Console.WriteLine("Error loading texture from disk: " + path);
+ }
+ return null;
+ }
+
internal delegate bool d_LoadImage(IntPtr tex, IntPtr data, bool markNonReadable);
internal static d_LoadImage iCall_LoadImage;
private static bool LoadImage(Texture2D tex, byte[] data, bool markNonReadable) {
if (iCall_LoadImage == null)
iCall_LoadImage = IL2CPP.ResolveICall<d_LoadImage>("UnityEngine.ImageConversion::LoadImage");
-
var il2cppArray = (Il2CppStructArray<byte>) data;
-
return iCall_LoadImage.Invoke(tex.Pointer, il2cppArray.Pointer, markNonReadable);
}
return res;
}
- public static void setSkinWithAnim(PlayerPhysics playerPhysics, uint CGNMKICGLOG) {
- SkinData nextSkin = DestroyableSingleton<HatManager>.CHNDKKBEIDG.AllSkins[(int)CGNMKICGLOG];
+ public static void setSkinWithAnim(PlayerPhysics playerPhysics, uint SkinId) {
+ SkinData nextSkin = DestroyableSingleton<HatManager>.Instance.AllSkins[(int)SkinId];
AnimationClip clip = null;
var spriteAnim = playerPhysics.Skin.animator;
var anim = spriteAnim.m_animator;
var skinLayer = playerPhysics.Skin;
- var currentPhysicsAnim = playerPhysics.NIKGMJIKBMP.GetCurrentAnimation();
+ var currentPhysicsAnim = playerPhysics.Animator.GetCurrentAnimation();
if (currentPhysicsAnim == playerPhysics.RunAnim) clip = nextSkin.RunAnim;
else if (currentPhysicsAnim == playerPhysics.SpawnAnim) clip = nextSkin.SpawnAnim;
else if (currentPhysicsAnim == playerPhysics.EnterVentAnim) clip = nextSkin.EnterVentAnim;
else if (currentPhysicsAnim == playerPhysics.IdleAnim) clip = nextSkin.IdleAnim;
else clip = nextSkin.IdleAnim;
- float progress = playerPhysics.NIKGMJIKBMP.m_animator.GetCurrentAnimatorStateInfo(0).normalizedTime;
+ float progress = playerPhysics.Animator.m_animator.GetCurrentAnimatorStateInfo(0).normalizedTime;
skinLayer.skin = nextSkin;
spriteAnim.Play(clip, 1f);
return true;
}
- public static void removeTasksFromPlayer(PlayerControl player) {
- if (player == null) return;
- var toRemove = new List<PlayerTask>();
- foreach (PlayerTask task in player.myTasks) {
- if (task.gameObject.GetComponent<ImportantTextTask>() != null)
- continue;
- if (task.TaskType != TaskTypes.FixComms &&
- task.TaskType != TaskTypes.FixLights &&
- task.TaskType != TaskTypes.ResetReactor &&
- task.TaskType != TaskTypes.ResetSeismic &&
- task.TaskType != TaskTypes.RestoreOxy &&
- task.TaskType != TaskTypes.StopCharles) {
- toRemove.Add(task);
- }
- }
- foreach (PlayerTask task in toRemove) {
- player.RemoveTask(task);
- }
- }
public static void refreshRoleDescription(PlayerControl player) {
if (player == null) return;
}
}
- private static List<int> lighterColors = new List<int>(){ 3, 4, 5, 7, 10, 11};
public static bool isLighterColor(int colorId) {
- return lighterColors.Contains(colorId);
+ return CustomColors.lighterColors.Contains(colorId);
}
public static bool isCustomServer() {
- if (DestroyableSingleton<ServerManager>.CHNDKKBEIDG == null) return false;
- StringNames n = DestroyableSingleton<ServerManager>.CHNDKKBEIDG.HMIJGFFKBNN.TranslateName;
+ if (DestroyableSingleton<ServerManager>.Instance == null) return false;
+ StringNames n = DestroyableSingleton<ServerManager>.Instance.CurrentRegion.TranslateName;
return n != StringNames.ServerNA && n != StringNames.ServerEU && n != StringNames.ServerAS;
}
+ public static bool hasFakeTasks(PlayerControl player) {
+ return (player == Jester.jester || player == Jackal.jackal || player == Sidekick.sidekick);
+ }
+
public static string cs(Color c, string s) {
return string.Format("<color=#{0:X2}{1:X2}{2:X2}{3:X2}>{4}</color>", ToByte(c.r), ToByte(c.g), ToByte(c.b), ToByte(c.a), s);
}
return (byte)(f * 255);
}
}
-}
\ No newline at end of file
+}
namespace TheOtherRoles
{
- [HarmonyPatch(typeof(IntroCutscene.EMGDLDOHGCK), nameof(IntroCutscene.EMGDLDOHGCK.MoveNext))]
+ [HarmonyPatch(typeof(IntroCutscene.Nested_0), nameof(IntroCutscene.Nested_0.MoveNext))]
class IntroPatch
{
// Intro special teams
- static void Prefix(IntroCutscene.EMGDLDOHGCK __instance)
+ static void Prefix(IntroCutscene.Nested_0 __instance)
{
if (PlayerControl.LocalPlayer == Jester.jester)
{
}
// Add the Spy to the Impostor team (for the Impostors)
- if (Spy.spy != null && PlayerControl.LocalPlayer.PPMOEEPBHJO.FDNMBJOAPFL) {
+ if (Spy.spy != null && PlayerControl.LocalPlayer.Data.IsImpostor) {
List<PlayerControl> players = PlayerControl.AllPlayerControls.ToArray().ToList().OrderBy(x => Guid.NewGuid()).ToList();
var fakeImpostorTeam = new Il2CppSystem.Collections.Generic.List<PlayerControl>();
foreach (PlayerControl p in players) {
- if (p == Spy.spy || p.PPMOEEPBHJO.FDNMBJOAPFL)
+ if (p == Spy.spy || p.Data.IsImpostor)
fakeImpostorTeam.Add(p);
}
__instance.yourTeam = fakeImpostorTeam;
}
// Intro display role
- static void Postfix(IntroCutscene.EMGDLDOHGCK __instance)
+ static void Postfix(IntroCutscene.Nested_0 __instance)
{
List<RoleInfo> infos = RoleInfo.getRoleInfoForPlayer(PlayerControl.LocalPlayer);
if (infos.Count == 0) return;
if (PlayerControl.LocalPlayer == Lovers.lover1 || PlayerControl.LocalPlayer == Lovers.lover2)
{
PlayerControl otherLover = PlayerControl.LocalPlayer == Lovers.lover1 ? Lovers.lover2 : Lovers.lover1;
- __instance.__4__this.Title.text = PlayerControl.LocalPlayer.PPMOEEPBHJO.FDNMBJOAPFL ? "<color=#FF1919FF>Imp</color>Lover" : "Lover";
- __instance.__4__this.Title.color = PlayerControl.LocalPlayer.PPMOEEPBHJO.FDNMBJOAPFL ? Color.white : Lovers.color;
- __instance.__4__this.ImpostorText.text = "You are in <color=#FC03BEFF>Love</color><color=#FFFFFFFF> with </color><color=#FC03BEFF>" + (otherLover?.PPMOEEPBHJO?.PCLLABJCIPC ?? "") + "</color>";
- __instance.__4__this.ImpostorText.gameObject.SetActive(true);
- __instance.__4__this.BackgroundBar.material.color = Lovers.color;
+ __instance.__this.Title.text = PlayerControl.LocalPlayer.Data.IsImpostor ? "<color=#FF1919FF>Imp</color><color=#FC03BEFF>Lover</color>" : "<color=#FC03BEFF>Lover</color>";
+ __instance.__this.Title.color = PlayerControl.LocalPlayer.Data.IsImpostor ? Color.white : Lovers.color;
+ __instance.__this.ImpostorText.text = "You are in <color=#FC03BEFF>Love</color><color=#FFFFFFFF> with </color><color=#FC03BEFF>" + (otherLover?.Data?.PlayerName ?? "") + "</color>";
+ __instance.__this.ImpostorText.gameObject.SetActive(true);
+ __instance.__this.BackgroundBar.material.color = Lovers.color;
}
else if (roleInfo.name == "Crewmate" || roleInfo.name == "Impostor") {}
else {
- __instance.__4__this.Title.text = roleInfo.name;
- __instance.__4__this.Title.color = roleInfo.color;
- __instance.__4__this.ImpostorText.gameObject.SetActive(true);
- __instance.__4__this.ImpostorText.text = roleInfo.introDescription;
- __instance.__4__this.BackgroundBar.material.color = roleInfo.color;
+ __instance.__this.Title.text = roleInfo.name;
+ __instance.__this.Title.color = roleInfo.color;
+ __instance.__this.ImpostorText.gameObject.SetActive(true);
+ __instance.__this.ImpostorText.text = roleInfo.introDescription;
+ __instance.__this.BackgroundBar.material.color = roleInfo.color;
}
}
}
public class JackInTheBox {
public static System.Collections.Generic.List<JackInTheBox> AllJackInTheBoxes = new System.Collections.Generic.List<JackInTheBox>();
public static int JackInTheBoxLimit = 3;
- private static Sprite jackInTheBoxSprite;
public static bool boxesConvertedToVents = false;
+ private static List<Sprite> boxAnimationSprites;
- public static Sprite getJackInTheBoxSprite() {
- if (jackInTheBoxSprite) return jackInTheBoxSprite;
- jackInTheBoxSprite = Helpers.loadSpriteFromResources("TheOtherRoles.Resources.JackInTheBox.png", 175f);
- return jackInTheBoxSprite;
+ public static Sprite getBoxSprite() {
+ List<Sprite> s = getBoxAnimationSprites();
+ if (s.Count > 0) return s.First();
+ return null;
+ }
+
+ public static List<Sprite> getBoxAnimationSprites() {
+ if (boxAnimationSprites != null) return boxAnimationSprites;
+ boxAnimationSprites = new List<Sprite>();
+ for (int i = 1; i < 19; i++) boxAnimationSprites.Add(Helpers.loadSpriteFromResources($"TheOtherRoles.Resources.TricksterAnimation.trickster_box_00{i:00}.png", 175f));
+ return boxAnimationSprites;
+ }
+
+ public static void startAnimation(int ventId) {
+ JackInTheBox box = AllJackInTheBoxes.FirstOrDefault((x) => x?.vent != null && x.vent.Id == ventId);
+ if (box == null) return;
+ Vent vent = box.vent;
+
+ HudManager.Instance.StartCoroutine(Effects.Lerp(0.6f, new Action<float>((p) => {
+ var sprites = getBoxAnimationSprites();
+ if (vent != null && vent.myRend != null && sprites != null && sprites.Count > 0) {
+ int index = (int)(p * sprites.Count);
+ vent.myRend.sprite = sprites[Mathf.Clamp(index, 0, sprites.Count-1)];
+ if (p == 1f) vent.myRend.sprite = getBoxSprite();
+ }
+ })));
}
private GameObject gameObject;
- private Vent vent;
+ public Vent vent;
public JackInTheBox(Vector2 p) {
gameObject = new GameObject("JackInTheBox");
Vector3 position = new Vector3(p.x, p.y, PlayerControl.LocalPlayer.transform.position.z + 1f);
- position += (Vector3)PlayerControl.LocalPlayer.Collider.offset; // add Player Collider offset as this gets subtracted again on Vent.DoMove
+ position += (Vector3)PlayerControl.LocalPlayer.Collider.offset; // Add collider offset that DoMove moves the player up at a valid position
// Create the marker
gameObject.transform.position = position;
var boxRenderer = gameObject.AddComponent<SpriteRenderer>();
- boxRenderer.sprite = getJackInTheBoxSprite();
+ boxRenderer.sprite = getBoxSprite();
// Create the vent
var referenceVent = UnityEngine.Object.FindObjectOfType<Vent>();
vent.Center = null;
vent.EnterVentAnim = null;
vent.ExitVentAnim = null;
+ vent.Offset = new Vector3(0f, 0.25f, 0f);
vent.GetComponent<PowerTools.SpriteAnim>()?.Stop();
- vent.Id = ShipStatus.Instance.GJHKPDGJHJN.Select(x => x.Id).Max() + 1; // Make sure we have a unique id
+ vent.Id = ShipStatus.Instance.AllVents.Select(x => x.Id).Max() + 1; // Make sure we have a unique id
var ventRenderer = vent.GetComponent<SpriteRenderer>();
- ventRenderer.sprite = getJackInTheBoxSprite();
- vent.KJAENOGGEOK = ventRenderer;
- var allVentsList = ShipStatus.Instance.GJHKPDGJHJN.ToList();
+ ventRenderer.sprite = getBoxSprite();
+ vent.myRend = ventRenderer;
+ var allVentsList = ShipStatus.Instance.AllVents.ToList();
allVentsList.Add(vent);
- ShipStatus.Instance.GJHKPDGJHJN = allVentsList.ToArray();
+ ShipStatus.Instance.AllVents = allVentsList.ToArray();
vent.gameObject.SetActive(false);
vent.name = "JackInTheBoxVent_" + vent.Id;
public class TheOtherRolesPlugin : BasePlugin
{
public const string Id = "me.eisbison.theotherroles";
- public const string Version = "2.2.2";
+ public const string Version = "2.3.0";
public const byte Major = 2;
- public const byte Minor = 2;
- public const byte Patch = 2;
+ public const byte Minor = 3;
+ public const byte Patch = 0;
public Harmony Harmony { get; } = new Harmony(Id);
public static TheOtherRolesPlugin Instance;
public static int optionsPage = 1;
public static ConfigEntry<bool> DebugMode { get; private set; }
+ public static ConfigEntry<bool> StreamerMode { get; set; }
+ public static ConfigEntry<string> StreamerModeReplacementText { get; set; }
+ public static ConfigEntry<string> StreamerModeReplacementColor { get; set; }
public static ConfigEntry<string> Ip { get; set; }
public static ConfigEntry<ushort> Port { get; set; }
+ public static DnsRegionInfo CustomRegion;
+
public override void Load() {
DebugMode = Config.Bind("Custom", "Enable Debug Mode", false);
+ StreamerMode = Config.Bind("Custom", "Enable Streamer Mode", false);
+ StreamerModeReplacementText = Config.Bind("Custom", "Streamer Mode Replacement Text", "\n\nThe Other Roles");
+ StreamerModeReplacementColor = Config.Bind("Custom", "Streamer Mode Replacement Text Hex Color", "#87AAF5FF");
+
+
Ip = Config.Bind("Custom", "Custom Server IP", "127.0.0.1");
Port = Config.Bind("Custom", "Custom Server Port", (ushort)22023);
- IRegionInfo customRegion = new DnsRegionInfo(Ip.Value, "Custom", StringNames.NoTranslation, Ip.Value, Port.Value).Cast<IRegionInfo>();
- ServerManager serverManager = DestroyableSingleton<ServerManager>.CHNDKKBEIDG;
+ CustomRegion = new DnsRegionInfo(Ip.Value, "Custom", StringNames.NoTranslation, Ip.Value, Port.Value);
+ ServerManager serverManager = DestroyableSingleton<ServerManager>.Instance;
IRegionInfo[] regions = ServerManager.DefaultRegions;
- regions = regions.Concat(new IRegionInfo[] { customRegion }).ToArray();
+ regions = regions.Concat(new IRegionInfo[] { CustomRegion.Cast<IRegionInfo>() }).ToArray();
ServerManager.DefaultRegions = regions;
- serverManager.AGFAPIKFOFF = regions;
+ serverManager.AvailableRegions = regions;
serverManager.SaveServers();
- CEIOGGEDKAN.LMADJLEGIMH = CEIOGGEDKAN.IJGNCMMDGDI = Enumerable.Repeat(3, 16).ToArray(); // Max Imp = Recommended Imp = 3
- CEIOGGEDKAN.JMEMPINECJN = Enumerable.Repeat(4, 15).ToArray(); // Min Players = 4
+ GameOptionsData.RecommendedImpostors = GameOptionsData.MaxImpostors = Enumerable.Repeat(3, 16).ToArray(); // Max Imp = Recommended Imp = 3
+ GameOptionsData.MinPlayers = Enumerable.Repeat(4, 15).ToArray(); // Min Players = 4
DebugMode = Config.Bind("Custom", "Enable Debug Mode", false);
Instance = this;
CustomOptionHolder.Load();
-
+ CustomColors.Load();
+
Harmony.PatchAll();
}
}
// Deactivate bans, since I always leave my local testing game and ban myself
- [HarmonyPatch(typeof(IAJICOPDKHA), nameof(IAJICOPDKHA.LEHPLHFNDLM), MethodType.Getter)]
+ [HarmonyPatch(typeof(StatsManager), nameof(StatsManager.AmBanned), MethodType.Getter)]
public static class AmBannedPatch
{
public static void Postfix(out bool __result)
__result = false;
}
}
-
+ [HarmonyPatch(typeof(ChatController), nameof(ChatController.Awake))]
+ public static class ChatControllerAwakePatch {
+ private static void Prefix() {
+ SaveManager.chatModeType = 1;
+ SaveManager.isGuest = false;
+ }
+ }
+
// Debugging tools
[HarmonyPatch(typeof(KeyboardJoystick), nameof(KeyboardJoystick.Update))]
public static class DebugManager
bots.Add(playerControl);
GameData.Instance.AddPlayer(playerControl);
- AmongUsClient.Instance.Spawn(playerControl, -2, IDCDPDDALNM.None);
+ AmongUsClient.Instance.Spawn(playerControl, -2, InnerNet.SpawnFlags.None);
playerControl.transform.position = PlayerControl.LocalPlayer.transform.position;
playerControl.GetComponent<DummyBehaviour>().enabled = true;
playerControl.NetTransform.enabled = false;
playerControl.SetName(RandomString(10));
- playerControl.SetColor((byte) random.Next(BLMBFIODBKL.AEDCMKGJKAG.Length));
- playerControl.SetHat((uint) random.Next(HatManager.CHNDKKBEIDG.AllHats.Count), playerControl.PPMOEEPBHJO.IMMNCAGJJJC);
- playerControl.SetPet((uint) random.Next(HatManager.CHNDKKBEIDG.AllPets.Count));
- playerControl.SetSkin((uint) random.Next(HatManager.CHNDKKBEIDG.AllSkins.Count));
+ playerControl.SetColor((byte) random.Next(Palette.PlayerColors.Length));
+ playerControl.SetHat((uint) random.Next(HatManager.Instance.AllHats.Count), playerControl.Data.ColorId);
+ playerControl.SetPet((uint) random.Next(HatManager.Instance.AllPets.Count));
+ playerControl.SetSkin((uint) random.Next(HatManager.Instance.AllSkins.Count));
GameData.Instance.RpcSetTasks(playerControl.PlayerId, new byte[0]);
}
public static int maxNumberOfMeetings = 10;
public static bool blockSkippingInEmergencyMeetings = false;
public static bool noVoteIsSelfVote = false;
+ public static bool hidePlayerNames = false;
// Updating values
public static int meetingsCount = 0;
maxNumberOfMeetings = Mathf.RoundToInt(CustomOptionHolder.maxNumberOfMeetings.getSelection());
blockSkippingInEmergencyMeetings = CustomOptionHolder.blockSkippingInEmergencyMeetings.getBool();
noVoteIsSelfVote = CustomOptionHolder.noVoteIsSelfVote.getBool();
+ hidePlayerNames = CustomOptionHolder.hidePlayerNames.getBool();
}
}
}
\ No newline at end of file
using UnityEngine;
using System.Reflection;
-using Effects = AEOEPNHOJDP;
-using Palette = BLMBFIODBKL;
-
namespace TheOtherRoles
{
[HarmonyPatch]
class MeetingHudPatch {
static bool[] selections;
static SpriteRenderer[] renderers;
- private static GameData.LGBOMGHJELL target = null;
+ private static GameData.PlayerInfo target = null;
+ private const float scale = 0.65f;
- [HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.KEICNHGALLI))]
+ [HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.CheckForEndVoting))]
class MeetingCalculateVotesPatch {
private static byte[] calculateVotes(MeetingHud __instance) {
- byte[] array = new byte[__instance.GBKFCOAKLAH.Length + 1];
- for (int i = 0; i < __instance.GBKFCOAKLAH.Length; i++)
+ byte[] array = new byte[__instance.playerStates.Length + 1];
+ for (int i = 0; i < __instance.playerStates.Length; i++)
{
- PlayerVoteArea playerVoteArea = __instance.GBKFCOAKLAH[i];
+ PlayerVoteArea playerVoteArea = __instance.playerStates[i];
if (playerVoteArea.didVote)
{
int num = (int)(playerVoteArea.votedFor + 1);
byte[] array2 = array;
int num2 = num;
// Mayor count vote twice
- if (Mayor.mayor != null && playerVoteArea.GEIOMAPOPKA == (sbyte)Mayor.mayor.PlayerId)
+ if (Mayor.mayor != null && playerVoteArea.TargetPlayerId == (sbyte)Mayor.mayor.PlayerId)
array2[num2] += 2;
else
array2[num2] += 1;
PlayerVoteArea swapped1 = null;
PlayerVoteArea swapped2 = null;
- foreach (PlayerVoteArea playerVoteArea in __instance.GBKFCOAKLAH) {
- if (playerVoteArea.GEIOMAPOPKA == Swapper.playerId1) swapped1 = playerVoteArea;
- if (playerVoteArea.GEIOMAPOPKA == Swapper.playerId2) swapped2 = playerVoteArea;
+ foreach (PlayerVoteArea playerVoteArea in __instance.playerStates) {
+ if (playerVoteArea.TargetPlayerId == Swapper.playerId1) swapped1 = playerVoteArea;
+ if (playerVoteArea.TargetPlayerId == Swapper.playerId2) swapped2 = playerVoteArea;
}
- if (swapped1 != null && swapped2 != null && swapped1.GEIOMAPOPKA + 1 >= 0 && swapped1.GEIOMAPOPKA + 1 < array.Length && swapped2.GEIOMAPOPKA + 1 >= 0 && swapped2.GEIOMAPOPKA + 1 < array.Length) {
- byte tmp = array[swapped1.GEIOMAPOPKA + 1];
- array[swapped1.GEIOMAPOPKA + 1] = array[swapped2.GEIOMAPOPKA + 1];
- array[swapped2.GEIOMAPOPKA + 1] = tmp;
+ if (swapped1 != null && swapped2 != null && swapped1.TargetPlayerId + 1 >= 0 && swapped1.TargetPlayerId + 1 < array.Length && swapped2.TargetPlayerId + 1 >= 0 && swapped2.TargetPlayerId + 1 < array.Length) {
+ byte tmp = array[swapped1.TargetPlayerId + 1];
+ array[swapped1.TargetPlayerId + 1] = array[swapped2.TargetPlayerId + 1];
+ array[swapped2.TargetPlayerId + 1] = tmp;
}
return array;
}
static bool Prefix(MeetingHud __instance)
{
- if (__instance.GBKFCOAKLAH.All((PlayerVoteArea ps) => ps.isDead || ps.didVote))
+ if (__instance.playerStates.All((PlayerVoteArea ps) => ps.isDead || ps.didVote))
{
// If skipping is disabled, replace skipps/no-votes with self vote
if (target == null && blockSkippingInEmergencyMeetings && noVoteIsSelfVote) {
- foreach (PlayerVoteArea playerVoteArea in __instance.GBKFCOAKLAH) {
- if (playerVoteArea.votedFor < 0) playerVoteArea.votedFor = playerVoteArea.GEIOMAPOPKA; // TargetPlayerId
+ foreach (PlayerVoteArea playerVoteArea in __instance.playerStates) {
+ if (playerVoteArea.votedFor < 0) playerVoteArea.votedFor = playerVoteArea.TargetPlayerId; // TargetPlayerId
}
}
byte[] self = calculateVotes(__instance);
bool tie;
int maxIdx = IndexOfMax(self, (byte p) => (int)p, out tie) - 1;
- GameData.LGBOMGHJELL exiled = null;
- foreach (GameData.LGBOMGHJELL pi in GameData.Instance.AllPlayers) {
- if (pi.FNPNJHNKEBK == maxIdx) {
+ GameData.PlayerInfo exiled = null;
+ foreach (GameData.PlayerInfo pi in GameData.Instance.AllPlayers) {
+ if (pi.PlayerId == maxIdx) {
exiled = pi;
break;
}
}
- byte[] array = new byte[__instance.GBKFCOAKLAH.Length];
- for (int i = 0; i < __instance.GBKFCOAKLAH.Length; i++)
+ byte[] array = new byte[__instance.playerStates.Length];
+ for (int i = 0; i < __instance.playerStates.Length; i++)
{
- PlayerVoteArea playerVoteArea = __instance.GBKFCOAKLAH[i];
- array[(int)playerVoteArea.GEIOMAPOPKA] = playerVoteArea.GetState();
+ PlayerVoteArea playerVoteArea = __instance.playerStates[i];
+ array[(int)playerVoteArea.TargetPlayerId] = playerVoteArea.GetState();
}
// RPCVotingComplete
- if (AmongUsClient.Instance.BPADAHAOBLM)
- __instance.BBFDNCCEJHI(array, exiled, tie);
+ if (AmongUsClient.Instance.AmClient)
+ __instance.VotingComplete(array, exiled, tie);
MessageWriter messageWriter = AmongUsClient.Instance.StartRpc(__instance.NetId, 23, Hazel.SendOption.Reliable);
messageWriter.WriteBytesAndSize(array);
- messageWriter.Write((exiled != null) ? exiled.FNPNJHNKEBK : byte.MaxValue);
+ messageWriter.Write((exiled != null) ? exiled.PlayerId : byte.MaxValue);
messageWriter.Write(tie);
messageWriter.EndMessage();
}
}
}
- [HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.FIJFIACMIFB))]
+ [HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.PopulateResults))]
class MeetingPopulateVotesPatch {
- static bool Prefix(MeetingHud __instance, Il2CppStructArray<byte> COMOIMMLKHF)
+ static bool Prefix(MeetingHud __instance, [HarmonyArgument(0)]Il2CppStructArray<byte> states)
{
// Swapper swap votes
PlayerVoteArea swapped1 = null;
PlayerVoteArea swapped2 = null;
- foreach (PlayerVoteArea playerVoteArea in __instance.GBKFCOAKLAH) {
- if (playerVoteArea.GEIOMAPOPKA == Swapper.playerId1) swapped1 = playerVoteArea;
- if (playerVoteArea.GEIOMAPOPKA == Swapper.playerId2) swapped2 = playerVoteArea;
+ foreach (PlayerVoteArea playerVoteArea in __instance.playerStates) {
+ if (playerVoteArea.TargetPlayerId == Swapper.playerId1) swapped1 = playerVoteArea;
+ if (playerVoteArea.TargetPlayerId == Swapper.playerId2) swapped2 = playerVoteArea;
}
bool doSwap = swapped1 != null && swapped2 != null;
+ float delay = 0f;
if (doSwap) {
+ delay = 2f;
+ __instance.StartCoroutine(Effects.Slide3D(swapped1.transform, swapped1.transform.localPosition, swapped2.transform.localPosition, 2f));
+ __instance.StartCoroutine(Effects.Slide3D(swapped2.transform, swapped2.transform.localPosition, swapped1.transform.localPosition, 2f));
+ }
- __instance.StartCoroutine(Effects.KLAIEICHCNO(swapped1.transform, swapped1.transform.localPosition, swapped2.transform.localPosition, 2f));
- __instance.StartCoroutine(Effects.KLAIEICHCNO(swapped2.transform, swapped2.transform.localPosition, swapped1.transform.localPosition, 2f));
+ float votesXOffset = 0f;
+ float votesFinalSize = 1f;
+ if (__instance.playerStates.Length > 10) {
+ votesXOffset = 0.1f;
+ votesFinalSize = scale;
}
// Mayor display vote twice
- __instance.TitleText.text = DestroyableSingleton<TranslationController>.CHNDKKBEIDG.GetString(StringNames.MeetingVotingResults, new Il2CppReferenceArray<Il2CppSystem.Object>(0));
- int num = doSwap ? 4 : 0; // Delay animaton if swapping
- for (int i = 0; i < __instance.GBKFCOAKLAH.Length; i++)
+ __instance.TitleText.text = DestroyableSingleton<TranslationController>.Instance.GetString(StringNames.MeetingVotingResults, new Il2CppReferenceArray<Il2CppSystem.Object>(0));
+ int num = 0;
+ for (int i = 0; i < __instance.playerStates.Length; i++)
{
- PlayerVoteArea playerVoteArea = __instance.GBKFCOAKLAH[i];
+ PlayerVoteArea playerVoteArea = __instance.playerStates[i];
playerVoteArea.ClearForResults();
- int num2 = doSwap ? 4 : 0; // Delay animaton if swapping
+ int num2 = 0;
bool mayorFirstVoteDisplayed = false;
- for (int j = 0; j < __instance.GBKFCOAKLAH.Length; j++)
+ for (int j = 0; j < __instance.playerStates.Length; j++)
{
- PlayerVoteArea playerVoteArea2 = __instance.GBKFCOAKLAH[j];
- byte self = COMOIMMLKHF[(int)playerVoteArea2.GEIOMAPOPKA];
+ PlayerVoteArea playerVoteArea2 = __instance.playerStates[j];
+ byte self = states[(int)playerVoteArea2.TargetPlayerId];
if (!((self & 128) > 0))
{
- GameData.LGBOMGHJELL playerById = GameData.Instance.GetPlayerById((byte)playerVoteArea2.GEIOMAPOPKA);
+ GameData.PlayerInfo playerById = GameData.Instance.GetPlayerById((byte)playerVoteArea2.TargetPlayerId);
int votedFor = (int)PlayerVoteArea.GetVotedFor(self);
- if (votedFor == (int)playerVoteArea.GEIOMAPOPKA)
+ if (votedFor == (int)playerVoteArea.TargetPlayerId)
{
SpriteRenderer spriteRenderer = UnityEngine.Object.Instantiate<SpriteRenderer>(__instance.PlayerVotePrefab);
- if (PlayerControl.GameOptions.BBPDJOCPEEJ)
+ if (PlayerControl.GameOptions.AnonymousVotes)
{
- PlayerControl.SetPlayerMaterialColors(Palette.EGHCBLDNCGP, spriteRenderer);
+ PlayerControl.SetPlayerMaterialColors(Palette.DisabledGrey, spriteRenderer);
}
else
{
- PlayerControl.SetPlayerMaterialColors((int)playerById.IMMNCAGJJJC, spriteRenderer);
+ PlayerControl.SetPlayerMaterialColors((int)playerById.ColorId, spriteRenderer);
}
spriteRenderer.transform.SetParent(playerVoteArea.transform);
- spriteRenderer.transform.localPosition = __instance.FAJKDFHIHDN + new Vector3(__instance.GGHFHCMCJAL.x * (float)num2, 0f, 0f);
+ spriteRenderer.transform.localPosition = __instance.CounterOrigin + new Vector3(votesXOffset + __instance.CounterOffsets.x * (float)(num2), 0f, 0f);
spriteRenderer.transform.localScale = Vector3.zero;
spriteRenderer.transform.SetParent(playerVoteArea.transform.parent); // Reparent votes so they don't move with their playerVoteArea
- __instance.StartCoroutine(Effects.JCDLOIMPBFJ((float)num2 * 0.5f, spriteRenderer.transform, 1f, 0.5f));
+ __instance.StartCoroutine(Effects.Bloop((float)(num2) * 0.5f + delay, spriteRenderer.transform, votesFinalSize, 0.5f));
num2++;
}
else if (i == 0 && votedFor == -1)
{
SpriteRenderer spriteRenderer2 = UnityEngine.Object.Instantiate<SpriteRenderer>(__instance.PlayerVotePrefab);
- if (PlayerControl.GameOptions.BBPDJOCPEEJ)
+ if (PlayerControl.GameOptions.AnonymousVotes)
{
- PlayerControl.SetPlayerMaterialColors(Palette.EGHCBLDNCGP, spriteRenderer2);
+ PlayerControl.SetPlayerMaterialColors(Palette.DisabledGrey, spriteRenderer2);
}
else
{
- PlayerControl.SetPlayerMaterialColors((int)playerById.IMMNCAGJJJC, spriteRenderer2);
+ PlayerControl.SetPlayerMaterialColors((int)playerById.ColorId, spriteRenderer2);
}
spriteRenderer2.transform.SetParent(__instance.SkippedVoting.transform);
- spriteRenderer2.transform.localPosition = __instance.FAJKDFHIHDN + new Vector3(__instance.GGHFHCMCJAL.x * (float)num, 0f, 0f);
+ spriteRenderer2.transform.localPosition = __instance.CounterOrigin + new Vector3(votesXOffset + __instance.CounterOffsets.x * (float)(num), 0f, 0f);
spriteRenderer2.transform.localScale = Vector3.zero;
spriteRenderer2.transform.SetParent(playerVoteArea.transform.parent); // Reparent votes so they don't move with their playerVoteArea
- __instance.StartCoroutine(Effects.JCDLOIMPBFJ((float)num * 0.5f, spriteRenderer2.transform, 1f, 0.5f));
+ __instance.StartCoroutine(Effects.Bloop((float)num * 0.5f + delay, spriteRenderer2.transform, votesFinalSize, 0.5f));
num++;
}
// Major vote, redo this iteration to place a second vote
- if (Mayor.mayor != null && playerVoteArea2.GEIOMAPOPKA == (sbyte)Mayor.mayor.PlayerId && !mayorFirstVoteDisplayed) {
+ if (Mayor.mayor != null && playerVoteArea2.TargetPlayerId == (sbyte)Mayor.mayor.PlayerId && !mayorFirstVoteDisplayed) {
mayorFirstVoteDisplayed = true;
j--;
}
}
}
- [HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.BBFDNCCEJHI))]
+ [HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.VotingComplete))]
class MeetingHudVotingCompletedPatch {
- static void Postfix(MeetingHud __instance, byte[] COMOIMMLKHF, GameData.LGBOMGHJELL EAFLJGMBLCH, bool EMBDDLIPBME)
+ static void Postfix(MeetingHud __instance, [HarmonyArgument(0)]byte[] states, [HarmonyArgument(1)]GameData.PlayerInfo exiled, [HarmonyArgument(2)]bool tie)
{
// Reset swapper values
Swapper.playerId1 = Byte.MaxValue;
// Lovers save next to be exiled, because RPC of ending game comes before RPC of exiled
Lovers.notAckedExiledIsLover = false;
- if (EAFLJGMBLCH != null)
- Lovers.notAckedExiledIsLover = ((Lovers.lover1 != null && Lovers.lover1.PlayerId == EAFLJGMBLCH.FNPNJHNKEBK) || (Lovers.lover2 != null && Lovers.lover2.PlayerId == EAFLJGMBLCH.FNPNJHNKEBK));
+ if (exiled != null)
+ Lovers.notAckedExiledIsLover = ((Lovers.lover1 != null && Lovers.lover1.PlayerId == exiled.PlayerId) || (Lovers.lover2 != null && Lovers.lover2.PlayerId == exiled.PlayerId));
}
}
static void onClick(int i, MeetingHud __instance)
{
- if (Swapper.swapper == null || PlayerControl.LocalPlayer != Swapper.swapper || Swapper.swapper.PPMOEEPBHJO.IAGJEKLJCCI) return;
- if (__instance.FOIGOPKABAA == MeetingHud.MANCENPNMAC.Results) return;
- if (__instance.GBKFCOAKLAH[i].isDead) return;
+ if (Swapper.swapper == null || PlayerControl.LocalPlayer != Swapper.swapper || Swapper.swapper.Data.IsDead) return;
+ if (__instance.state == MeetingHud.VoteStates.Results) return;
+ if (__instance.playerStates[i].isDead) return;
int selectedCount = selections.Where(b => b).Count();
SpriteRenderer renderer = renderers[i];
for (int A = 0; A < selections.Length; A++) {
if (selections[A]) {
if (firstPlayer != null) {
- secondPlayer = __instance.GBKFCOAKLAH[A];
+ secondPlayer = __instance.playerStates[A];
break;
} else {
- firstPlayer = __instance.GBKFCOAKLAH[A];
+ firstPlayer = __instance.playerStates[A];
}
}
}
if (firstPlayer != null && secondPlayer != null) {
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SwapperSwap, Hazel.SendOption.Reliable, -1);
- writer.Write((byte)firstPlayer.GEIOMAPOPKA);
- writer.Write((byte)secondPlayer.GEIOMAPOPKA);
+ writer.Write((byte)firstPlayer.TargetPlayerId);
+ writer.Write((byte)secondPlayer.TargetPlayerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
- RPCProcedure.swapperSwap((byte)firstPlayer.GEIOMAPOPKA, (byte)secondPlayer.GEIOMAPOPKA);
+ RPCProcedure.swapperSwap((byte)firstPlayer.TargetPlayerId, (byte)secondPlayer.TargetPlayerId);
}
}
}
}
static void populateButtonsPostfix(MeetingHud __instance) {
- // Reposition button if there are more than 10 players
- float scale = 5f / 8f; // 8 rows are needed instead of 5
- if (__instance.GBKFCOAKLAH != null && __instance.GBKFCOAKLAH.Length > 10) {
- for (int i = 0; i < __instance.GBKFCOAKLAH.Length; i++) {
- PlayerVoteArea area = __instance.GBKFCOAKLAH[i];
- bool isLeft = i % 2 == 0;
- int num2 = i / 2;
- area.transform.localPosition = __instance.VoteOrigin + new Vector3(isLeft ? 1f : 3.9f, __instance.VoteButtonOffsets.y * (float)num2 * scale, area.transform.localPosition.z);
- area.transform.localScale = new Vector3(area.transform.localScale.x * scale, area.transform.localScale.y * scale, area.transform.localScale.z);
+ // Change buttons if there are more than 10 players
+ if (__instance.playerStates != null && __instance.playerStates.Length > 10) {
+ PlayerVoteArea[] playerStates = __instance.playerStates.OrderBy((PlayerVoteArea p) => p.isDead ? 50 : 0)
+ .ThenBy((PlayerVoteArea p) => p.TargetPlayerId)
+ .ToArray<PlayerVoteArea>();
+ for (int i = 0; i < playerStates.Length; i++) {
+ PlayerVoteArea area = playerStates[i];
+
+ int row = i/3, col = i%3;
+
+ // Update scalings
+ area.Overlay.transform.localScale = area.PlayerButton.transform.localScale = new Vector3(1, 1/scale, 1);
+ area.NameText.transform.localScale = new Vector3(1/scale, 1/scale, 1);
+ area.gameObject.transform.localScale = new Vector3(scale, scale, 1);
+ GameObject megaphoneWrapper = new GameObject();
+ megaphoneWrapper.transform.SetParent(area.transform);
+ megaphoneWrapper.transform.localScale = Vector3.one * 1/scale;
+ area.Megaphone.transform.SetParent(megaphoneWrapper.transform);
+
+ // Update positions
+ area.Megaphone.transform.localPosition += Vector3.left * 0.1f;
+ area.NameText.transform.localPosition = new Vector3(1.2f, 0.2f, area.NameText.transform.localPosition.z);
+ area.transform.localPosition = new Vector3(-3.63f + 2.43f * col, 1.5f - 0.76f * row, -0.9f - 0.01f * row);
}
}
// Add Swapper Buttons
- if (Swapper.swapper == null || PlayerControl.LocalPlayer != Swapper.swapper || Swapper.swapper.PPMOEEPBHJO.IAGJEKLJCCI) return;
- selections = new bool[__instance.GBKFCOAKLAH.Length];
- renderers = new SpriteRenderer[__instance.GBKFCOAKLAH.Length];
+ if (Swapper.swapper == null || PlayerControl.LocalPlayer != Swapper.swapper || Swapper.swapper.Data.IsDead) return;
+ selections = new bool[__instance.playerStates.Length];
+ renderers = new SpriteRenderer[__instance.playerStates.Length];
- for (int i = 0; i < __instance.GBKFCOAKLAH.Length; i++)
+ for (int i = 0; i < __instance.playerStates.Length; i++)
{
- PlayerVoteArea playerVoteArea = __instance.GBKFCOAKLAH[i];
+ PlayerVoteArea playerVoteArea = __instance.playerStates[i];
GameObject template = playerVoteArea.Buttons.transform.Find("CancelButton").gameObject;
GameObject checkbox = UnityEngine.Object.Instantiate(template);
checkbox.transform.SetParent(playerVoteArea.transform);
[HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.Deserialize))]
class MeetingDeserializePatch {
- static void Postfix(MeetingHud __instance, MessageReader JIGFBHFFNFI, bool DNMLJNIADHH)
+ static void Postfix(MeetingHud __instance, [HarmonyArgument(0)]MessageReader reader, [HarmonyArgument(1)]bool initialState)
{
// Add swapper buttons
- if (DNMLJNIADHH) {
+ if (initialState) {
populateButtonsPostfix(__instance);
}
}
[HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.CoStartMeeting))]
class StartMeetingPatch {
- public static void Prefix(PlayerControl __instance, GameData.LGBOMGHJELL DGDGDKCCKHJ) {
+ public static void Prefix(PlayerControl __instance, [HarmonyArgument(0)]GameData.PlayerInfo meetingTarget) {
// Reset vampire bitten
Vampire.bitten = null;
// Count meetings
- if (DGDGDKCCKHJ == null) meetingsCount++;
+ if (meetingTarget == null) meetingsCount++;
// Save the meeting target
- target = DGDGDKCCKHJ;
+ target = meetingTarget;
}
}
[HarmonyPatch(typeof(ExileController), "Begin")]
class ExileBeginPatch {
-
- public static void Prefix(ref GameData.LGBOMGHJELL EAFLJGMBLCH, bool EMBDDLIPBME) {
+ public static void Prefix(ExileController __instance, [HarmonyArgument(0)]ref GameData.PlayerInfo exiled, [HarmonyArgument(1)]bool tie) {
// Shifter shift
- if (Shifter.shifter != null && AmongUsClient.Instance.HHBLOCGKFAB && Shifter.futureShift != null) { // We need to send the RPC from the host here, to make sure that the order of shifting and erasing is correct (for that reason the futureShifted and futureErased are being synced)
+ if (Shifter.shifter != null && AmongUsClient.Instance.AmHost && Shifter.futureShift != null) { // We need to send the RPC from the host here, to make sure that the order of shifting and erasing is correct (for that reason the futureShifted and futureErased are being synced)
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ShifterShift, Hazel.SendOption.Reliable, -1);
writer.Write(Shifter.futureShift.PlayerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
Shifter.futureShift = null;
// Eraser erase
- if (Eraser.eraser != null && AmongUsClient.Instance.HHBLOCGKFAB && Eraser.futureErased != null) { // We need to send the RPC from the host here, to make sure that the order of shifting and erasing is correct (for that reason the futureShifted and futureErased are being synced)
+ if (Eraser.eraser != null && AmongUsClient.Instance.AmHost && Eraser.futureErased != null) { // We need to send the RPC from the host here, to make sure that the order of shifting and erasing is correct (for that reason the futureShifted and futureErased are being synced)
foreach (PlayerControl target in Eraser.futureErased) {
if (target != null) {
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ErasePlayerRole, Hazel.SendOption.Reliable, -1);
// Reset custom button timers where necessary
CustomButton.MeetingEndedUpdate();
// Child set adapted cooldown
- if (Child.child != null && PlayerControl.LocalPlayer == Child.child && Child.child.PPMOEEPBHJO.FDNMBJOAPFL) {
+ if (Child.child != null && PlayerControl.LocalPlayer == Child.child && Child.child.Data.IsImpostor) {
var multiplier = Child.isGrownUp() ? 0.66f : 2f;
- Child.child.SetKillTimer(PlayerControl.GameOptions.DGOPNLEEAAJ * multiplier);
+ Child.child.SetKillTimer(PlayerControl.GameOptions.KillCooldown * multiplier);
}
// Seer spawn souls
rend.sprite = Seer.getSoulSprite();
if(Seer.limitSoulDuration) {
- HudManager.CHNDKKBEIDG.StartCoroutine(Effects.DCHLMIDMBHG(Seer.soulDuration, new Action<float>((p) => {
+ HudManager.Instance.StartCoroutine(Effects.Lerp(Seer.soulDuration, new Action<float>((p) => {
if (rend != null) {
var tmp = rend.color;
tmp.a = Mathf.Clamp01(1 - p);
rend.color = tmp;
}
- if (p == 1f && rend?.gameObject != null) UnityEngine.Object.Destroy(rend.gameObject);
+ if (p == 1f && rend != null && rend.gameObject != null) UnityEngine.Object.Destroy(rend.gameObject);
})));
}
}
[HarmonyPatch(typeof(TranslationController), nameof(TranslationController.GetString), new Type[] { typeof(StringNames), typeof(Il2CppReferenceArray<Il2CppSystem.Object>) })]
class MeetingExiledTextPatch
{
- static void Postfix(ref string __result, StringNames AKGLBKHCEMI, Il2CppReferenceArray<Il2CppSystem.Object> FHLKFONKJLH)
+ static void Postfix(ref string __result, [HarmonyArgument(0)]StringNames id, [HarmonyArgument(1)]Il2CppReferenceArray<Il2CppSystem.Object> parts)
{
- if (ExileController.Instance != null && ExileController.Instance.EAFLJGMBLCH != null)
+ if (ExileController.Instance != null && ExileController.Instance.exiled != null)
{
// Exile role text for roles that are being assigned to crewmates
- if (AKGLBKHCEMI == StringNames.ExileTextPN || AKGLBKHCEMI == StringNames.ExileTextSN)
+ if (id == StringNames.ExileTextPN || id == StringNames.ExileTextSN)
{
- if( Jester.jester != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Jester.jester.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Jester.";
- else if(Mayor.mayor != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Mayor.mayor.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Mayor.";
- else if(Engineer.engineer != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Engineer.engineer.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Engineer.";
- else if(Sheriff.sheriff != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Sheriff.sheriff.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Sheriff.";
- else if(Lighter.lighter != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Lighter.lighter.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Lighter.";
- else if(Detective.detective != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Detective.detective.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Detective.";
- else if(TimeMaster.timeMaster != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == TimeMaster.timeMaster.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Time Master.";
- else if(Medic.medic != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Medic.medic.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Medic.";
- else if(Shifter.shifter != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Shifter.shifter.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Shifter.";
- else if(Swapper.swapper != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Swapper.swapper.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Swapper.";
- else if(Lovers.lover1 != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Lovers.lover1.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Lover.";
- else if(Lovers.lover2 != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Lovers.lover2.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Lover.";
- else if(Seer.seer != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Seer.seer.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Seer.";
- else if(Hacker.hacker != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Hacker.hacker.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Hacker.";
- else if(Child.child != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Child.child.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Child.";
- else if(Tracker.tracker != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Tracker.tracker.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Tracker.";
- else if(Snitch.snitch != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Snitch.snitch.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Snitch.";
- else if(Jackal.jackal != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Jackal.jackal.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Jackal.";
- else if(Sidekick.sidekick != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Sidekick.sidekick.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Sidekick.";
- else if(Spy.spy != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Spy.spy.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Spy.";
+ if( Jester.jester != null && ExileController.Instance.exiled.Object.PlayerId == Jester.jester.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Jester.";
+ else if(Mayor.mayor != null && ExileController.Instance.exiled.Object.PlayerId == Mayor.mayor.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Mayor.";
+ else if(Engineer.engineer != null && ExileController.Instance.exiled.Object.PlayerId == Engineer.engineer.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Engineer.";
+ else if(Sheriff.sheriff != null && ExileController.Instance.exiled.Object.PlayerId == Sheriff.sheriff.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Sheriff.";
+ else if(Lighter.lighter != null && ExileController.Instance.exiled.Object.PlayerId == Lighter.lighter.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Lighter.";
+ else if(Detective.detective != null && ExileController.Instance.exiled.Object.PlayerId == Detective.detective.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Detective.";
+ else if(TimeMaster.timeMaster != null && ExileController.Instance.exiled.Object.PlayerId == TimeMaster.timeMaster.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Time Master.";
+ else if(Medic.medic != null && ExileController.Instance.exiled.Object.PlayerId == Medic.medic.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Medic.";
+ else if(Shifter.shifter != null && ExileController.Instance.exiled.Object.PlayerId == Shifter.shifter.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Shifter.";
+ else if(Swapper.swapper != null && ExileController.Instance.exiled.Object.PlayerId == Swapper.swapper.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Swapper.";
+ else if(Lovers.lover1 != null && ExileController.Instance.exiled.Object.PlayerId == Lovers.lover1.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Lover.";
+ else if(Lovers.lover2 != null && ExileController.Instance.exiled.Object.PlayerId == Lovers.lover2.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Lover.";
+ else if(Seer.seer != null && ExileController.Instance.exiled.Object.PlayerId == Seer.seer.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Seer.";
+ else if(Hacker.hacker != null && ExileController.Instance.exiled.Object.PlayerId == Hacker.hacker.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Hacker.";
+ else if(Child.child != null && ExileController.Instance.exiled.Object.PlayerId == Child.child.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Child.";
+ else if(Tracker.tracker != null && ExileController.Instance.exiled.Object.PlayerId == Tracker.tracker.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Tracker.";
+ else if(Snitch.snitch != null && ExileController.Instance.exiled.Object.PlayerId == Snitch.snitch.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Snitch.";
+ else if(Jackal.jackal != null && ExileController.Instance.exiled.Object.PlayerId == Jackal.jackal.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Jackal.";
+ else if(Sidekick.sidekick != null && ExileController.Instance.exiled.Object.PlayerId == Sidekick.sidekick.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Sidekick.";
+ else if(Spy.spy != null && ExileController.Instance.exiled.Object.PlayerId == Spy.spy.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Spy.";
else
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was not The Impostor.";
+ __result = ExileController.Instance.exiled.PlayerName + " was not The Impostor.";
}
// Exile role text for roles that are being assigned to impostors
- if (AKGLBKHCEMI == StringNames.ExileTextPP || AKGLBKHCEMI == StringNames.ExileTextSP) {
- if(Godfather.godfather != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Godfather.godfather.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Godfather.";
- else if(Mafioso.mafioso != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Mafioso.mafioso.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Mafioso.";
- else if(Janitor.janitor != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Janitor.janitor.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Janitor.";
- else if(Morphling.morphling != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Morphling.morphling.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Morphling.";
- else if(Camouflager.camouflager != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Camouflager.camouflager.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Camouflager.";
- else if(Lovers.lover1 != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Lovers.lover1.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The ImpLover.";
- else if(Lovers.lover2 != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Lovers.lover2.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The ImpLover.";
- else if(Vampire.vampire != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Vampire.vampire.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Vampire.";
- else if (Eraser.eraser != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Eraser.eraser.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Eraser.";
- else if (Trickster.trickster != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Trickster.trickster.PlayerId)
- __result = ExileController.Instance.EAFLJGMBLCH.PCLLABJCIPC + " was The Trickster.";
+ if (id == StringNames.ExileTextPP || id == StringNames.ExileTextSP) {
+ if(Godfather.godfather != null && ExileController.Instance.exiled.Object.PlayerId == Godfather.godfather.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Godfather.";
+ else if(Mafioso.mafioso != null && ExileController.Instance.exiled.Object.PlayerId == Mafioso.mafioso.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Mafioso.";
+ else if(Janitor.janitor != null && ExileController.Instance.exiled.Object.PlayerId == Janitor.janitor.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Janitor.";
+ else if(Morphling.morphling != null && ExileController.Instance.exiled.Object.PlayerId == Morphling.morphling.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Morphling.";
+ else if(Camouflager.camouflager != null && ExileController.Instance.exiled.Object.PlayerId == Camouflager.camouflager.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Camouflager.";
+ else if(Lovers.lover1 != null && ExileController.Instance.exiled.Object.PlayerId == Lovers.lover1.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The ImpLover.";
+ else if(Lovers.lover2 != null && ExileController.Instance.exiled.Object.PlayerId == Lovers.lover2.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The ImpLover.";
+ else if(Vampire.vampire != null && ExileController.Instance.exiled.Object.PlayerId == Vampire.vampire.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Vampire.";
+ else if (Eraser.eraser != null && ExileController.Instance.exiled.Object.PlayerId == Eraser.eraser.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Eraser.";
+ else if (Trickster.trickster != null && ExileController.Instance.exiled.Object.PlayerId == Trickster.trickster.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Trickster.";
+ else if (Cleaner.cleaner != null && ExileController.Instance.exiled.Object.PlayerId == Cleaner.cleaner.PlayerId)
+ __result = ExileController.Instance.exiled.PlayerName + " was The Cleaner.";
}
// Hide number of remaining impostors on Jester win
- if (AKGLBKHCEMI == StringNames.ImpostorsRemainP || AKGLBKHCEMI == StringNames.ImpostorsRemainS)
+ if (id == StringNames.ImpostorsRemainP || id == StringNames.ImpostorsRemainS)
{
- if (Jester.jester != null && ExileController.Instance.EAFLJGMBLCH.GJPBCGFPMOD.PlayerId == Jester.jester.PlayerId)
+ if (Jester.jester != null && ExileController.Instance.exiled.Object.PlayerId == Jester.jester.PlayerId)
__result = "";
}
}
using static TheOtherRoles.GameHistory;
using UnityEngine;
-using SystemTypes = BCPJLGGNHBC;
-using Palette = BLMBFIODBKL;
-using Constants = LNCOKMACBKP;
-using PhysicsHelpers = FJFJIDCFLDJ;
-using DeathReason = EGHDCAKGMKI;
-using GameOptionsData = CEIOGGEDKAN;
-using Effects = AEOEPNHOJDP;
-
namespace TheOtherRoles {
[HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.FixedUpdate))]
public static class PlayerControlFixedUpdatePatch
{
- public static void bendTimeUpdate() {
- if (TimeMaster.isRewinding) {
- if (localPlayerPositions.Count > 0) {
- // Set position
- var next = localPlayerPositions[0];
- if (!PlayerControl.LocalPlayer.inVent)
- PlayerControl.LocalPlayer.transform.position = next.Item1;
- localPlayerPositions.RemoveAt(0);
- if (localPlayerPositions.Count > 0) localPlayerPositions.RemoveAt(0); // Skip every second position to rewinde in half the time
- } else {
- TimeMaster.isRewinding = false;
- PlayerControl.LocalPlayer.moveable = true;
- }
- } else {
- while (localPlayerPositions.Count >= Mathf.Round(TimeMaster.rewindTime / Time.fixedDeltaTime)) localPlayerPositions.RemoveAt(localPlayerPositions.Count - 1);
- localPlayerPositions.Insert(0, new Tuple<Vector3, DateTime>(PlayerControl.LocalPlayer.transform.position, DateTime.UtcNow));
- }
- }
+ // Helpers
static PlayerControl setTarget(bool onlyCrewmates = false, bool targetPlayersInVents = false, List<PlayerControl> untargetablePlayers = null) {
PlayerControl result = null;
- float num = GameOptionsData.DCAJHEGBLDD[Mathf.Clamp(PlayerControl.GameOptions.OCPGKHJJAHL, 0, 2)];
+ float num = GameOptionsData.KillDistances[Mathf.Clamp(PlayerControl.GameOptions.KillDistance, 0, 2)];
if (!ShipStatus.Instance) return result;
Vector2 truePosition = PlayerControl.LocalPlayer.GetTruePosition();
- Il2CppSystem.Collections.Generic.List<GameData.LGBOMGHJELL> allPlayers = GameData.Instance.AllPlayers;
+ Il2CppSystem.Collections.Generic.List<GameData.PlayerInfo> allPlayers = GameData.Instance.AllPlayers;
for (int i = 0; i < allPlayers.Count; i++)
{
- GameData.LGBOMGHJELL LGBOMGHJELL = allPlayers[i];
- if (!LGBOMGHJELL.MFFAGDHDHLO && LGBOMGHJELL.FNPNJHNKEBK != PlayerControl.LocalPlayer.PlayerId && !LGBOMGHJELL.IAGJEKLJCCI && (!onlyCrewmates || !LGBOMGHJELL.FDNMBJOAPFL))
+ GameData.PlayerInfo playerInfo = allPlayers[i];
+ if (!playerInfo.Disconnected && playerInfo.PlayerId != PlayerControl.LocalPlayer.PlayerId && !playerInfo.IsDead && (!onlyCrewmates || !playerInfo.IsImpostor))
{
- PlayerControl @object = LGBOMGHJELL.GJPBCGFPMOD;
+ PlayerControl @object = playerInfo.Object;
if(untargetablePlayers != null && untargetablePlayers.Any(x => x == @object)) {
// if that player is not targetable: skip check
continue;
{
Vector2 vector = @object.GetTruePosition() - truePosition;
float magnitude = vector.magnitude;
- if (magnitude <= num && !PhysicsHelpers.HLIEDNLNBBH(truePosition, vector.normalized, magnitude, Constants.LEOCDMEJGPA))
+ if (magnitude <= num && !PhysicsHelpers.AnyNonTriggersBetween(truePosition, vector.normalized, magnitude, Constants.ShipAndObjectsMask))
{
result = @object;
num = magnitude;
return result;
}
+ static void setPlayerOutline(PlayerControl target, Color color) {
+ if (target == null || target.myRend == null) return;
+
+ target.myRend.material.SetFloat("_Outline", 1f);
+ target.myRend.material.SetColor("_OutlineColor", color);
+ }
+
+ // Update functions
+
+ static void setBasePlayerOutlines() {
+ foreach (PlayerControl target in PlayerControl.AllPlayerControls) {
+ if (target == null || target.myRend == null) continue;
+
+ bool hasVisibleShield = false;
+ if (Camouflager.camouflageTimer <= 0f && Medic.shielded != null && (target == Medic.shielded || (target == Morphling.morphling && Morphling.morphTarget == Medic.shielded && Morphling.morphTimer > 0f))) {
+ hasVisibleShield = Medic.showShielded == 0 // Everyone
+ || (Medic.showShielded == 1 && (PlayerControl.LocalPlayer == Medic.shielded || PlayerControl.LocalPlayer == Medic.medic)) // Shielded + Medic
+ || (Medic.showShielded == 2 && PlayerControl.LocalPlayer == Medic.medic); // Medic only
+ }
+
+ if (hasVisibleShield) {
+ target.myRend.material.SetFloat("_Outline", 1f);
+ target.myRend.material.SetColor("_OutlineColor", Medic.shieldedColor);
+ } else {
+ target.myRend.material.SetFloat("_Outline", 0f);
+ }
+ }
+ }
+
+ public static void bendTimeUpdate() {
+ if (TimeMaster.isRewinding) {
+ if (localPlayerPositions.Count > 0) {
+ // Set position
+ var next = localPlayerPositions[0];
+ if (next.Item2 == true) {
+ // Exit current vent if necessary
+ if (PlayerControl.LocalPlayer.inVent) {
+ foreach (Vent vent in ShipStatus.Instance.AllVents) {
+ bool canUse;
+ bool couldUse;
+ vent.CanUse(PlayerControl.LocalPlayer.Data, out canUse, out couldUse);
+ if (canUse) {
+ PlayerControl.LocalPlayer.MyPhysics.RpcExitVent(vent.Id);
+ vent.SetButtons(false);
+ }
+ }
+ }
+ // Set position
+ PlayerControl.LocalPlayer.transform.position = next.Item1;
+ } else if (localPlayerPositions.Any(x => x.Item2 == true)) {
+ PlayerControl.LocalPlayer.transform.position = next.Item1;
+ }
+
+ localPlayerPositions.RemoveAt(0);
+
+ if (localPlayerPositions.Count > 1) localPlayerPositions.RemoveAt(0); // Skip every second position to rewinde twice as fast, but never skip the last position
+ } else {
+ TimeMaster.isRewinding = false;
+ PlayerControl.LocalPlayer.moveable = true;
+ }
+ } else {
+ while (localPlayerPositions.Count >= Mathf.Round(TimeMaster.rewindTime / Time.fixedDeltaTime)) localPlayerPositions.RemoveAt(localPlayerPositions.Count - 1);
+ localPlayerPositions.Insert(0, new Tuple<Vector3, bool>(PlayerControl.LocalPlayer.transform.position, PlayerControl.LocalPlayer.CanMove)); // CanMove = CanMove
+ }
+ }
+
static void medicSetTarget() {
if (Medic.medic == null || Medic.medic != PlayerControl.LocalPlayer) return;
Medic.currentTarget = setTarget();
+ if (!Medic.usedShield) setPlayerOutline(Medic.currentTarget, Medic.color);
}
static void shifterSetTarget() {
if (Shifter.shifter == null || Shifter.shifter != PlayerControl.LocalPlayer) return;
Shifter.currentTarget = setTarget();
+ if (Shifter.futureShift == null) setPlayerOutline(Shifter.currentTarget, Shifter.color);
}
static void morphlingSetTarget() {
if (Morphling.morphling == null || Morphling.morphling != PlayerControl.LocalPlayer) return;
Morphling.currentTarget = setTarget();
+ setPlayerOutline(Morphling.currentTarget, Morphling.color);
}
static void sheriffSetTarget() {
if (Sheriff.sheriff == null || Sheriff.sheriff != PlayerControl.LocalPlayer) return;
Sheriff.currentTarget = setTarget();
+ setPlayerOutline(Sheriff.currentTarget, Sheriff.color);
}
static void trackerSetTarget() {
if (Tracker.tracker == null || Tracker.tracker != PlayerControl.LocalPlayer) return;
Tracker.currentTarget = setTarget();
+ if (!Tracker.usedTracker) setPlayerOutline(Tracker.currentTarget, Tracker.color);
}
static void detectiveUpdateFootPrints() {
if (Detective.timer <= 0f) {
Detective.timer = Detective.footprintIntervall;
foreach (PlayerControl player in PlayerControl.AllPlayerControls) {
- if (player != null && player != PlayerControl.LocalPlayer && !player.PPMOEEPBHJO.IAGJEKLJCCI && !player.inVent) {
+ if (player != null && player != PlayerControl.LocalPlayer && !player.Data.IsDead && !player.inVent) {
new Footprint(Detective.footprintDuration, Detective.anonymousFootprints, player);
}
}
}
Vampire.targetNearGarlic = targetNearGarlic;
Vampire.currentTarget = target;
+ setPlayerOutline(Vampire.currentTarget, Vampire.color);
}
static void jackalSetTarget() {
}
if(Child.child != null && !Child.isGrownUp()) untargetablePlayers.Add(Child.child); // Exclude Jackal from targeting the Child unless it has grown up
Jackal.currentTarget = setTarget(untargetablePlayers : untargetablePlayers);
+ setPlayerOutline(Jackal.currentTarget, Jackal.color);
}
static void sidekickSetTarget() {
if(Jackal.jackal != null) untargetablePlayers.Add(Jackal.jackal);
if(Child.child != null && !Child.isGrownUp()) untargetablePlayers.Add(Child.child); // Exclude Sidekick from targeting the Child unless it has grown up
Sidekick.currentTarget = setTarget(untargetablePlayers : untargetablePlayers);
+ if (Sidekick.canKill) setPlayerOutline(Sidekick.currentTarget, Sidekick.color);
}
static void eraserSetTarget() {
List<PlayerControl> untargatables = new List<PlayerControl>();
if (Spy.spy != null) untargatables.Add(Spy.spy);
Eraser.currentTarget = setTarget(onlyCrewmates: !Eraser.canEraseAnyone, untargetablePlayers: Eraser.canEraseAnyone ? new List<PlayerControl>() : untargatables);
+ setPlayerOutline(Eraser.currentTarget, Eraser.color);
}
static void engineerUpdate() {
- if (PlayerControl.LocalPlayer.PPMOEEPBHJO.FDNMBJOAPFL && ShipStatus.Instance?.GJHKPDGJHJN != null) {
- foreach (Vent vent in ShipStatus.Instance.GJHKPDGJHJN) {
+ if (PlayerControl.LocalPlayer.Data.IsImpostor && ShipStatus.Instance?.AllVents != null) {
+ foreach (Vent vent in ShipStatus.Instance.AllVents) {
try {
- if (vent?.KJAENOGGEOK?.material != null) {
+ if (vent?.myRend?.material != null) {
if (Engineer.engineer != null && Engineer.engineer.inVent) {
- vent.KJAENOGGEOK.material.SetFloat("_Outline", 1f);
- vent.KJAENOGGEOK.material.SetColor("_OutlineColor", Engineer.color);
- } else if (vent.KJAENOGGEOK.material.GetColor("_AddColor") != Color.red) {
- vent.KJAENOGGEOK.material.SetFloat("_Outline", 0);
+ vent.myRend.material.SetFloat("_Outline", 1f);
+ vent.myRend.material.SetColor("_OutlineColor", Engineer.color);
+ } else if (vent.myRend.material.GetColor("_AddColor") != Color.red) {
+ vent.myRend.material.SetFloat("_Outline", 0);
}
}
} catch {}
}
static void impostorSetTarget() {
- if (!PlayerControl.LocalPlayer.PPMOEEPBHJO.FDNMBJOAPFL ||!PlayerControl.LocalPlayer.POECPOEKKNO || PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI) { // !isImpostor || !canMove || isDead
- HudManager.CHNDKKBEIDG.KillButton.SetTarget(null);
+ if (!PlayerControl.LocalPlayer.Data.IsImpostor ||!PlayerControl.LocalPlayer.CanMove || PlayerControl.LocalPlayer.Data.IsDead) { // !isImpostor || !canMove || isDead
+ HudManager.Instance.KillButton.SetTarget(null);
return;
}
target = setTarget(true, true);
}
- HudManager.CHNDKKBEIDG.KillButton.SetTarget(target);
+ HudManager.Instance.KillButton.SetTarget(target); // Includes setPlayerOutline(target, Palette.ImpstorRed);
}
static void trackerUpdate() {
return;
}
- if (Tracker.tracker != null && Tracker.tracked != null && PlayerControl.LocalPlayer == Tracker.tracker && !Tracker.tracker.PPMOEEPBHJO.IAGJEKLJCCI) {
+ if (Tracker.tracker != null && Tracker.tracked != null && PlayerControl.LocalPlayer == Tracker.tracker && !Tracker.tracker.Data.IsDead) {
Tracker.timeUntilUpdate -= Time.fixedDeltaTime;
if (Tracker.timeUntilUpdate <= 0f) {
- bool trackedOnMap = !Tracker.tracked.PPMOEEPBHJO.IAGJEKLJCCI;
+ bool trackedOnMap = !Tracker.tracked.Data.IsDead;
Vector3 position = Tracker.tracked.transform.position;
if (!trackedOnMap) { // Check for dead body
DeadBody body = UnityEngine.Object.FindObjectsOfType<DeadBody>().FirstOrDefault(b => b.ParentId == Tracker.tracked.PlayerId);
}
}
- public static void Prefix(PlayerControl __instance) {
- if (AmongUsClient.Instance.GameState != InnerNet.InnerNetClient.GCDONLGCMIL.Started) return;
- }
-
public static void Postfix(PlayerControl __instance) {
- if (AmongUsClient.Instance.GameState != InnerNet.InnerNetClient.GCDONLGCMIL.Started) return;
+ if (AmongUsClient.Instance.GameState != InnerNet.InnerNetClient.GameStates.Started) return;
- // Update Role Description
- Helpers.refreshRoleDescription(__instance);
// Child and Morphling shrink
playerSizeUpdate(__instance);
if (PlayerControl.LocalPlayer == __instance) {
+ // Update player outlines
+ setBasePlayerOutlines();
+
+ // Update Role Description
+ Helpers.refreshRoleDescription(__instance);
+
// Time Master
bendTimeUpdate();
// Morphling
class PlayerPhysicsWalkPlayerToPatch {
private static Vector2 offset = Vector2.zero;
public static void Prefix(PlayerPhysics __instance) {
- bool correctOffset = Camouflager.camouflageTimer <= 0f && (__instance.EMHCBDEIOLO == Child.child || (Morphling.morphling != null && __instance.EMHCBDEIOLO == Morphling.morphling && Morphling.morphTarget == Child.child && Morphling.morphTimer > 0f));
+ bool correctOffset = Camouflager.camouflageTimer <= 0f && (__instance.myPlayer == Child.child || (Morphling.morphling != null && __instance.myPlayer == Morphling.morphling && Morphling.morphTarget == Child.child && Morphling.morphTimer > 0f));
if (correctOffset) {
float currentScaling = (Child.growingProgress() + 1) * 0.5f;
- __instance.EMHCBDEIOLO.Collider.offset = currentScaling * Child.defaultColliderOffset * Vector2.down;
+ __instance.myPlayer.Collider.offset = currentScaling * Child.defaultColliderOffset * Vector2.down;
}
}
}
class PlayerControlCmdReportDeadBodyPatch {
public static void Prefix(PlayerControl __instance) {
// Murder the bitten player before the meeting starts or reset the bitten player
- if (Vampire.bitten != null && !Vampire.bitten.PPMOEEPBHJO.IAGJEKLJCCI && Helpers.handleMurderAttempt(Vampire.bitten, true)) {
+ if (Vampire.bitten != null && !Vampire.bitten.Data.IsDead && Helpers.handleMurderAttempt(Vampire.bitten, true)) {
MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.VampireTryKill, Hazel.SendOption.Reliable, -1);
AmongUsClient.Instance.FinishRpcImmediately(killWriter);
RPCProcedure.vampireTryKill();
[HarmonyPatch(typeof(KillButtonManager), nameof(KillButtonManager.PerformKill))]
class PerformKillPatch {
public static bool Prefix(KillButtonManager __instance) {
- if (__instance.isActiveAndEnabled && __instance.CurrentTarget && !__instance.isCoolingDown && !PlayerControl.LocalPlayer.PPMOEEPBHJO.IAGJEKLJCCI && PlayerControl.LocalPlayer.POECPOEKKNO) { // Among Us default checks
+ if (__instance.isActiveAndEnabled && __instance.CurrentTarget && !__instance.isCoolingDown && !PlayerControl.LocalPlayer.Data.IsDead && PlayerControl.LocalPlayer.CanMove) { // Among Us default checks
if (Helpers.handleMurderAttempt(__instance.CurrentTarget)) { // Custom checks
if (Child.child != null && PlayerControl.LocalPlayer == Child.child) { // Not checked by official servers
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.UncheckedMurderPlayer, Hazel.SendOption.Reliable, -1);
[HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.LocalPlayer.CmdReportDeadBody))]
class BodyReportPatch
{
- static void Postfix(PlayerControl __instance, GameData.LGBOMGHJELL DGDGDKCCKHJ)
+ static void Postfix(PlayerControl __instance, [HarmonyArgument(0)]GameData.PlayerInfo target)
{
// Medic or Detective report
bool isMedicReport = Medic.medic != null && Medic.medic == PlayerControl.LocalPlayer && __instance.PlayerId == Medic.medic.PlayerId;
bool isDetectiveReport = Detective.detective != null && Detective.detective == PlayerControl.LocalPlayer && __instance.PlayerId == Detective.detective.PlayerId;
if (isMedicReport || isDetectiveReport)
{
- DeadPlayer deadPlayer = deadPlayers?.Where(x => x.player?.PlayerId == DGDGDKCCKHJ?.FNPNJHNKEBK)?.FirstOrDefault();
+ DeadPlayer deadPlayer = deadPlayers?.Where(x => x.player?.PlayerId == target?.PlayerId)?.FirstOrDefault();
if (deadPlayer != null && deadPlayer.killerIfExisting != null) {
float timeSinceDeath = ((float)(DateTime.UtcNow - deadPlayer.timeOfDeath).TotalMilliseconds);
if (timeSinceDeath < Detective.reportNameDuration * 1000) {
msg = $"Body Report: The killer appears to be {deadPlayer.killerIfExisting.name}!";
} else if (timeSinceDeath < Detective.reportColorDuration * 1000) {
- var typeOfColor = Helpers.isLighterColor(deadPlayer.killerIfExisting.PPMOEEPBHJO.IMMNCAGJJJC) ? "lighter" : "darker";
+ var typeOfColor = Helpers.isLighterColor(deadPlayer.killerIfExisting.Data.ColorId) ? "lighter" : "darker";
msg = $"Body Report: The killer appears to be a {typeOfColor} color!";
} else {
msg = $"Body Report: The corpse is too old to gain information from!";
if (!string.IsNullOrWhiteSpace(msg))
{
- if (AmongUsClient.Instance.BPADAHAOBLM && DestroyableSingleton<HudManager>.CHNDKKBEIDG)
+ if (AmongUsClient.Instance.AmClient && DestroyableSingleton<HudManager>.Instance)
{
- DestroyableSingleton<HudManager>.CHNDKKBEIDG.Chat.AddChat(PlayerControl.LocalPlayer, msg);
+ DestroyableSingleton<HudManager>.Instance.Chat.AddChat(PlayerControl.LocalPlayer, msg);
}
if (msg.IndexOf("who", StringComparison.OrdinalIgnoreCase) >= 0)
{
- DestroyableSingleton<Assets.CoreScripts.Telemetry>.CHNDKKBEIDG.SendWho();
+ DestroyableSingleton<Assets.CoreScripts.Telemetry>.Instance.SendWho();
}
}
}
public static bool resetToCrewmate = false;
public static bool resetToDead = false;
- public static void Prefix(PlayerControl __instance, PlayerControl DGDGDKCCKHJ)
+ public static void Prefix(PlayerControl __instance, [HarmonyArgument(0)]PlayerControl target)
{
// Allow everyone to murder players
- resetToCrewmate = !__instance.PPMOEEPBHJO.FDNMBJOAPFL;
- resetToDead = __instance.PPMOEEPBHJO.IAGJEKLJCCI;
- __instance.PPMOEEPBHJO.FDNMBJOAPFL = true;
- __instance.PPMOEEPBHJO.IAGJEKLJCCI = false;
+ resetToCrewmate = !__instance.Data.IsImpostor;
+ resetToDead = __instance.Data.IsDead;
+ __instance.Data.IsImpostor = true;
+ __instance.Data.IsDead = false;
}
- public static void Postfix(PlayerControl __instance, PlayerControl DGDGDKCCKHJ)
+ public static void Postfix(PlayerControl __instance, [HarmonyArgument(0)]PlayerControl target)
{
// Collect dead player info
- DeadPlayer deadPlayer = new DeadPlayer(DGDGDKCCKHJ, DateTime.UtcNow, DeathReason.Kill, __instance);
+ DeadPlayer deadPlayer = new DeadPlayer(target, DateTime.UtcNow, DeathReason.Kill, __instance);
GameHistory.deadPlayers.Add(deadPlayer);
// Reset killer to crewmate if resetToCrewmate
- if (resetToCrewmate) __instance.PPMOEEPBHJO.FDNMBJOAPFL = false;
- if (resetToDead) __instance.PPMOEEPBHJO.IAGJEKLJCCI = true;
+ if (resetToCrewmate) __instance.Data.IsImpostor = false;
+ if (resetToDead) __instance.Data.IsDead = true;
// Lover suicide trigger on murder
- if ((Lovers.lover1 != null && DGDGDKCCKHJ == Lovers.lover1) || (Lovers.lover2 != null && DGDGDKCCKHJ == Lovers.lover2)) {
- PlayerControl otherLover = DGDGDKCCKHJ == Lovers.lover1 ? Lovers.lover2 : Lovers.lover1;
- if (PlayerControl.LocalPlayer == DGDGDKCCKHJ && otherLover != null && !otherLover.PPMOEEPBHJO.IAGJEKLJCCI && Lovers.bothDie) { // Only the dead lover sends the rpc
+ if ((Lovers.lover1 != null && target == Lovers.lover1) || (Lovers.lover2 != null && target == Lovers.lover2)) {
+ PlayerControl otherLover = target == Lovers.lover1 ? Lovers.lover2 : Lovers.lover1;
+ if (PlayerControl.LocalPlayer == target && otherLover != null && !otherLover.Data.IsDead && Lovers.bothDie) { // Only the dead lover sends the rpc
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.LoverSuicide, Hazel.SendOption.Reliable, -1);
writer.Write(otherLover.PlayerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
}
// Sidekick promotion trigger on murder
- if (Sidekick.promotesToJackal && Sidekick.sidekick != null && !Sidekick.sidekick.PPMOEEPBHJO.IAGJEKLJCCI && DGDGDKCCKHJ == Jackal.jackal && Jackal.jackal == PlayerControl.LocalPlayer) {
+ if (Sidekick.promotesToJackal && Sidekick.sidekick != null && !Sidekick.sidekick.Data.IsDead && target == Jackal.jackal && Jackal.jackal == PlayerControl.LocalPlayer) {
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SidekickPromotes, Hazel.SendOption.Reliable, -1);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.sidekickPromotes();
}
+ // Cleaner Button Sync
+ if (Cleaner.cleaner != null && PlayerControl.LocalPlayer == Cleaner.cleaner && __instance == Cleaner.cleaner && HudManagerStartPatch.cleanerCleanButton != null)
+ HudManagerStartPatch.cleanerCleanButton.Timer = Cleaner.cleaner.killTimer;
+
// Seer show flash and add dead player position
- if (Seer.seer != null && PlayerControl.LocalPlayer == Seer.seer && !Seer.seer.PPMOEEPBHJO.IAGJEKLJCCI && Seer.seer != DGDGDKCCKHJ && Seer.mode <= 1) {
- HudManager.CHNDKKBEIDG.FullScreen.enabled = true;
- HudManager.CHNDKKBEIDG.StartCoroutine(Effects.DCHLMIDMBHG(1f, new Action<float>((p) => {
- var renderer = HudManager.CHNDKKBEIDG.FullScreen;
+ if (Seer.seer != null && PlayerControl.LocalPlayer == Seer.seer && !Seer.seer.Data.IsDead && Seer.seer != target && Seer.mode <= 1) {
+ HudManager.Instance.FullScreen.enabled = true;
+ HudManager.Instance.StartCoroutine(Effects.Lerp(1f, new Action<float>((p) => {
+ var renderer = HudManager.Instance.FullScreen;
if (p < 0.5) {
if (renderer != null)
renderer.color = new Color(42f / 255f, 187f / 255f, 245f / 255f, Mathf.Clamp01(p * 2 * 0.75f));
if (p == 1f && renderer != null) renderer.enabled = false;
})));
}
- if (Seer.deadBodyPositions != null) Seer.deadBodyPositions.Add(DGDGDKCCKHJ.transform.position);
+ if (Seer.deadBodyPositions != null) Seer.deadBodyPositions.Add(target.transform.position);
// Child set adapted kill cooldown
- if (Child.child != null && PlayerControl.LocalPlayer == Child.child && Child.child.PPMOEEPBHJO.FDNMBJOAPFL && Child.child == __instance) {
+ if (Child.child != null && PlayerControl.LocalPlayer == Child.child && Child.child.Data.IsImpostor && Child.child == __instance) {
var multiplier = Child.isGrownUp() ? 0.66f : 2f;
- Child.child.SetKillTimer(PlayerControl.GameOptions.DGOPNLEEAAJ * multiplier);
+ Child.child.SetKillTimer(PlayerControl.GameOptions.KillCooldown * multiplier);
}
}
}
[HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.SetKillTimer))]
class PlayerControlSetCoolDownPatch {
- public static bool Prefix(PlayerControl __instance, float IHIOFAHBJKK) {
- if (PlayerControl.GameOptions.DGOPNLEEAAJ <= 0f) return false;
+ public static bool Prefix(PlayerControl __instance, [HarmonyArgument(0)]float time) {
+ if (PlayerControl.GameOptions.KillCooldown <= 0f) return false;
float multiplier = 1f;
- if (Child.child != null && PlayerControl.LocalPlayer == Child.child && Child.child.PPMOEEPBHJO.FDNMBJOAPFL) multiplier = Child.isGrownUp() ? 0.66f : 2f;
+ if (Child.child != null && PlayerControl.LocalPlayer == Child.child && Child.child.Data.IsImpostor) multiplier = Child.isGrownUp() ? 0.66f : 2f;
- __instance.killTimer = Mathf.Clamp(IHIOFAHBJKK, 0f, PlayerControl.GameOptions.DGOPNLEEAAJ * multiplier);
- DestroyableSingleton<HudManager>.CHNDKKBEIDG.KillButton.SetCoolDown(__instance.killTimer, PlayerControl.GameOptions.DGOPNLEEAAJ * multiplier);
+ __instance.killTimer = Mathf.Clamp(time, 0f, PlayerControl.GameOptions.KillCooldown * multiplier);
+ DestroyableSingleton<HudManager>.Instance.KillButton.SetCoolDown(__instance.killTimer, PlayerControl.GameOptions.KillCooldown * multiplier);
return false;
}
}
[HarmonyPatch(typeof(KillAnimation), nameof(KillAnimation.CoPerformKill))]
class KillAnimationCoPerformKillPatch {
- public static void Prefix(KillAnimation __instance, ref PlayerControl KIJHPICDEAD, ref PlayerControl DGDGDKCCKHJ) {
- if (Vampire.vampire != null && Vampire.vampire == KIJHPICDEAD && Vampire.bitten != null && Vampire.bitten == DGDGDKCCKHJ)
- KIJHPICDEAD = DGDGDKCCKHJ;
+ public static void Prefix(KillAnimation __instance, [HarmonyArgument(0)]ref PlayerControl source, [HarmonyArgument(1)]ref PlayerControl target) {
+ if (Vampire.vampire != null && Vampire.vampire == source && Vampire.bitten != null && Vampire.bitten == target)
+ source = target;
}
}
{
public static void Prefix(PlayerControl __instance) {
// Child exile lose condition
- if (Child.child != null && Child.child == __instance && !Child.isGrownUp() && !Child.child.PPMOEEPBHJO.FDNMBJOAPFL) {
+ if (Child.child != null && Child.child == __instance && !Child.isGrownUp() && !Child.child.Data.IsImpostor) {
Child.triggerChildLose = true;
}
// Jester win condition
// Lover suicide trigger on exile
if ((Lovers.lover1 != null && __instance == Lovers.lover1) || (Lovers.lover2 != null && __instance == Lovers.lover2)) {
PlayerControl otherLover = __instance == Lovers.lover1 ? Lovers.lover2 : Lovers.lover1;
- if (otherLover != null && !otherLover.PPMOEEPBHJO.IAGJEKLJCCI && Lovers.bothDie)
+ if (otherLover != null && !otherLover.Data.IsDead && Lovers.bothDie)
otherLover.Exiled();
}
// Sidekick promotion trigger on exile
- if (Sidekick.promotesToJackal && Sidekick.sidekick != null && !Sidekick.sidekick.PPMOEEPBHJO.IAGJEKLJCCI && __instance == Jackal.jackal && Jackal.jackal == PlayerControl.LocalPlayer) {
+ if (Sidekick.promotesToJackal && Sidekick.sidekick != null && !Sidekick.sidekick.Data.IsDead && __instance == Jackal.jackal && Jackal.jackal == PlayerControl.LocalPlayer) {
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SidekickPromotes, Hazel.SendOption.Reliable, -1);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.sidekickPromotes();
}
}
- [HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.POECPOEKKNO), MethodType.Getter)]
+ [HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.CanMove), MethodType.Getter)]
class PlayerControlCanMovePatch {
public static bool Prefix(PlayerControl __instance, ref bool __result)
{
__result = __instance.moveable &&
!Minigame.Instance &&
- (!DestroyableSingleton<HudManager>.BMHJGNNOGDM || (!DestroyableSingleton<HudManager>.CHNDKKBEIDG.Chat.ENPNFFCCKON && !DestroyableSingleton<HudManager>.CHNDKKBEIDG.KillOverlay.ENPNFFCCKON && !DestroyableSingleton<HudManager>.CHNDKKBEIDG.GameMenu.ENPNFFCCKON)) &&
- (!MapBehaviour.Instance || !MapBehaviour.Instance.FLLAHBDIMHD) &&
+ (!DestroyableSingleton<HudManager>.InstanceExists || (!DestroyableSingleton<HudManager>.Instance.Chat.IsOpen && !DestroyableSingleton<HudManager>.Instance.KillOverlay.IsOpen && !DestroyableSingleton<HudManager>.Instance.GameMenu.IsOpen)) &&
+ (!MapBehaviour.Instance || !MapBehaviour.Instance.IsOpenStopped) &&
!MeetingHud.Instance &&
!CustomPlayerMenu.Instance &&
!ExileController.Instance &&
using UnityEngine;
using System;
-using Palette = BLMBFIODBKL;
-using DeathReason = EGHDCAKGMKI;
-using SwitchSystem = ABIMJJMBJJM;
-using SystemTypes = BCPJLGGNHBC;
-using Effects = AEOEPNHOJDP;
-
namespace TheOtherRoles
{
enum RoleId {
Sidekick,
Eraser,
Spy,
- Trickster
+ Trickster,
+ Cleaner
}
enum CustomRPC
EngineerFixLights = 81,
EngineerUsedRepair,
- JanitorClean,
+ CleanBody,
SheriffKill,
MedicSetShielded,
ShieldedMurderAttempt,
public static void forceEnd() {
foreach (PlayerControl player in PlayerControl.AllPlayerControls)
{
- if (!player.PPMOEEPBHJO.FDNMBJOAPFL)
+ if (!player.Data.IsImpostor)
{
player.RemoveInfected();
player.MurderPlayer(player);
- player.PPMOEEPBHJO.IAGJEKLJCCI = true;
+ player.Data.IsDead = true;
}
}
}
case RoleId.Trickster:
Trickster.trickster = player;
break;
+ case RoleId.Cleaner:
+ Cleaner.cleaner = player;
+ break;
}
}
}
Array.Reverse(bytes);
reader.Buffer = bytes;
reader.Length = bytes.Length;
+
+ JackInTheBox.startAnimation(ventId);
player.MyPhysics.HandleRpc(isEnter != 0 ? (byte)19 : (byte)20, reader);
}
public static void engineerFixLights() {
SwitchSystem switchSystem = ShipStatus.Instance.Systems[SystemTypes.Electrical].Cast<SwitchSystem>();
- switchSystem.BBCFBNPEPIE = switchSystem.FLDLDHLDCLM;
+ switchSystem.ActualSwitches = switchSystem.ExpectedSwitches;
}
public static void engineerUsedRepair() {
Engineer.usedRepair = true;
}
- public static void janitorClean(byte playerId) {
+ public static void cleanBody(byte playerId) {
DeadBody[] array = UnityEngine.Object.FindObjectsOfType<DeadBody>();
for (int i = 0; i < array.Length; i++) {
- if (GameData.Instance.GetPlayerById(array[i].ParentId).FNPNJHNKEBK == playerId)
+ if (GameData.Instance.GetPlayerById(array[i].ParentId).PlayerId == playerId)
UnityEngine.Object.Destroy(array[i].gameObject);
}
}
if(TimeMaster.timeMaster != null && TimeMaster.timeMaster == PlayerControl.LocalPlayer) {
resetTimeMasterButton();
}
- HudManager.CHNDKKBEIDG.FullScreen.color = new Color(0f, 0.5f, 0.8f, 0.3f);
- HudManager.CHNDKKBEIDG.FullScreen.enabled = true;
- HudManager.CHNDKKBEIDG.StartCoroutine(Effects.DCHLMIDMBHG(TimeMaster.rewindTime / 2, new Action<float>((p) => {
- if (p == 1f) HudManager.CHNDKKBEIDG.FullScreen.enabled = false;
+ HudManager.Instance.FullScreen.color = new Color(0f, 0.5f, 0.8f, 0.3f);
+ HudManager.Instance.FullScreen.enabled = true;
+ HudManager.Instance.StartCoroutine(Effects.Lerp(TimeMaster.rewindTime / 2, new Action<float>((p) => {
+ if (p == 1f) HudManager.Instance.FullScreen.enabled = false;
})));
- if (TimeMaster.timeMaster == null) return;
-
- PlayerControl lp = PlayerControl.LocalPlayer;
- if (lp?.PPMOEEPBHJO != null && !lp.PPMOEEPBHJO.IAGJEKLJCCI && lp.inVent) {
- if ((float)(DateTime.UtcNow -localVentEnterTimePoint).TotalMilliseconds < 1000 * TimeMaster.rewindTime) {
- foreach (Vent vent in ShipStatus.Instance.GJHKPDGJHJN) {
- bool canUse;
- bool couldUse;
- vent.CanUse(PlayerControl.LocalPlayer.PPMOEEPBHJO, out canUse, out couldUse);
- if (canUse) {
- PlayerControl.LocalPlayer.MyPhysics.RpcExitVent(vent.Id);
- vent.SetButtons(false);
- }
- }
- }
- }
-
- if (PlayerControl.LocalPlayer == TimeMaster.timeMaster) return; // Time Master himself does not rewind
+ if (TimeMaster.timeMaster == null || PlayerControl.LocalPlayer == TimeMaster.timeMaster) return; // Time Master himself does not rewind
TimeMaster.isRewinding = true;
public static void timeMasterShield() {
TimeMaster.shieldActive = true;
- HudManager.CHNDKKBEIDG.StartCoroutine(Effects.DCHLMIDMBHG(TimeMaster.shieldDuration, new Action<float>((p) => {
+ HudManager.Instance.StartCoroutine(Effects.Lerp(TimeMaster.shieldDuration, new Action<float>((p) => {
if (p == 1f) TimeMaster.shieldActive = false;
})));
}
}
public static void shieldedMurderAttempt() {
- if (Medic.shielded != null && Medic.shielded == PlayerControl.LocalPlayer && Medic.showAttemptToShielded && HudManager.CHNDKKBEIDG?.FullScreen != null) {
- HudManager.CHNDKKBEIDG.FullScreen.enabled = true;
- HudManager.CHNDKKBEIDG.StartCoroutine(Effects.DCHLMIDMBHG(0.5f, new Action<float>((p) => {
- var renderer = HudManager.CHNDKKBEIDG.FullScreen;
- Color c = Palette.JPCHLLEJNEH;
+ if (Medic.shielded != null && Medic.shielded == PlayerControl.LocalPlayer && Medic.showAttemptToShielded && HudManager.Instance?.FullScreen != null) {
+ HudManager.Instance.FullScreen.enabled = true;
+ HudManager.Instance.StartCoroutine(Effects.Lerp(0.5f, new Action<float>((p) => {
+ var renderer = HudManager.Instance.FullScreen;
+ Color c = Palette.ImpostorRed;
if (p < 0.5) {
if (renderer != null)
renderer.color = new Color(c.r, c.g, c.b, Mathf.Clamp01(p * 2 * 0.75f));
Shifter.clearAndReload();
// Suicide (exile) when impostor or impostor variants
- if (player.PPMOEEPBHJO.FDNMBJOAPFL || player == Jackal.jackal || player == Sidekick.sidekick) {
+ if (player.Data.IsImpostor || player == Jackal.jackal || player == Sidekick.sidekick) {
oldShifter.Exiled();
return;
}
// Switch shield
if (Medic.shielded != null && Medic.shielded == player) {
- Medic.shielded.KJAENOGGEOK.material.SetFloat("_Outline", 0f);
Medic.shielded = oldShifter;
} else if (Medic.shielded != null && Medic.shielded == oldShifter) {
- Medic.shielded.KJAENOGGEOK.material.SetFloat("_Outline", 0f);
Medic.shielded = player;
}
PlayerControl target = Helpers.playerById(playerId);
if (Morphling.morphling == null || target == null) return;
- Morphling.morphTimer = 10f;
+ Morphling.morphTimer = Morphling.duration;
Morphling.morphTarget = target;
}
public static void camouflagerCamouflage() {
if (Camouflager.camouflager == null) return;
- Camouflager.camouflageTimer = 10f;
+ Camouflager.camouflageTimer = Camouflager.duration;
}
public static void loverSuicide(byte remainingLoverId) {
- if (Lovers.lover1 != null && !Lovers.lover1.PPMOEEPBHJO.IAGJEKLJCCI && Lovers.lover1.PlayerId == remainingLoverId) {
+ if (Lovers.lover1 != null && !Lovers.lover1.Data.IsDead && Lovers.lover1.PlayerId == remainingLoverId) {
Lovers.lover1.MurderPlayer(Lovers.lover1);
- } else if (Lovers.lover2 != null && !Lovers.lover2.PPMOEEPBHJO.IAGJEKLJCCI && Lovers.lover2.PlayerId == remainingLoverId) {
+ } else if (Lovers.lover2 != null && !Lovers.lover2.Data.IsDead && Lovers.lover2.PlayerId == remainingLoverId) {
Lovers.lover2.MurderPlayer(Lovers.lover2);
}
}
if (Vampire.vampire == null) return;
foreach (PlayerControl player in PlayerControl.AllPlayerControls) {
- if (player.PlayerId == targetId && !player.PPMOEEPBHJO.IAGJEKLJCCI) {
+ if (player.PlayerId == targetId && !player.Data.IsDead) {
Vampire.bitten = player;
}
}
}
public static void vampireTryKill() {
- if (Vampire.bitten != null && !Vampire.bitten.PPMOEEPBHJO.IAGJEKLJCCI) {
+ if (Vampire.bitten != null && !Vampire.bitten.Data.IsDead) {
Vampire.vampire.MurderPlayer(Vampire.bitten);
}
Vampire.bitten = null;
{
if (player.PlayerId == targetId)
{
- if(!Jackal.canCreateSidekickFromImpostor && player.PPMOEEPBHJO.FDNMBJOAPFL) {
+ if(!Jackal.canCreateSidekickFromImpostor && player.Data.IsImpostor) {
Jackal.fakeSidekick = player;
return;
}
if (player != Lovers.lover1 && player != Lovers.lover2) erasePlayerRole(player.PlayerId);
Sidekick.sidekick = player;
- Helpers.removeTasksFromPlayer(player);
return;
}
}
if (player == Vampire.vampire) Vampire.clearAndReload();
if (player == Eraser.eraser) Eraser.clearAndReload();
if (player == Trickster.trickster) Trickster.clearAndReload();
+ if (player == Cleaner.cleaner) Cleaner.clearAndReload();
// Other roles
if (player == Jester.jester) Jester.clearAndReload();
Lovers.clearAndReload();
}
if (player == Jackal.jackal) { // Promote Sidekick and hence override the the Jackal or erase Jackal
- if (Sidekick.promotesToJackal && Sidekick.sidekick != null && !Sidekick.sidekick.PPMOEEPBHJO.IAGJEKLJCCI) {
+ if (Sidekick.promotesToJackal && Sidekick.sidekick != null && !Sidekick.sidekick.Data.IsDead) {
RPCProcedure.sidekickPromotes();
} else {
Jackal.clearAndReload();
public static void lightsOut() {
Trickster.lightsOutTimer = Trickster.lightsOutDuration;
// If the local player is impostor indicate lights out
- if(PlayerControl.LocalPlayer.PPMOEEPBHJO.FDNMBJOAPFL) {
+ if(PlayerControl.LocalPlayer.Data.IsImpostor) {
new CustomMessage("Lights are out", Trickster.lightsOutDuration);
}
}
[HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.HandleRpc))]
class RPCHandlerPatch
{
- static void Postfix(byte ONIABIILFGF, MessageReader JIGFBHFFNFI)
+ static void Postfix([HarmonyArgument(0)]byte callId, [HarmonyArgument(1)]MessageReader reader)
{
- byte packetId = ONIABIILFGF;
- MessageReader reader = JIGFBHFFNFI;
+ byte packetId = callId;
switch (packetId) {
// Main Controls
RPCProcedure.resetVariables();
break;
case (byte)CustomRPC.ShareOptionSelection:
- uint id = JIGFBHFFNFI.ReadPackedUInt32();
- uint selection = JIGFBHFFNFI.ReadPackedUInt32();
+ uint id = reader.ReadPackedUInt32();
+ uint selection = reader.ReadPackedUInt32();
RPCProcedure.shareOptionSelection(id, selection);
break;
case (byte)CustomRPC.ForceEnd:
RPCProcedure.forceEnd();
break;
case (byte)CustomRPC.SetRole:
- byte roleId = JIGFBHFFNFI.ReadByte();
- byte playerId = JIGFBHFFNFI.ReadByte();
+ byte roleId = reader.ReadByte();
+ byte playerId = reader.ReadByte();
RPCProcedure.setRole(roleId, playerId);
break;
case (byte)CustomRPC.SetUncheckedColor:
- byte c = JIGFBHFFNFI.ReadByte();
- byte p = JIGFBHFFNFI.ReadByte();
+ byte c = reader.ReadByte();
+ byte p = reader.ReadByte();
RPCProcedure.setUncheckedColor(c, p);
break;
case (byte)CustomRPC.VersionHandshake:
- byte major = JIGFBHFFNFI.ReadByte();
- byte minor = JIGFBHFFNFI.ReadByte();
- byte patch = JIGFBHFFNFI.ReadByte();
- int versionOwnerId = JIGFBHFFNFI.ReadPackedInt32();
+ byte major = reader.ReadByte();
+ byte minor = reader.ReadByte();
+ byte patch = reader.ReadByte();
+ int versionOwnerId = reader.ReadPackedInt32();
RPCProcedure.versionHandshake(major, minor, patch, versionOwnerId);
break;
case (byte)CustomRPC.UseUncheckedVent:
- int ventId = JIGFBHFFNFI.ReadPackedInt32();
- byte ventingPlayer = JIGFBHFFNFI.ReadByte();
- byte isEnter = JIGFBHFFNFI.ReadByte();
+ int ventId = reader.ReadPackedInt32();
+ byte ventingPlayer = reader.ReadByte();
+ byte isEnter = reader.ReadByte();
RPCProcedure.useUncheckedVent(ventId, ventingPlayer, isEnter);
break;
case (byte)CustomRPC.UncheckedMurderPlayer:
- byte source = JIGFBHFFNFI.ReadByte();
- byte target = JIGFBHFFNFI.ReadByte();
+ byte source = reader.ReadByte();
+ byte target = reader.ReadByte();
RPCProcedure.uncheckedMurderPlayer(source, target);
break;
case (byte)CustomRPC.EngineerUsedRepair:
RPCProcedure.engineerUsedRepair();
break;
- case (byte)CustomRPC.JanitorClean:
- RPCProcedure.janitorClean(JIGFBHFFNFI.ReadByte());
+ case (byte)CustomRPC.CleanBody:
+ RPCProcedure.cleanBody(reader.ReadByte());
break;
case (byte)CustomRPC.SheriffKill:
- RPCProcedure.sheriffKill(JIGFBHFFNFI.ReadByte());
+ RPCProcedure.sheriffKill(reader.ReadByte());
break;
case (byte)CustomRPC.TimeMasterRewindTime:
RPCProcedure.timeMasterRewindTime();
RPCProcedure.timeMasterShield();
break;
case (byte)CustomRPC.MedicSetShielded:
- RPCProcedure.medicSetShielded(JIGFBHFFNFI.ReadByte());
+ RPCProcedure.medicSetShielded(reader.ReadByte());
break;
case (byte)CustomRPC.ShieldedMurderAttempt:
RPCProcedure.shieldedMurderAttempt();
break;
case (byte)CustomRPC.ShifterShift:
- RPCProcedure.shifterShift(JIGFBHFFNFI.ReadByte());
+ RPCProcedure.shifterShift(reader.ReadByte());
break;
case (byte)CustomRPC.SwapperSwap:
- byte playerId1 = JIGFBHFFNFI.ReadByte();
- byte playerId2 = JIGFBHFFNFI.ReadByte();
+ byte playerId1 = reader.ReadByte();
+ byte playerId2 = reader.ReadByte();
RPCProcedure.swapperSwap(playerId1, playerId2);
break;
case (byte)CustomRPC.MorphlingMorph:
- RPCProcedure.morphlingMorph(JIGFBHFFNFI.ReadByte());
+ RPCProcedure.morphlingMorph(reader.ReadByte());
break;
case (byte)CustomRPC.CamouflagerCamouflage:
RPCProcedure.camouflagerCamouflage();
break;
case (byte)CustomRPC.LoverSuicide:
- RPCProcedure.loverSuicide(JIGFBHFFNFI.ReadByte());
+ RPCProcedure.loverSuicide(reader.ReadByte());
break;
case (byte)CustomRPC.VampireSetBitten:
- byte bittenId = JIGFBHFFNFI.ReadByte();
- byte reset = JIGFBHFFNFI.ReadByte();
+ byte bittenId = reader.ReadByte();
+ byte reset = reader.ReadByte();
RPCProcedure.vampireSetBitten(bittenId, reset);
break;
case (byte)CustomRPC.VampireTryKill:
RPCProcedure.vampireTryKill();
break;
case (byte)CustomRPC.PlaceGarlic:
- RPCProcedure.placeGarlic(JIGFBHFFNFI.ReadBytesAndSize());
+ RPCProcedure.placeGarlic(reader.ReadBytesAndSize());
break;
case (byte)CustomRPC.TrackerUsedTracker:
- RPCProcedure.trackerUsedTracker(JIGFBHFFNFI.ReadByte());
+ RPCProcedure.trackerUsedTracker(reader.ReadByte());
break;
case (byte)CustomRPC.JackalKill:
- RPCProcedure.jackalKill(JIGFBHFFNFI.ReadByte());
+ RPCProcedure.jackalKill(reader.ReadByte());
break;
case (byte)CustomRPC.SidekickKill:
- RPCProcedure.sidekickKill(JIGFBHFFNFI.ReadByte());
+ RPCProcedure.sidekickKill(reader.ReadByte());
break;
case (byte)CustomRPC.JackalCreatesSidekick:
- RPCProcedure.jackalCreatesSidekick(JIGFBHFFNFI.ReadByte());
+ RPCProcedure.jackalCreatesSidekick(reader.ReadByte());
break;
case (byte)CustomRPC.SidekickPromotes:
RPCProcedure.sidekickPromotes();
break;
case (byte)CustomRPC.ErasePlayerRole:
- RPCProcedure.erasePlayerRole(JIGFBHFFNFI.ReadByte());
+ RPCProcedure.erasePlayerRole(reader.ReadByte());
break;
case (byte)CustomRPC.SetFutureErased:
- RPCProcedure.setFutureErased(JIGFBHFFNFI.ReadByte());
+ RPCProcedure.setFutureErased(reader.ReadByte());
break;
case (byte)CustomRPC.SetFutureShifted:
- RPCProcedure.setFutureShifted(JIGFBHFFNFI.ReadByte());
+ RPCProcedure.setFutureShifted(reader.ReadByte());
break;
case (byte)CustomRPC.PlaceJackInTheBox:
- RPCProcedure.placeJackInTheBox(JIGFBHFFNFI.ReadBytesAndSize());
+ RPCProcedure.placeJackInTheBox(reader.ReadBytesAndSize());
break;
case (byte)CustomRPC.LightsOut:
RPCProcedure.lightsOut();
--- /dev/null
+// Adapted from https://github.com/MoltenMods/Unify
+/*
+MIT License
+
+Copyright (c) 2021 Daemon
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+using HarmonyLib;
+using UnityEngine;
+using UnityEngine.UI;
+using System;
+using UnityEngine.Events;
+
+namespace TheOtherRoles {
+ [HarmonyPatch(typeof(RegionMenu), nameof(RegionMenu.Open))]
+ public static class RegionMenuOpenPatch
+ {
+ private static TextBoxTMP ipField;
+ private static TextBoxTMP portField;
+
+ public static void Postfix(RegionMenu __instance)
+ {
+ var template = DestroyableSingleton<JoinGameButton>.Instance;
+
+ if (ipField == null || ipField.gameObject == null) {
+ ipField = UnityEngine.Object.Instantiate(template.GameIdText, __instance.transform);
+ ipField.gameObject.name = "IpTextBox";
+ UnityEngine.Object.DestroyImmediate(ipField.transform.FindChild("arrowEnter").gameObject);
+
+ ipField.transform.localPosition = new Vector3(0, -1f, -100f);
+ ipField.characterLimit = 30;
+ ipField.AllowSymbols = true;
+ ipField.SetText(TheOtherRolesPlugin.Ip.Value);
+ __instance.StartCoroutine(Effects.Lerp(0.1f, new Action<float>((p) => {
+ ipField.outputText.SetText(TheOtherRolesPlugin.Ip.Value);
+ ipField.SetText(TheOtherRolesPlugin.Ip.Value);
+ })));
+
+ ipField.ClearOnFocus = false;
+ ipField.OnFocusLost = ipField.OnEnter = ipField.OnChange = new Button.ButtonClickedEvent();
+ ipField.OnChange.AddListener((UnityAction)ipEvent);
+
+ void ipEvent() {
+ TheOtherRolesPlugin.Ip.Value = ipField.text;
+ TheOtherRolesPlugin.CustomRegion.DefaultIp = ipField.text;
+ }
+ }
+ if (portField == null || portField.gameObject == null) {
+ portField = UnityEngine.Object.Instantiate(template.GameIdText, __instance.transform);
+ portField.gameObject.name = "PortTextBox";
+ UnityEngine.Object.DestroyImmediate(portField.transform.FindChild("arrowEnter").gameObject);
+
+ portField.transform.localPosition = new Vector3(0, -1.75f, -100f);
+ portField.characterLimit = 5;
+ portField.SetText(TheOtherRolesPlugin.Port.Value.ToString());
+ __instance.StartCoroutine(Effects.Lerp(0.1f, new Action<float>((p) => {
+ portField.outputText.SetText(TheOtherRolesPlugin.Port.Value.ToString());
+ portField.SetText(TheOtherRolesPlugin.Port.Value.ToString());
+ })));
+
+
+ portField.ClearOnFocus = false;
+ portField.OnFocusLost = portField.OnEnter = portField.OnChange = new Button.ButtonClickedEvent();
+ portField.OnChange.AddListener((UnityAction)portEvent);
+
+ void portEvent() {
+ ushort port = 0;
+ if (ushort.TryParse(portField.text, out port)) {
+ TheOtherRolesPlugin.Port.Value = port;
+ TheOtherRolesPlugin.CustomRegion.Port = port;
+ portField.outputText.color = Color.white;
+ } else {
+ portField.outputText.color = Color.red;
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
RPCProcedure.setRole(roleId, playerId);
}
- public static void Postfix(Il2CppReferenceArray<GameData.LGBOMGHJELL> BHNEINNHPIJ)
+ public static void Postfix([HarmonyArgument(0)]Il2CppReferenceArray<GameData.PlayerInfo> infected)
{
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ResetVaribles, Hazel.SendOption.Reliable, -1);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.resetVariables();
List<PlayerControl> crewmates = PlayerControl.AllPlayerControls.ToArray().ToList().OrderBy(x => Guid.NewGuid()).ToList();
- crewmates.RemoveAll(x => x.PPMOEEPBHJO.FDNMBJOAPFL);
+ crewmates.RemoveAll(x => x.Data.IsImpostor);
List<PlayerControl> impostors = PlayerControl.AllPlayerControls.ToArray().ToList().OrderBy(x => Guid.NewGuid()).ToList();
- impostors.RemoveAll(x => !x.PPMOEEPBHJO.FDNMBJOAPFL);
+ impostors.RemoveAll(x => !x.Data.IsImpostor);
float crewCountSettings = (float)CustomOptionHolder.crewmateRolesCount.getSelection() / 2;
float impCountSettings = (float)CustomOptionHolder.impostorRolesCount.getSelection() / 2;
impSettings.Add((byte)RoleId.Vampire, CustomOptionHolder.vampireSpawnRate.getSelection());
impSettings.Add((byte)RoleId.Eraser, CustomOptionHolder.eraserSpawnRate.getSelection());
impSettings.Add((byte)RoleId.Trickster, CustomOptionHolder.tricksterSpawnRate.getSelection());
+ impSettings.Add((byte)RoleId.Cleaner, CustomOptionHolder.cleanerSpawnRate.getSelection());
crewSettings.Add((byte)RoleId.Jester, CustomOptionHolder.jesterSpawnRate.getSelection());
crewSettings.Add((byte)RoleId.Mayor, CustomOptionHolder.mayorSpawnRate.getSelection());
}
if (rnd.Next(1, 101) <= CustomOptionHolder.loversSpawnRate.getSelection() * 10) {
- if (impostors.Count > 0 && crewmates.Count > 0 && maxCrewmateRoles > 0 && maxImpostorRoles > 0 && rnd.Next(1, 101) <= CustomOptionHolder.loversImpLoverRate.getSelection()) {
+ if (impostors.Count > 0 && crewmates.Count > 0 && maxCrewmateRoles > 0 && maxImpostorRoles > 0 && rnd.Next(1, 101) <= CustomOptionHolder.loversImpLoverRate.getSelection() * 10) {
setRoleToRandomPlayer((byte)RoleId.Lover1, impostors);
setRoleToRandomPlayer((byte)RoleId.Lover2, crewmates);
maxCrewmateRoles--;
using static TheOtherRoles.TheOtherRoles;
using UnityEngine;
-using Palette = BLMBFIODBKL;
-
namespace TheOtherRoles
{
public class RoleInfo {
"Use your jack-in-the-boxes to surprise others",
"Surprise your enemies"));
}
+ if (Cleaner.cleaner != null && p == Cleaner.cleaner) {
+ infos.Add(new RoleInfo("Cleaner",
+ Cleaner.color,
+ "Kill everyone and leave no traces",
+ "Clean up dead bodies"));
+ }
if (Detective.detective != null && p == Detective.detective) {
infos.Add(new RoleInfo("Detective",
Detective.color,
"Hacke to find the Impostors"));
}
if (Child.child != null && p == Child.child) {
- infos.Add(new RoleInfo(p.PPMOEEPBHJO.FDNMBJOAPFL ? "Bad Child" : "Good Child",
- p.PPMOEEPBHJO.FDNMBJOAPFL ? Palette.JPCHLLEJNEH : Child.color,
+ infos.Add(new RoleInfo(p.Data.IsImpostor ? "Bad Child" : "Good Child",
+ p.Data.IsImpostor ? Palette.ImpostorRed : Child.color,
"No one will harm you until you grow up",
"No one will harm you"));
}
"Help your Jackal to kill everyone"));
}
if ((Lovers.lover1 != null && p == Lovers.lover1) || (Lovers.lover2 != null && p == Lovers.lover2)) {
- infos.Add(new RoleInfo(p.PPMOEEPBHJO.FDNMBJOAPFL ? "ImpLover" : "Lover",
- p.PPMOEEPBHJO.FDNMBJOAPFL ? Palette.JPCHLLEJNEH : Lovers.color,
+ infos.Add(new RoleInfo(p.Data.IsImpostor ? "ImpLover" : "Lover",
+ p.Data.IsImpostor ? Palette.ImpostorRed : Lovers.color,
"You are in <color=#FC03BEFF>Love</color>",
"You are in love"));
}
"Confuse the <color=#FF1919FF>Impostors</color>",
"Confuse the Impostors"));
}
- if (infos.Count == 0 && p.PPMOEEPBHJO.FDNMBJOAPFL) { // Just Impostor
+ if (infos.Count == 0 && p.Data.IsImpostor) { // Just Impostor
infos.Add(new RoleInfo("Impostor",
- Palette.JPCHLLEJNEH,
+ Palette.ImpostorRed,
"",
"Sabotage and kill everyone"));
} else if (infos.Count == 0) { // Just Crewmate
using static TheOtherRoles.TheOtherRoles;
using UnityEngine;
-using SystemTypes = BCPJLGGNHBC;
-using SwitchSystem = ABIMJJMBJJM;
-using ISystemType = JBBCJFNFOBB;
-
namespace TheOtherRoles {
[HarmonyPatch(typeof(ShipStatus))]
[HarmonyPostfix]
[HarmonyPatch(typeof(ShipStatus), nameof(ShipStatus.CalculateLightRadius))]
- public static bool Prefix(ref float __result, ShipStatus __instance, [HarmonyArgument(0)] GameData.LGBOMGHJELL player) {
+ public static bool Prefix(ref float __result, ShipStatus __instance, [HarmonyArgument(0)] GameData.PlayerInfo player) {
ISystemType systemType = __instance.Systems.ContainsKey(SystemTypes.Electrical) ? __instance.Systems[SystemTypes.Electrical] : null;
if (systemType == null) return true;
SwitchSystem switchSystem = systemType.TryCast<SwitchSystem>();
if (switchSystem == null) return true;
- float num = (float)switchSystem.FPHHBGCHEJG / 255f;
+ float num = (float)switchSystem.Value / 255f;
- if (player == null || player.IAGJEKLJCCI) // IsDead
+ if (player == null || player.IsDead) // IsDead
__result = __instance.MaxLightRadius;
- else if (player.FDNMBJOAPFL) // IsImpostor
- __result = __instance.MaxLightRadius * PlayerControl.GameOptions.EJPJACEEECE;
- else if (Lighter.lighter != null && Lighter.lighter.PlayerId == player.FNPNJHNKEBK && Lighter.lighterTimer > 0f) // if player is Lighter and Lighter has his ability active
+ else if (player.IsImpostor) // IsImpostor
+ __result = __instance.MaxLightRadius * PlayerControl.GameOptions.ImpostorLightMod;
+ else if (Lighter.lighter != null && Lighter.lighter.PlayerId == player.PlayerId && Lighter.lighterTimer > 0f) // if player is Lighter and Lighter has his ability active
__result = Mathf.Lerp(__instance.MaxLightRadius * Lighter.lighterModeLightsOffVision, __instance.MaxLightRadius * Lighter.lighterModeLightsOnVision, num);
else if (Trickster.trickster != null && Trickster.lightsOutTimer > 0f) {
float lerpValue = 1f;
if (Trickster.lightsOutDuration - Trickster.lightsOutTimer < 0.5f) lerpValue = Mathf.Clamp01((Trickster.lightsOutDuration - Trickster.lightsOutTimer) * 2);
else if (Trickster.lightsOutTimer < 0.5) lerpValue = Mathf.Clamp01(Trickster.lightsOutTimer*2);
- __result = Mathf.Lerp(__instance.MinLightRadius, __instance.MaxLightRadius, 1 - lerpValue) * PlayerControl.GameOptions.FAJGBBKDEHP; // Instant lights out? Maybe add a smooth transition?
+ __result = Mathf.Lerp(__instance.MinLightRadius, __instance.MaxLightRadius, 1 - lerpValue) * PlayerControl.GameOptions.CrewLightMod; // Instant lights out? Maybe add a smooth transition?
}
else
- __result = Mathf.Lerp(__instance.MinLightRadius, __instance.MaxLightRadius, num) * PlayerControl.GameOptions.FAJGBBKDEHP;
+ __result = Mathf.Lerp(__instance.MinLightRadius, __instance.MaxLightRadius, num) * PlayerControl.GameOptions.CrewLightMod;
return false;
}
--- /dev/null
+
+using HarmonyLib;
+using UnityEngine;
+using System.Collections.Generic;
+using Hazel;
+using System;
+using UnityEngine.UI;
+using UnityEngine.Events;
+
+namespace TheOtherRoles {
+ [HarmonyPatch(typeof(OptionsMenuBehaviour), nameof(OptionsMenuBehaviour.Start))]
+ public class OptionsMenuBehaviourStartPatch {
+ public static ToggleButtonBehaviour streamerModeButton;
+
+ private static void updateStreamerModeButton() {
+ if (streamerModeButton == null || streamerModeButton.gameObject == null) return;
+
+ bool on = TheOtherRolesPlugin.StreamerMode.Value;
+ Color color = on ? new Color(0f, 1f, 0.16470589f, 1f) : Color.white;
+ streamerModeButton.Background.color = color;
+ streamerModeButton.Text.text = $"Streamer Mode: {(on ? "On" : "Off")}";
+ if (streamerModeButton.Rollover) streamerModeButton.Rollover.ChangeOutColor(color);
+ }
+
+ public static void Postfix(OptionsMenuBehaviour __instance) {
+ if ((streamerModeButton == null || streamerModeButton.gameObject == null) && __instance.CensorChatButton != null) {
+ streamerModeButton = UnityEngine.Object.Instantiate(__instance.CensorChatButton, __instance.CensorChatButton.transform.parent);
+ streamerModeButton.transform.localPosition += Vector3.down * 0.25f;
+ __instance.CensorChatButton.transform.localPosition += Vector3.up * 0.25f;
+ PassiveButton button = streamerModeButton.GetComponent<PassiveButton>();
+ button.OnClick = new Button.ButtonClickedEvent();
+ button.OnClick.AddListener((UnityEngine.Events.UnityAction)onClick);
+ updateStreamerModeButton();
+ }
+
+ void onClick() {
+ TheOtherRolesPlugin.StreamerMode.Value = !TheOtherRolesPlugin.StreamerMode.Value;
+ updateStreamerModeButton();
+ }
+ }
+ }
+
+ [HarmonyPatch(typeof(TextBoxTMP), nameof(TextBoxTMP.SetText))]
+ public static class HiddenTextPatch
+ {
+ private static void Postfix(TextBoxTMP __instance)
+ {
+ bool flag = TheOtherRolesPlugin.StreamerMode.Value && (__instance.name == "GameIdText" || __instance.name == "IpTextBox" || __instance.name == "PortTextBox");
+ if (flag) __instance.outputText.text = new string('*', __instance.text.Length);
+ }
+ }
+}
\ No newline at end of file
using System.IO;
using UnityEngine;
-using Palette = BLMBFIODBKL;
-
namespace TheOtherRoles
{
[HarmonyPatch]
Eraser.clearAndReload();
Spy.clearAndReload();
Trickster.clearAndReload();
+ Cleaner.clearAndReload();
}
public static class Jester {
public static class Godfather {
public static PlayerControl godfather;
- public static Color color = Palette.JPCHLLEJNEH;
+ public static Color color = Palette.ImpostorRed;
public static void clearAndReload() {
godfather = null;
public static class Mafioso {
public static PlayerControl mafioso;
- public static Color color = Palette.JPCHLLEJNEH;
+ public static Color color = Palette.ImpostorRed;
public static void clearAndReload() {
mafioso = null;
public static class Janitor {
public static PlayerControl janitor;
- public static Color color = Palette.JPCHLLEJNEH;
+ public static Color color = Palette.ImpostorRed;
public static float cooldown = 30f;
public static void clearAndReload() {
medic = null;
- if (shielded?.KJAENOGGEOK?.material != null) shielded.KJAENOGGEOK.material.SetFloat("_Outline", 0f);
shielded = null;
currentTarget = null;
usedShield = false;
public static bool notAckedExiledIsLover = false;
public static bool existingAndAlive() {
- return lover1 != null && lover2 != null && !lover1.PPMOEEPBHJO.IAGJEKLJCCI && !lover2.PPMOEEPBHJO.IAGJEKLJCCI && !lover1.PPMOEEPBHJO.MFFAGDHDHLO && !lover2.PPMOEEPBHJO.MFFAGDHDHLO && !notAckedExiledIsLover; // ADD NOT ACKED IS LOVER
+ return lover1 != null && lover2 != null && !lover1.Data.IsDead && !lover2.Data.IsDead && !lover1.Data.Disconnected && !lover2.Data.Disconnected && !notAckedExiledIsLover; // ADD NOT ACKED IS LOVER
}
public static bool existingAndCrewLovers() {
- if (lover1 == null || lover2 == null || lover1.PPMOEEPBHJO.MFFAGDHDHLO || lover2.PPMOEEPBHJO.MFFAGDHDHLO) return false; // Null or disconnected
- return !(lover1.PPMOEEPBHJO.FDNMBJOAPFL || lover2.PPMOEEPBHJO.FDNMBJOAPFL || lover1 == Jackal.jackal || lover2 == Jackal.jackal || lover1 == Sidekick.sidekick || lover2 == Sidekick.sidekick); // Not Impostor, Sidekick or Jackal
+ if (lover1 == null || lover2 == null || lover1.Data.Disconnected || lover2.Data.Disconnected) return false; // Null or disconnected
+ return !(lover1.Data.IsImpostor || lover2.Data.IsImpostor || lover1 == Jackal.jackal || lover2 == Jackal.jackal || lover1 == Sidekick.sidekick || lover2 == Sidekick.sidekick); // Not Impostor, Sidekick or Jackal
}
public static void clearAndReload() {
public static class Morphling {
public static PlayerControl morphling;
- public static Color color = Palette.JPCHLLEJNEH;
+ public static Color color = Palette.ImpostorRed;
private static Sprite sampleSprite;
private static Sprite morphSprite;
public static float cooldown = 30f;
+ public static float duration = 10f;
public static PlayerControl currentTarget;
public static PlayerControl sampledTarget;
morphTarget = null;
morphTimer = 0f;
if (morphling == null) return;
- morphling.SetName(morphling.PPMOEEPBHJO.PCLLABJCIPC);
- morphling.SetHat(morphling.PPMOEEPBHJO.CPGFLBANALE, (int)morphling.PPMOEEPBHJO.IMMNCAGJJJC);
- Helpers.setSkinWithAnim(morphling.MyPhysics, morphling.PPMOEEPBHJO.CGNMKICGLOG);
- morphling.SetPet(morphling.PPMOEEPBHJO.LBHODBKCBKA);
- morphling.CurrentPet.BDBDGFDELMB = morphling.BDBDGFDELMB;
- morphling.SetColor(morphling.PPMOEEPBHJO.IMMNCAGJJJC);
- morphling.KJAENOGGEOK.material.SetFloat("_Outline", 0f);
+ morphling.SetName(morphling.Data.PlayerName);
+ morphling.SetHat(morphling.Data.HatId, (int)morphling.Data.ColorId);
+ Helpers.setSkinWithAnim(morphling.MyPhysics, morphling.Data.SkinId);
+ morphling.SetPet(morphling.Data.PetId);
+ morphling.CurrentPet.Visible = morphling.Visible;
+ morphling.SetColor(morphling.Data.ColorId);
}
public static void clearAndReload() {
morphTarget = null;
morphTimer = 0f;
cooldown = CustomOptionHolder.morphlingCooldown.getFloat();
+ duration = CustomOptionHolder.morphlingDuration.getFloat();
}
public static Sprite getSampleSprite() {
public static class Camouflager {
public static PlayerControl camouflager;
- public static Color color = Palette.JPCHLLEJNEH;
+ public static Color color = Palette.ImpostorRed;
public static float cooldown = 30f;
+ public static float duration = 10f;
public static float camouflageTimer = 0f;
private static Sprite buttonSprite;
foreach (PlayerControl p in PlayerControl.AllPlayerControls) {
if (p == null) continue;
if (Morphling.morphling == null || Morphling.morphling != p) {
- p.SetName(p.PPMOEEPBHJO.PCLLABJCIPC);
- p.SetHat(p.PPMOEEPBHJO.CPGFLBANALE, (int)p.PPMOEEPBHJO.IMMNCAGJJJC);
- Helpers.setSkinWithAnim(p.MyPhysics, p.PPMOEEPBHJO.CGNMKICGLOG);
- p.SetPet(p.PPMOEEPBHJO.LBHODBKCBKA);
- p.CurrentPet.BDBDGFDELMB = p.BDBDGFDELMB;
- p.SetColor(p.PPMOEEPBHJO.IMMNCAGJJJC);
+ p.SetName(p.Data.PlayerName);
+ p.SetHat(p.Data.HatId, (int)p.Data.ColorId);
+ Helpers.setSkinWithAnim(p.MyPhysics, p.Data.SkinId);
+ p.SetPet(p.Data.PetId);
+ p.CurrentPet.Visible = p.Visible;
+ p.SetColor(p.Data.ColorId);
}
}
}
camouflager = null;
camouflageTimer = 0f;
cooldown = CustomOptionHolder.camouflagerCooldown.getFloat();
+ duration = CustomOptionHolder.camouflagerDuration.getFloat();
}
}
public static class Vampire {
public static PlayerControl vampire;
- public static Color color = Palette.JPCHLLEJNEH;
+ public static Color color = Palette.ImpostorRed;
public static float delay = 10f;
public static float cooldown = 30f;
}
public static void removeCurrentJackal() {
- formerJackals.Add(jackal);
+ if (!formerJackals.Contains(jackal)) formerJackals.Add(jackal);
jackal = null;
currentTarget = null;
fakeSidekick = null;
public static class Eraser {
public static PlayerControl eraser;
- public static Color color = Palette.JPCHLLEJNEH;
+ public static Color color = Palette.ImpostorRed;
public static List<PlayerControl> futureErased = new List<PlayerControl>();
public static PlayerControl currentTarget;
public static class Spy {
public static PlayerControl spy;
- public static Color color = Palette.JPCHLLEJNEH;
+ public static Color color = Palette.ImpostorRed;
public static bool impostorsCanKillAnyone = true;
public static class Trickster {
public static PlayerControl trickster;
- public static Color color = Palette.JPCHLLEJNEH;
+ public static Color color = Palette.ImpostorRed;
public static float placeBoxCooldown = 30f;
public static float lightsOutCooldown = 30f;
public static float lightsOutDuration = 10f;
}
}
+
+ public static class Cleaner {
+ public static PlayerControl cleaner;
+ public static Color color = Palette.ImpostorRed;
+
+ public static float cooldown = 30f;
+
+ private static Sprite buttonSprite;
+ public static Sprite getButtonSprite() {
+ if (buttonSprite) return buttonSprite;
+ buttonSprite = Helpers.loadSpriteFromResources("TheOtherRoles.Resources.CleanButton.png", 115f);
+ return buttonSprite;
+ }
+
+ public static void clearAndReload() {
+ cleaner = null;
+ cooldown = CustomOptionHolder.janitorCooldown.getFloat();
+ }
+ }
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
- <Version>2.2.2</Version>
-
+ <Version>2.3.0</Version>
<Description>TheOtherRoles</Description>
<Authors>Eisbison</Authors>
</PropertyGroup>
- <PropertyGroup Condition="'$(GamePlatform)' == 'Steam'">
+ <PropertyGroup>
<GameVersion>2021.4.14s</GameVersion>
+ <Mappings>EoF-1141/Mappings:0.4.1</Mappings>
<DefineConstants>$(DefineConstants);STEAM</DefineConstants>
</PropertyGroup>
- <PropertyGroup Condition="'$(GamePlatform)' == 'Itch'">
- <GameVersion>2021.4.14i</GameVersion>
- <DefineConstants>$(DefineConstants);ITCH</DefineConstants>
- </PropertyGroup>
-
<ItemGroup>
- <EmbeddedResource Include="Resources\RepairButton.png" />
- <EmbeddedResource Include="Resources\CleanButton.png" />
- <EmbeddedResource Include="Resources\TimeShieldButton.png" />
- <EmbeddedResource Include="Resources\ShieldButton.png" />
- <EmbeddedResource Include="Resources\ShiftButton.png" />
- <EmbeddedResource Include="Resources\SeerButton.png" />
- <EmbeddedResource Include="Resources\MorphButton.png" />
- <EmbeddedResource Include="Resources\SampleButton.png" />
- <EmbeddedResource Include="Resources\CamoButton.png" />
- <EmbeddedResource Include="Resources\HackerButton.png" />
- <EmbeddedResource Include="Resources\TrackerButton.png" />
- <EmbeddedResource Include="Resources\VampireButton.png" />
- <EmbeddedResource Include="Resources\GarlicButton.png" />
- <EmbeddedResource Include="Resources\LighterButton.png" />
- <EmbeddedResource Include="Resources\EraserButton.png" />
- <EmbeddedResource Include="Resources\TricksterVentButton.png" />
- <EmbeddedResource Include="Resources\Arrow.png" />
- <EmbeddedResource Include="Resources\Garlic.png" />
- <EmbeddedResource Include="Resources\GarlicBackground.png" />
- <EmbeddedResource Include="Resources\Footprint.png" />
- <EmbeddedResource Include="Resources\Soul.png" />
- <EmbeddedResource Include="Resources\AdminTableIcon.png" />
- <EmbeddedResource Include="Resources\SwapperCheck.png" />
- <EmbeddedResource Include="Resources\SidekickButton.png" />
- <EmbeddedResource Include="Resources\PlaceJackInTheBoxButton.png" />
- <EmbeddedResource Include="Resources\JackInTheBox.png" />
- <EmbeddedResource Include="Resources\LightsOutButton.png" />
+ <EmbeddedResource Include="Resources\CustomHats\*.png" />
+ <EmbeddedResource Include="Resources\*.png" />
+ <EmbeddedResource Include="Resources\TricksterAnimation\*.png" />
</ItemGroup>
<ItemGroup>
- <Reference Include="0Harmony">
- <HintPath>$(AmongUs)\BepInEx\core\0Harmony.dll</HintPath>
- </Reference>
- <Reference Include="Apple">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Apple.dll</HintPath>
- </Reference>
- <Reference Include="AppleCore">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\AppleCore.dll</HintPath>
- </Reference>
- <Reference Include="AppleMacos">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\AppleMacos.dll</HintPath>
- </Reference>
- <Reference Include="Assembly-CSharp">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Assembly-CSharp.dll</HintPath>
- </Reference>
- <Reference Include="Assembly-CSharp-firstpass">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Assembly-CSharp-firstpass.dll</HintPath>
- </Reference>
- <Reference Include="AssemblyUnhollower">
- <HintPath>$(AmongUs)\BepInEx\core\AssemblyUnhollower.dll</HintPath>
- </Reference>
- <Reference Include="BepInEx.Core">
- <HintPath>$(AmongUs)\BepInEx\core\BepInEx.Core.dll</HintPath>
- </Reference>
- <Reference Include="BepInEx.IL2CPP">
- <HintPath>$(AmongUs)\BepInEx\core\BepInEx.IL2CPP.dll</HintPath>
- </Reference>
- <Reference Include="BepInEx.Preloader.Core">
- <HintPath>$(AmongUs)\BepInEx\core\BepInEx.Preloader.Core.dll</HintPath>
- </Reference>
- <Reference Include="FacebookStore">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\FacebookStore.dll</HintPath>
- </Reference>
- <Reference Include="Hazel">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Hazel.dll</HintPath>
- </Reference>
- <Reference Include="Iced">
- <HintPath>$(AmongUs)\BepInEx\core\Iced.dll</HintPath>
- </Reference>
- <Reference Include="Il2Cpp.TlsAdapter">
- <HintPath>$(AmongUs)\BepInEx\core\Il2Cpp.TlsAdapter.dll</HintPath>
- </Reference>
- <Reference Include="Il2CppDumper">
- <HintPath>$(AmongUs)\BepInEx\core\Il2CppDumper.dll</HintPath>
- </Reference>
- <Reference Include="Il2CppMono.Security">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Il2CppMono.Security.dll</HintPath>
- </Reference>
- <Reference Include="Il2Cppmscorlib">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Il2Cppmscorlib.dll</HintPath>
- </Reference>
- <Reference Include="Il2CppSystem">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Il2CppSystem.dll</HintPath>
- </Reference>
- <Reference Include="Il2CppSystem.Configuration">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Il2CppSystem.Configuration.dll</HintPath>
- </Reference>
- <Reference Include="Il2CppSystem.Core">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Il2CppSystem.Core.dll</HintPath>
- </Reference>
- <Reference Include="Il2CppSystem.Data">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Il2CppSystem.Data.dll</HintPath>
- </Reference>
- <Reference Include="Il2CppSystem.Net.Http">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Il2CppSystem.Net.Http.dll</HintPath>
- </Reference>
- <Reference Include="Il2CppSystem.Numerics">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Il2CppSystem.Numerics.dll</HintPath>
- </Reference>
- <Reference Include="Il2CppSystem.Runtime.Serialization">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Il2CppSystem.Runtime.Serialization.dll</HintPath>
- </Reference>
- <Reference Include="Il2CppSystem.Xml">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Il2CppSystem.Xml.dll</HintPath>
- </Reference>
- <Reference Include="Il2CppSystem.Xml.Linq">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Il2CppSystem.Xml.Linq.dll</HintPath>
- </Reference>
- <Reference Include="Mono.Cecil">
- <HintPath>$(AmongUs)\BepInEx\core\Mono.Cecil.dll</HintPath>
- </Reference>
- <Reference Include="Mono.Cecil.Mdb">
- <HintPath>$(AmongUs)\BepInEx\core\Mono.Cecil.Mdb.dll</HintPath>
- </Reference>
- <Reference Include="Mono.Cecil.Pdb">
- <HintPath>$(AmongUs)\BepInEx\core\Mono.Cecil.Pdb.dll</HintPath>
- </Reference>
- <Reference Include="Mono.Cecil.Rocks">
- <HintPath>$(AmongUs)\BepInEx\core\Mono.Cecil.Rocks.dll</HintPath>
- </Reference>
- <Reference Include="MonoMod.RuntimeDetour">
- <HintPath>$(AmongUs)\BepInEx\core\MonoMod.RuntimeDetour.dll</HintPath>
- </Reference>
- <Reference Include="MonoMod.Utils">
- <HintPath>$(AmongUs)\BepInEx\core\MonoMod.Utils.dll</HintPath>
- </Reference>
- <Reference Include="Newtonsoft.Json">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Newtonsoft.Json.dll</HintPath>
- </Reference>
- <Reference Include="Purchasing.Common">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Purchasing.Common.dll</HintPath>
- </Reference>
- <Reference Include="QRCoder">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\QRCoder.dll</HintPath>
- </Reference>
- <Reference Include="Rewired_Core">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Rewired_Core.dll</HintPath>
- </Reference>
- <Reference Include="Rewired_Windows">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Rewired_Windows.dll</HintPath>
- </Reference>
- <Reference Include="Security">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Security.dll</HintPath>
- </Reference>
- <Reference Include="SemVer">
- <HintPath>$(AmongUs)\BepInEx\core\SemVer.dll</HintPath>
- </Reference>
- <Reference Include="Stores">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Stores.dll</HintPath>
- </Reference>
- <Reference Include="UnhollowerBaseLib">
- <HintPath>$(AmongUs)\BepInEx\core\UnhollowerBaseLib.dll</HintPath>
- </Reference>
- <Reference Include="UnhollowerRuntimeLib">
- <HintPath>$(AmongUs)\BepInEx\core\UnhollowerRuntimeLib.dll</HintPath>
- </Reference>
- <Reference Include="Unity.Addressables">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Unity.Addressables.dll</HintPath>
- </Reference>
- <Reference Include="Unity.Analytics.DataPrivacy">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Unity.Analytics.DataPrivacy.dll</HintPath>
- </Reference>
- <Reference Include="Unity.ResourceManager">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Unity.ResourceManager.dll</HintPath>
- </Reference>
- <Reference Include="Unity.textMeshPro">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\Unity.textMeshPro.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.AIModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.AIModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.AndroidJNIModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.AndroidJNIModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.AnimationModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.AnimationModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.AssetBundleModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.AssetBundleModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.AudioModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.AudioModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.CoreModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.CoreModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.DirectorModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.DirectorModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.GridModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.GridModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.ImageConversionModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.ImageConversionModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.IMGUIModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.IMGUIModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.InputLegacyModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.InputLegacyModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.InputModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.InputModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.JSONSerializeModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.JSONSerializeModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.ParticleSystemModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.ParticleSystemModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.Physics2DModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.Physics2DModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.PhysicsModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.PhysicsModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.Purchasing">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.Purchasing.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.ScreenCaptureModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.ScreenCaptureModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.SharedInternalsModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.SharedInternalsModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.SpriteMaskModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.SpriteMaskModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.SpriteShapeModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.SpriteShapeModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.SubsystemsModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.SubsystemsModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.TerrainModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.TerrainModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.textCoreModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.textCoreModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.textRenderingModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.textRenderingModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.TilemapModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.TilemapModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.UI">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.UI.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.UIElementsNativeModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.UIElementsNativeModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.UIModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.UIModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.UnityAnalyticsModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.UnityAnalyticsModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.UnityWebRequestAssetBundleModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.UnityWebRequestAssetBundleModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.UnityWebRequestModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.UnityWebRequestModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.UnityWebRequestWWWModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.VFXModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.VFXModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.VideoModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.VideoModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.VRModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.VRModule.dll</HintPath>
- </Reference>
- <Reference Include="UnityEngine.XRModule">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\UnityEngine.XRModule.dll</HintPath>
- </Reference>
- <Reference Include="winrt">
- <HintPath>$(AmongUs)\BepInEx\unhollowed\winrt.dll</HintPath>
- </Reference>
+ <PackageReference Include="Reactor.OxygenFilter.MSBuild" Version="*" />
</ItemGroup>
- <Target Name="CopyCustomContent" AfterTargets="AfterBuild">
- <Message Text="Second occurrence" />
- <Copy SourceFiles="$(ProjectDir)\bin\Debug\netstandard2.1\TheOtherRoles.dll" DestinationFolder="$(AmongUs)/BepInEx/plugins/" />
+ <Target Name="Copy" AfterTargets="Reobfuscate">
+ <Copy SourceFiles="$(OutputPath)reobfuscated/$(AssemblyName)-$(GameVersion).dll" DestinationFolder="$(AmongUs)/BepInEx/plugins/" />
</Target>
-</Project>
\ No newline at end of file
+</Project>
using System.Collections.Generic;
using System.Linq;
-using Palette = BLMBFIODBKL;
-
namespace TheOtherRoles
{
[HarmonyPatch(typeof(HudManager), nameof(HudManager.Update))]
class HudManagerUpdatePatch
{
+ public static bool hidePlayerName(PlayerControl source, PlayerControl target) {
+ if (!MapOptions.hidePlayerNames) return false; // All names are visible
+ else if (source == null || target == null) return true;
+ else if (source == target) return false; // Player sees his own name
+ else if (source.Data.IsImpostor && (target.Data.IsImpostor || target == Spy.spy)) return false; // Members of team Impostors see the names of Impostors/Spies
+ else if ((source == Lovers.lover1 || source == Lovers.lover2) && (target == Lovers.lover1 || target == Lovers.lover2)) return false; // Members of team Lovers see the names of each other
+ else if ((source == Jackal.jackal || source == Sidekick.sidekick) && (target == Jackal.jackal || target == Sidekick.sidekick || target == Jackal.fakeSidekick)) return false; // Members of team Jackal see the names of each other
+ return true;
+ }
+
static void resetNameTagsAndColors() {
Dictionary<byte, PlayerControl> playersById = Helpers.allPlayersById();
foreach (PlayerControl player in PlayerControl.AllPlayerControls) {
- player.nameText.text = player.PPMOEEPBHJO.PCLLABJCIPC;
- if (PlayerControl.LocalPlayer.PPMOEEPBHJO.FDNMBJOAPFL && player.PPMOEEPBHJO.FDNMBJOAPFL) {
- player.nameText.color = Palette.JPCHLLEJNEH;
+ player.nameText.text = hidePlayerName(PlayerControl.LocalPlayer, player) ? "" : player.Data.PlayerName;
+ if (PlayerControl.LocalPlayer.Data.IsImpostor && player.Data.IsImpostor) {
+ player.nameText.color = Palette.ImpostorRed;
} else {
player.nameText.color = Color.white;
}
}
if (MeetingHud.Instance != null) {
- foreach (PlayerVoteArea player in MeetingHud.Instance.GBKFCOAKLAH) {
- PlayerControl playerControl = playersById.ContainsKey((byte)player.GEIOMAPOPKA) ? playersById[(byte)player.GEIOMAPOPKA] : null;
+ foreach (PlayerVoteArea player in MeetingHud.Instance.playerStates) {
+ PlayerControl playerControl = playersById.ContainsKey((byte)player.TargetPlayerId) ? playersById[(byte)player.TargetPlayerId] : null;
if (playerControl != null) {
- player.NameText.text = playerControl.PPMOEEPBHJO.PCLLABJCIPC;
- if (PlayerControl.LocalPlayer.PPMOEEPBHJO.FDNMBJOAPFL && playerControl.PPMOEEPBHJO.FDNMBJOAPFL) {
- player.NameText.color = Palette.JPCHLLEJNEH;
+ player.NameText.text = playerControl.Data.PlayerName;
+ if (PlayerControl.LocalPlayer.Data.IsImpostor && playerControl.Data.IsImpostor) {
+ player.NameText.color = Palette.ImpostorRed;
} else {
player.NameText.color = Color.white;
}
}
}
}
- if (PlayerControl.LocalPlayer.PPMOEEPBHJO.FDNMBJOAPFL) {
+ if (PlayerControl.LocalPlayer.Data.IsImpostor) {
List<PlayerControl> impostors = PlayerControl.AllPlayerControls.ToArray().ToList();
- impostors.RemoveAll(x => !x.PPMOEEPBHJO.FDNMBJOAPFL);
+ impostors.RemoveAll(x => !x.Data.IsImpostor);
foreach (PlayerControl player in impostors)
- player.nameText.color = Palette.JPCHLLEJNEH;
+ player.nameText.color = Palette.ImpostorRed;
if (MeetingHud.Instance != null)
- foreach (PlayerVoteArea player in MeetingHud.Instance.GBKFCOAKLAH) {
- PlayerControl playerControl = Helpers.playerById((byte)player.GEIOMAPOPKA);
- if (playerControl != null && playerControl.PPMOEEPBHJO.FDNMBJOAPFL)
- player.NameText.color = Palette.JPCHLLEJNEH;
+ foreach (PlayerVoteArea player in MeetingHud.Instance.playerStates) {
+ PlayerControl playerControl = Helpers.playerById((byte)player.TargetPlayerId);
+ if (playerControl != null && playerControl.Data.IsImpostor)
+ player.NameText.color = Palette.ImpostorRed;
}
}
static void setPlayerNameColor(PlayerControl p, Color color) {
p.nameText.color = color;
if (MeetingHud.Instance != null)
- foreach (PlayerVoteArea player in MeetingHud.Instance.GBKFCOAKLAH)
- if (player.NameText != null && p.PlayerId == player.GEIOMAPOPKA)
+ foreach (PlayerVoteArea player in MeetingHud.Instance.playerStates)
+ if (player.NameText != null && p.PlayerId == player.TargetPlayerId)
player.NameText.color = color;
}
}
// No else if here, as the Impostors need the Spy name to be colored
- if (Spy.spy != null && PlayerControl.LocalPlayer.PPMOEEPBHJO.FDNMBJOAPFL) {
+ if (Spy.spy != null && PlayerControl.LocalPlayer.Data.IsImpostor) {
setPlayerNameColor(Spy.spy, Spy.color);
}
}
static void setMafiaNameTags() {
- if (PlayerControl.LocalPlayer != null && PlayerControl.LocalPlayer.PPMOEEPBHJO.FDNMBJOAPFL) {
+ if (PlayerControl.LocalPlayer != null && PlayerControl.LocalPlayer.Data.IsImpostor) {
foreach (PlayerControl player in PlayerControl.AllPlayerControls)
if (Godfather.godfather != null && Godfather.godfather == player)
- player.nameText.text = player.PPMOEEPBHJO.PCLLABJCIPC + " (G)";
+ player.nameText.text = player.Data.PlayerName + " (G)";
else if (Mafioso.mafioso != null && Mafioso.mafioso == player)
- player.nameText.text = player.PPMOEEPBHJO.PCLLABJCIPC + " (M)";
+ player.nameText.text = player.Data.PlayerName + " (M)";
else if (Janitor.janitor != null && Janitor.janitor == player)
- player.nameText.text = player.PPMOEEPBHJO.PCLLABJCIPC + " (J)";
+ player.nameText.text = player.Data.PlayerName + " (J)";
if (MeetingHud.Instance != null)
- foreach (PlayerVoteArea player in MeetingHud.Instance.GBKFCOAKLAH)
- if (Godfather.godfather != null && Godfather.godfather.PlayerId == player.GEIOMAPOPKA)
- player.NameText.text = Godfather.godfather.PPMOEEPBHJO.PCLLABJCIPC + " (G)";
- else if (Mafioso.mafioso != null && Mafioso.mafioso.PlayerId == player.GEIOMAPOPKA)
- player.NameText.text = Mafioso.mafioso.PPMOEEPBHJO.PCLLABJCIPC + " (M)";
- else if (Janitor.janitor != null && Janitor.janitor.PlayerId == player.GEIOMAPOPKA)
- player.NameText.text = Janitor.janitor.PPMOEEPBHJO.PCLLABJCIPC + " (J)";
+ foreach (PlayerVoteArea player in MeetingHud.Instance.playerStates)
+ if (Godfather.godfather != null && Godfather.godfather.PlayerId == player.TargetPlayerId)
+ player.NameText.text = Godfather.godfather.Data.PlayerName + " (G)";
+ else if (Mafioso.mafioso != null && Mafioso.mafioso.PlayerId == player.TargetPlayerId)
+ player.NameText.text = Mafioso.mafioso.Data.PlayerName + " (M)";
+ else if (Janitor.janitor != null && Janitor.janitor.PlayerId == player.TargetPlayerId)
+ player.NameText.text = Janitor.janitor.Data.PlayerName + " (J)";
}
}
static void updateShielded() {
if (Medic.shielded == null) return;
- if(Medic.showShielded == 0) // Everyone
- {
- Medic.shielded.KJAENOGGEOK.material.SetFloat("_Outline", 1f);
- Medic.shielded.KJAENOGGEOK.material.SetColor("_OutlineColor", Medic.shieldedColor);
- }
- else if (Medic.showShielded == 1 && PlayerControl.LocalPlayer == Medic.shielded) // Shielded + Medic
- {
- Medic.shielded.KJAENOGGEOK.material.SetFloat("_Outline", 1f);
- Medic.shielded.KJAENOGGEOK.material.SetColor("_OutlineColor", Medic.shieldedColor);
- }
- else if(PlayerControl.LocalPlayer == Medic.medic) // Medic
- {
- Medic.shielded.KJAENOGGEOK.material.SetFloat("_Outline", 1f);
- Medic.shielded.KJAENOGGEOK.material.SetColor("_OutlineColor", Medic.shieldedColor);
- }
-
- // Break shield
- if (Medic.shielded.PPMOEEPBHJO.IAGJEKLJCCI || Medic.medic == null || Medic.medic.PPMOEEPBHJO.IAGJEKLJCCI) {
- Medic.shielded.KJAENOGGEOK.material.SetFloat("_Outline", 0f);
+ if (Medic.shielded.Data.IsDead || Medic.medic == null || Medic.medic.Data.IsDead) {
Medic.shielded = null;
}
}
// Set morphling morphed look
if (Morphling.morphTimer > 0f && Camouflager.camouflageTimer <= 0f) {
if (Morphling.morphling != null && Morphling.morphTarget != null) {
- Morphling.morphling.nameText.text = Morphling.morphTarget.PPMOEEPBHJO.PCLLABJCIPC;
- Morphling.morphling.KJAENOGGEOK.material.SetColor("_BackColor", Palette.PHFOPNDOEMD[Morphling.morphTarget.PPMOEEPBHJO.IMMNCAGJJJC]);
- Morphling.morphling.KJAENOGGEOK.material.SetColor("_BodyColor", Palette.AEDCMKGJKAG[Morphling.morphTarget.PPMOEEPBHJO.IMMNCAGJJJC]);
- Morphling.morphling.KJAENOGGEOK.material.SetFloat("_Outline", Morphling.morphTarget.KJAENOGGEOK.material.GetFloat("_Outline"));
- Morphling.morphling.KJAENOGGEOK.material.SetColor("_OutlineColor", Morphling.morphTarget.KJAENOGGEOK.material.GetColor("_OutlineColor"));
- Morphling.morphling.HatRenderer.SetHat(Morphling.morphTarget.PPMOEEPBHJO.CPGFLBANALE, Morphling.morphTarget.PPMOEEPBHJO.IMMNCAGJJJC);
- Morphling.morphling.nameText.transform.localPosition = new Vector3(0f, (Morphling.morphTarget.PPMOEEPBHJO.CPGFLBANALE == 0U) ? 0.7f : 1.05f, -0.5f);
-
- if (Morphling.morphling.MyPhysics.Skin.skin.ProdId != DestroyableSingleton<HatManager>.CHNDKKBEIDG.AllSkins[(int)Morphling.morphTarget.PPMOEEPBHJO.CGNMKICGLOG].ProdId) {
- Helpers.setSkinWithAnim(Morphling.morphling.MyPhysics, Morphling.morphTarget.PPMOEEPBHJO.CGNMKICGLOG);
+ Morphling.morphling.nameText.text = hidePlayerName(PlayerControl.LocalPlayer, Morphling.morphling) ? "" : Morphling.morphTarget.Data.PlayerName;
+ Morphling.morphling.myRend.material.SetColor("_BackColor", Palette.ShadowColors[Morphling.morphTarget.Data.ColorId]);
+ Morphling.morphling.myRend.material.SetColor("_BodyColor", Palette.PlayerColors[Morphling.morphTarget.Data.ColorId]);
+ Morphling.morphling.myRend.material.SetFloat("_Outline", Morphling.morphTarget.myRend.material.GetFloat("_Outline"));
+ Morphling.morphling.myRend.material.SetColor("_OutlineColor", Morphling.morphTarget.myRend.material.GetColor("_OutlineColor"));
+ Morphling.morphling.HatRenderer.SetHat(Morphling.morphTarget.Data.HatId, Morphling.morphTarget.Data.ColorId);
+ Morphling.morphling.nameText.transform.localPosition = new Vector3(0f, (Morphling.morphTarget.Data.HatId == 0U) ? 0.7f : 1.05f, -0.5f);
+
+ if (Morphling.morphling.MyPhysics.Skin.skin.ProdId != DestroyableSingleton<HatManager>.Instance.AllSkins[(int)Morphling.morphTarget.Data.SkinId].ProdId) {
+ Helpers.setSkinWithAnim(Morphling.morphling.MyPhysics, Morphling.morphTarget.Data.SkinId);
}
- if (Morphling.morphling.CurrentPet == null || Morphling.morphling.CurrentPet.OPADMIKFGHK != DestroyableSingleton<HatManager>.CHNDKKBEIDG.AllPets[(int)Morphling.morphTarget.PPMOEEPBHJO.LBHODBKCBKA].OPADMIKFGHK) {
+ if (Morphling.morphling.CurrentPet == null || Morphling.morphling.CurrentPet.ProdId != DestroyableSingleton<HatManager>.Instance.AllPets[(int)Morphling.morphTarget.Data.PetId].ProdId) {
if (Morphling.morphling.CurrentPet) UnityEngine.Object.Destroy(Morphling.morphling.CurrentPet.gameObject);
- Morphling.morphling.CurrentPet = UnityEngine.Object.Instantiate<PetBehaviour>(DestroyableSingleton<HatManager>.CHNDKKBEIDG.AllPets[(int)Morphling.morphTarget.PPMOEEPBHJO.LBHODBKCBKA]);
+ Morphling.morphling.CurrentPet = UnityEngine.Object.Instantiate<PetBehaviour>(DestroyableSingleton<HatManager>.Instance.AllPets[(int)Morphling.morphTarget.Data.PetId]);
Morphling.morphling.CurrentPet.transform.position = Morphling.morphling.transform.position;
Morphling.morphling.CurrentPet.Source = Morphling.morphling;
- Morphling.morphling.CurrentPet.BDBDGFDELMB = Morphling.morphling.BDBDGFDELMB;
- PlayerControl.SetPlayerMaterialColors(Morphling.morphTarget.PPMOEEPBHJO.IMMNCAGJJJC, Morphling.morphling.CurrentPet.rend);
+ Morphling.morphling.CurrentPet.Visible = Morphling.morphling.Visible;
+ PlayerControl.SetPlayerMaterialColors(Morphling.morphTarget.Data.ColorId, Morphling.morphling.CurrentPet.rend);
} else if (Morphling.morphling.CurrentPet) {
- PlayerControl.SetPlayerMaterialColors(Morphling.morphTarget.PPMOEEPBHJO.IMMNCAGJJJC, Morphling.morphling.CurrentPet.rend);
+ PlayerControl.SetPlayerMaterialColors(Morphling.morphTarget.Data.ColorId, Morphling.morphling.CurrentPet.rend);
}
}
}
if (Camouflager.camouflageTimer > 0f) {
foreach (PlayerControl p in PlayerControl.AllPlayerControls) {
p.nameText.text = "";
- p.KJAENOGGEOK.material.SetColor("_BackColor", Palette.AEDCMKGJKAG[6]);
- p.KJAENOGGEOK.material.SetColor("_BodyColor", Palette.AEDCMKGJKAG[6]);
- p.KJAENOGGEOK.material.SetFloat("_Outline", 0f);
+ p.myRend.material.SetColor("_BackColor", Palette.PlayerColors[6]);
+ p.myRend.material.SetColor("_BodyColor", Palette.PlayerColors[6]);
p.HatRenderer.SetHat(0, 0);
Helpers.setSkinWithAnim(p.MyPhysics, 0);
bool spawnPet = false;
if (p.CurrentPet == null) spawnPet = true;
- else if (p.CurrentPet.OPADMIKFGHK != DestroyableSingleton<HatManager>.CHNDKKBEIDG.AllPets[0].OPADMIKFGHK) {
+ else if (p.CurrentPet.ProdId != DestroyableSingleton<HatManager>.Instance.AllPets[0].ProdId) {
UnityEngine.Object.Destroy(p.CurrentPet.gameObject);
spawnPet = true;
}
if (spawnPet) {
- p.CurrentPet = UnityEngine.Object.Instantiate<PetBehaviour>(DestroyableSingleton<HatManager>.CHNDKKBEIDG.AllPets[0]);
+ p.CurrentPet = UnityEngine.Object.Instantiate<PetBehaviour>(DestroyableSingleton<HatManager>.Instance.AllPets[0]);
p.CurrentPet.transform.position = p.transform.position;
p.CurrentPet.Source = p;
}
Child.child.nameText.text += suffix;
if (MeetingHud.Instance != null) {
- foreach (PlayerVoteArea player in MeetingHud.Instance.GBKFCOAKLAH)
- if (player.NameText != null && Child.child.PlayerId == player.GEIOMAPOPKA)
+ foreach (PlayerVoteArea player in MeetingHud.Instance.playerStates)
+ if (player.NameText != null && Child.child.PlayerId == player.TargetPlayerId)
player.NameText.text += suffix;
}
}
static void updateImpostorKillButton(HudManager __instance) {
- if (!PlayerControl.LocalPlayer.PPMOEEPBHJO.FDNMBJOAPFL) return;
+ if (!PlayerControl.LocalPlayer.Data.IsImpostor) return;
bool enabled = true;
if (Vampire.vampire != null && Vampire.vampire == PlayerControl.LocalPlayer)
enabled = false;
- else if (Mafioso.mafioso != null && Mafioso.mafioso == PlayerControl.LocalPlayer && Godfather.godfather != null && !Godfather.godfather.PPMOEEPBHJO.IAGJEKLJCCI)
+ else if (Mafioso.mafioso != null && Mafioso.mafioso == PlayerControl.LocalPlayer && Godfather.godfather != null && !Godfather.godfather.Data.IsDead)
enabled = false;
else if (Janitor.janitor != null && Janitor.janitor == PlayerControl.LocalPlayer)
enabled = false;
foreach (Arrow arrow in Snitch.localArrows) arrow.arrow.SetActive(false);
- if (Snitch.snitch == null || Snitch.snitch.PPMOEEPBHJO.IAGJEKLJCCI) return;
+ if (Snitch.snitch == null || Snitch.snitch.Data.IsDead) return;
int numberOfTasks = 0;
- GameData.LGBOMGHJELL LGBOMGHJELL = Snitch.snitch.PPMOEEPBHJO;
- if (!LGBOMGHJELL.MFFAGDHDHLO && LGBOMGHJELL.PHGPJMKOKMC != null) {
- for (int i = 0; i < LGBOMGHJELL.PHGPJMKOKMC.Count; i++) {
- if (!LGBOMGHJELL.PHGPJMKOKMC[i].LBBFBHJINJK)
+ GameData.PlayerInfo playerInfo = Snitch.snitch.Data;
+ if (!playerInfo.Disconnected && playerInfo.Tasks != null) {
+ for (int i = 0; i < playerInfo.Tasks.Count; i++) {
+ if (!playerInfo.Tasks[i].Complete)
numberOfTasks++;
}
}
- if (PlayerControl.LocalPlayer.PPMOEEPBHJO.FDNMBJOAPFL && numberOfTasks <= Snitch.taskCountForImpostors) {
+ if (PlayerControl.LocalPlayer.Data.IsImpostor && numberOfTasks <= Snitch.taskCountForImpostors) {
if (Snitch.localArrows.Count == 0) Snitch.localArrows.Add(new Arrow(Color.blue));
if (Snitch.localArrows.Count != 0 && Snitch.localArrows[0] != null) {
Snitch.localArrows[0].arrow.SetActive(true);
} else if (PlayerControl.LocalPlayer == Snitch.snitch && numberOfTasks == 0) {
int arrowIndex = 0;
foreach (PlayerControl p in PlayerControl.AllPlayerControls) {
- if (p.PPMOEEPBHJO.FDNMBJOAPFL && !p.PPMOEEPBHJO.IAGJEKLJCCI) {
+ if (p.Data.IsImpostor && !p.Data.IsDead) {
if (arrowIndex >= Snitch.localArrows.Count) Snitch.localArrows.Add(new Arrow(Color.blue));
if (arrowIndex < Snitch.localArrows.Count && Snitch.localArrows[arrowIndex] != null) {
Snitch.localArrows[arrowIndex].arrow.SetActive(true);
static void Postfix(HudManager __instance)
{
- if (AmongUsClient.Instance.GameState != InnerNet.InnerNetClient.GCDONLGCMIL.Started) return;
+ if (AmongUsClient.Instance.GameState != InnerNet.InnerNetClient.GameStates.Started) return;
CustomButton.HudUpdate();
resetNameTagsAndColors();
// Mafia
setMafiaNameTags();
- // Jester
- Helpers.removeTasksFromPlayer(Jester.jester);
// Impostors
updateImpostorKillButton(__instance);
// Timer updates
childUpdate();
// Snitch
snitchUpdate();
- // Jackal
- Helpers.removeTasksFromPlayer(Jackal.jackal);
- // Sidekick
- Helpers.removeTasksFromPlayer(Sidekick.sidekick);
}
}
-}
\ No newline at end of file
+}
using static TheOtherRoles.MapOptions;
using System.Collections.Generic;
-using SystemTypes = BCPJLGGNHBC;
-using Palette = BLMBFIODBKL;
-using Constants = LNCOKMACBKP;
-using PhysicsHelpers = FJFJIDCFLDJ;
-using TaskTypes = DMOAGPGAFKM;
-using ImageNames = DLBCMCKGOMN;
namespace TheOtherRoles
{
[HarmonyPatch(typeof(Vent), "CanUse")]
public static class VentCanUsePatch
{
- public static bool Prefix(Vent __instance, ref float __result, [HarmonyArgument(0)] GameData.LGBOMGHJELL pc, [HarmonyArgument(1)] out bool canUse, [HarmonyArgument(2)] out bool couldUse)
+ public static bool Prefix(Vent __instance, ref float __result, [HarmonyArgument(0)] GameData.PlayerInfo pc, [HarmonyArgument(1)] out bool canUse, [HarmonyArgument(2)] out bool couldUse)
{
float num = float.MaxValue;
- PlayerControl @object = pc.GJPBCGFPMOD;
+ PlayerControl @object = pc.Object;
bool roleCouldUse = false;
roleCouldUse = true;
else if (Sidekick.canUseVents && Sidekick.sidekick != null && Sidekick.sidekick == @object)
roleCouldUse = true;
- else if (pc.FDNMBJOAPFL) {
+ else if (pc.IsImpostor) {
if (Janitor.janitor != null && Janitor.janitor == PlayerControl.LocalPlayer)
roleCouldUse = false;
- else if (Mafioso.mafioso != null && Mafioso.mafioso == PlayerControl.LocalPlayer && Godfather.godfather != null && !Godfather.godfather.PPMOEEPBHJO.IAGJEKLJCCI)
+ else if (Mafioso.mafioso != null && Mafioso.mafioso == PlayerControl.LocalPlayer && Godfather.godfather != null && !Godfather.godfather.Data.IsDead)
roleCouldUse = false;
else
roleCouldUse = true;
}
- var usableDistance = __instance.KNKPIDOGFFC;
+ var usableDistance = __instance.UsableDistance;
if (__instance.name.StartsWith("JackInTheBoxVent_")) {
if(Trickster.trickster != PlayerControl.LocalPlayer) {
// Only the Trickster can use the Jack-In-The-Boxes!
}
}
- couldUse = ((@object.inVent || roleCouldUse) && !pc.IAGJEKLJCCI && (@object.POECPOEKKNO || @object.inVent));
+ couldUse = ((@object.inVent || roleCouldUse) && !pc.IsDead && (@object.CanMove || @object.inVent));
canUse = couldUse;
if (canUse)
{
Vector3 position = __instance.transform.position;
num = Vector2.Distance(truePosition, position);
- canUse &= (num <= usableDistance && !PhysicsHelpers.DOAHONIIFJD(truePosition, position, Constants.KOMPKLHCHJI, false));
+ canUse &= (num <= usableDistance && !PhysicsHelpers.AnythingBetween(truePosition, position, Constants.ShipOnlyMask, false));
}
__result = num;
return false;
public static bool Prefix(Vent __instance) {
bool flag;
bool flag2;
- __instance.CanUse(PlayerControl.LocalPlayer.PPMOEEPBHJO, out flag, out flag2);
+ __instance.CanUse(PlayerControl.LocalPlayer.Data, out flag, out flag2);
- if (!flag) return true; // Continue with default method
+ if (!flag || !__instance.name.StartsWith("JackInTheBoxVent_")) return true; // Continue with default method
bool isEnter = !PlayerControl.LocalPlayer.inVent;
- if (isEnter) localVentEnterTimePoint = DateTime.UtcNow;
-
- if (!__instance.name.StartsWith("JackInTheBoxVent_")) return true; // Continue with default method
__instance.SetButtons(isEnter);
MessageWriter writer = AmongUsClient.Instance.StartRpc(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.UseUncheckedVent, Hazel.SendOption.Reliable);
class UseButtonSetTargetPatch {
static void Postfix(UseButtonManager __instance) {
// Trickster render special vent button
- if (__instance.LHAKKAAOLLM != null && Trickster.trickster != null && Trickster.trickster == PlayerControl.LocalPlayer) {
- Vent possibleVent = __instance.LHAKKAAOLLM.TryCast<Vent>();
- if (possibleVent?.gameObject != null && possibleVent.gameObject.name.StartsWith("JackInTheBoxVent_")) {
+ if (__instance.currentTarget != null && Trickster.trickster != null && Trickster.trickster == PlayerControl.LocalPlayer) {
+ Vent possibleVent = __instance.currentTarget.TryCast<Vent>();
+ if (possibleVent != null && possibleVent.gameObject != null && possibleVent.gameObject.name.StartsWith("JackInTheBoxVent_")) {
__instance.UseButton.sprite = Trickster.getTricksterVentButtonSprite();
}
}
// Mafia sabotage button render patch
bool blockSabotageJanitor = (Janitor.janitor != null && Janitor.janitor == PlayerControl.LocalPlayer);
- bool blockSabotageMafioso = (Mafioso.mafioso != null && Mafioso.mafioso == PlayerControl.LocalPlayer && Godfather.godfather != null && !Godfather.godfather.PPMOEEPBHJO.IAGJEKLJCCI);
- if (__instance.LHAKKAAOLLM == null && (blockSabotageJanitor || blockSabotageMafioso)) {
- __instance.UseButton.sprite = DestroyableSingleton<TranslationController>.CHNDKKBEIDG.GetImage(ImageNames.UseButton);
+ bool blockSabotageMafioso = (Mafioso.mafioso != null && Mafioso.mafioso == PlayerControl.LocalPlayer && Godfather.godfather != null && !Godfather.godfather.Data.IsDead);
+ if (__instance.currentTarget == null && (blockSabotageJanitor || blockSabotageMafioso)) {
+ __instance.UseButton.sprite = DestroyableSingleton<TranslationController>.Instance.GetImage(ImageNames.UseButton);
__instance.UseButton.color = new Color(1f, 1f, 1f, 0.3f);
}
[HarmonyPatch(typeof(UseButtonManager), nameof(UseButtonManager.DoClick))]
class UseButtonDoClickPatch {
static bool Prefix(UseButtonManager __instance) {
- if (__instance.LHAKKAAOLLM != null) return true;
+ if (__instance.currentTarget != null) return true;
// Mafia sabotage button click patch
bool blockSabotageJanitor = (Janitor.janitor != null && Janitor.janitor == PlayerControl.LocalPlayer);
- bool blockSabotageMafioso = (Mafioso.mafioso != null && Mafioso.mafioso == PlayerControl.LocalPlayer && Godfather.godfather != null && !Godfather.godfather.PPMOEEPBHJO.IAGJEKLJCCI);
+ bool blockSabotageMafioso = (Mafioso.mafioso != null && Mafioso.mafioso == PlayerControl.LocalPlayer && Godfather.godfather != null && !Godfather.godfather.Data.IsDead);
if (blockSabotageJanitor || blockSabotageMafioso) return false;
return true;
}
// Handle max number of meetings
- if (__instance.FOIGOPKABAA == 1) {
+ if (__instance.state == 1) {
int localRemaining = PlayerControl.LocalPlayer.RemainingEmergencies;
int teamRemaining = Mathf.Max(0, maxNumberOfMeetings - meetingsCount);
int remaining = Mathf.Min(localRemaining, (Mayor.mayor != null && Mayor.mayor == PlayerControl.LocalPlayer) ? 1 : teamRemaining);
class VitalsMinigameBeginPatch {
static void Postfix(VitalsMinigame __instance) {
- if (__instance.PMKNJGLKGDD.Length > 10) {
- for (int i = 0; i < __instance.PMKNJGLKGDD.Length; i++) {
- var vitalsPanel = __instance.PMKNJGLKGDD[i];
+ if (__instance.vitals.Length > 10) {
+ for (int i = 0; i < __instance.vitals.Length; i++) {
+ var vitalsPanel = __instance.vitals[i];
var player = GameData.Instance.AllPlayers[i];
- vitalsPanel.Text.text = player.PCLLABJCIPC.Length >= 4 ? player.PCLLABJCIPC.Substring(0, 4).ToUpper() : player.PCLLABJCIPC.ToUpper();
+ vitalsPanel.Text.text = player.PlayerName.Length >= 4 ? player.PlayerName.Substring(0, 4).ToUpper() : player.PlayerName.ToUpper();
}
}
}
static void Postfix(VitalsMinigame __instance) {
// Hacker show time since death
bool showHackerInfo = Hacker.hacker != null && Hacker.hacker == PlayerControl.LocalPlayer && Hacker.hackerTimer > 0;
- for (int k = 0; k < __instance.PMKNJGLKGDD.Length; k++)
+ for (int k = 0; k < __instance.vitals.Length; k++)
{
- VitalsPanel vitalsPanel = __instance.PMKNJGLKGDD[k];
- GameData.LGBOMGHJELL player = GameData.Instance.AllPlayers[k];
+ VitalsPanel vitalsPanel = __instance.vitals[k];
+ GameData.PlayerInfo player = GameData.Instance.AllPlayers[k];
// Crowded scaling
- float scale = 10f / Mathf.Max(10, __instance.PMKNJGLKGDD.Length);
+ float scale = 10f / Mathf.Max(10, __instance.vitals.Length);
vitalsPanel.transform.localPosition = new Vector3((float)k * 0.6f * scale + -2.7f, 0.2f, -1f);
vitalsPanel.transform.localScale = new Vector3(scale, scale, vitalsPanel.transform.localScale.z);
// Hacker update
if (vitalsPanel.IsDead) {
- DeadPlayer deadPlayer = deadPlayers?.Where(x => x.player?.PlayerId == player?.FNPNJHNKEBK)?.FirstOrDefault();
+ DeadPlayer deadPlayer = deadPlayers?.Where(x => x.player?.PlayerId == player?.PlayerId)?.FirstOrDefault();
if (deadPlayer != null && deadPlayer.timeOfDeath != null) {
float timeSinceDeath = ((float)(DateTime.UtcNow - deadPlayer.timeOfDeath).TotalMilliseconds);
if (showHackerInfo)
vitalsPanel.Text.text = Math.Round(timeSinceDeath / 1000) + "s";
- else if (__instance.PMKNJGLKGDD.Length > 10)
- vitalsPanel.Text.text = player.PCLLABJCIPC.Length >= 4 ? player.PCLLABJCIPC.Substring(0, 4).ToUpper() : player.PCLLABJCIPC.ToUpper();
+ else if (__instance.vitals.Length > 10)
+ vitalsPanel.Text.text = player.PlayerName.Length >= 4 ? player.PlayerName.Substring(0, 4).ToUpper() : player.PlayerName.ToUpper();
else
- vitalsPanel.Text.text = DestroyableSingleton<TranslationController>.CHNDKKBEIDG.GetString(Palette.MBDDHJCCLBP[(int)player.IMMNCAGJJJC], new UnhollowerBaseLib.Il2CppReferenceArray<Il2CppSystem.Object>(0));
+ vitalsPanel.Text.text = DestroyableSingleton<TranslationController>.Instance.GetString(Palette.ShortColorNames[(int)player.ColorId], new UnhollowerBaseLib.Il2CppReferenceArray<Il2CppSystem.Object>(0));
}
}
}
class MapCountOverlayUpdatePatch {
static bool Prefix(MapCountOverlay __instance) {
// Save colors for the Hacker
- __instance.PPKFBIONLAL += Time.deltaTime;
- if (__instance.PPKFBIONLAL < 0.1f)
+ __instance.timer += Time.deltaTime;
+ if (__instance.timer < 0.1f)
{
return false;
}
- __instance.PPKFBIONLAL = 0f;
+ __instance.timer = 0f;
players = new Dictionary<SystemTypes, List<Color>>();
bool commsActive = false;
foreach (PlayerTask task in PlayerControl.LocalPlayer.myTasks)
if (task.TaskType == TaskTypes.FixComms) commsActive = true;
- if (!__instance.PIMGCOPFDBG && commsActive)
+ if (!__instance.isSab && commsActive)
{
- __instance.PIMGCOPFDBG = true;
- __instance.BackgroundColor.SetColor(Palette.EGHCBLDNCGP);
+ __instance.isSab = true;
+ __instance.BackgroundColor.SetColor(Palette.DisabledGrey);
__instance.SabotageText.gameObject.SetActive(true);
return false;
}
- if (__instance.PIMGCOPFDBG && !commsActive)
+ if (__instance.isSab && !commsActive)
{
- __instance.PIMGCOPFDBG = false;
+ __instance.isSab = false;
__instance.BackgroundColor.SetColor(Color.green);
__instance.SabotageText.gameObject.SetActive(false);
}
if (!commsActive)
{
- PlainShipRoom plainShipRoom = ShipStatus.Instance.DFAAPCDKCCO[counterArea.RoomType];
+ PlainShipRoom plainShipRoom = ShipStatus.Instance.FastRooms[counterArea.RoomType];
if (plainShipRoom != null && plainShipRoom.roomArea)
{
- int num = plainShipRoom.roomArea.OverlapCollider(__instance.CMCPAKBKLDP, __instance.HMNBGCJAGLM);
+ int num = plainShipRoom.roomArea.OverlapCollider(__instance.filter, __instance.buffer);
int num2 = num;
for (int j = 0; j < num; j++)
{
- Collider2D collider2D = __instance.HMNBGCJAGLM[j];
+ Collider2D collider2D = __instance.buffer[j];
if (!(collider2D.tag == "DeadBody"))
{
PlayerControl component = collider2D.GetComponent<PlayerControl>();
- if (!component || component.PPMOEEPBHJO == null || component.PPMOEEPBHJO.MFFAGDHDHLO || component.PPMOEEPBHJO.IAGJEKLJCCI)
+ if (!component || component.Data == null || component.Data.Disconnected || component.Data.IsDead)
{
num2--;
- } else if (component?.KJAENOGGEOK?.material != null) {
- Color color = component.KJAENOGGEOK.material.GetColor("_BodyColor");
+ } else if (component?.myRend?.material != null) {
+ Color color = component.myRend.material.GetColor("_BodyColor");
if (Hacker.onlyColorType) {
- var id = Mathf.Max(0, Palette.AEDCMKGJKAG.IndexOf(color));
- color = Helpers.isLighterColor((byte)id) ? Palette.AEDCMKGJKAG[7] : Palette.AEDCMKGJKAG[6];
+ var id = Mathf.Max(0, Palette.PlayerColors.IndexOf(color));
+ color = Helpers.isLighterColor((byte)id) ? Palette.PlayerColors[7] : Palette.PlayerColors[6];
}
roomColors.Add(color);
}
} else {
DeadBody component = collider2D.GetComponent<DeadBody>();
if (component) {
- GameData.LGBOMGHJELL LGBOMGHJELL = GameData.Instance.GetPlayerById(component.ParentId);
- if (LGBOMGHJELL != null) {
- var color = Palette.AEDCMKGJKAG[LGBOMGHJELL.IMMNCAGJJJC];
+ GameData.PlayerInfo playerInfo = GameData.Instance.GetPlayerById(component.ParentId);
+ if (playerInfo != null) {
+ var color = Palette.PlayerColors[playerInfo.ColorId];
if (Hacker.onlyColorType)
- color = Helpers.isLighterColor(LGBOMGHJELL.IMMNCAGJJJC) ? Palette.AEDCMKGJKAG[7] : Palette.AEDCMKGJKAG[6];
+ color = Helpers.isLighterColor(playerInfo.ColorId) ? Palette.PlayerColors[7] : Palette.PlayerColors[6];
roomColors.Add(color);
}
}
if (players.ContainsKey(__instance.RoomType)) {
List<Color> colors = players[__instance.RoomType];
- for (int i = 0; i < __instance.OHFFOMPLFLL.Count; i++) {
- PoolableBehavior icon = __instance.OHFFOMPLFLL[i];
+ for (int i = 0; i < __instance.myIcons.Count; i++) {
+ PoolableBehavior icon = __instance.myIcons[i];
SpriteRenderer renderer = icon.GetComponent<SpriteRenderer>();
if (renderer != null) {