core: a card with a distant alias keeps its own setcodes (v1.7.1)
A rule_code card answered is_set_card from the named card only, so a custom card that adds an archetype its base card lacks lost it in the duel (Vennominon 810000878 was not a "Venom" monster for Venom Fangs). check_code_setcode adds the card's own setcodes while it bears its own rule_code; is_set_card, is_pre_set_card and is_special_summon_set_card use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WoiqG2TqZQmJ8tTn8tYpgy
This commit is contained in:
1 parent
313d8f34de
commit
00ed2796f1
4 files changed
+23
-18
No files matched your search
@@ -5,6 +5,15 @@ wire protocol, the engine message stream, the setup pairs and the Lua API. A row
|
||||
change first shipped in the Unity repo, the ticket, and the contract part it touched. Rows 0001-0024
|
||||
are the fork patches replayed into this repo as commits (`git log --oneline -- server/gframe core`).
|
||||
|
||||
## v1.7.1 — 2026-11-11
|
||||
|
||||
A card whose cdb alias names another card keeps its own setcodes. No new export, message or capability bit:
|
||||
exports 336 / 857 / 851, protocol 12, capabilities `0xF7FF`.
|
||||
|
||||
| Date | Change | Ticket | Contract part |
|
||||
|---|---|---|---|
|
||||
| 2026-11-11 | Core: a card read with a `rule_code` (a cdb alias outside the artwork range, which the readers turn into `rule_code`) answered `is_set_card` from the NAMED card's setcodes only, so a custom card that adds an archetype its base card lacks lost it in the duel ("Vennominon" 810000878, setcode `0x50`, named 72677437, setcode 0: "Venom Fangs" could not equip it; 21 cards of the custom pack). `card::check_code_setcode`: while the card's code is its own `rule_code`, its own `data.setcode` answers too, then the named card's. Used by `is_set_card`, `is_pre_set_card` and `is_special_summon_set_card`. A card renamed by `EFFECT_CHANGE_CODE` takes the new name's setcodes only, as before. Card.IsSetCard / IsPreviousSetCard / IsSummonSetCard. | none (owner) | (d) Lua API: behaviour |
|
||||
|
||||
## v1.7.0 — 2026-11-08
|
||||
|
||||
Prompt context (proposal 55): right before every prompt the answering seat learns which card and which effect asks.
|
||||
|
||||
@@ -240,6 +240,7 @@ duelist's own side (v1.2.0), both sides for an observer when spectators see all
|
||||
| `0x1000` | `FEATURE_TAG_TWO_FIELDS` | 10 | v1.5.0 | Tag two Field slots: Spell/Trap sequence 6 is a team's second Field Zone (no message); a Tag room refuses a joiner without it |
|
||||
| `0x2000` | `FEATURE_TAG_PARTNER_CARDS` | 9 | v1.2.0 | Tag partner cards (`STOC_TAG_PARTNER_CARDS`, `ygol_query_tag_cards`) |
|
||||
| `0x4000` | `FEATURE_TAG_SHARED_EXTRA` | 11 | v1.6.0 | Tag shared Extra Deck: the setup pair `ygol.tag.extra=shared`, `QUERY_TAG_MEMBER` on Extra Deck refreshes; a Tag room refuses a joiner without it |
|
||||
| v1.7.1 | A card read with a `rule_code` (a distant cdb alias) is a member of its OWN setcodes as well as those of the card it names: `Card.IsSetCard`, `Card.IsPreviousSetCard` and `Card.IsSummonSetCard` check `data.setcode` while the card bears its own `rule_code` (`card::check_code_setcode`). A card renamed by `EFFECT_CHANGE_CODE` answers from the new name only, as stock. No new message, no capability bit. |
|
||||
| `0x8000` | `FEATURE_PROMPT_CONTEXT` | 12 | v1.7.0 | Prompt context (`STOC_PROMPT_CONTEXT`, `ygol_query_prompt_context`): which card and which effect asks; no room refuses a joiner without it |
|
||||
|
||||
`FEATURE_PROTOCOL` is bumped by every patch that adds a message a client must understand; the join
|
||||
|
||||
+12
-18
@@ -179,6 +179,13 @@ bool card::check_card_setcode(uint32_t code, uint32_t value) {
|
||||
::read_card(code, &dat);
|
||||
return dat.is_setcode(value);
|
||||
}
|
||||
bool card::check_code_setcode(uint32_t code, uint32_t value) const {
|
||||
if (code == data.code)
|
||||
return data.is_setcode(value);
|
||||
if (data.rule_code && code == data.rule_code && data.is_setcode(value))
|
||||
return true;
|
||||
return check_card_setcode(code, value);
|
||||
}
|
||||
void card::attacker_map::addcard(card* pcard) {
|
||||
auto fid = pcard ? pcard->fieldid_r : 0;
|
||||
auto pr = emplace(fid, mapped_type(pcard, 0));
|
||||
@@ -511,15 +518,8 @@ uint32_t card::get_another_code() {
|
||||
}
|
||||
int32_t card::is_set_card(uint32_t set_code) {
|
||||
uint32_t code1 = get_code();
|
||||
card_data dat1;
|
||||
if (code1 == data.code) {
|
||||
if (data.is_setcode(set_code))
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
if (check_card_setcode(code1, set_code))
|
||||
return TRUE;
|
||||
}
|
||||
if (check_code_setcode(code1, set_code))
|
||||
return TRUE;
|
||||
uint32_t code2 = get_another_code();
|
||||
if (code2 && check_card_setcode(code2, set_code))
|
||||
return TRUE;
|
||||
@@ -544,14 +544,8 @@ int32_t card::is_origin_set_card(uint32_t set_code) {
|
||||
}
|
||||
int32_t card::is_pre_set_card(uint32_t set_code) {
|
||||
uint32_t code = previous.code;
|
||||
if (code == data.code) {
|
||||
if (data.is_setcode(set_code))
|
||||
return TRUE;
|
||||
}
|
||||
else {
|
||||
if (check_card_setcode(code, set_code))
|
||||
return TRUE;
|
||||
}
|
||||
if (check_code_setcode(code, set_code))
|
||||
return TRUE;
|
||||
uint32_t code2 = previous.code2;
|
||||
if (code2 && check_card_setcode(code2, set_code))
|
||||
return TRUE;
|
||||
@@ -598,7 +592,7 @@ int32_t card::is_link_set_card(uint32_t set_code) {
|
||||
}
|
||||
int32_t card::is_special_summon_set_card(uint32_t set_code) {
|
||||
uint32_t code = spsummon.code;
|
||||
if (check_card_setcode(code, set_code))
|
||||
if (check_code_setcode(code, set_code))
|
||||
return TRUE;
|
||||
uint32_t code2 = spsummon.code2;
|
||||
if (code2 && check_card_setcode(code2, set_code))
|
||||
|
||||
@@ -229,6 +229,7 @@ public:
|
||||
~card() = default;
|
||||
static bool card_operation_sort(card* c1, card* c2);
|
||||
static bool check_card_setcode(uint32_t code, uint32_t value);
|
||||
bool check_code_setcode(uint32_t code, uint32_t value) const;
|
||||
bool is_extra_deck_monster() const { return !!(data.type & TYPES_EXTRA_DECK); }
|
||||
|
||||
int32_t get_infos(byte* buf, uint32_t query_flag, int32_t use_cache = TRUE);
|
||||
|
||||
Reference in new issue
Block a user