implement Sword.java

This commit is contained in:
2026-05-17 06:36:03 -07:00
parent 74ae9dfc5b
commit fc67dbb4f9
@@ -1,26 +1,26 @@
package org.project.item.weapons; package org.project.item.weapons;
import org.project.entity.Entity; import org.project.weaponEffects.StatusEffect;
import java.util.ArrayList; public class Sword extends Weapon {
// TODO: UPDATE IMPLEMENTATION private static final String NAME = "Sword";
public class Sword { private static final int LIGHT_DAMAGE = 10;
/* private static final int HEAVY_DAMAGE = 5;
THIS IS AN EXAMPLE OF A WEAPON DESIGN. private static final int DURABILITY = 4;
*/
int abilityCharge;
public Sword() { public Sword() {
// TODO: DESIGN SWORD'S ATTRIBUTES IMPLEMENT THE CONSTRUCTOR this(null);
} }
// TODO: (BONUS) UPDATE THE UNIQUE ABILITY public Sword(StatusEffect weaponEffect) {
public void uniqueAbility(ArrayList<Entity> targets) {
abilityCharge += 2; super(
for (Entity target : targets) { NAME,
target.takeDamage(getDamage()); LIGHT_DAMAGE,
} HEAVY_DAMAGE,
weaponEffect,
DURABILITY
);
} }
} }