Skip to content

Commit 38060b2

Browse files
Merge pull request #19 from CallOfCreator/dev
v1.2.7 Update
2 parents 93272b5 + e0f0872 commit 38060b2

20 files changed

Lines changed: 222 additions & 26 deletions

NewMod/Buttons/Overload/OverloadButton.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public void Absorb(CustomActionButton target)
9696
absorbedCooldown = target.Cooldown;
9797
absorbedMaxUses = target.MaxUses;
9898
absorbedSprite = target.Sprite;
99-
absorbedKeybind = target.Keybind;
99+
absorbedKeybind = (MiraKeybind)target.Keybind;
100100
absorbedOnClick = () => target.GetType().GetMethod("OnClick", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)
101101
?.Invoke(target, null);
102102

NewMod/Components/Toast.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using UnityEngine;
66
using Reactor.Utilities.Attributes;
77
using NewMod;
8+
using Il2CppInterop.Runtime.Attributes;
89

910
[RegisterInIl2Cpp]
1011
public class Toast(IntPtr ptr) : MonoBehaviour(ptr)
@@ -39,6 +40,8 @@ public void ShowToast(string title, string text, Color color, float displayDurat
3940

4041
Coroutines.Start(CoAnimateToast(displayDuration));
4142
}
43+
44+
[HideFromIl2Cpp]
4245
public IEnumerator CoAnimateToast(float duration)
4346
{
4447
Vector3 visiblePos = new Vector3(-0.0527f, 2.7741f, 0f);

NewMod/DebugWindow.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ private static bool AllowDebug()
104104
}
105105
if (GUILayout.Button("Show Toast") && LobbyBehaviour.Instance)
106106
{
107-
Toast.CreateToast().ShowToast(string.Empty, "NewMod v1.2.6", Color.red, 5f);
107+
var toast = Toast.CreateToast();
108+
toast.ShowToast(string.Empty, "NewMod v1.2.6", Color.red, 5f);
108109
}
109110
/*if (GUILayout.Button("Spawn General NPC") && allow)
110111
{
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using BepInEx.Configuration;
2+
using MiraAPI.LocalSettings;
3+
using MiraAPI.LocalSettings.Attributes;
4+
using UnityEngine;
5+
6+
namespace NewMod.LocalSettings
7+
{
8+
public class NewModLocalSettings(ConfigFile config) : LocalSettingsTab(config)
9+
{
10+
public override string TabName => "NewMod";
11+
public override LocalSettingTabAppearance TabAppearance { get; } = new()
12+
{
13+
TabButtonColor = Color.cyan,
14+
TabButtonHoverColor = Color.magenta,
15+
TabIcon = NewModAsset.NMIcon,
16+
};
17+
18+
[LocalSliderSetting("Frame Rate Limit", min: 30f, max: 240f, "Lock your framerate (FPS)", displayValue: true, formatString: "0", roundValue: true)]
19+
public ConfigEntry<float> FrameRateLimit { get; } = config.Bind(
20+
"Performance",
21+
"FrameRateLimit",
22+
165f,
23+
"Frames per second limit"
24+
);
25+
26+
public override void OnOptionChanged(ConfigEntryBase configEntry)
27+
{
28+
base.OnOptionChanged(configEntry);
29+
30+
if (configEntry == FrameRateLimit)
31+
{
32+
Application.targetFrameRate = (int)FrameRateLimit.Value;
33+
}
34+
}
35+
}
36+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using MiraAPI.Modifiers.Types;
2+
using MiraAPI.GameOptions;
3+
using NewMod.Options.Modifiers;
4+
using NewMod.Options;
5+
6+
namespace NewMod.Modifiers
7+
{
8+
public class AdrenalineModifier : GameModifier
9+
{
10+
public override string ModifierName => "Adrenaline";
11+
public override bool HideOnUi => false;
12+
public override int GetAssignmentChance() => (int)OptionGroupSingleton<ModifiersOptions>.Instance.AdrenalineChance.Value;
13+
public override int GetAmountPerGame() => (int)OptionGroupSingleton<ModifiersOptions>.Instance.AdrenalineAmount;
14+
15+
public override void OnActivate()
16+
{
17+
Player.MyPhysics.Speed *= OptionGroupSingleton<AdrenalineModifierOptions>.Instance.SpeedMultiplier;
18+
}
19+
20+
public override void OnDeactivate()
21+
{
22+
Player.MyPhysics.Speed /= OptionGroupSingleton<AdrenalineModifierOptions>.Instance.SpeedMultiplier;
23+
}
24+
25+
public override void OnDeath(DeathReason reason)
26+
{
27+
Player.MyPhysics.Speed /= OptionGroupSingleton<AdrenalineModifierOptions>.Instance.SpeedMultiplier;
28+
}
29+
}
30+
}

NewMod/Modifiers/DrowsyModifier.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using MiraAPI.GameOptions;
2+
using MiraAPI.Modifiers;
3+
using MiraAPI.Modifiers.Types;
4+
using MiraAPI.Utilities;
5+
using NewMod.Options;
6+
using NewMod.Options.Modifiers;
7+
using UnityEngine;
8+
9+
namespace NewMod.Modifiers
10+
{
11+
public sealed class DrowsyModifier : GameModifier
12+
{
13+
public override string ModifierName => "Drowsy";
14+
public override bool ShowInFreeplay => true;
15+
public override Color FreeplayFileColor => new(0.6f, 0.7f, 1f);
16+
public override string GetDescription() =>
17+
$"Move slower (x{OptionGroupSingleton<ModifiersOptions>.Instance.DrowsyAmount:0.##}).";
18+
19+
public override int GetAssignmentChance() => (int)OptionGroupSingleton<ModifiersOptions>.Instance.DrowsyChance.Value;
20+
21+
public override int GetAmountPerGame() => (int)OptionGroupSingleton<ModifiersOptions>.Instance.DrowsyAmount;
22+
23+
public override void OnActivate()
24+
{
25+
Player.MyPhysics.Speed *= OptionGroupSingleton<DrowsyModifierOptions>.Instance.SpeedMultiplier;
26+
}
27+
28+
public override void OnDeactivate()
29+
{
30+
Player.MyPhysics.Speed /= OptionGroupSingleton<DrowsyModifierOptions>.Instance.SpeedMultiplier;
31+
}
32+
33+
public override void OnDeath(DeathReason reason)
34+
{
35+
Player.MyPhysics.Speed /= OptionGroupSingleton<DrowsyModifierOptions>.Instance.SpeedMultiplier;
36+
}
37+
}
38+
}

NewMod/Modifiers/FalseFormModifier.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
using MiraAPI.GameOptions;
22
using MiraAPI.Modifiers.Types;
33
using MiraAPI.Utilities;
4+
using NewMod.Options;
45
using NewMod.Options.Modifiers;
56
using UnityEngine;
67

78
namespace NewMod.Modifiers
89
{
9-
public class FalseFormModifier : TimedModifier
10+
public class FalseFormModifier : GameModifier
1011
{
1112
public override string ModifierName => "FalseForm";
12-
public override bool AutoStart => OptionGroupSingleton<FalseFormModifierOptions>.Instance.EnableModifier;
13-
public override float Duration => (int)OptionGroupSingleton<FalseFormModifierOptions>.Instance.FalseFormDuration;
1413
public override bool ShowInFreeplay => true;
1514
public override bool HideOnUi => false;
16-
public override bool RemoveOnComplete => true;
1715
private float timer;
1816
private AppearanceBackup oldAppearance;
17+
public override int GetAssignmentChance()
18+
{
19+
return OptionGroupSingleton<ModifiersOptions>.Instance.FalseFormChance;
20+
}
21+
public override int GetAmountPerGame()
22+
{
23+
return (int)OptionGroupSingleton<ModifiersOptions>.Instance.FalseFormAmount;
24+
}
1925
public override void OnActivate()
2026
{
2127
oldAppearance = new AppearanceBackup

NewMod/Modifiers/StickyModifier.cs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,27 @@
22
using System.Collections.Generic;
33
using MiraAPI.GameOptions;
44
using MiraAPI.Modifiers.Types;
5+
using NewMod.Options;
56
using NewMod.Options.Modifiers;
67
using Reactor.Utilities;
78
using UnityEngine;
89

910
namespace NewMod.Modifiers
1011
{
11-
public class StickyModifier : TimedModifier
12+
public class StickyModifier : GameModifier
1213
{
1314
public override string ModifierName => "Sticky";
14-
public override bool AutoStart => OptionGroupSingleton<StickyModifierOptions>.Instance.EnableModifier;
15-
public override float Duration => (int)OptionGroupSingleton<StickyModifierOptions>.Instance.StickyDuration;
1615
public override bool HideOnUi => false;
1716
public override bool ShowInFreeplay => true;
18-
public override bool RemoveOnComplete => true;
19-
public static List<PlayerControl> linkedPlayers = new();
17+
public static List<PlayerControl> linkedPlayers = [];
18+
public override int GetAmountPerGame()
19+
{
20+
return (int)OptionGroupSingleton<ModifiersOptions>.Instance.StickyAmount;
21+
}
22+
public override int GetAssignmentChance()
23+
{
24+
return OptionGroupSingleton<ModifiersOptions>.Instance.StickyChance;
25+
}
2026
public override bool? CanVent()
2127
{
2228
return Player.Data.Role.CanVent;
@@ -49,8 +55,6 @@ public override void FixedUpdate()
4955
}
5056
public IEnumerator CoFollowStickyPlayer(PlayerControl player)
5157
{
52-
float duration = Duration;
53-
5458
var info = new StickyState
5559
{
5660
StickyOwner = Player,
@@ -59,7 +63,7 @@ public IEnumerator CoFollowStickyPlayer(PlayerControl player)
5963
};
6064

6165
yield return HudManager.Instance.StartCoroutine(
62-
Effects.Overlerp(duration, new System.Action<float>((t) =>
66+
Effects.Overlerp(0.5f, new System.Action<float>((t) =>
6367
{
6468
Vector3 targetPos = info.LinkedPlayer.transform.position;
6569
Vector3 currentPos = info.StickyOwner.transform.position;

NewMod/NewMod.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
using MiraAPI.Events;
2525
using NewMod.Patches.Compatibility;
2626
using NewMod.Buttons.Overload;
27+
using MiraAPI.LocalSettings;
2728

2829
namespace NewMod;
2930

@@ -36,11 +37,11 @@ namespace NewMod;
3637
public partial class NewMod : BasePlugin, IMiraPlugin
3738
{
3839
public const string Id = "com.callofcreator.newmod";
39-
public const string ModVersion = "1.2.6";
40+
public const string ModVersion = "1.2.7";
4041
public Harmony Harmony { get; } = new Harmony(Id);
4142
public static BasePlugin Instance;
4243
public static Minigame minigame;
43-
public const string SupportedAmongUsVersion = "2025.6.10";
44+
public const string SupportedAmongUsVersion = "2025.9.9";
4445
public static ConfigEntry<bool> ShouldEnableBepInExConsole { get; set; }
4546
public ConfigFile GetConfigFile() => Config;
4647
public string OptionsTitleText => "NewMod";
@@ -58,9 +59,10 @@ public override void Load()
5859
Harmony.PatchAll(typeof(LaunchpadCompatibility));
5960
Harmony.PatchAll(typeof(LaunchpadHackTextPatch));
6061
}
61-
ShouldEnableBepInExConsole = Config.Bind("NewMod", "Console", false, "Whether to enable BepInEx Console for debugging");
62+
ShouldEnableBepInExConsole = Config.Bind("NewMod", "Console", true, "Whether to enable BepInEx Console for debugging");
6263
if (!ShouldEnableBepInExConsole.Value) ConsoleManager.DetachConsole();
63-
Instance.Log.LogMessage($"Loaded Successfully NewMod v{ModVersion} With MiraAPI Version : {MiraApiPlugin.Version} with ID : {MiraApiPlugin.Id}");
64+
65+
Instance.Log.LogMessage($"Loaded Successfully NewMod v{ModVersion} With MiraAPI Version : {MiraApiPlugin.Version}");
6466
}
6567
public static void CheckVersionCompatibility()
6668
{

NewMod/NewMod.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<VersionPrefix>1.2.6</VersionPrefix>
3+
<VersionPrefix>1.2.7</VersionPrefix>
44
<VersionSuffix>dev</VersionSuffix>
55
<Description>NewMod is a mod for Among Us that introduces a variety of new roles, unique abilities</Description>
66
<Authors>CallofCreator</Authors>
@@ -21,8 +21,8 @@
2121

2222
<ItemGroup>
2323
<PackageReference Include="Reactor" Version="2.3.1" />
24-
<PackageReference Condition="'$(Configuration)' == 'Debug' Or '$(Configuration)' == 'Release' " Include="AmongUs.GameLibs.Steam" Version="2025.4.15" PrivateAssets="all" />
25-
<PackageReference Condition="'$(Configuration)' == 'ANDROID' " Include="AmongUs.GameLibs.Android" Version="2025.6.10" PrivateAssets="all" />
24+
<PackageReference Condition="'$(Configuration)' == 'Debug' Or '$(Configuration)' == 'Release' " Include="AmongUs.GameLibs.Steam" Version="2025.9.9" PrivateAssets="all" />
25+
<PackageReference Condition="'$(Configuration)' == 'ANDROID' " Include="AmongUs.GameLibs.Android" Version="2025.9.9" PrivateAssets="all" />
2626
<PackageReference Include="BepInEx.AutoPlugin" Version="1.1.0" PrivateAssets="all" />
2727
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="2.1.0-rc.1" PrivateAssets="all" ExcludeAssets="runtime" />
2828
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.735" />

0 commit comments

Comments
 (0)