mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
document gamemodes
This commit is contained in:
1 parent
feb73d6b07
commit
1428c629b8
1 file changed
+66
-50
@@ -3,74 +3,82 @@
|
||||
namespace MiraAPI.GameModes;
|
||||
|
||||
/// <summary>
|
||||
/// Base class for custom gamemodes
|
||||
/// Base class for custom gamemodes.
|
||||
/// </summary>
|
||||
public abstract class CustomGameMode
|
||||
{
|
||||
/// <summary>
|
||||
/// Game mode name
|
||||
/// Gets the game mode name.
|
||||
/// </summary>
|
||||
public abstract string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Game mode description
|
||||
/// Gets the game mode description.
|
||||
/// </summary>
|
||||
public abstract string Description { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Game mode ID
|
||||
/// Gets the game mode ID.
|
||||
/// </summary>
|
||||
public abstract int Id { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Called when Intro Cutscene is destroyed
|
||||
/// Called when Intro Cutscene is destroyed.
|
||||
/// </summary>
|
||||
public virtual void Initialize() { }
|
||||
public virtual void Initialize()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called on HudManager.Start()
|
||||
/// Called on HudManager.Start().
|
||||
/// </summary>
|
||||
/// <param name="instance">Instance of HudManager</param>
|
||||
public virtual void HudStart(HudManager instance) { }
|
||||
/// <param name="instance">Instance of HudManager.</param>
|
||||
public virtual void HudStart(HudManager instance)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called every frame on HudManager.Update()
|
||||
/// Called every frame on HudManager.Update().
|
||||
/// </summary>
|
||||
/// <param name="instance">Instance of HudManager</param>
|
||||
public virtual void HudUpdate(HudManager instance) { }
|
||||
/// <param name="instance">Instance of HudManager.</param>
|
||||
public virtual void HudUpdate(HudManager instance)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when a player is killed
|
||||
/// Called when a player is killed.
|
||||
/// </summary>
|
||||
/// <param name="player">PlayerControl that was killed</param>
|
||||
public virtual void OnDeath(PlayerControl player) { }
|
||||
/// <param name="player">PlayerControl that was killed.</param>
|
||||
public virtual void OnDeath(PlayerControl player)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculate Game End logic
|
||||
/// Calculate Game End logic.
|
||||
/// </summary>
|
||||
/// <param name="runOriginal">Should original game end logic be used</param>
|
||||
/// <param name="instance">Instance of LogicGameFlowNormal</param>
|
||||
/// <param name="runOriginal">Should original game end logic be used.</param>
|
||||
/// <param name="instance">Instance of LogicGameFlowNormal.</param>
|
||||
public virtual void CheckGameEnd(out bool runOriginal, LogicGameFlowNormal instance)
|
||||
{
|
||||
runOriginal = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Custom role assignment
|
||||
/// Custom role assignment.
|
||||
/// </summary>
|
||||
/// <param name="runOriginal">Should original role assignment be used</param>
|
||||
/// <param name="instance">Instance of LogicRoleSelection</param>
|
||||
/// <param name="runOriginal">Should original role assignment be used.</param>
|
||||
/// <param name="instance">Instance of LogicRoleSelection.</param>
|
||||
public virtual void AssignRoles(out bool runOriginal, LogicRoleSelectionNormal instance)
|
||||
{
|
||||
runOriginal = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Custom murder logic
|
||||
/// Custom murder logic.
|
||||
/// </summary>
|
||||
/// <param name="runOriginal">Should original murder logic be used</param>
|
||||
/// <param name="result">Result of custom murder logic</param>
|
||||
/// <param name="target">Target player for murder</param>
|
||||
/// <param name="runOriginal">Should the original murder logic be used.</param>
|
||||
/// <param name="result">Result of custom murder logic.</param>
|
||||
/// <param name="target">Target player for murder.</param>
|
||||
public virtual void CanKill(out bool runOriginal, out bool result, PlayerControl target)
|
||||
{
|
||||
result = false;
|
||||
@@ -78,61 +86,69 @@ public abstract class CustomGameMode
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Should Roles Settings be available when this gamemode is selected?
|
||||
/// Should Roles Settings be available when this gamemode is selected.
|
||||
/// </summary>
|
||||
public virtual bool CanAccessRolesTab() => true;
|
||||
/// <returns>True if Role Settings are enabled in this game mode.</returns>
|
||||
public virtual bool AreRoleSettingsEnabled() => true;
|
||||
|
||||
/// <summary>
|
||||
/// Should Game Settings be available when this gamemode is selected?
|
||||
/// Should Game Settings be available when this gamemode is selected.
|
||||
/// </summary>
|
||||
public virtual bool CanAccessSettingsTab() => true;
|
||||
/// <returns>True if Game Settings are enabled in this mode.</returns>
|
||||
public virtual bool AreGameSettingsEnabled() => true;
|
||||
|
||||
/// <summary>
|
||||
/// Custom winner selection
|
||||
/// Custom winner selection.
|
||||
/// </summary>
|
||||
/// <returns>List of winners</returns>
|
||||
public virtual List<NetworkedPlayerInfo> CalculateWinners() => null;
|
||||
/// <returns>List of winners or null.</returns>
|
||||
public virtual List<NetworkedPlayerInfo>? CalculateWinners() => null;
|
||||
|
||||
/// <summary>
|
||||
/// Show gamemode in Intro Cutscene
|
||||
/// Show gamemode in Intro Cutscene.
|
||||
/// </summary>
|
||||
public virtual bool ShowCustomRoleScreen() => false;
|
||||
/// <returns>True if the game mode should be shown in the intro cutscene.</returns>
|
||||
public virtual bool ShowGameModeIntroCutscene() => false;
|
||||
|
||||
/// <summary>
|
||||
/// Can Admin be used in this gamemode
|
||||
/// Can Admin be used in this gamemode.
|
||||
/// </summary>
|
||||
/// <param name="console">Admin Console</param>
|
||||
/// <param name="console">Admin Console.</param>
|
||||
/// <returns>True if Admin console is enabled.</returns>
|
||||
public virtual bool CanUseMapConsole(MapConsole console) => true;
|
||||
|
||||
/// <summary>
|
||||
/// Can a body be reported in this gamemode
|
||||
/// Can a body be reported in this gamemode.
|
||||
/// </summary>
|
||||
/// <param name="body">Target body for reporting</param>
|
||||
/// <param name="body">Target body for reporting.</param>
|
||||
/// <returns>True if dead bodies can be reported.</returns>
|
||||
public virtual bool CanReport(DeadBody body) => true;
|
||||
|
||||
/// <summary>
|
||||
/// Can system consoles be used in this gamemode
|
||||
/// Can system consoles be used in this gamemode.
|
||||
/// </summary>
|
||||
/// <param name="console">System Console</param>
|
||||
/// <param name="console">System Console.</param>
|
||||
/// <returns>True if system consoles are enabled in this mode.</returns>
|
||||
public virtual bool CanUseSystemConsole(SystemConsole console) => true;
|
||||
|
||||
/// <summary>
|
||||
/// Can tasks be interacted with in this gamemode
|
||||
/// Can tasks be interacted with in this gamemode.
|
||||
/// </summary>
|
||||
/// <param name="console">Task console</param>
|
||||
public virtual bool CanUseConsole(Console console) => true;
|
||||
/// <param name="console">Task console.</param>
|
||||
/// <returns>True if tasks are enabled in this mode.</returns>
|
||||
public virtual bool CanUseTasks(Console console) => true;
|
||||
|
||||
/// <summary>
|
||||
/// Should the sabotage map be used when attempting to open sabotage overlay
|
||||
/// Should the sabotage map be used when attempting to open sabotage overlay.
|
||||
/// </summary>
|
||||
/// <param name="map">MapBehaviour object</param>
|
||||
/// <param name="map">MapBehaviour object.</param>
|
||||
/// <returns>True if the sabotage map should be shown.</returns>
|
||||
public virtual bool ShouldShowSabotageMap(MapBehaviour map) => true;
|
||||
|
||||
/// <summary>
|
||||
/// Can a player vent in this gamemode
|
||||
/// Can a player vent in this gamemode.
|
||||
/// </summary>
|
||||
/// <param name="vent">Target vent</param>
|
||||
/// <param name="playerInfo">Player attempting to vent</param>
|
||||
/// <param name="vent">Target vent.</param>
|
||||
/// <param name="playerInfo">Player attempting to vent.</param>
|
||||
/// <returns>True if venting is enabled in this mode.</returns>
|
||||
public virtual bool CanVent(Vent vent, NetworkedPlayerInfo playerInfo) => true;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user