Example #1
0
        public TurboSlotGump(TurboSlot Slot, int[] Symbols)
            : base(25, 25)
        {
            m_Slot = Slot;
            m_Symbols = Symbols;

            if (m_Slot == null)
                return; // Something is obviously wrong!
            int dispy = m_Symbols[13];
            int backgroundcolor = m_Symbols[14];
            int titlecolor = m_Symbols[15];
            int titlestyle = m_Symbols[16];
            int headingcolor1 = m_Symbols[17];
            int headingcolor2 = m_Symbols[18];
            int paycolor = m_Symbols[19];
            int slotart = m_Symbols[20];
            decimal payout = 0;
            string[] Jackpot = { null, null };
            bool progressive = false;
            int ProgressiveHue = 0;
            int PayoutHue = 37;
            int lastjackpotstarty = 85;
            int progstarty = 65;
            int symbolxoffset = 0;
            string text = null;
            int tilecolor = 9304;
            if ((SlotThemeType)m_Slot.SlotTheme == SlotThemeType.GruesomeGambling || (SlotThemeType)m_Slot.SlotTheme == SlotThemeType.StatScrolls)
                tilecolor = 9204;
            else if ((SlotThemeType)m_Slot.SlotTheme == SlotThemeType.Holiday1)
                tilecolor = 0xBBC;
            else if ((SlotThemeType)m_Slot.SlotTheme == SlotThemeType.FarmerFaceoff || (SlotThemeType)m_Slot.SlotTheme == SlotThemeType.OffToTheRaces
                                    || (SlotThemeType)m_Slot.SlotTheme == SlotThemeType.TrophyHunter)
                tilecolor = 2524;
            else if ((SlotThemeType)m_Slot.SlotTheme == SlotThemeType.PowerScrolls)
            {
                tilecolor = 9354;
                symbolxoffset = 16;
            }

            if (backgroundcolor == 0)
                text = String.Format("<body bgcolor=\"black\"><basefont SIZE={0} COLOR=\"#{1:x6}\"><CENTER>{2}</CENTER></basefont></body>", titlestyle, titlecolor, m_Slot.Name);
            else if (backgroundcolor < 0)
                text = String.Format("<basefont SIZE={0} COLOR=\"#{1:x6}\"><CENTER>{2}</CENTER></basefont>", titlestyle, titlecolor, m_Slot.Name);
            else
                text = String.Format("<body bgcolor=\"#{0:x6}\"><basefont SIZE={1} COLOR=\"#{2:x6}\"><CENTER>{3}</CENTER></basefont></body>", backgroundcolor, titlestyle, titlecolor, m_Slot.Name);
            if ((m_Slot.ProgSlotMaster != null && !m_Slot.ProgSlotMaster.Deleted && ((TurboSlot)m_Slot.ProgSlotMaster).ProgIsMaster) || m_Slot.ProgIsMaster)
            {
                progressive = true;
                lastjackpotstarty = 110;
                if (m_Slot.ProgIsMaster)
                {
                    //pjackpot += m_Slot.ProgJackpot;
                    ProgressiveHue = m_Slot.Hue;
                }
                else
                {
                    //pjackpot += ((TurboSlot) m_Slot.ProgSlotMaster).ProgJackpot;
                    ProgressiveHue = ((TurboSlot)m_Slot.ProgSlotMaster).Hue;
                }
                ProgressiveHue += -1;
                if (ProgressiveHue < 0)
                    ProgressiveHue = 1149;
            }
            Closable = true;
            Disposable = true;
            Dragable = true;
            Resizable = false;
            AddPage(0);
            AddBackground(18, 64, 371, 278, 5120);
            AddBackground(32, 193, 345, 100, 2620);
            AddImageTiled(23, 298, 363, 10, 5121);
            AddHtml(30, 65, 170, 23, @text, (bool)false, (bool)false);

            if (m_Slot.ShowPayback || (m_Slot.InUseBy != null && m_Slot.InUseBy.AccessLevel != AccessLevel.Player))
            {
                float payoutdif = Math.Abs(m_Slot.w_Percentage - m_Slot.WinningPercentage);
                PayoutHue = 267;
                if (payoutdif > 15.0f || m_Slot.WinningPercentage > 100.0f)
                    PayoutHue = 37;
                else if (payoutdif > 7.0f)
                    PayoutHue = 55;
                else if (payoutdif > 3.0f)
                    PayoutHue = 87;
                text = String.Format("{0:##0.00}%", m_Slot.WinningPercentage);
                AddLabel(205, 65, headingcolor1, @"Payback Percentage:");
                AddLabel(330, 65, PayoutHue, @text);
                progstarty = 85;
                if (progressive)
                    lastjackpotstarty = 125;
                if (m_Slot.InUseBy != null && m_Slot.InUseBy.AccessLevel != AccessLevel.Player)
                {
                    if (m_Slot.w_Percentage > 99.5f)
                        PayoutHue = 37;
                    else if (m_Slot.w_Percentage > 90.0f)
                        PayoutHue = 267;
                    else if (m_Slot.w_Percentage > 80.0f)
                        PayoutHue = 87;
                    else if (m_Slot.w_Percentage > 60.0f)
                        PayoutHue = 55;
                    else if (m_Slot.w_Percentage > 40.0f)
                        PayoutHue = 37;
                    string[] pstring = new string[] { "L", "N", "T", "E", "C", "R" };
                    text = String.Format("({0})", pstring[(int)m_Slot.CurrentPayback]);
                    if ((int)m_Slot.SlotPaybackOdds == 5)
                        AddLabel(208, 80, 37, @text);
                    else
                        AddLabel(208, 80, headingcolor1, @text);
                    AddLabel(232, 80, headingcolor1, @"Statisical Odds:");
                    text = String.Format("{0:##0.00}%", m_Slot.w_Percentage);
                    AddLabel(330, 80, PayoutHue, @text);
                    progstarty = 155;
                    lastjackpotstarty = 94;
                }
            }
            AddImageTiled(37, 200, 335, 86, 9354);
            AddImageTiled(150, 202, 2, 83, 9353);
            AddLabel(30, 100, headingcolor2, @"Cost: ");
            AddLabel(65, 100, paycolor, m_Slot.Cost.ToString());
            AddLabel(30, 120, headingcolor2, @"Credits: ");
            AddLabel(80, 120, paycolor, m_Slot.Won.ToString());
            AddLabel(30, 140, headingcolor2, @"Last Pay: ");
            AddLabel(92, 140, paycolor, m_Slot.LastPay.ToString());
            AddButton(30, 163, 4026, 4027, 11, GumpButtonType.Reply, 0);
            AddLabel(65, 164, headingcolor1, @"View Pay Table");
            AddButton(30, 307, 4020, 4021, 12, GumpButtonType.Reply, 0);
            if (m_Slot.FreeSpin)
                AddLabel(65, 307, headingcolor2, @"Free");
            else
                AddLabel(65, 307, headingcolor1, @"Spin");
            AddButton(118, 307, 4029, 4030, 13, GumpButtonType.Reply, 0);
            AddLabel(153, 307, headingcolor1, @"Cash Out");
            AddButton(235, 300, 4037, 4036, 14, GumpButtonType.Reply, 0);
            AddLabel(270, 307, headingcolor1, @"ATM");
            AddImageTiled(60, 205, 75, 75, tilecolor);
            AddImageTiled(167, 205, 75, 75, tilecolor);
            AddImageTiled(274, 205, 75, 75, tilecolor);
            AddImageTiled(258, 202, 2, 83, 9353);
            if (slotart != 0)
                ShowSymbol(155, 90, slotart);
            if (m_Slot.LastWonBy != null && !m_Slot.LastWonBy.Deleted)
            {
                AddLabel(230, lastjackpotstarty, headingcolor2, "Last Jackpot won by:");
                text = String.Format("<BASEFONT COLOR=#FFFFFF><Center>{0}<//Center></BASEFONT>", m_Slot.LastWonBy.Name);
                AddHtml(205, lastjackpotstarty + 15, 180, 15, @text, (bool)false, (bool)false);
                text = String.Format("{0:MM/dd/yy hh:mm:ss tt}", m_Slot.LastWonByDate);
                AddLabel(205, lastjackpotstarty + 30, headingcolor2, "Date:");
                AddLabel(237, lastjackpotstarty + 30, paycolor, text);
                text = String.Format("{0:##,###,### Gold!}", m_Slot.LastWonAmount);
                AddLabel(202, lastjackpotstarty + 45, headingcolor2, "Value:");
                AddLabel(237, lastjackpotstarty + 45, paycolor, text);
            }
            if (progressive)
            {
                Jackpot = m_Slot.GetJackpotPayoutStr(0, out payout);
                AddHtml(245, progstarty, 356, 23, @"<BASEFONT COLOR=#FFFFFF><U>Progressive Jackpot</U></BASEFONT>", (bool)false, (bool)false);
                AddLabel(280, progstarty + 15, ProgressiveHue, Jackpot[0]);
            }
            ShowSymbol(75 - symbolxoffset, 220 - dispy / 3, m_Slot.ReelOne);
            ShowSymbol(183 - symbolxoffset, 220 - dispy / 3, m_Slot.ReelTwo);
            ShowSymbol(290 - symbolxoffset, 220 - dispy / 3, m_Slot.ReelThree);
            if (Utility.Random(25000) == 45)
                CEOCookie(headingcolor2);
        }
