package lect78_impl.model; /** * @overview Standard projectile that deals damage reduced by armor */ public class ProjectileStandard extends Projectile { /** * @effects Initialize this as a StandardProjectile with given parameters */ public ProjectileStandard(int damage, int angle, Tank source) { super(damage, angle, source); } /** * @effects Apply damage to the target tank with armor reduction */ @Override public void applyDamage(Tank target) { // Calculate damage as (damage - target's armor) int finalDamage = Math.max(0, damage - target.getArmor()); target.takeDamage(finalDamage); System.out.println("Standard damage: " + finalDamage + " to tank at " + target.getPosition()); } }