local ItemData = require("bag.Proto").ItemData
local HeroSimple = require("hero.Proto").HeroSimple
local RoleBase = require("role.Proto").RoleBase 
local CombatSkillConf = require("combat.Proto").CombatSkillConf
local Attr = require("role.Proto").Attr
local BuyItem = require("topup.Proto").BuyItem

-- 进入战役界面的查询
CG_BATTLE_QUERY = {}

Tongguan = {
    {"reward",10,ItemData},               -- 道具 
	{"heroReward",2,HeroSimple},           -- 武将展示
    {"status",1,"byte"},                  -- 状态
    {"levelName",1,"string"},             -- 所需通关
    {"index",1,"int"},                    -- 奖励索引
    {"nowBattle",1,"string"},             -- 当前通关关卡
}

-- 通关信息
BattleShark = {
    {"roleBase",    1,  RoleBase},                        -- 角色信息
    {"type",        1,  "byte"},                          -- 类型  1 战力  2最快  3 最近
    {"param",       1,  "int"},                         -- 参数  战力 or 通关时间 or 挑战时间
    {"videoUuid",   1,  "string"},                         -- 战斗记录
}

-- 世界地图
BattleWorldMap  = {
    {"mapID",       1,  "byte"},                            -- 地图ID
    {"mapName",     1,  "string"},                          -- 地图名称
    {"mapBuild",    1,  "int"},                             -- 地图建筑
    {"mapBg",       1,  "int"},                             -- 地图背景
    {"mapPos",      2,  "int"},                             -- 地图坐标
    {"status",      1,  "byte"},                            -- 地图状态  1 已解锁   2 未解锁
    {"story",       1,  "string"},                          -- 背景故事
    {"maxLevel",    1,  "byte"},                            -- 最大进度
    {"curLevel",    1,  "byte"},                            -- 当前进度
    {"chapterReward",   40,  ItemData},                          -- 大关卡奖励
    {"chapterDot",      1,  "byte"},                            -- 是否可以奖励
    {"roleList",    3,  RoleBase},                          -- 在此关卡的玩家
}

-- 关卡信息
BattleNodeInfo = {
    {"nodeName",    1,"string"},                    -- 关卡名
    {"battleID",    1,"int"},                       -- 关卡ID
    {"needLv",      1,"int"},                       -- 关卡需要等级
    {"needZDL",     1,"int"},                       -- 关卡需要战斗力
    {"hasSuipian",  1,"byte"},                      -- 关卡是否有碎片
}

BattlePosNet = {
	{"battleID",	  1,	  "int"},
	{"posX",		  1,	  "short"},	   -- 坐标x
	{"posY",		  1,	  "short"},	   -- 坐标y
	{"roleBase",	  2,	  RoleBase},   -- 最快通关玩家信息 数组长度0表示没有
	{"nodeName",	  1,	  "string"},
	{"isBig",		  1,	  "byte"},	   -- 是否大关卡
}

BattleExtraDataSSZH = {
	{"posList",			50,		BattlePosNet},
}

-- 模型信息
BattleBody = {
    {"body",1,"int"},               -- 模型
    {"atkId",1,CombatSkillConf},    -- 普攻
    {"skill",1,CombatSkillConf},    -- 技能
    {"pos",1,"byte"},               -- 位置
    {"hp",1,"int"},                 -- 血量
    {"atkType",1,"byte"},           -- 1 近战 2 远程
}                       

-- 战斗记录结构体
CombatVideoStruct = {
    {"ownBody",6,BattleBody},       -- 己方
    {"enemyBody",6,BattleBody},     -- 敌方
}

