예제 #1
0
void spell_stats_on_save(savefile_ptr file)
{
    str_map_ptr      map = _spell_stats_map();
    str_map_iter_ptr iter;
    
    savefile_write_s32b(file, str_map_count(map));

    for (iter = str_map_iter_alloc(map); 
            str_map_iter_is_valid(iter); 
            str_map_iter_next(iter))
    {
        spell_stats_ptr stats = str_map_iter_current(iter);

        savefile_write_cptr(file, str_map_iter_current_key(iter));
        savefile_write_u32b(file, stats->flags);
        savefile_write_s32b(file, stats->ct_cast);
        savefile_write_s32b(file, stats->ct_fail);
        savefile_write_s32b(file, stats->skill);
        savefile_write_s32b(file, stats->max_skill);
        savefile_write_s32b(file, stats->last_turn);
    }
    str_map_iter_free(iter);
}
예제 #2
0
void skills_on_save(savefile_ptr file)
{
    str_map_ptr         map = _innate_map();
    str_map_iter_ptr    iter;

    savefile_write_s32b(file, str_map_count(map));

    for (iter = str_map_iter_alloc(map);
            str_map_iter_is_valid(iter);
            str_map_iter_next(iter))
    {
        cptr            name = str_map_iter_current_key(iter);
        _skill_info_ptr info = (_skill_info_ptr)str_map_iter_current(iter);

        savefile_write_cptr(file, name);
        savefile_write_s32b(file, info->current);
        savefile_write_s32b(file, info->max);
    }
    str_map_iter_free(iter);

    /* TODO: Spell Skills for Bookless Casters */
    savefile_write_s32b(file, 0);
}