5 public static void main(String[] args)
throws IOException {
6 InputStreamReader isr =
new InputStreamReader(System.in);
7 BufferedReader inData =
new BufferedReader(isr);
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(
" ");
16 Student c2 =
new Student(c2_info[0], Integer.valueOf(c2_info[1]), Integer.valueOf(c2_info[2]));
18 BadGun w2 =
new BadGun(w2_info[0], Integer.valueOf(w2_info[1]));
21 System.out.println(
"Now fighting: " + c1.
getName() +
" VS " + c2.
getName());
26 System.out.println(
"----------------------------");
31 int attackAmount = c1.
attack(w1);
32 System.out.println(c1.
getName() +
" makes an attack by " + w1.
getName() +
"!");
34 int hurtAmount = c2.
hurt(attackAmount);
35 if (hurtAmount == 0) {
36 System.out.println(c2.
getName() +
" hides from the attack!");
39 System.out.println(c2.
getName() +
" takes a hurt amount of " + hurtAmount +
"! Remaining energy becomes " + c2.
getEnergyLevel() +
".");
47 int attackAmount = c2.
attack(w2);
48 int hurtAmount = c1.
hurt(attackAmount);
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() +
".");
55 System.out.println(c1.
getName() +
" boost the " + w1.
getName() +
"!");
62 System.out.println(c2.
getName() +
" wins! The examination paper is stolen!");
65 System.out.println(c1.
getName() +
" wins! The examination paper is secured!");
The BadGun has poor quality such that at each shot, only 80% of its original power can be produced (r...
int hurt(int attackAmount)
Reduces the energy level of the character by the specified attack amount.
boolean isLose()
Determines whether the character has lost the combat.
int getSkillLevel()
Returns the skill level of the character.
int getEnergyLevel()
Returns the current energy level of the character.
int attack(Weapon w1)
Calculates the total attack amount generated by the character.
String getName()
Returns the name of the character.
static void main(String[] args)
The SecurityGuard is well-funded by the department and must use a SuperGun.
void boostWeapon(SuperGun w1)
Boosts the specified SuperGun for the next attack.
The Student is poor and can only afford using a BadGun.
void hide()
Hides the student from the next attack.
int hurt(int attackAmount)
Calculates the amount of hurt taken from an attack.
The SuperGun can produce a boosted shot, such that the shot produces two times power than the origina...
String getName()
Returns the name of the weapon.