Esempio n. 1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            m_Hive = (apiBeeHive)reader.ReadItem();
        }
		public static void HiveUpdate(apiBeeHive hive)
		{
			if ( !hive.IsCheckable )
				return;

			//make sure it is time for update
			if ( DateTime.Now < hive.NextCheck )
			{
				//m_GrowthIndicator = PlantGrowthIndicator.Delay;
				return;
			}

			hive.NextCheck = DateTime.Now + CheckDelay; //update check timer
			hive.LastGrowth = HiveGrowthIndicator.None; //reset growth indicator
			
			hive.HiveAge++;	//update age of the hive
			hive.FindFlowersInRange(); //update flowers
			hive.FindWaterInRange();   //update water

			//apply any potions
			hive.ApplyBenefitEffects();
			
			//apply negative effects
			if( !hive.ApplyMaladiesEffects() )  //Dead
				return;

            //update stage
			hive.Grow();
			
			//update maladies
			hive.UpdateMaladies();

			hive.BeeHiveComponent.InvalidateProperties(); //to refresh beehive properties
		}
Esempio n. 3
0
        public apiBeeHiveDestroyGump(Mobile from, apiBeeHive hive) : base(20, 20)
        {
            m_hive = hive;

            Closable   = true;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            AddPage(0);

            AddBackground(37, 26, 205, 137, 3600);

            AddItem(11, 20, 3307);
            AddItem(205, 20, 3307);
            AddItem(12, 65, 3307);
            AddItem(206, 69, 3307);

            AddLabel(84, 43, 92, "Destory the hive?");

            AddItem(73, 68, 2330);
            AddItem(160, 68, 5359);

            AddImage(131, 74, 5601);              //arrow

            AddButton(83, 114, 1150, 1152, (int)Buttons.butCancel, GumpButtonType.Reply, 0);
            AddButton(166, 115, 1153, 1155, (int)Buttons.butOkay, GumpButtonType.Reply, 0);
        }
        public SwitchDormantGump(Mobile from, apiBeeHive hive)
            : base(20, 20)
        {
            from.CloseGump(typeof(SwitchDormantGump));
            m_hive = hive;

            Closable   = true;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            AddPage(0);

            AddImage(0, 0, 0x816);
            AddButton(34, 74, 0x81A, 0x81B, 1, GumpButtonType.Reply, 0); // OK
            AddButton(88, 74, 0x995, 0x996, 2, GumpButtonType.Reply, 0); // Cancel

            string msg = "Put the bees to dormant?";

            if (m_hive.IsDormant)
            {
                msg = "Wake up the bees?";
            }
            AddHtml(30, 25, 120, 40, msg, false, false);
        }
Esempio n. 5
0
        public apiBeeHiveProductionGump(Mobile from, apiBeeHive hive) : base(20, 20)
        {
            m_hive = hive;

            Closable   = true;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            AddPage(0);

            AddBackground(37, 133, 205, 54, 3600);
            AddBackground(37, 67, 205, 80, 3600);
            AddBackground(37, 26, 205, 55, 3600);


            AddItem(12, 91, 3307);
            AddItem(11, 24, 3307);
            AddItem(206, 87, 3307);
            AddItem(205, 20, 3307);

            AddItem(76, 99, 5154);
            AddItem(149, 97, 2540);

            //honey
            if (m_hive.HiveStage < HiveStatus.Producing)
            {            //too early to produce
                AddLabel(185, 97, 37, "X");
            }
            else
            {
                AddLabel(185, 97, 0x481, m_hive.Honey.ToString());
            }

            //wax
            if (m_hive.HiveStage < HiveStatus.Producing)
            {            //too early to produce
                AddLabel(113, 97, 37, "X");
            }
            else
            {
                AddLabel(113, 97, 0x481, m_hive.Wax.ToString());
            }

            AddLabel(110, 43, 92, "Production");              //title

            AddItem(44, 47, 6256);
            AddItem(191, 151, 2540);

            AddItem(42, 153, 5154);

            AddImage(162, 96, 212);
            AddImage(90, 96, 212);

            AddButton(204, 150, 212, 212, (int)Buttons.butHoney, GumpButtonType.Reply, 0);
            AddButton(57, 43, 212, 212, (int)Buttons.butExit, GumpButtonType.Reply, 0);
            AddButton(56, 150, 212, 212, (int)Buttons.butWax, GumpButtonType.Reply, 0);
        }
