Skip to content

Commit c28a6fe

Browse files
v1.2.6 Update
2 parents c0b38f5 + aa4529b commit c28a6fe

80 files changed

Lines changed: 2152 additions & 544 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ name: NewMod CI
22

33
on:
44
push:
5-
branches:
6-
- main
7-
- dev
5+
branches: [main, dev]
6+
tags:
7+
- 'v*'
88
pull_request:
9-
branches:
10-
- main
11-
- dev
9+
branches: [main, dev]
1210
workflow_dispatch:
1311

1412
jobs:
@@ -68,22 +66,24 @@ jobs:
6866
name: NewMod-Android
6967
path: NewMod/bin/ANDROID/net6.0/NewMod.dll
7068

71-
7269
release:
7370
needs: build
7471
runs-on: ubuntu-latest
75-
if: github.ref == 'refs/heads/main'
72+
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
73+
permissions:
74+
contents: write
7675

7776
steps:
7877
- name: Download Release DLL
7978
uses: actions/download-artifact@v4
8079
with:
8180
name: NewMod
81+
path: ./release_artifacts
8282

8383
- name: Publish GitHub Release
8484
uses: softprops/action-gh-release@v1
8585
with:
86-
tag_name: v1.2.${{ github.run_number }}
87-
files: NewMod/bin/Release/net6.0/NewMod.dll
86+
tag_name: ${{ github.ref_name }}
87+
files: ./release_artifacts/**/NewMod.dll
8888
env:
8989
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
using MiraAPI.GameOptions;
2+
using MiraAPI.Hud;
3+
using MiraAPI.Utilities.Assets;
4+
using NewMod.Options.Roles.AegisOptions;
5+
using UnityEngine;
6+
using AG = NewMod.Roles.CrewmateRoles.Aegis;
7+
using NewMod.Utilities;
8+
using MiraAPI.Keybinds;
9+
10+
namespace NewMod.Buttons.Aegis
11+
{
12+
/// <summary>
13+
/// Custom action button for the Aegis role. Places a configurable shield zone.
14+
/// </summary>
15+
public class AegisButton : CustomActionButton
16+
{
17+
/// <summary>
18+
/// Gets the display name for this button.
19+
/// </summary>
20+
public override string Name => "Sentinel Ward";
21+
22+
/// <summary>
23+
/// Cooldown is driven by AegisOptions.
24+
/// </summary>
25+
public override float Cooldown => OptionGroupSingleton<AegisOptions>.Instance.AegisCooldown;
26+
27+
/// <summary>
28+
/// Maximum number of uses is driven by AegisOptions.
29+
/// </summary>
30+
public override int MaxUses => (int)OptionGroupSingleton<AegisOptions>.Instance.MaxCharges;
31+
32+
/// <summary>
33+
/// Button location on HUD.
34+
/// </summary>
35+
public override ButtonLocation Location => ButtonLocation.BottomLeft;
36+
37+
/// <summary>
38+
/// Default keybind for Aegis.
39+
/// </summary>
40+
public override MiraKeybind Keybind => MiraGlobalKeybinds.PrimaryAbility;
41+
42+
/// <summary>
43+
/// No “hold” effect, instant cast.
44+
/// </summary>
45+
public override float EffectDuration => 0f;
46+
47+
/// <summary>
48+
/// Icon for the button (replace with your actual asset).
49+
/// </summary>
50+
public override LoadableAsset<Sprite> Sprite => NewModAsset.Shield;
51+
52+
/// <summary>
53+
/// Enabled only for the Aegis role.
54+
/// </summary>
55+
public override bool Enabled(RoleBehaviour role) => role is AG;
56+
57+
/// <summary>
58+
/// On click, place the Aegis shield at the player's current position using the configured settings.
59+
/// </summary>
60+
protected override void OnClick()
61+
{
62+
var player = PlayerControl.LocalPlayer;
63+
64+
AegisUtilities.ActivateShield(player, (Vector2)player.transform.position);
65+
}
66+
}
67+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
using MiraAPI.GameOptions;
2+
using MiraAPI.Hud;
3+
using MiraAPI.Utilities.Assets;
4+
using NewMod.Options.Roles.EdgeveilOptions;
5+
using EV = NewMod.Roles.ImpostorRoles.Edgeveil;
6+
using Rewired;
7+
using UnityEngine;
8+
using NewMod.Components.ScreenEffects;
9+
using NewMod.Utilities;
10+
using Reactor.Utilities;
11+
using MiraAPI.Keybinds;
12+
13+
namespace NewMod.Buttons.Edgeveil
14+
{
15+
/// <summary>
16+
/// Defines a custom action button for Edgeviel's Arc ability.
17+
/// </summary>
18+
public class ArcButton : CustomActionButton
19+
{
20+
/// <summary>
21+
/// The name displayed on the button.
22+
/// </summary>
23+
public override string Name => "Arc";
24+
25+
/// <summary>
26+
/// Gets the cooldown time for this button, based on <see cref="EdgeveilOptions"/>.
27+
/// </summary>
28+
public override float Cooldown => OptionGroupSingleton<EdgeveilOptions>.Instance.SlashCooldown;
29+
30+
/// <summary>
31+
/// Gets the maximum number of uses for this button (0 = infinite).
32+
/// </summary>
33+
public override int MaxUses => (int)OptionGroupSingleton<EdgeveilOptions>.Instance.SlashMaxUses;
34+
35+
/// <summary>
36+
/// Determines how long the effect lasts. For Arc, none.
37+
/// </summary>
38+
public override float EffectDuration => 0f;
39+
40+
/// <summary>
41+
/// Default keybind for Edgeveil's Arc ability.
42+
/// </summary>
43+
public override MiraKeybind Keybind => MiraGlobalKeybinds.PrimaryAbility;
44+
45+
/// <summary>
46+
/// Defines where on the screen this button should appear.
47+
/// </summary>
48+
public override ButtonLocation Location => ButtonLocation.BottomLeft;
49+
50+
/// <summary>
51+
/// The visual icon for this button, set to the Edgeveil Arc sprite asset.
52+
/// </summary>
53+
public override LoadableAsset<Sprite> Sprite => NewModAsset.SlashIcon;
54+
55+
/// <summary>
56+
/// Invoked when the Arc button is clicked.
57+
/// </summary>
58+
protected override void OnClick()
59+
{
60+
var player = PlayerControl.LocalPlayer;
61+
62+
bool flipLeft = player.cosmetics.currentBodySprite.BodySprite.flipX;
63+
Vector2 dir = flipLeft ? Vector2.left : Vector2.right;
64+
65+
float spawnOffset = 0.55f;
66+
var spawnPos = player.GetTruePosition() + dir * spawnOffset;
67+
68+
var tray = SlashTray.CreateTray();
69+
tray.transform.SetParent(ShipStatus.Instance.transform, worldPositionStays: true);
70+
tray.transform.SetPositionAndRotation(
71+
new Vector3(spawnPos.x, spawnPos.y, player.transform.position.z),
72+
Quaternion.FromToRotation(Vector3.right, new Vector3(dir.x, dir.y, 0f))
73+
);
74+
75+
tray.Owner = player;
76+
tray.SetMotion(dir, OptionGroupSingleton<EdgeveilOptions>.Instance.SlashSpeed);
77+
78+
float effectDuration = OptionGroupSingleton<EdgeveilOptions>.Instance.EffectDuration;
79+
80+
HudManager.Instance.PlayerCam.ShakeScreen(effectDuration, 2f);
81+
}
82+
/// <summary>
83+
/// Determines whether this button is enabled for the role, returning true if the role is <see cref="EdgevielRole"/>.
84+
/// </summary>
85+
/// <param name="role">The current player's role.</param>
86+
/// <returns>True if the role is Edgeveil; otherwise false.</returns>
87+
public override bool Enabled(RoleBehaviour role)
88+
{
89+
return role is EV;
90+
}
91+
}
92+
}

NewMod/Buttons/EnergyThief/DrainButton.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using ET = NewMod.Roles.NeutralRoles.EnergyThief;
77
using UnityEngine;
88
using NewMod.Utilities;
9-
using Rewired;
9+
using MiraAPI.Keybinds;
1010

1111
namespace NewMod.Buttons.EnergyThief
1212
{
@@ -34,11 +34,11 @@ public class DrainButton : CustomActionButton<PlayerControl>
3434
/// The on-screen position of this button.
3535
/// </summary>
3636
public override ButtonLocation Location => ButtonLocation.BottomRight;
37-
37+
3838
/// <summary>
3939
/// Default keybind for EnergyThief's Drain ability.
4040
/// </summary>
41-
public override KeyboardKeyCode Defaultkeybind => KeyboardKeyCode.F;
41+
public override MiraKeybind Keybind => MiraGlobalKeybinds.PrimaryAbility;
4242

4343
/// <summary>
4444
/// The duration of the effect applied by this button; in this case, zero.

NewMod/Buttons/Injector/InjectButton.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using MiraAPI.Utilities;
88
using System;
99
using static NewMod.Utilities.Utils;
10-
using Rewired;
10+
using MiraAPI.Keybinds;
1111

1212
namespace NewMod.Buttons.Injector
1313
{
@@ -45,7 +45,7 @@ public class InjectButton : CustomActionButton<PlayerControl>
4545
/// <summary>
4646
/// Default keybind for Injector's Inject ability.
4747
/// </summary>
48-
public override KeyboardKeyCode Defaultkeybind => KeyboardKeyCode.C;
48+
public override MiraKeybind Keybind => MiraGlobalKeybinds.PrimaryAbility;
4949

5050
/// <summary>
5151
/// Sprite/icon displayed on the button.

NewMod/Buttons/Necromancer/ReviveButton.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using NewMod.Roles.ImpostorRoles;
66
using UnityEngine;
77
using NewMod.Utilities;
8-
using Rewired;
8+
using MiraAPI.Keybinds;
99

1010
namespace NewMod.Buttons.Necromancer
1111
{
@@ -37,7 +37,7 @@ public class ReviveButton : CustomActionButton
3737
/// <summary>
3838
/// Default keybind for Necromancer's Revive ability.
3939
/// </summary>
40-
public override KeyboardKeyCode Defaultkeybind => KeyboardKeyCode.V;
40+
public override MiraKeybind Keybind => MiraGlobalKeybinds.PrimaryAbility;
4141

4242
/// <summary>
4343
/// Defines where on the screen this button should appear.

NewMod/Buttons/Overload/FinalButton.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using MiraAPI.GameOptions;
22
using MiraAPI.Hud;
3+
using MiraAPI.Keybinds;
34
using MiraAPI.Utilities.Assets;
45
using NewMod.Options.Roles.OverloadOptions;
56
using NewMod.Roles.NeutralRoles;
@@ -32,7 +33,7 @@ public class FinalAbilityButton : CustomActionButton
3233
/// <summary>
3334
/// Default keybind for the Final Ability button.
3435
/// </summary>
35-
public override KeyboardKeyCode Defaultkeybind => KeyboardKeyCode.B;
36+
public override MiraKeybind Keybind => MiraGlobalKeybinds.SecondaryAbility;
3637

3738
/// <summary>
3839
/// No duration effect.

NewMod/Buttons/Overload/OverloadButton.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using MiraAPI.Hud;
2+
using MiraAPI.Keybinds;
23
using MiraAPI.Utilities.Assets;
34
using NewMod.Roles.NeutralRoles;
4-
using Rewired;
55
using UnityEngine;
66

77
namespace NewMod.Buttons.Overload
@@ -47,7 +47,7 @@ public class OverloadButton : CustomActionButton
4747
/// Stores the default key assigned to the absorbed button's action.
4848
/// Mirrors the keybind of the original absorbed button.
4949
/// </summary>
50-
public KeyboardKeyCode absorbedKeybind;
50+
public MiraKeybind absorbedKeybind;
5151

5252
/// <summary>
5353
/// The name displayed on the button.
@@ -67,7 +67,7 @@ public class OverloadButton : CustomActionButton
6767
/// <summary>
6868
/// Default keybind for Overload's Overload ability.
6969
/// </summary>
70-
public override KeyboardKeyCode Defaultkeybind => absorbedKeybind;
70+
public override MiraKeybind Keybind => absorbedKeybind;
7171

7272
/// <summary>
7373
/// Determines how long the effect from clicking the button lasts. In this case, no duration is set.
@@ -96,7 +96,7 @@ public void Absorb(CustomActionButton target)
9696
absorbedCooldown = target.Cooldown;
9797
absorbedMaxUses = target.MaxUses;
9898
absorbedSprite = target.Sprite;
99-
absorbedKeybind = target.Defaultkeybind;
99+
absorbedKeybind = target.Keybind;
100100
absorbedOnClick = () => target.GetType().GetMethod("OnClick", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)
101101
?.Invoke(target, null);
102102

NewMod/Buttons/Prankster/FakeBodyButton.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using UnityEngine;
88
using NewMod.Utilities;
99
using Rewired;
10+
using MiraAPI.Keybinds;
1011

1112
namespace NewMod.Buttons.Prankster
1213
{
@@ -38,7 +39,7 @@ public class FakeBodyButton : CustomActionButton
3839
/// <summary>
3940
/// Default keybind for Prankster's Fake Body ability.
4041
/// </summary>
41-
public override KeyboardKeyCode Defaultkeybind => KeyboardKeyCode.Z;
42+
public override MiraKeybind Keybind => MiraGlobalKeybinds.PrimaryAbility;
4243

4344
/// <summary>
4445
/// The duration of any effect caused by this button press; in this case, no effect duration is used.

NewMod/Buttons/PulseBlade/StrikeButton.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using NewMod.Utilities;
1313
using Reactor.Networking.Attributes;
1414
using Rewired;
15+
using MiraAPI.Keybinds;
1516

1617
namespace NewMod.Buttons.Pulseblade
1718
{
@@ -48,10 +49,8 @@ public class StrikeButton : CustomActionButton
4849

4950
/// <summary>
5051
/// Default keybind for Pulseblade's Strike ability.
51-
/// Requires Shift as a modifier to prevent accidental use.
5252
/// </summary>
53-
public override KeyboardKeyCode Defaultkeybind => KeyboardKeyCode.G;
54-
public override ModifierKey Modifier1 => ModifierKey.Shift;
53+
public override MiraKeybind Keybind => MiraGlobalKeybinds.PrimaryAbility;
5554
/// <summary>
5655
/// Sprite used for the button — set to empty;
5756
/// </summary>

0 commit comments

Comments
 (0)