Example #2
0
			public InternalTimer2(TurboSlot slot, TimeSpan delay)
				: base(delay)
			{
				Priority = TimerPriority.OneSecond;
				m_slot = slot;
			}
Example #3
0
		public NewMinerBonusGump( TurboSlot Slot, int[] Symbols, bool initialize, bool[] b, int[] c, int totalwon ) : base( 25, 25 )
		{
			m_Slot = Slot;
			m_Symbols = Symbols;
            m_b = b;
            m_c = c;
            m_TotalWon = totalwon;
            if (initialize)
            {
                double zerochance = .40;
                bool fiftyk = false;
                for (int i = 0; i < 9; i++)
                {
                    b[i] = false;
                    if (fiftyk || ( i == 3 && 0.10 < Utility.RandomDouble())) // Only allow one fifty K spot and worsen the odds and rarely on the top button! :P
                    {
                        if (zerochance < Utility.RandomDouble())
                            c[i] = Utility.RandomList(5000, 5000, 1000, 1000, 1000, 500, 500, 500, 500, 500, 500, 500, 500, 500, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50);
                        else
                            c[i] = 0;
                        if (i == 1) c[i] = 111;
                    }
                    else
                    {
                        if (zerochance < Utility.RandomDouble())
                            c[i] = Utility.RandomList(50000, 10000, 5000, 5000, 1000, 1000, 1000, 1000, 1000, 500, 500, 500, 500, 500, 500, 500, 500, 100, 100, 100, 100, 100, 100, 100, 100, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50);
                        else
                            c[i] = 0;
                        if (c[i] == 50000)
                        {
                            fiftyk = true;
                            zerochance += .28;
                        }
                    }
                    if (c[i] != 0)
                            zerochance += .05;
                }
            }
            Disposable = true;
            Dragable = true;
            Closable = true;
            for (int i = 0; i < 9; i++)
            {
                if (!b[i])
                {
                    Disposable = false;
                    Dragable = true;
                    Closable = false;
                    break;
                }
            }
			Resizable=false;
			AddPage(0);
			AddBackground(52, 25, 393, 430, 5120);
			AddImage(59, 63, 5528);
			AddImage(60, 30, 5573);
			AddLabel(123, 26, 1149, @"Pick a location to mine, If you mine up coal you lose.");
			AddLabel(123, 42, 1149, @"You keep mining till you find coal or all are gone.");

            for (int i = 0; i < 9; i++)
            {
                if (!b[i])
                {
                    AddButton(buttonx[i], buttony[i], 2117, 2118, i + 1, GumpButtonType.Reply, 0);
#if TestMode 
                    if (m_Slot.TestMode)
                        AddLabel(buttonx[i], buttony[i]+ 10, 1160, c[i].ToString());
#endif
                }
                else
                {
                    AddImage(buttonx[i], buttony[i], 5231);
                    if (c[i] != 0)
                        AddLabel(buttonx[i], buttony[i], 1160, c[i].ToString());
                    else
                        AddLabel(buttonx[i], buttony[i], 1160, @"!! Coal !!");
                }
            }
		}
