示例#1
0
		public bool CanBeWatered( PlantItem plant )
		{
			if ( plant.PlantStatus >= PlantStatus.DecorativePlant )
				return false;
			else
				return true;
		}
示例#2
0
        public PlantSystem( PlantItem plant, bool fertileDirt )
        {
            m_Plant = plant;
            m_FertileDirt = fertileDirt;

            m_NextGrowth = Core.Now + CheckDelay;
            m_GrowthIndicator = PlantGrowthIndicator.None;
            m_Hits = MaxHits;
            m_LeftSeeds = 8;
            m_LeftResources = 8;
        }
示例#3
0
        public PlantSystem(PlantItem plant, bool fertileDirt)
        {
            this.m_Plant = plant;
            this.m_FertileDirt = fertileDirt;

            this.m_NextGrowth = DateTime.Now + CheckDelay;
            this.m_GrowthIndicator = PlantGrowthIndicator.None;
            this.m_Hits = this.MaxHits;
            this.m_LeftSeeds = 8;
            this.m_LeftResources = 8;
        }
		public SetToDecorativeGump( PlantItem plant ) : base( 20, 20 )
		{
			m_Plant = plant;

			DrawBackground();

			AddLabel( 115, 85, 0x44, "Set plant" );
			AddLabel( 82, 105, 0x44, "to decorative mode?" );

			AddButton( 98, 140, 0x47E, 0x480, 1, GumpButtonType.Reply, 0 ); // Cancel

			AddButton( 138, 141, 0xD2, 0xD2, 2, GumpButtonType.Reply, 0 ); // Help
			AddLabel( 143, 141, 0x835, "?" );

			AddButton( 168, 140, 0x481, 0x483, 3, GumpButtonType.Reply, 0 ); // Ok
		}
		public EmptyTheBowlGump( PlantItem plant ) : base( 20, 20 )
		{
			m_Plant = plant;

			DrawBackground();

			AddLabel( 90, 70, 0x44, "Empty the bowl?" );

			DrawPicture();

			AddButton( 98, 150, 0x47E, 0x480, 1, GumpButtonType.Reply, 0 ); // Cancel

			AddButton( 138, 151, 0xD2, 0xD2, 2, GumpButtonType.Reply, 0 ); // Help
			AddLabel( 143, 151, 0x835, "?" );

			AddButton( 168, 150, 0x481, 0x483, 3, GumpButtonType.Reply, 0 ); // Ok
		}
示例#6
0
        public ReproductionGump( PlantItem plant )
            : base(20, 20)
        {
            m_Plant = plant;

            DrawBackground();

            AddButton( 70, 67, 0xD4, 0xD4, 1, GumpButtonType.Reply, 0 ); // Main menu
            AddItem( 57, 65, 0x1600 );

            AddLabel( 108, 67, 0x835, "Reproduction" );

            if ( m_Plant.PlantStatus == PlantStatus.Stage9 )
            {
                AddButton( 212, 67, 0xD4, 0xD4, 2, GumpButtonType.Reply, 0 ); // Set to decorative
                AddItem( 202, 68, 0xC61 );
                AddLabel( 216, 66, 0x21, "/" );
            }

            AddButton( 80, 116, 0xD4, 0xD4, 3, GumpButtonType.Reply, 0 ); // Pollination
            AddItem( 66, 117, 0x1AA2 );
            AddPollinationState( 106, 116 );

            AddButton( 128, 116, 0xD4, 0xD4, 4, GumpButtonType.Reply, 0 ); // Resources
            AddItem( 113, 120, 0x1021 );
            AddResourcesState( 149, 116 );

            AddButton( 177, 116, 0xD4, 0xD4, 5, GumpButtonType.Reply, 0 ); // Seeds
            AddItem( 160, 121, 0xDCF );
            AddSeedsState( 199, 116 );

            AddButton( 70, 163, 0xD2, 0xD2, 6, GumpButtonType.Reply, 0 ); // Gather pollen
            AddItem( 56, 164, 0x1AA2 );

            AddButton( 138, 163, 0xD2, 0xD2, 7, GumpButtonType.Reply, 0 ); // Gather resources
            AddItem( 123, 167, 0x1021 );

            AddButton( 212, 163, 0xD2, 0xD2, 8, GumpButtonType.Reply, 0 ); // Gather seeds
            AddItem( 195, 168, 0xDCF );
        }
