/* * 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"); }
create_food() { set_name("egg"); set_adj("white"); set_long("It looks like if it were made by a hen.\n"); set_amount(50); /* 50 grams of food. */ add_prop(OBJ_I_WEIGHT, 50); /* what does an egg really weight?? */ add_prop(OBJ_I_VOLUME, 30); }
void create_armour() { set_name("forcefield"); add_name("mag_shield_prot"); set_adj("magic"); set_long("A magical forcefield covering your whole body.\n"); add_prop(OBJ_I_NO_DROP, 1); add_prop(OBJ_I_IS_MAGIC_ARMOUR, 1); add_prop(OBJ_S_WIZINFO, "A magical shield to protect the wearer. Will " + "out before to long\n"); add_prop(MAGIC_AM_MAGIC, ({ 20, "abjured" }) );
/* * Function name: create_object * Description: The standard create routine. */ nomask void create_object() { create_paralyze(); set_no_show(); add_prop(OBJ_M_NO_GET, 1); add_prop(OBJ_M_NO_DROP, 1); add_prop(OBJ_M_NO_STEAL, 1); add_prop(OBJ_M_NO_TELEPORT, 1); }
void create_scroll() { set_name("book"); set_adj("blue"); set_long("It's labeled 'Fairy tails from Genesis'\n"); add_prop(OBJ_I_VALUE, 678); add_prop(OBJ_I_WEIGHT, 40); add_prop(OBJ_I_VOLUME, 254); set_file("/d/Genesis/doc/examples/obj/book"); }
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"); }
/* * This potion looks just like the poisoned potion, he he he */ create_potion() { set_soft_amount(10); set_alco_amount(0); set_name("potion"); set_adj("bubbling"); set_long("This potion bubbles and fumes.\n"); add_prop(OBJ_I_VALUE, 125); add_prop(OBJ_I_WEIGHT, 103); add_prop(OBJ_I_VOLUME, 76); add_prop(OBJ_S_WIZINFO, "A antidote, heals many poisons.\n"); add_prop(MAGIC_AM_ID_INFO, ({ "You feel something is good with this potion.\n", 0, "This is a antidote potion, it will remove lesser poisons.\n", 20 }) );
static void read_prop(gmx_atomprop_t aps, int eprop, double factor) { gmx_atomprop *ap2 = (gmx_atomprop*) aps; FILE *fp; char line[STRLEN], resnm[32], atomnm[32]; double pp; int line_no; aprop_t *ap; ap = &ap2->prop[eprop]; fp = libopen(ap->db); line_no = 0; while (get_a_line(fp, line, STRLEN)) { line_no++; if (sscanf(line, "%31s %31s %20lf", resnm, atomnm, &pp) == 3) { pp *= factor; add_prop(ap, aps->restype, resnm, atomnm, pp, line_no); } else { fprintf(stderr, "WARNING: Error in file %s at line %d ignored\n", ap->db, line_no); } } /* for libraries we can use the low-level close routines */ gmx_ffclose(fp); ap->bSet = TRUE; }
void create_monster() { if (!IS_CLONE) return; set_name("alchemist"); set_race_name("alchemist"); set_living_name("_alchemist_"); set_adj("town"); set_long("@@my_long"); add_prop(CONT_I_WEIGHT,47000); /* 47 Kg */ add_prop(CONT_I_HEIGHT,87); /* 87 cm */ add_prop(LIVE_I_NEVERKNOWN,1); /* str dex con int wis dis */ set_stats(({ 22, 27, 21, 70, 70, 34}));
void create_scroll() { seteuid(getuid(this_object())); add_prop(OBJ_I_NO_DROP, "Don't drop the slate, it holds valueable " + "information!\n"); set_name("slate"); set_short("slate displaying 'READ ME!'"); set_long("The slate has a large, square display with backlighting. " + "On the screen the text 'READ ME!' is displayed in big letters.\n"); set_autoload(); set_file(APPRENTICE_SCROLL_FILE); }
/* * Function name: create_room * Description: Initialize this room * Returns: */ void create_room() { config_default_trade(); set_money_give_max(1000); set_short("The local shop"); set_long( "You are in the local shop. Here you can sell and buy stuff.\n" + "You can also use value or list commands, 'list armours',\n" + "'list weapons', 'list <name>' and 'list' works too.\n" + "There is also a small sign to read with more instructions.\n" + ""); add_exit("/d/Genesis/doc/examples/trade/pub", "south", 0); add_exit(STORE_ROOM, "north", "@@wiz_check"); add_prop(ROOM_I_INSIDE,1); /* This is a real room */ }
/* * 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);
int main(int argc, char *argv[]) { int c; scf_walk_callback callback; int flags; int err; (void) setlocale(LC_ALL, ""); (void) textdomain(TEXT_DOMAIN); return_code = UU_EXIT_OK; (void) uu_setpname(argv[0]); prop_pool = uu_list_pool_create("properties", sizeof (svcprop_prop_node_t), offsetof(svcprop_prop_node_t, spn_list_node), NULL, 0); if (prop_pool == NULL) uu_die("%s\n", uu_strerror(uu_error())); prop_list = uu_list_create(prop_pool, NULL, 0); hndl = scf_handle_create(SCF_VERSION); if (hndl == NULL) scfdie(); while ((c = getopt(argc, argv, "Ccfp:qs:tvwz:")) != -1) { switch (c) { case 'C': if (cflag || sflag || wait) usage(); /* Not with -c, -s or -w */ Cflag++; snapshot = NULL; break; case 'c': if (Cflag || sflag || wait) usage(); /* Not with -C, -s or -w */ cflag++; snapshot = NULL; break; case 'f': types = 1; fmris = 1; break; case 'p': add_prop(optarg); break; case 'q': quiet = 1; warn = quiet_warn; die = quiet_die; break; case 's': if (Cflag || cflag || wait) usage(); /* Not with -C, -c or -w */ snapshot = optarg; sflag++; break; case 't': types = 1; break; case 'v': verbose = 1; break; case 'w': if (Cflag || cflag || sflag) usage(); /* Not with -C, -c or -s */ wait = 1; break; case 'z': { scf_value_t *zone; scf_handle_t *h = hndl; if (getzoneid() != GLOBAL_ZONEID) uu_die(gettext("svcprop -z may only be used " "from the global zone\n")); if ((zone = scf_value_create(h)) == NULL) scfdie(); if (scf_value_set_astring(zone, optarg) != SCF_SUCCESS) scfdie(); if (scf_handle_decorate(h, "zone", zone) != SCF_SUCCESS) uu_die(gettext("invalid zone '%s'\n"), optarg); scf_value_destroy(zone); break; } case '?': switch (optopt) { case 'p': usage(); default: break; } /* FALLTHROUGH */ default: usage(); } } if (optind == argc) usage(); max_scf_name_length = scf_limit(SCF_LIMIT_MAX_NAME_LENGTH); max_scf_value_length = scf_limit(SCF_LIMIT_MAX_VALUE_LENGTH); max_scf_fmri_length = scf_limit(SCF_LIMIT_MAX_FMRI_LENGTH); if (max_scf_name_length == -1 || max_scf_value_length == -1 || max_scf_fmri_length == -1) scfdie(); if (scf_handle_bind(hndl) == -1) die(gettext("Could not connect to configuration repository: " "%s.\n"), scf_strerror(scf_error())); flags = SCF_WALK_PROPERTY | SCF_WALK_SERVICE | SCF_WALK_EXPLICIT; if (wait) { if (uu_list_numnodes(prop_list) > 1) usage(); if (argc - optind > 1) usage(); callback = do_wait; } else { callback = process_fmri; flags |= SCF_WALK_MULTIPLE; } if ((err = scf_walk_fmri(hndl, argc - optind, argv + optind, flags, callback, NULL, &return_code, warn)) != 0) { warn(gettext("failed to iterate over instances: %s\n"), scf_strerror(err)); return_code = UU_EXIT_FATAL; } scf_handle_destroy(hndl); return (return_code); }