-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEncounters.java
More file actions
183 lines (108 loc) · 7.36 KB
/
Encounters.java
File metadata and controls
183 lines (108 loc) · 7.36 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
package com.apcs;
public class Encounters {
public int randomEncounter(Quest quest) {
int encounter = Utilities.randomCalc();
if (quest.getCrew().getCount() <= 0) {
System.out.println("Your entire crew has died! GAME OVER. ");
System.exit(0);
} else if (quest.getShop().getAmbrosia() <= 0) {
System.out.println("You have ran out of ambrosia to feed your crew! GAME OVER. ");
System.exit(0);
} else if (quest.getLifeSituation().getMoney() <= 0) {
System.out.println("You have run out of money, leaving your crew unable to continue going forward! GAME OVER. ");
System.exit(0);
} else {
if (encounter == 1) {
System.out.println("Your crew has incurred the wrath of Lord Poseidon and is caught in a storm. One crew member has died. ");
quest.getCrew().killCrewMember();
quest.setTurnCounter(quest.getTurnCounter() + 1);
} else if (encounter == 2) {
System.out.println("Your crew has incurred the wrath of Lord Poseidon and is caught in a storm.");
if (quest.getShop().getSails() > 1) {
System.out.println("Thank the gods you purchased those SAILS before! Your entire crew has survived.");
quest.getShop().setSails(quest.getShop().getSails() - 2);
} else {
System.out.println("You lacked the proper replacement SAILS to carry everyone safely through the storm. One crew member has died.");
quest.getCrew().killCrewMember();
}
quest.setTurnCounter(quest.getTurnCounter() + 1);
} else if (encounter == 3) {
System.out.println("Your crew has encroached onto siren territory.");
if (quest.getShop().getEarbuds() > 0) {
System.out.println("Thank the gods you purchased those EARBUDS before! Your entire crew has survived.");
quest.getShop().setEarbuds(quest.getShop().getEarbuds() - 1);
} else {
System.out.println("You lacked the proper replacement EARBUDS to protect your entire crew from the sirens. One crew member has died.");
quest.getCrew().killCrewMember();
}
quest.setTurnCounter(quest.getTurnCounter() + 1);
} else if (encounter == 4) {
System.out.println("Lord Poseidon has favored your crew! You can travel safely ONE extra turn with no consequences. ");
quest.setTurnCounter(quest.getTurnCounter() + 2);
} else if (encounter == 5) {
System.out.println("A crew member got greedy with the ambrosia supply, spoiling and eating a major portion of your supply. One crew member has died and half of your ambrosia supply is gone.");
quest.getCrew().killCrewMember();
quest.getShop().setAmbrosia(quest.getShop().getAmbrosia() / 2);
quest.setTurnCounter(quest.getTurnCounter() + 1);
} else if (encounter == 6) {
System.out.println("Your crew has found a pack of hippocampi, who help your ship travel faster. You can travel safely ONE extra turn with no consequences. ");
quest.setTurnCounter(quest.getTurnCounter() + 1);
} else if (encounter == 7) {
System.out.println("While sailing, your crew rescues someone stranded at sea. To express their gratitude, they offer to join your crew. A new crew member has joined.");
quest.getCrew().addCrewMember("Fortuna");
quest.setTurnCounter(quest.getTurnCounter() + 1);
} else if (encounter == 8) {
System.out.println("Smooth sailing today. Nothing out of the ordinary happens.");
quest.setTurnCounter(quest.getTurnCounter() + 1);
} else if (encounter == 9) {
System.out.println("The goddess of the rainbow, Iris, has favored your crew and blessed you with some extra wealth. Receive plus 100 DRACHMAS.");
quest.getLifeSituation().setMoney(quest.getLifeSituation().getMoney() + 100);
quest.setTurnCounter(quest.getTurnCounter() + 1);
} else if (encounter == 10) {
System.out.println("A monster has attacked you and your crew.");
if (quest.getShop().getBandages() > 4) {
System.out.println("Thank the gods you purchased those BANDAGES before! Your entire crew has survived.");
quest.getShop().setBandages(quest.getShop().getBandages() - 5);
} else {
System.out.println("You lacked the proper replacement BANDAGES to protect and rehabilitate your crew from the monster. One crew member has died.");
quest.getCrew().killCrewMember();
}
quest.setTurnCounter(quest.getTurnCounter() + 1);
} else if (encounter == 11) {
System.out.println("It's a foggy day.");
if (quest.getShop().isPegasus() == true) {
System.out.println("If you have a PEGASUS, you can travel safely ONE extra turn with no consequences.");
quest.setTurnCounter(quest.getTurnCounter() + 1);
} else {
System.out.println("Sailing takes longer than normal, but ultimately you make steady pace. Nothing out of the ordinary happens ");
}
quest.setTurnCounter(quest.getTurnCounter() + 1);
} else if (encounter == 12) {
System.out.println("The kerkopes have stolen away on your ship, looking to steal some of your riches.");
if (quest.getShop().isThreeHeadedDog() == true) {
System.out.println("If you have a THREE-HEADED DOG, your money is safe! Nothing out of the ordinary happens");
} else {
System.out.println("The brothers get into your money stash and are gone by the morning. Lose 50 drachmas. ");
quest.getLifeSituation().setMoney(quest.getLifeSituation().getMoney() - 50);
}
quest.setTurnCounter(quest.getTurnCounter() + 1);
} else if (encounter == 13) {
System.out.println("A crew member has fallen extremely ill and they most likely won't make it. ");
if (quest.getShop().isPhoenix() == true) {
System.out.println("If you have a PHOENIX, you can use the Phoenix tears to save their life. Nothing out of the ordinary happens. ");
} else {
System.out.println("You did not have the proper resources to save the crew member. One crew member has died.");
quest.getCrew().killCrewMember();
}
quest.setTurnCounter(quest.getTurnCounter() + 1);
} else if (encounter == 14) {
System.out.println("A monster has attacked you and your crew. A crew member on the night shift fights back, but ultimately does not make it. One crew member has died.");
quest.getCrew().killCrewMember();
quest.setTurnCounter(quest.getTurnCounter() + 1);
} else {
return 0;
}
}
return encounter;
}
}