Rule 13. Counterclaim and cross-claim.

(a) Compulsory counterclaims. A pleading shall state as a counterclaim any claim which at the time of serving the pleading the pleader has against any opposing party, if it arises out of the transaction or occurrence that is the subject-matter of the opposing party's claim and does not require for its adjudication the presence of third parties of whom the court cannot acquire jurisdiction. But the pleader need not state the claim if (1) at the time the action was commenced the claim was the subject of another pending action, or (2) the opposing party brought suit upon his claim by attachment or other process by which the court did not acquire jurisdiction to render a personal judgment on that claim, and the pleader is not stating any counterclaim under this Rule 13.

(b) Permissive counterclaim. A pleading may state as a counterclaim any claim against an opposing party not arising out of the transaction or occurrence that is the subject-matter of the opposing party's claim.

(c) Counterclaim exceeding opposing claim. A counterclaim may or may not diminish or defeat the recovery sought by the opposing party. It may claim relief exceeding in amount or different in kind from that sought in the pleading of the opposing party.

(d) Counterclaim maturing or acquired after pleading. A claim which either matured or was acquired by the pleader after serving his pleading may, with the permission of the court, be presented as a counterclaim by supplemental pleading.

(e) Omitted counterclaim. When a pleader fails to set up a counterclaim through oversight, inadvertence, or excusable neglect, or when justice requires, he may by leave of court set up the counterclaim by amendment.

(f) Cross-claim against co-party. A pleading may state as a cross-claim any claim by one party against a co-party arising out of the transaction or occurrence that is the subject-matter either of the original action or of a counterclaim therein or relating to any property that is the subject-matter of the original action. Such cross-claim may include a claim that the party against whom it is asserted is or may be liable to the cross-claimant for all or part of a claim asserted in the action against the cross-claimant.

(g) Additional parties may be brought in. When the presence of parties other than those to the original action is required for the granting of complete relief in the determination of a counterclaim or cross-claim, the court shall order them to be brought in as defendants as provided in these rules, if jurisdiction of them can be obtained.

(h) Separate judgments. Judgment on a counterclaim or cross-claim may be rendered in accordance with the terms of Rule 54(b), even if the claims of the opposing party have been dismissed or otherwise disposed of.

(i) Cross demands not affected by assignment or death. When cross demands have existed between persons under such circumstances that, if one had brought an action against the other, a counterclaim could have been set up, the two demands shall be deemed compensated so far as they equal each other, and neither can be deprived of the benefit thereof by the assignment or death of the other, except as provided in Subdivision (j) of this rule.

(j) Claims against assignee. Except as otherwise provided by law as to negotiable instruments and assignments of accounts receivable, any claim, counterclaim, or cross-claim which could have been asserted against an assignor at the time of or before notice of such assignment, may be asserted against his assignee, to the extent that such claim, counterclaim, or cross-claim does not exceed recovery upon the claim of the assignee.