Server.Mobiles.BaseCreature.CheckFeed C# (CSharp) Method

CheckFeed() public method

public CheckFeed ( Server.Mobile from, Item dropped ) : bool
from Server.Mobile
dropped Item
return bool
        public virtual bool CheckFeed( Mobile from, Item dropped )
        {
            if ( !IsDeadPet && Controlled && (ControlMaster == from || IsPetFriend( from )) && (dropped is Food || dropped is Gold || dropped is CookableFood || dropped is Head || dropped is LeftArm || dropped is LeftLeg || dropped is Torso || dropped is RightArm || dropped is RightLeg) )
            {
                Item f = dropped;

                if ( CheckFoodPreference( f ) )
                {
                    int amount = f.Amount;

                    if ( amount > 0 )
                    {
                        int stamGain;

                        if ( f is Gold )
                            stamGain = amount - 50;
                        else
                            stamGain = (amount * 15) - 50;

                        if ( stamGain > 0 )
                            Stam += stamGain;

                        if ( Core.SE )
                        {
                            if ( m_Loyalty < MaxLoyalty )
                            {
                                m_Loyalty = MaxLoyalty;
                            }
                        }
                        else
                        {
                            for ( int i = 0; i < amount; ++i )
                            {
                                if ( m_Loyalty < MaxLoyalty  && 0.5 >= Utility.RandomDouble() )
                                {
                                    m_Loyalty += 10;
                                }
                            }
                        }

                        /* if ( happier )*/	// looks like in OSI pets say they are happier even if they are at maximum loyalty
                            SayTo( from, 502060 ); // Your pet looks happier.

                        if ( Body.IsAnimal )
                            Animate( 3, 5, 1, true, false, 0 );
                        else if ( Body.IsMonster )
                            Animate( 17, 5, 1, true, false, 0 );

                        if ( IsBondable && !IsBonded )
                        {
                            Mobile master = m_ControlMaster;

                            if ( master != null && master == from )	//So friends can't start the bonding process
                            {
                                if ( m_dMinTameSkill <= 29.1 || master.Skills[SkillName.AnimalTaming].Base >= m_dMinTameSkill || OverrideBondingReqs() || (Core.ML && master.Skills[SkillName.AnimalTaming].Value >= m_dMinTameSkill) )
                                {
                                    if ( BondingBegin == DateTime.MinValue )
                                    {
                                        BondingBegin = DateTime.Now;
                                    }
                                    else if ( (BondingBegin + BondingDelay) <= DateTime.Now )
                                    {
                                        IsBonded = true;
                                        BondingBegin = DateTime.MinValue;
                                        from.SendLocalizedMessage( 1049666 ); // Your pet has bonded with you!
                                    }
                                }
                                else if( Core.ML )
                                {
                                    from.SendLocalizedMessage( 1075268 ); // Your pet cannot form a bond with you until your animal taming ability has risen.
                                }
                            }
                        }

                        dropped.Delete();
                        return true;
                    }
                }
            }

            return false;
        }
BaseCreature