private void OnCollisionEnter(Collision other)
    {
        if (!isInit)
        {
            return;
        }

        Rigidbody myBody = GetComponent <Rigidbody>();

        if (myBody != null)
        {
            myBody.constraints = RigidbodyConstraints.FreezeAll;
        }

        // TODO: Make more dynamic
        if (other.collider.tag != "Weapon" && other.collider.tag != "Player")
        {
            BaseAnimal animal = other.collider.transform.root.GetComponent <BaseAnimal>();
            if (animal != null)
            {
                if (other.collider.name.Contains("leg"))
                {
                    animal.Hit(.8f);
                }
                else
                {
                    animal.Hit(3f);
                }
                transform.SetParent(other.collider.transform);
                transform.GetComponent <Collider>().enabled = false;
            }
            isInit = false;
        }
    }
 protected override void OnTarget(Mobile from, object targ)
 {
     if (targ is BaseAnimal)
     {
         BaseAnimal ba = (BaseAnimal)targ;
         if (ba.Owner == from)
         {
             if (from.Followers + ba.ControlSlots <= from.FollowersMax)
             {
                 ba.Controlled    = true;
                 ba.ControlMaster = from;
                 ba.ControlTarget = from;
                 ba.ControlOrder  = OrderType.Follow;
                 from.SendMessage("You claim your animal.");
             }
             else
             {
                 from.SendMessage("You have too many followers!");
             }
             from.SendGump(new RanchStoneGump(t_rs));
         }
         else
         {
             from.SendMessage("You don't own that.");
             from.SendGump(new RanchStoneGump(t_rs));
         }
     }
     else
     {
         from.SendMessage("You can't claim that.");
         from.SendGump(new RanchStoneGump(t_rs));
     }
 }
    public void SpawnPreyAnimal(string animalID, Vector3 worldLocation)
    {
        // Spawn one animal
        BaseAnimal tmpAnimal = (BaseAnimal)_gameItemDatabase.CreateItemInstance(animalID, worldLocation, Quaternion.identity);

        animals.Add(tmpAnimal);
    }
 protected override void OnTarget(Mobile from, object targ)
 {
     if (targ is BaseAnimal)
     {
         BaseAnimal ba = (BaseAnimal)targ;
         if ((ba.ControlMaster == from && ba.Owner == null) || ba.Owner == from)
         {
             ba.Owner = t_bi.ranchstone.Owner;
             ba.Brand = t_bi.ranchstone.Ranch;
             from.PlaySound(0x3B5);
             ba.PlaySound(ba.GetHurtSound());
             from.SendMessage("Animal branded!");
             ba.InvalidateProperties();
             t_bi.Hot = Utility.RandomBool();                         //false;
             if (!t_bi.Hot)
             {
                 from.SendMessage("The branding iron cools.");
             }
         }
         else
         {
             from.SendMessage("You don't own that animal.");
         }
     }
     else
     {
         from.SendMessage("You can't brand that.");
     }
 }
Exemple #5
0
        // BaseAnimal.OnAttacked()
        public static void NPCHurt(BaseAnimal animal, HitInfo info)
        {
            // works
            var npc = new NPC(animal);

            if (info.Initiator != null)
            {
                Player      p     = new Player(info.Initiator as BasePlayer);
                PlayerStats stats = new PlayerStats(p.SteamID);
                stats.AddDamageTo(info.damageAmount, false, true, false);
                p.Stats = stats;
            }

            if (!Realm.Server() || (double)animal.myHealth <= 0.0)
            {
                return;
            }

            if ((animal.myHealth - info.damageAmount) > 0.0f)
            {
                OnNPCHurt.OnNext(new Events.NPCHurtEvent(npc, info));
            }

            animal.myHealth -= info.damageAmount;
            if ((double)animal.myHealth > 0.0)
            {
                return;
            }
            animal.Die(info);
        }
    public static PooType StronglyTypedExcrement <PooType>(this IPooProvider <PooType> iPooProvider)
        where PooType : Poo
    {
        BaseAnimal animal = (BaseAnimal)iPooProvider;

        return((PooType)animal.Excrement);
    }
Exemple #7
0
 public DrinkingWater(Water water, float consumingRate, NavMeshAgent agent, BaseAnimal animal)
 {
     this.water         = water;
     this.consumingRate = consumingRate;
     this.agent         = agent;
     this.animal        = animal;
 }
