AGoodNameLib
a good name lib.
模組介紹 作者原文
This mod doesn't do anything for you, on its own;
Its a library mod without a lot;
It will be updated;
For any modders:
- try_kill_player is deprecated, but will not be removed
AGoodNameLib Documentation
Classes and Methods
AGoodNameLib.player
This class provides static methods to interact with player objects.
- do_kill_player(PlayerBody __body, int id = 256, CauseOfDeath cod = CauseOfDeath.Accident)
- Attempts to kill the specified player, marking the death with a specified cause of death.
- Parameters:
- __body: The player's body that will be affected.
- id: The ID of the killer (defaults to 256).
- cod: The cause of death (defaults to CauseOfDeath.Accident).
- Returns: True if the player was successfully killed, otherwise False.
- try_destroy_respawns(Player player)
- Attempts to destroy all respawn positions for the specified player.
- Parameters:
- player: The player instance whose respawns will be removed.
- Returns: True if the player's respawns were removed, otherwise False.
- setPos(Player player, Vec2 position)
- Sets the position of the specified player.
- Parameters:
- player: The player instance.
- position: The new position for the player.
- player_from_body(PlayerBody body)
- Gets the player instance from a player's body.
- Parameters:
- body: The player's body.
- Returns: The player instance or null if the body is null.
- id_from_player_body(PlayerBody body)
- Gets the player ID from a player's body.
- Parameters:
- body: The player's body.
- Returns: The player ID or 256 if the body is null.
- Physics_from_body(PlayerBody body)
- Gets the physics instance from a player's body.
- Parameters:
- body: The player's body.
- Returns: The player's physics instance or null if the body is null.
- clear_ropes(PlayerBody body)
- Clears all ropes from the player's body.
- Parameters:
- body: The player's body.
- does_own_rope(PlayerBody body)
- Checks if the player owns the rope attached to their body.
- Parameters:
- body: The player's body.
- Returns: True if the player owns the rope, otherwise False.
AGoodNameLib.match
This class manages the match state.
- SuddenDeathState
- Gets or sets the sudden death state of the game.
- Property: bool SuddenDeathState
Example Mod Using AGNL
using BepInEx;
using BoplFixedMath;
using HarmonyLib;
using UnityEngine;
using static UnityEngine.ParticleSystem.PlaybackState;
namespace example_agln
{
[BepInPlugin(PLUGIN_GUID, PLUGIN_NAME, PLUGIN_VERSION)]
public class Plugin: BaseUnityPlugin
{
public const string PLUGIN_GUID = "com.your_name.example_agnl";
public const string PLUGIN_NAME = "example_agnl";
public const string PLUGIN_VERSION = "1.0.0";
private void Awake()
{
// Plugin startup logic
Logger.LogInfo($"Plugin {PLUGIN_GUID} is loaded!");
var harmony = new Harmony(PLUGIN_GUID);
harmony.PatchAll(typeof(Patches));
}
}
public class Patches
{
//basic plugin which gives dash the ability to disconnect grapple hooks
[HarmonyPatch(typeof(Dash), "performDash")]
[HarmonyPostfix]
public static void PatchDash(Dash __instance)
{
PlayerBody body = __instance.body;
if (!AGoodNameLib.player.does_own_rope(body))
{
AGoodNameLib.player.clear_ropes(body);
}
}
}
}
安裝與使用 安裝:按包內說明操作
- 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
- 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
- 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
- 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。
不同模組的安裝位置差異較大,包內說明是最可靠的依據。
下面這些內容需要先安裝,否則該模組不會生效: