Пример #1
0
static int _get_spells(spell_info* spells, int max)
{
    int idx = -1;
    int ct = 0;
    menu_t menu = { "Use which group of talents?", "Browse which group of talents?", NULL,
                    _spell_menu_fn, _groups, 3};
    
    idx = menu_choose(&menu);
    if (idx < 0) return 0;

    /* Hack: Add innate Wonder attack to Wild Beginnings */
    if (idx == 0)
    {
        spell_info* spell = &spells[ct++];
        spell->level = 10;
        spell->cost = 10;
        spell->fail = calculate_fail_rate(10, 30, p_ptr->stat_ind[A_INT]);
        spell->fn = wonder_spell;
    }

    ct += _get_spells_imp(spells + ct, max - ct, _groups[idx].min_slot, _groups[idx].max_slot);
    if (ct == 0)
        msg_print("You don't know any of those talents yet!");
    return ct;
}
static void _character_dump(doc_ptr doc)
{
    spell_info spells[MAX_SPELLS];
    int        ct = 0, i;

    for (i = 0; i < 4; i++)
        ct += _get_spells_imp(spells + ct, MAX_SPELLS - ct, i);

    py_display_spells(doc, spells, ct);
}
Пример #3
0
static int _get_spells(spell_info* spells, int max)
{
    int idx = -1;
    int ct = 0;
    menu_t menu = { "Use which group?", NULL, NULL,
                    _book_menu_fn, _books, 4 };
    
    idx = menu_choose(&menu);
    if (idx < 0) return 0;

    ct = _get_spells_imp(spells, max, idx);
    if (ct == 0)
        msg_print("You don't know any of those techniques yet!");
    return ct;
}
Пример #4
0
static int _get_spells(spell_info* spells, int max)
{
	int idx = -1;
	int ct = 0;
	menu_list_t list = { "Use which group of spells?", "Browse which group of spells?", NULL,
						_spell_group_name, _spell_group_help, _spell_group_color, 
						_spell_groups, _MAX_SPELL_GROUPS};

	idx = menu_choose(&list);
	if (idx < 0) return 0;
	ct = _get_spells_imp(spells, max, &_spell_groups[idx]);
	if (ct == 0)
		msg_print("You don't know any of those spells yet!");
	return ct;
}
Пример #5
0
static void _character_dump(doc_ptr doc)
{
    int i;
    spell_info spells[MAX_SPELLS];
    int ct = _get_spells_imp(spells, MAX_SPELLS, 0, _MAX_TALENTS - 1);

    for (i = 0; i < ct; i++)
    {
        spell_info* current = &spells[i];
        current->cost += get_spell_cost_extra(current->fn);
        current->fail = MAX(current->fail, get_spell_fail_min(current->fn));
    }

    if (ct > 0)
    {
        int i;
        variant name, info;

        var_init(&name);
        var_init(&info);

        doc_printf(doc, "<topic:WildTalent>================================= <color:keypress>W</color>ild Talents ================================\n\n");
        doc_printf(doc, "<color:G>%-23.23s Lv Stat Cost Fail Info</color>\n", "");
        for (i = 0; i < ct; ++i)
        {
            spell_info *spell = &spells[i];

            (spell->fn)(SPELL_NAME, &name);
            (spell->fn)(SPELL_INFO, &info);

            doc_printf(doc, "%-23.23s %2d %4.4s %4d %3d%% %s\n",
                            var_get_string(&name),
                            spell->level,
                            stat_abbrev_true[_which_stat(i)],
                            spell->cost,
                            spell->fail,
                            var_get_string(&info));
        }

        var_clear(&name);
        var_clear(&info);

        doc_newline(doc);
    }
}