Пример #1
0
int
v_scry_region(struct command *c)
{
  int targ_loc = c->a;
  int aura = c->b;

  if (!is_loc_or_ship(targ_loc)) {
    wout(c->who, "%s is not a location.", box_code(targ_loc));
    return FALSE;
  }

  if (crosses_ocean(targ_loc, c->who)) {
    wout(c->who, "Something seems to block your magic.");
    return FALSE;
  };

  if (c->b < 1)
    c->b = 1;
  aura = c->b;

  if (!check_aura(c->who, aura))
    return FALSE;

  return TRUE;
}
Пример #2
0
int
d_bird_spy(struct command *c)
{
	int targ = c->d;

	if (!has_holy_symbol(c->who)) {
	  wout(c->who, "A holy symbol is required to bird spy.");
	  return FALSE;
	};

	if (!use_piety(c->who, skill_piety(c->use_skill))) {
	  wout(c->who, "You don't have the piety required to use that prayer.");
	  return FALSE;
	};

	if (!is_loc_or_ship(targ))
	{
		wout(c->who, "%s is not a location.", box_code(targ));
		return FALSE;
	}

	wout(c->who, "The bird returns with a report:");
	out(c->who, "");
	show_loc(c->who, targ);

	return TRUE;
}
Пример #3
0
void
set_where(int who, int new_loc)
{
	int old_loc;

/*
 *  This check could be expanded to make sure that new_loc is
 *  not anywhere inside of who, by walking up new_loc to the top
 *  and making sure we don't go through who
 */

	assert(who != new_loc);

	old_loc = loc(who);

	if (old_loc > 0)
		remove_from_here_list(old_loc, who);

	if (new_loc > 0)
		add_to_here_list(new_loc, who);

	p_loc_info(who)->where = new_loc;

#if 0
	if (is_loc_or_ship(loc(who)))
		assert(!is_prisoner(who));
#endif
}
Пример #4
0
int
cast_where(int who)
{
  int where;

  where = char_proj_cast(who);

  if (is_loc_or_ship(where)) {
    return where;
  }

  return subloc(who);
}
Пример #5
0
int
reset_cast_where(int who)
{
  int where;

  where = char_proj_cast(who);

  if (is_loc_or_ship(where)) {
    p_magic(who)->project_cast = 0;
    return where;
  }

  return subloc(who);
}
Пример #6
0
int
cast_check_char_here(int who, int target)
{
  int where;
  int basic;
  int pl;

  basic = char_proj_cast(who);

  if (is_loc_or_ship(basic))
    where = basic;
  else
    where = subloc(who);

#if 1
  p_magic(who)->project_cast = 0;
#endif

  if (crosses_ocean(where, who)) {
    wout(who, "Something seems to block your magic.");
    return FALSE;
  };

  if (kind(target) != T_char || where != subloc(target)) {
    wout(who, "%s is not a character in range of this cast.",
         box_code(target));
    return FALSE;
  }

  if (char_really_hidden(target)) {
    pl = player(who);
    if (pl == player(target))
      return TRUE;

    if (contacted(target, who))
      return TRUE;

    return FALSE;
  }

#if 0
  if (basic == where)
    p_magic(who)->project_cast = 0;
#endif

  return TRUE;
}
Пример #7
0
int
v_los(struct command *c)
{
  int target = c->a;
  int d;

  if (!is_loc_or_ship(target)) {
    wout(c->who, "%s is not a location.", box_code(target));
    return FALSE;
  }

  d = los_province_distance(subloc(c->who), target);

  wout(c->who, "distance=%d", d);

  return TRUE;
}
Пример #8
0
int
v_poof(struct command *c)
{

  if (!is_loc_or_ship(c->a)) {
    wout(c->who, "%s is not a location.", c->parse[1]);
    return FALSE;
  }

  move_stack(c->who, c->a);

  wout(c->who, ">poof!<  A cloud of orange smoke appears and "
       "wisks you away...");
  out(c->who, "");

  show_loc(c->who, loc(c->who));

  return TRUE;
}
Пример #9
0
int
d_view_aura(struct command *c)
{
	int n;
	int level;
	int first = TRUE;
	int aura = c->a;
	int where = c->d;
	char *s;
	int has_detect;
	int learned;
	char *source;

	if (!is_loc_or_ship(where))
	{
		wout(c->who, "%s is no longer a valid location.",
				box_code(where));
		return FALSE;
	}

	if (!charge_aura(c->who, aura))
		return FALSE;

	loop_char_here(where, n)
	{
		if (is_magician(n))
		{
/*
 *  Does the viewed magician have Detect ability scry?
 */

			level = char_cur_aura(n);

			if (aura <= char_abil_shroud(n))
			{
				s = "???";
				learned = FALSE;
			}
			else
			{
				s = sout("%d", level);
				learned = TRUE;
			}

			wout(c->who, "%s, current aura: %s", box_name(n), s);
			first = FALSE;

			has_detect = has_skill(n, sk_detect_abil);

			if (has_detect > exp_novice)
				source = box_name(c->who);
			else
				source = "Someone";

			if (has_detect)
				wout(n, "%s cast View aura here.", source);

			if (has_detect > exp_journeyman)
			{
			    if (learned)
			       wout(n, "Our current aura rating was learned.");
			    else
			       wout(n, "Our current aura rating was "
							"not revealed.");
			}
		}
	}
	next_char_here;

	if (first)
	{
		wout(c->who, "No mages are seen here.");
		log_output(LOG_CODE, "d_view_aura: not a mage?\n");
	}

	return TRUE;
}
Пример #10
0
int
v_bird_spy(struct command *c)
{
	int targ = c->a;
	int where = subloc(c->who);
	struct exit_view *v;

	if (!has_holy_symbol(c->who)) {
	  wout(c->who, "A holy symbol is required to bird spy.");
	  return FALSE;
	};

	if (!has_piety(c->who, skill_piety(c->use_skill))) {
	  wout(c->who, "You don't have the piety required to use that prayer.");
	  return FALSE;
	};

	if (is_ship(where))
		where = loc(where);

	if (numargs(c) < 1)
	{
		wout(c->who, "Specify what location the bird should spy on.");
		return FALSE;
	}

	if (!is_loc_or_ship(c->a))
	{
		v = parse_exit_dir(c, where, sout("use %d", sk_bird_spy));

		if (v == NULL)
			return FALSE;

		targ = v->destination;
	}

	if (province(targ) != province(c->who))
	{
		struct exit_view **l;
		int i;
		int okay = FALSE;

		l = exits_from_loc(c->who, where);

		for (i = 0; i < ilist_len(l); i++)
			if (l[i]->destination == targ)
				okay = TRUE;

		if (!okay)
		{
			wout(c->who, "The location to be spied upon must be "
				"a sublocation in the same province or a "
				"neighboring location.");
			return FALSE;
		}
	}

	c->d = targ;

	return TRUE;
}