def_castle.c

ldmud-3.3.719/mud/lp-245/room/def_castle.c · 1.1 KB

From the archive ldmud-3.3.719.tar.gz

Download the archive   « Back to the archive contents

/*
 * This is just the facade to a castle. If you want to enable the
 * "enter" command, move the player to a hall or something (which
 * you have to design yourself).
 * The predefined string DEST is where a player should come when he
 * leaves the castle.
 *
 * This file is loaded automatically from "init_file". We have to move
 * ourself to where we are supposed to be.
 */

/* In the blueprint, both NAME and DEST are undefined. To make it
 * possible to check the blueprint for errors, provide default
 * definitions.
 */
#ifndef NAME
#  define NAME "Nobody"
#endif

#ifndef DEST
#  define DEST "/room/church"
#endif

int id(string str) { return str == "castle"; }

string short() {
    return "Castle of " + NAME;
}

void long() {
    write("This is the " + short() + ".\n");
    write(NAME + " is a rather new wizard, but it is an amazing castle\n");
    write("just the same. However, the gates are closed.\n");
}

void init() {
    add_action("enter", "enter");
}

int enter(string str) {
    if (!id(str))
	return 0;
    write("It is not an open castle.\n");
    return 1;
}

void reset(int arg) {
    if (arg)
	return;
    move_object(this_object(), DEST);
}

Site Stats

Snippets: 1791
Codebases: 571