Beispiel #1
0
 public void Chop(Mobile from)
 {
     if (from.InRange(this.GetWorldLocation(), 1))
     {
         if (from == m_sower)
         {
             from.Direction = from.GetDirectionTo(this);
             double lumberValue = from.Skills[SkillName.Lumberjacking].Value / 100;
             if ((lumberValue > .5) && (Utility.RandomDouble() <= lumberValue))
             {
                 Beet fruit = new Beet(Utility.Random(m_yield + 2));
                 from.AddToBackpack(fruit);
             }
             this.Delete();
             from.SendMessage("You chop the plant up");
         }
         else
         {
             from.SendMessage("You do not own this plant !!!");
         }
     }
     else
     {
         from.SendLocalizedMessage(500446);
     }
 }
Beispiel #2
0
        public List <object> Products()
        {
            List <object> products = new List <object>();
            Beet          Beet     = new Beet();
            Carrot        Carrot   = new Carrot();
            Meat          Meat     = new Meat();
            Onion         Onion    = new Onion();
            Potato        Potato   = new Potato();
            Rise          Rise     = new Rise();

            Beet.Name   = "Свёкла";
            Carrot.Name = "Морковь";
            Meat.Name   = "Мясо";
            Onion.Name  = "Лук";
            Potato.Name = "Картошка";
            Rise.Name   = "Рис";

            products.AddRange(new object[] { Beet, Carrot, Meat, Onion, Potato, Rise });

            return(products);
        }
Beispiel #3
0
        public override void OnDoubleClick(Mobile from)
        {
            if (m_sower == null || m_sower.Deleted)
            {
                m_sower = from;
            }

            if (from.Mounted && !CropHelper.CanWorkMounted)
            {
                from.SendMessage("You cannot harvest a crop while mounted.");
                return;
            }

            if (DateTime.Now > lastpicked.AddSeconds(3))               // 3 seconds between picking
            {
                lastpicked = DateTime.Now;

                int cookValue = (int)from.Skills[SkillName.Cooking].Value / 20;
                if (cookValue == 0)
                {
                    from.SendMessage("You have no idea how to harvest this crop.");
                    return;
                }

                if (from.InRange(this.GetWorldLocation(), 1))
                {
                    if (m_yield < 1)
                    {
                        from.SendMessage("There is nothing here to harvest.");

                        if (PlayerCanDestroy && !(m_sower.AccessLevel > AccessLevel.Counselor))
                        {
                            UpRootGump g = new UpRootGump(from, this);
                            from.SendGump(g);
                        }
                    }
                    else                     //check skill and sower
                    {
                        from.Direction = from.GetDirectionTo(this);

                        from.Animate(from.Mounted ? 29:32, 5, 1, true, false, 0);

                        if (from == m_sower)
                        {
                            cookValue  *= 2;
                            m_lastvisit = DateTime.Now;
                        }

                        if (cookValue > m_yield)
                        {
                            cookValue = m_yield + 1;
                        }

                        int pick = Utility.Random(cookValue);
                        if (pick == 0)
                        {
                            from.SendMessage("You do not manage to harvest any crops.");
                            return;
                        }

                        m_yield -= pick;
                        from.SendMessage("You harvest {0} crop{1}!", pick, (pick == 1 ? "" : "s"));

                        //PublicOverheadMessage( MessageType.Regular, 0x3BD, false, string.Format( "{0}", m_yield ));
                        ((Item)this).ItemID = pickedGraphic;

                        Beet crop = new Beet(pick);
                        from.AddToBackpack(crop);

                        if (SowerPickTime != TimeSpan.Zero && m_lastvisit + SowerPickTime < DateTime.Now && !(m_sower.AccessLevel > AccessLevel.Counselor))
                        {
                            this.UpRoot(from);
                            return;
                        }

                        if (!regrowTimer.Running)
                        {
                            //regrowTimer = new CropTimer( this );
                            regrowTimer.Start();
                        }
                    }
                }
                else
                {
                    from.SendMessage("You are too far away to harvest anything.");
                }
            }
        }
