Skip to content

Commit c329ec4

Browse files
Merge pull request #2 from CallOfCreator/au-2025.3.25
Add support for v2025.6.10 (v16.1.0)
2 parents e6a3b46 + fb000f1 commit c329ec4

46 files changed

Lines changed: 1125 additions & 331 deletions

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: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: NewMod CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
- au-2025.3.25
9+
pull_request:
10+
branches:
11+
- main
12+
- dev
13+
- au-2025.3.25
14+
workflow_dispatch:
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
env:
20+
BuildingInsideCI: true
21+
22+
steps:
23+
- name: Checkout Repository
24+
uses: actions/checkout@v4
25+
with:
26+
submodules: true
27+
28+
- name: Cache Dependencies
29+
uses: actions/cache@v4
30+
with:
31+
path: |
32+
~/.nuget/packages
33+
~/.cache/bepinex
34+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
35+
restore-keys: |
36+
${{ runner.os }}-nuget-
37+
38+
- name: Setup .NET 8.0
39+
uses: actions/setup-dotnet@v4
40+
with:
41+
dotnet-version: 8.0.x
42+
43+
- name: Restore NuGet Packages
44+
run: dotnet restore NewMod/NewMod.csproj
45+
46+
- name: Build NewMod (Release)
47+
run: dotnet build NewMod/NewMod.csproj --configuration Release --no-restore
48+
49+
- name: Build NewMod (Debug)
50+
run: dotnet build NewMod/NewMod.csproj --configuration Debug --no-restore
51+
52+
- name: Upload NewMod DLL (Release)
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: NewMod
56+
path: NewMod/bin/Release/net6.0/NewMod.dll
57+
58+
- name: Upload NewMod DLL (Debug)
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: NewMod-Debug
62+
path: NewMod/bin/Debug/net6.0/NewMod.dll
63+
64+
release:
65+
needs: build
66+
runs-on: ubuntu-latest
67+
if: github.ref == 'refs/heads/main'
68+
69+
steps:
70+
- name: Download Release DLL
71+
uses: actions/download-artifact@v4
72+
with:
73+
name: NewMod
74+
75+
- name: Publish GitHub Release
76+
uses: softprops/action-gh-release@v1
77+
with:
78+
tag_name: v1.2.${{ github.run_number }}
79+
files: NewMod/bin/Release/net6.0/NewMod.dll
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
bin/
22
obj/
3+
libs/*
34
References/
45
/packages/
56
riderModule.iml

NewMod.sln

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 12.00
1+
Microsoft Visual Studio Solution File, Format Version 12.00
32
# Visual Studio Version 17
43
VisualStudioVersion = 17.5.002.0
54
MinimumVisualStudioVersion = 10.0.40219.1
@@ -9,12 +8,15 @@ Global
98
GlobalSection(SolutionConfigurationPlatforms) = preSolution
109
Debug|Any CPU = Debug|Any CPU
1110
Release|Any CPU = Release|Any CPU
11+
ANDROID|Any CPU = ANDROID|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1414
{FC05DD49-CE3A-41F4-8452-37686FE23D0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1515
{FC05DD49-CE3A-41F4-8452-37686FE23D0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
1616
{FC05DD49-CE3A-41F4-8452-37686FE23D0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
1717
{FC05DD49-CE3A-41F4-8452-37686FE23D0A}.Release|Any CPU.Build.0 = Release|Any CPU
18+
{FC05DD49-CE3A-41F4-8452-37686FE23D0A}.ANDROID|Any CPU.ActiveCfg = ANDROID|Any CPU
19+
{FC05DD49-CE3A-41F4-8452-37686FE23D0A}.ANDROID|Any CPU.Build.0 = ANDROID|Any CPU
1820
EndGlobalSection
1921
GlobalSection(SolutionProperties) = preSolution
2022
HideSolutionNode = FALSE

NewMod/Buttons/Revenant/DoomAwakening.cs

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class DoomAwakening : CustomActionButton
2020
/// <summary>
2121
/// The name displayed on the button.
2222
/// </summary>
23-
public override string Name => "Doom Awakening";
23+
public override string Name => "";
2424

2525
/// <summary>
2626
/// Cooldown time for this ability, as configured in <see cref="RevenantOptions"/>.
@@ -43,9 +43,9 @@ public class DoomAwakening : CustomActionButton
4343
public override float EffectDuration => OptionGroupSingleton<RevenantOptions>.Instance.DoomAwakeningDuration;
4444

4545
/// <summary>
46-
/// The icon or sprite representing this button. Here, set to an empty sprite.
46+
/// The icon or sprite representing this button.
4747
/// </summary>
48-
public override LoadableAsset<Sprite> Sprite => MiraAssets.Empty;
48+
public override LoadableAsset<Sprite> Sprite => NewModAsset.DoomAwakeningButton;
4949

5050
/// <summary>
5151
/// Specifies whether this button is enabled for the specified role.
@@ -74,6 +74,7 @@ protected override void OnClick()
7474
var player = PlayerControl.LocalPlayer;
7575
Coroutines.Start(StartDoomAwakening(player));
7676
}
77+
public static List<PlayerControl> killedPlayers = new();
7778

7879
/// <summary>
7980
/// Executes the Doom Awakening effect, increasing speed, fading the screen, and killing nearby players.
@@ -85,6 +86,9 @@ public System.Collections.IEnumerator StartDoomAwakening(PlayerControl player)
8586
float originalSpeed = player.MyPhysics.Speed;
8687
player.MyPhysics.Speed *= 2f;
8788

89+
var clip = NewModAsset.DoomAwakeningSound.LoadAsset();
90+
SoundManager.Instance.PlaySound(clip, true, 1f, null);
91+
8892
var fullScreen = HudManager.Instance.FullScreen;
8993
fullScreen.color = new Color(1f, 0f, 0f, 0f);
9094
fullScreen.gameObject.SetActive(true);
@@ -103,34 +107,33 @@ public System.Collections.IEnumerator StartDoomAwakening(PlayerControl player)
103107
float duration = EffectDuration;
104108
float timer = 0f;
105109
int killCount = 0;
110+
106111
float ghostInterval = 0.2f;
107112
float ghostTimer = 0f;
108113

109114
Queue<GameObject> ghosts = new Queue<GameObject>();
110115
SpriteRenderer playerRenderer = player.cosmetics.normalBodySprite.BodySprite;
111116

112-
// Doom Awakening loop
113117
while (timer < duration)
114118
{
115119
timer += Time.deltaTime;
116120
ghostTimer += Time.deltaTime;
117121

118-
// Create a trailing ghost sprite
119122
if (ghostTimer >= ghostInterval && player.MyPhysics.Speed > 0.01f)
120123
{
121124
ghostTimer = 0f;
122-
GameObject ghost = new GameObject("Revenant-Ghost");
125+
GameObject ghost = new("Revenant-Ghost");
123126
var ghostRenderer = ghost.AddComponent<SpriteRenderer>();
124127
ghostRenderer.sprite = playerRenderer.sprite;
125128
ghostRenderer.flipX = playerRenderer.flipX;
126129
ghostRenderer.flipY = playerRenderer.flipY;
127-
ghostRenderer.material = new Material(playerRenderer.material);
130+
ghostRenderer.sharedMaterial = playerRenderer.sharedMaterial;
128131
PlayerMaterial.SetColors(player.Data.DefaultOutfit.ColorId, ghostRenderer);
129132
ghostRenderer.sortingLayerID = playerRenderer.sortingLayerID;
130133
ghostRenderer.sortingOrder = playerRenderer.sortingOrder + 1;
131134
ghost.transform.position = player.transform.position;
132135
ghost.transform.rotation = player.transform.rotation;
133-
ghost.transform.localScale = new Vector3(0.7f, 0.7f, 1f);
136+
ghost.transform.localScale = player.transform.lossyScale;
134137

135138
Coroutines.Start(Utils.FadeAndDestroy(ghost, 1f));
136139
ghosts.Enqueue(ghost);
@@ -143,11 +146,10 @@ public System.Collections.IEnumerator StartDoomAwakening(PlayerControl player)
143146
Object.Destroy(oldGhost);
144147
}
145148
}
146-
147149
// Kill any nearby players
148150
foreach (var target in PlayerControl.AllPlayerControls)
149151
{
150-
if (target == player || target.Data.IsDead || target.Data.Disconnected || target.inVent)
152+
if (target == player || target.Data.IsDead || target.Data.Disconnected || target.inVent || target.Data.Role.IsImpostor)
151153
continue;
152154

153155
if (Vector2.Distance(player.GetTruePosition(), target.GetTruePosition()) < 1f)
@@ -160,10 +162,19 @@ public System.Collections.IEnumerator StartDoomAwakening(PlayerControl player)
160162
showKillAnim: false,
161163
playKillSound: true);
162164
killCount++;
165+
killedPlayers.Add(target);
166+
}
167+
if (target.AmOwner)
168+
{
169+
SoundManager.Instance.PlaySound(NewModAsset.DoomAwakeningEndSound.LoadAsset(), false, 1f, null);
163170
}
164171
}
165172
yield return null;
166173
}
174+
if (killedPlayers.Count >= 3)
175+
{
176+
SoundManager.Instance.PlaySound(NewModAsset.DoomAwakeningEndSound.LoadAsset(), false, 1f, null);
177+
}
167178

168179
// Fade out the red overlay
169180
float fadeOutTime = 0.5f;
@@ -177,9 +188,11 @@ public System.Collections.IEnumerator StartDoomAwakening(PlayerControl player)
177188

178189
// Restore original speed and conclude
179190
player.MyPhysics.Speed = originalSpeed;
191+
SoundManager.Instance.StopSound(clip);
180192
RV.StalkingStates.Remove(player.PlayerId);
181193
Coroutines.Start(CoroutinesHelper.CoNotify("<color=green>Doom Awakening ended.</color>"));
182194
Helpers.CreateAndShowNotification($"Doom Awakening killed {killCount} players", Color.red, null, null);
195+
killedPlayers.Clear();
183196
}
184197
}
185198
}

NewMod/Buttons/Revenant/FeignDeathButton.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ public override bool Enabled(RoleBehaviour role)
5353
{
5454
return role is Rev && !Rev.HasUsedFeignDeath;
5555
}
56+
/// <summary>
57+
/// Checks if this button can be used
58+
/// </summary>
59+
/// <returns>True if base conditions are met and the player hasn't used Feign Death; otherwise, false.</returns>
60+
public override bool CanUse()
61+
{
62+
return base.CanUse() && !Rev.HasUsedFeignDeath;
63+
}
5664

5765
/// <summary>
5866
/// Invoked when the Feign Death button is clicked, starting the feign death coroutine.

NewMod/Buttons/Visionary/ShowScreenshotButton.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class ShowScreenshotButton : CustomActionButton
1818
/// <summary>
1919
/// The name displayed on this button.
2020
/// </summary>
21-
public override string Name => "Show Screenshot";
21+
public override string Name => "";
2222

2323
/// <summary>
2424
/// The cooldown time for this button, based on <see cref="VisionaryOptions"/>.
@@ -36,9 +36,9 @@ public class ShowScreenshotButton : CustomActionButton
3636
public override int MaxUses => (int)OptionGroupSingleton<VisionaryOptions>.Instance.MaxScreenshots;
3737

3838
/// <summary>
39-
/// The sprite asset for this button. Here, set to an empty sprite.
39+
/// The sprite asset for this button.
4040
/// </summary>
41-
public override LoadableAsset<Sprite> Sprite => MiraAssets.Empty;
41+
public override LoadableAsset<Sprite> Sprite => NewModAsset.ShowScreenshotButton;
4242

4343
/// <summary>
4444
/// The on-screen location where the button will appear.

NewMod/CustomGameModes/RevivalRoyale.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ public override void HudUpdate(HudManager instance)
4747
ReviveCounter.text = $"Revive Count: {ReviveCount}";
4848
if (ReviveCount >= 6)
4949
{
50+
#if PC
51+
GameManager.Instance.RpcEndGame(GameOverReason.ImpostorsByKill, true);
52+
#else
5053
GameManager.Instance.RpcEndGame(GameOverReason.ImpostorByKill, true);
54+
#endif
5155
break;
5256
}
5357
}

0 commit comments

Comments
 (0)