├── ModsThanos ├── Resources │ ├── arrow.png │ ├── mind.png │ ├── portal.png │ ├── power.png │ ├── snap.png │ ├── soul.png │ ├── space.png │ ├── time.png │ ├── reality.png │ ├── anim-mind.png │ ├── anim-pickup.png │ ├── anim-power.png │ ├── anim-space.png │ ├── anim-time.png │ └── anim-reality.png ├── ModsThanos.csproj.user ├── Utility │ ├── Enumerations │ │ ├── KillDistance.cs │ │ ├── DeathReason.cs │ │ ├── Visibility.cs │ │ ├── MapType.cs │ │ ├── ColorType.cs │ │ ├── PetType.cs │ │ ├── SkinType.cs │ │ ├── RpcCalls.cs │ │ └── HatType.cs │ ├── Draw.cs │ ├── AnimatedTexture.cs │ ├── PlayerControlUtils.cs │ ├── HelperSprite.cs │ ├── Utils.cs │ ├── RandomPosition.cs │ └── CooldownButton.cs ├── Patch │ ├── BanPatch.cs │ ├── VersionShowerPatch.cs │ ├── IntroCutScenePatch.cs │ ├── ServerRegionPatch.cs │ ├── PingTrackerPatch.cs │ ├── VentPatch.cs │ ├── GameSettingsPatch.cs │ ├── PlayerUpdatePatch.cs │ ├── TasksPatch.cs │ ├── HatManagerHatsPatch.cs │ ├── EndGamePatch.cs │ ├── SetInfectedPatch.cs │ ├── HudPatch.cs │ ├── MeetingPatch.cs │ ├── StartPatch.cs │ └── HandleRpcPatch.cs ├── RoleHelper.cs ├── Stone │ ├── Map │ │ ├── Mind.cs │ │ ├── Time.cs │ │ ├── Power.cs │ │ ├── Space.cs │ │ ├── Reality.cs │ │ └── Soul.cs │ ├── Soul.cs │ ├── Space.cs │ ├── Power.cs │ ├── Mind.cs │ ├── System │ │ ├── Mind │ │ │ ├── PlayerData.cs │ │ │ └── Mind.cs │ │ ├── Time │ │ │ ├── TimePoint.cs │ │ │ └── Time.cs │ │ ├── Power.cs │ │ ├── Snap.cs │ │ ├── Reality.cs │ │ └── Space.cs │ ├── Reality.cs │ ├── Time.cs │ ├── Snap.cs │ └── StoneManager.cs ├── CustomRPC.cs ├── GlobalVariable.cs ├── ResourceLoader.cs ├── ModsThanos.csproj ├── ModsThanos.cs ├── GemBehaviour.cs └── CustomGameOptions.cs ├── .gitignore ├── ModsThanos.sln ├── README.md ├── README.fr.md └── LICENSE /ModsThanos/Resources/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardel-DW/ModsThanos/HEAD/ModsThanos/Resources/arrow.png -------------------------------------------------------------------------------- /ModsThanos/Resources/mind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardel-DW/ModsThanos/HEAD/ModsThanos/Resources/mind.png -------------------------------------------------------------------------------- /ModsThanos/Resources/portal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardel-DW/ModsThanos/HEAD/ModsThanos/Resources/portal.png -------------------------------------------------------------------------------- /ModsThanos/Resources/power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardel-DW/ModsThanos/HEAD/ModsThanos/Resources/power.png -------------------------------------------------------------------------------- /ModsThanos/Resources/snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardel-DW/ModsThanos/HEAD/ModsThanos/Resources/snap.png -------------------------------------------------------------------------------- /ModsThanos/Resources/soul.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardel-DW/ModsThanos/HEAD/ModsThanos/Resources/soul.png -------------------------------------------------------------------------------- /ModsThanos/Resources/space.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardel-DW/ModsThanos/HEAD/ModsThanos/Resources/space.png -------------------------------------------------------------------------------- /ModsThanos/Resources/time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardel-DW/ModsThanos/HEAD/ModsThanos/Resources/time.png -------------------------------------------------------------------------------- /ModsThanos/Resources/reality.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardel-DW/ModsThanos/HEAD/ModsThanos/Resources/reality.png -------------------------------------------------------------------------------- /ModsThanos/Resources/anim-mind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardel-DW/ModsThanos/HEAD/ModsThanos/Resources/anim-mind.png -------------------------------------------------------------------------------- /ModsThanos/Resources/anim-pickup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardel-DW/ModsThanos/HEAD/ModsThanos/Resources/anim-pickup.png -------------------------------------------------------------------------------- /ModsThanos/Resources/anim-power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardel-DW/ModsThanos/HEAD/ModsThanos/Resources/anim-power.png -------------------------------------------------------------------------------- /ModsThanos/Resources/anim-space.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardel-DW/ModsThanos/HEAD/ModsThanos/Resources/anim-space.png -------------------------------------------------------------------------------- /ModsThanos/Resources/anim-time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardel-DW/ModsThanos/HEAD/ModsThanos/Resources/anim-time.png -------------------------------------------------------------------------------- /ModsThanos/Resources/anim-reality.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hardel-DW/ModsThanos/HEAD/ModsThanos/Resources/anim-reality.png -------------------------------------------------------------------------------- /ModsThanos/ModsThanos.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ModsThanos/Utility/Enumerations/KillDistance.cs: -------------------------------------------------------------------------------- 1 | namespace ModsThanos.Utility.Enumerations { 2 | public enum KillDistance { 3 | Short = 0, 4 | Medium = 1, 5 | Long = 2, 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ModsThanos/Utility/Enumerations/DeathReason.cs: -------------------------------------------------------------------------------- 1 | namespace ModsThanos.Utility.Enumerations { 2 | public enum DeathReason 3 | { 4 | Exile = 0, 5 | Kill = 1, 6 | Disconnect = 2 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ############ 2 | # Binaries # 3 | ############ 4 | bin/ 5 | obj/ 6 | 7 | ############################# 8 | # Specific to Visual Studio # 9 | ############################# 10 | .vs/ 11 | .user 12 | Untitled-1.sql 13 | -------------------------------------------------------------------------------- /ModsThanos/Utility/Enumerations/Visibility.cs: -------------------------------------------------------------------------------- 1 | namespace ModsThanos.Utility.Enumerations { 2 | public enum Visibility : byte { 3 | Everyone = 1, 4 | OnlyCrewmate = 2, 5 | OnlyImpostor = 3 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ModsThanos/Utility/Enumerations/MapType.cs: -------------------------------------------------------------------------------- 1 | namespace ModsThanos.Utility.Enumerations { 2 | public enum MapType 3 | { 4 | Skeld = 0, 5 | MiraHQ = 1, 6 | Polus = 2, 7 | Airship = 3, // Just guessing 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ModsThanos/Patch/BanPatch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace ModsThanos.Patch { 4 | [HarmonyPatch(typeof(StatsManager), nameof(StatsManager.AmBanned), MethodType.Getter)] 5 | public static class BanPatch { 6 | public static void Postfix(out bool __result) { 7 | __result = false; 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /ModsThanos/Patch/VersionShowerPatch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace ModsThanos.Patch { 4 | 5 | [HarmonyPatch(typeof(VersionShower), nameof(VersionShower.Start))] 6 | public static class VersionShowerPatch { 7 | public static void Postfix() { 8 | Reactor.Patches.ReactorVersionShower.Text.Text += " + [BF00D6FF]Thanos[] Mod par Hardel - Serveur de Cheep-YT.com"; 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /ModsThanos/Utility/Enumerations/ColorType.cs: -------------------------------------------------------------------------------- 1 | namespace ModsThanos.Utility.Enumerations { 2 | public enum ColorType : byte 3 | { 4 | Red = 0, 5 | Blue = 1, 6 | Green = 2, 7 | Pink = 3, 8 | Orange = 4, 9 | Yellow = 5, 10 | Black = 6, 11 | White = 7, 12 | Purple = 8, 13 | Brown = 9, 14 | Cyan = 10, 15 | Lime = 11, 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ModsThanos/Utility/Enumerations/PetType.cs: -------------------------------------------------------------------------------- 1 | namespace ModsThanos.Utility.Enumerations { 2 | public enum PetType 3 | { 4 | NoPet = 0, 5 | Alien = 1, 6 | Crewmate = 2, 7 | Doggy = 3, 8 | Stickmin = 4, 9 | Hamster = 5, 10 | Robot = 6, 11 | Ufo = 7, 12 | Ellie = 8, 13 | Squig = 9, 14 | Bedcrab = 10, 15 | Glitch = 11, 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ModsThanos/RoleHelper.cs: -------------------------------------------------------------------------------- 1 | namespace ModsThanos { 2 | 3 | public static class RoleHelper { 4 | public static bool IsThanos(byte playerId) { 5 | bool isThanos = false; 6 | 7 | for (int i = 0; i < GlobalVariable.allThanos.Count; i++) { 8 | if (playerId == GlobalVariable.allThanos[i].PlayerId) 9 | isThanos = true; 10 | } 11 | 12 | return isThanos; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ModsThanos/Utility/Enumerations/SkinType.cs: -------------------------------------------------------------------------------- 1 | namespace ModsThanos.Utility.Enumerations { 2 | public enum SkinType : byte 3 | { 4 | None = 0, 5 | Astro = 1, 6 | Capt = 2, 7 | Mech = 3, 8 | Military = 4, 9 | Police = 5, 10 | Science = 6, 11 | SuitB = 7, 12 | SuitW = 8, 13 | Wall = 9, 14 | Hazmat = 10, 15 | Security = 11, 16 | Tarmac = 12, 17 | Miner = 13, 18 | Winter = 14, 19 | Archae = 15, 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ModsThanos/Stone/Map/Mind.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ModsThanos.Stone.Map { 4 | 5 | public static class Mind { 6 | public static void Place(Vector3 position) { 7 | if (!GlobalVariable.stoneObjects.ContainsKey("Mind")) { 8 | ModThanos.Logger.LogInfo(CustomGameOptions.VisibilityMind.ToString()); 9 | new ComponentMap(position, "ModsThanos.Resources.mind.png", "Mind", CustomGameOptions.VisibilityStringToEnum(CustomGameOptions.VisibilityMind.GetText())); 10 | } 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /ModsThanos/Stone/Map/Time.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ModsThanos.Stone.Map { 4 | 5 | public static class Time { 6 | public static void Place(Vector3 position) { 7 | if (!GlobalVariable.stoneObjects.ContainsKey("Time")) { 8 | 9 | ModThanos.Logger.LogInfo(CustomGameOptions.VisibilityTime.ToString()); 10 | new ComponentMap(position, "ModsThanos.Resources.time.png", "Time", CustomGameOptions.VisibilityStringToEnum(CustomGameOptions.VisibilityTime.GetText())); 11 | } 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /ModsThanos/Stone/Map/Power.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ModsThanos.Stone.Map { 4 | public static class Power { 5 | 6 | public static void Place(Vector3 position) { 7 | if (!GlobalVariable.stoneObjects.ContainsKey("Power")) { 8 | 9 | ModThanos.Logger.LogInfo(CustomGameOptions.VisibilityPower.ToString()); 10 | new ComponentMap(position, "ModsThanos.Resources.power.png", "Power", CustomGameOptions.VisibilityStringToEnum(CustomGameOptions.VisibilityPower.GetText())); 11 | } 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /ModsThanos/Stone/Map/Space.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ModsThanos.Stone.Map { 4 | 5 | public static class Space { 6 | public static void Place(Vector3 position) { 7 | if (!GlobalVariable.stoneObjects.ContainsKey("Space")) { 8 | 9 | ModThanos.Logger.LogInfo(CustomGameOptions.VisibilitySpace.ToString()); 10 | new ComponentMap(position, "ModsThanos.Resources.space.png", "Space", CustomGameOptions.VisibilityStringToEnum(CustomGameOptions.VisibilitySpace.GetText())); 11 | } 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /ModsThanos/Stone/Map/Reality.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ModsThanos.Stone.Map { 4 | 5 | public static class Reality { 6 | public static void Place(Vector3 position) { 7 | if (!GlobalVariable.stoneObjects.ContainsKey("Reality")) { 8 | ModThanos.Logger.LogInfo(CustomGameOptions.VisibilityReality.ToString()); 9 | new ComponentMap(position, "ModsThanos.Resources.reality.png", "Reality", CustomGameOptions.VisibilityStringToEnum(CustomGameOptions.VisibilityReality.GetText())); 10 | } 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /ModsThanos/Stone/Soul.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ModsThanos.Stone { 4 | class Soul : StoneManager { 5 | Soul() : base("Soul", new Color(1f, 1f, 1f, 1f), new Vector2(0f, 0f), false) { } 6 | 7 | public override void OnClick() { 8 | System.Space.OnSpacePressed(); 9 | } 10 | 11 | public override void OnEffectEnd() { } 12 | 13 | public override void OnUpdate() { 14 | if (!GlobalVariable.UsableButton) 15 | Button.SetCanUse(false); 16 | else 17 | Button.SetCanUse(HasStone(PlayerControl.LocalPlayer.PlayerId)); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ModsThanos/Stone/Space.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ModsThanos.Stone { 4 | class Space : StoneManager { 5 | Space() : base("Space", new Color(1f, 1f, 1f, 1f), new Vector2(0f, 1f), false) { } 6 | 7 | public override void OnClick() { 8 | System.Space.OnSpacePressed(); 9 | } 10 | 11 | public override void OnEffectEnd() { } 12 | 13 | public override void OnUpdate() { 14 | if (!GlobalVariable.UsableButton) 15 | Button.SetCanUse(false); 16 | else 17 | Button.SetCanUse(HasStone(PlayerControl.LocalPlayer.PlayerId)); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ModsThanos/Stone/Power.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ModsThanos.Stone { 4 | class Power : StoneManager { 5 | Power() : base("Power", new Color(1f, 1f, 1f, 1f), new Vector2(1f, 1f), false) { } 6 | 7 | public override void OnClick() { 8 | Stone.System.Power.OnPowerPressed(); 9 | } 10 | 11 | public override void OnEffectEnd() { } 12 | 13 | public override void OnUpdate() { 14 | if (!GlobalVariable.UsableButton) 15 | Button.SetCanUse(false); 16 | else 17 | Button.SetCanUse(HasStone(PlayerControl.LocalPlayer.PlayerId)); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ModsThanos/CustomRPC.cs: -------------------------------------------------------------------------------- 1 | namespace ModsThanos { 2 | public enum CustomRPC { 3 | SetThanos = 100, 4 | TurnInvisibility = 101, 5 | PowerStone = 102, 6 | SpawnPortal = 103, 7 | Unknow = 104, 8 | TakeRandomApparence = 105, 9 | InitalApparence = 106, 10 | Snap = 107, 11 | TimeRewind = 109, 12 | StonePickup = 110, 13 | SyncStone = 111, 14 | SetVisiorColor = 112, 15 | SnapEnded = 113, 16 | TimeRevive = 114, 17 | ReplaceStone = 115, 18 | SetPlayerSoulStone = 116, 19 | RemovePlayerSoulStone = 117, 20 | SetColorName = 118, 21 | MindChangedValue = 119 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ModsThanos/Stone/Mind.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ModsThanos.Stone { 4 | class Mind : StoneManager { 5 | Mind() : base("Mind", new Color(1f, 1f, 1f, 1f), new Vector2(1f, 2f), true) { } 6 | 7 | public override void OnClick() { 8 | System.Mind.CoreMind.OnMindPressed(); 9 | } 10 | 11 | public override void OnEffectEnd() { 12 | System.Mind.CoreMind.OnMindEnded(); 13 | } 14 | 15 | public override void OnUpdate() { 16 | if (!GlobalVariable.UsableButton) 17 | Button.SetCanUse(false); 18 | else 19 | Button.SetCanUse(HasStone(PlayerControl.LocalPlayer.PlayerId)); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ModsThanos/Stone/System/Mind/PlayerData.cs: -------------------------------------------------------------------------------- 1 | namespace ModsThanos.Stone.System.Mind { 2 | public class PlayerData { 3 | public byte PlayerId; 4 | public byte PlayerColor; 5 | public uint PlayerHat; 6 | public uint PlayerPet; 7 | public uint PlayerSkin; 8 | public string PlayerName; 9 | 10 | public PlayerData(byte playerId, byte playerColor, uint playerHat, uint playerPet, uint playerSkin, string playerName) { 11 | PlayerId = playerId; 12 | PlayerColor = playerColor; 13 | PlayerHat = playerHat; 14 | PlayerPet = playerPet; 15 | PlayerSkin = playerSkin; 16 | PlayerName = playerName; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ModsThanos/Stone/Reality.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ModsThanos.Stone { 4 | class Reality : StoneManager { 5 | Reality() : base("Reality", new Color(1f, 1f, 1f, 1f), new Vector2(1f, 0f), false) { } 6 | 7 | public override void OnClick() { 8 | Stone.System.Reality.OnRealityPressed(true); 9 | } 10 | 11 | public override void OnEffectEnd() { 12 | Stone.System.Reality.OnRealityPressed(false); 13 | } 14 | 15 | public override void OnUpdate() { 16 | if (!GlobalVariable.UsableButton) 17 | Button.SetCanUse(false); 18 | else 19 | Button.SetCanUse(HasStone(PlayerControl.LocalPlayer.PlayerId)); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ModsThanos/Stone/System/Time/TimePoint.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ModsThanos.Stone.System { 4 | class TimePoint { 5 | 6 | private Vector3 position; 7 | private Vector2 velocity; 8 | private long unix; 9 | 10 | public TimePoint(Vector3 position, Vector2 velocity, long unix) { 11 | this.position = position; 12 | this.velocity = velocity; 13 | this.unix = unix; 14 | } 15 | 16 | public Vector3 Position { 17 | get => position; 18 | set => position = value; 19 | } 20 | 21 | public Vector2 Velocity { 22 | get => velocity; 23 | set => velocity = value; 24 | } 25 | 26 | public long Unix { 27 | get => unix; 28 | set => unix = value; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ModsThanos/GlobalVariable.cs: -------------------------------------------------------------------------------- 1 | using ModsThanos.Stone.System.Mind; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace ModsThanos { 6 | public static class GlobalVariable { 7 | // Player 8 | public static List allThanos = new List(); 9 | 10 | // Player Data 11 | public static byte PlayerColor; 12 | public static uint PlayerHat; 13 | public static uint PlayerPet; 14 | public static uint PlayerSkin; 15 | public static string PlayerName; 16 | public static Color PlayerColorName; 17 | public static List allPlayersData = new List(); 18 | 19 | // Misc 20 | public static bool GameStarted = false; 21 | public static bool UsableButton = true; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ModsThanos.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModsThanos", "ModsThanos\ModsThanos.csproj", "{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|Any CPU = Debug|Any CPU 8 | Release|Any CPU = Release|Any CPU 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 12 | {11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.Debug|Any CPU.Build.0 = Debug|Any CPU 13 | {11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.Release|Any CPU.ActiveCfg = Release|Any CPU 14 | {11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.Release|Any CPU.Build.0 = Release|Any CPU 15 | EndGlobalSection 16 | EndGlobal 17 | -------------------------------------------------------------------------------- /ModsThanos/Patch/IntroCutScenePatch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using UnityEngine; 3 | using IntroCutScene = PENEIDJGGAF.CKACLKCOJFO; 4 | 5 | namespace ModsThanos.Patch { 6 | 7 | [HarmonyPatch(typeof(IntroCutScene), nameof(IntroCutScene.MoveNext))] 8 | public static class IntroCutScenePatch { 9 | public static void Postfix(IntroCutScene __instance) { 10 | if (RoleHelper.IsThanos(PlayerControl.LocalPlayer.PlayerId)) { 11 | __instance.__this.Title.Text = "Thanos"; 12 | __instance.__this.Title.Color = new Color(0.749f, 0f, 0.839f, 1f); 13 | __instance.__this.ImpostorText.Text = "Trouver les pierres, et Défier les crewmates."; 14 | __instance.__this.BackgroundBar.material.color = new Color(0.749f, 0f, 0.839f, 1f); 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ModsThanos/Stone/Time.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ModsThanos.Stone { 4 | class Time : StoneManager { 5 | Time() : base("Time", new Color(1f, 1f, 1f, 1f), new Vector2(0f, 2f), false) { } 6 | 7 | public override void OnClick() { 8 | System.Space.OnSpacePressed(); 9 | } 10 | 11 | public override void OnEffectEnd() { 12 | System.Time.StopRewind(); 13 | } 14 | 15 | public override void OnUpdate() { 16 | if (!GlobalVariable.UsableButton) 17 | Button.SetCanUse(false); 18 | else 19 | Button.SetCanUse(HasStone(PlayerControl.LocalPlayer.PlayerId)); 20 | 21 | if (System.Time.isRewinding) 22 | for (int i = 0; i < 2; i++)System.Time.Rewind(); 23 | else System.Time.Record(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ModsThanos/Patch/ServerRegionPatch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using System.Globalization; 3 | 4 | namespace ModsThanos.Patch { 5 | [HarmonyPatch(typeof(RegionMenu), nameof(RegionMenu.OnEnable))] 6 | public static class ServerRegionPatch { 7 | public static bool Prefix(ref RegionMenu __instance) { 8 | if (ServerManager.DefaultRegions.Count != 4) { 9 | UnhollowerBaseLib.Il2CppReferenceArray ModdedServer = new ServerInfo[1] { new ServerInfo("Modded", "yourIpHere", 22023) }; 10 | var regions = new RegionInfo[4] { ServerManager.DefaultRegions[0], ServerManager.DefaultRegions[1], ServerManager.DefaultRegions[2], 11 | new RegionInfo("Modded", "0", ModdedServer) }; 12 | 13 | ServerManager.DefaultRegions = regions; 14 | } 15 | 16 | return true; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ModsThanos/Utility/Draw.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace ModsThanos.Utility { 4 | public static class Draw { 5 | public static void DrawCircle(LineRenderer lineRenderer, float thetaScale, float radius, Color color, Vector3 position) { 6 | float Theta = 0f; 7 | int size = (int) ((1f / thetaScale) + 1f); 8 | lineRenderer.SetVertexCount(size); 9 | lineRenderer.material.color = Color.white; 10 | lineRenderer.startColor = Color.white; 11 | lineRenderer.endColor = Color.white; 12 | 13 | for (int i = 0; i < size; i++) { 14 | Theta += (2.0f * 3.14159265358979323846f * thetaScale); 15 | float x = radius * Mathf.Cos(Theta); 16 | float y = radius * Mathf.Sin(Theta); 17 | lineRenderer.SetPosition(i, new Vector3(x + position.x, y + position.y, 0)); 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ModsThanos/Stone/System/Power.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using Hazel; 3 | using ModsThanos.Utility; 4 | using UnityEngine; 5 | 6 | namespace ModsThanos.Stone.System { 7 | class Power { 8 | public static void OnPowerPressed() { 9 | Vector2 localPositon = PlayerControlUtils.Position(PlayerControl.LocalPlayer); 10 | HelperSprite.ShowAnimation(1, 24, true, "ModsThanos.Resources.anim-power.png", 10, 1, PlayerControl.LocalPlayer.gameObject.transform.position, 5); 11 | 12 | MessageWriter write = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.PowerStone, SendOption.None, -1); 13 | write.Write(PlayerControl.LocalPlayer.PlayerId); 14 | write.WriteVector2(localPositon); 15 | AmongUsClient.Instance.FinishRpcImmediately(write); 16 | PlayerControlUtils.KillPlayerArea(localPositon, PlayerControl.LocalPlayer, 3f); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ModsThanos/Patch/PingTrackerPatch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using UnityEngine; 3 | 4 | namespace ModsThanos.Patch { 5 | 6 | [HarmonyPatch(typeof(PingTracker), nameof(PingTracker.Update))] 7 | [HarmonyPriority(Priority.First)] 8 | public static class PingTrackerPatch { 9 | private static Vector3 lastDist = Vector3.zero; 10 | 11 | public static void Postfix(ref PingTracker __instance) { 12 | if (!GlobalVariable.GameStarted) { 13 | AspectPosition aspect = __instance.text.gameObject.GetComponent(); 14 | if (aspect.DistanceFromEdge != lastDist) { 15 | aspect.DistanceFromEdge += new Vector3(0.6f, 0); 16 | aspect.AdjustPosition(); 17 | 18 | lastDist = aspect.DistanceFromEdge; 19 | } 20 | __instance.text.Text += $"\n[BF00D6FF]Thanos Mods: [] \nhardel.fr/discord"; 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /ModsThanos/Patch/VentPatch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using UnityEngine; 3 | 4 | namespace ModsThanos.Patch { 5 | 6 | [HarmonyPatch(typeof(Vent), "CanUse")] 7 | public static class VentPatch { 8 | public static bool Prefix(Vent __instance, ref float __result, [HarmonyArgument(0)], GameData.PlayerInfo playerInfo, [HarmonyArgument(1)] out bool canUse, [HarmonyArgument(2)] out bool couldUse) { 9 | float maxFloat = float.MaxValue; 10 | PlayerControl player = playerInfo.Object; 11 | couldUse = (playerInfo.IsImpostor || RoleHelper.IsThanos(playerInfo.PlayerId) && !playerInfo.IsDead && (player.CanMove || player.inVent)) 12 | canUse = couldUse; 13 | if (canUse) { 14 | maxFloat = Vector2.Distance(player.GetTruePosition(), __instance.transform.position); 15 | canUse &= maxFloat <= __instance.UsableDistance; 16 | } 17 | 18 | __result = maxFloat; 19 | return false; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ModsThanos/Utility/Enumerations/RpcCalls.cs: -------------------------------------------------------------------------------- 1 | namespace CheepsAmongUsApi.API.Enumerations { 2 | public enum RpcCalls : byte 3 | { 4 | PlayAnimation = 0, 5 | CompleteTask = 1, 6 | SyncSettings = 2, 7 | SetInfected = 3, 8 | Exiled = 4, 9 | CheckName = 5, 10 | SetName = 6, 11 | CheckColor = 7, 12 | SetColor = 8, 13 | SetHat = 9, 14 | SetSkin = 10, 15 | ReportDeadBody = 11, 16 | MurderPlayer = 12, 17 | SendChat = 13, 18 | StartMeeting = 14, 19 | SetScanner = 15, 20 | SendChatNote = 16, 21 | SetPet = 17, 22 | SetStartCounter = 18, 23 | EnterVent = 19, 24 | ExitVent = 20, 25 | SnapTo = 21, 26 | Close = 22, 27 | VotingComplete = 23, 28 | CastVote = 24, 29 | ClearVote = 25, 30 | AddVote = 26, 31 | CloseDoorsOfType = 27, 32 | RepairSystem = 28, 33 | SetTasks = 29, 34 | UpdateGameData = 30, 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ModsThanos/Patch/GameSettingsPatch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace ModsThanos.Patch { 4 | 5 | [HarmonyPatch(typeof(GameOptionsData), nameof(GameOptionsData.Method_24))] 6 | class GameSettingsPatch { 7 | static void Postfix(ref string __result) { 8 | DestroyableSingleton.Instance.GameSettings.scale = 0.425f; 9 | } 10 | } 11 | 12 | [HarmonyPatch] 13 | class GameOptionsMenuPatch { 14 | static float defaultBounds = 0f; 15 | 16 | [HarmonyPatch(typeof(GameOptionsMenu), nameof(GameOptionsMenu.Start))] 17 | class Start { 18 | static void Postfix(ref GameOptionsMenu __instance) { 19 | defaultBounds = __instance.GetComponentInParent().YBounds.max; 20 | } 21 | } 22 | 23 | [HarmonyPatch(typeof(GameOptionsMenu), nameof(GameOptionsMenu.Update))] 24 | class Update { 25 | static void Postfix(ref GameOptionsMenu __instance) { 26 | __instance.GetComponentInParent().YBounds.max = 17f; 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /ModsThanos/Utility/AnimatedTexture.cs: -------------------------------------------------------------------------------- 1 | using Reactor; 2 | using System; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace ModsThanos { 7 | 8 | [RegisterInIl2Cpp] 9 | class AnimatedTexture : MonoBehaviour { 10 | public AnimatedTexture(IntPtr ptr) : base(ptr) { } 11 | 12 | public int TileX = 1; 13 | public int TileY = 28; 14 | public int framerate = 1; 15 | public string image = "ModsThanos.Resources.anim.png"; 16 | public int PixelPerUnit = 64; 17 | public bool simpleAnimation = false; 18 | 19 | private List sprites = new List(); 20 | private SpriteRenderer renderer; 21 | private int turn = 0; 22 | 23 | void Start() { 24 | renderer = this.gameObject.AddComponent(); 25 | sprites = Utility.HelperSprite.LoadTileTextureEmbed(image, PixelPerUnit, TileX, TileY); 26 | } 27 | 28 | void Update() { 29 | turn++; 30 | if (turn > (TileX * TileY) - 1) { 31 | if (simpleAnimation) { 32 | Destroy(this.gameObject); 33 | } 34 | turn = 0; 35 | } 36 | 37 | renderer.sprite = sprites[turn]; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ModsThanos/Patch/PlayerUpdatePatch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace ModsThanos.Patch { 4 | 5 | [HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.FixedUpdate))] 6 | class PlayerUpdatePatch { 7 | public static void Postfix(PlayerControl __instance) { 8 | if (GlobalVariable.useSnap) 9 | Stone.System.Snap.Incremente(); 10 | 11 | if (PlayerControl.LocalPlayer != null) { 12 | if (GlobalVariable.hasSoulStone && PlayerControl.LocalPlayer.Data.IsDead && !RoleHelper.IsThanos(PlayerControl.LocalPlayer.PlayerId)) 13 | Stone.StoneDrop.TryReplaceStone("Soul"); 14 | 15 | if (RoleHelper.IsThanos(PlayerControl.LocalPlayer.PlayerId) && PlayerControl.LocalPlayer.Data.IsDead) 16 | if (GlobalVariable.hasSoulStone || GlobalVariable.hasMindStone || GlobalVariable.hasPowerStone || GlobalVariable.hasSpaceStone || GlobalVariable.hasTimeStone || GlobalVariable.hasRealityStone) { 17 | foreach (var stone in GlobalVariable.stonesNames) 18 | Stone.StoneDrop.TryReplaceStone(stone); 19 | } 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ModsThanos/Stone/Map/Soul.cs: -------------------------------------------------------------------------------- 1 | using ModsThanos.Utility; 2 | using System; 3 | using UnityEngine; 4 | 5 | namespace ModsThanos.Stone.Map { 6 | public static class Soul { 7 | 8 | public static void Place(Vector3 position) { 9 | 10 | if (!GlobalVariable.stoneObjects.ContainsKey("Soul")) { 11 | ModThanos.Logger.LogInfo(CustomGameOptions.VisibilitySoul.ToString()); 12 | new ComponentMap(position, "ModsThanos.Resources.soul.png", "Soul", CustomGameOptions.VisibilityStringToEnum(CustomGameOptions.VisibilitySoul.GetText())); 13 | 14 | 15 | if (AmongUsClient.Instance.GameMode == GameModes.FreePlay || !RoleHelper.IsThanos(PlayerControl.LocalPlayer.PlayerId)) { 16 | var gameObject = new GameObject { layer = 5 }; 17 | var arrow = gameObject.AddComponent(); 18 | var renderer = gameObject.AddComponent(); 19 | arrow.image = renderer; 20 | arrow.target = position; 21 | renderer.sprite = HelperSprite.LoadSpriteFromEmbeddedResources("ModsThanos.Resources.arrow.png", 150); 22 | GlobalVariable.arrow = gameObject; 23 | } 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /ModsThanos/Patch/TasksPatch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using UnityEngine; 3 | 4 | namespace ModsThanos.Patch { 5 | 6 | [HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.SetTasks))] 7 | class TasksPatch { 8 | public static void Postfix(PlayerControl __instance) { 9 | if (PlayerControl.LocalPlayer != null) { 10 | if (GlobalVariable.allThanos != null && RoleHelper.IsThanos(PlayerControl.LocalPlayer.PlayerId)) { 11 | ImportantTextTask ImportantTasks = new GameObject("ThanosTasks").AddComponent(); 12 | ImportantTasks.transform.SetParent(__instance.transform, false); 13 | ImportantTasks.Text = "[FFFFFFFF]Objectif: Trouver les pierres pour obtenir le snap.[]\n\n[808080FF]Snap:[] Termine la partie.\n[008516FF]Pierre du temps :[] Permet de revenir dans le temps.\n[822FA8FF]Pierre de pouvoir :[] Permet de tuer en zone.\n[C46f1AFF]Pierre de l'âme :[] les crewmate peuvent la ramasser.\n[A6A02EFF]Pierre de l'esprit :[] Permet de se transformer en quelqu'un.\n[3482BAFF]Pierre de l'espace[]: Pose des portails.\n[D43D3DFF]Pierre de Réalité[]: Permet de se rendre invisible"; 14 | __instance.myTasks.Insert(0, ImportantTasks); 15 | } 16 | } 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /ModsThanos/Stone/Snap.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using UnityEngine; 3 | using ModsThanos.Utility.Enumerations; 4 | 5 | namespace ModsThanos.Stone { 6 | 7 | [HarmonyPatch(typeof(HudManager), nameof(HudManager.Start))] 8 | public static class Snap { 9 | public static void Postfix(HudManager __instance) { 10 | new CooldownButton 11 | (() => OnClick(), 12 | 15f, 13 | "ModsThanos.Resources.snap.png", 14 | 450f, 15 | new Vector2(0.5f,3f), 16 | Visibility.OnlyImpostor, 17 | __instance, 18 | 5f, 19 | () => OnEndedSnap(), 20 | () => OnUpdate(GlobalVariable.buttonSnap) 21 | ); 22 | } 23 | 24 | private static void OnEndedSnap() { 25 | Stone.System.Snap.OnSnapEnded(); 26 | } 27 | 28 | private static void OnClick() { 29 | Stone.System.Snap.OnSnapPressed(); 30 | } 31 | 32 | private static void OnUpdate(CooldownButton button) { 33 | if (!GlobalVariable.UsableButton || CustomGameOptions.DisableSnap.GetValue()) { 34 | button.SetCanUse(false); 35 | } else { 36 | if (StoneManager) 37 | button.SetCanUse(true); 38 | else 39 | button.SetCanUse(false); 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ModsThanos/Patch/HatManagerHatsPatch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using System; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace ModsThanos.Patch { 7 | 8 | [HarmonyPatch(typeof(HatManager), nameof(HatManager.GetHatById))] 9 | class HatManagerHatsPatch { 10 | static bool modded = false; 11 | static List allHats; 12 | 13 | private static void AddHat(Sprite texture, string id) { 14 | HatBehaviour newHat = new HatBehaviour(); 15 | newHat.MainImage = texture; 16 | newHat.ProductId = $"+{id}"; 17 | newHat.InFront = true; 18 | newHat.NoBounce = true; 19 | 20 | allHats.Add(newHat); 21 | } 22 | 23 | public static void InitHat() { 24 | foreach (var hat in ResourceLoader.allHats) 25 | AddHat(hat.Key, hat.Value); 26 | } 27 | 28 | public static bool Prefix(HatManager __instance) { 29 | try { 30 | if (!modded) { 31 | modded = true; 32 | foreach (var hat in allHats) 33 | __instance.AllHats.Add(hat); 34 | 35 | __instance.AllHats.Sort((Il2CppSystem.Comparison) ((h1, h2) => h2.ProductId.CompareTo(h1.ProductId))); 36 | } 37 | 38 | return true; 39 | } catch (Exception e) { 40 | throw e; 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ModsThanos/Patch/EndGamePatch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace ModsThanos.Patch { 4 | 5 | [HarmonyPatch(typeof(AmongUsClient), nameof(AmongUsClient.ExitGame))] 6 | public static class EndGamePatch { 7 | 8 | public static void Prefix(AmongUsClient __instance) { 9 | EndGameCommons.ResetGlobalVariable(); 10 | } 11 | } 12 | 13 | [HarmonyPatch(typeof(EndGameManager), nameof(EndGameManager.SetEverythingUp))] 14 | public static class EndGameManagerPatch { 15 | public static bool Prefix(EndGameManager __instance) { 16 | EndGameCommons.ResetGlobalVariable(); 17 | 18 | return true; 19 | } 20 | } 21 | 22 | public static class EndGameCommons { 23 | public static void ResetGlobalVariable() { 24 | GlobalVariable.GameStarted = false; 25 | GlobalVariable.hasMindStone = false; 26 | GlobalVariable.hasPowerStone = false; 27 | GlobalVariable.hasRealityStone = false; 28 | GlobalVariable.hasSoulStone = false; 29 | GlobalVariable.hasSpaceStone = false; 30 | GlobalVariable.hasTimeStone = false; 31 | GlobalVariable.useSnap = false; 32 | GlobalVariable.mindStoneUsed = false; 33 | GlobalVariable.realityStoneUsed = false; 34 | GlobalVariable.UsableButton = false; 35 | 36 | GlobalVariable.allThanos.Clear(); 37 | GlobalVariable.stoneObjects.Clear(); 38 | GlobalVariable.stonePositon.Clear(); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /ModsThanos/ResourceLoader.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | using System.Reflection; 4 | using Reactor.Extensions; 5 | using UnityEngine; 6 | 7 | namespace ModsThanos { 8 | public static class ResourceLoader { 9 | private static readonly Assembly Assembly = Assembly.GetExecutingAssembly(); 10 | public static Dictionary allHats; 11 | public static AudioClip StonePickup; 12 | public static AudioClip SnapUsed; 13 | public static AudioClip RealityUsed; 14 | public static AudioClip MindUsed; 15 | public static AudioClip TimeUsed; 16 | public static AudioClip PowerUsed; 17 | public static AudioClip SpawnPortal; 18 | public static AudioClip PlayerRevive; 19 | 20 | public static void LoadAssets() { 21 | Stream resourceSteam = Assembly.GetManifestResourceStream("ModsThanos.Resources.xxx"); 22 | AssetBundle assetBundle = AssetBundle.LoadFromMemory(resourceSteam.ReadFully()); 23 | StonePickup = assetBundle.LoadAsset("StonePickup").DontDestroy(); 24 | SnapUsed = assetBundle.LoadAsset("SnapUsed").DontDestroy(); 25 | RealityUsed = assetBundle.LoadAsset("RealityUsed").DontDestroy(); 26 | MindUsed = assetBundle.LoadAsset("MindUsed").DontDestroy(); 27 | TimeUsed = assetBundle.LoadAsset("TimeUsed").DontDestroy(); 28 | PowerUsed = assetBundle.LoadAsset("PowerUsed").DontDestroy(); 29 | SpawnPortal = assetBundle.LoadAsset("SpawnPortal").DontDestroy(); 30 | PlayerRevive = assetBundle.LoadAsset("PlayerRevive").DontDestroy(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ModsThanos/Patch/SetInfectedPatch.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using HarmonyLib; 5 | using Hazel; 6 | using ModsThanos.Utility.Enumerations; 7 | using UnhollowerBaseLib; 8 | 9 | namespace ModsThanos.Patch { 10 | 11 | [HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.RpcSetInfected))] 12 | class SetInfectedPatch { 13 | public static void Postfix([HarmonyArgument(0)] Il2CppReferenceArray infected) { 14 | List playersSelections = PlayerControl.AllPlayerControls.ToArray().ToList(); 15 | Visibility visibility = CustomGameOptions.SideStringToEnum(CustomGameOptions.ThanosSide.GetText()); 16 | GlobalVariable.allThanos.Clear(); 17 | 18 | if (Visibility.OnlyImpostor == visibility) 19 | playersSelections.RemoveAll(x => !x.Data.IsImpostor); 20 | 21 | if (Visibility.OnlyCrewmate == visibility) 22 | playersSelections.RemoveAll(x => x.Data.IsImpostor); 23 | 24 | // playersSelections 25 | if (playersSelections != null && playersSelections.Count > 0 && CustomGameOptions.EnableThanosMods.GetValue()) { 26 | MessageWriter messageWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte) CustomRPC.SetThanos, SendOption.None, -1); 27 | List playerSelected = new List(); 28 | 29 | for (int i = 0; i < CustomGameOptions.NumberThanos.GetValue(); i++) { 30 | Random random = new Random(); 31 | PlayerControl selectedPlayer = playersSelections[random.Next(0, playersSelections.Count)]; 32 | GlobalVariable.allThanos.Add(selectedPlayer); 33 | playersSelections.Remove(selectedPlayer); 34 | playerSelected.Add(selectedPlayer.PlayerId); 35 | } 36 | 37 | messageWriter.WriteBytesAndSize(playerSelected.ToArray()); 38 | AmongUsClient.Instance.FinishRpcImmediately(messageWriter); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ModsThanos/Stone/System/Snap.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using Hazel; 3 | using ModsThanos.Utility; 4 | using UnityEngine; 5 | 6 | namespace ModsThanos.Stone.System { 7 | class Snap { 8 | public static void OnSnapPressed() { 9 | MessageWriter write = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte) CustomRPC.Snap, SendOption.None, -1); 10 | write.Write(PlayerControl.LocalPlayer.PlayerId); 11 | AmongUsClient.Instance.FinishRpcImmediately(write); 12 | 13 | GlobalVariable.useSnap = true; 14 | Camera.main.GetComponent().shakeAmount = 0.3f; 15 | Camera.main.GetComponent().shakePeriod = 600f; 16 | HudManager.Instance.FullScreen.enabled = true; 17 | HudManager.Instance.FullScreen.color = new Color(1f, 1f, 1f, 0f); 18 | } 19 | 20 | public static void Incremente() { 21 | Camera.main.GetComponent().shakeAmount = 0.3f; 22 | Camera.main.GetComponent().shakePeriod = 600f; 23 | 24 | Color currentColor = HudManager.Instance.FullScreen.color; 25 | HudManager.Instance.FullScreen.enabled = true; 26 | HudManager.Instance.FullScreen.color = new Color(1f, 1f, 1f, currentColor.a + 0.002f); 27 | } 28 | 29 | public static void OnSnapEnded() { 30 | GlobalVariable.useSnap = false; 31 | Camera.main.GetComponent().shakeAmount = 0f; 32 | Camera.main.GetComponent().shakePeriod = 0f; 33 | 34 | HudManager.Instance.FullScreen.color = new Color(1f, 1f, 1f, 0f); 35 | HudManager.Instance.FullScreen.enabled = false; 36 | 37 | MessageWriter write = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte) CustomRPC.SnapEnded, SendOption.None, -1); 38 | write.Write(PlayerControl.LocalPlayer.PlayerId); 39 | AmongUsClient.Instance.FinishRpcImmediately(write); 40 | 41 | PlayerControlUtils.KillEveryone(PlayerControl.LocalPlayer); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ModsThanos/ModsThanos.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.1 4 | 1.0.0 5 | NuclearPowered/Mappings:0.2.0 6 | 7 | Mods Thanos 8 | Hardel 9 | 10 | 11 | 12 | 2021.3.5s 13 | $(DefineConstants);STEAM 14 | 15 | 16 | 17 | 2021.3.5i 18 | $(DefineConstants);ITCH 19 | 20 | 21 | 22 | 23 | 24 | 25 | all 26 | runtime; build; native; contentfiles; analyzers; buildtransitive 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | $(AmongUs)\BepInEx\plugins\Essentials-$(GameVersion).dll 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /ModsThanos/ModsThanos.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using BepInEx.Configuration; 3 | using BepInEx.IL2CPP; 4 | using BepInEx.Logging; 5 | using HarmonyLib; 6 | using Reactor; 7 | using System; 8 | using System.Linq; 9 | using System.Net; 10 | using UnhollowerBaseLib; 11 | 12 | namespace ModsThanos { 13 | 14 | [BepInPlugin(Id)] 15 | [BepInProcess("Among Us.exe")] 16 | [BepInDependency(ReactorPlugin.Id)] 17 | public class ModThanos : BasePlugin 18 | { 19 | public const string Id = "gg.fuzeIII.ModsThanos"; 20 | public static ManualLogSource Logger; 21 | 22 | public Harmony Harmony { get; } = new Harmony(Id); 23 | 24 | public ConfigEntry Name { get; set; } 25 | 26 | public ConfigEntry Ip { get; set; } 27 | 28 | public ConfigEntry Port { get; set; } 29 | 30 | public override void Load() { 31 | Logger = Log; 32 | Logger.LogInfo("ThanosMods est charger !"); 33 | RegisterInIl2CppAttribute.Register(); 34 | Harmony.PatchAll(); 35 | ResourceLoader.LoadAssets(); 36 | 37 | #region Cheeps Server 38 | Name = Config.Bind("Server", "Name", "Cheep-YT.com"); 39 | Ip = Config.Bind("Server", "Ipv4 or Hostname", "207.180.234.175"); 40 | Port = Config.Bind("Server", "Port", (ushort) 22023); 41 | 42 | var defaultRegions = ServerManager.DefaultRegions.ToList(); 43 | var ip = Ip.Value; 44 | if (Uri.CheckHostName(Ip.Value).ToString() == "Dns") { 45 | Log.LogMessage("Resolving " + ip + " ..."); 46 | try { 47 | foreach (IPAddress address in Dns.GetHostAddresses(Ip.Value)) { 48 | if (address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) { 49 | ip = address.ToString(); 50 | break; 51 | } 52 | } 53 | } catch { 54 | Log.LogMessage("Hostname could not be resolved" + ip); 55 | } 56 | 57 | Log.LogMessage("IP is " + ip); 58 | } 59 | 60 | var port = Port.Value; 61 | Il2CppReferenceArray serverInfo = new ServerInfo[1] { 62 | new ServerInfo(Name.Value, Ip.Value, Port.Value) 63 | }; 64 | 65 | defaultRegions.Insert(0, new StaticRegionInfo(Name.Value, StringNames.NoTranslation, "50", serverInfo).Cast()); 66 | 67 | ServerManager.DefaultRegions = defaultRegions.ToArray(); 68 | #endregion 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /ModsThanos/Utility/Enumerations/HatType.cs: -------------------------------------------------------------------------------- 1 | namespace ModsThanos.Utility.Enumerations { 2 | public enum HatType 3 | { 4 | NoHat = 0, 5 | Astronaut = 1, 6 | BaseballCap = 2, 7 | BrainSlug = 3, 8 | BushHat = 4, 9 | CaptainsHat = 5, 10 | DoubleTopHat = 6, 11 | Flowerpot = 7, 12 | Goggles = 8, 13 | HardHat = 9, 14 | Military = 10, 15 | PaperHat = 11, 16 | PartyHat = 12, 17 | Police = 13, 18 | Stethescope = 14, 19 | TopHat = 15, 20 | TowelWizard = 16, 21 | Ushanka = 17, 22 | Viking = 18, 23 | WallCap = 19, 24 | Snowman = 20, 25 | Reindeer = 21, 26 | Lights = 22, 27 | Santa = 23, 28 | Tree = 24, 29 | Present = 25, 30 | Candycanes = 26, 31 | ElfHat = 27, 32 | NewYears2018 = 28, 33 | WhiteHat = 29, 34 | Crown = 30, 35 | Eyebrows = 31, 36 | HaloHat = 32, 37 | HeroCap = 33, 38 | PipCap = 34, 39 | PlungerHat = 35, 40 | ScubaHat = 36, 41 | StickminHat = 37, 42 | StrawHat = 38, 43 | TenGallonHat = 39, 44 | ThirdEyeHat = 40, 45 | ToiletPaperHat = 41, 46 | Toppat = 42, 47 | Fedora = 43, 48 | Goggles2 = 44, 49 | Headphones = 45, 50 | MaskHat = 46, 51 | PaperMask = 47, 52 | Security = 48, 53 | StrapHat = 49, 54 | Banana = 50, 55 | Beanie = 51, 56 | Bear = 52, 57 | Cheese = 53, 58 | Cherry = 54, 59 | Egg = 55, 60 | Fedora2 = 56, 61 | Flamingo = 57, 62 | FlowerPin = 58, 63 | Helmet = 59, 64 | Plant = 60, 65 | BatEyes = 61, 66 | BatWings = 62, 67 | Horns = 63, 68 | Mohawk = 64, 69 | Pumpkin = 65, 70 | ScaryBag = 66, 71 | Witch = 67, 72 | Wolf = 68, 73 | Pirate = 69, 74 | Plague = 70, 75 | Machete = 71, 76 | Fred = 72, 77 | MinerCap = 73, 78 | WinterHat = 74, 79 | Archae = 75, 80 | Antenna = 76, 81 | Balloon = 77, 82 | BirdNest = 78, 83 | BlackBelt = 79, 84 | Caution = 80, 85 | Chef = 81, 86 | CopHat = 82, 87 | DoRag = 83, 88 | DumSticker = 84, 89 | Fez = 85, 90 | GeneralHat = 86, 91 | GreyThing = 87, 92 | HunterCap = 88, 93 | JungleHat = 89, 94 | MiniCrewmate = 90, 95 | NinjaMask = 91, 96 | RamHorns = 92, 97 | Snowman2 = 93, 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /ModsThanos/Patch/HudPatch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using UnityEngine; 3 | 4 | namespace ModsThanos.Patch { 5 | public static class HudPatch { 6 | public static void UpdateMeetingHUD(MeetingHud __instance) { 7 | foreach (PlayerVoteArea player in __instance.playerStates) { 8 | if (GlobalVariable.PlayerSoulStone != null) 9 | if (player.NameText.Text == GlobalVariable.PlayerSoulStone.name && !GlobalVariable.mindStoneUsed) 10 | player.NameText.Color = new Color(1f, 0.65f, 0f, 1f); 11 | 12 | if (PlayerControl.AllPlayerControls != null && PlayerControl.AllPlayerControls.Count > 1) { 13 | if (PlayerControl.LocalPlayer != null) { 14 | foreach (var playerControl in PlayerControl.AllPlayerControls) { 15 | if (RoleHelper.IsThanos(playerControl.PlayerId) && RoleHelper.IsThanos(PlayerControl.LocalPlayer.PlayerId)) { 16 | string playerName = playerControl.Data.PlayerName; 17 | 18 | if (playerName == player.NameText.Text) 19 | player.NameText.Color = new Color(0.749f, 0f, 0.839f, 1f); 20 | } 21 | } 22 | } 23 | } 24 | } 25 | } 26 | } 27 | 28 | [HarmonyPatch(typeof(HudManager), nameof(HudManager.Update))] 29 | public static class HudUpdatePatch { 30 | public static void Postfix(HudManager __instance) { 31 | 32 | if (MeetingHud.Instance != null) 33 | HudPatch.UpdateMeetingHUD(MeetingHud.Instance); 34 | 35 | if (PlayerControl.AllPlayerControls.Count > 1 && GlobalVariable.PlayerSoulStone != null) 36 | foreach (var player in PlayerControl.AllPlayerControls) 37 | if (player.PlayerId == GlobalVariable.PlayerSoulStone.PlayerId && !GlobalVariable.mindStoneUsed) 38 | player.nameText.Color = new Color(1f, 0.65f, 0f, 1f); 39 | 40 | if (GlobalVariable.allThanos != null && PlayerControl.AllPlayerControls.Count > 1 && GlobalVariable.realityStoneUsed) 41 | foreach (var player in PlayerControl.AllPlayerControls) 42 | if (RoleHelper.IsThanos(player.PlayerId)) 43 | player.nameText.Color = new Color(1f, 1f, 1f, 0f); 44 | 45 | if (GlobalVariable.allThanos != null && PlayerControl.AllPlayerControls.Count > 1) { 46 | if (PlayerControl.LocalPlayer != null) { 47 | if (RoleHelper.IsThanos(PlayerControl.LocalPlayer.PlayerId)) { 48 | foreach (var player in PlayerControl.AllPlayerControls) { 49 | if (RoleHelper.IsThanos(player.PlayerId)) { 50 | player.nameText.Color = new Color(0.749f, 0f, 0.839f, 1f); 51 | } 52 | } 53 | } 54 | } 55 | } 56 | 57 | CooldownButton.HudUpdate(); 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /ModsThanos/Patch/MeetingPatch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using ModsThanos.Utility; 3 | 4 | namespace ModsThanos.Patch { 5 | 6 | [HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.Close))] 7 | public static class MeetingClosePatch { 8 | 9 | public static void Postfix(MeetingHud __instance) { 10 | if (GlobalVariable.allThanos != null) { 11 | if (RoleHelper.IsThanos(PlayerControl.LocalPlayer.PlayerId)) { 12 | GlobalVariable.buttonMind.Timer = CustomGameOptions.CooldownMindStone.GetValue(); 13 | GlobalVariable.buttonPower.Timer = CustomGameOptions.CooldownPowerStone.GetValue(); 14 | GlobalVariable.buttonReality.Timer = CustomGameOptions.CooldownRealityStone.GetValue(); 15 | GlobalVariable.buttonSoul.Timer = CustomGameOptions.CooldownSoulStone.GetValue(); 16 | GlobalVariable.buttonTime.Timer = CustomGameOptions.CooldownTimeStone.GetValue(); 17 | GlobalVariable.buttonSpace.Timer = CustomGameOptions.CooldownSpaceStone.GetValue(); 18 | GlobalVariable.buttonSnap.Timer = 15f; 19 | } 20 | } 21 | } 22 | } 23 | 24 | [HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.Update))] 25 | public static class MeetingUpdatePatch { 26 | public static void Postfix(MeetingHud __instance) { 27 | if (GlobalVariable.allThanos != null) { 28 | if (RoleHelper.IsThanos(PlayerControl.LocalPlayer.PlayerId)) { 29 | GlobalVariable.buttonMind.SetCanUse(false); 30 | GlobalVariable.buttonPower.SetCanUse(false); 31 | GlobalVariable.buttonSnap.SetCanUse(false); 32 | GlobalVariable.buttonReality.SetCanUse(false); 33 | GlobalVariable.buttonMind.SetCanUse(false); 34 | GlobalVariable.buttonTime.SetCanUse(false); 35 | GlobalVariable.buttonSpace.SetCanUse(false); 36 | } 37 | } 38 | } 39 | } 40 | 41 | [HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.Awake))] 42 | public static class MeetingStartPatch { 43 | public static void Postfix(MeetingHud __instance) { 44 | if (GlobalVariable.allThanos != null && GlobalVariable.mindStoneUsed) { 45 | foreach (var playerData in GlobalVariable.allPlayersData) { 46 | PlayerControl currentPlayer = PlayerControlUtils.FromPlayerId(playerData.PlayerId); 47 | 48 | currentPlayer.SetPet(playerData.PlayerPet); 49 | currentPlayer.SetSkin(playerData.PlayerSkin); 50 | currentPlayer.SetName(playerData.PlayerName); 51 | currentPlayer.SetHat(playerData.PlayerHat, playerData.PlayerColor); 52 | currentPlayer.SetColor(playerData.PlayerColor); 53 | GlobalVariable.mindStoneUsed = false; 54 | } 55 | } 56 | 57 | Stone.System.Time.StopRewind(); 58 | if (GlobalVariable.allThanos != null && GlobalVariable.realityStoneUsed && RoleHelper.IsThanos(PlayerControl.LocalPlayer.PlayerId)) { 59 | Stone.System.Reality.OnRealityPressed(false); 60 | } 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /ModsThanos/GemBehaviour.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using ModsThanos.Utility; 4 | using Hazel; 5 | using Reactor; 6 | 7 | namespace ModsThanos { 8 | 9 | [RegisterInIl2Cpp] 10 | public class GemBehaviour : MonoBehaviour { 11 | 12 | public GemBehaviour(IntPtr ptr) : base(ptr) { } 13 | 14 | void OnTriggerEnter2D(Collider2D collider) { 15 | PlayerControl player = collider.GetComponent(); 16 | 17 | if (player != null && !player.Data.IsDead && player.Data.PlayerId == PlayerControl.LocalPlayer.PlayerId) { 18 | if (name == "Soul") { 19 | GlobalVariable.hasSoulStone = true; 20 | GlobalVariable.PlayerSoulStone = PlayerControlUtils.FromPlayerId(PlayerControl.LocalPlayer.PlayerId); 21 | 22 | MessageWriter write = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte) CustomRPC.SetPlayerSoulStone, SendOption.None, -1); 23 | write.Write(player.PlayerId); 24 | AmongUsClient.Instance.FinishRpcImmediately(write); 25 | 26 | Destroy(GlobalVariable.arrow); 27 | StonePickup(); 28 | } 29 | } 30 | 31 | if (player != null && !player.Data.IsDead && player.Data.PlayerId == PlayerControl.LocalPlayer.PlayerId && name != "Soul") { 32 | if (RoleHelper.IsThanos(PlayerControl.LocalPlayer.PlayerId)) { 33 | switch (name) { 34 | case "Mind": 35 | GlobalVariable.hasMindStone = true; 36 | break; 37 | 38 | case "Power": 39 | GlobalVariable.hasPowerStone = true; 40 | break; 41 | 42 | case "Reality": 43 | GlobalVariable.hasRealityStone = true; 44 | break; 45 | 46 | case "Space": 47 | GlobalVariable.hasSpaceStone = true; 48 | break; 49 | 50 | case "Time": 51 | GlobalVariable.hasTimeStone = true; 52 | break; 53 | 54 | default: 55 | ModThanos.Logger.LogInfo("Pierre inconnu rammasser"); 56 | break; 57 | } 58 | 59 | StonePickup(); 60 | } 61 | } 62 | } 63 | 64 | void StonePickup() { 65 | HelperSprite.ShowAnimation(1, 28, true, "ModsThanos.Resources.anim-pickup.png", 128, 1, this.gameObject.transform.position); 66 | 67 | MessageWriter write = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte) CustomRPC.StonePickup, SendOption.None, -1); 68 | write.Write(name); 69 | AmongUsClient.Instance.FinishRpcImmediately(write); 70 | 71 | GlobalVariable.stoneObjects[name].DestroyThisObject(); 72 | } 73 | 74 | void Update() { 75 | if (Vector2.Distance(gameObject.transform.position, new Vector2(-10.418f, 113.000f)) < 1f) 76 | gameObject.transform.position = new Vector3(32.596f, -15.570f, -0.5f); 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /ModsThanos/Stone/System/Mind/Mind.cs: -------------------------------------------------------------------------------- 1 | using Hazel; 2 | using ModsThanos.Utility; 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | namespace ModsThanos.Stone.System.Mind { 7 | public static class CoreMind { 8 | 9 | public static void OnMindPressed() { 10 | HelperSprite.ShowAnimation(1, 15, true, "ModsThanos.Resources.anim-mind.png", 48, 1, PlayerControl.LocalPlayer.gameObject.transform.position, 1); 11 | 12 | GlobalVariable.PlayerHat = PlayerControl.LocalPlayer.Data.HatId; 13 | GlobalVariable.PlayerPet = PlayerControl.LocalPlayer.Data.PetId; 14 | GlobalVariable.PlayerSkin = PlayerControl.LocalPlayer.Data.SkinId; 15 | GlobalVariable.PlayerColor = PlayerControl.LocalPlayer.Data.ColorId; 16 | GlobalVariable.PlayerColorName = PlayerControl.LocalPlayer.nameText.Color; 17 | GlobalVariable.PlayerName = PlayerControl.LocalPlayer.Data.PlayerName; 18 | GlobalVariable.mindStoneUsed = true; 19 | 20 | List players = new List(); 21 | 22 | foreach (var element in PlayerControl.AllPlayerControls) 23 | if (element.PlayerId != PlayerControl.LocalPlayer.PlayerId && !element.Data.IsDead) 24 | players.Add(element.PlayerId); 25 | 26 | Random random = new Random(); 27 | byte RandomPlayer = players[random.Next(0, players.Count)]; 28 | 29 | PlayerControl player = PlayerControlUtils.FromPlayerId(PlayerControl.LocalPlayer.PlayerId); 30 | PlayerControl target = PlayerControlUtils.FromPlayerId(RandomPlayer); 31 | 32 | MessageWriter write = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte) CustomRPC.MindChangedValue, SendOption.None, -1); 33 | write.Write(true); 34 | AmongUsClient.Instance.FinishRpcImmediately(write); 35 | 36 | player.RpcSetHat(target.Data.HatId); 37 | player.RpcSetSkin(target.Data.SkinId); 38 | player.RpcSetPet(target.Data.PetId); 39 | player.RpcSetColor(target.Data.ColorId); 40 | player.RpcSetName(target.Data.PlayerName); 41 | PlayerControlUtils.RpcSetColorName(target.nameText.Color, player.PlayerId); } 42 | 43 | public static void OnMindEnded(bool wihoutAnimation = false) { 44 | if (!wihoutAnimation) HelperSprite.ShowAnimation(1, 15, true, "ModsThanos.Resources.anim-mind.png", 48, 1, PlayerControl.LocalPlayer.gameObject.transform.position, 1); 45 | PlayerControl player = PlayerControlUtils.FromPlayerId(PlayerControl.LocalPlayer.PlayerId); 46 | MessageWriter write = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte) CustomRPC.MindChangedValue, SendOption.None, -1); 47 | write.Write(false); 48 | AmongUsClient.Instance.FinishRpcImmediately(write); 49 | 50 | GlobalVariable.mindStoneUsed = false; 51 | player.RpcSetName(GlobalVariable.PlayerName); 52 | PlayerControlUtils.RpcSetColorName(new UnityEngine.Color(1f, 1f, 1f, 1f), PlayerControl.LocalPlayer.PlayerId); 53 | player.RpcSetHat(GlobalVariable.PlayerHat); 54 | player.RpcSetSkin(GlobalVariable.PlayerSkin); 55 | player.RpcSetPet(GlobalVariable.PlayerPet); 56 | player.RpcSetColor(GlobalVariable.PlayerColor); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /ModsThanos/Utility/PlayerControlUtils.cs: -------------------------------------------------------------------------------- 1 | using Hazel; 2 | using System; 3 | using UnityEngine; 4 | 5 | namespace ModsThanos.Utility { 6 | public class PlayerControlUtils { 7 | public const float OffsetTruePositionX = 0; 8 | public const float OffsetTruePositionY = 0.366667f; 9 | 10 | public static Vector2 TruePositionOffset = new Vector2(OffsetTruePositionX, OffsetTruePositionY); 11 | 12 | public static Vector2 Position(PlayerControl player) { 13 | return player.GetTruePosition() + TruePositionOffset; 14 | } 15 | 16 | public static PlayerControl FromNetId(uint netId) { 17 | foreach (var player in PlayerControl.AllPlayerControls) 18 | if (player.NetId == netId) 19 | return player; 20 | 21 | return null; 22 | } 23 | 24 | public static PlayerControl FromPlayerId(byte id) { 25 | for (int i = 0; i < PlayerControl.AllPlayerControls.Count; i++) 26 | if (PlayerControl.AllPlayerControls[i].PlayerId == id) 27 | return PlayerControl.AllPlayerControls[i]; 28 | 29 | return null; 30 | } 31 | 32 | /// 33 | /// Set the players opacity (hat bugs a bit) 34 | /// 35 | /// Opacity value from 0 - 1 36 | public void SetOpacity(float opacity, PlayerControl player) { 37 | var toSetColor = new Color(1, 1, 1, opacity); 38 | player.GetComponent().color = toSetColor; 39 | 40 | player.HatRenderer.FrontLayer.color = toSetColor; 41 | player.HatRenderer.BackLayer.color = toSetColor; 42 | player.HatRenderer.color = toSetColor; 43 | player.MyPhysics.Skin.layer.color = toSetColor; 44 | player.nameText.Color = toSetColor; 45 | } 46 | 47 | public void Telportation(Vector2 position, PlayerControl player) { 48 | player.NetTransform.RpcSnapTo(position); 49 | } 50 | 51 | public static void KillPlayerArea(Vector2 psotion, PlayerControl murder, float size) { 52 | foreach (var player in PlayerControl.AllPlayerControls) { 53 | if (player.PlayerId == murder.PlayerId) 54 | continue; 55 | 56 | float distance = Vector2.Distance(psotion, Position(player)); 57 | if (distance < size) 58 | player.MurderPlayer(player); 59 | } 60 | } 61 | 62 | public static void RpcSetColorName(Color color, byte playerid) { 63 | FromPlayerId(playerid).nameText.Color = new Color(color.r, color.g, color.b, color.a); 64 | 65 | MessageWriter write = AmongUsClient.Instance.StartRpc(PlayerControl.LocalPlayer.NetId, (byte) CustomRPC.SetColorName, SendOption.None); 66 | write.Write(playerid); 67 | write.Write(color.r); 68 | write.Write(color.g); 69 | write.Write(color.b); 70 | write.Write(color.a); 71 | write.EndMessage(); 72 | } 73 | 74 | public static void KillEveryone(PlayerControl murder) { 75 | foreach (var player in PlayerControl.AllPlayerControls) { 76 | if (player.PlayerId == murder.PlayerId) 77 | continue; 78 | 79 | player.MurderPlayer(player); 80 | } 81 | } 82 | 83 | public static bool AmHost() { 84 | return AmongUsClient.Instance.AmHost; 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /ModsThanos/Utility/HelperSprite.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnhollowerBaseLib; 4 | using UnityEngine; 5 | 6 | namespace ModsThanos.Utility { 7 | class HelperSprite { 8 | public static Sprite LoadSpriteFromEmbeddedResources(string resource, float PixelPerUnit) { 9 | try { 10 | System.Reflection.Assembly myAssembly = System.Reflection.Assembly.GetExecutingAssembly(); 11 | System.IO.Stream myStream = myAssembly.GetManifestResourceStream(resource); 12 | byte[] image = new byte[myStream.Length]; 13 | myStream.Read(image, 0, (int) myStream.Length); 14 | Texture2D myTexture = new Texture2D(2, 2, TextureFormat.ARGB32, true); 15 | LoadImage(myTexture, image, true); 16 | return Sprite.Create(myTexture, new Rect(0, 0, myTexture.width, myTexture.height), new Vector2(0.5f, 0.5f), PixelPerUnit); 17 | } catch { } 18 | return null; 19 | } 20 | 21 | public static List LoadTileTextureEmbed(string resource, float PixelPerUnit, int TileX, int TileY) { 22 | try { 23 | List sprites = new List(); 24 | System.Reflection.Assembly myAssembly = System.Reflection.Assembly.GetExecutingAssembly(); 25 | System.IO.Stream myStream = myAssembly.GetManifestResourceStream(resource); 26 | byte[] image = new byte[myStream.Length]; 27 | myStream.Read(image, 0, (int) myStream.Length); 28 | Texture2D myTexture = new Texture2D(2, 2, TextureFormat.ARGB32, true); 29 | LoadImage(myTexture, image, true); 30 | 31 | int sizeX = (int) ((float) (myTexture.width / (float) TileX)); 32 | int sizeY = (int) ((float) (myTexture.height / (float) TileY)); 33 | 34 | for (int x = 1; x <= TileX; x++) { 35 | for (int y = 1; y <= TileY; y++) { 36 | sprites.Add(Sprite.Create(myTexture, new Rect(myTexture.width - (sizeX * x), myTexture.height - (sizeY * y), sizeX, sizeY), new Vector2(0.5f, 0.5f), PixelPerUnit, 100, SpriteMeshType.FullRect, Vector4.zero)); 37 | } 38 | } 39 | 40 | return sprites; 41 | } catch { } 42 | return null; 43 | } 44 | 45 | public static void ShowAnimation(int TileX, int TileY, bool simpleAnimation, string image, int PixelPerUnit, int framerate, Vector3 position, int LayerValue = 1) { 46 | GameObject animation = new GameObject { layer = LayerValue }; 47 | animation.transform.position = position; 48 | 49 | var anim = animation.AddComponent(); 50 | anim.TileX = TileX; 51 | anim.TileY = TileY; 52 | anim.simpleAnimation = simpleAnimation; 53 | anim.image = image; 54 | anim.PixelPerUnit = PixelPerUnit; 55 | anim.framerate = framerate; 56 | } 57 | 58 | internal delegate bool d_LoadImage(IntPtr tex, IntPtr data, bool markNonReadable); 59 | internal static d_LoadImage iCall_LoadImage; 60 | private static bool LoadImage(Texture2D tex, byte[] data, bool markNonReadable) { 61 | if (iCall_LoadImage == null) 62 | iCall_LoadImage = IL2CPP.ResolveICall("UnityEngine.ImageConversion::LoadImage"); 63 | 64 | var il2cppArray = (Il2CppStructArray) data; 65 | 66 | return iCall_LoadImage.Invoke(tex.Pointer, il2cppArray.Pointer, markNonReadable); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /ModsThanos/CustomGameOptions.cs: -------------------------------------------------------------------------------- 1 | using Essentials.Options; 2 | using ModsThanos.Utility.Enumerations; 3 | 4 | namespace ModsThanos { 5 | public static class CustomGameOptions { 6 | public static string[] visibilityValue = new string[] { "Everyone", "Thanos", "Crewmate" }; 7 | 8 | public static CustomToggleOption EnableThanosMods = CustomOption.AddToggle("Enable Thanos Mods", true); 9 | public static CustomStringOption ThanosSide = CustomOption.AddString("Thanos Side", new string[] { "Impostor", "Crewmate" }); 10 | public static CustomNumberOption NumberThanos = CustomOption.AddNumber("Thanos Number", 1f, 1f, 10f, 1f); 11 | public static CustomToggleOption DisableSnap = CustomOption.AddToggle("Disable Snap", false); 12 | 13 | public static CustomNumberOption CooldownTimeStone = CustomOption.AddNumber("Cooldown Time Stone", 30f, 10f, 300f, 5f); 14 | public static CustomNumberOption CooldownRealityStone = CustomOption.AddNumber("Cooldown Reality Stone", 10f, 10f, 300f, 5f); 15 | public static CustomNumberOption CooldownSoulStone = CustomOption.AddNumber("Cooldown Soul Stone", 30f, 10f, 300f, 5f); 16 | public static CustomNumberOption CooldownSpaceStone = CustomOption.AddNumber("Cooldown Space Stone", 30f, 10f, 300f, 5f); 17 | public static CustomNumberOption CooldownMindStone = CustomOption.AddNumber("Cooldown Mind Stone", 30f, 10f, 300f, 5f); 18 | public static CustomNumberOption CooldownPowerStone = CustomOption.AddNumber("Cooldown Power Stone", 30f, 10f, 300f, 5f); 19 | public static CustomNumberOption TimeDuration = CustomOption.AddNumber("Time Duration", 5f, 5f, 40f, 2.5f); 20 | public static CustomNumberOption RealityDuration = CustomOption.AddNumber("Reality Duration", 10f, 5f, 40f, 2.5f); 21 | public static CustomNumberOption MindDuration = CustomOption.AddNumber("Mind Duration", 4f, 5f, 40f, 2.5f); 22 | public static CustomNumberOption MaxPortal = CustomOption.AddNumber("Max Portal", 4f, 1f, 20f, 1f); 23 | public static CustomNumberOption StoneSize = CustomOption.AddNumber("Stone Size", 320f, 50f, 1000f, 10f); 24 | 25 | public static CustomStringOption VisibilityTime = CustomOption.AddString("Time Stone Visibility", visibilityValue); 26 | public static CustomStringOption VisibilityPower = CustomOption.AddString("Power Stone Visibility", visibilityValue); 27 | public static CustomStringOption VisibilityMind = CustomOption.AddString("Mind Stone Visibility", visibilityValue); 28 | public static CustomStringOption VisibilitySoul = CustomOption.AddString("Soul Stone Visibility", visibilityValue); 29 | public static CustomStringOption VisibilitySpace = CustomOption.AddString("Space Stone Visibility", visibilityValue); 30 | public static CustomStringOption VisibilityReality = CustomOption.AddString("Reality Stone Visibility", visibilityValue); 31 | 32 | public static Visibility VisibilityStringToEnum(string visibility) { 33 | return visibility switch { 34 | "Everyone" => Visibility.Everyone, 35 | "Thanos" => Visibility.OnlyImpostor, 36 | "Crewmate" => Visibility.OnlyCrewmate, 37 | _ => Visibility.OnlyImpostor, 38 | }; 39 | } 40 | 41 | public static Visibility SideStringToEnum(string visibility) { 42 | return visibility switch 43 | { 44 | "Everyone" => Visibility.Everyone, 45 | "Impostor" => Visibility.OnlyImpostor, 46 | "Crewmate" => Visibility.OnlyCrewmate, 47 | _ => Visibility.OnlyImpostor, 48 | }; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /ModsThanos/Stone/System/Reality.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using Hazel; 3 | using ModsThanos.Utility; 4 | using System.Collections.Generic; 5 | using UnityEngine; 6 | 7 | namespace ModsThanos.Stone.System { 8 | class Reality { 9 | public static List invisPlayers = new List(); 10 | 11 | public static void OnRealityPressed(bool isInvis) { 12 | HelperSprite.ShowAnimation(1, 8, true, "ModsThanos.Resources.anim-reality.png", 48, 1, PlayerControl.LocalPlayer.gameObject.transform.position, 1); 13 | var writer = AmongUsClient.Instance.StartRpc(PlayerControl.LocalPlayer.NetId, (byte) CustomRPC.TurnInvisibility, SendOption.Reliable); 14 | writer.Write(isInvis); 15 | writer.Write(PlayerControl.LocalPlayer.PlayerId); 16 | writer.EndMessage(); 17 | RpcFunctions.TurnInvis(isInvis, PlayerControl.LocalPlayer); 18 | } 19 | } 20 | 21 | public static class RpcFunctions { 22 | static public void TurnInvis(bool isInvis, PlayerControl player) { 23 | var playerRenderer = player.myRend; 24 | 25 | if (isInvis) { 26 | Reality.invisPlayers.Add(player.PlayerId); 27 | if (player == PlayerControl.LocalPlayer || RoleHelper.IsThanos(PlayerControl.LocalPlayer.PlayerId) || PlayerControl.LocalPlayer.Data.IsDead) { 28 | playerRenderer.SetColorAlpha(0.2f); 29 | player.HatRenderer.FrontLayer.SetColorAlpha(0.2f); 30 | player.HatRenderer.BackLayer.SetColorAlpha(0.2f); 31 | player.MyPhysics.Skin.layer.SetColorAlpha(0.2f); 32 | if (player.CurrentPet != null) player.CurrentPet.rend.SetColorAlpha(0.2f); 33 | 34 | } else { 35 | playerRenderer.SetColorAlpha(0f); 36 | player.HatRenderer.FrontLayer.SetColorAlpha(0f); 37 | player.HatRenderer.BackLayer.SetColorAlpha(0f); 38 | player.MyPhysics.Skin.layer.SetColorAlpha(0f); 39 | player.nameText.Color = new Color(player.nameText.Color.r, player.nameText.Color.g, player.nameText.Color.b, 0f); 40 | if (player.CurrentPet != null) player.CurrentPet.rend.SetColorAlpha(0f); 41 | } 42 | } else { 43 | Reality.invisPlayers.Remove(player.PlayerId); 44 | player.nameText.Color = new Color(player.nameText.Color.r, player.nameText.Color.g, player.nameText.Color.b, 1f); 45 | playerRenderer.SetColorAlpha(1f); 46 | player.HatRenderer.FrontLayer.SetColorAlpha(1f); 47 | player.HatRenderer.BackLayer.SetColorAlpha(1f); 48 | player.MyPhysics.Skin.layer.SetColorAlpha(1f); 49 | if (player.CurrentPet != null) player.CurrentPet.rend.SetColorAlpha(1f); 50 | } 51 | } 52 | 53 | static public void SetColorAlpha(this SpriteRenderer renderer, float alpha) { 54 | renderer.color = new Color(renderer.color.r, renderer.color.g, renderer.color.b, alpha); 55 | } 56 | } 57 | 58 | [HarmonyPatch(typeof(PlayerPhysics), nameof(PlayerPhysics.LateUpdate))] 59 | public static class PlayerPhysicsLateUpdatePatch { 60 | public static void Prefix(PlayerPhysics __instance) { 61 | if (Reality.invisPlayers.Contains(__instance.Field_5.PlayerId)) { 62 | if (RoleHelper.IsThanos(PlayerControl.LocalPlayer.PlayerId) || PlayerControl.LocalPlayer.Data.IsDead) { 63 | __instance.Field_5.SetHatAlpha(0.2f); 64 | } else { 65 | __instance.Field_5.SetHatAlpha(0f); 66 | } 67 | } 68 | } 69 | } 70 | 71 | [HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.Start))] 72 | public class GameStartManagerStartPatch { 73 | public static void Prefix() { 74 | Reality.invisPlayers.Clear(); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /ModsThanos/Stone/System/Time/Time.cs: -------------------------------------------------------------------------------- 1 | using Hazel; 2 | using ModsThanos.Utility; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using UnityEngine; 7 | 8 | namespace ModsThanos.Stone.System { 9 | 10 | public static class Time { 11 | 12 | public static float recordTime = 10f; 13 | public static bool isRewinding = false; 14 | internal static List pointsInTime = new List(); 15 | private static long deadtime; 16 | private static bool isDead = false; 17 | 18 | public static void Record() { 19 | if (pointsInTime.Count > Mathf.Round(recordTime / UnityEngine.Time.fixedDeltaTime)) { 20 | pointsInTime.RemoveAt(pointsInTime.Count - 1); 21 | } 22 | 23 | if (PlayerControl.LocalPlayer != null) { 24 | pointsInTime.Insert(0, new TimePoint( 25 | PlayerControl.LocalPlayer.transform.position, 26 | PlayerControl.LocalPlayer.gameObject.GetComponent().velocity, 27 | DateTimeOffset.Now.ToUnixTimeSeconds() 28 | )); 29 | 30 | if (PlayerControl.LocalPlayer.Data.IsDead && !isDead) { 31 | isDead = true; 32 | deadtime = DateTimeOffset.Now.ToUnixTimeSeconds(); 33 | } 34 | 35 | if (!PlayerControl.LocalPlayer.Data.IsDead && isDead) { 36 | isDead = false; 37 | deadtime = 0; 38 | } 39 | } 40 | } 41 | 42 | public static void Rewind() { 43 | if (pointsInTime.Count > 0) { 44 | if (!PlayerControl.LocalPlayer.inVent) { 45 | TimePoint currentTimePoint = pointsInTime[0]; 46 | 47 | PlayerControl.LocalPlayer.transform.position = currentTimePoint.Position; 48 | PlayerControl.LocalPlayer.gameObject.GetComponent().velocity = currentTimePoint.Velocity; 49 | 50 | if (isDead && currentTimePoint.Unix < deadtime && PlayerControl.LocalPlayer.Data.IsDead) { 51 | PlayerControl.LocalPlayer.Revive(); 52 | var body = UnityEngine.Object.FindObjectsOfType().FirstOrDefault(b => b.ParentId == PlayerControl.LocalPlayer.PlayerId); 53 | 54 | if (body != null) 55 | UnityEngine.Object.Destroy(body.gameObject); 56 | 57 | deadtime = 0; 58 | isDead = false; 59 | 60 | MessageWriter write = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte) CustomRPC.TimeRevive, SendOption.None, -1); 61 | write.Write(PlayerControl.LocalPlayer.PlayerId); 62 | AmongUsClient.Instance.FinishRpcImmediately(write); 63 | } 64 | } 65 | 66 | pointsInTime.RemoveAt(0); 67 | } else { 68 | StopRewind(); 69 | } 70 | } 71 | 72 | public static void StartRewind() { 73 | isRewinding = true; 74 | PlayerControl.LocalPlayer.moveable = false; 75 | HudManager.Instance.FullScreen.color = new Color(0f, 0.639f, 0.211f, 0.3f); 76 | HudManager.Instance.FullScreen.enabled = true; 77 | GlobalVariable.UsableButton = false; 78 | HelperSprite.ShowAnimation(1, 13, true, "ModsThanos.Resources.anim-time.png", 64, 1, PlayerControl.LocalPlayer.gameObject.transform.position, 5); 79 | 80 | MessageWriter write = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte) CustomRPC.TimeRewind, SendOption.None, -1); 81 | AmongUsClient.Instance.FinishRpcImmediately(write); 82 | } 83 | 84 | public static void StopRewind() { 85 | isRewinding = false; 86 | GlobalVariable.UsableButton = true; 87 | PlayerControl.LocalPlayer.moveable = true; 88 | HudManager.Instance.FullScreen.enabled = false; 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /ModsThanos/Patch/StartPatch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using Hazel; 3 | using ModsThanos.Map; 4 | using ModsThanos.Utility; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using UnityEngine; 8 | 9 | namespace ModsThanos.Patch { 10 | 11 | [HarmonyPatch(typeof(ShipStatus), nameof(ShipStatus.Start))] 12 | public static class ShipStatusPatch { 13 | public static void Prefix(ShipStatus __instance) { 14 | Stone.System.Time.pointsInTime.Clear(); 15 | Stone.System.Time.recordTime = CustomGameOptions.TimeDuration.GetValue(); 16 | GlobalVariable.hasMindStone = false; 17 | GlobalVariable.hasPowerStone = false; 18 | GlobalVariable.hasRealityStone = false; 19 | GlobalVariable.hasSoulStone = false; 20 | GlobalVariable.hasSpaceStone = false; 21 | GlobalVariable.realityStoneUsed = false; 22 | GlobalVariable.hasTimeStone = false; 23 | GlobalVariable.useSnap = false; 24 | GlobalVariable.mindStoneUsed = false; 25 | GlobalVariable.GameStarted = true; 26 | GlobalVariable.UsableButton = true; 27 | GlobalVariable.PlayerName = null; 28 | 29 | GlobalVariable.allPlayersData.Clear(); 30 | foreach (var player in PlayerControl.AllPlayerControls) { 31 | GlobalVariable.allPlayersData.Add(new Stone.System.Mind.PlayerData( 32 | player.PlayerId, 33 | player.Data.ColorId, 34 | player.Data.HatId, 35 | player.Data.PetId, 36 | player.Data.SkinId, 37 | player.nameText.Text 38 | )); 39 | } 40 | 41 | // Button Timer 42 | Stone.System.Time.recordTime = CustomGameOptions.TimeDuration.GetValue(); 43 | GlobalVariable.buttonMind.MaxTimer = CustomGameOptions.CooldownMindStone.GetValue(); 44 | GlobalVariable.buttonMind.EffectDuration = CustomGameOptions.MindDuration.GetValue(); 45 | GlobalVariable.buttonReality.MaxTimer = CustomGameOptions.CooldownRealityStone.GetValue(); 46 | GlobalVariable.buttonReality.EffectDuration = CustomGameOptions.RealityDuration.GetValue(); 47 | GlobalVariable.buttonTime.MaxTimer = CustomGameOptions.CooldownTimeStone.GetValue(); 48 | GlobalVariable.buttonTime.EffectDuration = CustomGameOptions.TimeDuration.GetValue() / 2; 49 | GlobalVariable.buttonPower.MaxTimer = CustomGameOptions.CooldownPowerStone.GetValue(); 50 | GlobalVariable.buttonSpace.MaxTimer = CustomGameOptions.CooldownSpaceStone.GetValue(); 51 | 52 | Dictionary stonePosition = StonePlacement.SetAllStonePositions(); 53 | StonePlacement.PlaceAllStone(); 54 | 55 | if (PlayerControlUtils.AmHost()) { 56 | foreach (var stone in stonePosition) { 57 | MessageWriter write = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte) CustomRPC.SyncStone, SendOption.None, -1); 58 | write.Write(stone.Key); 59 | write.WriteVector2(stone.Value); 60 | AmongUsClient.Instance.FinishRpcImmediately(write); 61 | } 62 | } 63 | } 64 | } 65 | 66 | [HarmonyPatch(typeof(LobbyBehaviour), nameof(LobbyBehaviour.Start))] 67 | public static class LobbyBehaviourPatch { 68 | public static void Prefix() { 69 | GlobalVariable.stoneObjects.Clear(); 70 | GlobalVariable.stonePositon.Clear(); 71 | GlobalVariable.allThanos.Clear(); 72 | GlobalVariable.hasMindStone = false; 73 | GlobalVariable.hasPowerStone = false; 74 | GlobalVariable.hasRealityStone = false; 75 | GlobalVariable.hasSoulStone = false; 76 | GlobalVariable.hasSpaceStone = false; 77 | GlobalVariable.hasTimeStone = false; 78 | GlobalVariable.realityStoneUsed = false; 79 | GlobalVariable.useSnap = false; 80 | GlobalVariable.mindStoneUsed = false; 81 | GlobalVariable.UsableButton = false; 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /ModsThanos/Utility/Utils.cs: -------------------------------------------------------------------------------- 1 | using Hazel; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace ModsThanos.Utility { 6 | public static class Utils { 7 | private static readonly FloatRange XRange = new FloatRange(-40f, 40f); 8 | private static readonly FloatRange YRange = new FloatRange(-40f, 40f); 9 | 10 | public static void WriteVector2(this MessageWriter writer, Vector2 vec) { 11 | ushort value = (ushort) (XRange.ReverseLerp(vec.x) * 65535f); 12 | ushort value2 = (ushort) (YRange.ReverseLerp(vec.y) * 65535f); 13 | writer.Write(value); 14 | writer.Write(value2); 15 | } 16 | 17 | public static Vector2 ReadVector2(this MessageReader reader) { 18 | float v = (float) reader.ReadUInt16() / 65535f; 19 | float v2 = (float) reader.ReadUInt16() / 65535f; 20 | return new Vector2(XRange.Lerp(v), YRange.Lerp(v2)); 21 | } 22 | } 23 | 24 | public class FloatRange { 25 | public float Last { 26 | get; private set; 27 | } 28 | 29 | public float Width { 30 | get { 31 | return this.max - this.min; 32 | } 33 | } 34 | 35 | public FloatRange(float min, float max) { 36 | this.min = min; 37 | this.max = max; 38 | } 39 | 40 | public float ChangeRange(float y, float min, float max) { 41 | return Mathf.Lerp(min, max, (y - this.min) / this.Width); 42 | } 43 | 44 | public float Clamp(float value) { 45 | return Mathf.Clamp(value, this.min, this.max); 46 | } 47 | 48 | public bool Contains(float t) { 49 | return this.min <= t && this.max >= t; 50 | } 51 | 52 | public float CubicLerp(float v) { 53 | if (this.min >= this.max) { 54 | return this.min; 55 | } 56 | v = Mathf.Clamp(0f, 1f, v); 57 | return v * v * v * (this.max - this.min) + this.min; 58 | } 59 | 60 | public float EitherOr() { 61 | if (UnityEngine.Random.value <= 0.5f) { 62 | return this.max; 63 | } 64 | return this.min; 65 | } 66 | 67 | public float LerpUnclamped(float v) { 68 | return Mathf.LerpUnclamped(this.min, this.max, v); 69 | } 70 | 71 | public float Lerp(float v) { 72 | return Mathf.Lerp(this.min, this.max, v); 73 | } 74 | 75 | public float ExpOutLerp(float v) { 76 | return this.Lerp(1f - Mathf.Pow(2f, -10f * v)); 77 | } 78 | 79 | public static float ExpOutLerp(float v, float min, float max) { 80 | return Mathf.Lerp(min, max, 1f - Mathf.Pow(2f, -10f * v)); 81 | } 82 | 83 | public static float Next(float min, float max) { 84 | return UnityEngine.Random.Range(min, max); 85 | } 86 | 87 | public float Next() { 88 | return this.Last = UnityEngine.Random.Range(this.min, this.max); 89 | } 90 | 91 | public IEnumerable Range(int numStops) { 92 | float num; 93 | for (float i = 0f; i <= (float) numStops; i = num) { 94 | yield return Mathf.Lerp(this.min, this.max, i / (float) numStops); 95 | num = i + 1f; 96 | } 97 | yield break; 98 | } 99 | 100 | public IEnumerable RandomRange(int numStops) { 101 | float num; 102 | for (float i = 0f; i <= (float) numStops; i = num) { 103 | yield return this.Next(); 104 | num = i + 1f; 105 | } 106 | yield break; 107 | } 108 | 109 | internal float ReverseLerp(float t) { 110 | return Mathf.Clamp((t - this.min) / this.Width, 0f, 1f); 111 | } 112 | 113 | public static float ReverseLerp(float t, float min, float max) { 114 | float num = max - min; 115 | return Mathf.Clamp((t - min) / num, 0f, 1f); 116 | } 117 | 118 | public IEnumerable SpreadToEdges(int stops) { 119 | return FloatRange.SpreadToEdges(this.min, this.max, stops); 120 | } 121 | 122 | // Token: 0x060000F9 RID: 249 RVA: 0x00005ACD File Offset: 0x00003CCD 123 | public IEnumerable SpreadEvenly(int stops) { 124 | return FloatRange.SpreadEvenly(this.min, this.max, stops); 125 | } 126 | 127 | public static IEnumerable SpreadToEdges(float min, float max, int stops) { 128 | if (stops == 1) { 129 | yield break; 130 | } 131 | int num; 132 | for (int i = 0; i < stops; i = num) { 133 | yield return Mathf.Lerp(min, max, (float) i / ((float) stops - 1f)); 134 | num = i + 1; 135 | } 136 | yield break; 137 | } 138 | 139 | public static IEnumerable SpreadEvenly(float min, float max, int stops) { 140 | float step = 1f / ((float) stops + 1f); 141 | for (float i = step; i < 1f; i += step) { 142 | yield return Mathf.Lerp(min, max, i); 143 | } 144 | yield break; 145 | } 146 | 147 | public float min; 148 | public float max; 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /ModsThanos/Stone/System/Space.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using System.Linq; 3 | using UnityEngine; 4 | using Hazel; 5 | using ModsThanos.Utility; 6 | using System.Collections.Generic; 7 | 8 | namespace ModsThanos.Stone.System { 9 | 10 | public static class Space { 11 | private static List listVent = new List(); 12 | public static Vent lastVent; 13 | 14 | public static void OnSpacePressed() { 15 | var pos = PlayerControl.LocalPlayer.transform.position; 16 | int ventId = GetAvailableVentId(); 17 | int ventLeft = int.MaxValue; 18 | int ventCrnter = int.MaxValue; 19 | int ventRight = int.MaxValue; 20 | 21 | if (lastVent != null) { 22 | ventLeft = lastVent.Id; 23 | } 24 | 25 | RpcSpawnVent(ventId, pos, ventLeft, ventCrnter, ventRight); 26 | } 27 | 28 | static int GetAvailableVentId() { 29 | int id = 0; 30 | 31 | while (true) { 32 | if (!ShipStatus.Instance.AllVents.Any(v => v.Id == id)) { 33 | return id; 34 | } 35 | id++; 36 | } 37 | } 38 | 39 | static void SpawnVent(int id, Vector2 postion, int leftVent, int centerVent, int rightVent) { 40 | var ventPref = GameObject.FindObjectOfType(); 41 | var vent = GameObject.Instantiate(ventPref, ventPref.transform.parent); 42 | 43 | GameObject goRender = new GameObject(); 44 | SpriteRenderer renderer = goRender.AddComponent(); 45 | goRender.gameObject.transform.position = new Vector3(postion.x, postion.y, 1f); 46 | goRender.gameObject.transform.parent = ventPref.transform.parent; 47 | renderer.sprite = HelperSprite.LoadSpriteFromEmbeddedResources("ModsThanos.Resources.portal.png", 300f); 48 | vent.GetComponent().color = new Color(1f, 1f, 1f, 0f); 49 | 50 | vent.Id = id; 51 | vent.transform.position = postion; 52 | vent.Left = leftVent == int.MaxValue ? null : ShipStatus.Instance.AllVents.FirstOrDefault(v => v.Id == leftVent); 53 | vent.Center = centerVent == int.MaxValue ? null : ShipStatus.Instance.AllVents.FirstOrDefault(v => v.Id == centerVent); 54 | vent.Right = rightVent == int.MaxValue ? null : ShipStatus.Instance.AllVents.FirstOrDefault(v => v.Id == rightVent); 55 | 56 | var allVents = ShipStatus.Instance.AllVents.ToList(); 57 | allVents.Add(vent); 58 | ShipStatus.Instance.AllVents = allVents.ToArray(); 59 | 60 | if (lastVent != null) { 61 | lastVent.Right = ShipStatus.Instance.AllVents.FirstOrDefault(v => v.Id == id); 62 | } 63 | 64 | lastVent = vent; 65 | 66 | HelperSprite.ShowAnimation(1, 30, true, "ModsThanos.Resources.anim-space.png", 64, 1, new Vector3(goRender.gameObject.transform.position.x, goRender.gameObject.transform.position.y + 0.3f, 1f), 5);; 67 | } 68 | 69 | static void RpcSpawnVent(int id, Vector2 postion, int leftVent, int centerVent, int rightVent) { 70 | 71 | SpawnVent(id, postion, leftVent, centerVent, rightVent); 72 | 73 | var w = AmongUsClient.Instance.StartRpc(ShipStatus.Instance.NetId, (byte) CustomRPC.SpawnPortal, SendOption.Reliable); 74 | 75 | w.WritePacked(id); 76 | w.WriteVector2(postion); 77 | w.WritePacked(leftVent); 78 | w.WritePacked(centerVent); 79 | w.WritePacked(rightVent); 80 | w.EndMessage(); 81 | 82 | } 83 | 84 | [HarmonyPatch(typeof(ShipStatus), nameof(ShipStatus.HandleRpc))] 85 | static class ShipstatusHandleRpcPatch { 86 | static bool Prefix(ShipStatus __instance, byte HKHMBLJFLMC, MessageReader ALMCIJKELCP) { 87 | if (HKHMBLJFLMC == (byte) CustomRPC.SpawnPortal) { 88 | var reader = ALMCIJKELCP; 89 | var id = reader.ReadPackedInt32(); 90 | var postion = reader.ReadVector2(); 91 | var leftVent = reader.ReadPackedInt32(); 92 | var centerVent = reader.ReadPackedInt32(); 93 | var rightVent = reader.ReadPackedInt32(); 94 | 95 | SpawnVent( 96 | id: id, 97 | postion: postion, 98 | leftVent: leftVent, 99 | centerVent: centerVent, 100 | rightVent: rightVent 101 | ); 102 | return false; 103 | } 104 | return true; 105 | } 106 | } 107 | } 108 | } -------------------------------------------------------------------------------- /ModsThanos/Utility/RandomPosition.cs: -------------------------------------------------------------------------------- 1 | using ModsThanos.Utility.Enumerations; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using UnityEngine; 6 | 7 | namespace ModsThanos.Utility { 8 | class RandomPosition { 9 | public static Dictionary MapLocations = new Dictionary() { 10 | { MapType.Skeld, new Vector2[] { 11 | new Vector2(-12.594f, -4.179f), 12 | new Vector2(-22.746f, -7.206f), 13 | new Vector2(-19.269f, -9.544f), 14 | new Vector2(-7.772f, -11.655f), 15 | new Vector2(-9.825f, -9.023f), 16 | new Vector2(-2.874f, -16.936f), 17 | new Vector2(0.336f, -9.152f), 18 | new Vector2(5.731f, -9.607f), 19 | new Vector2(-5.044f, -2.642f), 20 | new Vector2(-1.013f, 5.975f), 21 | new Vector2(10.772f, 1.998f), 22 | new Vector2(6.409f, -4.710f), 23 | new Vector2(17.997f, -5.689f), 24 | new Vector2(11.165f, -10.334f), 25 | new Vector2(7.522f, -14.285f), 26 | new Vector2(1.707f, -14.937f), 27 | new Vector2(-3.685f, -11.657f), 28 | new Vector2(-14.163f, -6.832f), 29 | new Vector2(-18.551f, 2.625f), 30 | new Vector2(-7.556f, -2.124f) 31 | }}, 32 | 33 | { MapType.Polus, new Vector2[] { 34 | new Vector2(4.458f, -3.387f), 35 | new Vector2(3.801F, -7.584F), 36 | new Vector2(7.193f, -13.089f), 37 | new Vector2(4.042f, -11.233f), 38 | new Vector2(0.660f, -15.868f), 39 | new Vector2(1.516f, -18.669f), 40 | new Vector2(2.331f, -24.491f), 41 | new Vector2(9.231f, -25.351f), 42 | new Vector2(12.681f, -24.541f), 43 | new Vector2(12.489f, -17.160f), 44 | new Vector2(17.958f, -25.710f), 45 | new Vector2(22.225f, -25.008f), 46 | new Vector2(23.933f, -20.589f), 47 | new Vector2(31.295f, -11.321f), 48 | new Vector2(18.055f, -13.020f), 49 | new Vector2(12.892f, -17.317f), 50 | new Vector2(6.582f -17,113f), 51 | new Vector2(23.639f, -2.799f), 52 | new Vector2(24.928f, -6.877f), 53 | new Vector2(32.344f, -10.047f), 54 | new Vector2(34.852f, -5.208f), 55 | new Vector2(40.516f, -8.102f), 56 | new Vector2(36.291f, -22.012f) 57 | }}, 58 | 59 | { MapType.MiraHQ, new Vector2[] { 60 | new Vector2(18.266f, -3.223f), 61 | new Vector2(28.257f, -2.250f), 62 | new Vector2(18.293f, 5.045f), 63 | new Vector2(28.276f, 2.735f), 64 | new Vector2(17.843f, 11.516f), 65 | new Vector2(13.750f, 17.214f), 66 | new Vector2(22.387f, 19.160f), 67 | new Vector2(13.862f, 23.878f), 68 | new Vector2(19.330f, 25.309f), 69 | new Vector2(16.177f, 3.085f), 70 | new Vector2(16.752f, -1.455f), 71 | new Vector2(11.755f, 10.300f), 72 | new Vector2(11.112f, 14.068f), 73 | new Vector2(2.444f, 13.352f), 74 | new Vector2(0.414f, 10.087f), 75 | new Vector2(-5.780f, -2.037f), 76 | new Vector2(16.752f, -1.455f), 77 | new Vector2(10.161f, 5.162f) 78 | }} 79 | }; 80 | 81 | public static Vector2 GetRandomPosition() { 82 | var random = new System.Random(); 83 | Vector2[] vectors = MapLocations[(MapType) ShipStatus.Instance.Type]; 84 | return vectors[random.Next(vectors.Count())]; 85 | } 86 | 87 | public static Vector2 GetRandomPositionUnique(List WhiteListPosition, float separation) { 88 | bool RerollPosition; 89 | List vectors = MapLocations[(MapType) ShipStatus.Instance.Type].ToList(); 90 | Vector2 CurrentPosition; 91 | 92 | do { 93 | var random = new System.Random(); 94 | RerollPosition = false; 95 | CurrentPosition = vectors[random.Next(vectors.Count())]; 96 | 97 | foreach (var element in WhiteListPosition) { 98 | float positionBeetween = Vector2.Distance(element, CurrentPosition); 99 | if (positionBeetween < separation) { 100 | RerollPosition = true; 101 | vectors.Remove(CurrentPosition); 102 | } 103 | } 104 | } while (RerollPosition && vectors.Count > 0); 105 | 106 | if (vectors.Count == 0) 107 | throw new Exception("Hardel API => In class RandomPosition, GetRandomPositionUnique Function : No position was found in list"); 108 | 109 | return CurrentPosition; 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /ModsThanos/Stone/StoneManager.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using ModsThanos.Utility; 3 | using ModsThanos.Utility.Enumerations; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using UnityEngine; 7 | 8 | namespace ModsThanos.Stone { 9 | 10 | abstract class StoneManager { 11 | public static List Stones; 12 | 13 | public string Name { get; set; } 14 | public Color Color { get; set; } 15 | public bool IsPicked { get; set; } 16 | public PlayerControl Player { get; set; } 17 | public CooldownButton Button { get; set; } 18 | public GameObject GameObject { get; set; } 19 | public Visibility Visiblity { get; set; } 20 | public Vector2 PositionHud { get; set; } 21 | public bool CanSeeStone { get; set; } 22 | public bool HasEffectDuration { get; set; } 23 | 24 | protected StoneManager(string name, Color color, Vector2 positionHud, bool hasEffectDuration) { 25 | Name = name; 26 | Color = color; 27 | PositionHud = positionHud; 28 | HasEffectDuration = hasEffectDuration; 29 | Stones.Add(this); 30 | } 31 | 32 | public bool HasStone(byte PlayerId) { 33 | return PlayerControl.AllPlayerControls.ToArray().ToList().FirstOrDefault(s => s.PlayerId == PlayerId); 34 | } 35 | 36 | public void DestroyThisObject() { 37 | Object.Destroy(GameObject); 38 | if (Stones.Contains(this)) Stones.Remove(this); 39 | } 40 | 41 | public void ModifyPosition(Vector3 position) { 42 | GameObject.transform.position = position; 43 | } 44 | 45 | public void CanSee() { 46 | if (PlayerControl.LocalPlayer == null) 47 | return; 48 | 49 | bool IsImpostor = PlayerControl.LocalPlayer.Data.IsImpostor; 50 | switch (Visiblity) { 51 | case Visibility.Everyone: { 52 | CanSeeStone = true; 53 | break; 54 | } 55 | case Visibility.OnlyCrewmate: { 56 | CanSeeStone = !IsImpostor; 57 | break; 58 | } 59 | case Visibility.OnlyImpostor: { 60 | CanSeeStone = IsImpostor; 61 | break; 62 | } 63 | } 64 | } 65 | 66 | public void CreateGameObject(Vector2 Position) { 67 | CanSee(); 68 | GameObject = new GameObject(Name); 69 | SpriteRenderer renderer = GameObject.AddComponent(); 70 | GemBehaviour gemBehaviour = GameObject.AddComponent(); 71 | BoxCollider2D collider = GameObject.AddComponent(); 72 | 73 | collider.size = new Vector2(1f, 1f); 74 | collider.isTrigger = true; 75 | GameObject.transform.position = new Vector3(Position.x, Position.y, -0.5f); 76 | GameObject.transform.localPosition = new Vector3(Position.x, Position.y, -0.5f); 77 | GameObject.transform.localScale = new Vector3(1f, 1f, 1f); 78 | 79 | if (CanSeeStone) renderer.sprite = HelperSprite.LoadSpriteFromEmbeddedResources($"ModsThanos.Resources.{Name}.png", 300f); 80 | GameObject.SetActive(true); 81 | } 82 | 83 | public void ReplaceStone() { 84 | DestroyThisObject(); 85 | IsPicked = false; 86 | Player = null; 87 | } 88 | 89 | public static void PlaceAllStone() { 90 | foreach (var Stone in Stones) { 91 | Stone.CreateGameObject(RandomPosition.GetRandomPositionUnique(Stones.Select(s => (Vector2) s.GameObject.transform.position).ToList(), 1f)); 92 | } 93 | } 94 | 95 | public abstract void ChangeVisibility(); 96 | 97 | public abstract void OnEffectEnd(); 98 | 99 | public abstract void OnUpdate(); 100 | 101 | public abstract void OnClick(); 102 | } 103 | 104 | [HarmonyPatch(typeof(HudManager), nameof(HudManager.Start))] 105 | public static class StonesHud { 106 | public static void Postfix(HudManager __instance) { 107 | foreach (var Stone in StoneManager.Stones) { 108 | if (Stone.HasEffectDuration) { 109 | Stone.Button = new CooldownButton 110 | (() => Stone.OnClick(), 111 | CustomGameOptions.CooldownMindStone.GetValue(), 112 | $"ModsThanos.Resources.{Stone.Name}.png", 113 | 300f, 114 | Stone.PositionHud, 115 | Visibility.OnlyImpostor, 116 | __instance, 117 | CustomGameOptions.CooldownMindStone.GetValue(), 118 | () => Stone.OnEffectEnd(), 119 | () => Stone.OnUpdate() 120 | ); 121 | } else { 122 | Stone.Button = new CooldownButton 123 | (() => Stone.OnClick(), 124 | CustomGameOptions.CooldownMindStone.GetValue(), 125 | $"ModsThanos.Resources.{Stone.Name}.png", 126 | 300f, 127 | Stone.PositionHud, 128 | Visibility.OnlyImpostor, 129 | __instance, 130 | () => Stone.OnUpdate() 131 | ); 132 | } 133 | } 134 | } 135 | } 136 | } -------------------------------------------------------------------------------- /ModsThanos/Utility/CooldownButton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using ModsThanos.Utility; 5 | using ModsThanos.Utility.Enumerations; 6 | 7 | namespace ModsThanos { 8 | public class CooldownButton { 9 | public static List buttons = new List(); 10 | public KillButtonManager killButtonManager; 11 | private Color startColorButton = new Color(255, 255, 255); 12 | private Color startColorText = new Color(255, 255, 255); 13 | public Vector2 PositionOffset = Vector2.zero; 14 | public float MaxTimer = 0f; 15 | public float Timer = 0f; 16 | public float EffectDuration = 0f; 17 | public bool isEffectActive; 18 | public bool hasEffectDuration; 19 | public bool enabled = true; 20 | public Visibility visibility; 21 | private string ResourceName; 22 | private Action OnClick; 23 | private Action OnEffectEnd; 24 | private Action OnUpdate; 25 | private Sprite sprite; 26 | private HudManager hudManager; 27 | private float pixelsPerUnit; 28 | private bool canUse; 29 | 30 | public CooldownButton(Action OnClick, float Cooldown, string ImageEmbededResourcePath, float PixelsPerUnit, Vector2 PositionOffset, Visibility visibility, HudManager hudManager, float EffectDuration, Action OnEffectEnd, Action OnUpdate) { 31 | this.hudManager = hudManager; 32 | this.OnClick = OnClick; 33 | this.OnEffectEnd = OnEffectEnd; 34 | this.OnUpdate = OnUpdate; 35 | this.PositionOffset = PositionOffset; 36 | this.EffectDuration = EffectDuration; 37 | this.visibility = visibility; 38 | this.sprite = HelperSprite.LoadSpriteFromEmbeddedResources(ResourceName, pixelsPerUnit); 39 | pixelsPerUnit = PixelsPerUnit; 40 | MaxTimer = Cooldown; 41 | Timer = MaxTimer; 42 | ResourceName = ImageEmbededResourcePath; 43 | hasEffectDuration = true; 44 | isEffectActive = false; 45 | buttons.Add(this); 46 | Start(); 47 | } 48 | 49 | public CooldownButton(Action OnClick, float Cooldown, string ImageEmbededResourcePath, float pixelsPerUnit, Vector2 PositionOffset, Visibility visibility, HudManager hudManager, Action OnUpdate) { 50 | this.hudManager = hudManager; 51 | this.OnClick = OnClick; 52 | this.OnUpdate = OnUpdate; 53 | this.pixelsPerUnit = pixelsPerUnit; 54 | this.PositionOffset = PositionOffset; 55 | this.visibility = visibility; 56 | this.sprite = HelperSprite.LoadSpriteFromEmbeddedResources(ResourceName, pixelsPerUnit); 57 | MaxTimer = Cooldown; 58 | Timer = MaxTimer; 59 | ResourceName = ImageEmbededResourcePath; 60 | hasEffectDuration = false; 61 | buttons.Add(this); 62 | Start(); 63 | } 64 | 65 | private void Start() { 66 | killButtonManager = UnityEngine.Object.Instantiate(hudManager.KillButton, hudManager.transform); 67 | startColorButton = killButtonManager.renderer.color; 68 | startColorText = killButtonManager.TimerText.Color; 69 | killButtonManager.gameObject.SetActive(true); 70 | killButtonManager.renderer.enabled = true; 71 | killButtonManager.renderer.sprite = sprite; 72 | PassiveButton button = killButtonManager.GetComponent(); 73 | button.OnClick.RemoveAllListeners(); 74 | button.OnClick.AddListener((UnityEngine.Events.UnityAction) listener); 75 | void listener() { 76 | if (Timer < 0f && canUse) { 77 | killButtonManager.renderer.color = new Color(1f, 1f, 1f, 0.3f); 78 | if (hasEffectDuration) { 79 | isEffectActive = true; 80 | Timer = EffectDuration; 81 | killButtonManager.TimerText.Color = new Color(0, 255, 0); 82 | } else { 83 | Timer = MaxTimer; 84 | } 85 | 86 | OnClick(); 87 | } 88 | } 89 | } 90 | 91 | public static void HudUpdate() { 92 | buttons.RemoveAll(item => item.killButtonManager == null); 93 | for (int i = 0; i < buttons.Count; i++) { 94 | buttons[i].killButtonManager.renderer.sprite = buttons[i].sprite; 95 | buttons[i].OnUpdate(); 96 | buttons[i].Update(); 97 | } 98 | } 99 | 100 | private void Update() { 101 | if (killButtonManager.transform.localPosition.x > 0f) 102 | killButtonManager.transform.localPosition = new Vector3((killButtonManager.transform.localPosition.x + 1.3f) * -1, killButtonManager.transform.localPosition.y, killButtonManager.transform.localPosition.z) + new Vector3(PositionOffset.x, PositionOffset.y); 103 | if (Timer < 0f) { 104 | killButtonManager.renderer.color = new Color(1f, 1f, 1f, 1f); 105 | if (isEffectActive) { 106 | killButtonManager.TimerText.Color = startColorText; 107 | Timer = MaxTimer; 108 | isEffectActive = false; 109 | OnEffectEnd(); 110 | } 111 | } else { 112 | if (canUse && (isEffectActive || PlayerControl.LocalPlayer.CanMove)) 113 | Timer -= UnityEngine.Time.deltaTime; 114 | 115 | killButtonManager.renderer.color = new Color(1f, 1f, 1f, 0.3f); 116 | } 117 | killButtonManager.gameObject.SetActive(canUse); 118 | killButtonManager.renderer.enabled = canUse; 119 | if (canUse) { 120 | killButtonManager.renderer.material.SetFloat("_Desat", 0f); 121 | killButtonManager.SetCoolDown(Timer, MaxTimer); 122 | } 123 | } 124 | 125 | public void SetCanUse(bool value) { 126 | this.canUse = value; 127 | } 128 | 129 | public bool GetCanUse() { 130 | return this.canUse; 131 | } 132 | } 133 | } -------------------------------------------------------------------------------- /ModsThanos/Patch/HandleRpcPatch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using Hazel; 3 | using ModsThanos.Utility; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using UnityEngine; 7 | 8 | namespace ModsThanos.Patch { 9 | 10 | [HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.HandleRpc))] 11 | class HandleRpcPatch { 12 | 13 | public static bool Prefix(PlayerControl __instance, [HarmonyArgument(0)] byte callId, [HarmonyArgument(1)] MessageReader reader) { 14 | if (callId == (byte) CustomRPC.SyncStone) { 15 | string stoneName = reader.ReadString(); 16 | Vector2 vector = reader.ReadVector2(); 17 | 18 | if (!GlobalVariable.stoneObjects.ContainsKey(stoneName)) 19 | GlobalVariable.stonePositon.Add(stoneName, vector); 20 | else 21 | GlobalVariable.stoneObjects[stoneName].ModifyPosition(vector); 22 | 23 | return false; 24 | } 25 | 26 | if (callId == (byte) CustomRPC.ReplaceStone) { 27 | string stoneName = reader.ReadString(); 28 | Vector2 vector = reader.ReadVector2(); 29 | 30 | Stone.StoneDrop.ReplaceStone(stoneName, vector); 31 | return false; 32 | } 33 | 34 | if (callId == (byte) CustomRPC.SetVisiorColor) { 35 | byte playerId = reader.ReadByte(); 36 | float colorR = reader.ReadSingle(); 37 | float colorG = reader.ReadSingle(); 38 | float colorB = reader.ReadSingle(); 39 | float colorA = reader.ReadSingle(); 40 | 41 | foreach (var player in PlayerControl.AllPlayerControls) { 42 | if (player.PlayerId == playerId) { 43 | player.myRend.material.SetColor("_VisorColor", new Color(colorR, colorG, colorB, colorA)); 44 | } 45 | } 46 | 47 | return false; 48 | } 49 | 50 | if (callId == (byte) CustomRPC.SetColorName) { 51 | byte playerId = reader.ReadByte(); 52 | float colorR = reader.ReadSingle(); 53 | float colorG = reader.ReadSingle(); 54 | float colorB = reader.ReadSingle(); 55 | float colorA = reader.ReadSingle(); 56 | 57 | foreach (var player in PlayerControl.AllPlayerControls) 58 | if (player.PlayerId == playerId) 59 | player.nameText.Color = new Color(colorR, colorG, colorB, colorA); 60 | 61 | return false; 62 | } 63 | 64 | if (callId == (byte) CustomRPC.SetPlayerSoulStone) { 65 | byte playerId = reader.ReadByte(); 66 | GlobalVariable.PlayerSoulStone = PlayerControlUtils.FromPlayerId(playerId); 67 | return false; 68 | } 69 | 70 | if (callId == (byte) CustomRPC.RemovePlayerSoulStone) { 71 | GlobalVariable.PlayerSoulStone = null; 72 | return false; 73 | } 74 | 75 | if (callId == (byte) CustomRPC.SetThanos) { 76 | GlobalVariable.allThanos.Clear(); 77 | List selectedPlayers = reader.ReadBytesAndSize().ToList(); 78 | 79 | for (int i = 0; i < selectedPlayers.Count; i++) 80 | GlobalVariable.allThanos.Add(PlayerControlUtils.FromPlayerId(selectedPlayers[i])); 81 | 82 | return false; 83 | } 84 | 85 | if (callId == (byte) CustomRPC.StonePickup) { 86 | string nameStone = reader.ReadString(); 87 | 88 | if (GlobalVariable.stoneObjects.ContainsKey(nameStone)) 89 | GlobalVariable.stoneObjects[nameStone].DestroyThisObject(); 90 | 91 | if (nameStone == "Soul") 92 | Object.DestroyImmediate(GlobalVariable.arrow); 93 | 94 | return false; 95 | } 96 | 97 | if (callId == (byte) CustomRPC.MindChangedValue) { 98 | GlobalVariable.mindStoneUsed = reader.ReadBoolean(); 99 | return false; 100 | } 101 | 102 | if (callId == (byte) CustomRPC.TimeRewind) { 103 | Stone.System.Time.isRewinding = true; 104 | GlobalVariable.UsableButton = false; 105 | PlayerControl.LocalPlayer.moveable = false; 106 | HudManager.Instance.FullScreen.color = new Color(0f, 0.639f, 0.211f, 0.3f); 107 | HudManager.Instance.FullScreen.enabled = true; 108 | return false; 109 | } 110 | 111 | if (callId == (byte) CustomRPC.TimeRevive) { 112 | PlayerControl player = PlayerControlUtils.FromPlayerId(reader.ReadByte()); 113 | player.Revive(); 114 | var body = Object.FindObjectsOfType().FirstOrDefault(b => b.ParentId == player.PlayerId); 115 | 116 | if (body != null) Object.Destroy(body.gameObject); 117 | return false; 118 | } 119 | 120 | if (callId == (byte) CustomRPC.PowerStone) { 121 | PlayerControl murder = PlayerControlUtils.FromPlayerId(reader.ReadByte()); 122 | HelperSprite.ShowAnimation(1, 24, true, "ModsThanos.Resources.anim-power.png", 10, 1, murder.gameObject.transform.position, 5); 123 | Vector2 murderPosition = reader.ReadVector2(); 124 | 125 | PlayerControlUtils.KillPlayerArea(murderPosition, murder, 3f); 126 | return false; 127 | } 128 | 129 | if (callId == (byte) CustomRPC.TurnInvisibility) { 130 | bool isInvis = reader.ReadBoolean(); 131 | byte playerId = reader.ReadByte(); 132 | 133 | PlayerControl player = PlayerControlUtils.FromPlayerId(playerId); 134 | HelperSprite.ShowAnimation(1, 8, true, "ModsThanos.Resources.anim-reality.png", 48, 1, player.gameObject.transform.position, 1); 135 | 136 | GlobalVariable.realityStoneUsed = isInvis; 137 | Stone.System.RpcFunctions.TurnInvis(isInvis, __instance); 138 | return false; 139 | } 140 | 141 | if (callId == (byte) CustomRPC.Snap) { 142 | GlobalVariable.useSnap = true; 143 | Camera.main.GetComponent().shakeAmount = 0.2f; 144 | Camera.main.GetComponent().shakePeriod = 1200f; 145 | HudManager.Instance.FullScreen.enabled = true; 146 | HudManager.Instance.FullScreen.color = new Color(1f, 1f, 1f, 0f); 147 | 148 | return false; 149 | } 150 | 151 | if (callId == (byte) CustomRPC.SnapEnded) { 152 | GlobalVariable.useSnap = false; 153 | Camera.main.GetComponent().shakeAmount = 0f; 154 | Camera.main.GetComponent().shakePeriod = 0f; 155 | HudManager.Instance.FullScreen.enabled = false; 156 | HudManager.Instance.FullScreen.color = new Color(1f, 1f, 1f, 0f); 157 | 158 | PlayerControl player = PlayerControlUtils.FromPlayerId(reader.ReadByte()); 159 | PlayerControlUtils.KillEveryone(player); 160 | 161 | return false; 162 | } 163 | 164 | return true; 165 | } 166 | } 167 | } 168 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Cliquer ici pour le readme en français : 2 |

3 | 4 | 5 | 6 |

7 | 8 | [![Hardel](https://discord.com/assets/e4923594e694a21542a489471ecffa50.svg)](https://discord.gg/AP9axbXXNC) 9 | 10 | 11 | # Thanos Mod 12 | 13 | The Thanos Mod, it's among Us mod, adding a role and new features. 14 | A random player, will be Thanos and will have to search for the 6 stones of infinity to unlock the finger snap, and finish the game. 15 | 16 options are configurable in the lobby. 16 | 17 | # Releases : 18 | | Among Us - Version| Mod Version | Link | 19 | |----------|-------------|-----------------| 20 | | 2020.12.19s | V1.2 | [Download](https://github.com/Hardel-DW/ModsThanos/releases/download/V1.2.0/Among.Us.-.Thanos.zip) | 21 | | 2020.12.19s | V1.1 | [Download](https://github.com/Hardel-DW/ModsThanos/releases/download/V1.1/Among.Us.-.Mods.Thanos.zip) | 22 | | 2020.12.19s | V1.0c | [Download](https://github.com/Hardel-DW/ModsThanos/releases/download/V1.0c/Among.Us.-.Mods.Prod.zip) | 23 | | 2020.12.19s | V0.1 | [Download](https://github.com/Hardel-DW/ModsThanos/releases/download/B%C3%AAta/Among.Us.-.Mods.Thanos.zip) | 24 |
Changelog 25 |

26 | 27 | # Version 1.2: 28 | ## Features: 29 | * The tasks on the left menu for impostors are now visible. 30 | * The "Games Options" are now visible to everyone. 31 | * A new "Game Options", made are appearance allowing to deactivate the mod. 32 | * The right and left arrows for the visibility "games options" are no longer limiting. 33 | * The buttons are no longer usable during the voting phase. 34 | * After the voting phase, the buttons are set to their maximum pause times. 35 | * Impostors in the winds are not impacted by the winding effect. 36 | * Addition of the discord server in the lobby, and not in part. 37 | * Among us's LeaverBuster is deleted. 38 | * A new spawn location for stones on Polus has spawned. 39 | 40 | ## Bug Fixes: 41 | * On the map of Polus, stones could appear outside the limits of the game map. 42 | * When going back in time, if the impostor was in a wind, he could move while being invisible. 43 | * Sometimes the visibility "Game Options" does not work. 44 | * The "Cooldown" of the first use of stones was not that of "Game Options". 45 | 46 | ## Technical change : 47 | * Reactor is now used as a dependency for inter-modal compatibility. 48 | * Essentials-Reactor is now used as a dependency for inter-mod compatibility. 49 | * 80% of the files have been modified for a better development comfort and performance optimization. 50 | * Among Us pointer references are now almost all removed. 51 | * Packet sending for "role management" is no longer sent in several packets but in one. 52 |

53 |
54 | 55 | # Installation 56 | 57 | Download the zip file on the right side of Github. 58 | 1. Find the folder of your game, for steams players you can right click in steam, on the game, a menu will appear proposing you to go to the folders. 59 | 2. Make a copy of your game (not required but recommended) 60 | 3. Drag or extract the files from the zip into your game, at the .exe level. 61 | 4. Turn on the game. 62 | 5. Play the game. 63 | 64 | ![Install](https://i.imgur.com/pvBAyZN.png) 65 | 66 | ## Serveur 67 | 68 | The Thanos Mod, being a mod that modifies a lot the behavior of the game, the official servers will not support the new features. 69 | That's why a private server is necessary. 70 | By default Thanos Mod, offers you the possibility to connect to the Cheeps-YT.com servers. 71 | 72 | ![Server](https://i.imgur.com/opzh2BQ.png) 73 | 74 | -------- 75 | 76 | ## Thanos role 77 | 78 | At the start of a game, a randomly chosen person will become Thanos, he will then have a purple screen, 79 | and the name to display in purple, only Thanos can see his name in color. 80 | In addition 6 stones are hidden through the map, Thanos will have to search and recover them without revealing his identity. 81 | Each stone offers a unique power, find all 6 and the mythical finger snap will be unlocked. 82 | The stones are synchronized between all the players. 83 | ![Thanos](https://i.imgur.com/1x5DshJ.png) 84 | 85 | # Infinity Stone : 86 | ## Soul Stone 87 | It is an orange stone, the Crewmates have the particularity to see an arrow on their interfaces indicating the position of the stone. 88 | The main specificity of this stone is that the Crewmates can pick it up. 89 | When a "Crewmate" collects this stone, their name becomes orange and is visible to all. 90 | By killing the owner of the soul stone, this stone will then be randomly placed back on the map. 91 | 92 | ## Stone of time: 93 | This is a green stone, which simply allows its activation to go back in time. 94 | All the movements and animation of the walk are reproduced exactly. 95 | In addition, if a Crewmate are dead, and the power is activated, This said Crewmate is then resurrected. 96 | (In case the Crewmate possesses the orange stone, it will lose it, and its name will become white again). 97 | 98 | ## Reality Stone: 99 | It is a red stone, which makes it possible to be invisible during a period. 100 | Thanos will see an effect of transparency, and the other players won't see Thanos anymore. 101 | 102 | ## Space Stone: 103 | It is a blue stone, which allows the action of this one, to pose a dimensional portai. 104 | When several portals are placed, Thanos can imprint them like vents, and travel from portal to portal. 105 | 106 | ## Mind Stone: 107 | It is a yellow stone, which allows its activation to take the appearance of someone, pseudo, costume, hat, colors, and pet. 108 | It has a temporary duration. 109 | Once the duration is over, the player is transformed back into himself. 110 | 111 | ## Stone of Power: 112 | It is a pink/purple stone, which allows its activation to kill all players in the proximity of Thanos. 113 | 114 | ## Finger snap: 115 | When Thanos has the 6 stones, the finger snap is automatically unlocked when used, an animation will start and after a delay all players will die. 116 | 117 | ![HUD](https://i.imgur.com/ivxlot9.png) 118 | -------- 119 | 120 | ## Games Options 121 | | Game Option | Description | Type | 122 | |----------|-------------|-----------------| 123 | | Cooldown Time Stone | Modifies the reloading time of the time stone | Number | 124 | | Cooldown Reality Stone | Modifies the reloading time of the reality stone | Number | 125 | | Cooldown Space Stone | Modifies the reloading time of the space stone | Number | 126 | | Cooldown Mind Stone | Modifies the reloading time of the mind stone | Number | 127 | | Cooldown Soul Stone | Modifies the reloading time of the soul stone | Number | 128 | | Cooldown Power Stone | Modifies the reloading time of the power stone | Number | 129 | | Time Stone Visibility | Modifies the person(s) who can see the stone | Everyone/Thanos/Crewmate | 130 | | Reality Stone Visibility | Modifies the person(s) who can see the stone | Everyone/Thanos/Crewmate | 131 | | Power Stone Visibility | Modifies the person(s) who can see the stone | Everyone/Thanos/Crewmate | 132 | | Soul Stone Visibility | Modifies the person(s) who can see the stone | Everyone/Thanos/Crewmate | 133 | | Mind Stone Visibility | Modifies the person(s) who can see the stone | Everyone/Thanos/Crewmate | 134 | | Space Stone Visibility | Modifies the person(s) who can see the stone | Everyone/Thanos/Crewmate | 135 | | Time Duration | Changes the duration of the associated effect | Number | 136 | | Reality Duration | Changes the duration of the associated effect | Number | 137 | | Mind Duration | Changes the duration of the associated effect | Number | 138 | | Max Portal | Modifies the maximum number of gates installed (Non-functional) | Number | 139 | | Stone Size | Changes the size of the stone on the map (the higher the value, the smaller it will be, and vice versa). | Number | 140 | | Thanos Enable | Enable thanos mod | True/False | 141 | 142 | # Author and thanks 143 | Creation of the mod by Hardel by request of FuzeIII. 144 | Thanks, to the Reactor server, for all the help. 145 | Thank you, Cheeps for giving permission to use his private server. 146 | 147 | # Bugs/Feature suggestions 148 | If you need to contact me, to request additional features, or to make bug or change requests. 149 | Go to this [Discord](https://discord.gg/AP9axbXXNC) server, or create a ticker on Github. 150 | 151 | # Ressources 152 | https://github.com/NuclearPowered/Reactor Le Framework que le mod utilise. 153 | https://github.com/BepInEx For loading the mods. 154 | https://github.com/DorCoMaNdO/Reactor-Essentials To create inter-mods game options. 155 | https://github.com/Woodi-dev/Among-Us-Sheriff-Mod For code snippets. 156 | 157 | # License 158 | This software is distributed under the GNU GPLv3 License. BepinEx is distributed under LGPL-2.1 License. 159 | -------------------------------------------------------------------------------- /README.fr.md: -------------------------------------------------------------------------------- 1 | ## Click on English flag to change readme description : 2 |

3 | 4 | 5 | 6 |

7 | 8 | 9 | [![Hardel](https://discord.com/assets/e4923594e694a21542a489471ecffa50.svg)](https://discord.gg/AP9axbXXNC) 10 | 11 | # Thanos Mod 12 | 13 | Le Thanos Mod, il s'agit d'un mod sûr among Us, rajoutant un rôle ainsi que des nouveautés inédites. 14 | Un joueur aléatoire, sera Thanos et devra rechercher les 6 pierres de l'infinité afin de débloquer le claquement de doigt, et terminer la partie. 15 | 16 options sont configurables dans le lobby. 16 | 17 | # Releases : 18 | | Among Us - Version| Mod Version | Link | 19 | |----------|-------------|-----------------| 20 | | 2020.12.19s | V1.2 | [Download](https://github.com/Hardel-DW/ModsThanos/releases/download/V1.2.0/Among.Us.-.Thanos.zip) | 21 | | 2020.12.19s | V1.1 | [Download](https://github.com/Hardel-DW/ModsThanos/releases/download/V1.1/Among.Us.-.Mods.Thanos.zip) | 22 | | 2020.12.19s | V1.0c | [Download](https://github.com/Hardel-DW/ModsThanos/releases/download/V1.0c/Among.Us.-.Mods.Prod.zip) | 23 | | 2020.12.19s | V0.1 | [Download](https://github.com/Hardel-DW/ModsThanos/releases/download/B%C3%AAta/Among.Us.-.Mods.Thanos.zip) | 24 |
Changelog 25 |

26 | 27 | # Version 1.2: 28 | ## Fonctionnalités : 29 | * Les tâches sur le menu de gauche pour les imposteurs sont maintenant visible. 30 | * Les "Games Options", sont maintenant visible pour tous. 31 | * Une nouvelle "Game Options", fait sont apparition permettant de désactiver le mod. 32 | * Les "Game Options", les flèches droite et gauche pour les options de visibilité ne sont plus limiter. 33 | * Les boutons ne sont plus utilisables pendant le la phase des votes. 34 | * Après la phase des votes, les boutons sont mis a leurs temps de pause maximum. 35 | * Les imposteurs dans les vents ne sont pas impacter par l'effet de remontage dans le temps. 36 | * Rajout du serveur discord dans le lobby, et non en game. 37 | * Le LeaberBuster de Amonh us est supprimer. 38 | * Un nouveau endroit d'apparition pour les pierres sur Polus fait sont apparition. 39 | 40 | ## Correction de bug : 41 | * Sur la carte de Polus, des pierres pouvait apparaître hors des limites de la carte de jeu. 42 | * Lors d'un rewind, si l'imposteur était dans une vent, il pouvait se déplacer en étant invisible. 43 | * Les "Game Options" de visibilité ne fonctionné parfois pas. 44 | * Le "Cooldown" de la première utilisation des pierres n'était pas celle des "Game Options". 45 | 46 | ## Changement technique : 47 | * Reactor est maintenant utiliser en tant que dépendance pour la compatibilité inter-mods. 48 | * Essentials-Reactor est maintenant utiliser en tant que dépendance pour la compatibilité inter-mods. 49 | * 80% des fichiers ont était modifier pour un meilleur confort de développement et optimisation de performance. 50 | * Les référence au pointer de Among Us sont maintenant presque tous supprimer. 51 | * L'envoie de packet pour le "rôle management", ne s'envoie plus en plusieurs packets mais en un seul. 52 |

53 |
54 | 55 | # Installation 56 | 57 | Télécharger le fichier zip se trouvant sur la droite de Github. 58 | 1. Trouver le dossier de votre jeu, pour les joueurs steams vous pouvez faire une clique droit dans steam, sur le jeu, un menu apparaîtra vous proposant d'aller dans les dossiers. 59 | 2. Faite une copie de votre jeu, ce n'est pas obligatoire mais conseiller, metter là où vous le souhaitez, je vous conseille de le mettre dans le dossier __commun__ de steam. 60 | 3. Glisser ou extraire les fichiers du zip dans votre jeu, au niveau du .exe. 61 | 4. Allumer le jeu. 62 | 5. Amusez-vous. 63 | 64 | ![Install](https://i.imgur.com/pvBAyZN.png) 65 | 66 | ## Serveur 67 | 68 | Le Thanos Mod, étant un mod qui modifie beaucoup le comportement du jeu, les serveurs officiels ne supporteront pas les nouvelles fonctionnalités. 69 | C'est pour cela qu'un serveur privé est nécessaire. 70 | Par défaut Thanos Mod, vous offre la possibilité de vous connecter sur les serveurs de Cheeps-YT.com 71 | 72 | ![Server](https://i.imgur.com/opzh2BQ.png) 73 | 74 | -------- 75 | 76 | ## Rôle Thanos 77 | 78 | Au démarrage d'une partie, une personne aléatoirement choisie deviendras Thanos, il auras alors un écran violet, et le nom d'afficher en violet, seul Thanos peut voir son nom en couleur. 79 | De plus 6 pierres sont cachées à travers la carte, Thanos devra les chercher et les récupérers sans dévoiler son identité. 80 | Chaque pierre offre un pouvoir unique, trouver les 6 et le claquement de doigt mythique sera débloqué. 81 | Les pierres sont synchronisées entre tous les joueurs. 82 | ![Thanos](https://i.imgur.com/1x5DshJ.png) 83 | 84 | # Pierre de l'infinité : 85 | ### Pierre de l'âme 86 | Il s'agit d'une pierre orange, les Crewmates ont la particularité de voir une flèche sur leurs interfaces indiquant la position de la pierre. 87 | La spécificité première de cette Pierre, c'est que les Crewmates peuvent la ramasser. 88 | Quand un "Crewmate" récupére cette pierre, leur nom devient orange et est visible par tous. 89 | En tuant, le possesseur de la pierre de l'esprit, cette pierre sera alors replacée aléatoirement sur la map. 90 | 91 | ### Pierre du temps. 92 | Il s'agit d'une pierre verte, qui permet simplement à son activation de remonter dans le temps. 93 | Tous les déplacements, et animation de marche sont reproduit a l'exacte. 94 | De plus, si un Crewmate et tuer, et que le pouvoir est activé, Ce dit Crewmate est alors ressuscité. 95 | (Dans le cas ou le Crewmate possédé la pierre orange, il la perdra, et son nom redeviendra blanc). 96 | 97 | ### Pierre de Réalité 98 | Il s'agit d'une pierre rouge, qui permet de se rendre invisible pendant une période. 99 | Thanos verra un effet de transparence, et les autres joueurs ne verront plus Thanos. 100 | 101 | ### Pierre de l'espace 102 | Il s'agit d'une pierre bleue, qui permet à l'action de celle-ci, de poser un portai dimensionnel. 103 | Quand plusieurs portails sont posés, Thanos peut les empreintes comme des vents, et voyage de portail en portail. 104 | 105 | ### Pierre de l'âme 106 | Il s'agit d'une pierre jaune, qui permet à son activation de prendre l'apparence de quelqu'un, pseudo, déguisement, chapeau, couleurs, et familier. 107 | Elle possède une durée temporaire. 108 | Une fois la durée finie, le joueur est retransformé en lui-même. 109 | 110 | ### Pierre de pouvoir 111 | Il s'agit d'une pierre rose/violette, qui permet à son activation de tuer tous les joueurs se trouvant à proximité de Thanos. 112 | 113 | ### Claquement de doigt 114 | Quand Thanos à récupérer les 6 pierres, le claquement de doigt est automatiquement débloqué à son utilisation, une animation se lancera et après un délai tous les joueurs mourront. 115 | 116 | ![HUD](https://i.imgur.com/ivxlot9.png) 117 | -------- 118 | 119 | ## Options de personnalisation 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 |
Cooldown Time StoneModifie le délai de rechargement de la pierre du temps
Cooldown Reality StoneModifie le délai de rechargement de la pierre de réalité
Cooldown Space StoneModifie le délai de rechargement de la pierre de l'espace
Cooldown Mind StoneModifie le délai de rechargement de la pierre de l'esprit
Cooldown Soul StoneModifie le délai de rechargement de la pierre de l'âme
Cooldown Power StoneModifie le délai de rechargement de la pierre de pouvoir
Time DurationModifie la durer de l'effet de la pierre du temps
Reality DurationModifie la durer de l'effet de la pierre de réalité
Mind DurationModifie la durer de l'effet de la pierre de l'esprit
Time Stone VisibilityModifie le/les perssonne(s) qui peuvent voir la pierre
Reality Stone VisibilityModifie le/les perssonne(s) qui peuvent voir la pierre
Power Stone VisibilityModifie le/les perssonne(s) qui peuvent voir la pierre
Soul Stone VisibilityModifie le/les perssonne(s) qui peuvent voir la pierre
Mind Stone VisibilityModifie le/les perssonne(s) qui peuvent voir la pierre
Space Stone VisibilityModifie le/les perssonne(s) qui peuvent voir la pierre
Max PortalModifie le nombre maximum de portail posé (Non fonctionnel)
Stone SizeModifie la taille de la pierre sur la map (Plus la valeur est élévée, et plus elle sera petite, et inversement.
193 | 194 | # Auteur et remerciment 195 | Création du mod par Hardel par demande de Fuze. 196 | Merci, au serveur Réacteur, pour toutes les aides. 197 | Merci, Cheeps pour avoir donné l'autorisation d'utiliser son serveur privé. 198 | 199 | # Bugs/Suggestions de fonctionnalités 200 | Si vous avez besoin de me contacter, pour demander des fonctionnalités supplémentaires, ou pour faire des demandes de bugs ou de changements. 201 | Allez sur ce serveur de [Discord](https://discord.gg/AP9axbXXNC), ou créez un ticker sur Github. 202 | 203 | # Ressources 204 | https://github.com/NuclearPowered/Reactor Le Framework que le mod utilise. 205 | https://github.com/BepInEx Pour le chargement des mods. 206 | https://github.com/DorCoMaNdO/Reactor-Essentials Pour créer des games options inter-mods. 207 | https://github.com/Woodi-dev/Among-Us-Sheriff-Mod Pour les extraits de code. 208 | 209 | # License 210 | This software is distributed under the GNU GPLv3 License. BepinEx is distributed under LGPL-2.1 License. 211 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------