Ejemplo n.º 1
0
static void _rage_strike_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Ragestrike");
        break;
    case SPELL_DESC:
        var_set_string(res, "Fire a ball of pure rage at chosen foe, striking with everything you've got!");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, _rage_strike_dam()));
        break;
    case SPELL_FAIL:
        sp_player(-p_ptr->csp);
        break;
    case SPELL_CAST:
    {
        int dir;
        var_set_bool(res, FALSE);

        if (p_ptr->chp < 100)
        {
            if (!get_check("Really? This will kill you!")) return;
        }

        if (!get_aim_dir(&dir)) return;

        fire_ball(GF_MISSILE, dir, _rage_strike_dam(), 0);
        take_hit(DAMAGE_NOESCAPE, 100, "Rage", -1);
        if (!p_ptr->shero)
            set_stun(99, FALSE); /* 100 is Knocked Out */

        sp_player(-p_ptr->csp); /* Don't use SPELL_COST_EXTRA since we pay mana up front these days! */
        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
Ejemplo n.º 2
0
static void _focus_rage_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Focus Rage");
        break;
    case SPELL_DESC:
        var_set_string(res, "Damage yourself and regain spell points.");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, 10 + p_ptr->lev/2));
        break;
    case SPELL_FAIL:
    {
        int hp = 10 + p_ptr->lev/2;
        take_hit(DAMAGE_NOESCAPE, hp, "Rage", -1);
        break;
    }
    case SPELL_CAST:
    {
        int hp = 10 + p_ptr->lev/2;

        var_set_bool(res, FALSE);

        if (p_ptr->chp < hp)
        {
            if (!get_check("Really? This will kill you!")) return;
        }

        take_hit(DAMAGE_NOESCAPE, hp, "Rage", -1);
        sp_player(hp);

        _unclear_mind = FALSE; /* Hack to avoid automatic mana drain for this action */
        var_set_bool(res, TRUE);
        break;    
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
void _pulverise_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Pulverise");
        break;
    case SPELL_DESC:
        var_set_string(res, "Fires a ball which hurts monsters with telekinesis.");
        break;
    case SPELL_SPOIL_DESC:
        var_set_string(res, "Fires a ball (Radius 0 or (L-20)/8 + 1) of Telekinesis (Damage (8 + (L-5)/4)d8).");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(spell_power(8 + ((p_ptr->lev - 5) / 4)), 8, spell_power(p_ptr->to_d_spell)));
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        int dice = 8 + ((p_ptr->lev - 5) / 4);
        int sides = 8;
        int rad = p_ptr->lev > 20 ? spell_power((p_ptr->lev - 20) / 8 + 1) : 0;

        var_set_bool(res, FALSE);
        if (!get_fire_dir(&dir)) return;

        fire_ball(
            GF_TELEKINESIS,
            dir,
            spell_power(damroll(dice, sides) + p_ptr->to_d_spell),
            rad
        );

        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
Ejemplo n.º 4
0
void laser_eye_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Laser Eye");
        break;
    case SPELL_DESC:
        var_set_string(res, "Fires a laser beam.");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, spell_power(p_ptr->lev*2)));
        break;
    case SPELL_GAIN_MUT:
        msg_print("Your eyes burn for a moment.");
        break;
    case SPELL_LOSE_MUT:
        msg_print("Your eyes burn for a moment, then feel soothed.");
        break;
    case SPELL_MUT_DESC:
        var_set_string(res, "Your eyes can fire laser beams.");
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        var_set_bool(res, FALSE);
        if (get_aim_dir(&dir))
        {
            fire_beam(GF_LITE, dir, spell_power(2 * p_ptr->lev));
            var_set_bool(res, TRUE);
        }
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
Ejemplo n.º 5
0
static void _breathe_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Breathe");
        break;
    case SPELL_DESC:
        var_set_string(res, format("Breathes %s at your opponent.", _breath_desc()));
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, _breath_amount()));
        break;
    case SPELL_COST_EXTRA:
    {
        int l = p_ptr->lev;
        int cst = l*l/100;
        var_set_int(res, cst);
        break;
    }
    case SPELL_CAST:
    {
        int dir = 0;
        var_set_bool(res, FALSE);
        if (get_aim_dir(&dir))
        {
            int e = _breath_effect();
            msg_format("You breathe %s", gf_name(e));
            fire_ball(e, dir, _breath_amount(), -1 - (p_ptr->lev / 20));
            var_set_bool(res, TRUE);
        }
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
void _neural_blast_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Neural Blast");
        break;
    case SPELL_DESC:
        var_set_string(res, "Fires a beam or ball which inflicts psionic damage.");
        break;
    case SPELL_SPOIL_DESC:
        var_set_string(res, "Fires a beam or ball (Radius 0) which inflicts (3 + (L-1)/4)d(3 + L/15) psionic damage.");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(spell_power(3 + ((p_ptr->lev - 1) / 4)), 3 + p_ptr->lev / 15, spell_power(p_ptr->to_d_spell)));
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        int dice = 3 + ((p_ptr->lev - 1) / 4);
        int sides = (3 + p_ptr->lev / 15);
        var_set_bool(res, FALSE);

        if (!get_fire_dir(&dir)) return;

        if (randint1(100) < p_ptr->lev * 2)
            fire_beam(GF_PSI, dir, spell_power(damroll(dice, sides) + p_ptr->to_d_spell));
        else
            fire_ball(GF_PSI, dir, spell_power(damroll(dice, sides) + p_ptr->to_d_spell), 0);

        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
