char *
display_kind(int n)
{
	char *s;

	switch (subkind(n))
	{
	case sub_city:
		if (is_port_city(n))
			s = "port city";
		else
			s = "city";
		break;

	case sub_fog:
	case sub_rain:
	case sub_wind:
	case sub_mist:
		s = "storm";
		break;

	case sub_guild:
	  if (rp_subloc(n) && rp_subloc(n)->guild &&
	      valid_box(rp_subloc(n)->guild)) 
	    s = sout("%s Guild",bx[rp_subloc(n)->guild]->name);
	  else
	    s = "";
	  break;

	default:
		s = subkind_s[subkind(n)];
	}

	return s;
}
void
remove_from_here_list(int loc, int who)
{

  assert(in_here_list(loc, who));
  ilist_rem_value(&(rp_loc_info(loc)->here_list), who);
  /*
   *  Mon Apr 20 18:08:44 1998 -- Scott Turner
   *
   *  Thanks to Rich's nice encapsulation, this is the only
   *  place we have to worry about someone being the last person
   *  out of a subloc...so here's where we reset the fees.
   *
   *  Anyway, that's plan :-).
   *
   */
  if (!ilist_len(rp_loc_info(loc)->here_list) &&
      rp_subloc(loc)) {
    rp_subloc(loc)->control.weight = 0;
    rp_subloc(loc)->control.nobles = 0;
    rp_subloc(loc)->control.men = 0;

    rp_subloc(loc)->control2.weight = 0;
    rp_subloc(loc)->control2.nobles = 0;
    rp_subloc(loc)->control2.men = 0;
  };
      
  assert(!in_here_list(loc, who));
}
示例#3
0
static char *
incomplete_string(int n)
{
  struct entity_subloc *p;
  struct entity_build *b;

  p = rp_subloc(n);
  if (p == NULL)
    return "";

  b = get_build(n, BT_BUILD);

  if (b == NULL || b->effort_required == 0)
    return "";

  return sout(", %d%% completed", b->effort_given * 100 / b->effort_required);
}
示例#4
0
static char *
liner_desc_loc(int n)
{
  char buf[LEN];

  sprintf(buf, "%s%s%s",
          box_name_kind(n), safe_haven_s(n), incomplete_string(n));

  if (loc_depth(n) == LOC_province && rp_loc(n) && province_admin(n)) {
    if (rp_loc(n)->control.nobles) {
      strcat(buf, sout(", entrance fee %s per noble",
                       gold_s(rp_loc(n)->control.nobles)));
    };
    if (rp_loc(n)->control.weight) {
      strcat(buf, sout(", entrance fee %s per 1000 weight",
                       gold_s(rp_loc(n)->control.weight)));
    };
    if (rp_loc(n)->control.men) {
      strcat(buf, sout(", entrance fee %s per 100 men",
                       gold_s(rp_loc(n)->control.men)));
    };
  };

  if (rp_subloc(n) && first_character(n)) {
    if (rp_subloc(n)->control.nobles) {
      strcat(buf, sout(", entrance fee %s per noble",
                       gold_s(rp_subloc(n)->control.nobles)));
    };
    if (rp_subloc(n)->control.weight) {
      strcat(buf, sout(", entrance fee %s per 1000 weight",
                       gold_s(rp_subloc(n)->control.weight)));
    };
    if (rp_subloc(n)->control.men) {
      strcat(buf, sout(", entrance fee %s per 100 men",
                       gold_s(rp_subloc(n)->control.men)));
    };
  };

  if (loc_depth(n) == LOC_province && rp_loc(n) && province_admin(n)) {
    if (rp_loc(n)->control.closed) {
      strcat(buf, sout(", border closed"));
    };
  };

  if (rp_subloc(n) && first_character(n)) {
    if (rp_subloc(n)->control.closed) {
      strcat(buf, sout(", closed"));
    };
  };

  if (entrance_size(n)) {
    strcat(buf, sout(", entrance size: %d", entrance_size(n)));
  };

  if (loc_depth(n) == LOC_build) {
    if (loc_defense(n))
      strcat(buf, sout(", defense~%d", loc_defense(n)));

    if (get_effect(n, ef_improve_fort, 0, 0))
      strcat(buf, sout(", magical defense~%d",
                       get_effect(n, ef_improve_fort, 0, 0)));

    if (loc_moat(n))
      strcat(buf, ", with moat");

    if (loc_damage(n))
      strcat(buf, sout(", %d%%~damaged", (100 * loc_damage(n)) / loc_hp(n)));
  }

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

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

  if (loc_hidden(n))
    strcat(buf, ", hidden");

  if (subkind(n) == sub_mine_shaft) {
    struct entity_mine *mi = get_mine_info(n);
    if (mine_depth(n))
      strcat(buf, sout(", depth~%d feet", (mine_depth(n) * 100) + 100));
    if (mi)
      switch (mi->shoring[mine_depth(n)]) {
      case WOODEN_SHORING:
        strcat(buf, sout(", wooden shoring"));
        break;
      case IRON_SHORING:
        strcat(buf, sout(", iron shoring"));
        break;
      case NO_SHORING:
      default:
        strcat(buf, sout(", no shoring"));
        break;
      };
  };

  if (loc_depth(n) == LOC_subloc) {
    if (subkind(n) == sub_hades_pit)
      strcat(buf, ", 28 days");
    else if (subkind(n) != sub_mine_shaft &&
             subkind(n) != sub_mine_shaft_notdone)
      strcat(buf, ", 1 day");
  }

  return sout("%s", buf);
}
示例#5
0
static char *
liner_desc_ship(int n)
{
  char buf[LEN];
  struct entity_ship *ship = rp_ship(n);

  sprintf(buf, "%s%s", box_name_kind(n), incomplete_string(n));

  if (ship) {
    if (ship->hulls)
      strcat(buf, sout(", %d hull%s", ship->hulls,
                       ship->hulls == 1 ? "" : "s"));
    if (ship->ports)
      strcat(buf, sout(", %d rowing port%s", ship->ports,
                       ship->ports == 1 ? "" : "s"));
    if (ship->sails)
      strcat(buf, sout(", %d sail%s", ship->sails,
                       ship->sails == 1 ? "" : "s"));
  };

#if 0
  strcat(buf, ship_cap_s(n));

  if (loc_defense(n))
    strcat(buf, sout(", defense~%d", loc_defense(n)));
#endif

  if (loc_damage(n))
    strcat(buf, sout(", %d%%~damaged", (loc_damage(n) * 100) / loc_hp(n)));

  if (show_display_string) {
    char *s = banner(n);
    if (s && *s)
      strcat(buf, sout(", \"%s\"", s));
  }

  if (loc_hidden(n))
    strcat(buf, ", hidden");

  if (ship_has_ram(n))
    strcat(buf, ", with ram");

  if (rp_subloc(n)) {
    if (rp_subloc(n)->control.nobles) {
      strcat(buf, sout(", boarding fee %s per noble",
                       gold_s(rp_subloc(n)->control.nobles)));
    };
    if (rp_subloc(n)->control.weight) {
      strcat(buf, sout(", boarding fee %s per 1000 weight",
                       gold_s(rp_subloc(n)->control.weight)));
    };
    if (rp_subloc(n)->control.men) {
      strcat(buf, sout(", boarding fee %s per 100 men",
                       gold_s(rp_subloc(n)->control.men)));
    };
  };

#if 0
  if (fee = board_fee(n))
    strcat(buf, ", %s per 100 wt. to board", gold_s(fee));
#endif

  return sout("%s", buf);
}