-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.java
More file actions
133 lines (130 loc) · 2.77 KB
/
Copy pathPlayer.java
File metadata and controls
133 lines (130 loc) · 2.77 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
import java.util.*;
public class Player
{
Scanner scan = new Scanner(System.in);
private Sex sex;
private HairStyle hairStyle;
private HairColor hairColor;
private SkinColor skinColor;
private EyeColor eyeColor;
private String name;
private Lineage lineage;
private int level;
private int health;
private List<String> tasks;
private int coins;
private List<Weapons> weapons;
private int focus;
public Player()
{
this.level = 1;
this.health = 100;
this.coins = 35;
this.weapons = new ArrayList<Weapons>();
this.focus=50;
}
public int getFocus()
{
return this.focus;
}
public void setPlayerByDefault()
{
this.sex = Sex.MALE;
this.hairStyle = HairStyle.LONGHAIR;
this.hairColor = HairColor.BLACK;
this.skinColor = SkinColor.PALE;
this.eyeColor = EyeColor.BLACK;
this.name = "DEFAULT Player";
this.lineage = Lineage.EQUIDES;
this.level = 1;
this.health = 100;
this.coins = 35;
}
public void setSex(Sex s)
{
this.sex = s;
}
public void setHairStyle(HairStyle h)
{
this.hairStyle = h;
}
public void setHairColor(HairColor h)
{
this.hairColor = h;
}
public void setSkinColor(SkinColor s)
{
this.skinColor = s;
}
public void setEyeColor(EyeColor e)
{
this.eyeColor = e;
}
public void setName(String name)
{
this.name = name;
}
public void setLineage(Lineage l)
{
this.lineage = l;
}
public String getName()
{
return this.name;
}
public void playerDetails()
{
System.out.println("ALL ABOUT PLAYER");
System.out.println("Name: "+this.name);
System.out.println("Sex: "+this.sex);
System.out.println("HairStyle: "+this.hairStyle);
System.out.println("HairColor: "+this.hairColor);
System.out.println("SkinColor: "+this.skinColor);
System.out.println("EyeColor: "+this.eyeColor);
System.out.println("Lineage: "+this.lineage);
System.out.println("Level: "+this.level);
}
public void showWeapons()
{
System.out.println("Weapons");
for(int i=0; i<this.weapons.size(); i++)
{
System.out.println(this.weapons.get(i).getName());
}
System.out.println("Money: "+this.coins);
}
public void pressEnter()
{
System.out.println("[Okay]");
scan.nextLine();
}
public void mapWidened()
{
System.out.println(this.name+", you have interacted with someone important.\n"+
"New places to venture has been added\n");
}
public int replyToAngmarDialogue1()
{
System.out.println("[0]Yes! I'm invincible! [1]I'll do my best... ");
int x = scan.nextInt();
scan.nextLine();
return x;
}
public void replyToAngmarDialogue2()
{
System.out.println("Let's see what you have.[ENTER]");
scan.nextLine();
}
public void buyWeapon(Weapons w)
{
if((this.coins - w.getPrice()) >= 0)
{
this.coins -= w.getPrice();
this.weapons.add(w);
}
else
{
System.out.println("Insufficient Money");
}
}
}