core: a Tag team can share one Extra Deck, each card keeps its partner (TICKET-433, v1.6.0)
Option DUEL_TAG_SHARED_EXTRA 0x200: start_duel moves tag_list_extra into list_extra and renumbers, for both teams; tag_swap skips its Extra block. card::tag_member is 0 from new_card and 1 from new_tag_card. QUERY_TAG_MEMBER 0x1000000 is written last in get_infos. Bit 0x100000 stays unused: old flags (0xf81fff, 0x181fff, 0xFFFFFF) set it with no value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c2eca90644
commit
8a73120dbb
5 files changed
+30
-9
No files matched your search
@@ -431,6 +431,9 @@ int32_t card::get_infos(byte* buf, uint32_t query_flag, int32_t use_cache) {
|
||||
query_flag &= ~QUERY_LINK;
|
||||
}
|
||||
}
|
||||
if(query_flag & QUERY_TAG_MEMBER) {
|
||||
buffer_write<uint32_t>(p, tag_member);
|
||||
}
|
||||
byte* finalize = buf;
|
||||
buffer_write<int32_t>(finalize, (int32_t)(p - buf));
|
||||
buffer_write<uint32_t>(finalize, query_flag);
|
||||
|
||||
@@ -164,6 +164,7 @@ public:
|
||||
card_state spsummon;
|
||||
query_cache q_cache;
|
||||
uint8_t owner{ PLAYER_NONE };
|
||||
uint8_t tag_member{ 0 }; // [YGOL] proposal 53: the partner who brought it, 0 from new_card, 1 from new_tag_card
|
||||
uint8_t summon_player{ PLAYER_NONE };
|
||||
uint32_t summon_info{};
|
||||
uint32_t status{};
|
||||
|
||||
@@ -271,6 +271,7 @@ enum LuaParamType : int32_t {
|
||||
#define QUERY_LSCALE 0x200000
|
||||
#define QUERY_RSCALE 0x400000
|
||||
#define QUERY_LINK 0x800000
|
||||
#define QUERY_TAG_MEMBER 0x1000000 // [YGOL] proposal 53. Never 0x100000: old flags (0xf81fff, 0x181fff, 0xFFFFFF) set it with no value
|
||||
|
||||
//Link markers
|
||||
#define LINK_MARKER_BOTTOM_LEFT 0x001
|
||||
@@ -452,6 +453,7 @@ enum LuaParamType : int32_t {
|
||||
#define DUEL_SIMPLE_AI 0x40
|
||||
#define DUEL_RETURN_DECK_TOP 0x80
|
||||
#define DUEL_REVEAL_DECK_SEQ 0x100
|
||||
#define DUEL_TAG_SHARED_EXTRA 0x200 // [YGOL] proposal 53: one Extra Deck per Tag team
|
||||
|
||||
//Activity
|
||||
#define ACTIVITY_SUMMON 1
|
||||
|
||||
+11
-9
@@ -1243,15 +1243,17 @@ void field::tag_swap(uint8_t playerid) {
|
||||
pcard->enable_field_effect(true);
|
||||
}
|
||||
//extra
|
||||
for(auto& pcard : player[playerid].list_extra) {
|
||||
pcard->enable_field_effect(false);
|
||||
pcard->cancel_field_effect();
|
||||
}
|
||||
std::swap(player[playerid].list_extra, player[playerid].tag_list_extra);
|
||||
std::swap(player[playerid].extra_p_count, player[playerid].tag_extra_p_count);
|
||||
for(auto& pcard : player[playerid].list_extra) {
|
||||
pcard->apply_field_effect();
|
||||
pcard->enable_field_effect(true);
|
||||
if(!(core.duel_options & DUEL_TAG_SHARED_EXTRA)) { // [YGOL] proposal 53: a shared Extra Deck stays live for both partners
|
||||
for(auto& pcard : player[playerid].list_extra) {
|
||||
pcard->enable_field_effect(false);
|
||||
pcard->cancel_field_effect();
|
||||
}
|
||||
std::swap(player[playerid].list_extra, player[playerid].tag_list_extra);
|
||||
std::swap(player[playerid].extra_p_count, player[playerid].tag_extra_p_count);
|
||||
for(auto& pcard : player[playerid].list_extra) {
|
||||
pcard->apply_field_effect();
|
||||
pcard->enable_field_effect(true);
|
||||
}
|
||||
}
|
||||
player[playerid].tag_partner ^= 1; // [YGOL] proposal 45: the other partner's Field slot is the live one now
|
||||
pduel->write_buffer8(MSG_TAG_SWAP);
|
||||
|
||||
@@ -109,6 +109,18 @@ OCGCORE_API void start_duel(intptr_t pduel, uint32_t options) {
|
||||
pd->game_field->core.shuffle_hand_check[1] = FALSE;
|
||||
pd->game_field->core.shuffle_deck_check[0] = FALSE;
|
||||
pd->game_field->core.shuffle_deck_check[1] = FALSE;
|
||||
if((options & DUEL_TAG_MODE) && (options & DUEL_TAG_SHARED_EXTRA)) { // [YGOL] proposal 53: the team has one live Extra Deck
|
||||
for(uint8_t p = 0; p < 2; ++p) {
|
||||
auto& team = pd->game_field->player[p];
|
||||
for(auto& pcard : team.tag_list_extra) {
|
||||
team.list_extra.push_back(pcard);
|
||||
pcard->apply_field_effect();
|
||||
pcard->enable_field_effect(true);
|
||||
}
|
||||
team.tag_list_extra.clear();
|
||||
pd->game_field->reset_sequence(p, LOCATION_EXTRA);
|
||||
}
|
||||
}
|
||||
if(pd->game_field->player[0].start_count > 0)
|
||||
pd->game_field->draw(0, REASON_RULE, PLAYER_NONE, 0, pd->game_field->player[0].start_count);
|
||||
if(pd->game_field->player[1].start_count > 0)
|
||||
@@ -198,6 +210,7 @@ OCGCORE_API void new_tag_card(intptr_t pduel, uint32_t code, uint8_t owner, uint
|
||||
if(owner > 1 || !(location & (LOCATION_DECK | LOCATION_EXTRA)))
|
||||
return;
|
||||
card* pcard = ptduel->new_card(code);
|
||||
pcard->tag_member = 1; // [YGOL] proposal 53
|
||||
switch(location) {
|
||||
case LOCATION_DECK:
|
||||
ptduel->game_field->player[owner].tag_list_main.push_back(pcard);
|
||||
|
||||
Reference in new issue
Block a user