示例#1
0
        public AddOrder(Customer customer)
        {
            InitializeComponent();
            ACustomer = customer;
            Coffee                  aCoffee            = new Coffee();
            CoffeeDarkRoast         aDarkRoastCoffee   = new CoffeeDarkRoast();
            SandwichWithBacon       aBaconSandwich     = new SandwichWithBacon();
            SandwichWithEggSalad    aEggSandwich       = new SandwichWithEggSalad();
            SandwichWithRoastedBeef aRoastBeefSandwich = new SandwichWithRoastedBeef();
            Tea       aTea      = new Tea();
            Milk      aMilk     = new Milk();
            Suggar    aSuggar   = new Suggar();
            Sweetener aSweetner = new Sweetener();
            Cheese    aCheese   = new Cheese();
            Mayo      aMayo     = new Mayo();
            Lettuce   aLettuce  = new Lettuce();
            Tomato    aTomato   = new Tomato();

            lbxOrders.Items.Add(aCoffee);
            lbxOrders.Items.Add(aDarkRoastCoffee);
            lbxOrders.Items.Add(aBaconSandwich);
            lbxOrders.Items.Add(aEggSandwich);
            lbxOrders.Items.Add(aRoastBeefSandwich);
            lbxOrders.Items.Add(aTea);
            lbxAdditions.Items.Add(aSweetner);
            lbxAdditions.Items.Add(aMilk);
            lbxAdditions.Items.Add(aSuggar);
            lbxAdditions.Items.Add(aCheese);
            lbxAdditions.Items.Add(aMayo);
            lbxAdditions.Items.Add(aLettuce);
            lbxAdditions.Items.Add(aTomato);
        }
 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))
             {
                 Lettuce fruit = new Lettuce(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);
     }
 }
        public override Item GetCropObject()
        {
            Lettuce lettuce = new Lettuce();

            lettuce.ItemID = Utility.Random(3184, 2);

            return(lettuce);
        }
示例#4
0
		public override Item GetCropObject()
		{
			Lettuce lettuce = new Lettuce();

			lettuce.ItemID = Utility.Random( 3184, 2 );

			return lettuce;
		}
示例#5
0
    // Use this for initialization
    void Start()
    {
        rand = new System.Random();

        indexIcon = rand.Next(0, 12);
        noEffect  = new Effect("No Disease", 0, false);

        purifyEffect = new Effect("Cure", 1, false);

        malaria = new Effect("Malaria", -1, false);

        bilharzia = new Effect("Bilharzia", -2, false);

        effectExp1 = "lose 1 HP every turn";
        effectExp2 = "Cure all disease and +1 HP";
        effectExp3 = "lose 2 HP every turn";

        effectsActive = new ArrayList();
        foods         = new ArrayList();

        birdseed = new BirdSeed("Bird Seed", 1, noEffect, 0);
        oat      = new Oat("Oat", 1, malaria, 1);
        Lettuce             lettuce             = new Lettuce("Lettuce", 3, bilharzia, 2); // lose speed -> speed/2
        Rice                rice                = new Rice("Rice", 1, purifyEffect, 3);
        RottenGrape         rottenGrape         = new RottenGrape("Rotten Grape", -2, malaria, 4);
        PollutedCrackedCorn pollutedCrackedCorn = new PollutedCrackedCorn("Polluted Cracked Corn", -2, malaria, 5);
        Avocado             avocado             = new Avocado("Avocado", -2, malaria, 6);
        Onion               onion               = new Onion("Onion", -2, purifyEffect, 7);
        Nuts                nuts                = new Nuts("Nuts", -2, purifyEffect, 8);
        Chocolate           chocolate           = new Chocolate("Chocolate", -2, purifyEffect, 9);
        Popcorn             popcorn             = new Popcorn("Popcorn", -2, bilharzia, 10);
        Bread               bread               = new Bread("Bread", -2, malaria, 11);



        for (int i = 0; i < 3; i++)
        {
            foods.Add(birdseed);
            foods.Add(oat);
            foods.Add(lettuce);
            foods.Add(rice);
            foods.Add(rottenGrape);
            foods.Add(pollutedCrackedCorn);
            foods.Add(avocado);
            foods.Add(onion);
            foods.Add(nuts);
            foods.Add(chocolate);
            foods.Add(popcorn);
            foods.Add(bread);
        }
    }
