Index / last update: December 2002

A Holodeck Simulation of “Balances”

Balances © 1994, 1995, 1996 by Graham Nelson

Unvisitable Rooms:

Real Rooms:

Virtual Rooms:


This simulation is as yet incomplete. Notes to come.


Balances Zone (dbref #2361)

@dig Balances Zone
@desc #2361 = Contains all global verbs for the game "Balances".

north (#2362)

@open north;n;go north;go n;walk north;walk n = nowhere
@field #2362 = desc : You see nothing special about the north wall.
@succ #2362 = @tellroom(@location("%#"),"",@print("%n >north%c",
 @call(2362,"go_default"))); @call(3529,"each_turn");
---
@succ #2362 = @tellroom(@location("%#"),"",@print("%n >north%c", @call(2362,"go_default"))); @call(3529,"each_turn");
===
@field #2362 = go_default :
 @switch(@getfield(3529,"parent"),3614,"You'll have to get off the beautiful red carpet first.",
 @strcheck(@getfield(@location("%#"),"cant_go"),"You can't go that way."));
---
@field #2362 = go_default : @switch(@getfield(3529,"parent"),3614,"You'll have to get off the beautiful red carpet first.", @strcheck(@getfield(@location("%#"),"cant_go"),"You can't go that way."));
===

@open south;s;go south;go s;walk south;walk s = nowhere
@field #12510 = desc : You see nothing special about the south wall.
@succ #12510 = @tellroom(@location("%#"),"",@print("%n >south%c",
 @call(2362,"go_default"))); @call(3529,"each_turn");

@open west;w;go west;go w;walk west;walk w = nowhere
@field #12511 = desc : You see nothing special about the west wall.
@succ #12511 = @tellroom(@location("%#"),"",@print("%n >west%c", @call(2362,"go_default"))); @call(3529,"each_turn");

@open east;e;go east;go e;walk east;walk e = nowhere
@field #12512 = desc : You see nothing special about the east wall.
@succ #12512 = @tellroom(@location("%#"),"",@print("%n >east%c", @call(2362,"go_default"))); @call(3529,"each_turn");

@open northwest;nw;go northwest;go nw;walk northwest;walk nw = nowhere
@field #12513 = desc : You see nothing special about the northwest wall.
@succ #12513 = @tellroom(@location("%#"),"",@print("%n >northwest%c", @call(2362,"go_default"))); @call(3529,"each_turn");

@open northeast;ne;go northeast;go ne;walk northeast;walk ne = nowhere
@field #12514 = desc : You see nothing special about the northeast wall.
@succ #12514 = @tellroom(@location("%#"),"",@print("%n >northeast%c", @call(2362,"go_default"))); @call(3529,"each_turn");

@open southwest;sw;go southwest;go sw;walk southwest;walk sw = nowhere
@field #12515 = desc : You see nothing special about the southwest wall.
@succ #12515 = @tellroom(@location("%#"),"",@print("%n >southwest%c", @call(2362,"go_default"))); @call(3529,"each_turn");

@open southeast;se;go southeast;go se;walk southeast;walk se = nowhere
@field #12516 = desc : You see nothing special about the southeast wall.
@succ #12516 = @tellroom(@location("%#"),"",@print("%n >southeast%c", @call(2362,"go_default"))); @call(3529,"each_turn");

@open up;u;go up;go u;walk up;walk u = nowhere
@field #12517 = desc : You see nothing special about the ceiling.
@succ #12517 = @tellroom(@location("%#"),"",@print("%n >up%c", @call(2362,"go_default"))); @call(3529,"each_turn");

@open down;d;go down;go d;walk down;walk d = nowhere
@field #12518 = desc : You see nothing special about the floor.
@succ #12518 = @tellroom(@location("%#"),"",@print("%n >down%c", @call(2362,"go_default"))); @call(3529,"each_turn");

ask (#13159)

@open ask * about *;ask *;ask = nowhere
@set #13159 = puzzle
@succ #13159 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @tellroom(@location("%#"),"",@print("%n >ask %0",
  @switch("%1","","%c"," about %1%c"),
  @switch(1,
   @eq("%0",""),@print("Whom do you want to ask?",@setfield(3529,"isturn",0)),
   @eq(t1,"-1"),"You can't see any such thing.",
   @eq(@getfield(t1,"is_animate"),""),"You can only do that to something animate.",
   @eq("%1",""),@print("What do you want to ask ",
    @switch(t1,3529,"yourself",@print("the ",@shortname(t1))),
    " about?",@setfield(3529,"isturn",0)),
   @not(@eq(@getfield(t1,"on_ask"),"")),@call(t1,"on_ask"),
   @not(@eq(@getfield(t1,"life"),"")),@call(t1,"life"),
   @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"),
   "There is no reply."
  )
 )); @call(3539,"each_turn");
---
@succ #13159 = @execute(@getfield(3529,"fn_calc_t1")); @tellroom(@location("%#"),"",@print("%n >ask %0", @switch("%1","","%c"," about %1%c"), @switch(1, @eq("%0",""),@print("Whom do you want to ask?",@setfield(3529,"isturn",0)), @eq(t1,"-1"),"You can't see any such thing.", @eq(@getfield(t1,"is_animate"),""),"You can only do that to something animate.", @eq("%1",""),@print("What do you want to ask ", @switch(t1,3529,"yourself",@print("the ",@shortname(t1))), " about?",@setfield(3529,"isturn",0)), @not(@eq(@getfield(t1,"on_ask"),"")),@call(t1,"on_ask"), @not(@eq(@getfield(t1,"life"),"")),@call(t1,"life"), @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"), "There is no reply."))); @call(3539,"each_turn");
===

attack (#3771)

@open attack *;attack;break *;break;smash *;smash;hit *;hit;
 fight *;fight;wreck *;wreck;crack *;crack;
 destroy *;destroy;murder *;murder;kill *;kill;
 torture *;torture;punch *;punch;thump *;thump = nowhere
@set #3771 = puzzle
@succ #3771 = 
 @execute(@getfield(3529,"fn_calc_t1"));
 @tellroom(@location("%#"),"",@print("%n >attack %0%c",
  @switch(1,
   @eq("%0",""),@print("What do you want to attack?",@setfield(3529,"isturn",0)),
   @eq(t1,"-1"),"You can't see any such thing.",
   @not(@eq(@getfield(t1,"on_attack"),"")),@call(t1,"on_attack"),
   @not(@eq(@getfield(t1,"life"),"")),@call(t1,"life"),
   @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"),
   "Violence isn't the answer to this one."
  )
 )); @call(3539,"each_turn");
---
@succ #3771 = @execute(@getfield(3529,"fn_calc_t1")); @tellroom(@location("%#"),"",@print("%n >attack %0%c", @switch(1, @eq("%0",""),@print("What do you want to attack?",@setfield(3529,"isturn",0)), @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"on_attack"),"")),@call(t1,"on_attack"), @not(@eq(@getfield(t1,"life"),"")),@call(t1,"life"), @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"), "Violence isn't the answer to this one."))); @call(3529,"each_turn");
===

bozbar (#3426)

@open bozbar *;bozbar = nowhere
@set #3426 = puzzle
@succ #3426 = @s("p0","%0"); @execute(@getfield(3529,"fn_calc_t1")); @call(3426,"cast"); @call(3529,"each_turn");
@field #3426 = cast :
 @tellroom(@location("%#"),"",@print("%n >bozbar ",p0,"%c",@switch(1,
  @lt(@getfield(3542,"number"),1),"You haven't learned that spell, if indeed it is a spell.",
  @eq("%0",""),"The spell dies away in vain.",
  @eq(t1,"-1"),"You can't see any such thing.",
  @eq(@getfield(t1,"is_animate"),""),"The spell dies away in vain.",
  @eq(@getfield(3542,"is_reversed"),""),@switch(1,
   @eq(t1,3529),"Your elbows twitch, but there is no other effect.",
   @not(@eq(@getfield(t1,"on_bozbar"),"")),@execute(@getfield(t1,"on_bozbar")),
   @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")),
   @print("For a moment, the ",@shortname(t1)," looks highly discomforted, but the moment passes.")
  ),
  @switch(1,
   @eq(t1,3529),"What wings?",
   @and(@eq(t1,2366),@getfield(2366,"is_general")),@print(
    @setfield(2366,"is_general",""),
    "The Enchanter giveth, and the Enchanter taketh away. The horse looks disconsolate but returns to the oats."
   ),
   @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")),
   @print("The ",@shortname(t1)," has no wings to lose.")
  )
 )));
 @switch(@getfield(3542,"number"),{0,100},"",@print(
  @setfield(3542,"number",@sub(@getfield(3542,"number"),1)),
  @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1)),
  @switch(@getfield(3542,"number"),0,@setfield(3542,"is_reversed",""))
 ));
---
TEST
@field #3426 = cast : @tellroom(@location("%#"),"",@print("%n >bozbar ",p0,"%c",@switch(1, @lt(@getfield(3542,"number"),1),"You haven't learned that spell, if indeed it is a spell.", @eq("%0",""),"The spell dies away in vain.", @eq(t1,"-1"),"You can't see any such thing.", @eq(@getfield(t1,"is_animate"),""),"The spell dies away in vain.", @eq(@getfield(3542,"is_reversed"),""),@switch(1, @eq(t1,3529),"Your elbows twitch, but there is no other effect.", @not(@eq(@getfield(t1,"on_bozbar"),"")),@execute(@getfield(t1,"on_bozbar")), @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")), @print("For a moment, the ",@shortname(t1)," looks highly discomforted, but the moment passes.")), @switch(1, @eq(t1,3529),"What wings?", @and(@eq(t1,2366),@getfield(2366,"is_general")),@print( @setfield(2366,"is_general",""), "The Enchanter giveth, and the Enchanter taketh away. The horse looks disconsolate but returns to the oats."), @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")), @print("The ",@shortname(t1)," has no wings to lose."))))); @switch(@getfield(3542,"number"),{0,100},"",@print( @setfield(3542,"number",@sub(@getfield(3542,"number"),1)), @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1)),@switch(@getfield(3542,"number"),0,@setfield(3542,"is_reversed",""))));
===

caskly (#3384)

@open caskly *;caskly = nowhere
@set #3384 = puzzle
@succ #3384 = @s("p0","%0"); @execute(@getfield(3529,"fn_calc_t1")); @call(3384,"cast"); @call(3529,"each_turn");
@field #3384 = cast :
 @tellroom(@location("%#"),"",@print("%n >caskly ",p0,"%c",
  @switch(1,
  @lt(@getfield(3547,"number"),1),"You haven't learned that spell, if indeed it is a spell.",
  @eq("%0",""),"Trying to make everything perfect was a little too ambitious.",
  @eq(t1,"-1"),"You can't see any such thing.",
  @eq(t1,3529),"Oh, don't be too hard on yourself.",
  @eq(t1,2365),"Your spell is not powerful enough to restore the lost pages.",
  @not(@eq(@getfield(t1,"on_caskly"),"")),@execute(@getfield(t1,"on_caskly")),
  @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")),
  @print("The ",@shortname(t1)," looks pretty perfect as is.")
 )));
---
@field #3384 = cast : @tellroom(@location("%#"),"",@print("%n >caskly ",p0,"%c", @switch(1, @lt(@getfield(3547,"number"),1),"You haven't learned that spell, if indeed it is a spell.", @eq("%0",""),"Trying to make everything perfect was a little too ambitious.", @eq(t1,"-1"),"You can't see any such thing.", @eq(t1,3529),"Oh, don't be too hard on yourself.", @eq(t1,2365),"Your spell is not powerful enough to restore the lost pages.", @not(@eq(@getfield(t1,"on_caskly"),"")),@execute(@getfield(t1,"on_caskly")), @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")), @print("The ",@shortname(t1)," looks pretty perfect as is."))));
===

cast (#3393)

@open cast * on *;cast * at *;cast * = nowhere
@set #3393 = puzzle
@succ #3393 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @execute(@getfield(3529,"fn_calc_t2"));
 @switch(t1,
  3181,@print(@setfield(3406,"p0","%1"),@setfield(3406,"t1",t2),@call(3406,"cast")),
  3016,@print(@setfield(3405,"p0","%1"),@setfield(3405,"t1",t2),@call(3405,"cast")),
  3134,@print(@setfield(3503,"p0","%1"),@setfield(3503,"t1",t2),@call(3503,"cast")),
  3130,@print(@setfield(3448,"p0","%1"),@setfield(3448,"t1",t2),@call(3448,"cast")),
  3520,@print(@setfield(3411,"p0","%1"),@setfield(3411,"t1",t2),@call(3411,"cast")),
  3528,@print(@setfield(3427,"p0","%1"),@setfield(3427,"t1",t2),@call(3427,"cast")),
  3542,@print(@setfield(3426,"p0","%1"),@setfield(3426,"t1",t2),@call(3426,"cast")),
  3547,@print(@setfield(3384,"p0","%1"),@setfield(3384,"t1",t2),@call(3384,"cast")),
  3548,@print(@setfield(3423,"p0","%1"),@setfield(3423,"t1",t2),@call(3423,"cast")),
  3549,@print(@setfield(3451,"p0","%1"),@setfield(3451,"t1",t2),@call(3451,"cast")),
  3701,@print(@setfield(4098,"p0","%1"),@setfield(4098,"t1",t2),@call(4098,"cast")),
  @tellroom(@location("%#"),"",@print("%n >cast %0",
   @switch("%1","","%c"," at %1%c"),
   "You haven't learned that spell, if indeed it is a spell."))
 ); @call(3529,"each_turn");
---
@succ #3393 = @execute(@getfield(3529,"fn_calc_t1")); @execute(@getfield(3529,"fn_calc_t2")); @switch(t1, 3181,@print(@setfield(3406,"p0","%1"),@setfield(3406,"t1",t2),@call(3406,"cast")), 3016,@print(@setfield(3405,"p0","%1"),@setfield(3405,"t1",t2),@call(3405,"cast")), 3134,@print(@setfield(3503,"p0","%1"),@setfield(3503,"t1",t2),@call(3503,"cast")), 3130,@print(@setfield(3448,"p0","%1"),@setfield(3448,"t1",t2),@call(3448,"cast")), 3520,@print(@setfield(3411,"p0","%1"),@setfield(3411,"t1",t2),@call(3411,"cast")), 3528,@print(@setfield(3427,"p0","%1"),@setfield(3427,"t1",t2),@call(3427,"cast")), 3542,@print(@setfield(3426,"p0","%1"),@setfield(3426,"t1",t2),@call(3426,"cast")), 3547,@print(@setfield(3384,"p0","%1"),@setfield(3384,"t1",t2),@call(3384,"cast")), 3548,@print(@setfield(3423,"p0","%1"),@setfield(3423,"t1",t2),@call(3423,"cast")), 3549,@print(@setfield(3451,"p0","%1"),@setfield(3451,"t1",t2),@call(3451,"cast")), 3701,@print(@setfield(4098,"p0","%1"),@setfield(4098,"t1",t2),@call(4098,"cast")), @tellroom(@location("%#"),"",@print("%n >cast %0", @switch("%1","","%c"," at %1%c"), "You haven't learned that spell, if indeed it is a spell."))); @call(3529,"each_turn");
===

close (#3407)

@open close *;close = nowhere
@set #3407 = puzzle
@field #3407 = fn_hide :
 @contentsloop(2376,"x",@switch(@getfield("%x","parent"),t1,@print(
  @move("%x",2651),
  @contentsloop(2376,"y",@switch(@getfield("%y","parent"),"%x",@print(
   @move("%y",2651)
  )))
 )));
---
@field #3407 = fn_hide : @contentsloop(2376,"x",@switch(@getfield("%x","parent"),t1,@print( @move("%x",2651), @contentsloop(2376,"y",@switch(@getfield("%y","parent"),"%x",@print(@move("%y",2651)))))));
===
@succ #3407 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @tellroom(@location("%#"),"",@print("%n >close %0%c",
  @switch(1,
   @eq("%0",""),@print("What do you want to close?",@setfield(3529,"isturn",0)),
   @eq(t1,"-1"),"You can't see any such thing.",
   @not(@eq(@getfield(t1,"on_close"),"")),@call(t1,"on_close"),
   @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"),
   @eq(@getfield(t1,"is_openable"),""),"That's not something you can close.",
   @eq(@getfield(t1,"is_open"),""),"That's already closed.",
   @print(
     @setfield(t1,"is_open",""), @call(3407,"fn_hide"),
     @print("You close the ",@shortname(t1),".")
   )
  )
 )); @call(3529,"each_turn");
---
@succ #3407 = @execute(@getfield(3529,"fn_calc_t1")); @tellroom(@location("%#"),"",@print("%n >close %0%c", @switch(1, @eq("%0",""),@print("What do you want to close?",@setfield(3529,"isturn",0)), @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"on_close"),"")),@call(t1,"on_close"), @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"), @eq(@getfield(t1,"is_openable"),""),"That's not something you can close.", @eq(@getfield(t1,"is_open"),""),"That's already closed.", @print( @setfield(t1,"is_open",""), @call(3407,"fn_hide"), @print("You close the ",@shortname(t1),"."))))); @call(3529,"each_turn");
===

copy * to * (#3399)

@open copy * to *;copy *;copy = nowhere
@set #3399 = puzzle
@succ #3399 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @execute(@getfield(3529,"fn_calc_t2"));
 @tellroom(@location("%#"),"",@print("%n >copy %0",
  @switch("%1","","%c"," to %1%c"),
  @switch(1,
   @eq("%0",""),@print("What do you want to copy?",@setfield(3529,"isturn",0)),
   @or( @eq(t1,"-1"),@eq(@getfield(t1,"is_spell"),"") ),
    "You haven't access to that spell, if indeed it is a spell.",
   @eq("%1",""),@print("What do you want to copy ",
    @switch(@getfield(t1,"is_proper"),"","the "),
    @shortname(t1)," to?",@setfield(3529,"isturn",0)),
   @eq(t2,"-1"),"You can't see any such thing.",
   @not(@eq(@getfield(2409,"parent"),3529)),"You need to be holding the burin to copy a spell.",
   @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"),
   @eq(@getfield(t2,"is_spellbook"),1),"If a burin could write in a spell book, you wouldn't need the gnusto spell!",
   @eq(@getfield(t2,"is_scroll"),""),"You can only copy spells to scrolls.",
   @not(@eq(@getfield(t2,"child"),"")),"The scroll is already full of incantation.",
   "The scroll is not blank, only illegible."
  )
 )); @call(3529,"each_turn");
---
TEST
@succ #3399 = @execute(@getfield(3529,"fn_calc_t1")); @execute(@getfield(3529,"fn_calc_t2")); @tellroom(@location("%#"),"",@print("%n >copy %0", @switch("%1","","%c"," to %1%c"), @switch(1,@eq("%0",""),@print("What do you want to copy?",@setfield(3529,"isturn",0)), @or( @eq(t1,"-1"),@eq(@getfield(t1,"is_spell"),"")), "You haven't access to that spell, if indeed it is a spell.", @eq("%1",""),@print("What do you want to copy ", @switch(@getfield(t1,"is_proper"),"","the "), @shortname(t1)," to?",@setfield(3529,"isturn",0)), @eq(t2,"-1"),"You can't see any such thing.", @not(@eq(@getfield(2409,"parent"),3529)),"You need to be holding the burin to copy a spell.", @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"), @eq(@getfield(t2,"is_spellbook"),1),"If a burin could write in a spell book, you wouldn't need the gnusto spell!", @eq(@getfield(t2,"is_scroll"),""),"You can only copy spells to scrolls.", @not(@eq(@getfield(t2,"child"),"")),"The scroll is already full of incantation.", "The scroll is not blank, only illegible."))); @call(3529,"each_turn");
===

diagnose (#2379)

@open diagnose;health = nowhere
@succ #2379 = @tellroom(@location("%#"),"",@print(
 "%n >diagnose%c",
 @switch(@getfield(3529,"memory_capacity"),
 5,"You feel fine, and your memory is unimpaired.",
 4,"You feel shaky after your brush with death, but your mental
 faculties seem sound.",
 3,"For someone who has died twice, you're in reasonable shape.",
 "How many times have you died now? Your memory isn't what it was."
 ))); @call(3529,"each_turn");
---
@succ #2379 = @tellroom(@location("%#"),"",@print("%n >diagnose%c", @switch(@getfield(3529,"memory_capacity"), 5,"You feel fine, and your memory is unimpaired.", 4,"You feel shaky after your brush with death, but your mental faculties seem sound.", 3,"For someone who has died twice, you're in reasonable shape.", "How many times have you died now? Your memory isn't what it was."))); @call(3529,"each_turn");
===

drop (#3855)

@open drop *;drop;put down *;put * down;put down;throw *;discard * = nowhere
@set #3855 = puzzle
@succ #3855 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @tellroom(@location("%#"),"",@print("%n >drop %0%c",
  @switch(1,
   @eq("%0",""),@print("What do you want to drop?",@setfield(3529,"isturn",0)),
   @eq(t1,"-1"),"You can't see any such thing.",
   @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"),
   @eq(t1,3529),"You lack the dexterity.",
   @eq(@getfield(t1,"parent"),@getfield(3529,"parent")),
    @print(@switch(@getfield(t1,"is_proper"),"","The "),
    @shortname(t1)," is already here."),
   @not(@eq(@getfield(t1,"parent"),3529)),"You haven't got that.",
   @print(
    @setfield(t1,"parent",@getfield(3529,"parent")),
    "Dropped.")
  )
 )); @call(3529,"each_turn");
---
@succ #3855 = @execute(@getfield(3529,"fn_calc_t1")); @tellroom(@location("%#"),"",@print("%n >drop %0%c", @switch(1, @eq("%0",""),@print("What do you want to drop?",@setfield(3529,"isturn",0)), @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"), @eq(t1,3529),"You lack the dexterity.", @eq(@getfield(t1,"parent"),@getfield(3529,"parent")), @print(@switch(@getfield(t1,"is_proper"),"","The "), @shortname(t1)," is already here."), @not(@eq(@getfield(t1,"parent"),3529)),"You haven't got that.", @print( @setfield(t1,"parent",@getfield(3529,"parent")), "Dropped.")))); @call(3529,"each_turn");
===

eat (#5054)

@open eat *;eat;drink *;drink;taste *;taste = nowhere
@set #5054 = puzzle
@succ #5054 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @tellroom(@location("%#"),"",@print("%n >eat %0%c",
  @switch(1,
   @eq("%0",""),@print("What do you want to eat?",@setfield(3529,"isturn",0)),
   @eq(t1,"-1"),"You can't see any such thing.",
   @not(@eq(@getfield(t1,"on_eat"),"")),@call(t1,"on_eat"),
   @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"),
   @eq(t1,3529),"(first taking yourself)%cYou are always self-possessed.",
   @getfield(t1,"is_animate"),@print("(first taking the ",@shortname(t1),")%cI don't suppose the ",@shortname(t1)," would care for that."),
   @getfield(t1,"is_scenery"),@print("(first taking the ",@shortname(t1),")%cThat's hardly portable."),
   @getfield(t1,"is_static"),@print("(first taking the ",@shortname(t1),")%cThat's fixed in place."),
   @print(
    "That's plainly inedible."
   )
 ))); @call(3529,"each_turn");
---
TEST
@succ #5054 = @execute(@getfield(3529,"fn_calc_t1")); @tellroom(@location("%#"),"",@print("%n >eat %0%c", @switch(1, @eq("%0",""),@print("What do you want to eat?",@setfield(3529,"isturn",0)), @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"on_eat"),"")),@call(t1,"on_eat"), @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"), @eq(t1,3529),"(first taking yourself)%cYou are always self-possessed.", @getfield(t1,"is_animate"),@print("(first taking the ",@shortname(t1),")%cI don't suppose the ",@shortname(t1)," would care for that."), @getfield(t1,"is_scenery"),@print("(first taking the ",@shortname(t1),")%cThat's hardly portable."), @getfield(t1,"is_static"),@print("(first taking the ",@shortname(t1),")%cThat's fixed in place."), @print("That's plainly inedible.")))); @call(3529,"each_turn");
===

filfre (#4098)

@open filfre *;filfre = nowhere
@set #4098 = puzzle
@succ #4098 = @s("p0","%0"); @execute(@getfield(3529,"fn_calc_t1")); @call(4098,"cast"); @call(3529,"each_turn");
@field #4098 = cast :
 @tellroom(@location("%#"),"",@print("%n >filfre ",p0,"%c",
  @switch(1,@lt(@getfield(3701,"number"),1),
   "You haven't learned that spell, if indeed it is a spell.",
  @eq(t1,"-1"),"You can't see any such thing.",
  @eq(@getfield(3701,"is_reversed"),""),@print(
   "A brief shower of gratuitous fireworks spells out:%c%cThe masterly Enchanter trilogy was written by Marc Blank, Dave Lebling and Steve Meretzky.",
   @switch(@getfield(3701,"is_scored"),"",@print(
    @setfield(3529,"score",@add(1,@getfield(3529,"score"))),
    @setfield(3701,"is_scored",1),
    "%c%c[Your score has just gone up one point.]"
   ))
  ),
   "A lengthy shower of artistically justified fireworks spells out:%c%cThe masterly Enchanter trilogy was written by Jane Austen, Emily Bronte and Edgar Allen Poe."
  )
 ));
 @switch(@getfield(3701,"number"),{0,100},"",@print(
  @setfield(3701,"number",@sub(@getfield(3701,"number"),1)),
  @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1)),
  @switch(@getfield(3701,"number"),0,@setfield(3701,"is_reversed",""))
 ));
---
TEST
@field #4098 = cast : @tellroom(@location("%#"),"",@print("%n >filfre ",p0,"%c", @switch(1,@lt(@getfield(3701,"number"),1), "You haven't learned that spell, if indeed it is a spell.", @eq(t1,"-1"),"You can't see any such thing.", @eq(@getfield(3701,"is_reversed"),""),@print( "A brief shower of gratuitous fireworks spells out:%c%cThe masterly Enchanter trilogy was written by Marc Blank, Dave Lebling and Steve Meretzky.", @switch(@getfield(3701,"is_scored"),"",@print( @setfield(3529,"score",@add(1,@getfield(3529,"score"))), @setfield(3701,"is_scored",1), "%c%c[Your score has just gone up one point.]"))), "A lengthy shower of artistically justified fireworks spells out:%c%cThe masterly Enchanter trilogy was written by Jane Austen, Emily Bronte and Edgar Allen Poe."))); @switch(@getfield(3701,"number"),{0,100},"",@print( @setfield(3701,"number",@sub(@getfield(3701,"number"),1)), @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1)),@switch(@getfield(3701,"number"),0,@setfield(3701,"is_reversed",""))));
===

flip (#3404)

@open flip *;toss *;flip;toss = nowhere
@set #3404 = puzzle
@succ #3404 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @tellroom(@location("%#"),"",@print("%n >flip %0%c",
  @switch(1,@eq("%0",""),@print(
   @s("t2",""), @s("t3",""),
   @contentsloop(2376,"x",@print(
    @switch(1,
     @and(@getfield("%x","is_coin"),@eq(t2,""),@eq(@getfield("%x","parent"),3529)),@s("t2","%x"),
     @and(@getfield("%x","is_coin"),@eq(t3,""),@not(@eq(@getfield("%x","parent"),3529))),@s("t3","%x")
    )
   )),
   @s("t1",@strcheck(t2,t3,"-1")),
   @switch(t1,"-1","",@print(
    "(the ",@shortname(t1),")%c"
   ))
  )),
  @switch(1,
   @eq("-1",t1),"You can't see any such thing.",
   @eq(@getfield(t1,"is_coin"),""),"That's not a coin.",
   @not(@eq(@getfield(t1,"parent"),3529)),"You need to be holding the coin first.",
   @print(
    @setfield(t1,"parent",@getfield(3529,"parent")),
    @switch(1,
     @eq(@getfield(3529,"can_see"),0),"You throw it away into the darkness.",
     @rand(20),"You toss the coin, and it lands... on its edge, amazingly.",
     "You toss the coin, and it comes up... blank, since neither side is marked."
    )
   )
  )
 )); @call(3529,"each_turn");
---
@succ #3404 = @execute(@getfield(3529,"fn_calc_t1")); @switch(t1,"%#",@s("t1",3529)); @tellroom(@location("%#"),"",@print("%n >flip %0%c", @switch(1,@eq("%0",""),@print(@s("t2",""), @s("t3",""), @contentsloop(2376,"x",@print(@switch(1, @and(@getfield("%x","is_coin"),@eq(t2,""),@eq(@getfield("%x","parent"),3529)),@s("t2","%x"), @and(@getfield("%x","is_coin"),@eq(t3,""),@not(@eq(@getfield("%x","parent"),3529))),@s("t3","%x")))), @s("t1",@strcheck(t2,t3,"-1")), @switch(t1,"-1","",@print("(the ",@shortname(t1),")%c")))), @switch(1, @eq("-1",t1),"You can't see any such thing.", @eq(@getfield(t1,"is_coin"),""),"That's not a coin.", @not(@eq(@getfield(t1,"parent"),3529)),"You need to be holding the coin first.", @print( @setfield(t1,"parent",@getfield(3529,"parent")), @switch(1, @eq(@getfield(3529,"can_see"),0),"You throw it away into the darkness.", @rand(20),"You toss the coin, and it lands... on its edge, amazingly.", "You toss the coin, and it comes up... blank, since neither side is marked."))))); @call(3529,"each_turn");
===

frotz (#3405)

@open frotz *;frotz = nowhere
@set #3405 = puzzle
@succ #3405 = @s("p0","%0"); @execute(@getfield(3529,"fn_calc_t1")); @call(3405,"cast"); @call(3529,"each_turn");
@field #3405 = cast :
 @tellroom(@location("%#"),"",@print("%n >frotz ",p0,"%c",
  @switch(1,@lt(@getfield(3016,"number"),1),
   "You haven't learned that spell, if indeed it is a spell.",
  @eq(@getfield(3016,"is_reversed"),""),
   @switch(1,
    @eq("%0",""),"There is a brief, blinding flash of light.",
    @eq(t1,"-1"),"You can't see any such thing.",
    @not(@eq(@getfield(t1,"on_frotz"),"")),@execute(@getfield(t1,"on_frotz")),
    @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")),
    @getfield(t1,"is_animate"),"The spell, not designed for living creatures, goes sour.",
    @eq(@type(t1),3),"The spell dissipates vaguely.",
    @print(
     @setfield(t1,"is_light",1),
     @setfield(3016,@print("frotzed_",t1),t1),
     "There is an almost blinding flash of light as the ",@shortname(t1),
     " begins to glow! It slowly fades to a less painful level, but the ",
     @shortname(t1)," is now quite usable as a light source.")
   ),@switch(1,
    @eq("%0",""),"There is a brief moment of deep darkness.",
    @eq(t1,"-1"),"You can't see any such thing.",
    @not(@eq(@getfield(t1,"on_ztorf"),"")),@execute(@getfield(t1,"on_ztorf")),
    @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")),
    @getfield(t1,"is_animate"),"The spell, not designed for living creatures, goes sour.",
    @eq(@type(t1),3),"The spell dissipates vaguely.",
    @eq(@getfield(t1,"is_light"),""),@print("The ",@shortname(t1)," isn't producing light as it is."),
    @print(
     @setfield(t1,"is_light",""),
     @setfield(3016,@print("frotzed_",t1),""),
     "A pool of darkness coagulates around the ",@shortname(t1),
     " but slowly fades back to normality.  Still, the ",@shortname(t1),
     " is no longer any kind of light source.")
 ))));
 @switch(@getfield(3016,"number"),{0,100},"",@print(
  @setfield(3016,"number",@sub(@getfield(3016,"number"),1)),
  @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1)),
  @switch(@getfield(3016,"number"),0,@setfield(3016,"is_reversed",""))
 ));
