Fluorohydride / ygopro-core

ygopro script engine.
MIT License
327 stars 134 forks source link

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

Closed salix5 closed 6 months ago

salix5 commented 6 months ago

334

516

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

The reason for release now:

They should be applied to Duel.Sendto*, as @465uytrewq suggested in https://github.com/Fluorohydride/ygopro-scripts/pull/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 commented 6 months ago

merged as a workaround