Program Description
When the 10x10 map is generated the following items must be placed randomly without any overlap: 2 full health energy potion, 6 monsters, and 2 scared farmers. The hero starts with 100 health, a dagger that does between 10-30 damage, and no armor. Each item should not overlap with any other item.
A printout of the state of the map should be displayed each time the Hero moves. The Hero will interact with an object if he is next to an object, which means he is to the direct west, east, north or south of the object. The hero will not interact with an object if he is diagonal to the object. If the hero is "touching" more than one object at a time, he will interact in the following order: potions, farmers, then monsters. Also, objects will be invisible until they are first interacted with. Once an object has interacted with the Hero, they will appear on the map for the rest of the game.
When first spoken to, one of the scared farmers will say something along the lines of “My sheep have been taken… My family is gone and I have nothing left except for bronze amor I have buried… Only a true hero will receive this.” The second farmer will say something similar referencing a broad sword(attack 20-50). The first farmer will give the Hero his armor(reduces attack damage by 1/3) only when 2 of the monsters have been killed. The second farmer will give the Hero his broad sword when 4 of the monsters have been killed. Farmers must give the Hero objects of each type that are in their possession. The Hero will replace his current weapon, or armor, object with the one he is given.
The purpose of the game is to gather all the items and defeat all the monsters. Feel free to insert a magical ending such as a fairy rising out of the chest of the final monster and restoring Hero’s memory which he lost after the wax melted from his wings as he foolishly tried to fly higher than the sun. Ending with the fairy transporting the Hero to the land in the clouds with his wings restored. Alternatively, you can change the setting and characters, while keeping the same game elements.
The player should be prompted to type in the following commands: w(north), s(south), d(east), and a(west). When the hero discovers an item, it is automatically equipped or used. The hero runs into a monster when he occupies the same space as the monster. When this happens, the monster’s stats should be printed out, showing their health, attack level and speed. The hero and monster should automatically begin to fight. The fight screen should prompt the hero to either attack or run. The hero can run 75% of the time if the monster has a speed of 0. If the monster has a speed of 1, the hero can run 50% of the time. If the monster has a speed of 2, the hero can run 25% of the time and if the monster has a speed of 3, the hero can never run away.
Sample Output
** Hero & Monsters ** * The map has been generated * * The enemies have been placed * * The items have been placed * ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- H--------- Hero begins his journey in the Southwest corner of Yore. Potions: 0 Enter direction (wasd) or 'p' to use a potion: w ---------- ---------- ---------- ---------- ---------- ---------- ---------- P--------- H--------- ---------- Hero finds a potion! Potions: 1 Enter direction (wasd) or 'p' to use a potion: w ---------- ---------- ---------- ---------- ---------- ---------- ---------- HM-------- ---------- ---------- Hero encounters a monster! The monster engages! Enter an action ('r' to run, 'a' to attack, or 'p' to use a potion): r Hero tries to run! The monster is too fast! The monster attacks! Hero’s energy goes down to 85/100 Enter an action ('r' to run, 'a' to attack, or 'p' to use a potion): r Hero tries to run! The monster is too fast! The monster attacks! Hero’s energy goes down to 68/100 Enter an action ('r' to run, 'a' to attack, or 'p' to use a potion): a Hero attacks and deals out 15 damage! The monster attacks! Hero’s energy goes down to 52/100 Enter an action ('r' to run, 'a' to attack, or 'p' to use a potion): a Hero attacks and deals out 17 damage! The monster attacks! Hero’s energy goes down to 22/100 Enter an action ('r' to run, 'a' to attack, or 'p' to use a potion): r Hero tries to run! The monster is too fast! The monster attacks! Hero’s energy goes down to 5/100 Enter an action ('r' to run, 'a' to attack, or 'p' to use a potion): r Hero tries to run! The monster is too fast! The monster attacks! Hero’s energy goes down to 0/100 * Hero collapses and is struck a deadly blow by Monster * ** Monsters in the surrounding area converge on the carcass. **