Ejemplo n.º 1
0
void
add_aura(int who, int aura)
{
  p_magic(who)->cur_aura += aura;
  if (char_max_aura(who) && char_cur_aura(who) > 5 * max_eff_aura(who))
    p_magic(who)->cur_aura = 5 * max_eff_aura(who);
};
Ejemplo n.º 2
0
int
d_adv_med(struct command *c)
{
  struct char_magic *p;
  int chance;
  int m_a;
  int bonus;

  chance = hinder_med_chance(c->who);

  p = p_magic(c->who);
  p->hinder_meditation = 0;
  m_a = max_eff_aura(c->who);

  bonus = max(2, max_eff_aura(c->who) / 10);

  if (rnd(1, 100) <= chance) {
    wout(c->who, "Disturbing images and unquiet thoughts "
         "hamper the meditative trance.");
    bonus = 1;
  }

  p->cur_aura += bonus;

  if (p->cur_aura >= max_eff_aura(c->who) + 2)
    p->cur_aura = max_eff_aura(c->who) + 2;

  wout(c->who, "Current aura is now %d.", p->cur_aura);
  return TRUE;
}
Ejemplo n.º 3
0
int
d_meditate(struct command *c)
{
  struct char_magic *p;
  int chance;
  int bonus;

  chance = hinder_med_chance(c->who);

  p = p_magic(c->who);
  p->hinder_meditation = 0;

  if (rnd(1, 100) <= chance) {
    wout(c->who, "Disturbing images and unquiet thoughts "
         "ruin the meditative trance.  Meditation fails.");
    return FALSE;
  }

  bonus = max(1, max_eff_aura(c->who) / 20);

  p->cur_aura += bonus;

  if (p->cur_aura >= max_eff_aura(c->who) + 1)
    p->cur_aura = max_eff_aura(c->who) + 1;

  wout(c->who, "Current aura is now %d.", p->cur_aura);
  return TRUE;
}
Ejemplo n.º 4
0
static char *
mage_s(int n)
{
  int a;

  if (!is_magician(n) || char_hide_mage(n))
    return "";

  a = max_eff_aura(n);

  if (a <= 5)
    return "";
  if (a <= 10)
    return ", conjurer";
  if (a <= 15)
    return ", mage";
  if (a <= 20)
    return ", wizard";
  if (a <= 30)
    return ", sorcerer";
  if (a <= 40)
    return ", 6th black circle";
  if (a <= 50)
    return ", 5th black circle";
  if (a <= 60)
    return ", 4th black circle";
  if (a <= 70)
    return ", 3rd black circle";
  if (a <= 80)
    return ", 2nd black circle";

  return ", master of the black arts";
}
Ejemplo n.º 5
0
int
d_adv_med(struct command *c)
{
  struct char_magic *p;
  int chance;
  int m_a;

  if (subkind(subloc(c->who)) != sub_tower ||
      !alone_here(c->who)) {
    wout(c->who, "You must be alone in a tower to use Advanced Meditation.");
    return FALSE;
  };
    
  if (c->wait != 0) return TRUE;

  chance = hinder_med_chance(c->who);

  p = p_magic(c->who);
  p->hinder_meditation = 0;
  m_a = max_eff_aura(c->who);

  if (rnd(1, 100) <= chance) {
    wout(c->who, "Disturbing images and unquiet thoughts "
	 "hamper the meditative trance!");
    return FALSE;
  };

  p->max_aura++;
  wout(c->who, "Maximum aura is now %d.", p->max_aura);
  return TRUE;
}
Ejemplo n.º 6
0
int
d_meditate(struct command *c)
{
	struct char_magic *p;
	int chance;

	if (!char_alone(c->who)) {
	  wout(c->who, "You cannot meditate unless completely alone.");
	  return FALSE;
	};

	if (char_cur_aura(c->who) >= max_eff_aura(c->who))
	{
		wout(c->who, "Current aura is already %d.  It may not "
			"be increased further via meditation.",
					char_cur_aura(c->who));
		return FALSE;
	}

	if (c->wait != 0) return TRUE;

	chance = hinder_med_chance(c->who);

	p = p_magic(c->who);
	p->hinder_meditation = 0;

	if (rnd(1, 100) <= chance)
	{
		wout(c->who, "Disturbing images and unquiet thoughts "
			"ruin the meditative trance.  Meditation fails.");
		return FALSE;
	}

	/*
	 *  How much should we add?  2, 4 if alone in a tower,
	 *  and 2 additional if has an auraculum.
	 *
	 */
	add_aura(c->who,2);

	if (subkind(subloc(c->who)) == sub_tower &&
	    alone_here(c->who)) 
	  add_aura(c->who,2);

	if (has_auraculum(c->who))
	  add_aura(c->who,2);

	wout(c->who, "Current aura is now %d.", p->cur_aura);
	return TRUE;
}
Ejemplo n.º 7
0
int
v_meditate(struct command *c)
{
  if (!char_alone(c->who)) {
    wout(c->who, "You cannot meditate unless completely alone.");
    return FALSE;
  };

  if (char_cur_aura(c->who) >= max_eff_aura(c->who)) {
    wout(c->who, "Current aura is already %d.  It may not "
	       "be increased further via meditation.",
	       char_cur_aura(c->who));
    return FALSE;
  }

  wout(c->who, "Meditate for %s.", weeks(c->wait));
  return TRUE;
}