Ejemplo n.º 7
0
static void _drip_of_light_spell(int cmd, variant *res)
{
    int  dd = 3 + (p_ptr->lev-1)/5;
    int     ds = 4;
    bool beam = (p_ptr->lev >= 10 && _on_mirror) ? TRUE : FALSE;

    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Drip of Light");
        break;
    case SPELL_DESC:
        if (beam)
            var_set_string(res, "Fires a beam of light");
        else
            var_set_string(res, "Fires a bolt of light");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(spell_power(dd), ds, 0));
        break;
    case SPELL_CAST:
    {
        int dir;
        var_set_bool(res, FALSE);
        if (!get_aim_dir(&dir)) return;
        if (beam)
            fire_beam(GF_LITE, dir,spell_power(damroll(dd, ds)));
        else
            fire_bolt(GF_LITE, dir,spell_power(damroll(dd, ds)));
        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
Ejemplo n.º 8
0
static void _binding_field_spell(int cmd, variant *res)
{
    int dam = spell_power(p_ptr->lev*11 + 5);
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Binding Field");
        break;
    case SPELL_DESC:
        var_set_string(res, "Generates a magical triangle which damages all monsters in the area. The vertices of the triangle is you and two mirrors in sight.");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, dam));
        break;
    case SPELL_CAST:
        if (!binding_field(dam))
            msg_print("You were not able to choose suitable mirrors!");
        var_set_bool(res, TRUE);
        break;
    default:
        default_spell(cmd, res);
        break;
    }
}
void _psychic_drain_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Psychic Drain");
        break;
    case SPELL_DESC:
        var_set_string(res, "Fires a ball which damages monsters and absorbs monsters' mind power. "
                              "Absorbing takes from 0 to 1.5 more turns.");
        break;
    case SPELL_SPOIL_DESC:
        var_set_string(res, "Drain target monster (Damage (L/2)d6) to regain 5d(damage)/4 spell points. But this spell also consumes 1d150 extra energy.");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(spell_power(p_ptr->lev/2), 6, spell_power(p_ptr->to_d_spell)));
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        int dam = spell_power(damroll(p_ptr->lev / 2, 6) + p_ptr->to_d_spell);
        var_set_bool(res, FALSE);
        if (!get_fire_dir(&dir)) return;

        /* Only charge extra energy if the drain succeeded */
        if (fire_ball(GF_PSI_DRAIN, dir, dam, 0))
            p_ptr->energy_need += randint1(150);

        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
Ejemplo n.º 10
0
static void _bite_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Vampiric Bite");
        break;
    case SPELL_DESC:
        var_set_string(res, "As a vampire, you must feed on fresh blood in order to sustain your unlife!");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, _bite_amt()));
        break;
    case SPELL_CAST:
        var_set_bool(res, FALSE);
        if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
        {
            msg_print("Something prevents you from attacking.");
            return;
        }
        else
        {
            int x = 0, y = 0, amt, m_idx = 0;
            int dir = 0;

            if (use_old_target && target_okay())
            {
                y = target_row;
                x = target_col;
                m_idx = cave[y][x].m_idx;
                if (m_idx)
                {
                    if (m_list[m_idx].cdis > 1)
                        m_idx = 0;
                    else
                        dir = 5;
                }
            }

            if (!m_idx)
            {
                if (!get_rep_dir2(&dir)) return;
                if (dir == 5) return;
                y = py + ddy[dir];
                x = px + ddx[dir];
                m_idx = cave[y][x].m_idx;

                if (!m_idx)
                {
                    msg_print("There is no monster there.");
                    return;
                }
            }

            var_set_bool(res, TRUE);

            msg_print("You grin and bare your fangs...");
            amt = _bite_amt();

            vampiric_drain_hack = TRUE;
            if (project(0, 0, y, x, amt, GF_OLD_DRAIN, PROJECT_STOP | PROJECT_KILL | PROJECT_THRU, -1))
            {
                vampire_feed(amt);
            }
            else
                msg_print("Yechh. That tastes foul.");
            vampiric_drain_hack = FALSE;
        }
        break;
    case SPELL_COST_EXTRA:
        var_set_int(res, MIN(_bite_amt() / 10, 29));
        break;
    default:
        default_spell(cmd, res);
        break;
    }
}