Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix reason check in field::send_to(uint16 step #580

Merged
merged 1 commit into from
Apr 28, 2024
Merged

Conversation

salix5
Copy link
Collaborator

@salix5 salix5 commented Apr 27, 2024

#334
#516

As we have seen before, dividing the reason into effect/cost is not enough.

The reason for release now:

  • REASON_ACTION
    "This card cannot declare an attack unless"... (Panther Warrior)

  • REASON_COST
    The card is released by the cost of effect activation.
    Prohibited by Ritual Beast Ulti-Reirautari.

  • REASON_EFFECT
    The card is released by effect. (Ritual Summon)

  • REASON_MAINTENANCE
    The maintenance cost. (Aerial Recharge)

  • REASON_SPSUMMON
    The card is released by the Special Summon procedure. (Blue-Eyes Toon Dragon)

  • REASON_SUMMON
    The card is released by Tribute Summon.

  • REASON_RULE
    The card is is released by non-effect actions. (痛み分け/Share the Pain)

They should be applied to Duel.Sendto*, as @465uytrewq suggested in Fluorohydride/ygopro-scripts#2366 .

Now it will check pcard->is_affect_by_effect only when the move is marked by REASON_EFFECT.

Test script:

--[[message #580]]
Debug.ReloadFieldBegin(DUEL_ATTACK_FIRST_TURN+DUEL_SIMPLE_AI)
Debug.SetPlayerInfo(0,8000,0,0)
Debug.SetPlayerInfo(1,8000,0,0)

Debug.AddCard(16886617,0,0,LOCATION_HAND,0,POS_FACEDOWN)
Debug.AddCard(72270339,0,0,LOCATION_HAND,1,POS_FACEDOWN)

Debug.AddCard(27240101,0,0,LOCATION_MZONE,0,POS_FACEUP_ATTACK)
Debug.AddCard(27240101,0,0,LOCATION_MZONE,1,POS_FACEUP_ATTACK)

Debug.AddCard(66570171,0,0,LOCATION_DECK,0,POS_FACEDOWN)
Debug.AddCard(40044918,0,0,LOCATION_DECK,1,POS_FACEDOWN)
Debug.AddCard(66570171,0,0,LOCATION_DECK,2,POS_FACEDOWN)

Debug.AddCard(66570171,1,1,LOCATION_DECK,0,POS_FACEDOWN)
Debug.AddCard(40044918,1,1,LOCATION_DECK,1,POS_FACEDOWN)
Debug.AddCard(27660735,1,1,LOCATION_DECK,2,POS_FACEDOWN)

Debug.ReloadFieldEnd()
--aux.BeginPuzzle()

@mercury233
@purerosefallen

@salix5 salix5 mentioned this pull request Apr 27, 2024
@salix5 salix5 merged commit 6b6d7ea into master Apr 28, 2024
1 check passed
@salix5 salix5 deleted the patch-reason branch April 28, 2024 13:37
@salix5
Copy link
Collaborator Author

salix5 commented Apr 28, 2024

merged as a workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant