-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
83 changed files
with
1,513 additions
and
863 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[*.{cs,vb}] | ||
dotnet_diagnostic.CA1707.severity = none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using MiraAPI.Example.Roles; | ||
using MiraAPI.GameOptions; | ||
using MiraAPI.GameOptions.Attributes; | ||
using System; | ||
using MiraAPI.Utilities; | ||
|
||
namespace MiraAPI.Example.Options.Roles; | ||
|
||
public class FreezerRoleSettings : AbstractOptionGroup | ||
{ | ||
public override string GroupName => "Custom Role"; | ||
|
||
public override Type AdvancedRole => typeof(FreezerRole); | ||
|
||
[ModdedNumberOption("Freeze Duration", 1, 15, 1, MiraNumberSuffixes.Seconds)] | ||
public float FreezeDuration { get; set; } = 5; | ||
|
||
[ModdedNumberOption("Freeze Uses", 1, 5)] | ||
public float FreezeUses { get; set; } = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using MiraAPI.Roles; | ||
using MiraAPI.Utilities.Assets; | ||
using TMPro; | ||
using UnityEngine; | ||
|
||
namespace MiraAPI.Example.Roles; | ||
|
||
[RegisterCustomRole] | ||
public class ChameloenRole : CrewmateRole, ICustomRole | ||
{ | ||
public string RoleName => "Chamelon"; | ||
public string RoleLongDescription => "Stay invisible while not moving."; | ||
public string RoleDescription => RoleLongDescription; | ||
public Color RoleColor => Palette.AcceptedGreen; | ||
public ModdedRoleTeams Team => ModdedRoleTeams.Crewmate; | ||
public LoadableAsset<Sprite> OptionsScreenshot => ExampleAssets.Banner; | ||
public int MaxPlayers => 2; | ||
|
||
public void PlayerControlFixedUpdate(PlayerControl playerControl) | ||
{ | ||
if (playerControl.MyPhysics.Velocity.magnitude > 0) | ||
{ | ||
SpriteRenderer rend = playerControl.cosmetics.currentBodySprite.BodySprite; | ||
TextMeshPro tmp = playerControl.cosmetics.nameText; | ||
tmp.color = Color.Lerp(tmp.color, new Color(tmp.color.r, tmp.color.g, tmp.color.b, 1), Time.deltaTime * 4f); | ||
rend.color = Color.Lerp(rend.color, new Color(1, 1, 1, 1), Time.deltaTime * 4f); | ||
|
||
foreach (var cosmetic in playerControl.cosmetics.transform.GetComponentsInChildren<SpriteRenderer>()) | ||
{ | ||
cosmetic.color = Color.Lerp(cosmetic.color, new Color(1, 1, 1, 1), Time.deltaTime * 4f); | ||
} | ||
} | ||
else | ||
{ | ||
SpriteRenderer rend = playerControl.cosmetics.currentBodySprite.BodySprite; | ||
TextMeshPro tmp = playerControl.cosmetics.nameText; | ||
tmp.color = Color.Lerp(tmp.color, new Color(tmp.color.r, tmp.color.g, tmp.color.b, playerControl.AmOwner ? 0.3f : 0), Time.deltaTime * 4f); | ||
rend.color = Color.Lerp(rend.color, new Color(1, 1, 1, playerControl.AmOwner ? 0.3f : 0), Time.deltaTime * 4f); | ||
|
||
foreach (var cosmetic in playerControl.cosmetics.transform.GetComponentsInChildren<SpriteRenderer>()) | ||
{ | ||
cosmetic.color = Color.Lerp(cosmetic.color, new Color(1, 1, 1, playerControl.AmOwner ? 0.3f : 0), Time.deltaTime * 4f); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using MiraAPI.Roles; | ||
using UnityEngine; | ||
|
||
namespace MiraAPI.Example.Roles; | ||
|
||
[RegisterCustomRole] | ||
public class NeutralKillerRole : ImpostorRole, ICustomRole | ||
{ | ||
public string RoleName => "Neutral Killer"; | ||
public string RoleDescription => "Neutral who can kill."; | ||
public string RoleLongDescription => RoleDescription; | ||
public Color RoleColor => Color.magenta; | ||
public ModdedRoleTeams Team => ModdedRoleTeams.Neutral; | ||
public bool UseVanillaKillButton => true; | ||
public bool CanGetKilled => true; | ||
public bool CanUseVent => true; | ||
|
||
public override void SpawnTaskHeader(PlayerControl playerControl) | ||
{ | ||
// remove existing task header. | ||
} | ||
|
||
public override bool DidWin(GameOverReason gameOverReason) | ||
{ | ||
return GameManager.Instance.DidHumansWin(gameOverReason); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,4 @@ internal static void Register(Assembly assembly) | |
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Linq; | ||
|
||
namespace MiraAPI.GameOptions; | ||
|
||
/// <summary> | ||
/// Singleton for option groups. | ||
/// </summary> | ||
/// <typeparam name="T">The option group type.</typeparam> | ||
public class OptionGroupSingleton<T> where T : AbstractOptionGroup | ||
public static class OptionGroupSingleton<T> where T : AbstractOptionGroup | ||
{ | ||
private static T? _instance; | ||
|
||
/// <summary> | ||
/// Gets the instance of the option group. | ||
/// </summary> | ||
/// <exception cref="InvalidOperationException">Can't</exception> | ||
#pragma warning disable CA1000 | ||
public static T Instance => _instance ??= ModdedOptionsManager.Groups.OfType<T>().Single(); | ||
#pragma warning restore CA1000 | ||
} |
Oops, something went wrong.