syntax = "proto3";
option go_package = ".;pb";
import "hero/hero_db.proto";
import "comm.proto";

//玩家战斗阵型
message DBPlayerBattleFormt {
  int32 leadpos = 1; //队长位置
  repeated DBHero formt = 2;
}

//玩家基本信息
message ArenaPlayer {
  string uid = 1;
  string name = 2;
  string avatar = 3; //@go_tags(`bson:"avatar"`) 头像
  int32 lv = 4;      //@go_tags(`bson:"lv"`) 等级
  int32 dan = 5;     //段位
  int32 integral = 6;
  int32 rank = 7;                 //排名
  DBPlayerBattleFormt defend = 8; //防守
  bool isai = 9;                  //是否是ai
  int32 mformatid = 10;           // AIId
  int32 changeintegral = 11;      //变化积分
}

enum BattleRecordState {
  AttackWin = 0;
  AttackLost = 1;
  DefendkWin = 2;
  DefendLost = 3;
  WaitingRevenge = 4;
  RevengeFailed = 5;
  RevengeSucceeded = 6;
  RevengeEnd = 7;
}

message DBHeroBase {
  string oid = 1; //英雄的唯一id
  string cid = 2; //英雄配置id
  int32 star = 3; //英雄星级
  int32 lv = 4;   //英雄等级
  map<string, int32> property = 5; // 属性相关
  map<string, int32> addProperty = 6; //@go_tags(`bson:"addProperty"`) 附加属性相关
  map<string, int32> juexProperty = 7;   //@go_tags(`bson:"juexProperty"`) //觉醒属性
  map<string, int32> talentProperty = 8; //@go_tags(`bson:"talentProperty"`)  // 天赋属性
  map<string, int32> horoscopeProperty = 9; //@go_tags(`bson:"horoscopeProperty"`) //星座属性加成
  map<string, int32> fetters = 10; //@go_tags(`bson:"fetters"`) //羁绊属性加成
  repeated SkillData normalSkill = 11; //@go_tags(`bson:"normalSkill"`) 普通技能
}
//战斗记录
message DBArenaBattleRecord {
  string bid = 1;                //战斗id
  int64 time = 2;                //战斗时间
  bool iswin = 3;                //是否胜利
  bool isdefend = 4;             //是否防守
  string rivalid = 5;            //对手id
  string rivalname = 6;          //对手名称
  int32 leadpos = 7;             //队长位置
  repeated DBHeroBase formt = 8; //阵营
  int32 addintegral = 9;         //积分变化
  BattleRecordState State = 10;  //记录状态
}

//竞技场用户数据
message DBArenaUser {
  string uid = 1;                           //用户id
  string name = 2;                          //玩家名称
  string avatar = 3;                        //@go_tags(`bson:"avatar"`) 头像
  int32 lv = 4;                             //@go_tags(`bson:"lv"`) 等级
  int32 integral = 5;                       //积分
  // int32 ticket = 6;                      //挑战券
  int32 dan = 7;                            //段位
  DBPlayerBattleFormt attack = 8;           //进攻阵型
  DBPlayerBattleFormt defend = 9;           //防守阵型
  int32 streak = 10;                        //连胜
  int32 attackrate = 11;                    //进攻胜率
  int32 defendrate = 12;                    //防守胜率
  int32 rank = 13;                          //排名
  int32 buynum = 14;                        //购买次数
  repeated DBArenaBattleRecord record = 15; //战斗记录
  int64 lastrtickettime = 16;               //最后领劵时间
  int32 attackwinuum = 17;                  //进攻胜利次数
  int32 attacktotaluum = 18;                //进攻总次数
  int32 defendwinuum = 19;                  //防守胜利
  int32 defendtotaluum = 20;                //防守总
  repeated double loc = 21;                 //地图索引 匹配系统使用
  bool isdef = 22;                          //是否设置防守
  map<int32, DBNpc> npc = 23;               // npc Cd
  int32 prededuction = 24;                  //预扣字段
}

// npc数据
message DBNpc {
  int32 id = 1;
  int64 cd = 2;
  int32 index = 3;
}


//修改用户积分
message RPCModifyIntegralReq {
  string uid = 1;
  int32 integral = 2;
}