core: a Tag team on Master Rule 4/5 has a Field slot per partner (TICKET-384, v1.5.0)

Proposal 45. field::has_two_fields() (DUEL_TAG_MODE on Master Rule 4 or 5) gives
each team Spell/Trap sequence 5 for the partner who plays the team's first turn and
6 for the other; player_info::tag_partner flips in tag_swap and get_szone_size is 7
there. A Field Spell lands in the playing partner's slot (get_fzone_landing) and
replaces only that card; a control change takes the free slot when the playing
partner's is taken; a Set offers only the landing slot's bit. LOCATION_FZONE covers
both slots in card_state::is_location, filter_matching_card, filter_field_card,
is_location_useable and Duel.IsEnvironment; get_field_card(p, LOCATION_FZONE, 0) is
the playing partner's field, else the other, and 1 the remaining one. Singles, Match
and Master Rule 3 (slot 6 = a Pendulum Zone) are unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
donnyandClaude Fable 5.1 committed 2026-10-24 18:35:20 -07:00
1 parent 10ade7fc41
commit bcd19c9cd0
5 files changed
+98 -44

No files matched your search

+11 -8
View File
@@ -2459,7 +2459,7 @@ int32_t field::sset(uint16_t step, uint8_t setplayer, uint8_t toplayer, card * t
return TRUE;
uint32_t flag = 0;
if(target->data.type & TYPE_FIELD) {
flag = ~(0x1U << 13);
flag = ~(0x1U << (8 + get_fzone_landing(target, toplayer))); // [YGOL] proposal 45: the partner's Field slot
} else {
get_useable_count(target, setplayer, LOCATION_SZONE, toplayer, LOCATION_REASON_TOFIELD, zone ? zone : 0xff, &flag);
flag = ((flag & 0xff) << 8) | 0xffff00ff;
@@ -2567,7 +2567,7 @@ int32_t field::sset_g(uint16_t step, uint8_t setplayer, uint8_t toplayer, group*
card_set* set_cards = (card_set*)ptarget;
card* target = *set_cards->begin();
if(target->data.type & TYPE_FIELD) {
returns.bvalue[2] = 5;
returns.bvalue[2] = get_fzone_landing(target, toplayer); // [YGOL] proposal 45
return FALSE;
}
uint32_t flag;
@@ -2606,7 +2606,7 @@ int32_t field::sset_g(uint16_t step, uint8_t setplayer, uint8_t toplayer, group*
target->enable_field_effect(false);
uint32_t zone;
if(target->data.type & TYPE_FIELD) {
zone = 0x1U << 5;
zone = 0x1U << get_fzone_landing(target, toplayer); // [YGOL] proposal 45
} else {
for(int32_t i = 0; i < 7; i++) {
zone = 0x1U << i;
@@ -2676,6 +2676,8 @@ int32_t field::sset_g(uint16_t step, uint8_t setplayer, uint8_t toplayer, group*
uint8_t ct = (uint8_t)core.operated_set.size();
if(core.set_group_used_zones & (0x1U << 5))
--ct;
if(core.set_group_used_zones & (0x1U << 6)) // [YGOL] proposal 45: the second Field slot
--ct;
if(ct <= 1)
return FALSE;
pduel->write_buffer8(MSG_SHUFFLE_SET_CARD);
@@ -4602,9 +4604,10 @@ int32_t field::move_to_field(uint16_t step, card* target, uint32_t enable, uint3
returns.ivalue[0] = FALSE;
if((ret == RETURN_TEMP_REMOVE_TO_FIELD) && (!(target->current.reason & REASON_TEMPORARY) || (target->current.reason_effect->owner != core.reason_effect->owner)))
return TRUE;
if(location == LOCATION_SZONE && zone == 0x1U << 5 && (target->data.type & TYPE_FIELD) && (target->data.type & TYPE_SPELL)) {
card* pcard = get_field_card(playerid, LOCATION_SZONE, 5);
if(pcard) {
if(location == LOCATION_SZONE && is_fzone_zone(zone) && (target->data.type & TYPE_FIELD) && (target->data.type & TYPE_SPELL)) {
// [YGOL] proposal 45: the card replaces only the Field slot it lands in
card* pcard = get_field_card(playerid, LOCATION_SZONE, get_fzone_landing(target, playerid));
if(pcard && pcard != target) {
if(core.duel_rule >= 3)
send_to(pcard, 0, REASON_RULE, pcard->current.controler, PLAYER_NONE, LOCATION_GRAVE, 0, 0);
else
@@ -4683,8 +4686,8 @@ int32_t field::move_to_field(uint16_t step, card* target, uint32_t enable, uint3
}
case 1: {
uint32_t seq = returns.bvalue[2];
if(location == LOCATION_SZONE && zone == 0x1U << 5 && (target->data.type & TYPE_FIELD) && (target->data.type & TYPE_SPELL))
seq = 5;
if(location == LOCATION_SZONE && is_fzone_zone(zone) && (target->data.type & TYPE_FIELD) && (target->data.type & TYPE_SPELL))
seq = get_fzone_landing(target, playerid); // [YGOL] proposal 45
if(ret != RETURN_TEMP_REMOVE_TO_FIELD) {
if(location != target->current.location) {
uint32_t resetflag = 0;