public bool Demolish(Mobile m)
        {
            var deed = new CharacterStatueDeed(null);

            if (m.PlaceInBackpack(deed))
            {
                Delete();

                deed.Statue     = this;
                deed.StatueType = m_Type;

                if (Plinth != null)
                {
                    Plinth.Delete();
                    Plinth = null;
                }

                return(true);
            }

            m.SendLocalizedMessage(500720); // You don't have enough room in your backpack!
            deed.Delete();

            return(false);
        }
        public ActionResult DeleteConfirmed(int id)
        {
            Plinth plinth = db.Plinths.Find(id);

            db.Plinths.Remove(plinth);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,Name,Category,Material,Price,Quantity")] Plinth plinth)
 {
     if (ModelState.IsValid)
     {
         db.Entry(plinth).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(plinth));
 }
        public ActionResult Create([Bind(Include = "Id,Name,Category,Material,Price,Quantity")] Plinth plinth)
        {
            if (ModelState.IsValid)
            {
                db.Plinths.Add(plinth);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(plinth));
        }
        public override void OnAfterDelete()
        {
            base.OnAfterDelete();

            if (Plinth == null)
            {
                return;
            }

            Plinth.Delete();
            Plinth = null;
        }
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Plinth plinth = db.Plinths.Find(id);

            if (plinth == null)
            {
                return(HttpNotFound());
            }
            return(View(plinth));
        }
        public void InvalidateHues()
        {
            switch (m_Type)
            {
            case StatueType.Minax:
            {
                Hue = 1645;
                break;
            }

            case StatueType.TB:
            {
                Hue = 2214;
                break;
            }

            case StatueType.CoM:
            {
                Hue = 1325;
                break;
            }

            case StatueType.SL:
            {
                Hue = 1109;
                break;
            }
            }

            if (m_Type != StatueType.None)
            {
                HairHue = Hue;

                if (FacialHairItemID > 0)
                {
                    FacialHairHue = Hue;
                }

                for (int i = Items.Count - 1; i >= 0; i--)
                {
                    Items[i].Hue = Hue;
                }
            }

            if (Plinth != null)
            {
                Plinth.InvalidateHue();
            }
        }
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			#region v0
			m_Plinth = reader.ReadItem() as Plinth;
			m_HasPlinth = (m_Plinth != null);

			m_Material = (MaterialType)reader.ReadInt();

			m_Owner = reader.ReadMobile();

			m_Pose = (Poses)reader.ReadInt();
			#endregion

			if( !BaseStatue.AllStatues.Contains( this ) )
				BaseStatue.AddStatue( this );

			BeginUpdate();
		}
 public ActionResult Index(Plinth plinth)
 {
     return(View());
 }
Beispiel #10
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_Item.Deleted)
            {
                return;
            }

            Mobile    from  = sender.Mobile;
            int       id    = info.ButtonID;
            GameBoard board = m_Item.Board;

            switch (id)
            {
            case 5:                     // move up
            {
                if (m_SelectedRow == -1)
                {
                    return;
                }

                board.GamePanel.MoveUp(m_SelectedRow);
                board.CurrentMovements++;

                from.PlaySound(0xFA);
                from.SendGump(new PuzzleBoardGump(m_Item, m_SelectedRow));

                break;
            }

            case 6:                     // move down
            {
                if (m_SelectedRow == -1)
                {
                    return;
                }

                board.GamePanel.MoveDown(m_SelectedRow);
                board.CurrentMovements++;

                from.PlaySound(0xFA);
                from.SendGump(new PuzzleBoardGump(m_Item, m_SelectedRow));

                break;
            }

            case 7:                     // apply
            {
                if (board.IsCorrect())
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Correct Code Entered. Crystal Lock Disengaged.");
                    from.PlaySound(0xF7);

                    m_Item.Delete();

                    Item reward;

                    switch (Utility.Random(10))
                    {
                    default:
                    case 0: reward = new VoidEssence(30); break;

                    case 1: reward = new SilverSerpentVenom(30); break;

                    case 2: reward = new ScouringToxin(30); break;

                    case 3: reward = new ToxicVenomSac(30); break;

                    case 4: reward = new KneadingBowl(); break;

                    case 5: reward = new TotemPole(); break;

                    case 6: reward = new DustyPillow(); break;

                    case 7: reward = new Plinth(); break;

                    case 8: reward = new FlouredBreadBoard(); break;

                    case 9: reward = new LuckyCoin(); break;
                    }

                    from.PlaceInBackpack(reward);

                    PlayerMobile pm = from as PlayerMobile;

                    if (pm != null && !Misc.TestCenter.Enabled)
                    {
                        pm.NextPuzzleAttempt = DateTime.UtcNow + TimeSpan.FromDays(1.0);
                    }
                }
                else
                {
                    m_Item.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Incorrect Code Sequence. Access Denied");
                    from.PlaySound(0xFD);
                }

                break;
            }

            case 8:                     // cancel
            {
                board.Reset();

                from.PlaySound(0xFB);
                from.SendGump(new PuzzleBoardGump(m_Item, -1));

                break;
            }

            default:
            {
                if (id >= 1 && id <= 4)
                {
                    from.SendGump(new PuzzleBoardGump(m_Item, id - 1));
                }

                break;
            }
            }
        }