From 2c176589c24093ae93ec45e8d208dce81c27a515 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Mon, 19 Nov 2018 13:11:43 +0100 Subject: Create java package for the project --- src/Weapon.java | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 src/Weapon.java (limited to 'src/Weapon.java') diff --git a/src/Weapon.java b/src/Weapon.java deleted file mode 100644 index f20e0ca..0000000 --- a/src/Weapon.java +++ /dev/null @@ -1,44 +0,0 @@ -// TODO: there are object such as "puch" that need infinite durability -public class Weapon { - // TODO: if possible make final - private int damage; - private int durability; - private int range; - private String name; - - // TODO: add bonus / power-ups structure - // public class PowerUps {} - - public Weapon(String name, int damage, int range, int durability) { - this.name = name; - this.damage = damage; - this.range = range; - this.durability = durability; - } - - /* accessors */ - public String getName() { return this.name; } - public int getDamage() { return this.damage; } - public int getRange() { return this.range; } - public int getDurability() { return this.durability; } - - - public boolean isBroken() { - return this.durability <= 0; - } - - public boolean damage(Actor attacker, Actor attacked, Map map) { - if (isBroken()) { - return false; - } - - if (map.getTile(attacked.getX(), attacked.getY()).isSelected()) { - attacked.damage(this.damage); - this.durability--; - return true; - } else { - return false; - } - } - -} -- cgit v1.2.1