Beispiel #1
0
static void spell_wonder(int Ind, int dir)
{
/* This spell should become more useful (more
   controlled) as the player gains experience levels.
   Thus, add 1/5 of the player's level to the die roll.
   This eliminates the worst effects later on, while
   keeping the results quite random.  It also allows
   some potent effects only at high level. */

	player_type *p_ptr = Players[Ind];
	
	int py = p_ptr->py;
	int px = p_ptr->px;
	int Depth = p_ptr->dun_depth;
	int plev = p_ptr->lev;
	int die = randint(100) + plev / 5;
	int beam = beam_chance(Ind);

	if (die > 100)
		msg_print(Ind, "You feel a surge of power!");
	if (die < 8) clone_monster(Ind, dir);
	else if (die < 14) speed_monster(Ind, dir);
	else if (die < 26) heal_monster(Ind, dir);
	else if (die < 31) poly_monster(Ind, dir);
	else if (die < 36)
		fire_bolt_or_beam(Ind, beam - 10, GF_MISSILE, dir,
		                  damroll(3 + ((plev - 1) / 5), 4));
	else if (die < 41) confuse_monster(Ind, dir, plev);
	else if (die < 46) fire_ball(Ind, GF_POIS, dir, 20 + (plev / 2), 3);
	else if (die < 51) lite_line(Ind, dir);
	else if (die < 56)
		fire_beam(Ind, GF_ELEC, dir, damroll(3+((plev-5)/6), 6));
	else if (die < 61)
		fire_bolt_or_beam(Ind, beam-10, GF_COLD, dir,
		                  damroll(5+((plev-5)/4), 8));
	else if (die < 66)
		fire_bolt_or_beam(Ind, beam, GF_ACID, dir,
		                  damroll(6+((plev-5)/4), 8));
	else if (die < 71)
		fire_bolt_or_beam(Ind, beam, GF_FIRE, dir,
		                  damroll(8+((plev-5)/4), 8));
	else if (die < 76) drain_life(Ind, dir, 75);
	else if (die < 81) fire_ball(Ind, GF_ELEC, dir, 30 + plev / 2, 2);
	else if (die < 86) fire_ball(Ind, GF_ACID, dir, 40 + plev, 2);
	else if (die < 91) fire_ball(Ind, GF_ICE, dir, 70 + plev, 3);
	else if (die < 96) fire_ball(Ind, GF_FIRE, dir, 80 + plev, 3);
	else if (die < 101) drain_life(Ind, dir, 100 + plev);
	else if (die < 104) earthquake(Depth, py, px, 12);
	else if (die < 106) destroy_area(Depth, py, px, 15, TRUE);
	else if (die < 108) banishment(Ind);
	else if (die < 110) dispel_monsters(Ind, 120);
	else /* RARE */
	{
		dispel_monsters(Ind, 150);
		slow_monsters(Ind);
		sleep_monsters(Ind);
		hp_player(Ind, 300);
	}
}
Beispiel #2
0
static bool cast_undead_spell(int Ind, int spell)
{
	player_type 	*p_ptr = Players[Ind];
	
	int dir;
	
	int plev = p_ptr->lev;

	switch (spell)
	{
		case GHOSTLY_BLINK:
		{
			teleport_player(Ind, 10);
			break;
		}
		case GHOSTLY_TELEPORT_SELF:
		{
			teleport_player(Ind, plev * 8);
			break;
		}
		case GHOSTLY_SCARE_MONSTER:
		{
			if (!get_aim_dir(Ind, &dir)) return (FALSE);
			(void)fear_monster(Ind, dir, plev);
			break;
		}
		case GHOSTLY_CONFUSE_MONSTER:
		{
			if (!get_aim_dir(Ind, &dir)) return (FALSE);
			confuse_monster(Ind, dir, plev);
			break;
		}
		case GHOSTLY_NETHER_BOLT:
		{
			if (!get_aim_dir(Ind, &dir)) return (FALSE);
			fire_bolt_or_beam(Ind, plev * 2, GF_NETHER, dir, 50 + damroll(5, 5) + plev);
			break;
		}
		case GHOSTLY_NETHER_BALL:
		{
			if (!get_aim_dir(Ind, &dir)) return (FALSE);
			fire_ball(Ind, GF_NETHER, dir, 100 + 2 * plev, 2);
			break;
		}
		case GHOSTLY_DARKNESS_STORM:
		{
			if (!get_aim_dir(Ind, &dir)) return (FALSE);
			fire_ball(Ind, GF_DARK, dir, plev * 5 + damroll(10, 10), 3);
			break;
		}
	}

	/* Success */
	return (TRUE);
}
Beispiel #3
0
void _breathe_light_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Breathe Light");
        break;
    case SPELL_DESC:
        var_set_string(res, "Breathes light at chosen target");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, p_ptr->chp / 3));
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        var_set_bool(res, FALSE);
        if (!get_fire_dir(&dir)) return;

        msg_print("You breathe light.");
        fire_ball(GF_LITE, dir, p_ptr->chp / 3, -3);

        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