Esempio n. 6
0
        public static void HiveUpdate(apiBeeHive hive)
        {
            if (!hive.IsCheckable)
            {
                return;
            }

            //make sure it is time for update
            if (DateTime.UtcNow < hive.NextCheck)
            {
                //m_GrowthIndicator = PlantGrowthIndicator.Delay;
                return;
            }

            hive.NextCheck  = DateTime.UtcNow + CheckDelay; //update check timer
            hive.LastGrowth = HiveGrowthIndicator.None;     //reset growth indicator

            hive.HiveAge++;                                 //update age of the hive
            hive.FindFlowersInRange();                      //update flowers
            hive.FindWaterInRange();                        //update water

            //apply any potions
            hive.ApplyBenefitEffects();

            //apply negative effects
            if (!hive.ApplyMaladiesEffects())               //Dead
            {
                return;
            }

            //update stage
            hive.Grow();

            //update maladies
            hive.UpdateMaladies();

            hive.BeeHiveComponent.InvalidateProperties();             //to refresh beehive properties
        }
Esempio n. 7
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
			m_Hive = (apiBeeHive)reader.ReadItem();
		}
Esempio n. 8
0
		public apiBeeHiveComponent(apiBeeHive hive) : base (2330)
		{	
			m_Hive = hive;
		}
Esempio n. 9
0
		public apiBeesComponent( apiBeeHive hive ) : base( 0x91b )
		{
			m_Hive = hive;
			Movable = false;
		}
Esempio n. 10
0
 public apiBeeHiveComponent(apiBeeHive hive) : base(2330)
 {
     m_Hive = hive;
 }
Esempio n. 11
0
 public apiBeesComponent(apiBeeHive hive) : base(0x91b)
 {
     m_Hive  = hive;
     Movable = false;
 }
