servatrice/common/pb/command_create_token.proto
Basile Clement 42e7a8b423
Better support Double-Faced Cards (#4753)
* Better support Double-Faced Cards

This patch allows cards to be (virtually) transformed into other cards
while preserving their state, essentially implemeting the MTG mechanic
of the same name.

On the server side, this is implemented by allowing cards to be "stashed
away". A card that is stashed away is not in any zone, but is instead
owned by another card. When a token is destroyed due to a zone change,
if it had a card stashed away, that card is placed in the target zone
instead of the token.

On the database side, `attach="transform"` is used on `<reverse>` and
`<reverse-related>` to indicate that the created token should be
transformed this way.

Old servers ignore the new field in `Command_CreateToken` and will
perform a regular attachment, as currently.

* Address review comments

* Prevent tokens from being stashed

* format.sh
2023-03-03 16:54:51 +01:00

28 lines
803 B
Protocol Buffer

syntax = "proto2";
import "game_commands.proto";
message Command_CreateToken {
enum TargetMode {
// Attach the target to the token
ATTACH_TO = 0;
// Transform the target into the token
TRANSFORM_INTO = 1;
}
extend GameCommand {
optional Command_CreateToken ext = 1010;
}
optional string zone = 1;
optional string card_name = 2;
optional string color = 3;
optional string pt = 4;
optional string annotation = 5;
optional bool destroy_on_zone_change = 6;
optional sint32 x = 7;
optional sint32 y = 8;
optional string target_zone = 9;
optional sint32 target_card_id = 10 [default = -1];
// What to do with the target card. Ignored if there is no target card.
optional TargetMode target_mode = 11;
}