add repairKit class
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
package org.project.item.consumables;
|
||||||
|
|
||||||
|
import org.project.entity.Entity;
|
||||||
|
import org.project.entity.players.Player;
|
||||||
|
|
||||||
|
public class repairKit extends Consumable{
|
||||||
|
public repairKit() {
|
||||||
|
super("Repair Kit",1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void use(Entity target) {
|
||||||
|
if (!hasCharges()) {
|
||||||
|
System.out.println("Repair Kit is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
((Player) (target)).getArmor().repair();
|
||||||
|
consume();
|
||||||
|
System.out.println("(" + getQuantity() + " charges remaining)");
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user