Пример #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))
             {
                 Turnip fruit = new Turnip(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);
     }
 }
Пример #2
0
        public override Item GetCropObject()
        {
            var turnip = new Turnip();

            turnip.ItemID = Utility.Random(3385, 2);

            return(turnip);
        }
Пример #3
0
		public override Item GetCropObject()
		{
			Turnip turnip = new Turnip();

			turnip.ItemID = Utility.Random( 3385, 2 );

			return turnip;
		}
Пример #4
0
        public override Item GetCropObject()
        {
            Turnip turnip = new Turnip
            {
                ItemID = Utility.Random(3385, 2)
            };

            return(turnip);
        }
Пример #5
0
 void ExplodeMinions()
 {
     foreach (GameObject g in RoomManager.rm.currentRoom.monsters)
     {
         if (g.gameObject == this.gameObject)
         {
             continue;
         }
         Turnip t = g.GetComponent <Turnip>();
         t.explosionDMG    = 0;
         t.growState       = Turnip.State.BOOM;
         t.explosionDelay  = Random.Range(0.0f, 2f);
         t.explosionVolume = 0.1f;
     }
 }
Пример #6
0
        public override bool LootItem(Mobile from)
        {
            if (Utility.RandomDouble() <= .05)
            {
                TurnipSeed item = new TurnipSeed();
                from.AddToBackpack(item);
                from.SendMessage("You manage to gather 1 turnip seed.");
            }
            Turnip c = new Turnip();

            c.ItemID = 3385;
            from.AddToBackpack(c);
            from.SendMessage("You manage to gather 1 turnip.");
            return(true);
        }
Пример #7
0
        static void Main(string[] args)
        {//создаем всех персонажей
            Cat          cat          = new Cat("Cat");
            Mouse        mouse        = new Mouse("Mouse");
            Grandfather  grandfather  = new Grandfather("Grandfather");
            Grandmother  grandmother  = new Grandmother("Grandmother");
            Dog          dog          = new Dog("Dog");
            Granddauther granddauther = new Granddauther("Granddauther");

            dog.Woof();
            cat.Meow(); //рядперсонажей и репку
            Line   characterline = new Line();
            Turnip turnip        = new Turnip();

            //пока не вытянем
            do
            {
                Console.WriteLine("Add a character");
                string newcharacter = Console.ReadLine(); //пишем кого хотим добавить
                switch (newcharacter)
                {                                         //Добавляем персонажа
                case "Grandfather":
                    characterline.AddCharacter(grandfather);
                    break;

                case "Grandmother":
                    characterline.AddCharacter(grandmother);
                    break;

                case "Granddauther":
                    characterline.AddCharacter(granddauther);
                    break;

                case "Cat":
                    characterline.AddCharacter(cat);
                    break;

                case "Dog":
                    characterline.AddCharacter(dog);
                    break;

                case "Mouse":
                    characterline.AddCharacter(mouse);
                    break;
                }
            }while(!turnip.Attempt(characterline));//работаем пока не вытащим
        }
Пример #8
0
        public Item Harvest()
        {
            Item harvest = null;

            if (CropType == "turnip")
            {
                if (Maturity == "b")
                {
                    harvest = new Turnip(Content, new Vector2(X, Y));
                }
            }
            else if (CropType == "potato")
            {
                if (Maturity == "b")
                {
                    harvest = new Potato(Content, new Vector2(X, Y));
                }
            }
            else if (CropType == "tomato")
            {
                if (Maturity == "d")
                {
                    harvest = new Tomato(Content, new Vector2(X, Y));
                }
            }
            else if (CropType == "corn")
            {
                if (Maturity == "d")
                {
                    harvest = new Corn(Content, new Vector2(X, Y));
                }
            }
            else if (CropType == "grass")
            {
                harvest = null;
            }

            if (harvest != null)
            {
                harvest.Update(HarvestMoon.Instance.GameTime);
            }

            return(harvest);
        }
Пример #9
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;
                        }
                        Turnip crop = new Turnip(pick);
                        from.AddToBackpack(crop);
                        if (!regrowTimer.Running)
                        {
                            regrowTimer.Start();
                        }
                    }
                }
                else
                {
                    from.SendMessage("You are too far away to harvest anything.");
                }
            }
        }
Пример #10
0
            public static void VendorBeg(Mobile m, object targeted, double chance)
            {
                //Console.WriteLine("Chance: {0}", chance);
                Mobile t          = (Mobile)targeted;
                Item   reward     = null;
                string rewardName = "";


                if (chance > .99 && m.Skills.Begging.Base >= 100)     //Vendor Only (1 hour cooldown)
                {
                    int rand = Utility.Random(9);                     //0-9 (10 Total) (40% chance for a item)
                    if (rand == 0)
                    {
                        reward     = new RockArtifact();                     //Rock Artifact
                        rewardName = "A rock";
                    }
                    else if (rand == 2)
                    {
                        reward     = new BeggerCoins(24);                     //Special Coins
                        rewardName = "24 dull slver coins.";
                    }
                    else if (rand == 4)                     //Fur Boots
                    {
                        reward     = new FurBoots();
                        rewardName = "a pair of Fur Boots";
                    }
                    else if (rand == 6)
                    {
                        reward     = new FlowerGarland();
                        rewardName = "a flower Garland";
                    }
                }
                Console.WriteLine("RewardName (1) {0}", reward);
                if (chance > .95 && m.Skills.Begging.Base >= 90 && reward == null)
                {
                    int rand = Utility.Random(9);
                    Console.WriteLine("Random 2 is {0}", rand);
                    if (rand == 0)
                    {
                        reward     = new BegBedRoll();
                        rewardName = "Bedroll";
                    }
                    else if (rand == 1)
                    {
                        reward     = new Cookies();
                        rewardName = "Cookies";
                    }
                    else if (rand == 3)
                    {
                        reward     = new FishSteak();
                        rewardName = "Fish Steaks";
                    }
                    else if (rand == 4)
                    {
                        reward     = new FishingPole();
                        rewardName = "Fishing Pole";
                    }
                    else if (rand == 6)
                    {
                        reward     = new BeggerCoins(12);
                        rewardName = "12 Dull Silver Coins.";
                    }
                    else if (rand == 7)
                    {
                        reward     = new Turnip();
                        rewardName = "Turnip";
                    }
                    else if (rand == 9)
                    {
                        reward     = new CeramicMug();
                        rewardName = "Ceramic Mug";
                    }
                }
                Console.WriteLine("RewardName (2) {0}", reward);
                if (reward == null)
                {
                    JunkBeg(m, t, chance);
                }
                else
                {
                    Reward(m, t, reward, rewardName);
                }
            }
Пример #11
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 mageValue = (int)from.Skills[SkillName.Magery].Value / 20;                  //FUTURE add two skill checks...
                if (mageValue == 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)
                        {
                            mageValue  *= 2;
                            m_lastvisit = DateTime.Now;
                        }

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

                        int pick = Utility.Random(mageValue);
                        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;

                        Turnip crop = new Turnip(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.Start();
                        }
                    }
                }
                else
                {
                    from.SendMessage("You are too far away to harvest anything.");
                }
            }
        }