prompt context: announce kind byte, record 23 bytes, STOC 0x44 24 bytes (TICKET-451, v1.7.0)
u8 announce_kind after chain_link, set only while MSG_ANNOUNCE_NUMBER is open: 1 when the script called Duel.AnnounceLevel (it passes playerid + 0x10000 to the unit), else 2 when the asking effect has CATEGORY_DICE and is visible to the answering player, else 0. Contract, changelog, binding PromptContext.AnnounceKind + AnnouncePlain / Level / Dice, codec 24 bytes, probe: plain 0, AnnounceLevel 1, a dice effect's AnnounceNumber 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3f84b0b50b
commit
954fbfc65b
12 files changed
+70
-40
No files matched your search
@@ -214,10 +214,10 @@ namespace YGOLegacy.Protocol.Codecs
|
||||
}
|
||||
}
|
||||
|
||||
// The 22-byte ygol_query_prompt_context record (version, has effect, uint32 code, controller, location, sequence, position, uint64 description, uint16 effect index, phase, chain link) + the prompt's MSG id; no sender stamp (v1.7.0, TICKET-451).
|
||||
// The 23-byte ygol_query_prompt_context record (version, has effect, uint32 code, controller, location, sequence, position, uint64 description, uint16 effect index, phase, chain link, announce kind) + the prompt's MSG id; no sender stamp (v1.7.0, TICKET-451).
|
||||
public sealed class PromptContextCodec : IStocCodec<PromptContext>
|
||||
{
|
||||
public const int Size = 23;
|
||||
public const int Size = 24;
|
||||
|
||||
public StocMessage Id => StocMessage.PromptContext;
|
||||
|
||||
@@ -235,8 +235,9 @@ namespace YGOLegacy.Protocol.Codecs
|
||||
var effectIndex = reader.ReadUInt16();
|
||||
var phase = reader.ReadByte();
|
||||
var chainLink = reader.ReadByte();
|
||||
var announceKind = reader.ReadByte();
|
||||
var prompt = reader.ReadByte();
|
||||
return new PromptContext(version, hasEffect, code, controller, location, sequence, position, description, effectIndex, phase, chainLink, prompt);
|
||||
return new PromptContext(version, hasEffect, code, controller, location, sequence, position, description, effectIndex, phase, chainLink, announceKind, prompt);
|
||||
}
|
||||
|
||||
public void Write(BinaryWriter writer, PromptContext payload)
|
||||
@@ -252,6 +253,7 @@ namespace YGOLegacy.Protocol.Codecs
|
||||
writer.Write(payload.EffectIndex);
|
||||
writer.Write(payload.Phase);
|
||||
writer.Write(payload.ChainLink);
|
||||
writer.Write(payload.AnnounceKind);
|
||||
writer.Write(payload.Prompt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -598,6 +598,9 @@ namespace YGOLegacy.Protocol.Contracts
|
||||
public const byte PhaseTarget = 2;
|
||||
public const byte PhaseOperation = 3;
|
||||
public const byte PhaseAsk = 4;
|
||||
public const byte AnnouncePlain = 0;
|
||||
public const byte AnnounceLevel = 1;
|
||||
public const byte AnnounceDice = 2;
|
||||
|
||||
public byte Version { get; }
|
||||
// False: no effect function runs (battle and idle commands, a plain summon); every other value is zero and EffectIndex is UnknownIndex.
|
||||
@@ -616,13 +619,15 @@ namespace YGOLegacy.Protocol.Contracts
|
||||
public byte Phase { get; }
|
||||
// The chain link the effect is, 0 when it is not on the chain.
|
||||
public byte ChainLink { get; }
|
||||
// MSG_ANNOUNCE_NUMBER only: AnnounceLevel (the script called Duel.AnnounceLevel), AnnounceDice (the asking effect is a visible dice effect); AnnouncePlain everywhere else.
|
||||
public byte AnnounceKind { get; }
|
||||
// The MSG_* id of the prompt this context belongs to.
|
||||
public byte Prompt { get; }
|
||||
|
||||
public PromptContext(bool hasEffect, uint code, byte controller, byte location, byte sequence, byte position, ulong description, ushort effectIndex, byte phase, byte chainLink, byte prompt)
|
||||
: this(CurrentVersion, hasEffect, code, controller, location, sequence, position, description, effectIndex, phase, chainLink, prompt) { }
|
||||
public PromptContext(bool hasEffect, uint code, byte controller, byte location, byte sequence, byte position, ulong description, ushort effectIndex, byte phase, byte chainLink, byte announceKind, byte prompt)
|
||||
: this(CurrentVersion, hasEffect, code, controller, location, sequence, position, description, effectIndex, phase, chainLink, announceKind, prompt) { }
|
||||
|
||||
public PromptContext(byte version, bool hasEffect, uint code, byte controller, byte location, byte sequence, byte position, ulong description, ushort effectIndex, byte phase, byte chainLink, byte prompt)
|
||||
public PromptContext(byte version, bool hasEffect, uint code, byte controller, byte location, byte sequence, byte position, ulong description, ushort effectIndex, byte phase, byte chainLink, byte announceKind, byte prompt)
|
||||
{
|
||||
Version = version;
|
||||
HasEffect = hasEffect;
|
||||
@@ -635,10 +640,11 @@ namespace YGOLegacy.Protocol.Contracts
|
||||
EffectIndex = effectIndex;
|
||||
Phase = phase;
|
||||
ChainLink = chainLink;
|
||||
AnnounceKind = announceKind;
|
||||
Prompt = prompt;
|
||||
}
|
||||
|
||||
public static PromptContext None(byte prompt) => new PromptContext(false, 0, 0, 0, 0, 0, 0, UnknownIndex, PhaseOther, 0, prompt);
|
||||
public static PromptContext None(byte prompt) => new PromptContext(false, 0, 0, 0, 0, 0, 0, UnknownIndex, PhaseOther, 0, AnnouncePlain, prompt);
|
||||
|
||||
public bool IsHidden => HasEffect && Code == 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user