Esempio n. 1
0
def migrate_human_template(db_character: DBCharacter,
                           db_game_object: DBGameObject) -> None:
    DBTrait(
        dn="human",
        game_object=db_game_object,
        data={
            "dn":
            "human",
            "type":
            "human",
            "createdTraits": [
                "Интеллект", "Смекалка", "Концентрация", "Сила", "Ловкость",
                "Выносливость", "Харизма", "Манипулирование", "Хладнокровие",
                "Эрудиция", "Загадки", "Ремесло", "Расследование", "Медицина",
                "Оккультизм", "Политика", "Наука", "Атлетика", "Борьба",
                "Верховая езда", "Стрельба", "Кража", "Скрытность",
                "Выживание", "Холодное оружие", "Знание_животных", "Эмпатия",
                "Самовыражение", "Запугивание", "Убеждение", "Социализация",
                "Знание улиц", "Обман", "Защита", "Здоровье",
                "Модификатор_Инициативы", "Целостность", "Размер", "Скорость",
                "Сила_воли", "Богатство", "weapon", "armor", "position",
                "Name", "Age", "Player", "Race", "Nation", "Language",
                "Добродетель", "Порок", "Концепт"
            ]
        })
def migrate_initiative_mod(db_character: DBCharacter,
                           db_game_object: DBGameObject) -> None:
    DBTrait(dn="Модификатор_Инициативы",
            game_object=db_game_object,
            data={
                "dn": "Модификатор_Инициативы",
                "type": "Модификатор_Инициативы"
            })
Esempio n. 3
0
def migrate_size(db_character: DBCharacter,
                 db_game_object: DBGameObject) -> None:
    DBTrait(dn="Размер",
            game_object=db_game_object,
            data={
                "dn": "Размер",
                "type": "Размер"
            })
Esempio n. 4
0
def migrate_weapon(db_character: DBCharacter,
                   db_game_object: DBGameObject) -> None:
    DBTrait(dn="weapon",
            game_object=db_game_object,
            data={
                "dn": "weapon",
                "type": "weapon"
            })
Esempio n. 5
0
def migrate_armor(db_character: DBCharacter,
                  db_game_object: DBGameObject) -> None:
    DBTrait(dn="armor",
            game_object=db_game_object,
            data={
                "dn": "armor",
                "type": "armor"
            })
def migrate_generation_advancement(db_character: DBCharacter,
                                   db_game_object: DBGameObject) -> None:
    DBTrait(dn="generation_advancement",
            game_object=db_game_object,
            data={
                "dn": "generation_advancement",
                "type": "generation_advancement"
            })
Esempio n. 7
0
def migrate_speed(db_character: DBCharacter,
                  db_game_object: DBGameObject) -> None:
    DBTrait(dn="Скорость",
            game_object=db_game_object,
            data={
                "dn": "Скорость",
                "type": "Скорость"
            })
Esempio n. 8
0
def migrate_defence(db_character: DBCharacter,
                    db_game_object: DBGameObject) -> None:
    DBTrait(dn="Защита",
            game_object=db_game_object,
            data={
                "dn": "Защита",
                "type": "Защита"
            })
Esempio n. 9
0
def migrate_wealth(db_character: DBCharacter,
                   db_game_object: DBGameObject) -> None:
    DBTrait(dn="Богатство",
            game_object=db_game_object,
            data={
                "dn": "Богатство",
                "type": "Богатство",
                "points": db_character.get_number("Богатство", 0)
            })
def migrate_player_character(db_character: DBCharacter,
                             db_game_object: DBGameObject) -> None:
    DBTrait(dn="player_character",
            game_object=db_game_object,
            data={
                "dn": "player_character",
                "type": "player_character",
                "createdTraits": ["Опыт"]
            })
Esempio n. 11
0
def migrate_willpower(db_character: DBCharacter,
                      db_game_object: DBGameObject) -> None:
    DBTrait(dn="Сила_воли",
            game_object=db_game_object,
            data={
                "dn": "Сила_воли",
                "type": "Сила_воли",
                "points": None
            })
Esempio n. 12
0
def migrate_integrity(db_character: DBCharacter,
                      db_game_object: DBGameObject) -> None:
    DBTrait(dn="Целостность",
            game_object=db_game_object,
            data={
                "dn": "Целостность",
                "type": "Целостность",
                "points": db_character.get_number("Целостность", 7)
            })
