Program 4 Dordal Due: December 6, 2002 You are to modify the game program presented in class, adding the following features: 1. Add a second lantern or other Lightable. Try to do this in such a way that you don't need to keep these Lightable objects as global variables, although that is an acceptable way to do it. 2. If you eat the chocolate, it should go away. Optional: the chocolate should last 2-3 bites. Keep the number of bites left as an attribute of the chocolate itself. 3. Introduce a puzzle room where you cannot *leave* the room until some action occurs. Possibilities are: You have to FIGHT the dragon (with a SWORD?) You have to GIVE the dragon a PRESENT or COOKIE. There is a cave-in and you have to DIG (with SHOVEL?) 4. You are to add one additional puzzle of your own. Your puzzle should, at a minimum, involve the following: one new CarryObj one new verb one new derived room class, with special behavior for at least one verb (new or existing). some kind of state change to the room or to an object (like the stone being moved or valve being turned) Here are a few possibilities. UNLOCK CHEST with a KEY found elsewhere; once the chest is unlocked, something should be inside. Cross a rickety two-move bridge over a bottomless pit; if you carry too much the bridge will break; you can only carry two things at a time. Have goblins attack you in a pitch-black cave room, if you fail to LIGHT LANTERN within 2 turns. Note that this puzzle involves keeping count of turns. You need to CAST SPELL in the WizardsChamber, but in order to do this you must first find in the game a BELL, BOOK, and CANDLE. (And maybe LIGHT CANDLE? Or maybe, in the simpler direction, just find NEWTEYE and BATWING. If you try to CAST SPELL and don't have the ingredients, the game should tell you what you're missing.) Be sure all verbs you introduce are handled at some primitive level by default_interpret(), so that they're not completely unrecognized even if you're not in the "right" room.