void _gaze_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Vampiric Gaze");
        break;
    case SPELL_DESC:
        var_set_string(res, "Attempts to dominate an intelligent foe causing stunning, confusion, fear or perhaps even enslavement.");
        break;
    case SPELL_INFO:
        var_set_string(res, info_power(_gaze_power()));
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        var_set_bool(res, FALSE);
        if (!get_aim_dir(&dir)) return;
        fire_ball(GF_DOMINATION, dir, _gaze_power(), 0);
        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
/******************************************************************************
 * Troll Powers
 ******************************************************************************/
static void _aklash_breathe_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Breathe Gas");
        break;
    case SPELL_DESC:
        var_set_string(res, "Breathes poison at your opponent.");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, p_ptr->chp / 4));
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        var_set_bool(res, FALSE);
        if (get_aim_dir(&dir))
        {
            msg_print("You breathe gas.");
            fire_ball(GF_POIS, dir, p_ptr->chp / 4, -2);
            var_set_bool(res, TRUE);
        }
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
void _psycho_storm_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Psycho-Storm");
        break;
    case SPELL_DESC:
        var_set_string(res, "Fires a large ball of pure mental energy.");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(10, spell_power(10), spell_power(p_ptr->lev * 5 + p_ptr->to_d_spell)));
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        var_set_bool(res, FALSE);
        if (!get_fire_dir(&dir)) return;

        fire_ball(GF_PSI_STORM, dir, spell_power(p_ptr->lev * 5 + damroll(10, 10) + p_ptr->to_d_spell), 4);

        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
void _domination_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Domination");
        break;
    case SPELL_DESC:
        var_set_string(res, "Stuns, confuses or scares a monster. Or attempts to charm all monsters in sight at level 30.");
        break;
    case SPELL_SPOIL_DESC:
        var_set_string(res, "Stuns, confuses or scares a monster. Or attempts to charm all monsters in sight at L30.");
        break;
    case SPELL_CAST:
    {
        var_set_bool(res, FALSE);
        if (p_ptr->lev < 30)
        {
            int dir = 0;
            if (!get_fire_dir(&dir)) return;

            fire_ball(GF_DOMINATION, dir, spell_power(p_ptr->lev), 0);
        }
        else
        {
            charm_monsters(spell_power(p_ptr->lev * 2));
        }
        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
static void _mirror_clashing_spell(int cmd, variant *res)
{
    int dd = 8 + (p_ptr->lev - 5)/4;
    int ds = 8;
    int rad = p_ptr->lev > 20 ? spell_power((p_ptr->lev - 20)/8 + 1) : 0;

    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Mirror Clashing");
        break;
    case SPELL_DESC:
        var_set_string(res, "Fires a ball of shards.");
        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;
        fire_ball(GF_SHARDS, dir, spell_power(damroll(dd, ds)), rad);
        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
Beispiel #9
0
static void _shine_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Shine");
        break;
    case SPELL_DESC:
        var_set_string(res, "Generates a large ball of sunlight.");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, p_ptr->lev * 3));
        break;
    case SPELL_CAST:
        fire_ball(GF_LITE, 0, p_ptr->lev * 3 * 2, 3);
        var_set_bool(res, TRUE);
        break;
    case SPELL_COST_EXTRA:
        var_set_int(res, (p_ptr->lev - 20)/2);
        break;
    default:
        default_spell(cmd, res);
        break;
    }
}
Beispiel #10
0
static void _shout_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Shout");
        break;
    case SPELL_DESC:
        var_set_string(res, "Projects a cone of sound at a chosen foe.");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(3 + (p_ptr->lev-1)/5, 4, 0));
        break;
    case SPELL_CAST:
    {
        int dir;
        var_set_bool(res, FALSE);
        if (!get_aim_dir(&dir)) return;
        fire_ball(GF_SOUND, dir, damroll(3 + (p_ptr->lev-1)/5, 4), -2);
        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
void android_bazooka_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Bazooka");
        break;
    case SPELL_DESC:
        var_set_string(res, "Fires your bazooka at a nearby monster.");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, spell_power(25 + p_ptr->lev * 2)));
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        var_set_bool(res, FALSE);
        if (!get_aim_dir(&dir)) return;

        msg_print("You fire your bazooka.");
        fire_ball(GF_MISSILE, dir, spell_power(25 + p_ptr->lev * 2), 2);

        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
