상속: SectionMaterial
예제 #1
0
        public static Point3D GetCellLocation(JailCell cell)
        {
            switch (cell)
            {
            case JailCell.SmallCellOne:
            {
                return(new Point3D(5276, 1164, 0));
            }

            case JailCell.SmallCellTwo:
            {
                return(new Point3D(5286, 1164, 0));
            }

            case JailCell.SmallCellThree:
            {
                return(new Point3D(5296, 1164, 0));
            }

            case JailCell.SmallCellFour:
            {
                return(new Point3D(5306, 1164, 0));
            }

            case JailCell.SmallCellFive:
            {
                return(new Point3D(5276, 1174, 0));
            }

            case JailCell.SmallCellSix:
            {
                return(new Point3D(5286, 1174, 0));
            }

            case JailCell.SmallCellSeven:
            {
                return(new Point3D(5296, 1174, 0));
            }

            case JailCell.SmallCellEight:
            {
                return(new Point3D(5306, 1174, 0));
            }

            case JailCell.BigCellOne:
            {
                return(new Point3D(5283, 1184, 0));
            }

            case JailCell.BigCellTwo:
            {
                return(new Point3D(5304, 1184, 0));
            }

            default:
            {
                return(new Point3D(5283, 1184, 0));
            }
            }
        }
예제 #2
0
        internal static Cell GetCell(int index, CellType cellType)
        {
            Cell cell = null;

            if (cellType == CellType.StartCell)
            {
                cell = new StartCell();
            }
            if (cellType == CellType.PropertyCell)
            {
                cell = new PropertyCell();
            }
            if (cellType == CellType.JailCell)
            {
                cell = new JailCell();
            }
            if (cellType == CellType.GoToJailCell)
            {
                cell = new GoToJailCell();
            }
            if (cellType == CellType.FreeParking)
            {
                cell = new FreeParking();
            }
            cell.Index = index;
            return(cell);
        }
예제 #3
0
 public JailTarget(JailCell cell, int days, int hours, int minutes, string reason)
     : base(12, false, TargetFlags.None)
 {
     CheckLOS = false;
     m_Cell   = (JailCell)cell;
     m_Length = new TimeSpan(days, hours, minutes, 0, 0);
     m_Reason = reason;
 }
예제 #4
0
 public JailTarget( JailCell cell, int days, int hours, int minutes, string reason )
     : base( 12, false, TargetFlags.None )
 {
     CheckLOS = false;
     m_Cell = (JailCell)cell;
     m_Length = new TimeSpan( days, hours, minutes, 0, 0 );
     m_Reason = reason;
 }
예제 #5
0
        public static void JailPlayer(PlayerMobile criminal, JailCell cell, TimeSpan length, string reason, PlayerMobile jailer)
        {
            Point3D jailedFromPoint = criminal.Location;
            Map     jailedFromMap   = criminal.Map;

            if (Settings.AutoSquelch && !criminal.Squelched)
            {
                criminal.Squelched = true;
                criminal.SendMessage("You have been squelched.");
            }

            if (criminal.Mounted)
            {
                if (criminal.Mount is BaseMount)
                {
                    BaseMount pet = (BaseMount)criminal.Mount;
                    pet.Rider = null;
                    StablePet(criminal, pet);
                }
            }

            foreach (Mobile mobile in World.Mobiles.Values)
            {
                if (mobile is BaseCreature)
                {
                    BaseCreature creature = (BaseCreature)mobile;

                    if (creature.Controlled && creature.ControlMaster == criminal)
                    {
                        StablePet(criminal, creature);
                    }
                }
            }

            criminal.MoveToWorld(GetCellLocation(cell), Settings.SendToMap);

            JailedPlayers.Add(new JailedPlayer(criminal, jailedFromPoint, jailedFromMap, length, jailer.Name, reason));

            criminal.SendGump(new JailInfoGump(jailer.Name, length, reason));

            criminal.SendMessage(String.Format("You have been jailed by {0} for {1} day{2}, {3} hour{4}, and {5} minute{6}.",
                                               criminal == jailer ? "yourself" : jailer.Name,
                                               length.Days, length.Days == 1 ? "" : "s",
                                               length.Hours, length.Hours == 1 ? "" : "s",
                                               length.Minutes, length.Minutes == 1 ? "" : "s"));
            criminal.SendMessage(String.Format("Reason: {0}", reason));

            WriteLine(String.Format("{0} has been jailed for {1} day{2}, {3} hour{4}, and {5} minute{6} for {7} by {8}.",
                                    criminal.Name,
                                    length.Days, length.Days == 1 ? "" : "s",
                                    length.Hours, length.Hours == 1 ? "" : "s",
                                    length.Minutes, length.Minutes == 1 ? "" : "s",
                                    reason,
                                    jailer.Name));
        }
예제 #6
0
        public void OnCellSteppedTest()
        {
            List <EventArgs> receivedEvents = new List <EventArgs>();
            JailCell         cell           = new JailCell(1, 11, 1, 1, "Jail", "Jail");

            cell.CellStepped += (object sender, EventArgs e) => receivedEvents.Add(e);

            cell.Step();

            Assert.AreEqual(1, receivedEvents.Count);
            Assert.AreEqual(EventArgs.Empty, receivedEvents[0]);
        }