示例#7
0
        public PlantSystem( PlantItem plant, GenericReader reader )
        {
            m_Plant = plant;

            int version = reader.ReadInt();

            m_FertileDirt = reader.ReadBool();

            if ( version >= 1 )
                m_NextGrowth = reader.ReadDateTime();
            else
                m_NextGrowth = reader.ReadDeltaTime();

            m_GrowthIndicator = (PlantGrowthIndicator) reader.ReadInt();

            m_Water = reader.ReadInt();

            m_Hits = reader.ReadInt();
            m_Infestation = reader.ReadInt();
            m_Fungus = reader.ReadInt();
            m_Poison = reader.ReadInt();
            m_Disease = reader.ReadInt();
            m_PoisonPotion = reader.ReadInt();
            m_CurePotion = reader.ReadInt();
            m_HealPotion = reader.ReadInt();
            m_StrengthPotion = reader.ReadInt();

            m_Pollinated = reader.ReadBool();
            m_SeedType = (PlantType) reader.ReadInt();
            m_SeedHue = (PlantHue) reader.ReadInt();
            m_AvailableSeeds = reader.ReadInt();
            m_LeftSeeds = reader.ReadInt();

            m_AvailableResources = reader.ReadInt();
            m_LeftResources = reader.ReadInt();

            if ( version < 2 && PlantHueInfo.IsCrossable( m_SeedHue ) )
                m_SeedHue |= PlantHue.Reproduces;
        }
		public PollinateTarget( PlantItem plant ) : base( 3, true, TargetFlags.None )
		{
			m_Plant = plant;
		}
示例#9
0
 public PlantPourTarget( PlantItem plant )
     : base(3, true, TargetFlags.None)
 {
     m_Plant = plant;
 }
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( m_PlantBowl.Deleted )
					return;

				if ( !m_PlantBowl.IsChildOf( from.Backpack ) )
				{
					from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
					return;
				}

				if ( targeted is FertileDirt )
				{
					FertileDirt dirt = (FertileDirt)targeted;

					if ( !dirt.IsChildOf( from.Backpack ) )
					{
						from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
					}
					else if ( dirt.Amount < 40 )
					{
						from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061896 ); // You need more dirt to fill a plant bowl!
					}
					else
					{
						PlantItem fullBowl = new PlantItem( true );

						if ( from.PlaceInBackpack( fullBowl ) )
						{
							dirt.Consume( 40 );
							m_PlantBowl.Delete();

							from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061895 ); // You fill the bowl with fresh dirt.
						}
						else
						{
							fullBowl.Delete();

							from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061894 ); // There is no room in your backpack for a bowl full of dirt!
						}
					}
				}
				else if ( PlantBowl.IsDirtPatch( targeted ) )
				{
					PlantItem fullBowl = new PlantItem( false );

					if ( from.PlaceInBackpack( fullBowl ) )
					{
						m_PlantBowl.Delete();

						from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061895 ); // You fill the bowl with fresh dirt.
					}
					else
					{
						fullBowl.Delete();

						from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061894 ); // There is no room in your backpack for a bowl full of dirt!
					}
				}
				else
				{
					from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061893 ); // You'll want to gather fresh dirt in order to raise a healthy plant!
				}
			}
示例#11
0
        public TopiaryGump(PlantItem plant, Clippers clippers) : base(0, 0)
        {
            m_plant = plant;
            m_clippers = clippers;

            AddPage(0);

            AddBackground(50, 89, 508, 195, 2600);

            AddLabel(103, 114, 0, @"Choose a Topiary:");

            AddButton(92, 155, 1209, 1210, 1, GumpButtonType.Reply, 0);
            AddItem(75, 178, 18713);

            AddButton(133, 155, 1209, 1210, 2, GumpButtonType.Reply, 0);
            AddItem(119, 178, 18714);

            AddButton(177, 155, 1209, 1210, 3, GumpButtonType.Reply, 0);
            AddItem(165, 182, 18715);

            AddButton(217, 155, 1209, 1210, 4, GumpButtonType.Reply, 0);
            AddItem(205, 182, 18736);

            AddButton(267, 155, 1209, 1210, 5, GumpButtonType.Reply, 0);
            AddItem(220, 133, 18813);

            AddButton(333, 155, 1209, 1210, 6, GumpButtonType.Reply, 0);
            AddItem(272, 133, 18814);

            AddButton(388, 155, 1209, 1210, 7, GumpButtonType.Reply, 0);
            AddItem(374, 178, 18784);

            AddButton(426, 155, 1209, 1210, 8, GumpButtonType.Reply, 0);
            AddItem(413, 175, 18713);

            AddButton(480, 155, 1209, 1210, 9, GumpButtonType.Reply, 0);
            AddItem(463, 176, 19369);
        }