Esempio n. 13
0
def migrate_character_info(db_character: DBCharacter,
                           db_game_object: DBGameObject) -> None:
    for old_dn, new_type in __old_new_relation.items():
        DBTrait(dn=new_type,
                game_object=db_game_object,
                data={
                    "dn": new_type,
                    "type": new_type,
                    "value": db_character.get_text(old_dn, "")
                })
def migrate_attributes_and_skills(db_character: DBCharacter, db_game_object: DBGameObject) -> None:
    for old_dn, new_type in trait_old_new_relation.items():
        DBTrait(
            dn=new_type,
            game_object=db_game_object,
            data={
                "dn": new_type,
                "type": new_type,
                "value": db_character.get_number(old_dn, 1 if old_dn in ATTRIBUTES else 0)
            }
        )
Esempio n. 15
0
def migrate_health(db_character: DBCharacter, db_game_object: DBGameObject) -> None:
    DBTrait(
        dn="Здоровье",
        game_object=db_game_object,
        data={
            "dn": "Здоровье",
            "type": "Здоровье",
            "lethal": db_character.get_number("Очки летального урона", 0),
            "bashing": db_character.get_number("Очки легкого урона", 0),
            "aggravated": db_character.get_number("Очки агравированного урона", 0)
        }
    )
Esempio n. 16
0
def migrate_experience(db_character: DBCharacter,
                       db_game_object: DBGameObject) -> None:
    beats = __parse_text_instance("Биты", db_character)
    experience = __parse_text_instance("Опыт", db_character)

    DBTrait(dn="Опыт",
            game_object=db_game_object,
            data={
                "dn": "Опыт",
                "type": "Опыт",
                "beats": beats + 5 * experience,
                "spent": 0
            })
Esempio n. 17
0
def migrate_specialities(db_character: DBCharacter,
                         db_game_object: DBGameObject) -> None:
    for speciality in select(s for s in DBSpecialityInstance
                             if s.character == db_character):
        speciality: DBSpecialityInstance

        DBTrait(dn=speciality.dn,
                game_object=db_game_object,
                data={
                    "dn": speciality.dn,
                    "type": "Специализация",
                    "name": speciality.value,
                    "skill": trait_old_new_relation.get(speciality.trait_dn)
                })
Esempio n. 18
0
def migrate_aspiration(db_character: DBCharacter,
                       db_game_object: DBGameObject) -> None:
    for dn in dns:
        aspiration = db_character.get_text(dn, "")

        if aspiration:
            dn = str(uuid.uuid4())
            DBTrait(dn=dn,
                    game_object=db_game_object,
                    data={
                        "dn": dn,
                        "type": "Стремление",
                        "value": aspiration
                    })
Esempio n. 19
0
def migrate_custom_merits(db_character: DBCharacter,
                          db_game_object: DBGameObject) -> None:
    for merit in select(m for m in DBMeritInstance
                        if m.merit_dn is None and m.character == db_character):
        merit: DBMeritInstance

        DBTrait(dn=merit.dn,
                game_object=db_game_object,
                data={
                    "dn": merit.dn,
                    "type": "Custom_Merit",
                    "customName": merit.title,
                    "value": merit.value
                })
Esempio n. 20
0
def migrate_merits(db_character: DBCharacter, db_game_object: DBGameObject) -> None:
    for merit in select(m for m in DBMeritInstance if m.merit_dn is not None and m.character == db_character):
        merit: DBMeritInstance

        DBTrait(
            dn=merit.dn,
            game_object=db_game_object,
            data={
                "dn": merit.dn,
                "type": __old_new_relation.get(merit.merit_dn, merit.merit_dn),
                "customName": merit.title,
                "value": merit.value
            }
        )
Esempio n. 21
0
def migrate_aspiration(db_character: DBCharacter,
                       db_game_object: DBGameObject) -> None:

    dnArray = [
        "aspiration_1", "aspiration_2", "aspiration_3", "aspiration_4",
        "aspiration_5"
    ]

    for dn in dnArray:

        aspiration = db_character.get_text(dn, "")

        if aspiration:
            DBTrait(dn="Стремление",
                    game_object=db_game_object,
                    data={
                        "dn": uuid.uuid4(),
                        "type": "Стремление",
                        "value  ": aspiration
                    })