Ejemplo n.º 1
0
        private async Task TileProduce(Player player, int amount)
        {
            UI ui = player.ui;

            (string source, Sandbox sb, int tileIndex, int productIndex, _) = await ui.GetTileProcudeData(player);

            await SandboxActions.ProduceAmount(player, sb,
                                               source, tileIndex, productIndex, amount, Context.Channel);
        }
Ejemplo n.º 2
0
        internal static async Task CancelProduction(Player player, int i, ISocketMessageChannel channel)
        {
            House house = await LoadHouse(player, channel);

            Sandbox sb = house.sandbox;
            await channel.SendMessageAsync(sb.tiles[i].Cancel(sb));

            await house.Save();

            await SandboxActions.InspectTile(player, sb, "house", i, channel);
        }
Ejemplo n.º 3
0
        public static async Task UpgradeTile(Player player, int index, ISocketMessageChannel chan)
        {
            House house = await LoadHouse(player, chan);

            Sandbox sb = house.sandbox;

            sb.UpgradeTile(sb.tiles[index]);
            await house.Save();

            await SandboxActions.InspectTile(player, sb, "house", sb.tiles.Count - 1, chan);
        }
Ejemplo n.º 4
0
        public static async Task BuildTile(Player player, SandboxTile.TileType type, ISocketMessageChannel chan)
        {
            House house = await LoadHouse(player, chan);

            Sandbox sb = house.sandbox;

            sb.Build(type);
            await house.Save();

            await SandboxActions.InspectTile(player, sb, "house", sb.tiles.Count - 1, chan);
        }
Ejemplo n.º 5
0
        internal static async Task Produce(Player player, int tileIndex, ProductionRecipe recipe, int amount, ISocketMessageChannel channel)
        {
            House house = await LoadHouse(player, channel);

            Sandbox sb = house.sandbox;

            recipe.Consume(sb, amount);
            sb.tiles[tileIndex].Start(recipe, amount);
            await house.Save();

            await SandboxActions.InspectTile(player, sb, "house", tileIndex, channel);
        }
Ejemplo n.º 6
0
        public async Task HouseFunds([Summary("deposit or withdraw")] string action, long amount)
        {
            Player player = Context.Player;
            House  house  = await LoadHouse(player, Context.Channel);

            Sandbox sb = house.sandbox;

            if (SandboxActions.TransferFunds(player, sb, action, amount, out string result))
            {
                await house.Save();

                player.SaveFileMongo();
                await ViewHouseInfo(player, house, Context.Channel);
            }

            await ReplyAsync(result);
        }
Ejemplo n.º 7
0
        public async Task HouseStock([Summary("view, withdraw or deposit")] string action = "view",
                                     [Summary("withdraw or deposit: Item {slot}x{amount} \n" +
                                              "view: filter")] string argument = null)
        {
            Player player = Context.Player;
            House  house  = await LoadHouse(player, Context.Channel);

            Sandbox sb = house.sandbox;

            if (SandboxActions.TransferItem(player, sb, action, argument, out string reply))
            {
                await house.Save();

                await Neitsillia.InventoryCommands.Inventory.
                UpdateinventoryUI(player, Context.Channel);
                await ReplyAsync(reply);
            }
            else
            {
                await SandboxActions.StorageView(player, house.sandbox, "house", 0, argument ?? "all", Context.Channel, false);
            }
        }