Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: NewMod CI

on:
push:
branches:
- main
- dev
- au-2025.3.25
pull_request:
branches:
- main
- dev
- au-2025.3.25
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
env:
BuildingInsideCI: true

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true

- name: Cache Dependencies
uses: actions/cache@v4
with:
path: |
~/.nuget/packages
~/.cache/bepinex
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-

- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Restore NuGet Packages
run: dotnet restore NewMod/NewMod.csproj

- name: Build NewMod (Release)
run: dotnet build NewMod/NewMod.csproj --configuration Release --no-restore

- name: Build NewMod (Debug)
run: dotnet build NewMod/NewMod.csproj --configuration Debug --no-restore

- name: Upload NewMod DLL (Release)
uses: actions/upload-artifact@v4
with:
name: NewMod
path: NewMod/bin/Release/net6.0/NewMod.dll

- name: Upload NewMod DLL (Debug)
uses: actions/upload-artifact@v4
with:
name: NewMod-Debug
path: NewMod/bin/Debug/net6.0/NewMod.dll

release:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

steps:
- name: Download Release DLL
uses: actions/download-artifact@v4
with:
name: NewMod

- name: Publish GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: v1.2.${{ github.run_number }}
files: NewMod/bin/Release/net6.0/NewMod.dll
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
bin/
obj/
libs/*
References/
/packages/
riderModule.iml
Expand Down
6 changes: 4 additions & 2 deletions NewMod.sln
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Expand All @@ -9,12 +8,15 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
ANDROID|Any CPU = ANDROID|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FC05DD49-CE3A-41F4-8452-37686FE23D0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC05DD49-CE3A-41F4-8452-37686FE23D0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC05DD49-CE3A-41F4-8452-37686FE23D0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC05DD49-CE3A-41F4-8452-37686FE23D0A}.Release|Any CPU.Build.0 = Release|Any CPU
{FC05DD49-CE3A-41F4-8452-37686FE23D0A}.ANDROID|Any CPU.ActiveCfg = ANDROID|Any CPU
{FC05DD49-CE3A-41F4-8452-37686FE23D0A}.ANDROID|Any CPU.Build.0 = ANDROID|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
33 changes: 23 additions & 10 deletions NewMod/Buttons/Revenant/DoomAwakening.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class DoomAwakening : CustomActionButton
/// <summary>
/// The name displayed on the button.
/// </summary>
public override string Name => "Doom Awakening";
public override string Name => "";

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

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

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

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

var clip = NewModAsset.DoomAwakeningSound.LoadAsset();
SoundManager.Instance.PlaySound(clip, true, 1f, null);

var fullScreen = HudManager.Instance.FullScreen;
fullScreen.color = new Color(1f, 0f, 0f, 0f);
fullScreen.gameObject.SetActive(true);
Expand All @@ -103,34 +107,33 @@ public System.Collections.IEnumerator StartDoomAwakening(PlayerControl player)
float duration = EffectDuration;
float timer = 0f;
int killCount = 0;

float ghostInterval = 0.2f;
float ghostTimer = 0f;

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

// Doom Awakening loop
while (timer < duration)
{
timer += Time.deltaTime;
ghostTimer += Time.deltaTime;

// Create a trailing ghost sprite
if (ghostTimer >= ghostInterval && player.MyPhysics.Speed > 0.01f)
{
ghostTimer = 0f;
GameObject ghost = new GameObject("Revenant-Ghost");
GameObject ghost = new("Revenant-Ghost");
var ghostRenderer = ghost.AddComponent<SpriteRenderer>();
ghostRenderer.sprite = playerRenderer.sprite;
ghostRenderer.flipX = playerRenderer.flipX;
ghostRenderer.flipY = playerRenderer.flipY;
ghostRenderer.material = new Material(playerRenderer.material);
ghostRenderer.sharedMaterial = playerRenderer.sharedMaterial;
PlayerMaterial.SetColors(player.Data.DefaultOutfit.ColorId, ghostRenderer);
ghostRenderer.sortingLayerID = playerRenderer.sortingLayerID;
ghostRenderer.sortingOrder = playerRenderer.sortingOrder + 1;
ghost.transform.position = player.transform.position;
ghost.transform.rotation = player.transform.rotation;
ghost.transform.localScale = new Vector3(0.7f, 0.7f, 1f);
ghost.transform.localScale = player.transform.lossyScale;

Coroutines.Start(Utils.FadeAndDestroy(ghost, 1f));
ghosts.Enqueue(ghost);
Expand All @@ -143,11 +146,10 @@ public System.Collections.IEnumerator StartDoomAwakening(PlayerControl player)
Object.Destroy(oldGhost);
}
}

// Kill any nearby players
foreach (var target in PlayerControl.AllPlayerControls)
{
if (target == player || target.Data.IsDead || target.Data.Disconnected || target.inVent)
if (target == player || target.Data.IsDead || target.Data.Disconnected || target.inVent || target.Data.Role.IsImpostor)
continue;

if (Vector2.Distance(player.GetTruePosition(), target.GetTruePosition()) < 1f)
Expand All @@ -160,10 +162,19 @@ public System.Collections.IEnumerator StartDoomAwakening(PlayerControl player)
showKillAnim: false,
playKillSound: true);
killCount++;
killedPlayers.Add(target);
}
if (target.AmOwner)
{
SoundManager.Instance.PlaySound(NewModAsset.DoomAwakeningEndSound.LoadAsset(), false, 1f, null);
}
}
yield return null;
}
if (killedPlayers.Count >= 3)
{
SoundManager.Instance.PlaySound(NewModAsset.DoomAwakeningEndSound.LoadAsset(), false, 1f, null);
}

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

// Restore original speed and conclude
player.MyPhysics.Speed = originalSpeed;
SoundManager.Instance.StopSound(clip);
RV.StalkingStates.Remove(player.PlayerId);
Coroutines.Start(CoroutinesHelper.CoNotify("<color=green>Doom Awakening ended.</color>"));
Helpers.CreateAndShowNotification($"Doom Awakening killed {killCount} players", Color.red, null, null);
killedPlayers.Clear();
}
}
}
8 changes: 8 additions & 0 deletions NewMod/Buttons/Revenant/FeignDeathButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ public override bool Enabled(RoleBehaviour role)
{
return role is Rev && !Rev.HasUsedFeignDeath;
}
/// <summary>
/// Checks if this button can be used
/// </summary>
/// <returns>True if base conditions are met and the player hasn't used Feign Death; otherwise, false.</returns>
public override bool CanUse()
{
return base.CanUse() && !Rev.HasUsedFeignDeath;
}

/// <summary>
/// Invoked when the Feign Death button is clicked, starting the feign death coroutine.
Expand Down
6 changes: 3 additions & 3 deletions NewMod/Buttons/Visionary/ShowScreenshotButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ShowScreenshotButton : CustomActionButton
/// <summary>
/// The name displayed on this button.
/// </summary>
public override string Name => "Show Screenshot";
public override string Name => "";

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

/// <summary>
/// The sprite asset for this button. Here, set to an empty sprite.
/// The sprite asset for this button.
/// </summary>
public override LoadableAsset<Sprite> Sprite => MiraAssets.Empty;
public override LoadableAsset<Sprite> Sprite => NewModAsset.ShowScreenshotButton;

/// <summary>
/// The on-screen location where the button will appear.
Expand Down
4 changes: 4 additions & 0 deletions NewMod/CustomGameModes/RevivalRoyale.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ public override void HudUpdate(HudManager instance)
ReviveCounter.text = $"Revive Count: {ReviveCount}";
if (ReviveCount >= 6)
{
#if PC
GameManager.Instance.RpcEndGame(GameOverReason.ImpostorsByKill, true);
#else
GameManager.Instance.RpcEndGame(GameOverReason.ImpostorByKill, true);
#endif
break;
}
}
Expand Down
Loading
Loading