Skip to content
This repository was archived by the owner on Feb 19, 2021. It is now read-only.
Steven Webster edited this page Sep 30, 2020 · 3 revisions

The API adds a way to easily interact with the plugin from your own plugins. Although most stuff is public anyways, this makes it a lot easier. This should be accessible via Subclass.API.

  • GiveClass(Player, SubClass) -> bool

    • Gives a player a subclass if they don't have one and are the proper role.
    • Returns true if the subclass was given, false otherwise.
  • RemoveClass(Player) -> bool

    • Removes the player's subclass.
    • Returns true if they had a subclass, false otherwise.
  • GetClasses() -> Dictionary<string, SubClass>

    • Returns a dictionary of subclasses mapped to their names.
  • EnableAllClasses() -> void

    • Enables all loaded subclasses (Only subclasses that are enabled in their config are loaded).
  • DisableAllClasses() -> void

    • Disables all loaded subclasses.
  • EnableClass(SubClass) -> bool

    • Enables the subclass, returns true if it was successfully enabled, false otherwise.
    • Overload: EnableClass(String)
      • Enables the subclass with the name provided.
  • DisableClass(SubClass) -> bool

    • Disables the subclass, returns true if it was successfully disabled, false otherwise.
    • Overload: DisableClass(String)
      • Disables the subclass with the name provided.
  • GetPlayersWithSubclasses() -> Dictionary<Player, SubClass>

    • Returns a dictionary of subclasses mapped to the player that has them.
  • PlayerHasSubClass(Player) -> bool

    • Returns true if the player has a subclass, false otherwise.
  • PlayerHasZombies(Player) -> bool

    • Returns true if the player has zombies (necromancers).
  • PlayerHadZombies(Player) -> bool

    • Returns true if the player had zombies and escaped (were necromancers), false otherwise.
  • PlayersZombies(Player) -> List

    • Returns a list of the provided player's zombies, or null if they have none.
  • PlayersZombiesOld(Player) -> List

    • Returns a list of the provided player's old zombies, or null if they had none.
  • RevivedZombies() -> List

    • Returns a list of players that were revived by necromancers (can be empty).
  • AbilityOnCooldown(Player, AbilityType) -> bool?

    • Returns true if the ability is on cooldown, false if it isn't or null if the player doesn't have a subclass.
  • TimeLeftOnCooldown(Player, AbilityType) -> float?

    • Returns the time left on the cooldown of the provided ability for the player, or null if they don't have a subclass.

Clone this wiki locally