Esempio n. 12
0
        public apiBeeHiveMainGump(Mobile from, apiBeeHive hive) : base(20, 20)
        {
            m_hive = hive;

            Closable   = true;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            AddPage(0);
            AddBackground(37, 26, 205, 161, 3600);

            //vines
            AddItem(12, 91, 3307);
            AddItem(11, 24, 3307);
            AddItem(206, 87, 3307);
            AddItem(205, 20, 3307);

            AddImage(101, 66, 1417);              //circle thing
            AddItem(118, 89, 2330);               //beehive

            //potions
            AddItem(195, 46, 3848);
            AddItem(185, 96, 3847);
            AddItem(190, 71, 3850);
            AddItem(183, 121, 3852);
            AddItem(186, 146, 3849);

            //status icons
            AddItem(-5, 76, 882);             //little bug thing
            AddItem(41, 121, 4088);
            AddItem(45, 148, 3336);
            AddItem(44, 49, 5154);
            AddItem(46, 100, 6884);

            //corner boxes
            AddImage(34, 20, 210);
            AddImage(228, 20, 210);
            AddImage(34, 172, 210);
            AddImage(228, 172, 210);

            //boxes around status icons
            AddImage(58, 71, 212);              //infestation
            AddImage(58, 96, 212);              //disease
            AddImage(58, 121, 212);             //water
            AddImage(58, 146, 212);             //flower

            //potion lables
            AddLabel(190, 47, 0x481, hive.potAgility.ToString());                //agility
            AddLabel(190, 71, 0x481, hive.potPoison.ToString());                 //poison
            AddLabel(190, 96, 0x481, hive.potCure.ToString());                   //cure
            AddLabel(190, 121, 0x481, hive.potHeal.ToString());                  //heal
            AddLabel(190, 146, 0x481, hive.potStrength.ToString());              //strength

            //status labels
            switch (hive.ParasiteLevel)               //parasites
            {
            case 1: AddLabel(81, 71, 52, @"-"); break;

            case 2: AddLabel(81, 71, 37, @"-"); break;
            }
            switch (hive.DiseaseLevel)               //disease
            {
            case 1: AddLabel(81, 96, 52, @"-"); break;

            case 2: AddLabel(81, 96, 37, @"-"); break;
            }
            switch (hive.ScaleWater())              //water
            {
            case ResourceStatus.None: AddLabel(81, 121, 37, @"X"); break;

            case ResourceStatus.VeryLow: AddLabel(81, 121, 37, @"-"); break;

            case ResourceStatus.Low: AddLabel(81, 121, 52, @"-"); break;

            case ResourceStatus.High: AddLabel(81, 121, 67, @"+"); break;

            case ResourceStatus.VeryHigh: AddLabel(81, 121, 52, @"+"); break;

            case ResourceStatus.TooHigh: AddLabel(81, 121, 37, @"+"); break;
            }
            switch (hive.ScaleFlower())              //flowers
            {
            case ResourceStatus.None: AddLabel(81, 145, 37, @"X"); break;

            case ResourceStatus.VeryLow: AddLabel(81, 145, 37, @"-"); break;

            case ResourceStatus.Low: AddLabel(81, 145, 52, @"-"); break;

            case ResourceStatus.High: AddLabel(81, 145, 67, @"+"); break;

            case ResourceStatus.VeryHigh: AddLabel(81, 145, 52, @"+"); break;

            case ResourceStatus.TooHigh: AddLabel(81, 145, 37, @"+"); break;
            }

            //corner labels
            AddLabel(40, 20, 0x481, ((int)hive.HiveStage).ToString());              //top left (stage)

            //last growth
            switch (m_hive.LastGrowth)
            {
            case HiveGrowthIndicator.PopulationDown: AddLabel(234, 20, 37, "-"); break;                     //red -

            case HiveGrowthIndicator.PopulationUp: AddLabel(234, 20, 67, "+"); break;                       //green +

            case HiveGrowthIndicator.NotHealthy: AddLabel(234, 20, 37, "!"); break;                         //red !

            case HiveGrowthIndicator.LowResources: AddLabel(234, 20, 52, "!"); break;                       //yellow !

            case HiveGrowthIndicator.Grown: AddLabel(234, 20, 92, "+"); break;                              //blue +
            }

            AddLabel(40, 172, 0x481, "?");           //help
            AddLabel(232, 172, 37, @"\");            //destroy
            AddItem(214, 176, 6256, 0);              //destroy

            //misc labels
            if (hive.HiveStage >= HiveStatus.Producing)
            {
                AddLabel(100, 42, 92, "Colony : " + hive.Population.ToString() + "0k");
            }
            else if (hive.HiveStage >= HiveStatus.Brooding)
            {
                AddLabel(100, 42, 92, "   Brooding");
            }
            else
            {
                AddLabel(100, 42, 92, "  Colonizing");
            }
            switch (hive.OverallHealth)              //overall health
            {
            case HiveHealth.Dying: AddLabel(116, 146, 37, "Dying"); break;

            case HiveHealth.Sickly: AddLabel(116, 146, 52, "Sickly"); break;

            case HiveHealth.Healthy: AddLabel(116, 146, 67, "Healthy"); break;

            case HiveHealth.Thriving: AddLabel(116, 146, 92, "Thriving"); break;
            }

            //resource
            AddButton(58, 46, 212, 212, (int)Buttons.butResource, GumpButtonType.Reply, 0);
            //help
            AddButton(34, 172, 212, 212, (int)Buttons.butHelp, GumpButtonType.Reply, 0);
            //destroy
            AddButton(228, 172, 212, 212, (int)Buttons.butDestroy, GumpButtonType.Reply, 0);
            //agility
            AddButton(202, 46, 212, 212, (int)Buttons.butAgil, GumpButtonType.Reply, 0);
            //poison
            AddButton(202, 71, 212, 212, (int)Buttons.butPois, GumpButtonType.Reply, 0);
            //cure
            AddButton(202, 96, 212, 212, (int)Buttons.butCure, GumpButtonType.Reply, 0);
            //heal
            AddButton(202, 121, 212, 212, (int)Buttons.butHeal, GumpButtonType.Reply, 0);
            //strength
            AddButton(202, 146, 212, 212, (int)Buttons.butStr, GumpButtonType.Reply, 0);
        }
Esempio n. 13
0
		public apiBeeHiveDestroyGump( Mobile from, apiBeeHive hive ) : base( 20, 20 )
		{
			m_hive = hive;

			Closable=true;
			Disposable=true;
			Dragable=true;
			Resizable=false;
			
			AddPage(0);
			
			AddBackground(37, 26, 205, 137, 3600);
			
			AddItem(11, 20, 3307);
			AddItem(205, 20, 3307);
			AddItem(12, 65, 3307);
			AddItem(206, 69, 3307);

			AddLabel(84, 43, 92, "Destory the hive?");
					
			AddItem(73, 68, 2330);
			AddItem(160, 68, 5359);	
			
			AddImage(131, 74, 5601);  //arrow

			AddButton(83, 114, 1150, 1152, (int)Buttons.butCancel, GumpButtonType.Reply, 0);
			AddButton(166, 115, 1153, 1155, (int)Buttons.butOkay, GumpButtonType.Reply, 0);
		}
Esempio n. 14
0
		public apiBeeHiveProductionGump( Mobile from, apiBeeHive hive ) : base( 20, 20 )
		{
			m_hive = hive;

			Closable=true;
			Disposable=true;
			Dragable=true;
			Resizable=false;

			AddPage(0);

			AddBackground(37, 133, 205, 54, 3600);
			AddBackground(37, 67, 205, 80, 3600);
			AddBackground(37, 26, 205, 55, 3600);
			
			
			AddItem(12, 91, 3307);
			AddItem(11, 24, 3307);
			AddItem(206, 87, 3307);
			AddItem(205, 20, 3307);
			
			AddItem(76, 99, 5154);
			AddItem(149, 97, 2540);

			//honey
			if( m_hive.HiveStage < HiveStatus.Producing )
			{//too early to produce
				AddLabel(185, 97, 37, "X");
			}
			else
			{
				AddLabel(185, 97, 0x481, m_hive.Honey.ToString() );
			}

			//wax
			if( m_hive.HiveStage < HiveStatus.Producing )
			{//too early to produce
				AddLabel(113, 97, 37, "X");
			}
			else
			{
				AddLabel(113, 97, 0x481, m_hive.Wax.ToString() );
			}			

			AddLabel(110, 43, 92, "Production");  //title

			AddItem(44, 47, 6256);
			AddItem(191, 151, 2540);
			
			AddItem(42, 153, 5154);

			AddImage(162, 96, 212);
			AddImage(90, 96, 212);
			
			AddButton(204, 150, 212, 212, (int)Buttons.butHoney, GumpButtonType.Reply, 0);
			AddButton(57, 43, 212, 212, (int)Buttons.butExit, GumpButtonType.Reply, 0);
			AddButton(56, 150, 212, 212, (int)Buttons.butWax, GumpButtonType.Reply, 0);
		}
Esempio n. 15
0
		public apiBeeHiveMainGump( Mobile from, apiBeeHive hive ) : base( 20, 20 )
		{
			m_hive = hive;

			Closable=true;
			Disposable=true;
			Dragable=true;
			Resizable=false;
			
			AddPage(0);
			AddBackground(37, 26, 205, 161, 3600);
			
			//vines
			AddItem(12, 91, 3307);
			AddItem(11, 24, 3307);
			AddItem(206, 87, 3307);
			AddItem(205, 20, 3307);

			AddImage(101, 66, 1417);  //circle thing
			AddItem(118, 89, 2330);   //beehive

			//potions
			AddItem(195, 46, 3848);
			AddItem(185, 96, 3847);
			AddItem(190, 71, 3850);
			AddItem(183, 121, 3852);
			AddItem(186, 146, 3849);

			//status icons
			AddItem(-5, 76, 882); //little bug thing
			AddItem(41, 121, 4088);
			AddItem(45, 148, 3336);
			AddItem(44, 49, 5154);
			AddItem(46, 100, 6884);
			
			//corner boxes
			AddImage(34, 20, 210);
			AddImage(228, 20, 210);
			AddImage(34, 172, 210);
			AddImage(228, 172, 210);
			
			//boxes around status icons
			AddImage(58, 71, 212);  //infestation
			AddImage(58, 96, 212);  //disease
			AddImage(58, 121, 212); //water
			AddImage(58, 146, 212); //flower

			//potion lables
			AddLabel(190, 47, 0x481,  hive.potAgility.ToString() );  //agility
			AddLabel(190, 71, 0x481,  hive.potPoison.ToString() );   //poison
			AddLabel(190, 96, 0x481,  hive.potCure.ToString() );     //cure
			AddLabel(190, 121, 0x481, hive.potHeal.ToString() );     //heal
			AddLabel(190, 146, 0x481, hive.potStrength.ToString() ); //strength	

			//status labels
			switch( hive.ParasiteLevel )  //parasites
			{
				case 1: AddLabel(81, 71, 52, @"-"); break;
				case 2: AddLabel(81, 71, 37, @"-"); break;
			}
			switch( hive.DiseaseLevel )  //disease
			{
				case 1: AddLabel(81, 96, 52, @"-");break;
				case 2: AddLabel(81, 96, 37, @"-");break;
			}
			switch( hive.ScaleWater() ) //water
			{
				case ResourceStatus.None    : AddLabel(81, 121, 37, @"X"); break;
				case ResourceStatus.VeryLow : AddLabel(81, 121, 37, @"-"); break;
				case ResourceStatus.Low     : AddLabel(81, 121, 52, @"-"); break;
				case ResourceStatus.High    : AddLabel(81, 121, 67, @"+"); break;
				case ResourceStatus.VeryHigh: AddLabel(81, 121, 52, @"+"); break;
			    case ResourceStatus.TooHigh : AddLabel(81, 121, 37, @"+"); break;
			}
			switch( hive.ScaleFlower() ) //flowers
			{
				case ResourceStatus.None    : AddLabel(81, 145, 37, @"X"); break;
				case ResourceStatus.VeryLow : AddLabel(81, 145, 37, @"-"); break;
				case ResourceStatus.Low     : AddLabel(81, 145, 52, @"-"); break;
				case ResourceStatus.High    : AddLabel(81, 145, 67, @"+"); break;
				case ResourceStatus.VeryHigh: AddLabel(81, 145, 52, @"+"); break;
				case ResourceStatus.TooHigh : AddLabel(81, 145, 37, @"+"); break;
			}
			
			//corner labels
			AddLabel(40, 20, 0x481, ((int)hive.HiveStage).ToString() ); //top left (stage)
			
			//last growth
			switch( m_hive.LastGrowth )
			{
				case HiveGrowthIndicator.PopulationDown: AddLabel(234, 20, 37, "-"); break; //red -
				case HiveGrowthIndicator.PopulationUp  : AddLabel(234, 20, 67, "+"); break; //green +
				case HiveGrowthIndicator.NotHealthy    : AddLabel(234, 20, 37, "!"); break; //red !
				case HiveGrowthIndicator.LowResources  : AddLabel(234, 20, 52, "!"); break; //yellow !
				case HiveGrowthIndicator.Grown         : AddLabel(234, 20, 92, "+"); break; //blue +
			}
			
			AddLabel(40, 172, 0x481, "?"); //help
			AddLabel(232, 172, 37, @"\");   //destroy
			AddItem(214, 176, 6256, 0);  //destroy

			//misc labels
			if( hive.HiveStage >= HiveStatus.Producing )
				AddLabel(100, 42, 92, "Colony : "+hive.Population.ToString()+"0k" );
			else if( hive.HiveStage >= HiveStatus.Brooding )
				AddLabel(100, 42, 92, "   Brooding");
			else
				AddLabel(100, 42, 92, "  Colonizing");
			switch( hive.OverallHealth ) //overall health
			{
				case HiveHealth.Dying: AddLabel(116, 146, 37, "Dying"); break;
				case HiveHealth.Sickly: AddLabel(116, 146, 52, "Sickly"); break;
				case HiveHealth.Healthy: AddLabel(116, 146, 67, "Healthy"); break;
				case HiveHealth.Thriving: AddLabel(116, 146, 92, "Thriving"); break;
			}  

			//resource
			AddButton(58, 46, 212, 212, (int)Buttons.butResource, GumpButtonType.Reply, 0);
			//help
			AddButton(34, 172, 212, 212, (int)Buttons.butHelp, GumpButtonType.Reply, 0);
			//destroy
			AddButton(228, 172, 212, 212, (int)Buttons.butDestroy, GumpButtonType.Reply, 0);
			//agility
			AddButton(202, 46, 212, 212, (int)Buttons.butAgil, GumpButtonType.Reply, 0);
			//poison
			AddButton(202, 71, 212, 212, (int)Buttons.butPois, GumpButtonType.Reply, 0);
			//cure
			AddButton(202, 96, 212, 212, (int)Buttons.butCure, GumpButtonType.Reply, 0);
			//heal
			AddButton(202, 121, 212, 212, (int)Buttons.butHeal, GumpButtonType.Reply, 0);
			//strength
			AddButton(202, 146, 212, 212, (int)Buttons.butStr, GumpButtonType.Reply, 0);

		}
        public SwitchDormantGump(Mobile from, apiBeeHive hive)
            : base(20, 20)
        {
            from.CloseGump(typeof(SwitchDormantGump));
            m_hive = hive;

            Closable = true;
            Disposable = true;
            Dragable = true;
            Resizable = false;

            AddPage(0);

            AddImage(0, 0, 0x816);
            AddButton(34, 74, 0x81A, 0x81B, 1, GumpButtonType.Reply, 0); // OK
            AddButton(88, 74, 0x995, 0x996, 2, GumpButtonType.Reply, 0); // Cancel

            string msg = "Put the bees to dormant?";
            if (m_hive.IsDormant)
                msg = "Wake up the bees?";
            AddHtml(30, 25, 120, 40, msg, false, false);
        }