Example #1
0
static void _add_extra_costs(spell_info* spells, int max)
{
    int i;
    /* Some spells give extra abilities depending on player level ...
       Ideally, these spells should scale the costs as well! */
    for (i = 0; i < max; 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));
        current->cost = calculate_cost(current->cost);
    }
}
Example #2
0
static void _add_extra_costs_powers(spell_info* spells, int max)
{
    int i;
    /* Some spells give extra abilities depending on player level ...
       Ideally, these spells should scale the costs as well! */
    for (i = 0; i < max; 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));
        /*Oops: Powers should not benefit from DEC_MANA or CASTER_NO_SPELL_COST!!!
        current->cost = calculate_cost(current->cost);*/
    }
}
Example #3
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);
    }
}