Esempio n. 1
0
        private void OpenChoppingWindow()
        {
            var player = EntityManager.Get <IEntity>(Game.GameSession.Player.ObjectId);

            if (WorldObjectManager.ContainsWorldObject <ILocation>(player.CurrentLocation, GameObjects.WorldObjectBase.Objects.Tree))
            {
                this.SwitchFocusMakeVisible(UserInterfaceManager.Get <ChoppingWindow>());
            }
        }
Esempio n. 2
0
        private static void ChopWood()
        {
            var player          = Game.GameSession.Player;
            var currentLocation = LocationManager.GetLocationByObjectId <ILocation>(player.CurrentLocation.ObjectId);

            if (WorldObjectManager.ContainsWorldObject(currentLocation, WorldObjectBase.Objects.Tree))
            {
                var tree = WorldObjectManager.GetLocationWorldObjectsByObjectType <IWorldObject>(currentLocation, WorldObjectBase.Objects.Tree).FirstOrDefault();

                var reward = tree.Items.FirstOrDefault();

                InventoryManager.AddToInventory <PlayerInventory>(reward);
                MessageManager.AddItemObtained(reward.Name, 1);
            }
        }
Esempio n. 3
0
 private void UpdateKeybindingVisibility()
 {
     KeybindingManager.UpdateVisibility(Keybindings.Chop, WorldObjectManager.ContainsWorldObject(Game.GameSession.Player.CurrentLocation,
                                                                                                 GameObjects.WorldObjectBase.Objects.Tree) && this.IsFocused);
 }