Index / last update: December 2002
Balances © 1994, 1995, 1996 by Graham Nelson
Unvisitable Rooms:
Real Rooms:
Virtual Rooms:
This simulation is as yet incomplete. Notes to come.
@dig Balances Zone @desc #2361 = Contains all global verbs for the game "Balances".
@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");
@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");
===
@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");
===
@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",""))));
===
@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."))));
===
@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");
===
@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");
===
@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");
===
@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");
===
@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");
===
@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");
===
@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",""))));
===
@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");
===
@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",""))));
===
@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");
===
@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);
===
@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);
@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");
===
@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");
===
//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");
===
@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");
===
@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))));
===
@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."));
===
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"));
===
@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 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);
];
@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");
===
@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");
===
@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");
===
@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)));
===
@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",""))));
===
@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");
===
@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");
====
@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");
===
@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");
===
@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");
===
@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;
];
@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"));
@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");
===
@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");
===
@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.");
===
@open wait;z = nowhere
@succ #3819 = @tellroom(@location("%#"),"","%n >wait%cTime passes."); @call(3529,"each_turn");
@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");
===
@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");
===
@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");
===
@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",""))));
===
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"))));
===
@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); ===
@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 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",""); ===