Server.Items.BasePotion.HasFreeHand C# (CSharp) Méthode

HasFreeHand() public static méthode

public static HasFreeHand ( Server.Mobile m ) : bool
m Server.Mobile
Résultat bool
        public static bool HasFreeHand( Mobile m )
        {
            Item handOne = m.FindItemOnLayer( Layer.OneHanded );
            Item handTwo = m.FindItemOnLayer( Layer.TwoHanded );

            if ( handTwo is BaseWeapon )
                handOne = handTwo;
            if ( handTwo is BaseRanged )
            {
                BaseRanged ranged = (BaseRanged) handTwo;

                if ( ranged.Balanced )
                    return true;
            }

            return ( handOne == null || handTwo == null );
        }

Usage Example

Exemple #1
0
 private static bool CanUseWeapon(PlayerMobile from, INinjaWeapon weapon)
 {
     if (WeaponIsValid(weapon, from))
     {
         if (weapon.UsesRemaining > 0)
         {
             if (!from.NinjaWepCooldown)
             {
                 if (BasePotion.HasFreeHand(from))
                 {
                     return(true);
                 }
                 else
                 {
                     from.SendLocalizedMessage(weapon.NoFreeHandMessage);
                 }
             }
             else
             {
                 from.SendLocalizedMessage(weapon.RecentlyUsedMessage);
             }
         }
         else
         {
             from.SendLocalizedMessage(weapon.EmptyWeaponMessage);
         }
     }
     return(false);
 }
All Usage Examples Of Server.Items.BasePotion::HasFreeHand