battlecore::player

The playermodule manages the player life cycle (dying and respawning), applies damage and healing across health, armour and shield, and reads or writes the player's stats and identity. Include its declarations with include "./battlecore/player.bst";.

Life cycle

native void battlecore::player.die ();
native void battlecore::player.respawn ();
native bool battlecore::player.getIsRespawning ();
native bool battlecore::player.getIsAlive ();
  • die — kills the player.
  • respawn — respawns the player.
  • getIsRespawning — returns whether the player is currently respawning.
  • getIsAlive — returns whether the player is alive.

Identity

native int  battlecore::player.getPlayerId ();
native int  battlecore::player.getTeamId ();
native void battlecore::player.setTeamId (int newVal);
native void battlecore::player.setName (string newName);
  • getPlayerId — returns the player id.
  • getTeamId / setTeamId — gets or sets the team id.
  • setName — sets the player name.

Damage and healing

native void battlecore::player.takeDamage (int amount);
native void battlecore::player.takeArmourDamage (int amount);
native void battlecore::player.takeShieldDamage (int amount);
native void battlecore::player.takeHealing (int amount);
native void battlecore::player.takeArmourHealing (int amount);
native void battlecore::player.takeShieldHealing (int amount);

Each function applies the given amount of damage or healing to the relevant pool (health, armour or shield).

Stats (getters and setters)

The following stats each expose a getter and a setter. Getters of type int return the value; setters take a single newVal argument.

GetterSetter
native int battlecore::player.getShield ();native void battlecore::player.setShield (int newVal);
native int battlecore::player.getShieldMax ();native void battlecore::player.setShieldMax (int newVal);
native int battlecore::player.getShieldInitial ();native void battlecore::player.setShieldInitial (int newVal);
native int battlecore::player.getArmour ();native void battlecore::player.setArmour (int newVal);
native int battlecore::player.getArmourMax ();native void battlecore::player.setArmourMax (int newVal);
native int battlecore::player.getArmourInitial ();native void battlecore::player.setArmourInitial (int newVal);
native int battlecore::player.getLives ();native void battlecore::player.setLives (int newVal);
native int battlecore::player.getLivesMax ();native void battlecore::player.setLivesMax (int newVal);
native int battlecore::player.getLivesInitial ();native void battlecore::player.setLivesInitial (int newVal);
native int battlecore::player.getKillCount ();native void battlecore::player.setKillCount (int newVal);
native int battlecore::player.getDeathCount ();native void battlecore::player.setDeathCount (int newVal);
native int battlecore::player.getPoints ();native void battlecore::player.setPoints (int newVal);
native bool battlecore::player.getIsInvulnerable ();native void battlecore::player.setIsInvulnerable (bool newVal);