-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.java
More file actions
executable file
·201 lines (160 loc) · 4.24 KB
/
Player.java
File metadata and controls
executable file
·201 lines (160 loc) · 4.24 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
/**
* This is the player class
* It shows the stats of your player and the limits of how drunk they can be
* and how much damage they can take.
*
* There is also a NPC player program here which has been created to hinder
* the players decisions throughout the game.
*
* @author
* @version
*/
public class Player
{
// instance variables - replace the example below with your own
/**
* Constructor for objects of class Player
*/
public Player()
{
drunkMeter = 60;
playerMoney = 30;
playerHealth = 50;
playerDamage = 10;
}
//include a drunk meter % wise.
//Include player currency in this class;
public int drunkMeter;
public int playerMoney;
public int addDrunk;
private int drunkScale;
private int minimumValue;
private int maximumValue;
private int minimumMoney;
public int playerHealth;
public int playerDamage;
private int healthScale;
private String police;
private int policeHealth;
private String policeReaction;
/**
* @param Drunk Meter to monitor how drunk you are and how drunk you could get;
*
*/
public void DrunkMeter()
{
drunkMeter = 60;
System.out.println(drunkMeter);
}
/**
* @buy function to determine whether you can buy something due to the amount of money you have.
*/
public boolean buyFunction(int cost)
{
if(cost > playerMoney)
{
cost = 0;
System.out.println ("You are out of money");
return false;
}
else {
playerMoney -= cost;
System.out.println ("Amount of money " + playerMoney);
return true;
}
}
/**
* @param to the drunk scale to determin how drunk you are;
*/
public boolean drunkScale()
{
if(drunkMeter == 100)
{
System.out.println("you blackout and end up in hopsital");
System.out.println("you have failed.");
return true;
}
else {
System.out.println("drunk meter " + drunkMeter);
}
if(drunkMeter <= 10)
{
System.out.println("you are almost sober");
}
return false;
}
/**
* @param the health scale to see how damaged you are.
*/
public boolean healthScale()
{
if(playerHealth <= 0)
{
System.out.println("you blackout and end up in hospital");
System.out.println("you have failed.");
return true;
}
else
{
System.out.println("health meter" + playerHealth);
}
return false;
}
/**
* @return the drunk value as an int
*/
public int getDrunk()
{
return drunkMeter;
}
public int getHealth()
{
return playerHealth;
}
public void setHealth()
{
System.out.println(playerHealth);
}
/**
* @param Players Money amount;
*/
public void Money()
{
playerMoney = 30;
System.out.println(playerMoney);
}
/**
* @param minimum Spending limit.
*
/**
* @return Money amount;
*/
public int getMoney()
{
return minimumMoney;
}
public void playerDetractHealth(int death)
{
playerHealth = playerHealth - death;
}
/**
* @param this shows the general condition of the player;
*/
public void stat()
{
System.out.println("Amount of money" + playerMoney);
System.out.println("drunk meter" + getDrunk());
System.out.println("health meter" + getHealth());
}
/**
* @param Police officer will be another player that will walk around similar to your player
* however it will be completely random movement.
*/
//public void policeOfficer()
//{
// System.out.println("there is a police officer in the room");
//if(commandWord == CommandWord.ATTACK)
//{
// System.out.println ("You get arrested. Game over");
//}
}