示例#6
0
        public override bool LootItem(Mobile from)
        {
            if (Utility.RandomDouble() <= .05)
            {
                LettuceSeed item = new LettuceSeed();
                from.AddToBackpack(item);
                from.SendMessage("You manage to gather 1 lettuce seed.");
            }
            Lettuce c = new Lettuce();

            c.ItemID = 3184;
            from.AddToBackpack(c);
            from.SendMessage("You manage to gather 1 lettuce.");
            return(true);
        }
示例#7
0
 public void AddAnOrder(IMenuItem aItem)
 {
     AMenuItemAddition = lbxAdditions.SelectedItem as MenuItemAddition;
     if (AMenuItemAddition is Suggar)
     {
         CurrentOrder = new Suggar(aItem);
         lbxOrdered.Items.Clear();
         lbxOrdered.Items.Add(CurrentOrder);
     }
     else if (AMenuItemAddition is Milk)
     {
         CurrentOrder = new Milk(aItem);
         lbxOrdered.Items.Clear();
         lbxOrdered.Items.Add(CurrentOrder);
     }
     else if (AMenuItemAddition is Sweetener)
     {
         CurrentOrder = new Sweetener(aItem);
         lbxOrdered.Items.Clear();
         lbxOrdered.Items.Add(CurrentOrder);
     }
     else if (AMenuItemAddition is Lettuce)
     {
         CurrentOrder = new Lettuce(aItem);
         lbxOrdered.Items.Clear();
         lbxOrdered.Items.Add(CurrentOrder);
     }
     else if (AMenuItemAddition is Tomato)
     {
         CurrentOrder = new Tomato(aItem);
         lbxOrdered.Items.Clear();
         lbxOrdered.Items.Add(CurrentOrder);
     }
     else if (AMenuItemAddition is Cheese)
     {
         CurrentOrder = new Cheese(aItem);
         lbxOrdered.Items.Clear();
         lbxOrdered.Items.Add(CurrentOrder);
     }
     else if (AMenuItemAddition is Mayo)
     {
         CurrentOrder = new Mayo(aItem);
         lbxOrdered.Items.Clear();
         lbxOrdered.Items.Add(CurrentOrder);
     }
 }
        public Vegetable GetVegetable(int index)
        {
            Vegetable vegetable;

            if (index % 2 == 0)
            {
                vegetable = new Carrot()
                {
                    Id = index, Color = "orange", Size = 15
                };
            }
            else
            {
                vegetable = new Lettuce()
                {
                    Id = index, Color = "green"
                };
            }

            return(vegetable);
        }
        public void DoWork()
        {
            //客人訂了一份土司,不需要配料,列出他的價格與描述
            IBreakfast bf1 = new Toast();

            Console.WriteLine("餐點:{0} 價格:{1}", bf1.GetDescription(), bf1.GetCost());

            //客人訂了一份貝果,要加"雙倍"火腿,列出他的價格與描述
            IBreakfast bf2 = new Bego();

            bf2 = new Ham(bf2);
            bf2 = new Ham(bf2);
            Console.WriteLine("餐點:{0} 價格:{1}", bf2.GetDescription(), bf2.GetCost());

            //客人訂了一份漢堡,要加牛肉 生菜 起司,列出他的價格與描述
            IBreakfast bf3 = new Hamburger();

            bf3 = new Beef(bf3);
            bf3 = new Lettuce(bf3);
            bf3 = new Cheese(bf3);
            Console.WriteLine("餐點:{0} 價格:{1}", bf3.GetDescription(), bf3.GetCost());
        }
