static void _mirror_of_seeing_spell(int cmd, variant *res)
{
    int lvl = p_ptr->lev;

    if (_on_mirror)
        lvl += 4;

    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Mirror of Seeing");
        break;
    case SPELL_DESC:
        if (lvl >= 39)
            var_set_string(res, "Detects monsters in your vicinity. Grants temporary ESP. Maps nearby arean.");
        else if (lvl >= 29)
            var_set_string(res, "Detects monsters in your vicinity. Grants temporary ESP");
        else if (lvl >= 19)
            var_set_string(res, "Detects monsters in your vicinity.");
        else if (lvl >= 5)
            var_set_string(res, "Detects visible monsters in your vicinity.");
        else
            var_set_string(res, "Does nothing since you are too weak. Try standing on a mirror.");
        break;
    case SPELL_CAST:
    {
        if (lvl < 5)
            msg_print("You need a mirror to concentrate!");

        if (lvl >= 5)
            detect_monsters_normal(DETECT_RAD_DEFAULT);
        if (lvl >= 19)
            detect_monsters_invis(DETECT_RAD_DEFAULT);
        if (lvl >= 29)
            set_tim_esp(lvl + randint1(lvl),FALSE);
        if (lvl >= 39)
            map_area(DETECT_RAD_MAP);

        var_set_bool(res, TRUE);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}
Пример #2
0
void _wild_esp_off(void) {
    if (p_ptr->tim_esp)
        set_tim_esp(0, TRUE);
    if (!IS_TIM_ESP())
        msg_print("Your consciousness contracts again.");
}
Пример #3
0
/*
 * do_cmd_mind calls this function if the player's class
 * is 'Reckoner'.
 */
static bool cast_reckoner_spell(int spell)
{
	/* this will vary based on the spells, and what they depend on */
	int     plev = p_ptr->lev;
	int 	b;
	int		py = p_ptr->py;
	int		px = p_ptr->px;
	int 	dir;
	
	/* spell code */
	switch (spell)
	{
    			case 0:	
    					if (plev < 30) 
    					{
    					teleport_player(plev);
    					}  
    					else
    					{
    					teleport_player(plev * 3);
    					}
    					break;
    					
				case 1: 
						b = (randint(50) + plev);
						if (b < 10)
						{
						unlite_area(randint(plev *2), (randint(plev / 5) + 2));
						}
						else if (b < 25)
						{
						unlite_room(py, px);
						}
						else if  (b < 50)
						{
						lite_room(py, px);
						}
						else 
						{
						lite_area(randint(plev * 2), (randint(plev / 5) + 3));
						}
						
						break;
				
				case 2: b = (randint(50) + plev);
						if (b < 20)
						{
						speed_monsters();
						}
						else if (b < 30)
						{
						slow_monsters();
						}
						else if (b < 55)
						{
						sleep_monsters();
						}
						else if (b < 75)
						{
							if (!p_ptr->fast)
							{
								(void)set_fast(randint(plev) + plev);
							}
							else
							{
								(void)set_fast(p_ptr->fast + randint(5));
							}
							break;
						}
						else
						{
						(void)set_fast(p_ptr->fast + b);
						slow_monsters();
						sleep_monsters();
						}
						 break;
				case 3:  if (!get_aim_dir(&dir)) return FALSE; 
						 (void)fire_bolt(GF_NETHER, dir,
								damroll((plev / 2), (3 + plev / 3)));
						 break;
				
				case 4:  if (!get_aim_dir(&dir)) return FALSE;
						 (void)wall_to_mud(dir);
						 break;
						 
				case 5:  (void)hp_player(damroll((plev / 3), plev));
						 (void)set_cut(0);
						 break;
						 
				case 6:  set_recall(); break;
				
				case 7:  if (!get_aim_dir(&dir)) return FALSE;
						 (void)poly_monster(dir);
						 break;
				case 8:  if (plev < 40)
						 {
						 map_area();
						 (void)set_tim_esp(p_ptr->tim_esp + 10);
						 }
						 else
						 {
						 wiz_lite();
						 (void)set_tim_esp(p_ptr->tim_esp + plev);
						 }
						 break;
				case 9:  msg_print("The world changes!");
			
 						 /* Leaving */
						 p_ptr->leaving = TRUE;
						 			
						 break;
				case 10: break;
				case 11: break;
				case 12: break;
				case 13: break;
				case 14: break;
			    case 15: break;
			    case 16: break;
			    case 17: break;
			    case 18: break;
			    case 19: break;
			    case 20: break;
	}

	return TRUE;
}
Пример #4
0
/*
 * do_cmd_mind calls this function if the player's class
 * is 'Medium'.
 */
static bool cast_medium_spell(int spell)
{
	/* this will vary based on the spells, and what they depend on */
	int             b = 0;
	int 			dir;
	int             plev = p_ptr->lev;

	/* spell code */
	switch (spell)
	{
		case 0:
			/* Mindblast */
			if (!get_aim_dir(&dir)) return FALSE;

			if (randint(100) < plev * 2)
				(void)fire_bolt_or_beam(100, GF_PSI, dir,
								damroll(3 + ((plev - 1) / 4), (3 + plev / 15)));
			else
				(void)fire_ball(GF_PSI, dir,
								damroll(3 + ((plev - 1) / 4), (3 + plev / 15)),
								0);
			break;
		case 1:
			if (plev > 44)
				wiz_lite();
			else if (plev > 19)
				map_area();

			if (plev < 30)
			{
				b = detect_monsters_normal();
				if (plev > 14)
					b |= detect_monsters_invis();

				if (plev > 4)
				{
					b |= detect_traps();
					b |= detect_doors();
				}
			}
			else
			{
				b = detect_all();
			}

			if (plev > 24)
			{
				(void)set_tim_esp(p_ptr->tim_esp + plev);
			}

			if (!b) msg_print("You feel safe.");
			break;
		case 2:
			/* Minor displace */
			teleport_player(plev);
			break;
		case 3:
			/* Major displace */
			teleport_player(plev * 5);
			break;
		case 4:
			/* Psychic Disturbance */
			msg_print("You disturb specters from beyond the veil!");
			(void)project(-1, 2 + plev / 8, p_ptr->py, p_ptr->px,
						  damroll((plev / 2), plev), GF_CONFUSION, PROJECT_KILL);
			break;
		case 5:
			/* spirit blast  ---  not 'true' TK */
			if (!get_aim_dir(&dir)) return FALSE;
			(void)fire_ball(GF_SOUND, dir, damroll(8 + ((plev - 5) / 4), 8),
							(plev > 20 ? (plev - 20) / 8 + 1 : 0));
			break;
		case 6:
			/* Character Armour */
			(void)set_shield(p_ptr->shield + plev);
			if (plev > 14) (void)set_oppose_acid(p_ptr->oppose_acid + plev);
			if (plev > 19) (void)set_oppose_fire(p_ptr->oppose_fire + plev);
			if (plev > 24) (void)set_oppose_cold(p_ptr->oppose_cold + plev);
			if (plev > 29) (void)set_oppose_elec(p_ptr->oppose_elec + plev);
			if (plev > 34) (void)set_oppose_pois(p_ptr->oppose_pois + plev);
			break;
		case 7:
			ident_spell();
			break;
		case 8:
			if (!get_aim_dir(&dir)) return FALSE; 
			(void)fire_bolt(GF_DOMINATION, dir,
					damroll((plev / 2), (3 + plev / 3)));
			break;
		case 9:
			/* Soul Purge */
			msg_print("The anguish of the dead emanates from your brain!");
			
			(void)project(-1, 2 + plev / 10, p_ptr->py, p_ptr->px,
						  damroll(plev, 4), GF_PSI, PROJECT_KILL);
			break;
		case 10:
			/* Adrenaline */
			(void)set_afraid(0);
			(void)set_stun(0);

			/*
			 * Only heal when Adrenalin Channeling is not active. We check
			 * that by checking if the player isn't fast and 'heroed' atm.
			 */
			if (!p_ptr->fast || !(p_ptr->hero || p_ptr->shero))
			{
				(void)hp_player(plev);
			}

			b = 10 + randint((plev * 3) / 2);
			if (plev < 35)
				(void)set_hero(p_ptr->hero + b);
			else
				(void)set_shero(p_ptr->shero + b);

			if (!p_ptr->fast)
			{
				/* Haste */
				(void)set_fast(b);
			}
			else
			{
				(void)set_fast(p_ptr->fast + b);
			}
			break;
		case 11:
			/* Psychic Drain Turned into MEGA-STUN*/
			if (!get_aim_dir(&dir)) return FALSE;

			b = damroll(plev * 2, 3);

			/* This is always a radius-0 ball now */
			if (fire_ball(GF_STUN, dir, b, 0))
			p_ptr->energy -= randint(150);
			break;
		case 12:
			/* Entropic Blast */
			msg_print
				("A wave of pure entropic force blasts out from your spirit!");
			(void)project(-1, 3 + plev / 10, p_ptr->py, p_ptr->px,
						  plev * (plev > 39 ? 4 : 3), GF_FORCE,
						  PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID);
			break;
		default:
			msg_print("Unknown Mindcrafter power!");
	}


	return TRUE;
}
Пример #5
0
/*
 * do_cmd_mind calls this function if the player's class
 * is 'explorer'.
 */
static bool cast_explorer_spell(int spell)
{
	/* this will vary based on the spells, and what they depend on */
	int b = 0;
	int plev = p_ptr->lev;
	int	px = p_ptr->px;
	int py = p_ptr->py;
	
	/* spell code */
	switch (spell)
	{
    			case 0:  lite_room (py, px);
    					 break;
				case 1:  if (plev > 44)
							wiz_lite();
						else if (plev > 19)
							map_area();
			
						if (plev < 30)
						{
							b = detect_monsters_normal();
							if (plev > 14)
								b |= detect_monsters_invis();
			
							if (plev > 4)
							{
								b |= detect_traps();
								b |= detect_doors();
							}
						}
						else
						{
							b = detect_all();
						}
			
						if (plev > 24)
						{
							(void)set_tim_esp(p_ptr->tim_esp + plev);
						}
			
						if (!b) msg_print("You feel safe.");
						 break;
				case 2:  teleport_player(plev);
						 break;
				case 3:  (void)set_food(PY_FOOD_MAX - 1);
						 break;
				case 4:  ident_spell();
						 break;
				case 5:  set_recall();
						 break;
				case 6:  (void)recharge(30);
						 break;
				case 7:  alchemy();
						 break;
				case 8: {
						 int time = randint(plev) + plev;
						(void)set_oppose_acid(p_ptr->oppose_acid + time);
						(void)set_oppose_elec(p_ptr->oppose_elec + time);
						(void)set_oppose_fire(p_ptr->oppose_fire + time);
						(void)set_oppose_cold(p_ptr->oppose_cold + time);
						(void)set_oppose_pois(p_ptr->oppose_pois + time); 
						 break;
						 }
				case 9:  break;
				case 10: break;
				case 11: break;
				case 12: break;
				case 13: break;
				case 14: break;
			    case 15: break;
			    case 16: break;
			    case 17: break;
			    case 18: break;
			    case 19: break;
			    case 20: break;
	}

	return TRUE;
}
void _precognition_spell(int cmd, variant *res)
{
    switch (cmd)
    {
    case SPELL_NAME:
        var_set_string(res, "Precognition");
        break;
    case SPELL_DESC:
    {
        if (p_ptr->lev < 5)
            var_set_string(res, "Detects visible monsters in your vicinity.");
        else if (p_ptr->lev < 15)
            var_set_string(res, "Detects visible monsters, traps, and doors in your vicinity.");
        else if (p_ptr->lev < 20)
            var_set_string(res, "Detects monsters, traps, and doors in your vicinity.");
        else if (p_ptr->lev < 25)
            var_set_string(res, "Detects monsters, traps, and doors in your vicinity and maps nearby area.");
        else if (p_ptr->lev < 30)
            var_set_string(res, "Detects monsters, traps, and doors in your vicinity and maps nearby area. Grants temporary ESP.");
        else if (p_ptr->lev < 40)
            var_set_string(res, "Detects monsters, traps, doors, stairs and objects in your vicinity and maps nearby area. Grants temporary ESP.");
        else if (p_ptr->lev < 45)
            var_set_string(res, "Detects monsters, traps, doors, stairs and objects in your vicinity and maps nearby area.");
        else
            var_set_string(res, "Detects monsters, traps, doors, stairs and objects in your vicinity and maps the entire level.");
        break;
    }
    case SPELL_SPOIL_DESC:
        var_set_string(res, "Detects monsters (L1), traps and doors (L5), invisible monsters (L15) and items (L30). Gives magic mapping (L20) and telepathy (L25). Enlightens level (L45).");
        break;
    case SPELL_CAST:
    {
        int b = 0;
        if (p_ptr->lev > 44)
        {
            virtue_add(VIRTUE_KNOWLEDGE, 1);
            virtue_add(VIRTUE_ENLIGHTENMENT, 1);
            wiz_lite(p_ptr->tim_superstealth > 0);
        }
        else if (p_ptr->lev > 19)
            map_area(DETECT_RAD_MAP);

        if (p_ptr->lev < 30)
        {
            b = detect_monsters_normal(DETECT_RAD_DEFAULT);
            if (p_ptr->lev > 14) b |= detect_monsters_invis(DETECT_RAD_DEFAULT);
            if (p_ptr->lev > 4)  {
                b |= detect_traps(DETECT_RAD_DEFAULT, TRUE);
                b |= detect_doors(DETECT_RAD_DEFAULT);
            }
        }
        else
        {
            b = detect_all(DETECT_RAD_DEFAULT);
        }

        if ((p_ptr->lev > 24) && (p_ptr->lev < 40))
            set_tim_esp(p_ptr->lev + randint1(p_ptr->lev), FALSE);

        if (!b) msg_print("You feel safe.");

        var_set_bool(res, TRUE);
        break;
    }
    case SPELL_COST_EXTRA:
    {
        int n = 0;

        if (p_ptr->lev >= 45)
            n += 9;
        else if (p_ptr->lev >= 30)
            n += 4;
        else if (p_ptr->lev >= 25)
            n += 3;
        else if (p_ptr->lev >= 20)
            n += 1;
        else if (p_ptr->lev >= 15)
            n += 0;
        else if (p_ptr->lev >= 5)
            n += 0;

        var_set_int(res, n);
        break;
    }
    default:
        default_spell(cmd, res);
        break;
    }
}