示例#1
0
 public override void Execute(FreneticScript.CommandSystem.CommandQueue queue, CommandEntry entry)
 {
     try
     {
         BooleanTag boolean = BooleanTag.TryFor(entry.GetArgumentObject(queue, 1));
         if (boolean == null)
         {
             queue.HandleError(entry, "Invalid boolean!");
             return;
         }
         PlayerTag player = PlayerTag.For(entry.GetArgument(queue, 0));
         if (player == null)
         {
             queue.HandleError(entry, "Invalid player!");
             return;
         }
         bool       value = boolean.Internal;
         PlayerLife life  = player.Internal.player.life;
         if (life._isBleeding != value)
         {
             life._isBleeding = value;
             if (value)
             {
                 uint sim = life.player.input.simulation;
                 life.lastBleeding = sim;
                 life.lastBleed    = sim;
             }
             life.channel.send("tellBleeding", ESteamCall.OWNER, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
             {
                 life.isBleeding
             });
             entry.Good(queue, "Successfully adjusted the bleeding of player " + TagParser.Escape(player.ToString()) + " to " + TagParser.Escape(boolean.ToString()) + "!");
         }
         else
         {
             entry.Good(queue, "Player " + TagParser.Escape(player.ToString()) + " already has their bleeding set to " + TagParser.Escape(boolean.ToString()) + "!");
         }
     }
     catch (Exception ex) // TODO: Necessity?
     {
         queue.HandleError(entry, "Failed to adjust player's bleeding state: " + ex.ToString());
     }
 }