local DungeonBaseEntity = require "app/userdata/dungeon/dungeon_base_entity"
local DungeonGoldEntity = class("DungeonGoldEntity", DungeonBaseEntity)

-- 金币副本数据

function DungeonGoldEntity:init(data)
    if self.maxPassedId then
        ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_DUNGEON_GOLD, data.max_chapter_gold_id - self.maxPassedId)
    end
    self.totalChallengeCount = data.total_challenge_count
    self.todayChallengeCount = data.today_challenge_count
    self.maxPassedId = data.max_chapter_gold_id
end

function DungeonGoldEntity:getTotalChallengeCount()
    return self.totalChallengeCount
end

function DungeonGoldEntity:getTodayChallengeCount()
    return self.todayChallengeCount
end

function DungeonGoldEntity:getPassedMaxId()
    return self.maxPassedId
end

function DungeonGoldEntity:getModuleKey()
    return ModuleManager.MODULE_KEY.DUNGEON_GOLD
end

function DungeonGoldEntity:getOpenWeekCycle()
    if self.openWeek == nil then
        self.openWeek = {2,4,6,7}
    end
    return self.openWeek
end

function DungeonGoldEntity:getConfigName()
    return "chapter_dungeon_gold"
end

function DungeonGoldEntity:getTitleString()
    return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_GOLD_TITLE)
end

function DungeonGoldEntity:getRuleString()
    return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_GOLD_HELP)
end

function DungeonGoldEntity:getOpenWeekString()
    return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_GOLD_OPEN)
end

function DungeonGoldEntity:getBossBuff(id)
    return self:getConfig()[id].effect[1]
end

function DungeonGoldEntity:getIcon()
    if self.dungeonIcon == nil then
        self.dungeonIcon = {GConst.ATLAS_PATH.DUNGEON,"dungeon_dec_1"}
    end
    return self.dungeonIcon
end

function DungeonGoldEntity:getBanner()
    return "assets/arts/textures/background/dungeon/dungeon_bg_1.png"
end

function DungeonGoldEntity:getOpenTextColor()
    return "#FFEDC5"
end

function DungeonGoldEntity:getChallengeHpCost()
    return GFunc.getConstReward("dungeon_gold_cost")
end

function DungeonGoldEntity:getTodayMaxCount()
	return GFunc.getConstIntValue("dungeon_gold_limit")
end

function DungeonGoldEntity:getBoardShowRewardId()
	return 1
end

function DungeonGoldEntity:getFirstRewardNum(id)
	return GFunc.getRewardNum(ConfigManager:getConfig("chapter_dungeon_gold")[id].first_pass_reward)
end

function DungeonGoldEntity:getPassRewardNum(id)
	return GFunc.getRewardNum(ConfigManager:getConfig("chapter_dungeon_gold")[id].percent_reward)
end

return DungeonGoldEntity