Exemple #8
0
 public void Eaten(float consumingRate, BaseAnimal consumer)
 {
     this.consumeRate += consumingRate;
     beingEaten        = true;
     if (!eaters.ContainsKey(consumer))
     {
         eaters.Add(consumer, consumingRate);
     }
 }
Exemple #9
0
 public SearchForWater(LayerMask searchLayer, BaseAnimal animal, float searchRadius,
                       string tagToLookFor, NavMeshAgent agent, float waterConsumingRate)
 {
     this.searchLayer        = searchLayer;
     this.animal             = animal;
     this.searchRadius       = searchRadius;
     this.tagToLookFor       = tagToLookFor;
     this.agent              = agent;
     this.waterConsumingRate = waterConsumingRate;
 }
Exemple #10
0
 public Resting(BaseAnimal animal, NavMeshAgent agent)
 {
     this.animal = animal;
     this.agent  = agent;
     anim        = agent.gameObject.GetComponent <Animation>();
     if (anim != null)
     {
         anim[animationStr].wrapMode = WrapMode.Loop;
     }
 }
Exemple #11
0
    //private StateMachine microManager;


    public SearchForResource(LayerMask searchLayer1, LayerMask searchLayer2, BaseAnimal animal, float searchRadius,
                             NavMeshAgent agent, float foodConsumingRate, float waterConsumingRate)
    {
        this.searchLayer1       = searchLayer1;
        this.searchLayer2       = searchLayer2; // use an array
        this.animal             = animal;
        this.searchRadius       = searchRadius;
        this.agent              = agent;
        this.foodConsumingRate  = foodConsumingRate;
        this.waterConsumingRate = waterConsumingRate;
    }
    public static PooType StronglyTypedExcrement <PooType>(
        this IPooProvider <PooType> iPooProvider)
        where PooType : Poo
    {
        BaseAnimal animal = iPooProvider as BaseAnimal;

        if (null == animal)
        {
            throw new InvalidArgumentException("iPooProvider must be a BaseAnimal.");
        }
        return((PooType)animal.Excrement);
    }
    public EatingFood(Food food, float consumingRate, NavMeshAgent agent, BaseAnimal animal)
    {
        this.food          = food;
        this.consumingRate = consumingRate;
        this.agent         = agent;
        this.animal        = animal;

        if (anim != null)
        {
            anim[animationStr].wrapMode = WrapMode.Loop;
        }
    }
Exemple #14
0
    public WanderAround(NavMeshAgent agent, float speed, BaseAnimal animal)
    {
        this.agent  = agent;
        this.speed  = speed;
        anim        = agent.gameObject.GetComponent <Animation>();
        this.animal = animal;
        if (anim != null)
        {
            anim[animationStr].wrapMode = WrapMode.Loop;
        }

        playerTransform = GameObject.Find("Player (Vive)").transform;
    }
