装备副本

This commit is contained in:
xiekaidong 2023-07-19 20:16:17 +08:00
parent 000bc5e926
commit 2ffd6e88ba
30 changed files with 1111 additions and 4324 deletions

View File

@ -122,6 +122,9 @@ BIReport.ITEM_GET_TYPE = {
ARENA_SETTLEMENT = "ArenaSettlement",
ARENA_GIFT = "ArenaGift",
COLLECTION_HERO_REWARD = "CollectionHeroReward",
DUNGEON_WEAPON_CHALLENGE = "DungeonWeaponChallenge",
DUNGEON_WEAPON_END = "DungeonWeaponEnd",
DUNGEON_WEAPON_SWEEP = "DungeonWeaponSweep",
}
BIReport.ADS_CLICK_TYPE = {
@ -167,6 +170,8 @@ BIReport.BATTLE_TYPE = {
["3"] = "DungeonGold",
["4"] = "DungeonShards",
["5"] = "Arena",
["6"] = "DungeonWeapon",
["7"] = "DungeonArmor",
}
BIReport.GIFT_TYPE = {

View File

@ -133,11 +133,11 @@ function DataManager:initWithServerData(data)
self.DailyChallengeData:init(data.chapter_daily_challenge)
self.DungeonData:initDungeonGold(data.chapter_gold_challenge)
self.DungeonData:initDungeonShards(data.chapter_shards_challenge)
self.DungeonData:initDungeonWeapon(data.chapter_weapon_challenge)
self.DungeonData:initDungeonArmor(data.chapter_armor_challenge)
self.HeroData:init(data.bag.heroes)
self.BagData:init(data.bag)
self.FormationData:init(data.fight_info)
self.DungeonData:initDungeonWeapon(data.chapter_weapon_challenge)
self.DungeonData:initDungeonArmor(data.chapter_armor_challenge)
self.CollectionData:init(data.collection)
self.TutorialData:init(data.guide)
self.MailData:init(data.mail_info)

View File

@ -8,11 +8,7 @@ local chapter_dungeon_equip = {
1
},
["monster"]={
106,
206,
306,
406,
506
101,
},
["first_reward"]={
["type"]=1,
@ -101,11 +97,7 @@ local chapter_dungeon_equip = {
2
},
["monster"]={
606,
706,
806,
906,
1006
101,
},
["first_reward"]={
["type"]=1,
@ -194,11 +186,7 @@ local chapter_dungeon_equip = {
3
},
["monster"]={
1106,
1206,
1306,
1406,
1506
101
},
["first_reward"]={
["type"]=1,
@ -287,11 +275,7 @@ local chapter_dungeon_equip = {
4
},
["monster"]={
1606,
1706,
1806,
1906,
2006
101
},
["first_reward"]={
["type"]=1,

View File

@ -1,8 +1,5 @@
local LocalizationGlobalConst =
{
["DUNGEON_WEAPON_DESC_12"] = "DUNGEON_WEAPON_DESC_12",
["DUNGEON_WEAPON_DESC_13"] = "DUNGEON_WEAPON_DESC_13",
["DUNGEON_WEAPON_DESC_14"] = "DUNGEON_WEAPON_DESC_14",
MAIN_BTN_1 = "MAIN_BTN_1",
QLT_DESC_1 = "QLT_DESC_1",
QLT_DESC_2 = "QLT_DESC_2",
@ -394,6 +391,11 @@ local LocalizationGlobalConst =
ATTR_NORMAL_HURTP = "ATTR_NORMAL_HURTP",
ATTR_SKILL_HURTP = "ATTR_SKILL_HURTP",
ATTR_CURED = "ATTR_CURED",
DUNGEON_WEAPON_DESC_12 = "DUNGEON_WEAPON_DESC_12",
DUNGEON_WEAPON_DESC_13 = "DUNGEON_WEAPON_DESC_13",
DUNGEON_WEAPON_DESC_14 = "DUNGEON_WEAPON_DESC_14",
MOP_UP_DESC_1 = "MOP_UP_DESC_1",
MOP_UP_DESC_2 = "MOP_UP_DESC_2",
}
return LocalizationGlobalConst

View File

@ -520,27 +520,27 @@ local monster_base = {
["model_ui"]=1.0
},
[20039]={
["model_id"]="m20034",
["model_id"]="m20039",
["body"]=1,
["model_ui"]=1.0
},
[20040]={
["model_id"]="m20035",
["body"]=1,
["model_ui"]=1.0
},
[20041]={
["model_id"]="m20036",
["model_id"]="m20040",
["body"]=1,
["model_ui"]=1.0
},
[20042]={
["model_id"]="m20037",
["model_id"]="m20042",
["body"]=1,
["model_ui"]=1.0
},
[20041]={
["model_id"]="m20041",
["body"]=1,
["model_ui"]=1.0
},
[20043]={
["model_id"]="m20038",
["model_id"]="m20043",
["body"]=1,
["model_ui"]=1.0
},

View File

@ -48,7 +48,7 @@ local monster_dungeon_equip = {
["monster_exp"]=23000
},
[506]={
["monster_base"]=20043,
["monster_base"]=20041,
["is_boss"]=2,
["hp"]=240000000,
["atk"]=1590000,
@ -117,7 +117,7 @@ local monster_dungeon_equip = {
["monster_exp"]=23000
},
[1006]={
["monster_base"]=20039,
["monster_base"]=20040,
["is_boss"]=2,
["hp"]=240000000,
["atk"]=1590000,
@ -128,7 +128,8 @@ local monster_dungeon_equip = {
30116
},
["skill"]={
10085
10085,
10129
},
["passive_skill"]={
10008
@ -184,7 +185,7 @@ local monster_dungeon_equip = {
["monster_exp"]=23000
},
[1506]={
["monster_base"]=20040,
["monster_base"]=20039,
["is_boss"]=2,
["hp"]=240000000,
["atk"]=1590000,
@ -252,7 +253,7 @@ local monster_dungeon_equip = {
["monster_exp"]=23000
},
[2006]={
["monster_base"]=20041,
["monster_base"]=20043,
["is_boss"]=2,
["hp"]=240000000,
["atk"]=1590000,
@ -389,7 +390,7 @@ local monster_dungeon_equip = {
["monster_exp"]=23000
},
[3006]={
["monster_base"]=20043,
["monster_base"]=20041,
["is_boss"]=2,
["hp"]=240000000,
["atk"]=1590000,
@ -458,7 +459,7 @@ local monster_dungeon_equip = {
["monster_exp"]=23000
},
[3506]={
["monster_base"]=20039,
["monster_base"]=20040,
["is_boss"]=2,
["hp"]=240000000,
["atk"]=1590000,
@ -469,7 +470,8 @@ local monster_dungeon_equip = {
30131
},
["skill"]={
10096
10096,
10129
},
["passive_skill"]={
10008
@ -525,7 +527,7 @@ local monster_dungeon_equip = {
["monster_exp"]=23000
},
[4006]={
["monster_base"]=20040,
["monster_base"]=20039,
["is_boss"]=2,
["hp"]=240000000,
["atk"]=1590000,
@ -593,7 +595,7 @@ local monster_dungeon_equip = {
["monster_exp"]=23000
},
[4506]={
["monster_base"]=20041,
["monster_base"]=20043,
["is_boss"]=2,
["hp"]=240000000,
["atk"]=1590000,
@ -730,7 +732,7 @@ local monster_dungeon_equip = {
["monster_exp"]=23000
},
[5506]={
["monster_base"]=20043,
["monster_base"]=20041,
["is_boss"]=2,
["hp"]=240000000,
["atk"]=1590000,
@ -799,7 +801,7 @@ local monster_dungeon_equip = {
["monster_exp"]=23000
},
[6006]={
["monster_base"]=20039,
["monster_base"]=20040,
["is_boss"]=2,
["hp"]=240000000,
["atk"]=1590000,
@ -810,7 +812,8 @@ local monster_dungeon_equip = {
30137
},
["skill"]={
10107
10107,
10129
},
["passive_skill"]={
10008
@ -866,7 +869,7 @@ local monster_dungeon_equip = {
["monster_exp"]=23000
},
[6506]={
["monster_base"]=20040,
["monster_base"]=20039,
["is_boss"]=2,
["hp"]=240000000,
["atk"]=1590000,
@ -934,7 +937,7 @@ local monster_dungeon_equip = {
["monster_exp"]=23000
},
[7006]={
["monster_base"]=20041,
["monster_base"]=20043,
["is_boss"]=2,
["hp"]=240000000,
["atk"]=1590000,
@ -1071,7 +1074,7 @@ local monster_dungeon_equip = {
["monster_exp"]=23000
},
[8006]={
["monster_base"]=20043,
["monster_base"]=20041,
["is_boss"]=2,
["hp"]=240000000,
["atk"]=1590000,
@ -1140,7 +1143,7 @@ local monster_dungeon_equip = {
["monster_exp"]=23000
},
[8506]={
["monster_base"]=20039,
["monster_base"]=20040,
["is_boss"]=2,
["hp"]=240000000,
["atk"]=1590000,
@ -1151,7 +1154,8 @@ local monster_dungeon_equip = {
30143
},
["skill"]={
10118
10118,
10129
},
["passive_skill"]={
10008
@ -1207,7 +1211,7 @@ local monster_dungeon_equip = {
["monster_exp"]=23000
},
[9006]={
["monster_base"]=20040,
["monster_base"]=20039,
["is_boss"]=2,
["hp"]=240000000,
["atk"]=1590000,
@ -1275,7 +1279,7 @@ local monster_dungeon_equip = {
["monster_exp"]=23000
},
[9506]={
["monster_base"]=20041,
["monster_base"]=20043,
["is_boss"]=2,
["hp"]=240000000,
["atk"]=1590000,

File diff suppressed because it is too large Load Diff

View File

@ -1,83 +1,83 @@
local chapter_dungeon_equip = {
[1]={
["name"]="邪眸灯灵第1层",
["desc"]="他掌控着拥有魔法能量的邪眸,被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["desc"]="他掌控着拥有魔法能量的邪眸,被远古勇士囚禁在神灯之中。他会使用邪眸制造<color=#ffde35>意念护盾</color>,护盾存在时他将是无敌的"
},
[2]={
["name"]="诅咒灯灵第2层",
["desc"]="掌控着拥有魔法能量的邪眸被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["desc"]="是一位古代有名的厨师,原本喜欢用美食帮助他人帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了<color=#ffde35>邪恶的诅咒</color>"
},
[3]={
["name"]="黄金灯灵第3层",
["desc"]="掌控着拥有魔法能量的邪眸被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["desc"]="是来自远古的战士,由于探索了黄金财宝而被留在了黄金神灯之中。每一次战斗对他来说都在学习和强化自己,他的<color=#ffde35>攻击只会越来越强</color>"
},
[4]={
["name"]="灯灵第4层",
["desc"]="掌控着拥有魔法能量的邪眸被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["name"]="灯灵第4层",
["desc"]="本有一颗医者之心,为了治疗朋友的不治之症将自己的灵魂出卖给了邪神,残留的意识存在这神灯之中。他的医术能够让自己<color=#ffde35>不断恢复生命</color>"
},
[5]={
["name"]="霜峰灯灵第5层",
["desc"]="掌控着拥有魔法能量的邪眸被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["desc"]="本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘的心他成为了霜峰灯灵。在懊悔的岁月里他领悟了<color=#ffde35>冰霜的奥秘</color>"
},
[6]={
["name"]="邪眸灯灵第6层",
["desc"]="他掌控着拥有魔法能量的邪眸,被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["desc"]="他掌控着拥有魔法能量的邪眸,被远古勇士囚禁在神灯之中。他会使用邪眸制造<color=#ffde35>意念护盾</color>,护盾存在时他将是无敌的"
},
[7]={
["name"]="诅咒灯灵第7层",
["desc"]="掌控着拥有魔法能量的邪眸被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["desc"]="是一位古代有名的厨师,原本喜欢用美食帮助他人帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了<color=#ffde35>邪恶的诅咒</color>"
},
[8]={
["name"]="黄金灯灵第8层",
["desc"]="掌控着拥有魔法能量的邪眸被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["desc"]="是来自远古的战士,由于探索了黄金财宝而被留在了黄金神灯之中。每一次战斗对他来说都在学习和强化自己,他的<color=#ffde35>攻击只会越来越强</color>"
},
[9]={
["name"]="灯灵第9层",
["desc"]="掌控着拥有魔法能量的邪眸被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["name"]="灯灵第9层",
["desc"]="本有一颗医者之心,为了治疗朋友的不治之症将自己的灵魂出卖给了邪神,残留的意识存在这神灯之中。他的医术能够让自己<color=#ffde35>不断恢复生命</color>"
},
[10]={
["name"]="霜峰灯灵第10层",
["desc"]="掌控着拥有魔法能量的邪眸被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["desc"]="本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘的心他成为了霜峰灯灵。在懊悔的岁月里他领悟了<color=#ffde35>冰霜的奥秘</color>"
},
[11]={
["name"]="邪眸灯灵第11层",
["desc"]="他掌控着拥有魔法能量的邪眸,被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["desc"]="他掌控着拥有魔法能量的邪眸,被远古勇士囚禁在神灯之中。他会使用邪眸制造<color=#ffde35>意念护盾</color>,护盾存在时他将是无敌的"
},
[12]={
["name"]="诅咒灯灵第12层",
["desc"]="掌控着拥有魔法能量的邪眸被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["desc"]="是一位古代有名的厨师,原本喜欢用美食帮助他人帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了<color=#ffde35>邪恶的诅咒</color>"
},
[13]={
["name"]="黄金灯灵第13层",
["desc"]="掌控着拥有魔法能量的邪眸被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["desc"]="是来自远古的战士,由于探索了黄金财宝而被留在了黄金神灯之中。每一次战斗对他来说都在学习和强化自己,他的<color=#ffde35>攻击只会越来越强</color>"
},
[14]={
["name"]="灯灵第14层",
["desc"]="掌控着拥有魔法能量的邪眸被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["name"]="灯灵第14层",
["desc"]="本有一颗医者之心,为了治疗朋友的不治之症将自己的灵魂出卖给了邪神,残留的意识存在这神灯之中。他的医术能够让自己<color=#ffde35>不断恢复生命</color>"
},
[15]={
["name"]="霜峰灯灵第15层",
["desc"]="掌控着拥有魔法能量的邪眸被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["desc"]="本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘的心他成为了霜峰灯灵。在懊悔的岁月里他领悟了<color=#ffde35>冰霜的奥秘</color>"
},
[16]={
["name"]="邪眸灯灵第16层",
["desc"]="他掌控着拥有魔法能量的邪眸,被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["desc"]="他掌控着拥有魔法能量的邪眸,被远古勇士囚禁在神灯之中。他会使用邪眸制造<color=#ffde35>意念护盾</color>,护盾存在时他将是无敌的"
},
[17]={
["name"]="诅咒灯灵第17层",
["desc"]="掌控着拥有魔法能量的邪眸被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["desc"]="是一位古代有名的厨师,原本喜欢用美食帮助他人帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了<color=#ffde35>邪恶的诅咒</color>"
},
[18]={
["name"]="黄金灯灵第18层",
["desc"]="掌控着拥有魔法能量的邪眸被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["desc"]="是来自远古的战士,由于探索了黄金财宝而被留在了黄金神灯之中。每一次战斗对他来说都在学习和强化自己,他的<color=#ffde35>攻击只会越来越强</color>"
},
[19]={
["name"]="灯灵第19层",
["desc"]="掌控着拥有魔法能量的邪眸被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["name"]="灯灵第19层",
["desc"]="本有一颗医者之心,为了治疗朋友的不治之症将自己的灵魂出卖给了邪神,残留的意识存在这神灯之中。他的医术能够让自己<color=#ffde35>不断恢复生命</color>"
},
[20]={
["name"]="霜峰灯灵第20层",
["desc"]="掌控着拥有魔法能量的邪眸被远古勇士囚禁在神灯之中。他使用邪眸制造意念护盾护盾存在时将不受到伤害每次命中将降低护盾层数层数为0时护盾消失"
["desc"]="本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘的心他成为了霜峰灯灵。在懊悔的岁月里他领悟了<color=#ffde35>冰霜的奥秘</color>"
}
}
local config = {

File diff suppressed because it is too large Load Diff

View File

@ -391,11 +391,13 @@ local localization_global =
["ATTR_NORMAL_HURTP"] = "普攻增伤%",
["ATTR_SKILL_HURTP"] = "技能增伤%",
["ATTR_CURED"] = "治疗效果提升%",
["DUNGEON_WEAPON_DESC_12"] = "最近没有通关",
["DUNGEON_WEAPON_DESC_13"] = "今日扫荡次数已用完",
["DUNGEON_WEAPON_DESC_14"] = "查看",
["MOP_UP_DESC_1"] = "扫荡完成",
["MOP_UP_DESC_2"] = "再次扫荡",
["DUNGEON_WEAPON_DESC_15"] = "最强灯神阵容",
}
return localization_global

View File

@ -86,6 +86,8 @@ BattleConst.BATTLE_TYPE = {
DUNGEON_GOLD = "3",
DUNGEON_SHARDS = "4",
ARENA = "5",
DUNGEON_WEAPON = "6",
DUNGEON_ARMOR = "7",
}
BattleConst.IS_PVP_BATTLE = {

View File

@ -11,7 +11,9 @@ local BATTLE_CONTROLLER = {
[BattleConst.BATTLE_TYPE.DAILY_CHALLENGE] = "app/module/battle/controller/battle_controller_daily_challenge",
[BattleConst.BATTLE_TYPE.DUNGEON_GOLD] = "app/module/battle/controller/battle_controller_dungeon_gold",
[BattleConst.BATTLE_TYPE.DUNGEON_SHARDS] = "app/module/battle/controller/battle_controller_dungeon_shards",
[BattleConst.BATTLE_TYPE.ARENA] = "app/module/battle/controller/battle_controller_arena"
[BattleConst.BATTLE_TYPE.ARENA] = "app/module/battle/controller/battle_controller_arena",
[BattleConst.BATTLE_TYPE.DUNGEON_WEAPON] = "app/module/battle/controller/battle_controller_dungeon_weapon",
[BattleConst.BATTLE_TYPE.DUNGEON_ARMOR] = "app/module/battle/controller/battle_controller_dungeon_armor",
}
function BattleManager:showPauseUI(battleType, battleController)
@ -22,7 +24,7 @@ function BattleManager:showPauseUI(battleType, battleController)
end
end
function BattleManager:showBattleResultUI(battleType, rewards, combatReport, mysteryBoxIdx)
function BattleManager:showBattleResultUI(battleType, rewards, combatReport, mysteryBoxIdx, firstPassIdx, noMergeReward)
UIManager:showUI("app/ui/battle/battle_result_ui", {
battleType = battleType,
isWin = combatReport.victory,
@ -30,7 +32,9 @@ function BattleManager:showBattleResultUI(battleType, rewards, combatReport, mys
atkReport = combatReport.atkReport,
wave = combatReport.wave,
mysteryBoxIdx = mysteryBoxIdx or 0,
firstPassIdx = firstPassIdx or 0,
remainRound = combatReport.remainRound or 0,
noMergeReward = noMergeReward,
})
end

View File

@ -0,0 +1,77 @@
local BattleController = require "app/module/battle/controller/battle_controller"
local BattleControllerDungeonWeapon = class("BattleControllerDungeonWeapon", BattleController)
function BattleControllerDungeonWeapon:getBoardConfig()
return ConfigManager:getConfig("chapter_board_dungeon_equip")
end
function BattleControllerDungeonWeapon:getChapterConfig()
return ConfigManager:getConfig("chapter_dungeon_equip")
end
function BattleControllerDungeonWeapon:getChapterId()
local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON)
return weaponData:getCurFightChapterId()
end
function BattleControllerDungeonWeapon:controllBattleEnd()
self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_WEAPON,
wave = self.waveIndex,
victory = self.victory,
}
local atkReport = {}
local teamEntity = self.battleData:getAtkTeam()
local members = teamEntity:getAllMembers()
for k, v in pairs(members) do
local report = {
heroId = v:getId(),
dmg = v:getDamageCount(),
}
table.insert(atkReport, report)
end
self.combatReport.atkReport = atkReport
if not self.victory then
self.combatReport.wave = self.combatReport.wave - 1
end
ModuleManager.DungeonWeaponManager:reqEndChallenge(self.chapterId, self.combatReport, self.taskProgress)
end
function BattleControllerDungeonWeapon:postWaveOver(atkDead, isQuit)
local deathType = BIReport.FIGHT_DEATH_TYPE.SURVIVE
local waveEndType = BIReport.FIGHT_WAVE_END_TYPE.WIN
if atkDead then
if self.isBossWave then
deathType = BIReport.FIGHT_DEATH_TYPE.BOSS_FAIL
else
deathType = BIReport.FIGHT_DEATH_TYPE.NORMAL_FAIL
end
waveEndType = BIReport.FIGHT_WAVE_END_TYPE.FAIL
end
if isQuit then
waveEndType = BIReport.FIGHT_WAVE_END_TYPE.QUIT
end
local duration = self.waveDurationTime
local totalTime = self.totalDurationTime
local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON)
local startTimes = weaponData:getChapterFightCount(self.chapterId)
local isFirstWin = false
if weaponData:getPassedMaxId() < self.chapterId and self.victory then
isFirstWin = true
end
local isFianlStep = self.waveIndex >= self.maxWaveIndex
BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.DUNGEON_WEAPON, self.battleData, self.chapterId, self.waveIndex, duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount)
end
function BattleControllerDungeonWeapon:postFightStart()
local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON)
local startTimes = weaponData:getChapterFightCount(self.chapterId)
local unlockMaxChapter = weaponData:getPassedMaxId() + 1
BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.DUNGEON_WEAPON, self.waveIndex, self.chapterId, unlockMaxChapter, startTimes)
end
return BattleControllerDungeonWeapon

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: c4928c1be06af084082b9ea721afed69
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 17207e19052e6f542b794c7243f97a02
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -15,4 +15,11 @@ function CommonManager:showMopUpUI(rewards, remainCount, callback, customtitleTx
UIManager:showUI("app/ui/common/mop_up_ui", params)
end
function CommonManager:showFormationUI(formationType)
local params = {
formationType = formationType
}
UIManager:showUI("app/ui/common/common_formation_ui", params)
end
return CommonManager

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 67801c6593529c84d8b2f218d5c629a6
guid: f232addf6c4152a42ab0c464183a206f
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}

View File

@ -5,7 +5,141 @@ function DungeonWeaponManager:showMainUI()
end
function DungeonWeaponManager:showIntroductionUI(chapterId)
local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON)
local passInfo = weaponData:getCachePassInfo(chapterId)
if not passInfo then
self:reqPassInfo(chapterId)
end
UIManager:showUI("app/ui/dungeon_weapon/dungeon_weapon_introduction_ui", {chapterId = chapterId})
end
function DungeonWeaponManager:reqFight(chapterId)
if not DataManager.FormationData:formationIsFull(GConst.BattleConst.FORMATION_TYPE.DUNGEON_WEAPON) then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_8))
return
end
local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON)
if not weaponData:canFightChapter(chapterId) then
return
end
local heroes = {}
local formation = DataManager.FormationData:getDungeonWeaponFormation()
for matchType, heroId in pairs(formation) do
if heroId > 0 then
table.insert(heroes, heroId)
end
end
local parmas = {chapter_weapon_id = chapterId, heroes = heroes}
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterWeaponChallengeStartReq, parmas, {}, self.rsqFight, BIReport.ITEM_GET_TYPE.DUNGEON_WEAPON_CHALLENGE)
end
function DungeonWeaponManager:rsqFight(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON)
weaponData:setCurFightChapterId(result.reqData.chapter_weapon_id)
local params = {
atkFormation = {}
}
local formation = DataManager.FormationData:getDungeonWeaponFormation()
for elementType, heroId in pairs(formation) do
local heroEntity = DataManager.HeroData:getHeroById(heroId)
if heroEntity then
params.atkFormation[elementType] = heroEntity
end
end
ModuleManager.BattleManager:playBattle(GConst.BattleConst.BATTLE_TYPE.DUNGEON_WEAPON, params, function()
self:showMainUI()
end)
end
end
function DungeonWeaponManager:reqEndChallenge(chapterId, combatReport, taskProgress)
local parmas = {
chapter_weapon_id = chapterId,
win = combatReport.victory,
task_stat = taskProgress,
combatReport = combatReport,
}
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterWeaponChallengeSettlementReq, parmas, {}, self.rsqEndChallenge, BIReport.ITEM_GET_TYPE.DUNGEON_WEAPON_END)
end
function DungeonWeaponManager:rsqEndChallenge(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON)
weaponData:refreshInfoOnSettlement(result.reqData.chapter_weapon_id, result)
local firstRewardsIdx = #result.first_rewards
local rewardCount = #result.rewards
if firstRewardsIdx > rewardCount then
firstRewardsIdx = rewardCount
end
local rewards = {}
for i = firstRewardsIdx + 1, rewardCount do
table.insert(rewards, result.rewards[i])
end
local newRewards = {}
GFunc.mergeRewards2(rewards, newRewards)
local resultRewards = {}
for i = 1, firstRewardsIdx do
table.insert(resultRewards, result.rewards[i])
end
for _, reward in ipairs(newRewards) do
table.insert(resultRewards, reward)
end
ModuleManager.BattleManager:showBattleResultUI(GConst.BattleConst.BATTLE_TYPE.DUNGEON_WEAPON, resultRewards, result.reqData.combatReport, nil, firstRewardsIdx, true)
end
end
-- 请求扫荡副本
function DungeonWeaponManager:reqSweep(chapterId)
local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON)
-- 判断次数
if weaponData:getRemianFarmCount() <= 0 then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_13))
return
end
if not weaponData:canFarmChapter(chapterId) then
return
end
local parmas = {
chapter_weapon_id = chapterId,
}
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterWeaponChallengeFarmReq, parmas, {}, self.respSweep, BIReport.ITEM_GET_TYPE.DUNGEON_WEAPON_SWEEP)
end
-- 响应扫荡副本
function DungeonWeaponManager:respSweep(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON)
weaponData:refreshInfoOnFarm(result)
local remainCount = weaponData:getRemianFarmCount()
-- 合并奖励
local newRewards = {}
GFunc.mergeRewards2(result.rewards, newRewards)
ModuleManager.CommonManager:showMopUpUI(newRewards, remainCount, function()
self:reqSweep(result.reqData.chapter_weapon_id)
end)
end
end
function DungeonWeaponManager:reqPassInfo(chapterId)
local parmas = {
chapter_weapon_id = chapterId,
}
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterWeaponLatestPlayerInfoReq, parmas, {}, self.rspPassInfo)
end
function DungeonWeaponManager:rspPassInfo(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON)
weaponData:doCachePassInfo(result.reqData.chapter_weapon_id, result.players)
end
end
return DungeonWeaponManager

View File

@ -16,6 +16,9 @@ function BattleResultUI:ctor(params)
self.battleType = params.battleType
self.isWin = params.isWin
self.rewards = params.rewards
self.firstPassIdx = params.firstPassIdx or 0
self.noMergeReward = params.noMergeReward
-- pve特有
self.atkReport = params.atkReport
self.wave = params.wave
@ -35,14 +38,10 @@ function BattleResultUI:ctor(params)
end
end
-- 相同奖励合并
for idx, reward in pairs(self.rewards) do
for i = #self.rewards, idx + 1, -1 do
if i ~= idx and reward.item.id == self.rewards[i].item.id then
reward.item.count = reward.item.count + self.rewards[i].item.count
table.remove(self.rewards, i)
end
end
if not self.noMergeReward then
local newRewards = {}
GFunc.mergeRewards2(self.rewards, newRewards)
self.rewards = newRewards
end
end
@ -360,6 +359,7 @@ function BattleResultUI:refreshRewards()
self.animRewards[index] = self:showRewardAppearAnim(index, cell)
end
cell:showRightUpIcon(index <= self.mysteryBoxIdx, GConst.ATLAS_PATH.COMMON, "common_chest_1")
cell:showFirstPass(index <= self.firstPassIdx)
end)
if self:hasArenaBoxNode() then
self.rewardScrollRect:setSizeDeltaY(SCROLL_LINE_HEIGHT)

View File

@ -0,0 +1,56 @@
local CommonFormationUI = class("CommonFormationUI", BaseUI)
function CommonFormationUI:showCommonBG()
return false
end
function CommonFormationUI:getPrefabPath()
return "assets/prefabs/ui/common/common_formation_ui.prefab"
end
function CommonFormationUI:getCurrencyParams()
if self.currencyParams == nil then
self.currencyParams = {
itemIds = {
GConst.ItemConst.ITEM_ID_GEM,
},
showType = GConst.CURRENCY_TYPE.HORIZONTAL
}
end
return self.currencyParams
end
function CommonFormationUI:ctor(params)
self.formationType = params.formationType
end
function CommonFormationUI:onLoadRootComplete()
local uiMap = self.root:genAllChildren()
uiMap["common_formation_ui.banner.btn_ok.tx_ok"]:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_24))
uiMap["common_formation_ui.banner.btn_ok"]:addClickListener(function()
self:closeUI()
end)
local heroUI = uiMap["common_formation_ui.hero_ui"]
heroUI:initPrefabHelper()
heroUI:genAllChildren()
self.heroComp = heroUI:addLuaComponent("app/ui/hero/hero_comp")
self:bind(DataManager.HeroData, "isDirty", function()
self:onRefresh()
end)
self:bind(DataManager.BagData.ItemData, "dirty", function()
self:onRefresh()
end)
self:addEventListener(EventManager.CUSTOM_EVENT.GO_SHOP, function()
self:closeUI()
end)
end
function CommonFormationUI:onRefresh()
self.heroComp:refresh(self.formationType)
end
return CommonFormationUI

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: a827eeea98715174b8206cb56f3cb4f4
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -53,14 +53,27 @@ function DungeonBoardCell:refreshInfo()
self.txOpen:setAnchoredPositionY(-110)
self.txStart:setText(I18N:getGlobalText(I18N.GlobalConst.START_DESC))
local time = DataManager.DungeonData:getRemainTimes(self.moduleKey)
local timeStr = nil
if time <= 0 then
timeStr = "<color=#FF6464>" .. time .. "</color>"
if self.moduleKey == ModuleManager.MODULE_KEY.DUNGEON_WEAPON then
local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON)
local time = weaponData:getRemianFarmCount()
local timeStr = nil
if time <= 0 then
timeStr = "<color=#FF6464>" .. time .. "</color>"
else
timeStr = time
end
self.txTimes:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_5, timeStr))
else
timeStr = time
local time = DataManager.DungeonData:getRemainTimes(self.moduleKey)
local timeStr = nil
if time <= 0 then
timeStr = "<color=#FF6464>" .. time .. "</color>"
else
timeStr = time
end
self.txTimes:setText(I18N:getGlobalText(I18N.GlobalConst.TODAY_REMAIN_TIMES, timeStr))
end
self.txTimes:setText(I18N:getGlobalText(I18N.GlobalConst.TODAY_REMAIN_TIMES, timeStr))
self:refreshCountdown(self.txCountdown)
else
self.btnStart:setVisible(false)
@ -71,15 +84,19 @@ function DungeonBoardCell:refreshInfo()
self.lockTxLock:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_OPEN))
self:refreshCountdown(self.lockTxCountdown)
end
self.txTimes:setVisible(not DataManager.DungeonData:isNoTotalLimit(self.moduleKey))
GFunc.centerImgAndTx(self.lockIcon, self.lockTxLock, 10)
GFunc.centerImgAndTx(self.lockIconCountdown, self.lockTxCountdown, 10)
end
function DungeonBoardCell:refreshRewards()
local id = DataManager.DungeonData:getBoardShowRewardId(self.moduleKey)
self.itemReward:refreshItemById(id, 0)
if self.moduleKey == ModuleManager.MODULE_KEY.DUNGEON_WEAPON then
self.itemReward:getBaseObject():setActive(false)
else
self.itemReward:getBaseObject():setActive(true)
local id = DataManager.DungeonData:getBoardShowRewardId(self.moduleKey)
self.itemReward:refreshItemById(id, 0)
end
end
function DungeonBoardCell:refreshCountdown(txCountdown)

View File

@ -41,14 +41,12 @@ function ChapterLayerCell:refresh(id)
fightBtn:setSprite(GConst.ATLAS_PATH.COMMON, FIGHT_BTN[2])
fightDesc:setText(I18N:getGlobalText(I18N.GlobalConst.SMASH))
self.rewardCells[1]:refreshByConfig(config.must_drop[1])
self.rewardCells[2]:refreshByConfig(config.rand_drop[1])
self.rewardCells[3]:refreshByConfig(config.rand_drop[2])
for i = 1, 3 do
self.rewardCells[i]:refreshByConfig(config.item_show[i])
self.rewardCells[i]:hideCountTx()
end
fightBtn:addClickListener(function()
Logger.logHighlight("扫荡")
ModuleManager.DungeonWeaponManager:reqSweep(id)
end)
elseif weaponData:canFightChapter(id) then -- 可挑战
mask:setVisible(false)
@ -60,16 +58,14 @@ function ChapterLayerCell:refresh(id)
fightBtn:setSprite(GConst.ATLAS_PATH.COMMON, FIGHT_BTN[1])
fightDesc:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_CHALLENGE))
self.rewardCells[1]:refreshByConfig(config.must_drop[1])
self.rewardCells[2]:refreshByConfig(config.rand_drop[1])
self.rewardCells[3]:refreshByConfig(config.rand_drop[2])
for i = 1, 3 do
self.rewardCells[i]:refreshByConfig(config.item_show[i])
self.rewardCells[i]:hideCountTx()
end
self.rewardCells[4]:refreshByConfig(config.first_reward)
self.rewardCells[4]:showFirstPass(true)
fightBtn:addClickListener(function()
Logger.logHighlight("挑战")
ModuleManager.DungeonWeaponManager:reqFight(id)
end)
else -- 不可挑战
mask:setVisible(true)

View File

@ -18,17 +18,18 @@ function DungeonWeaponMainUI:getPrefabPath()
end
function DungeonWeaponMainUI:ctor()
self.weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON)
self.chapterList = {}
self.targetId = nil
self.targetId = self.weaponData:getPassedMaxId()
for id, info in pairs(ConfigManager:getConfig("chapter_dungeon_equip")) do
table.insert(self.chapterList, id)
if not self.targetId then
self.targetId = id
end
-- if id == then -- 最大可挑战章节
-- self.targetId = id
-- end
if id == self.weaponData:getPassedMaxId() + 1 and self.weaponData:canFightChapter(id) then -- 最大可挑战章节
self.targetId = id
end
end
end
@ -52,10 +53,25 @@ function DungeonWeaponMainUI:_addListeners()
uiMap["dungeon_weapon_mian_ui.banner.btn_back"]:addClickListener(function()
self:closeUI()
end)
uiMap["dungeon_weapon_mian_ui.banner.btn_formation"]:addClickListener(function()
ModuleManager.CommonManager:showFormationUI(GConst.BattleConst.FORMATION_TYPE.DUNGEON_WEAPON)
end)
end
function DungeonWeaponMainUI:_bind()
self:bind(self.weaponData, "isDirty", function()
self:refreshFormation()
self:refreshRemianNode()
end)
self:bind(DataManager.FormationData, "dirty", function()
self:refreshFormation()
end)
self:bind(DataManager.FormationData, "isDirty", function()
self:refreshFormation()
end)
end
function DungeonWeaponMainUI:refreshScrollrect()
@ -84,8 +100,7 @@ function DungeonWeaponMainUI:refreshRemianNode()
local uiMap = self.root:genAllChildren()
local node = uiMap["dungeon_weapon_mian_ui.remian_node"]
local txt = uiMap["dungeon_weapon_mian_ui.remian_node.desc"]
local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON)
txt:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_5, weaponData:getRemianFarmCount() .. "/" .. weaponData:getDialyFarmLimit()))
txt:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_5, self.weaponData:getRemianFarmCount() .. "/" .. self.weaponData:getDialyFarmLimit()))
GFunc.expandImgToFitTx(node, txt, 16.5)
end