示例#12
0
 public PollinateTarget(PlantItem plant) : base(3, true, TargetFlags.None)
 {
     m_Plant = plant;
 }
示例#13
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
            m_Plant = reader.ReadItem() as PlantItem;

            if (m_Plant != null && m_Plant is RaisedGardenPlantItem && ((RaisedGardenPlantItem)m_Plant).Component == null)
                ((RaisedGardenPlantItem)m_Plant).Component = this;
        }
示例#14
0
        public MainPlantGump(PlantItem plant)
            : base(20, 20)
        {
            m_Plant = plant;

            DrawBackground();

            DrawPlant();

            AddButton(71, 67, 0xD4, 0xD4, 1, GumpButtonType.Reply, 0); // Reproduction menu
            AddItem(59, 68, 0xD08);

            PlantSystem system = plant.PlantSystem;

            AddButton(71, 91, 0xD4, 0xD4, 2, GumpButtonType.Reply, 0); // Infestation
            AddItem(8, 96, 0x372);
            AddPlus(95, 92, system.Infestation);

            AddButton(71, 115, 0xD4, 0xD4, 3, GumpButtonType.Reply, 0); // Fungus
            AddItem(58, 115, 0xD16);
            AddPlus(95, 116, system.Fungus);

            AddButton(71, 139, 0xD4, 0xD4, 4, GumpButtonType.Reply, 0); // Poison
            AddItem(59, 143, 0x1AE4);
            AddPlus(95, 140, system.Poison);

            AddButton(71, 163, 0xD4, 0xD4, 5, GumpButtonType.Reply, 0); // Disease
            AddItem(55, 167, 0x1727);
            AddPlus(95, 164, system.Disease);

            AddButton(209, 67, 0xD2, 0xD2, 6, GumpButtonType.Reply, 0); // Water
            AddItem(193, 67, 0x1F9D);
            AddPlusMinus(196, 67, system.Water);

            AddButton(209, 91, 0xD4, 0xD4, 7, GumpButtonType.Reply, 0); // Poison potion
            AddItem(201, 91, 0xF0A);
            AddLevel(196, 91, system.PoisonPotion);

            AddButton(209, 115, 0xD4, 0xD4, 8, GumpButtonType.Reply, 0); // Cure potion
            AddItem(201, 115, 0xF07);
            AddLevel(196, 115, system.CurePotion);

            AddButton(209, 139, 0xD4, 0xD4, 9, GumpButtonType.Reply, 0); // Heal potion
            AddItem(201, 139, 0xF0C);
            AddLevel(196, 139, system.HealPotion);

            AddButton(209, 163, 0xD4, 0xD4, 10, GumpButtonType.Reply, 0); // Strength potion
            AddItem(201, 163, 0xF09);
            AddLevel(196, 163, system.StrengthPotion);

            AddImage(48, 47, 0xD2);
            AddLevel(54, 47, (int)m_Plant.PlantStatus);

            AddImage(232, 47, 0xD2);
            AddGrowthIndicator(239, 47);

            AddButton(48, 183, 0xD2, 0xD2, 11, GumpButtonType.Reply, 0); // Help
            AddLabel(54, 183, 0x835, "?");

            if (plant is MaginciaPlantItem || plant is RaisedGardenPlantItem)
            {
                AddItem(219, 180, 0x913);
            }
            else
            {
                AddItem(219, 180, 0x15FD);
            }

            AddButton(232, 183, 0xD4, 0xD4, 12, GumpButtonType.Reply, 0); // Empty the bowl
        }
示例#15
0
 public PlantPourTarget(PlantItem plant)
     : base(3, true, TargetFlags.None)
 {
     m_Plant = plant;
 }
