Inheritance: Object
Exemplo n.º 1
0
 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));
     }
 }
Exemplo n.º 2
0
 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));
     }
 }
Exemplo n.º 3
0
 public static Player Set(byte Slot, Player P)
 {
     if (Slot < Players.Length)
     {
         P.Slot = Slot;
         Players[Slot] = P;
         return P;
     }
     return null;
 }
Exemplo n.º 4
0
 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;
 }
Exemplo n.º 5
0
 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;
 }