예제 #1
0
async def reply_for_layout_description(message: discord.Message, description: LayoutDescription):
    embed = discord.Embed(
        title="Spoiler file for Randovania {}".format(description.randovania_version_text),
    )

    if description.player_count == 1:
        preset = description.get_preset(0)
        embed.description = "{}, with preset {}.\nSeed Hash: {}\nPermalink: {}".format(
            preset.game.long_name, preset.name,
            description.shareable_word_hash,
            description.permalink.as_base64_str,
        )
        _add_preset_description_to_embed(embed, preset)
    else:
        games = {preset.game.long_name for preset in description.all_presets}
        game_names = sorted(games)

        last_game = game_names.pop()
        games_text = ", ".join(game_names)
        if games_text:
            games_text += " and "
        games_text += last_game

        embed.description = "{} player multiworld for {}.\nSeed Hash: {}\nPermalink: {}".format(
            description.player_count,
            games_text,
            description.shareable_word_hash,
            description.permalink.as_base64_str,
        )

    await message.reply(embed=embed, mention_author=False)
예제 #2
0
    def __init__(self, description: LayoutDescription,
                 players_config: PlayersConfiguration,
                 cosmetic_patches: BaseCosmeticPatches):
        self.description = description
        self.players_config = players_config
        self.cosmetic_patches = cosmetic_patches

        self.item_db = default_database.item_database_for_game(
            self.game_enum())

        self.patches = description.all_patches[players_config.player_index]
        self.configuration = description.get_preset(
            players_config.player_index).configuration
        self.rng = Random(
            description.get_seed_for_player(players_config.player_index))
        self.game = filtered_database.game_description_for_layout(
            self.configuration)
예제 #3
0
def _get_resource_database(description: LayoutDescription,
                           player: int) -> ResourceDatabase:
    return default_database.resource_database_for(
        description.get_preset(player).game)