-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMonsterTypeOne.java
More file actions
178 lines (165 loc) · 4.97 KB
/
Copy pathMonsterTypeOne.java
File metadata and controls
178 lines (165 loc) · 4.97 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
/* TAG: Team Adventure Game
* Code: Don Combs / Ken A.
* 11-24-2019 To Current Date
*
*/
import java.util.Random;
public class MonsterTypeOne {
//basic monsters
//imp
//troll
//hydra
//Zombie
//Other
public static void main(String[] args) {
//Setup for testing
Monster();
}
public static void Monster() {
String Monster = RandMonster(RandomMonsterMethod());
BattleEngine.BattleMonster(Monster);
}
public static int RandomMonsterMethod() {
Random randNum = new Random();
int rand_int1 = randNum.nextInt(6);
return rand_int1;
}
public static String RandMonster(int randMonster) {
int i = randMonster;
String Monster = "";
if(i == 0)
Monster = "Troll";
else if (i == 1)
Monster = "Imp";
else if (i == 2)
Monster = "Hydra";
else if (i == 3)
Monster = "Zombie";
else if (i == 4)
Monster = "Other";
else if (i == 5)
Monster = "Other";
return Monster;
}
public static int RandNumMethod() {
Random randNum = new Random();
int rand_int1 = randNum.nextInt(101);
if (rand_int1 <= 5) {
rand_int1 = rand_int1 +5;
}
return rand_int1;
}
public static int RandNumMethod2() {
Random randNum = new Random();
int rand_int1 = randNum.nextInt(21);
if(rand_int1 == 0) {
RandNumMethod2();
}
return rand_int1;
}
public static int RandNumMethod3() {
Random randNum = new Random();
int rand_int1 = randNum.nextInt(10);
return rand_int1;
}
public static int RandNumMethod4() {
Random randNum = new Random();
int rand_int1 = randNum.nextInt(101);
return rand_int1;
}
public static int RandNumMethod5() {
Random randNum = new Random();
int rand_int1 = randNum.nextInt(2);
return rand_int1;
}
public static int Encounter() {
int i = RandNumMethod();
if (i > 35) {
return i;
}
else {
return 0;
}
}
public static int MagicItemChance() {
//chance of dropping magic item
int i = RandNumMethod4();
if (i > 55) {
return i;
}
else {
return 0;
}
}
public static int MagicItem() {
int i = RandNumMethod3();
return i;
}
public static int DropItem() {
// item in item list array
int i = RandNumMethod3();
return i;
}
public static int DamagePerHit() {
int i = RandNumMethod2();
return i;
}
public static int[] MonsterOne(String Monster) {
//Monster is chosen randomly
int hitPoints = RandNumMethod() + ((Player.CHARACTER_LEVEL)*4);
int damagePerHit = DamagePerHit() + ((Player.CHARACTER_LEVEL)*3);
int expPoints = RandNumMethod();
int coinDrop = RandNumMethod() + ((Player.CHARACTER_LEVEL)*3);
int magicItemChance = MagicItemChance();
int magicItem = MagicItem();
int encounter = Encounter();
int dropItem = DropItem();
System.out.print("\n");
System.out.println("\t--------Stats For "+Monster+"--------");
System.out.println("\tThe hitpoints for this "+Monster+" is: " + hitPoints + " Encounter percentage chance on Quest: " + encounter + "%");
if (encounter == 0) {
dropItem=0;
}
int ArmorOrWeapon = RandNumMethod5();
String Dropped = "";
if(ArmorOrWeapon == 0)
Dropped = "Armor";
if(ArmorOrWeapon == 1)
Dropped = "Weapon";
System.out.println("\tDrop item percentage: " + RandNumMethod4() + "%" + " and dropped item number is: " + dropItem);
if(Dropped == "Armor") {
//System.out.print(Armor.ArmorsConfig[dropItem].Armor_Name);
System.out.print("\tDropped Item is "+Dropped+ " Class and is the item named: *** " + Armor.ArmorsConfig[dropItem].Armor_Name + " ***");
}
if(Dropped == "Weapon") {
System.out.print("\tDropped Item is "+Dropped+ " Class and is the item named: *** " + Weapon.WeaponsConfig[dropItem].Weapon_Name + " ***");
}
// System.out.print("\n\tMagic Item Drop percentage chance on Quest: " + magicItemChance + "%");
// if(magicItemChance >=65) {
// magicItem = MagicItem();
// }
// else {
// magicItem=0;
// }
// System.out.println(" The Magic Item dropped is number: " + magicItem);
// if(Dropped == "Armor") {
// //System.out.print(Armor.ArmorsConfig[dropItem].Armor_Name);
// System.out.print("\n\tDropped Item is "+Dropped+ " Class and is the Item: " + Magic_Armor.MagicArmorsConfig[dropItem].MagicArmor_Name);
// }
// if(Dropped == "Weapon") {
// System.out.print("\n\tDropped Item is "+Dropped+ " Class and is the Item: " + Magic_Weapon.MagicWeaponsConfig[dropItem].MagicWeapon_Name);
// }
System.out.println("\n\tMAX Damage per hit upon Player Character is: " + damagePerHit + GameEngine.NEWLINE +"\tExperience Points Gained: " + expPoints +
":\tCoin Drop: " + coinDrop);
System.out.println("\n\t----------------");
if(Monster == "Troll")
MonsterAscii.TrollAscii();
if(Monster == "Imp")
MonsterAscii.ImpAscii();
if(Monster == "Hydra")
MonsterAscii.HydraAscii();
if(Monster == "Zombie")
MonsterAscii.ZombieAscii();
return new int[] {hitPoints, damagePerHit, expPoints, coinDrop};
}
}