-- 挂机界面查询
GC_BATTLE_QUERY = {
	{"nowBattleID",	    1,	    "int"},	                -- 下一战斗节点id
	{"nodeName",	    1,	    "string"},	            -- 下一战斗节点名
	{"nodeID",		    1,	    "int"},                 -- 下一战斗节点ID
	{"needLv",		    1,	    "int"},                 -- 下一战斗节点所需玩家等级
    {"maxBattleID",     1,      "int"},                 -- 最大的id
	{"mapID",		    1,	    "int"},                 -- 当前挂机地图ID
	{"mapName",		    1,	    "string"},              -- 当前挂机地图名字
	{"bg",			    1,	    "int"},                 -- 当前挂机地图背景图
	{"sceneID",			1,	    "int"},                 -- 战斗场景
    {"time",            1,      "int"},                 -- 已挂机时间
    {"maxTime",         1,      "int"},                 -- 最大可挂机时间
	{"canBattle",		1,	    "byte"},	            -- 能否战斗
	{"canMopup",		1,	    "byte"},	            -- 能否免费扫荡
	{"xushang",		    1,	    "int"},	                -- 悬赏情报数量
	{"xushangMax",		1,	    "int"},	                -- 悬赏情报上限
	{"xsDot",		    1,	    "byte"},	            -- 悬赏红点
	{"doubleCnt",       1,      "byte"},
	{"tongguan",	    2, 	    Tongguan},              -- 通关奖励 长度为0不需要展示
    {"extraDataSSZH",	1,		BattleExtraDataSSZH},	-- 额外数据（闪烁战火）
    {"videoInfo",       1,      CombatVideoStruct},     -- 播放数据
	{"battleGameTimes",	1,	    "byte"},	            -- 普通闯关获得的游戏次数
}

-- 世界地图
CG_BATTLE_WORLD_MAP_QUERY = {
}

GC_BATTLE_WORLD_MAP_QUERY = {
    {"worldMap",20,BattleWorldMap},           -- 世界地图
	{"isStart",	1,	    "byte"},	           -- 是否是第一段数据，0-否,1-是
	{"isEnd",	1,	    "byte"},	           -- 是否是最后一段数据，0-否,1-是
}

-- 当前关卡玩家查询
CG_BATTLE_WORLD_MAP_ROLELIST_QUERY = {
    {"worldMapId",1,"int"},                     -- 世界地图ID
}

GC_BATTLE_WORLD_MAP_ROLELIST_QUERY = {
    {"roleList",50,RoleBase},                    -- 在次关卡的玩家
}

-- 战斗节点查询
CG_BATTLE_NODE_QUERY = {
    {"mapID",1,"int"},                      -- 地图ID
}

GC_BATTLE_NODE_QUERY = {
    {"battleID",1,"int"},                           -- 自己所在关卡
    {"nodeInfo",20,BattleNodeInfo},                 -- 节点信息
}


-- 收获基础收益
CG_BATTLE_HANG_QUERY = {}

GC_BATTLE_HANG_QUERY = {
    {"time",		    1,	    "int"},
    {"maxTime",		    1,	    "int"},
    {"items",		    50,	    ItemData},	
	{"exp",			    1,	    "int"},	            --经验
	{"jinbi",		    1,	    "int"},	            --金币
	{"greenExp",	    1,	    "int"},	            --绿魂	
    {"qingbao",         1,      "int"},             --情报
	{"diamond",         1,      "int"},             -- 钻石消耗数量
	{"index",           1,      "int"},             -- 序号
	{"isEnd",           1,      "int"},             -- 是否结束
}

CG_BATTLE_HANG_GET = {
}

-- 挂机奖励满载时间查询
-- fullTime: 满载时刻的Unix时间戳
--   fullTime <= 当前时间  => 已经满了，满的时间是fullTime
--   fullTime >  当前时间  => 还没满，将在fullTime时满
CG_BATTLE_HANG_FULL_TIME_QUERY = {}

GC_BATTLE_HANG_FULL_TIME_QUERY = {
    {"fullTime", 1, "int"},   -- 挂机满载时的时间戳
}

-- 战役节点详细信息查询
CG_BATTLE_NODE_DETAIL_QUERY = {
	{"battleID",	  1,	  "int"},
}
GC_BATTLE_NODE_DETAIL_QUERY = {
	{"battleID",	  1,	    "int"},
	{"exp",			  1,	    "int"},	            --经验
	{"jinbi",		  1,	    "int"},	            --金币
	{"greenExp",	  1,	    "int"},	            --绿魂	
	{"qingbao",	      1,	    "int"},	            --情报
	{"items",		  60,	    ItemData},		            
    {"nodeName",      1,        "string"},                        -- 当前关卡，字符串
}

-- 战役章节(地图)收益查询
BattleMapDropItemsNet = {
	{"mapID",		  1,		"int"},
	{"mapName",		  1,		"string"},
	{"isOpen",		  1,		"byte"},
}
CG_BATTLE_MAP_DROPITEMS_LIST = {}
GC_BATTLE_MAP_DROPITEMS_LIST = {
	{"list",		  60,		BattleMapDropItemsNet},
}
CG_BATTLE_MAP_DROPITEMS_DETAIL = {
	{"mapID",		  1,		"int"},	
}
GC_BATTLE_MAP_DROPITEMS_DETAIL = {
	{"mapID",		  1,		"int"},
	{"items",		  60,		ItemData},	
}

