-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAttack.java
executable file
·27 lines (22 loc) · 1.13 KB
/
Attack.java
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
//Attack.java
//Nafis Molla
//This is the Attack class that holds that organises all the attacks and related things all in one place.
import java.util.*;
public class Attack {
public String name,special; //variables are public so they can be accessed by other classes easily
public int cost, damage;
public Attack (String n,String s,int c, int d){//constructor
name = n;
special = s; ////all public variables that describe the pokemons attack characteristics
cost = c;
damage = d;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
public String toString(){ //to string function
return name+" "+special+" "+cost+" "+damage;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public String getNameCost(){ //prints the releavent information that an attacker need to see when picking an attack
return name+" "+"this costs "+cost+" this does "+damage+" damage"+" this attacks special is "+special+".";
}
}