diff --git a/README.md b/README.md index 1a7d3e2..e62b1ae 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ We are only a team of teenagers, and we may not be able to make this mod like an | Among Us - Version | Mod Version | Link | | ------------------ | ----------- | ------------------------------------------------------------ | +| 2024.10.29s | v1.3.0 | [Download](https://github.com/dabao40/TheOtherRolesGMIA/releases/tag/1.3.0) | +| 2024.6.18s | v1.2.9 | [Download](https://github.com/dabao40/TheOtherRolesGMIA/releases/tag/1.2.9) | | 2024.6.18s | v1.2.7 | [Download](https://github.com/dabao40/TheOtherRolesGMIA/releases/tag/1.2.7) | | 2024.3.5s | v1.2.3 | [Download](https://github.com/dabao40/TheOtherRolesGMIA/releases/tag/1.2.3) | @@ -45,6 +47,41 @@ We are only a team of teenagers, and we may not be able to make this mod like an
Click to show the Changelog + **Version v1.3.0** + - Added compatibility to Among Us v2024.10.29 + - Added new role Kataomoi + - Added new join lobby UI + - Added some new achievements to the Neutral roles + - Added some meeting clues to make memorizing the texts easier + - Adjusted the Moriarty Indicator and made the UI more beautiful + - Added the uses icons to some buttons + - Added the info icons to some suicidal buttons + - Added the Husk info for Shifters shifting onto dead Sheriff/Jackal etc. + - Added new types of button label texts as well as the uses texts + - Adjusted the Teleporter swapping by using the Shapeshifter menu + - The Madmate can now be assigned with another modifier + - The number of dummies can now be selected to 0 + - The Cupid Lovers and the Lovers' chat channel won't interfere with each other now + - The Busker no longer gets to see the dead players' chats while pseudociding + - The Task Texts won't be visible during comms sabotage + - Fixed a bug where the dead Shifter could revive upon shifting someone alive + - Fixed a bug where the Jackal cannot be shifted + - Fixed a bug where the Fox would cause a game crash + - Fixed a bug where the Shifter can shift anyone upon death + - Fixed a bug where the Busker could not revive + - Fixed a bug where the Task Master's extra tasks are displayed wrongly + - Fixed a bug where the Moriarty's fake kill could be counted + - Fixed a bug where the Trapper's target can still move even when trapped + - Fixed a bug where the option "Trapper Hear Range" is useless + - Fixed a bug where the Madmate's tasks are not assigned properly + - Fixed a bug where the Janitor could stll sabotage + - Fixed a bug where switching gamemodes in Free Play would still work + - Fixed a bug where the "Crewmate" screen may still be shown during Intro + - Fixed a bug where the Schrodinger's Cat's role color will not change + - Fixed a bug where the option "Number Of Dummies" is still visible even not in Free Play + - Fixed a bug where the Swapper's charges would zoom up upon the death of a selected target + - Fixed a bug where the Akujo and the Cupid timer would still be visible during the meeting even if the target has been selected + **Version v1.2.3** - Fixed several bugs with the colors/footprints of the Mimic (both Killer and Assistant). - Changed the implementation of the detective footprints. @@ -95,106 +132,6 @@ We are only a team of teenagers, and we may not be able to make this mod like an
-
- Click to show the new roles added - -## Flashlight(Recently Not Available) - -Original Idea by [eDonnes](https://github.com/eDonnes124) -The Flashlight is An Impostor with a special bomb ability. -This bomb ability makes everyone except for the Impostors and other players outside this range blind. -The cooldown of the Flashlight will be added after using this skill. -The Impostors can all see the blinded players since their names would be black.(optional) - -| Options | Notes | -| ------------------------ | -------------------------------------------------------- | -| Flash Cooldown | | -| Flash Duration | | -| Name Is Black | Impostors see those players who are affected by the bomb | -| Cooldown after Bomb | The Cooldown added after the bomb | -| Flashlight Kill Cooldown | | - -## EvilLighter - -This role is developed by our team and is quite similar to the original role in TheOtherRolesGM H, which was the [Trickster](#Trickster) -The Evil Lighter will be affected by the lights and can use its lighter to increase its vision. -Once the Evil Lighter uses its lighter, the lights will still go out even if the lights are fixed. -This is quite similar to the Trickster, for the lights cannot be fixed as well. Everyone except for the Impostors will be forced to decrease their visions. -Every Impostor will know that the Evil Lighter has used its skill by receiving a message called "EvilLighterlightouttext". -However, in order to make the Evil Lighter not so invincible, its cooldown will increase by 5 every time it uses its skill. - -## KillerCreator - -Original Idea by [miru-y](https://github.com/miru-y) -This is an Impostor roles that allows for a one-time nomination of "Madmate Killer" from among the Crewmates. -"Madmate Killer" is promoted to Impostor upon the death of "Killer Creator". -*If the "Madmate Killer" becomes a "Madmate Killer", all tasks are treated as completed. -*If the Impostor team wins with the "Killer Creator" still alive, the "Madmate Killer" will not win. -*If the Killer Creator has created a Madmate Killer, the Killer Creator cannot kill. - -| Options | Notes | -| -------------------------------------------------- | ------------------------------------------------------------ | -| Madmate Killer Can Die to Sheriff | | -| Madmate Killer Can Vent | | -| Madmate Killer Knows Impostors when Tasks Finished | The Madmate Killer Knows who the Impostors are when the tasks are completed | -| Madmate Killer Can Fix Comms | | -| Madmate Killer Can Fix Lights | | -| Madmate Killer Has Impostor Vision | | - -## TaskMaster - -Original Idea by [miru-y](https://github.com/miru-y) -Task Master is a Crewmate that has special tasks. -When all the tasks are completed, this player turns into a Task Master. -When all the extra tasks are finished, the Crewmates will win. -Note: The victory won't be triggered if the Task Master is dead. - -## Jailor - -Created by [dabao40](https://github.com/dabao40) -The Jailor is a Crewmate that can put people into the jail. (Only available in Skeld) -The Jail is a special container beside the Cafeteria. -Anyone can revive people from the jail by using the "Jail" button on the left bottom corner. -Once all the Impostors, Neutrals that can kill are put into jail, the Crewmates will win immediately. -The Jailor can put x+1 (x means the amount of evil roles in the game) players in the jail. -Once the Jailor is killed, everyone in the jail commits suicide. -NOTE: Players that are in the Jail cannot speak during meetings or vote or use any of the buttons besides the vent button. They can escape the Jail by venting. -Lovers can still talk in the chat and hosts can still kick players even if they're in the Jail. - -## Sprinter - -The Sprinter is a Crewmate role with the ability to sprint for a short while. -While the Sprinter activates its skill, the Sprinter will turn invisible and that no one except for the dead players and itself will be able to see the Sprinter. -The Sprinter, unlike the Ninja, won't get a speed bonus and cannot be targeted while sprinting. -The Sprinter can deactivate its skill by pressing the button again. - -## Cupid - -Original Idea by [haoming37](https://github.com/haoming37) -The Cupid is a Neutral role that can make two player Lovers. -If one of the Lovers dies, all of them dies. -The Cupid can use his life to protect one of the Lovers. -This means that if a player tries to kill the protected Lovers, the victim himself will not notice, but the Cupid will suicide. - -## Akujo - -Original Idea by [haoming37](https://github.com/haoming37) -The Akujo is a Neutral role that can create a Backup and a True Love. -He will become lovers with the True Love, and it works like a normal Lovers. -If the True Love dies, the Akujo also dies. However, if the Backup dies, nothing will happen to the Akujo. -The Akujo knows the roles of the True Love and the Backup (Optional). - -## Isolator - -This role is created by a member of my group, zcy. -The Isolator can be either an Impostor or a Crewmate depending on the options. -When the Isolator activates its skill, he will turn into a soul but won't leave a body behind. -He cannot move during this time and cannot do its tasks. -However, he will not be affected by the lights and can even use the chat. -NOTE: If the Isolator is a Lovers, the lover won't die if the Isolator uses its skill. -The Isolator will actually die and its body will be shown during the intro part of the meeting shown below "Dead" if it uses its skill and the meeting has started. -
-
Click to show the features of TheOtherRoles GM H @@ -2258,12 +2195,11 @@ For steam users, you have to follow the following steps. # Roles For the functionality of the roles in TheOtherRoles GM IA, please take a look at our [Wiki](https://github.com/dabao40/TheOtherRolesGMIA/wiki) -# Credits & Resources +# The Other Roles GM IA Team ## Developers - [Imp11](https://github.com/dabao40) - [Among us](https://github.com/XiezibanWrite) -- [Sukuna](https://github.com/SaskueUchiwa) ## Artists - [Fangkuai](https://github.com/FangkuaiYa) @@ -2275,6 +2211,8 @@ For the functionality of the roles in TheOtherRoles GM IA, please take a look at - [unhappyset](https://github.com/unhappyset) - [KS](https://github.com/Ks-777) +# Credits & Resources + Firstly, credits to The Other Roles, since this mod is based on their developement. Also credits to The Other Roles GM and The Other Roles GM H, for some of the roles are based on their ideas. OxygenFilter - For the versions v2.3.0 to v2.6.1, we were using the OxygenFilter for automatic deobfuscation diff --git a/Strings.xlsx b/Strings.xlsx index 5855d3b..23bcd61 100644 Binary files a/Strings.xlsx and b/Strings.xlsx differ diff --git a/TheOtherRoles/Buttons.cs b/TheOtherRoles/Buttons.cs index 820d749..f1b3e9d 100644 --- a/TheOtherRoles/Buttons.cs +++ b/TheOtherRoles/Buttons.cs @@ -259,6 +259,7 @@ public static void setCustomButtonCooldowns() { foxImmoralistButton.MaxTimer = 20f; immoralistButton.MaxTimer = 20f; buskerButton.MaxTimer = Busker.cooldown; + jackalAndSidekickSabotageLightsButton.MaxTimer = 0f; operateButton.MaxTimer = 0f; operateButton.Timer = 0f; freePlayReviveButton.MaxTimer = 0f; @@ -326,7 +327,7 @@ private static void addReplacementHandcuffedButton(CustomButton button, Vector3? { Vector3 positionOffsetValue = positionOffset ?? button.PositionOffset; // For non custom buttons, we can set these manually. positionOffsetValue.z = -0.1f; - couldUse = couldUse ?? button.CouldUse; + couldUse ??= button.CouldUse; CustomButton replacementHandcuffedButton = new(() => { }, () => { return true; }, couldUse, () => { }, Deputy.getHandcuffedButtonSprite(), positionOffsetValue, button.hudManager, button.hotkey, true, Deputy.handcuffDuration, () => { }, button.mirror); replacementHandcuffedButton.actionButtonGameObject.ForEachChild((Il2CppSystem.Action)((c) => { if (c.name.Equals("HotKeyGuide")) GameObject.Destroy(c); })); @@ -371,7 +372,7 @@ public static void setAllButtonsHandcuffedStatus(bool handcuffed, bool reset = f // Vent Button if enabled if (CachedPlayer.LocalPlayer.PlayerControl.roleCanUseVents()) addReplacementHandcuffedButton(arsonistButton, CustomButton.ButtonPositions.upperRowCenter, couldUse: () => { return FastDestroyableSingleton.Instance.ImpostorVentButton.currentTarget != null; }); // Report Button - addReplacementHandcuffedButton(arsonistButton, (!CachedPlayer.LocalPlayer.Data.Role.IsImpostor) ? new Vector3(-1f, -0.06f, 0): CustomButton.ButtonPositions.lowerRowRight, () => { return FastDestroyableSingleton.Instance.ReportButton.graphic.color == Palette.EnabledColor; }); + addReplacementHandcuffedButton(arsonistButton, (!CachedPlayer.LocalPlayer.PlayerControl.Data.Role.IsImpostor) ? new Vector3(-1f, -0.06f, 0): CustomButton.ButtonPositions.lowerRowRight, () => { return FastDestroyableSingleton.Instance.ReportButton.graphic.color == Palette.EnabledColor; }); } else if (!handcuffed && deputyHandcuffedButtons.ContainsKey(CachedPlayer.LocalPlayer.PlayerId)) // Reset to original. Disables the replacements, enables the original buttons. { @@ -495,13 +496,13 @@ public static void createButtonsPostfix(HudManager __instance) { } }, - () => { return Engineer.engineer != null && Engineer.engineer == CachedPlayer.LocalPlayer.PlayerControl && Engineer.remainingFixes > 0 && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Engineer.engineer != null && Engineer.engineer == CachedPlayer.LocalPlayer.PlayerControl && Engineer.remainingFixes > 0 && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { if (engineerRepairText != null) engineerRepairText.text = Engineer.remainingFixes.ToString(); bool sabotageActive = false; foreach (PlayerTask task in CachedPlayer.LocalPlayer.PlayerControl.myTasks.GetFastEnumerator()) 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 - || SubmergedCompatibility.IsSubmerged && task.TaskType == SubmergedCompatibility.RetrieveOxygenMask) + || (SubmergedCompatibility.IsSubmerged && task.TaskType == SubmergedCompatibility.RetrieveOxygenMask)) sabotageActive = true; return sabotageActive && Engineer.remainingFixes > 0 && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, @@ -545,7 +546,7 @@ public static void createButtonsPostfix(HudManager __instance) { } } }, - () => { return Janitor.janitor != null && Janitor.janitor == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Janitor.janitor != null && Janitor.janitor == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return __instance.ReportButton.graphic.color == Palette.EnabledColor && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { janitorCleanButton.Timer = janitorCleanButton.MaxTimer; }, Janitor.getButtonSprite(), @@ -590,7 +591,7 @@ public static void createButtonsPostfix(HudManager __instance) { sheriffKillButton.Timer = sheriffKillButton.MaxTimer; Sheriff.currentTarget = null; }, - () => { return Sheriff.sheriff != null && Sheriff.sheriff == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Sheriff.sheriff != null && Sheriff.sheriff == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return Sheriff.currentTarget && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { sheriffKillButton.Timer = sheriffKillButton.MaxTimer;}, __instance.KillButton.graphic.sprite, @@ -618,10 +619,10 @@ public static void createButtonsPostfix(HudManager __instance) { SoundEffectsManager.play("deputyHandcuff"); }, - () => { return (Deputy.deputy != null && Deputy.deputy == CachedPlayer.LocalPlayer.PlayerControl || Sheriff.sheriff != null && Sheriff.sheriff == CachedPlayer.LocalPlayer.PlayerControl && Sheriff.sheriff == Sheriff.formerDeputy && Deputy.keepsHandcuffsOnPromotion) && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return ((Deputy.deputy != null && Deputy.deputy == CachedPlayer.LocalPlayer.PlayerControl) || (Sheriff.sheriff != null && Sheriff.sheriff == CachedPlayer.LocalPlayer.PlayerControl && Sheriff.sheriff == Sheriff.formerDeputy && Deputy.keepsHandcuffsOnPromotion)) && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { if (deputyButtonHandcuffsText != null) deputyButtonHandcuffsText.text = $"{Deputy.remainingHandcuffs}"; - return ((Deputy.deputy != null && Deputy.deputy == CachedPlayer.LocalPlayer.PlayerControl && Deputy.currentTarget || Sheriff.sheriff != null && Sheriff.sheriff == CachedPlayer.LocalPlayer.PlayerControl && Sheriff.sheriff == Sheriff.formerDeputy && Sheriff.currentTarget) && Deputy.remainingHandcuffs > 0 && CachedPlayer.LocalPlayer.PlayerControl.CanMove); + return ((Deputy.deputy != null && Deputy.deputy == CachedPlayer.LocalPlayer.PlayerControl && Deputy.currentTarget) || (Sheriff.sheriff != null && Sheriff.sheriff == CachedPlayer.LocalPlayer.PlayerControl && Sheriff.sheriff == Sheriff.formerDeputy && Sheriff.currentTarget)) && Deputy.remainingHandcuffs > 0 && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { deputyHandcuffButton.Timer = deputyHandcuffButton.MaxTimer; }, Deputy.getButtonSprite(), @@ -639,8 +640,8 @@ public static void createButtonsPostfix(HudManager __instance) { ShipStatus.Instance.RpcUpdateSystem(SystemTypes.Sabotage, (byte)SystemTypes.Electrical); }, () => { - return (Jackal.jackal != null && Jackal.jackal == CachedPlayer.LocalPlayer.PlayerControl && Jackal.canSabotageLights || - Sidekick.sidekick != null && Sidekick.sidekick == CachedPlayer.LocalPlayer.PlayerControl && Sidekick.canSabotageLights) && !CachedPlayer.LocalPlayer.Data.IsDead + return ((Jackal.jackal != null && Jackal.jackal == CachedPlayer.LocalPlayer.PlayerControl && Jackal.canSabotageLights) || + (Sidekick.sidekick != null && Sidekick.sidekick == CachedPlayer.LocalPlayer.PlayerControl && Sidekick.canSabotageLights)) && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && (!Helpers.isFungle() || CustomOptionHolder.fungleElectrical.getBool()); }, () => { @@ -666,7 +667,7 @@ public static void createButtonsPostfix(HudManager __instance) { RPCProcedure.timeMasterShield(); SoundEffectsManager.play("timemasterShield"); }, - () => { return TimeMaster.timeMaster != null && TimeMaster.timeMaster == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return TimeMaster.timeMaster != null && TimeMaster.timeMaster == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { timeMasterShieldButton.Timer = timeMasterShieldButton.MaxTimer; @@ -707,7 +708,7 @@ public static void createButtonsPostfix(HudManager __instance) { SoundEffectsManager.play("medicShield"); }, - () => { return Medic.medic != null && Medic.medic == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Medic.medic != null && Medic.medic == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return !Medic.usedShield && Medic.currentTarget && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => {}, Medic.getButtonSprite(), @@ -734,7 +735,7 @@ public static void createButtonsPostfix(HudManager __instance) { RPCProcedure.setFutureShifted(Shifter.currentTarget.PlayerId); SoundEffectsManager.play("shifterShift"); }, - () => { return Shifter.shifter != null && Shifter.shifter == CachedPlayer.LocalPlayer.PlayerControl && Shifter.futureShift == null && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Shifter.shifter != null && Shifter.shifter == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return Shifter.currentTarget && Shifter.futureShift == null && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { }, Shifter.getButtonSprite(), @@ -779,7 +780,7 @@ public static void createButtonsPostfix(HudManager __instance) { setButtonTargetDisplay(Morphling.sampledTarget, morphlingButton); } }, - () => { return Morphling.morphling != null && Morphling.morphling == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Morphling.morphling != null && Morphling.morphling == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return (Morphling.currentTarget || Morphling.sampledTarget) && CachedPlayer.LocalPlayer.PlayerControl.CanMove && !Helpers.MushroomSabotageActive(); }, () => { morphlingButton.Timer = morphlingButton.MaxTimer; @@ -821,7 +822,7 @@ public static void createButtonsPostfix(HudManager __instance) { RPCProcedure.camouflagerCamouflage(); SoundEffectsManager.play("morphlingMorph"); }, - () => { return Camouflager.camouflager != null && Camouflager.camouflager == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Camouflager.camouflager != null && Camouflager.camouflager == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { camouflagerButton.Timer = camouflagerButton.MaxTimer; @@ -847,7 +848,7 @@ public static void createButtonsPostfix(HudManager __instance) { Hacker.hackerTimer = Hacker.duration; SoundEffectsManager.play("hackerHack"); }, - () => { return Hacker.hacker != null && Hacker.hacker == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Hacker.hacker != null && Hacker.hacker == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return true; }, () => { hackerButton.Timer = hackerButton.MaxTimer; @@ -877,7 +878,7 @@ public static void createButtonsPostfix(HudManager __instance) { CachedPlayer.LocalPlayer.NetTransform.Halt(); // Stop current movement Hacker.chargesAdminTable--; }, - () => { return Hacker.hacker != null && Hacker.hacker == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead;}, + () => { return Hacker.hacker != null && Hacker.hacker == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead;}, () => { if (hackerAdminTableChargesText != null) hackerAdminTableChargesText.text = $"{Hacker.chargesAdminTable} / {Hacker.toolsNumber}"; return Hacker.chargesAdminTable > 0; @@ -939,7 +940,7 @@ public static void createButtonsPostfix(HudManager __instance) { Hacker.chargesVitals--; }, - () => { return Hacker.hacker != null && Hacker.hacker == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead && GameOptionsManager.Instance.currentGameOptions.MapId != 0 && GameOptionsManager.Instance.currentNormalGameOptions.MapId != 3; }, + () => { return Hacker.hacker != null && Hacker.hacker == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && GameOptionsManager.Instance.currentGameOptions.MapId != 0 && GameOptionsManager.Instance.currentNormalGameOptions.MapId != 3; }, () => { if (hackerVitalsChargesText != null) hackerVitalsChargesText.text = $"{Hacker.chargesVitals} / {Hacker.toolsNumber}"; hackerVitalsButton.actionButton.graphic.sprite = Helpers.isMira() ? Hacker.getLogSprite() : Hacker.getVitalsSprite(); @@ -996,7 +997,7 @@ public static void createButtonsPostfix(HudManager __instance) { RPCProcedure.trackerUsedTracker(Tracker.currentTarget.PlayerId); SoundEffectsManager.play("trackerTrackPlayer"); }, - () => { return Tracker.tracker != null && Tracker.tracker == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Tracker.tracker != null && Tracker.tracker == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return CachedPlayer.LocalPlayer.PlayerControl.CanMove && Tracker.currentTarget != null && !Tracker.usedTracker; }, () => { if(Tracker.resetTargetAfterMeeting) Tracker.resetTracked(); }, Tracker.getButtonSprite(), @@ -1010,7 +1011,7 @@ public static void createButtonsPostfix(HudManager __instance) { trackerTrackCorpsesButton = new CustomButton( () => { Tracker.corpsesTrackingTimer = Tracker.corpsesTrackingDuration; SoundEffectsManager.play("trackerTrackCorpses"); }, - () => { return Tracker.tracker != null && Tracker.tracker == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead && Tracker.canTrackCorpses; }, + () => { return Tracker.tracker != null && Tracker.tracker == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && Tracker.canTrackCorpses; }, () => { return CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { trackerTrackCorpsesButton.Timer = trackerTrackCorpsesButton.MaxTimer; @@ -1097,7 +1098,7 @@ public static void createButtonsPostfix(HudManager __instance) { vampireKillButton.HasEffect = false; } }, - () => { return Vampire.vampire != null && Vampire.vampire == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Vampire.vampire != null && Vampire.vampire == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { if (Vampire.targetNearGarlic && Vampire.canKillNearGarlics) { vampireKillButton.actionButton.graphic.sprite = __instance.KillButton.graphic.sprite; @@ -1144,7 +1145,7 @@ public static void createButtonsPostfix(HudManager __instance) { RPCProcedure.placeGarlic(buff); SoundEffectsManager.play("garlic"); }, - () => { return !Vampire.localPlacedGarlic && !CachedPlayer.LocalPlayer.Data.IsDead && Vampire.garlicsActive && !HideNSeek.isHideNSeekGM; }, + () => { return !Vampire.localPlacedGarlic && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && Vampire.garlicsActive && !HideNSeek.isHideNSeekGM; }, () => { return CachedPlayer.LocalPlayer.PlayerControl.CanMove && !Vampire.localPlacedGarlic; }, () => { }, Vampire.getGarlicButtonSprite(), @@ -1171,7 +1172,7 @@ public static void createButtonsPostfix(HudManager __instance) { RPCProcedure.placePortal(buff); SoundEffectsManager.play("tricksterPlaceBox"); }, - () => { return Portalmaker.portalmaker != null && Portalmaker.portalmaker == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead && Portal.secondPortal == null; }, + () => { return Portalmaker.portalmaker != null && Portalmaker.portalmaker == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && Portal.secondPortal == null; }, () => { if (portalmakerButtonNumText != null) portalmakerButtonNumText.text = $"{(Portal.firstPortal == null ? 2 : 1)}"; @@ -1202,7 +1203,7 @@ public static void createButtonsPostfix(HudManager __instance) { CachedPlayer.LocalPlayer.NetTransform.RpcSnapTo(entry); - if (!CachedPlayer.LocalPlayer.Data.IsDead) { // Ghosts can portal too, but non-blocking and only with a local animation + if (!CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead) { // Ghosts can portal too, but non-blocking and only with a local animation MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.UsePortal, Hazel.SendOption.Reliable, -1); writer.Write((byte)CachedPlayer.LocalPlayer.PlayerId); writer.Write(portalMakerSoloTeleport ? (byte)1 : (byte)0); @@ -1231,7 +1232,7 @@ public static void createButtonsPostfix(HudManager __instance) { if (CachedPlayer.LocalPlayer.PlayerControl == Portalmaker.portalmaker && Portal.bothPlacedAndEnabled) portalmakerButtonText1.text = Portal.locationNearEntry(CachedPlayer.LocalPlayer.transform.position) || !Portalmaker.canPortalFromAnywhere ? "" : "1. " + Portal.firstPortal.room; return Portal.bothPlacedAndEnabled; }, - () => { return CachedPlayer.LocalPlayer.PlayerControl.CanMove && (Portal.locationNearEntry(CachedPlayer.LocalPlayer.transform.position) || Portalmaker.canPortalFromAnywhere && CachedPlayer.LocalPlayer.PlayerControl == Portalmaker.portalmaker) && !Portal.isTeleporting; }, + () => { return CachedPlayer.LocalPlayer.PlayerControl.CanMove && (Portal.locationNearEntry(CachedPlayer.LocalPlayer.transform.position) || (Portalmaker.canPortalFromAnywhere && CachedPlayer.LocalPlayer.PlayerControl == Portalmaker.portalmaker)) && !Portal.isTeleporting; }, () => { usePortalButton.Timer = usePortalButton.MaxTimer; }, Portalmaker.getUsePortalButtonSprite(), new Vector3(0.9f, -0.06f, 0), @@ -1249,7 +1250,7 @@ public static void createButtonsPostfix(HudManager __instance) { bool didTeleport = false; Vector3 exit = Portal.secondPortal.portalGameObject.transform.position; - if (!CachedPlayer.LocalPlayer.Data.IsDead) { // Ghosts can portal too, but non-blocking and only with a local animation + if (!CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead) { // Ghosts can portal too, but non-blocking and only with a local animation MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.UsePortal, Hazel.SendOption.Reliable, -1); writer.Write((byte)CachedPlayer.LocalPlayer.PlayerId); writer.Write((byte)2); @@ -1316,7 +1317,7 @@ public static void createButtonsPostfix(HudManager __instance) { RPCProcedure.jackalCreatesSidekick(Jackal.currentTarget.PlayerId); SoundEffectsManager.play("jackalSidekick"); }, - () => { return Jackal.canCreateSidekick && Jackal.jackal != null && Jackal.jackal == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Jackal.canCreateSidekick && Jackal.jackal != null && Jackal.jackal == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return Jackal.canCreateSidekick && Jackal.currentTarget != null && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { jackalSidekickButton.Timer = jackalSidekickButton.MaxTimer;}, Jackal.getSidekickButtonSprite(), @@ -1334,7 +1335,7 @@ public static void createButtonsPostfix(HudManager __instance) { jackalKillButton.Timer = jackalKillButton.MaxTimer; Jackal.currentTarget = null; }, - () => { return Jackal.jackal != null && Jackal.jackal == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Jackal.jackal != null && Jackal.jackal == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return Jackal.currentTarget && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { jackalKillButton.Timer = jackalKillButton.MaxTimer;}, __instance.KillButton.graphic.sprite, @@ -1404,11 +1405,11 @@ public static void createButtonsPostfix(HudManager __instance) { AmongUsClient.Instance.FinishRpcImmediately(killWriter); RPCProcedure.serialKillerSuicide(targetId); }, + buttonText: ModTranslation.getString("serialKillerSuicideText"), + isSuicide: true, abilityTexture: CustomButton.ButtonLabelType.UseButton ) { - showButtonText = true, - buttonText = ModTranslation.getString("serialKillerSuicideText"), isEffectActive = true }; ButtonEffect.SetMouseActionIcon(jekyllAndHydeSuicideButton.actionButtonGameObject, true, ModTranslation.getString("buttonsNormalSuicide"), false, ButtonEffect.ActionIconType.InfoAction); @@ -1417,6 +1418,7 @@ public static void createButtonsPostfix(HudManager __instance) { // OnClick () => { + _ = new StaticAchievementToken("jekyllAndHyde.common1"); JekyllAndHyde.oddIsJekyll = !JekyllAndHyde.oddIsJekyll; MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.SetOddIsJekyll, Hazel.SendOption.Reliable, -1); writer.Write(JekyllAndHyde.oddIsJekyll); @@ -1522,6 +1524,7 @@ public static void createButtonsPostfix(HudManager __instance) { AmongUsClient.Instance.FinishRpcImmediately(writer); RPCProcedure.plagueDoctorInfected(targetId); PlagueDoctor.numInfections--; + _ = new StaticAchievementToken("plagueDoctor.common1"); plagueDoctorButton.Timer = plagueDoctorButton.MaxTimer; PlagueDoctor.currentTarget = null; @@ -1640,8 +1643,8 @@ public static void createButtonsPostfix(HudManager __instance) { SoundEffectsManager.play("blackmailerSilence"); } }, - () => { return Blackmailer.blackmailer != null && Blackmailer.blackmailer == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, - () => { return (Blackmailer.currentTarget != null && CachedPlayer.LocalPlayer.PlayerControl.CanMove); }, + () => { return Blackmailer.blackmailer != null && Blackmailer.blackmailer == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, + () => { return Blackmailer.currentTarget != null && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { Blackmailer.acTokenChallenge.Value.witness = new(); @@ -1661,7 +1664,7 @@ public static void createButtonsPostfix(HudManager __instance) { sidekickKillButton.Timer = sidekickKillButton.MaxTimer; Sidekick.currentTarget = null; }, - () => { return Sidekick.canKill && Sidekick.sidekick != null && Sidekick.sidekick == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Sidekick.canKill && Sidekick.sidekick != null && Sidekick.sidekick == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return Sidekick.currentTarget && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { sidekickKillButton.Timer = sidekickKillButton.MaxTimer;}, __instance.KillButton.graphic.sprite, @@ -1692,7 +1695,7 @@ public static void createButtonsPostfix(HudManager __instance) { RPCProcedure.setFutureErased(Eraser.currentTarget.PlayerId); SoundEffectsManager.play("eraserErase"); }, - () => { return Eraser.eraser != null && Eraser.eraser == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Eraser.eraser != null && Eraser.eraser == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return CachedPlayer.LocalPlayer.PlayerControl.CanMove && Eraser.currentTarget != null; }, () => { eraserButton.Timer = eraserButton.MaxTimer;}, Eraser.getButtonSprite(), @@ -1739,7 +1742,7 @@ public static void createButtonsPostfix(HudManager __instance) { Helpers.checkMurderAttemptAndKill(Veteran.veteran, Moriarty.moriarty); return; } - + _ = new StaticAchievementToken("moriarty.common1"); MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SetBrainwash, Hazel.SendOption.Reliable, -1); writer.Write(Moriarty.currentTarget.PlayerId); AmongUsClient.Instance.FinishRpcImmediately(writer); @@ -1856,7 +1859,7 @@ public static void createButtonsPostfix(HudManager __instance) { RPCProcedure.placeJackInTheBox(buff); SoundEffectsManager.play("tricksterPlaceBox"); }, - () => { return Trickster.trickster != null && Trickster.trickster == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead && !JackInTheBox.hasJackInTheBoxLimitReached(); }, + () => { return Trickster.trickster != null && Trickster.trickster == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && !JackInTheBox.hasJackInTheBoxLimitReached(); }, () => { if (tricksterBoxesText != null) tricksterBoxesText.text = (JackInTheBox.JackInTheBoxLimit - JackInTheBox.AllJackInTheBoxes.Count).ToString(); @@ -1879,7 +1882,7 @@ public static void createButtonsPostfix(HudManager __instance) { RPCProcedure.lightsOut(); SoundEffectsManager.play("lighterLight"); }, - () => { return Trickster.trickster != null && Trickster.trickster == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead && JackInTheBox.hasJackInTheBoxLimitReached() && JackInTheBox.boxesConvertedToVents; }, + () => { return Trickster.trickster != null && Trickster.trickster == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && JackInTheBox.hasJackInTheBoxLimitReached() && JackInTheBox.boxesConvertedToVents; }, () => { return CachedPlayer.LocalPlayer.PlayerControl.CanMove && JackInTheBox.hasJackInTheBoxLimitReached() && JackInTheBox.boxesConvertedToVents; }, () => { lightsOutButton.Timer = lightsOutButton.MaxTimer; @@ -1933,7 +1936,7 @@ public static void createButtonsPostfix(HudManager __instance) { } } }, - () => { return Cleaner.cleaner != null && Cleaner.cleaner == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Cleaner.cleaner != null && Cleaner.cleaner == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return __instance.ReportButton.graphic.color == Palette.EnabledColor && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { cleanerCleanButton.Timer = cleanerCleanButton.MaxTimer; }, Cleaner.getButtonSprite(), @@ -2005,7 +2008,7 @@ public static void createButtonsPostfix(HudManager __instance) { } }, - () => { return Warlock.warlock != null && Warlock.warlock == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Warlock.warlock != null && Warlock.warlock == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return ((Warlock.curseVictim == null && Warlock.currentTarget != null) || (Warlock.curseVictim != null && Warlock.curseVictimTarget != null)) && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { warlockCurseButton.Timer = warlockCurseButton.MaxTimer; @@ -2050,7 +2053,7 @@ public static void createButtonsPostfix(HudManager __instance) { SoundEffectsManager.play("securityGuardPlaceCam"); // Same sound used for both types (cam or vent)! securityGuardButton.Timer = securityGuardButton.MaxTimer; }, - () => { return SecurityGuard.securityGuard != null && SecurityGuard.securityGuard == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead && SecurityGuard.remainingScrews >= Mathf.Min(SecurityGuard.ventPrice, SecurityGuard.camPrice); }, + () => { return SecurityGuard.securityGuard != null && SecurityGuard.securityGuard == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && SecurityGuard.remainingScrews >= Mathf.Min(SecurityGuard.ventPrice, SecurityGuard.camPrice); }, () => { securityGuardButton.actionButton.graphic.sprite = (SecurityGuard.ventTarget == null && !Helpers.isMira() && !Helpers.isFungle() && GameOptionsManager.Instance.currentNormalGameOptions.MapId != 1 && !SubmergedCompatibility.IsSubmerged) ? SecurityGuard.getPlaceCameraButtonSprite() : SecurityGuard.getCloseVentButtonSprite(); if (SecurityGuard.ventTarget == null && !Helpers.isMira() && !Helpers.isFungle() && GameOptionsManager.Instance.currentNormalGameOptions.MapId != 1 && !SubmergedCompatibility.IsSubmerged) @@ -2117,7 +2120,7 @@ public static void createButtonsPostfix(HudManager __instance) { if (SecurityGuard.cantMove) CachedPlayer.LocalPlayer.PlayerControl.moveable = false; CachedPlayer.LocalPlayer.NetTransform.Halt(); // Stop current movement }, - () => { return SecurityGuard.securityGuard != null && SecurityGuard.securityGuard == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead && SecurityGuard.remainingScrews < Mathf.Min(SecurityGuard.ventPrice, SecurityGuard.camPrice) + () => { return SecurityGuard.securityGuard != null && SecurityGuard.securityGuard == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && SecurityGuard.remainingScrews < Mathf.Min(SecurityGuard.ventPrice, SecurityGuard.camPrice) && !SubmergedCompatibility.IsSubmerged; }, () => { if (securityGuardChargesText != null) securityGuardChargesText.text = $"{SecurityGuard.charges} / {SecurityGuard.maxCharges}"; @@ -2183,7 +2186,7 @@ public static void createButtonsPostfix(HudManager __instance) { SoundEffectsManager.play("arsonistDouse"); } }, - () => { return Arsonist.arsonist != null && Arsonist.arsonist == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Arsonist.arsonist != null && Arsonist.arsonist == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { bool dousedEveryoneAlive = Arsonist.dousedEveryoneAlive(); if (dousedEveryoneAlive) @@ -2246,7 +2249,7 @@ public static void createButtonsPostfix(HudManager __instance) { Veteran.remainingAlerts--; SoundEffectsManager.play("veteranAlert"); }, - () => { return Veteran.veteran != null && Veteran.veteran == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Veteran.veteran != null && Veteran.veteran == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { if (veteranButtonAlertText != null) veteranButtonAlertText.text = $"{Veteran.remainingAlerts}"; return CachedPlayer.LocalPlayer.PlayerControl.CanMove && Veteran.remainingAlerts > 0; @@ -2577,7 +2580,7 @@ public static void createButtonsPostfix(HudManager __instance) { { return Undertaker.undertaker != null && Undertaker.undertaker == CachedPlayer.LocalPlayer.PlayerControl && - !CachedPlayer.LocalPlayer.Data.IsDead; + !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, // Bool HasButton () => { @@ -2756,7 +2759,7 @@ public static void createButtonsPostfix(HudManager __instance) { string killerTeam = RoleInfo.GetRolesString(killer, useColors: true, showModifier: false, includeHidden: true); newPopUp.gameObject.transform.GetChild(0).GetComponent().enabled = false; newPopUp.gameObject.transform.GetChild(0).GetComponent().text = string.Format(ModTranslation.getString("sherlockMessage2"), killerTeam); - newPopUp.gameObject.transform.position += (count % 4) * new Vector3(0, -1.2f, 0) + new Vector3(3f - (int)(count / 4) * 3.8f, -0.25f, __instance.MapButton.transform.localPosition.z - 600f); + newPopUp.gameObject.transform.position += count % 4 * new Vector3(0, -1.2f, 0) + new Vector3(3f - (int)(count / 4) * 3.8f, -0.25f, __instance.MapButton.transform.localPosition.z - 600f); newPopUp.ModShow(target, 0); count++; msg += $"{string.Format(ModTranslation.getString("sherlockMeeting"), target?.Data?.PlayerName, killerTeam)}\n"; @@ -2859,7 +2862,8 @@ public static void createButtonsPostfix(HudManager __instance) { } } if (Cupid.lovers1 != null && Cupid.lovers2 != null) - { + { + _ = new StaticAchievementToken("cupid.common1"); MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.SetCupidLovers, Hazel.SendOption.Reliable, -1); writer.Write(Cupid.lovers1.PlayerId); writer.Write(Cupid.lovers2.PlayerId); @@ -2924,7 +2928,7 @@ public static void createButtonsPostfix(HudManager __instance) { Helpers.checkMurderAttemptAndKill(Veteran.veteran, Akujo.akujo); return; } - + _ = new StaticAchievementToken("akujo.common2"); MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.AkujoSetHonmei, Hazel.SendOption.Reliable, -1); writer.Write(Akujo.akujo.PlayerId); writer.Write(Akujo.currentTarget.PlayerId); @@ -2962,7 +2966,7 @@ public static void createButtonsPostfix(HudManager __instance) { Helpers.checkMurderAttemptAndKill(Veteran.veteran, Akujo.akujo); return; } - + _ = new StaticAchievementToken("akujo.common1"); MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.AkujoSetKeep, Hazel.SendOption.Reliable, -1); writer.Write(Akujo.akujo.PlayerId); writer.Write(Akujo.currentTarget.PlayerId); @@ -3128,6 +3132,7 @@ public static void createButtonsPostfix(HudManager __instance) { if (murderAttemptResult == MurderAttemptResult.PerformKill) { + _ = new StaticAchievementToken("kataomoi.challenge"); byte targetId = Kataomoi.currentTarget.PlayerId; MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.UncheckedMurderPlayer, Hazel.SendOption.Reliable, -1); killWriter.Write(Kataomoi.kataomoi.Data.PlayerId); @@ -3172,6 +3177,7 @@ public static void createButtonsPostfix(HudManager __instance) { true, Kataomoi.stareDuration, () => { + _ = new StaticAchievementToken("kataomoi.common1"); Kataomoi.doStare(); kataomoiButton.Timer = Kataomoi.canLove() ? 0 : kataomoiButton.MaxTimer; }, @@ -3371,6 +3377,7 @@ public static void createButtonsPostfix(HudManager __instance) { Helpers.checkMurderAttemptAndKill(Veteran.veteran, Fox.fox); return; } + _ = new StaticAchievementToken("fox.common1"); MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.FoxCreatesImmoralist, Hazel.SendOption.Reliable, -1); writer.Write(Fox.currentTarget.PlayerId); AmongUsClient.Instance.FinishRpcImmediately(writer); @@ -3390,6 +3397,7 @@ public static void createButtonsPostfix(HudManager __instance) { immoralistButton = new CustomButton( () => { + _ = new StaticAchievementToken("immoralist.challenge"); byte targetId = CachedPlayer.LocalPlayer.PlayerControl.PlayerId; MessageWriter killWriter = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.SerialKillerSuicide, Hazel.SendOption.Reliable, -1); killWriter.Write(targetId); AmongUsClient.Instance.FinishRpcImmediately(killWriter); @@ -3438,14 +3446,12 @@ public static void createButtonsPostfix(HudManager __instance) { killWriter.Write(targetId); AmongUsClient.Instance.FinishRpcImmediately(killWriter); RPCProcedure.serialKillerSuicide(targetId); - }, + }, + buttonText: ModTranslation.getString("serialKillerSuicideText"), + isSuicide: true, abilityTexture: CustomButton.ButtonLabelType.UseButton ) { - //UnityEngine.Object.Destroy(serialKillerButton.actionButton.buttonLabelText); - //serialKillerButton.actionButton.buttonLabelText = UnityEngine.Object.Instantiate(__instance.AbilityButton.buttonLabelText, serialKillerButton.actionButton.transform); - showButtonText = true, - buttonText = ModTranslation.getString("serialKillerSuicideText"), isEffectActive = true }; ButtonEffect.SetMouseActionIcon(serialKillerButton.actionButtonGameObject, true, ModTranslation.getString("buttonsNormalSuicide"), false, ButtonEffect.ActionIconType.InfoAction); @@ -3503,7 +3509,7 @@ public static void createButtonsPostfix(HudManager __instance) { } } }, - () => { return Vulture.vulture != null && Vulture.vulture == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Vulture.vulture != null && Vulture.vulture == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { if (vultureRemainingText != null) vultureRemainingText.text = (Vulture.vultureNumberToWin - Vulture.eatenBodies).ToString(); @@ -3564,7 +3570,7 @@ public static void createButtonsPostfix(HudManager __instance) { SoundEffectsManager.play("mediumAsk"); } }, - () => { return Medium.medium != null && Medium.medium == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Medium.medium != null && Medium.medium == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { if (mediumButton.isEffectActive && Medium.target != Medium.soulTarget) { Medium.soulTarget = null; @@ -3838,7 +3844,7 @@ Func fortuneTellerCouldUse(byte index) } }, - () => { return Pursuer.pursuer != null && Pursuer.pursuer == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead && Pursuer.blanks < Pursuer.blanksNumber; }, + () => { return Pursuer.pursuer != null && Pursuer.pursuer == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && Pursuer.blanks < Pursuer.blanksNumber; }, () => { if (pursuerButtonBlanksText != null) pursuerButtonBlanksText.text = $"{Pursuer.blanksNumber - Pursuer.blanks}"; @@ -3870,7 +3876,7 @@ Func fortuneTellerCouldUse(byte index) SoundEffectsManager.play("witchSpell"); } }, - () => { return Witch.witch != null && Witch.witch == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Witch.witch != null && Witch.witch == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { if (witchSpellButton.isEffectActive && Witch.spellCastingTarget != Witch.currentTarget) { Witch.spellCastingTarget = null; @@ -3901,7 +3907,7 @@ Func fortuneTellerCouldUse(byte index) AmongUsClient.Instance.FinishRpcImmediately(writer); RPCProcedure.setFutureSpelled(Witch.currentTarget.PlayerId); } - if (attempt == MurderAttemptResult.BlankKill || attempt == MurderAttemptResult.PerformKill) { + if (attempt is MurderAttemptResult.BlankKill or MurderAttemptResult.PerformKill) { Witch.currentCooldownAddition += Witch.cooldownAddition; witchSpellButton.MaxTimer = Witch.cooldown + Witch.currentCooldownAddition; Patches.PlayerControlFixedUpdatePatch.miniCooldownUpdate(); // Modifies the MaxTimer if the witch is the mini @@ -4039,7 +4045,7 @@ Func fortuneTellerCouldUse(byte index) RPCProcedure.placeAssassinTrace(buff); } - if (attempt == MurderAttemptResult.BlankKill || attempt == MurderAttemptResult.PerformKill) { + if (attempt is MurderAttemptResult.BlankKill or MurderAttemptResult.PerformKill) { assassinButton.Timer = assassinButton.MaxTimer; Assassin.assassin.killTimer = GameOptionsManager.Instance.currentNormalGameOptions.KillCooldown; } else if (attempt == MurderAttemptResult.SuppressKill) { @@ -4066,10 +4072,10 @@ Func fortuneTellerCouldUse(byte index) AmongUsClient.Instance.FinishRpcImmediately(writer); } }, - () => { return Assassin.assassin != null && Assassin.assassin == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Assassin.assassin != null && Assassin.assassin == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { // CouldUse assassinButton.Sprite = Assassin.assassinMarked != null ? Assassin.getKillButtonSprite() : Assassin.getMarkButtonSprite(); - return (Assassin.currentTarget != null || Assassin.assassinMarked != null && !TransportationToolPatches.isUsingTransportation(Assassin.assassinMarked)) && CachedPlayer.LocalPlayer.PlayerControl.CanMove; + return (Assassin.currentTarget != null || (Assassin.assassinMarked != null && !TransportationToolPatches.isUsingTransportation(Assassin.assassinMarked))) && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { // on meeting ends assassinButton.Timer = assassinButton.MaxTimer; @@ -4100,13 +4106,13 @@ Func fortuneTellerCouldUse(byte index) AmongUsClient.Instance.FinishRpcImmediately(writer); mayorMeetingButton.Timer = 1f; }, - () => { return Mayor.mayor != null && Mayor.mayor == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead && Mayor.meetingButton; }, + () => { return Mayor.mayor != null && Mayor.mayor == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && Mayor.meetingButton; }, () => { mayorMeetingButton.actionButton.OverrideText(ModTranslation.getString("mayorEmergencyLeftText") + " (" + Mayor.remoteMeetingsLeft + ")"); bool sabotageActive = false; foreach (PlayerTask task in CachedPlayer.LocalPlayer.PlayerControl.myTasks.GetFastEnumerator()) 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 - || SubmergedCompatibility.IsSubmerged && task.TaskType == SubmergedCompatibility.RetrieveOxygenMask) + || (SubmergedCompatibility.IsSubmerged && task.TaskType == SubmergedCompatibility.RetrieveOxygenMask)) sabotageActive = true; return !sabotageActive && CachedPlayer.LocalPlayer.PlayerControl.CanMove && (Mayor.remoteMeetingsLeft > 0); }, @@ -4140,7 +4146,7 @@ Func fortuneTellerCouldUse(byte index) SoundEffectsManager.play("trapperTrap"); trapperButton.Timer = trapperButton.MaxTimer; }, - () => { return Trapper.trapper != null && Trapper.trapper == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Trapper.trapper != null && Trapper.trapper == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { if (trapperChargesText != null) trapperChargesText.text = $"{Trapper.charges} / {Trapper.maxCharges}"; return CachedPlayer.LocalPlayer.PlayerControl.CanMove && Trapper.charges > 0; @@ -4172,7 +4178,7 @@ Func fortuneTellerCouldUse(byte index) bomberButton.Timer = bomberButton.MaxTimer; Bomber.isPlanted = true; }, - () => { return Bomber.bomber != null && Bomber.bomber == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Bomber.bomber != null && Bomber.bomber == CachedPlayer.LocalPlayer.PlayerControl && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return CachedPlayer.LocalPlayer.PlayerControl.CanMove && !Bomber.isPlanted; }, () => { bomberButton.Timer = bomberButton.MaxTimer; }, Bomber.getButtonSprite(), @@ -4197,7 +4203,7 @@ Func fortuneTellerCouldUse(byte index) defuseButton.PositionOffset = new Vector3(0f, 2f, 0f); else defuseButton.PositionOffset = new Vector3(0f, 1f, 0f); - return Bomber.bomb != null && Bomb.canDefuse && !CachedPlayer.LocalPlayer.Data.IsDead; }, + return Bomber.bomb != null && Bomb.canDefuse && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { if (defuseButton.isEffectActive && !Bomb.canDefuse) { defuseButton.Timer = 0f; @@ -4335,7 +4341,7 @@ Func fortuneTellerCouldUse(byte index) RPCProcedure.uncheckedMurderPlayer(thief.PlayerId, target.PlayerId, byte.MaxValue); } }, - () => { return Thief.thief != null && CachedPlayer.LocalPlayer.PlayerControl == Thief.thief && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return Thief.thief != null && CachedPlayer.LocalPlayer.PlayerControl == Thief.thief && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return Thief.currentTarget != null && CachedPlayer.LocalPlayer.PlayerControl.CanMove; }, () => { thiefKillButton.Timer = thiefKillButton.MaxTimer; }, __instance.KillButton.graphic.sprite, @@ -4359,8 +4365,8 @@ Func fortuneTellerCouldUse(byte index) }, () => { - if (CachedPlayer.LocalPlayer.PlayerControl == null || !CachedPlayer.LocalPlayer.Data.IsDead || CachedPlayer.LocalPlayer.Data.Role.IsImpostor || (CachedPlayer.LocalPlayer.PlayerControl == Busker.busker && Busker.pseudocideFlag)) return false; - var (playerCompleted, playerTotal) = TasksHandler.taskInfo(CachedPlayer.LocalPlayer.Data); + if (CachedPlayer.LocalPlayer.PlayerControl == null || !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead || CachedPlayer.LocalPlayer.PlayerControl.Data.Role.IsImpostor || (CachedPlayer.LocalPlayer.PlayerControl == Busker.busker && Busker.pseudocideFlag)) return false; + var (playerCompleted, playerTotal) = TasksHandler.taskInfo(CachedPlayer.LocalPlayer.PlayerControl.Data); int numberOfLeftTasks = playerTotal - playerCompleted; return numberOfLeftTasks <= 0 || !CustomOptionHolder.finishTasksBeforeHauntingOrZoomingOut.getBool(); }, @@ -4386,7 +4392,7 @@ Func fortuneTellerCouldUse(byte index) AmongUsClient.Instance.FinishRpcImmediately(writer); RPCProcedure.shareTimer(Hunter.lightPunish); }, - () => { return HideNSeek.isHunter() && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return HideNSeek.isHunter() && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return true; }, () => { hunterLighterButton.Timer = 30f; @@ -4423,7 +4429,7 @@ Func fortuneTellerCouldUse(byte index) AmongUsClient.Instance.FinishRpcImmediately(writer); RPCProcedure.shareTimer(Hunter.AdminPunish); }, - () => { return HideNSeek.isHunter() && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return HideNSeek.isHunter() && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return true; }, () => { hunterAdminTableButton.Timer = hunterAdminTableButton.MaxTimer; @@ -4455,7 +4461,7 @@ Func fortuneTellerCouldUse(byte index) AmongUsClient.Instance.FinishRpcImmediately(writer); RPCProcedure.shareTimer(Hunter.ArrowPunish); }, - () => { return HideNSeek.isHunter() && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return HideNSeek.isHunter() && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { return true; }, () => { hunterArrowButton.Timer = 30f; @@ -4487,7 +4493,7 @@ Func fortuneTellerCouldUse(byte index) Hunted.shieldCount--; }, - () => { return HideNSeek.isHunted() && !CachedPlayer.LocalPlayer.Data.IsDead; }, + () => { return HideNSeek.isHunted() && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; }, () => { if (huntedShieldCountText != null) huntedShieldCountText.text = $"{Hunted.shieldCount}"; return CachedPlayer.LocalPlayer.PlayerControl.CanMove && Hunted.shieldCount > 0; diff --git a/TheOtherRoles/CustomGameModes/HideNSeekGM.cs b/TheOtherRoles/CustomGameModes/HideNSeekGM.cs index 109f636..780c373 100644 --- a/TheOtherRoles/CustomGameModes/HideNSeekGM.cs +++ b/TheOtherRoles/CustomGameModes/HideNSeekGM.cs @@ -22,17 +22,17 @@ public static class HideNSeek { // HideNSeek Gamemode public static float killCooldown = 10f; public static float hunterWaitingTime = 15f; public static bool isHunter() { - return isHideNSeekGM && CachedPlayer.LocalPlayer != null && CachedPlayer.LocalPlayer.Data.Role.IsImpostor; + return isHideNSeekGM && CachedPlayer.LocalPlayer != null && CachedPlayer.LocalPlayer.PlayerControl.Data.Role.IsImpostor; } public static List getHunters() { List hunters = new(CachedPlayer.AllPlayers); - hunters.RemoveAll(x => !x.Data.Role.IsImpostor); + hunters.RemoveAll(x => !x.PlayerControl.Data.Role.IsImpostor); return hunters; } public static bool isHunted() { - return isHideNSeekGM && CachedPlayer.LocalPlayer != null && !CachedPlayer.LocalPlayer.Data.Role.IsImpostor; + return isHideNSeekGM && CachedPlayer.LocalPlayer != null && !CachedPlayer.LocalPlayer.PlayerControl.Data.Role.IsImpostor; } public static void clearAndReload() { @@ -135,4 +135,4 @@ public static void clearAndReload() { shieldRewindTime = CustomOptionHolder.huntedShieldRewindTime.getFloat(); } } -} \ No newline at end of file +} diff --git a/TheOtherRoles/CustomOptionHolder.cs b/TheOtherRoles/CustomOptionHolder.cs index 25e0640..f69c487 100644 --- a/TheOtherRoles/CustomOptionHolder.cs +++ b/TheOtherRoles/CustomOptionHolder.cs @@ -1195,7 +1195,7 @@ public static void Load() { // Other options maxNumberOfMeetings = CustomOption.Create(3, Types.General, "maxNumberOfMeetings", 10, 0, 15, 1, null, true, "unitShots", heading: "headingGameplay"); - freePlayGameModeNumDummies = CustomOption.Create(10424, Types.General, cs(Color.green, "freePlayGameModeNumDummies"), 1f, 1f, 23f, 1f, format: "unitPlayers"); + freePlayGameModeNumDummies = CustomOption.Create(10424, Types.General, cs(Color.green, "freePlayGameModeNumDummies"), 1f, 0f, 23f, 1f, format: "unitPlayers"); anyPlayerCanStopStart = CustomOption.Create(2, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "anyPlayerCanStopStart"), false, null, false); blockSkippingInEmergencyMeetings = CustomOption.Create(4, Types.General, "blockSkippingInEmergencyMeetings", false); noVoteIsSelfVote = CustomOption.Create(5, Types.General, "noVoteIsSelfVote", false, blockSkippingInEmergencyMeetings); diff --git a/TheOtherRoles/Helpers.cs b/TheOtherRoles/Helpers.cs index bfa0513..8eb9836 100644 --- a/TheOtherRoles/Helpers.cs +++ b/TheOtherRoles/Helpers.cs @@ -311,7 +311,7 @@ internal static string getRoleString(RoleInfo roleInfo, bool isHusk) bool addHusk = isHusk && !roleInfo.isModifier; if (roleInfo.roleId == RoleId.Jackal) { - var getSidekickText = Jackal.canCreateSidekick ? ModTranslation.getString("jackalWithSidekick") : ModTranslation.getString("jackalShortDesc"); + var getSidekickText = Jackal.canCreateSidekick && !addHusk ? ModTranslation.getString("jackalWithSidekick") : ModTranslation.getString("jackalShortDesc"); return cs(roleInfo.color, $"{roleInfo.name}{(addHusk ? $" ({ModTranslation.getString("husk")})" : "")}: {getSidekickText}"); } @@ -1488,18 +1488,6 @@ public static void toggleZoom(bool reset=false) { ResolutionManager.ResolutionChanged.Invoke((float)Screen.width / Screen.height, Screen.width, Screen.height, Screen.fullScreen); // This will move button positions to the correct position. } - public static float GetShadowSize() - { - var shadowCollab = Camera.main.GetComponentInChildren(); - return shadowCollab.ShadowCamera.orthographicSize; - } - public static void ChangeShadowSize(float orthographicSize = 3f) - { - var shadowCollab = Camera.main.GetComponentInChildren(); - shadowCollab.ShadowCamera.orthographicSize = orthographicSize; - shadowCollab.ShadowQuad.transform.localScale = new Vector3(orthographicSize * Camera.main.aspect, orthographicSize) * 2f; - } - public static void AddModSettingsChangeMessage(this NotificationPopper popper, StringNames key, string value, string option, bool playSound = true) { string str = DestroyableSingleton.Instance.GetString(StringNames.LobbyChangeSettingNotification, "" + option + "", "" + value + ""); diff --git a/TheOtherRoles/Modules/BepInExUpdater.cs b/TheOtherRoles/Modules/BepInExUpdater.cs index 4cef9a2..ee106f1 100644 --- a/TheOtherRoles/Modules/BepInExUpdater.cs +++ b/TheOtherRoles/Modules/BepInExUpdater.cs @@ -19,8 +19,8 @@ namespace TheOtherRoles.Modules; public class BepInExUpdater : MonoBehaviour { - public const string RequiredBepInExVersion = "6.0.0-be.671+9caf61dca07043beae57b0771f6a5283aa02436b"; - public const string BepInExDownloadURL = "https://builds.bepinex.dev/projects/bepinex_be/671/BepInEx-Unity.IL2CPP-win-x86-6.0.0-be.671%2B9caf61d.zip"; + public const string RequiredBepInExVersion = "6.0.0-be.725+e1974e26fd7702c66b54c0d6879c90b988cc4920"; + public const string BepInExDownloadURL = "https://builds.bepinex.dev/projects/bepinex_be/725/BepInEx-Unity.IL2CPP-win-x86-6.0.0-be.725%2Be1974e2.zip"; public static bool UpdateRequired => Paths.BepInExVersion.ToString() != RequiredBepInExVersion; public void Awake() diff --git a/TheOtherRoles/Modules/ChatCommands.cs b/TheOtherRoles/Modules/ChatCommands.cs index 5d1009a..ea87fe1 100644 --- a/TheOtherRoles/Modules/ChatCommands.cs +++ b/TheOtherRoles/Modules/ChatCommands.cs @@ -18,7 +18,7 @@ static bool Prefix(ChatController __instance) { if (AmongUsClient.Instance.GameState != InnerNet.InnerNetClient.GameStates.Started) { if (text.ToLower().StartsWith("/kick ")) { string playerName = text.Substring(6); - PlayerControl target = CachedPlayer.AllPlayers.FirstOrDefault(x => x.Data.PlayerName.Equals(playerName)); + PlayerControl target = CachedPlayer.AllPlayers.FirstOrDefault(x => x.PlayerControl.Data.PlayerName.Equals(playerName)); if (target != null && AmongUsClient.Instance != null && AmongUsClient.Instance.CanBan()) { var client = AmongUsClient.Instance.GetClient(target.OwnerId); if (client != null) { @@ -28,7 +28,7 @@ static bool Prefix(ChatController __instance) { } } else if (text.ToLower().StartsWith("/ban ")) { string playerName = text.Substring(5); - PlayerControl target = CachedPlayer.AllPlayers.FirstOrDefault(x => x.Data.PlayerName.Equals(playerName)); + PlayerControl target = CachedPlayer.AllPlayers.FirstOrDefault(x => x.PlayerControl.Data.PlayerName.Equals(playerName)); if (target != null && AmongUsClient.Instance != null && AmongUsClient.Instance.CanBan()) { var client = AmongUsClient.Instance.GetClient(target.OwnerId); if (client != null) { @@ -37,7 +37,7 @@ static bool Prefix(ChatController __instance) { } } } - else if (text.ToLower().StartsWith("/gm")) + else if (text.ToLower().StartsWith("/gm") && TORMapOptions.gameMode != CustomGamemodes.FreePlay) { string gm = text.Substring(4).ToLower(); CustomGamemodes gameMode = CustomGamemodes.Classic; @@ -70,7 +70,7 @@ static bool Prefix(ChatController __instance) { if (AmongUsClient.Instance.NetworkMode == NetworkModes.FreePlay) { if (text.ToLower().Equals("/murder")) { CachedPlayer.LocalPlayer.PlayerControl.Exiled(); - FastDestroyableSingleton.Instance.KillOverlay.ShowKillAnimation(CachedPlayer.LocalPlayer.Data, CachedPlayer.LocalPlayer.Data); + FastDestroyableSingleton.Instance.KillOverlay.ShowKillAnimation(CachedPlayer.LocalPlayer.PlayerControl.Data, CachedPlayer.LocalPlayer.PlayerControl.Data); handled = true; } else if (text.ToLower().StartsWith("/color ")) { handled = true; @@ -84,9 +84,9 @@ static bool Prefix(ChatController __instance) { } } - if (text.ToLower().StartsWith("/tp ") && CachedPlayer.LocalPlayer.Data.IsDead) { + if (text.ToLower().StartsWith("/tp ") && CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead) { string playerName = text.Substring(4).ToLower(); - PlayerControl target = CachedPlayer.AllPlayers.FirstOrDefault(x => x.Data.PlayerName.ToLower().Equals(playerName)); + PlayerControl target = CachedPlayer.AllPlayers.FirstOrDefault(x => x.PlayerControl.Data.PlayerName.ToLower().Equals(playerName)); if (target != null) { CachedPlayer.LocalPlayer.transform.position = target.transform.position; handled = true; @@ -113,7 +113,7 @@ public static void Postfix(HudManager __instance) { public static class SetBubbleName { public static void Postfix(ChatBubble __instance, [HarmonyArgument(0)] string playerName) { PlayerControl sourcePlayer = PlayerControl.AllPlayerControls.ToArray().ToList().FirstOrDefault(x => x.Data != null && x.Data.PlayerName.Equals(playerName)); - if (sourcePlayer != null && CachedPlayer.LocalPlayer != null && CachedPlayer.LocalPlayer.Data?.Role?.IsImpostor == true && (Spy.spy != null && sourcePlayer.PlayerId == Spy.spy.PlayerId || Sidekick.sidekick != null && Sidekick.wasTeamRed && sourcePlayer.PlayerId == Sidekick.sidekick.PlayerId || Jackal.jackal != null && Jackal.wasTeamRed && sourcePlayer.PlayerId == Jackal.jackal.PlayerId) && __instance != null) __instance.NameText.color = Palette.ImpostorRed; + if (sourcePlayer != null && CachedPlayer.LocalPlayer != null && CachedPlayer.LocalPlayer.PlayerControl.Data?.Role?.IsImpostor == true && (Spy.spy != null && sourcePlayer.PlayerId == Spy.spy.PlayerId || Sidekick.sidekick != null && Sidekick.wasTeamRed && sourcePlayer.PlayerId == Sidekick.sidekick.PlayerId || Jackal.jackal != null && Jackal.wasTeamRed && sourcePlayer.PlayerId == Jackal.jackal.PlayerId) && __instance != null) __instance.NameText.color = Palette.ImpostorRed; } } diff --git a/TheOtherRoles/Modules/CustomOptions.cs b/TheOtherRoles/Modules/CustomOptions.cs index bf26c80..589e623 100644 --- a/TheOtherRoles/Modules/CustomOptions.cs +++ b/TheOtherRoles/Modules/CustomOptions.cs @@ -1410,9 +1410,9 @@ public static void Postfix(HudManager __instance) { } if (CachedPlayer.LocalPlayer != null && CachedPlayer.LocalPlayer.PlayerControl != null) { - var (playerCompleted, playerTotal) = TasksHandler.taskInfo(CachedPlayer.LocalPlayer.Data); + var (playerCompleted, playerTotal) = TasksHandler.taskInfo(CachedPlayer.LocalPlayer.PlayerControl.Data); int numberOfLeftTasks = playerTotal - playerCompleted; - bool zoomButtonActive = !(CachedPlayer.LocalPlayer.PlayerControl == null || !CachedPlayer.LocalPlayer.Data.IsDead || (CachedPlayer.LocalPlayer.PlayerControl == Busker.busker && Busker.pseudocideFlag)); + bool zoomButtonActive = !(CachedPlayer.LocalPlayer.PlayerControl == null || !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead || (CachedPlayer.LocalPlayer.PlayerControl == Busker.busker && Busker.pseudocideFlag)); zoomButtonActive &= numberOfLeftTasks <= 0 || !CustomOptionHolder.finishTasksBeforeHauntingOrZoomingOut.getBool(); toggleZoomButtonObject.SetActive(zoomButtonActive); var posOffset = Helpers.zoomOutStatus ? new Vector3(-1.27f, -7.92f, -52f) : new Vector3(0, -1.6f, -52f); diff --git a/TheOtherRoles/Objects/Bomb.cs b/TheOtherRoles/Objects/Bomb.cs index 23c4341..005f0cd 100644 --- a/TheOtherRoles/Objects/Bomb.cs +++ b/TheOtherRoles/Objects/Bomb.cs @@ -83,7 +83,7 @@ public static void explode(Bomb b) { if (Bomber.bomber != null) { var position = b.bomb.transform.position; var distance = Vector2.Distance(position, CachedPlayer.LocalPlayer.transform.position); // every player only checks that for their own client (desynct with positions sucks) - if (distance < Bomber.destructionRange && !CachedPlayer.LocalPlayer.Data.IsDead) { + if (distance < Bomber.destructionRange && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead) { Helpers.checkMurderAttemptAndKill(Bomber.bomber, CachedPlayer.LocalPlayer.PlayerControl, false, false, true, true); MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.ShareGhostInfo, Hazel.SendOption.Reliable, -1); diff --git a/TheOtherRoles/Objects/CustomButton.cs b/TheOtherRoles/Objects/CustomButton.cs index d979928..04abd18 100644 --- a/TheOtherRoles/Objects/CustomButton.cs +++ b/TheOtherRoles/Objects/CustomButton.cs @@ -40,6 +40,7 @@ public class CustomButton { public string buttonText = ""; public string actionName = ""; public bool shakeOnEnd = true; + public bool isSuicide = false; public bool isHandcuffed = false; private static readonly int Desat = Shader.PropertyToID("_Desat"); @@ -61,7 +62,8 @@ public enum ButtonLabelType HauntButton } - public CustomButton(Action OnClick, Func HasButton, Func CouldUse, Action OnMeetingEnds, Sprite Sprite, Vector3 PositionOffset, HudManager hudManager, KeyCode? hotkey, bool HasEffect, float EffectDuration, Action OnEffectEnds, bool mirror = false, string buttonText = "", ButtonLabelType abilityTexture = ButtonLabelType.KillButton, string actionName = "", bool shakeOnEnd = true) + public CustomButton(Action OnClick, Func HasButton, Func CouldUse, Action OnMeetingEnds, Sprite Sprite, Vector3 PositionOffset, HudManager hudManager, KeyCode? hotkey, bool HasEffect, float EffectDuration, Action OnEffectEnds, bool mirror = false, string buttonText = "", ButtonLabelType abilityTexture = ButtonLabelType.KillButton, string actionName = "", bool shakeOnEnd = true, + bool isSuicide = false) { this.hudManager = hudManager; this.OnClick = OnClick; @@ -79,6 +81,7 @@ public CustomButton(Action OnClick, Func HasButton, Func CouldUse, A this.buttonText = buttonText; this.actionName = actionName; this.shakeOnEnd = shakeOnEnd; + this.isSuicide = isSuicide; Timer = 16.2f; buttons.Add(this); actionButton = UnityEngine.Object.Instantiate(hudManager.KillButton, hudManager.KillButton.transform.parent); @@ -95,8 +98,8 @@ public CustomButton(Action OnClick, Func HasButton, Func CouldUse, A setActive(false); } - public CustomButton(Action OnClick, Func HasButton, Func CouldUse, Action OnMeetingEnds, Sprite Sprite, Vector3 PositionOffset, HudManager hudManager, KeyCode? hotkey, bool mirror = false, string buttonText = "", ButtonLabelType abilityTexture = ButtonLabelType.KillButton, string actionName = "", bool shakeOnEnd = true) - : this(OnClick, HasButton, CouldUse, OnMeetingEnds, Sprite, PositionOffset, hudManager, hotkey, false, 0f, () => {}, mirror, buttonText, abilityTexture, actionName, shakeOnEnd) { } + public CustomButton(Action OnClick, Func HasButton, Func CouldUse, Action OnMeetingEnds, Sprite Sprite, Vector3 PositionOffset, HudManager hudManager, KeyCode? hotkey, bool mirror = false, string buttonText = "", ButtonLabelType abilityTexture = ButtonLabelType.KillButton, string actionName = "", bool shakeOnEnd = true, bool isSuicide = false) + : this(OnClick, HasButton, CouldUse, OnMeetingEnds, Sprite, PositionOffset, hudManager, hotkey, false, 0f, () => {}, mirror, buttonText, abilityTexture, actionName, shakeOnEnd, isSuicide) { } public void onClickEvent() { @@ -178,8 +181,8 @@ public void setActive(bool isActive) { public void Update() { - var localPlayer = CachedPlayer.LocalPlayer; - var moveable = localPlayer.PlayerControl.moveable; + var localPlayer = CachedPlayer.LocalPlayer.PlayerControl; + var moveable = localPlayer.moveable; if (localPlayer.Data == null || MeetingHud.Instance || ExileController.Instance || !HasButton()) { setActive(false); @@ -190,11 +193,11 @@ public void Update() if (DeputyTimer >= 0) { // This had to be reordered, so that the handcuffs do not stop the underlying timers from running if (HasEffect && isEffectActive) DeputyTimer -= Time.deltaTime; - else if (!localPlayer.PlayerControl.inVent && moveable) + else if (!localPlayer.inVent && moveable) DeputyTimer -= Time.deltaTime; } - if (DeputyTimer <= 0 && HasEffect && isEffectActive && buttonText != HudManagerStartPatch.serialKillerButton.buttonText) { // Here we have to specify that the Serial Killer button will not be affected + if (DeputyTimer <= 0 && HasEffect && isEffectActive && !isSuicide) { // Here we have to specify that the Serial Killer button will not be affected isEffectActive = false; actionButton.cooldownTimerText.color = Palette.EnabledColor; OnEffectEnds(); @@ -234,7 +237,7 @@ public void Update() if (Timer <= 3f && Timer > 0f && shakeOnEnd) actionButton.graphic.transform.localPosition = actionButton.transform.localPosition + (Vector3)UnityEngine.Random.insideUnitCircle * 0.05f; } - else if (!localPlayer.PlayerControl.inVent && moveable) + else if (!localPlayer.inVent && moveable) Timer -= Time.deltaTime; } diff --git a/TheOtherRoles/Objects/FoxTask.cs b/TheOtherRoles/Objects/FoxTask.cs index 27ffa5b..e9a8190 100644 --- a/TheOtherRoles/Objects/FoxTask.cs +++ b/TheOtherRoles/Objects/FoxTask.cs @@ -56,7 +56,7 @@ private void FixedUpdate() var console = ShipStatus.Instance.AllConsoles.FirstOrDefault(x => x.ConsoleId == MyNormTask.Data[MyNormTask.taskStep]); MyNormTask.StartAt = console.Room; } - StartCoroutine(CoStartClose(0.5f)); + StartCoroutine(CoDestroySelf()); } } @@ -74,7 +74,7 @@ public void OnDisable() void onClick() { - Close(); + StartCoroutine(CoDestroySelf()); } } } diff --git a/TheOtherRoles/Patches/EndGamePatch.cs b/TheOtherRoles/Patches/EndGamePatch.cs index faa8e99..7197b7c 100644 --- a/TheOtherRoles/Patches/EndGamePatch.cs +++ b/TheOtherRoles/Patches/EndGamePatch.cs @@ -126,7 +126,7 @@ public static void Postfix(AmongUsClient __instance, [HarmonyArgument(0)]ref End AdditionalTempData.clear(); - foreach(var playerControl in CachedPlayer.AllPlayers) { + foreach(PlayerControl playerControl in CachedPlayer.AllPlayers) { var roles = RoleInfo.getRoleInfoForPlayer(playerControl, true, true); var colors = roles.Select(x => x.color).ToList(); var (tasksCompleted, tasksTotal) = TasksHandler.taskInfo(playerControl.Data, true); @@ -295,7 +295,8 @@ public static void Postfix(AmongUsClient __instance, [HarmonyArgument(0)]ref End } else if (plagueDoctorWin) - { + { + if (CachedPlayer.LocalPlayer.PlayerControl == PlagueDoctor.plagueDoctor) _ = new StaticAchievementToken("plagueDoctor.challenge"); EndGameResult.CachedWinners = new Il2CppSystem.Collections.Generic.List(); CachedPlayerData wpd = new(PlagueDoctor.plagueDoctor.Data); EndGameResult.CachedWinners.Add(wpd); @@ -310,7 +311,8 @@ public static void Postfix(AmongUsClient __instance, [HarmonyArgument(0)]ref End } else if (jekyllAndHydeWin) - { + { + if (CachedPlayer.LocalPlayer.PlayerControl == JekyllAndHyde.jekyllAndHyde) _ = new StaticAchievementToken("jekyllAndHyde.challenge"); EndGameResult.CachedWinners = new Il2CppSystem.Collections.Generic.List(); CachedPlayerData wpd = new(JekyllAndHyde.jekyllAndHyde.Data); EndGameResult.CachedWinners.Add(wpd); @@ -338,7 +340,8 @@ public static void Postfix(AmongUsClient __instance, [HarmonyArgument(0)]ref End } else if (moriartyWin) - { + { + if (CachedPlayer.LocalPlayer.PlayerControl == Moriarty.moriarty) _ = new StaticAchievementToken("moriarty.challenge"); EndGameResult.CachedWinners = new Il2CppSystem.Collections.Generic.List(); CachedPlayerData wpd = new(Moriarty.moriarty.Data); EndGameResult.CachedWinners.Add(wpd); @@ -377,6 +380,7 @@ public static void Postfix(AmongUsClient __instance, [HarmonyArgument(0)]ref End // Akujo win else if (akujoWin) { + if (CachedPlayer.LocalPlayer.PlayerControl == Akujo.akujo) _ = new StaticAchievementToken("akujo.challenge"); AdditionalTempData.winCondition = WinCondition.AkujoWin; EndGameResult.CachedWinners = new Il2CppSystem.Collections.Generic.List(); EndGameResult.CachedWinners.Add(new CachedPlayerData(Akujo.akujo.Data)); @@ -420,7 +424,8 @@ public static void Postfix(AmongUsClient __instance, [HarmonyArgument(0)]ref End } else if (cupidLoversWin) - { + { + if (CachedPlayer.LocalPlayer.PlayerControl == Cupid.cupid) _ = new StaticAchievementToken("cupid.challenge"); AdditionalTempData.winCondition = WinCondition.CupidLoversWin; EndGameResult.CachedWinners = new Il2CppSystem.Collections.Generic.List(); EndGameResult.CachedWinners.Add(new CachedPlayerData(Cupid.lovers1.Data)); @@ -486,6 +491,7 @@ public static void Postfix(AmongUsClient __instance, [HarmonyArgument(0)]ref End else if (foxWin) { + if (CachedPlayer.LocalPlayer.PlayerControl == Fox.fox) _ = new StaticAchievementToken("fox.challenge"); AdditionalTempData.winCondition = WinCondition.FoxWin; EndGameResult.CachedWinners = new Il2CppSystem.Collections.Generic.List(); CachedPlayerData wpd = new(Fox.fox.Data); @@ -550,7 +556,8 @@ public static void Postfix(AmongUsClient __instance, [HarmonyArgument(0)]ref End EndGameResult.CachedWinners.ToArray().Any(x => x.PlayerName == Cupid.lovers2.Data.PlayerName) && !EndGameResult.CachedWinners.ToArray().Any(x => x.PlayerName == Cupid.cupid.Data.PlayerName)) { EndGameResult.CachedWinners.Add(new CachedPlayerData(Cupid.cupid.Data)); - } + } + if (CachedPlayer.LocalPlayer.PlayerControl == Cupid.cupid) _ = new StaticAchievementToken("cupid.challenge"); } // Possible Additional winner: Pursuer diff --git a/TheOtherRoles/Patches/ExileControllerPatch.cs b/TheOtherRoles/Patches/ExileControllerPatch.cs index 8b5c325..d579283 100644 --- a/TheOtherRoles/Patches/ExileControllerPatch.cs +++ b/TheOtherRoles/Patches/ExileControllerPatch.cs @@ -16,7 +16,7 @@ namespace TheOtherRoles.Patches { [HarmonyPriority(Priority.First)] class ExileControllerBeginPatch { public static NetworkedPlayerInfo lastExiled; - public static void Prefix(ExileController __instance, [HarmonyArgument(0)]ref NetworkedPlayerInfo exiled, [HarmonyArgument(1)]bool tie) { + public static void Prefix(ExileController __instance, [HarmonyArgument(0)]ref NetworkedPlayerInfo exiled) { lastExiled = exiled; // Medic shield @@ -155,14 +155,14 @@ class ExileControllerWrapUpPatch { [HarmonyPatch(typeof(ExileController), nameof(ExileController.WrapUp))] class BaseExileControllerPatch { public static void Postfix(ExileController __instance) { - WrapUpPostfix(__instance.exiled); + WrapUpPostfix(__instance.initData.networkedPlayer); } } [HarmonyPatch(typeof(AirshipExileController), nameof(AirshipExileController.WrapUpAndSpawn))] class AirshipExileControllerPatch { public static void Postfix(AirshipExileController __instance) { - WrapUpPostfix(__instance.exiled); + WrapUpPostfix(__instance.initData.networkedPlayer); } } @@ -638,7 +638,7 @@ static void WrapUpPostfix(NetworkedPlayerInfo exiled) // Invert add meeting if (Invert.meetings > 0) Invert.meetings--; - Chameleon.lastMoved.Clear(); + Chameleon.lastMoved?.Clear(); /*foreach (Trap trap in Trap.traps) trap.triggerable = false; FastDestroyableSingleton.Instance.StartCoroutine(Effects.Lerp(GameOptionsManager.Instance.currentNormalGameOptions.KillCooldown / 2 + 2, new Action((p) => { @@ -659,8 +659,8 @@ static void Postfix() { class ExileControllerMessagePatch { static void Postfix(ref string __result, [HarmonyArgument(0)]StringNames id) { try { - if (ExileController.Instance != null && ExileController.Instance.exiled != null) { - PlayerControl player = Helpers.playerById(ExileController.Instance.exiled.Object.PlayerId); + if (ExileController.Instance != null && ExileController.Instance.initData != null) { + PlayerControl player = Helpers.playerById(ExileController.Instance.initData.networkedPlayer.Object.PlayerId); if (player == null) return; // Exile role text if (id is StringNames.ExileTextPN or StringNames.ExileTextSN or StringNames.ExileTextPP or StringNames.ExileTextSP) { diff --git a/TheOtherRoles/Patches/HauntMenuMinigamePatch.cs b/TheOtherRoles/Patches/HauntMenuMinigamePatch.cs index d64e36b..083f990 100644 --- a/TheOtherRoles/Patches/HauntMenuMinigamePatch.cs +++ b/TheOtherRoles/Patches/HauntMenuMinigamePatch.cs @@ -64,7 +64,7 @@ public static bool StartPrefix(HauntMenuMinigame __instance) { [HarmonyPatch(typeof(HauntMenuMinigame), nameof(HauntMenuMinigame.FixedUpdate))] public static void UpdatePostfix(HauntMenuMinigame __instance) { if (GameOptionsManager.Instance.currentGameOptions.GameMode != GameModes.Normal) return; - if (CachedPlayer.LocalPlayer.Data.Role.IsImpostor && Vampire.vampire != CachedPlayer.LocalPlayer.PlayerControl) + if (CachedPlayer.LocalPlayer.PlayerControl.Data.Role.IsImpostor && Vampire.vampire != CachedPlayer.LocalPlayer.PlayerControl) __instance.gameObject.transform.localPosition = new UnityEngine.Vector3(-6f, -1.1f, __instance.gameObject.transform.localPosition.z); return; } @@ -74,9 +74,9 @@ public static void UpdatePostfix(HauntMenuMinigame __instance) { public static void showOrHideAbilityButtonPostfix(AbilityButton __instance) { bool isHideNSeek = GameOptionsManager.Instance.currentGameOptions.GameMode == GameModes.HideNSeek; if (FreePlayGM.isFreePlayGM) return; - if (CachedPlayer.LocalPlayer.Data.IsDead && (CustomOptionHolder.finishTasksBeforeHauntingOrZoomingOut.getBool() || isHideNSeek)) { + if (CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && (CustomOptionHolder.finishTasksBeforeHauntingOrZoomingOut.getBool() || isHideNSeek)) { // player has haunt button. - var (playerCompleted, playerTotal) = TasksHandler.taskInfo(CachedPlayer.LocalPlayer.Data); + var (playerCompleted, playerTotal) = TasksHandler.taskInfo(CachedPlayer.LocalPlayer.PlayerControl.Data); int numberOfLeftTasks = playerTotal - playerCompleted; if (numberOfLeftTasks <= 0 || isHideNSeek) __instance.Show(); diff --git a/TheOtherRoles/Patches/IntroPatch.cs b/TheOtherRoles/Patches/IntroPatch.cs index c1810d4..6e59382 100644 --- a/TheOtherRoles/Patches/IntroPatch.cs +++ b/TheOtherRoles/Patches/IntroPatch.cs @@ -463,7 +463,7 @@ public static void setupIntroTeamIcons(IntroCutscene __instance, ref Il2CppSyst } // Add the Spy to the Impostor team (for the Impostors) - if (Spy.spy != null && CachedPlayer.LocalPlayer.Data.Role.IsImpostor) { + if (Spy.spy != null && CachedPlayer.LocalPlayer.PlayerControl.Data.Role.IsImpostor) { List players = PlayerControl.AllPlayerControls.ToArray().ToList().OrderBy(x => Guid.NewGuid()).ToList(); var fakeImpostorTeam = new Il2CppSystem.Collections.Generic.List(); // The local player always has to be the first one in the list (to be displayed in the center) fakeImpostorTeam.Add(CachedPlayer.LocalPlayer.PlayerControl); diff --git a/TheOtherRoles/Patches/MeetingPatch.cs b/TheOtherRoles/Patches/MeetingPatch.cs index f6fdcd5..45d1e2c 100644 --- a/TheOtherRoles/Patches/MeetingPatch.cs +++ b/TheOtherRoles/Patches/MeetingPatch.cs @@ -186,8 +186,8 @@ class MeetingHudBloopAVoteIconPatch { public static bool Prefix(MeetingHud __instance, [HarmonyArgument(0)]NetworkedPlayerInfo voterPlayer, [HarmonyArgument(1)]int index, [HarmonyArgument(2)]Transform parent) { var spriteRenderer = UnityEngine.Object.Instantiate(__instance.PlayerVotePrefab); var showVoteColors = !GameManager.Instance.LogicOptions.GetAnonymousVotes() || - (CachedPlayer.LocalPlayer.Data.IsDead && TORMapOptions.ghostsSeeVotes) || - (Mayor.mayor != null && Mayor.mayor == CachedPlayer.LocalPlayer.PlayerControl && Mayor.canSeeVoteColors && TasksHandler.taskInfo(CachedPlayer.LocalPlayer.Data).Item1 >= Mayor.tasksNeededToSeeVoteColors || + (CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && TORMapOptions.ghostsSeeVotes) || + (Mayor.mayor != null && Mayor.mayor == CachedPlayer.LocalPlayer.PlayerControl && Mayor.canSeeVoteColors && TasksHandler.taskInfo(CachedPlayer.LocalPlayer.PlayerControl.Data).Item1 >= Mayor.tasksNeededToSeeVoteColors || CachedPlayer.LocalPlayer.PlayerControl == Watcher.nicewatcher || CachedPlayer.LocalPlayer.PlayerControl == Watcher.evilwatcher); if (showVoteColors) @@ -511,7 +511,7 @@ static void guesserOnClick(int buttonTarget, MeetingHud __instance) { guesserUIExitButton.OnClick.AddListener((System.Action)(() => { __instance.playerStates.ToList().ForEach(x => { x.gameObject.SetActive(true); - if (CachedPlayer.LocalPlayer.Data.IsDead && x.transform.FindChild("ShootButton") != null) UnityEngine.Object.Destroy(x.transform.FindChild("ShootButton").gameObject); + if (CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && x.transform.FindChild("ShootButton") != null) UnityEngine.Object.Destroy(x.transform.FindChild("ShootButton").gameObject); }); UnityEngine.Object.Destroy(container.gameObject); })); @@ -563,7 +563,7 @@ static void guesserOnClick(int buttonTarget, MeetingHud __instance) { int copiedIndex = i; button.GetComponent().OnClick.RemoveAllListeners(); - if (!CachedPlayer.LocalPlayer.Data.IsDead && !Helpers.playerById((byte)__instance.playerStates[buttonTarget].TargetPlayerId).Data.IsDead) button.GetComponent().OnClick.AddListener((System.Action)(() => { + if (!CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && !Helpers.playerById((byte)__instance.playerStates[buttonTarget].TargetPlayerId).Data.IsDead) button.GetComponent().OnClick.AddListener((System.Action)(() => { if (selectedButton != button) { selectedButton = button; buttons.ForEach(x => x.GetComponent().color = x == selectedButton ? Color.red : Color.white); @@ -735,7 +735,7 @@ static void populateButtonsPostfix(MeetingHud __instance) { } PassiveButton passiveButton = meetingExtraButton.GetComponent(); passiveButton.OnClick.RemoveAllListeners(); - if (!CachedPlayer.LocalPlayer.Data.IsDead) { + if (!CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead) { if (addSwapperButtons) passiveButton.OnClick.AddListener((Action)(() => swapperConfirm(__instance))); else if (addMayorButton) @@ -817,7 +817,7 @@ static void populateButtonsPostfix(MeetingHud __instance) { // Add Guesser Buttons int remainingShots = HandleGuesser.remainingShots(CachedPlayer.LocalPlayer.PlayerId); - if (isGuesser && !CachedPlayer.LocalPlayer.Data.IsDead && remainingShots > 0) { + if (isGuesser && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && remainingShots > 0) { for (int i = 0; i < __instance.playerStates.Length; i++) { PlayerVoteArea playerVoteArea = __instance.playerStates[i]; if (playerVoteArea.AmDead || playerVoteArea.TargetPlayerId == CachedPlayer.LocalPlayer.PlayerId) continue; @@ -1186,7 +1186,7 @@ public static void Prefix(PlayerControl __instance, [HarmonyArgument(0)]Networke } } - if (CachedPlayer.LocalPlayer.Data.IsDead && output != "") FastDestroyableSingleton.Instance.Chat.AddChat(CachedPlayer.LocalPlayer, $"{output}", false); + if (CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && output != "") FastDestroyableSingleton.Instance.Chat.AddChat(CachedPlayer.LocalPlayer, $"{output}", false); //Trapper.playersOnMap = new List(); Snitch.playerRoomMap = new Dictionary(); diff --git a/TheOtherRoles/Patches/PlayerControlPatch.cs b/TheOtherRoles/Patches/PlayerControlPatch.cs index faf072f..35b9364 100644 --- a/TheOtherRoles/Patches/PlayerControlPatch.cs +++ b/TheOtherRoles/Patches/PlayerControlPatch.cs @@ -116,7 +116,7 @@ public static void bendTimeUpdate() { foreach (Vent vent in MapUtilities.CachedShipStatus.AllVents) { bool canUse; bool couldUse; - vent.CanUse(CachedPlayer.LocalPlayer.Data, out canUse, out couldUse); + vent.CanUse(CachedPlayer.LocalPlayer.PlayerControl.Data, out canUse, out couldUse); if (canUse) { CachedPlayer.LocalPlayer.PlayerPhysics.RpcExitVent(vent.Id); vent.SetButtons(false); @@ -404,7 +404,7 @@ static void deputyUpdate() static void engineerUpdate() { bool jackalHighlight = Engineer.highlightForTeamJackal && (CachedPlayer.LocalPlayer.PlayerControl == Jackal.jackal || CachedPlayer.LocalPlayer.PlayerControl == Sidekick.sidekick); - bool impostorHighlight = Engineer.highlightForImpostors && CachedPlayer.LocalPlayer.Data.Role.IsImpostor; + bool impostorHighlight = Engineer.highlightForImpostors && CachedPlayer.LocalPlayer.PlayerControl.Data.Role.IsImpostor; if ((jackalHighlight || impostorHighlight) && MapUtilities.CachedShipStatus?.AllVents != null) { foreach (Vent vent in MapUtilities.CachedShipStatus.AllVents) { try { @@ -440,7 +440,7 @@ static void engineerUpdate() { } static void impostorSetTarget() { - if (!CachedPlayer.LocalPlayer.Data.Role.IsImpostor ||!CachedPlayer.LocalPlayer.PlayerControl.CanMove || CachedPlayer.LocalPlayer.Data.IsDead || (CachedPlayer.LocalPlayer.PlayerControl == Undertaker.undertaker && Undertaker.DraggedBody != null)) { // !isImpostor || !canMove || isDead + if (!CachedPlayer.LocalPlayer.PlayerControl.Data.Role.IsImpostor ||!CachedPlayer.LocalPlayer.PlayerControl.CanMove || CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead || (CachedPlayer.LocalPlayer.PlayerControl == Undertaker.undertaker && Undertaker.DraggedBody != null)) { // !isImpostor || !canMove || isDead FastDestroyableSingleton.Instance.KillButton.SetTarget(null); return; } @@ -678,7 +678,7 @@ static void assassinUpdate() Assassin.arrow.arrow.SetActive(false); return; } - if (Assassin.assassinMarked != null && !CachedPlayer.LocalPlayer.Data.IsDead) + if (Assassin.assassinMarked != null && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead) { bool trackedOnMap = !Assassin.assassinMarked.Data.IsDead; Vector3 position = Assassin.assassinMarked.transform.position; @@ -730,7 +730,7 @@ public static void plagueDoctorUpdate() gameObject.SetActive(true); UnityEngine.Object.DestroyImmediate(gameObject.GetComponent()); PlagueDoctor.statusText = gameObject.GetComponent(); - gameObject.transform.localPosition = new Vector3(-2.7f, -0.1f - CachedPlayer.AllPlayers.Select(x => !PlagueDoctor.dead.ContainsKey(x.PlayerId)).Count() * 0.07f, gameObject.transform.localPosition.z); + gameObject.transform.localPosition = new Vector3(-2.7f, -0.1f - CachedPlayer.AllPlayers.Select(x => !PlagueDoctor.dead.ContainsKey(x.PlayerControl.PlayerId)).Count() * 0.07f, gameObject.transform.localPosition.z); PlagueDoctor.statusText.transform.localScale = new Vector3(1f, 1f, 1f); PlagueDoctor.statusText.fontSize = 1.5f; @@ -994,7 +994,7 @@ public static void updatePlayerInfo() { p.cosmetics.nameText.transform.parent.SetLocalZ(-0.0001f); // This moves both the name AND the colorblindtext behind objects (if the player is behind the object), like the rock on polus - if ((Lawyer.lawyerKnowsRole && CachedPlayer.LocalPlayer.PlayerControl == Lawyer.lawyer && p == Lawyer.target) || (Akujo.knowsRoles && CachedPlayer.LocalPlayer.PlayerControl == Akujo.akujo && (p == Akujo.honmei || Akujo.keeps.Any(x => x.PlayerId == p.PlayerId))) || p == CachedPlayer.LocalPlayer.PlayerControl || (CachedPlayer.LocalPlayer.Data.IsDead + if ((Lawyer.lawyerKnowsRole && CachedPlayer.LocalPlayer.PlayerControl == Lawyer.lawyer && p == Lawyer.target) || (Akujo.knowsRoles && CachedPlayer.LocalPlayer.PlayerControl == Akujo.akujo && (p == Akujo.honmei || Akujo.keeps.Any(x => x.PlayerId == p.PlayerId))) || p == CachedPlayer.LocalPlayer.PlayerControl || (CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && !(CachedPlayer.LocalPlayer.PlayerControl == Busker.busker && Busker.pseudocideFlag)) || FreePlayGM.isFreePlayGM) { Transform playerInfoTransform = p.cosmetics.nameText.transform.parent.FindChild("Info"); TMPro.TextMeshPro playerInfo = playerInfoTransform != null ? playerInfoTransform.GetComponent() : null; @@ -1108,7 +1108,7 @@ public static void arsonistSetTarget() { if (Arsonist.douseTarget != null) { untargetables = new(); - foreach (CachedPlayer cachedPlayer in CachedPlayer.AllPlayers) + foreach (PlayerControl cachedPlayer in CachedPlayer.AllPlayers) { if (cachedPlayer.PlayerId != Arsonist.douseTarget.PlayerId) { @@ -1772,7 +1772,7 @@ public static void impostorArrowUpdate() return; } } - if (CachedPlayer.LocalPlayer.Data.Role.IsImpostor) + if (CachedPlayer.LocalPlayer.PlayerControl.Data.Role.IsImpostor) { // 前フレームからの経過時間をマイナスする FortuneTeller.updateTimer -= Time.fixedDeltaTime; @@ -1825,8 +1825,8 @@ public static void hackerUpdate() { // For swapper swap charges public static void swapperUpdate() { - if (Swapper.swapper == null || CachedPlayer.LocalPlayer.PlayerControl != Swapper.swapper || CachedPlayer.LocalPlayer.Data.IsDead) return; - var (playerCompleted, _) = TasksHandler.taskInfo(CachedPlayer.LocalPlayer.Data); + if (Swapper.swapper == null || CachedPlayer.LocalPlayer.PlayerControl != Swapper.swapper || CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead) return; + var (playerCompleted, _) = TasksHandler.taskInfo(CachedPlayer.LocalPlayer.PlayerControl.Data); if (playerCompleted == Swapper.rechargedTasks) { Swapper.rechargedTasks += Swapper.rechargeTasksNumber; Swapper.charges++; @@ -1974,7 +1974,7 @@ static void hunterUpdate() { } } if (HideNSeek.isHunted() && !Hunted.taskPunish && !HideNSeek.isWaitingTimer) { - var (playerCompleted, playerTotal) = TasksHandler.taskInfo(CachedPlayer.LocalPlayer.Data); + var (playerCompleted, playerTotal) = TasksHandler.taskInfo(CachedPlayer.LocalPlayer.PlayerControl.Data); int numberOfTasks = playerTotal - playerCompleted; if (numberOfTasks == 0) { MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.ShareTimer, Hazel.SendOption.Reliable, -1); @@ -2216,7 +2216,7 @@ class BodyReportPatch { static bool Prefix(PlayerControl __instance, [HarmonyArgument(0)] NetworkedPlayerInfo target) { - if (Moriarty.brainwashed.FindAll(x => x.PlayerId == __instance.PlayerId).Count > 0) + if (Moriarty.brainwashed?.FindAll(x => x.PlayerId == __instance?.PlayerId).Count > 0) { return false; } @@ -2415,7 +2415,8 @@ public static void Postfix(PlayerControl __instance, [HarmonyArgument(0)]PlayerC } if (SchrodingersCat.schrodingersCat != null && target == SchrodingersCat.schrodingersCat) - { + { + if (CachedPlayer.LocalPlayer.PlayerControl == target) _ = new StaticAchievementToken("schrodingersCat.common1"); SchrodingersCat.schrodingersCat.clearAllTasks(); if (!SchrodingersCat.hasTeam()) { @@ -3237,7 +3238,7 @@ public static void Postfix(PlayerPhysics __instance) if (__instance.AmOwner && AmongUsClient.Instance && AmongUsClient.Instance.GameState == InnerNet.InnerNetClient.GameStates.Started && - !CachedPlayer.LocalPlayer.Data.IsDead && + !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && shouldInvert && GameData.Instance && __instance.myPlayer.CanMove) @@ -3246,7 +3247,7 @@ public static void Postfix(PlayerPhysics __instance) if (__instance.AmOwner && AmongUsClient.Instance && AmongUsClient.Instance.GameState == InnerNet.InnerNetClient.GameStates.Started && - !CachedPlayer.LocalPlayer.Data.IsDead && + !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && GameData.Instance && __instance.myPlayer.CanMove && CachedPlayer.LocalPlayer.PlayerControl == Undertaker.undertaker && @@ -3265,7 +3266,7 @@ public static bool Prefix(ref bool __result) { if (GameOptionsManager.Instance.currentGameOptions.GameMode == GameModes.HideNSeek) return true; __result = false; - if (!CachedPlayer.LocalPlayer.Data.IsDead && Lighter.lighter != null && Lighter.lighter.PlayerId == CachedPlayer.LocalPlayer.PlayerId) { + if (!CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && Lighter.lighter != null && Lighter.lighter.PlayerId == CachedPlayer.LocalPlayer.PlayerId) { __result = true; } @@ -3278,7 +3279,7 @@ public static class AdjustLight { public static bool Prefix(PlayerControl __instance) { if (__instance == null || CachedPlayer.LocalPlayer == null || Lighter.lighter == null) return true; - bool hasFlashlight = !CachedPlayer.LocalPlayer.Data.IsDead && Lighter.lighter.PlayerId == CachedPlayer.LocalPlayer.PlayerId; + bool hasFlashlight = !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && Lighter.lighter.PlayerId == CachedPlayer.LocalPlayer.PlayerId; __instance.SetFlashlightInputMethod(); __instance.lightSource.SetupLightingForGameplay(hasFlashlight, Lighter.flashlightWidth, __instance.TargetFlashlight.transform); diff --git a/TheOtherRoles/Patches/TransportationToolPatches.cs b/TheOtherRoles/Patches/TransportationToolPatches.cs index 1aad9ad..5fd1764 100644 --- a/TheOtherRoles/Patches/TransportationToolPatches.cs +++ b/TheOtherRoles/Patches/TransportationToolPatches.cs @@ -42,34 +42,27 @@ public static void postfix(ZiplineBehaviour __instance, PlayerControl player, bo { if (Camouflager.camouflageTimer <= 0 && !Helpers.MushroomSabotageActive()) { - if (player == Morphling.morphling && Morphling.morphTimer > 0) - { - hand.SetPlayerColor(Morphling.morphTarget.CurrentOutfit, PlayerMaterial.MaskType.None); + if (player == Morphling.morphling && Morphling.morphTimer > 0) { + hand.SetPlayerColor(Morphling.morphTarget.CurrentOutfit, PlayerMaterial.MaskType.None, 1f); // Also set hat color, cause the line destroys it... player.RawSetHat(Morphling.morphTarget.Data.DefaultOutfit.HatId, Morphling.morphTarget.Data.DefaultOutfit.ColorId); - } - else if (player == MimicK.mimicK && MimicK.victim != null) - { - hand.SetPlayerColor(MimicK.victim.CurrentOutfit, PlayerMaterial.MaskType.None); + } else if (player == MimicK.mimicK && MimicK.victim != null) { + hand.SetPlayerColor(MimicK.victim.CurrentOutfit, PlayerMaterial.MaskType.None, 1f); player.RawSetHat(MimicK.victim.Data.DefaultOutfit.HatId, MimicK.victim.Data.DefaultOutfit.ColorId); - } - else if (player == MimicA.mimicA && MimicK.mimicK != null && MimicA.isMorph) - { - hand.SetPlayerColor(MimicK.mimicK.CurrentOutfit, PlayerMaterial.MaskType.None); + } else if (player == MimicA.mimicA && MimicK.mimicK != null && MimicA.isMorph) { + hand.SetPlayerColor(MimicK.mimicK.CurrentOutfit, PlayerMaterial.MaskType.None, 1f); player.RawSetHat(MimicK.mimicK.Data.DefaultOutfit.HatId, MimicK.mimicK.Data.DefaultOutfit.ColorId); - } - else - { - hand.SetPlayerColor(player.CurrentOutfit, PlayerMaterial.MaskType.None); + } else if ((Ninja.ninja != null && Ninja.ninja == player && Ninja.stealthed) || (Sprinter.sprinter != null && Sprinter.sprinter == player && Sprinter.sprinting) + || (Fox.fox != null && Fox.fox == player && Fox.stealthed) || (Kataomoi.kataomoi != null && Kataomoi.kataomoi == player && Kataomoi.isStalking())) { + hand.SetPlayerColor(player.CurrentOutfit, PlayerMaterial.MaskType.None, 0f); + } else { + hand.SetPlayerColor(player.CurrentOutfit, PlayerMaterial.MaskType.None, player.cosmetics.GetPhantomRoleAlpha()); } } else { PlayerMaterial.SetColors(6, hand.handRenderer); } - - if ((Ninja.ninja != null && Ninja.ninja == player && Ninja.stealthed) || (Sprinter.sprinter != null && Sprinter.sprinter == player && Sprinter.sprinting) - || (Fox.fox != null && Fox.fox == player && Fox.stealthed) || (Kataomoi.kataomoi != null && Kataomoi.kataomoi == player && Kataomoi.isStalking())) hand.gameObject.SetActive(false); } }))); } diff --git a/TheOtherRoles/Patches/UpdatePatch.cs b/TheOtherRoles/Patches/UpdatePatch.cs index d985706..794fc0f 100644 --- a/TheOtherRoles/Patches/UpdatePatch.cs +++ b/TheOtherRoles/Patches/UpdatePatch.cs @@ -19,7 +19,7 @@ class HudManagerUpdatePatch private static Dictionary TagColorDict = new(); static void resetNameTagsAndColors() { var localPlayer = CachedPlayer.LocalPlayer.PlayerControl; - var myData = CachedPlayer.LocalPlayer.Data; + var myData = CachedPlayer.LocalPlayer.PlayerControl.Data; var amImpostor = myData.Role.IsImpostor; var morphTimerNotUp = Morphling.morphTimer > 0f; var morphTargetNotNull = Morphling.morphTarget != null; @@ -286,7 +286,7 @@ static void setNameColors() { static void setNameTags() { // Mafia - if (CachedPlayer.LocalPlayer != null && CachedPlayer.LocalPlayer.Data.Role.IsImpostor) { + if (CachedPlayer.LocalPlayer != null && CachedPlayer.LocalPlayer.PlayerControl.Data.Role.IsImpostor) { foreach (PlayerControl player in CachedPlayer.AllPlayers) if (Godfather.godfather != null && Godfather.godfather == player) player.cosmetics.nameText.text = player.Data.PlayerName + $" ({ModTranslation.getString("mafiaG")})"; @@ -450,7 +450,7 @@ public static void miniUpdate() { // || Mini.mini == MimicK.mimicK && MimicK.victim != null // the above line deleted in 2024.3.9, specified the MimicK instead if (Mini.mini == null || Camouflager.camouflageTimer > 0f || Helpers.MushroomSabotageActive() || (Mini.mini == MimicA.mimicA && MimicA.isMorph) || (Mini.mini == Morphling.morphling && Morphling.morphTimer > 0f) || (Mini.mini == Ninja.ninja && Ninja.stealthed) - || (Mini.mini == Fox.fox && Fox.stealthed) || (Mini.mini == Sprinter.sprinter && Sprinter.sprinting) || SurveillanceMinigamePatch.nightVisionIsActive) return; + || (Mini.mini == Fox.fox && Fox.stealthed) || (Mini.mini == Sprinter.sprinter && Sprinter.sprinting) || (Mini.mini == Kataomoi.kataomoi && Kataomoi.isStalking()) || SurveillanceMinigamePatch.nightVisionIsActive) return; float growingProgress = Mini.growingProgress(); float scale = growingProgress * 0.35f + 0.35f; @@ -474,7 +474,7 @@ public static void miniUpdate() { } static void updateImpostorKillButton(HudManager __instance) { - if (!CachedPlayer.LocalPlayer.Data.Role.IsImpostor) return; + if (!CachedPlayer.LocalPlayer.PlayerControl.Data.Role.IsImpostor) return; if (MeetingHud.Instance) { __instance.KillButton.Hide(); return; diff --git a/TheOtherRoles/Patches/UsablesPatch.cs b/TheOtherRoles/Patches/UsablesPatch.cs index 1e75b6d..7bdb3dc 100644 --- a/TheOtherRoles/Patches/UsablesPatch.cs +++ b/TheOtherRoles/Patches/UsablesPatch.cs @@ -110,7 +110,7 @@ public static bool Prefix(Vent __instance) { bool canUse; bool couldUse; - __instance.CanUse(CachedPlayer.LocalPlayer.Data, out canUse, out couldUse); + __instance.CanUse(CachedPlayer.LocalPlayer.PlayerControl.Data, out canUse, out couldUse); bool canMoveInVents = CachedPlayer.LocalPlayer.PlayerControl != Spy.spy && CachedPlayer.LocalPlayer.PlayerControl != Jester.jester && !Madmate.madmate.Contains(CachedPlayer.LocalPlayer.PlayerControl) && CachedPlayer.LocalPlayer.PlayerControl != CreatedMadmate.createdMadmate; //&& !Trapper.playersOnMap.Contains(CachedPlayer.LocalPlayer.PlayerControl) if (CachedPlayer.LocalPlayer.PlayerControl == Engineer.engineer) canMoveInVents = true; if (!canUse) return false; // No need to execute the native method as using is disallowed anyways @@ -178,7 +178,7 @@ static void Postfix(VentButton __instance) { [HarmonyPatch(typeof(KillButton), nameof(KillButton.DoClick))] class KillButtonDoClickPatch { public static bool Prefix(KillButton __instance) { - if (__instance.isActiveAndEnabled && __instance.currentTarget && !__instance.isCoolingDown && !CachedPlayer.LocalPlayer.Data.IsDead && CachedPlayer.LocalPlayer.PlayerControl.CanMove) { + if (__instance.isActiveAndEnabled && __instance.currentTarget && !__instance.isCoolingDown && !CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && CachedPlayer.LocalPlayer.PlayerControl.CanMove) { // Ninja doesn't get teleported to the body on stealth bool showAnimation = true; if (CachedPlayer.LocalPlayer.PlayerControl == Ninja.ninja && Ninja.stealthed) @@ -984,7 +984,7 @@ private static void nightVisionUpdate(SurveillanceMinigame SkeldCamsMinigame = n isLightsOut = CachedPlayer.LocalPlayer.PlayerControl.myTasks.ToArray().Any(x => x.name.Contains("FixLightsTask")) || Trickster.lightsOutTimer > 0; - bool ignoreNightVision = CustomOptionHolder.camsNoNightVisionIfImpVision.getBool() && Helpers.hasImpVision(GameData.Instance.GetPlayerById(CachedPlayer.LocalPlayer.PlayerId)) || CachedPlayer.LocalPlayer.Data.IsDead; + bool ignoreNightVision = CustomOptionHolder.camsNoNightVisionIfImpVision.getBool() && Helpers.hasImpVision(GameData.Instance.GetPlayerById(CachedPlayer.LocalPlayer.PlayerId)) || CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; bool nightVisionEnabled = CustomOptionHolder.camsNightVision.getBool(); if (isLightsOut && !nightVisionIsActive && nightVisionEnabled && !ignoreNightVision) { // only update when something changed! diff --git a/TheOtherRoles/RPC.cs b/TheOtherRoles/RPC.cs index 68c58a7..5ab7518 100644 --- a/TheOtherRoles/RPC.cs +++ b/TheOtherRoles/RPC.cs @@ -1854,6 +1854,7 @@ public static void schrodingersCatSetTeam(byte team) SchrodingersCat.setCrewFlag(); break; } + if (CachedPlayer.LocalPlayer.PlayerControl == SchrodingersCat.schrodingersCat) _ = new StaticAchievementToken("schrodingersCat.another1"); } public static void placeAssassinTrace(byte[] buff) { @@ -1882,7 +1883,7 @@ public static void setInvisible(byte playerId, byte flag) target.setLook("", 6, "", "", "", ""); Color color = Color.clear; - bool canSee = CachedPlayer.LocalPlayer.Data.Role.IsImpostor || CachedPlayer.LocalPlayer.Data.IsDead; + bool canSee = CachedPlayer.LocalPlayer.PlayerControl.Data.Role.IsImpostor || CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead; if (canSee) color.a = 0.1f; target.cosmetics.currentBodySprite.BodySprite.color = color; target.cosmetics.colorBlindText.gameObject.SetActive(false); @@ -2002,7 +2003,8 @@ public static void cupidSuicide(byte cupidId, bool isScapegoat) { cupid.MurderPlayer(cupid, MurderResultFlags.Succeeded); GameHistory.overrideDeathReasonAndKiller(cupid, isScapegoat ? DeadPlayer.CustomDeathReason.Scapegoat : DeadPlayer.CustomDeathReason.Suicide); - if (MeetingHud.Instance) updateMeeting(cupidId); + if (MeetingHud.Instance) updateMeeting(cupidId); + if (CachedPlayer.LocalPlayer.PlayerControl == cupid) _ = new StaticAchievementToken("cupid.another1"); } } @@ -2755,12 +2757,12 @@ public static void guesserShoot(byte killerId, byte dyingTargetId, byte guessedT else if ((RoleId)guessedRoleId == RoleId.Shifter) guessedRoleInfo = RoleInfo.niceshifter; } string msg = ""; - if (CachedPlayer.LocalPlayer.Data.IsDead && guessedTarget != null && guesser != null) + if (CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && guessedTarget != null && guesser != null) { msg = string.Format(ModTranslation.getString("guesserGuessChat"), guesser.Data.PlayerName, guessedRoleInfo?.name ?? "", guessedTarget.Data.PlayerName); sender = guesser; } - else if (!CachedPlayer.LocalPlayer.Data.IsDead && (CachedPlayer.LocalPlayer.PlayerControl == Watcher.nicewatcher || CachedPlayer.LocalPlayer.PlayerControl == Watcher.evilwatcher) && Watcher.canSeeGuesses) + else if (!CachedPlayer.LocalPlayer.PlayerControl.Data.IsDead && (CachedPlayer.LocalPlayer.PlayerControl == Watcher.nicewatcher || CachedPlayer.LocalPlayer.PlayerControl == Watcher.evilwatcher) && Watcher.canSeeGuesses) msg = string.Format(ModTranslation.getString("watcherGuessChat"), guessedRoleInfo?.name ?? "", guessedTarget.Data.PlayerName); if (!string.IsNullOrEmpty(msg)) @@ -2979,7 +2981,7 @@ public static void huntedRewindTime(byte playerId) { if (p == 1f) FastDestroyableSingleton.Instance.FullScreen.enabled = false; }))); - if (!CachedPlayer.LocalPlayer.Data.Role.IsImpostor) return; // only rewind hunter + if (!CachedPlayer.LocalPlayer.PlayerControl.Data.Role.IsImpostor) return; // only rewind hunter TimeMaster.isRewinding = true; diff --git a/TheOtherRoles/Resources/Achievements.dat b/TheOtherRoles/Resources/Achievements.dat index 16e975d..0b5a18e 100644 --- a/TheOtherRoles/Resources/Achievements.dat +++ b/TheOtherRoles/Resources/Achievements.dat @@ -135,12 +135,17 @@ plagueDoctor.challenge,2, fox.common1,0, fox.challenge,2, immoralist.challenge,1, -bloody.common1,0,once, -bloody.challenge,2, -lover.common1,0,once, -lover.another1,0,once,secret, -lover.challenge,2, -tiebreaker.common1,0,once, -tiebreaker.challenge,2, -challenge.impostor,2, -challenge.crewmate,2, +akujo.common1,0,once, +akujo.common2,0,once, +akujo.challenge,2, +jekyllAndHyde.common1,0, +jekyllAndHyde.challenge,2, +moriarty.common1,0,once, +moriarty.challenge,2, +cupid.common1,0, +cupid.another1,1,secret, +cupid.challenge,2, +schrodingersCat.common1,0, +schrodingersCat.another1,1, +kataomoi.common1,0,once, +kataomoi.challenge,2, diff --git a/TheOtherRoles/Resources/stringData.json b/TheOtherRoles/Resources/stringData.json index dd2a79c..d5d4aa9 100644 --- a/TheOtherRoles/Resources/stringData.json +++ b/TheOtherRoles/Resources/stringData.json @@ -9278,6 +9278,234 @@ "0": "No More Annoying Shifters", "13": "\u5012\u53cd\u5929\u7f61" }, + "plagueDoctorcommon1AchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "plagueDoctorcommon1AchievementGoal": { + "0": "Infect One Player", + "13": "\u611f\u67d3\u4e00\u540d\u73a9\u5bb6" + }, + "plagueDoctorcommon1AchievementTitle": { + "0": "Infection!", + "13": "\u611f\u67d3\u6e90\uff01" + }, + "plagueDoctorchallengeAchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "plagueDoctorchallengeAchievementGoal": { + "0": "Infect All Players And Win The Game", + "13": "\u611f\u67d3\u6240\u6709\u73a9\u5bb6\u5e76\u80dc\u5229" + }, + "plagueDoctorchallengeAchievementTitle": { + "0": "Plague", + "13": "\u9ed1\u6b7b\u75c5" + }, + "foxcommon1AchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "foxcommon1AchievementGoal": { + "0": "Create An Immoralist", + "13": "\u8bf1\u60d1\u4e00\u4e2a\u80cc\u5fb7\u8005" + }, + "foxcommon1AchievementTitle": { + "0": "Immortal!", + "13": "\u6c38\u8fdc\u4e0d\u6b7b\uff01" + }, + "foxchallengeAchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "foxchallengeAchievementGoal": { + "0": "Steal The Impostors' Or The Crewmates' Victory", + "13": "\u5077\u8d70\u5185\u9b3c\u6216\u8239\u5458\u7684\u80dc\u5229" + }, + "foxchallengeAchievementTitle": { + "0": "No Work And All Gain", + "13": "\u8ba9\u4f60\u4eec\u767d\u6253\u5de5\uff01" + }, + "immoralistchallengeAchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "immoralistchallengeAchievementGoal": { + "0": "Commit Suicide To Protect The Fox", + "13": "\u81ea\u6740\u4ee5\u4fdd\u62a4\u72d0\u5996" + }, + "immoralistchallengeAchievementTitle": { + "0": "All For The Best", + "13": "\u4e00\u5207\u90fd\u662f\u6700\u597d\u7684\u5b89\u6392" + }, + "akujocommon1AchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "akujocommon1AchievementGoal": { + "0": "Make Someone Your Backup", + "13": "\u9009\u62e9\u4e00\u540d\u73a9\u5bb6\u5f53\u505a\u5907\u80ce" + }, + "akujocommon1AchievementTitle": { + "0": "Dump You Anytime", + "13": "\u968f\u65f6\u629b\u5f03" + }, + "akujocommon2AchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "akujocommon2AchievementGoal": { + "0": "Make Someone Your True Love", + "13": "\u9009\u62e9\u4e00\u540d\u73a9\u5bb6\u5f53\u505a\u771f\u7231" + }, + "akujocommon2AchievementTitle": { + "0": "Love You~", + "13": "\u6211\u7231\u4f60\uff01" + }, + "akujochallengeAchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "akujochallengeAchievementGoal": { + "0": "Win With Your True Love", + "13": "\u5728\u6e38\u620f\u7ed3\u675f\u65f6\u4e0e\u771f\u7231\u4e00\u8d77\u83b7\u80dc" + }, + "akujochallengeAchievementTitle": { + "0": "Manipulate Everyone!", + "13": "\u6765\u505a\u70b9\"\u5feb\u4e50\"\u7684\u4e8b\u60c5\u5427" + }, + "jekyllAndHydecommon1AchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "jekyllAndHydecommon1AchievementGoal": { + "0": "Use The Drug To Switch Personalities", + "13": "\u4f7f\u7528\u79d8\u836f\u5207\u6362\u4eba\u683c" + }, + "jekyllAndHydecommon1AchievementTitle": { + "0": "Who Am I", + "13": "\u6211\u7a76\u7adf\u662f\u8c01" + }, + "jekyllAndHydechallengeAchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "jekyllAndHydechallengeAchievementGoal": { + "0": "Kill Enough Players And Win The Game", + "13": "\u6740\u6b7b\u8db3\u591f\u591a\u7684\u73a9\u5bb6\u6765\u83b7\u5f97\u80dc\u5229" + }, + "jekyllAndHydechallengeAchievementTitle": { + "0": "Darkness Has Arrived", + "13": "\u9ed1\u6697\u964d\u4e34" + }, + "moriartycommon1AchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "moriartycommon1AchievementGoal": { + "0": "Brainwash A Player", + "13": "\u6d17\u8111\u4e00\u540d\u73a9\u5bb6" + }, + "moriartycommon1AchievementTitle": { + "0": "Perfect Crime", + "13": "\u5b8c\u7f8e\u7684\u72af\u7f6a" + }, + "moriartychallengeAchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "moriartychallengeAchievementGoal": { + "0": "Kill Enough Players Using Your Brainwash", + "13": "\u901a\u8fc7\u6d17\u8111\u6740\u6b7b\u8db3\u591f\u591a\u7684\u73a9\u5bb6" + }, + "moriartychallengeAchievementTitle": { + "0": "World Under Control", + "13": "\u7834\u706d\uff01" + }, + "cupidcommon1AchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "cupidcommon1AchievementGoal": { + "0": "Create A Pair Of Lovers", + "13": "\u521b\u9020\u4e00\u5bf9\u604b\u4eba" + }, + "cupidcommon1AchievementTitle": { + "0": "The One Who Shoots The Arrows", + "13": "\u5c04\u7bad\u7a7f\u5fc3\u4e4b\u4eba" + }, + "cupidchallengeAchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "cupidchallengeAchievementGoal": { + "0": "Win Together With The Lovers", + "13": "\u548c\u604b\u4eba\u4e00\u8d77\u83b7\u5f97\u80dc\u5229" + }, + "cupidchallengeAchievementTitle": { + "0": "True Love Never Dies", + "13": "\u771f\u7231\u4e0d\u6b7b" + }, + "cupidanother1AchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "cupidanother1AchievementGoal": { + "0": "Scapegoat And Protect The Lovers", + "13": "\u66ff\u6b7b\u4ee5\u4fdd\u62a4\u604b\u4eba" + }, + "cupidanother1AchievementTitle": { + "0": "I Have Done My Duty", + "13": "\u606a\u5c3d\u804c\u5b88" + }, + "schrodingersCatcommon1AchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "schrodingersCatcommon1AchievementGoal": { + "0": "Get Killed And Join The Killer's Team", + "13": "\u901a\u8fc7\u88ab\u51fb\u6740\u52a0\u5165\u51f6\u624b\u9635\u8425" + }, + "schrodingersCatcommon1AchievementTitle": { + "0": "A Cat Has Nine Lives", + "13": "\u732b\u6709\u4e5d\u6761\u547d\uff01" + }, + "schrodingersCatanother1AchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "schrodingersCatanother1AchievementGoal": { + "0": "Switch Teams When All Tasks Completed", + "13": "\u5b8c\u6210\u4efb\u52a1\u540e\u5207\u6362\u9635\u8425" + }, + "schrodingersCatanother1AchievementTitle": { + "0": "Choose Whatever I Want", + "13": "\u5c0f\u5b69\u5b50\u624d\u505a\u9009\u62e9, \u6211\u5168\u90fd\u8981\uff01" + }, + "kataomoicommon1AchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "kataomoicommon1AchievementGoal": { + "0": "Stare Your Target", + "13": "\u51dd\u89c6\u4f60\u7684\u76ee\u6807" + }, + "kataomoicommon1AchievementTitle": { + "0": "Seeing You Makes Me Happy", + "13": "\u770b\u89c1\u4f60\u8ba9\u6211\u9ad8\u5174" + }, + "kataomoichallengeAchievementCond": { + "0": "[BLANK]", + "13": "[BLANK]" + }, + "kataomoichallengeAchievementGoal": { + "0": "Kill Your Target And Win The Game", + "13": "\u6740\u6b7b\u51dd\u89c6\u76ee\u6807\u5e76\u83b7\u5f97\u80dc\u5229" + }, + "kataomoichallengeAchievementTitle": { + "0": "I Hope I Can See Love More...", + "13": "\u6211\u5e0c\u671b\u6211\u80fd\u61c2\u5f97\u7231\u60c5\u7684\u7f8e\u597d..." + }, "hintHelpInGameTitle": { "0": "Role Help", "13": "\u89d2\u8272\u89e3\u91ca" diff --git a/TheOtherRoles/RoleInfo.cs b/TheOtherRoles/RoleInfo.cs index 3b62462..fffa8c7 100644 --- a/TheOtherRoles/RoleInfo.cs +++ b/TheOtherRoles/RoleInfo.cs @@ -398,7 +398,7 @@ public static String GetRolesString(PlayerControl p, bool useColors, bool showMo if (p == Shifter.shifter && (CachedPlayer.LocalPlayer.PlayerControl == Shifter.shifter || Helpers.shouldShowGhostInfo()) && Shifter.futureShift != null) roleName += Helpers.cs(Color.yellow, " ← " + Shifter.futureShift.Data.PlayerName); if (p == Vulture.vulture && (CachedPlayer.LocalPlayer.PlayerControl == Vulture.vulture || Helpers.shouldShowGhostInfo())) - roleName = roleName + Helpers.cs(Vulture.color, $" ({Vulture.vultureNumberToWin - Vulture.eatenBodies} {ModTranslation.getString("roleInfoRemaining")})"); + roleName += Helpers.cs(Vulture.color, $" ({Vulture.vultureNumberToWin - Vulture.eatenBodies} {ModTranslation.getString("roleInfoRemaining")})"); if (Helpers.shouldShowGhostInfo()) { if (Eraser.futureErased.Contains(p)) roleName = Helpers.cs(Color.gray, ModTranslation.getString("roleInfoErased")) + roleName; @@ -425,7 +425,7 @@ public static String GetRolesString(PlayerControl p, bool useColors, bool showMo if (Arsonist.dousedPlayers.Contains(p)) roleName = Helpers.cs(Arsonist.color, "♨ ") + roleName; if (p == Arsonist.arsonist) - roleName = roleName + Helpers.cs(Arsonist.color, $" ({CachedPlayer.AllPlayers.Count(x => { return x.PlayerControl != Arsonist.arsonist && !x.Data.IsDead && !x.Data.Disconnected && !Arsonist.dousedPlayers.Any(y => y.PlayerId == x.PlayerId); })} {ModTranslation.getString("roleInfoRemaining")})"); + roleName += Helpers.cs(Arsonist.color, $" ({CachedPlayer.AllPlayers.Count(x => { return x.PlayerControl != Arsonist.arsonist && !x.PlayerControl.Data.IsDead && !x.PlayerControl.Data.Disconnected && !Arsonist.dousedPlayers.Any(y => y.PlayerId == x.PlayerControl.PlayerId); })} {ModTranslation.getString("roleInfoRemaining")})"); if (p == Jackal.fakeSidekick) roleName = Helpers.cs(Sidekick.color, ModTranslation.getString("roleInfoFakeSD")) + roleName; if (Akujo.keeps.Contains(p)) @@ -512,7 +512,7 @@ public static String GetRolesString(PlayerControl p, bool useColors, bool showMo deathReasonString = string.Format(ModTranslation.getString("roleSummaryTorched"), Helpers.cs(killerColor, deadPlayer.killerIfExisting.Data.PlayerName)); break; } - roleName = roleName + deathReasonString; + roleName += deathReasonString; } } } diff --git a/TheOtherRoles/TheOtherRoles.cs b/TheOtherRoles/TheOtherRoles.cs index 8738c7d..4e25ee6 100644 --- a/TheOtherRoles/TheOtherRoles.cs +++ b/TheOtherRoles/TheOtherRoles.cs @@ -1515,7 +1515,7 @@ public static Sprite getIgniteSprite() { } public static bool dousedEveryoneAlive() { - return CachedPlayer.AllPlayers.All(x => { return x.PlayerControl == Arsonist.arsonist || x.Data.IsDead || x.Data.Disconnected || Arsonist.dousedPlayers.Any(y => y.PlayerId == x.PlayerId); }); + return CachedPlayer.AllPlayers.All(x => { return x.PlayerControl == Arsonist.arsonist || x.PlayerControl.Data.IsDead || x.PlayerControl.Data.Disconnected || Arsonist.dousedPlayers.Any(y => y.PlayerId == x.PlayerControl.PlayerId); }); } public static void clearAndReload() { @@ -4598,7 +4598,7 @@ public static class Moriarty public static PlayerControl target; public static PlayerControl currentTarget; public static PlayerControl killTarget; - public static List brainwashed; + public static List brainwashed = new(); public static int counter; diff --git a/TheOtherRoles/TheOtherRoles.csproj b/TheOtherRoles/TheOtherRoles.csproj index c5b8199..649b9ca 100644 --- a/TheOtherRoles/TheOtherRoles.csproj +++ b/TheOtherRoles/TheOtherRoles.csproj @@ -25,10 +25,10 @@ - - + + - + diff --git a/TheOtherRoles/packages.lock.json b/TheOtherRoles/packages.lock.json index 9170f6f..bb46f98 100644 --- a/TheOtherRoles/packages.lock.json +++ b/TheOtherRoles/packages.lock.json @@ -4,9 +4,9 @@ "net6.0": { "AmongUs.GameLibs.Steam": { "type": "Direct", - "requested": "[2024.6.18, )", - "resolved": "2024.6.18", - "contentHash": "xb+HP1xXn4/ES8AgXpk9xeoW568LFYw5NTjY6bHwd6vQjHDf2kT1xHMmQ1me5Vfee/Gp69YIMZDXUAUToG7Elg==" + "requested": "[2024.10.29, )", + "resolved": "2024.10.29", + "contentHash": "znuLMD9DRMTp7RMfIz3hts5KUljioPZ1TiuodgyFrH3mDEcOLZtn1sA08AU9pUzsgQA9hzikrrzP+sJIsPqZ9g==" }, "BepInEx.IL2CPP.MSBuild": { "type": "Direct", @@ -16,93 +16,105 @@ }, "BepInEx.Unity.IL2CPP": { "type": "Direct", - "requested": "[6.0.0-be.671, )", - "resolved": "6.0.0-be.671", - "contentHash": "XpmrBitEO7pe5YG9VHqn0nuelEF5Dp0Rpkxa2F7PFZF1a00KSsdCL809++HYnGzLumNOCIt7mO7yyDNP5k25mw==", + "requested": "[6.0.0-be.725, )", + "resolved": "6.0.0-be.725", + "contentHash": "lb6atWrBnVnQVOlaLBF3irZlbnA8gI46Jw/YlLBaeGra14W0q4aPVjUO5ODaBFzq/U0e7iAxzUNzesp3WPJ/tA==", "dependencies": { - "BepInEx.Core": "6.0.0-be.671", - "BepInEx.Unity.Common": "6.0.0-be.671", - "HarmonyX": "2.10.1", - "Iced": "1.18.0", - "Il2CppInterop.Generator": "1.4.6-ci.367", - "Il2CppInterop.HarmonySupport": "1.4.6-ci.367", - "Il2CppInterop.Runtime": "1.4.6-ci.367", - "MonoMod.RuntimeDetour": "22.5.1.1", - "Samboy063.Cpp2IL.Core": "2022.1.0-development.866" + "BepInEx.Core": "6.0.0-be.725", + "BepInEx.Unity.Common": "6.0.0-be.725", + "HarmonyX": "2.10.2", + "Iced": "1.21.0", + "Il2CppInterop.Generator": "1.4.6-ci.426", + "Il2CppInterop.HarmonySupport": "1.4.6-ci.426", + "Il2CppInterop.Runtime": "1.4.6-ci.426", + "MonoMod.RuntimeDetour": "22.7.31.1", + "Samboy063.Cpp2IL.Core": "2022.1.0-pre-release.18" } }, "Reactor": { "type": "Direct", - "requested": "[2.2.0, )", - "resolved": "2.2.0", - "contentHash": "foMHya01tmr//3tw+kO7FmY1ojnR0m+ShMU6sxogbnWeO85lmX3QM8aSIsYeAhtJSThf6Ben6iTM4O0KgVcmqw==", + "requested": "[2.3.1, )", + "resolved": "2.3.1", + "contentHash": "CsFs84aM3PA6+74TzHEAUayXOosYBJEJKf1Ebs3CpL10RMLrj+WRAWrpgFoNd9qS+pIzQflW76Q5Pgg/aOQ40w==", "dependencies": { - "BepInEx.Unity.IL2CPP": "6.0.0-be.670" + "BepInEx.Unity.IL2CPP": "6.0.0-be.679" } }, "AsmResolver": { "type": "Transitive", - "resolved": "5.1.0", - "contentHash": "7PjujQzgQ3wjzqZYT4CY8SV6zx7FY6swIwj3Yk4QLolLqo9sBPb7FLF3W30QFvCsCkNfiVWXlSbeZKs4xGgQOQ==" + "resolved": "6.0.0-beta.1", + "contentHash": "M5btCR/rmrx32jZsoN6CLQ/VQk8lN8hvPb6lgojua7pjNoo7StAl92koMC8qz4vzZyH2CNqxLSDoswRvyyK/vA==" }, "AsmResolver.DotNet": { "type": "Transitive", - "resolved": "5.1.0", - "contentHash": "oKrBU94OaSrbbTwydvpLRFalYxozrNXGkl13nIkm823ZFQtPNYOiOMJb5DQLvkCJlWyis7q865tg803T5zg9IA==", + "resolved": "6.0.0-beta.1", + "contentHash": "PTq8nNQvhgTxF1iARCknffCsu7Iq9B0kN7TVC8iMaU7uEYog3xvVqH/0+TreY8GW74/+MqhZt/yEFsvS4oAduQ==", "dependencies": { - "AsmResolver.PE": "5.1.0", - "System.Text.Json": "6.0.7" + "AsmResolver.PE": "6.0.0-beta.1" } }, "AsmResolver.PE": { "type": "Transitive", - "resolved": "5.1.0", - "contentHash": "XD3iAgLSInJIODKUUlpHWXf8MR9H1SFMb1lsmabb4GxxxnDQRPjMxjglv2NOCjQQuNB2Oh0bvjHE7ewf82UqyQ==", + "resolved": "6.0.0-beta.1", + "contentHash": "KadLvx/zzFCJyF+E4jG6jPE1d0iJquzL6+hm8GBivBAs6nwHC8s6g4c857QwQCzXMWza6Vz5Q+3hFiNuOfKaWQ==", "dependencies": { - "AsmResolver.PE.File": "5.1.0" + "AsmResolver.PE.File": "6.0.0-beta.1" } }, "AsmResolver.PE.File": { "type": "Transitive", - "resolved": "5.1.0", - "contentHash": "YituBYe0Fh471sXQMfu+f4tWKX/JZvRwrX6g/SVsr4XkUIUzYi/aGT3/QvjHoYx19fE1KYOB6zBKqPkkOK7HPw==", + "resolved": "6.0.0-beta.1", + "contentHash": "+lusB9UMHevI5aQsu73NQ1ctPMLFvyHAsEf8vjaJ/py+kX1DkU0JkbERtBRmaf58/hBZ7cyrE7gFnjoo7Bbg7A==", "dependencies": { - "AsmResolver": "5.1.0" + "AsmResolver": "6.0.0-beta.1" } }, - "AssetRipper.VersionUtilities": { + "AssetRipper.CIL": { "type": "Transitive", - "resolved": "1.3.1", - "contentHash": "/1D18NOpqm7rS7+qVUbAReVMNWwgDuYpsnf0RkX1Aah/I0a0irqldoFJ+Kku7YdbSm0zqD+Z6iYUGKoP3GwTNQ==" + "resolved": "1.1.0", + "contentHash": "nSz1cBjgVeKv+esfDtyQGC1mY9b4C4NFStytdoa9DMozDC8uth6930kAsuWZEivj9GqWSqENnaQUGnl23WpmnQ==", + "dependencies": { + "AsmResolver.DotNet": "6.0.0-beta.1" + } + }, + "AssetRipper.Gee.External.Capstone": { + "type": "Transitive", + "resolved": "2.3.2", + "contentHash": "wOr5PQPL/2ZfD7+ebt6cpRbUhSzSY5nlHGHjjzuQRiU5zkQlqQNwWDLX0M3smrm5IkaDvONkmDjFMKTlZJmyuQ==" + }, + "AssetRipper.Primitives": { + "type": "Transitive", + "resolved": "3.1.3", + "contentHash": "djZbN/+EXmI+Oia9Pm0LyjZVCPLf60TPSL5rGb7mBEYM5F4CN3nPFXvl2yA5LanPZoHS1Yq7PghGUmkP7Pv9RQ==" }, "BepInEx.Core": { "type": "Transitive", - "resolved": "6.0.0-be.671", - "contentHash": "Hp9QsgwtlGuNULFq5tF8YHrVD5R5WA5nMgFTJbcScWsGJDq7KPEhiLNGvKHAxcmMM8GA0CKM+jn8cJPtlMKvNQ==", + "resolved": "6.0.0-be.725", + "contentHash": "xBqYH8OtmEfwe7ZRvQDkJF4cPRgyoykcYRXcuszeVWI+0e/7IYZ316wT3HhRU/GLQE6FijuMFGag73jTxMmoxA==", "dependencies": { - "HarmonyX": "2.10.1", - "MonoMod.Utils": "22.5.1.1", + "HarmonyX": "2.10.2", + "MonoMod.Utils": "22.7.31.1", "SemanticVersioning": "2.0.2" } }, "BepInEx.Unity.Common": { "type": "Transitive", - "resolved": "6.0.0-be.671", - "contentHash": "05W7ERsHizZl0MacTAhiGkcihZl2b0DYBP0e6gA1Vzoay+teQ/mHy3zorGu1r8lLWlesH4LXl89HwFjrMA1ZKw==", + "resolved": "6.0.0-be.725", + "contentHash": "2onnkxl2Ai88JwhxXXZld6bKjICwhLav/msfK9tIVJObCcxJkvWWGGXmUD+KquQtKjNj4hrExWwZa+zPnbUsTA==", "dependencies": { - "AssetRipper.VersionUtilities": "1.2.1", - "MonoMod.Utils": "22.5.1.1" + "AssetRipper.Primitives": "3.1.3", + "MonoMod.Utils": "22.7.31.1" } }, "Disarm": { "type": "Transitive", - "resolved": "2022.1.0-master.26", - "contentHash": "YnZEbRGr0nG+N3G8WbRQ4Lkg8dTD3oso9iJlCVBmyhEyhLyqs+drBs1kWQbQqFPnb9mi/RJ++R9bPb+L3HF03Q==" + "resolved": "2022.1.0-master.34", + "contentHash": "sxzTci5eSdl+sFoaGsMZIp7X/eB5ZzplM3CppvD1CWoiZ8rSa43XGLC19G5e8n6mjutNBfN9yL+RER5PCspHFg==" }, "HarmonyX": { "type": "Transitive", - "resolved": "2.10.1", - "contentHash": "9LodMC9Y0u1TW96eKJoWrFJFpmzbgojEO38/Q+e7c1mFPhmHt8xcR8qhI06iF1rf0Dnsk+hqENFVSgbtwl/bEw==", + "resolved": "2.10.2", + "contentHash": "/5WwkxXX8mPsRuigQt957rJGx1f0dDQxk+bvk4yYITKFjXas9Em+O71zEP8X0ym8OFQQ2XH/2SxS4NC7vEC+Xg==", "dependencies": { "MonoMod.RuntimeDetour": "22.3.23.4", "System.Reflection.Emit": "4.7.0" @@ -110,13 +122,13 @@ }, "Iced": { "type": "Transitive", - "resolved": "1.18.0", - "contentHash": "G60lZOvbvqttA+SBSv/yY6/wUboXKJlkffhSNR9iOrx0M5gpcK1TRr6xrFR+qAhqIAhvrsPF1jkn9fYb4lEufQ==" + "resolved": "1.21.0", + "contentHash": "dv5+81Q1TBQvVMSOOOmRcjJmvWcX3BZPZsIq31+RLc5cNft0IHAyNlkdb7ZarOWG913PyBoFDsDXoCIlKmLclg==" }, "Il2CppInterop.Common": { "type": "Transitive", - "resolved": "1.4.6-ci.367", - "contentHash": "zviSAk0COGdxx1KLTJlSi6lyvfRjbPO4qhj9RvLAU5zP74hwAkjhim0WsSo9clkkyGS+KXDrjnUEHqfXuMMm9Q==", + "resolved": "1.4.6-ci.426", + "contentHash": "pI0kU0qqJKMP6z9eFz4+WJtGIwklfPxW2yWEY9vKnrN9bbYMusK3v5uFWV8al7S/HPSATV5jNWH1hyTvP7kglA==", "dependencies": { "Iced": "1.17.0", "Microsoft.Extensions.Logging.Abstractions": "6.0.1", @@ -125,36 +137,31 @@ }, "Il2CppInterop.Generator": { "type": "Transitive", - "resolved": "1.4.6-ci.367", - "contentHash": "VP/1LX3wEy0/5BCrgggzIm9niyRGp/zjXaxFJip1D2bvM7oIXwK0LR0Rp8BE/uxKW8aQjVYxxwVwsdXPS/1KZw==", + "resolved": "1.4.6-ci.426", + "contentHash": "kecdx/vbNl0RtfzfYW592jU8PMyq1JbzpvoJSvqwO+tV6icp9SljXy6yG8bT/wt0gaPj9mFUNDTe2Wu6M6XGZQ==", "dependencies": { - "Il2CppInterop.Common": "1.4.6-ci.367", + "Il2CppInterop.Common": "1.4.6-ci.426", "Mono.Cecil": "0.11.3" } }, "Il2CppInterop.HarmonySupport": { "type": "Transitive", - "resolved": "1.4.6-ci.367", - "contentHash": "rKb4Bt4cZQNWtI1L1/n/m5jJelP8pwAcQHwN/gaUAcobnapGZPJvRp8gyLQRvthGm3sxeleIQelEsv6L+21A2g==", + "resolved": "1.4.6-ci.426", + "contentHash": "rd2T5o6SybIc12hmX3HktTF5n27hFb0w4mNSExq7h1YsmrNlt7x+Ac1MBnnB0JwPLIg7w8LjnKjoIX6Gf626ng==", "dependencies": { "HarmonyX": "2.10.0", - "Il2CppInterop.Runtime": "1.4.6-ci.367" + "Il2CppInterop.Runtime": "1.4.6-ci.426" } }, "Il2CppInterop.Runtime": { "type": "Transitive", - "resolved": "1.4.6-ci.367", - "contentHash": "Wb4rj/ESlfiYljfVXskndbkYNSX1WxPcsylrYex39QnVzujk6tRQUbHLA7PZn509z6P5wYbqJvhodzJ+w9Kk4A==", + "resolved": "1.4.6-ci.426", + "contentHash": "0O0oI7gOqJixrsjvh1firhuGYK3Yr0uDLp6Q+t5CfcTMmeEX8Plk3pqAP9ZYyilBvh7uW0gv4Golqz08L1GXug==", "dependencies": { "Iced": "1.17.0", - "Il2CppInterop.Common": "1.4.6-ci.367" + "Il2CppInterop.Common": "1.4.6-ci.426" } }, - "js6pak.Gee.External.Capstone": { - "type": "Transitive", - "resolved": "2.1.0", - "contentHash": "YYpq7NM50bSSVUDjXyV/eiITk6syXqItPjKBOb3jEWS6RFsk0DNhpWMPW6b3hKDmArARuWDU6S2pVu1IeVrvIA==" - }, "Microsoft.Extensions.Logging.Abstractions": { "type": "Transitive", "resolved": "6.0.1", @@ -177,11 +184,11 @@ }, "MonoMod.RuntimeDetour": { "type": "Transitive", - "resolved": "22.5.1.1", - "contentHash": "WG5zLRuAr8KJEnIkKTuIG1OJCrGIT3pjvnAD43E0FDchHf3Dp985MF/8tmIQvAzCZV87JNs6QKeGGqmwDmpXpw==", + "resolved": "22.7.31.1", + "contentHash": "nxVJTvQbWAujaogt5XX3eAy7d22t66Z88aWg9sirPLO9rR/6yNCHAyZpgxXrOsIobZVW0IEZPqNMOBhgke25/w==", "dependencies": { "Mono.Cecil": "0.11.4", - "MonoMod.Utils": "22.5.1.1", + "MonoMod.Utils": "22.7.31.1", "System.Collections.NonGeneric": "4.3.0", "System.ComponentModel.TypeConverter": "4.3.0", "System.IO.FileSystem.Primitives": "4.3.0", @@ -192,8 +199,8 @@ }, "MonoMod.Utils": { "type": "Transitive", - "resolved": "22.5.1.1", - "contentHash": "vBObO1atXxhi2C4AuC53y87Bqeogi9xIrD1Ym3YWr5uxc8Nrm8SrsFeD1i3x04R999+XQ3FdeHrbXScyWYEHqQ==", + "resolved": "22.7.31.1", + "contentHash": "nI0E1oadXS1iMbfwfCzYF08C1jRQR9cnnHv66a4BSPd4sGu2p6g4BmctCWsdAB6oGKkSJUhcfHfxcfTsDyB94Q==", "dependencies": { "Mono.Cecil": "0.11.4", "System.Collections.NonGeneric": "4.3.0", @@ -304,30 +311,31 @@ }, "Samboy063.Cpp2IL.Core": { "type": "Transitive", - "resolved": "2022.1.0-development.866", - "contentHash": "QPMuix/3jRngWBdNSLhAbm9BHYf95Ln1Ph1eCK/cDZdVibxFDFP3a6Yczyx1p7GbN7bRQwrhs2skPJSS/z3m2w==", + "resolved": "2022.1.0-pre-release.18", + "contentHash": "eX9d1IK05jWaEaeuMAE0L5WYHT7thtxz+aWLL/CAaCzZ0TzRPD+WFTjJ0KQO0YWBVO300CX3GwmPmf7TNO+wUg==", "dependencies": { - "AsmResolver.DotNet": "5.1.0", - "Disarm": "2022.1.0-master.26", - "Iced": "1.18.0", - "Samboy063.LibCpp2IL": "2022.1.0-development.866", - "StableNameDotNet": "0.1.0-development.866", - "js6pak.Gee.External.Capstone": "2.1.0" + "AsmResolver.DotNet": "6.0.0-beta.1", + "AssetRipper.CIL": "1.1.0", + "AssetRipper.Gee.External.Capstone": "2.3.2", + "Disarm": "2022.1.0-master.34", + "Iced": "1.21.0", + "Samboy063.LibCpp2IL": "2022.1.0-pre-release.18", + "StableNameDotNet": "0.1.0-pre-release.15" } }, "Samboy063.LibCpp2IL": { "type": "Transitive", - "resolved": "2022.1.0-development.866", - "contentHash": "EcJSWTfQko8SQozozoUT+aQJVWC8wj8C0YUiPBF4rNRId19yTKp2IXcXnI747v+8/aal222QR6WHfoBK2WlVLg==", + "resolved": "2022.1.0-pre-release.18", + "contentHash": "9zJdTAeErpwJpYDHYwwI0MAC1OyBEfC1ce7dpAOYRUUYCfeaKVWxnSCcyaoY6HDzIoxPkhbfllbwOe49ZmUYuQ==", "dependencies": { - "AssetRipper.VersionUtilities": "1.3.1", - "Samboy063.WasmDisassembler": "2022.1.0-development.866" + "AssetRipper.Primitives": "3.1.2", + "Samboy063.WasmDisassembler": "2022.1.0-pre-release.15" } }, "Samboy063.WasmDisassembler": { "type": "Transitive", - "resolved": "2022.1.0-development.866", - "contentHash": "2QK8F3eISkLcoW/Nt7wtxyQh31EXAqEMBVXXjEnuxyvXpBXxOIGpjmE3pWhGwxQwDCbe4zBsLF1zUiqq3/pXRA==" + "resolved": "2022.1.0-pre-release.15", + "contentHash": "e6qw81SHS+fS7iZ3qfqZBavVarYbkPElNgDCANF6dNFTYq5+hc80am+4FqQDl+ZVNS47bZDZobxIzHhmriCXGg==" }, "SemanticVersioning": { "type": "Transitive", @@ -336,8 +344,8 @@ }, "StableNameDotNet": { "type": "Transitive", - "resolved": "0.1.0-development.866", - "contentHash": "DJb8x4dV3ucDgM12sU28HxCdeqY/JudJbeJG6mgXWDJzpFZw2Jd7JF1pKFRNLzh/0gpo8bCGLQS9gOWZmBjdtg==" + "resolved": "0.1.0-pre-release.15", + "contentHash": "aIkEOo8V76vE+9CppHpTFLGXalBw6TAl4/tb6vadmS+gHJMshTVehzQv9cJXy4xZDdANV1uGMRaUFZERcDA2xQ==" }, "System.Collections": { "type": "Transitive", @@ -664,11 +672,6 @@ "Microsoft.NETCore.Targets": "1.1.0" } }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" - }, "System.Runtime.Extensions": { "type": "Transitive", "resolved": "4.3.0", @@ -867,23 +870,6 @@ "System.Runtime": "4.3.0" } }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "6.0.7", - "contentHash": "/Tf/9XjprpHolbcDOrxsKVYy/mUG/FS7aGd9YUgBVEiHeQH4kAE0T1sMbde7q6B5xcrNUsJ5iW7D1RvHudQNqA==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encodings.Web": "6.0.0" - } - }, "System.Threading": { "type": "Transitive", "resolved": "4.3.0",