|
|
|
@ -0,0 +1,31 @@ |
|
|
|
public class Wizard{ |
|
|
|
int health; |
|
|
|
String weapon; |
|
|
|
String spell; |
|
|
|
public Wizard(){ |
|
|
|
this.health = 100; |
|
|
|
this.weapon = "Staff"; |
|
|
|
this.spell = "Arcane Arrow"; |
|
|
|
} |
|
|
|
public Wizard(int health,String weapon,String spell){ |
|
|
|
this.health = health; |
|
|
|
this.weapon = weapon; |
|
|
|
this.spell = spell; |
|
|
|
} |
|
|
|
public void drinkPotion(){ |
|
|
|
this.health += 10; |
|
|
|
} |
|
|
|
public void drinkPotion(int potion){ |
|
|
|
this.health += potion; |
|
|
|
} |
|
|
|
public void wizardDetails(){ |
|
|
|
System.out.println("This Wizard has a total health of: " + this.health); |
|
|
|
System.out.println("This Wizard carries a " + this.weapon + " and can cast " + this.spell + "."); |
|
|
|
System.out.println(); |
|
|
|
} |
|
|
|
/* |
|
|
|
public static void main(String[] args){ |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
} |