Exemple #1
0
 public Merchant(int x, int y)
     : base(x, y)
 {
     inv       = new MerchantInventory();
     mM        = new MerchantMenu();
     isTrading = false;
 }
        public void SetMerchant(Player p, Character c)
        {
            _merchant = c;

            _conversationManager.ClearConversations();

            Conversations list = GameRef.Content.Load <Conversations>(@"SilverProphet\MerchantConversations\" + _merchant.Name);

            _conversation = list.ConversationList[_merchant.Name];

            if (!_merchantManager.ContainsMerchant(_merchant.Name))
            {
                _inventory = GameRef.Content.Load <MerchantInventory>(@"SilverProphet\MerchantInventories\" + _merchant.Name);
            }
            else
            {
                _inventory = _merchantManager.GetMerchant(_merchant.Name);
            }

            player    = p;
            _portrait = c.Portrait;

            _mode = MerchantMode.Talk;

            _selectedIndex = 0;
            _selectedItem  = "";

            _conversation.StartConversation();
        }
 /// <summary>Assigns all controls to something usable in code.</summary>
 private void AssignControls()
 {
     HeroInventory     = (GridInventory)GetNode("HeroInventory");
     MerchantInventory = (MerchantInventory)GetNode("MerchantInventory");
     HeroEquipment     = (GridEquipment)GetNode("HeroEquipment");
     HeroInventory.SetUpInventory(GameState.CurrentHero.Inventory);
     HeroEquipment.SetUpEquipment(GameState.CurrentHero.Equipment, GameState.CurrentHero.Level, GameState.CurrentHero.Class);
     MerchantInventory.SetUpInventory(GameState.MerchantInventory.Where(itm => itm.IsSold).ToList());
 }