5 {
6 InputStreamReader isr = new InputStreamReader(System.in);
7 BufferedReader inData = new BufferedReader(isr);
8
9
10 String c1_info[] = inData.readLine().split(" ");
11 String c2_info[] = inData.readLine().split(" ");
12 String w1_info[] = inData.readLine().split(" ");
13 String w2_info[] = inData.readLine().split(" ");
14
15 SecurityGuard c1 = new SecurityGuard(c1_info[0], Integer.valueOf(c1_info[1]), Integer.valueOf(c1_info[2]));
16 Student c2 = new Student(c2_info[0], Integer.valueOf(c2_info[1]), Integer.valueOf(c2_info[2]));
17 SuperGun w1 = new SuperGun(w1_info[0], Integer.valueOf(w1_info[1]));
18 BadGun w2 = new BadGun(w2_info[0], Integer.valueOf(w2_info[1]));
19
20
21 System.out.println("Now fighting: " + c1.getName() + " VS " + c2.getName());
22 System.out.println("Skill level of " + c1.getName() + ": " + c1.getSkillLevel());
23 System.out.println("Skill level of " + c2.getName() + ": " + c2.getSkillLevel());
24 System.out.println("Energy level of " + c1.getName() + ": " + c1.getEnergyLevel());
25 System.out.println("Energy level of " + c2.getName() + ": " + c2.getEnergyLevel());
26 System.out.println("----------------------------");
27
28 int round = 0;
29 while (!c1.isLose() && !c2.isLose()) {
30 if (round % 2 == 0) {
31 int attackAmount = c1.attack(w1);
32 System.out.println(c1.getName() + " makes an attack by " + w1.getName() + "!");
33
34 int hurtAmount = c2.hurt(attackAmount);
35 if (hurtAmount == 0) {
36 System.out.println(c2.getName() + " hides from the attack!");
37 }
38 else {
39 System.out.println(c2.getName() + " takes a hurt amount of " + hurtAmount + "! Remaining energy becomes " + c2.getEnergyLevel() + ".");
40 }
41
42 if (round % 3 == 0) {
43 c2.hide();
44 }
45 }
46 else {
47 int attackAmount = c2.attack(w2);
48 int hurtAmount = c1.hurt(attackAmount);
49
50 System.out.println(c2.getName() + " makes an attack by " + w2.getName() + "!");
51 System.out.println(c1.getName() + " takes a hurt amount of " + hurtAmount + "! Remaining energy becomes " + c1.getEnergyLevel() + ".");
52
53 if (round % 3 == 0) {
54 c1.boostWeapon(w1);
55 System.out.println(c1.getName() + " boost the " + w1.getName() + "!");
56 }
57 }
58 round++;
59 }
60
61 if (c1.isLose()) {
62 System.out.println(c2.getName() + " wins! The examination paper is stolen!");
63 }
64 else {
65 System.out.println(c1.getName() + " wins! The examination paper is secured!");
66 }
67 }