void invoke_logrus_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Invoke Logrus");
        break;
    case SPELL_DESC:
        var_set_string(res, "Fires a huge ball of chaos.");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(spell_power(10), 10, spell_power(p_ptr->lev*4)));
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        var_set_bool(res, FALSE);
        if (!get_aim_dir(&dir)) return;
        fire_ball(GF_CHAOS, dir, spell_power(damroll(10, 10) + p_ptr->lev*4), 4);
        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
static void _shard_ball_spell(int cmd, variant *res)
{
    int l = p_ptr->lev;
    int dam = l*2 + l*l/25 + l*l*l/1250;

    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Shard Ball");
        break;
    case SPELL_DESC:
        var_set_string(res, "Fires a ball of shards at chosent target");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, dam));
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        var_set_bool(res, FALSE);
        if (!get_aim_dir(&dir)) return;
        fire_ball(GF_SHARDS, dir, dam, 2);
        var_set_bool(res, TRUE);
        break;
    }
    case SPELL_COST_EXTRA:
        var_set_int(res, dam / 6);
        break;
    default:
        default_spell(cmd, res);
        break;
    }
}
void acid_ball_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Acid Ball");
        break;
    case SPELL_DESC:
        var_set_string(res, "Generate an Acid Ball on chosen target.");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, spell_power(3*p_ptr->lev/2 + 35)));
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        var_set_bool(res, FALSE);
        if (!get_aim_dir(&dir)) return;
        fire_ball(GF_ACID, dir, spell_power(3*p_ptr->lev/2 + 35), 2);
        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
void breathe_fire_II_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Breathe Fire");
        break;
    case SPELL_DESC:
        var_set_string(res, "Breathes Fire at your opponent.");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, spell_power(p_ptr->chp*2/5)));
        break;
    case SPELL_COST_EXTRA:
        var_set_int(res, p_ptr->lev);
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        var_set_bool(res, FALSE);
        if (get_aim_dir(&dir))
        {
            stop_mouth();
            msg_print("You breathe fire...");
            fire_ball(GF_FIRE, dir, spell_power(p_ptr->chp*2/5), -1 - (p_ptr->lev / 20));
            var_set_bool(res, TRUE);
        }
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
void hellfire_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Hellfire");
        break;
    case SPELL_DESC:
        var_set_string(res, "Fires a powerful ball of evil power directly from the bowels of hell. Good monsters are especially susceptible.");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, spell_power(666)));
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        var_set_bool(res, FALSE);
        if (get_aim_dir(&dir))
        {
            fire_ball(GF_HELL_FIRE, dir, spell_power(666), 3);
            if (!demon_is_(DEMON_BALROG))
                take_hit(DAMAGE_USELIFE, 20 + randint1(30), "the strain of casting Hellfire", -1);
            var_set_bool(res, TRUE);
        }
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
Beispiel #17
0
void _breathe_disintegration_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Breathe Disintegration");
        break;
    case SPELL_DESC:
        var_set_string(res, "A disintegration breath. Not even the dungeon walls can withstand its power!");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, p_ptr->chp / 4));
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        var_set_bool(res, FALSE);
        if (!get_aim_dir(&dir)) return;

        msg_print("You breathe disintegration.");
        fire_ball(GF_DISINTEGRATE, dir, p_ptr->chp / 4, -3);

        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
Beispiel #18
0
void _breathe_time_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Breathe Time");
        break;
    case SPELL_DESC:
        var_set_string(res, "Breathes time at chosen target");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, p_ptr->chp / 5));
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        var_set_bool(res, FALSE);
        if (!get_aim_dir(&dir)) return;

        msg_print("You breathe time.");
        fire_ball(GF_TIME, dir, p_ptr->chp / 5, -3);

        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
static void _water_ball_spell(int cmd, variant *res)
{
    int l = p_ptr->lev;
    int dam = l*2 + l*l/25 + l*l*l/1250;

    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Water Ball");
        break;
    case SPELL_DESC:
        var_set_string(res, "Fires a huge ball of water.");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, dam));
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        var_set_bool(res, FALSE);
        if (!get_aim_dir(&dir)) return;
        fire_ball(GF_WATER2, dir, dam, 4);
        var_set_bool(res, TRUE);
        break;
    }
    case SPELL_COST_EXTRA:
        var_set_int(res, dam / 10);
        break;
    default:
        default_spell(cmd, res);
        break;
    }
}
void lightning_ball_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Lightning Ball");
        break;
    case SPELL_DESC:
        var_set_string(res, "Fires a ball of electricity.");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, spell_power(3*p_ptr->lev/2 + 20)));
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        var_set_bool(res, FALSE);
        if (!get_aim_dir(&dir)) return;
        fire_ball(GF_ELEC, dir, spell_power(3*p_ptr->lev/2 + 20), 2);
        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
