public void Respawn(Vector2 Position) { Killer = null; Health = 1000; Dead = false; this.Position = Position; bool T = Collides; InterpolatedPosition = this.Position; if (this == Self) { if (MultiPlayer.Type() == MultiPlayer.Types.Client) MultiPlayer.Send(MultiPlayer.Construct(Packets.Respawn, Position)); else if (MultiPlayer.Type() == MultiPlayer.Types.Server) MultiPlayer.Send(MultiPlayer.Construct(Packets.Respawn, Slot, Position)); } }
public void Die() { if ((this == Self) && (Killer == null)) Killer = Self; if (Killer != null) { Killer.Kills++; } Game.RoundEndWait = 1; Deaths++; Dead = true; RespawnTimer = Game.RespawnTimer; if (this == Self) { if (MultiPlayer.Type() == MultiPlayer.Types.Client) MultiPlayer.Send(MultiPlayer.Construct(Packets.Death, Killer.Slot)); else if (MultiPlayer.Type() == MultiPlayer.Types.Server) MultiPlayer.Send(MultiPlayer.Construct(Packets.Death, Slot, Killer.Slot)); } }
public static Player Set(byte Slot, Player P) { if (Slot < Players.Length) { P.Slot = Slot; Players[Slot] = P; return P; } return null; }
public static bool Remove(Player P) { for (byte i = 0; i < Players.Length; i++) if (Players[i] == P) { Players[i] = null; return true; } return false; }
public static Player Add(Player P) { for (byte i = 0; i < Players.Length; i++) if (Players[i] == null) { P.Slot = i; Players[i] = P; return P; } return null; }