Skip to content

Commit

Permalink
remove unnecessary stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
XtraCube committed Dec 21, 2024
1 parent 9fb8a6b commit 0fe6d98
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 25 deletions.
4 changes: 0 additions & 4 deletions MiraAPI.Example/ExamplePlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@
using BepInEx.Configuration;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using MiraAPI.Events;
using MiraAPI.Events.Mira;
using MiraAPI.Example.Buttons.Freezer;
using MiraAPI.PluginLoading;
using Reactor;
using Reactor.Networking;
using Reactor.Networking.Attributes;
using Reactor.Utilities;

namespace MiraAPI.Example;

Expand Down
24 changes: 24 additions & 0 deletions MiraAPI.Example/Modifiers/HighPriorityModifier.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using MiraAPI.Modifiers;
using MiraAPI.Modifiers.Types;

namespace MiraAPI.Example.Modifiers;

[RegisterModifier]
public class HighPriorityModifier : GameModifier
{
public override string ModifierName => "High Priority";
public override int GetAssignmentChance()
{
return 100;
}

public override int GetAmountPerGame()
{
return 1;
}

public override int Priority()
{
return 100;
}
}
1 change: 0 additions & 1 deletion MiraAPI/Events/MiraEventManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using BepInEx.Unity.IL2CPP;
using Reactor.Utilities;

namespace MiraAPI.Events;
Expand Down
9 changes: 4 additions & 5 deletions MiraAPI/Modifiers/ModifierManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Linq;
using MiraAPI.Modifiers.Types;
using MiraAPI.Networking;
using MiraAPI.PluginLoading;
using MiraAPI.Roles;
using MiraAPI.Utilities;
using Reactor.Networking.Rpc;
Expand Down Expand Up @@ -88,18 +87,18 @@ internal static void AssignModifiers(List<PlayerControl> plrs)
{
var mod = Activator.CreateInstance(IdToTypeModifierMap[id]) as GameModifier;
var chance = Math.Clamp(mod!.GetAssignmentChance(), 0, 100);
var count = mod!.GetAmountPerGame();
var count = mod.GetAmountPerGame();

if (chance == 0 || count == 0)
{
continue;
}

var maxCount = plrs.Count(x => IsGameModifierValid(x, mod!, id));
var maxCount = plrs.Count(x => IsGameModifierValid(x, mod, id));

if (maxCount == 0)
{
Logger<MiraApiPlugin>.Warning($"No players are valid for {mod!.ModifierName}");
Logger<MiraApiPlugin>.Warning($"No players are valid for {mod.ModifierName}");
continue;
}

Expand All @@ -126,7 +125,7 @@ internal static void AssignModifiers(List<PlayerControl> plrs)

if (shuffledList.Count > plrs.Count)
{
shuffledList = shuffledList.GetRange(0, plrs.Count)!;
shuffledList = shuffledList.GetRange(0, plrs.Count);
}

foreach (var id in shuffledList)
Expand Down
1 change: 0 additions & 1 deletion MiraAPI/Networking/CustomMurderRpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using AmongUs.GameOptions;
using Assets.CoreScripts;
using BepInEx.Unity.IL2CPP.Utils;
using Discord;
using MiraAPI.Events;
using MiraAPI.Events.Vanilla;
using Reactor.Networking.Attributes;
Expand Down
1 change: 0 additions & 1 deletion MiraAPI/Patches/Events/HudButtonEventPatches.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using HarmonyLib;
using MiraAPI.Events;
using MiraAPI.Events.Vanilla;
using Reactor.Utilities;

namespace MiraAPI.Patches.Events;

Expand Down
3 changes: 0 additions & 3 deletions MiraAPI/Patches/Events/VentEventPatches.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System.Linq;
using BepInEx.Unity.IL2CPP.Utils.Collections;
using HarmonyLib;
using MiraAPI.Events;
using MiraAPI.Events.Vanilla;
using MiraAPI.Utilities;
using Reactor.Utilities;

namespace MiraAPI.Patches.Events;

Expand Down
1 change: 0 additions & 1 deletion MiraAPI/Patches/HudManagerPatches.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using HarmonyLib;
using MiraAPI.Hud;
using MiraAPI.Roles;
using Reactor.Utilities.Extensions;
using UnityEngine;
using Object = UnityEngine.Object;
Expand Down
4 changes: 1 addition & 3 deletions MiraAPI/Patches/VentPatches.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System.Linq;
using HarmonyLib;
using HarmonyLib;
using MiraAPI.Roles;
using MiraAPI.Utilities;
using Reactor.Utilities;
using UnityEngine;

namespace MiraAPI.Patches;
Expand Down
4 changes: 0 additions & 4 deletions MiraAPI/PluginLoading/MiraPluginInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
using MiraAPI.GameModes;
using MiraAPI.GameOptions;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Collections.ObjectModel;
using System.Linq;
using MiraAPI.GameOptions.OptionTypes;
using MiraAPI.Hud;
using MiraAPI.Roles;

namespace MiraAPI.PluginLoading;

Expand Down
2 changes: 0 additions & 2 deletions MiraAPI/Utilities/Assets/SpriteTools.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Reflection;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Reactor.Utilities;
using Reactor.Utilities.Extensions;
using UnityEngine;
Expand Down

0 comments on commit 0fe6d98

Please sign in to comment.