예제 #7
0
        public void InitializeBoardTest()
        {
            MonopolyBoard board = new MonopolyBoard(11, 11, 1, CellsData);
            int           expectedNumberOfCell       = 40;
            int           expextedNumberOfLandCell   = 28;
            int           expextedNumberOfActionCell = 6;
            int           expectedNumberOfTaxCell    = 2;

            // cek jumlah MonopolyCell
            Assert.AreEqual(board.ListOfMonopolyCell.Count, expectedNumberOfCell);

            // cek jumlah LandCell
            List <MonopolyCell> cells = board.ListOfMonopolyCell.FindAll(FindLandCell);

            Assert.AreEqual(cells.Count, expextedNumberOfLandCell);

            // cek jumlah ActionCell
            cells = board.ListOfMonopolyCell.FindAll(FindActionCell);
            Assert.AreEqual(cells.Count, expextedNumberOfActionCell);

            // cek jumlah TaxCell
            cells = board.ListOfMonopolyCell.FindAll(FindTaxCell);
            Assert.AreEqual(cells.Count, expectedNumberOfTaxCell);

            // cek StartCell exist
            StartCell start = board.ListOfMonopolyCell[0] as StartCell;

            Assert.AreNotEqual(start, null);

            // cek JailCell exist
            JailCell jail = board.ListOfMonopolyCell[10] as JailCell;

            Assert.AreNotEqual(jail, null);

            // cek FreeParkingCell exist
            FreeParkingCell free = board.ListOfMonopolyCell[20] as FreeParkingCell;

            Assert.AreNotEqual(free, null);

            // cek GotoJailCell exist
            GotoJailCell gotojail = board.ListOfMonopolyCell[30] as GotoJailCell;

            Assert.AreNotEqual(gotojail, null);
        }
예제 #8
0
 public static Point3D GetCellLocation( JailCell cell )
 {
     switch ( cell )
     {
         case JailCell.SmallCellOne:
         {
             return new Point3D( 5276, 1164, 0 );
         }
         case JailCell.SmallCellTwo:
         {
             return new Point3D( 5286, 1164, 0 );
         }
         case JailCell.SmallCellThree:
         {
             return new Point3D( 5296, 1164, 0 );
         }
         case JailCell.SmallCellFour:
         {
             return new Point3D( 5306, 1164, 0 );
         }
         case JailCell.SmallCellFive:
         {
             return new Point3D( 5276, 1174, 0 );
         }
         case JailCell.SmallCellSix:
         {
             return new Point3D( 5286, 1174, 0 );
         }
         case JailCell.SmallCellSeven:
         {
             return new Point3D( 5296, 1174, 0 );
         }
         case JailCell.SmallCellEight:
         {
             return new Point3D( 5306, 1174, 0 );
         }
         case JailCell.BigCellOne:
         {
             return new Point3D( 5283, 1184, 0 );
         }
         case JailCell.BigCellTwo:
         {
             return new Point3D( 5304, 1184, 0 );
         }
         default:
         {
             return new Point3D( 5283, 1184, 0 );
         }
     }
 }
예제 #9
0
        public static void JailPlayer( PlayerMobile criminal, JailCell cell, TimeSpan length, string reason, PlayerMobile jailer )
        {
            Point3D jailedFromPoint = criminal.Location;
            Map jailedFromMap = criminal.Map;

            if ( Settings.AutoSquelch && !criminal.Squelched )
            {
                criminal.Squelched = true;
                criminal.SendMessage( "You have been squelched." );
            }

            if ( criminal.Mounted )
            {
                if ( criminal.Mount is BaseMount )
                {
                    BaseMount pet = (BaseMount)criminal.Mount;
                    pet.Rider = null;
                    StablePet( criminal, pet );
                }
            }

            foreach ( Mobile mobile in World.Mobiles.Values )
            {
                if ( mobile is BaseCreature )
                {
                    BaseCreature creature = (BaseCreature)mobile;

                    if ( creature.Controlled && creature.ControlMaster == criminal )
                    {
                        StablePet( criminal, creature );
                    }
                }
            }

            criminal.MoveToWorld( GetCellLocation( cell ), Settings.SendToMap );

            JailedPlayers.Add( new JailedPlayer( criminal, jailedFromPoint, jailedFromMap, length, jailer.Name, reason ) );

            criminal.SendGump( new JailInfoGump( jailer.Name, length, reason ) );

            criminal.SendMessage( String.Format( "You have been jailed by {0} for {1} day{2}, {3} hour{4}, and {5} minute{6}.",
                criminal == jailer ? "yourself" : jailer.Name,
                length.Days, length.Days == 1 ? "" : "s",
                length.Hours, length.Hours == 1 ? "" : "s",
                length.Minutes, length.Minutes == 1 ? "" : "s" ) );
            criminal.SendMessage( String.Format( "Reason: {0}", reason ) );

            WriteLine( String.Format( "{0} has been jailed for {1} day{2}, {3} hour{4}, and {5} minute{6} for {7} by {8}.",
                criminal.Name,
                length.Days, length.Days == 1 ? "" : "s",
                length.Hours, length.Hours == 1 ? "" : "s",
                length.Minutes, length.Minutes == 1 ? "" : "s",
                reason,
                jailer.Name ) );
        }