Beispiel #4
0
        static void Main()
        {
            ICookBorshch  cookBorshch  = new Borshch();
            ICookPilaf    cookPilaf    = new Pilaf();
            ICookRagout   cookRagout   = new Ragout();
            IReadyBorshch readyBorshch = new Chef();
            IReadyPilaf   readyPilaf   = new Chef();
            IReadyRagout  readyRagout  = new Chef();

            Chef Kolya = new Chef
            {
                Age  = 40,
                Name = "Колян"
            };

            Chef Vitya = new Chef
            {
                Age  = 35,
                Name = "Витёк"
            };

            Chef Vasya = new Chef
            {
                Age  = 25,
                Name = "Васька"
            };

            Borshch borshch = new Borshch();
            Pilaf   pilaf   = new Pilaf();
            Ragout  ragout  = new Ragout();
            Cutting cut     = new Cutting();

            Beet   beet   = new Beet();
            Carrot carrot = new Carrot();
            Meat   meat   = new Meat();
            Onion  onion  = new Onion();
            Potato potato = new Potato();
            Rise   rise   = new Rise();

            List <object> friedBorshch  = cookBorshch.FryBorshch();
            List <object> boiledBorshch = cookBorshch.BoilBorshch();
            List <object> friedPilaf    = cookPilaf.FryPilaf();
            List <object> boiledPilaf   = cookPilaf.BoilPilaf();
            List <object> friedRagout   = cookRagout.FryRagout();
            List <object> boiledRagout  = cookRagout.BoilRagout();

            List <List <object> > readyBorshchDish = readyBorshch.FinishedDishBorshch(friedBorshch, boiledBorshch);
            List <List <object> > readyPilafDish   = readyPilaf.FinishedDishPilaf(friedPilaf, boiledPilaf);
            List <List <object> > readyRagoutDish  = readyRagout.FinishedDishRagout(friedRagout, boiledRagout);

            cut.Products();

            Console.WriteLine($"Сегодняшние повара:" +
                              $"\n\n{Kolya.Name} ({Kolya.Age} лет), {Vasya.Name} ({Vasya.Age} лет) и {Vitya.Name} ({Vitya.Age} лет)" +
                              $"\n\nОни приготовили сегодня:" +
                              $"\n{borshch.Dish}, {pilaf.Dish}, {ragout.Dish}" +
                              $"\n\nРецепт такой:" +
                              $"\n\n{beet.Name} - {beet.Weight} кг" +
                              $"\n{carrot.Name} - {carrot.Weight} кг" +
                              $"\n{meat.Name} - {meat.Weight} (тип {meat.Type}) кг" +
                              $"\n{onion.Name} - {onion.Weight}" +
                              $"\n{potato.Name} - {potato.Weight}" +
                              $"\n{rise.Name} - {rise.Weight} (тип {rise.Type}) кг" +
                              $"\n{cut.Pepper}" +
                              $"\n{cut.Salt}" +
                              $"\n{cut.Spices}");
            Console.WriteLine("\n\nГотовили блюда следующим образом:");

            foreach (var mainList in readyBorshchDish)
            {
                foreach (var item in mainList)
                {
                    Console.WriteLine("");
                    Console.WriteLine($"{item}");
                }
            }
        }
Beispiel #5
0
        public override void OnDoubleClick(Mobile from)
        {
            if (m_sower == null || m_sower.Deleted)
            {
                m_sower = from;
            }
            if (from != m_sower)
            {
                from.SendMessage("You do not own this plant !!!"); return;
            }

            if (from.Mounted && !CropHelper.CanWorkMounted)
            {
                from.SendMessage("You cannot harvest a crop while mounted."); return;
            }
            if (DateTime.UtcNow > lastpicked.AddSeconds(3))
            {
                lastpicked = DateTime.UtcNow;
                int cookValue = (int)from.Skills[SkillName.Cooking].Value / 20;
                if (cookValue == 0)
                {
                    from.SendMessage("You have no idea how to harvest this crop."); return;
                }
                if (from.InRange(this.GetWorldLocation(), 1))
                {
                    if (m_yield < 1)
                    {
                        from.SendMessage("There is nothing here to harvest.");
                    }
                    else
                    {
                        from.Direction = from.GetDirectionTo(this);
                        from.Animate(from.Mounted ? 29:32, 5, 1, true, false, 0);
                        m_lastvisit = DateTime.UtcNow;
                        if (cookValue > m_yield)
                        {
                            cookValue = m_yield + 1;
                        }
                        int pick = Utility.RandomMinMax(cookValue - 4, cookValue);
                        if (pick < 0)
                        {
                            pick = 0;
                        }
                        if (pick == 0)
                        {
                            from.SendMessage("You do not manage to harvest any crops."); return;
                        }
                        m_yield -= pick;
                        from.SendMessage("You harvest {0} crop{1}!", pick, (pick == 1 ? "" : "s"));
                        if (m_yield < 1)
                        {
                            ((Item)this).ItemID = pickedGraphic;
                        }
                        Beet crop = new Beet(pick);
                        from.AddToBackpack(crop);
                        if (!regrowTimer.Running)
                        {
                            regrowTimer.Start();
                        }
                    }
                }
                else
                {
                    from.SendMessage("You are too far away to harvest anything.");
                }
            }
        }