---
TEST
@field #3405 = cast : @tellroom(@location("%#"),"",@print("%n >frotz ",p0,"%c", @switch(1,@lt(@getfield(3016,"number"),1), "You haven't learned that spell, if indeed it is a spell.", @eq(@getfield(3016,"is_reversed"),""), @switch(1, @eq("%0",""),"There is a brief, blinding flash of light.", @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"on_frotz"),"")),@execute(@getfield(t1,"on_frotz")), @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")), @getfield(t1,"is_animate"),"The spell, not designed for living creatures, goes sour.", @eq(@type(t1),3),"The spell dissipates vaguely.", @print( @setfield(t1,"is_light",1),@setfield(3016,@print("frotzed_",t1),t1), "There is an almost blinding flash of light as the ", @shortname(t1), " begins to glow! It slowly fades to a less painful level, but the ", @shortname(t1)," is now quite usable as a light source.") ),@switch(1, @eq("%0",""),"There is a brief moment of deep darkness.", @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"on_ztorf"),"")),@execute(@getfield(t1,"on_ztorf")), @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")), @getfield(t1,"is_animate"),"The spell, not designed for living creatures, goes sour.", @eq(@type(t1),3),"The spell dissipates vaguely.", @eq(@getfield(t1,"is_light"),""),@print("The ",@shortname(t1)," isn't producing light as it is."), @print( @setfield(t1,"is_light",""),@setfield(3016,@print("frotzed_",t1),""), "A pool of darkness coagulates around the ", @shortname(t1), " but slowly fades back to normality.  Still, the ", @shortname(t1), " is no longer any kind of light source."))))); @switch(@getfield(3016,"number"),{0,100},"",@print( @setfield(3016,"number",@sub(@getfield(3016,"number"),1)), @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1)),@switch(@getfield(3016,"number"),0,@setfield(3016,"is_reversed",""))));
===

give (#5057)

@open give * to *;give *;give = nowhere
@set #5057 = puzzle
@succ #5057 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @execute(@getfield(3529,"fn_calc_t2"));
 @tellroom(@location("%#"),"",@print("%n >give %0",
  @switch("%1","","%c"," to %1%c"),
  @switch(1,
   @eq("%0",""),@print("What do you want to give?",@setfield(3529,"isturn",0)),
   @eq(t1,"-1"),"You can't see any such thing.",
   @eq("%1",""),@print("Who do you want to give ",
    @switch(@getfield(t1,"is_proper"),"","the "),
    @shortname(t1)," to?",@setfield(3529,"isturn",0)
   ),
   @eq(t2,"-1"),"You can't see any such thing.",
   @not(@eq(@getfield(t1,"parent"),3529)),@print(
    "You aren't holding ",
    @switch(@getfield(t1,"is_proper"),"","the "),
    @shortname(t1),"."),
   @eq(t2,3529),@print("You juggle ",
    @switch(@getfield(t1,"is_proper"),"","the "),
    @shortname(t1)," for a while, but don't achieve much."),
   @eq(@getfield(t2,"is_animate"),""),"You can only do that to something animate.",
   @not(@eq(@getfield(t1,"on_give"),"")),@call(t1,"on_give"),
   @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"),
   @not(@eq(@getfield(t2,"on_receive"),"")),@call(t2,"on_receive"),
   @not(@eq(@getfield(t2,"on_before"),"")),@call(t2,"on_before"),
   @print(
    @switch(@getfield(t2,"is_proper"),"","The "),@shortname(t2),
    " doesn't seem interested."
   )
 ))); @call(3529,"each_turn");
---
@succ #5057 = @execute(@getfield(3529,"fn_calc_t1")); @execute(@getfield(3529,"fn_calc_t2")); @tellroom(@location("%#"),"",@print("%n >give %0", @switch("%1","","%c"," to %1%c"), @switch(1, @eq("%0",""),@print("What do you want to give?",@setfield(3529,"isturn",0)), @eq(t1,"-1"),"You can't see any such thing.", @eq("%1",""),@print("Who do you want to give ", @switch(@getfield(t1,"is_proper"),"","the "), @shortname(t1)," to?",@setfield(3529,"isturn",0)), @eq(t2,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"parent"),3529)),@print( "You aren't holding ", @switch(@getfield(t1,"is_proper"),"","the "), @shortname(t1),"."), @eq(t2,3529),@print("You juggle ", @switch(@getfield(t1,"is_proper"),"","the "), @shortname(t1)," for a while, but don't achieve much."), @eq(@getfield(t2,"is_animate"),""),"You can only do that to something animate.", @not(@eq(@getfield(t1,"on_give"),"")),@call(t1,"on_give"), @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"), @not(@eq(@getfield(t2,"on_receive"),"")),@call(t2,"on_receive"), @not(@eq(@getfield(t2,"on_before"),"")),@call(t2,"on_before"), @print( @switch(@getfield(t2,"is_proper"),"","The "),@shortname(t2), " doesn't seem interested.")))); @call(3529,"each_turn");
===

gnusto (#3406)

@open gnusto *;gnusto = nowhere
@set #3406 = puzzle
@succ #3406 = @s("p0","%0"); @execute(@getfield(3529,"fn_calc_t1")); @call(3406,"cast"); @call(3529,"each_turn");
@field #3406 = cast :
 @switch(1,@getfield(@getfield(t1,"parent"),"is_scroll"),
  @s("t1",@getfield(t1,"parent")));
 @s("_msg",@print("%n >gnusto ",p0,"%c",
  @switch(1,
  @eq("%0",""),"Your spell fizzles vaguely out.",
  @eq(t1,"-1"),"You can't see any such thing.",
  @getfield(t1,"is_spellbook"),"Unlike scrolls, spell books are magically guarded against the 'theft' of their lore.",
  @eq(@getfield(t1,"is_scroll"),""),"Your spell fizzles vaguely out.",
  @not(@eq(@getfield(t1,"parent"),3529)),"A gnusto spell would require close scrutiny of the scroll it is to copy: which you do not seem to be holding.",
  @not(@or(
   @eq(@getfield(2391,"parent"),3529),@eq(@getfield(2365,"parent"),3529)
  )),"Your spell fails, as you have no spell book.",
  @or(
   @eq(@getfield(t1,"child"),0),
   @eq(@getfield(@getfield(t1,"child"),"is_spell"),"")
  ),@print("Your spell fails, as the ",@shortname(t1)," is illegible."),
  @print(
   @s("t2",@getfield(t1,"child")),
   @s("bk",@switch(@getfield(2391,"parent"),3529,2391,2365)),
   @setfield(bk,"spell_list",@print(
    @getfield(bk,"spell_list"),@switch(t2,
    3181,"A",3016,"B",3134,"C",3130,"D",3520,"E",
    3528,"F",3542,"G",3547,"H",3548,"I",3549,"J",3701,"K"
    ))),
   @move(t1,2651),@setfield(t1,"parent",2651),
   @setfield(t1,"child",""),@setfield(t2,"parent",bk),
   "Your spell book begins to glow softly. Slowly, ornately, the words of the ",
   @shortname(t2),
   " are inscribed, glowing even more brightly then the book itself. The book's brightness fades, but the spell remains! However, the scroll on which it was written vanishes as the last word is copied."
  )
 )));
 @tellroom(@location("%#"),"",_msg);
---
@field #3406 = cast : @switch(1,@getfield(@getfield(t1,"parent"),"is_scroll"), @s("t1",@getfield(t1,"parent"))); @s("_msg",@print("%n >gnusto ",p0,"%c", @switch(1, @eq("%0",""),"Your spell fizzles vaguely out.", @eq(t1,"-1"),"You can't see any such thing.", @getfield(t1,"is_spellbook"),"Unlike scrolls, spell books are magically guarded against the 'theft' of their lore.", @eq(@getfield(t1,"is_scroll"),""),"Your spell fizzles vaguely out.", @not(@eq(@getfield(t1,"parent"),3529)),"A gnusto spell would require close scrutiny of the scroll it is to copy: which you do not seem to be holding.", @not(@or( @eq(@getfield(2391,"parent"),3529),@eq(@getfield(2365,"parent"),3529) )),"Your spell fails, as you have no spell book.", @or( @eq(@getfield(t1,"child"),0), @eq(@getfield(@getfield(t1,"child"),"is_spell"),"") ),@print("Your spell fails, as the ",@shortname(t1)," is illegible."), @print( @s("t2",@getfield(t1,"child")), @s("bk",@switch(@getfield(2391,"parent"),3529,2391,2365)), @setfield(bk,"spell_list",@print( @getfield(bk,"spell_list"),@switch(t2, 3181,"A",3016,"B",3134,"C",3130,"D",3520,"E", 3528,"F",3542,"G",3547,"H",3548,"I",3549,"J",3701,"K"))), @move(t1,2651), @setfield(t1,"parent",2651), @setfield(t1,"child",""), @setfield(t2,"parent",bk), "Your spell book begins to glow softly. Slowly, ornately, the words of the ", @shortname(t2), " are inscribed, glowing even more brightly then the book itself. The book's brightness fades, but the spell remains! However, the scroll on which it was written vanishes as the last word is copied.")))); @tellroom(@location("%#"),"",_msg);
===

insert * in * (dbref #5073)

@open insert * in *;insert * into *;put * in *;put * into *;place * in *;place * into * = nowhere
@set #5073 = puzzle
@succ #5073 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @execute(@getfield(3529,"fn_calc_t2"));
// @s("anc",...TODO...);
 @tellroom(@location("%#"),"",@print("%n >put %0",
  @switch("%1","","%c"," in %1%c"),
  @switch(1,
   @eq("%0",""),@print("What do you want to put?",@setfield(3529,"isturn",0)),
   @eq(t1,"-1"),"You can't see any such thing.",
   @eq("%1",""),@print("What do you want to put ",
    @switch(@getfield(t1,"is_proper"),"","the "),
    @shortname(t1)," in (or on)?",@setfield(3529,"isturn",0)
   ),
   @eq(t2,"-1"),"You can't see any such thing.",
   @not(@eq(@getfield(t1,"parent"),3529)),@print(
    "You need to be holding ",
    @switch(@getfield(t1,"is_proper"),"","the "),
    @shortname(t1)," before you can put it into something else."),
//   @eq(anc,t1),"You can't put something inside itself.",
   @eq(t2,t1),"You can't put something inside itself.",
   @not(@eq(@getfield(t1,"on_insert"),"")),@call(t1,"on_insert"),
   @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"),
   @not(@eq(@getfield(t2,"on_receive"),"")),@call(t2,"on_receive"),
   @and(@getfield(t2,"is_container"),@eq(@getfield(t2,"is_open"),"")),@print(
    @switch(@getfield(t2,"is_proper"),"","The "),
    @shortname(t2)," is closed."
   ),
   @eq(@getfield(t2,"is_container"),""),"That can't contain things.",
   @print(
    @setfield(t1,"parent",t2),
    @setfield(t1,"ncontents",@add(1,@getfield(t1,"ncontents"))),
    "You put ",
    @switch(@getfield(t1,"is_proper"),"","the "),
    @shortname(t1)," into ",
    @switch(@getfield(t2,"is_proper"),"","the "),
    @shortname(t2),"."
   )
 ))); @call(3529,"each_turn");
---
TODO
@succ #5073 = @execute(@getfield(3529,"fn_calc_t1")); @execute(@getfield(3529,"fn_calc_t2")); @tellroom(@location("%#"),"",@print("%n >put %0", @switch("%1","","%c"," in %1%c"), @switch(1, @eq("%0",""),@print("What do you want to put?",@setfield(3529,"isturn",0)), @eq(t1,"-1"),"You can't see any such thing.", @eq("%1",""),@print("What do you want to put ", @switch(@getfield(t1,"is_proper"),"","the "), @shortname(t1)," in (or on)?",@setfield(3529,"isturn",0)), @eq(t2,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"parent"),3529)),@print( "You need to be holding ", @switch(@getfield(t1,"is_proper"),"","the "), @shortname(t1)," before you can put it into something else."), @eq(t2,t1),"You can't put something inside itself.", @not(@eq(@getfield(t1,"on_insert"),"")),@call(t1,"on_insert"), @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"), @not(@eq(@getfield(t2,"on_receive"),"")),@call(t2,"on_receive"), @and(@getfield(t2,"is_container"),@eq(@getfield(t2,"is_open"),"")),@print( @switch(@getfield(t2,"is_proper"),"","The "), @shortname(t2)," is closed."), @eq(@getfield(t2,"is_container"),""),"That can't contain things.", @print(@setfield(t1,"parent",t2), @setfield(t1,"ncontents",@add(1,@getfield(t1,"ncontents"))), "You put ",@switch(@getfield(t1,"is_proper"),"","the "), @shortname(t1)," into ", @switch(@getfield(t2,"is_proper"),"","the "), @shortname(t2),".")))); @call(3529,"each_turn");
===
  ancestor = CommonAncestor(noun, second);

inventory (#2402)

@open inventory;inv;i = nowhere
@succ #2402 =
 @s("cnt",0);
 @contentsloop(2376,"x",@switch(@getfield("%x","parent"),3529,
  @s("cnt",@add(1,cnt))
 ));
 @tellroom(@location("%#"),"",@print(
  "%n >inventory%cYou are carrying",
  @switch(cnt,0," nothing.",@print(":",
   @contentsloop(2376,"x",@switch(@getfield("%x","parent"),3529,@print(
    "%c ",
    @switch(1,@getfield("%x","is_proper"),"",
     @not(@eq(@getfield("%x","article"),"")),@print(@getfield("%x","article")," "),
     "a "),
    @shortname("%x"),
    @switch(1,@and(@getfield("%x","is_scroll"),@getfield("%x","is_general")),@print(
     @switch(1,@getfield(@getfield("%x","child"),"is_spell"),@print(
      " (of the ",@shortname(@getfield("%x","child")),")"
      )," (which is illegible)")
    )),
    @switch(1,@getfield("%x","is_container"),@print(
      @switch(1,@getfield("%x","is_light"),
       " (providing light and "," (which is "),
      @switch(@getfield("%x","is_open"),
       1,@print("open",@switch(@getfield("%x","ncontents"),0," but empty")),
       @print("closed",@switch(@getfield("%x","is_locked"),1," and locked"))
      ),")",

      @contentsloop(2376,"y",@switch(@getfield("%y","parent"),"%x",@print(
       "%c  ",
       @switch(1,@getfield("%y","is_proper"),"",
        @not(@eq(@getfield("%y","article"),"")),@print(@getfield("%y","article")," "),
        "a "),
       @shortname("%y"),
       @switch(1,@and(@getfield("%y","is_scroll"),@getfield("%y","is_general")),@print(
        @switch(1,@getfield(@getfield("%y","child"),"is_spell"),@print(
         " (of the ",@shortname(@getfield("%y","child")),")"
         )," (which is illegible)")
       )),
       @switch(1,@getfield("%y","is_light")," (providing light)")
      )))

     ),@getfield("%x","is_light")," (providing light)"
    )
   )))
  ))
 )); @call(3529,"each_turn");
---
@succ #2402 = @s("cnt",0); @contentsloop(2376,"x",@switch(@getfield("%x","parent"),3529, @s("cnt",@add(1,cnt)))); @tellroom(@location("%#"),"",@print("%n >inventory%cYou are carrying", @switch(cnt,0," nothing.",@print(":", @contentsloop(2376,"x",@switch(@getfield("%x","parent"),3529,@print("%c ", @switch(1,@getfield("%x","is_proper"),"", @not(@eq(@getfield("%x","article"),"")),@print(@getfield("%x","article")," "), "a "), @shortname("%x"), @switch(1,@and(@getfield("%x","is_scroll"),@getfield("%x","is_general")),@print( @switch(1,@getfield(@getfield("%x","child"),"is_spell"),@print(" (of the ",@shortname(@getfield("%x","child")),")")," (which is illegible)"))), @switch(1,@getfield("%x","is_container"),@print( @switch(1,@getfield("%x","is_light"), " (providing light and "," (which is "), @switch(@getfield("%x","is_open"), 1,@print("open",@switch(@getfield("%x","ncontents"),0," but empty")), @print("closed",@switch(@getfield("%x","is_locked"),1," and locked"))),")", @contentsloop(2376,"y",@switch(@getfield("%y","parent"),"%x",@print("%c  ", @switch(1,@getfield("%y","is_proper"),"", @not(@eq(@getfield("%y","article"),"")),@print(@getfield("%y","article")," "),"a "), @shortname("%y"), @switch(1,@and(@getfield("%y","is_scroll"),@getfield("%y","is_general")),@print(@switch(1,@getfield(@getfield("%y","child"),"is_spell"),@print(" (of the ",@shortname(@getfield("%y","child")),")")," (which is illegible)"))), @switch(1,@getfield("%y","is_light")," (providing light)"))))),@getfield("%x","is_light")," (providing light)")))))))); @call(3529,"each_turn");
===

jump (dbref #12901)

@open jump;skip;hop = nowhere
@succ #12901 =
 @tellroom(@location("%#"),"",@print("%n >jump%c",
  @switch(@getfield(3529,"parent"),
  2369,@print("You jump bravely into the chasm, and plunge...
  gracefully through the air. (It gets a bit less noble and airy after
  that.)", @setfield(3529,"deadflag",1)),
  "You jump on the spot, fruitlessly."
  )
 )); @call(3529,"each_turn");
---
@succ #12901 = @tellroom(@location("%#"),"",@print("%n >jump%c", @switch(@getfield(3529,"parent"), 2369,@print("You jump bravely into the chasm, and plunge... gracefully through the air. (It gets a bit less noble and airy after that.)", @setfield(3529,"deadflag",1)), "You jump on the spot, fruitlessly."))); @call(3529,"each_turn");
===

learn (#3408)

//Verb "learn" "memorise" "memorize"
//                * scope=ReadableSpell            -> Learn;
@open learn *;memorise *;memorize * = nowhere
@set #3408 = puzzle
@succ #3408 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @switch(@getfield(t1,"is_spell"),"",@s("t1","-1"));
 @tellroom(@location("%#"),"",@print("%n >learn %0%c",
  @switch(1,
   @eq("%0",""),@print("What do you want to learn?",@setfield(3529,"isturn",0)),
   @eq(t1,"-1"),"You haven't access to that spell, if indeed it is a spell.",
   @eq(@getfield(2376,"the_room"),2461),"\"None of that!\" snaps the barker angrily, putting you off your study habits. He mutters about \"Enchanter cheats\", but under the circumstances you decide to let the insult pass.",
   @eq(@getfield(t1,"number"),100),"You always know that spell.",
   @print(
    @switch(@getfield(2376,"in_thedark"),1,"(The magic writing of the spells casts enough light that you can read them.)%c^"),
    "Using your best study habits, you commit the ",@shortname(t1),
    " to memory",
    @setfield(3529,"number_known",@add(1,@getfield(3529,"number_known"))),
    @setfield(t1,"number",@add(1,@getfield(t1,"number"))),
    @switch(@getfield(t1,"number"),1,".",2," once again.",
     3," a third time."," yet another time."),
    @switch(@gt(@getfield(3529,"number_known"),@getfield(3529,"memory_capacity")),1,@print(
//   TODO: self.forget_spell(sibling(child(self)));
     " You have so much buzzing around in your head, though, that it's likely something may have been forgotten in the shuffle."
    ))
   )
  )
 )); @call(3529,"each_turn");
---
TEST
@succ #3408 = @execute(@getfield(3529,"fn_calc_t1")); @switch(@getfield(t1,"is_spell"),"",@s("t1","-1")); @tellroom(@location("%#"),"",@print("%n >learn %0%c", @switch(1, @eq("%0",""),@print("What do you want to learn?",@setfield(3529,"isturn",0)), @eq(t1,"-1"),"You haven't access to that spell, if indeed it is a spell.", @eq(@getfield(2376,"the_room"),2461),"\"None of that!\" snaps the barker angrily, putting you off your study habits. He mutters about \"Enchanter cheats\", but under the circumstances you decide to let the insult pass.", @eq(@getfield(t1,"number"),100),"You always know that spell.", @print( @switch(@getfield(2376,"in_thedark"),1,"(The magic writing of the spells casts enough light that you can read them.)%c^"), "Using your best study habits, you commit the ",@shortname(t1), " to memory", @setfield(3529,"number_known",@add(1,@getfield(3529,"number_known"))), @setfield(t1,"number",@add(1,@getfield(t1,"number"))), @switch(@getfield(t1,"number"),1,".",2," once again.", 3," a third time."," yet another time."), @switch(@gt(@getfield(3529,"number_known"),@getfield(3529,"memory_capacity")),1,@print(" You have so much buzzing around in your head, though, that it's likely something may have been forgotten in the shuffle.")))))); @call(3529,"each_turn");
===

listen (#3818)

@open listen to *;listen *;listen = nowhere
@set #3818 = puzzle
@succ #3818 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @s("_msg",@print("%n >listen",@switch("%0","","%c"," to %0%c"),
  @switch(1,
  @eq(t1,"-1"),"You can't see any such thing.",
  @not(@eq(@getfield(@getfield(2376,"the_room"),"on_listen"),"")),
   @execute(@getfield(@getfield(2376,"the_room"),"on_listen")),
  "You hear nothing unexpected.")
 ));
 @tellroom(@location("%#"),"",_msg);
 @call(3529,"each_turn");
---
@succ #3818 =  @execute(@getfield(3529,"fn_calc_t1")); @s("_msg",@print("%n >listen",@switch("%0","","%c"," to %0%c"), @switch(1, @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(@getfield(2376,"the_room"),"on_listen"),"")), @execute(@getfield(@getfield(2376,"the_room"),"on_listen")), "You hear nothing unexpected."))); @tellroom(@location("%#"),"",_msg); @call(3529,"each_turn");
===

lleps (#3411)

@open lleps *;lleps = nowhere
@set #3411 = puzzle
@succ #3411 = @s("p0","%0"); @execute(@getfield(3529,"fn_calc_t1")); @call(3411,"cast"); @call(3529,"each_turn");
@field #3411 = cast :
 @tellroom(@location("%#"),"",@print("%n >lleps ",p0,"%c",
  @switch(1,
   @lt(@getfield(3520,"number"),1),"You haven't learned that spell, if indeed it is a spell.",
   @eq("%0",""),"The spell backfires, painfully.",
   @eq(t1,"-1"),"You can't see any such thing.",
   @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")),
   @eq(@getfield(t1,"is_spell"),""),"The spell backfires, painfully.",
   @lt(@getfield(t1,"number"),1),"The spell backfires, painfully.",
   @eq(@getfield(t1,"number"),100),"You know that spell too well for your mind to be able to accept the change.",
   @eq(t1,3520),@switch(@getfield(3520,"number"),
    1,"The spell backfires, painfully.",
    @print(
     @setfield(3520,"number",@sub(@getfield(3520,"number"),1)),
     @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1)),
     "Your mind wrenches as the two lleps spells cancel each other out, leaving only a sensation quite like a hangover."
   )),
   @print(
    @setfield(t1,"is_reversed",@switch(
     @getfield(t1,"is_reversed"),"",1,""
    )),
    "Your mind wrenches as the ",@shortname(t1)," reverses itself."
   )
  )
 ));
 @switch(@getfield(3520,"number"),{0,100},"",@print(
  @setfield(3520,"number",@sub(@getfield(3520,"number"),1)),
  @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1))
 ));
---
@field #3411 = cast : @tellroom(@location("%#"),"",@print("%n >lleps ",p0,"%c", @switch(1, @lt(@getfield(3520,"number"),1),"You haven't learned that spell, if indeed it is a spell.", @eq("%0",""),"The spell backfires, painfully.", @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")), @eq(@getfield(t1,"is_spell"),""),"The spell backfires, painfully.", @lt(@getfield(t1,"number"),1),"The spell backfires, painfully.", @eq(@getfield(t1,"number"),100),"You know that spell too well for your mind to be able to accept the change.", @eq(t1,3520),@switch(@getfield(3520,"number"), 1,"The spell backfires, painfully.", @print(@setfield(3520,"number",@sub(@getfield(3520,"number"),1)), @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1)), "Your mind wrenches as the two lleps spells cancel each other out, leaving only a sensation quite like a hangover.")), @print(@setfield(t1,"is_reversed",@switch( @getfield(t1,"is_reversed"),"",1,"")), "Your mind wrenches as the ",@shortname(t1)," reverses itself.")))); @switch(@getfield(3520,"number"),{0,100},"",@print( @setfield(3520,"number",@sub(@getfield(3520,"number"),1)), @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1))));
===

lobal (#3423)

@open lobal *;lobal = nowhere
@set #3423 = puzzle
@field #3423 = timer : 0
@succ #3423 = @s("p0","%0"); @execute(@getfield(3529,"fn_calc_t1")); @call(3423,"cast"); @call(3529,"each_turn");
@field #3423 = cast :
 @tellroom(@location("%#"),"",@print("%n >lobal ",p0,"%c",
  @switch(1,@lt(@getfield(3548,"number"),1),
   "You haven't learned that spell, if indeed it is a spell.",
  @eq(@getfield(3548,"is_reversed"),""),
   @switch(1,
    @eq("%0",""),"There is a loud bang in your ear, but no other effect.",
    @eq(t1,"-1"),"You can't see any such thing.",
    @not(@eq(@getfield(t1,"on_lobal"),"")),@execute(@getfield(t1,"on_lobal")),
    @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")),
    @not(@getfield(t1,"is_animate")),"There is a loud bang in your ear, but no other effect.",
    @eq(t1,3529),@switch(@getfield(3529,"hearing_good"),
     1,"There is no further effect.",@print(
     @setfield(3529,"hearing_good",1),@setfield(3423,"timer",5),
     "Nothing happens, possibly because those butterflies on the
     other side of the hill keep distracting you."
    )),
    @print("The ",@shortname(t1)," is no doubt grateful for the gift of sharper hearing.")
   ),@switch(1,
    @eq("%0",""),"There is a brief silence, but no other effect.",
    @eq(t1,"-1"),"You can't see any such thing.",
    @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")),
    @not(@getfield(t1,"is_animate")),"There is a loud bang in your ear, but no other effect.",
    @eq(t1,3529),@print(@setfield(3529,"hearing_good",""),@setfield(3423,"timer",0),"Pardon?"),
    @print("The ",@shortname(t1)," is no doubt grateful not to have to listen to you.")
 ))));
 @switch(@getfield(3548,"number"),{0,100},"",@print(
  @setfield(3548,"number",@sub(@getfield(3548,"number"),1)),
  @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1)),
  @switch(@getfield(3548,"number"),0,@setfield(3548,"is_reversed",""))
 ));
---
TEST
@field #3423 = cast : @tellroom(@location("%#"),"",@print("%n >lobal ",p0,"%c", @switch(1,@lt(@getfield(3548,"number"),1), "You haven't learned that spell, if indeed it is a spell.", @eq(@getfield(3548,"is_reversed"),""), @switch(1, @eq("%0",""),"There is a loud bang in your ear, but no other effect.", @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"on_lobal"),"")),@execute(@getfield(t1,"on_lobal")), @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")), @not(@getfield(t1,"is_animate")),"There is a loud bang in your ear, but no other effect.", @eq(t1,3529),@switch(@getfield(3529,"hearing_good"), 1,"There is no further effect.",@print( @setfield(3529,"hearing_good",1),@setfield(3423,"timer",5), "Nothing happens, possibly because those butterflies on the other side of the hill keep distracting you.")), @print("The ",@shortname(t1)," is no doubt grateful for the gift of sharper hearing.")),@switch(1, @eq("%0",""),"There is a brief silence, but no other effect.", @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")), @not(@getfield(t1,"is_animate")),"There is a loud bang in your ear, but no other effect.", @eq(t1,3529),@print(@setfield(3529,"hearing_good",""),@setfield(3423,"timer",0),"Pardon?"), @print("The ",@shortname(t1)," is no doubt grateful not to have to listen to you."))))); @switch(@getfield(3548,"number"),{0,100},"",@print( @setfield(3548,"number",@sub(@getfield(3548,"number"),1)), @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1)),@switch(@getfield(3548,"number"),0,@setfield(3548,"is_reversed",""))));
===
@field #3423 = timestep :
 @setfield(3423,"timer",@sub(@getfield(3423,"timer"),1));
 @switch(1,@and(
  @eq(@getfield(3423,"timer"),0),@getfield(3529,"hearing_good")),@print(
   @setfield(3529,"hearing_good",0),
   "%cThose wretched butterflies finally shut up."
 ));
---
TEST
@field #3423 = timestep : @setfield(3423,"timer",@sub(@getfield(3423,"timer"),1)); @switch(1,@and( @eq(@getfield(3423,"timer"),0),@getfield(3529,"hearing_good")),@print( @setfield(3529,"hearing_good",0),"%cThose wretched butterflies finally shut up."));
===

metareset (#3000)

A little explanation is in order. This command tells all the rooms in the game to calculate their reset fields. Each room has a list of objects that they are responsible for (whichever room an object starts in). Each object must have its own reset code. This metareset bundling helps avoid the 64 call limit; otherwise it'd be easier to just call every object's reset field directly.

@open metareset = nowhere
@succ #3000 = @fieldloop(2375,"room_", @print(
  @call("%v","metareset"),
  "Metareset: ",@shortname("%v")," (#%v)%c"
 ));
---
@succ #3000 = @fieldloop(2375,"room_", @print(@call("%v","metareset"), "Metareset: ",@shortname("%v")," (#%v)%c"));
===

mortin (#3427)

@open mortin *;mortin = nowhere
@set #3427 = puzzle
@succ #3427 = @s("p0","%0"); @execute(@getfield(3529,"fn_calc_t1")); @call(3427,"cast"); @call(3529,"each_turn");
@field #3427 = cast :
 @tellroom(@location("%#"),"",@print("%n >mortin ",p0,"%c",
  @switch(1,@lt(@getfield(3528,"number"),1),
   "You haven't learned that spell, if indeed it is a spell.",
  @eq(t1,"-1"),"You can't see any such thing.",
  @eq(@getfield(3528,"is_reversed"),""),@print(
    @setfield(3529,"deadflag",1),
    "You really can't fault Helistar on this one. Death is absolutely immediate, like a sudden blackout curtain..."
  ),@print(
    @setfield(3529,"prepared_flag",1),
    "Nothing quite happens... and yet you feel enormously more confident as you go about this dangerous world."
  ))
 ));
 @switch(@getfield(3528,"number"),{0,100},"",@print(
  @setfield(3528,"number",@sub(@getfield(3528,"number"),1)),
  @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1)),
  @switch(@getfield(3528,"number"),0,@setfield(3528,"is_reversed",""))
 ));
---
TEST
@field #3427 = cast : @tellroom(@location("%#"),"",@print("%n >mortin ",p0,"%c", @switch(1,@lt(@getfield(3528,"number"),1), "You haven't learned that spell, if indeed it is a spell.", @eq(t1,"-1"),"You can't see any such thing.", @eq(@getfield(3528,"is_reversed"),""), @print(@setfield(3529,"deadflag",1),"You really can't fault Helistar on this one. Death is absolutely immediate, like a sudden blackout curtain..."), @print(@setfield(3529,"prepared_flag",1), "Nothing quite happens... and yet you feel enormously more confident as you go about this dangerous world.")))); @switch(@getfield(3528,"number"),{0,100},"",@print( @setfield(3528,"number",@sub(@getfield(3528,"number"),1)), @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1)),@switch(@getfield(3528,"number"),0,@setfield(3528,"is_reversed",""))));
===

