Skip to content

Commit

Permalink
Use CARD_LOCATION_PLAY_AREA instead of CARD_LOCATION_ARENA
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectroDeoxys committed Nov 10, 2024
1 parent 4ead64d commit 81842fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/engine/duel/core.asm
Original file line number Diff line number Diff line change
Expand Up @@ -6908,7 +6908,7 @@ DiscardAttachedPluspowers:
dec e
jr nz, .unattach_pluspower_loop
ld de, PLUSPOWER
jp MoveCardToDiscardPileIfInArena
jp MoveCardToDiscardPileIfInPlayArea

; discard any DEFENDER attached to the turn holder's arena and/or bench Pokemon
DiscardAttachedDefenders:
Expand All @@ -6921,7 +6921,7 @@ DiscardAttachedDefenders:
dec e
jr nz, .unattach_defender_loop
ld de, DEFENDER
jp MoveCardToDiscardPileIfInArena
jp MoveCardToDiscardPileIfInPlayArea

; return carry if the turn holder's arena Pokemon card is asleep, poisoned, or double poisoned.
; also, if confused, paralyzed, or asleep, return the status condition in a.
Expand Down Expand Up @@ -7594,7 +7594,7 @@ GetCardOneStageBelow:
; loads deck indices of the stages present in hTempPlayAreaLocation_ff9d.
; the three stages are loaded consecutively in wAllStagesIndices.
ldh a, [hTempPlayAreaLocation_ff9d]
or CARD_LOCATION_ARENA
or CARD_LOCATION_PLAY_AREA
ld c, a
ld a, DUELVARS_CARD_LOCATIONS
call GetTurnDuelistVariable
Expand Down
9 changes: 5 additions & 4 deletions src/home/duel.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2268,15 +2268,16 @@ GetPlayAreaCardRetreatCost::
call GetLoadedCard1RetreatCost
ret

; move the turn holder's card with ID at de to the discard pile
; if it's currently in the arena.
MoveCardToDiscardPileIfInArena::
; move all turn holder's card with ID at de to the discard pile
; that are currently in the Play Area
; this is used to discard all attached Pluspowers and Defenders
MoveCardToDiscardPileIfInPlayArea::
ld c, e
ld b, d
ld l, DUELVARS_CARD_LOCATIONS
.next_card
ld a, [hl]
and CARD_LOCATION_ARENA
and CARD_LOCATION_PLAY_AREA
jr z, .skip ; jump if card not in arena
ld a, l
call GetCardIDFromDeckIndex
Expand Down

0 comments on commit 81842fe

Please sign in to comment.