Exemplo n.º 1
0
        /// <summary>
        /// Contains the design infor for the Duel Confirmation gump
        /// </summary>
        /// <param name="from">Mobile requesting the duel</param>
        /// <param name="to">Mobile requested to duel</param>
        /// <param name="stone">Duel Stone the gump is linked to</param>
        public DuelConfirmGump(Mobile from, Mobile to, DuelStone stone)
            : base(20, 30)
        {
            m_Requester = from;
            m_Acceptor = to;
            m_Stone = stone;

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

            AddPage(0);
            AddBackground(100, 100, 276, 331, 9350);
            AddHtml(117, 115, 241, 32, @"<center>Duel Terms</center>", (bool)true, (bool)false);
            AddLabel(122, 164, 0, @"Duel Fee(%):");
            AddLabel(122, 201, 0, @"Gear:");
            AddLabel(122, 239, 0, @"Time Limit:");
            AddLabel(124, 278, 0, @"Rules:");
            AddLabel(124, 312, 0, @"Opponent");
            AddLabel(124, 347, 0, @"Wager");
            AddHtml(202, 159, 153, 30, m_Stone.Fee.ToString(), (bool)true, (bool)false); // Duel Fee
            AddHtml(202, 195, 153, 30, m_Stone.SuppliedDuel ? "Provided" : "User", (bool)true, (bool)false); // Gear
            AddHtml(202, 233, 153, 30, m_Stone.MaxDuelTime.TotalMinutes.ToString() + "min", (bool)true, (bool)false); // Time Limit
            AddHtml(202, 272, 153, 30, @"Field", (bool)true, (bool)false); // Ruleset
            AddHtml(202, 306, 153, 30, m_Requester.Name, (bool)true, (bool)false);
            AddHtml(202, 341, 153, 30, m_Stone.Wager.ToString(), (bool)true, (bool)false);
            AddButton(222, 393, 247, 248, 1, GumpButtonType.Reply, 0);
            AddButton(291, 393, 241, 242, 0, GumpButtonType.Reply, 0);

            m_InTime = new InternalTimer(m_Acceptor, m_Stone);
            m_InTime.Start();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="d1">Duelist One</param>
        /// <param name="d2">Duelist Two</param>
        /// <param name="item">Duel Stone that contains the Duel info</param>
        public DuelTimer(Mobile d1, Mobile d2, DuelStone item)
            : base(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(1.0))
        {
            m_Duelist1 = d1;
            m_Duelist2 = d2;
            m_Stone = item;

            double fee = (double)m_Stone.Wager * ((double)m_Stone.Fee / 100);
            m_CalcFee = (int)fee;

            m_Staging = DateTime.Now + m_Stone.StagingTime;
            GetDuelists();
        }
Exemplo n.º 3
0
            /// <summary>
            /// Used to allow the mobile to target its duel opponent
            /// and send the duel request
            /// </summary>
            /// <param name="owner">Mobile requesting the duel</param>
            /// <param name="stone">Duel Stone linked to the targetting</param>
            public InternalTarget(Mobile owner, DuelStone stone)
                : base(5, true, TargetFlags.None)
            {
                m_Owner = owner;
                m_Stone = stone;

                m_InTime = new InternalTimer(m_Owner, m_Stone);
                m_InTime.Start();
            }
Exemplo n.º 4
0
 /// <summary>
 /// Timer constructer
 /// </summary>
 /// <param name="m">Mobile that has either the gumps or the target option</param>
 /// <param name="stone">Duel Stone that is linked to these events</param>
 public InternalTimer(Mobile m, DuelStone stone)
     : base(TimeSpan.FromSeconds(0.0), TimeSpan.FromSeconds(1.0))
 {
     m_StartTime = DateTime.Now;
     m_EndTime = m_StartTime + m_ChoiceTime;
     m_Owner = m;
     m_Stone = stone;
 }
Exemplo n.º 5
0
        /// <summary>
        /// Constructor
        /// Contains design info for the Duel Gump
        /// </summary>
        /// <param name="from">Mobile the gump is displayed to</param>
        /// <param name="stone">Duel Stone the gump is linked to</param>
        public DuelGump(Mobile from, DuelStone stone)
            : base(20, 30)
        {
            m_Owner = from;
            m_Stone = stone;

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

            AddPage(0);
            AddBackground(100, 100, 276, 331, 9350);
            AddHtml(117, 115, 241, 32, @"<center>Duel Terms</center>", (bool)true, (bool)false);
            AddLabel(122, 164, 0, @"Duel Fee(%):");
            AddLabel(122, 201, 0, @"Gear:");
            AddLabel(122, 239, 0, @"Time Limit:");
            AddLabel(124, 278, 0, @"Rules:");
            AddHtml(202, 159, 153, 30, m_Stone.Fee.ToString(), (bool)true, (bool)false); // Duel Fee
            AddHtml(202, 195, 153, 30, m_Stone.SuppliedDuel ? "Provided":"User", (bool)true, (bool)false); // Gear
            AddHtml(202, 233, 153, 30, m_Stone.MaxDuelTime.TotalMinutes.ToString()+"min", (bool)true, (bool)false); // Time Limit
            AddHtml(202, 272, 153, 30, @"Field", (bool)true, (bool)false); // Ruleset
            AddLabel(140, 319, 0, @"How much do you wish to wager?");
            AddBackground(124, 342, 230, 33, 9350);
            AddButton(222, 393, 247, 248, 1, GumpButtonType.Reply, 0);
            AddButton(291, 393, 241, 242, 0, GumpButtonType.Reply, 0);
            AddTextEntry(129, 346, 217, 23, 0, 0, m_Stone.MinimumWager.ToString());

            m_InTime = new InternalTimer(m_Owner, m_Stone);
            m_InTime.Start();
        }