示例#16
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_PlantBowl.Deleted)
                {
                    return;
                }

                if (!m_PlantBowl.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1042664);                       // You must have the object in your backpack to use it.
                    return;
                }

                if (targeted is FertileDirt)
                {
                    int _dirtNeeded = Core.ML ? 20 : 40;

                    FertileDirt dirt = (FertileDirt)targeted;

                    if (!dirt.IsChildOf(from.Backpack))
                    {
                        from.SendLocalizedMessage(1042664);                           // You must have the object in your backpack to use it.
                    }
                    else if (dirt.Amount < _dirtNeeded)
                    {
                        from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061896);                           // You need more dirt to fill a plant bowl!
                    }
                    else
                    {
                        PlantItem fullBowl = new PlantItem(true);

                        if (from.PlaceInBackpack(fullBowl))
                        {
                            dirt.Consume(_dirtNeeded);
                            m_PlantBowl.Delete();

                            from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061895);                               // You fill the bowl with fresh dirt.
                        }
                        else
                        {
                            fullBowl.Delete();

                            from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061894);                               // There is no room in your backpack for a bowl full of dirt!
                        }
                    }
                }
                else if (PlantBowl.IsDirtPatch(targeted))
                {
                    PlantItem fullBowl = new PlantItem(false);

                    if (from.PlaceInBackpack(fullBowl))
                    {
                        m_PlantBowl.Delete();

                        from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061895);                           // You fill the bowl with fresh dirt.
                    }
                    else
                    {
                        fullBowl.Delete();

                        from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061894);                           // There is no room in your backpack for a bowl full of dirt!
                    }
                }
                else
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061893);                       // You'll want to gather fresh dirt in order to raise a healthy plant!
                }
            }
示例#17
0
        protected override void OnTarget(Mobile from, object targeted)
        {
            if (!m_Plant.Deleted && m_Plant.PlantStatus < PlantStatus.DecorativePlant && from.InRange(m_Plant.GetWorldLocation(), 3))
            {
                if (!m_Plant.IsUsableBy(from))
                {
                    m_Plant.LabelTo(from, 1061856);                       // You must have the item in your backpack or locked down in order to use it.
                }
                else if (!m_Plant.IsCrossable)
                {
                    m_Plant.LabelTo(from, 1053050);                       // You cannot gather pollen from a mutated plant!
                }
                else if (!m_Plant.PlantSystem.PollenProducing)
                {
                    m_Plant.LabelTo(from, 1053051);                       // You cannot gather pollen from a plant in this stage of development!
                }
                else if (m_Plant.PlantSystem.Health < PlantHealth.Healthy)
                {
                    m_Plant.LabelTo(from, 1053052);                       // You cannot gather pollen from an unhealthy plant!
                }
                else
                {
                    PlantItem targ = targeted as PlantItem;

                    if (targ == null || targ.PlantStatus >= PlantStatus.DecorativePlant || targ.PlantStatus <= PlantStatus.BowlOfDirt)
                    {
                        m_Plant.LabelTo(from, 1053070);                           // You can only pollinate other specially grown plants!
                    }
                    else if (!targ.IsUsableBy(from))
                    {
                        targ.LabelTo(from, 1061856);                           // You must have the item in your backpack or locked down in order to use it.
                    }
                    else if (!targ.IsCrossable)
                    {
                        targ.LabelTo(from, 1053073);                           // You cannot cross-pollinate with a mutated plant!
                    }
                    else if (!targ.PlantSystem.PollenProducing)
                    {
                        targ.LabelTo(from, 1053074);                           // This plant is not in the flowering stage. You cannot pollinate it!
                    }
                    else if (targ.PlantSystem.Health < PlantHealth.Healthy)
                    {
                        targ.LabelTo(from, 1053075);                           // You cannot pollinate an unhealthy plant!
                    }
                    else if (targ.PlantSystem.Pollinated)
                    {
                        targ.LabelTo(from, 1053072);                           // This plant has already been pollinated!
                    }
                    else if (targ == m_Plant)
                    {
                        targ.PlantSystem.Pollinated = true;
                        targ.PlantSystem.SeedType   = m_Plant.PlantType;
                        targ.PlantSystem.SeedHue    = m_Plant.PlantHue;

                        targ.LabelTo(from, 1053071);                           // You pollinate the plant with its own pollen.
                    }
                    else
                    {
                        targ.PlantSystem.Pollinated = true;
                        targ.PlantSystem.SeedType   = PlantTypeInfo.Cross(m_Plant.PlantType, targ.PlantType);
                        targ.PlantSystem.SeedHue    = PlantHueInfo.Cross(m_Plant.PlantHue, targ.PlantHue);

                        targ.LabelTo(from, 1053076);                           // You successfully cross-pollinate the plant.
                    }
                }
            }
        }
        public MainPlantGump( PlantItem plant )
            : base(20, 20)
        {
            m_Plant = plant;

            DrawBackground();

            DrawPlant();

            AddButton( 71, 67, 0xD4, 0xD4, 1, GumpButtonType.Reply, 0 ); // Reproduction menu
            AddItem( 59, 68, 0xD08 );

            PlantSystem system = plant.PlantSystem;

            AddButton( 71, 91, 0xD4, 0xD4, 2, GumpButtonType.Reply, 0 ); // Infestation
            AddItem( 8, 96, 0x372 );
            AddPlus( 95, 92, system.Infestation );

            AddButton( 71, 115, 0xD4, 0xD4, 3, GumpButtonType.Reply, 0 ); // Fungus
            AddItem( 58, 115, 0xD16 );
            AddPlus( 95, 116, system.Fungus );

            AddButton( 71, 139, 0xD4, 0xD4, 4, GumpButtonType.Reply, 0 ); // Poison
            AddItem( 59, 143, 0x1AE4 );
            AddPlus( 95, 140, system.Poison );

            AddButton( 71, 163, 0xD4, 0xD4, 5, GumpButtonType.Reply, 0 ); // Disease
            AddItem( 55, 167, 0x1727 );
            AddPlus( 95, 164, system.Disease );

            AddButton( 209, 67, 0xD2, 0xD2, 6, GumpButtonType.Reply, 0 ); // Water
            AddItem( 193, 67, 0x1F9D );
            AddPlusMinus( 196, 67, system.Water );

            AddButton( 209, 91, 0xD4, 0xD4, 7, GumpButtonType.Reply, 0 ); // Poison potion
            AddItem( 201, 91, 0xF0A );
            AddLevel( 196, 91, system.PoisonPotion );

            AddButton( 209, 115, 0xD4, 0xD4, 8, GumpButtonType.Reply, 0 ); // Cure potion
            AddItem( 201, 115, 0xF07 );
            AddLevel( 196, 115, system.CurePotion );

            AddButton( 209, 139, 0xD4, 0xD4, 9, GumpButtonType.Reply, 0 ); // Heal potion
            AddItem( 201, 139, 0xF0C );
            AddLevel( 196, 139, system.HealPotion );

            AddButton( 209, 163, 0xD4, 0xD4, 10, GumpButtonType.Reply, 0 ); // Strength potion
            AddItem( 201, 163, 0xF09 );
            AddLevel( 196, 163, system.StrengthPotion );

            AddImage( 48, 47, 0xD2 );
            AddLevel( 54, 47, (int)m_Plant.PlantStatus );

            AddImage( 232, 47, 0xD2 );
            AddGrowthIndicator( 239, 47 );

            AddButton( 48, 183, 0xD2, 0xD2, 11, GumpButtonType.Reply, 0 ); // Help
            AddLabel( 54, 183, 0x835, "?" );

            AddButton( 232, 183, 0xD4, 0xD4, 12, GumpButtonType.Reply, 0 ); // Empty the bowl
            AddItem( 219, 180, 0x15FD );
        }
