forked from Jleetrahan/bork
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHealthCommand.java
More file actions
37 lines (33 loc) · 839 Bytes
/
Copy pathHealthCommand.java
File metadata and controls
37 lines (33 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
*
*/
/** HealthCommand deals with any Commands relating to a player checking their health.
* @author Team Red
*
*/
class HealthCommand extends Command{
/** Instantiates a HealthCommand
*
*/
HealthCommand()
{
}
/**
* @override From Command
*/
String execute()
{
GameState state = GameState.instance();
int currentHealth = state.getAdventurersHealth();
if(currentHealth >= 41)
return "You feel as healthy and strong as ever\n";
else if(currentHealth >= 31)
return "Your wounds sting slightly, but you have plenty of strength for adventuring\n";
else if(currentHealth >= 21)
return "Your health has clearly degraded\n";
else if(currentHealth >= 11)
return "You stagger from the pain of your wounds\n";
else
return "You feel as if you have one foot in your grave already\n";
}
}