Example 1: Your opponent attacks with their Infantry Battalion card, and you defend with a Rampart card from your hand. If your opponent’s Attack Card makes you discard cards from your hand or reveal cards from your draw pile, this reduces the quantity by one. As a result, you are unaffected by the Infantry Battalion.
Example 2: Your opponent attacks with their Royal Guard card, and you defend with 2 Rampart cards from your hand. If your opponent’s Attack Card makes you discard cards from your hand or reveal cards from your draw pile, this reduces the quantity by 2. Royal Guard would normally make you reveal the top 3 cards from your draw pile, but this reduces it by 2, so you only have to reveal 1 card.