Constant Story "^"; Constant Headline "Winnie The Pooh's Adventure^ By Brandon Hansen^ Compiled: 12/10/2002^"; Constant MAX_SCORE 4; Serial "021210"; Release 1; Include "Parser"; Include "VerbLib"; global checkrabbit=0; global checkowl=0; ! Flag to check if player has talked to owl global checkkanga=0; ! Flag to check to see if player has talked to kanga global haskeytocloset=0; !Flag to fix a bug in inform where the object disappears from inventory [ Initialise; location = House; !Put the player in the house switch (random(7)){ ! Randomly put the carrot in the field 0: move Carrot to Bottom_west_carrot_field; 1: move Carrot to Bottom_east_carrot_field; 2: move Carrot to Mid_west_carrot_field; 3: move Carrot to Mid_carrot_field; 4: move Carrot to Mid_east_carrot_field; 5: move Carrot to Top_east_carrot_field; 6: move Carrot to Top_mid_carrot_field; 7: move Carrot to Top_west_carrot_field; } StartDaemon(roo); !start the roo daemon puting a NPC that walks around in StartDaemon(youwin); !start the win daemon to end the game and let you win StartDaemon(put_honey_pot_in_cupboard); !Start the daemon to check if the honey is in the pot and the pot is in the cupboard move roo to Trail_East_1; !Move roo to his start location move Honey_pot to House; !Move the honey pot to the house fixing a bug ]; [ PrintRank; ! Print the score if the user types 'score' print ", earning you the rank of "; if (score >= 4) "Pooh."; if (score >= 3) "Christopher Robin."; if (score >= 2) "Tigger."; if (score >= 1) "Rabbit."; "Roo."; ]; Object House "House of Pooh" with description "You are in Pooh's house", out_to Front_Door, has light; Object -> Note "note" !Important note telling the player the objectives with name "note", description "Things to do for winter:^ 1.Put a full honey pot in the cupboards.^ 2.Talk to Rabbit.^ 3.Talk to Owl.^ 4.Talk to Kanga.^", inital "An important note is lying here"; Object Carrot "giant carrot" !Giant carrot for you to find and give to Rabbit with name "giant" "carrot", decription "A big carrot that is enough to last the whole winter"; Object Outside_house "Outside the House" with description "You are outside of Pooh's house. You notice that there is a bees nest above. There are 4 exits, north into the woods, back into Pooh's house through the door, east and west along a trail", ! s_to House, in_to Front_Door, n_to Woods_1, e_to Trail_East_1, w_to Trail_West_1, u_to Tree, has light; Object -> Sign "sign" with name "sign", description "Pooh's Abode: Watch out for falling honey!", has static; Object Woods_1 "Entering the Woods" with description "You have entered the the woods. It looks a little scary", s_to Outside_house, n_to Woods_2, has light; Object Woods_2 "Outside Owl's House In The Woods" with description "You are standing below Owl's House. It looks pretty dark to the north", before [; if (IndirectlyContains (player, flashlight)) give Dark_woods1 light;], !Give the woods to the north light if you have the flashlight u_to Owls_house_woods, n_to Dark_woods1, s_to Woods_1, has light; Object Owls_house_woods "Inside Owl's house" with description "You are in Owl's house. He looks discouraged. Maybe you should 'talk owl'", d_to Woods_2, before [; if (haskeytocloset==1) move key_to_closet to player;], !Fix a bug that takes your key out of the inventory has light; Object Owl "Owl" with name "owl", with description "An old wise Owl that has glasses.", before [; talk: if (location == Owls_house_woods && checkowl==1) {print "You tell the old wise owl your problem and he hands you his glasses"; move Owls_glasses to player; give key_to_closet ~concealed; } ; !Inital Talk with owl if (checkowl==0 && ~IndirectlyContains(player,key_to_closet)) {print "You ask Owl what's wrong and he says, He lost his key to his closet in the dark forest and is scared to go get it. Can you get it for him? He hands you a flashlight"; checkowl=1; move flashlight to player;} ; !Second talk with owl after exploring the woods he gives glasses that make the key not concealed if (IndirectlyContains(player,key_to_closet)) {print "Could you unlock the closet and open it for me since I don't have any hands?";};], !final talk with owl on what to do to get the score raised because I can't check if the closet is unlocked found_in Owls_house_woods, has static; Object Closet "closet" with name "closet", with description "A closet", with_key key_to_closet, after [; open: if (Closet has open) {score++; "Owl says, ~THANK YOU. Now I can be ready for Halloween!~";};], !Add one to score if closet has been opened found_in Owls_house_woods, has static openable container lockable door ~open locked; Object key_to_closet "key to the closet" !Key to the closet found in the woods need a light and owls glasses to make unconcealed with name "key" with description "A key to the closet", found_in Dark_woods2, has concealed; Object Dark_woods1 "Dark Woods" with description "Dark woods", before [; if (IndirectlyContains (player, flashlight)) give Dark_woods2 light ;], !Give the woods light if you have the flashlight s_to Woods_2, n_to Dark_woods2; Object Dark_woods2 "Dark Woods" with description [; if (IndirectlyContains(player,Owls_glasses)) "You are at the end of the dark woods."; !If you have the glasses then the key is there if (~IndirectlyContains(player,Owls_glasses)) "You have a funny feeling about the place. Maybe you should go ask the wise Owl for more help.";], !If you don't have the glasses yet ask owl for them after [; take: if (IndirectlyContains(player, key_to_closet)) haskeytocloset =1;], !Set the varible to make sure the player keeps the key after the bug s_to Dark_woods1; Object flashlight "flashlight" !Flashlight so you can go into the woods with description "A flashlight that is always on"; Object Owls_glasses "glasses"!Glasses that let you see the Key with description "The old and wise Owl's glasses. They give you a different perspective on things."; Object Trail_East_1 "On the Eastern Trail. You can continue on the trail east or you can go west to just outside Pooh's house" with description "East Trail", w_to Outside_house, e_to Trail_East_2, has light; Object Trail_East_2 "On the Eastern Trail" with description "You are at the end of the eastern trail. You see a hut to the north. You can make out that Kanga lives there.", n_to Kangas_hut, w_to Trail_East_1, has light; Object Kangas_hut "Inside Kanga's Hut" with description "You are inside the tiny hut made for 2. You see an exit to the south. Maybe you should 'talk kanga'", before [; drop: if (IndirectlyContains(player,roo)) {score++; remove roo; "Thanks for returning Roo to me!";}; !Add 1 to score if you drop roo here ], s_to Trail_East_2, has light; Object Kanga "Kanga" with name "kanga", with description "Kanga is pacing around since her little roo is missing.", before [; talk: if (checkkanga==0 && ~IndirectlyContains(player,roo)) {print "You ask Kanga what's wrong and She says that roo has run away. Please find him and bring him back!"; checkkanga=1;} ; !First time talking to kanga you get the mission to find roo if (IndirectlyContains(player,roo)) {print "Kanga says to drop roo right here";};],! Second time talking to kanga she tells you what to do with roo to get the points found_in Kangas_hut, has static; Object Trail_West_1 "On the Western Trail" with description "You are on the western trail. You can continue on the trail west or you can go east to just outside Pooh's house", e_to Outside_house, w_to Rabbits_hut_west, has light; Object Rabbits_hut_west "On the Western Trail" with description "You are on the western trail. You can see a hut downwards. You can see a field of carrots to the north.", e_to Trail_West_1, d_to Rabbits_hut, n_to Begin_field_carrots has light; Object Rabbits_hut "Rabbits Hut" with description [; if (IndirectlyContains(player,Carrot)) "Maybe you should 'talk rabbit' again."; !If you have the carrot you should talk to rabbit again to get the points if (~IndirectlyContains(player,Carrot)) "You are now in Rabbit's Hut. Maybe you should 'talk rabbit'";], !Inital talk to rabbit u_to Rabbits_hut_west, has light; Object Begin_field_carrots "Field of carrots"!Field of carrots 3x3 square with a random carrot position with description "You are in a field of carrots. Now if you could only find a big enough carrot to last Rabbit the winter.", s_to Rabbits_hut_west, n_to Mid_carrot_field, w_to Bottom_west_carrot_field, e_to Bottom_east_carrot_field, has light; Object Bottom_west_carrot_field "Field of carrots"!Field of carrots 3x3 square with a random carrot position with description "You are in a field of carrots. Now if you could only find a big enough carrot to last Rabbit the winter. You can see a exit to the east.", n_to Mid_west_carrot_field, e_to Begin_field_carrots, has light; Object Mid_carrot_field "Field of carrots"!Field of carrots 3x3 square with a random carrot position with description "You are in a field of carrots. Now if you could only find a big enough carrot to last Rabbit the winter. You can see an exit to the south.", s_to Begin_field_carrots, n_to Top_mid_carrot_field, w_to Mid_west_carrot_field, e_to Mid_east_carrot_field, has light; Object Bottom_east_carrot_field "Field of carrots"!Field of carrots 3x3 square with a random carrot position with description "You are in a field of carrots. Now if you could only find a big enough carrot to last Rabbit the winter. You can see an exit to the east.", w_to Begin_field_carrots, n_to Mid_east_carrot_field, has light; Object Mid_west_carrot_field "Field of carrots"!Field of carrots 3x3 square with a random carrot position with description "You are in a field of carrots. Now if you could only find a big enough carrot to last Rabbit the winter. You can see an exit to the south and east.", e_to Mid_carrot_field, s_to Bottom_west_carrot_field, n_to Top_west_carrot_field, has light; Object Mid_east_carrot_field "Field of carrots"!Field of carrots 3x3 square with a random carrot position with description "You are in a field of carrots. Now if you could only find a big enough carrot to last Rabbit the winter. You can see an exit to the south and west.", w_to Mid_carrot_field, s_to Bottom_east_carrot_field, n_to Top_west_carrot_field, has light; Object Top_west_carrot_field "Field of carrots"!Field of carrots 3x3 square with a random carrot position with description "You are in a field of carrots. Now if you could only find a big enough carrot to last Rabbit the winter. You can see an exit to the south and east.", s_to Mid_west_carrot_field, e_to Top_mid_carrot_field, has light; Object Top_mid_carrot_field "Field of carrots"!Field of carrots 3x3 square with a random carrot position with description "You are in a field of carrots. Now if you could only find a big enough carrot to last Rabbit the winter. You can see an exit to the south.", s_to Mid_carrot_field, w_to Top_west_carrot_field, e_to Top_east_carrot_field, has light; Object Top_east_carrot_field "Field of carrots"!Field of carrots 3x3 square with a random carrot position with description "You are in a field of carrots. Now if you could only find a big enough carrot to last Rabbit the winter. You can see an exit to the south and west.", w_to Top_mid_carrot_field, s_to Mid_east_carrot_field, has light; Object Rabbit "Rabbit" with name "rabbit" with description "A furry Rabbit.", before [; talk: if (location == Rabbits_Hut && checkrabbit==1 && IndirectlyContains(player, Carrot)) {print "Thanks for the carrot!!!"; remove Carrot; score++;} ; if (checkrabbit==0) {print "Hey! If you just go find me some carrots north of this place"; checkrabbit=1;} ;], found_in Rabbits_hut, has static; Object Tree "In the tree above Pooh's House. You see an exit down." !Tree with the honey with description "In the tree", d_to Outside_house, has light; Object Front_Door "front door" !Front door to pooh's house with name "front" "door", description "The front door is made of wood.", when_open "The front door is open.", when_closed "The front door is closed.", door_to [; if (location==House) return Outside_house; return House; ], door_dir [; if (location==House) return out_to; return in_to; ], found_in House Outside_house, has static door openable; Object Cupboards "cupboard" !Container taking a pot of honey to give player the points with name "cupboards" "cupboard", description [; if (IndirectlyContains(cupboards, Honey_pot)) { print "The cupboards are full with honey.";}; print "The cupboards are barren. Maybe if there was some honey in there you'd feel better.";], found_in House, has static container openable; Object Honey_pot "honey pot" !Holds honey with name "pot", description "A jar to hold honey.", has container openable; Object Honey "honey" with name "honey", found_in Tree; Object youwin "YOU WIN" !you win daemon with name "win", description "", daemon [; if (score == 4) deadflag =2; ]; Object put_honey_pot_in_cupboard "honey" !check if the honey is in the pot and the pot is in the cupboards with name "objective1", description "", daemon [; if (location == House && IndirectlyContains(Cupboards,Honey_pot) && IndirectlyContains(Honey_pot,Honey)) score++; ]; Object roo "roo" !Daemon to start roo walking and make him do stuff.... aka #include magic.h taken from inform-fiction.org with name "roo" , before [; take: move roo to player; "Roo jumps into your arms.";], each_turn "^Roo bounces around.", daemon [ direction roo_at way exit_count exit_chosen; if (random(5) ~= 1) rfalse; roo_at = parent(roo); objectloop (direction in compass) { way = roo_at.(direction.door_dir); if (way ofclass Object && way hasnt door) exit_count++; } if (exit_count == 0) rfalse; exit_chosen = random(exit_count); exit_count = 0; objectloop (direction in compass) { way = roo_at.(direction.door_dir); if (way ofclass Object && way hasnt door) exit_count++; if (exit_count == exit_chosen) { move self to way; if (roo_at == location) "^Roo bounces away!"; if (way == location) "^Roo bounces in!"; rfalse; } } ], has animate; verb 'talk' 'speak' * noun -> talk; !Define my own talk [ talkSub; ]; Include "Grammar";