-- 挂机收益增加提示
GC_BATTLE_REWARD_UP = {
	{"itemExp",		  1,	  ItemData},	            	
	{"itemJinbi",	  1,	  ItemData},	            	
	{"itemGreenExp",  1,	  ItemData},	                 	
	{"itemQingbao",   1,	  ItemData},	        	
	{"expOld",		  1,	  "int"},	            --经验
	{"expNew",		  1,	  "int"},	            --经验
	{"jinbiOld",	  1,	  "int"},	            --金币
	{"jinbiNew",	  1,	  "int"},	            --金币
	{"greenExpOld",	  1,	  "int"},	            --绿魂
	{"greenExpNew",	  1,	  "int"},	            --绿魂
	{"qingbaoOld",	  1,	  "int"},	            --情报
	{"qingbaoNew",	  1,	  "int"},	            --情报
}


-- 设置战役挂机节点/进入下一章
CG_BATTLE_NODE_SET = {
	{"battleID",	  1,	  "int"},
}

GC_BATTLE_NODE_SET = {}


-- 战役界面假打的小人查询
CG_BATTLE_HANG_FIGHT = {}

HangFightNet = {
	{"body",		1,	"int"},
	{"fireType",	1,	"short"},
	{"attackEffect",1,	"string"},
	{"flyEffect",	1,	"string"},
	{"flyCoords",   1,  "string"},
	{"hitEffect",	1,	"string"},
	{"height",		1,	"short"},
	{"weight",		1,	"short"},
	{"hitSound",	1,	"string"},
}

GC_BATTLE_HANG_FIGHT = {
	{"attackerList",		6,	  HangFightNet},
	{"monsterList",		    6,	  HangFightNet},
}

-- 收菜提醒
GC_BATTLE_HANG_TIME_SPILL = {
	{"time",          1, "int"},
}

-- 快速作战
CG_BATTLE_MOPUP_FIGHT = {
    
}

GC_BATTLE_MOPUP_FIGHT = {
	{"exp",			  1,	  "int"},	            --经验
	{"jinbi",		  1,	  "int"},	            --金币
	{"greenExp",	  1,	  "int"},	            --绿魂	
	{"qingbao",	      1,	  "int"},	            --情报
    {"item",40,ItemData},
	{"double",        1,      "byte"},
	{"isDailyFirstMopup",     1,      "byte"}, 		-- 是否是当天的第一次扫荡, 0-不是, 1-是
}

-- 扫荡查询
CG_BATTLE_MOPUP_QUERY = {
}

GC_BATTLE_MOPUP_QUERY = {
    {"item",            50,     ItemData},                       -- 物品
    {"leftCnt",         1,      "int"},                       -- 剩余扫荡次数
    {"need",            1,      "int"},                           -- 扫荡花费钻石
    {"vip",             1,      "byte"},                           -- 是否是vip
    {"nowCnt",          1,      "int"},                        -- 当前已扫荡次数
	{"exp",			    1,	    "int"},	            --经验
	{"jinbi",		    1,	    "int"},	            --金币
	{"greenExp",	    1,	    "int"},	            --绿魂	
    {"qingbao",         1,      "int"},             --情报
    {"name",            1,      "string"},             --情报
}

-- 通关奖励领取
CG_BATTLE_TONGGUAN_REWARD_GET = { 
    {"index",1,"int"},
}

-- 回到征战界面
GC_BATTLE_GOBACK_MAIN = {
	{"panelIDs",	5,		"short"},
}

-- 通关战报查询
CG_BATTLE_SHARK_QUERY = {
    {"battleID",1,"int"},               -- 关卡
}

GC_BATTLE_SHARK_QUERY = {
    {"battleShark",3,BattleShark},         --战报
}

--大关卡通关后领取奖励
CG_BATTLE_CHAPTER_REWARD = {
    {"mapID", 1, "byte"},
}

GC_BATTLE_CHAPTER_REWARD = {
    -- {"mapID", 1, "byte"},

	{"mapIDList", 30, "byte"},
}

--客户端查询副本是否开启
CG_ELITE_OPEN = {
}

