-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHero.java
More file actions
28 lines (22 loc) · 758 Bytes
/
Hero.java
File metadata and controls
28 lines (22 loc) · 758 Bytes
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
package Hero;
public class Hero {
String isim;
String rol;
int can;
int hasar;
public Hero(String isim,String rol,int can,int hasar){
this.isim=isim;
this.rol=rol;
this.can=can;
this.hasar=hasar;
}
public void saldir(){System.out.println("!!_Dikkat_!! "+isim+" saldırıyor "+hasar+" hasar verdi...");}
public void hasarAl(int a){
can-=a;
if(can==0||can<0){can=0;System.out.println( isim+" Son Aldığı Hasarla Yere Yığıldı ve Öldü");}
else {System.out.println(isim+ " "+a+" hasar aldı"+"\n Mevcut Can-->"+can);}
}
public void durumGoster(){
System.out.println( isim+" Canı-->"+can+"\n"+isim+ " Hasarı-->"+hasar+"\n Karakter İsmi-->"+isim+"\n Karakter Rolü-->"+rol+"\n");
}
}