示例#1
0
async def get_download_sprite_link(sprite_id: str) -> str:
    if entity.has_value(sprite_id):
        base_url = await core.get_base_url()
        result = f'{base_url}FileService/DownloadSprite?spriteId={sprite_id}'
        return result
    else:
        return None
示例#2
0
文件: pss_crew.py 项目: Lnic/YaDc
def __get_embed_color(collection_info: entity.EntityInfo, collections_data: entity.EntitiesData, characters_data: entity.EntitiesData, **kwargs) -> discord.Color:
    color_string = collection_info.get('ColorString')
    if entity.has_value(color_string):
        result = util.convert_color_string_to_embed_color(color_string)
    else:
        result = discord.Embed.Empty
    return result
示例#3
0
文件: pss_training.py 项目: Lnic/YaDc
async def __get_thumbnail_url(training_info: entity.EntityInfo,
                              trainings_data: entity.EntitiesData,
                              items_data: entity.EntitiesData,
                              researches_data: entity.EntitiesData,
                              **kwargs) -> str:
    training_sprite_id = training_info.get('TrainingSpriteId')
    sprite_id = None
    if entity.has_value(training_sprite_id) and training_sprite_id != '454':
        sprite_id = training_sprite_id
    else:
        training_id = training_info.get(TRAINING_DESIGN_KEY_NAME)
        item_details = item.get_item_details_by_training_id(
            training_id, items_data, trainings_data)
        if item_details:
            item_sprite_id = item_details[0].entity_info.get('ImageSpriteId')
            if entity.has_value(item_sprite_id):
                sprite_id = item_sprite_id
    if sprite_id:
        result = await sprites.get_download_sprite_link(sprite_id)
    else:
        result = None
    return result
示例#4
0
def __get_value(*args, **kwargs) -> str:
    entity_property = kwargs.get('entity_property')
    if entity.has_value(entity_property):
        return entity_property
    else:
        return None
示例#5
0
文件: pss_crew.py 项目: Lnic/YaDc
def __get_ability(character_info: entity.EntityInfo, characters_data: entity.EntitiesData, collections_data: entity.EntitiesData, level: int, **kwargs) -> str:
    if entity.has_value(character_info['SpecialAbilityType']):
        result = lookups.SPECIAL_ABILITIES_LOOKUP.get(character_info['SpecialAbilityType'], character_info['SpecialAbilityType'])
    else:
        result = None
    return result