--精英副本开启通知
GC_ELITE_OPEN = {
	{"curCopyType",     1,      "int"},	--当前副本类型
	{"copyOpenType",    2,      "byte"},--副本开启类型 无素1 精英副本 开启：1 未开启：0 元素2 困难副本 开启：1 未开启：0
}

--进入精英副本难易度选择
CG_ELITE_SELECT = {
	--index为1：普通难度 主线章节
	--index为2：精英难度
	--index为3：困难难度
	{"index",1,"int"},
}

GC_ELITE_SELECT ={
	--status为0：表示选择成功
	--status为1：表示玩家等级未达到
    --status为2：表示玩家未完成通过主线第80关
	{"status",1,"int"},
}

-- 通关奖励领取
CG_BATTLE_TONGGUAN_REWARD_GET_COPY = { 
    {"index",1,"int"}, --查询副本类型
}

GC_BATTLE_TONGGUAN_REWARD_GET_COPY =
{
	{"status",		1,		"int"},					-- 领取状态(0、失败， 1、成功)
}

--查询所有未领取奖励关卡奖励
CG_BATTLE_QUERY_ALL = {
	{"index",1,"int"}, --查询副本类型
	{"curIndex",1,"int"} --当前请求的记录条数 
}

--返回所有未领取奖励关卡奖励
GC_BATTLE_QUERY_ALL = {
	{"index",1,"int"}, --查询副本类型
	{"list",15,Tongguan},--查询副本返回数据
	{"curIndex",1,"int"},--想请求的记录条数会累加到最大关卡
	{"isEnd",1,"byte"},--未领取奖励是否发送结束
}


CG_BATTLE_GETGAMEREWARD = {
	{"indexStr",	1,	    "string"},	            --图案id，格式: 101|102|103
}

GC_BATTLE_GETGAMEREWARD = {
	{"battleGameTimes",	1,	    "byte"},	            -- 普通闯关获得的游戏次数
}


-- 每日通关信息查询
CG_BATTLE_DAILY_PASSLVEL_INFO_QUERY = {}
GC_BATTLE_DAILY_PASSLVEL_INFO_QUERY = {
	{"currentPassLevelNum",      1,        "short"},  -- 当日已通关数量
	{"maxPassLevelNum",        	 1,        "short"},  -- 当日最大通关数量
}



-------------------------------肉鸽系统-----------------------------------------
AttrInfo ={
	{"name",			1,	    "string"},	       --名字
	{"id",		    	1,	    "int"},	           --id
	{"quality",	    	1,	    "byte"},	       --品质
	{"level",	    	1,	    "byte"},	       --等级
	{"icon",	    	1,	    "int"},	       	   --icon
    {"attr",         	1,      Attr},             --加成属性
}

--查询当前闯关模式是否有没选择的属性
CG_ISNEEDSELECTATTR = {}

GC_ISNEEDSELECTATTR = {
	{"noraml",	1,	    "byte"},	            -- 是否有有未选择的属性加成, 0：没有，1：有
	{"elite",	1,	    "byte"},	            -- 是否有有未选择的属性加成, 0：没有，1：有
	{"hard",	1,	    "byte"},	            -- 是否有有未选择的属性加成, 0：没有，1：有
}

--获取当前闯关模式需要选择的属性加成信息
CG_GETCHOOSEATTR_INFO = {}
GC_GETCHOOSEATTR_INFO = {
	{"attrInfo",	3,	    AttrInfo},	            -- 属性加成信息
	{"refreshCost",	1,	    ItemData},	            -- 刷新消耗
}

--当前闯关模式的所有加成信息
CG_GETALLATTR_INFO = {}
GC_GETALLATTR_INFO = {
	{"attrInfo",	20,	    AttrInfo},	            -- 属性加成信息
	{"refreshCost",	1,	    ItemData},	            -- 刷新消耗
	{"isEnd",		1,	    "byte"},	            -- 是否发完标识, 0-没有， 1-发完
}


--选择属性
CG_CHOOSE_ATTR = {
	{"idx",		    	1,	    "int"},	           --下标
}

--刷新属性
CG_REFRESH_ATTR = {
	{"type",		   	1,	    "byte"},	       --刷新类型, 1-刷新选择界面的3个属性, 2-刷新已获得属性界面的属性
	{"id",		    	1,	    "int"},	           --id, type为1时随便填, 等于2时为要刷新的属性id
}