示例#19
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Seed.Deleted)
                {
                    return;
                }

                if (!m_Seed.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1042664);                       // You must have the object in your backpack to use it.
                    return;
                }

                if (targeted is PlantItem)
                {
                    PlantItem plant = (PlantItem)targeted;

                    plant.PlantSeed(from, m_Seed);
                }

                else if (targeted is Server.Items.GardenAddonComponent)
                {
                    Server.Items.GardenAddonComponent addon = (Server.Items.GardenAddonComponent)targeted;

                    if (addon.Plant != null)
                    {
                        from.SendLocalizedMessage(1150367); // This plot already has a plant!
                    }
                    else
                    {
                        Server.Multis.BaseHouse house = Server.Multis.BaseHouse.FindHouseAt(addon);

                        if (house != null)
                        {
                            int fertileDirt = from.Backpack == null ? 0 : from.Backpack.GetAmount(typeof(FertileDirt), false);

                            if (fertileDirt > 0)
                            {
                                from.SendGump(new FertileDirtGump(m_Seed, fertileDirt, addon));
                            }
                            else
                            {
                                RaisedGardenPlantItem dirt = new RaisedGardenPlantItem();
                                dirt.MoveToWorld(new Point3D(addon.X, addon.Y, addon.Z + 5), addon.Map);

                                dirt.PlantSeed(from, m_Seed);
                                addon.Plant    = dirt;
                                dirt.Component = addon;
                            }
                        }
                    }
                }
                else if (targeted is Item)
                {
                    ((Item)targeted).LabelTo(from, 1061919);                       // You must use a seed on a bowl of dirt!
                }
                else
                {
                    from.SendLocalizedMessage(1061919);                       // You must use a seed on a bowl of dirt!
                }
            }