open * (dbref #3505)

@open open *;open = nowhere
@set #3505 = puzzle
@succ #3505 = 
 @execute(@getfield(3529,"fn_calc_t1"));
 @tellroom(@location("%#"),"",@print("%n >open %0%c",
  @switch(1,
   @eq("%0",""),@print("What do you want to open?",@setfield(3529,"isturn",0)),
   @eq(t1,"-1"),"You can't see any such thing.",
   @not(@eq(@getfield(t1,"on_open"),"")),@call(t1,"on_open"),
   @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"),
   @eq(@getfield(t1,"is_openable"),""),"That's not something you can open.",
   @getfield(t1,"is_locked"),"It seems to be locked.",
   @getfield(t1,"is_open"),"That's already open.",
   @print(
    @setfield(t1,"is_open",1),
    @switch(1,@and(@getfield(t1,"is_container"),
     @gt(@getfield(t1,"ncontents"),0)),
     @print("You open the ",@shortname(t1),", revealing",
      @execute(@getfield(3505,"fn_reveal")),"."
     ),
     @print("You open the ",@shortname(t1),".")
    )
   )
  )
 )); @call(3529,"each_turn");
---
@succ #3505 = @execute(@getfield(3529,"fn_calc_t1")); @tellroom(@location("%#"),"",@print("%n >open %0%c", @switch(1, @eq("%0",""),@print("What do you want to open?",@setfield(3529,"isturn",0)), @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"on_open"),"")),@call(t1,"on_open"), @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"), @eq(@getfield(t1,"is_openable"),""),"That's not something you can open.", @getfield(t1,"is_locked"),"It seems to be locked.", @getfield(t1,"is_open"),"That's already open.", @print( @setfield(t1,"is_open",1), @switch(1,@and(@getfield(t1,"is_container"), @gt(@getfield(t1,"ncontents"),0)), @print("You open the ",@shortname(t1),", revealing", @execute(@getfield(3505,"fn_reveal")),"."), @print("You open the ",@shortname(t1),".")))))); @call(3529,"each_turn");
===
@field #3505 = fn_reveal :
 @s("nhere",0);
 @contentsloop(2651,"x",@switch(@getfield("%x","parent"),t1,@print(
  @move("%x",2376), @s("nhere",@add(1,nhere)),
  @contentsloop(2651,"y",@switch(@getfield("%y","parent"),"%x",@print(
   @move("%y",2376)
  )))
 )));
 @s("i",1);
 @contentsloop(2376,"x",@switch(@getfield("%x","parent"),t1,@print(
  @switch(i,1," ",nhere," and ",", "),
  @switch(1,@getfield("%x","is_proper"),"",
   @eq(@getfield("%x","article"),""),"a ",
   @print(@getfield("%x","article")," ")),
  @shortname("%x"),
  @s("i",@add(1,i))
 )));
---
TEST
@field #3505 = fn_reveal : @s("nhere",0); @contentsloop(2651,"x",@switch(@getfield("%x","parent"),t1,@print( @move("%x",2376), @s("nhere",@add(1,nhere)), @contentsloop(2651,"y",@switch(@getfield("%y","parent"),"%x",@print( @move("%y",2376))))))); @s("i",1); @contentsloop(2376,"x",@switch(@getfield("%x","parent"),t1,@print( @switch(i,1," ",nhere," and ",", "), @switch(1,@getfield("%x","is_proper"),"", @eq(@getfield("%x","article"),""),"a ", @print(@getfield("%x","article")," ")), @shortname("%x"), @s("i",@add(1,i)))));
===
[ OpenSub;
  if (ObjectIsUntouchable(noun)) return;
  if (noun hasnt openable) return L__M(##Open,1,noun);
  if (noun has locked)     return L__M(##Open,2,noun);
  if (noun has open)       return L__M(##Open,3,noun);
  give noun open;
  if (AfterRoutines()==1) rtrue;
  if (keep_silent==1) rtrue;
  if (noun has container && noun hasnt transparent && child(noun)~=0
      && IndirectlyContains(noun,player)==0)
      return L__M(##Open,4,noun);
  L__M(##Open,5,noun);
];

pull (#5058)

@open pull *;pull;yank *;yank;tug *;tug = nowhere
@set #5058 = puzzle
@succ #5058 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @tellroom(@location("%#"),"",@print("%n >pull %0%c",
  @switch(1,
   @eq("%0",""),@print("What do you want to pull?",@setfield(3529,"isturn",0)),
   @eq(t1,"-1"),"You can't see any such thing.",
   @not(@eq(@getfield(t1,"on_pull"),"")),@call(t1,"on_pull"),
   @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"),
   @getfield(t1,"is_static"),"It is fixed in place.",
   @getfield(t1,"is_scenery"),"You are unable to.",
   @getfield(t1,"is_animate"),"That would be less than courteous.",
   "Nothing obvious happens."
 ))); @call(3529,"each_turn");
---
TEST
@succ #5058 = @execute(@getfield(3529,"fn_calc_t1")); @tellroom(@location("%#"),"",@print("%n >pull %0%c", @switch(1, @eq("%0",""),@print("What do you want to pull?",@setfield(3529,"isturn",0)), @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"on_pull"),"")),@call(t1,"on_pull"), @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"), @getfield(t1,"is_static"),"It is fixed in place.", @getfield(t1,"is_scenery"),"You are unable to.", @getfield(t1,"is_animate"),"That would be less than courteous.", "Nothing obvious happens."))); @call(3529,"each_turn");
===

push (#5059)

@open push *;push;press *;press = nowhere
@set #5059 = puzzle
@succ #5059 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @tellroom(@location("%#"),"",@print("%n >push %0%c",
  @switch(1,
   @eq("%0",""),@print("What do you want to push?",@setfield(3529,"isturn",0)),
   @eq(t1,"-1"),"You can't see any such thing.",
   @not(@eq(@getfield(t1,"on_push"),"")),@call(t1,"on_push"),
   @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"),
   @getfield(t1,"is_static"),"It is fixed in place.",
   @getfield(t1,"is_scenery"),"You are unable to.",
   @getfield(t1,"is_animate"),"That would be less than courteous.",
   "Nothing obvious happens."
 ))); @call(3529,"each_turn");
---
TEST
@succ #5059 = @execute(@getfield(3529,"fn_calc_t1")); @tellroom(@location("%#"),"",@print("%n >push %0%c", @switch(1, @eq("%0",""),@print("What do you want to push?",@setfield(3529,"isturn",0)), @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"on_push"),"")),@call(t1,"on_push"), @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"), @getfield(t1,"is_static"),"It is fixed in place.", @getfield(t1,"is_scenery"),"You are unable to.", @getfield(t1,"is_animate"),"That would be less than courteous.", "Nothing obvious happens."))); @call(3529,"each_turn");
===

put on (#3368)

@open put * on *;put * onto *;place * on *;place * onto *;drop * on *;drop * onto *;throw * on *;throw * onto *;discard * on *;discard * onto * = nowhere
@set #3368 = puzzle
@succ #3368 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @execute(@getfield(3529,"fn_calc_t2"));
// @s("anc",...TODO...);
 @tellroom(@location("%#"),"",@print("%n >put %0",
  @switch("%1","","%c"," on %1%c"),
  @switch(1,
   @eq("%0",""),@print("What do you want to put?",@setfield(3529,"isturn",0)),
   @eq(t1,"-1"),"You can't see any such thing.",
   @eq("%1",""),@print("What do you want to put ",
    @switch(@getfield(t1,"is_proper"),"","the "),
    @shortname(t1)," on?",@setfield(3529,"isturn",0)
   ),
   @eq(t2,"-1"),"You can't see any such thing.",
   @not(@eq(@getfield(t1,"parent"),3529)),@print(
    "You need to be holding ",
    @switch(@getfield(t1,"is_proper"),"","the "),
    @shortname(t1)," before you can put it onto something else."),
//   @eq(anc,t1),"You can't put something on top of itself.",
   @eq(t2,t1),"You can't put something on top of itself.",
   @not(@eq(@getfield(t1,"on_puton"),"")),@call(t1,"on_puton"),
   @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"),
   @not(@eq(@getfield(t2,"on_receive"),"")),@call(t2,"on_receive"),
   @not(@eq(@getfield(t2,"on_before"),"")),@call(t2,"on_before"),
   @eq(@getfield(t2,"is_supporter"),""),"That can't support things.",
   @print(
    @setfield(t1,"parent",t2),
    @setfield(t1,"ncontents",@add(1,@getfield(t1,"ncontents"))),
    "You put ",
    @switch(@getfield(t1,"is_proper"),"","the "),
    @shortname(t1)," onto ",
    @switch(@getfield(t2,"is_proper"),"","the "),
    @shortname(t2),"."
   )
 ))); @call(3529,"each_turn");
---
TEST
@succ #3368 = @execute(@getfield(3529,"fn_calc_t1")); @execute(@getfield(3529,"fn_calc_t2")); @tellroom(@location("%#"),"",@print("%n >put %0", @switch("%1","","%c"," on %1%c"), @switch(1, @eq("%0",""),@print("What do you want to put?",@setfield(3529,"isturn",0)), @eq(t1,"-1"),"You can't see any such thing.", @eq("%1",""),@print("What do you want to put ", @switch(@getfield(t1,"is_proper"),"","the "), @shortname(t1)," on?",@setfield(3529,"isturn",0)), @eq(t2,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"parent"),3529)),@print("You need to be holding ", @switch(@getfield(t1,"is_proper"),"","the "), @shortname(t1)," before you can put it onto something else."), @eq(t2,t1),"You can't put something on top of itself.", @not(@eq(@getfield(t1,"on_puton"),"")),@call(t1,"on_puton"), @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"), @not(@eq(@getfield(t2,"on_receive"),"")),@call(t2,"on_receive"), @not(@eq(@getfield(t2,"on_before"),"")),@call(t2,"on_before"), @eq(@getfield(t2,"is_supporter"),""),"That can't support things.", @print( @setfield(t1,"parent",t2), @setfield(t1,"ncontents",@add(1,@getfield(t1,"ncontents"))), "You put ", @switch(@getfield(t1,"is_proper"),"","the "), @shortname(t1)," onto ", @switch(@getfield(t2,"is_proper"),"","the "), @shortname(t2),".")))); @call(3529,"each_turn");
===

restart (#2375)

@open restart;reset = nowhere
@field #2375 = room_offstage : 2651
@field #2375 = room_holodeck : 2376
@field #2375 = room_hut : 2315
@field #2375 = room_grasslands : 2326
@field #2375 = room_valley : 2349
@field #2375 = room_boneyard : 2464
@field #2375 = room_track : 2475
@field #2375 = room_finale : 2476
@field #2375 = room_cavemouth : 2448
@field #2375 = room_incave : 2452
@field #2375 = room_edge : 2369
@field #2375 = room_crest : 2439
@field #2375 = room_gorse : 2459
@field #2375 = room_bazaar : 2461
@succ #2375 = @fieldloop(2375,"room_",@call("%v","reset"));
 @tellroom(2376,"",@print(
  "%n >restart%c%c",@getfield(2376,"name"),
  "%c",@call(2376,"description"),"%c%cVisible Exits:",
  @substr(@contentsloop(2376,"x",@switch(@type("%x"),3,@print(
  ", ",@shortname("%x")))),1)));
---
@succ #2375 = @fieldloop(2375,"room_",@call("%v","reset")); @tellroom(2376,"",@print( "%n >restart%c%c",@getfield(2376,"name"), "%c",@call(2376,"description"),"%c%cVisible Exits:", @substr(@contentsloop(2376,"x",@switch(@type("%x"),3,@print(", ",@shortname("%x")))),1)));
===

rezrov (#3448)

@open rezrov *;rezrov = nowhere
@set #3448 = puzzle
@succ #3448 = @s("p0","%0"); @execute(@getfield(3529,"fn_calc_t1")); @call(3448,"cast"); @call(3529,"each_turn");
@field #3448 = fn_unhide :
 @contentsloop(2651,"x",@switch(@getfield("%x","parent"),t1,@print(
  @move("%x",2376),
  @contentsloop(2651,"y",@switch(@getfield("%y","parent"),"%x",@print(
   @move("%y",2376)
  )))
 )));
---
TEST
@field #3448 = fn_unhide : @contentsloop(2651,"x",@switch(@getfield("%x","parent"),t1,@print( @move("%x",2376), @contentsloop(2651,"y",@switch(@getfield("%y","parent"),"%x",@print(@move("%y",2376)))))));
===
@field #3448 = fn_reveal :
 @s("nhere",0);
 @contentsloop(2651,"x",@switch(@getfield("%x","parent"),t1,@print(
  @move("%x",2376), @s("nhere",@add(1,nhere)),
  @contentsloop(2651,"y",@switch(@getfield("%y","parent"),"%x",@print(
   @move("%y",2376)
  )))
 )));
 @switch(1,
  @eq(nhere,0),@print(
   @switch(@getfield(t1,"is_proper"),"","The "),
   @shortname(t1)," is empty."),
  @print("In the ",@shortname(t1),@switch(nhere,1," is"," are"),
   @s("i",1),
   @contentsloop(2376,"x",@switch(@getfield("%x","parent"),t1,@print(
    @switch(i,1," ",nhere," and ",", "),
    @switch(1,@getfield("%x","is_proper"),"",
     @eq(@getfield("%x","article"),""),"a ",
     @print(@getfield("%x","article")," ")),
    @shortname("%x"),
    @s("i",@add(1,i))
   ))),"."
 ));
---
TEST
@field #3448 = fn_reveal : @s("nhere",0); @contentsloop(2651,"x",@switch(@getfield("%x","parent"),t1,@print( @move("%x",2376), @s("nhere",@add(1,nhere)), @contentsloop(2651,"y",@switch(@getfield("%y","parent"),"%x",@print( @move("%y",2376))))))); @switch(1, @eq(nhere,0),@print( @switch(@getfield(t1,"is_proper"),"","The "), @shortname(t1)," is empty."), @print("In the ",@shortname(t1), @switch(nhere,1," is"," are"), @s("i",1), @contentsloop(2376,"x",@switch(@getfield("%x","parent"),t1,@print( @switch(i,1," ",nhere," and ",", "), @switch(1,@getfield("%x","is_proper"),"", @eq(@getfield("%x","article"),""),"a ", @print(@getfield("%x","article")," ")), @shortname("%x"), @s("i",@add(1,i))))),"."));
===
@field #3448 = fn_hide :
 @contentsloop(2376,"x",@switch(@getfield("%x","parent"),t1,@print(
  @move("%x",2651),
  @contentsloop(2376,"y",@switch(@getfield("%y","parent"),"%x",@print(
   @move("%y",2651)
  )))
 )));
---
@field #3448 = fn_hide : @contentsloop(2376,"x",@switch(@getfield("%x","parent"),t1,@print( @move("%x",2651), @contentsloop(2376,"y",@switch(@getfield("%y","parent"),"%x",@print(@move("%y",2651)))))));
===
@field #3448 = cast :
 @tellroom(@location("%#"),"",@print("%n >rezrov ",p0,"%c",
  @switch(1,@lt(@getfield(3130,"number"),1),
   "You haven't learned that spell, if indeed it is a spell.",
  @eq(@getfield(3130,"is_reversed"),""),
   @switch(1,
    @eq("%0",""),"The world is open already.",
    @eq(t1,"-1"),"You can't see any such thing.",
    @not(@eq(@getfield(t1,"on_rezrov"),"")),@execute(@getfield(t1,"on_rezrov")),
    @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")),
    @not(@eq(@getfield(t1,"on_before"),"")),@execute(@getfield(t1,"on_before")),
    @getfield(t1,"is_animate"),"It might be a boon to surgeons if it worked, but it doesn't.",
    @or(@getfield(t1,"is_open"),@eq(@getfield(t1,"is_openable"),"")),"It doesn't need opening.",
    @eq(@getfield(t1,"is_locked"),""),@print(
     @setfield(t1,"is_open",1),
     @switch(@getfield(t1,"is_proper"),"","The "),@shortname(t1),
     " opens obediently. Like swatting a fly with a sledge hammer, if you ask me.",
     @switch(1,
      @getfield(t1,"is_container"),@call(3448,"fn_unhide"),
      @eq(t1,3963),@setfield(3966,"is_open",1),
      @eq(t1,3966),@setfield(3963,"is_open",1)
     )
    ),
    @print(
     @setfield(t1,"is_open",1),@setfield(t1,"is_locked",""),
     "Silently, ",@switch(@getfield(t1,"is_proper"),"","the "),
     @shortname(t1)," swings open. ",
     @switch(1,
      @getfield(t1,"is_container"),@call(3448,"fn_reveal"),
      @eq(t1,3963),@print(@setfield(3966,"is_open",1),@setfield(3966,"is_locked","")),
      @eq(t1,3966),@print(@setfield(3963,"is_open",1),@setfield(3963,"is_locked",""))
     )
    )
   ),@switch(1,
    @eq("%0",""),"The world is closed already.",
    @eq(t1,"-1"),"You can't see any such thing.",
    @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")),
    @not(@eq(@getfield(t1,"on_before"),"")),@execute(@getfield(t1,"on_before")),
    @getfield(t1,"is_animate"),"Happily, that is unnecessary.",
    @or(@getfield(t1,"is_locked"),@eq(@getfield(t1,"is_lockable"),"")),"It doesn't need locking.",
    @print(
     @setfield(t1,"is_open",""),@setfield(t1,"is_locked",1),
     "Silently, ",@switch(@getfield(t1,"is_proper"),"","the "),
     @shortname(t1)," swings shut and locks. ",
     @switch(1,
      @getfield(t1,"is_container"),@call(3448,"fn_hide"),
      @eq(t1,3963),@print(@setfield(3966,"is_open",""),@setfield(3966,"is_locked",1)),
      @eq(t1,3966),@print(@setfield(3963,"is_open",""),@setfield(3963,"is_locked",1))
     )
    )
 ))));
 @switch(@getfield(3130,"number"),{0,100},"",@print(
  @setfield(3130,"number",@sub(@getfield(3130,"number"),1)),
  @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1)),
  @switch(@getfield(3130,"number"),0,@setfield(3130,"is_reversed",""))
 ));
---
@field #3448 = cast : @tellroom(@location("%#"),"",@print("%n >rezrov ",p0,"%c", @switch(1,@lt(@getfield(3130,"number"),1), "You haven't learned that spell, if indeed it is a spell.", @eq(@getfield(3130,"is_reversed"),""), @switch(1, @eq("%0",""),"The world is open already.", @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"on_rezrov"),"")),@execute(@getfield(t1,"on_rezrov")), @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")), @not(@eq(@getfield(t1,"on_before"),"")),@execute(@getfield(t1,"on_before")), @getfield(t1,"is_animate"),"It might be a boon to surgeons if it worked, but it doesn't.", @or(@getfield(t1,"is_open"),@eq(@getfield(t1,"is_openable"),"")),"It doesn't need opening.", @eq(@getfield(t1,"is_locked"),""),@print( @setfield(t1,"is_open",1), @switch(@getfield(t1,"is_proper"),"","The "),@shortname(t1), " opens obediently. Like swatting a fly with a sledge hammer, if you ask me.", @switch(1,@getfield(t1,"is_container"),@call(3448,"fn_unhide"), @eq(t1,3963),@setfield(3966,"is_open",1), @eq(t1,3966),@setfield(3963,"is_open",1))), @print(@setfield(t1,"is_open",1),@setfield(t1,"is_locked",""), "Silently, ",@switch(@getfield(t1,"is_proper"),"","the "), @shortname(t1)," swings open. ", @switch(1,@getfield(t1,"is_container"),@call(3448,"fn_reveal"), @eq(t1,3963),@print(@setfield(3966,"is_open",1),@setfield(3966,"is_locked","")), @eq(t1,3966),@print(@setfield(3963,"is_open",1),@setfield(3963,"is_locked",""))))),@switch(1,@eq("%0",""),"The world is closed already.", @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")), @not(@eq(@getfield(t1,"on_before"),"")),@execute(@getfield(t1,"on_before")), @getfield(t1,"is_animate"),"Happily, that is unnecessary.", @or(@getfield(t1,"is_locked"),@eq(@getfield(t1,"is_lockable"),"")),"It doesn't need locking.", @print(@setfield(t1,"is_open",""),@setfield(t1,"is_locked",1), "Silently, ",@switch(@getfield(t1,"is_proper"),"","the "), @shortname(t1)," swings shut and locks. ", @switch(1,@getfield(t1,"is_container"),@call(3448,"fn_hide"), @eq(t1,3963),@print(@setfield(3966,"is_open",""),@setfield(3966,"is_locked",1)), @eq(t1,3966),@print(@setfield(3963,"is_open",""),@setfield(3963,"is_locked",1)))))))); @switch(@getfield(3130,"number"),{0,100},"",@print( @setfield(3130,"number",@sub(@getfield(3130,"number"),1)), @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1)), @switch(@getfield(3130,"number"),0,@setfield(3130,"is_reversed",""))));
===

ride (#2987)

@open ride *;mount *;straddle *;ride;mount;straddle = nowhere
@set #2987 = puzzle
@succ #2987 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @s("_msg",@print("%n >ride %0%c",@switch(1,
   @eq("%0",""),@print("What do you want to ride?",@setfield(3529,"isturn",0)),
   @eq(t1,"-1"),"You can't see any such thing.",
   @not(@eq(@getfield(t1,"on_ride"),"")),@call(t1,"on_ride"),
   @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"),
   @print("You can hardly ride a ",@shortname(t1),".")
 )));
 @tellroom(@location("%#"),"",_msg); @call(3529,"each_turn");
---
@succ #2987 = @execute(@getfield(3529,"fn_calc_t1")); @s("_msg",@print("%n >ride %0%c",@switch(1, @eq("%0",""),@print("What do you want to ride?",@setfield(3529,"isturn",0)), @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"on_ride"),"")),@call(t1,"on_ride"), @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"), @print("You can hardly ride a ",@shortname(t1),".")))); @tellroom(@location("%#"),"",_msg); @call(3529,"each_turn");
===

rub (#12903)

@open rub *;shine *;polish *;sweep *;clean *;dust *;wipe *;scrub *;
 rub;shine;polish;sweep;clean;dust;wipe = nowhere
@set #12903 = puzzle
@succ #12903 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @tellroom(@location("%#"),"",@print("%n >rub %0%c",@switch(1,
  @eq("%0",""),@print("What do you want to rub?",@setfield(3529,"isturn",0)),
   @eq(t1,"-1"),"You can't see any such thing.",
   @not(@eq(@getfield(t1,"on_ride"),"")),@call(t1,"on_rub"),
   @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"),
   "You achieve nothing by this."
 ))); @call(3529,"each_turn");
----
@succ #12903 = @execute(@getfield(3529,"fn_calc_t1")); @tellroom(@location("%#"),"",@print("%n >rub %0%c",@switch(1, @eq("%0",""),@print("What do you want to rub?",@setfield(3529,"isturn",0)), @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"on_ride"),"")),@call(t1,"on_rub"), @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"), "You achieve nothing by this."))); @call(3529,"each_turn");
====

stand (dbref #5071)

@name #5071 = stand;stand up;get out;get off;get up;exit;out;outside;get off *;leave *
@open stand;stand up;get out;get off;get up;exit;out;outside;get off *;leave * = nowhere
@succ #5071 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @s("p",@getfield(3529,"parent"));
 @tellroom(@location("%#"),"",@print("%n >",
  @switch("%0","","stand%c","leave %0%c"),
  @switch(1,
   @eq(t1,"-1"),"You can't see any such thing.",
   @eq(p,@getfield(2376,"the_room")),"But you aren't in anything at the moment.",
   @print(
    @setfield(3529,"parent",@getfield(2376,"the_room")),
    @setfield(2376,"name",@getfield(@getfield(2376,"the_room"),"name")),
    "You get off the ", @shortname(p), "."
   )
 ))); @call(3529,"each_turn");
---
@succ #5071 = @execute(@getfield(3529,"fn_calc_t1")); @s("p",@getfield(3529,"parent")); @tellroom(@location("%#"),"",@print("%n >", @switch("%0","","stand%c","leave %0%c"), @switch(1, @eq(t1,"-1"),"You can't see any such thing.", @eq(p,@getfield(2376,"the_room")),"But you aren't in anything at the moment.", @print( @setfield(3529,"parent",@getfield(2376,"the_room")), @setfield(2376,"name",@getfield(@getfield(2376,"the_room"),"name")), "You get off the ", @shortname(p), ".")))); @call(3529,"each_turn");
===

search (#5074)

@open search *;search;
 look inside *;look into *;look in *;l inside *;l into *;l in *;
 look inside;look into;look in;l inside;l into;l in;
 look behind *;l behind *;look through *;l through *;
 look under *;l under *;look behind;look through;look under;
 l behind;l through;l under;look on *;l on *;look on;l on = nowhere
@set #5074 = puzzle
@field #5074 = fn_list :
 @s("i",1);
 @contentsloop(2376,"x",@switch(@getfield("%x","parent"),t1,@print(
  @switch(i,1," ",f," and ",", "),
  @switch(1,@getfield("%x","is_proper"),"",
   @eq(@getfield("%x","article"),""),"a ",
   @print(@getfield("%x","article")," ")),
  @shortname("%x"),
  @s("i",@add(1,i))
 )));
---
@field #5074 = fn_list : @s("i",1); @contentsloop(2376,"x",@switch(@getfield("%x","parent"),t1,@print(@switch(i,1," ",f," and ",", "), @switch(1,@getfield("%x","is_proper"),"", @eq(@getfield("%x","article"),""),"a ", @print(@getfield("%x","article")," ")), @shortname("%x"), @s("i",@add(1,i)))));
===
@succ #5074 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @s("f",0);
 @contentsloop(@location("%#"),"x",@switch(1,
  @and(
   @eq(@getfield("%x","parent"),t1),
   @eq(@getfield("%x","is_scenery"),"")
  ),@s("f",@add(1,f))
 ));
 @tellroom(@location("%#"),"",@print("%n >search %0%c",
  @switch(1,
   @eq("%0",""),@print("What do you want to search?",@setfield(3529,"isturn",0)),
   @eq(t1,"-1"),"You can't see any such thing.",
   @eq(@getfield(3529,"can_see"),0),"But it's dark.",
   @not(@eq(@getfield(t1,"on_search"),"")),@call(t1,"on_search"),
   @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"),
   @getfield(t1,"is_supporter"),@switch(1,
    @eq(f,0),@print("There is nothing on the ",@shortname(t1),"."),
    @print("On the ",@shortname(t1),
     @switch(f,1," is"," are"),@call(5074,"fn_list"),".")
   ),
   @eq(@getfield(t1,"is_container"),""),"You find nothing of interest.",
   @eq(@getfield(t1,"is_open"),""),@print(
    "You can't see inside, since ",
    @switch(@getfield(t1,"is_proper"),"","the "),
    @shortname(t1)," is closed."),
   @eq(f,0),@print(
    @switch(@getfield(t1,"is_proper"),"","The "),
    @shortname(t1)," is empty."),
   @print("In the ",@shortname(t1),
    @switch(f,1," is"," are"),@call(5074,"fn_list"),".")
 ))); @call(3529,"each_turn");
---
@succ #5074 = @execute(@getfield(3529,"fn_calc_t1")); @s("f",0); @contentsloop(@location("%#"),"x",@switch(1, @and(@eq(@getfield("%x","parent"),t1), @eq(@getfield("%x","is_scenery"),"")),@s("f",@add(1,f)))); @tellroom(@location("%#"),"",@print("%n >search %0%c", @switch(1, @eq("%0",""),@print("What do you want to search?",@setfield(3529,"isturn",0)), @eq(t1,"-1"),"You can't see any such thing.", @eq(@getfield(3529,"can_see"),0),"But it's dark.", @not(@eq(@getfield(t1,"on_search"),"")),@call(t1,"on_search"), @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"), @getfield(t1,"is_supporter"),@switch(1, @eq(f,0),@print("There is nothing on the ",@shortname(t1),"."), @print("On the ",@shortname(t1), @switch(f,1," is"," are"),@call(5074,"fn_list"),".")), @eq(@getfield(t1,"is_container"),""),"You find nothing of interest.", @eq(@getfield(t1,"is_open"),""),@print( "You can't see inside, since ", @switch(@getfield(t1,"is_proper"),"","the "), @shortname(t1)," is closed."), @eq(f,0),@print( @switch(@getfield(t1,"is_proper"),"","The "), @shortname(t1)," is empty."), @print("In the ",@shortname(t1), @switch(f,1," is"," are"),@call(5074,"fn_list"),".")))); @call(3529,"each_turn");
===

score (#3768)

@open score;fullscore = nowhere
@succ #3768 = @tellroom(@location("%#"),"",@print(
  "%n >score%cYou have so far scored ",@getfield(3529,"score"),
  " out of a possible 51, in ",@getfield(3529,"turns"),
  " turns, earning you the rank of ",
  @switch(1,
   @gt(@getfield(3529,"score"),49),"Scientist.",
   @gt(@getfield(3529,"score"),39),"Spellbreaker.",
   @gt(@getfield(3529,"score"),29),"Sorcerer.",
   @gt(@getfield(3529,"score"),19),"Enchanter.",
   @gt(@getfield(3529,"score"),9),"novice Enchanter.",
   "lost dreamer.")
 )); @call(3529,"each_turn");
---
@succ #3768 = @tellroom(@location("%#"),"",@print("%n >score%cYou have so far scored ",@getfield(3529,"score"), " out of a possible 51, in ",@getfield(3529,"turns"), " turns, earning you the rank of ", @switch(1, @gt(@getfield(3529,"score"),49),"Scientist.", @gt(@getfield(3529,"score"),39),"Spellbreaker.", @gt(@getfield(3529,"score"),29),"Sorcerer.", @gt(@getfield(3529,"score"),19),"Enchanter.", @gt(@getfield(3529,"score"),9),"novice Enchanter.", "lost dreamer."))); @call(3529,"each_turn");
===

spells (#2988)

// note: memory.capacity became @getfield(3529,"memory_capacity")
@open spells;memory = nowhere
@field #2988 = number_known : 1
@succ #2988 =
 @tellroom(@location("%#"),"",@print("%n >spells%c",
  @s("j",0),@s("k",0),
  @fieldloop(3529,"spell_",@switch(@getfield("%v","number"),100,
    @s("j",@add(1,j))
  )),
  @switch(1,@gt(j,0),@print("The ",
   @fieldloop(3529,"spell_",@print(
    @switch(@getfield("%v","number"),100,@print(
     @s("k",@add(1,k)),@getfield("%v","sname"),
     @switch(1,@eq(k,@sub(j,1))," and ",
      @lt(k,@sub(j,1)),", ")
    ))
   )),
   @switch(j,1," spell is"," spells are"),
   " yours forever. Other than that, y"
  ),"Y"),
  "ou have ",@s("j",0),@s("k",0),
  @fieldloop(3529,"spell_",@switch(@getfield("%v","number"),{0,100},"",
    @s("j",@add(1,j))
  )),
  @switch(1,@gt(j,0),@print("the ",
   @fieldloop(3529,"spell_",@switch(@getfield("%v","number"),{0,100},"",@print(
    @s("k",@add(1,k)),@shortname("%v"),
    @switch(@getfield("%v","number"),1,"",2," (twice)",3," (thrice)",
     4," (four times"," (many times)"),
    @switch(1,@eq(k,@sub(j,1))," and ",
     @lt(k,@sub(j,1)),", ")
   )))
  ),"no spells"),
  " memorised."
 )); @call(3529,"each_turn");
---
TEST
@succ #2988 = @tellroom(@location("%#"),"",@print("%n >spells%c", @s("j",0),@s("k",0), @fieldloop(3529,"spell_",@switch(@getfield("%v","number"),100, @s("j",@add(1,j)))), @switch(1,@gt(j,0),@print("The ", @fieldloop(3529,"spell_",@print( @switch(@getfield("%v","number"),100,@print( @s("k",@add(1,k)),@getfield("%v","sname"), @switch(1,@eq(k,@sub(j,1))," and ", @lt(k,@sub(j,1)),", "))))), @switch(j,1," spell is"," spells are"), " yours forever. Other than that, y"),"Y"), "ou have ",@s("j",0),@s("k",0), @fieldloop(3529,"spell_",@switch(@getfield("%v","number"),{0,100},"", @s("j",@add(1,j)))), @switch(1,@gt(j,0),@print("the ", @fieldloop(3529,"spell_",@switch(@getfield("%v","number"),{0,100},"",@print( @s("k",@add(1,k)),@shortname("%v"), @switch(@getfield("%v","number"),1,"",2," (twice)",3," (thrice)", 4," (four times"," (many times)"), @switch(1,@eq(k,@sub(j,1))," and ", @lt(k,@sub(j,1)),", "))))),"no spells")," memorised.")); @call(3529,"each_turn");
===
TODO
       forget_spell
       [ sp;
           if (sp notin self || sp.number==100) rtrue;
           self.number_known--;
           sp.number--;
           if (sp.number==0) remove sp;
           rtrue;
       ];

take (#4379)

@open take *;get *;grab *;pick up * = nowhere
@set #4379 = puzzle
@succ #4379 = TODO
 @execute(@getfield(3529,"fn_calc_t1"));
 @tellroom(@location("%#"),"",@print("%n >take %0%c",
  @switch(1,
   @eq("%0",""),@print("What do you want to take?",@setfield(3529,"isturn",0)),
   @eq(t1,"-1"),"You can't see any such thing.",
   @eq(@getfield(t1,"parent"),3529),"You already have that.",
   @eq(t1,3529),"You are always self-possessed.",
   @not(@eq(@getfield(t1,"on_take"),"")),@call(t1,"on_take"),
   @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"),
   @getfield(t1,"is_animate"),@print("I don't suppose the ",@shortname(t1)," would care for that."),
   @getfield(t1,"is_spell"),"You can't see any such thing.",
   @eq(@getfield(3529,"parent"),t1),@print("You'd have to get off the ",@shortname(t1)," first."),
   ...
   @getfield(t1,"is_scenery"),"That's hardly portable.",
   @getfield(t1,"is_static"),"That's fixed in place.",
   @not(@eq(@getfield(@getfield(t1,"parent"),"on_letgo"),"")),
    @call(@getfield(t1,"parent"),"on_letgo"),
   ...
   @print(@setfield(t1,"parent",3529),
    "Taken.",
    @switch(@getfield(t1,"on_take_after"),"","",@call(t1,"on_take_after")),
    @switch(@or(@getfield(t1,"is_cube"),
     @not(@eq(@getfield(t1,"initial"),""))),
     1,@setfield(t1,"is_moved",1))
   )
  )
 )); @call(3529,"each_turn");
---
TEST
@succ #4379 = @execute(@getfield(3529,"fn_calc_t1")); @tellroom(@location("%#"),"",@print("%n >take %0%c", @switch(1, @eq("%0",""),@print("What do you want to take?",@setfield(3529,"isturn",0)), @eq(t1,"-1"),"You can't see any such thing.", @eq(@getfield(t1,"parent"),3529),"You already have that.", @eq(t1,3529),"You are always self-possessed.", @not(@eq(@getfield(t1,"on_take"),"")),@call(t1,"on_take"), @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"), @getfield(t1,"is_animate"),@print("I don't suppose the ",@shortname(t1)," would care for that."), @getfield(t1,"is_spell"),"You can't see any such thing.", @eq(@getfield(3529,"parent"),t1),@print("You'd have to get off the ",@shortname(t1)," first."), @getfield(t1,"is_scenery"),"That's hardly portable.", @getfield(t1,"is_static"),"That's fixed in place.", @not(@eq(@getfield(@getfield(t1,"parent"),"on_letgo"),"")), @call(@getfield(t1,"parent"),"on_letgo"), @print(@setfield(t1,"parent",3529),"Taken.", @switch(@getfield(t1,"on_take_after"),"","",@call(t1,"on_take_after")), @switch(@or(@getfield(t1,"is_cube"), @not(@eq(@getfield(t1,"initial"),""))), 1,@setfield(t1,"is_moved",1)))))); @call(3529,"each_turn");
===
[ TakeSub;
  if (onotheld_mode==0 || noun notin player)
      if (AttemptToTakeObject(noun)) rtrue;
  if (AfterRoutines()==1) rtrue;
  notheld_mode=onotheld_mode;
  if (notheld_mode==1 || keep_silent==1) rtrue;
  L__M(##Take,1);
];
[ AttemptToTakeObject item     ancestor after_recipient i j k;
  ! People cannot ordinarily be taken.
  if (item == player) return L__M(##Take,2);
  if (item has animate) return L__M(##Take,3,item);

  ancestor = CommonAncestor(player, item);
  if (ancestor == 0)
  {   i = ObjectScopedBySomething(item);
      if (i ~= 0) ancestor = CommonAncestor(player, i);
  }

  ! Are player and item in totally different places?
  if (ancestor == 0) return L__M(##Take,8,item);

  ! Is the player indirectly inside the item?
  if (ancestor == item) return L__M(##Take,4,item);

  ! Does the player already directly contain the item?
  if (item in player) return L__M(##Take,5,item);

  ! Can the player touch the item, or is there (e.g.) a closed container
  ! in the way?
  if (ObjectIsUntouchable(item,false,true)) return;

  ! The item is now known to be accessible.

  ! Consult the immediate possessor of the item, if it's in a container
  ! which the player is not in.

  i=parent(item);
  if (i ~= ancestor && (i has container || i has supporter))
  {   after_recipient=i;
      k=action; action=##LetGo;
      if (RunRoutines(i,before)~=0) { action=k; rtrue; }
      action=k;
  }

  if (item has scenery) return L__M(##Take,10,item);
  if (item has static)  return L__M(##Take,11,item);

  ! Transfer the item.
  move item to player;

  ! Send "after" message to the object letting go of the item, if any.

  if (after_recipient~=0)
  {   k=action; action=##LetGo;
      if (RunRoutines(after_recipient,after)~=0) { action=k; rtrue; }
      action=k;
  }
  rfalse;
];

// DEL'D @field #3529 = fn_take_animate : @tellroom(@location("%#"),"",@print("%n >take ",@shortname("%!"),"%cI don't suppose the ",@shortname("%!")," would care for that."));

// TODO: need to setfield child/sibling
// DEL'D @field #3529 = fn_take_other :
// @s("_msg",@print("%n >take ",@shortname("%!"),"%c",
//  @switch(1,
//   @eq(@getfield("%!","parent"),3529),"You already have that.",
//   @print(@setfield("%!","parent",3529),"Taken.")
//  )
// ));
// @tellroom(@location("%#"),"",@g("_msg"));

unlock (#3462)

@open unlock * with *;unlock * using *;unlock *;unlock = nowhere
@set #3462 = puzzle
// TODO WISH: attempt "take %1" if %1 is in scope but isn't held
@succ #3462 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @execute(@getfield(3529,"fn_calc_t2"));
 @tellroom(@location("%#"),"",@print("%n >unlock %0",
  @switch("%1","","%c"," with %1%c"),
  @switch(1,
   @eq("%0",""),@print("What do you want to unlock?",@setfield(3529,"isturn",0)),
   @eq(t1,"-1"),"You can't see any such thing.",
   @eq("%1",""),@print("What do you want to unlock ",
    @switch(@getfield(t1,"is_proper"),"","the "),
    @shortname(t1)," with?",@setfield(3529,"isturn",0)),
   @eq(t2,"-1"),"You can't see any such thing.",
   @not(@eq(@getfield(t2,"parent"),3529)),@print("You aren't holding ",
    @switch(@getfield(t2,"is_proper"),"","the "),
    @shortname(t2),"."),
   @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"),
   @eq(@getfield(t1,"is_lockable"),""),"That doesn't seem to be something you can unlock.",
   @eq(@getfield(t1,"is_locked"),""),"That's unlocked at the moment.",
   "That doesn't seem to fit the lock."
  )
 )); @call(3529,"each_turn");
---
@succ #3462 = @execute(@getfield(3529,"fn_calc_t1")); @execute(@getfield(3529,"fn_calc_t2")); @tellroom(@location("%#"),"",@print("%n >unlock %0", @switch("%1","","%c"," with %1%c"), @switch(1, @eq("%0",""),@print("What do you want to unlock?",@setfield(3529,"isturn",0)), @eq(t1,"-1"),"You can't see any such thing.", @eq("%1",""),@print("What do you want to unlock ", @switch(@getfield(t1,"is_proper"),"","the "), @shortname(t1)," with?",@setfield(3529,"isturn",0)), @eq(t2,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t2,"parent"),3529)),@print("You aren't holding ", @switch(@getfield(t2,"is_proper"),"","the "), @shortname(t2),"."), @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"), @eq(@getfield(t1,"is_lockable"),""),"That doesn't seem to be something you can unlock.",@eq(@getfield(t1,"is_locked"),""),"That's unlocked at the moment.","That doesn't seem to fit the lock."))); @call(3529,"each_turn");
===

urbzig (#3451)

@open urbzig *;urbzig = nowhere
@set #3451 = puzzle
@succ #3451 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @tellroom(@location("%#"),"",@print("%n >urbzig %0%c",
  @switch(@getfield(3549,"is_reversed"),"",
   @switch(1,
    @eq("%0",""),"The spell fizzles away.",
    @eq(t1,"-1"),"You can't see any such thing.",
    @not(@eq(@getfield(t1,"on_urbzig"),"")),@execute(@getfield(t1,"on_urbzig")),
    @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")),
    @not(@eq(@getfield(t1,"on_before"),"")),@execute(@getfield(t1,"on_before")),
    @eq(t1,3529),"It's a matter of opinion, isn't it?",
    @switch(t1,{2365,3721,3619,3599,3622,3724},1,0),@print(
     @switch(t1,2365,"","The "),@shortname(t1),
     @move(t1,2651),@setfield(t1,"parent",2651),
     @contentsloop(2376,"x",@switch(t1,
      @getfield("%x","parent"),@move("%x",2651),
      @getfield(@getfield("%x","parent"),"parent"),@move("%x",2651)
     )),
     @switch(@and(@eq(t1,3721),@eq(@getfield(3718,"parent"),@getfield(2376,"the_room"))),1,@print(
      @move(3718,2651),@setfield(3718,"parent",2651),
      @move(3722,2376),@setfield(3722,"parent",@getfield(2376,"the_room")),
      " turns into a featureless white cube just as the cyclops was about to hit you with it. Mightily embarrassed by this, he drops the cube and runs off!"
      )," turns into a moth and flutters away."
    ),
    @print(
     "Nothing obvious happens. Perhaps ",
     @switch(@getfield(t1,"is_proper"),"","the "),
     @shortname(t1)," isn't so very dangerous after all."
   )),@switch(1,
    @eq("%0",""),"The spell fizzles away.",
    @eq(t1,"-1"),"You can't see any such thing.",
    @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")),
    @not(@eq(@getfield(t1,"on_before"),"")),@execute(@getfield(t1,"on_before")),
    @eq(t1,3529),"It's a matter of opinion, isn't it?",
    @or(@getfield(t1,"is_static"),@getfield(t1,"is_scenery")),
     @print("Your spell is too weak for something quite as monumentally harmless as ",
     @switch(@getfield(t1,"is_proper"),"","the "),
     @shortname(t1),"."),
    @switch(t1,{2365,3695,3718,3721,3722,3724,3599,3619},1,0),
     "Nothing obvious happens."),
    @eq(@getfield(t1,"parent"),3529),@print(
     @move(t1,2651),@setfield(t1,"parent",2651),
     @contentsloop(2376,"x",@switch(t1,
      @getfield("%x","parent"),@move("%x",2651),
      @getfield(@getfield("%x","parent"),"parent"),@move("%x",2651)
     )),
     @setfield(3529,"deadflag",1),
     "Suddenly, a tarantula races up your arm to your throat! Perhaps it was unwise to gizbru something you were actually holding."),
    @getfield(3718,"is_general"),"Nothing happens. Perhaps that's just as well, after the last time.",
    @print(
     @move(t1,2651),@setfield(t1,"parent",2651),
     @contentsloop(2376,"x",@switch(t1,
      @getfield("%x","parent"),@move("%x",2651),
      @getfield(@getfield("%x","parent"),"parent"),@move("%x",2651)
     )),
     @move(3718,2376),@move(3721,2376),
     @setfield(3718,"parent",@getfield(2376,"the_room")),
     @setfield(3718,"is_general",1),@setfield(3718,"timer",5),
     @switch(@getfield(t1,"is_proper"),"","The "),
     @shortname(t1)," is replaced by a buck-toothed cyclops wielding a mace!"
    )
 ))));
 @switch(@getfield(3549,"number"),{0,100},"",@print(
  @setfield(3549,"number",@sub(@getfield(3549,"number"),1)),
  @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1)),
  @switch(@getfield(3549,"number"),0,@setfield(3549,"is_reversed",""))
 )); @call(3529,"each_turn");
---
@succ #3451 = @execute(@getfield(3529,"fn_calc_t1")); @tellroom(@location("%#"),"",@print("%n >urbzig %0%c", @switch(@getfield(3549,"is_reversed"),"", @switch(1, @eq("%0",""),"The spell fizzles away.", @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"on_urbzig"),"")),@execute(@getfield(t1,"on_urbzig")), @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")), @not(@eq(@getfield(t1,"on_before"),"")),@execute(@getfield(t1,"on_before")), @eq(t1,3529),"It's a matter of opinion, isn't it?", @switch(t1,{2365,3721,3619,3599,3622,3724},1,0),@print( @switch(t1,2365,"","The "),@shortname(t1), @move(t1,2651),@setfield(t1,"parent",2651), @contentsloop(2376,"x",@switch(t1, @getfield("%x","parent"),@move("%x",2651), @getfield(@getfield("%x","parent"),"parent"),@move("%x",2651))), @switch(@and(@eq(t1,3721),@eq(@getfield(3718,"parent"),@getfield(2376,"the_room"))),1,@print( @move(3718,2651),@setfield(3718,"parent",2651), @move(3722,2376),@setfield(3722,"parent",@getfield(2376,"the_room")), " turns into a featureless white cube just as the cyclops was about to hit you with it. Mightily embarrassed by this, he drops the cube and runs off!" )," turns into a moth and flutters away."), @print( "Nothing obvious happens. Perhaps ", @switch(@getfield(t1,"is_proper"),"","the "), @shortname(t1)," isn't so very dangerous after all.")),@switch(1, @eq("%0",""),"The spell fizzles away.", @eq(t1,"-1"),"You can't see any such thing.", @not(@eq(@getfield(t1,"on_cast"),"")),@execute(@getfield(t1,"on_cast")), @not(@eq(@getfield(t1,"on_before"),"")),@execute(@getfield(t1,"on_before")), @eq(t1,3529),"It's a matter of opinion, isn't it?", @or(@getfield(t1,"is_static"),@getfield(t1,"is_scenery")), @print("Your spell is too weak for something quite as monumentally harmless as ", @switch(@getfield(t1,"is_proper"),"","the "), @shortname(t1),"."), @switch(t1,{2365,3695,3718,3721,3722,3724,3599,3619},1,0), "Nothing obvious happens."), @eq(@getfield(t1,"parent"),3529),@print( @move(t1,2651),@setfield(t1,"parent",2651), @contentsloop(2376,"x",@switch(t1, @getfield("%x","parent"),@move("%x",2651), @getfield(@getfield("%x","parent"),"parent"),@move("%x",2651))), @setfield(3529,"deadflag",1), "Suddenly, a tarantula races up your arm to your throat! Perhaps it was unwise to gizbru something you were actually holding."), @getfield(3718,"is_general"),"Nothing happens. Perhaps that's just as well, after the last time.", @print( @move(t1,2651),@setfield(t1,"parent",2651), @contentsloop(2376,"x",@switch(t1, @getfield("%x","parent"),@move("%x",2651), @getfield(@getfield("%x","parent"),"parent"),@move("%x",2651))), @move(3718,2376),@move(3721,2376), @setfield(3718,"parent",@getfield(2376,"the_room")), @setfield(3718,"is_general",1),@setfield(3718,"timer",5), @switch(@getfield(t1,"is_proper"),"","The "), @shortname(t1)," is replaced by a buck-toothed cyclops wielding a mace!"))))); @switch(@getfield(3549,"number"),{0,100},"",@print( @setfield(3549,"number",@sub(@getfield(3549,"number"),1)), @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1)), @switch(@getfield(3549,"number"),0,@setfield(3549,"is_reversed","")))); @call(3529,"each_turn");
===

verbs (#3457)

@open verbs = nowhere
@succ #3457 = @tellroom(@location("%#"),"","%n >verbs%c
 Some verbs known to this game:%c
 attack, cast, close, copy, diagnose, drop, eat, flip, get, give, hit,
 holodeck exit (he), in, insert, inventory, jump, kill, learn, listen, look,
 memorize, mount, open, out,
 push, pull, put, restart, ride, score, search, spells,
 stand, take, unlock, verbs, wait, what, who, write, x.");
---
@succ #3457 = @tellroom(@location("%#"),"","%n >verbs%cSome verbs known to this game:%cattack, cast, close, copy, diagnose, drop, eat, flip, get, give, hit, holodeck exit (he), in, insert, inventory, jump, kill, learn, listen, look, memorize, mount, open, out, push, pull, put, restart, ride, score, search, spells, stand, take, unlock, verbs, wait, what, who, write, x.");
===

wait (#3819)

@open wait;z = nowhere
@succ #3819 = @tellroom(@location("%#"),"","%n >wait%cTime passes."); @call(3529,"each_turn");

who is a * (#2378)

@open who is a *;who is *;who was a *;who was *;what do *;
 what is a *;what is *;what was a *;what was *;how do * = nowhere
@set #2378 = puzzle
@succ #2378 = @tellroom(@location("%#"),"",@switch("%0",
 {"helistar","friend","my friend","colleague","my colleague",
  "my friend helistar","my colleague helistar"},
 "%n >who is Helistar%cHelistar is your colleague, an Enchanter like you who has been much
 on your mind lately. She has been investigating some very dark
 magic indeed, and seems not to be around any more. You feel rather
 vague about the details.",
 {"burin","magic burin","magical burin"},
 "%n >what is a burin%cA burin is an engraving and writing tool.",
 {"change","great change","the change","the great change"},
 "%n >what was the Great Change%cSomething you had a lot to do with, but what exactly? No, it's gone.",
 "cyclops",
 "%n >what is a cyclops%cA one-eyed giant, usually hostile. (Don't they teach anything at
 adventurer school these days?)",
 "grue",
 "%n >what is a grue%cThe grue is a sinister, lurking presence in the dark places of the
 earth. Its favorite diet is adventurers, but its insatiable appetite
 is tempered by its fear of light. No grue has ever been seen by the
 light of day, and few have survived its fearsome jaws to tell the tale.",
 "grimoire",
 "%n >what is a grimoire%cAccording to Chambers English Dictionary, a grimoire is \"a magician's
 book for calling up spirits\".",
 {"spells","spells work"},
 "%n >how do spells work%cYour memory is still dream-hazed, but it's coming back. As a trained
 Enchanter, you have the ability to cast spells like \"frotz\", provided
 you have learned them in advance. Some of these spells can be cast
 at something; others can be cast alone.
 %c%cSpells are very complicated. Each time you cast one, you forget it
 (though you can get around this by learning it several times, so as
 to have several uses up your sleeve). The only way to hang on to
 a spell is to have it written down, on a scroll or in a spell book.
 Scrolls are not ideal for this, and you can only learn a spell from
 your spell book. (But you can add spells to your book.)
 %c%c[Type \"learn frotz\" and then \"frotz coin\" for an example. You can
 also type \"spells\" to see what you currently have memorised.]",
 "You can't see any such thing."
 )); @call(3529,"each_turn");
---
@succ #2378 = @tellroom(@location("%#"),"",@switch("%0", {"helistar","friend","my friend","colleague","my colleague","my friend helistar","my colleague helistar"}, "%n >who is Helistar%cHelistar is your colleague, an Enchanter like you who has been much on your mind lately. She has been investigating some very dark magic indeed, and seems not to be around any more. You feel rather vague about the details.", {"burin","magic burin","magical burin"}, "%n >what is a burin%cA burin is an engraving and writing tool.", {"change","great change","the change","the great change"}, "%n >what was the Great Change%cSomething you had a lot to do with, but what exactly? No, it's gone.", "cyclops", "%n >what is a cyclops%cA one-eyed giant, usually hostile. (Don't they teach anything at adventurer school these days?)", "grue", "%n >what is a grue%cThe grue is a sinister, lurking presence in the dark places of the earth. Its favorite diet is adventurers, but its insatiable appetite is tempered by its fear of light. No grue has ever been seen by the light of day, and few have survived its fearsome jaws to tell the tale.", "grimoire", "%n >what is a grimoire%cAccording to Chambers English Dictionary, a grimoire is \"a magician's book for calling up spirits\".", {"spells","spells work"}, "%n >how do spells work%cYour memory is still dream-hazed, but it's coming back. As a trained Enchanter, you have the ability to cast spells like \"frotz\", provided you have learned them in advance. Some of these spells can be cast at something; others can be cast alone.%c%cSpells are very complicated. Each time you cast one, you forget it (though you can get around this by learning it several times, so as to have several uses up your sleeve). The only way to hang on to a spell is to have it written down, on a scroll or in a spell book. Scrolls are not ideal for this, and you can only learn a spell from your spell book. (But you can add spells to your book.)%c%c[Type \"learn frotz\" and then \"frotz coin\" for an example. You can also type \"spells\" to see what you currently have memorised.]", "You can't see any such thing.")); @call(3529,"each_turn");
===

write (#3487)

@open write "*" on *;scribe "*" on *;write "*";scribe "*";write * on *;scribe * on *;write *;scribe *;write;scribe = nowhere
// featureless white cube;blank white cube;white cube;featureless cube;blank cube;cube
@set #3487 = puzzle
@succ #3487 =
 @s("nn","");
 @strloop("%0","x",@switch("%x",{" ","\""},"",
  @s("nn",@print(nn,"%x"))));
 @execute(@getfield(3529,"fn_calc_t2"));
 @tellroom(@location("%#"),"",@print("%n >write \"",nn,"\"",
  @switch("%1","","%c"," on %1%c"),
  @switch(1,
   @eq(nn,""),@print("What do you want to write?",@setfield(3529,"isturn",0)),
   @eq("%1",""),@print("What do you want to write on?",@setfield(3529,"isturn",0)),
   @eq(t2,"-1"),"You can't see any such thing.",
   @getfield(t2,"is_cube"),@switch(1,
    @not(@eq(@getfield(t2,"parent"),3529)),"Writing on a cube is such a fiddly process that you need to be holding it in your hand first.",
    @not(@eq(@getfield(2409,"parent"),3529)),"You would need some powerful implement for that.",
    @print(
     @setfield(t2,"article","the"),
     @setfield(t2,"name",@print(
      "\"",nn,"\" cube;",nn," cube;\"",
      nn,"\" white cube;",nn," white cube;white cube;cube"
     )),
     "It is now called the ",@shortname(t2),"."
    )
   ),
   @getfield(t2,"is_spellbook"),"If a burin could write in a spell book, you wouldn't need the gnusto spell!",
   @getfield(t2,"is_scroll"),"You cannot write just anything on the magic parchment of a scroll: you can only \"copy\" a spell to it.",
   "Graffiti is banned."
  )
 )); @call(3529,"each_turn");
---
TEST
@succ #3487 = @s("nn",""); @strloop("%0","x",@switch("%x",{" ","\""},"", @s("nn",@print(nn,"%x")))); @execute(@getfield(3529,"fn_calc_t2")); @tellroom(@location("%#"),"",@print("%n >write \"",nn,"\"", @switch("%1","","%c"," on %1%c"), @switch(1, @eq(nn,""),@print("What do you want to write?",@setfield(3529,"isturn",0)), @eq("%1",""),@print("What do you want to write that on?",@setfield(3529,"isturn",0)), @eq(t2,"-1"),"You can't see any such thing.", @getfield(t2,"is_cube"),@switch(1, @not(@eq(@getfield(t2,"parent"),3529)),"Writing on a cube is such a fiddly process that you need to be holding it in your hand first.", @not(@eq(@getfield(2409,"parent"),3529)),"You would need some powerful implement for that.", @print( @setfield(t2,"article","the"), @setfield(t2,"name",@print( "\"",nn,"\" cube;",nn," cube;\"", nn,"\" white cube;",nn," white cube;white cube;cube")),"It is now called the ",@shortname(t2),".")), @getfield(t2,"is_spellbook"),"If a burin could write in a spell book, you wouldn't need the gnusto spell!", @getfield(t2,"is_scroll"),"You cannot write just anything on the magic parchment of a scroll: you can only \"copy\" a spell to it.", "Graffiti is banned."))); @call(3529,"each_turn");
===

x (#5060)

@open x *;examine *;look at *;l at * = nowhere
@set #5060 = puzzle
@succ #5060 =
 @execute(@getfield(3529,"fn_calc_t1"));
 @tellroom(@location("%#"),"",@print("%n >x %0%c",@switch(1,
  @eq("%0",""),"What do you want to examine?",
  @eq(t1,"-1"),"You can't see any such thing.",
  @getfield(t1,"is_coin"),"A round unstamped disc, presumably part of the local currency.",
  @getfield(t1,"is_scroll"),@print(
   @s("sp",@getfield(t1,"child")),
   @setfield(t1,"is_general",1),
   @switch(1,@or(@eq(sp,""),@not(@getfield(sp,"is_spell"))),
   "The scroll has faded, and you cannot read it.",
   @print("The scroll reads \"",@shortname(sp),": ",
   @getfield(sp,"purpose"),"\"."))
  ),
  @getfield(t1,"is_spell"),@print(@shortname(t1),": ",@getfield(t1,"purpose")),
  @getfield(t1,"is_socket"),@print(
   @s("ch",@getfield(t1,"child")),"The ",@shortname(t1),
   ", cubical and slightly more than four inches on a side, is decorated with ",
   @getfield(t1,"desc"),
   @switch(ch,"","",@print(", and contains a ",@shortname(ch))),"."
  ),
  @eq(t1,3805),"It would be cheating to see what's written on the curled up tickets still in the board.",
  @getfield(t1,"is_ticket"),@switch(@getfield(t1,"number"),
   2306,"It is labelled \"First Prize\"!",
   5802,"It is labelled \"Nineteenth Prize\".",
   "\"You lose,\" says the ticket, with a smily face. \"Try again!\""
  ),
  @not(@eq(@getfield(t1,"desc"),"")),@call(t1,"desc"),
  @eq(@type(t1),3),@print("You see nothing special about the ",
   @switch(@shortname(t1),"up","ceiling.","down","floor.",
   "holodeck exit","holodeck exit.",@print(@shortname(t1)," wall."))
  ),
  @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"),
  @getfield(t1,"is_scenery"),@print("You see nothing special about the ",@shortname(@g("t1")),"."),
  @print("It looks like an ordinary ",@shortname(t1),".")
 ))); @call(3529,"each_turn");
---
@succ #5060 = @execute(@getfield(3529,"fn_calc_t1")); @tellroom(@location("%#"),"",@print("%n >x %0%c",@switch(1, @eq("%0",""),"What do you want to examine?", @eq(t1,"-1"),"You can't see any such thing.", @getfield(t1,"is_coin"),"A round unstamped disc, presumably part of the local currency.", @getfield(t1,"is_scroll"),@print( @s("sp",@getfield(t1,"child")), @setfield(t1,"is_general",1), @switch(1,@or(@eq(sp,""),@not(@getfield(sp,"is_spell"))), "The scroll has faded, and you cannot read it.", @print("The scroll reads \"",@shortname(sp),": ", @getfield(sp,"purpose"),"\"."))), @getfield(t1,"is_spell"),@print(@shortname(t1),": ",@getfield(t1,"purpose")), @getfield(t1,"is_socket"),@print( @s("ch",@getfield(t1,"child")),"The ",@shortname(t1), ", cubical and slightly more than four inches on a side, is decorated with ", @getfield(t1,"desc"), @switch(ch,"","",@print(", and contains a ",@shortname(ch))),"."), @eq(t1,3805),"It would be cheating to see what's written on the curled up tickets still in the board.", @getfield(t1,"is_ticket"),@switch(@getfield(t1,"number"), 2306,"It is labelled \"First Prize\"!", 5802,"It is labelled \"Nineteenth Prize\".", "\"You lose,\" says the ticket, with a smily face. \"Try again!\""), @not(@eq(@getfield(t1,"desc"),"")),@call(t1,"desc"), @eq(@type(t1),3),@print("You see nothing special about the ", @switch(@shortname(t1),"up","ceiling.","down","floor.", "holodeck exit","holodeck exit.",@print(@shortname(t1)," wall."))), @not(@eq(@getfield(t1,"on_before"),"")),@call(t1,"on_before"), @getfield(t1,"is_scenery"),@print("You see nothing special about the ",@shortname(@g("t1")),"."), @print("It looks like an ordinary ",@shortname(t1),".")))); @call(3529,"each_turn");
===

yomin (#3503)

@open yomin *;yomin = nowhere
@set #3503 = puzzle
@succ #3503 = @s("p0","%0"); @execute(@getfield(3529,"fn_calc_t1")); @call(3503,"cast"); @call(3529,"each_turn");
@field #3503 = cast :
 @tellroom(@location("%#"),"",@print("%n >yomin ",@g("p0"),"%c",
  @switch(1,@lt(@getfield(3134,"number"),1),
   "You haven't learned that spell, if indeed it is a spell.",
  @eq(@getfield(3134,"is_reversed"),""),
   @switch(1,
    @eq("%0",""),"That must be either vegetable or mineral.",
    @eq(@g("t1"),"-1"),"You can't see any such thing.",
    @not(@eq(@getfield(@g("t1"),"on_yomin"),"")),@execute(@getfield(@g("t1"),"on_yomin")),
    @not(@eq(@getfield(@g("t1"),"on_cast"),"")),@execute(@getfield(@g("t1"),"on_cast")),
    @eq(@getfield(@g("t1"),"is_animate"),""),"That must be either vegetable or mineral.",
    @eq(@g("t1"),3529),"You give yourself a mild headache.",
    @print(
     "You look into the rather ordinary thoughts of ",
     @switch(@getfield(@g("t1"),"is_proper"),"","the "),
     @shortname(@g("t1")),"."
   )),@switch(1,
    @eq("%0",""),"That must be either vegetable or mineral.",
    @eq(@g("t1"),"-1"),"You can't see any such thing.",
    @not(@eq(@getfield(@g("t1"),"on_nimoy"),"")),@execute(@getfield(@g("t1"),"on_nimoy")),
    @not(@eq(@getfield(@g("t1"),"on_cast"),"")),@execute(@getfield(@g("t1"),"on_cast")),
    @eq(@getfield(@g("t1"),"is_animate"),""),"That must be either vegetable or mineral.",
    @eq(@g("t1"),3529),"You give yourself a mild headache.",
    @print(
     @switch(@getfield(@g("t1"),"is_proper"),"","The "),
     @shortname(@g("t1"))," is rather shocked, for some reason."
    )
 ))));
 @switch(@getfield(3134,"number"),{0,100},"",@print(
  @setfield(3134,"number",@sub(@getfield(3134,"number"),1)),
  @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1)),
  @switch(@getfield(3134,"number"),0,@setfield(3134,"is_reversed",""))
 ));
---
TEST
@field #3503 = cast : @tellroom(@location("%#"),"",@print("%n >yomin ",@g("p0"),"%c", @switch(1,@lt(@getfield(3134,"number"),1), "You haven't learned that spell, if indeed it is a spell.", @eq(@getfield(3134,"is_reversed"),""), @switch(1,@eq("%0",""),"That must be either vegetable or mineral.", @eq(@g("t1"),"-1"),"You can't see any such thing.", @not(@eq(@getfield(@g("t1"),"on_yomin"),"")),@execute(@getfield(@g("t1"),"on_yomin")), @not(@eq(@getfield(@g("t1"),"on_cast"),"")),@execute(@getfield(@g("t1"),"on_cast")), @eq(@getfield(@g("t1"),"is_animate"),""),"That must be either vegetable or mineral.", @eq(@g("t1"),3529),"You give yourself a mild headache.", @print("You look into the rather ordinary thoughts of ", @switch(@getfield(@g("t1"),"is_proper"),"","the "), @shortname(@g("t1")),".")),@switch(1, @eq("%0",""),"That must be either vegetable or mineral.", @eq(@g("t1"),"-1"),"You can't see any such thing.", @not(@eq(@getfield(@g("t1"),"on_nimoy"),"")),@execute(@getfield(@g("t1"),"on_nimoy")), @not(@eq(@getfield(@g("t1"),"on_cast"),"")),@execute(@getfield(@g("t1"),"on_cast")), @eq(@getfield(@g("t1"),"is_animate"),""),"That must be either vegetable or mineral.", @eq(@g("t1"),3529),"You give yourself a mild headache.", @print( @switch(@getfield(@g("t1"),"is_proper"),"","The "), @shortname(@g("t1"))," is rather shocked, for some reason."))))); @switch(@getfield(3134,"number"),{0,100},"",@print(@setfield(3134,"number",@sub(@getfield(3134,"number"),1)), @setfield(3529,"number_known",@sub(@getfield(3529,"number_known"),1)),@switch(@getfield(3134,"number"),0,@setfield(3134,"is_reversed",""))));
===

Offstage (#2651)

This room is reserved for things not yet in play, or destroyed.

@dig Offstage
@desc #2651 = Part of the "Balances" game. This room is reserved for things not yet in play, or destroyed.
@zone #2651 = #2361
@field #2651 = obj_h_box : 2364
@field #2651 = obj_helistars_book : 2365
@field #2651 = obj_lleps : 3520
@field #2651 = obj_mortin : 3528
@field #2651 = obj_shiny_scroll : 2371
@field #2651 = obj_bozbar : 3542
@field #2651 = obj_chewed_scroll : 3550
@field #2651 = obj_torn_scroll : 3717
@field #2651 = obj_lobal : 3548
@field #2651 = obj_feather : 3149
@field #2651 = obj_caskly : 3547
@field #2651 = obj_cyclops : 3718
@field #2651 = obj_mace : 3721
@field #2651 = obj_eye_cube : 3722
@field #2651 = obj_podium : 3882
@field #2651 = obj_square : 3897
@field #2651 = obj_blsocket : 3901
@field #2651 = obj_tlsocket : 3915
@field #2651 = obj_brsocket : 3919
@field #2651 = obj_trsocket : 3926
@field #2651 = obj_elephant : 3723
@field #2651 = obj_barker_cube : 3724
@field #2651 = obj_ticket2306 : 3927
@field #2651 = obj_ticket5802 : 3940
@field #2651 = obj_ticketbad : 3952
@field #2651 = reset :
@field #2651 = metareset :
 @setfield(2651,"reset","");
 @fieldloop(2651,"obj_",@setfield(2651,"reset",@print(
  @getfield(2651,"reset"),@getfield("%v","reset")
 )));
---
@field #2651 = metareset : @setfield(2651,"reset",""); @fieldloop(2651,"obj_",@setfield(2651,"reset",@print(@getfield(2651,"reset"),@getfield("%v","reset"))));
===

cedarwood box (#2364) - aka h_box

@create cedarwood box;cedar box;wooden box;box
@link #2364 = #2651
@zone #2364 = #2361
@lock #2364 = #-1
@set #2364 = dark
@field #2364 = desc : The box bears the calligraphed initial H.
@field #2364 = is_container : 1
@field #2364 = is_openable : 1
@field #2364 = is_lockable : 1
@field #2364 = is_locked : 1
@field #2364 = ncontents : 1
@field #2364 = reset : @move(2364,2651); @setfield(2364,"is_locked",1);
 @setfield(2364,"parent",2651); @setfield(2364,"child",2365);
 @setfield(2364,"is_open",""); @setfield(2364,"ncontents",1);
---
@field #2364 = reset : @move(2364,2651); @setfield(2364,"is_locked",1); @setfield(2364,"parent",2651); @setfield(2364,"child",2365); @setfield(2364,"is_open",""); @setfield(2364,"ncontents",1);
===

Helistar's grimoire (#2365") - aka helistars_book

@create Helistar's grimoire;helistars grimoire;grimoire
@link #2365 = #2651
@zone #2365 = #2361
@lock #2365 = #-1
@set #2365 = dark
@field #2365 = spell_list : BEF
@field #2365 = desc :
 @print("This must be the grimoire of dangerous spells kept by your
 irresponsible friend Helistar. Many pages are missing, but a few
 spells remain:%c");
 @strloop(@g("spell_list"),"x",@print(
  "%c",@setfield(3529,"the_spellcode","%x"),
  @call(3529,"fn_calc_the_spell"),
  @call(3529,"fn_desc_the_spell")
 ));
---
@field #2365 = desc : @print("This must be the grimoire of dangerous spells kept by your irresponsible friend Helistar. Many pages are missing, but a few spells remain:%c"); @strloop(@g("spell_list"),"x",@print("%c",@setfield(3529,"the_spellcode","%x"), @call(3529,"fn_calc_the_spell"), @call(3529,"fn_desc_the_spell")));
===
@field #2365 = is_proper : 1
@field #2365 = is_spellbook : 1
@field #2365 = reset : @move(2365,2651);
 @setfield(2365,"parent",2364); @setfield(2365,"spell_list","BEF");
---
@field #2365 = reset : @move(2365,2651); @setfield(2365,"parent",2364); @setfield(2365,"spell_list","BEF");
===
@field #2365 = on_open : @execute(@getfield(3529,"fn_open_spellbook"));
@field #2365 = on_close : @execute(@getfield(3529,"fn_open_spellbook"));
@field #2365 = on_attack : @execute(@getfield(3529,"fn_attack_spellbook"));

lleps spell (#3520)

// lleps is found in Helistar's grimoire
// note: lleps command is #3411
@create lleps spell;lleps
@zone #3520 = #2361
@link #3520 = #2651
@lock #3520 = #-1
@set #3520 = dark
@field #3520 = is_spell : 1
@field #3520 = the_spellcode : E
@field #3520 = sname : lleps
@field #3520 = article : the
@field #3520 = number : 0
@field #3520 = parent : 2365
@field #3520 = purpose : reverse effect of memorised spell
@field #3520 = reset : @move(3520,2651); @setfield(3520,"parent",2365);
 @setfield(3520,"number",0); @setfield(3520,"is_known","");
 @setfield(3520,"is_reversed","");
---
@field #3520 = reset : @move(3520,2651); @setfield(3520,"parent",2365); @setfield(3520,"number",0); @setfield(3520,"is_known",""); @setfield(3520,"is_reversed","");
===

mortin spell (#3528)

// mortin is found in Helistar's grimoire
@create mortin spell;mortin
@zone #3528 = #2361
@lock #3528 = #-1
@link #3528 = #2651
@set #3528 = dark
@field #3528 = is_spell : 1
@field #3528 = the_spellcode : F
@field #3528 = article : the
@field #3528 = number : 0
@field #3528 = parent : 2365
@field #3528 = sname : mortin
@field #3528 = purpose : cause immediate death of caster
@field #3528 = reset : @move(3528,2651); @setfield(3528,"parent",2365);
 @setfield(3528,"number",0); @setfield(3528,"is_known","");
 @setfield(3528,"is_reversed","");
---
@field #3528 = reset : @move(3528,2651); @setfield(3528,"parent",2365); @setfield(3528,"number",0); @setfield(3528,"is_known",""); @setfield(3528,"is_reversed","");
===

shiny scroll (#2371)

You find this scroll when you x/search the oats. It has the bozbar spell on it.

@create shiny scroll;scroll
@link #2371 = #2651
@zone #2371 = #2361
@lock #2371 = #-1
@set #2371 = dark
@field #2371 = is_scroll : 1
@field #2371 = reset : @move(2371,2651); @setfield(2371,"parent",2351); @setfield(2371,"child",3542); @setfield(2371,"is_general","");
@field #2371 = parent : 2351
@field #2371 = child : 3542

bozbar spell (#3542)

//Spell -> bozbar_spell (on shiny scroll (#2371)
@create bozbar spell;bozbar
@zone #3542 = #2361
@link #3542 = #2651
@lock #3542 = #-1
@set #3542 = dark
@field #3542 = purpose : cause an animal to sprout wings
@field #3542 = is_spell : 1
@field #3542 = the_spellcode : G
@field #3542 = sname : bozbar
@field #3542 = parent : 2371
@field #3542 = article : the
@field #3542 = number : 0
@field #3542 = reset : @move(3542,2651); @setfield(3542,"parent",2371);
 @setfield(3542,"number",0); @setfield(3542,"is_known","");
 @setfield(3542,"is_reversed","");
---
@field #3542 = reset : @move(3542,2651); @setfield(3542,"parent",2371); @setfield(3542,"number",0); @setfield(3542,"is_known",""); @setfield(3542,"is_reversed","");
===

chewed scroll (#3550)

The chewed scroll is dropped when the tortoise gets wings.

@create chewed scroll;scroll
@zone #3550 = #2361
@lock #3550 = #-1
@link #3550 = #2651
@set #3550 = dark
@field #3550 = is_scroll : 1
@field #3550 = parent : 2651
@field #3550 = reset : @move(3550,2651); @setfield(3550,"parent",2651); @setfield(3550,"is_general",""); @setfield(3550,"is_moved","");
@field #3550 = initial : It looks as if the tortoise was eating something - once it might have been a scroll, but now it lies there, chewed up like a lettuce leaf.
@field #3550 = on_eat : "Eating your words" is notoriously dangerous for a wizard. Rearranged in the stomach, a spell might do anything!
@field #3550 = on_caskly :
 @move(3717,2376); @setfield(3717,"parent",@getfield(3550,"parent"));
 @move(3548,2376);
 @move(3550,2651); @setfield(3550,"parent",2651);
 @setfield(3529,"score",@add(5,@getfield(3529,"score")));
 @print("Before your eyes, the scroll begins to repair itself, failing only at the very last tear. Not quite perfect perhaps, but certainly a readable, if torn scroll.%c%c[Your score has just gone up by five points.]");
---
@field #3550 = on_caskly : @move(3717,2376); @setfield(3717,"parent",@getfield(3550,"parent")); @move(3548,2376); @move(3550,2651); @setfield(3550,"parent",2651); @setfield(3529,"score",@add(5,@getfield(3529,"score"))); @print("Before your eyes, the scroll begins to repair itself, failing only at the very last tear. Not quite perfect perhaps, but certainly a readable, if torn scroll.%c%c[Your score has just gone up by five points.]");
===

torn scroll (#3717)

The torn scroll replaces the chewed scroll when caskly is cast on the latter.

@create torn scroll;scroll
@lock #3717 = #-1
@link #3717 = #2651
@zone #3717 = #2361
@set #3717 = dark
@field #3717 = is_scroll : 1
@field #3717 = parent : 2651
@field #3717 = child : 3548
@field #3717 = reset : @move(3717,2651); @setfield(3717,"parent",2651); @setfield(3717,"child",3548); @setfield(3717,"is_general","");

lobal spell (#3548)

@create lobal spell;lobal
@zone #3548 = #2361
@link #3548 = #2651
@lock #3548 = #-1
@set #3548 = dark
@field #3548 = is_spell : 1
@field #3548 = the_spellcode : I
@field #3548 = sname : lobal
@field #3548 = article : the
@field #3548 = number : 0
@field #3548 = parent: 3717
@field #3548 = purpose : sharpen hearing
@field #3548 = reset : @move(3548,2651); @setfield(3548,"parent",3717);
 @setfield(3548,"number",0); @setfield(3548,"is_known","");
 @setfield(3548,"is_reversed","");
---
@field #3548 = reset : @move(3548,2651); @setfield(3548,"parent",3717); @setfield(3548,"number",0); @setfield(3548,"is_known",""); @setfield(3548,"is_reversed","");
===

tortoise feather (#3149)

@create tortoise feather;feather
@link #3149 = #2651
@zone #3149 = #2361
@lock #3149 = #-1
@set #3149 = dark
@field #3149 = reset : @move(3149,2651);
@field #3149 = desc : Possibly your rarest, and also least valuable, possession.

caskly spell (#3547)

// caskly is learned/gained when one examines the sapphire
@create caskly spell;caskly
@zone #3547 = #2361
@link #3547 = #2651
@lock #3547 = #-1
@set #3547 = dark
@field #3547 = is_spell : 1
@field #3547 = the_spellcode : H
@field #3547 = sname : caskly
@field #3547 = purpose : cause perfection
@field #3547 = parent : 2651
@field #3547 = number : 0
@field #3547 = article : the
@field #3547 = reset : @move(3547,2651); @setfield(3547,"parent",2651);
 @setfield(3547,"number",0); @setfield(3547,"is_known","");
 @setfield(3547,"is_reversed","");
---
@field #3547 = reset : @move(3547,2651); @setfield(3547,"parent",2651); @setfield(3547,"number",0); @setfield(3547,"is_known",""); @setfield(3547,"is_reversed","");
===

cyclops (#3718)

The cyclops appears when you first cast reversed-urbzig successfully.

@create buck-toothed cyclops;buck toothed cyclops;toothed cyclops;cyclops
@zone #3718 = #2361
@link #3718 = #2651
@lock #3718 = #-1
@set #3718 = dark
@field #3718 = reset : @move(3718,2651); @setfield(3718,"parent",2651);
 @setfield(3718,"child",3721); @setfield(3718,"is_general","");
 @setfield(3718,"timer",0);
---
@field #3718 = reset : @move(3718,2651); @setfield(3718,"parent",2651); @setfield(3718,"child",3721); @setfield(3718,"is_general",""); @setfield(3718,"timer",0);
===
@field #3718 = initial : A huge buck-toothed cyclops menaces you, armed with a heavy mace!
@field #3718 = life : He roars incoherently, swinging the mace!
@field #3718 = timer : 0
@field #3718 = on_bozbar : Does the term "death wish" mean anything to you?
@field #3718 = on_urbzig : The cyclops bellows with glee as your spell has no effect. (After all, he wouldn't be "dangerous" if an urbzig spell worked on him, would he?)
@field #3718 = is_animate : 1
@field #3718 = parent : 2651
@field #3718 = child : 3721
@field #3718 = each_turn : @switch(@rand(4),
 1,"%cThe cyclops leaps and bellows!",
 2,"%cWhirling the mace, the cyclops jabbers at you incoherently.",
 3,"%cThe cyclops is losing patience (the appropriate cyclops
 word is untranslatable into English, but approximately means
 \"forbearance in not smashing all nearby skulls\").",
 "%cThe cyclops jabs you with the mace, almost breaking your rib.");
---
@field #3718 = each_turn : @switch(@rand(4), 1,"%cThe cyclops leaps and bellows!", 2,"%cWhirling the mace, the cyclops jabbers at you incoherently.", 3,"%cThe cyclops is losing patience (the appropriate cyclops word is untranslatable into English, but approximately means \"forbearance in not smashing all nearby skulls\").", "%cThe cyclops jabs you with the mace, almost breaking your rib.");
===
       time_out
       [;  if (self notin location)
           {   remove self; rtrue;
           }
           deadflag = true; remove mace; remove cyclops;
           "Feeling that he's given you quite long enough to explain why
            you made such a mess of his life, he swings the great mace
            maniacally down on you!";
       ],

mace (#3721)

// The mace appears at the same time the cyclops does.
// The mace is initially held by the cyclops.
@create mace;axe;heavy mace;heavy axe
@zone #3721 = #2361
@link #3721 = #2651
@lock #3721= #-1
@set #3721 = dark
@field #3721 = parent : 3718
@field #3721 = desc : It looks much too heavy for you to even lift.
@field #3721 = reset : @move(3721,2651); @setfield(3721,"parent",3718);
// The eye cube appears when you urbzig the mace.

eye cube (#3722)

@create featureless white cube;blank white cube;white cube;featureless cube;blank cube;cube
@zone #3722 = #2361
@link #3722 = #2651
@lock #3722 = #-1
@set #3722 = dark
@field #3722 = is_cube : 1
@field #3722 = parent : 2651
@field #3722 = name_1 : featureless white cube;blank white cube;white cube;featureless cube;blank cube;cube
@field #3722 = initial : A featureless white cube lies where the cyclops dropped it.
@field #3722 = reset : @move(3722,2651); @setfield(3722,"parent",2651); @setfield(3722,"article",""); @setfield(3722,"name",@getfield(3722,"name_1")); @setfield(3722,"is_moved","");
@field #3722 = on_take_after :
 @switch(@getfield(3722,"is_moved"),"",@print(
  @setfield(3529,"score",@add(5,@getfield(3529,"score"))),
  "%c%c[Your score has just gone up by five points.]"
 ));
---
@field #3722 = on_take_after : @switch(@getfield(3722,"is_moved"),"",@print( @setfield(3529,"score",@add(5,@getfield(3529,"score"))),"%c%c[Your score has just gone up by five points.]"));
===

cuddly toy elephant (#3723)

@create cuddly toy elephant;cuddly elephant;toy elephant;toy;elephant
@lock #3723 = #-1
@zone #3723 = #2361
@link #3723 = #2651
@set #3723 = dark
@field #3723 = reset : @move(3723,2651);
@field #3723 = desc : Pink, cuddly, toy, elephant. Says it all, really.
@field #3723 = on_bozbar : Let me get this straight. You, the enchanter who defeated Krill, the head of the Borphee Guild himself... are attempting to grow wings on a pink cuddly elephant?
@field #3723 = on_yomin : Woolly.

barker cube (#3724)

@create featureless white cube;blank white cube;white cube;featureless cube;blank cube;cube
@zone #3724 = #2361
@link #3724 = #2651
@lock #3724 = #-1
@set #3724 = dark
@field #3724 = is_cube : 1
@field #3724 = parent : 2651
@field #3724 = reset : @move(3724,2651); @setfield(3724,"parent",2651); @setfield(3724,"article",""); @setfield(3724,"name",@getfield(3722,"name_1"));

podium (#3882)

@create podium;pedestal;platform;cubical podium;cubical pedestal;cubical platform
@zone #3882 = #2361
@link #3882 = #2651
@lock #3882 = #-1
@set #3882 = dark
@field #3882 = desc : As predicted, it is cubical.
@field #3882 = initial : Far below the scales, in the centre of the "floor", is a predictably-shaped podium. Set into it are four sockets, arranged in a two by two square.
@field #3882 = is_static : 1
@field #3882 = is_supporter : 1
@field #3882 = reset : @move(3882,2651); @setfield(3882,"parent",2651);

two by two square (#3897)

@create two by two square;square
@zone #3897 = #2361
@link #3897 = #2651
@lock #3897 = #-1
@set #3897 = dark
@field #3897 = is_static : 1
@field #3897 = reset : @move(3897,2651);
@field #3897 = desc : You'll have to say which socket you mean. (Let's call them "top left", "bottom right" and so on.)
       before
       [ i;  if (action~=##Examine || number_filled==0)
              "You'll have to say which socket you mean. 
               (Let's call them ~top left~, ~bottom right~ and so on.)";
           objectloop (i in self)
           {   print (The) i;
               if (child(i)==0) print " is empty.^";
               else { print " contains ", (a) child(i), ".^"; }
           }
           rtrue;
       ],
Class Socket
           Receive: if (~~(noun ofclass FeaturelessCube))
                       "The socket rejects that.";
                    if (child(self) ~= nothing)
                       "There is already a cube in that socket.";
       ],
       after
       [;  LetGo:  number_filled--;
                   "With much struggle, you manage to pull the cube away.";
           Receive2: number_filled++;
           if (number_filled==4)
           {   if (snakes_cube in bl_socket
                   && barker_cube in ul_socket
                   && cave_cube in br_socket
                   && eye_cube in ur_socket)
               {   deadflag=2; score=score+5;
                  "As you place the final cube into the sockets, you feel
                   imbued with celestial wisdom (more so than usually). 
                   You find yourself growing to the height of the cube, so
                   that you pull the balances back level by hand, and then
                   you grow still further, out of the temple until it is but
                   a cube in your hand, and you are a giant towering over
                   the land.
                 ^^Then, of course, you wake up, glumly realising it's time
                   to go to your job at the new Borphee Laboratories and
                   all those Wheatstone bridge experiments.  But at least
                   you can dream about the old days.";
               }
              "The sockets are all full now, but that doesn't mean
               anything's happened.";
           }
          "The cube is a predictably perfect fit in the socket.";
       ],

bottom left socket (#3901)

@create bottom left socket;bottom left serpent socket;bottom left serpent;bottom left;bottom socket;left socket;serpent socket;serpent;socket
@lock #3901 = #-1
@zone #3901 = #2361
@link #3901 = #2651
@set #3901 = dark
@field #3901 = reset : @move(3901,2651);
@field #3901 = parent : 3882
@field #3901 = is_socket : 1
@field #3901 = is_static : 1
@field #3901 = is_container : 1
@field #3901 = is_open : 1
@field #3901 = article : the
@field #3901 = desc : a serpent
@field #3901 = on_cast : The sockets are proof against magic.
@field #3901 = on_letgo :
 @print(
  @setfield(3529,"number_filled",@sub(@getfield(3529,"number_filled"),1)),
  @setfield(@getfield(3901,"child"),"parent",3529),
  @setfield(3901,"child",""),
  "With much struggle, you manage to pull the cube away."
 );
---
TEST
@field #3901 = on_letgo : @print( @setfield(3529,"number_filled",@sub(@getfield(3529,"number_filled"),1)), @setfield(@getfield(3901,"child"),"parent",3529), @setfield(3901,"child",""), "With much struggle, you manage to pull the cube away.");
===

top left socket (#3915)

@create top left socket;top left bazaar socket;top left bazaar;top left;top socket;left socket;bazaar socket;bazaar;socket
@lock #3915 = #-1
@zone #3915 = #2361
@link #3915 = #2651
@set #3915 = dark
@field #3915 = reset : @move(3915,2651);
@field #3915 = parent : 3882
@field #3915 = is_socket : 1
@field #3915 = is_static : 1
@field #3915 = is_container : 1
@field #3915 = is_open : 1
@field #3915 = article : the
@field #3915 = desc : a scene in a bazaar
@field #3915 = on_cast : The sockets are proof against magic.
@field #3915 = on_letgo :
 @print(
  @setfield(3529,"number_filled",@sub(@getfield(3529,"number_filled"),1)),
  @setfield(@getfield(3915,"child"),"parent",3529),
  @setfield(3915,"child",""),
  "With much struggle, you manage to pull the cube away."
 );
---
TEST
@field #3915 = on_letgo : @print( @setfield(3529,"number_filled",@sub(@getfield(3529,"number_filled"),1)), @setfield(@getfield(3915,"child"),"parent",3529), @setfield(3915,"child",""), "With much struggle, you manage to pull the cube away.");
===

bottom right socket (#3919)

@create bottom right socket;bottom right cave socket;bottom right cave;bottom right;bottom socket;right socket;cave socket;cave;socket
@lock #3919 = #-1
@zone #3919 = #2361
@link #3919 = #2651
@set #3919 = dark
@field #3919 = reset : @move(3919,2651);
@field #3919 = parent : 3882
@field #3919 = is_socket : 1
@field #3919 = is_static : 1
@field #3919 = is_container : 1
@field #3919 = is_open : 1
@field #3919 = article : the
@field #3919 = desc : an engraving of a rocky cave
@field #3919 = on_cast : The sockets are proof against magic.
@field #3919 = on_letgo :
 @print(
  @setfield(3529,"number_filled",@sub(@getfield(3529,"number_filled"),1)),
  @setfield(@getfield(3919,"child"),"parent",3529),
  @setfield(3919,"child",""),
  "With much struggle, you manage to pull the cube away."
 );
---
TEST
@field #3919 = on_letgo : @print( @setfield(3529,"number_filled",@sub(@getfield(3529,"number_filled"),1)), @setfield(@getfield(3919,"child"),"parent",3529), @setfield(3919,"child",""), "With much struggle, you manage to pull the cube away.");
===

top right socket (#3926)

@create top right socket;top right eye socket;top right eye;top right;top socket;right socket;eye socket;eye;socket
@lock #3926 = #-1
@zone #3926 = #2361
@link #3926 = #2651
@set #3926 = dark
@field #3926 = reset : @move(3926,2651);
@field #3926 = parent : 3882
@field #3926 = is_socket : 1
@field #3926 = is_static : 1
@field #3926 = is_container : 1
@field #3926 = is_open : 1
@field #3926 = article : the
@field #3926 = desc : an eye
@field #3926 = on_cast : The sockets are proof against magic.
@field #3926 = on_letgo :
 @print(
  @setfield(3529,"number_filled",@sub(@getfield(3529,"number_filled"),1)),
  @setfield(@getfield(3926,"child"),"parent",3529),
  @setfield(3926,"child",""),
  "With much struggle, you manage to pull the cube away."
 );
---
TEST
@field #3926 = on_letgo : @print( @setfield(3529,"number_filled",@sub(@getfield(3529,"number_filled"),1)), @setfield(@getfield(3926,"child"),"parent",3529), @setfield(3926,"child",""), "With much struggle, you manage to pull the cube away.");
===

ticket 2306 (#3927)

@create lottery ticket 2306;ticket 2306
@zone #3927 = #2361
@link #3927 = #2651
@lock #3927 = #-1
@set #3927 = dark
@field #3927 = reset : @move(3927,2651);
@field #3927 = is_ticket : 1
@field #3927 = number : 2306

ticket 5802 (#3940)

@create lottery ticket 5802;ticket 5802
@zone #3940 = #2361
@link #3940 = #2651
@lock #3940 = #-1
@set #3940 = dark
@field #3940 = reset : @move(3940,2651);
@field #3940 = is_ticket : 1
@field #3940 = number : 5802

losing ticket (#3952)

@create lottery ticket;ticket @zone #3952 = #2361 @link #3952 = #2651 @lock #3952 = #-1 @set #3952 = dark @field #3952 = reset : @move(3952,2651); @field #3952 = is_ticket : 1 @field #3952 = number : 1

Edifice Towers - First Floor (center hall) (#2541)

1008 (dbref #199)

@open 1008 = #2550
@succe #199 = You open the door to #1008, and walk in.
@osucc #199 = opens the door to #1008, and walks in.
@desc #199 = The plaque on the door to #1008 reads: "DavidW's Holodeck".
@odrop #199 = enters the apartment from the hallway.

Holodeck Antechamber (#2550)

@dig Holodeck Antechamber
@desc #2550 = A small waiting area outside the Holodeck.

south (#2552) - from Antechamber to Edifice Towers

@open south;s;exit;out;o;front door;white door;wooden door;door = #2541
@field #2552 = exitto : to Edifice Towers
@odrop #2552 = enters the hallway from apartment #1008.
@succ #2552 = You open the door to the hallway, and walk out.
@osucc #2552 = opens the door to the hallway, and walks out.
@desc #2552 = The front door of the apartment is just a simple white wooden door.

north (#2590) - from Antechamber to True Holodeck

@open north;n;enter;enter holodeck;in;holodeck door;enter door = #2376
@field #2590 = exitto : to Holodeck
@lock #2590 = me
@fail #2590 = Unfortunately, the door into the Holodeck won't open.
@ofail #2590 = discovers that the door into the Holodeck won't open.
@odrop #2590 = enters the Holodeck.
@succ #2590 = The Holodeck door opens and closes automatically as you enter.
@osucc #2590 = enters the Holodeck, whose door opens and closes automatically to let %o pass through.
@desc #2590 = The door into the Holodeck proper is a large metal sliding door in the north wall. The door is closed.

True Holodeck (#2376)

@dig "Balances" Holodeck
@zone #2376 = #2361
// Which room is the Holodeck mimicking?
@field #2376 = the_room : 2400
@desc #2376 =
 // Part 1: Basic room description
 @call(@getfield(2376,"the_room"),"description");
 // Part 2: The "describe" lines.
 @s("also",0);
 @contentsloop(@location("%#"),"x",@print(
  @switch(1,@not(@eq(@getfield("%x","describe"),"")),
   @print("%c",@call("%x","describe"),@s("also",1))
 )));
 // Part 3: The "initial" lines.
 @contentsloop(@location("%#"),"x",@print(
  @switch(1,@and(
   @not(@eq(@getfield("%x","initial"),"")),
   @eq(@getfield("%x","is_moved"),"")
   ),@print("%c%c",@getfield("%x","initial"),@s("also",1))
 )));
 // Part 4a: The "You can see xxx here." line. (prelim)
 @s("nhere",0);
 @contentsloop(@location("%#"),"x",@switch(1,@and(
  @eq(@type("%x"),4),
  @eq(@getfield("%x","parent"),@getfield(@location("%#"),"the_room")),
  @eq(@getfield("%x","is_static"),""),
  @eq(@getfield("%x","is_scenery"),""),
  @eq(@getfield("%x","describe"),""),
  @not(@and( @not(@eq(@getfield("%x","initial"),"")),@eq(@getfield("%x","is_moved"),"") ))
 ),@print(
  @s("nhere",@add(1,@g("nhere"))),
  @setfield("%x","is_workflag",1)
 ),@setfield("%x","is_workflag","")
 ));
 // Part 4b: The "You can see xxx here." line. (actual)
 @switch(@g("nhere"),0,"",@print(
  "%c%cYou can ",@switch(@g("also"),1,"also "),"see", @s("i",1),
  @contentsloop(@location("%#"),"x",@switch(1,@getfield("%x","is_workflag"),@print(
   @switch(@g("i"),1," ",@g("nhere")," and ",", "),
   @switch(1,@getfield("%x","is_proper"),"",
    @eq(@getfield("%x","article"),""),"a ",
    @print(@getfield("%x","article")," ")),
   @shortname("%x"),
   @s("i",@add(1,@g("i")))
  )))," here."
 ));
---
TEST
@desc #2376 = @call(@getfield(2376,"the_room"),"description"); @s("also",0); @contentsloop(@location("%#"),"x",@print( @switch(1,@not(@eq(@getfield("%x","describe"),"")), @print("%c",@call("%x","describe"),@s("also",1))))); @contentsloop(@location("%#"),"x",@print( @switch(1,@and( @not(@eq(@getfield("%x","initial"),"")), @eq(@getfield("%x","is_moved"),"")),@print("%c%c",@getfield("%x","initial"),@s("also",1))))); @s("nhere",0); @contentsloop(@location("%#"),"x",@switch(1,@and( @eq(@type("%x"),4), @eq(@getfield("%x","parent"),@getfield(@location("%#"),"the_room")), @eq(@getfield("%x","is_static"),""), @eq(@getfield("%x","is_scenery"),""), @eq(@getfield("%x","describe"),""), @not(@and( @not(@eq(@getfield("%x","initial"),"")),@eq(@getfield("%x","is_moved"),"")))),@print(@s("nhere",@add(1,@g("nhere"))), @setfield("%x","is_workflag",1)),@setfield("%x","is_workflag",""))); @switch(@g("nhere"),0,"",@print( "%c%cYou can ",@switch(@g("also"),1,"also "),"see", @s("i",1), @contentsloop(@location("%#"),"x",@switch(1,@getfield("%x","is_workflag"),@print( @switch(@g("i"),1," ",@g("nhere")," and ",", "), @switch(1,@getfield("%x","is_proper"),"", @eq(@getfield("%x","article"),""),"a ", @print(@getfield("%x","article")," ")), @shortname("%x"), @s("i",@add(1,@g("i"))))))," here."));
===

// reset and metareset
@field #2376 = obj_player : 3529
@field #2376 = obj_junk : 2316
@field #2376 = obj_enter : 2411
@field #2376 = obj_spellbook : 2391
@field #2376 = obj_players_coin : 2393
@field #2376 = obj_burin : 2409
@field #2376 = obj_gnusto_spell : 3181
@field #2376 = obj_frotz_spell : 3016
@field #2376 = obj_yomin_spell : 3134
@field #2376 = obj_rezrov_spell : 3130
@field #2376 = reset :
@field #2376 = metareset :
 @setfield(2376,"reset","");
 @fieldloop(2376,"obj_",@setfield(2376,"reset",@print(
  @getfield(2376,"reset"),@getfield("%v","reset")
 )));
---
@field #2376 = metareset : @setfield(2376,"reset",""); @fieldloop(2376,"obj_",@setfield(2376,"reset",@print( @getfield(2376,"reset"),@getfield("%v","reset"))));
===

// move out exits and objects that don't follow with the players
// move all exits except holodeck exit (#2377)
// move all things except held by player and junk (#2316)
// @setfield(2376,"description",@getfield(@getfield("%!","action2"),"description"));
@field #2376 = fn_move :
 @contentsloop(2376,"x",@switch(1,@or(
  @and(@eq(@type("%x"),3),@not(@eq("%x",2377))),
  @and(@eq(@type("%x"),4),@not(@eq("%x",2316)),@not(@eq("%x",3529)),
   @not(@eq(@getfield("%x","parent"),3529)),
   @not(@eq(@getfield("%x","parent"),2316)),
   @not(@eq(@getfield(@getfield("%x","parent"),"parent"),3529)),
   @not(@eq(@getfield(@getfield(@getfield("%x","parent"),"parent"),"parent"),3529)))
  ),@move("%x",@getfield(2376,"the_room"))
 ));
 @setfield(2376,"name",@getfield(@getfield("%!","action2"),"name"));
 @setfield(2376,"cant_go",@getfield(@getfield("%!","action2"),"cant_go"));
 @setfield(2376,"the_room",@getfield("%!","action2"));
 @setfield(2316,"name",@strcheck(@getfield(@getfield(2376,"the_room"),"ignore_names"),"_junk"));
 @switch(@getfield(3529,"parent"),3614,
  @setfield(2376,"name",@print(@getfield(2376,"name"),
   " (on the beautiful red carpet)")),
  @setfield(3529,"parent",@getfield(2376,"the_room")));
 @setfield(2316,"parent",@getfield(2376,"the_room"));
 @contentsloop(@getfield("%!","action2"),"x",@move("%x",2376));
---
@field #2376 = fn_move : @contentsloop(2376,"x",@switch(1,@or( @and(@eq(@type("%x"),3),@not(@eq("%x",2377))), @and(@eq(@type("%x"),4),@not(@eq("%x",2316)),@not(@eq("%x",3529)), @not(@eq(@getfield("%x","parent"),3529)), @not(@eq(@getfield("%x","parent"),2316)), @not(@eq(@getfield(@getfield("%x","parent"),"parent"),3529)), @not(@eq(@getfield(@getfield(@getfield("%x","parent"),"parent"),"parent"),3529)))),@move("%x",@getfield(2376,"the_room")))); @setfield(2376,"name",@getfield(@getfield("%!","action2"),"name")); @setfield(2376,"cant_go",@getfield(@getfield("%!","action2"),"cant_go")); @setfield(2376,"the_room",@getfield("%!","action2")); @setfield(2316,"name",@strcheck(@getfield(@getfield(2376,"the_room"),"ignore_names"),"_junk")); @switch(@getfield(3529,"parent"),3614, @setfield(2376,"name",@print(@getfield(2376,"name"), " (on the beautiful red carpet)")), @setfield(3529,"parent",@getfield(2376,"the_room"))); @setfield(2316,"parent",@getfield(2376,"the_room")); @contentsloop(@getfield("%!","action2"),"x",@move("%x",2376));
===
@field #2376 = fn_look :
 @print("%c",@getfield(2376,"name"),"%c",@call(2376,"description"),
  "%c%cVisible Exits:",@substr(@contentsloop(@location("%#"),"x",
  @switch(@type("%x"),3,@print(", ",@shortname("%x")))),1));
---
@field #2376 = fn_look : @print("%c",@getfield(2376,"name"),"%c",@call(2376,"description"), "%c%cVisible Exits:",@substr(@contentsloop(@location("%#"),"x", @switch(@type("%x"),3,@print(", ",@shortname("%x")))),1));
===
@field #2376 = fn_moveplayers :
 @execute(@getfield(2376,"fn_move"));
 @tellroom(@location("%#"),"",@execute(@getfield(2376,"fn_look")));
---
@field #2376 = fn_moveplayers : @execute(@getfield(2376,"fn_move")); @tellroom(@location("%#"),"",@execute(@getfield(2376,"fn_look")));
===
@field #2376 = fn_moveplayers2 :
 @execute(@getfield(2376,"fn_move"));
 @execute(@getfield(2376,"fn_look"));
---
@field #2376 = fn_moveplayers2 : @execute(@getfield(2376,"fn_move")); @execute(@getfield(2376,"fn_look"));
===

holodeck exit (#2377) - from True Holodeck to Antechamber

@open holodeck exit = #2550
@odrop #2377 = comes out of the Holodeck, its door opening and closing automatically.
@succ #2377 = The Holodeck door opens and closes automatically as you exit.
@osucc #2377 = leaves the Holodeck. As the door opens and closes automatically to let %o pass through, you get a brief glimpse of the Antechamber that lies beyond.
@desc #2377 = From this side, the closed Holodeck door appears to be no more than a wire-thin outline of a door against the backdrop of your current apparent location.

player (dbref #3529)

@create player;pc;myself
@zone #3529 = #2361
@link #3529 = #2376
@lock #3529 = #-1
@set #3529 = dark
@field #3529 = parent : 2400
@field #3529 = can_see : 1
@field #3529 = reset :
 @move(3529,2376); @setfield(3529,"parent",2376);
 @setfield(3529,"hearing_good",0); @setfield(3529,"memory_capacity",5);
 @setfield(3529,"score",0); @setfield(3529,"turns",0);
 @setfield(3529,"prepared_flag",0); @setfield(3529,"number_filled",0);
 @setfield(3529,"deadflag",0); @setfield(3529,"number_known",0);
 @setfield(3529,"can_see",1);
---
@field #3529 = reset : @move(3529,2376); @setfield(3529,"parent",2400); @setfield(3529,"hearing_good",0); @setfield(3529,"memory_capacity",5); @setfield(3529,"score",0); @setfield(3529,"turns",0); @setfield(3529,"prepared_flag",0); @setfield(3529,"number_filled",0); @setfield(3529,"deadflag",0); @setfield(3529,"number_known",0); @setfield(3529,"can_see",1);
===
@field #3529 = deadflag : 0
@field #3529 = spell_a : 3181
@field #3529 = spell_b : 3016
@field #3529 = spell_c : 3134
@field #3529 = spell_d : 3130
@field #3529 = spell_e : 3520
@field #3529 = spell_f : 3528
@field #3529 = spell_g : 3542
@field #3529 = spell_h : 3547
@field #3529 = spell_i : 3548
@field #3529 = spell_j : 3549
@field #3529 = spell_k : 3701
@field #3529 = is_animate : 1
@field #3529 = is_scenery : 1
@field #3529 = hearing_good : 0
@field #3529 = memory_capacity : 5
@field #3529 = prepared_flag : 0
@field #3529 = number_filled : 0
@field #3529 = score : 0
@field #3529 = turns : 0
@field #3529 = the_spellcode :
@field #3529 = the_spell : 
@field #3529 = desc : As good looking as ever.

// 1: increment turns
// 2: rescale the scales (3621,"do_rescale")
// 3: tortoise daemon
// 4: lobal timer
// 5: cyclops timer
// 6: cyclops each_turn
// 7: bazaar each_turn
// 8: test deadflag
@field #3529 = each_turn :
 @switch(@getfield(3529,"isturn"),1,@print(
  @setfield(3529,"turns",@add(1,@getfield(3529,"turns"))),
  @s("_msg",@print(
   @switch(@getfield(2376,"the_room"),2452,@call(3621,"do_rescale")),
   @switch(1,@getfield(3716,"daemon_on"),@call(3716,"daemon")),
   @switch(1,@gt(@getfield(3423,"timer"),0),@call(3423,"timestep")),
   @switch(1,@gt(@getfield(2376,"timer"),0),@call(2376,"timestep")),
   @switch(@getfield(2376,"the_room"),@getfield(3718,"parent"),
    @call(3718,"each_turn")),
   @switch(@getfield(2376,"the_room"),2461,@call(2461,"each_turn"))
  )),
  @switch(1,@not(@eq(_msg,"")),@tellroom(2376,"",_msg))
 ),@setfield(3529,"isturn",1));
 @switch(@getfield(3529,"deadflag"),1,@call(3529,"fn_death"));
---
TEST
@field #3529 = each_turn : @switch(@getfield(3529,"isturn"),1,@print( @setfield(3529,"turns",@add(1,@getfield(3529,"turns"))), @s("_msg",@print( @switch(@getfield(2376,"the_room"),2452,@call(3621,"do_rescale")), @switch(1,@getfield(3716,"daemon_on"),@call(3716,"daemon")), @switch(1,@gt(@getfield(3423,"timer"),0),@call(3423,"timestep")), @switch(1,@gt(@getfield(2376,"timer"),0),@call(2376,"timestep")), @switch(@getfield(2376,"the_room"),@getfield(3718,"parent"), @call(3718,"each_turn")), @switch(@getfield(2376,"the_room"),2461,@call(2461,"each_turn")))), @switch(1,@not(@eq(_msg,"")),@tellroom(2376,"",_msg))),@setfield(3529,"isturn",1)); @switch(@getfield(3529,"deadflag"),1,@call(3529,"fn_death"));
===

// DO: @execute(3529,@getfield(3529,"fn_calc_t1"))
// DONT: @call(3529,"fn_calc_t1")
@field #3529 = fn_calc_t1 : @s("t1",@object(2376,"%0")); @switch(@type(t1),2,@s("t1",3529));
@field #3529 = fn_calc_t2 : @s("t2",@object(2376,"%0")); @switch(@type(t2),2,@s("t2",3529));

@field #3529 = fn_calc_the_spell :
 @s("the_spell",@switch(@g("the_spellcode"),
  "A",3181,"B",3016,"C",3134,"D",3130,"E",3520,"F",3528,
  "G",3542,"H",3547,"I",3548,"J",3549,"K",3701, 0));
---
@field #3529 = fn_calc_the_spell : @s("the_spell",@switch(@g("the_spellcode"), "A",3181,"B",3016,"C",3134,"D",3130,"E",3520,"F",3528,"G",3542,"H",3547,"I",3548,"J",3549,"K",3701, 0));
===
// deadflag was 1 (so either mortin saves him, or it's a true death)
// if player dies in BalanceRm, mortin cannot save him.
// in any case, drop all inventory.
// in true death, move player to YouHaveDied.
// in mortin, return spellbook, move player to Boneyard.
@field #3529 = fn_death :
 @switch(@getfield(2376,"the_room"),2476,@print(
  @setfield(3529,"prepared_flag",0),
  "%c%cYour foresight in preparing a resurrection was wasted. The
  tangled magic of the Balance Room coiled around your puny
  enchantment like a constricting serpent."
 ));
 @setfield(3529,"deadflag",0);
 @contentsloop(2376,"x",@switch(@getfield("%x","parent"),3529,
  @setfield("%x","parent",@getfield(2376,"the_room"))));
 @switch(@getfield(3529,"prepared_flag"),0,@print(
// TRUEDEATH
  @setfield(12902,"name","   *** You have died ***"),
  @s("action2",12902),
  @execute(@getfield(2376,"fn_moveplayers2"))
 ),@print(
// MORTINSAVED
  @setfield(3529,"prepared_flag",0),
  @setfield(3529,"hearing_good",0),
  @switch(1,@gt(@getfield(3529,"memory_capacity"),1),
   @setfield(3529,"memory_capacity",@sub(@getfield(3529,"memory_capacity"),1))),
  @move(2391,2376), @setfield(2391,"parent",3529),
  "%cWith great foresight you prepared yourself for resurrection... 
  Your mind feels a little weaker, but at least you're alive.%c",
  @s("action2",2464),
  @execute(@getfield(2376,"fn_moveplayers2"))
 ));
--
TODO ADD
@field #3529 = fn_death : @switch(@getfield(2376,"the_room"),2476,@print( @setfield(3529,"prepared_flag",0), "%c%cYour foresight in preparing a resurrection was wasted. The tangled magic of the Balance Room coiled around your puny enchantment like a constricting serpent.")); @setfield(3529,"deadflag",0); @contentsloop(2376,"x",@switch(@getfield("%x","parent"),3529, @setfield("%x","parent",@getfield(2376,"the_room")))); @switch(@getfield(3529,"prepared_flag"),0,@print( @setfield(12902,"name","   *** You have died ***"), @s("action2",12902), @execute(@getfield(2376,"fn_moveplayers2"))),@print( @setfield(3529,"prepared_flag",0), @setfield(3529,"hearing_good",0), @switch(1,@gt(@getfield(3529,"memory_capacity"),1), @setfield(3529,"memory_capacity",@sub(@getfield(3529,"memory_capacity"),1))), @move(2391,2376), @setfield(2391,"parent",3529), "%cWith great foresight you prepared yourself for resurrection... Your mind feels a little weaker, but at least you're alive.%c", @s("action2",2464), @execute(@getfield(2376,"fn_moveplayers2"))));
==

@field #3529 = fn_desc_the_spell :
 @print(@shortname(@g("the_spell")),": ",
 @getfield(@g("the_spell"),"purpose"));
---
@field #3529 = fn_desc_the_spell : @print(@shortname(@g("the_spell")),": ", @getfield(@g("the_spell"),"purpose"));
===
@field #3529 = fn_attack_spellbook : @print("When you are done, ",
 @switch(@getfield("%!","is_proper"),"","the "),
 @shortname("%!")," remains unmarred.");
---
@field #3529 = fn_attack_spellbook : @print("When you are done, ", @switch(@getfield("%!","is_proper"),"","the "), @shortname("%!")," remains unmarred.");
===

// calculate the "You can see an xxx, a yyy and a zzz here." line
@field #3529 = fn_l_pt4 :
 @s("nhere",0);
 @contentsloop(@location("%#"),"x",@switch(1,@and(
  @eq(@type("%x"),4),
  @eq(@getfield("%x","parent"),@getfield(@location("%#"),"the_room")),
  @eq(@getfield("%x","is_static"),""),
  @eq(@getfield("%x","is_scenery"),""),
  @eq(@getfield("%x","describe"),""),
  @not(@and( @not(@eq(@getfield("%x","initial"),"")),@eq(@getfield("%x","is_moved"),1) ))
 ),@print(
  @s("nhere",@add(1,@g("nhere"))),
  @setfield("%x","is_workflag",1)
 ),@setfield("%x","is_workflag","")
 ));
 @s("l_pt4",@switch(@g("nhere"),0,"",@print(
  "%c%cYou can see", @s("i",1),
  @contentsloop(@location("%#"),"x",@switch(1,@getfield("%x","is_workflag"),@print(
   @switch(@g("i"),1," ",@g("nhere")," and ",", "),
   @switch(1,@getfield("%x","is_proper"),"",
    @eq(@getfield("%x","article"),""),"a ",
    @print(@getfield("%x","article")," ")),
   @shortname("%x"),
   @s("i",@add(1,@g("i")))
  )))," here."
 )));
----
TEST
@field #3529 = fn_l_pt4 : @s("nhere",0); @contentsloop(@location("%#"),"x",@switch(1,@and(@eq(@type("%x"),4), @eq(@getfield("%x","parent"),@getfield(@location("%#"),"the_room")), @eq(@getfield("%x","is_static"),""), @eq(@getfield("%x","is_scenery"),""), @eq(@getfield("%x","describe"),""), @not(@and( @not(@eq(@getfield("%x","initial"),"")),@eq(@getfield("%x","is_moved"),1)))),@print( @s("nhere",@add(1,@g("nhere"))), @setfield("%x","is_workflag",1) ),@setfield("%x","is_workflag",""))); @s("l_pt4",@switch(@g("nhere"),0,"",@print( "%c%cYou can see", @s("i",1), @contentsloop(@location("%#"),"x",@switch(1,@getfield("%x","is_workflag"),@print( @switch(@g("i"),1," ",@g("nhere")," and ",", "), @switch(1,@getfield("%x","is_proper"),"", @eq(@getfield("%x","article"),""),"a ", @print(@getfield("%x","article")," ")), @shortname("%x"), @s("i",@add(1,@g("i"))))))," here.")));
====
@field #3529 = fn_open_spellbook : @print(
 @switch(@getfield("%!","is_proper"),"","The "),@shortname("%!"),
 " is always open to the right place, but it
 is also always closed. This eliminates tedious leafing and
 hunting for spells. Many lives have been saved by this
 magical innovation.");
---
@field #3529 = fn_open_spellbook : @print( @switch(@getfield("%!","is_proper"),"","The "),@shortname("%!")," is always open to the right place, but it is also always closed. This eliminates tedious leafing and hunting for spells. Many lives have been saved by this magical innovation.");
===

room junk (dbref #2316)

This object serves as the set of objects to ignore in the current room. The room's ignore_names field is used as the new name of this item, else it is named "_".

This object is also responsible for resetting the holodeck room's fields that change.

@create junk
@zone #2316 = #2361
@link #2316 = #2376
@set #2316 = dark
@lock #2316 = #-1
@field #2316 = is_scenery : 1
@field #2316 = parent : 2400
@field #2316 = reset : @move(2316,2376); @setfield(2316,"parent",2400);
 @setfield(2376,"the_room",2400);
 @setfield(2376,"name",@getfield(2400,"name"));
 @setfield(2376,"cant_go",@getfield(2400,"cant_go"));
 @setfield(3423,"timer",0);
@field #2316 = desc : That's not something you need to refer to in the course of this game.
@field #2316 = on_before : That's not something you need to refer to in the course of this game.
---
@field #2316 = reset : @move(2316,2376); @setfield(2316,"parent",2400); @setfield(2376,"the_room",2400); @setfield(2376,"name",@getfield(2400,"name")); @setfield(2376,"cant_go",@getfield(2400,"cant_go")); @setfield(3423,"timer",0);
===

enter (#2411) - from Holodeck to Hut

//%cPorted to the ifMud in 2002 by David Welbourn (DavidW)");
@open enter = nowhere
@field #2411 = action2 : 2315
@field #2411 = reset : @move(2411,2376);
@succ #2411 = @tellroom(@location("%#"),"","%n >enter%cYou feel a
 little confused as to how you got here.
 Something to do with Helistar! That's right, and how the world is
 so far off balance nowadays, after the Great Change.%c%cBALANCES
 %cAn Interactive Short Story%cCopyright (c) 1994, 1995, 1996 by Graham
 Nelson");
 @execute(@getfield(2376,"fn_moveplayers"));
---
@succ #2411 = @tellroom(@location("%#"),"","%n >enter%cYou feel a little confused as to how you got here. Something to do with Helistar! That's right, and how the world is so far off balance nowadays, after the Great Change.%c%cBALANCES%cAn Interactive Short Story%cCopyright (c) 1994, 1995, 1996 by Graham Nelson"); @execute(@getfield(2376,"fn_moveplayers"));
===

spell book (#2391)

@create spell book;book;spellbook;my spell book;my spellbook;my book
@zone #2391 = #2361
@link #2391 = #2376
@lock #2391 = #-1
@set #2391 = dark
@field #2391 = parent : 3529
@field #2391 = on_open : @execute(@getfield(3529,"fn_open_spellbook"));
@field #2391 = on_close : @execute(@getfield(3529,"fn_open_spellbook"));
@field #2391 = on_attack : @execute(@getfield(3529,"fn_attack_spellbook"));
@field #2391 = is_spellbook : 1
@field #2391 = spell_list : ABCD
@field #2391 = desc :
 @print("My Spell Book%c");
 @strloop(@g("spell_list"),"x",@print(
  "%c",@setfield(3529,"the_spellcode","%x"),
  @call(3529,"fn_calc_the_spell"),
  @call(3529,"fn_desc_the_spell")
 ));
---
@field #2391 = desc : @print("My Spell Book%c"); @strloop(@g("spell_list"),"x",@print("%c",@setfield(3529,"the_spellcode","%x"), @call(3529,"fn_calc_the_spell"), @call(3529,"fn_desc_the_spell")));
===
@field #2391 = reset : @move(2391,2376); @setfield(2391,"parent",3529); @setfield(2391,"spell_list","ABCD");

silver coin (#2393)

@create silver coin;coin
@zone #2393 = #2361
@lock #2393 = #-1
@link #2393 = #2376
@set #2393 = dark
@field #2393 = is_coin : 1
@field #2393 = is_silver_coin : 1
@field #2393 = parent : 3529
@field #2393 = reset : @move(2393,2376); @setfield(2393,"parent",3529);

magic burin (#2409)

@create magic burin;magical burin;burin;magic pen;magical pen;pen
@zone #2409 = #2361
@link #2409 = #2376
@lock #2409 = #-1
@set #2409 = dark
@field #2409 = parent : 3529
@field #2409 = reset : @move(2409,2376); @setfield(2409,"parent",3529);
@field #2409 = desc : This is a magical burin, used for inscribing objects with words or runes of magical import. Such a burin also gives you the ability to write spell scrolls.

gnusto spell (#3181)

// note: gnusto command is #3406
// The parent is set to the room junk, so it'll be in scope, yet not
// in the player's inventory.
@create gnusto spell;gnusto
@link #3181 = #2376
@zone #3181 = #2361
@lock #3181 = #-1
@set #3181 = dark
@field #3181 = purpose : copy a scroll into your spell book
@field #3181 = number : 100
@field #3181 = is_spell : 1
@field #3181 = the_spellcode : A
@field #3181 = sname : gnusto
@field #3181 = article : the
@field #3181 = parent : 2316
@field #3181 = is_known : 1
@field #3181 = reset : @move(3181,2376); @setfield(3181,"parent",2316);
 @setfield(3181,"number",100); @setfield(3181,"is_known",1);
 @setfield(3181,"is_reversed","");
---
@field #3181 = reset : @move(3181,2376); @setfield(3181,"parent",2316); @setfield(3181,"number",100); @setfield(3181,"is_known",1); @setfield(3181,"is_reversed","");
===

frotz spell (#3016)

// note: frotz command is #3405
@create frotz spell;frotz
@zone #3016 = #2361
@lock #3016 = #-1
@link #3016 = #2376
@set #3016 = dark
@field #3016 = purpose : cause an object to give off light
@field #3016 = is_spell : 1
@field #3016 = the_spellcode : B
@field #3016 = sname : frotz
@field #3016 = parent : 2391
@field #3016 = article : the
@field #3016 = number : 0
@field #3016 = reset : @move(3016,2376); @setfield(3016,"parent",2391);
 @setfield(3016,"number",0); @setfield(3016,"is_known","");
 @setfield(3016,"is_reversed","");
 @fieldloop(3016,"frotzed_",@print(
  @setfield("%v","is_light",""),@setfield(3016,"%f","")
 ));
---
@field #3016 = reset : @move(3016,2376); @setfield(3016,"parent",2391); @setfield(3016,"number",0); @setfield(3016,"is_known",""); @setfield(3016,"is_reversed",""); @fieldloop(3016,"frotzed_",@print(@setfield("%v","is_light",""),@setfield(3016,"%f","")));
===

rezrov spell (#3130)

@create rezrov spell;rezrov
@zone #3130 = #2361
@lock #3130 = #-1
@link #3130 = #2376
@set #3130 = dark
@field #3130 = purpose : open even locked or enchanted objects
@field #3130 = is_spell : 1
@field #3130 = the_spellcode : D
@field #3130 = article : the
@field #3130 = number : 0
@field #3130 = sname : rezrov
@field #3130 = parent : 2391
@field #3130 = reset : @move(3130,2376); @setfield(3130,"parent",2391);
 @setfield(3130,"number",0); @setfield(3130,"is_known","");
 @setfield(3130,"is_reversed","");
---
@field #3130 = reset : @move(3130,2376); @setfield(3130,"parent",2391); @setfield(3130,"number",0); @setfield(3130,"is_known",""); @setfield(3130,"is_reversed","");
===

yomin spell (#3134)

@create yomin spell;yomin
@zone #3134 = #2361
@lock #3134 = #-1
@link #3134 = #2376
@set #3134 = dark
@field #3134 = purpose : mind probe
@field #3134 = is_spell : 1
@field #3134 = parent : 2391
@field #3134 = the_spellcode : C
@field #3134 = sname : yomin
@field #3134 = article : the
@field #3134 = number : 0
@field #3134 = reset : @move(3134,2376); @setfield(3134,"parent",2391);
 @setfield(3134,"number",0); @setfield(3134,"is_known","");
 @setfield(3134,"is_reversed","");
---
@field #3134 = reset : @move(3134,2376); @setfield(3134,"parent",2391); @setfield(3134,"number",0); @setfield(3134,"is_known",""); @setfield(3134,"is_reversed","");
===

"Balances Holodeck" (#2400)

// Not the true Holodeck, but its mirror.
@dig "Balances" Holodeck
@name #2400 = "Balances" Holodeck
@zone #2400 = #2361
@desc #2400 = Welcome to a short story called "Balances", one of the example games for the Inform design system (and now an example game in JotaCode). Some people may recognise the setting, but others might like to type "how do spells work" - the game responds to a few such questions.%c%c* Type ENTER to begin the game.%c* Type RESTART to restart the game.%c* Type VERBS for a list of known verbs.
@field #2400 = cant_go : You may either "enter" the game, or "exit" the holodeck.

Ramshackle Hut (#2315) - aka Hut

@dig Ramshackle Hut
@desc #2315 = Until quite recently, someone lived here, you feel sure. Now the furniture is matchwood and the windows are glassless. Outside, it is a warm, sunny day, and grasslands extend to the low hills on the horizon.
@zone #2315 = #2361
@field #2315 = cant_go : There's only the one room: better go "out".
@field #2315 = ignore_names : windows;grasslands;grass;hills
@field #2315 = restart :
// @move(2319,2315); @move(2363,2315); @setfield(2365,"is_searched","");
@field #2315 = obj_out : 2319
@field #2315 = obj_furniture : 2363
@field #2315 = metareset :
 @setfield(2315,"reset","");
 @fieldloop(2315,"obj_",@setfield(2315,"reset",@print(
  @getfield(2315,"reset"),@getfield("%v","reset")
 )));
---
@field #2315 = metareset : @setfield(2315,"reset",""); @fieldloop(2315,"obj_",@setfield(2315,"reset",@print(@getfield(2315,"reset"),@getfield("%v","reset"))));
===

out (#2319) - from Hut (#2315) to Grasslands (#2326)

@open out;west;w = nowhere
@field #2319 = action2 : 2326
@field #2319 = reset : @move(2319,2315);
@succ #2319 = @tellroom(@location("%#"),"","%n >out"); @execute(@getfield(2376,"fn_moveplayers"));

wooden furniture (#2363)

You find and auto-take the cedarwood box the first time the furniture is examined or searched.

@create wooden furniture;furniture;wood furniture;broken furniture;broken wood furniture;broken wooden furniture
@zone #2363 = #2361
@lock #2363 = #-1
@link #2363 = #2315
@set #2363 = dark
@field #2363 = is_scenery : 1
@field #2363 = parent: 2315
@field #2363 = reset : @move(2363,2315); @setfield(2363,"is_searched","");
@desc #2363 =
@field #2363 = desc : @call(2363,"on_search");
@field #2363 = on_search :
 @switch(@getfield(2363,"is_searched"),"",@print(
  @setfield(2363,"is_searched",1),
  @setfield(3529,"score",@add(5,@getfield(3529,"score"))),
  @move(2364,2376),@setfield(2364,"parent",3529),
  "Searching through the furniture, which is good for nothing
  but firewood now, you come across an old cedarwood box,
  which you pick up for a closer look.%c%c[Your score has just
  gone up by five points.]"
 ),"You see nothing special about the wooden furniture."
 );
---
@field #2363 = on_search : @switch(@getfield(2363,"is_searched"),"",@print(@setfield(2363,"is_searched",1), @setfield(3529,"score",@add(5,@getfield(3529,"score"))), @move(2364,2376),@setfield(2364,"parent",3529), "Searching through the furniture, which is good for nothing but firewood now, you come across an old cedarwood box, which you pick up for a closer look.%c%c[Your score has just gone up by five points.]"),"You see nothing special about the wooden furniture.");
===

Grasslands, near Hut (#2326)

@dig Grasslands, near Hut
@desc #2326 = The grasslands sway over low hills in all directions: it is a peaceful wilderness, broken only by this hut and a faint path to the north.
@zone #2326 = #2361
@field #2326 = cant_go : You wander around for a while but end up back at the hut.
@field #2326 = ignore_names : grasslands;grass;hut;path
@field #2326 = obj_in : 2344
@field #2326 = obj_north : 2355
@field #2326 = reset :
@field #2326 = metareset :
 @setfield(2326,"reset","");
 @fieldloop(2326,"obj_",@setfield(2326,"reset",@print(
  @getfield(2326,"reset"),@getfield("%v","reset")
 )));
---
@field #2326 = metareset : @setfield(2326,"reset",""); @fieldloop(2326,"obj_",@setfield(2326,"reset",@print(@getfield(2326,"reset"),@getfield("%v","reset"))));
===

in (#2344) from Grasslands into Hut

@open in;east;e = nowhere
@field #2344 = action2 : 2315
@succ #2344 = @tellroom(@location("%#"),"","%n >in"); @execute(@getfield(2376,"fn_moveplayers"));
@field #2344 = reset : @move(2344,2326);

north (#2355) from Grasslands to Valley

@open north;n = nowhere
@field #2355 = action2 : 2349
@succ #2355 = @tellroom(@location("%#"),"","%n >north"); @execute(@getfield(2376,"fn_moveplayers"));
@field #2355 = reset : @move(2355,2326);

Pocket Valley (#2349)

@desc #2349 = A pleasant pocket valley in the grassy hills, through which a trail runs north-to-south.
@zone #2349 = #2361
@field #2349 = cant_go : You wander around the pleasant valley, but are afraid to lose sight of the trail.
@field #2349 = ignore_names : valley;trail
@field #2349 = obj_north : 2356
@field #2349 = obj_south : 2359
@field #2349 = obj_horse : 2366
@field #2349 = obj_oats : 2370
@field #2349 = reset :
@field #2349 = metareset :
 @setfield(2349,"reset","");
 @fieldloop(2349,"obj_",@setfield(2349,"reset",@print(
  @getfield(2349,"reset"),@getfield("%v","reset")
 )));
---
@field #2349 = metareset : @setfield(2349,"reset",""); @fieldloop(2349,"obj_",@setfield(2349,"reset",@print(@getfield(2349,"reset"),@getfield("%v","reset"))));
===

north (#2356) - from Pocket Valley to nowhere

@open north;n = nowhere
@succ #2356 = @tellroom(@location("%#"),"","%n >north%cThe trail runs out to nothing, and you retreat for fear of getting so lost you couldn't find the hut again by nightfall.");
@field #2356 = reset : @move(2356,2349);

south (#2359) - from Pocket Valley to Grasslands

@open south;s = nowhere
@field #2359 = action2 : 2326
@succ #2359 = @tellroom(@location("%#"),"","%n >south"); @execute(@getfield(2376,"fn_moveplayers"));
@field #2359 = reset : @move(2359,2349);

horse (#2366)

// horse #2366 starts in Valley?
// horse's name can change
@create chestnut horse;horse
@link #2366 = #2349
@zone #2366 = #2361
@lock #2366 = #-1
@set #2366 = dark
@field #2366 = describe : @print("There is a ",@shortname("%!")," here, munching on a pile of oats.");
@field #2366 = reset : @move(2366,2349); @setfield(2366,"parent",2349); @setfield(2366,"is_general",""); @setfield(2366,"name",@getfield(2366,"name_0"));
@field #2366 = is_animate : 1
@field #2366 = parent : 2349
@field #2366 = name_0 : chestnut horse;horse
@field #2366 = name_1 : winged horse;chestnut horse;winged chestnut horse;horse
@field #2366 = on_yomin : He is mainly thinking about oats. Partly who you are and what you're up to, but mainly oats.
@field #2366 = on_bozbar : @print(
 @setfield(2366,"is_general",1),
 @setfield(2366,"name",@getfield(2366,"name_1")),
 "A pair of handsome brown wings suddenly appears on
 the horse's powerful shoulders. The horse turns in a
 complete circle, a look of puzzlement on his face."
 );
---
@field #2366 = on_bozbar : @print(@setfield(2366,"is_general",1), @setfield(2366,"name",@getfield(2366,"name_1")), "A pair of handsome brown wings suddenly appears on the horse's powerful shoulders. The horse turns in a complete circle, a look of puzzlement on his face.");
===
// at end of flight, move players to 2369
@field #2366 = on_ride : @switch(@getfield(2366,"is_general"),"",
 "You ride around for a while, exercising the horse, but
 soon enough he tires of this and pointedly brings you
 back to the oats. Obligingly you dismount and he begins grazing again.",
 @print(
 "You begin to ride north. Then, slowly at first but with
 increasing sureness, the horse begins beating its powerful
 wings. You rise majestically through the air, sailing
 gracefully across a chasm where the hills fall away. 
 The horse lands gently on the far side and deposits you,
 taking to the skies again.%c",
 @s("action2",2369),
 @execute(@getfield(2376,"fn_moveplayers2"))
 ));
---
@field #2366 = on_ride : @switch(@getfield(2366,"is_general"),"","You ride around for a while, exercising the horse, but soon enough he tires of this and pointedly brings you back to the oats. Obligingly you dismount and he begins grazing again.", @print("You begin to ride north. Then, slowly at first but with increasing sureness, the horse begins beating its powerful wings. You rise majestically through the air, sailing gracefully across a chasm where the hills fall away. The horse lands gently on the far side and deposits you, taking to the skies again.%c", @s("action2",2369), @execute(@getfield(2376,"fn_moveplayers2"))));
===
@field #2366 = on_enter : @call(2355,"on_ride");

pile of oats (#2370)

@create pile of oats;oats
@zone #2370 = #2361
@link #2370 = #2349
@lock #2370 = #-1
@set #2370 = dark
@field #2370 = is_scenery : 1
@field #2370 = parent : 2349
@field #2370 = reset : @move(2370,2349); @setfield(2370,"is_searched","");
@field #2370 = on_take : What would you want with all those oats?
@field #2370 = desc : @call(2370,"on_search");
@field #2370 = on_search :
 @switch(@g("is_searched"),"",@print(
  @s("is_searched",1),
  @setfield(3529,"score",@add(5,@getfield(3529,"score"))),
  @move(2371,2376),@setfield(2371,"parent",3529),@move(3542,2376),
   "Sifting through the oats, you find a shiny scroll! Lucky
   you got to it before the horse did. As you turn it over
   in your hands, it seems undamaged.%c%c[Your score has just
   gone up by five points.]"
 ),"You see nothing special about the pile of oats."
 );
---
@field #2370 = on_search : @switch(@g("is_searched"),"",@print(@s("is_searched",1), @setfield(3529,"score",@add(5,@getfield(3529,"score"))), @move(2371,2376),@setfield(2371,"parent",3529),@move(3542,2376), "Sifting through the oats, you find a shiny scroll! Lucky you got to it before the horse did. As you turn it over in your hands, it seems undamaged.%c%c[Your score has just gone up by five points.]"),"You see nothing special about the pile of oats.");
===

Edge of Chasm (#2369)

@dig Edge of Chasm
@zone #2369 = #2361
@desc #2369 = The road ends suddenly at a wide chasm. The road leads upward to the north, and you can see it continuing on the southern side of the chasm.
@field #2369 = cant_go : The chasm is too perilous to approach. The only safe way is up and to the north.
@field #2369 = ignore_names : wide;chasm;road;daffodils;clump;wide chasm;clump of daffodils
@field #2369 = obj_north : 3558
@field #2369 = obj_snake : 3595
@field #2369 = obj_snakes_cube : 3599
@field #2369 = reset :
@field #2369 = metareset :
 @setfield(2369,"reset","");
 @fieldloop(2369,"obj_",@setfield(2369,"reset",@print(
  @getfield(2369,"reset"),@getfield("%v","reset")
 )));
---
@field #2369 = metareset : @setfield(2369,"reset",""); @fieldloop(2369,"obj_",@setfield(2369,"reset",@print( @getfield(2369,"reset"),@getfield("%v","reset"))));
===

north (#3558) - from Edge (#2369) to Crest (#2439)

@open north;n;up;u = nowhere
@field #3558 = action2 : 2439
@succ #3558 = @tellroom(@location("%#"),"","%n >north"); @execute(@getfield(2376,"fn_moveplayers"));
@field #3558 = reset : @move(3558,2369);

hissing snake (#3595)

@create hissing snake;snake
@field #3595 = reset : @move(3595,2369);
@link #3595 = #2369
@zone #3595 = #2361
@lock #3595 = #-1
@set #3595 = dark
@field #3595 = parent : 2369
@field #3595 = reset : @move(3595,2369); @setfield(3595,"parent",2369);
@field #3595 = desc : It has some V-markings, some scaly parts, colours from grey to reddish-brown. Is that any help?
@field #3595 = initial : Lying in a tight coil at the edge of the chasm is a hissing snake.
@field #3595 = is_animate : 1
@field #3595 = life : The snake hisses angrily!
@field #3595 = on_take : The slipperiness of its skin is only one of many reasons why this is ill-advised.
@field #3595 = on_urbzig :
 @move(3595,2651); @setfield(3595,"parent",2651);
 @setfield(3599,"initial","Beside a clump of daffodils is a featureless white cube.");
 @setfield(3599,"on_before","");
 @print("The snake is replaced by a clump of daffodils.");
---
TEST
@field #3595 = on_urbzig : @move(3595,2651); @setfield(3595,"parent",2651); @setfield(3599,"initial","Beside a clump of daffodils is a featureless white cube."); @setfield(3599,"on_before",""); @print("The snake is replaced by a clump of daffodils.");
===
@field #3595 = on_bozbar :
 @move(3595,2651); @setfield(3595,"parent",2651); @setfield(3599,"on_before","");
 @setfield(3599,"initial","A featureless cube rests where the snake took off from.");
 @print("The snake is transformed into a huge, winged serpent,
 a dragon which bellows and leaps out into the chasm,
 backwinging furiously... and knocking you over the
 edge quite by accident.");
 @setfield(3529,"deadflag",1);
---
@field #3595 = on_bozbar : @move(3595,2651); @setfield(3595,"parent",2651); @setfield(3599,"on_before",""); @setfield(3599,"initial","A featureless cube rests where the snake took off from."); @print("The snake is transformed into a huge, winged serpent, a dragon which bellows and leaps out into the chasm, backwinging furiously... and knocking you over the edge quite by accident."); @setfield(3529,"deadflag",1);
===
@field #3595 = on_yomin : Horrid reptilian thoughts insinuate their way into you.

snake's cube (#3599)

@create featureless white cube;blank white cube;white cube;featureless cube;blank cube;cube
@lock #3599 = #-1
@zone #3599 = #2361
@link #3599 = #2369
@set #3599 = dark
@field #3599 = is_cube : 1
@field #3599 = parent : 2369
@field #3599 = reset : @move(3599,2369); @setfield(3599,"parent",2369);
 @setfield(3599,"is_moved","");
 @setfield(3599,"initial","The snake appears to be curled around a featureless white cube.");
 @setfield(3599,"on_before","The snake won't let you near that cube!");
 @setfield(3599,"article",""); @setfield(3599,"name",@getfield(3722,"name"));
---
@field #3599 = reset : @move(3599,2369); @setfield(3599,"parent",2369); @setfield(3599,"is_moved",""); @setfield(3599,"initial","The snake appears to be curled around a featureless white cube."); @setfield(3599,"on_before","The snake won't let you near that cube!"); @setfield(3599,"article",""); @setfield(3599,"name",@getfield(3722,"name"));
===
@field #3599 = on_before : The snake won't let you near that cube!
@field #3599 = on_take_after :
 @switch(@getfield(3599,"is_moved"),"",@print(
  @setfield(3529,"score",@add(5,@getfield(3529,"score"))),
  "%c%c[Your score has just gone up by five points.]"
 ));
---
@field #3599 = on_take_after : @switch(@getfield(3599,"is_moved"),"",@print( @setfield(3529,"score",@add(5,@getfield(3529,"score"))),"%c%c[Your score has just gone up by five points.]"));
===

Crest of Hill (#2439)

@dig Crest of Hill
@zone #2439 = #2361
@desc #2439 = The road crosses the top of a ridge here, sloping downwards to the south and the northwest. A track diverges to east.
@field #2439 = obj_nw : 3713
@field #2439 = obj_south : 3714
@field #2439 = obj_east : 3715
@field #2439 = obj_tortoise : 3716
@field #2439 = reset :
@field #2439 = metareset :
 @setfield(2439,"reset","");
 @fieldloop(2439,"obj_",@setfield(2439,"reset",@print(
  @getfield(2439,"reset"),@getfield("%v","reset")
 )));
---
@field #2439 = metareset : @setfield(2439,"reset",""); @fieldloop(2439,"obj_",@setfield(2439,"reset",@print( @getfield(2439,"reset"),@getfield("%v","reset"))));
===

northwest (#3713) - from Crest of Hill to Cave Mouth

@open northwest;nw = nowhere
@field #3713 = action2 : 2448
@field #3713 = reset : @move(3713,2439);
@succ #3713 = @tellroom(@location("%#"),"","%n >northwest"); @execute(@getfield(2376,"fn_moveplayers"));

south (#3714) - from Crest of Hill to Edge

@open south;s;down;d = nowhere
@field #3714 = action2 : 2369
@field #3714 = reset : @move(3714,2439);
@succ #3714 = @tellroom(@location("%#"),"","%n >south"); @execute(@getfield(2376,"fn_moveplayers"));

east (#3715) - from Crest of Hill to Track

@open east;e = nowhere
@field #3715 = action2 : 2475
@field #3715 = reset : @move(3715,2439);
@succ #3715 = @tellroom(@location("%#"),"","%n >east"); @execute(@getfield(2376,"fn_moveplayers"));

tortoise (#3716) at Crest of Hill

@create tortoise;turtle
@lock #3716 = #-1
@link #3716 = #2439
@zone #3716 = #2361
@set #3716 = dark
@field #3716 = initial : A tortoise ambles along the road, extremely slowly.
@field #3716 = is_animate : 1
@field #3716 = parent : 2439
@field #3716 = reset : @move(3716,2439); @setfield(3716,"parent",2439); @setfield(3716,"daemon_on",""); @setfield(3716,"is_general","");
@field #3716 = life : The tortoise (slowly) turns its neck to look at you (stupidly).
@field #3716 = on_take : Your parents always warned you not to pick up casual acquaintances met on the road.
@field #3716 = on_remove : Your parents always warned you not to pick up casual acquaintances met on the road.
@field #3716 = on_urbzig : Just how safe do you want your surroundings to be?
@field #3716 = on_yomin : For a moment you think there is nothing there, as you chew absentmindedly on a leaf. But somewhere inside the tortoise is a sense of wonder at the amazing blue canopy of the sky.
@field #3716 = on_bozbar :
 @move(3550,2376); @setfield(3550,"parent",@getfield(3716,"parent"));
 @move(3716,2651); @setfield(3716,"parent",2651);
 @setfield(3716,"daemon_on",1);
 @setfield(3529,"score",@add(5,@getfield(3529,"score")));
 @print("The tortoise seems to be incapable of expressing surprise, but is now soaring away high in the sky. Something rather grubby is left behind.%c%c[Your score has just gone up by five points.]");
---
@field #3716 = on_bozbar : @move(3550,2376); @setfield(3550,"parent",@getfield(3716,"parent")); @move(3716,2651); @setfield(3716,"parent",2651); @setfield(3716,"daemon_on",1); @setfield(3529,"score",@add(5,@getfield(3529,"score"))); @print("The tortoise seems to be incapable of expressing surprise, but is now soaring away high in the sky. Something rather grubby is left behind.%c%c[Your score has just gone up by five points.]");
===
@field #3716 = daemon :
 @switch(@and(@eq(@rand(6),1),@or(@eq(@getfield(2376,"the_room"),2439),
 @eq(@getfield(2376,"the_room"),2475))),1,@print(
  @switch(@and(@eq(@rand(4),1),@eq(@getfield(3716,"is_general"),"")),
   1,@print(
   @move(3149,2376),@setfield(3149,"parent",@getfield(2376,"the_room")),
   @setfield(3716,"is_general",1),
   "%cA tortoise-feather flutters to the ground before you!"
  ),@print(
   @switch(@rand(3),0,"%cHigh in the sky,",1,"%cFar above you,",
   2,"%cTiny in the blue sky,"),
   " a tortoise flaps across the sun."
  ))
 ));
---
@field #3716 = daemon : @switch(@and(@eq(@rand(6),1),@or(@eq(@getfield(2376,"the_room"),2439), @eq(@getfield(2376,"the_room"),2475))),1,@print( @switch(@and(@eq(@rand(4),1),@eq(@getfield(3716,"is_general"),"")), 1,@print( @move(3149,2376),@setfield(3149,"parent",@getfield(2376,"the_room")), @setfield(3716,"is_general",1),"%cA tortoise-feather flutters to the ground before you!"),@print(@switch(@rand(3),0,"%cHigh in the sky,",1,"%cFar above you,",2,"%cTiny in the blue sky,")," a tortoise flaps across the sun."))));
===

Cave Mouth (#2448)

@dig Cave Mouth
@zone #2448 = #2361
@desc #2448 = This is a cave mouth, at one end of a road which winds southeast over rising ground. The entrance west to the caves is a dark tunnel, and only a footpath runs further north, into gorse.
@field #2448 = ignore_names : gorse;footpath;cave;mouth;cave mouth
@field #2448 = obj_sw : 3601
@field #2448 = obj_west : 3605
@field #2448 = obj_door : 3966
@field #2448 = obj_north : 3607
@field #2448 = obj_sapphire : 3611
@field #2448 = metareset :
 @setfield(2448,"reset","");
 @fieldloop(2448,"obj_",@setfield(2448,"reset",@print(
  @getfield(2448,"reset"),@getfield("%v","reset")
 )));
---
@field #2448 = metareset : @setfield(2448,"reset",""); @fieldloop(2448,"obj_",@setfield(2448,"reset",@print( @getfield(2448,"reset"),@getfield("%v","reset"))));
===

southeast (#3601) - from Cave Mouth to Crest of Hill

@open southeast;se;up;u = nowhere
@field #3601 = action2 : 2439
@field #3601 = reset : @move(3601,2448);
@succ #3601 = @tellroom(@location("%#"),"","%n >southeast"); @execute(@getfield(2376,"fn_moveplayers"));

west (#3605) - iron door from Cave Mouth to In Cave

// in_to Iron_Door, w_to Iron_Door
@open west;w;in;enter door;enter iron door = nowhere
@field #3605 = reset : @move(3605,2448);
@name #3605 = west;w;in;enter door;enter iron door
@field #3605 = action2 : 2452
@succ #3605 =
 @tellroom(@location("%#"),"",@print("%n >west%c",
  @switch(@getfield(3966,"is_open"),1,
   @execute(@getfield(2376,"fn_moveplayers2")),
   "You can't, since the iron door is in the way."
 )));
---
@succ #3605 = @tellroom(@location("%#"),"",@print("%n >west%c", @switch(@getfield(3966,"is_open"),1, @execute(@getfield(2376,"fn_moveplayers2")), "You can't, since the iron door is in the way.")));
===

iron door (#3966)

// this will be handled as TWO items, one for each side
@create iron door;heavy iron door;heavy door;door
@link #3966 = #2448
@zone #3966 = #2361
@lock #3966 = #-1
@set #3966 = dark
@field #3966 = parent : 2448
@field #3966 = reset : @move(3966,2448); @setfield(3966,"is_open",""); @setfield(3966,"is_locked",1);
@field #3966 = desc : It just looks like an ordinary heavy iron door.
@field #3966 = is_static : 1
@field #3966 = is_door : 1
@field #3966 = is_openable : 1
@field #3966 = is_locked : 1
@field #3966 = is_lockable : 1
@field #3966 = door_dir : 3605
@field #3966 = door_to : 2452
@field #3966 = describe : @switch(1,
 @getfield(3966,"is_open"),"%cThe iron door stands open.",
 @eq(@getfield(3966,"is_locked"),""),"%cThe iron door is unlocked but shut.",
 "A heavy iron door bars the cave mouth.");
---
@field #3966 = describe : @switch(1, @getfield(3966,"is_open"),"%cThe iron door stands open.", @eq(@getfield(3966,"is_locked"),""),"%cThe iron door is unlocked but shut.", "A heavy iron door bars the cave mouth.");
===

north (#3607) - from Cave Mouth to Gorse Bushes

@open north;n = nowhere
@field #3607 = action2 : 2459
@field #3607 = reset : @move(3607,2448);
@succ #3607 = @tellroom(@location("%#"),"","%n >north"); @execute(@getfield(2376,"fn_moveplayers"));

sapphire (#3611)

!  Cf. T. S. Eliot, "Burnt Norton" II:
!  (but see also Mallarme's sonnet from which Eliot borrowed the image)
// sapphire holds the secret of caskly spell
@create perfect sapphire;sapphire;perfect gemstone;gemstone;perfect gem;gem
@link #3611 = #2448
@zone #3611 = #2361
@lock #3611 = #-1
@set #3611 = dark
@field #3611 = parent : 2448
@field #3611 = reset : @move(3611,2448); @setfield(3611,"parent",2448); @setfield(3611,"is_moved","");
@field #3611 = initial : Clotted in the mud beside the door is a perfect sapphire.
// TODO: might wanna fix re which spellbook, if any, is involved
@field #3611 = desc :
 @move(3611,2651); @setfield(3611,"parent",2651);
 @move(3547,2376); @setfield(3547,"parent",2316);
 @setfield(3547,"number",100);
 @setfield(2391,"spell_list",@print(@getfield(2391,"spell_list"),"H"));
 @print("As you gaze into the perfect blue of the sapphire,
 you feel your mind begin to reel. Unable to bear
 the naked sight of perfection, you look away, ashamed.
 As you do so, the sapphire cracks and wastes away to
 thin hot dust. But something remains, something in your
 mind...");
----
@field #3611 = desc : @move(3611,2651); @setfield(3611,"parent",2651); @move(3547,2376); @setfield(3547,"parent",2316); @setfield(3547,"number",100); @setfield(2391,"spell_list",@print(@getfield(2391,"spell_list"),"H")); @print("As you gaze into the perfect blue of the sapphire, you feel your mind begin to reel. Unable to bear the naked sight of perfection, you look away, ashamed. As you do so, the sapphire cracks and wastes away to thin hot dust. But something remains, something in your mind...");
====

Inside Cave (#2452)

@dig Inside Cave
@desc #2452 = A wide but shallow cave not far inside the hill. There is no obvious exit, except for the way you came in.
@field #2452 = cant_go : The only way is back "out" through the iron door.
@zone #2452 = #2361
@field #2452 = obj_out : 3617
@field #2452 = obj_door : 3963
@field #2452 = obj_cube : 3619
@field #2452 = obj_scales : 3621
@field #2452 = obj_rpan : 3623
@field #2452 = obj_gold1 : 3652
@field #2452 = obj_gold2 : 3654
@field #2452 = obj_gold3 : 3662
@field #2452 = obj_lpan : 3651
@field #2452 = obj_bronze : 3679
@field #2452 = obj_gold4 : 3666
@field #2452 = obj_gold5 : 3677
@field #2452 = obj_crump : 3680
@field #2452 = obj_urbzig : 3549
@field #2452 = metareset :
 @setfield(2452,"reset","");
 @fieldloop(2452,"obj_",@setfield(2452,"reset",@print(
  @getfield(2452,"reset"),@getfield("%v","reset")
 )));
---
@field #2452 = metareset : @setfield(2452,"reset",""); @fieldloop(2452,"obj_",@setfield(2452,"reset",@print( @getfield(2452,"reset"),@getfield("%v","reset"))));
===
  has  ~light;

out (#3617) - thru iron door to Cave Mouth

@open out;exit;east;e;enter door;enter iron door = nowhere
@field #3617 = reset : @move(3617,2452);
@field #3617 = action2 : 2448
@succ #3617 =
 @s("nc",0);
 @contentsloop(@location("%#"),"x",@print(
  @switch(1,
   @and(@getfield("%x","is_coin"),@or(
    @eq(@getfield("%x","parent"),3623),
    @eq(@getfield("%x","parent"),3651)
   )),
   @s("nc",@add(1,@g("nc")))
 )));
 @tellroom(@location("%#"),"",@print("%n >east%c",
  @switch(1,
   @lt(@g("nc"),6),"Something bars your way, and you hear the scales jangling militantly. You were trying to steal its coins!",
   @not(@eq(@getfield(3621,"number"),0)),"Something bars your way, and you hear the scales jangle slightly with energy.",
   @eq(@getfield(3963,"is_open"),""),"You can't, since the iron door is in the way.",
   @execute(@getfield(2376,"fn_moveplayers2"))
 )));
---
TEST
@succ #3617 = @s("nc",0); @contentsloop(@location("%#"),"x",@print( @switch(1, @and(@getfield("%x","is_coin"),@or( @eq(@getfield("%x","parent"),3623), @eq(@getfield("%x","parent"),3651))), @s("nc",@add(1,@g("nc")))))); @tellroom(@location("%#"),"",@print("%n >east%c", @switch(1, @lt(@g("nc"),6),"Something bars your way, and you hear the scales jangling militantly. You were trying to steal its coins!", @not(@eq(@getfield(3621,"number"),0)),"Something bars your way, and you hear the scales jangle slightly with energy.", @eq(@getfield(3963,"is_open"),""),"You can't, since the iron door is in the way.", @execute(@getfield(2376,"fn_moveplayers2")))));
===

iron door (#3963)

@create iron door;heavy iron door;heavy door;door
@lock #3963 = #-1
@zone #3963 = #2361
@link #3963 = #2452
@set #3963 = dark
@field #3963 = parent : 2452
@field #3963 = reset : @move(3963,2452); @setfield(3963,"is_open",""); @setfield(3963,"is_locked",1);
@field #3963 = desc : It just looks like an ordinary heavy iron door.
@field #3963 = is_static : 1
@field #3963 = is_door : 1
@field #3963 = is_openable : 1
@field #3963 = is_locked : 1
@field #3963 = is_lockable : 1
@field #3963 = door_dir : 3617
@field #3963 = door_to : 2448
@field #3963 = describe : @switch(1,
 @getfield(3963,"is_open"),"%cThe iron door stands open.",
 @eq(@getfield(3963,"is_locked"),""),"%cThe iron door is unlocked but shut.",
 "A heavy iron door bars the cave mouth.");
---
@field #3963 = describe : @switch(1, @getfield(3963,"is_open"),"%cThe iron door stands open.", @eq(@getfield(3963,"is_locked"),""),"%cThe iron door is unlocked but shut.", "A heavy iron door bars the cave mouth.");
===
       after
       [;  Take: if (parent(noun)==left_pan or right_pan)
                     print_ret "Taken from ", (the) parent(noun), ".";
       ],

cave cube (#3619)

@create featureless white cube;blank white cube;white cube;featureless cube;blank cube;cube
@lock #3619 = #-1
@zone #3619 = #2361
@link #3619 = #2452
@set #3619 = dark
@field #3619 = is_cube : 1
@field #3619 = parent : 2452
@field #3619 = reset : @move(3619,2452); @setfield(3619,"parent",2452); @setfield(3619,"is_moved",""); @setfield(3619,"article",""); @setfield(3619,"name",@getfield(3722,"name"));
@field #3619 = initial : Balanced on a rock formation is a featureless white cube.
@field #3619 = on_take_after :
 @switch(@getfield(3619,"is_moved"),"",@print(
  @setfield(3529,"score",@add(5,@getfield(3529,"score"))),
  "%c%c[Your score has just gone up by five points.]"
 ));
---
@field #3619 = on_take_after : @switch(@getfield(3619,"is_moved"),"",@print( @setfield(3529,"score",@add(5,@getfield(3529,"score"))), "%c%c[Your score has just gone up by five points.]"));
===

pair of scales (#3621)

@create pair of scales;pair of pans;pans;scales
@lock #3621 = #-1
@zone #3621 = #2361
@link #3621 = #2452
@set #3621 = dark
@field #3621 = parent : 2452
@field #3621 = reset : @move(3621,2452);
@field #3621 = number : 0
@field #3621 = is_static : 1
@field #3621 = is_supporter : 1
@field #3621 = describe :
 @print("%cA fair-sized pair of scales hangs from a bracket in the
 cave wall. ",@switch(@getfield(3621,"number"),
 0,"The scales are balanced.",
 1,"The left-hand side is higher.",
 "The right-hand side is higher."));
---
@field #3621 = describe : @print("%cA fair-sized pair of scales hangs from a bracket in the cave wall. ",@switch(@getfield(3621,"number"), 0,"The scales are balanced.", 1,"The left-hand side is higher.", "The right-hand side is higher."));
===
@field #3621 = on_before : There are left and right hand pans, which you should refer to individually.
@field #3621 = do_rescale :
 @s("i",@getfield(3621,"number"));
 @s("w1",0); @s("w2",0);
 @contentsloop(@location("%#"),"x",@print(
  @s("wx",@switch("%x",3679,2,{2371,3550,3717,3680,3700,3149},1,3)),
  @switch(@getfield("%x","parent"),
   3651,@s("w1",@add(@g("w1"),@g("wx"))),
   3623,@s("w2",@add(@g("w2"),@g("wx"))))
 ));
 @setfield(3621,"number",@switch(1, @eq(@g("w1"),@g("w2")),0, @gt(@g("w1"),@g("w2")),-1, @lt(@g("w1"),@g("w2")),1 ));
 @s("j",@getfield(3621,"number"));
 @s("d",@mul(@sub(@g("w2"),@g("w1")),@getfield(3621,"number")));
 @switch(@g("j"),
  @g("i"),"",
  0,"The scales come into balance.",
  1,@print("The left pan ",@switch(@g("d"),1,"very slowly "),"rises up."),
  @print("The right pan ",@switch(@g("d"),1,"very slowly "),"rises up.")
 );
---
TEST
@field #3621 = do_rescale : @s("i",@getfield(3621,"number")); @s("w1",0); @s("w2",0); @contentsloop(@location("%#"),"x",@print( @s("wx",@switch("%x",3679,2,{2371,3550,3717,3680,3700,3149},1,3)), @switch(@getfield("%x","parent"), 3651,@s("w1",@add(@g("w1"),@g("wx"))), 3623,@s("w2",@add(@g("w2"),@g("wx")))))); @setfield(3621,"number",@switch(1, @eq(@g("w1"),@g("w2")),0, @gt(@g("w1"),@g("w2")),-1, @lt(@g("w1"),@g("w2")),1 )); @s("j",@getfield(3621,"number")); @s("d",@mul(@sub(@g("w2"),@g("w1")),@getfield(3621,"number"))); @switch(@g("j"), @g("i"),"", 0,"The scales come into balance.", 1,@print("The left pan ",@switch(@g("d"),1,"very slowly "),"rises up."), @print("The right pan ",@switch(@g("d"),1,"very slowly "),"rises up."));
===
Class  ScalePan
       before
       [;  Receive:
           if (noun ofclass Scroll or Coin) rfalse;
           if (noun==feather) rfalse;
           "The pans gleam with what almost seems greed, and somehow they
            contrive to nudge your hand past them with your worthless and
            boring item.";
       ],

right pan (#3623)

@create right pan;right side;right tray;pan;side;tray
@field #3623 = is_scalepan : 1
@lock #3623 = #-1
@zone #3623 = #2361
@link #3623 = #2452
@set #3623 = dark
@field #3623 = parent : 2452
@field #3623 = reset : @move(3623,2452);
@field #3623 = is_supporter : 1
@field #3623 = is_scenery : 1
// gold coins 1..3 are in right pan

gold coin 1 (#3652)

@create gold coin;coin
@lock #3652 = #-1
@zone #3652 = #2361
@link #3652 = #2452
@set #3652 = dark
@field #3652 = reset : @move(3652,2452); @setfield(3652,"parent",3623);
@field #3652 = is_coin : 1
@field #3652 = is_goldcoin : 1
@field #3652 = parent: 3623

gold coin 2 (#3654)

@create gold coin;coin
@lock #3654 = #-1
@zone #3654 = #2361
@link #3654 = #2452
@set #3654 = dark
@field #3654 = reset : @move(3654,2452); @setfield(3654,"parent",3623);
@field #3654 = is_coin : 1
@field #3654 = is_goldcoin : 1
@field #3654 = parent: 3623

gold coin 3 (#3662)

@create gold coin;coin
@lock #3662 = #-1
@zone #3662 = #2361
@link #3662 = #2452
@set #3662 = dark
@field #3662 = reset : @move(3662,2452); @setfield(3662,"parent",3623);
@field #3662 = is_coin : 1
@field #3662 = is_goldcoin : 1
@field #3662 = parent: 3623

left pan (#3651)

@create left pan;left side;left tray;pan;side;tray
@field #3651 = is_scalepan : 1
@lock #3651 = #-1
@zone #3651 = #2361
@link #3651 = #2452
@set #3651 = dark
@field #3651 = parent : 2452
@field #3651 = reset : @move(3651,2452);
@field #3651 = is_supporter : 1
@field #3651 = is_scenery : 1

bronze coin (#3679)

// bronze coin, gold coins 4&5, crumpled scroll in left pan
@create bronze coin;coin
@lock #3679 = #-1
@zone #3679 = #2361
@link #3679 = #2452
@set #3679 = dark
@field #3679 = reset : @move(3679,2452); @setfield(3679,"parent",3651);
@field #3679 = is_coin : 1
@field #3679 = is_bronzecoin : 1
@field #3679 = parent: 3651

gold coin 4 (#3666)

@create gold coin;coin
@lock #3666 = #-1
@zone #3666 = #2361
@link #3666 = #2452
@set #3666 = dark
@field #3666 = reset : @move(3666,2452); @setfield(3666,"parent",3651);
@field #3666 = is_coin : 1
@field #3666 = is_goldcoin : 1
@field #3666 = parent: 3651

gold coin 5 (#3677)

@create gold coin;coin
@lock #3677 = #-1
@zone #3677 = #2361
@link #3677 = #2452
@set #3677 = dark
@field #3677 = reset : @move(3677,2452); @setfield(3677,"parent",3651);
@field #3677 = is_coin : 1
@field #3677 = is_goldcoin : 1
@field #3677 = parent: 3651

crumpled scroll (#3680)

// crumpled scroll starts in the left pan, and has the urbzig spell on it.
@create crumpled scroll;scroll
@lock #3680 = #-1
@zone #3680 = #2361
@link #3680 = #2452
@set #3680 = dark
@field #3680 = parent : 3651
@field #3680 = child : 3549
@field #3680 = is_scroll : 1
@field #3680 = reset : @move(3680,2452); @setfield(3680,"parent",3651); @setfield(3680,"child",3549); @setfield(3680,"is_general","");

urbzig spell (#3549)

@create urbzig spell;urbzig
@zone #3549 = #2361
@lock #3549 = #-1
@link #3549 = #2452
@set #3549 = dark
@field #3549 = is_spell : 1
@field #3549 = the_spellcode : J
@field #3549 = sname : urbzig
@field #3549 = parent : 3680
@field #3549 = article : the
@field #3549 = number : 0
@field #3549 = reset : @move(3549,2452); @setfield(3549,"parent",3680);
 @setfield(3549,"number",0); @setfield(3549,"is_known","");
 @setfield(3549,"is_reversed","");
---
@field #3549 = reset : @move(3549,2452); @setfield(3549,"parent",3680); @setfield(3549,"number",0); @setfield(3549,"is_known",""); @setfield(3549,"is_reversed","");
===
@field #3549 = purpose : turn a dangerous object into a harmless one

Gorse Bushes (#2459)

// Place Footpath "Gorse Bushes" #2459
@dig Gorse Bushes
@desc #2459 = The footpath from the cave mouth runs into dense, impenetrable gorse bushes. Perhaps it wasn't so much a footpath as a rill in the earth where roots wouldn't take; anyway, there's no way but back south.
@field #2459 = obj_south : 3612
@field #2459 = obj_carpet : 3614
@field #2459 = metareset :
 @setfield(2459,"reset","");
 @fieldloop(2459,"obj_",@setfield(2459,"reset",@print(
  @getfield(2459,"reset"),@getfield("%v","reset")
 )));
---
@field #2459 = metareset : @setfield(2459,"reset",""); @fieldloop(2459,"obj_",@setfield(2459,"reset",@print( @getfield(2459,"reset"),@getfield("%v","reset"))));
===

south (#3612) - from Gorse Bushes to Cave Mouth

@open south;s = nowhere
@field #3612 = action2 : 2448
@field #3612 = reset : @move(3612,2459);
@succ #3612 = @tellroom(@location("%#"),"","%n >south"); @execute(@getfield(2376,"fn_moveplayers"));

carpet (#3614)

@create beautiful red carpet;carpet;beautiful carpet;magic carpet;red carpet;beautiful magic carpet;red magic carpet;magic red carpet;beautiful magic red carpet;beautiful red magic carpet
@link #3614 = #2459
@lock #3614 = #-1
@zone #3614 = #2361
@set #3614 = dark
@field #3614 = parent : 2459
@field #3614 = reset : @move(3614,2459); @setfield(3614,"parent",2459); @setfield(3614,"is_moved","");
@field #3614 = initial : Slung over one of the gorse bushes is a beautiful red carpet.
@field #3614 = desc : This is a carpet of unusual design. It is red, beautifully woven and bears a pattern of cubes.
@field #3614 = is_supporter : 1
@field #3614 = is_enterable : 1
@field #3614 = on_take :
 @switch(1,
  @eq(@getfield(3529,"parent"),3614),"Not while you're on it!",
  @print(
   @contentsloop(2376,"x",@switch(@getfield("%x","parent"),3614,@print(
    @setfield("%x","parent",@getfield(2376,"the_room")),
    "(Dislodging ",@switch(@getfield("%x","is_proper"),"","the "),
    @shortname("%x"),")%c"
   ))),
   @setfield(3614,"parent",3529),@setfield(3614,"is_moved",1),"Taken."
 ));
---
@field #3614 = on_take : @switch(1, @eq(@getfield(3529,"parent"),3614),"Not while you're on it!", @print( @contentsloop(2376,"x",@switch(@getfield("%x","parent"),3614,@print( @setfield("%x","parent",@getfield(2376,"the_room")), "(Dislodging ",@switch(@getfield("%x","is_proper"),"","the "), @shortname("%x"),")%c"))), @setfield(3614,"parent",3529),@setfield(3614,"is_moved",1),"Taken."));
===
// TODO FIX: player should appear to be on carpet during look.
@field #3614 = on_ride :
 @switch(1,
  @not(@and(
   @eq(@getfield(3614,"parent"),@getfield(2376,"the_room")),
   @eq(@getfield(3614,"is_moved"),1)
  )),
   "Not until the carpet's on the ground, you can't.",
  @eq(@getfield(2376,"the_room"),2476),
   "Mysteriously, the carpet rucks and pulls until you're thrown off. It settles back on the white floor with a contented sigh.",
  @eq(@getfield(2376,"the_room"),2452),
   "The carpet rises suddenly, crashing into the roof of the cave and throwing you back off again. Painfully.",
  @print(
  @s("action2",@switch(@getfield(2376,"the_room"),2461,2439,2461)),
  "The carpet rises suddenly into the fluffy white clouds, and after a headlong journey deposits you...%c",
  @move(3614,@g("action2")),@setfield(3614,"parent",@g("action2")),
  @setfield(3529,"parent",3614),
  @execute(@getfield(2376,"fn_moveplayers2"))
 ));
---
@field #3614 = on_ride : @switch(1, @not(@and(@eq(@getfield(3614,"parent"),@getfield(2376,"the_room")), @eq(@getfield(3614,"is_moved"),1))), "Not until the carpet's on the ground, you can't.", @eq(@getfield(2376,"the_room"),2476), "Mysteriously, the carpet rucks and pulls until you're thrown off. It settles back on the white floor with a contented sigh.", @eq(@getfield(2376,"the_room"),2452), "The carpet rises suddenly, crashing into the roof of the cave and throwing you back off again. Painfully.", @print(@s("action2",@switch(@getfield(2376,"the_room"),2461,2439,2461)), "The carpet rises suddenly into the fluffy white clouds, and after a headlong journey deposits you...%c", @move(3614,@g("action2")),@setfield(3614,"parent",@g("action2")), @setfield(3529,"parent",3614), @execute(@getfield(2376,"fn_moveplayers2"))));
===
       [ i;  Receive:
                 if (self notin location || self hasnt moved)
                     "Not until the carpet's on the ground, you can't.";
           Enter: Ride self;
       ],

Crowded Bazaar (#2461)

@dig Crowded Bazaar
@desc #2461 = @switch(1,@or(@eq(@location(3803),2651),@eq(@location(3804),2651)),
 "This is a crowded, noisy bazaar. Directly in front of you is the lottery!",
 "This is a crowded, noisy bazaar. Directly in front of you is a lottery! But the contemptuous-looking barker is doing a very poor trade: hardly anyone wants his first prize, the big cuddly toy elephant, or even his nineteenth prize, a featureless white cube.");
---
ADD
@desc #2461 = @switch(1,@or(@eq(@location(3803),2651),@eq(@location(3804),2651)),"This is a crowded, noisy bazaar. Directly in front of you is the lottery!","This is a crowded, noisy bazaar. Directly in front of you is a lottery! But the contemptuous-looking barker is doing a very poor trade: hardly anyone wants his first prize, the big cuddly toy elephant, or even his nineteenth prize, a featureless white cube.");
===
@zone #2461 = #2361
@field #2461 = cant_go : Everywhere, the crowds of jabbering natives block your way to all the good stalls. In fact, the only one you can get at is this dismal lottery.
@field #2461 = each_turn : @switch(@rand(4),
 0,"%c\"Roll up! Roll up! One silver piece for three goes!\"",
 1,"%c\"Come on, then! Just a silver coin gets you three!\"",
 2,"%c\"Think what you could win, all for one silver coin!\"",
 3,"%c\"This could be your lucky day!\"");
---
@field #2461 = each_turn : @switch(@rand(4), 0,"%c\"Roll up! Roll up! One silver piece for three goes!\"", 1,"%c\"Come on, then! Just a silver coin gets you three!\"", 2,"%c\"Think what you could win, all for one silver coin!\"", 3,"%c\"This could be your lucky day!\"");
===
@field #2461 = obj_board : 3698
@field #2461 = obj_tib : 3805
@field #2461 = obj_barker : 3779
@field #2461 = obj_prizes : 3796
@field #2461 = obj_pelephant : 3803
@field #2461 = obj_pcube : 3804
@field #2461 = metareset :
 @setfield(2461,"reset","");
 @fieldloop(2461,"obj_",@setfield(2461,"reset",@print(
  @getfield(2461,"reset"),@getfield("%v","reset")
 )));
---
@field #2461 = metareset : @setfield(2461,"reset",""); @fieldloop(2461,"obj_",@setfield(2461,"reset",@print(@getfield(2461,"reset"),@getfield("%v","reset"))));
===

lottery board (#3698)

@create lottery board;board;lottery holes;holes;board holes
@zone #3698 = #2361
@link #3698 = #2461
@lock #3698 = #-1
@set #3698 = dark
@field #3698 = parent : 2461
@field #3698 = child : 3805
@field #3698 = credit : 0
@field #3698 = reset : @move(3698,2461); @setfield(3698,"credit",0);
@field #3698 = desc :
 There are a hundred holes each way, making, um, let's see, yes,
 ten thousand tickets in all. Still, there are nineteen prizes,
 so your odds must be, oh, well, not too awful anyway.
@field #3698 = initial : Behind the barker is a huge drilled board,
 and inside each little numbered hole is a rolled-up lottery ticket.
@field #3698 = is_static : 1
@field #3698 = is_container : 1
@field #3698 = is_open : 1
@field #3698 = on_before : The barker is burly, and won't let you tamper
 with the board.
@field #3698 = on_receive : @switch(1,
 @getfield(@getfield(#insert,"t1"),"is_ticket"),"\"No changes of mind,
 that's your ticket now! Give it to me if you want to play it.\"",
 "The barker is burly, and won't let you tamper with the board.");

rolled-up ticket from the board (#3805)

@create rolled-up ticket from the board;lottery tickets;lottery ticket;ticket
@zone #3805 = #2361
@link #3805 = #2461
@lock #3805 = #-1
@set #3805 = dark
@field #3805 = parent : 3698
@field #3805 = article : a
@field #3805 = is_ticket : 1
@field #3805 = number : -1
@field #3805 = reset : @move(3805,2461); @setfield(3805,"parent",2461);

barker (#3779)

@create barker;burly man;burly barker;man
@zone #3779 = #2361
@link #3779 = #2461
@lock #3779 = #-1
@set #3779 = dark
@field #3779 = is_animate : 1
@field #3779 = is_male : 1
@field #3779 = is_scenery : 1
@field #3779 = number : 0
@field #3779 = reset : @move(3779,2461); @setfield(3779,"number",0);
@field #3779 = desc : A boxer gone to seed who failed as a magician all down the coast, that'd be your guess.
@field #3779 = on_attack : No way. He must weigh twice what you do.
@field #3779 = on_kiss : No way. He must weigh twice what you do.
@field #3779 = life : The barker glowers at you.
@field #3779 = on_bozbar : He's not that much of an animal.
@field #3779 = on_lobal : His problem is listening, not hearing.
@field #3779 = on_caskly : For a moment his hair seems to comb itself. Irritated, he ruffles it again, and the spell dies an ignominious death.
@field #3779 = on_yomin :
 @switch(1,
  @or(@getfield(3723,"is_moved"),@getfield(3724,"is_moved")),
   "The barker's mind is a heap of grumbles about lost prizes and scrawny Enchanters.",
  @eq(@getfield(3779,"is_general"),""),@print(
   @setfield(3379,"is_general",1),
   "\"Hope that scrawny Enchanter doesn't pick 2306!\" thinks the barker (slowly)."
  ),
  "\"If that mark does win, hope it's only worthless old 5802,\" ponders the barker."
 );
---
@field #3779 = on_yomin : @switch(1, @or(@getfield(3723,"is_moved"),@getfield(3724,"is_moved")), "The barker's mind is a heap of grumbles about lost prizes and scrawny Enchanters.", @eq(@getfield(3779,"is_general"),""),@print(@setfield(3379,"is_general",1),"\"Hope that scrawny Enchanter doesn't pick 2306!\" thinks the barker (slowly)."),"\"If that mark does win, hope it's only worthless old 5802,\" ponders the barker.");
===
@field #3779 = on_ask:
 // build x0 from %1, replacing spaces with underscores
 @s("x0","");
 @strloop("%1","x",@switch("%x"," ",
  @s("x0",@print(x0,"_")),@s("x0",@print(x0,"%x"))
 ));
 // trim leading 'a', 'an', 'the' from x0
 @switch(@substr(x0,0,2),"a_",@s("x0",@substr(x0,2)));
 @switch(@substr(x0,0,3),"an_",@s("x0",@substr(x0,3)));
 @switch(@substr(x0,0,4),"the_",@s("x0",@substr(x0,4)));
 // if field x0's value begins with "t_", replace x0 with @g(x0)
 @s("x0",@print("t_",x0));
 @switch(@substr(@g(x0),0,3), "t_", @s("x0",@g(x0)));
 @switch(@g(x0),"",t_default,@g(x0));
---
@field #3779 = on_ask: @s("x0",""); @strloop("%1","x",@switch("%x"," ", @s("x0",@print(x0,"_")),@s("x0",@print(x0,"%x")))); @switch(@substr(x0,0,2),"a_",@s("x0",@substr(x0,2))); @switch(@substr(x0,0,3),"an_",@s("x0",@substr(x0,3))); @switch(@substr(x0,0,4),"the_",@s("x0",@substr(x0,4))); @s("x0",@print("t_",x0)); @switch(@substr(@g(x0),0,3), "t_", @s("x0",@g(x0))); @switch(@g(x0),"",t_default,@g(x0));
===
 
@field #3779 = t_prize : t_prizes
@field #3779 = t_prizes : "Just one silver coin and a prize could be yours!"
@field #3779 = t_white_featureless_cube : t_cube
@field #3779 = t_featureless_white_cube : t_cube
@field #3779 = t_featureless_cube : t_cube
@field #3779 = t_white_cube : t_cube
@field #3779 = t_featureless : t_cube
@field #3779 = t_white : t_cube
@field #3779 = t_cube : He blows the dust off it. "Genuine antique, that."
@field #3779 = t_cuddly_toy_elephant : t_elephant
@field #3779 = t_cuddly_elephant : t_elephant
@field #3779 = t_toy_elephant : t_elephant
@field #3779 = t_cuddly : t_elephant
@field #3779 = t_toy : t_elephant
@field #3779 = t_elephant : "Good quality merchandise," he says, in a way that suggests he can only spell one of those three words.
@field #3779 = t_lottery_tickets : t_ticket
@field #3779 = t_lottery_ticket : t_ticket
@field #3779 = t_lottery : t_ticket
@field #3779 = t_tickets : t_ticket
@field #3779 = t_ticket : "Three tickets for one silver coin!"
@field #3779 = t_default : "Just play the game, bub."

@field #3779 = on_give :
 @switch(1,
  @getfield(t1,"is_ticket"),@print(
   @move(t1,2615), @setfield(t1,"parent",2615),
   @switch(@getfield(t1,"number"),
   2306,@print(
    @move(3723,2376),@setfield(3723,"parent",3529),
    @setfield(3723,"is_moved",1),
    @move(3803,2651),@setfield(3803,"parent",2651),
    "With very bad grace, the barker shoves the cuddly toy elephant into your arms."
   ),5802,@print(
    @move(3724,2376),@setfield(3724,"parent",3529),
    @setfield(3724,"is_moved",1),
    @move(3804,2651),@setfield(3804,"parent",2651),
    @setfield(3529,"score",@add(5,@getfield(3529,"score"))),
    "With concealed relief, the barker shoves the featureless white cube into your hands."
   ),"\"Bad luck! You lose!\""
  )),
  @eq(@getfield(3779,"number"),2),"\"You've had enough goes already!\" he growls. No wonder trade is bad.",
  @eq(t1,3679),"\"Bronze! Not a chance, sunshine.\"",
  @eq(t1,2393),@print(
   @move(t1,2615), @setfield(t1,"parent",2615),
   @setfield(3698,"credit",@add(3,@getfield(3698,"credit"))),
   @setfield(3779,"number",@add(1,@getfield(3779,"number"))),
   "Grudgingly the barker takes the silver coin and stands
   back to let you at the board, arms folded."
  ),
  @eq(@shortname(t1),"gold coin"),@print(
   @move(t1,2615), @setfield(t1,"parent",2615),
   @setfield(3698,"credit",@add(3,@getfield(3698,"credit"))),
   @setfield(3779,"number",@add(1,@getfield(3779,"number"))),
   "Gleefully the barker snatches the gold coin. \"Sorry
   bub, no change. Business is slack today!\""
  ),
  "\"What do you call that? One silver coin to play!\""
 );
---
@field #3779 = on_give : @switch(1, @getfield(t1,"is_ticket"),@print( @move(t1,2615), @setfield(t1,"parent",2615), @switch(@getfield(t1,"number"), 2306,@print( @move(3723,2376),@setfield(3723,"parent",3529), @setfield(3723,"is_moved",1), @move(3803,2651),@setfield(3803,"parent",2651),"With very bad grace, the barker shoves the cuddly toy elephant into your arms."),5802,@print( @move(3724,2376),@setfield(3724,"parent",3529), @setfield(3724,"is_moved",1), @move(3804,2651),@setfield(3804,"parent",2651), @setfield(3529,"score",@add(5,@getfield(3529,"score"))), "With concealed relief, the barker shoves the featureless white cube into your hands."),"\"Bad luck! You lose!\"")), @eq(@getfield(3779,"number"),2),"\"You've had enough goes already!\" he growls. No wonder trade is bad.", @eq(t1,3679),"\"Bronze! Not a chance, sunshine.\"", @eq(t1,2393),@print(@move(t1,2615), @setfield(t1,"parent",2615), @setfield(3698,"credit",@add(3,@getfield(3698,"credit"))), @setfield(3779,"number",@add(1,@getfield(3779,"number"))), "Grudgingly the barker takes the silver coin and stands back to let you at the board, arms folded."), @eq(@shortname(t1),"gold coin"),@print(@move(t1,2615), @setfield(t1,"parent",2615), @setfield(3698,"credit",@add(3,@getfield(3698,"credit"))), @setfield(3779,"number",@add(1,@getfield(3779,"number"))), "Gleefully the barker snatches the gold coin. \"Sorry bub, no change. Business is slack today!\""), "\"What do you call that? One silver coin to play!\"");
===

prizes (#3796)

@create prizes
@zone #3796 = #2361
@link #3796 = #2461
@lock #3796 = #-1
@set #3796 = dark
@field #3796 = parent : 2461
@field #3796 = reset : @move(3796,2461);
@field #3796 = is_scenery : 1
@field #3796 = on_before : "Hands off those prizes!"
@field #3796 = desc : "Hands off those prizes!"

prize elephant (#3803)

@create prize elephant;elephant prize;prize toy;toy prize;
 cuddly elephant;cuddly prize;cuddly toy elephant;cuddly toy;
 elephant;prize;toy
---
@create prize elephant;elephant prize;prize toy;toy prize;cuddly elephant;cuddly prize;cuddly toy elephant;cuddly toy;elephant;prize;toy
===
@zone #3803 = #2361
@link #3803 = #2461
@lock #3803 = #-1
@set #3803 = dark
@field #3803 = parent : 2461
@field #3803 = reset : @move(3803,2461); @setfield(3803,"parent",2461);
@field #3803 = desc : Pink, cuddly, toy, elephant. Says it all, really.
@field #3803 = on_before : "Hands off those prizes!"
@field #3803 = is_scenery : 1

prize cube (#3804)

@create prize cube;white prize cube;prize featureless white cube;prize;prize white cube;featureless white cube;blank white cube;white cube;featureless cube;blank cube;cube
@zone #3804 = #2361
@link #3804 = #2461
@lock #3804 = #-1
@set #3804 = dark
@field #3804 = parent : 2461
@field #3804 = reset : @move(3804,2461); @setfield(3804,"parent",2461);
@field #3804 = desc : Wouldn't you like to win it?
@field #3804 = on_before : "Hands off those prizes!"
@field #3804 = is_scenery : 1

Boneyard (#2464)

@dig Boneyard
@zone #2464 = #2361
@field #2464 = ignore_names : bones;shoulder blades;blades;skulls
@desc #2464 = This is a room of bones. Shoulder blades make up the floor,
 skulls the walls and leg-bones the door frames. The west exit leads into
 darkness, but the doorway to the north opens onto a seemingly normal scene.
@field #2464 = obj_north : 2470
@field #2464 = obj_west : 2467
@field #2464 = obj_worthless_scroll : 3700
@field #2464 = obj_filfre_spell : 3701
@field #2464 = reset :
@field #2464 = metareset :
 @setfield(2464,"reset","");
 @fieldloop(2464,"obj_",@setfield(2464,"reset",@print(
  @getfield(2464,"reset"),@getfield("%v","reset")
 )));
---
@field #2464 = metareset : @setfield(2464,"reset",""); @fieldloop(2464,"obj_",@setfield(2464,"reset",@print( @getfield(2464,"reset"),@getfield("%v","reset"))));
===

north (#2470)

// Go from Boneyard to either Inside Cave (2452) or Grasslands (2326).
// If scales (3621) balanced, go to grasslands; else go to cave.
@open north;n = nowhere
@field #2470 = reset : @move(2470,2464);
@field #2470 = action2 : 2326
@succ #2470 = @setfield(2470,"action2",@switch(
 @getfield(3621,"number"),0,2326,2452));
 @execute(@getfield(2376,"fn_moveplayers"));
---
@succ #2470 = @setfield(2470,"action2",@switch( @getfield(3621,"number"),0,2326,2452)); @execute(@getfield(2376,"fn_moveplayers"));
===

west (#2467)

@open west;w = nowhere
@field #2467 = reset : @move(2467,2464);
@succ #2467 = @tellroom(@location("%#"),"","%n >west%cSome magical force
 blocks your way, as though that doorway led into adventures from your
 past which you cannot rejoin now.");
@field #2467 = desc : You can make out nothing to the west.
@field #2467 = on_search : You can make out nothing to the west.

worthless scroll (#3700)

// has the filfre spell
@create worthless scroll;scroll
@zone #3700 = #2361
@link #3700 = #2464
@lock #3700 = #-1
@set #3700 = dark
@field #3700 = parent : 2464
@field #3700 = reset : @move(3700,2464); @setfield(3700,"parent",2464);
 @setfield(3700,"child",3701); @setfield(3700,"is_general","");
 @setfield(3700,"is_moved","");
@field #3700 = is_scroll : 1
@field #3700 = initial : You are almost treading on a worthless scroll.
@field #3700 = child : 3701

filfre spell (#3701)

@create filfre spell;filfre
@zone #3701 = #2361
@link #3701 = #2464
@lock #3701 = #-1
@set #3701 = dark
@field #3701 = reset : @move(3701,2464); @setfield(3701,"parent",3700);
 @setfield(3701,"number",0); @setfield(3701,"is_known","");
 @setfield(3701,"is_reversed",""); @setfield(3701,"is_scored","");
@field #3701 = is_spell : 1
@field #3701 = the_spellcode : K
@field #3701 = sname : filfre
@field #3701 = article : the
@field #3701 = number : 0
@field #3701 = parent : 3700
@field #3701 = purpose : produce gratuitous fireworks

Track, outside Temple (#2475)

@dig Track, outside Temple
@zone #2475 = #2361
@desc #2475 = This is the end of a long track winding through desolate
 hills, which runs back west up to the ridge.
@field #2475 = on_listen :
 @switch(@getfield(3529,"hearing_good"),0,
 "The chanting is too quiet to make out.",
 "The endlessly repeating threnody of the monks tells of
 the legend of one who will some day enlighten their order,
 and so be taken up to a higher plane. He (or she,
 presumably) is known as The Four-Cubed One.");
@field #2475 = obj_west : 3763
@field #2475 = obj_temple : 3764
@field #2475 = metareset :
 @setfield(2475,"reset","");
 @fieldloop(2475,"obj_",@setfield(2475,"reset",@print(
  @getfield(2475,"reset"),@getfield("%v","reset")
 )));
---
@field #2475 = metareset : @setfield(2475,"reset",""); @fieldloop(2475,"obj_",@setfield(2475,"reset",@print( @getfield(2475,"reset"),@getfield("%v","reset"))));
===

west (#3763) - from Track to Crest

@open west;w;up;u = nowhere
@field #3763 = action2 : 2439
@field #3763 = reset : @move(3763,2475);
@succ #3763 = @tellroom(@location("%#"),"","%n >west"); @execute(@getfield(2376,"fn_moveplayers"));

cubical Temple (#3764)

@create cubical Temple;cube temple;enormous temple;enormous cube;enormous cube temple;enormous cubical temple;temple
@zone #3764 = #2361
@lock #3764 = #-1
@link #3764 = #2475
@set #3764 = dark
@field #3764 = parent : 2475
@field #3764 = reset : @move(3764,2475);
@field #3764 = is_static : 1
@field #3764 = on_enter : The Temple is featureless and unbroken. Perhaps the top is open, because the sound must come from somewhere... but you wouldn't bet on it.
@field #3764 = on_rezrov : The huge temple remains impassive at your relatively puny enchantment.
@field #3764 = desc : It's much like every other gigantic temple in the shape of a featureless white cube you've ever seen. No obvious way in.
@field #3764 = describe :
 @print("%cYou stand outside an enormous temple in the shape of a
 perfect, featureless white cube, four hundred feet on a
 side. From somewhere within you hear the ",
 @switch(@getfield(3529,"hearing_good"),1,"bellowing noise","tiny sound"),
 " of the monks chanting.");
---
@field #3764 = describe : @print("%cYou stand outside an enormous temple in the shape of a perfect, featureless white cube, four hundred feet on a side. From somewhere within you hear the ", @switch(@getfield(3529,"hearing_good"),1,"bellowing noise","tiny sound"), " of the monks chanting.");
===
@field #3764 = on_frotz :
 @print(
  @s("j",0),
  @contentsloop(@location("%#"),"x",@switch(1,
   @and(@eq(@getfield("%x","parent"),3529),@getfield("%x","is_cube")),
   @s("j",@add(1,@g("j")))
  )),
  @switch(@g("j"),
   0,"The temple shakes, but then is still again.",
   {1,2,3},"The temple shakes! White light plays
   over your hands and possessions, but then all is still again.",
   @print(
    "The temple shakes and white light bathes you. 
    Smoothly it unfolds itself in a four-dimensional
    way your senses can barely comprehend. All you
    know is that when it is over, you find yourself in...%c",
    @setfield(3529,"hearing_good",0),
    @setfield(3529,"score",@add(5,@getfield(3529,"score"))),
    @s("action2",2476),
    @execute(@getfield(2376,"fn_moveplayers2"))
   )
  )
 );
---
@field #3764 = on_frotz : @print(@s("j",0), @contentsloop(@location("%#"),"x",@switch(1, @and(@eq(@getfield("%x","parent"),3529),@getfield("%x","is_cube")), @s("j",@add(1,@g("j"))))), @switch(@g("j"), 0,"The temple shakes, but then is still again.", {1,2,3},"The temple shakes! White light plays over your hands and possessions, but then all is still again.", @print("The temple shakes and white light bathes you. Smoothly it unfolds itself in a four-dimensional way your senses can barely comprehend. All you know is that when it is over, you find yourself in...%c", @setfield(3529,"hearing_good",0), @setfield(3529,"score",@add(5,@getfield(3529,"score"))), @s("action2",2476), @execute(@getfield(2376,"fn_moveplayers2")))));
===

Balance Room (#2476)

@dig Balance Room
@zone #2476 = #2361
@desc #2476 = This seems to be the inside of a featureless white cube, forty feet on a side. The air is stale and there is no exit.
@field #2476 = obj_image : 3748
@field #2476 = obj_podium : 3761
@field #2476 = metareset :
 @setfield(2476,"reset","");
 @fieldloop(2476,"obj_",@setfield(2476,"reset",@print(
  @getfield(2476,"reset"),@getfield("%v","reset")
 )));
---
@field #2476 = metareset : @setfield(2476,"reset",""); @fieldloop(2476,"obj_",@setfield(2476,"reset",@print( @getfield(2476,"reset"),@getfield("%v","reset"))));
===

image of the scales (#3748)

@create image of the scales;image of the pair of scales;image of a pair of scales;image of scales;image of pair of scales;pair of scales;scales;image
@zone #3748 = #2361
@link #3748 = #2476
@lock #3748 = #-1
@set #3748 = dark
@field #3748 = parent : 2476
@field #3748 = reset : @move(3748,2476);
@field #3748 = article : the
@field #3748 = initial : The image of a pair of scales hangs high in the air. One pan is much lower than the other.
@field #3748 = is_static : 1
@field #3748 = on_before : It's only an image.

dusty podium (#3761)

@create dusty podium;podium;cobwebs;cobwebbed podium
@zone #3761 = #2361
@link #3761 = #2476
@lock #3761 = #-1
@set #3761 = dark
@field #3761 = parent : 2476
@field #3761 = reset : @move(3761,2476); @setfield(3761,"parent",2476);
@field #3761 = initial : Far below the scales, in the centre of the "floor", is a predictably-shaped podium, but it is so dusty and cobwebbed that you can't see what it once was.
@field #3761 = is_static : 1
@field #3761 = on_caskly : Nice try, but it is protected from enchantment.
@field #3761 = on_cast : However dusty it is, the podium is still protected from casual enchantment.
@field #3761 = on_rub : @print(
 @move(3761,2651), @setfield(3761,"parent",2651),
 @move(3882,2476), @setfield(3882,"parent",2476),
 @move(3897,2476), @move(3901,2476),
 @move(3915,2476), @move(3919,2476), @move(3926,2476),
 "No substitute for old-fashioned hard work, sometimes,
 and after much patient (sneezy) scrubbing, the podium
 appears in its true white glory.  Set into it are four
 sockets, arranged in a two by two square."
 );
---
@field #3761 = on_rub : @print( @move(3761,2651), @setfield(3761,"parent",2651), @move(3882,2476), @setfield(3882,"parent",2476), @move(3897,2476), @move(3901,2476), @move(3915,2476), @move(3919,2476), @move(3926,2476), "No substitute for old-fashioned hard work, sometimes, and after much patient (sneezy) scrubbing, the podium appears in its true white glory.  Set into it are four sockets, arranged in a two by two square.");
===
is_known field Attribute reversed; ! Effect of this known spell reversed Note: let the chewed scroll be called "illegible scroll" [ ReadableSpell i j k; if (scope_stage==1) { if (action_to_be==##Examine) rfalse; rtrue; } if (scope_stage==2) { objectloop (i in player) if (i ofclass SpellBook) { for (k=0:kk~=0:k++) { j=(i.&array_of_spells)- ->k; PlaceInScope(j); } } rtrue; } ! No need for scope_stage 3 (the error stage), because our ! ParserError routine handles that case instead ]; Global the_spell_was = gnusto_spell; [ CastOneSub; ; ]; [ CastSub; the_spell_was = noun; memory.forget_spell(noun); if (noun has reversed) { give noun ~reversed; if (noun.unmagic() ~= 0) return; "Nothing happens."; } if (second ~= 0) { ResetVagueWords(second); ! Set "it", "him", "her" if (second provides before && second.before() ~= 0) return; ! Run before routine(s) } if (noun.magic() ~= 0) return; "Nothing happens."; ]; [ ParserError x i flag vb; if (etype==VERB_PE or ASKSCOPE_PE) { if (etype==ASKSCOPE_PE) { if (verb_word=='cast') vb=1; if (verb_word=='learn' or 'memorise' or 'memorize') vb=2; if (verb_word=='copy') vb=3; if (vb==0) { etype=CANTSEE_PE; rfalse; } } wn=verb_wordnum; if (vb~=0) wn++; x=NextWordStopped(); for (i=player+1:i<=top_object:i++) if (i ofclass Spell && Refers(i,x)==1 && i has known_about) flag=1; if (flag==1) { if (vb==0 or 1) "You haven't got that spell committed to memory. [Type ~spells~ to see what you do remember.]"; if (vb==2) "Your training is such that you can only memorise such a spell with the aid of a spell book containing it."; if (vb==3) "You have no text of that spell to copy."; } if (vb==1) "You haven't learned that spell, if indeed it is a spell."; if (vb==2 or 3) "You haven't access to that spell, if indeed it is a spell."; } rfalse; ]; [ ChooseObjects obj code; if (code<2) rfalse; if (action_to_be==##WriteOn && obj in player) return 9; return 0; ]; [ Topic i; if (scope_stage==1) return 0; if (scope_stage==2) { objectloop (i ofclass Question) PlaceInScope(i); rtrue; } "At the moment, even the simplest questions confuse you."; ]; -->

*** You have won/died *** (dbref #12902)

@dig *** You have died ***
@exec @setfield(12902,"name","   *** You have died ***")
@desc #12902 = @print("%cIn that game you scored ",@getfield(3529,"score"),
 " out of a possible 51, in ",@getfield(3529,"turns"), " turns, earning you the rank of ",
 @switch(1, @gt(@getfield(3529,"score"),49),"Scientist.",
 @gt(@getfield(3529,"score"),39),"Spellbreaker.",
 @gt(@getfield(3529,"score"),29),"Sorcerer.",
 @gt(@getfield(3529,"score"),19),"Enchanter.",
 @gt(@getfield(3529,"score"),9),"novice Enchanter.", "lost dreamer."),
 "%c%cWould you like to RESTART, return to the LOUNGE, or use the HOLODECK EXIT?");
---
@desc #12902 = @print("%cIn that game you scored ",@getfield(3529,"score"), " out of a possible 51, in ",@getfield(3529,"turns"), " turns, earning you the rank of ", @switch(1, @gt(@getfield(3529,"score"),49),"Scientist.", @gt(@getfield(3529,"score"),39),"Spellbreaker.", @gt(@getfield(3529,"score"),29),"Sorcerer.", @gt(@getfield(3529,"score"),19),"Enchanter.", @gt(@getfield(3529,"score"),9),"novice Enchanter.", "lost dreamer."), "%c%cWould you like to RESTART, return to the LOUNGE, or use the HOLODECK EXIT?");
===