示例#10
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;

                        Lettuce crop = new Lettuce(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.");
                }
            }
        }
        private void btn_Lettuce_Click(object sender, RoutedEventArgs e)
        {
            Lettuce lettuce = new Lettuce();

            lettuce.Show();
        }
示例#12
0
        private void BtnAdd_Click(object sender, EventArgs e)
        {
            if (menuGridView.CurrentRow == null)
            {
                return;
            }
            IMenuItem item = new Coffee();

            if (menuGridView.CurrentRow.Index == 1)
            {
                item = new CoffeeDarkRoast();
            }
            else if (menuGridView.CurrentRow.Index == 2)
            {
                item = new Tea();
            }
            else if (menuGridView.CurrentRow.Index == 3)
            {
                item = new SandwichWithBacon();
            }
            else if (menuGridView.CurrentRow.Index == 4)
            {
                item = new SandwichWithEggSalad();
            }
            else if (menuGridView.CurrentRow.Index == 5)
            {
                item = new SandwichWithRoastedBeef();
            }
            for (int i = 0; i < NUD_Cheese.Value; i++)
            {
                item = new Cheese(item);
            }
            for (int i = 0; i < NUD_Lettuce.Value; i++)
            {
                item = new Lettuce(item);
            }
            for (int i = 0; i < NUD_Mayo.Value; i++)
            {
                item = new Mayo(item);
            }
            for (int i = 0; i < NUD_Milk.Value; i++)
            {
                item = new Milk(item);
            }
            for (int i = 0; i < NUD_Sugar.Value; i++)
            {
                item = new Suggar(item);
            }
            for (int i = 0; i < NUD_Sweetener.Value; i++)
            {
                item = new Sweetener(item);
            }
            for (int i = 0; i < NUD_Tomato.Value; i++)
            {
                item = new Tomato(item);
            }
            orderListGridView.Rows.Add();
            orderListGridView.Rows[numberOfRows].Cells[0].Value   = item.Description;
            orderListGridView.Rows[numberOfRows++].Cells[1].Value = item.Cost;
            items.Add(item);
        }
示例#13
0
        public override void OnDoubleClick(Mobile from)
        {
            if (m_sower == null || m_sower.Deleted)
            {
                m_sower = from;
            }

            if (from.Mounted && !CropHelper.CanWorkMounted)
            {
                from.SendMessage(AgriTxt.CannotWorkMounted);
                return;
            }

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

                int lumberValue = (int)from.Skills[SkillName.Lumberjacking].Value / 5;
                if (lumberValue == 0)
                {
                    from.SendMessage(AgriTxt.DunnoHowTo);
                    return;
                }

                if (from.InRange(this.GetWorldLocation(), 2))
                {
                    if (m_yield < 1)
                    {
                        from.SendMessage(AgriTxt.NoCrop);

                        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)
                        {
                            lumberValue *= 2;
                            m_lastvisit  = DateTime.Now;
                        }

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

                        int pick = Utility.Random(lumberValue);
                        if (pick == 0)
                        {
                            from.SendMessage(AgriTxt.ZeroPicked);
                            return;
                        }

                        m_yield -= pick;
                        from.SendMessage(AgriTxt.YouPick + " {0} laitue{1}!", pick, (pick == 1 ? "" : "s"));

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

                        Lettuce crop = new Lettuce(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(AgriTxt.TooFar);
                }
            }
        }
 public Sandwich(WheatBread wheat, Ham ham, Lettuce lettuce)
 {
     _wheat   = wheat;
     _ham     = ham;
     _lettuce = lettuce;
 }
        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;
                        }
                        Lettuce crop = new Lettuce(pick);
                        from.AddToBackpack(crop);
                        if (!regrowTimer.Running)
                        {
                            regrowTimer.Start();
                        }
                    }
                }
                else
                {
                    from.SendMessage("You are too far away to harvest anything.");
                }
            }
        }