public SandboxTile(TileType type) { this.type = type; tier = 0; productionOptions = new List <string>(); ProductionRecipes.Add(this, 0, 0); }
internal static async Task ProduceAmount(Player player, Sandbox sb, string source, int tileIndex, int productIndex, int amount, ISocketMessageChannel channel) { SandboxTile tile = sb.tiles[tileIndex]; ProductionRecipe recipe = ProductionRecipes.Get(tile.type, tile.productionOptions[productIndex]); await player.EditUI(null, DUtils.BuildEmbed($"Product {recipe} from {tile.Name}", null, null, player.userSettings.Color, DUtils.NewField("Select Amount", $"{EUI.ok} Produce **[{amount}]**" + Environment.NewLine + $"{EUI.prev}|{EUI.lowerthan}|{EUI.greaterthan}|{EUI.next}" + Environment.NewLine + $" -5 | -1 | +1 | +5 |" + Environment.NewLine + $"Or `amount` command: `amount 10`"), recipe.ToField(amount) ).Build(), channel, MsgType.TileProduce, $"{source};{tileIndex};{productIndex};{amount}"); }
string GainProduction(int chances) { string s = null; while (chances > 0) { if (Program.Chance(chances)) { string newRecipe = ProductionRecipes.AddRandom(this); if (newRecipe != null) { s += Environment.NewLine + $"New production available: {newRecipe}"; } } chances -= 100; } return(s); }