/*
 *  Thu Oct 10 14:50:13 1996 -- Scott Turner
 *
 *  Capture Beasts is now an explicit skill
 *
 */
int
v_capture_beasts(struct command *c)
{
  int target = c->a;
  
  if (!has_holy_symbol(c->who)) {
    wout(c->who, "You must have a holy symbol to capture wild beasts.");
    return FALSE;
  };

  if (!has_holy_plant(c->who)) {
    wout(c->who, "Capturing wild beasts requires a holy plant.");
    return FALSE;
  };

  /*
   *  Target should be a character (oddly enough)
   *
   */
  if (kind(target) != T_char) {
    wout(c->who, "You cannot capture beasts from %s.",box_name(c->a));
    return FALSE;
 };

  /*
   *  In same location.
   *
   */
  if (!check_char_here(c->who, target)) {
    wout(c->who, "%s is not here.",box_name(c->a));
    return FALSE;
  };

  if (is_prisoner(target)) {
    wout(c->who, "Cannot capture beasts from prisoners.");
    return FALSE;
  };

  if (c->who == target) {
    wout(c->who, "Can't capture beasts from oneself.");
    return FALSE;
  };

  if (stack_leader(c->who) == stack_leader(target)) {
    wout(c->who, "Can't capture beasts from a member of the same stack.");
    return FALSE;
  };

  return TRUE;
};
示例#2
0
int
d_banish_undead(struct command *c)
{
  int target = c->a;
  int where = subloc(c->who);
  int head;

  if (!keep_undead_check(c, FALSE))
    return FALSE;

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

  head = stack_leader(target);

  wout(head, "%s banishes %s!", box_name(c->who), box_name(target));
  wout(where, "%s banishes %s!", box_name(c->who), box_name(target));

  extract_stacked_unit(target);
  kill_char(target, 0, S_body);

  return TRUE;
}
示例#3
0
static char *
liner_desc_char(int n)
{
  char buf[LEN];
  extern int show_combat_flag;
  char *s;
  int sk;

  strcpy(buf, box_name(n));

  sk = subkind(n);

  if (sk == sub_ni) {
    int mk = noble_item(n);
    int num = has_item(n, mk) + 1;

    if (num == 1)
      strcat(buf, sout(", %s", plural_item_name(mk, num)));
    else
      strcat(buf, sout(", %s, number:~%s",
                       plural_item_name(mk, num), comma_num(num)));
  }
  else if (sk) {
    if (sk == sub_temple) {
      if (is_temple(n)) {
        strcat(buf, sout(", Temple of %s", god_name(is_temple(n))));
      }
      else {
        strcat(buf, sout(", undedicated temple"));
      };
    }
    else if (sk == sub_guild) {
      strcat(buf, sout(", %s Guild", box_name(is_guild(n))));
    }
    else {
      strcat(buf, sout(", %s", subkind_s[sk]));
    };
  }

  strcat(buf, nation_s(n));
  strcat(buf, deserted_s(n));
  strcat(buf, rank_s(n));
  strcat(buf, mage_s(n));
  strcat(buf, priest_s(n));
#if 0
  strcat(buf, wield_s(n));
#endif

  if (show_combat_flag) {
    if (char_behind(n))
      strcat(buf, sout(", behind~%d%s", char_behind(n), combat_ally));
    else
      strcat(buf, combat_ally);
  }
  else if (char_guard(n) && stack_leader(n) == n &&
           subkind(n) != sub_garrison)
    strcat(buf, ", on guard");

#if 0
  if (subkind(n) == 0) {        /* only show lord for regular players */
    int sp = lord(n);

    if (sp != indep_player && !cloak_lord(n))
      strcat(buf, sout(", of~%s", box_code_less(sp)));
  }
#endif

  if (show_display_string) {
    s = banner(n);

    if (s && *s)
      strcat(buf, sout(", \"%s\"", s));
  }

  strcat(buf, with_inventory_string(n));

  if (is_prisoner(n))
    strcat(buf, ", prisoner");

  return sout("%s", buf);
}
int
d_capture_beasts(struct command *c)
{
  int type, piety, from = 0;
  int target = c->a;

  if (!has_holy_symbol(c->who)) {
    wout(c->who, "You must have a holy symbol to capture wild beasts.");
    return FALSE;
  };

  if (!has_holy_plant(c->who)) {
    wout(c->who, "Capturing wild beasts requires a holy plant.");
    return FALSE;
  };

  /*
   *  Target should be a character (oddly enough)
   *
   */
  if (kind(target) != T_char) {
    wout(c->who, "You cannot capture beasts from %s.",box_name(target));
    return FALSE;
  };

  /*
   *  In same location.
   *
   */
    
  if (!check_char_here(c->who, target)) {
    wout(c->who, "%s is not here.",box_name(c->a));
    return FALSE;
  };

  if (is_prisoner(target)) {
    wout(c->who, "Cannot capture beasts from prisoners.");
    return FALSE;
  };

  if (c->who == target) {
    wout(c->who, "Can't capture beasts from oneself.");
    return FALSE;
  };

  if (stack_leader(c->who) == stack_leader(target)) {
    wout(c->who, "Can't capture beasts from a member of the same stack.");
    return FALSE;
  };

  /*
   *  Now select a random beast from the target.  That can be either the
   *  target itself, or one of the beasts in the target's inventory.  In
   *  any case, the beast's statistics determine the piety cost of the
   *  spell.
   *
   *  Note that who the beast is "from" is also returned.
   *
   */
  type = get_random_beast(target, &from);

  if (!type || !item_animal(type)) {
    wout(c->who, "%s has no beasts that you can capture.", box_name(target));
    return FALSE;
  };

  piety = ((item_attack(type) + item_defense(type)) / 50.0) + 1.5;

  /*
   *  Perhaps he hasn't the piety.
   *
   */
  if (!has_piety(c->who, piety)) {
    wout(c->who, "You lack the piety to lure a beast from %s.",
	 box_name(target));
    return FALSE;
  };
  
  /*
   *  Lure the beast away.
   *
   */
  if (!move_item(from, c->who, type, 1)) {
    /*
     *  Possibly it is "from" himself who we are capturing.
     *
     */
    if (subkind(from) == sub_ni && item_animal(noble_item(from))) {
      wout(c->who, "You capture %s!",box_name(target));
      use_piety(c->who, piety);
      take_prisoner(c->who, from);
      /*
       *  Fri Mar 24 06:56:46 2000 -- Scott Turner
       *
       *  Take prisoner doesn't actually transfer the animal into your
       *  inventory, so we'll have to "create" one.
       *
       */
      gen_item(c->who, type, 1);
      return TRUE;
    };
    wout(c->who,"For some reason, you capture no beast.");
    return FALSE;
  };
  wout(c->who, "You capture a %s from %s!",box_name(type), box_name(target));
  use_piety(c->who, piety);
  return TRUE;
  
};