View File

@ -91,6 +91,8 @@ function HeroComp:refresh(battleType)
self:refreshArenaFightFormation()
elseif self.battleType == GConst.BattleConst.FORMATION_TYPE.ARENA_DEFEND then
self:refreshArenaDefendFormation()
elseif self.battleType == GConst.BattleConst.FORMATION_TYPE.DUNGEON_WEAPON then
self:refreshDungeonWeaponFormation()
end
end
@ -135,6 +137,20 @@ function HeroComp:refreshArenaDefendFormation()
self:refreshScrollRect()
end
-- 展示武器副本
function HeroComp:refreshDungeonWeaponFormation()
self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_15))
self.rimgTopBG:setTexture("assets/arts/textures/background/hero/hero_bg_1.png")
self.curFormation = DataManager.FormationData:getDungeonWeaponFormation()
self.onClickUseFunc = function(id, type)
DataManager.FormationData:upHeroToFormation(self.battleType, type, id)
self:refreshDungeonWeaponFormation()
end
self:refreshScrollRect()
end
function HeroComp:refreshScrollRect()
for i = 1, 5 do
local heroId = self.curFormation[i]

View File

@ -25,7 +25,7 @@ function DungeonComp:init()
return "app/ui/dungeon/dungeon_board_cell"
end)
self.scrollRectComp:addRefreshCallback(function(index, cell)
cell:refresh(self.openDungeons[index])
cell:refresh(self.openDungeons[index].module)
end)
self.scrollRectComp:setTotalCount(0)
self:refreshShow()

