예제 #1
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;
}
예제 #2
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;
}
예제 #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;
}
예제 #4
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;
}