protected override bool validTarget(Creep curTarget) { bool fly = this.flying || !curTarget.getFlying(); //true unless enemy is flying and tower is not bool mag = this.magic && curTarget.getMagicImmune(); //true if enemy is immune and tower is magic return fly && !mag; }