34 lines
586 B
Java
34 lines
586 B
Java
|
package semesterprojekt;
|
||
|
|
||
|
public class slime {
|
||
|
private int leben = 7;
|
||
|
private int level = 1;
|
||
|
private int schaden;
|
||
|
private int maxLeben = 7;
|
||
|
|
||
|
public String toString() {
|
||
|
return "Level: " + level + " Slime (" + leben + "HP)";
|
||
|
}
|
||
|
|
||
|
public int getLeben() {
|
||
|
return leben;
|
||
|
}
|
||
|
|
||
|
public void setLeben(int leben) {
|
||
|
this.leben = leben;
|
||
|
}
|
||
|
|
||
|
public int getSchaden() {
|
||
|
return schaden;
|
||
|
}
|
||
|
|
||
|
public void setSchaden() {
|
||
|
this.schaden = (int) (Math.random() * 3); // random schaden zwischen 0 und 2
|
||
|
}
|
||
|
|
||
|
public int getMaxLeben() {
|
||
|
return maxLeben;
|
||
|
}
|
||
|
|
||
|
}
|