Skip to content

Commit

Permalink
Only check for Ron when trashed card is in location
Browse files Browse the repository at this point in the history
  • Loading branch information
stasm committed Sep 13, 2024
1 parent 777e7d3 commit 614862c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cards/CardController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,15 @@ export abstract class CardController {
}

*Trash(trace: Trace) {
const revealed_cards = this.Field?.GetRevealedCards();
const armor_card = revealed_cards?.find((card) => card.Name === "Magic Ginger");
if (armor_card) {
yield trace.Log(`but ${armor_card} is here`);
return;
if (this.Field) {
const revealed_cards = this.Field.GetRevealedCards();
const armor_card = revealed_cards.find((card) => card.Name === "Magic Ginger");
if (armor_card) {
yield trace.Log(`but ${armor_card} is here`);
return;
}
}

if (this.Element.closest("a-hand")) {
yield* this.Battle.BroadcastCardMessage(Message.CardLeavesHand, trace, this);
} else if (this.Element.closest("a-deck")) {
Expand Down

0 comments on commit 614862c

Please sign in to comment.