VERB
  pry,  strike, wake,   say,
  beam, join,   opener, glow,
  grab, weigh,  rname,  score,
  wave, plug, unplug, debug;

feel	= touch;
shake	= wake;
hit	= strike;
kill	= strike;
shut	= close;
push	= move;
pull	= move;
lift	= move;
destroy	= break;
incant	= say;
chant	= say;
shout	= say;
yell	= say;
out	= exit;


cg = Proc()
{
    "You can't go that way.\n";
    MyLoc = $loc($ME);
}

die = Proc() {
    "You are transported to a large building built of white "
    "marble, with hundreds of columns and sculptures about. "
    "A robed figure emerges from the building and says,\n";
    If (NumDie == 0)
        "\"Having a bit of trouble with my little playground, are we? "
        "Well, you seem to show some promise, so I'll take pity on you "
        "and give you a second chance.  Begone!\"\n";
    Else If (NumDie == 1)
        "\"Hmm, I would have thought that the first time might have "
        "taught you a lesson.  Oh, well, you are yet young in the ways "
        "of philosophy.  I'll give you one last chance.  Away!\"\n";
    Else If (!Wizrd) {
        "\"I'm greatly disappointed in you.  And to think that you showed "
        "such promise at the beginning!  Ah, well, another may come to try "
        "out my playground.  As for you, good riddance!\"\n";
        Die();
    }
    NumDie = NumDie + 1;
    "The figure raises his arms, and you are transported to...\n";
    $move($ME, road1);
    While ($cont($ME)) {
        $move($cont($ME), farm5);
    }
    $ME.HAS = 0;
    GO = TRUE;
    $exit(1);
}

Looks = Proc()
{
    If (Dobj) {
	"Huh?\n";
	$exit(1);
    }
    GOVERB = TRUE;
    MyLoc = -1;
}

n (PREACT) = Looks;
s (PREACT) = Looks;
e (PREACT) = Looks;
w (PREACT) = Looks;

nw(PREACT) = Looks;
ne(PREACT) = Looks;
sw(PREACT) = Looks;
se(PREACT) = Looks;

u (PREACT) = Looks;
d (PREACT) = Looks;

out (PREACT) = Looks;
enter (PREACT) = Looks;

say (PREACT) = Proc()
{
    Expect(NO_OBJ|ONE_OBJ|STR_OBJ|PLAIN_OBJ, NO_OBJ);
    If (!Dobj) {
	"Type just what you want to say: ";
	Dobj = $read();
    }
    If (Dobj >= 0) {
	"You want to make " $name(Dobj)
	" a linguistic artifact??  Strange!\n";
	$exit(1);
    }
}
say (ACTION) = Proc()
{
    If (Dobj ?= Shazm) {
	WzTgl();
    }
    Else {
	"Very well.  '" Dobj "'.\n";
    }
}


DWIMD = Proc() {Return Dwimmer($arg(1));}

DWIMI = Proc() {Return Dwimmer($arg(1));}


wake(PREACT) = Preact;
wake(ACTION) = Proc() {"I don't know how to wake " $name(Dobj) ".\n";}


strike(PREACT) = Preact;
strike(ACTION) = Proc()
{
    "Hitting the " $name(Dobj) " doesn't seem to do anything.";
}


pry(PREACT) = Proc()
{
    Expect(ONE_OBJ|PLAIN_OBJ, ONE_OBJ|PLAIN_OBJ);
    CheckAvail();
}
pry(ACTION) = Proc() {"I can't seem to manage that.\n";}


Tress = Proc()
{
    "You were warned about trespassing! The fence is electrified!\n";
    die();
}


score(ACTION) = Proc()
{
    If (Wizrd | ($loc($ME) == town5)) {
        "A mysterious glowing network of lights appears, and you can "
        "just make out the words:\n";
        ShowScore();
    }
    Else {
	"Hmm, you'll have to check at the local bank.\n";
    }
}


WizP = Proc()
{
    If (!Wizrd) {
	"Only a real Wizard can do that!\n";
	$exit(1);
    }
}

rname(PREACT) = Proc()
{
    If (Dobj) {
	WizP();
	$sdesc(Dobj)();
    }
    Else {
	$sdesc($loc($ME))();
    }
    $exit(1);
}
beam(PREACT) = WizP;
grab(PREACT) = WizP;
join(PREACT) = WizP;
opener(PREACT) = WizP;
glow(PREACT) = WizP;
weigh(PREACT) = WizP;
debug(PREACT) = WizP;

beam(ACTION) = Proc()
{
    If (Dobj) {
	$move($ME, Dobj);
	MyLoc = -1;
    }
}

join(ACTION) = Proc()
{
    If (Dobj) {
	$move($ME, $loc(Dobj));
	MyLoc = -1;
    }
}

opener(ACTION) = Proc()
{
    If (Dobj) {
	Dobj.OPENED = TRUE;
	"Opened.\n";
    }
}

glow(ACTION) = Proc()
{
    $ME.LIGHT = !$ME.LIGHT;
    If ($ME.LIGHT)
	"Your body begins to radiate a strong but gentle white light!\n";
    Else
	"The light from your body fades away.\n";
}

grab(ACTION) = Proc()
{
    If (Dobj) {
	"You have the " $name(Dobj) ", Boss!\n";
	$move(Dobj, $ME);
	$ME.HAS = $ME.HAS + Dobj.WEIGH;
    }
}

weigh(ACTION) = Proc()
{
    If (Dobj)
	"The " $name(Dobj) " weighs " $str(Dobj.WEIGH);
    Else
	"You are carrying " $str($ME.HAS);
    " pounds, Boss!\n";
}

debug(ACTION) = Proc()
{
    $spec(DEBUG);	// Turn on debugging
}

plug(PREACT) = Preact;
plug(ACTION) = Proc() { "That doesn't seem to work.\n"; }

unplug(PREACT) = Preact;
unplug(ACTION) = Proc() { "That doesn't seem to work.\n"; }

wave(PREACT) = Preact;
wave(ACTION) = Proc() { "That doesn't seem to do anything.\n"; }
