Allows ritual monsters to be treated as extra deck monsters, to account for the change in RUSH duels. For this implementation, if the flag is used with the extra monster zones enabled, the monster will be summonable to both EMZone and MMZone like other non link cards
Currently, if a SINGLE_EFFECT of type DISABLE/FORBIDDEN is registered as single effect, when that effect is reset via a phase event or by other means that don't make the card move, if the card isn't on the field, the disabled status won't be updated.
Remove the explicit check in card::remove_effect preventing this
Attempt to fix a crash caused by an effect of type EFFECT_TYPE_XMATERIAL no longer having an associated handler if the material granting the effect was detached in the same chain in which its effect was activated
Added Duel.IsMainPhase, Duel.IsBatlePhase, Duel.IsPhase and Duel.IsTurnPlayer.
Update Card.IsCanBeEffectTarget: Prevent tokens that are no longer on the field from being valid cards for this function
* Update Card.IsReleasable to accept a second, optional parameter for the reason. Update GetReleaseGroup, GetReleaseGroupCount the same way as well, with the new parameter being the 4th. Defaulting it to REASON_COST will prevent massive script changes (cards that tribute by effect already use Card.IsReleasableByEffect).
* Update EFFECT_CANNOT_RELEASE to pass the reason and the reason effect a 4th and 5th parameters to its target function
* Pass the reason down the line until get_release_list, check_release_list,is_player_can_release and card::is_releasable_by_nonsummon, updating internal function calls accordingly
---------
Co-authored-by: Edoardo Lolletti <edoardo762@gmail.com>
Implement it natively rather than via lua, correctly handle the scenario where one of the xyz monsters to be overlaid has an effect to banish any card sent to the grave and it would be still applying if duel.sendtograve was called manually from the script
Decouple the summon location from the summon type, also keep track of the sequence and if the card was in a pzone, this allows to use symbolic locations in Card.IsSummonLocation as wel
LOCATION_STZONE (the Spell & Trap zone, so excluding mr3 pzones and field zone), LOCATION_MMZONE and LOCATION_EMZONE. Usable in GetMatchingCard, GetFieldGroup, etc
The given lua stack to a c function has enough room to push few return values without issues, so all the functions that return a fixed amount of values (usually 1 or 2) weren't touched, all the others that return an unknown amount are now properly calling checkstack to make the lua api allocate the space needed for all the return values.
Bump the race value size from 32 to 64 bit, giving us 32 new race values.
This is needed to futureproof the new upcoming rush card types, that could end up making the card types become more than 32.
This change breaks both the core abi and the messages.
For the abi now the race field in the OCG_CardData struct changed from uint32_t to uint64_t.
For the messages, QUERY_RACE will now be an uint64_t instead of uint32_t, MSG_ANNOUNCE_RACE will send an uint64_t for the races that can be declared, and also will now expect an uint64_t as answer, also, the HINT_RACE property associated with MSG_HINT will be using the full uint64_t data field as well.
Return 0 even if there's sumtype passed.
All the other functions don't have this special handling, probably it was a typo introduced when updating those functions, rn it will cause issues with skills and trap monsters that would be treated as cards having a race if used as materials.
The above change made ALL xyz materials be checked for being properly summoned when checking is_can_be_special_summoned instead of only materials with a revive limit effect, thus returning false for all the cards that didn't have such effect