Exemple #1
0
        public ucItemClicked(Item item, Player user, Room activeRoom, frmGame mainForm)
        {
            InitializeComponent();
            MainForm               = mainForm;
            ClickedItem            = item;
            User                   = user;
            ActiveRoom             = activeRoom;
            ItemSlots              = ActiveRoom.ItemSlotList;
            IsBackpacked           = false;
            cmdAddToInventory.Text = "Put " + item.Name.ToLower() + " in inventory";
            picClickedItem.Image   = item.Image;
            lblItemClicked.Text    = item.Name;

            if (ClickedItem.Usage == "Unlock")
            {
                cmdUseItem.Visible = false;
            }

            cmdUseItem.Text = item.Usage + " " + item.Name.ToLower();
            this.Left       = (MainForm.Width - this.Width) / 2;
            this.Top        = (MainForm.Height - this.Height) / 2;
        }
Exemple #2
0
 public void PutOutFire(Player User, Room room, Item item, ContainerItem containerItem, frmGame mainForm)
 {
     if (User.HasBriefcase)
     {
         ucItemOpen itemOpenControl = new ucItemOpen(User, User.Briefcase, room, mainForm, item);
         mainForm.Controls.Add(itemOpenControl);
         itemOpenControl.Show();
         itemOpenControl.BringToFront();
     }
     else
     {
         mainForm.PlayerThinking("I dont have anything to use on this");
     }
 }
Exemple #3
0
 public void CheckTime(Player User, Room room, Item item, ContainerItem containerItem, frmGame mainForm)
 {
     mainForm.PlayerThinking("Time is " + DateTime.Now.Hour.ToString() + ":" + DateTime.Now.Minute.ToString());
 }
Exemple #4
0
 public void Drink(Player User, Room room, Item item, ContainerItem containerItem, frmGame mainForm)
 {
     item.ItemSlot.SlottedItem = item.TransformsTo;
 }
Exemple #5
0
 public void Fill(Player User, Room room, Item item, ContainerItem containerItem, frmGame mainForm)
 {
     if (room.Name != "Room 2")
     {
         mainForm.PlayerThinking("No faucet available in this room");
     }
     else
     {
         item.ItemSlot.SlottedItem = item.TransformsTo;
     }
 }
Exemple #6
0
 //
 // USE METHODS
 //
 public void Eat(Player User, Room room, Item item, ContainerItem containerItem, frmGame mainForm)
 {
     if (!room.RemoveItem(room, item))
     {
         DropFromContainer(item, containerItem);
     }
     mainForm.PlayerThinking("Yummy.");
 }
Exemple #7
0
 public ucUseItemOnItem(Player user, Room activeRoom, Item useItem, Item useOnItem, frmGame mainForm, Control motherControl)
 {
     InitializeComponent();
     User            = user;
     ActiveRoom      = activeRoom;
     UseItem         = useItem;
     UseOnItem       = useOnItem;
     MainForm        = mainForm;
     MotherControl   = motherControl;
     lblUseItem.Text = "Use " + useItem.Name + " on " + useOnItem.Name + "?";
     this.Left       = (MainForm.Width - this.Width) / 2;
     this.Top        = (MainForm.Height - this.Height) / 2;
 }
Exemple #8
0
 public ucItemOpen(Player user, ContainerItem containerItem, Door clickedDoor, frmGame mainForm) // UNLOCK DOOR CTOR
 {
     InitializeComponent();
     SetItems(containerItem, mainForm);
     MainForm          = mainForm;
     User              = user;
     OpenContainerItem = containerItem;
     ClickedDoor       = clickedDoor;
     IsDoorOpen        = true;
 }
Exemple #9
0
        public ucItemClicked(Item item, Player user, List <ItemSlot> itemSlotList, Room activeRoom, frmGame mainForm, UserControl motherUserControl, ContainerItem motherItem)
        {
            InitializeComponent();
            MainForm      = mainForm;
            MotherControl = motherUserControl;
            MotherItem    = motherItem;
            ActiveRoom    = activeRoom;
            ClickedItem   = item;
            User          = user;
            ItemSlots     = itemSlotList;

            if (ClickedItem.Usage == "Unlock")
            {
                cmdUseItem.Visible = false;
            }

            this.Left = (MainForm.Width - this.Width) / 2;
            this.Top  = (MainForm.Height - this.Height) / 2;

            if (MotherItem != null && MotherItem.Name == "Briefcase")
            {
                IsBackpacked           = true;
                cmdAddToInventory.Text = "Drop " + item.Name.ToLower() + " from inventory";
            }
            picClickedItem.Image = item.Image;
            lblItemClicked.Text  = item.Name;
            if (item.Usage == "Unlock")
            {
                cmdUseItem.Text = "Unlock something with " + item.Name.ToLower();
            }
            else
            {
                cmdUseItem.Text = item.Usage + " " + item.Name.ToLower();
            }
        }