Пример #1
0
void msg_on_load(savefile_ptr file)
{
    int i;
    int count = savefile_read_s16b(file);

    for (i = 0; i < count; i++)
    {
        s32b turn = 0;
        s32b count = 0;
        byte color = TERM_WHITE;
        string_ptr msg = 0;

        msg = savefile_read_string(file);
        turn = savefile_read_s32b(file);
        count = savefile_read_s32b(file);
        color = savefile_read_byte(file);

        _cmsg_add_aux(color, string_buffer(msg), turn, count);
        string_free(msg);
    }
}
Пример #2
0
void spell_stats_on_load(savefile_ptr file)
{
    str_map_ptr map = _spell_stats_map();
    int         ct, i;

    str_map_clear(map);
    ct = savefile_read_s32b(file);
    for (i = 0; i < ct; i++)
    {
        char            name[255];
        spell_stats_ptr stats = malloc(sizeof(spell_stats_t));

        memset(stats, 0, sizeof(spell_stats_t));

        savefile_read_cptr(file, name, sizeof(name));
        stats->flags = savefile_read_u32b(file);
        stats->ct_cast = savefile_read_s32b(file);
        stats->ct_fail = savefile_read_s32b(file);
        stats->skill = savefile_read_s32b(file);
        stats->max_skill = savefile_read_s32b(file);
        stats->last_turn = savefile_read_s32b(file);

        str_map_add(map, name, stats);
    }
}
Пример #3
0
void skills_on_load(savefile_ptr file)
{
    str_map_ptr map = _innate_map();
    int         ct, i;

    str_map_clear(map);
    ct = savefile_read_s32b(file);

    for (i = 0; i < ct; i++)
    {
        char            name[255];
        _skill_info_ptr info = malloc(sizeof(_skill_info_t));

        savefile_read_cptr(file, name, sizeof(name));
        info->current = savefile_read_s32b(file);
        info->max = savefile_read_s32b(file);

        str_map_add(map, name, info);
    }

    /* TODO: Spell Skills for Bookless Casters */
    ct = savefile_read_s32b(file);
}