Inheritance: Object
Exemple #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));
     }
 }
Exemple #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));
     }
 }
Exemple #3
0
 public static Player Set(byte Slot, Player P)
 {
     if (Slot < Players.Length)
     {
         P.Slot = Slot;
         Players[Slot] = P;
         return P;
     }
     return null;
 }
Exemple #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;
 }
Exemple #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;
 }