Exemplo n.º 1
0
Arquivo: shop.c Projeto: xxx/cdlib
/*
 * Function name: shop_hook_bought_items
 * Description:   Called when player has bought something
 * Arguments:	  arr - The array of objects
 * Returns: 	  1
 */
int
shop_hook_bought_items(object *arr)
{
    write(break_string("You bought " + COMPOSITE_DEAD(arr) + ".\n", 75));
    say(QCTNAME(this_player()) + " bought " + QCOMPDEAD + ".\n");
    return 1;
}
Exemplo n.º 2
0
void
create()
{
    if (break_string("ab cd ef gh ij kl mn op qr", 8) !=
	"ab cd ef\ngh ij kl\nmn op qr")
	throw("break_string inconsistant\n");
}
Exemplo n.º 3
0
Arquivo: shop.c Projeto: xxx/cdlib
/*
 * Function name: shop_hook_sold_items
 * Description:   Hook that is called when player sold something
 * Arguments:	  item - The item array player sold
 * Returns:	  1
 */
int
shop_hook_sold_items(object *item)
{
    write(break_string("You sold " + COMPOSITE_DEAD(item) + ".\n", 75));
    say(QCTNAME(this_player()) + " sold " + QCOMPDEAD + ".\n");
    return 1;
}
Exemplo n.º 4
0
void create() {
  if (!clonep(this_object())) return;
  ::create();

  SetProp(P_SHORT, "Ein Kurzbogen");
  SetProp(P_INFO,
    "Die Syntax lautet: schiesse <geschoss> auf <ziel>\n");
  SetProp(P_NAME, "Kurzbogen");
  SetProp(P_LONG, break_string(
    "Mit diesem Kurzbogen kann man sicher nicht weit schiessen."));
  SetProp(P_MATERIAL, MAT_MISC_WOOD);

  AddId("kurzbogen");
  SetProp(P_GENDER, MALE);
  SetProp(P_WEIGHT, 800);
  SetProp(P_VALUE, 300);

  SetProp(P_WC, 10);
  SetProp(P_DAM_TYPE, DT_BLUDGEON);

  SetProp(P_SHOOTING_WC, 60);
  SetProp(P_NR_HANDS, 2);
  SetProp(P_WEAPON_TYPE, WT_RANGED_WEAPON);
  SetProp(P_AMMUNITION, MUN_ARROW);
  SetProp(P_STRETCH_TIME, 1);
  SetProp(P_RANGE, 10);
}
Exemplo n.º 5
0
/*
 * Function name: create_object
 * Description  : Constructor. It is called to create this object.
 */
nomask public void
create_object()
{
    set_name("editor");
    set_pname("editors");
    add_name("edit");
    add_name("date_edit");
    set_adj("data");

    set_short("data editor");
    set_pshort("data editors");

    set_long(break_string("With this data editor it is possible to list " +
	"and manipulate LPC-datafiles. One command, data_edit, is linked to " +
	"this editor. There is a general help-page on the command. Also, " +
	"within the editor, you can get help by typing ? or h[elp]. The " +
	"syntax for data_edit is 'data_edit <filename>'.", 75) + "\n");

    remove_prop(OBJ_I_VALUE);
    remove_prop(OBJ_I_VOLUME);
    remove_prop(OBJ_I_WEIGHT);

    add_prop(OBJ_I_NO_STEAL,    1);
    add_prop(OBJ_I_NO_TELEPORT, 1);
    add_prop(OBJ_S_WIZINFO,
	"Just examine the data editor for information. /Mercade\n");
}
Exemplo n.º 6
0
/*
 * Function name: remove_death_protection
 * Description  : Remove this shadow from a player.
 * Returns      : 1 - always
 */