Example #4
0
		public void RemoveMaster(TurboSlot s)
		{
			if (m_ProgressiveMaster != null && m_ProgressiveMaster == s)
				m_ProgressiveMaster = null;
		}
Example #5
0
		public void RemoveSlave(TurboSlot s)
		{
			if (m_SlotSlaves != null && m_SlotSlaves.Contains(s))
				m_SlotSlaves.Remove(s);
		}
Example #6
0
		public void AddSlave(TurboSlot s)
		{
			if (m_SlotSlaves != null && m_SlotSlaves.Contains(s))
				return;
			m_SlotSlaves.Add(s);
		}
Example #7
0
		public void JackpotHit(Mobile from, int jackpot, TurboSlot slot)
		{
			if (!m_isProgMaster)
				return;
			m_ProgressiveJackpot = m_DefaultStartProgressive;
#if PROFILE
			if (m_Profile)
				return;
#endif
			Point3D loc = Point3D.Zero;
			ArrayList announcedSlots = new ArrayList();
			announcedSlots.Add(this);
			//InvalidateProperties();		
			Effects.PlaySound(new Point3D(this.X, this.Y, this.Z), this.Map, 1035);
			from.FixedParticles(0x375A, 9, 20, 5027, EffectLayer.Waist);
			Effects.SendLocationEffect(new Point3D(this.X, this.Y, this.Z), this.Map, 0x375A, 15, this.Hue, 0);
			string text = String.Format("{0} has won a Progressive Jackpot valued at {1} gold!!!", from.Name, jackpot);
			if (m_AnnounceJackpot && jackpot > 500000)  // Don't report the small jackpots
				AnnounceJackpot(from, text);
			this.PublicOverheadMessage(0, this.Hue, false, text);
			if (m_SlotSlaves != null)
			{

				foreach (TurboSlot s in m_SlotSlaves)   // Announce the jackpot, but not to every machine to avoid a messy screen
				{
					bool announce = true;
					s.ActivateBlinkTimer(this.Hue);
					foreach (TurboSlot a in announcedSlots)
					{
						if (Utility.InRange(s.Location, a.Location, 4))
						{
							announce = false;
							break;
						}
					}
					if (announce)
					{
						s.PublicOverheadMessage(0, this.Hue, false, text);
						Effects.PlaySound(new Point3D(s.X, s.Y, s.Z), s.Map, 1035);
						announcedSlots.Add(s);
					}
					Effects.SendLocationEffect(new Point3D(s.X, s.Y, s.Z), s.Map, 0x375A, 15, this.Hue, 0);
					loc = s.Location;
				}
			}
		}
		public TurboSlotPayTableGump( TurboSlot Slot, int[] Symbols) : base( 25, 25 )
		{
			m_Slot = Slot;
			m_Symbols = Symbols;
			
			int anybarsindex = m_Symbols[10];
			int totalsymbols = m_Symbols[11];
			int dispx = m_Symbols[12];
			int dispy = m_Symbols[13];
			int backgroundcolor = m_Symbols[14];
			int titlecolor = m_Symbols[15];
            int titlestyle = m_Symbols[16];
			int headingcolor1 = m_Symbols[17];
			int headingcolor2 = m_Symbols[18];
			int paycolor = m_Symbols[19];
            decimal payout;
            int tilecolor = 9304;
            if ((SlotThemeType)m_Slot.SlotTheme == SlotThemeType.GruesomeGambling || (SlotThemeType)m_Slot.SlotTheme == SlotThemeType.StatScrolls)
                tilecolor = 9204;
            else if ((SlotThemeType)m_Slot.SlotTheme == SlotThemeType.Holiday1)
                tilecolor = 0xBBC;
            else if ((SlotThemeType)m_Slot.SlotTheme == SlotThemeType.FarmerFaceoff || (SlotThemeType)m_Slot.SlotTheme == SlotThemeType.OffToTheRaces
                                    || (SlotThemeType)m_Slot.SlotTheme == SlotThemeType.TrophyHunter)
                tilecolor = 2524;

			string text = null;
			if (backgroundcolor == 0)
				text = String.Format( "<body bgcolor=\"black\"><basefont SIZE={0} COLOR=\"#{1:x6}\"><CENTER>{2}</CENTER></basefont></body>",titlestyle, titlecolor, m_Slot.Name);
			else if (backgroundcolor < 0)
				text = String.Format( "<basefont SIZE={0} COLOR=\"#{1:x6}\"><CENTER>{2}</CENTER></basefont>",titlestyle, titlecolor, m_Slot.Name);
			else
				text = String.Format( "<body bgcolor=\"#{0:x6}\"><basefont SIZE={1} COLOR=\"#{2:x6}\"><CENTER>{3}</CENTER></basefont></body>",backgroundcolor, titlestyle, titlecolor, m_Slot.Name);

			bool progressive = false;
			int ProgressiveHue = 0;

			if ((m_Slot.ProgSlotMaster != null && !m_Slot.ProgSlotMaster.Deleted && ((TurboSlot) m_Slot.ProgSlotMaster).ProgIsMaster) || m_Slot.ProgIsMaster)
			{
				progressive = true;
				if (m_Slot.ProgIsMaster)
					ProgressiveHue = m_Slot.Hue;
				else
					ProgressiveHue = ((TurboSlot) m_Slot.ProgSlotMaster).Hue;
				ProgressiveHue += -1;
				if (ProgressiveHue < 0)
					ProgressiveHue = 1149;
			}


			bool bonusround = ((BonusRoundType) m_Slot.BonusRound != BonusRoundType.None);// ? true:false;
			int tiledlength = (30 * totalsymbols) + (dispy * 7);
			//int backgroundlength = 425 (30 * totalsymbols) + (dispy * 10);
			int backgroundlength = 185 + (30 * totalsymbols) + (dispy * 10);
            if ((ScatterType)m_Slot.ScatterPay == ScatterType.None)
				backgroundlength = (backgroundlength - 90) - (dispy*2);
            else if ((ScatterType)m_Slot.ScatterPay == ScatterType.LeftOnly)
            {
                backgroundlength = (backgroundlength - 30);
                tiledlength += 60 + (dispy * 2);
            }

			if (m_Slot.AnyBars)
				tiledlength += 30 + dispy;
			else
				backgroundlength = (backgroundlength - 30) - dispy;
			if (bonusround)
			{
				tiledlength -= (30 + dispy);
				backgroundlength = backgroundlength + 30;
			}
            if ((SlotThemeType)m_Slot.SlotTheme == SlotThemeType.PowerScrolls)
            {
                tiledlength += 35;
                backgroundlength += 35;
            }
			Closable=true;
			Disposable=true;
			Dragable=true;
			Resizable=false;
			AddPage(0);
            int backgroundx = 0;
            if ((int)m_Slot.JackpotRewards != 0)
                    backgroundx = 35;
			AddBackground(37, 34, 180+backgroundx+dispx*3, backgroundlength, 5120);

			AddHtml( 45, 41, 165+backgroundx+dispx*3, 22, @text, (bool)false, (bool)false);

			AddImageTiled(45, 84, 102+dispx*3, tiledlength, tilecolor);
			AddLabel(45, 64, headingcolor1, @"Pay Table");
            if (progressive)
            {
                m_Slot.GetJackpotPayoutStr(0, out payout);
                payout = payout * 100;
                AddLabel(147 + dispx * 3, 67, ProgressiveHue, @"(Progessive)");
            }
			int starty = 85;
			for (int i = 0; i < totalsymbols ; i++)
			{
				if (!bonusround || (bonusround && i != m_Symbols[8]))
				{
					ShowSymbol(45, starty, m_Symbols[i]);
					ShowSymbol(75+dispx, starty, m_Symbols[i]);
					ShowSymbol(105+dispx*2, starty, m_Symbols[i]);
                    if (i == 0 && progressive)
                        ShowPayout(155 + dispx * 3, starty, paycolor, m_Slot.GetJackpotPayoutStr(0, out payout));
                    else
					    ShowPayout(155+dispx*3, starty, paycolor, m_Slot.GetJackpotPayoutStr(i, out payout));
					starty += 30 + dispy;
				}
				if (i==anybarsindex && m_Slot.AnyBars)
				{
					ShowSymbol(45,  starty, m_Symbols[0]);
					ShowSymbol(105+dispx*2, starty, m_Symbols[anybarsindex]);
					AddLabel(46+dispx+dispx/2, starty+3, headingcolor2, @"Any Three Above"); // was 65
					ShowPayout(155+dispx*3, starty, paycolor, m_Slot.GetJackpotPayoutStr(8, out payout));
					starty += 30 + dispy;
				}

			}

            if ((ScatterType)Slot.ScatterPay != ScatterType.None)
            {
                if ((ScatterType)Slot.ScatterPay == ScatterType.Any)
                {
                    starty += 5;
                    int ScatterSymbol = m_Symbols[m_Symbols[9]];
                    if ((ScatterType)m_Slot.ScatterPay == ScatterType.Any)
                        AddLabel(45, starty, headingcolor1, @"Scatter Pay");
                    else
                        AddLabel(45, starty, headingcolor1, @"Extra Chance");
                    starty += 25;
                    AddImageTiled(45, starty - 4, 101 + dispx * 3, 64 + dispy, tilecolor);
                    ShowSymbol(45, starty, ScatterSymbol);
                    AddLabel(74 + dispx + dispx / 2, starty - 2, headingcolor2, @"Any One");
                    ShowPayout(154 + dispx * 3, starty, paycolor, m_Slot.GetJackpotPayoutStr(9, out payout));
                    starty += 30 + dispy / 2;
                    ShowSymbol(45, starty, ScatterSymbol);
                    ShowSymbol(75 + dispx, starty, ScatterSymbol);
                    AddLabel(74 + dispx + dispx / 2, starty - 2, headingcolor2, @"Any Two");
                    ShowPayout(154 + dispx * 3, starty, paycolor, m_Slot.GetJackpotPayoutStr(10, out payout));
                }
                else
                {
                    int ScatterSymbol = m_Symbols[m_Symbols[9]];
                    ShowSymbol(45, starty, ScatterSymbol);
                    ShowSymbol(75 + dispx, starty, ScatterSymbol);
                    AddLabel(105 + dispx*2 + dispx / 2, starty+2, headingcolor2, @"Any");
                    ShowPayout(154 + dispx * 3, starty, paycolor, m_Slot.GetJackpotPayoutStr(10, out payout));
                    starty += 30 + dispy;
                    ShowSymbol(45, starty, ScatterSymbol);
                    AddLabel(75 + dispx + dispx / 2, starty+2, headingcolor2, @"Any");
                    AddLabel(105 + dispx*2 + dispx / 2, starty+2, headingcolor2, @"Any");
                    ShowPayout(154 + dispx * 3, starty, paycolor, m_Slot.GetJackpotPayoutStr(9, out payout));
                }
				starty += 35 + dispy;
			}
			if (bonusround)
			{
				int BonusSymbol = m_Symbols[m_Symbols[8]];
				AddLabel(45, starty, headingcolor1, @"Bonus Round"); //426
				starty += 25;
				AddImageTiled(45, starty-4, 101+dispx*3, 35+dispy/2, tilecolor);
				ShowSymbol(45, starty, BonusSymbol);
				ShowSymbol(75+dispx, starty, BonusSymbol);
				ShowSymbol(105+dispx*2, starty, BonusSymbol);
			}
		}