Ejemplo n.º 1
0
 void ClearLegInjury(FallDamage falldamage)
 {
     if (falldamage == null)
     {
         return;
     }
     falldamage.ClearInjury();
 }
Ejemplo n.º 2
0
 void cmdCurePlayer(NetUser netuser, string command, string[] args)
 {
     if (!permission.UserHasPermission(netuser.playerClient.userID.ToString(), "advmetabolism.allowed"))
     {
         SendReply(netuser, GetMessage("NoPermissionCure", netuser.userID.ToString()));
         return;
     }
     else if (args.Length != 1)
     {
         var rootControllable = netuser.playerClient.rootControllable;
         if (!rootControllable)
         {
             return;
         }
         var rootCharacter = rootControllable.rootCharacter;
         if (!rootCharacter)
         {
             return;
         }
         Metabolism metabolism = rootControllable.GetComponent <Metabolism>();
         metabolism.AddCalories(3000);
         float radLevel = metabolism.GetRadLevel();
         metabolism.AddAntiRad(radLevel);
         FallDamage fallDamage = rootControllable.GetComponent <FallDamage>();
         fallDamage.ClearInjury();
         HumanBodyTakeDamage humanBodyTakeDamage = rootControllable.GetComponent <HumanBodyTakeDamage>();
         humanBodyTakeDamage.SetBleedingLevel(0);
         SendReply(netuser, GetMessage("CureSelf", netuser.userID.ToString()));
         return;
     }
     else
     {
         NetUser targetuser = rust.FindPlayer(args[0]);
         if (targetuser != null)
         {
             var rootControllable = netuser.playerClient.rootControllable;
             if (!rootControllable)
             {
                 return;
             }
             var rootCharacter = rootControllable.rootCharacter;
             if (!rootCharacter)
             {
                 return;
             }
             Metabolism metabolism = rootControllable.GetComponent <Metabolism>();
             metabolism.AddCalories(3000);
             float radLevel = metabolism.GetRadLevel();
             metabolism.AddAntiRad(radLevel);
             FallDamage fallDamage = rootControllable.GetComponent <FallDamage>();
             fallDamage.ClearInjury();
             HumanBodyTakeDamage humanBodyTakeDamage = rootControllable.GetComponent <HumanBodyTakeDamage>();
             humanBodyTakeDamage.SetBleedingLevel(0);
             SendReply(netuser, GetMessage("CureTargetReply", netuser.userID.ToString()) + targetuser.displayName);
             SendReply(targetuser, GetMessage("CureTargetMessage", netuser.userID.ToString()) + netuser.displayName);
         }
     }
 }
Ejemplo n.º 3
0
 public void Cancel()
 {
     if (_player.IsOnline)
     {
         if (BrokenLegs)
         {
             _fd.ClearInjury();
         }
         if (Bleeding)
         {
             _player.HumanBodyTakeDmg.SetBleedingLevel(0f);
         }
     }
 }
Ejemplo n.º 4
0
        public static bool IsFriend(HurtEvent e) // ref
        {
            GodModeCommand command = (GodModeCommand)ChatCommand.GetCommand("god");

            Fougerite.Player victim = e.Victim as Fougerite.Player;
            if (victim != null)
            {
                if (command.IsOn(victim.UID))
                {
                    FallDamage dmg = victim.FallDamage;
                    if (dmg != null)
                    {
                        dmg.ClearInjury();
                    }
                    return(true);
                }
                Fougerite.Player attacker = e.Attacker as Fougerite.Player;
                if (attacker != null)
                {
                    FriendsCommand command2 = (FriendsCommand)ChatCommand.GetCommand("amigos");
                    if (command2.ContainsException(attacker.UID) && command2.ContainsException(victim.UID))
                    {
                        return(false);
                    }
                    bool b = Core.config.GetBoolSetting("Settings", "friendly_fire");
                    try
                    {
                        FriendList list = (FriendList)command2.GetFriendsLists()[attacker.UID];
                        if (list == null || b)
                        {
                            return(false);
                        }
                        return(list.isFriendWith(victim.UID));
                    }
                    catch
                    {
                        return(false);
                    }
                }
            }
            return(false);
        }