View File

@ -116,7 +116,7 @@ function BaseTips:adaptWhenOverScreen(node, pivotX, pivotY)
-- 右边超出屏幕
if math.abs(rightX) > halfWidth then
node:addAnchoredPosition(halfWidth - math.abs(rightX), 0)
xOffset = xOffset + math.abs(leftX) - halfWidth
xOffset = xOffset + halfWidth - math.abs(rightX)
end
-- 上边超出屏幕
if math.abs(topY) > halfHeight then

View File

@ -1,7 +1,10 @@
local DungeonData = class("DungeonData", BaseData)
local SORT_ORDER = {
[ModuleManager.MODULE_KEY.DUNGEON_GOLD] = 1,
[ModuleManager.MODULE_KEY.DUNGEON_SHARDS] = 2,
[ModuleManager.MODULE_KEY.DUNGEON_WEAPON] = 3,
[ModuleManager.MODULE_KEY.DUNGEON_ARMOR] = 4,
}
-- 所有活动副本数据
@ -11,6 +14,11 @@ function DungeonData:ctor()
end
function DungeonData:clear()
if self.dataDungeons then
for _, entity in pairs(self.dataDungeons) do
entity:clear()
end
end
end
-- 初始化金币副本数据
@ -167,35 +175,33 @@ function DungeonData:getOpenDungeons()
-- 开启且活跃
table.foreach(self.dungeonStage, function(module, s)
if self:isOpen(module) and self:isActive(module) then
table.insert(openDungeons, module)
local count = self:getRemainTimes(module)
if count > 0 then
count = 100
else
count = 200
end
table.insert(openDungeons, {
sort = SORT_ORDER[module] + 1000 + count, -- 系数 + 开启1000 + 剩余次数
module = module
})
end
end)
-- 开启且不活跃
if not GFunc.isShenhe() then
table.foreach(self.dungeonStage, function(module, s)
if self:isOpen(module) and not self:isActive(module) then
table.insert(openDungeons, module)
table.insert(openDungeons, {
sort = SORT_ORDER[module] + 2000, -- 系数 + 未开启2000
module = module
})
end
end)
end
-- 碎片和金币顺序特殊处理:策划要求,同时开启时,金币在碎片之上
if self:isActive(ModuleManager.MODULE_KEY.DUNGEON_GOLD) and self:isActive(ModuleManager.MODULE_KEY.DUNGEON_SHARDS) then
local idxGold,idxShards = 0,0
for idx, module in pairs(openDungeons) do
if module == ModuleManager.MODULE_KEY.DUNGEON_GOLD then
idxGold = idx
end
if module == ModuleManager.MODULE_KEY.DUNGEON_SHARDS then
idxShards = idx
end
end
if idxGold > idxShards then
local temp = openDungeons[idxShards]
openDungeons[idxShards] = openDungeons[idxGold]
openDungeons[idxGold] = temp
end
end
table.sort(openDungeons, function(a, b)
return a.sort < b.sort
end)
if EDITOR_MODE then
Logger.logHighlight("已开启副本:")

