Skip to content

Commit 2f6e305

Browse files
Merge pull request #13 from CallOfCreator/dev
v1.2.1
2 parents bc90c71 + 9566598 commit 2f6e305

25 files changed

Lines changed: 462 additions & 64 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ on:
55
branches:
66
- main
77
- dev
8-
- au-2025.3.25
98
pull_request:
109
branches:
1110
- main
1211
- dev
13-
- au-2025.3.25
1412
workflow_dispatch:
1513

1614
jobs:
@@ -49,6 +47,9 @@ jobs:
4947
- name: Build NewMod (Debug)
5048
run: dotnet build NewMod/NewMod.csproj --configuration Debug --no-restore
5149

50+
- name: Build NewMod Android (Debug)
51+
run: dotnet build NewMod/NewMod.csproj --configuration ANDROID --no-restore
52+
5253
- name: Upload NewMod DLL (Release)
5354
uses: actions/upload-artifact@v4
5455
with:
@@ -61,6 +62,13 @@ jobs:
6162
name: NewMod-Debug
6263
path: NewMod/bin/Debug/net6.0/NewMod.dll
6364

65+
- name: Upload NewMod DLL (Android)
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: NewMod-Android
69+
path: NewMod/bin/ANDROID/net6.0/NewMod.dll
70+
71+
6472
release:
6573
needs: build
6674
runs-on: ubuntu-latest

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
bin/
22
obj/
3-
libs/*
43
References/
4+
NewMod/Components
55
/packages/
66
riderModule.iml
77
.idea

NewMod/Buttons/EnergyThief/DrainButton.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ public override bool Enabled(RoleBehaviour role)
8888
/// </summary>
8989
protected override void OnClick()
9090
{
91+
var clip = NewModAsset.DrainSound.LoadAsset();
92+
9193
PendingEffectManager.AddPendingEffect(Target);
94+
SoundManager.Instance.PlaySound(clip, false, 1f, null);
9295

9396
Utils.RecordDrainCount(PlayerControl.LocalPlayer);
9497

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
using MiraAPI.GameOptions;
2+
using MiraAPI.Hud;
3+
using MiraAPI.Utilities.Assets;
4+
using UnityEngine;
5+
using NewMod.Roles.NeutralRoles;
6+
using NewMod.Options.Roles.InjectorOptions;
7+
using MiraAPI.Utilities;
8+
using System;
9+
using static NewMod.Utilities.Utils;
10+
11+
namespace NewMod.Buttons.Injector
12+
{
13+
/// <summary>
14+
/// Represents the serum injection button for the Injector role.
15+
/// Allows injecting a random serum into nearby players.
16+
/// </summary>
17+
public class InjectButton : CustomActionButton<PlayerControl>
18+
{
19+
/// <summary>
20+
/// The name displayed on the button (if any).
21+
/// </summary>
22+
public override string Name => "Inject";
23+
24+
/// <summary>
25+
/// Cooldown time between uses, configured via <see cref="InjectorOptions"/>.
26+
/// </summary>
27+
public override float Cooldown => OptionGroupSingleton<InjectorOptions>.Instance.SerumCooldown;
28+
29+
/// <summary>
30+
/// Maximum allowed injections, configured via <see cref="InjectorOptions"/>.
31+
/// </summary>
32+
public override int MaxUses => OptionGroupSingleton<InjectorOptions>.Instance.MaxSerumUses;
33+
34+
/// <summary>
35+
/// Effect duration — unused here since injection is instant.
36+
/// </summary>
37+
public override float EffectDuration => 0f;
38+
39+
/// <summary>
40+
/// Screen location of the button on the HUD.
41+
/// </summary>
42+
public override ButtonLocation Location => ButtonLocation.BottomLeft;
43+
44+
/// <summary>
45+
/// Sprite/icon displayed on the button.
46+
/// </summary>
47+
public override LoadableAsset<Sprite> Sprite => MiraAssets.Empty;
48+
49+
/// <summary>
50+
/// Returns the closest valid player target within range,
51+
/// used by the Injector to determine who can be injected.
52+
/// </summary>
53+
/// <returns>The nearest PlayerControl instance, or null if none is in range.</returns>
54+
public override PlayerControl GetTarget()
55+
{
56+
return PlayerControl.LocalPlayer.GetClosestPlayer(true, Distance, false);
57+
}
58+
59+
/// <summary>
60+
/// Sets an outline around the target player to visually indicate interaction,
61+
/// such as highlighting a valid injection target for the Injector role.
62+
/// </summary>
63+
/// <param name="active">True to show the outline; false to hide it.</param>
64+
public override void SetOutline(bool active)
65+
{
66+
Target?.cosmetics.SetOutline(active, new Il2CppSystem.Nullable<Color>(Palette.AcceptedGreen));
67+
}
68+
69+
/// <summary>
70+
/// Determines whether this button is available for the current role.
71+
/// </summary>
72+
/// <param name="role">The current player's role.</param>
73+
/// <returns>True only for the Injector role.</returns>
74+
public override bool Enabled(RoleBehaviour role)
75+
{
76+
return role is InjectorRole;
77+
}
78+
79+
/// <summary>
80+
/// Called when the button is clicked. Applies a serum to the closest valid target.
81+
/// </summary>
82+
protected override void OnClick()
83+
{
84+
var serumValues = Enum.GetValues(typeof(SerumType));
85+
SerumType randomSerum = (SerumType)serumValues.GetValue(UnityEngine.Random.Range(0, serumValues.Length));
86+
87+
RpcApplySerum(PlayerControl.LocalPlayer, Target, randomSerum);
88+
}
89+
}
90+
}

NewMod/CustomGameModes/RevivalRoyale.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,8 @@ public override void HudUpdate(HudManager instance)
4747
ReviveCounter.text = $"Revive Count: {ReviveCount}";
4848
if (ReviveCount >= 6)
4949
{
50-
#if PC
50+
5151
GameManager.Instance.RpcEndGame(GameOverReason.ImpostorsByKill, true);
52-
#else
53-
GameManager.Instance.RpcEndGame(GameOverReason.ImpostorByKill, true);
54-
#endif
5552
break;
5653
}
5754
}

NewMod/CustomRPC.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
namespace NewMod;
2+
23
public enum CustomRPC
34
{
45
Revive,
56
Drain,
67
FakeBody,
78
AssignMission,
89
MissionSuccess,
9-
MissionFails
10+
MissionFails,
11+
ApplySerum
1012
}

NewMod/ModCompatibility.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static void DisableRole(string roleName, string pluginGuid)
3131
var plugin = MiraPluginManager.GetPluginByGuid(pluginGuid);
3232
if (plugin == null) return;
3333

34-
foreach (var kv in plugin.GetRoles())
34+
foreach (var kv in plugin.Roles)
3535
{
3636
var role = kv.Value;
3737

NewMod/NewMod.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace NewMod;
3737
public partial class NewMod : BasePlugin, IMiraPlugin
3838
{
3939
public const string Id = "com.callofcreator.newmod";
40-
public const string ModVersion = "1.2.0";
40+
public const string ModVersion = "1.2.1";
4141
public Harmony Harmony { get; } = new Harmony(Id);
4242
public static BasePlugin Instance;
4343
public static Minigame minigame;

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.0</VersionPrefix>
3+
<VersionPrefix>1.2.1</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,9 +21,9 @@
2121

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

NewMod/NewModAsset.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
using MiraAPI.Utilities.Assets;
22

33
namespace NewMod;
4+
45
public static class NewModAsset
56
{
7+
// Miscellaneous
68
public static LoadableResourceAsset Banner { get; } = new("NewMod.Resources.optionImage.png");
7-
public static LoadableResourceAsset DeadBodySprite { get; } = new("NewMod.Resources.deadbody.png");
8-
public static LoadableResourceAsset NecromancerButton { get; } = new("NewMod.Resources.Revive2.png");
99
public static LoadableResourceAsset Arrow { get; } = new("NewMod.Resources.Arrow.png");
1010
public static LoadableResourceAsset ModLogo { get; } = new("NewMod.Resources.Logo.png");
11-
public static LoadableResourceAsset Camera { get; } = new("NewMod.Resources.cam.png");
11+
12+
// Button icons
1213
public static LoadableResourceAsset SpecialAgentButton { get; } = new("NewMod.Resources.givemission.png");
1314
public static LoadableResourceAsset ShowScreenshotButton { get; } = new("NewMod.Resources.showscreenshot.png");
1415
public static LoadableResourceAsset DoomAwakeningButton { get; } = new("NewMod.Resources.doomawakening.png");
16+
public static LoadableResourceAsset NecromancerButton { get; } = new("NewMod.Resources.Revive2.png");
17+
public static LoadableResourceAsset DeadBodySprite { get; } = new("NewMod.Resources.deadbody.png");
18+
public static LoadableResourceAsset Camera { get; } = new("NewMod.Resources.cam.png");
19+
20+
// SFX
1521
public static LoadableAudioResourceAsset ReviveSound { get; } = new("NewMod.Resources.Sounds.revive.wav");
1622
public static LoadableAudioResourceAsset DoomAwakeningSound { get; } = new("NewMod.Resources.Sounds.gloomy_aura.wav");
1723
public static LoadableAudioResourceAsset DoomAwakeningEndSound { get; } = new("NewMod.Resources.Sounds.evil_laugh.wav");
24+
public static LoadableAudioResourceAsset DrainSound { get; } = new("NewMod.Resources.Sounds.drain_sound.wav");
25+
public static LoadableAudioResourceAsset FeignDeathSound { get; } = new("NewMod.Resources.Sounds.feign_death.wav");
26+
public static LoadableAudioResourceAsset VisionarySound { get; } = new("NewMod.Resources.Sounds.visionary_sound.wav");
1827
}

0 commit comments

Comments
 (0)