| Constructor and Description |
|---|
ConsoleView() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkContinue()
Checks with the user by asking if they want to continue their quest.
|
java.lang.String |
displayMainMenu()
Displays a "menu" for the player.
|
void |
endGame()
Prints a goodbye message for completing the game.
|
void |
knightNotFound()
Prints
|
void |
listKnights(java.util.List<Knight> knights)
Lists the knights by id: name.
|
void |
printBattleText(java.util.List<MOB> monsters,
java.util.List<Knight> activeKnights)
Lists a number of knights side by side with their 'foes' (aka monsters).
|
void |
printBattleText(MOB dead)
Prints that the MOB was defeaed.
|
void |
printDefeated()
Prints when all knights are defeated
|
void |
printFortunes(java.util.List<Knight> activeKnights)
Prints fortunes for the knight that they draw at the beginning of the quest.
|
void |
printHelp()
Prints the help menu.
|
void |
setActiveFailed()
Prints the following message:
|
void |
showKnight(Knight knight)
Prints a knight to the console, plus a blank line.
|
void |
splashScreen()
Prints a splashScreen that is called at the launch of the game.
|
public void splashScreen()
splashScreen in interface GameViewpublic void endGame()
public java.lang.String displayMainMenu()
What would you like to do?
The clients response will be recorded, and returned out of the method.displayMainMenu in interface GameViewScanner.nextLine(),
Scanner,
System.inpublic void printHelp()
Unsure what to do, here are some options:
ls or list all - listing the knights
list active - list the active knights knights only
show name or id - show the knight details card
set active name or id - set knight as active (note: only 4 knights can be active)
remove active name or id - remove a knight from active status (heals knight)
explore or adventure or quest - find random monsters to fight
save filename - save the game to the file name (default: saveData.csv)
exit or goodbye - to leave the game
Game rules: You can have four active knights. As long as they are active, they won't heal,
but they can gain XP by going on adventures.
When you make a knight inactive, they will heal. How many monsters can you defeat
before, you have to heal?
Note the space before the options is the tab character.public void listKnights(java.util.List<Knight> knights)
1: Guinevere
2: Morrigan Ravenskind
3: Eriu
4: Danu of Ireland
5: Fodla
6: Banba
7: Igraine of the Lake
8: Anna of the Mountains
9: Morgan la Fay
10: Elaine Pendragon
11: Morgawse
12: Arthur
13: Lancelot
14: Gwain
15: Argodras the Red
16: The Green Knight
17: Cam the Ram
If no knights are found, it prints the following:
No knights to list
listKnights in interface GameViewknights - a set of knights to listKnight.getId(),
MOB.getName()public void knightNotFound()
Knight not found!
To the console.knightNotFound in interface GameViewpublic void showKnight(Knight knight)
showKnight in interface GameViewknight - the knight whose card is meant to printKnight.toString()public void setActiveFailed()
Unable to set active knight. Only four can be active at a time.
setActiveFailed in interface GameViewpublic void printBattleText(java.util.List<MOB> monsters, java.util.List<Knight> activeKnights)
Our heroes come across the following monsters. Prepare for battle! Knights Foes Guinevere Umber Hulk Danu of Ireland Arthur
Our heroes come across the following monsters. Prepare for battle! Knights Foes Danu of Ireland Frost Giant Arthur Orc Gwain Frost Giant
printBattleText in interface GameViewmonsters - a list of MOB objectsactiveKnights - a list of Knight objectswpublic void printBattleText(MOB dead)
Frost Giant was defeated!
Arthur was defeated!
printBattleText in interface GameViewdead - the defeated MOBpublic void printFortunes(java.util.List<Knight> activeKnights)
For this quest, our knights drew the following fortunes! Danu of Ireland drew +======================+ |Justice | |HP Bonus: +5| |AC Bonus: +2| |Hit Bonus: +1| |Damage Adj: -| +======================+ Arthur drew +======================+ |Nobility | |HP Bonus: +10| |AC Bonus: +1| |Hit Bonus: +1| |Damage Adj: -| +======================+ Gwain drew +======================+ |Obedience | |HP Bonus: +0| |AC Bonus: +3| |Hit Bonus: +1| |Damage Adj: -| +======================+
printFortunes in interface GameViewactiveKnights - A List of Knightspublic boolean checkContinue()
Would you like to continue on your quest (y/n)?
checkContinue in interface GameViewpublic void printDefeated()
All active knights have been defeated!
printDefeated in interface GameView