forked from QingZhiYa/RPG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEvents.java
175 lines (159 loc) · 6.47 KB
/
Events.java
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
import java.util.Scanner;
public class Events{
Scanner input = new Scanner(System.in);
//setter and getter
public void popQuiz(Player p){
int i = (int)(Math.random()*10);
//different Rebelling data have different chances to win
if(p.getRebelling() > 10){
if(i < 8){
System.out.println("The teacher took a pop quiz, but you did bad.Σ( ° △ °|||)(Knowledge -2, Rebelling +1)");
p.addKnowledge(-2);
p.addRebelling(1);
}else{
System.out.println("The teacher took a pop quiz this morning, you did not bad.(Knowledge +2, Rebelling -1)");
p.addKnowledge(2);
p.addRebelling(-1);
}
}else{
if(i < 3){
System.out.println("The teacher took a pop quiz this morning, but you did bad.Σ( ° △ °|||)(Knowledge -2, Rebelling +1)");
p.addKnowledge(-2);
p.addRebelling(1);
}else{
System.out.println("The teacher took a pop quiz this morning, you did not bad.(Knowledge +2, Rebelling -1)");
p.addKnowledge(2);
p.addRebelling(-1);
}
}
}
public void sheNeedFood(Player p, Her h){
System.out.println(h.getName() + " got up late and did not eat the brackfast. Would you like to buy some snacks for her?");
System.out.println("(Type y for yes or anything for no.)");
String i = input.next();
if(i.equals("y") && p.getMoney()-5 >= 0){
p.addMoney(-5);
p.addLove(3);
System.out.println("You bought her some snacks, she thought you were a nice person♡.(Love +3, Money -5)");
System.out.println(p.printMoney());
}else if(i.equals("y") && p.getMoney()-5 < 0){
System.out.println("You do not have enough money.Σ(っ °Д °;)っ");
}
}
public void basketballGame(Player p, Her h){
System.out.println("There is a basketball game. You participated.");
//different basketball skills have different chances to win
int i = (int)(Math.random()*10);
if(p.getBasketball() > 10){
if(i < 7){
System.out.println("You won the game, and got 20 bucks award. " + h.getName() + " watched your game and cheered for you♡.(Basketball +1, Money +20, Love +2)");
p.addBasketball(1);
p.addMoney(20);
p.addLove(2);
System.out.println(p.printMoney());
}else{
System.out.println("However, you lost the gameΣ(っ °Д °;)っ.(Basketball -1)");
p.addBasketball(-1);
}
}else{
if(i < 4){
System.out.println("You won the game, and got 20 bucks award. " + h.getName() + " watched your game and cheered for you♡.(Basketball +1, Money +20, Love +2)");
p.addBasketball(1);
p.addMoney(20);
p.addLove(2);
System.out.println(p.printMoney());
}else{
System.out.println("However, you lost the gameΣ(っ °Д °;)っ.(Basketball -1)");
p.addBasketball(-1);
}
}
}
public void videoGame(Player p, Her h){
System.out.println("There is a video game competition. You participated.");
//different videoGame skills have different chances to win
int i = (int)(Math.random()*10);
if(p.getGame() > 8){
if(i < 7){
System.out.println("You won the game, and got 25 bucks award. " + h.getName() + " thought you did a good job♡.(Game +1, Money +20, Love +2)");
p.addGame(1);
p.addMoney(20);
p.addLove(2);
System.out.println(p.printMoney());
}else{
System.out.println("However, you lost the gameΣ(っ °Д °;)っ.(Game -1)");
p.addGame(-1);
}
}else{
if(i < 4){
System.out.println("You won the game, and got 20 bucks award. " + h.getName() + " thought you did a good job♡.(Game +1, Money +20, Love +2)");
p.addGame(1);
p.addMoney(20);
p.addLove(2);
System.out.println(p.printMoney());
}else{
System.out.println("However, you lost the gameΣ(っ °Д °;)っ.(Game -1)");
p.addGame(-1);
}
}
}
public void goMovie(Player p, Friend f, Her h){
System.out.println(f.getName() + " asked you to go to the movie this afternoon. He said he would ask " + h.getName() + " as well. Will you go?");
System.out.println("(Type y for yes or anything else for no.)");
if(input.next().equals("y")){
//if go, check the money
if(p.getMoney()<15){
System.out.println("You dont have enough money to go to the movie.Σ(っ °Д °;)っ");
}else{
System.out.println("You said you would go.");
p.setIfMovie(true);
}
}
}
public void upset(Player p, Her h){
System.out.println(h.getName() + " looks really upset. Would you like to talk to her?");
System.out.println("(Type y for yes or anything else for no.)");
int i = (int)(Math.random()*10);
if(input.next().equals("y")){
if(i < 5){
System.out.println("You ask her what heppened and try to comfort her. However, you are not good at comforting people. She smiles \"I know you are tring to comfort me, I am better now\"♡.(Love +1)");
p.addLove(1);
}else{
System.out.println("You ask her what happened, and tell a joke. She laughs♡.(Love +3)");
p.addLove(3);
}
}
}
public void talkDrama(Player p, Her h){
System.out.println(h.getName() + " asks you about recent drama.");
//different drama skills have different chances to win
int i = (int)(Math.random()*10);
if(p.getDrama() > 8){
if(i < 8){
System.out.println("You watched it as well. You two discuss it happily♡.(Love +3, Drama +1)");
p.addLove(3);
p.addDrama(1);
}else{
System.out.println("But you did not watch it. She thought you were kind of boring.Σ(っ °Д °;)っ(Love -1, Drama -1)");
p.addDrama(-1);
p.addLove(-1);
}
}else{
if(i < 4){
System.out.println("You watched it as well. You two discuss it happily♡.(Love +3, Drama +1)");
p.addLove(3);
p.addDrama(1);
}else{
System.out.println("But you did not watch it. She thought you were kind of boringΣ(っ °Д °;)っ.(Love -1, Drama -1)");
p.addDrama(-1);
p.addLove(-1);
}
}
}
public void tooRebellious(Player p){
//checked rebelling counter in Day class
System.out.println("You mom thinks you are too rebellious recently. She took 15 bucks from you and asked you to focus on your studyΣ(っ °Д °;)っ.(Money -15, Love -6)");
p.addMoney(-15);
p.addLove(-6);
System.out.println(p.printMoney());
}
}