Beispiel #1
0
        public SandboxTile UpgradeTile(SandboxTile tile)
        {
            TileSchematic ts = TileSchematics.GetSchem(tile.type, tile.tier + 1);

            tile.Upgrade(this, ts);
            return(tile);
        }
        public async Task HouseBuild([Remainder] string build_name = null)
        {
            Player player = Context.Player;
            House  house  = await LoadHouse(player, Context.Channel);

            Sandbox sb = house.sandbox;

            if (sb.tiles.Count >= sb.tier)
            {
                await ReplyAsync($"A tier {sb.tier} House may not have more than {sb.tier} buildings");
            }
            else if (EnumExtention.IsEnum(build_name?.Replace(' ', '_'), out SandboxTile.TileType result))
            {
                TileSchematic ts = TileSchematics.GetSchem(result, 0);
                await player.NewUI($"Are you sure you wish to build a {ts}?",
                                   ts.ToEmbed(player.userSettings.Color), Context.Channel, MsgType.ComfirmTile, $"house;0;{(int)result}");
            }
            else
            {
                await ReplyAsync($"{build_name} is not a valid build name. Please write a valid name:"
                                 + Environment.NewLine + EnumExtention.GetNames <SandboxTile.TileType>()
                                 .Join(Environment.NewLine, n => n.Replace('_', ' '))
                                 );
            }
        }
Beispiel #3
0
        public SandboxTile Build(SandboxTile.TileType type)
        {
            TileSchematic ts   = TileSchematics.GetSchem(type, 0);
            SandboxTile   tile = ts.Build(this);

            tiles.Add(tile);

            return(tile);
        }
 internal void Upgrade(Sandbox sandbox, TileSchematic ts)
 {
     ts.Upgrade(sandbox, this);
     xp -= XP_PER_TIER * (tier + 1);
     tier++;
 }