-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMonster.java
More file actions
102 lines (83 loc) · 2.07 KB
/
Monster.java
File metadata and controls
102 lines (83 loc) · 2.07 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
import java.util.Random;
public class Monster {
private int bodyStrength;
private int skill;
private int BodyDurability;
private int etat;
private Capacity cap;
public Monster() {
De de = new De();
this.bodyStrength = 3;// On initialise la force l'adresse et la résistance des monstres à 3D
this.skill = 3;
this.BodyDurability = 3;
this.etat = 0;
this.cap = new Capacity(1,1,1,1);
}
public void setbodyStrength(int bodyStrength) {
this.bodyStrength = bodyStrength;
}
public int getbodyStrength() {
return this.bodyStrength;
}
public void setSkill(int skill) {
this.skill = skill;
}
public int getSkill() {
return this.skill;
}
public void gsetBodyDurability(int BodyDurability) {
this.BodyDurability = BodyDurability;
}
public int getBodyDurability() {
return this.BodyDurability;
}
public int getEtat() {
return this.etat;
}
public void setEtat(int etat) {
this.etat = etat;
}
public Capacity getCapacite() {
return this.cap;
}
// Capacités
public int speed() {
int speed = this.getSkill() - cap.getclothesBurdon();
return speed;
}
public int attack() {
int attack = this.getSkill() + cap.getweaponManiability();
return attack;
}
public int dodge() {
int dodge = this.getSkill() - cap.getclothesBurdon();
return dodge;
}
public int defense() {
int defense = this.getBodyDurability() + cap.getclothesDurability();
return defense;
}
public int damage() {
int damage = this.getbodyStrength() + cap.getweaponStrength();
return damage;
}
public String checkLevelDmg() { //sert a vérifier l'état physique de son personnage
switch(this.getEtat()) { //pour chaque etat on print une phrase indiquant l'état
case 0:
return "Etat normale";
case 1:
return "Blessures superficielles";
case 2:
return "Légèrement blessé";
case 3:
return "Blessé";
case 4:
return "Gravement blessé";
case 5:
return "Inconscient";
case 6:
return "Mort";
}
return "Erreur";
}
}