-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnemy.java
More file actions
78 lines (66 loc) · 2.28 KB
/
Enemy.java
File metadata and controls
78 lines (66 loc) · 2.28 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
public class Enemy
{
public Enemy(int ohit, int ostrength, int oprize, String oname, String owin)
{
hit = ohit;
strength = ostrength;
prize = oprize;
name = oname;
win = owin;
}
public int getHit()
{
return hit;
}
public int getStrength()
{
return strength;
}
public int getPrize()
{
return prize;
}
public String getName()
{
return name;
}
public String getWin()
{
return win;
}
public void minusStrength(int truck)
{
strength-= truck;
}
public void hitPlayer(Player ip, Enemy ie)
{
ip.gotHit(ie.getHit());
System.out.println(ie.getName() + " hit " + ip.getName() + " for damage: " + ie.getHit());
if(ip.getHealth() < 0)
{
System.out.println("------------------------------------------------------------------------------------");
System.out.println("------------------------------------------------------------------------------------");
System.out.println("You lost :(");
System.out.println("------------------------------------------------------------------------------------");
System.out.println("------------------------------------------------------------------------------------");
System.out.println(ie.getName() + " still had " + ie.getStrength() + " strength left");
System.out.println("------------------------------------------------------------------------------------");
System.out.println("------------------------------------------------------------------------------------");
System.out.println("Credits:");
System.out.println("Everything: The Communist Panda");
System.out.println("------------------------------------------------------------------------------------");
System.out.println("------------------------------------------------------------------------------------");
System.out.println("Now terminating the program to erase all memory of this humiliating loss");
System.exit(0);
}
}
public void gotHit(int rre)
{
strength-= rre;
}
private int hit;
private int strength;
private int prize;
private String name;
private String win;
}