コード例 #1
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            switch (info.ButtonID)
            {
                case 0: break;
                case 1:
                    if (from is PlayerMobile && !CrateRace.Participant(from))
                    {
                        PlayerMobile pm = (PlayerMobile)from;

                        if (pm.HasDonated || CrateRace.Price < 1 || (CrateRace.Price > 0 && Banker.Withdraw(pm, CrateRace.Price)))
                        {
                            SunnySystem.Undress(pm);

                            if (!pm.HasDonated && CrateRace.Price > 0)
                                CrateRace.BankedMoney += CrateRace.Price;

                            RaceData data = new RaceData(pm);
                            CrateRace.PartData[pm] = data;
                            CrateRace.PartList.Add(data);
                            pm.SendGump(new CrateRacePlacer(data));
                            CrateRace.SetPlayerSpeed(pm);

                            pm.MoveToWorld(CrateRace.StoneLocation, CrateRace.Map);
                            pm.SendMessage("You have entered the race!");
                        }

                        else
                            from.SendMessage("You do not have enough money to participate.");
                    }

                    else
                        from.SendMessage("The race has already started.");

                    break;
            }
        }
コード例 #2
0
        public CrateRacePlacerAccept(int x, int y, RaceData data)
            : base(x, y)
        {
            m_Rd = data;
            Xaxis = x;
            Yaxis = y;

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

            AddBackground(0, 0, 480, 290, 2620);
            AddHtml(90, 30, 300, 100, Colorize("If this is the correct place where you want your racegump to pop up, please click okay. If you wish to choose a different location please click cancel.", "ffffff"), false, false);
            AddButton(120, 200, 242, 241, 0, GumpButtonType.Reply, 0);
            AddButton(260, 200, 248, 247, 1, GumpButtonType.Reply, 0);
        }
コード例 #3
0
        public CrateRacePlacer(RaceData data)
            : base(0, 0)
        {
            m_Rd = data;

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

            for (int i = 0; i < 17; i++)
                for (int j = 0; j < 11; j++)
                {
                    AddBackground(i * 60, j * 60, 60, 60, 2620);
                    AddButton(i * 60 + 15, j * 60 + 15, 2641, 2641, (int)(i * 100 + j), GumpButtonType.Reply, 0);
                }
        }
コード例 #4
0
 public CrateRaceGump2(RaceData data)
     : base(data)
 {
 }
コード例 #5
0
        public CrateRaceGump1(RaceData data)
            : base(data.Xaxe, data.Yaxe)
        {
            m_Rd = data;

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

            AddPage(0);
            AddImage(60, 18, 5058, 2105);
            AddImage(188, 18, 5058, 2105);
            AddImage(316, 18, 5058, 2105);
            AddImage(59, 146, 5058, 2105);
            AddImage(187, 145, 5058, 2105);
            AddImage(315, 145, 5058, 2105);
            AddImage(412, 142, 5058, 2105);
            AddImage(415, 18, 5058, 2105);// lback
            AddImage(143, 62, 2440, 2105);// titelback
            AddLabel(173, 63, 1152, "Crate Race Gump"); //title
            AddAlphaRegion(80, 50, 54, 54);//crate reg
            AddAlphaRegion(80, 120, 54, 54);//crate reg
            AddAlphaRegion(80, 190, 54, 54);//crate reg
            if (m_Rd.Crate1 != null)
                AddButton(85, 55, m_Rd.Crate1.GumpID, m_Rd.Crate1.GumpID, (int)Buttons.Crate1, GumpButtonType.Reply, 0);//crate1
            if (m_Rd.Crate2 != null)
                AddButton(85, 125, m_Rd.Crate2.GumpID, m_Rd.Crate2.GumpID, (int)Buttons.Crate2, GumpButtonType.Reply, 0);//crate2
            if (m_Rd.Crate3 != null)
                AddButton(85, 195, m_Rd.Crate3.GumpID, m_Rd.Crate3.GumpID, (int)Buttons.Crate3, GumpButtonType.Reply, 0);//crate3
            AddAlphaRegion(350, 50, 54, 54);//crate shield reg
            AddAlphaRegion(420, 50, 54, 54);//crate shield reg
            if (m_Rd.TempMirror)
                AddImage(355, 55, 2275);//crate tempshield
            if (m_Rd.Mirror)
                AddImage(425, 55, 2265);//crate shield

            //deco
            AddImage(530, 15, 10431, 2105);//rightupbody
            AddImage(511, 0, 10430, 2105);//righthead
            AddImage(12, 15, 10421, 2105);//leftupbody
            AddImage(35, 00, 10420, 2105);//lefthead
            AddImage(26, 135, 10422, 2105);///leftdownbody
            AddImage(524, 135, 10432, 2105);//rightdownbody
            //firebreath

            for (int i = 95; i <= 500; i += 16 )
                AddImage(i, 13, 10250, 2105);

            //bottomtiles
            AddImage(116, 269, 9267, 2105);
            AddImage(50, 269, 9267, 2105);
            AddImage(534, 269, 9268, 2105);
            AddImage(47, 269, 9266, 2105);
            //deco

            int hits = (int)(100 * m_Rd.Part.Hits / m_Rd.Part.HitsMax);
            int hitshue = 73;
            if (hits < 30)
                hitshue = 38;

            else if (hits < 50)
                hitshue = 55;

            AddAlphaRegion(140, 119, 383, 117);//large txt reg
            AddLabel(155, 130, hitshue, "Health:"); AddLabel(235, 130, hitshue, String.Format("{0}%", hits.ToString()));
            AddLabel(155, 150, 1152, "Lap:"); AddLabel(235, 150, 1152, m_Rd.Lap.ToString());
            AddLabel(155, 170, 1152, "Laps to go:"); AddLabel(235, 170, 1152, (CrateRace.Laps - m_Rd.Lap).ToString());
            AddLabel(155, 190, 1152, "Rank:"); AddLabel(235, 190, 1152, m_Rd.Place.ToString());
            AddLabel(295, 150, 1152, "Crates:"); AddLabel(375, 150, 1152, CrateRace.Crates.ToString());
            AddLabel(295, 170, 1152, "Opponents:"); AddLabel(375, 170, 1152, (CrateRace.Participants - 1).ToString());
            AddLabel(295, 190, 1152, "First Place:"); AddLabel(375, 190, 1152, CrateRace.FirstPlace == null ? "Noone" : CrateRace.FirstPlace.Name);
        }
コード例 #6
0
        public static void SetPlayerSpeed(RaceData rd)
        {
            if (QuickSpeed)
            {
                if (rd.Frozen)
                    rd.Part.Send(Reset);
                else
                    rd.Part.Send(SpeedUp);
            }

            else
            {
                if (rd.Frozen)
                    rd.Part.Send(Walk);

                else
                    rd.Part.Send(Reset);
            }
        }
コード例 #7
0
        public static void HandleDamage(RaceData rd, double amount)
        {
            if (rd.TempMirror)
            {
                rd.Part.SendMessage("But your temporary shield has saved you from any harm done.");
                rd.TempMirror = false;
            }
            else if (rd.Mirror)
            {
                rd.Part.SendMessage("But your shield has saved you from any harm done.");
                rd.Mirror = false;
            }

            else
            {
                int dam = (int)(rd.Part.HitsMax * amount);
                int damage = (int)(dam - (dam * ((OpenCrates + (Crates / 2)) / 100)));
                rd.Part.Damage(damage);
            }
        }