--刷新某个已获得属性时返回
GC_REFRESH_ATTR = {
	{"oldId",		   	1,	    "int"},	       		-- 原来的属性ID
	{"newAttrData",		   	1,	    AttrInfo},	       -- 新属性数据
}

------------------------------------------------------------------------------------------------------


CG_BATTLE_TEAM_COUNT = {
}

GC_BATTLE_TEAM_COUNT = {
	{"teamCnt",		   	1,	    "byte"},	       		-- 队伍数量
}


--------------------------------------------------------闯关主题--------------------------------------------
BREAKTHROUGHREWARD_INFO = {
	{"rewardArr",		   	4,	    ItemData},	      -- 奖励列表
	{"rewardStage",		   	1,	    "byte"},	      -- 奖励状态, 0-不可领取, 1-可领, 2-已领
	{"reallyIdx",		   	1,	    "short"},	      -- 奖励索引
	{"condStage",		   	1,	    "int"},	      	  -- 领取奖励所需关卡
}

ADVANCEDREWARD_INFO = {
	{"reward",		   		1,	    ItemData},	  -- 奖励列表
	{"rewardStage",		   	1,	    "byte"},	  -- 奖励状态, 0-不可领取, 1-可领, 2-已领
	{"condDays",		   	1,	    "int"},	      -- 领取奖励所需登录天数
}

-- 闯关阵容查询
CG_BREATHROUGHTHEME_LINEUP_QUERY = {}
GC_BREATHROUGHTHEME_LINEUP_QUERY = {
	{"lineup1",		   	5,	    HeroSimple},	       		-- 初级阵容
	{"lineup2",		   	5,	    HeroSimple},	       		-- 中级阵容
	{"lineup3",		   	5,	    HeroSimple},	       		-- 豪华阵容
}

-- 闯关奖励查询
CG_BREATHROUGHTHEME_BREAKTHROUGHREWARD_QUERY = {}
GC_BREATHROUGHTHEME_BREAKTHROUGHREWARD_QUERY = {
	{"list",		   	5,	    BREAKTHROUGHREWARD_INFO},
	{"isEnd",		   	1,	    "byte"},	      -- 数据发完标识, 0-没有, 1-已发完
	{"buyState",     	1,      "byte"},           -- 购买状态, 0-未购买, 1-已购买
}

-- 进阶奖励查询
CG_BREATHROUGHTHEME_ADVANCEDREWARD_QUERY = {}
GC_BREATHROUGHTHEME_ADVANCEDREWARD_QUERY = {
	{"list",		   		7,	    ADVANCEDREWARD_INFO},
	{"buyItem",     		1,      BuyItem},           -- 购买信息
	{"buyState",     		1,      "byte"},           -- 购买状态, 0-未购买, 1-已购买
}

-- 领奖
CG_BREATHROUGHTHEME_GET_REWARD = {
	{"rewardType",     		1,      "byte"},           -- 奖励类型, 1-闯关奖励, 2-进阶奖励	
}

-- 红点
GC_BREATHROUGHTHEME_REDDOT = {
	{"page1RedDotState",     		1,      "byte"},           -- 闯关奖励标签红点状态, 0-不显示红点, 1-显示红点
	{"page2RedDotState",     		1,      "byte"},           -- 进阶奖励标签红点状态, 0-不显示红点, 1-显示红点
}

-- 弹提示
CG_BREATHROUGHTHEME_SHOW_TIPS = {}
GC_BREATHROUGHTHEME_SHOW_TIPS = {
	{"tipState",     		1,      "byte"},           -- 1-服务器通知客户端弹出提示
}



-----------------------------------------闯关礼金---------------------------------------------------------

-- 闯关礼金查询
CG_BATTLEGIFT_QUERY = {}
GC_BATTLEGIFT_QUERY = {
	{"leftTime",		1,	    "int"},	       -- 重置剩余时间戳
	{"dailyStoreVal",	1,	    "int"},	       -- 当日存储礼金数量
	{"dailyGetVal",		1,	    "int"},	       -- 当日已领礼金数量
	{"dailyMaxVal",		1,	    "int"},	       -- 当日可领礼金数量
	{"buyItem",     	1,      BuyItem},      -- 购买信息, BuyItem.buyID为0, 则表示所有购买项均已购买
	{"dailyLimitVal",	1,	    "int"},	       -- 充值当前购买项后，增加的"每日可领取上限值"
}

-- 闯关礼金领取
CG_BATTLEGIFT_GET = {}