github.com/loomnetwork/gamechain@v0.0.0-20200406110549-36c47eb97a92/types/zb/zb_data/zb_data.proto (about)

     1  syntax = "proto3";
     2  
     3  option csharp_namespace = "Loom.ZombieBattleground.Protobuf";
     4  
     5  import "github.com/gogo/protobuf/gogoproto/gogo.proto";
     6  import "github.com/loomnetwork/go-loom/types/types.proto";
     7  import "github.com/loomnetwork/gamechain/types/nullable/nullable_pb/nullable.proto";
     8  import "github.com/loomnetwork/gamechain/types/zb/zb_enums/zb_enums.proto";
     9  import "github.com/loomnetwork/gamechain/types/zb/zb_custombase/zb_custombase.proto";
    10  
    11  message InitData {
    12      repeated Deck defaultDecks = 1;
    13      repeated CardCollectionCard defaultCollection = 2;
    14      repeated Card cards = 3;
    15      repeated OverlordPrototype overlords = 4;
    16      repeated AIDeck aiDecks = 5;
    17      string version = 6;
    18      Address oracle = 7;
    19      OverlordLevelingData overlordLeveling = 8;
    20  }
    21  
    22  message Account {
    23      string user_id             = 1;
    24      bool phone_number_verified = 2;
    25      bool reward_redeemed       = 3;
    26      bool is_kickstarter        = 4;
    27      string image               = 5;
    28      bool email_notification    = 6;
    29      int64 elo_score            = 7;
    30      int32 current_tier         = 8;
    31      int32 game_membership_tier = 9;
    32      bytes owner                = 10;
    33  }
    34  
    35  message Deck {
    36      int64 id = 1;
    37      string name = 2;
    38      int64 overlordId = 3;
    39      repeated DeckCard cards = 4;
    40      OverlordSkillType.Enum primarySkill = 5;
    41      OverlordSkillType.Enum secondarySkill = 6;
    42  }
    43  
    44  message Card {
    45      reserved 1; // int64 mouldId
    46      CardKey cardKey = 23 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/loomnetwork/gamechain/battleground/proto.CardKey"];
    47      CardSet.Enum set = 24;
    48      CardKind.Enum kind = 2;
    49      Faction.Enum faction = 3;
    50      string name = 4;
    51      string description = 5;
    52      string flavorText = 6;
    53      string picture = 7;
    54      CreatureRank.Enum rank = 8;
    55      CardType.Enum type = 9;
    56      string frame = 11;
    57      int32 damage = 12;
    58      int32 defense = 13;
    59      int32 cost = 14;
    60      CardPictureTransforms pictureTransforms = 16;
    61      repeated AbilityData abilities = 17;
    62      UniqueAnimation.Enum uniqueAnimation = 18;
    63      reserved 19;
    64      bool hidden = 20;
    65      reserved 21; // int64 sourceMouldId = 21;
    66      CardOverrides overrides = 22;
    67  }
    68  
    69  message CardOverrides {
    70      CardSetEnumValue set = 17;
    71      CardKindEnumValue kind = 1;
    72      FactionEnumValue faction = 2;
    73      StringValue name = 3;
    74      StringValue description = 4;
    75      StringValue flavorText = 5;
    76      StringValue picture = 6;
    77      CreatureRankEnumValue rank = 7;
    78      CardTypeEnumValue type = 8;
    79      StringValue frame = 9;
    80      Int32Value damage = 10;
    81      Int32Value defense = 11;
    82      Int32Value cost = 12;
    83      CardPictureTransforms pictureTransforms = 13;
    84      repeated AbilityData abilities = 14;
    85      UniqueAnimationEnumValue uniqueAnimation = 15;
    86      BoolValue hidden = 16;
    87  }
    88  
    89  message CardInstanceSpecificData {
    90      int32 damage = 1;
    91      int32 defense = 2;
    92      CardType.Enum type = 3;
    93      Faction.Enum faction = 4;
    94      int32 cost = 5;
    95      repeated AbilityData abilities = 6;
    96  }
    97  
    98  message CardPictureTransforms {
    99      PictureTransform battleground = 1;
   100      PictureTransform deckUI = 2;
   101      PictureTransform pastAction = 3;
   102  }
   103  
   104  message PictureTransform {
   105      Vector2Float position = 1;
   106      float scale = 3;
   107      reserved 2; // Vector3Float scale      = 2;
   108  }
   109  
   110  message Vector2Float {
   111      float x = 1;
   112      float y = 2;
   113  }
   114  
   115  message Vector2Int {
   116      int32 x = 1;
   117      int32 y = 2;
   118  }
   119  
   120  message Rect {
   121      Vector2Int position = 1;
   122      Vector2Int size = 2;
   123  }
   124  
   125  message CardList {
   126      repeated Card cards = 1;
   127  }
   128  
   129  message CardCollectionCard {
   130      reserved 1; //string cardName_deprecated = 1 [deprecated = true, json_name = "cardName"];
   131      int64 amount = 2;
   132      reserved 3; // int64 mouldId = 3;
   133      CardKey cardKey = 4 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/loomnetwork/gamechain/battleground/proto.CardKey"];
   134  }
   135  
   136  message DeckCard {
   137      reserved 1; // string card_name_deprecated = 1 [deprecated = true, json_name = "cardName"];
   138      int64 amount = 2;
   139      reserved 3; // int64 mouldId = 3;
   140      CardKey cardKey = 4 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/loomnetwork/gamechain/battleground/proto.CardKey"];
   141  }
   142  
   143  message CardLibrary {
   144      repeated Card cards = 1;
   145  }
   146  
   147  // Overlord prototype, shared between all users
   148  message OverlordPrototype {
   149      int64 id = 1;
   150  
   151      string icon = 2;
   152      string name = 3;
   153      string shortName = 13;
   154      string shortDescription = 4;
   155      string longDescription = 5;
   156      Faction.Enum faction = 6;
   157  
   158      reserved 7, 8; // experience, level
   159      reserved 10, 11;
   160  
   161      repeated OverlordSkillPrototype skills = 9;
   162      int32 initialDefense = 12;
   163  }
   164  
   165  // Per-user overlord data, stored between matches
   166  message OverlordUserData {
   167      int64 prototypeId = 1;
   168      int64 experience = 2;
   169      int64 level = 3;
   170      repeated int64 unlockedSkillIds = 4;
   171  }
   172  
   173  // Full overlord data, tuple of shared and per-user data
   174  message OverlordUserInstance {
   175      OverlordPrototype prototype = 1;
   176      OverlordUserData userData = 2;
   177  }
   178  
   179  // Overlord data only meaningful within a single match
   180  message OverlordMatchInstance {
   181      InstanceId instanceId = 1;
   182      int32 defense = 2;
   183      int32 goo = 3;
   184      int32 maxGoo = 4;
   185  }
   186  
   187  message OverlordSkillPrototype {
   188      string title = 1;
   189      OverlordSkillType.Enum skill = 2;
   190      string iconPath = 3;
   191      string description = 4;
   192      repeated SkillTarget.Enum skillTargets = 5;
   193      UnitSpecialStatus.Enum targetUnitSpecialStatus = 6;
   194      repeated Faction.Enum targetFactions = 7;
   195      int32 value = 8;
   196  
   197      int32 cooldown = 9;
   198      int32 initialCooldown = 10;
   199  
   200      int32 damage = 11;
   201      int32 count = 12;
   202  
   203      int64 id = 13;
   204      reserved 14; // unlocked
   205      bool canSelectTarget = 15;
   206      string unitStatus = 16;
   207  
   208      bool singleUse = 17;
   209  }
   210  
   211  message OverlordPrototypeList {
   212      repeated OverlordPrototype overlords = 1;
   213  }
   214  
   215  message OverlordUserDataList {
   216      repeated OverlordUserData overlordsUserData = 1;
   217  }
   218  
   219  message CardCollectionList {
   220      repeated CardCollectionCard cards = 1;
   221  }
   222  
   223  message DeckList {
   224      repeated Deck decks = 1;
   225  }
   226  
   227  message AIDeck {
   228      Deck deck = 1;
   229      AIType.Enum type = 2;
   230  }
   231  
   232  message AIDeckList {
   233      repeated AIDeck decks = 1;
   234  }
   235  
   236  message OverlordLevelingData {
   237      repeated LevelReward rewards = 1;
   238      repeated ExperienceAction experienceActions = 2;
   239      int32 fixed = 3;
   240      int32 experienceStep = 4;
   241      int32 gooRewardStep = 5;
   242      int32 maxLevel = 6;
   243  }
   244  
   245  message LevelReward {
   246      int32 level = 1;
   247      oneof reward {
   248          OverlordSkillRewardItem skillReward = 2;
   249          BoosterPackRewardItem boosterPackReward = 3;
   250      }
   251  }
   252  
   253  message OverlordSkillRewardItem {
   254      int32 skillIndex = 1;
   255  }
   256  
   257  message BoosterPackRewardItem {
   258      int32 amount = 1;
   259  }
   260  
   261  message ExperienceAction {
   262      ExperienceActionType.Enum action = 1;
   263      int32 experience = 2;
   264  }
   265  
   266  message ContractState {
   267      // Last Plasmachain block succesfully processed by oracle
   268      uint64 lastPlasmachainBlockNumber = 1;
   269      reserved 2; //uint64 reward_contract_version = 2;
   270      reserved 3; // uint64 tutorial_reward_amount = 3;
   271      reserved 4; // default_player_defense
   272      BigUInt currentFiatPurchaseTxId = 5;
   273      uint64 currentOracleCommandId = 6;
   274  }
   275  
   276  message ContractConfiguration {
   277      // Plasmachain FiatPurchase contract version
   278      uint64 fiatPurchaseContractVersion = 1;
   279      BigUInt initialFiatPurchaseTxId = 2;
   280      bool useCardLibraryAsUserCollection = 3;
   281      repeated DataWipeConfiguration dataWipeConfiguration = 4;
   282      string cardCollectionSyncDataVersion = 5;
   283  }
   284  
   285  //////////// Match Making /////////////
   286  
   287  message PlayerState {
   288      string id = 1;
   289      PlayerActionType.Enum currentAction = 2;
   290      reserved 3; // OverlordMatchInstance overlordInstance
   291      repeated CardInstance cardsInHand = 4;
   292      repeated CardInstance cardsInPlay = 5;
   293      repeated CardInstance cardsInDeck = 6;
   294      Deck deck = 7;
   295      int32 defense = 8;
   296      int32 currentGoo = 9;
   297      int32 gooVials = 10;
   298      bool hasDrawnCard = 11;
   299      repeated CardInstance cardsInGraveyard = 12;
   300      int32 initialCardsInHandCount = 13;
   301      int32 maxCardsInPlay = 14;
   302      int32 maxCardsInHand = 15;
   303      int32 maxGooVials = 16;
   304      int32 turnTime = 17;
   305      int32 turnNumber = 18;
   306      InstanceId instanceId = 19;
   307      repeated CardInstance mulliganCards = 20;
   308      int32 index = 21;
   309  }
   310  
   311  message InitialPlayerState {
   312      string id = 1;
   313      bool matchAccepted = 2;
   314      Deck deck  = 3;
   315  }
   316  
   317  message PlayerTimestamp {
   318      string id = 1;
   319      int64 updatedAt = 2;
   320  }
   321  
   322  message Match {
   323      int64 id = 1;
   324      repeated string topics = 2;
   325  
   326      // TODO: this data is not used by the client, but is still sent.
   327      // Perhaps we can split Match into MatchMetadata and MatchInitialPlayerState
   328      repeated InitialPlayerState playerStates = 3;
   329      enum Status {
   330          Created      = 0;
   331          Matching     = 1;
   332          Started      = 2;
   333          Playing      = 3;
   334          PlayerLeft   = 4;
   335          Ended        = 5;
   336          Timedout     = 6;
   337          Canceled     = 7;
   338      }
   339      Status status = 4;
   340      string version = 5;
   341      int64 randomSeed = 6;
   342      Address customGameAddr = 7;
   343      int64 createdAt = 8;
   344      bool useBackendGameLogic = 9;
   345      repeated PlayerTimestamp playerLastSeens = 10;
   346      repeated DebugCheatsConfiguration playerDebugCheats = 11;
   347  }
   348  
   349  message MatchMakingInfoList {
   350      repeated MatchMakingInfo infos = 1;
   351  }
   352  
   353  message MatchMakingInfo {
   354      string userId = 1;
   355      Deck deck = 2;
   356  }
   357  
   358  message PlayerAction {
   359      PlayerActionType.Enum actionType = 1; // not sure we really need this
   360      string playerId = 2;
   361      oneof action {
   362          PlayerActionEndTurn endTurn = 3;
   363          PlayerActionMulligan mulligan = 4;
   364          PlayerActionCardPlay cardPlay = 5;
   365          PlayerActionCardAttack cardAttack = 6;
   366          PlayerActionCardAbilityUsed cardAbilityUsed = 7;
   367          PlayerActionOverlordSkillUsed overlordSkillUsed = 8;
   368          PlayerActionLeaveMatch leaveMatch = 9;
   369          PlayerActionRankBuff rankBuff = 10;
   370          PlayerActionCheatDestroyCardsOnBoard cheatDestroyCardsOnBoard = 11;
   371      };
   372      repeated PlayerActionOutcome actionOutcomes = 14;
   373      int64 createdAt = 15; // timestamp
   374  
   375      // To be removed later. Only useful for client-logic games.
   376      // After constructing the "meat" of the action, the client fills this structure with his local game state.
   377      // The other client can then compare the game with his own and panic if de-sync is detected.
   378      GameState controlGameState = 16;
   379  }
   380  
   381  message PlayerActionEvent {
   382      PlayerAction playerAction = 1;
   383      Match match = 2;
   384      History block = 3;
   385      int64 CurrentActionIndex = 4;
   386      bool createdByBackend = 5;
   387  }
   388  
   389  message PlayerProfile {
   390      PlayerProfileRegistrationData registrationData = 1;
   391      int64 updatedAt = 2;
   392  }
   393  
   394  message PlayerProfileRegistrationData {
   395      string userId = 1;
   396      int64 deckId  = 2;
   397      string version = 3;
   398      Address customGame = 4;
   399      repeated string tags = 5;
   400      bool useBackendGameLogic = 6;
   401      DebugCheatsConfiguration debugCheats = 7 [(gogoproto.nullable) = false];
   402  }
   403  
   404  message PlayerPool {
   405      repeated PlayerProfile playerProfiles = 1;
   406  }
   407  
   408  message MatchCount {
   409      int64 currentId = 1;
   410  }
   411  
   412  message DebugCheatsConfiguration {
   413      bool enabled = 1;
   414  
   415      bool useCustomDeck = 2;
   416      Deck customDeck = 3;
   417  
   418      bool useCustomRandomSeed = 4;
   419      int64 customRandomSeed = 5;
   420  
   421      bool disableDeckShuffle = 6;
   422  
   423      string forceFirstTurnUserId = 7;
   424      bool ignoreGooRequirements = 8;
   425  
   426      bool skipMulligan = 9;
   427  }
   428  
   429  // Game Modes
   430  
   431  message GameMode {
   432      string ID = 1;
   433      string name = 2;
   434      string description = 3;
   435      string version = 4;
   436      GameModeType game_mode_type = 5;
   437      Address address = 6;
   438      Address Owner = 7;
   439  }
   440  
   441  message GameModeList {
   442      repeated GameMode game_modes = 1;
   443  }
   444  
   445  enum GameModeType {
   446      Community = 0;
   447      Loom = 1;
   448  }
   449  
   450  message CustomGameModeCustomUiLabel {
   451      string text = 1;
   452  }
   453  
   454  message CustomGameModeCustomUiButton {
   455      string title = 1;
   456      bytes callData = 2;
   457  }
   458  
   459  message CustomGameModeCustomUiElement {
   460      Rect rect = 1;
   461      oneof uiElement {
   462          CustomGameModeCustomUiLabel label = 2;
   463          CustomGameModeCustomUiButton button = 3;
   464      }
   465  }
   466  
   467  //////////////// GAME PLAY //////////////////
   468  
   469  // C# interfaces converted
   470  
   471  message GameState {
   472      int64 id                            = 1;
   473      bool isEnded                        = 2;
   474      int32 currentPlayerIndex            = 3;
   475      repeated PlayerState playerStates   = 4;
   476      int64 currentActionIndex            = 5;
   477      repeated PlayerAction playerActions = 6;
   478      int64 randomSeed                    = 7;
   479      string winner                       = 8;
   480      string version                      = 9;
   481      int64 createdAt                     = 10;
   482      int32 nextInstanceId = 11;
   483  }
   484  
   485  message CardChoosableAbility {
   486      string description = 1;
   487      AbilityData abilityData = 2;
   488      string attribute = 3;
   489  }
   490  
   491  message AbilityData {
   492      AbilityType.Enum ability = 1;
   493      AbilityActivity.Enum activity = 2;
   494      AbilityTrigger.Enum trigger = 3;
   495      repeated Target.Enum targets = 4;
   496      Stat.Enum stat = 5;
   497      Faction.Enum faction = 6;
   498      AbilityEffect.Enum effect = 7;
   499      AttackRestriction.Enum attackRestriction = 8;
   500      CardType.Enum targetCardType = 9;
   501      UnitSpecialStatus.Enum targetUnitSpecialStatus = 10;
   502      CardType.Enum targetUnitType = 11;
   503      int32 value = 12;
   504      int32 damage = 13;
   505      int32 defense = 14;
   506      string name = 15;
   507      int32 turns = 16;
   508      int32 count = 17;
   509      int32 delay = 18;
   510      repeated VisualEffectInfo visualEffectsToPlay = 19;
   511      GameMechanicDescription.Enum gameMechanicDescription = 20;
   512      Faction.Enum targetFaction = 21;
   513      AbilitySubTrigger.Enum subTrigger = 22;
   514      repeated CardChoosableAbility choosableAbilities = 23;
   515      int32 defense2 = 24;
   516      int32 cost = 25;
   517      CardKind.Enum targetCardKind = 26;
   518      repeated GameMechanicDescription.Enum targetGameMechanicDescriptionTypes = 27;
   519  
   520      message VisualEffectInfo {
   521          enum VisualEffectType {
   522              Undefined = 0;
   523              Impact = 1;
   524              Moving = 2;
   525              Impact_Heavy = 3;
   526              Impact_Feral = 4;
   527          }
   528  
   529          VisualEffectType type = 1;
   530          string path = 2;
   531      }
   532  }
   533  
   534  message CardAbilityRage {
   535      int32 addedDamage = 1; // TODO: Remove me
   536      bool wasApplied = 2;
   537  }
   538  
   539  message CardAbilityAdditionalDamageToHeavyInAttack {
   540      int32 addedDamage = 1;
   541  }
   542  
   543  message CardAbilityChangeStat {
   544      int32 statAdjustment = 1;
   545      Stat.Enum stat = 2;
   546  }
   547  
   548  message CardAbilityPriorityAttack {
   549      int32 attackerOldDefense = 1;
   550      int32 targetOldDefense = 2;
   551  }
   552  
   553  message CardAbilityReanimate {
   554      int32 defaultDamage = 1;
   555      int32 defaultDefense = 2;
   556      CardInstance newInstance = 3;
   557  }
   558  
   559  message CardAbilityAttackOverlord {
   560      int32 damage = 1;
   561      bool wasApplied = 2;
   562  }
   563  
   564  message CardAbilityReplaceUnitsWithTypeOnStrongerOnes {
   565      Faction.Enum faction = 1;
   566  }
   567  
   568  message CardAbilityDealDamageToThisAndAdjacentUnits {
   569      int32 adjacentDamage = 1;
   570  }
   571  
   572  message CardAbilityDevourZombieAndCombineStats {
   573      Faction.Enum faction = 1;
   574  }
   575  
   576  message PlayerActionOutcome {
   577      oneof Outcome {
   578          CardAbilityRageOutcome rage = 1;
   579          CardAbilityPriorityAttackOutcome priorityAttack = 2;
   580          CardAbilityAdditionalDamageToHeavyInAttackOutcome additionalDamageToHeavyInAttack = 3;
   581          CardAbilityChangeStatOutcome changeStat = 5;
   582          CardAbilityReanimateOutcome reanimate = 4;
   583          CardAbilityAttackOverlordOutcome attackOverlord = 6;
   584          CardAttackOutcome cardAttack = 7;
   585          CardAbilityReplaceUnitsWithTypeOnStrongerOnesOutcome replaceUnitsWithTypeOnStrongerOnes = 8;
   586          CardAbilityDealDamageToThisAndAdjacentUnitsOutcome dealDamageToThisAndAdjacentUnits = 9;
   587          CardAbilityDevourZombieAndCombineStatsOutcome devourZombieAndCombineStats = 10;
   588      }
   589  
   590      message CardAbilityRageOutcome {
   591          InstanceId instanceId = 1;
   592          int32 newDamage = 2;
   593      }
   594  
   595      message CardAbilityPriorityAttackOutcome {
   596          InstanceId instanceId = 1;
   597          int32 newDefense = 2;
   598      }
   599  
   600      message CardAbilityReanimateOutcome {
   601          CardInstance newCardInstance = 1;
   602      }
   603  
   604      message CardAbilityAdditionalDamageToHeavyInAttackOutcome {
   605          InstanceId instanceId = 1;
   606          int32 addedDamage = 2;
   607      }
   608  
   609      message CardAbilityChangeStatOutcome {
   610          InstanceId instanceId = 1;
   611          int32 newDamage = 2;
   612          int32 newDefense = 3;
   613          Stat.Enum stat = 4;
   614          InstanceId targetInstanceId = 5;
   615      }
   616  
   617      message CardAbilityAttackOverlordOutcome {
   618          InstanceId instanceId = 1;
   619          int32 newDefense = 2;
   620          int32 damage = 3;
   621      }
   622  
   623      message CardAttackOutcome {
   624          InstanceId attackerInstanceId = 1;
   625          InstanceId targetInstanceId = 2;
   626          int32 attackerNewDefense = 3;
   627          int32 targetNewDefense = 4;
   628      }
   629  
   630      message CardAbilityReplaceUnitsWithTypeOnStrongerOnesOutcome {
   631          repeated NewCardInstance newCardInstances = 1;
   632          repeated InstanceId oldInstanceIds = 2;
   633          // info about new card and it position
   634          message NewCardInstance {
   635              CardInstance cardInstance = 1;
   636              int32 position = 2;
   637          }
   638      }
   639  
   640      message CardAbilityDealDamageToThisAndAdjacentUnitsOutcome {
   641          // TBD
   642      }
   643  
   644      message CardAbilityDevourZombieAndCombineStatsOutcome {
   645          repeated InstanceId targetInstanceIds = 1;
   646      }
   647  }
   648  
   649  message CardAbilityInstance {
   650      oneof AbilityType {
   651          CardAbilityRage rage = 1;
   652          CardAbilityPriorityAttack priorityAttack = 2;
   653          CardAbilityReanimate reanimate = 5;
   654          CardAbilityAdditionalDamageToHeavyInAttack additionalDamageToHeavyInAttack = 6;
   655          CardAbilityChangeStat changeStat = 7;
   656          CardAbilityAttackOverlord attackOverlord = 8;
   657          CardAbilityReplaceUnitsWithTypeOnStrongerOnes replaceUnitsWithTypeOnStrongerOnes = 9;
   658          CardAbilityDealDamageToThisAndAdjacentUnits dealDamageToThisAndAdjacentUnits = 10;
   659          CardAbilityDevourZombieAndCombineStats devourZombieAndCombineStats = 11;
   660      }
   661      bool isActive = 3;
   662      AbilityTrigger.Enum trigger = 4;
   663  }
   664  
   665  message CardInstance {
   666      Card prototype = 1;
   667      InstanceId instanceId = 2;
   668      CardInstanceSpecificData instance = 3;
   669      string owner = 4;
   670  
   671      // FIXME: this really shouldn't be in Protobuf
   672      bool abilitiesInstancesInitialized = 5;
   673      repeated CardAbilityInstance abilitiesInstances = 6;
   674      Zone.type zone = 7;
   675      int32 ownerIndex = 8;
   676  }
   677  
   678  message DataIdOwner {
   679      int32 dataId = 1;
   680  }
   681  
   682  // (interface IDeck)
   683  message CardDeck {
   684      repeated Card cards = 1;
   685  }
   686  
   687  message InstanceId {
   688      int32 id = 1;
   689  }
   690  
   691  message OverlordSkillMatchInstance {
   692      OverlordSkillPrototype prototype = 1;
   693      int32 cooldown = 2;
   694  }
   695  
   696  message PlayerActionLeaveMatch {
   697      string winner = 1;
   698      Reason reason = 2;
   699  
   700      enum Reason {
   701          None = 0;
   702          PlayerLeave = 1;
   703          KeepAliveTimeout = 2;
   704      }
   705  }
   706  
   707  message PlayerActionCardPlay {
   708      InstanceId card = 1;
   709      int32 position = 2;
   710  }
   711  
   712  message PlayerActionRankBuff {
   713      InstanceId card = 1;
   714      repeated Unit targets = 2;
   715  }
   716  
   717  message PlayerActionCardAttack {
   718      InstanceId attacker = 1;
   719      Unit target = 2;
   720  }
   721  
   722  message PlayerActionCardAbilityUsed {
   723      InstanceId card = 1;
   724      repeated Unit targets = 3;
   725      AbilityType.Enum AbilityType = 4;
   726  }
   727  
   728  message PlayerActionOverlordSkillUsed {
   729      int64 SkillId = 1;
   730      Unit target = 2;
   731      repeated Unit targets = 3;
   732  }
   733  
   734  message PlayerActionEndTurn {
   735  }
   736  
   737  message PlayerActionMulligan {
   738      repeated InstanceId mulliganedCards = 1;
   739  }
   740  
   741  message PlayerActionCheatDestroyCardsOnBoard {
   742      repeated InstanceId destroyedCards = 1;
   743  }
   744  
   745  message StartGameAction {
   746      repeated PlayerState playerStates = 1;
   747  }
   748  
   749  message Unit {
   750      InstanceId instanceId = 1;
   751      Parameter Parameter = 3;
   752  }
   753  
   754  message Parameter {
   755      int32 Damage  = 1;
   756      int32 Defense = 2;
   757      string CardName = 3;
   758  }
   759  
   760  // Replay
   761  
   762  message GameReplay {
   763      repeated PlayerAction actions = 5;
   764      repeated HistoryData blocks   = 6;
   765  }
   766  
   767  message Player {
   768      string id = 1;
   769      Deck deck = 2; // TODO Change to card instance
   770  }
   771  
   772  message History {
   773      repeated HistoryData list = 1;
   774  }
   775  
   776  message HistoryData {
   777      oneof data {
   778          HistoryCreateGame createGame = 1;
   779          HistoryFullInstance fullInstance = 2;
   780          HistoryInstance showInstance = 3;
   781          HistoryHide hideInstance = 4;
   782          HistoryInstance changeInstance = 5;
   783          HistoryEndGame endGame = 6;
   784      }
   785  }
   786  
   787  message HistoryCreateGame {
   788      int64 gameId = 1;
   789      repeated Player players = 2;
   790      int64 randomSeed = 3;
   791      string version = 4;
   792  }
   793  
   794  message HistoryFullInstance {
   795      InstanceId instanceId = 1;
   796      int32 damage = 2;
   797      int32 defense = 3;
   798  }
   799  
   800  message HistoryInstance {
   801      InstanceId instanceId = 1;
   802      int32 value = 2;
   803      enum change {
   804          Damage = 0;
   805          Defense = 1;
   806      }
   807  }
   808  
   809  message HistoryHide {
   810      InstanceId instanceId = 1;
   811      Zone zone = 2;
   812  }
   813  
   814  message HistoryEndGame {
   815      int64 matchId   = 1;
   816      string userId   = 2;
   817      string winnerId = 3;
   818  }
   819  
   820  message DefaultDecksDataContainer {
   821      repeated Deck defaultDecks = 1;
   822  }
   823  
   824  message DefaultCollectionDataContainer {
   825      repeated CardCollectionCard defaultCollection = 1;
   826  }
   827  
   828  message CardLibraryDataContainer {
   829      repeated Card cards = 1;
   830  }
   831  
   832  message OverlordPrototypesDataContainer {
   833      repeated OverlordPrototype overlords = 1;
   834  }
   835  
   836  message AIDecksDataContainer {
   837      repeated AIDeck aiDecks = 1;
   838  }
   839  
   840  message OverlordLevelingDataContainer {
   841      OverlordLevelingData overlordLeveling = 1;
   842  }
   843  
   844  message DataWipeConfiguration{
   845      string version = 1;
   846      bool wipeDecks = 2;
   847      bool wipeOverlordUserInstances = 3;
   848  }
   849  
   850  message DataWipeConfigurationList {
   851      repeated DataWipeConfiguration configurations = 1;
   852  }
   853  
   854  message DataWipeConfigurationContainer {
   855      repeated DataWipeConfiguration dataWipeConfiguration = 1;
   856  }
   857  
   858  message UserPersistentData {
   859      Address address = 1;
   860      repeated string executedDataWipesVersions = 2;
   861      uint64 lastFullCardCollectionSyncPlasmachainBlockHeight = 3;
   862      uint64 lastAutoCardCollectionSyncPlasmachainBlockHeight = 4;
   863  }
   864  
   865  message NotificationEndMatch {
   866      int64 overlordId = 1;
   867      int32 oldLevel = 2;
   868      int64 oldExperience = 3;
   869      int32 newLevel = 4;
   870      int64 newExperience = 5;
   871      repeated LevelReward rewards = 6;
   872      bool isWin = 7;
   873      int64 deckId = 8;
   874  }
   875  
   876  message NotificationType {
   877      enum Enum {
   878          EndMatch = 0;
   879      }
   880  }
   881  
   882  message Notification {
   883      int32 id = 1;
   884      int64 createdAt = 2;
   885      bool seen = 3;
   886      NotificationType.Enum type = 4;
   887  
   888      oneof Notification {
   889          NotificationEndMatch endMatch = 10;
   890      }
   891  }
   892  
   893  message NotificationList {
   894      repeated Notification notifications = 1;
   895  }
   896  
   897  message UserIdContainer {
   898      string userId = 1;
   899  }
   900  
   901  message MintingTransactionReceipt {
   902      message VerifySignResult {
   903          bytes hash = 1;
   904          bytes signature = 2;
   905      }
   906  
   907      VerifySignResult verifyHash = 1;
   908      BigUInt userId = 2;
   909  	uint64 booster = 3;
   910      uint64 super = 10;
   911  	uint64 air = 4;
   912  	uint64 earth = 5;
   913  	uint64 fire = 6;
   914  	uint64 life = 7;
   915  	uint64 toxic = 8;
   916  	uint64 water = 9;
   917  	uint64 small = 11;
   918  	uint64 minion = 12;
   919  	uint64 binance = 13;
   920  	BigUInt txId = 14;
   921  }
   922  
   923  message MintingTransactionReceiptCollection {
   924      repeated MintingTransactionReceipt receipts = 1;
   925  }
   926  
   927  message CardAmountChangeItemsContainer {
   928      repeated CardAmountChangeItem cardAmountChanges = 1;
   929  }
   930  
   931  message CardAmountChangeItem {
   932      CardKey cardKey = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/loomnetwork/gamechain/battleground/proto.CardKey"];
   933      int64 amountChange = 2;
   934  }