package msg

import "leafstalk/covenant/model"

// TaskStatus 获取任务状态
type TaskStatus struct {
	PlayerId int64 `json:"userId"`
}

type TaskStatusAndProcess struct {
	TaskId   int64     `json:"taskId,omitempty"`
	Progress int64     `json:"progress"`         // 进度值
	Status   int64     `json:"status"`           // 状态 0未开始 1进行中 2已完成未领取 3已领取
	Reward   [][]int64 `json:"reward,omitempty"` // 已领取的奖励。周任务奖励是随机的，需要记录真正领取的奖励
}

type DailyActivity struct {
	Value     int64           `json:"total"`
	BoxStatus map[int64]int64 `json:"boxStatus"`
}

type TaskStatusData struct {
	DailyTasks       map[int64]*TaskStatusAndProcess `json:"dailyTasks"`
	WeeklyTasks      map[int64]*TaskStatusAndProcess `json:"weeklyTasks"`
	DailyActivity    *DailyActivity                  `json:"dailyActivity"`
	AchievementTasks map[int64]*TaskStatusAndProcess `json:"achievementTasks"` // 玩家的成就进度
}

type ResponseTaskStatus struct {
	ErrCode int             `json:"errCode"`
	Msg     string          `json:"msg,omitempty"`
	Data    *TaskStatusData `json:"data"`
}

// ClaimReward 领取任务奖励
type ClaimReward struct {
	PlayerId int64 `json:"userId"`
	TaskType int64 `json:"taskType"`
	TaskId   int64 `json:"taskId"` // 成就任务需要传，日常和挑战任务为一键领取
}

type ClaimRewardData struct {
	Materials      *model.DropedBundle `json:"materials"`
	TaskStatusData *TaskStatusData     `json:"taskStatusData"`
}

type ResponseClaimReward struct {
	ErrCode int              `json:"errCode"`
	Msg     string           `json:"msg,omitempty"`
	Data    *ClaimRewardData `json:"data"`
}

// ClaimActivityReward 领取日常活跃度奖励
type ClaimActivityReward struct {
	PlayerId int64 `json:"userId"`
}

type ClaimActivityRewardData struct {
	Materials     *model.DropedBundle `json:"materials"`
	DailyActivity *DailyActivity      `json:"dailyActivity"`
}

type ResponseClaimActivityReward struct {
	ErrCode int                      `json:"errCode"`
	Msg     string                   `json:"msg,omitempty"`
	Data    *ClaimActivityRewardData `json:"data"`
}

type TaskProcessReportIs struct {
	RpcRequestMsg
	PlayerId int64     `json:"userId"`
	Tasks    [][]int64 `json:"tasks"`
	// Day2       string     `json:"day"` //日期
	// Level      int        `json:"level"`
	ClientPlat string `json:"clientPlat"`
	// TaskType int    `json:"taskType"` //任务类型
	// Value    int    `json:"value"`    //任务值[关卡次数，强化次数，怪物数量，合成次数，升级次数，交易次数，开启宝箱次数，观看广告次数，获取金币、钻石数量，占卜次数，签到次数，邀请好友次数]
}

type ResponseTaskProcessReportIs struct {
	RpcResponseMsg
}
