Ejemplo n.º 1
0
static void _remove_obstacles_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Remove Obstacles");
        break;
    case SPELL_DESC:
        var_set_string(res, "Clears a path to treasure!  Traps, doors and trees will be removed.");
        break;
    case SPELL_CAST:
        {
            bool b = FALSE;
            int dir = 5;
            if (get_aim_dir(&dir))
            {
                project(0, 1, py, px, 0, GF_REMOVE_OBSTACLE, PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE, -1);
                project_hook(GF_REMOVE_OBSTACLE, dir, 0, PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM);
                b = TRUE;
            }
            var_set_bool(res, b);
        }
        break;
    default:
        default_spell(cmd, res);
        break;
    }
}
Ejemplo n.º 2
0
void amnesia_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Amnesia");
        break;
    case SPELL_DESC:
        var_set_string(res, "Attempt to make target monster forget something.");
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        int lvl = p_ptr->lev;
        if (p_ptr->lev > 40)
            lvl += (p_ptr->lev - 40) * 2;

        var_set_bool(res, FALSE);
        if (!get_aim_dir(&dir)) return;
        project_hook(GF_AMNESIA, dir, lvl, PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE);
        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
Ejemplo n.º 3
0
static void _extended_whip_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Extended Crack");
        break;
    case SPELL_DESC:
        var_set_string(res, "This spell extends the range of your whip based melee attack.");
        break;
    case SPELL_CAST:
        if (_whip_check())
        {
            int dir = 5;
            bool b = FALSE;

            project_length = 2;
            if (get_aim_dir(&dir))
            {
                project_hook(GF_ATTACK, dir, HISSATSU_2, PROJECT_STOP | PROJECT_KILL);
                b = TRUE;
            }
            var_set_bool(res, b);
        }
        else
        {
            msg_print("Whip techniques can only be used if you are fighting with whips.");
            var_set_bool(res, FALSE);
        }
        break;
    default:
        default_spell(cmd, res);
        break;
    }
}