void kiss_of_succubus_spell(int cmd, variant *res)
{
    int dam = spell_power(100 + p_ptr->lev * 2);
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Kiss of Succubus");
        break;
    case SPELL_DESC:
        var_set_string(res, "Fires a ball of nexus.");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, dam));
        break;
    case SPELL_CAST:
    {
        int dir;
        var_set_bool(res, FALSE);
        if (!get_aim_dir(&dir)) break;
        fire_ball(GF_NEXUS, dir, dam, 4);
        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
void imp_fire_spell(int cmd, variant *res)
{
    const int ball_lev = 30;
    switch (cmd)
    {
    case SPELL_NAME:
        if (p_ptr->lev >= ball_lev)
            var_set_string(res, "Fire Ball");
        else
            var_set_string(res, "Fire Bolt");
        break;
    case SPELL_SPOIL_NAME:
        var_set_string(res, "Fire Bolt/Ball");
        break;
    case SPELL_DESC:
        if (p_ptr->lev >= ball_lev)
            var_set_string(res, "Generate a Fire Ball on chosen target.");
        else
            var_set_string(res, "Hurls a fiery missile at chosen target.");
        break;
    case SPELL_SPOIL_DESC:
        var_set_string(res, "Fire Bolt for L damage. At L30, does a radius 2 Fire Ball for 2L damage instead.");
        break;
    case SPELL_INFO:
        if (p_ptr->lev >= ball_lev)
            var_set_string(res, info_damage(0, 0, spell_power(p_ptr->lev * 2)));
        else
            var_set_string(res, info_damage(0, 0, spell_power(p_ptr->lev)));
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        var_set_bool(res, FALSE);
        if (!get_aim_dir(&dir)) return;
        if (p_ptr->lev >= ball_lev)
            fire_ball(GF_FIRE, dir, spell_power(p_ptr->lev * 2), 2);
        else
            fire_bolt(GF_FIRE, dir, spell_power(p_ptr->lev));
        var_set_bool(res, TRUE);
        break;
    }
    case SPELL_COST_EXTRA:
        if (p_ptr->lev >= ball_lev)
            var_set_int(res, 7);
        else
            var_set_int(res, 0);
        break;
    default:
        default_spell(cmd, res);
        break;
    }
}
void breathe_fire_I_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Breathe Fire");
        break;
    case SPELL_DESC:
        var_set_string(res, "Breathes Fire at your opponent.");
        break;
    case SPELL_GAIN_MUT:
        msg_print("You gain the ability to breathe fire.");
        break;
    case SPELL_LOSE_MUT:
        msg_print("You lose the ability to breathe fire.");
        break;
    case SPELL_MUT_DESC:
        var_set_string(res, "You can breathe fire (dam lvl * 2).");
        break;
    case SPELL_INFO:
        var_set_string(res, info_damage(0, 0, spell_power(2 * p_ptr->lev)));
        break;
    case SPELL_COST_EXTRA:
        var_set_int(res, (p_ptr->lev+1)/2);
        break;
    case SPELL_CAST:
    {
        int dir = 0;
        var_set_bool(res, FALSE);
        if (get_aim_dir(&dir))
        {
            stop_mouth();
            msg_print("You breathe fire...");
            fire_ball(GF_FIRE, dir, spell_power(2 * p_ptr->lev), -1 - (p_ptr->lev / 20));
            var_set_bool(res, TRUE);
        }
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
Beispiel #24
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;
    }
}
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;
    }
}
Beispiel #26
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;
    }
}
Beispiel #28
0
static void _anti_magic_ray_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Antimagic Ray");
        break;
    case SPELL_DESC:
        var_set_string(res, "Block spells from a chosen foe.");
        break;
    case SPELL_CAST:
    {
        int dir;
        var_set_bool(res, FALSE);
        if (!get_aim_dir(&dir)) return;
        fire_ball(GF_ANTIMAGIC, dir, 1, 0);
        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
Beispiel #29
0
static void _mana_clash_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Mana Clash");
        break;
    case SPELL_DESC:
        var_set_string(res, "Fires a ball at chosen target. Only spellcasters will be damaged.");
        break;
    case SPELL_CAST:
    {
        int dir;
        var_set_bool(res, FALSE);
        if (!get_aim_dir(&dir)) return;
        fire_ball(GF_MANA_CLASH, dir, 24 * p_ptr->lev, 2); /* damage later divided by Y + 1 in spells1!project_m where Y is spell freq */
        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
static void _mana_clash_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Mana Clash");
        break;
    case SPELL_DESC:
        var_set_string(res, "Fires a ball at chosen target. Only spellcasters will be damaged.");
        break;
    case SPELL_CAST:
    {
        int dir;
        var_set_bool(res, FALSE);
        if (!get_fire_dir(&dir)) return;
        fire_ball(GF_MANA_CLASH, dir, 18 * p_ptr->lev, 2); /* dam = dam * spell_freq / 100 in spells1.c */
        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}