nomask public int
remove_death_protection()
{
    tell_object(query_shadow_who(), break_string("You are no longer " +
	"protected from the horrors of death. Take care! It is a rough " +
	"world out there.", 74) + "\n");

    destruct();
    return 1;
}
Exemplo n.º 7
0
void
line_breaker_rep::process (path pos) {
  int i;
  space spc;
  line_item first;

  first= a[pos->item];
  if (pos == path (start)) spc= space (first_spc+ first->b->w());
  else {
    path p= pos;
    while (!is_atom (p)) {
      line_item item1, item2;
      p= p->next;
      hyphenate (first, p->item, item1, item2);
      first= item2;
    }
    spc= space (first->b->w());
  }

  if ((pass>1) || (best[pos]->pen < HYPH_INVALID)) {
    // cout << "Process " << pos << ": " << first << "\n";
    for (i=pos->item; i<end; i++) {
      line_item item= a[i];
      if (i == pos->item) item= first;
      else spc= spc+ a[i-1]->spc+ space (item->b->w());
      if ((spc->max > line_width) &&
	  (item->type == STRING_ITEM) &&
	  (N(item->b->get_leaf_string ())>4))
	break_string (item, pos, i, spc+ space (-item->b->w()));
      if (item->penalty < HYPH_INVALID)
	if (propose_break (path (i+1), pos, item->penalty, spc))
	  break;
      if ((item->type == CONTROL_ITEM) &&
	  (item->t == LINE_BREAK) &&
	  (spc->min < line_width))
	if (propose_break (path (i+1), pos, 0, space (line_width)))
	  break;
    }
    if (i==end) {
      line_width -= last_spc;
      propose_break (path (i), pos, 0, spc);
      line_width += last_spc;
    }
  }

  if (first->type == STRING_ITEM) {
    string first_s= first->b->get_leaf_string ();
    int n= N(first_s);
    if (n>4)
      for (i=0; i<n-1; i++)
	if (best-> contains (pos * i))
	  process (pos * i);
  }
}
Exemplo n.º 8
0
void create() {
  ::create();

  SetProp(P_LIGHT, 1);
  SetProp(P_INT_SHORT, "Auf einem Baum");
  SetProp(P_INT_LONG, break_string(
    "Du hockst auf einem Baum und kannst auf die Lichtung unter Dir sehen. "
    "'schau runter' hilft sicherlich, Ziele auszumachen."));

  AddDetail("runter", function string { 
                        return __PATH__(0)"zielraum"->int_long(this_player());
                      });
Exemplo n.º 9
0
void
create_room()
{
    set_short("The chapel");
    set_long(break_string("" +
	"You are in the Chapel devoted to Paladine. There is a small altar " +
	"in one end where you can kneel and meditate to ask Paladine about " +
	"your stats, and also change your learning preferences." +
	"\n", 75));

    add_prop(ROOM_I_INSIDE, 1);
    add_prop(ROOM_M_NO_ATTACK, "The feeling of peace is too great here.\n");
}
Exemplo n.º 10
0
void create_mapsquare(int wlx, int wly, int slx,int sly)
{
    ::create_mapsquare(wlx, wly, slx, sly);

	set_short("Star base");
	if (sizeof(paths) > 0)
	    pdesc = "\n" + break_string("There are paths leading " +
				        get_pdesc(paths) + ".", 76);
	else
	    pdesc = "";


	if(slx == 4 && sly == 4) {                     /* Center of base */
	    set_long("This is the centre of the starbase." +
		  "They just started building the power plant here.\n" +
		  "You can fly in any direction.\n");
    } else if((slx > 2 && slx < 6) && (sly > 2 && sly < 6)) {
	set_long("This is near the midle of the base. " +
		  "There are lots od framework in place here.\n" +
		  "You can walk in any direction.\n");
    } else if((slx > 1 && slx < 7) && (sly > 1 && sly < 7)) {
	set_long("This is the level of the base that will contain quarters. " +
		  pdesc + "\n" +
		  "You can fly in any direction.\n");
    } else if((slx > 0 && slx < 8) && (sly > 0 && sly < 8)) {
	set_long("You are just inside the hull of the star base.\n" +
		 "This is where the cargo holds will be.\n" +
		  pdesc + "\n" +
		  "You can fly in fly direction.\n");
    } else {
	set_long("You are just outside what looks like a half finished\n " +
		 "star base bigger than Darth Vader's Death Star.\n" +
                 "Now the place seems to be deserted. " +
		  pdesc + "\n" +
		      "You can fly in any direction.\n");
    }
	set_noshow_obvious(1);

    }
Exemplo n.º 11
0
/*
 * Function name: wrap_text
 * Description  : This will take a text and make sure that none of the lines
 *                in the text exceed LINE_LENGTH characters. All lines longer
 *                than that will be broken. Lines will not be merged.
 * Arguments    : string - the text to be wrapped.
 * Returns      : string - the wrapped text.
 */
string
wrap_text(string text)
{
    string *lines;
    int    size;

    if (!strlen(text))
    {
	return "";
    }

    lines = explode(text, "\n");
    size = sizeof(lines);
    while(--size >= 0)
    {
	if (strlen(lines[size]) > LINE_LENGTH)
	{
	    lines[size] = break_string(lines[size], LINE_LENGTH);
	}
    }

    return implode(lines, "\n");
}
Exemplo n.º 12
0
/*
 * Function name: create_room
 * Description:   Set up default trade and cofigure it if wanted.
 */
void
create_room()
{
    set_short("The Inn of Last Home");
    set_long(break_string(
	"You are in the Inn of Last Home. There is a menu on the bar. " +
	"You find this place rather cozy with a lot of tables and chairs " +
	"and a warm fireplace. You can smell the beer from the kegs " +
	"and the food from the kitchen." +
	"", 75) + "\n");

    add_item("bar", "A nice looking wooden bar with a menu on it.\n");
    add_item("menu", "It has a lot of readable words on it.\n");
    add_item("chairs",
	"They are made out of wood as is the rest of the place.\n");
    add_item("tables", "They are darkened with spilled beer.\n");
    add_cmd_item("menu", "read", "@@read");

    add_prop(ROOM_I_INSIDE,1);  /* This is a real room */

    add_drink( ({ "beer", "beers", "small", "small beer" }),
	"beer", "small", 100, 4, 12, 0, 0,
	"It's a small but refreshing beer.\n", 0);