View File

@ -4,13 +4,37 @@ local DungeonWeaponEntity = class("DungeonWeaponEntity", DungeonBaseEntity)
local GET_PASS_INFO_INTERVAL = 600
-- 支线副本数据
function DungeonWeaponEntity:clear()
DataManager:unregisterCrossDayFunc("DungeonWeaponEntity")
end
function DungeonWeaponEntity:init(data)
self.maxPassedId = data.max_challenge_id
self.farmCount = data.farm_count
self.heroes = data.heroes
self.giftInfo = data.gift_info
self.totalChallengeCount = data.total_challenge_count
self.maxPassedId = data.max_challenge_id or 0
self.farmCount = data.farm_count or 0
self.heroes = data.heroes or {}
self.giftInfo = data.gift_info or {}
self.totalChallengeCount = data.total_challenge_count or {}
self.data.isDirty = not self.data.isDirty
DataManager.FormationData:initDungeonWeapon(self.heroes)
DataManager:registerCrossDayFunc("DungeonWeaponEntity", function()
self.farmCount = 0
self:setDirty()
end)
end
function DungeonWeaponEntity:refreshInfoOnSettlement(chapterId, result)
self.totalChallengeCount[chapterId] = (self.totalChallengeCount[chapterId] or 0) + 1
self.maxPassedId = result.max_id
self.giftInfo = result.gift_info
self:setDirty()
end
function DungeonWeaponEntity:refreshInfoOnFarm(result)
self.farmCount = self.farmCount + 1
self.giftInfo = result.gift_info
self:setDirty()
end
function DungeonWeaponEntity:setDirty()
@ -18,7 +42,11 @@ function DungeonWeaponEntity:setDirty()
end
function DungeonWeaponEntity:getTotalChallengeCount()
return self.totalChallengeCount
local count = 0
for _, c in pairs(self.totalChallengeCount) do
count = count + 1
end
return count
end
function DungeonWeaponEntity:getTodayChallengeCount()
@ -89,6 +117,10 @@ function DungeonWeaponEntity:getRemianFarmCount()
return count
end
function DungeonWeaponEntity:getTodayRemainLimitCount()
return self:getRemianFarmCount()
end
function DungeonWeaponEntity:getLevelEnough(chapterId)
local config = ConfigManager:getConfig(self:getConfigName())[chapterId]
if not config then
@ -139,6 +171,7 @@ function DungeonWeaponEntity:doCachePassInfo(chapterId, info)
self.cachePassInfo[chapterId].info = info
self.cachePassInfo[chapterId].getTime = Time:getServerTime()
end
self:setDirty()
end
function DungeonBaseEntity:getCachePassInfo(chapterId)
@ -157,4 +190,16 @@ function DungeonBaseEntity:getCachePassInfo(chapterId)
return self.cachePassInfo[chapterId].info
end
function DungeonWeaponEntity:setCurFightChapterId(chapterId)
self.curFightchapterId = chapterId or 1
end
function DungeonWeaponEntity:getCurFightChapterId()
return self.curFightchapterId or 1
end
function DungeonWeaponEntity:getChapterFightCount(chapterId)
return self.totalChallengeCount[chapterId] or 0
end
return DungeonWeaponEntity

View File

@ -46,6 +46,20 @@ function FormationData:initArena(attack, defend)
self:setDirty()
end
function FormationData:initDungeonWeapon(heroes)
if self.formations == nil then
self.formations = {}
end
self.formations[GConst.BattleConst.FORMATION_TYPE.DUNGEON_WEAPON] = {}
for idx, id in pairs(heroes) do
if id and id ~= 0 then
local matchType = DataManager.HeroData:getHeroById(id):getMatchType()
self.formations[GConst.BattleConst.FORMATION_TYPE.DUNGEON_WEAPON][matchType] = id
end
end
end
function FormationData:getStageFormation()
return self:getFormation(GConst.BattleConst.FORMATION_TYPE.STAGE)
end