예제 #1
0
        public override void OnDoubleClick( Mobile from )
        {
            PlayerMobile pm = from as PlayerMobile;

            if ( pm != null )
            {
                if ( pm.Map != this.Map || !pm.InRange( GetWorldLocation(), 2 ) )
                    pm.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
                else if ( pm.NextPuzzleAttempt > DateTime.Now )
                    pm.SendLocalizedMessage( 1113386 ); // You are too tired to attempt solving more puzzles at this time.
                else if ( pm.Backpack.FindItemByType<PuzzleBoardItem>( false ) != null )
                    pm.SendLocalizedMessage( 501885 ); // You already own one of those!
                else
                {
                    PuzzleBoardItem puzzle = new PuzzleBoardItem();

                    if ( pm.PlaceInBackpack( puzzle ) )
                    {
                        pm.SendLocalizedMessage( 1072223 ); // An item has been placed in your backpack.
                        puzzle.SendTimeRemainingMessage( pm );
                    }
                    else
                        puzzle.Delete();
                }
            }
        }
예제 #2
0
        public override void OnDoubleClick(Mobile from)
        {
            PlayerMobile pm = from as PlayerMobile;

            if (pm != null)
            {
                if (pm.Map != this.Map || !pm.InRange(GetWorldLocation(), 2))
                {
                    pm.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045);                       // I can't reach that.
                }
                else if (pm.NextPuzzleAttempt > DateTime.Now)
                {
                    pm.SendLocalizedMessage(1113386);                       // You are too tired to attempt solving more puzzles at this time.
                }
                else if (pm.Backpack.FindItemByType <PuzzleBoardItem>(false) != null)
                {
                    pm.SendLocalizedMessage(501885);                       // You already own one of those!
                }
                else
                {
                    PuzzleBoardItem puzzle = new PuzzleBoardItem();

                    if (pm.PlaceInBackpack(puzzle))
                    {
                        pm.SendLocalizedMessage(1072223);                           // An item has been placed in your backpack.
                        puzzle.SendTimeRemainingMessage(pm);
                    }
                    else
                    {
                        puzzle.Delete();
                    }
                }
            }
        }
예제 #3
0
        public PuzzleBoardGump( PuzzleBoardItem item, int selectedRow )
            : base(5, 30)
        {
            m_Item = item;
            m_SelectedRow = selectedRow;

            GameBoard board = item.Board;

            Panel player = board.GamePanel;
            Panel target = board.TargetPanel;

            AddBackground( 55, 45, 500, 200, 0x2422 );
            AddImage( 75, 83, 0x2423 );
            AddImage( 65, 118, 0x2423 );
            AddImage( 75, 153, 0x2423 );
            AddImage( 65, 188, 0x2423 );
            AddImage( 108, 55, 0x2427 );
            AddImage( 86, 65, 0x2427 );
            AddBackground( 75, 65, 86, 153, 0x2422 );
            AddBackground( 192, 65, 137, 153, 0x2422 );
            AddBackground( 397, 65, 137, 153, 0x2422 );
            AddBackground( 55, 270, 195, 110, 0x2422 );
            AddImage( 205, 77, 0x52 );
            AddImage( 205, 110, 0x52 );
            AddImage( 205, 143, 0x52 );
            AddImage( 410, 77, 0x52 );
            AddImage( 410, 110, 0x52 );
            AddImage( 410, 143, 0x52 );
            AddImage( 5, 5, 0x28C8 );

            AddButton( 160, 320, 0xF2, 0xF1, 8, GumpButtonType.Reply, 0 );		// Cancel
            AddButton( 80, 320, 0xEF, 0xF0, 7, GumpButtonType.Reply, 0 );		// Apply
            AddButton( 120, 345, 0x7DB, 0x7DB, 0, GumpButtonType.Reply, 0 );	// Log out

            AddHtml( 72, 285, 170, 20, "Command Functions: ", false, false );
            AddHtml( 200, 285, 100, 20, String.Format( "{0}/{1}", board.CurrentMovements, board.MaxMovements ), false, false );

            for ( int i = 0; i < 4; i++ )
            {
                bool button = m_SelectedRow != i;
                bool arrows = !button && !player.Rows[i].IsEmpty;

                if ( button )
                    AddButton( 108, 82 + ( i * 33 ), 0xD1, 0xD0, i + 1, GumpButtonType.Reply, 0 );
                else
                    AddImage( 108, 82 + ( i * 33 ), 0xD0 );

                if ( arrows )
                {
                    AddButton( 88, 82 + ( i * 33 ), 0xA5A, 0xA5B, 5, GumpButtonType.Reply, 0 );
                    AddButton( 128, 82 + ( i * 33 ), 0xA58, 0xA59, 6, GumpButtonType.Reply, 0 );
                }
                else
                {
                    AddImage( 88, 82 + ( i * 33 ), 0xA95 );
                    AddImage( 128, 82 + ( i * 33 ), 0xA95 );
                }
            }

            DrawPanel( player, 205, 76 );
            DrawPanel( target, 410, 76 );
        }
예제 #4
0
 public PuzzleBoardGump( PuzzleBoardItem item )
     : this(item, -1)
 {
 }