static void _for_each_mirror(pos_fn f)
{
    int x, y;
    for (x = 0; x < cur_wid; x++)
    {
        for (y = 0; y < cur_hgt; y++)
        {
            if (is_mirror_grid(&cave[y][x]))
                f(y, x);
        }
    }
}
static int _mirrors_ct(void)
{
    int ct = 0;
    int x, y;
    for (x = 0; x < cur_wid; x++)
    {
        for (y = 0; y < cur_hgt; y++)
        {
            if (is_mirror_grid(&cave[y][x]))
                ct++;
        }
    }
    return ct;
}
Exemplo n.º 3
0
/*
 * Remove all mirrors in this floor
 */
void remove_all_mirrors(bool explode)
{
    int x, y;

    for (x = 0; x < cur_wid; x++)
    {
        for (y = 0; y < cur_hgt; y++)
        {
            if (is_mirror_grid(&cave[y][x]))
            {
                remove_mirror(y, x);
                if (explode)
                    project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS,
                            (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
            }
        }
    }
}
Exemplo n.º 4
0
void mirror_concentration_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, T("Mirror Concentration", "静水"));
        break;
    case SPELL_DESC:
        var_set_string(res, "");
        break;
    case SPELL_CAST:
        var_set_bool(res, FALSE);
        if (total_friends)
        {
            msg_print(T("You need concentration on the pets now.", "今はペットを操ることに集中していないと。"));
            return;
        }
        if (is_mirror_grid(&cave[py][px]))
        {
            msg_print(T("You feel your head clear a little.", "少し頭がハッキリした。"));

            p_ptr->csp += (5 + p_ptr->lev * p_ptr->lev / 100);
            if (p_ptr->csp >= p_ptr->msp)
            {
                p_ptr->csp = p_ptr->msp;
                p_ptr->csp_frac = 0;
            }

            p_ptr->redraw |= (PR_MANA);
            var_set_bool(res, TRUE);
        }
        else
        {
            msg_print(T("You need to on a mirror to use this spell!", "鏡の上でないと集中できない!"));
        }
        break;
    default:
        default_spell(cmd, res);
        break;
    }
}
static int _get_powers(spell_info* spells, int max)
{    
    _on_mirror = is_mirror_grid(&cave[py][px]);
    return get_powers_aux(spells, max, _powers);
}