-
<Game.class> encapsulates all the methods and operations of this game, the Main.class only need to contain few lines of the codes that the whole game could run.
-
<Role.class> is the super class of the <Monster.class> and <Hero.classes>, the two classes are generated from this class because there are something in common, so I encapsulated some members and methods in this class for them to use.
-
<Hero.class> contains all the operations of heroes;
-
<HeroParty.class> creates a list of heroes (hero party) and contains all the operations of Hero Party.
-
<HeroFactory.class> uses the Factory Pattern and helps to create instances of different types of Heroes.
-
<Warrior.class> <Sorcerer.class> <Paladins.class> are three types of heroes, they are subclasses of the Hero class;
-
<Monster.class> contains all the operations of monster.
-
<MonsterGroup.class> creates a list of monsters and contains all the operations of Monster Group.
-
<MonsterFactory.class> uses the Factory Pattern and helps to create instances of different types of monsters.
-
<Product.class> is the super class of <Weapon.class> <Armor.class> <Spell.class> <Potion.class>.
-
<Weapon.class> encapsulates all the operations of weapons.
-
<Armor.class> encapsulates all the operations of armors.
-
<Spell.class> encapsulates all the operations of spells.
-
<Potion.class> encapsulates all the operations of potions.
-
<IceSpell.class> <FireSpell.class> <LightningSpell.class> are extends from <Spell.class>.
-
<ProductFactory.class> uses the Factory Pattern and helps to create instances of different types of Products.
-
<SpellFactory.class> uses the Factory Pattern and helps to create instances of different types of Spells.
-
<Market.class> accomplishes a market and its methods.
-
<Cell.class> is the super class of <InaccessibleCell.class> <MarketCell.class> <CommonCell.class>.
-
<MarketCell.class> is a cell with the market, heroes could enter the cell and choose whether to go to the market.
-
<CommonCell.class> contains all the methods that are related to this cell, the battle begins on this cell.
-
<Map.class> is to show the 8*8 cells on it.
-
<Battle.class> encapsulates all the details of the battles, a common cell has an instance of battle.
-
<Dragon.class> <Exoskeleton.class> <Spirits.class> are extended from <Monster.class>.
-
<OperationAttack.class> <OperationCastSpell.class> <OperationEquip.class> <OperationUsePotion.class> use Strategy Pattern to handle the operations of heroes.
-
<OperationFactory.class> uses the Factory Pattern and helps to create instances of different types of Operations
-
<Context.class> accomplishes the Strategy Pattern and operations.
-
<Inventory.class> has the list of products, is designed for hero, which encapsulates methods related to the hero's inventory.
- Navigate to the directory "main" after unzipping the files
- Run the following instructions:
Output: Welcome to Legends: Monsters and Heroes! How many heroes do you want to play with? Input: 3 Output:What kind of hero do you want to choose? Input: Warrior Output: (A list of Warriors) Please enter the Hero's name: Input: Eunoia_Cyn ...
Output: Name Level Mana Strength Agility Dexterity Starting money Starting experience
Eunoia_Cyn 1 400 700 800 600 2500.0 6
Kalabar 1 800 850 400 600 2500.0 6
| | X | | M | X | M | |
| | | X | | X | X | |
| X | | M | | X | | |
| | X | | X | M | | M |
| M | | | M | | M | X |
| M | | X | | | X | |
| M | | M | | M | | M |
Output: Please enter your move:
Input: d
Output: Your current location is: (2, 1) Name Level Damage Defense Dodge chance DocOck 600 600 55 Merrsha 1000 900 55 Casper 100 100 50 The monster group is created! The battle begins! Eunoia_CynIt's your turn, do you want to display the statistics? (Yes / No) ... <Output: > Eunoia_CynIt's your turn, please enter your activity: (Attack / Spell / Potion / Equip) <Input: > Attack <Output: > Please enter the name of the Monster you are gonna attack: <Input: > DocOck ... <Output: > Eunoia_CynIt attacked DocOck for 100 damage! ...