Exemple #15
0
        public virtual bool FleeCheck()
        {
            BaseAnimal ba = (BaseAnimal)m_Mobile;

            if (ba.Predator != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #16
0
        // BaseAnimal.Die()
        public static void NPCDied(BaseAnimal animal, HitInfo info)
        {
            if (info.Initiator != null)
            {
                Player      p     = new Player(info.Initiator as BasePlayer);
                PlayerStats stats = new PlayerStats(p.SteamID);
                stats.AddKill(false, true);
                p.Stats = stats;
            }

            var npc = new NPC(animal);

            OnNPCDied.OnNext(new Events.NPCDeathEvent(npc, info));
        }
Exemple #17
0
        public static void EventSink_Movement(MovementEventArgs e)
        {
            Mobile from = e.Mobile;

            //if (from.Mounted || !from.Alive || from.AccessLevel >= AccessLevel.GameMaster) return;
            //else from.Stam -= GetStamLoss(from, (e.Direction & Direction.Running) != 0);

            if (from is BaseAnimal)
            {
                BaseAnimal ba = (BaseAnimal)from;
                ba.Stam -= GetStamLoss(from, (e.Direction & Direction.Running) != 0);
            }

            return;
        }
 public override void OnDoubleClick(Mobile from)
 {
     if (from.InRange(this.GetWorldLocation(), 1))
     {
         if (m_Owner != null)
         {
             if (m_HasEggs > 0)
             {
                 if (m_Owner is BaseAnimal)
                 {
                     BaseAnimal ba = (BaseAnimal)m_Owner;
                     if (ba.Owner != from && ba.Owner != null)
                     {
                         ba.Combatant = from;
                     }
                     if (ba.IsPregnant)
                     {
                         ba.IsPregnant = false;
                     }
                 }
                 Eggs egg = new Eggs();
                 from.AddToBackpack(egg);
                 m_HasEggs -= 1;
                 InvalidateProperties();
                 from.SendMessage("You take an egg from the nest.");
                 if (m_HasEggs < 1)
                 {
                     ItemID = 6869;
                 }
             }
             else
             {
                 from.SendMessage("The nest is empty.");
                 ItemID = 6869;
             }
         }
         else
         {
             Movable = true;
             m_Owner = from;
             from.SendMessage("You free the nest.");
         }
     }
     else
     {
         from.SendMessage("You are too far away!");
     }
 }
 public SearchForFood(LayerMask searchLayer, BaseAnimal animal, float searchRadius,
                      string tagToLookFor, NavMeshAgent agent, float foodConsumingRate)
 {
     this.searchLayer       = searchLayer;
     this.animal            = animal;
     this.searchRadius      = searchRadius;
     this.tagToLookFor      = tagToLookFor;
     this.agent             = agent;
     this.foodConsumingRate = foodConsumingRate;
     anim = agent.gameObject.GetComponent <Animation>();
     if (anim != null)
     {
         //Debug.Log("set searching to loop");
         anim[animationStr].wrapMode = WrapMode.Loop;
     }
 }
Exemple #20
0
        public void Run(Direction d)
        {
            if ((m_Mobile.Spell != null && m_Mobile.Spell.IsCasting) || m_Mobile.Paralyzed || m_Mobile.Frozen || m_Mobile.DisallowAllMoves)
            {
                return;
            }

            //m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;

            if (IsIndependant())
            {
                BaseAnimal ba = (BaseAnimal)m_Mobile;
                //Smaller critters should run a bit faster at first. And all animals will slow down when Stam gets low.
                // Don't know if 25 is a good size or not but I needed a number,
                //add I don't know if the speeds are good but it's a start.
                if (ba.Size < 25)
                {
                    if (ba.Stam < (ba.StamMax / 4))
                    {
                        ba.CurrentSpeed = ba.PassiveSpeed;
                    }
                    else
                    {
                        ba.CurrentSpeed = (ba.ActiveSpeed + .1);
                    }
                }
                else
                {
                    if (ba.Stam < (ba.StamMax / 4))
                    {
                        ba.CurrentSpeed = ba.PassiveSpeed;
                    }
                    else
                    {
                        ba.CurrentSpeed = ba.ActiveSpeed;
                    }
                }
            }
            else
            {
                m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed;
            }

            m_Mobile.Direction = d | Direction.Running;
            DoMove(m_Mobile.Direction, true);
        }
Exemple #21
0
        public virtual bool DamageCheck()
        {
            double     hitPercent = (double)m_Mobile.Hits / m_Mobile.HitsMax;
            BaseAnimal ba         = (BaseAnimal)m_Mobile;

            if ((ba.Eats == EatType.Herbivore) && (hitPercent < 0.80))
            {
                return(true);
            }
            else if ((ba.Eats != EatType.Herbivore) && (hitPercent < 0.25))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #22
0
        public override bool DoActionWander()
        {
            BaseAnimal ba = (BaseAnimal)m_Mobile;

            if (IsIndependant())
            {
                if (FleeCheck() || DamageCheck())
                {
                    Action = ActionType.Flee;
                    return(true);
                }
                else if (ba.Combatant != null && m_Mobile.Hits < m_Mobile.HitsMax)
                {
                    m_Mobile.DebugSay("I am hurt or being attacked, I kill him");
                    Action = ActionType.Combat;
                }
                else
                {
                    base.DoActionWander();
                    //m_Mobile.DebugSay("Wandering");
                }
                return(true);
            }
            else if (ba.Combatant != null && m_Mobile.Hits < m_Mobile.HitsMax)
            {
                m_Mobile.DebugSay("I am hurt or being attacked, I kill him");
                Action = ActionType.Combat;
            }

            /*
             * else if (AcquireFocusMob( m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true ) )
             * {
             *      m_Mobile.DebugSay( "I have detected {0}, attacking", m_Mobile.FocusMob.Name );
             *      m_Mobile.Combatant = m_Mobile.FocusMob;
             *      Action = ActionType.Combat;
             * }
             */
            else
            {
                base.DoActionWander();
                m_Mobile.DebugSay("Wandering");
            }
            return(true);
        }
Exemple #23
0
 public override void Consumed(BaseAnimal animal)
 {
     if (this.foodLeft > 0)
     {
         float update = Time.deltaTime * eaters[animal];
         this.foodLeft -= update;
         animal.UpdateThirstLevel(update);
         Debug.Log(this.foodLeft);
     }
     else
     {
         Debug.Log("food ran out");
         animal.SwitchToPreviousState();
         if (eaters.Count == 0)
         {
             Destroy(this.gameObject);
         }
     }
 }
 public override void OnDoubleClick(Mobile from)
 {
     if (from.InRange(GetWorldLocation(), 2))
     {
         if (m_Owner != null)
         {
             BaseAnimal ba = (BaseAnimal)m_Owner;
             ba.PlaySound(ba.GetAngerSound());
             ba.Awake();
         }
         else
         {
             from.SendMessage("That animal won't wake up...oops!!");
             Delete();
         }
     }
     else
     {
         from.SendMessage("You can't reach that!");
     }
 }
 protected override void OnTarget(Mobile from, object targ)
 {
     if (targ is BaseAnimal)
     {
         BaseAnimal ba = (BaseAnimal)targ;
         if (ba.Owner == from)
         {
             from.SendMessage("Target player to transfer to.");
             from.Target = new TransferToTarget(ba, t_rs);
         }
         else
         {
             from.SendMessage("You don't own that.");
             from.SendGump(new RanchStoneGump(t_rs));
         }
     }
     else
     {
         from.SendMessage("You can't claim that.");
         from.SendGump(new RanchStoneGump(t_rs));
     }
 }
Exemple #26
0
    // Use this for initialization
    void Start()
    {
        LGrabbingHandRef   = GameObject.FindGameObjectWithTag("leftHand");
        RGrabbingHandRef   = GameObject.FindGameObjectWithTag("rightHand");
        animalComponentRef = GetComponent <BaseAnimal>();

        foreach (Transform child in transform)
        {
            if (child.CompareTag("particle_hearts"))
            {
                HeartParticleObject = child.gameObject;
                break;
            }
        }

        foreach (Transform child in transform)
        {
            if (child.CompareTag("particle_injure"))
            {
                InjureParticleObject = child.gameObject;
                break;
            }
        }
    }
Exemple #27
0
 public virtual void Consumed(BaseAnimal animal)
 {
 }
Exemple #28
0
 public void StopEating(BaseAnimal consumer)
 {
     //this.consumeRate -= eaters[consumer];
     eaters.Remove(consumer);
     beingEaten = (eaters.Count > 0);
 }
        //RUFO endfunction


        public void EndPetSale(Mobile from, BaseCreature pet)
        {
            if (Deleted || !from.CheckAlive())
            {
                return;
            }

            if (pet is BaseAnimal)
            {
                BaseAnimal ba = (BaseAnimal)pet;
                if (from != ba.Owner && ba.Owner != null)
                {
                    SayTo(from, 1042562);
                    return;
                }
                else if ((ba.Owner == null) && (!pet.Controlled || pet.ControlMaster != from))
                {
                    SayTo(from, 1042562);
                    return;
                }
            }
            else if (!pet.Controlled || pet.ControlMaster != from)
            {
                SayTo(from, 1042562);                   // You do not own that pet!
                return;
            }

            if (pet.IsDeadPet)
            {
                SayTo(from, 1049668);                                // Living pets only, please.
            }
            else if (pet.Summoned)
            {
                SayTo(from, "That is a summoned creature!");
            }
            else if (pet.Body.IsHuman)
            {
                SayTo(from, 502672);                                        // HA HA HA! Sorry, I am not an inn.
            }
            else if ((pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0))
            {
                SayTo(from, 1042563);                                                                                                                                         // You need to unload your pet.
            }
            else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map)
            {
                SayTo(from, 1042564);                                                                                                                 // I'm sorry.  Your pet seems to be busy.
            }
            else
            {
                if (pet is FarmChicken)
                {
                    FarmChicken ba        = (FarmChicken)pet;
                    double      sellbonus = 0;
                    if (ba.MotherBreed == ChickenBreed.Leghorn || ba.FatherBreed == ChickenBreed.Leghorn)
                    {
                        sellbonus += (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.MotherBreed == ChickenBreed.Barnevelder || ba.FatherBreed == ChickenBreed.Barnevelder)
                    {
                        sellbonus += (ba.IsPurebred() ? 4.0 : 2.0);
                    }
                    if (ba.MotherBreed == ChickenBreed.Orpington || ba.FatherBreed == ChickenBreed.Orpington)
                    {
                        sellbonus += (ba.IsPurebred() ? 2.0 : 1.0);
                    }
                    if (ba.MotherBreed == ChickenBreed.Poltava || ba.FatherBreed == ChickenBreed.Poltava)
                    {
                        sellbonus += (ba.IsPurebred() ? 2.0 : 1.0);
                    }
                    if (ba.MotherBreed == ChickenBreed.Bresse || ba.FatherBreed == ChickenBreed.Bresse)
                    {
                        sellbonus += (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.MotherBreed == ChickenBreed.Braekel || ba.FatherBreed == ChickenBreed.Braekel)
                    {
                        sellbonus += (ba.IsPurebred() ? 3.0 : 1.5);
                    }
                    if (ba.Age == AgeDescription.Baby)
                    {
                        sellbonus += 1.0;
                    }
                    else if (ba.Age == AgeDescription.Young)
                    {
                        sellbonus += 4.0;
                    }
                    else if (ba.Age == AgeDescription.Adult)
                    {
                        sellbonus += 6.0;
                    }
                    else if (ba.Age == AgeDescription.Senior)
                    {
                        sellbonus -= 10.0;
                    }
                    sellbonus += (ba.Female? 10:0);
                    SellPetForGold(from, pet, 15 + (int)sellbonus);
                }
                else if (pet is PackHorse)
                {
                    SellPetForGold(from, pet, 303);
                }
                else if (pet is Rabbit)
                {
                    SellPetForGold(from, pet, 39);
                }
                else if (pet is PackLlama)
                {
                    SellPetForGold(from, pet, 245);
                }
                else if (pet is Dog)
                {
                    SellPetForGold(from, pet, 90);
                }
                else if (pet is Cat)
                {
                    SellPetForGold(from, pet, 69);
                }
                else if (pet is Pig)
                {
                    FarmPig ba        = (FarmPig)pet;
                    double  sellbonus = 0;
                    if (ba.MotherBreed == PigBreed.Duroc || ba.FatherBreed == PigBreed.Duroc)
                    {
                        sellbonus += (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.MotherBreed == PigBreed.Iberian || ba.FatherBreed == PigBreed.Iberian)
                    {
                        sellbonus += (ba.IsPurebred() ? 4.0 : 2.0);
                    }
                    if (ba.MotherBreed == PigBreed.Tamworth || ba.FatherBreed == PigBreed.Tamworth)
                    {
                        sellbonus += (ba.IsPurebred() ? 2.0 : 1.0);
                    }
                    if (ba.MotherBreed == PigBreed.White || ba.FatherBreed == PigBreed.White)
                    {
                        sellbonus += (ba.IsPurebred() ? 2.0 : 1.0);
                    }
                    if (ba.MotherBreed == PigBreed.Feral || ba.FatherBreed == PigBreed.Feral)
                    {
                        sellbonus -= (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.Age == AgeDescription.Baby)
                    {
                        sellbonus += 5.0;
                    }
                    else if (ba.Age == AgeDescription.Young)
                    {
                        sellbonus += 10.0;
                    }
                    else if (ba.Age == AgeDescription.Adult)
                    {
                        sellbonus += 15.0;
                    }
                    else if (ba.Age == AgeDescription.Senior)
                    {
                        sellbonus -= 20.0;
                    }
                    sellbonus += (ba.Female? 10:0);
                    SellPetForGold(from, pet, 40 + (int)sellbonus);
                }
                else if (pet is WildBoar)
                {
                    WildBoar ba        = (WildBoar)pet;
                    double   sellbonus = 0;
                    if (ba.MotherBreed == PigBreed.Duroc || ba.FatherBreed == PigBreed.Duroc)
                    {
                        sellbonus += (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.MotherBreed == PigBreed.Iberian || ba.FatherBreed == PigBreed.Iberian)
                    {
                        sellbonus += (ba.IsPurebred() ? 4.0 : 2.0);
                    }
                    if (ba.MotherBreed == PigBreed.Tamworth || ba.FatherBreed == PigBreed.Tamworth)
                    {
                        sellbonus += (ba.IsPurebred() ? 2.0 : 1.0);
                    }
                    if (ba.MotherBreed == PigBreed.White || ba.FatherBreed == PigBreed.White)
                    {
                        sellbonus += (ba.IsPurebred() ? 2.0 : 1.0);
                    }
                    if (ba.MotherBreed == PigBreed.Feral || ba.FatherBreed == PigBreed.Feral)
                    {
                        sellbonus -= (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.Age == AgeDescription.Baby)
                    {
                        sellbonus += 5.0;
                    }
                    else if (ba.Age == AgeDescription.Young)
                    {
                        sellbonus += 10.0;
                    }
                    else if (ba.Age == AgeDescription.Adult)
                    {
                        sellbonus += 15.0;
                    }
                    else if (ba.Age == AgeDescription.Senior)
                    {
                        sellbonus -= 20.0;
                    }
                    sellbonus += (ba.Female? 10:0);
                    SellPetForGold(from, pet, 40 + (int)sellbonus);
                }
                else if (pet is Horse)
                {
                    SellPetForGold(from, pet, 250);
                }
                else if (pet is WildHorse)
                {
                    WildHorse ba        = (WildHorse)pet;
                    double    sellbonus = 0;
                    if (ba.MotherBreed == HorseBreed.Andalusian || ba.FatherBreed == HorseBreed.Andalusian)
                    {
                        sellbonus += (ba.IsPurebred() ? 10.0 : 5.0);
                    }
                    if (ba.MotherBreed == HorseBreed.Arabian || ba.FatherBreed == HorseBreed.Arabian)
                    {
                        sellbonus += (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.MotherBreed == HorseBreed.Appaloosa || ba.FatherBreed == HorseBreed.Appaloosa)
                    {
                        sellbonus += (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.MotherBreed == HorseBreed.Haflinger || ba.FatherBreed == HorseBreed.Haflinger)
                    {
                        sellbonus += (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.MotherBreed == HorseBreed.Thoroughbred || ba.FatherBreed == HorseBreed.Thoroughbred)
                    {
                        sellbonus += (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.MotherBreed == HorseBreed.Hackney || ba.FatherBreed == HorseBreed.Hackney)
                    {
                        sellbonus += (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.Age == AgeDescription.Baby)
                    {
                        sellbonus += 5.0;
                    }
                    else if (ba.Age == AgeDescription.Young)
                    {
                        sellbonus += 10.0;
                    }
                    else if (ba.Age == AgeDescription.Adult)
                    {
                        sellbonus += 15.0;
                    }
                    else if (ba.Age == AgeDescription.Senior)
                    {
                        sellbonus -= 20.0;
                    }
                    sellbonus += (ba.Female? 10:0);
                    SellPetForGold(from, pet, 50 + (int)sellbonus);
                }
                else if (pet is ForestOstard)
                {
                    SellPetForGold(from, pet, 301);
                }
                else if (pet is Cow)
                {
                    FarmCow ba        = (FarmCow)pet;
                    double  sellbonus = 0;
                    if (ba.MotherBreed == CowBreed.Holstein || ba.FatherBreed == CowBreed.Holstein)
                    {
                        sellbonus += (ba.IsPurebred() ? 10.0 : 5.0);
                    }
                    if (ba.MotherBreed == CowBreed.Guernsey || ba.FatherBreed == CowBreed.Guernsey)
                    {
                        sellbonus += (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.MotherBreed == CowBreed.Hereford || ba.FatherBreed == CowBreed.Hereford)
                    {
                        sellbonus += (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.MotherBreed == CowBreed.Angus || ba.FatherBreed == CowBreed.Angus)
                    {
                        sellbonus += (ba.IsPurebred() ? 10.0 : 5.0);
                    }
                    if (ba.MotherBreed == CowBreed.Gloucester || ba.FatherBreed == CowBreed.Gloucester)
                    {
                        sellbonus += (ba.IsPurebred() ? 3.0 : 1.5);
                    }
                    if (ba.MotherBreed == CowBreed.Montbeliarde || ba.FatherBreed == CowBreed.Montbeliarde)
                    {
                        sellbonus += (ba.IsPurebred() ? 3.0 : 1.5);
                    }
                    if (ba.MotherBreed == CowBreed.Corriente || ba.FatherBreed == CowBreed.Corriente)
                    {
                        sellbonus += (ba.IsPurebred() ? 4.0 : 2.0);
                    }
                    if (ba.MotherBreed == CowBreed.ToroBravo || ba.FatherBreed == CowBreed.ToroBravo)
                    {
                        sellbonus += (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.Age == AgeDescription.Baby)
                    {
                        sellbonus += 5.0;
                    }
                    else if (ba.Age == AgeDescription.Young)
                    {
                        sellbonus += 10.0;
                    }
                    else if (ba.Age == AgeDescription.Adult)
                    {
                        sellbonus += 15.0;
                    }
                    else if (ba.Age == AgeDescription.Senior)
                    {
                        sellbonus -= 20.0;
                    }
                    sellbonus += (ba.Female? 10:0);
                    SellPetForGold(from, pet, 70 + (int)sellbonus);
                }
                else if (pet is FarmBull)
                {
                    FarmBull ba        = (FarmBull)pet;
                    double   sellbonus = 0;
                    if (ba.MotherBreed == CowBreed.Holstein || ba.FatherBreed == CowBreed.Holstein)
                    {
                        sellbonus += (ba.IsPurebred() ? 10.0 : 5.0);
                    }
                    if (ba.MotherBreed == CowBreed.Guernsey || ba.FatherBreed == CowBreed.Guernsey)
                    {
                        sellbonus += (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.MotherBreed == CowBreed.Hereford || ba.FatherBreed == CowBreed.Hereford)
                    {
                        sellbonus += (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.MotherBreed == CowBreed.Angus || ba.FatherBreed == CowBreed.Angus)
                    {
                        sellbonus += (ba.IsPurebred() ? 10.0 : 5.0);
                    }
                    if (ba.MotherBreed == CowBreed.Gloucester || ba.FatherBreed == CowBreed.Gloucester)
                    {
                        sellbonus += (ba.IsPurebred() ? 3.0 : 1.5);
                    }
                    if (ba.MotherBreed == CowBreed.Montbeliarde || ba.FatherBreed == CowBreed.Montbeliarde)
                    {
                        sellbonus += (ba.IsPurebred() ? 3.0 : 1.5);
                    }
                    if (ba.MotherBreed == CowBreed.Corriente || ba.FatherBreed == CowBreed.Corriente)
                    {
                        sellbonus += (ba.IsPurebred() ? 4.0 : 2.0);
                    }
                    if (ba.MotherBreed == CowBreed.ToroBravo || ba.FatherBreed == CowBreed.ToroBravo)
                    {
                        sellbonus += (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.Age == AgeDescription.Baby)
                    {
                        sellbonus += 5.0;
                    }
                    else if (ba.Age == AgeDescription.Young)
                    {
                        sellbonus += 10.0;
                    }
                    else if (ba.Age == AgeDescription.Adult)
                    {
                        sellbonus += 15.0;
                    }
                    else if (ba.Age == AgeDescription.Senior)
                    {
                        sellbonus -= 20.0;
                    }
                    sellbonus += (ba.Female? 10:0);
                    SellPetForGold(from, pet, 100 + (int)sellbonus);
                }
                else if (pet is Hind)
                {
                    SellPetForGold(from, pet, 75);
                }
                else if (pet is GreatHart)
                {
                    SellPetForGold(from, pet, 200);
                }
                else if (pet is Eagle)
                {
                    SellPetForGold(from, pet, 201);
                }
                else if (pet is Sheep)
                {
                    FarmSheep ba        = (FarmSheep)pet;
                    double    sellbonus = 0;
                    if (ba.MotherBreed == SheepBreed.Cormo || ba.FatherBreed == SheepBreed.Cormo)
                    {
                        sellbonus += (ba.IsPurebred() ? 8.0 : 4.0);
                    }
                    if (ba.MotherBreed == SheepBreed.Cotswold || ba.FatherBreed == SheepBreed.Cotswold)
                    {
                        sellbonus += (ba.IsPurebred() ? 7.0 : 3.5);
                    }
                    if (ba.MotherBreed == SheepBreed.Swaledale || ba.FatherBreed == SheepBreed.Swaledale)
                    {
                        sellbonus += (ba.IsPurebred() ? 6.0 : 3.0);
                    }
                    if (ba.MotherBreed == SheepBreed.Coopworth || ba.FatherBreed == SheepBreed.Coopworth)
                    {
                        sellbonus += (ba.IsPurebred() ? 5.0 : 2.0);
                    }
                    if (ba.MotherBreed == SheepBreed.Racka || ba.FatherBreed == SheepBreed.Racka)
                    {
                        sellbonus += (ba.IsPurebred() ? 10.0 : 5.0);
                    }
                    if (ba.MotherBreed == SheepBreed.Latxa || ba.FatherBreed == SheepBreed.Latxa)
                    {
                        sellbonus += (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.MotherBreed == SheepBreed.Awassi || ba.FatherBreed == SheepBreed.Awassi)
                    {
                        sellbonus += (ba.IsPurebred() ? 4.0 : 2.0);
                    }
                    if (ba.Age == AgeDescription.Baby)
                    {
                        sellbonus += 2.0;
                    }
                    else if (ba.Age == AgeDescription.Young)
                    {
                        sellbonus += 5.0;
                    }
                    else if (ba.Age == AgeDescription.Adult)
                    {
                        sellbonus += 10.0;
                    }
                    else if (ba.Age == AgeDescription.Senior)
                    {
                        sellbonus -= 20.0;
                    }
                    sellbonus += (ba.Female? 10:0);
                    SellPetForGold(from, pet, 60 + (int)sellbonus);
                }
                else if (pet is FarmGoat)
                {
                    FarmGoat ba        = (FarmGoat)pet;
                    double   sellbonus = 0;
                    if (ba.MotherBreed == GoatBreed.Pyrenean || ba.FatherBreed == GoatBreed.Pyrenean)
                    {
                        sellbonus += (ba.IsPurebred() ? 8.0 : 4.0);
                    }
                    if (ba.MotherBreed == GoatBreed.Saanen || ba.FatherBreed == GoatBreed.Saanen)
                    {
                        sellbonus += (ba.IsPurebred() ? 7.0 : 3.5);
                    }
                    if (ba.MotherBreed == GoatBreed.Angora || ba.FatherBreed == GoatBreed.Angora)
                    {
                        sellbonus += (ba.IsPurebred() ? 10.0 : 5.0);
                    }
                    if (ba.MotherBreed == GoatBreed.Cashmere || ba.FatherBreed == GoatBreed.Cashmere)
                    {
                        sellbonus += (ba.IsPurebred() ? 12.0 : 6.0);
                    }
                    if (ba.MotherBreed == GoatBreed.Boer || ba.FatherBreed == GoatBreed.Boer)
                    {
                        sellbonus += (ba.IsPurebred() ? 5.0 : 2.5);
                    }
                    if (ba.MotherBreed == GoatBreed.Stiefelgeiss || ba.FatherBreed == GoatBreed.Stiefelgeiss)
                    {
                        sellbonus += (ba.IsPurebred() ? 4.0 : 2.0);
                    }
                    if (ba.Age == AgeDescription.Baby)
                    {
                        sellbonus += 2.0;
                    }
                    else if (ba.Age == AgeDescription.Young)
                    {
                        sellbonus += 5.0;
                    }
                    else if (ba.Age == AgeDescription.Adult)
                    {
                        sellbonus += 10.0;
                    }
                    else if (ba.Age == AgeDescription.Senior)
                    {
                        sellbonus -= 20.0;
                    }
                    sellbonus += (ba.Female? 10:0);
                    SellPetForGold(from, pet, 60 + (int)sellbonus);
                }
                else if (pet is BlackBear)
                {
                    SellPetForGold(from, pet, 317);
                }
                else if (pet is Bird)
                {
                    SellPetForGold(from, pet, 25);
                }
                else if (pet is TimberWolf)
                {
                    SellPetForGold(from, pet, 384);
                }
                else if (pet is GreyWolf)
                {
                    SellPetForGold(from, pet, 384);
                }
                else if (pet is DireWolf)
                {
                    SellPetForGold(from, pet, 384);
                }
                else if (pet is BlackBear)
                {
                    SellPetForGold(from, pet, 210);
                }
                else if (pet is Panther)
                {
                    SellPetForGold(from, pet, 635);
                }
                else if (pet is Cougar)
                {
                    SellPetForGold(from, pet, 635);
                }
                else if (pet is BrownBear)
                {
                    SellPetForGold(from, pet, 427);
                }
                else if (pet is GrizzlyBear)
                {
                    SellPetForGold(from, pet, 883);
                }
                else if (pet is Rat)
                {
                    SellPetForGold(from, pet, 53);
                }
                else if (pet is RidableLlama)
                {
                    SellPetForGold(from, pet, 101);
                }
                else if (pet is Llama)
                {
                    SellPetForGold(from, pet, 150);
                }
                else
                {
                    SayTo(from, "I dont want that Beast, go away");               // You can't PetSale that!
                }
            }
        }
 private void Start()
 {
     LGrabbingHandRef   = GameObject.FindGameObjectWithTag("leftHand");
     RGrabbingHandRef   = GameObject.FindGameObjectWithTag("rightHand");
     animalComponentRef = GetComponent <BaseAnimal>();
 }