Merge branch 'fang/dungeon' into 'dev'

活动副本

See merge request b6-client/b6-lua!2
This commit is contained in:
陈希 2023-06-14 06:46:12 +00:00
commit 453a98b793
77 changed files with 2335 additions and 768 deletions

View File

@ -96,6 +96,12 @@ BIReport.ITEM_GET_TYPE = {
DAILY_CHALLENGE_END = "DailyChallengeEnd", -- 每日挑战结算 DAILY_CHALLENGE_END = "DailyChallengeEnd", -- 每日挑战结算
DAILY_CHALLENGE_RESET = "DailyChallengeReset", -- 每日挑战重置 DAILY_CHALLENGE_RESET = "DailyChallengeReset", -- 每日挑战重置
DAILY_CHALLENGE_TASK_REWARD = "DailyChallengeTaskReward", -- 每日挑战任务奖励 DAILY_CHALLENGE_TASK_REWARD = "DailyChallengeTaskReward", -- 每日挑战任务奖励
DUNGEON_GOLD_CHALLENGE = "DungeonGoldChallenge", -- 金币副本挑战
DUNGEON_GOLD_END = "DungeonGoldEnd", -- 金币副本结算
DUNGEON_GOLD_SWEEP = "DungeonGoldSweep", -- 金币副本扫荡
DUNGEON_SHARDS_CHALLENGE = "DungeonShardsChallenge", -- 碎片副本挑战
DUNGEON_SHARDS_END = "DungeonShardsEnd", -- 碎片副本结算
DUNGEON_SHARDS_SWEEP = "DungeonShardsSweep", -- 碎片副本扫荡
} }
BIReport.ADS_CLICK_TYPE = { BIReport.ADS_CLICK_TYPE = {

View File

@ -111,6 +111,8 @@ function ConfigManager:preLoadConfig()
end end
handleMonsterGrow("monster_chapter") handleMonsterGrow("monster_chapter")
handleMonsterGrow("monster_daily_challenge") handleMonsterGrow("monster_daily_challenge")
handleMonsterGrow("monster_dungeon_gold")
handleMonsterGrow("monster_dungeon_shards")
self.configs["monster"] = { self.configs["monster"] = {
data = monsterFullData, data = monsterFullData,

View File

@ -9,6 +9,7 @@ function DataManager:init()
self:initManager("PlayerData", "app/userdata/player/player_data") self:initManager("PlayerData", "app/userdata/player/player_data")
self:initManager("ChapterData", "app/userdata/chapter/chapter_data") self:initManager("ChapterData", "app/userdata/chapter/chapter_data")
self:initManager("DailyChallengeData", "app/userdata/daily_challenge/daily_challenge_data") self:initManager("DailyChallengeData", "app/userdata/daily_challenge/daily_challenge_data")
self:initManager("DungeonData", "app/userdata/dungeon/dungeon_data")
self:initManager("HeroData", "app/userdata/hero/hero_data") self:initManager("HeroData", "app/userdata/hero/hero_data")
self:initManager("BagData", "app/userdata/bag/bag_data") self:initManager("BagData", "app/userdata/bag/bag_data")
self:initManager("BattleData", "app/userdata/battle/battle_data") self:initManager("BattleData", "app/userdata/battle/battle_data")
@ -85,6 +86,7 @@ function DataManager:clear()
self.PlayerData:clear() self.PlayerData:clear()
self.ChapterData:clear() self.ChapterData:clear()
self.DailyChallengeData:clear() self.DailyChallengeData:clear()
self.DungeonData:clear()
self.HeroData:clear() self.HeroData:clear()
self.BagData:clear() self.BagData:clear()
self.FormationData:clear() self.FormationData:clear()
@ -119,6 +121,8 @@ function DataManager:initWithServerData(data)
self.PlayerData:init(data) self.PlayerData:init(data)
self.ChapterData:init(data.chapter) self.ChapterData:init(data.chapter)
self.DailyChallengeData:init(data.chapter_daily_challenge) self.DailyChallengeData:init(data.chapter_daily_challenge)
self.DungeonData:initDungeonGold(data.chapter_gold_challenge)
self.DungeonData:initDungeonShards(data.chapter_shards_challenge)
self.HeroData:init(data.bag.heroes) self.HeroData:init(data.bag.heroes)
self.BagData:init(data.bag) self.BagData:init(data.bag)
self.FormationData:init(data.fight_info) self.FormationData:init(data.fight_info)

View File

@ -29,11 +29,12 @@ EventManager.CUSTOM_EVENT = {
SKILL_REFRESH_SUCC = "SKILL_REFRESH_SUCC", SKILL_REFRESH_SUCC = "SKILL_REFRESH_SUCC",
GO_SHOP = "GO_SHOP", -- 跳转商店 GO_SHOP = "GO_SHOP", -- 跳转商店
UPDATE_MAIN_MALL_HEIGHT = "UPDATE_MAIN_MALL_HEIGHT", -- 更新主要商品的高度 UPDATE_MAIN_MALL_HEIGHT = "UPDATE_MAIN_MALL_HEIGHT", -- 更新主要商品的高度
GO_DAILY_CHALLENGE = "GO_DAILY_CHALLENGE", -- 跳转每日挑战 CHANGE_MAIN_COMP_MODULE = "CHANGE_MAIN_COMP_MODULE", -- 切换主界面模块
GO_CHAPTER = "GO_CHAPTER", -- 跳转主线章节
CLOSE_BOX_HERO_UI = "CLOSE_BOX_HERO_UI", CLOSE_BOX_HERO_UI = "CLOSE_BOX_HERO_UI",
CLOSE_BOX_OPEN_UI = "CLOSE_BOX_OPEN_UI", CLOSE_BOX_OPEN_UI = "CLOSE_BOX_OPEN_UI",
BIND_ACCOUNT_SUCCESS = "BIND_ACCOUNT_SUCCESS", BIND_ACCOUNT_SUCCESS = "BIND_ACCOUNT_SUCCESS",
DUNGEON_CHALLENGE = "DUNGEON_CHALLENGE",-- 副本开始挑战
DUNGEON_SWEEP = "DUNGEON_SWEEP",-- 副本开始扫荡
-- BORAD_TOUCH_BEGIN = "BORAD_TOUCH_BEGIN", -- BORAD_TOUCH_BEGIN = "BORAD_TOUCH_BEGIN",
-- BORAD_TOUCH_OVER = "BORAD_TOUCH_OVER" -- BORAD_TOUCH_OVER = "BORAD_TOUCH_OVER"
} }

View File

@ -51,6 +51,8 @@ local MODULE_PATHS = {
PlayerManager = "app/module/player/player_manager", PlayerManager = "app/module/player/player_manager",
-- 账号 -- 账号
AccountManager= "app/module/account/account_manager", AccountManager= "app/module/account/account_manager",
-- 活动副本
DungeonManager = "app/module/dungeon/dungeon_manager",
} }
-- 这里的key对应func_open里的id -- 这里的key对应func_open里的id
@ -70,6 +72,8 @@ ModuleManager.MODULE_KEY = {
FIRST_RECHARGE = "first_charge", -- 首充礼包 FIRST_RECHARGE = "first_charge", -- 首充礼包
BEGINNER_GIFT = "new_player_gift", -- 新手礼包 BEGINNER_GIFT = "new_player_gift", -- 新手礼包
MAIL = "mail_open", -- 邮件 MAIL = "mail_open", -- 邮件
DUNGEON_SHARDS = "dungeon_shards_open", -- 碎片副本
DUNGEON_GOLD = "dungeon_gold_open", -- 金币副本
} }
local _moduleMgrs = {} local _moduleMgrs = {}

View File

@ -137,6 +137,15 @@ function Time:getOverOfServerToday(time)
return self:getBeginningOfServerToday() + SECONDS_PRE_DAY return self:getBeginningOfServerToday() + SECONDS_PRE_DAY
end end
-- 获取今日剩余时间
function Time:getTodaySurplusTime()
local result = self:getOverOfServerToday() - self:getServerTime()
if result < 0 then
result = 0
end
return result
end
function Time:getBeginningOfToday() function Time:getBeginningOfToday()
local now = os.date('*t', self:getServerTime() + self:getTimeZoneOffset()*SECONDS_PRE_HOUR) local now = os.date('*t', self:getServerTime() + self:getTimeZoneOffset()*SECONDS_PRE_HOUR)
local beginDay = os.time{year = now.year, month = now.month, day = now.day, hour = 0} local beginDay = os.time{year = now.year, month = now.month, day = now.day, hour = 0}
@ -271,6 +280,15 @@ function Time:getDayByTimeStamp(time)
return now.day return now.day
end end
-- 获取当前处于星期几
function Time:getWeekByTimeStamp(time)
time = time or self:getServerTime()
local now = os.date('!*t', time)
local weekTab = {7, 1, 2, 3, 4, 5, 6}
return weekTab[now.wday]
end
-- 转换服务器时间字符串(ISO 8601)的对应的时间戳,例如2022-09-10T18:10:00.000Z -- 转换服务器时间字符串(ISO 8601)的对应的时间戳,例如2022-09-10T18:10:00.000Z
function Time:convertServerTimeStringToTimestamp(str) function Time:convertServerTimeStringToTimestamp(str)
local dateTime = CS.System.DateTime.Parse(str) local dateTime = CS.System.DateTime.Parse(str)

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 8d3c3e28eaf46a94287e7509be47d216 guid: fe59ab7c592d4c141b9fa28289bc898d
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 0bf07daf8913b274e9d0b0b3a5fad0d1 guid: 8d387a3ff3bff68488370d1ca79c39d5
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -10,7 +10,7 @@ local chapter_dungeon_shards = {
4, 4,
5 5
}, },
["monster_dungeon_shards"]={ ["monster"]={
104, 104,
204, 204,
304, 304,
@ -99,7 +99,7 @@ local chapter_dungeon_shards = {
9, 9,
10 10
}, },
["monster_dungeon_shards"]={ ["monster"]={
604, 604,
704, 704,
804, 804,
@ -188,7 +188,7 @@ local chapter_dungeon_shards = {
14, 14,
15 15
}, },
["monster_dungeon_shards"]={ ["monster"]={
1104, 1104,
1204, 1204,
1304, 1304,
@ -277,7 +277,7 @@ local chapter_dungeon_shards = {
19, 19,
20 20
}, },
["monster_dungeon_shards"]={ ["monster"]={
1604, 1604,
1704, 1704,
1804, 1804,
@ -366,7 +366,7 @@ local chapter_dungeon_shards = {
24, 24,
25 25
}, },
["monster_dungeon_shards"]={ ["monster"]={
2104, 2104,
2204, 2204,
2304, 2304,
@ -455,7 +455,7 @@ local chapter_dungeon_shards = {
29, 29,
30 30
}, },
["monster_dungeon_shards"]={ ["monster"]={
2604, 2604,
2704, 2704,
2804, 2804,
@ -544,7 +544,7 @@ local chapter_dungeon_shards = {
34, 34,
35 35
}, },
["monster_dungeon_shards"]={ ["monster"]={
3104, 3104,
3204, 3204,
3304, 3304,
@ -633,7 +633,7 @@ local chapter_dungeon_shards = {
39, 39,
40 40
}, },
["monster_dungeon_shards"]={ ["monster"]={
3604, 3604,
3704, 3704,
3804, 3804,
@ -722,7 +722,7 @@ local chapter_dungeon_shards = {
44, 44,
45 45
}, },
["monster_dungeon_shards"]={ ["monster"]={
4104, 4104,
4204, 4204,
4304, 4304,
@ -811,7 +811,7 @@ local chapter_dungeon_shards = {
49, 49,
50 50
}, },
["monster_dungeon_shards"]={ ["monster"]={
4604, 4604,
4704, 4704,
4804, 4804,
@ -900,7 +900,7 @@ local chapter_dungeon_shards = {
54, 54,
55 55
}, },
["monster_dungeon_shards"]={ ["monster"]={
5104, 5104,
5204, 5204,
5304, 5304,
@ -989,7 +989,7 @@ local chapter_dungeon_shards = {
59, 59,
60 60
}, },
["monster_dungeon_shards"]={ ["monster"]={
5604, 5604,
5704, 5704,
5804, 5804,
@ -1078,7 +1078,7 @@ local chapter_dungeon_shards = {
64, 64,
65 65
}, },
["monster_dungeon_shards"]={ ["monster"]={
6104, 6104,
6204, 6204,
6304, 6304,
@ -1167,7 +1167,7 @@ local chapter_dungeon_shards = {
69, 69,
70 70
}, },
["monster_dungeon_shards"]={ ["monster"]={
6604, 6604,
6704, 6704,
6804, 6804,
@ -1256,7 +1256,7 @@ local chapter_dungeon_shards = {
74, 74,
75 75
}, },
["monster_dungeon_shards"]={ ["monster"]={
7104, 7104,
7204, 7204,
7304, 7304,
@ -1345,7 +1345,7 @@ local chapter_dungeon_shards = {
79, 79,
80 80
}, },
["monster_dungeon_shards"]={ ["monster"]={
7604, 7604,
7704, 7704,
7804, 7804,
@ -1434,7 +1434,7 @@ local chapter_dungeon_shards = {
84, 84,
85 85
}, },
["monster_dungeon_shards"]={ ["monster"]={
8104, 8104,
8204, 8204,
8304, 8304,
@ -1523,7 +1523,7 @@ local chapter_dungeon_shards = {
89, 89,
90 90
}, },
["monster_dungeon_shards"]={ ["monster"]={
8604, 8604,
8704, 8704,
8804, 8804,
@ -1612,7 +1612,7 @@ local chapter_dungeon_shards = {
94, 94,
95 95
}, },
["monster_dungeon_shards"]={ ["monster"]={
9104, 9104,
9204, 9204,
9304, 9304,
@ -1701,7 +1701,7 @@ local chapter_dungeon_shards = {
99, 99,
100 100
}, },
["monster_dungeon_shards"]={ ["monster"]={
9604, 9604,
9704, 9704,
9804, 9804,
@ -1790,7 +1790,7 @@ local chapter_dungeon_shards = {
104, 104,
105 105
}, },
["monster_dungeon_shards"]={ ["monster"]={
10104, 10104,
10204, 10204,
10304, 10304,
@ -1879,7 +1879,7 @@ local chapter_dungeon_shards = {
109, 109,
110 110
}, },
["monster_dungeon_shards"]={ ["monster"]={
10604, 10604,
10704, 10704,
10804, 10804,
@ -1968,7 +1968,7 @@ local chapter_dungeon_shards = {
114, 114,
115 115
}, },
["monster_dungeon_shards"]={ ["monster"]={
11104, 11104,
11204, 11204,
11304, 11304,
@ -2057,7 +2057,7 @@ local chapter_dungeon_shards = {
119, 119,
120 120
}, },
["monster_dungeon_shards"]={ ["monster"]={
11604, 11604,
11704, 11704,
11804, 11804,
@ -2146,7 +2146,7 @@ local chapter_dungeon_shards = {
124, 124,
125 125
}, },
["monster_dungeon_shards"]={ ["monster"]={
12104, 12104,
12204, 12204,
12304, 12304,
@ -2235,7 +2235,7 @@ local chapter_dungeon_shards = {
129, 129,
130 130
}, },
["monster_dungeon_shards"]={ ["monster"]={
12604, 12604,
12704, 12704,
12804, 12804,
@ -2324,7 +2324,7 @@ local chapter_dungeon_shards = {
134, 134,
135 135
}, },
["monster_dungeon_shards"]={ ["monster"]={
13104, 13104,
13204, 13204,
13304, 13304,
@ -2413,7 +2413,7 @@ local chapter_dungeon_shards = {
139, 139,
140 140
}, },
["monster_dungeon_shards"]={ ["monster"]={
13604, 13604,
13704, 13704,
13804, 13804,
@ -2502,7 +2502,7 @@ local chapter_dungeon_shards = {
144, 144,
145 145
}, },
["monster_dungeon_shards"]={ ["monster"]={
14104, 14104,
14204, 14204,
14304, 14304,
@ -2591,7 +2591,7 @@ local chapter_dungeon_shards = {
149, 149,
150 150
}, },
["monster_dungeon_shards"]={ ["monster"]={
14604, 14604,
14704, 14704,
14804, 14804,

View File

@ -1120,9 +1120,8 @@ local skill = {
}, },
["shake_time"]=200, ["shake_time"]=200,
["shake_type"]=6, ["shake_type"]=6,
["sound_hit"]={ ["sound"]=14001200,
1400120 ["sound_delay"]=0,
},
["name_act"]="skill01", ["name_act"]="skill01",
["fx_self"]=300049, ["fx_self"]=300049,
["bullet_time"]={ ["bullet_time"]={
@ -1337,9 +1336,8 @@ local skill = {
}, },
["shake_time"]=200, ["shake_time"]=200,
["shake_type"]=6, ["shake_type"]=6,
["sound_hit"]={ ["sound"]=14002200,
54001201 ["sound_delay"]=0,
},
["name_act"]="skill01", ["name_act"]="skill01",
["fx_self"]=300089, ["fx_self"]=300089,
["bullet_time"]={ ["bullet_time"]={
@ -1435,9 +1433,8 @@ local skill = {
}, },
["shake_time"]=200, ["shake_time"]=200,
["shake_type"]=6, ["shake_type"]=6,
["sound_hit"]={ ["sound"]=14002200,
54001201 ["sound_delay"]=0,
},
["name_act"]="skill01", ["name_act"]="skill01",
["fx_self"]=300089, ["fx_self"]=300089,
["bullet_time"]={ ["bullet_time"]={
@ -2738,9 +2735,8 @@ local skill = {
}, },
["shake_time"]=200, ["shake_time"]=200,
["shake_type"]=6, ["shake_type"]=6,
["sound_hit"]={ ["sound"]=24002200,
2400120 ["sound_delay"]=0,
},
["name_act"]="skill01", ["name_act"]="skill01",
["fx_self"]=300032, ["fx_self"]=300032,
["bullet_time"]={ ["bullet_time"]={
@ -3869,12 +3865,12 @@ local skill = {
} }
}, },
[3400210]={ [3400210]={
["position"]=3, ["position"]=4,
["effect_type"]=1, ["effect_type"]=1,
["trigger"]=1, ["trigger"]=1,
["effect"]={ ["effect"]={
{ {
["type"]="hurt_green", ["type"]="hurt_blue",
["num"]=10000, ["num"]=10000,
["ratio"]=10000, ["ratio"]=10000,
["round"]=0 ["round"]=0
@ -3882,8 +3878,8 @@ local skill = {
}, },
["obj"]=2, ["obj"]=2,
["skill_position"]={ ["skill_position"]={
1, 2,
140 0
}, },
["shake_time"]=100, ["shake_time"]=100,
["shake_type"]=1, ["shake_type"]=1,
@ -3891,15 +3887,15 @@ local skill = {
1000001 1000001
}, },
["name_act"]="attack01", ["name_act"]="attack01",
["fx_self"]=300091 ["fx_self"]=300033
}, },
[3400211]={ [3400211]={
["position"]=3, ["position"]=4,
["effect_type"]=1, ["effect_type"]=1,
["trigger"]=1, ["trigger"]=1,
["effect"]={ ["effect"]={
{ {
["type"]="hurt_green", ["type"]="hurt_blue",
["num"]=10000, ["num"]=10000,
["ratio"]=10000, ["ratio"]=10000,
["round"]=0 ["round"]=0
@ -3907,8 +3903,8 @@ local skill = {
}, },
["obj"]=2, ["obj"]=2,
["skill_position"]={ ["skill_position"]={
1, 2,
140 0
}, },
["shake_time"]=100, ["shake_time"]=100,
["shake_type"]=1, ["shake_type"]=1,
@ -3916,15 +3912,15 @@ local skill = {
1000002 1000002
}, },
["name_act"]="attack02", ["name_act"]="attack02",
["fx_self"]=300091 ["fx_self"]=300033
}, },
[3400212]={ [3400212]={
["position"]=3, ["position"]=4,
["effect_type"]=1, ["effect_type"]=1,
["trigger"]=1, ["trigger"]=1,
["effect"]={ ["effect"]={
{ {
["type"]="hurt_green", ["type"]="hurt_blue",
["num"]=10000, ["num"]=10000,
["ratio"]=10000, ["ratio"]=10000,
["round"]=0 ["round"]=0
@ -3932,8 +3928,8 @@ local skill = {
}, },
["obj"]=2, ["obj"]=2,
["skill_position"]={ ["skill_position"]={
1, 2,
140 0
}, },
["shake_time"]=100, ["shake_time"]=100,
["shake_type"]=1, ["shake_type"]=1,
@ -3941,15 +3937,15 @@ local skill = {
1000003 1000003
}, },
["name_act"]="attack03", ["name_act"]="attack03",
["fx_self"]=300091 ["fx_self"]=300093
}, },
[3400213]={ [3400213]={
["position"]=3, ["position"]=4,
["effect_type"]=1, ["effect_type"]=1,
["trigger"]=1, ["trigger"]=1,
["effect"]={ ["effect"]={
{ {
["type"]="hurt_green", ["type"]="hurt_blue",
["num"]=10000, ["num"]=10000,
["ratio"]=10000, ["ratio"]=10000,
["round"]=0 ["round"]=0
@ -3957,8 +3953,8 @@ local skill = {
}, },
["obj"]=2, ["obj"]=2,
["skill_position"]={ ["skill_position"]={
1, 2,
140 0
}, },
["shake_time"]=100, ["shake_time"]=100,
["shake_type"]=1, ["shake_type"]=1,
@ -3966,127 +3962,145 @@ local skill = {
1000004 1000004
}, },
["name_act"]="attack04", ["name_act"]="attack04",
["fx_self"]=300091 ["fx_self"]=300094
}, },
[3400220]={ [3400220]={
["energy"]=10, ["energy"]=10,
["link"]=1, ["link"]=1,
["position"]=3, ["position"]=4,
["method"]=1,
["skill_type"]=0,
["battle_icon"]="18",
["effect_type"]=1,
["trigger"]=1,
["effect"]={
{
["type"]="hurt_green",
["num"]=40000,
["ratio"]=10000,
["round"]=0
},
{
["type"]="curse",
["num"]=2500,
["ratio"]=10000,
["round"]=1
}
},
["obj"]=2,
["skill_position"]={
1,
140
},
["shake_time"]=200,
["shake_type"]=6,
["sound_hit"]={
3400120
},
["name_act"]="skill01",
["fx_self"]=300092,
["bullet_time"]={
1600,
3000,
200
}
},
[3400221]={
["energy"]=10,
["link"]=1,
["position"]=3,
["method"]=2, ["method"]=2,
["skill_type"]=4, ["skill_type"]=4,
["boardrange"]={ ["boardrange"]={
{
["type"]=1,
["range"]=2
}, },
{ ["battle_icon"]="19",
["type"]=2,
["range"]=2
}
},
["battle_icon"]="18",
["effect_type"]=1, ["effect_type"]=1,
["trigger"]=1, ["trigger"]=1,
["effect"]={ ["effect"]={
{ {
["type"]="hurt_green", ["type"]="hurt_blue",
["num"]=40000, ["num"]=40000,
["ratio"]=10000, ["ratio"]=10000,
["round"]=0 ["round"]=0
}, },
{ {
["type"]="curse", ["type"]="lethargy",
["num"]=2500, ["num"]=0,
["ratio"]=10000, ["ratio"]=5000,
["round"]=1 ["round"]=2
} }
}, },
["obj"]=2, ["obj"]=2,
["skill_position"]={ ["skill_position"]={
1, 2,
140 0
}, },
["shake_time"]=200, ["shake_time"]=200,
["shake_type"]=6, ["shake_type"]=5,
["sound_hit"]={ ["sound_hit"]={
3400120 4300120
}, },
["name_act"]="skill01", ["name_act"]="skill01",
["fx_self"]=300092, ["fx_target"]=300034,
["bullet_time"]={ ["bullet_time"]={
1600, 633,
3000, 3000,
200 400
} }
}, },
[3400221]={
["position"]=4,
["buff_condition"]={
{
{
["type"]="state",
["attr"]="weaken",
["op"]=">",
["v"]=0,
["side"]=2
}
}
},
["effect_type"]=2,
["trigger"]=7,
["effect"]={
{
["type"]="dmg_addition_blue_add",
["num"]=5000,
["ratio"]=10000,
["round"]=1
}
},
["obj"]=1
},
[3400222]={ [3400222]={
["position"]=3, ["position"]=4,
["buff_condition"]={
{
{
["type"]="state",
["attr"]="lethargy",
["op"]=">",
["v"]=0,
["side"]=2
}
}
},
["effect_type"]=2, ["effect_type"]=2,
["trigger"]=5, ["trigger"]=5,
["effect"]={ ["effect"]={
{ {
["type"]="corrupt", ["type"]="imprison",
["num"]=5000, ["num"]=0,
["ratio"]=1000, ["ratio"]=10000,
["round"]=2 ["round"]=2
} }
}, },
["obj"]=2 ["obj"]=2
}, },
[3400223]={ [3400223]={
["position"]=3, ["energy"]=8,
["effect_type"]=2, ["link"]=1,
["trigger"]=5, ["position"]=4,
["method"]=2,
["skill_type"]=4,
["boardrange"]={
},
["battle_icon"]="19",
["effect_type"]=1,
["trigger"]=1,
["effect"]={ ["effect"]={
{ {
["type"]="corrupt", ["type"]="hurt_blue",
["num"]=5000, ["num"]=40000,
["ratio"]=1000, ["ratio"]=10000,
["round"]=0
},
{
["type"]="lethargy",
["num"]=0,
["ratio"]=5000,
["round"]=2 ["round"]=2
} }
}, },
["obj"]=2 ["obj"]=2,
["skill_position"]={
2,
0
},
["shake_time"]=200,
["shake_type"]=5,
["sound_hit"]={
4300120
},
["name_act"]="skill01",
["fx_target"]=300034,
["bullet_time"]={
633,
3000,
400
}
}, },
[4200110]={ [4200110]={
["position"]=4, ["position"]=4,
@ -4976,9 +4990,8 @@ local skill = {
}, },
["shake_time"]=200, ["shake_time"]=200,
["shake_type"]=5, ["shake_type"]=5,
["sound_hit"]={ ["sound"]=44001200,
4300120 ["sound_delay"]=0,
},
["name_act"]="skill01", ["name_act"]="skill01",
["fx_target"]=300034, ["fx_target"]=300034,
["bullet_time"]={ ["bullet_time"]={
@ -5047,12 +5060,12 @@ local skill = {
["obj"]=2 ["obj"]=2
}, },
[4400210]={ [4400210]={
["position"]=4, ["position"]=3,
["effect_type"]=1, ["effect_type"]=1,
["trigger"]=1, ["trigger"]=1,
["effect"]={ ["effect"]={
{ {
["type"]="hurt_blue", ["type"]="hurt_green",
["num"]=10000, ["num"]=10000,
["ratio"]=10000, ["ratio"]=10000,
["round"]=0 ["round"]=0
@ -5060,8 +5073,8 @@ local skill = {
}, },
["obj"]=2, ["obj"]=2,
["skill_position"]={ ["skill_position"]={
2, 1,
0 140
}, },
["shake_time"]=100, ["shake_time"]=100,
["shake_type"]=1, ["shake_type"]=1,
@ -5069,15 +5082,15 @@ local skill = {
1000001 1000001
}, },
["name_act"]="attack01", ["name_act"]="attack01",
["fx_self"]=300033 ["fx_self"]=300091
}, },
[4400211]={ [4400211]={
["position"]=4, ["position"]=3,
["effect_type"]=1, ["effect_type"]=1,
["trigger"]=1, ["trigger"]=1,
["effect"]={ ["effect"]={
{ {
["type"]="hurt_blue", ["type"]="hurt_green",
["num"]=10000, ["num"]=10000,
["ratio"]=10000, ["ratio"]=10000,
["round"]=0 ["round"]=0
@ -5085,8 +5098,8 @@ local skill = {
}, },
["obj"]=2, ["obj"]=2,
["skill_position"]={ ["skill_position"]={
2, 1,
0 140
}, },
["shake_time"]=100, ["shake_time"]=100,
["shake_type"]=1, ["shake_type"]=1,
@ -5094,15 +5107,15 @@ local skill = {
1000002 1000002
}, },
["name_act"]="attack02", ["name_act"]="attack02",
["fx_self"]=300033 ["fx_self"]=300091
}, },
[4400212]={ [4400212]={
["position"]=4, ["position"]=3,
["effect_type"]=1, ["effect_type"]=1,
["trigger"]=1, ["trigger"]=1,
["effect"]={ ["effect"]={
{ {
["type"]="hurt_blue", ["type"]="hurt_green",
["num"]=10000, ["num"]=10000,
["ratio"]=10000, ["ratio"]=10000,
["round"]=0 ["round"]=0
@ -5110,8 +5123,8 @@ local skill = {
}, },
["obj"]=2, ["obj"]=2,
["skill_position"]={ ["skill_position"]={
2, 1,
0 140
}, },
["shake_time"]=100, ["shake_time"]=100,
["shake_type"]=1, ["shake_type"]=1,
@ -5119,15 +5132,15 @@ local skill = {
1000003 1000003
}, },
["name_act"]="attack03", ["name_act"]="attack03",
["fx_self"]=300093 ["fx_self"]=300091
}, },
[4400213]={ [4400213]={
["position"]=4, ["position"]=3,
["effect_type"]=1, ["effect_type"]=1,
["trigger"]=1, ["trigger"]=1,
["effect"]={ ["effect"]={
{ {
["type"]="hurt_blue", ["type"]="hurt_green",
["num"]=10000, ["num"]=10000,
["ratio"]=10000, ["ratio"]=10000,
["round"]=0 ["round"]=0
@ -5135,8 +5148,8 @@ local skill = {
}, },
["obj"]=2, ["obj"]=2,
["skill_position"]={ ["skill_position"]={
2, 1,
0 140
}, },
["shake_time"]=100, ["shake_time"]=100,
["shake_type"]=1, ["shake_type"]=1,
@ -5144,145 +5157,127 @@ local skill = {
1000004 1000004
}, },
["name_act"]="attack04", ["name_act"]="attack04",
["fx_self"]=300094 ["fx_self"]=300091
}, },
[4400220]={ [4400220]={
["energy"]=10, ["energy"]=10,
["link"]=1, ["link"]=1,
["position"]=4, ["position"]=3,
["method"]=2, ["method"]=1,
["skill_type"]=4, ["skill_type"]=0,
["boardrange"]={ ["battle_icon"]="18",
},
["battle_icon"]="19",
["effect_type"]=1, ["effect_type"]=1,
["trigger"]=1, ["trigger"]=1,
["effect"]={ ["effect"]={
{ {
["type"]="hurt_blue", ["type"]="hurt_green",
["num"]=40000, ["num"]=40000,
["ratio"]=10000, ["ratio"]=10000,
["round"]=0 ["round"]=0
}, },
{ {
["type"]="lethargy", ["type"]="curse",
["num"]=0, ["num"]=2500,
["ratio"]=5000,
["round"]=2
}
},
["obj"]=2,
["skill_position"]={
2,
0
},
["shake_time"]=200,
["shake_type"]=5,
["sound_hit"]={
4300120
},
["name_act"]="skill01",
["fx_target"]=300034,
["bullet_time"]={
633,
3000,
400
}
},
[4400221]={
["position"]=4,
["buff_condition"]={
{
{
["type"]="state",
["attr"]="weaken",
["op"]=">",
["v"]=0,
["side"]=2
}
}
},
["effect_type"]=2,
["trigger"]=7,
["effect"]={
{
["type"]="dmg_addition_blue_add",
["num"]=5000,
["ratio"]=10000, ["ratio"]=10000,
["round"]=1 ["round"]=1
} }
}, },
["obj"]=1 ["obj"]=2,
["skill_position"]={
1,
140
},
["shake_time"]=200,
["shake_type"]=6,
["sound_hit"]={
3400120
},
["name_act"]="skill01",
["fx_self"]=300092,
["bullet_time"]={
1600,
3000,
200
}
},
[4400221]={
["energy"]=10,
["link"]=1,
["position"]=3,
["method"]=2,
["skill_type"]=4,
["boardrange"]={
{
["type"]=1,
["range"]=2
},
{
["type"]=2,
["range"]=2
}
},
["battle_icon"]="18",
["effect_type"]=1,
["trigger"]=1,
["effect"]={
{
["type"]="hurt_green",
["num"]=40000,
["ratio"]=10000,
["round"]=0
},
{
["type"]="curse",
["num"]=2500,
["ratio"]=10000,
["round"]=1
}
},
["obj"]=2,
["skill_position"]={
1,
140
},
["shake_time"]=200,
["shake_type"]=6,
["sound_hit"]={
3400120
},
["name_act"]="skill01",
["fx_self"]=300092,
["bullet_time"]={
1600,
3000,
200
}
}, },
[4400222]={ [4400222]={
["position"]=4, ["position"]=3,
["buff_condition"]={
{
{
["type"]="state",
["attr"]="lethargy",
["op"]=">",
["v"]=0,
["side"]=2
}
}
},
["effect_type"]=2, ["effect_type"]=2,
["trigger"]=5, ["trigger"]=5,
["effect"]={ ["effect"]={
{ {
["type"]="imprison", ["type"]="corrupt",
["num"]=0, ["num"]=5000,
["ratio"]=10000, ["ratio"]=1000,
["round"]=2 ["round"]=2
} }
}, },
["obj"]=2 ["obj"]=2
}, },
[4400223]={ [4400223]={
["energy"]=8, ["position"]=3,
["link"]=1, ["effect_type"]=2,
["position"]=4, ["trigger"]=5,
["method"]=2,
["skill_type"]=4,
["boardrange"]={
},
["battle_icon"]="19",
["effect_type"]=1,
["trigger"]=1,
["effect"]={ ["effect"]={
{ {
["type"]="hurt_blue", ["type"]="corrupt",
["num"]=40000, ["num"]=5000,
["ratio"]=10000, ["ratio"]=1000,
["round"]=0
},
{
["type"]="lethargy",
["num"]=0,
["ratio"]=5000,
["round"]=2 ["round"]=2
} }
}, },
["obj"]=2, ["obj"]=2
["skill_position"]={
2,
0
},
["shake_time"]=200,
["shake_type"]=5,
["sound_hit"]={
4300120
},
["name_act"]="skill01",
["fx_target"]=300034,
["bullet_time"]={
633,
3000,
400
}
}, },
[5200110]={ [5200110]={
["position"]=5, ["position"]=5,

View File

@ -2482,67 +2482,96 @@ local skill_rogue = {
["weight"]=100000, ["weight"]=100000,
["qlt"]=4, ["qlt"]=4,
["type"]=6, ["type"]=6,
["skill_position"]=3, ["skill_position"]=4,
["icon"]="188" ["icon"]="189"
}, },
[3400201]={ [3400201]={
["limit_times"]=1, ["limit_times"]=1,
["weight"]=3000, ["weight"]=3000,
["qlt"]=3, ["qlt"]=3,
["type"]=1, ["type"]=2,
["parameter"]={ ["skill_position"]=4,
3400221 ["boardrange"]={
{
["type"]=5,
["range"]=1
}, },
["skill_position"]=3, {
["icon"]="150" ["type"]=6,
["range"]=1
},
{
["type"]=7,
["range"]=1
},
{
["type"]=8,
["range"]=1
}
},
["icon"]="157"
}, },
[3400202]={ [3400202]={
["limit_times"]=1, ["limit_times"]=1,
["weight"]=3000, ["weight"]=3000,
["qlt"]=3, ["qlt"]=3,
["type"]=3, ["type"]=12,
["skill_position"]=3, ["skill_position"]=4,
["effect"]={ ["effect"]={
{ {
["type"]="atkp", ["type"]="add_skill",
["num"]=5000, ["num"]=3400221,
["ratio"]=10000, ["ratio"]=10000,
["round"]=1 ["round"]=1
} }
}, },
["obj"]=1, ["obj"]=6,
["icon"]="151" ["icon"]="158"
}, },
[3400203]={ [3400203]={
["unlock"]=4400201,
["limit_times"]=1, ["limit_times"]=1,
["weight"]=3000, ["weight"]=3000,
["qlt"]=4, ["qlt"]=3,
["type"]=8, ["type"]=2,
["parameter"]={ ["skill_position"]=4,
2, ["boardrange"]={
1 {
["type"]=5,
["range"]=1
}, },
["skill_position"]=3, {
["icon"]="152" ["type"]=6,
["range"]=1
},
{
["type"]=7,
["range"]=1
},
{
["type"]=8,
["range"]=1
}
},
["icon"]="159"
}, },
[3400204]={ [3400204]={
["limit_times"]=1, ["limit_times"]=1,
["weight"]=3000, ["weight"]=3000,
["qlt"]=4, ["qlt"]=4,
["type"]=7, ["type"]=16,
["parameter"]={ ["parameter"]={
2, 2,
2500 5000
}, },
["skill_position"]=3, ["skill_position"]=4,
["icon"]="153" ["icon"]="160"
}, },
[3400205]={ [3400205]={
["limit_times"]=1, ["limit_times"]=1,
["weight"]=3000, ["weight"]=3000,
["qlt"]=4, ["qlt"]=4,
["type"]=9, ["type"]=9,
["skill_position"]=3,
["effect"]={ ["effect"]={
{ {
["type"]="add_skill", ["type"]="add_skill",
@ -2551,46 +2580,36 @@ local skill_rogue = {
["round"]=999 ["round"]=999
} }
}, },
["obj"]=5, ["obj"]=6,
["icon"]="154" ["icon"]="161"
}, },
[3400206]={ [3400206]={
["unlock"]=3400201,
["limit_times"]=1,
["weight"]=3000,
["qlt"]=3,
["type"]=2,
["skill_position"]=3,
["boardrange"]={
{
["type"]=3,
["range"]=2
},
{
["type"]=4,
["range"]=2
}
},
["icon"]="155"
},
[3400207]={
["unlock"]=3400205,
["cover_unlock"]=3400205,
["limit_times"]=1, ["limit_times"]=1,
["weight"]=3000, ["weight"]=3000,
["qlt"]=3, ["qlt"]=3,
["type"]=9, ["type"]=9,
["skill_position"]=3, ["skill_position"]=4,
["effect"]={ ["effect"]={
{ {
["type"]="add_skill", ["type"]="atkp_blue_add",
["num"]=3400223, ["num"]=1500,
["ratio"]=10000, ["ratio"]=10000,
["round"]=999 ["round"]=999
} }
}, },
["obj"]=5, ["obj"]=6,
["icon"]="156" ["icon"]="162"
},
[3400207]={
["limit_times"]=1,
["weight"]=3000,
["qlt"]=4,
["type"]=1,
["parameter"]={
3400223
},
["skill_position"]=4,
["icon"]="163"
}, },
[4200100]={ [4200100]={
["limit_times"]=1, ["limit_times"]=1,
@ -3076,96 +3095,67 @@ local skill_rogue = {
["weight"]=100000, ["weight"]=100000,
["qlt"]=4, ["qlt"]=4,
["type"]=6, ["type"]=6,
["skill_position"]=4, ["skill_position"]=3,
["icon"]="189" ["icon"]="188"
}, },
[4400201]={ [4400201]={
["limit_times"]=1, ["limit_times"]=1,
["weight"]=3000, ["weight"]=3000,
["qlt"]=3, ["qlt"]=3,
["type"]=2, ["type"]=1,
["skill_position"]=4, ["parameter"]={
["boardrange"]={ 4400221
{
["type"]=5,
["range"]=1
}, },
{ ["skill_position"]=3,
["type"]=6, ["icon"]="150"
["range"]=1
},
{
["type"]=7,
["range"]=1
},
{
["type"]=8,
["range"]=1
}
},
["icon"]="157"
}, },
[4400202]={ [4400202]={
["limit_times"]=1, ["limit_times"]=1,
["weight"]=3000, ["weight"]=3000,
["qlt"]=3, ["qlt"]=3,
["type"]=12, ["type"]=3,
["skill_position"]=4, ["skill_position"]=3,
["effect"]={ ["effect"]={
{ {
["type"]="add_skill", ["type"]="atkp",
["num"]=4400221, ["num"]=5000,
["ratio"]=10000, ["ratio"]=10000,
["round"]=1 ["round"]=1
} }
}, },
["obj"]=6, ["obj"]=1,
["icon"]="158" ["icon"]="151"
}, },
[4400203]={ [4400203]={
["unlock"]=4400201,
["limit_times"]=1, ["limit_times"]=1,
["weight"]=3000, ["weight"]=3000,
["qlt"]=3, ["qlt"]=4,
["type"]=2,
["skill_position"]=4,
["boardrange"]={
{
["type"]=5,
["range"]=1
},
{
["type"]=6,
["range"]=1
},
{
["type"]=7,
["range"]=1
},
{
["type"]=8, ["type"]=8,
["range"]=1 ["parameter"]={
} 2,
1
}, },
["icon"]="159" ["skill_position"]=3,
["icon"]="152"
}, },
[4400204]={ [4400204]={
["limit_times"]=1, ["limit_times"]=1,
["weight"]=3000, ["weight"]=3000,
["qlt"]=4, ["qlt"]=4,
["type"]=16, ["type"]=7,
["parameter"]={ ["parameter"]={
2, 2,
5000 2500
}, },
["skill_position"]=4, ["skill_position"]=3,
["icon"]="160" ["icon"]="153"
}, },
[4400205]={ [4400205]={
["limit_times"]=1, ["limit_times"]=1,
["weight"]=3000, ["weight"]=3000,
["qlt"]=4, ["qlt"]=4,
["type"]=9, ["type"]=9,
["skill_position"]=3,
["effect"]={ ["effect"]={
{ {
["type"]="add_skill", ["type"]="add_skill",
@ -3174,36 +3164,46 @@ local skill_rogue = {
["round"]=999 ["round"]=999
} }
}, },
["obj"]=6, ["obj"]=5,
["icon"]="161" ["icon"]="154"
}, },
[4400206]={ [4400206]={
["unlock"]=3400201,
["limit_times"]=1,
["weight"]=3000,
["qlt"]=3,
["type"]=2,
["skill_position"]=3,
["boardrange"]={
{
["type"]=3,
["range"]=2
},
{
["type"]=4,
["range"]=2
}
},
["icon"]="155"
},
[4400207]={
["unlock"]=3400205,
["cover_unlock"]=3400205,
["limit_times"]=1, ["limit_times"]=1,
["weight"]=3000, ["weight"]=3000,
["qlt"]=3, ["qlt"]=3,
["type"]=9, ["type"]=9,
["skill_position"]=4, ["skill_position"]=3,
["effect"]={ ["effect"]={
{ {
["type"]="atkp_blue_add", ["type"]="add_skill",
["num"]=1500, ["num"]=4400223,
["ratio"]=10000, ["ratio"]=10000,
["round"]=999 ["round"]=999
} }
}, },
["obj"]=6, ["obj"]=5,
["icon"]="162" ["icon"]="156"
},
[4400207]={
["limit_times"]=1,
["weight"]=3000,
["qlt"]=4,
["type"]=1,
["parameter"]={
4400223
},
["skill_position"]=4,
["icon"]="163"
}, },
[5200100]={ [5200100]={
["limit_times"]=1, ["limit_times"]=1,

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 7ab9ad8c53741f74db70394c459f5ddc guid: e550b6c1888c8c54a983504aadc97dd9
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 854572b70505d6f49b8709e3414a100f guid: 7ebdcf5eea9b5744b93b6a66a8a3a4ac
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -54,7 +54,7 @@ local hero = {
["desc"]="这一箭下去你可能会死。" ["desc"]="这一箭下去你可能会死。"
}, },
[34002]={ [34002]={
["name"]="艳后" ["name"]="梦魔"
}, },
[42001]={ [42001]={
["name"]="冰心", ["name"]="冰心",
@ -73,7 +73,7 @@ local hero = {
["desc"]="有人持剑起舞,寒冰妖姬用剑让敌人起舞。" ["desc"]="有人持剑起舞,寒冰妖姬用剑让敌人起舞。"
}, },
[44002]={ [44002]={
["name"]="梦魔" ["name"]="艳后"
}, },
[52001]={ [52001]={
["name"]="忍者伦", ["name"]="忍者伦",

View File

@ -136,8 +136,8 @@ local item = {
["desc"]="木兰碎片,凑齐可激活或升级。" ["desc"]="木兰碎片,凑齐可激活或升级。"
}, },
[34002]={ [34002]={
["name"]="艳后碎片", ["name"]="梦魔碎片",
["desc"]="艳后碎片,凑齐可激活或升级。" ["desc"]="梦魔碎片,凑齐可激活或升级。"
}, },
[42001]={ [42001]={
["name"]="冰心碎片", ["name"]="冰心碎片",
@ -156,8 +156,8 @@ local item = {
["desc"]="寒冰妖姬碎片,凑齐可激活或升级。" ["desc"]="寒冰妖姬碎片,凑齐可激活或升级。"
}, },
[44002]={ [44002]={
["name"]="梦魔碎片", ["name"]="艳后碎片",
["desc"]="梦魔碎片,凑齐可激活或升级。" ["desc"]="艳后碎片,凑齐可激活或升级。"
}, },
[52001]={ [52001]={
["name"]="忍者伦碎片", ["name"]="忍者伦碎片",

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: b80d583de1bab0249b1c2ea7e2b39f19 guid: 9dc40103a0748db44a9f1b68cf0aa638
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 6646cef1053957f498996449942e317b guid: 45e62fba12275294c9ca0781541e898f
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 9569dbcc21310dd4892f99b934dacdf1 guid: 2efd30882537bcf4d85d41874b20a5d1
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: c4d871056db7f784c8c8346a2a757b6a guid: feee83113a5ebf648b61119b6ea67052
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 9e880ced67030724b8e10531e93925aa guid: 1b7f9b5c90bd55244adec4028f50f7ae
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: c17fae36e98d089418b7172a74c0f72b guid: 91626068ba5bf40478d4c5f990dd336c
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 3ebd55d0b39273a489c43c02889dcabd guid: be940f5ccbf143143bcb35878aa85b20
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: d0df14a4c7def2b4dba7e30aa219d179 guid: 9b782692fe3bc8046acedd1c14447f80
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 56e74edf74e085649a1d58b52050bf83 guid: 4e211405289be9d4fb6973d27e4c0454
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 713a1bacc42589f49a5309bc4a7f064a guid: e19cdea5919e19a4b8bb6538c8b11347
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: b4194298591232d469bee8927cca98ee guid: 845ceb9424b01974aa158e74309a0190
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 81ee6a8c01c550649bd38da09fcb4c99 guid: 76981286f85df2347a2124c248246121
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: a3046085d8ac78c4ea564cd0cae61a52 guid: 0b2a3b866e0802941977489faf1a38fb
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: c09ce43658ef5e74a80b3dfa22e1f1b5 guid: b9d9a6866f4d1ab4887e52bd0917cdc2
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: b15dbe64e966569489a7836e7aff9685 guid: ff8547e7031a5194d8b1d50552114e6e
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 50113a7df3a762746877843f9da2b217 guid: b6be5004e7718fd47bff83daa57c7d73
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: bdd97d866a3ead549bf1326f93ec6162 guid: f47e3fc3edf30dc49b517e1f6d62d4f2
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 95494c882fd4db940b204e0f41b55b35 guid: b6035fe28448bba4d99008ec9615b2d8
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: ab538b46345987a4aa0c2294067ba315 guid: 2e1f0c926cef57f4986fb3a41d1496d9
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 96311fba66b34c94dbbf1927048d18b9 guid: 386cfeaa1310f294887e8b821f909933
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 1c2c4275bc1a0294aa37b9908a8fdb4d guid: b7c423d2d55031d48bb7b8fecf330920
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -181,6 +181,7 @@ GConst.ATLAS_PATH = {
MAIN = "assets/arts/atlas/ui/main.asset", MAIN = "assets/arts/atlas/ui/main.asset",
BATTLE = "assets/arts/atlas/ui/battle.asset", BATTLE = "assets/arts/atlas/ui/battle.asset",
DAILY_CHALLENGE = "assets/arts/atlas/ui/daily_challenge.asset", DAILY_CHALLENGE = "assets/arts/atlas/ui/daily_challenge.asset",
DUNGEON = "assets/arts/atlas/ui/dungeon.asset",
ICON_ITEM = "assets/arts/atlas/icon/item.asset", ICON_ITEM = "assets/arts/atlas/icon/item.asset",
UI_LOGIN = "assets/arts/atlas/ui/login.asset", UI_LOGIN = "assets/arts/atlas/ui/login.asset",
ICON_SKILL = "assets/arts/atlas/icon/skill.asset", ICON_SKILL = "assets/arts/atlas/icon/skill.asset",

View File

@ -1684,15 +1684,6 @@ function GFunc.recycleTempMap()
end end
end end
-- 获取table长度
function GFunc.getTableLength(table)
local length = 0
for k, v in pairs(table) do
length = length + 1
end
return length
end
--[[ --[[
tabLe只速 Lua error tabLe只速 Lua error
locaL readOnlyCfg = GFunc.readOnlyTab(cfg) return readOnlyCfg locaL readOnlyCfg = GFunc.readOnlyTab(cfg) return readOnlyCfg

View File

@ -77,6 +77,8 @@ BattleConst.TIME_SCALE = {
BattleConst.BATTLE_TYPE = { BattleConst.BATTLE_TYPE = {
STAGE = "1", STAGE = "1",
DAILY_CHALLENGE = "2", DAILY_CHALLENGE = "2",
DUNGEON_GOLD = "3",
DUNGEON_SHARDS = "4",
} }
BattleConst.TYPEOF_LUA_COMP = { BattleConst.TYPEOF_LUA_COMP = {

View File

@ -9,6 +9,8 @@ local BATTLE_CONTROLLER_BASE = "app/module/battle/controller/battle_controller"
local BATTLE_CONTROLLER = { local BATTLE_CONTROLLER = {
[BattleConst.BATTLE_TYPE.STAGE] = "app/module/battle/controller/battle_controller_stage", [BattleConst.BATTLE_TYPE.STAGE] = "app/module/battle/controller/battle_controller_stage",
[BattleConst.BATTLE_TYPE.DAILY_CHALLENGE] = "app/module/battle/controller/battle_controller_daily_challenge", [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",
} }
function BattleManager:showPauseUI(battleType) function BattleManager:showPauseUI(battleType)

View File

@ -19,24 +19,72 @@ local BUFF_NAME_TO_ATTR = BattleConst.BUFF_NAME_TO_ATTR
local GRID_BREAK_CONDITION = BattleConst.GRID_BREAK_CONDITION local GRID_BREAK_CONDITION = BattleConst.GRID_BREAK_CONDITION
-- *************各个子模块的战斗需要重写的方法 START************* -- *************各个子模块的战斗需要重写的方法 START*************
function BattleController:getBoardConfig()
return {}
end
function BattleController:getChapterConfig()
return {}
end
function BattleController:getChapterId() function BattleController:getChapterId()
return 0 return 0
end end
function BattleController:getInitBoard() function BattleController:getInitBoard()
return {} if not self.boradList then
self.boradList = {}
self.fixedRandomGrid = {}
self.mysteryBoxIndexMap = {}
local config = self:getChapterConfig()[self.chapterId]
local boardCfg = self:getBoardConfig()
for _, boardId in ipairs(config.board) do
local cfg = boardCfg[boardId]
if cfg then
table.insert(self.boradList, {board = GFunc.getTable(cfg.board), mysteryBoard = GFunc.getTable(cfg.mystery_box_board)})
table.insert(self.fixedRandomGrid, GFunc.getTable(cfg.control_element))
end
end
end
return self.boradList, self.fixedRandomGrid, self.mysteryBoxIndexMap
end end
function BattleController:getNotInvolvedSkills() function BattleController:getNotInvolvedSkills()
return {} if not self.notInvolvedSkills then
self.notInvolvedSkills = {}
local config = self:getChapterConfig()[self.chapterId]
if config.not_involved_skill then
for _, skillId in ipairs(config.not_involved_skill) do
self.notInvolvedSkills[skillId] = true
end
end
end
return self.notInvolvedSkills
end end
function BattleController:getFixedRogueSkill() function BattleController:getFixedRogueSkill()
return {} if not self.fixedRogueSkill then
self.fixedRogueSkill = {}
end
return self.fixedRogueSkill
end end
function BattleController:getSealElementType() function BattleController:getSealElementType()
return {} if not self.sealElementType then
self.sealElementType = {}
local config = self:getChapterConfig()[self.chapterId]
if config.seal_element then
for _, elementType in ipairs(config.seal_element) do
self.sealElementType[elementType] = true
end
end
end
return self.sealElementType
end end
function BattleController:getBuffs() function BattleController:getBuffs()
@ -112,7 +160,11 @@ end
-- 一共有多少波 -- 一共有多少波
function BattleController:getMaxWave() function BattleController:getMaxWave()
return 1 local config = self:getChapterConfig()[self.chapterId]
if not config or not config.monster then
return 0
end
return #config.monster
end end
function BattleController:getMinEliminationCount() function BattleController:getMinEliminationCount()
@ -123,11 +175,82 @@ function BattleController:getMinEliminationCount()
end end
function BattleController:initDefUnits(callback) function BattleController:initDefUnits(callback)
local config = self:getChapterConfig()[self.chapterId]
self.battleUI:loadBg(config.scene)
local unitEntity = DataManager.BattleData:addMonster(config.monster[1])
local modelId = unitEntity:getModelId()
BattleHelper:loadBattleHeroModel(modelId, self.battleUI:getBattleNode(), function(spineObject)
local monsterComp = spineObject:addLuaComponent(GConst.BattleConst.TYPEOF_LUA_COMP.BATTLE_MONSTER_COMPONENT)
monsterComp:initWithEntity(modelId, unitEntity, self)
self.defTeam:addUnit(monsterComp, true)
self.battleUI:refreshDefHp(unitEntity:getHp(), unitEntity:getHpPercent())
callback() callback()
end)
end
function BattleController:generateNextMonster()
local config = self:getChapterConfig()[self.chapterId]
local monsterId = config.monster[self.waveIndex + 1]
if monsterId == nil then
return self:enterNextWave()
end
local isBoss = self.defTeam:getIsBoss()
local unitEntity = DataManager.BattleData:addMonster(monsterId, true)
local modelId = unitEntity:getModelId()
BattleHelper:loadBattleHeroModel(modelId, self.battleUI:getBattleNode(), function(spineObject)
self.defTeam:removeAllUnits()
local monsterComp = spineObject:addLuaComponent(GConst.BattleConst.TYPEOF_LUA_COMP.BATTLE_MONSTER_COMPONENT)
monsterComp:initWithEntity(modelId, unitEntity, self)
self.defTeam:addUnit(monsterComp, true)
self:handleBuffs(GConst.BattleConst.SIDE_DEF)
self.battleUI:refreshDefHp(unitEntity:getHp(), unitEntity:getHpPercent())
local bornTime = monsterComp:getAnimationDuration(GConst.BattleConst.SPINE_ANIMATION_NAME.BORN)
if isBoss then -- 如果是boss就跑过去
local count = 0
local function onFinish()
count = count + 1
if count == 2 then
self.atkTeam:stopRunAction()
self:onRoundEnd(true)
end
end
self.atkTeam:playRunAction()
self.atkTeam:recoverHpOnWaveOver(onFinish)
isBoss = self.defTeam:getIsBoss()
if isBoss then
local monsterInfo = ConfigManager:getConfig("monster")[monsterId]
self.battleUI:showBossEnterAni(bornTime, ModuleManager.HeroManager:getMonsterName(monsterInfo.monster_base), monsterComp, function()
monsterComp:playEnterBattlefield(true, onFinish)
end)
else
monsterComp:playEnterBattlefield(true, onFinish)
end
else
local count = 0
local function onFinish()
count = count + 1
if count == 2 then
self:onRoundEnd(true)
end
end
self.atkTeam:recoverHpOnWaveOver(onFinish)
isBoss = self.defTeam:getIsBoss()
if isBoss then
local monsterInfo = ConfigManager:getConfig("monster")[monsterId]
self.battleUI:showBossEnterAni(bornTime, ModuleManager.HeroManager:getMonsterName(monsterInfo.monster_base), monsterComp, function()
monsterComp:playEnterBattlefield(false, onFinish)
end)
else
monsterComp:playEnterBattlefield(false, onFinish)
end
end
end)
end end
function BattleController:findNextDefUnit() function BattleController:findNextDefUnit()
self:enterRoundEnd() self:generateNextMonster()
end end
function BattleController:onDefDead(callback) function BattleController:onDefDead(callback)
@ -239,12 +362,27 @@ end
---- 障碍格子图片 ---- 障碍格子图片
function BattleController:getBlockIcon() function BattleController:getBlockIcon()
local chapterInfo = self:getChapterConfig()[self.chapterId]
if not chapterInfo then
return "battle_hinder_4" return "battle_hinder_4"
end end
return chapterInfo.block_icon
end
function BattleController:getChessBoardBgName() function BattleController:getChessBoardBgName()
local chapterInfo = self:getChapterConfig()[self.chapterId]
if not chapterInfo then
return "chessboard_1" return "chessboard_1"
end end
return chapterInfo.chess_board
end
function BattleController:refreshWave()
if not self.battleUI then
return
end
self.battleUI:refreshWave(self.waveIndex)
end
-- *************各个子模块的战斗需要重写的方法 END************* -- *************各个子模块的战斗需要重写的方法 END*************
@ -528,9 +666,7 @@ function BattleController:enterNextWave()
end end
self.waveIndex = self.waveIndex + 1 self.waveIndex = self.waveIndex + 1
if self.battleUI then self:refreshWave(self.waveIndex)
self.battleUI:refreshWave(self.waveIndex)
end
if self.waveIndex == 1 then -- 第一波 if self.waveIndex == 1 then -- 第一波
self.needWaitingBoardOver = true self.needWaitingBoardOver = true
self:generateBoard(true) self:generateBoard(true)

View File

@ -1,28 +1,20 @@
local BattleHelper = require "app/module/battle/helper/battle_helper" local BattleHelper = require "app/module/battle/helper/battle_helper"
local BattleController = require "app/module/battle/controller/battle_controller" local BattleController = require "app/module/battle/controller/battle_controller"
local BattleControllerDailyChallenge = class("BattleControllerDailyChallenge", BattleController) local BattleControllerDailyChallenge = class("BattleControllerDailyChallenge", BattleController)
local CHAPTER_CFG = ConfigManager:getConfig("chapter_daily_challenge")
local BattleBuffEntity = require "app/userdata/battle/skill/battle_buff_entity" local BattleBuffEntity = require "app/userdata/battle/skill/battle_buff_entity"
function BattleControllerDailyChallenge:getBoardConfig()
return ConfigManager:getConfig("chapter_board_daily_challenge")
end
function BattleControllerDailyChallenge:getChapterConfig()
return ConfigManager:getConfig("chapter_daily_challenge")
end
function BattleControllerDailyChallenge:getChapterId() function BattleControllerDailyChallenge:getChapterId()
return DataManager.DailyChallengeData:getChapterDailyId() return DataManager.DailyChallengeData:getChapterDailyId()
end end
function BattleControllerDailyChallenge:getMaxWave()
if CHAPTER_CFG[self.chapterId] then
return #CHAPTER_CFG[self.chapterId].monster
end
return 0
end
function BattleControllerDailyChallenge:getChessBoardBgName()
local chapterInfo = CHAPTER_CFG[self.chapterId]
if not chapterInfo then
return "chessboard_1"
end
return chapterInfo.chess_board
end
function BattleControllerDailyChallenge:getBuffs() function BattleControllerDailyChallenge:getBuffs()
if not self.initBuffs then if not self.initBuffs then
self.initBuffs = {} self.initBuffs = {}
@ -51,8 +43,8 @@ function BattleControllerDailyChallenge:onLoadComplete(...)
end end
function BattleControllerDailyChallenge:initOther() function BattleControllerDailyChallenge:initOther()
local ChapterId = DataManager.DailyChallengeData:getFixedChapterId() local chapterId = DataManager.DailyChallengeData:getFixedChapterId()
local cfg = ConfigManager:getConfig("chapter")[ChapterId] local cfg = ConfigManager:getConfig("chapter")[chapterId]
self.monsterAtkAddition = 0 self.monsterAtkAddition = 0
self.monsterHpAddition = 0 self.monsterHpAddition = 0
if cfg and cfg.daily_challenge_difficulty then if cfg and cfg.daily_challenge_difficulty then
@ -71,89 +63,14 @@ function BattleControllerDailyChallenge:getMonsterHpAddition()
return self.monsterHpAddition return self.monsterHpAddition
end end
function BattleControllerDailyChallenge:initDefUnits(callback)
local config = CHAPTER_CFG[self.chapterId]
self.battleUI:loadBg(config.scene)
local unitEntity = DataManager.BattleData:addMonster(config.monster[1], nil, self)
local modelId = unitEntity:getModelId()
BattleHelper:loadBattleHeroModel(modelId, self.battleUI:getBattleNode(), function(spineObject)
local monsterComp = spineObject:addLuaComponent(GConst.BattleConst.TYPEOF_LUA_COMP.BATTLE_MONSTER_COMPONENT)
monsterComp:initWithEntity(modelId, unitEntity, self)
self.defTeam:addUnit(monsterComp, true)
self.battleUI:refreshDefHp(unitEntity:getHp(), unitEntity:getHpPercent())
callback()
end)
end
function BattleControllerDailyChallenge:_stageGenerateNextMonster()
local config = CHAPTER_CFG[self.chapterId]
local monsterId = config.monster[self.waveIndex + 1]
if monsterId == nil then
return self:enterNextWave()
end
local isBoss = self.defTeam:getIsBoss()
local unitEntity = DataManager.BattleData:addMonster(monsterId, true, self)
local modelId = unitEntity:getModelId()
BattleHelper:loadBattleHeroModel(modelId, self.battleUI:getBattleNode(), function(spineObject)
self.defTeam:removeAllUnits()
local monsterComp = spineObject:addLuaComponent(GConst.BattleConst.TYPEOF_LUA_COMP.BATTLE_MONSTER_COMPONENT)
monsterComp:initWithEntity(modelId, unitEntity, self)
self.defTeam:addUnit(monsterComp, true)
self:handleBuffs(GConst.BattleConst.SIDE_DEF)
self.battleUI:refreshDefHp(unitEntity:getHp(), unitEntity:getHpPercent())
local bornTime = monsterComp:getAnimationDuration(GConst.BattleConst.SPINE_ANIMATION_NAME.BORN)
if isBoss then -- 如果是boss就跑过去
local count = 0
local function onFinish()
count = count + 1
if count == 2 then
self.atkTeam:stopRunAction()
self:onRoundEnd(true)
end
end
self.atkTeam:playRunAction()
self.atkTeam:recoverHpOnWaveOver(onFinish)
isBoss = self.defTeam:getIsBoss()
if isBoss then
local monsterInfo = ConfigManager:getConfig("monster")[monsterId]
self.battleUI:showBossEnterAni(bornTime, ModuleManager.HeroManager:getMonsterName(monsterInfo.monster_base), monsterComp, function()
monsterComp:playEnterBattlefield(true, onFinish)
end)
else
monsterComp:playEnterBattlefield(true, onFinish)
end
else
local count = 0
local function onFinish()
count = count + 1
if count == 2 then
self:onRoundEnd(true)
end
end
self.atkTeam:recoverHpOnWaveOver(onFinish)
isBoss = self.defTeam:getIsBoss()
if isBoss then
local monsterInfo = ConfigManager:getConfig("monster")[monsterId]
self.battleUI:showBossEnterAni(bornTime, ModuleManager.HeroManager:getMonsterName(monsterInfo.monster_base), monsterComp, function()
monsterComp:playEnterBattlefield(false, onFinish)
end)
else
monsterComp:playEnterBattlefield(false, onFinish)
end
end
end)
end
function BattleControllerDailyChallenge:getInitBoard() function BattleControllerDailyChallenge:getInitBoard()
if not self.boradList then if not self.boradList then
self.boradList = {} self.boradList = {}
self.fixedRandomGrid = {} self.fixedRandomGrid = {}
self.mysteryBoxIndexMap = {} self.mysteryBoxIndexMap = {}
local config = CHAPTER_CFG[self.chapterId] local config = self:getChapterConfig()[self.chapterId]
local boardCfg = ConfigManager:getConfig("chapter_board_daily_challenge") local boardCfg = self:getBoardConfig()
for _, boardId in ipairs(config.chapter_board_daily_challenge) do for _, boardId in ipairs(config.chapter_board_daily_challenge) do
local cfg = boardCfg[boardId] local cfg = boardCfg[boardId]
if cfg then if cfg then
@ -165,51 +82,6 @@ function BattleControllerDailyChallenge:getInitBoard()
return self.boradList, self.fixedRandomGrid, self.mysteryBoxIndexMap return self.boradList, self.fixedRandomGrid, self.mysteryBoxIndexMap
end end
function BattleControllerDailyChallenge:getSealElementType()
if not self.sealElementType then
self.sealElementType = {}
local config = CHAPTER_CFG[self.chapterId]
if config.seal_element then
for _, elementType in ipairs(config.seal_element) do
self.sealElementType[elementType] = true
end
end
end
return self.sealElementType
end
function BattleControllerDailyChallenge:getNotInvolvedSkills()
if not self.notInvolvedSkills then
self.notInvolvedSkills = {}
local config = CHAPTER_CFG[self.chapterId]
if config.not_involved_skill then
for _, skillId in ipairs(config.not_involved_skill) do
self.notInvolvedSkills[skillId] = true
end
end
end
return self.notInvolvedSkills
end
function BattleControllerDailyChallenge:getFixedRogueSkill()
if not self.fixedRogueSkill then
local config = CHAPTER_CFG[self.chapterId]
if config.involved_skill then
self.fixedRogueSkill = GFunc.getTable(config.involved_skill)
else
self.fixedRogueSkill = {}
end
end
return self.fixedRogueSkill
end
function BattleControllerDailyChallenge:findNextDefUnit()
self:_stageGenerateNextMonster()
end
function BattleControllerDailyChallenge:controllBattleEnd() function BattleControllerDailyChallenge:controllBattleEnd()
self.combatReport = { self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE, battleType = GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE,

View File

@ -0,0 +1,107 @@
local BattleController = require "app/module/battle/controller/battle_controller"
local BattleControllerDungeonGold = class("BattleControllerDungeonGold", BattleController)
function BattleControllerDungeonGold:getBoardConfig()
return ConfigManager:getConfig("chapter_board_dungeon_gold")
end
function BattleControllerDungeonGold:getChapterConfig()
return ConfigManager:getConfig("chapter_dungeon_gold")
end
function BattleControllerDungeonGold:getChapterId()
return DataManager.DungeonData:getCurFightChapterId()
end
function BattleControllerDungeonGold:refreshWave()
end
function BattleControllerDungeonGold:enterRoundBegin(...)
local nextWaveRound = 0
if self.dungeonGoldMaxRoundCount then
nextWaveRound = (self.waveRoundCount[self.waveIndex] or 0) + 1
if self.dungeonGoldMaxRoundCount < nextWaveRound then -- 超过最大回合, 直接结算
self.victory = false
self:postWaveOver(false)
self:battleEnd()
return
end
end
if self.battleUI then
self.battleUI:refreshWave(self.dungeonGoldMaxRoundCount - nextWaveRound + 1, GConst.ATLAS_PATH.COMMON, "common_dec_15")
end
BattleController.enterRoundBegin(self, ...)
end
-- 不同模块的战斗需要初始化的东西
function BattleControllerDungeonGold:initOther()
self.dungeonGoldMaxRoundCount = self:getChapterConfig()[self.chapterId].wave_limit or 1
if self.battleUI then
self.battleUI:refreshWave(self.dungeonGoldMaxRoundCount, GConst.ATLAS_PATH.COMMON, "common_dec_15")
end
end
function BattleControllerDungeonGold:controllBattleEnd()
local remainRound = self.dungeonGoldMaxRoundCount - (self.waveRoundCount[1] or 0)
self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD,
wave = self.waveIndex,
victory = self.victory,
remainRound = remainRound,
}
local atkReport = {}
local teamEntity = DataManager.BattleData:getAtkTeam()
local members = teamEntity:getAllMembers()
local totalDamage = 0
for k, v in pairs(members) do
local report = {
heroId = v:getId(),
dmg = v:getDamageCount(),
}
totalDamage = totalDamage + v:getDamageCount()
table.insert(atkReport, report)
end
self.combatReport.atkReport = atkReport
if not self.victory then
self.combatReport.wave = self.combatReport.wave - 1
end
local remainingHp = self.defTeam:getMainUnit().unitEntity:getHp()
ModuleManager.DungeonManager:reqEndChallengeGold(self.chapterId, self.combatReport, self.taskProgress, totalDamage, remainingHp)
end
function BattleControllerDungeonGold: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 startTimes = DataManager.DungeonData:getTotalCount(ModuleManager.MODULE_KEY.DUNGEON_GOLD, self.chapterId)
local isFirstWin = false
if DataManager.DungeonData:getPassedMaxId(ModuleManager.MODULE_KEY.DUNGEON_GOLD) < self.chapterId and self.victory then
isFirstWin = true
end
local isFianlStep = self.waveIndex >= self.maxWaveIndex
BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD, self.chapterId, self.waveIndex, duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount)
end
function BattleControllerDungeonGold:postFightStart()
local unlockMaxChapter = DataManager.DungeonData:getUnlockMaxId(ModuleManager.MODULE_KEY.DUNGEON_GOLD)
BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD, self.waveIndex, self.chapterId, unlockMaxChapter, DataManager.DungeonData:getTotalCount(ModuleManager.MODULE_KEY.DUNGEON_GOLD, self.chapterId))
end
return BattleControllerDungeonGold

View File

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

View File

@ -0,0 +1,75 @@
local BattleController = require "app/module/battle/controller/battle_controller"
local BattleControllerDungeonShards = class("BattleControllerDungeonShards", BattleController)
function BattleControllerDungeonShards:getBoardConfig()
return ConfigManager:getConfig("chapter_board_dungeon_shards")
end
function BattleControllerDungeonShards:getChapterConfig()
return ConfigManager:getConfig("chapter_dungeon_shards")
end
function BattleControllerDungeonShards:getChapterId()
return DataManager.DungeonData:getCurFightChapterId()
end
function BattleControllerDungeonShards:controllBattleEnd()
self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS,
wave = self.waveIndex,
victory = self.victory,
}
local atkReport = {}
local teamEntity = DataManager.BattleData:getAtkTeam()
local members = teamEntity:getAllMembers()
local totalDamage = 0
for k, v in pairs(members) do
local report = {
heroId = v:getId(),
dmg = v:getDamageCount(),
}
totalDamage = totalDamage + 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.DungeonManager:reqEndChallengeShards(self.chapterId, self.combatReport, self.taskProgress, totalDamage)
end
function BattleControllerDungeonShards: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 startTimes = DataManager.DungeonData:getTotalCount(ModuleManager.MODULE_KEY.DUNGEON_SHARDS, self.chapterId)
local isFirstWin = false
if DataManager.DungeonData:getPassedMaxId(ModuleManager.MODULE_KEY.DUNGEON_SHARDS) < self.chapterId and self.victory then
isFirstWin = true
end
local isFianlStep = self.waveIndex >= self.maxWaveIndex
BIReport:postFightEnd(GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS, self.chapterId, self.waveIndex, duration, totalTime, self.eliminateCount, self.eliminateTotalCount, waveEndType, deathType, startTimes, isFirstWin, isFianlStep, self.maxLinkCount)
end
function BattleControllerDungeonShards:postFightStart()
local unlockMaxChapter = DataManager.DungeonData:getUnlockMaxId(ModuleManager.MODULE_KEY.DUNGEON_SHARDS)
BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS, self.waveIndex, self.chapterId, unlockMaxChapter, DataManager.DungeonData:getTotalCount(ModuleManager.MODULE_KEY.DUNGEON_SHARDS, self.chapterId))
end
return BattleControllerDungeonShards

View File

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

View File

@ -1,120 +1,26 @@
local BattleHelper = require "app/module/battle/helper/battle_helper"
local BattleController = require "app/module/battle/controller/battle_controller" local BattleController = require "app/module/battle/controller/battle_controller"
local BattleControllerStage = class("BattleControllerStage", BattleController) local BattleControllerStage = class("BattleControllerStage", BattleController)
function BattleControllerStage:getBoardConfig()
return ConfigManager:getConfig("chapter_board")
end
function BattleControllerStage:getChapterConfig()
return ConfigManager:getConfig("chapter")
end
function BattleControllerStage:getChapterId() function BattleControllerStage:getChapterId()
return DataManager.ChapterData:getChapterId() return DataManager.ChapterData:getChapterId()
end end
function BattleControllerStage:getMaxWave()
return DataManager.ChapterData:getChapterCfgMaxWave(self.chapterId)
end
function BattleControllerStage:getBlockIcon()
local chapterInfo = ConfigManager:getConfig("chapter")[self.chapterId]
if not chapterInfo then
return "battle_hinder_4"
end
return chapterInfo.block_icon
end
function BattleControllerStage:getChessBoardBgName()
local chapterInfo = ConfigManager:getConfig("chapter")[self.chapterId]
if not chapterInfo then
return "chessboard_1"
end
return chapterInfo.chess_board
end
function BattleControllerStage:initOther()
end
function BattleControllerStage:initDefUnits(callback)
local config = ConfigManager:getConfig("chapter")[self.chapterId]
self.battleUI:loadBg(config.scene)
local unitEntity = DataManager.BattleData:addMonster(config.monster[1])
local modelId = unitEntity:getModelId()
BattleHelper:loadBattleHeroModel(modelId, self.battleUI:getBattleNode(), function(spineObject)
local monsterComp = spineObject:addLuaComponent(GConst.BattleConst.TYPEOF_LUA_COMP.BATTLE_MONSTER_COMPONENT)
monsterComp:initWithEntity(modelId, unitEntity, self)
self.defTeam:addUnit(monsterComp, true)
self.battleUI:refreshDefHp(unitEntity:getHp(), unitEntity:getHpPercent())
callback()
end)
end
function BattleControllerStage:_stageGenerateNextMonster()
local config = ConfigManager:getConfig("chapter")[self.chapterId]
local monsterId = config.monster[self.waveIndex + 1]
if monsterId == nil then
return self:enterNextWave()
end
local isBoss = self.defTeam:getIsBoss()
local unitEntity = DataManager.BattleData:addMonster(monsterId, true)
local modelId = unitEntity:getModelId()
BattleHelper:loadBattleHeroModel(modelId, self.battleUI:getBattleNode(), function(spineObject)
self.defTeam:removeAllUnits()
local monsterComp = spineObject:addLuaComponent(GConst.BattleConst.TYPEOF_LUA_COMP.BATTLE_MONSTER_COMPONENT)
monsterComp:initWithEntity(modelId, unitEntity, self)
self.defTeam:addUnit(monsterComp, true)
self:handleBuffs(GConst.BattleConst.SIDE_DEF)
self.battleUI:refreshDefHp(unitEntity:getHp(), unitEntity:getHpPercent())
local bornTime = monsterComp:getAnimationDuration(GConst.BattleConst.SPINE_ANIMATION_NAME.BORN)
if isBoss then -- 如果是boss就跑过去
local count = 0
local function onFinish()
count = count + 1
if count == 2 then
self.atkTeam:stopRunAction()
self:onRoundEnd(true)
end
end
self.atkTeam:playRunAction()
self.atkTeam:recoverHpOnWaveOver(onFinish)
isBoss = self.defTeam:getIsBoss()
if isBoss then
local monsterInfo = ConfigManager:getConfig("monster")[monsterId]
self.battleUI:showBossEnterAni(bornTime, ModuleManager.HeroManager:getMonsterName(monsterInfo.monster_base), monsterComp, function()
monsterComp:playEnterBattlefield(true, onFinish)
end)
else
monsterComp:playEnterBattlefield(true, onFinish)
end
else
local count = 0
local function onFinish()
count = count + 1
if count == 2 then
self:onRoundEnd(true)
end
end
self.atkTeam:recoverHpOnWaveOver(onFinish)
isBoss = self.defTeam:getIsBoss()
if isBoss then
local monsterInfo = ConfigManager:getConfig("monster")[monsterId]
self.battleUI:showBossEnterAni(bornTime, ModuleManager.HeroManager:getMonsterName(monsterInfo.monster_base), monsterComp, function()
monsterComp:playEnterBattlefield(false, onFinish)
end)
else
monsterComp:playEnterBattlefield(false, onFinish)
end
end
end)
end
function BattleControllerStage:getInitBoard() function BattleControllerStage:getInitBoard()
if not self.boradList then if not self.boradList then
self.boradList = {} self.boradList = {}
self.fixedRandomGrid = {} self.fixedRandomGrid = {}
self.mysteryBoxIndexMap = {} self.mysteryBoxIndexMap = {}
local config = ConfigManager:getConfig("chapter")[self.chapterId] local config = self:getChapterConfig()[self.chapterId]
local boardCfg = ConfigManager:getConfig("chapter_board") local boardCfg = self:getBoardConfig()
for _, boardId in ipairs(config.board) do for _, boardId in ipairs(config.board) do
local cfg = boardCfg[boardId] local cfg = boardCfg[boardId]
if cfg then if cfg then
@ -135,34 +41,6 @@ function BattleControllerStage:getInitBoard()
return self.boradList, self.fixedRandomGrid, self.mysteryBoxIndexMap return self.boradList, self.fixedRandomGrid, self.mysteryBoxIndexMap
end end
function BattleControllerStage:getSealElementType()
if not self.sealElementType then
self.sealElementType = {}
local config = ConfigManager:getConfig("chapter")[self.chapterId]
if config.seal_element then
for _, elementType in ipairs(config.seal_element) do
self.sealElementType[elementType] = true
end
end
end
return self.sealElementType
end
function BattleControllerStage:getNotInvolvedSkills()
if not self.notInvolvedSkills then
self.notInvolvedSkills = {}
local config = ConfigManager:getConfig("chapter")[self.chapterId]
if config.not_involved_skill then
for _, skillId in ipairs(config.not_involved_skill) do
self.notInvolvedSkills[skillId] = true
end
end
end
return self.notInvolvedSkills
end
function BattleControllerStage:getFixedRogueSkill() function BattleControllerStage:getFixedRogueSkill()
if not self.fixedRogueSkill then if not self.fixedRogueSkill then
local config = ConfigManager:getConfig("chapter")[self.chapterId] local config = ConfigManager:getConfig("chapter")[self.chapterId]
@ -176,10 +54,6 @@ function BattleControllerStage:getFixedRogueSkill()
return self.fixedRogueSkill return self.fixedRogueSkill
end end
function BattleControllerStage:findNextDefUnit()
self:_stageGenerateNextMonster()
end
function BattleControllerStage:controllBattleEnd() function BattleControllerStage:controllBattleEnd()
self.combatReport = { self.combatReport = {
battleType = GConst.BattleConst.BATTLE_TYPE.STAGE, battleType = GConst.BattleConst.BATTLE_TYPE.STAGE,

View File

@ -116,6 +116,8 @@ function ChapterManager:endFightFinish(result)
DataManager:tryOpenModules() DataManager:tryOpenModules()
-- 更新每日挑战数据 -- 更新每日挑战数据
ModuleManager.DailyChallengeManager:onResetState() ModuleManager.DailyChallengeManager:onResetState()
-- 更新副本活动
DataManager.DungeonData:setDirty()
-- 章节通关 标记可弹出章节礼包 -- 章节通关 标记可弹出章节礼包
DataManager.ShopData:markPopUpGiftForActChapterStore(maxChapter) DataManager.ShopData:markPopUpGiftForActChapterStore(maxChapter)
ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_PASS_CHAPTER) ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_PASS_CHAPTER)

View File

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

View File

@ -0,0 +1,225 @@
local DungeonManager = class("DungeonManager", BaseModule)
-- 外部接口--------------------------------------------------------------------------
-- 挑战
function DungeonManager:reqChallenge(module, id)
if module == ModuleManager.MODULE_KEY.DUNGEON_GOLD then
self:reqChallengeGold(id)
elseif module == ModuleManager.MODULE_KEY.DUNGEON_SHARDS then
self:reqChallengeShards(id)
end
end
-- 结算
function DungeonManager:reqEndChallenge(module, id)
if module == ModuleManager.MODULE_KEY.DUNGEON_GOLD then
self:reqEndChallengeGold(id)
elseif module == ModuleManager.MODULE_KEY.DUNGEON_SHARDS then
self:reqEndChallengeShards(id)
end
end
-- 扫荡
function DungeonManager:reqSweep(module, id)
if module == ModuleManager.MODULE_KEY.DUNGEON_GOLD then
self:reqSweepGold(id)
elseif module == ModuleManager.MODULE_KEY.DUNGEON_SHARDS then
self:reqSweepShards(id)
end
end
-- 内部接口--------------------------------------------------------------------------
function DungeonManager:checkDayChange()
if EDITOR_MODE then
Logger.logHighlight("检查跨天:".. tostring(DataManager.DungeonData:getIfCanReset()))
end
if not DataManager.DungeonData:getIfCanReset() then
return
end
-- 跨天重置数据
DataManager.DungeonData:onDayChange()
end
-- 请求挑战金币副本
function DungeonManager:reqChallengeGold(id)
local moduleKey = ModuleManager.MODULE_KEY.DUNGEON_GOLD
-- 判断次数
if DataManager.DungeonData:getRemainTimes(moduleKey) <= 0 then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_1))
return
end
-- 判断体力
if not DataManager.DungeonData:isEnoughHp(moduleKey) then
GFunc.showItemNotEnough(GConst.ItemConst.ITEM_ID_VIT)
ModuleManager.CommerceManager:showBuyVitUI()
return
end
if not DataManager.DungeonData:isCanChallenge(moduleKey) then
return
end
local parmas = {chapter_gold_id = id}
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterGoldChallengeStartReq, parmas, {}, self.respChallengeGold, BIReport.ITEM_GET_TYPE.DUNGEON_GOLD_CHALLENGE)
end
-- 响应挑战金币副本
function DungeonManager:respChallengeGold(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.DungeonData:onFightCountReduce(ModuleManager.MODULE_KEY.DUNGEON_GOLD)
DataManager.DungeonData:setCurFightChapterId(result.reqData.chapter_gold_id)
ModuleManager.BattleManager:playBattle(GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD)
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.DUNGEON_CHALLENGE)
end
end
-- 请求结算金币副本
function DungeonManager:reqEndChallengeGold(id, combatReport, taskProgress, totalDamage, remainingHp)
local parmas = {
win = combatReport.victory,
total_damage = totalDamage,
remaining_hp = remainingHp,
chapter_gold_id = id,
task_stat = taskProgress,
combatReport = combatReport,
}
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterGoldChallengeSettlementReq, parmas, {}, self.respEndChallengeGold, BIReport.ITEM_GET_TYPE.DUNGEON_GOLD_END)
end
-- 响应结算金币副本
function DungeonManager:respEndChallengeGold(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.DungeonData:initDungeonGold(result.gold_challenge)
ModuleManager.BattleManager:showBattleResultUI(GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD, result.rewards, result.reqData.combatReport)
end
end
-- 请求扫荡金币副本
function DungeonManager:reqSweepGold(id)
local moduleKey = ModuleManager.MODULE_KEY.DUNGEON_GOLD
-- 判断次数
if DataManager.DungeonData:getRemainTimes(moduleKey) <= 0 then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_1))
return
end
-- 判断体力
if not DataManager.DungeonData:isEnoughHp(moduleKey) then
GFunc.showItemNotEnough(GConst.ItemConst.ITEM_ID_VIT)
ModuleManager.CommerceManager:showBuyVitUI()
return
end
if not DataManager.DungeonData:isCanChallenge(moduleKey) then
return
end
local parmas = {
chapter_gold_id = id,
}
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterGoldChallengeFarmReq, parmas, {}, self.respSweepGold, BIReport.ITEM_GET_TYPE.DUNGEON_GOLD_SWEEP)
end
-- 响应扫荡金币副本
function DungeonManager:respSweepGold(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.DungeonData:onFightCountReduce(ModuleManager.MODULE_KEY.DUNGEON_GOLD)
GFunc.showRewardBox(result.rewards)
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.DUNGEON_SWEEP)
end
end
-- 请求挑战碎片副本
function DungeonManager:reqChallengeShards(id)
local moduleKey = ModuleManager.MODULE_KEY.DUNGEON_SHARDS
-- 判断次数
if DataManager.DungeonData:getRemainTimes(moduleKey) <= 0 then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_1))
return
end
-- 判断体力
if not DataManager.DungeonData:isEnoughHp(moduleKey) then
GFunc.showItemNotEnough(GConst.ItemConst.ITEM_ID_VIT)
ModuleManager.CommerceManager:showBuyVitUI()
return
end
if not DataManager.DungeonData:isCanChallenge(moduleKey) then
return
end
local parmas = {chapter_shards_id = id}
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterShardsChallengeStartReq, parmas, {}, self.respChallengeShards, BIReport.ITEM_GET_TYPE.DUNGEON_SHARDS_CHALLENGE)
end
-- 响应挑战碎片副本
function DungeonManager:respChallengeShards(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.DungeonData:onFightCountReduce(ModuleManager.MODULE_KEY.DUNGEON_SHARDS)
DataManager.DungeonData:setCurFightChapterId(result.reqData.chapter_shards_id)
ModuleManager.BattleManager:playBattle(GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS)
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.DUNGEON_CHALLENGE)
end
end
-- 请求结算碎片副本
function DungeonManager:reqEndChallengeShards(id, combatReport, taskProgress, totalDamage)
local parmas = {
win = true,
total_damage = totalDamage,
chapter_shards_id = id,
task_stat = taskProgress,
combatReport = combatReport,
}
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterShardsChallengeSettlementReq, parmas, {}, self.respEndChallengeShards, BIReport.ITEM_GET_TYPE.DUNGEON_SHARDS_END)
end
-- 响应结算碎片副本
function DungeonManager:respEndChallengeShards(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.DungeonData:initDungeonShards(result.shards_challenge)
ModuleManager.BattleManager:showBattleResultUI(GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS, result.rewards, result.reqData.combatReport)
end
end
-- 请求扫荡碎片副本
function DungeonManager:reqSweepShards(id)
local moduleKey = ModuleManager.MODULE_KEY.DUNGEON_SHARDS
-- 判断次数
if DataManager.DungeonData:getRemainTimes(moduleKey) <= 0 then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_1))
return
end
-- 判断体力
if not DataManager.DungeonData:isEnoughHp(moduleKey) then
GFunc.showItemNotEnough(GConst.ItemConst.ITEM_ID_VIT)
ModuleManager.CommerceManager:showBuyVitUI()
return
end
if not DataManager.DungeonData:isCanChallenge(moduleKey) then
return
end
local parmas = {
chapter_shards_id = id,
}
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterShardsChallengeFarmReq, parmas, {}, self.respSweepShards, BIReport.ITEM_GET_TYPE.DUNGEON_SHARDS_SWEEP)
end
-- 响应扫荡碎片副本
function DungeonManager:respSweepShards(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.DungeonData:onFightCountReduce(ModuleManager.MODULE_KEY.DUNGEON_SHARDS)
GFunc.showRewardBox(result.rewards)
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.DUNGEON_SWEEP)
end
end
return DungeonManager

View File

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

View File

@ -18,6 +18,7 @@ MainCityConst.BOTTOM_CLOSE_ICON = {
MainCityConst.MAIN_MODULE = { MainCityConst.MAIN_MODULE = {
DAILY_CHALLENGE = 1, DAILY_CHALLENGE = 1,
CHAPTER = 2, CHAPTER = 2,
DUNGEON = 3,
} }
MainCityConst.LEFT_SIDE_BARS = { MainCityConst.LEFT_SIDE_BARS = {

View File

@ -95,6 +95,15 @@ function BattleResultUI:refreshFixedInfo()
desc3:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_7, GFunc.num2Str(self.totalDmg))) desc3:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_7, GFunc.num2Str(self.totalDmg)))
rewardTitle:setText(I18N:getGlobalText(I18N.GlobalConst.REWARD_DESC)) rewardTitle:setText(I18N:getGlobalText(I18N.GlobalConst.REWARD_DESC))
continue:setText(I18N:getGlobalText(I18N.GlobalConst.CONTINUE_DESC)) continue:setText(I18N:getGlobalText(I18N.GlobalConst.CONTINUE_DESC))
local iconName = "common_dec_3"
if self.battleType == GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD then
iconName = "common_dec_15"
local round = self.combatReport.remainRound or 0
desc2:setText(round)
end
icon:setSprite(GConst.ATLAS_PATH.COMMON, iconName)
GFunc.centerImgAndTx(icon, desc2, 7) GFunc.centerImgAndTx(icon, desc2, 7)
end end

View File

@ -1674,12 +1674,16 @@ function BattleUI:refreshLv()
self.lastLv = lv self.lastLv = lv
end end
function BattleUI:refreshWave(wave) function BattleUI:refreshWave(wave, iconAtlas, iconName)
local uiMap = self.root:genAllChildren() local uiMap = self.root:genAllChildren()
local icon = uiMap["battle_ui.top_node.wave_icon"] local icon = uiMap["battle_ui.top_node.wave_icon"]
local desc = uiMap["battle_ui.top_node.wave_desc"] local desc = uiMap["battle_ui.top_node.wave_desc"]
desc:setText(wave) desc:setText(wave)
GFunc.centerImgAndTx(icon, desc, 10) GFunc.centerImgAndTx(icon, desc, 10)
iconAtlas = iconAtlas or GConst.ATLAS_PATH.COMMON
iconName = iconName or "common_dec_3"
icon:setSprite(iconAtlas, iconName)
end end
function BattleUI:refreshTaskBtn() function BattleUI:refreshTaskBtn()

8
lua/app/ui/dungeon.meta Normal file
View File

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

View File

@ -0,0 +1,124 @@
local DungeonBoardCell = class("DungeonBoardCell", BaseCell)
function DungeonBoardCell:init()
self.uiMap = self:getUIMap()
self.txTitle = self.uiMap["dungeon_board_cell.tx_title"]
self.countdown = self.uiMap["dungeon_board_cell.countdown"]
self.txCountdown = self.uiMap["dungeon_board_cell.countdown.tx_countdown"]
self.txOpen = self.uiMap["dungeon_board_cell.tx_open"]
self.lock = self.uiMap["dungeon_board_cell.lock"]
self.lockIcon = self.uiMap["dungeon_board_cell.lock.desc.icon"]
self.lockTxLock = self.uiMap["dungeon_board_cell.lock.desc.tx_lock"]
self.lockIconCountdown = self.uiMap["dungeon_board_cell.lock.countdown.icon"]
self.lockTxCountdown = self.uiMap["dungeon_board_cell.lock.countdown.tx_countdown"]
self.btnStart = self.uiMap["dungeon_board_cell.btn_start"]
self.txStart = self.uiMap["dungeon_board_cell.btn_start.tx_btn"]
self.txTimes = self.uiMap["dungeon_board_cell.btn_start.tx_times"]
self.btnHelp = self.uiMap["dungeon_board_cell.btn_help"]
self.itemReward = self.uiMap["dungeon_board_cell.item_reward"]
self.itemRewardIcon = self.uiMap["dungeon_board_cell.item_reward.icon"]
self.btnStart:addClickListener(function()
-- 打开副本关卡选择界面
UIManager:showUI("app/ui/dungeon/dungeon_difficulty_ui", {module = self.moduleKey})
end)
self.btnHelp:addClickListener(function()
-- 展示提示
ModuleManager.TipsManager:showDescTips(DataManager.DungeonData:getRule(self.moduleKey), self.btnHelp)
end)
end
function DungeonBoardCell:refresh(moduleKey)
self.moduleKey = moduleKey
self:refreshInfo()
self:refreshRewards()
end
function DungeonBoardCell:refreshInfo()
self.txTitle:setText(DataManager.DungeonData:getTitle(self.moduleKey))
self.txOpen:setText("<color=" .. DataManager.DungeonData:getOpenTextColor(self.moduleKey) .. ">" .. DataManager.DungeonData:getOpenTimeDesc(self.moduleKey) .. "</color>")
self.baseObject:setTexture(DataManager.DungeonData:getBanner(self.moduleKey))
if DataManager.DungeonData:isActive(self.moduleKey) then
self.btnStart:setVisible(true)
self.countdown:setVisible(true)
self.lock:setVisible(false)
-- 红点
if DataManager.DungeonData:isCanChallenge(self.moduleKey) then
self.btnStart:addRedPoint(110, 40, 0.6)
else
self.btnStart:removeRedPoint()
end
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>"
else
timeStr = ":" .. time
end
self.txTimes:setText(I18N:getGlobalText(I18N.GlobalConst.TODAY_REMAIN_TIMES, timeStr))
self:refreshCountdown(self.txCountdown)
else
self.btnStart:setVisible(false)
self.countdown:setVisible(false)
self.lock:setVisible(true)
self.txOpen:setAnchoredPositionY(-75)
self.lockTxLock:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_OPEN))
self:refreshCountdown(self.lockTxCountdown)
end
GFunc.centerImgAndTx(self.lockIcon, self.lockTxLock, 10)
GFunc.centerImgAndTx(self.lockIconCountdown, self.lockTxCountdown, 10)
end
function DungeonBoardCell:refreshRewards()
local reward = DataManager.DungeonData:getBoardShowRewardId(self.moduleKey)
if reward ~= nil then
-- 展示实际item
local info = ConfigManager:getConfig("item")[reward]
if info == nil then
return
end
self.itemRewardIcon:setSprite(GConst.ATLAS_PATH.ICON_ITEM, info.icon)
self.itemReward:setTouchEnable(true)
self.itemReward:addClickListener(function()
ModuleManager.TipsManager:showRewardTips(reward, info.type, self.itemReward)
end)
else
reward = DataManager.DungeonData:getBoardShowRewardIcon(self.moduleKey)
-- 展示icon图片
self.itemRewardIcon:setSprite(reward[1], reward[2])
self.itemReward:setTouchEnable(false)
end
end
function DungeonBoardCell:refreshCountdown(txCountdown)
if self.countdownSid then
SchedulerManager:unscheduleGlobal(self.countdownSid)
self.countdownSid = nil
end
self.countdownSid = txCountdown:scheduleGlobal(function()
self:updateTime(txCountdown)
end, 1)
self:updateTime(txCountdown)
end
function DungeonBoardCell:updateTime(txCountdown)
if self.remainTime == nil or self.remainTime < 0 then
self.remainTime = DataManager.DungeonData:geNextTime(self.moduleKey)
else
self.remainTime = self.remainTime - 1
end
txCountdown:setText(GFunc.getTimeStrWithHMS(self.remainTime))
end
return DungeonBoardCell

View File

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

View File

@ -0,0 +1,208 @@
local DungeonDifficultyUI = class("DungeonDifficultyUI", BaseUI)
function DungeonDifficultyUI:isFullScreen()
return false
end
function DungeonDifficultyUI:getPrefabPath()
return "assets/prefabs/ui/dungeon/dungeon_difficulty_ui.prefab"
end
function DungeonDifficultyUI:ctor(params)
self.module = params.module
self.curId = DataManager.DungeonData:getUnlockMaxId(self.module)
end
function DungeonDifficultyUI:onCover()
end
function DungeonDifficultyUI:onReshow()
end
function DungeonDifficultyUI:onClose()
end
function DungeonDifficultyUI:onLoadRootComplete()
self.uiMap = self.root:genAllChildren()
self.icon = self.uiMap["dungeon_difficulty_ui.bg.title.icon_title"]
self.btnClose = self.uiMap["dungeon_difficulty_ui.bg.close_btn"]
self.btnStart = self.uiMap["dungeon_difficulty_ui.bg.btns.btn_start"]
self.txStart = self.uiMap["dungeon_difficulty_ui.bg.btns.btn_start.tx_start"]
self.txStartCost = self.uiMap["dungeon_difficulty_ui.bg.btns.btn_start.cost.tx_cost"]
self.btnSweep = self.uiMap["dungeon_difficulty_ui.bg.btns.btn_sweep"]
self.txSweep = self.uiMap["dungeon_difficulty_ui.bg.btns.btn_sweep.tx_sweep"]
self.txSweepCost = self.uiMap["dungeon_difficulty_ui.bg.btns.btn_sweep.cost.tx_cost"]
self.txTime = self.uiMap["dungeon_difficulty_ui.bg.btns.tx_time"]
self.txDifficulty = self.uiMap["dungeon_difficulty_ui.bg.select.chapter.tx_difficulty"]
self.txLevel = self.uiMap["dungeon_difficulty_ui.bg.select.chapter.tx_level"]
self.arrowLeft = self.uiMap["dungeon_difficulty_ui.bg.select.chapter.arrow_left"]
self.arrowRight = self.uiMap["dungeon_difficulty_ui.bg.select.chapter.arrow_right"]
self.txDesc = self.uiMap["dungeon_difficulty_ui.bg.tx_desc"]
self.txTitle = self.uiMap["dungeon_difficulty_ui.bg.title.title_text"]
self.buffObj = self.uiMap["dungeon_difficulty_ui.bg.boss_buff"]
self.txbuff = self.uiMap["dungeon_difficulty_ui.bg.boss_buff.tx_buff"]
self.iconBuff = self.uiMap["dungeon_difficulty_ui.bg.boss_buff.icon_buff"]
self.rewardTx = self.uiMap["dungeon_difficulty_ui.bg.reward_desc"]
self.rewardFirst = self.uiMap["dungeon_difficulty_ui.bg.rewards.reward_first"]
self.rewardFirstIcon = self.uiMap["dungeon_difficulty_ui.bg.rewards.reward_first.icon"]
self.rewardFirstNum = self.uiMap["dungeon_difficulty_ui.bg.rewards.reward_first.num"]
self.rewardPass = self.uiMap["dungeon_difficulty_ui.bg.rewards.reward_pass"]
self.rewardPassIcon = self.uiMap["dungeon_difficulty_ui.bg.rewards.reward_pass.icon"]
self.rewardPassNum = self.uiMap["dungeon_difficulty_ui.bg.rewards.reward_pass.num"]
self.txFrist = self.uiMap["dungeon_difficulty_ui.bg.rewards.reward_first.tx_first"]
self.txLock = self.uiMap["dungeon_difficulty_ui.bg.tx_lock"]
self.btnGroup = self.uiMap["dungeon_difficulty_ui.bg.btns"]
local iconPath = DataManager.DungeonData:getIcon(self.module)
self.icon:setSprite(iconPath[1], iconPath[2], function()
self.icon:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):SetNativeSize()
end)
self.txTitle:setText(DataManager.DungeonData:getTitle(self.module))
self.txDifficulty:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_STAGE))
self.txStart:setText(I18N:getGlobalText(I18N.GlobalConst.START_DESC))
self.txSweep:setText(I18N:getGlobalText(I18N.GlobalConst.SMASH))
local cost = DataManager.DungeonData:getChallengeHpCost(self.module)
self.txStartCost:setText(GFunc.getRewardNum(cost))
self.txSweepCost:setText(GFunc.getRewardNum(cost))
local time = DataManager.DungeonData:getRemainTimes(self.module)
local timeStr = nil
if time <= 0 then
timeStr = ":<color=#FF8181>" .. time .. "</color>"
else
timeStr = ":" .. time
end
self.txTime:setText(I18N:getGlobalText(I18N.GlobalConst.TODAY_REMAIN_TIMES, timeStr))
self.txFrist:setText(I18N:getGlobalText(I18N.GlobalConst.FIRST_PASS))
self.rewardTx:setText(I18N:getGlobalText(I18N.GlobalConst.REWARD_DESC)..":")
self.txLock:setText(I18N:getGlobalText(I18N.GlobalConst.PASS_REQUIRE))
self:refreshDifficulty()
self.btnClose:addClickListener(function()
self:closeUI()
end)
self.btnStart:addClickListener(function()
-- 开始挑战
ModuleManager.DungeonManager:reqChallenge(self.module, self.curId)
end)
self.btnSweep:addClickListener(function()
-- 开始扫荡
ModuleManager.DungeonManager:reqSweep(self.module, self.curId)
end)
self.arrowLeft:addClickListener(function()
if self:isMinId() then
return
end
self.curId = self.curId - 1
self:refreshDifficulty()
end)
self.arrowRight:addClickListener(function()
if self:isMaxId() then
return
end
self.curId = self.curId + 1
self:refreshDifficulty()
end)
self:addEventListener(EventManager.CUSTOM_EVENT.DUNGEON_CHALLENGE, function()
self:closeUI()
end)
self:addEventListener(EventManager.CUSTOM_EVENT.DUNGEON_SWEEP, function()
self:closeUI()
end)
end
function DungeonDifficultyUI:refreshDifficulty()
self.btnSweep:setActive(self:isCanSweepId())
self.txLevel:setText(tostring(self.curId))
-- buff or desc
local buff = DataManager.DungeonData:getBossBuff(self.module, self.curId)
local desc = DataManager.DungeonData:getRule(self.module)
if buff then
local cfg = ConfigManager:getConfigWithOtherKey("buff", "name")[buff.type]
self.txDesc:setActive(false)
self.buffObj:setActive(true)
self.txbuff:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_DESC))
self.iconBuff:setSprite(GConst.ATLAS_PATH.ICON_BUFF, cfg.icon)
self.iconBuff:addClickListener(function()
ModuleManager.TipsManager:showDescTips(GFunc.getBuffDesc(buff.type, buff.num), self.iconBuff)
end)
elseif desc then
self.txDesc:setActive(true)
self.buffObj:setActive(false)
self.txDesc:setText(desc)
else
self.txDesc:setActive(false)
self.buffObj:setActive(false)
end
-- 箭头
self.txLock:setActive(not self:isCanChallengeId())
self.btnGroup:setActive(self:isCanChallengeId())
self.arrowRight:setActive(not self:isMaxId())
self.arrowLeft:setActive(not self:isMinId())
-- 奖励
local reward = DataManager.DungeonData:getBoardShowRewardId(self.module)
if reward ~= nil then
-- 展示实际item
local info = ConfigManager:getConfig("item")[reward]
if info == nil then
return
end
self.rewardFirstIcon:setSprite(GConst.ATLAS_PATH.ICON_ITEM, info.icon)
self.rewardPassIcon:setSprite(GConst.ATLAS_PATH.ICON_ITEM, info.icon)
self.rewardFirst:setTouchEnable(true)
self.rewardPass:setTouchEnable(true)
self.rewardFirst:addClickListener(function()
ModuleManager.TipsManager:showRewardTips(reward, info.type, self.rewardFirst)
end)
self.rewardPass:addClickListener(function()
ModuleManager.TipsManager:showRewardTips(reward, info.type, self.rewardPass)
end)
else
reward = DataManager.DungeonData:getBoardShowRewardIcon(self.module)
-- 展示icon图片
self.rewardFirstIcon:setSprite(reward[1], reward[2])
self.rewardPassIcon:setSprite(reward[1], reward[2])
self.rewardFirst:setTouchEnable(false)
self.rewardPass:setTouchEnable(false)
end
local firstNum = DataManager.DungeonData:getFirstRewardNum(self.module, self.curId)
local passNum = DataManager.DungeonData:getPassRewardNum(self.module, self.curId)
if not self:isCanSweepId() and firstNum then
self.rewardFirst:setActive(true)
self.rewardFirstNum:setText(firstNum)
else
self.rewardFirst:setActive(false)
end
self.rewardPassNum:setText(passNum)
end
-- 是否是可扫荡关卡
function DungeonDifficultyUI:isCanSweepId()
return self.curId < DataManager.DungeonData:getUnlockMaxId(self.module)
end
--是否是可挑战关卡
function DungeonDifficultyUI:isCanChallengeId()
return self.curId <= DataManager.DungeonData:getUnlockMaxId(self.module)
end
-- 是最大副本id
function DungeonDifficultyUI:isMaxId()
return self.curId == DataManager.DungeonData:getConfigMaxId(self.module)
end
--是最小关卡
function DungeonDifficultyUI:isMinId()
return self.curId == 1
end
return DungeonDifficultyUI

View File

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

View File

@ -12,11 +12,15 @@ function ChapterComp:getIsOpen()
end end
function ChapterComp:getEntranceName() function ChapterComp:getEntranceName()
return "主线章节" return I18N:getGlobalText(I18N.GlobalConst.MAIN_CHAPTER)
end end
function ChapterComp:getEntranceIcon() function ChapterComp:getEntranceIcon()
return GConst.ATLAS_PATH.COMMON,"common_dec_1" return GConst.ATLAS_PATH.MAIN,"main_dec_5"
end
function ChapterComp:getEntranceBg()
return GConst.ATLAS_PATH.MAIN,"main_btn_ringt"
end end
function ChapterComp:getHpCost() function ChapterComp:getHpCost()

View File

@ -6,13 +6,17 @@ function DailyChallengeComp:getIsOpen()
end end
function DailyChallengeComp:getEntranceName() function DailyChallengeComp:getEntranceName()
return "每日挑战" return I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE)
end end
function DailyChallengeComp:getEntranceIcon() function DailyChallengeComp:getEntranceIcon()
return GConst.ATLAS_PATH.MAIN,"main_dec_1" return GConst.ATLAS_PATH.MAIN,"main_dec_1"
end end
function DailyChallengeComp:getEntranceBg()
return GConst.ATLAS_PATH.MAIN,"main_btn_ligth"
end
function DailyChallengeComp:getShowEntranceRedPoint() function DailyChallengeComp:getShowEntranceRedPoint()
return DataManager.DailyChallengeData:isMeetChallenge() return DataManager.DailyChallengeData:isMeetChallenge()
end end
@ -137,7 +141,7 @@ end
function DailyChallengeComp:updateTime() function DailyChallengeComp:updateTime()
ModuleManager.DailyChallengeManager:checkDayChange() ModuleManager.DailyChallengeManager:checkDayChange()
local remainTime = DataManager.DailyChallengeData:getTodaySurplusTime() local remainTime = Time:getTodaySurplusTime()
self.countdownTx:setText(GFunc.getTimeStrWithHMS(remainTime)) self.countdownTx:setText(GFunc.getTimeStrWithHMS(remainTime))
end end

View File

@ -0,0 +1,66 @@
local MainCompBaseCell = require "app/ui/main_city/component/main_comp_base_cell"
local DungeonComp = class("DungeonComp", MainCompBaseCell)
function DungeonComp:getIsOpen()
return DataManager.DungeonData:isOpenAnyone()
end
function DungeonComp:getEntranceName()
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_BTN)
end
function DungeonComp:getEntranceIcon()
return GConst.ATLAS_PATH.MAIN,"main_dec_2"
end
function DungeonComp:getEntranceBg()
return GConst.ATLAS_PATH.MAIN,"main_btn_ringt"
end
function DungeonComp:getShowEntranceRedPoint()
return DataManager.DungeonData:isCanChallengeAnyone()
end
function DungeonComp:ctor()
end
function DungeonComp:init()
self.uiMap = self:getBaseObject():genAllChildren()
self.scrollRect = self.uiMap["dungeon_comp.scrollrect"]
self.scrollRectComp = self.scrollRect:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.scrollRectComp:addInitCallback(function()
return "app/ui/dungeon/dungeon_board_cell"
end)
self.scrollRectComp:addRefreshCallback(function(index, cell)
cell:refresh(self.openDungeons[index])
end)
self.scrollRectComp:clearCells()
self.scrollRectComp:setTotalCount(0)
self:refreshShow()
end
function DungeonComp:refreshShow()
if EDITOR_MODE then
Logger.logHighlight("更新副本显示."..tostring(Time:getTodaySurplusTime()))
end
self.openDungeons = DataManager.DungeonData:getOpenDungeons()
if self.scrollRectComp:getTotalCount() ~= #self.openDungeons then
self.scrollRectComp:clearCells()
self.scrollRectComp:refillCells(#self.openDungeons)
else
self.scrollRectComp:updateAllCell()
end
-- 跨天定时器
if self.countdownSid then
SchedulerManager:unscheduleGlobal(self.countdownSid)
self.countdownSid = nil
end
self.countdownSid = self:getBaseObject():scheduleGlobal(function()
ModuleManager.DungeonManager:checkDayChange()
end, Time:getTodaySurplusTime() + 1)
end
return DungeonComp

View File

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

View File

@ -1,15 +1,15 @@
local MainComp = class("MainComp", LuaComponent) local MainComp = class("MainComp", LuaComponent)
local CHAPTER_COMP = "app/ui/main_city/component/chapter_comp" local CHAPTER_COMP = "app/ui/main_city/component/chapter_comp"
local DAILY_CHALLENGE_COMP = "app/ui/main_city/component/daily_challenge_comp" local DAILY_CHALLENGE_COMP = "app/ui/main_city/component/daily_challenge_comp"
local DUNGEON_COMP = "app/ui/main_city/component/dungeon_comp"
local BOTTOM_HEIGHT = 120 local BOTTOM_HEIGHT = 120
function MainComp:init() function MainComp:init()
self.uiMap = self:getBaseObject():genAllChildren() self.uiMap = self:getBaseObject():genAllChildren()
self:refreshModule(ModuleManager.MaincityManager:getCurModule())
self:initStageFormation() self:initStageFormation()
self:refreshModule(ModuleManager.MaincityManager:getCurModule())
end end
function MainComp:refreshModule(selectModule) function MainComp:refreshModule(selectModule)
@ -25,31 +25,36 @@ function MainComp:refreshModule(selectModule)
self.dailyChallengeComp = CellManager:addCellComp(dailyChallengeComp, DAILY_CHALLENGE_COMP) self.dailyChallengeComp = CellManager:addCellComp(dailyChallengeComp, DAILY_CHALLENGE_COMP)
self.dailyChallengeComp:initWithParentUI(self) self.dailyChallengeComp:initWithParentUI(self)
self.moduleMap[GConst.MainCityConst.MAIN_MODULE.DAILY_CHALLENGE] = self.dailyChallengeComp self.moduleMap[GConst.MainCityConst.MAIN_MODULE.DAILY_CHALLENGE] = self.dailyChallengeComp
-- 活动副本
local dungeonComp = self.uiMap["main_comp.dungeon_comp"]
self.dungeonComp = CellManager:addCellComp(dungeonComp, DUNGEON_COMP)
self.dungeonComp:initWithParentUI(self)
self.moduleMap[GConst.MainCityConst.MAIN_MODULE.DUNGEON] = self.dungeonComp
end end
if self.curModuleType ~= selectModule then if self.curModuleType ~= selectModule then
self.curModuleType = selectModule self.curModuleType = selectModule
ModuleManager.MaincityManager:setCurModule(self.curModuleType) ModuleManager.MaincityManager:setCurModule(self.curModuleType)
self:setFormationVisible(true)
if self.curModuleType == GConst.MainCityConst.MAIN_MODULE.CHAPTER then if self.curModuleType == GConst.MainCityConst.MAIN_MODULE.CHAPTER then
-- 切换到主线章节 -- 切换到主线章节
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.GO_CHAPTER)
elseif self.curModuleType == GConst.MainCityConst.MAIN_MODULE.DAILY_CHALLENGE then elseif self.curModuleType == GConst.MainCityConst.MAIN_MODULE.DAILY_CHALLENGE then
-- 切换到每日挑战 -- 切换到每日挑战
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.GO_DAILY_CHALLENGE)
if not DataManager.TutorialData:getIsInTutorial() and DataManager.DailyChallengeData:getIsPopTask() then if not DataManager.TutorialData:getIsInTutorial() and DataManager.DailyChallengeData:getIsPopTask() then
ModuleManager.DailyChallengeManager:showBattleTaskUI() ModuleManager.DailyChallengeManager:showBattleTaskUI()
end end
elseif self.curModuleType == GConst.MainCityConst.MAIN_MODULE.DUNGEON then
-- 切换到活动副本
self:setFormationVisible(false)
end end
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.CHANGE_MAIN_COMP_MODULE, self.curModuleType)
end end
for idx, cell in pairs(self.moduleMap) do for idx, cell in pairs(self.moduleMap) do
cell:getBaseObject():setActive(self.curModuleType == idx) cell:getBaseObject():setActive(self.curModuleType == idx)
end end
local heroBg = self.uiMap["main_comp.hero_bg"]
local heroBgPosY = heroBg:fastGetAnchoredPositionY()
local sWidth, sHeight = GFunc.getUIExpandScreenSize()
local hSHeight = sHeight / 2
self.btnPosY = (heroBgPosY + (BOTTOM_HEIGHT / 2 - hSHeight)) / 2
self:refreshBtns() self:refreshBtns()
end end
@ -62,16 +67,17 @@ end
function MainComp:refreshFightBtn() function MainComp:refreshFightBtn()
local moduleCell = self.moduleMap[self.curModuleType] local moduleCell = self.moduleMap[self.curModuleType]
self.uiMap["main_comp.fight_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.START_DESC))
local cost = moduleCell:getHpCost() local cost = moduleCell:getHpCost()
if cost then if cost then
self.uiMap["main_comp.fight_btn.desc_2"]:setText(GFunc.getRewardNum(cost)) self.uiMap["main_comp.fight_btn"]:setActive(true)
else
self.uiMap["main_comp.fight_btn.desc_2"]:setText("0")
end
self.uiMap["main_comp.fight_btn"]:addClickListener(moduleCell.onClickFight) self.uiMap["main_comp.fight_btn"]:addClickListener(moduleCell.onClickFight)
self.uiMap["main_comp.fight_btn"]:setAnchoredPositionY(self.btnPosY) self.uiMap["main_comp.fight_btn"]:setAnchoredPositionY(self.btnPosY)
self.uiMap["main_comp.fight_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.START_DESC))
self.uiMap["main_comp.fight_btn.desc_2"]:setText(GFunc.getRewardNum(cost))
else
self.uiMap["main_comp.fight_btn"]:setActive(false)
return
end
local remainCount = moduleCell:getTodayRemainCount() local remainCount = moduleCell:getTodayRemainCount()
if remainCount >= 0 then if remainCount >= 0 then
@ -99,9 +105,13 @@ function MainComp:refreshLeftBtn()
end end
self.leftBtn:setActive(true) self.leftBtn:setActive(true)
local bgAtlas, bgName = moduleCell:getEntranceBg()
self.uiMap["main_comp.left_btn.bg"]:setSprite(bgAtlas, bgName)
local iconAtlas, iconName = moduleCell:getEntranceIcon() local iconAtlas, iconName = moduleCell:getEntranceIcon()
self.uiMap["main_comp.left_btn.desc"]:setText(moduleCell:getEntranceName()) self.uiMap["main_comp.left_btn.desc"]:setText(moduleCell:getEntranceName())
self.uiMap["main_comp.left_btn.icon"]:setSprite(iconAtlas, iconName) self.uiMap["main_comp.left_btn.icon"]:setSprite(iconAtlas, iconName, function()
self.uiMap["main_comp.left_btn.icon"]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):SetNativeSize()
end)
self.leftBtn:addClickListener(function() self.leftBtn:addClickListener(function()
self:refreshModule(leftIdx) self:refreshModule(leftIdx)
end) end)
@ -129,9 +139,13 @@ function MainComp:refreshRightBtn()
end end
self.rightBtn:setActive(true) self.rightBtn:setActive(true)
local bgAtlas, bgName = moduleCell:getEntranceBg()
self.uiMap["main_comp.right_btn.bg"]:setSprite(bgAtlas, bgName)
local iconAtlas, iconName = moduleCell:getEntranceIcon() local iconAtlas, iconName = moduleCell:getEntranceIcon()
self.uiMap["main_comp.right_btn.desc"]:setText(moduleCell:getEntranceName()) self.uiMap["main_comp.right_btn.desc"]:setText(moduleCell:getEntranceName())
self.uiMap["main_comp.right_btn.icon"]:setSprite(iconAtlas, iconName) self.uiMap["main_comp.right_btn.icon"]:setSprite(iconAtlas, iconName, function()
self.uiMap["main_comp.right_btn.icon"]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE):SetNativeSize()
end)
self.rightBtn:addClickListener(function() self.rightBtn:addClickListener(function()
self:refreshModule(rightIdx) self:refreshModule(rightIdx)
end) end)
@ -151,7 +165,7 @@ function MainComp:getCurLeftModuleIdx()
end end
function MainComp:getCurRightModuleIdx() function MainComp:getCurRightModuleIdx()
local totalModuleNum = GFunc.getTableLength(GConst.MainCityConst.MAIN_MODULE) local totalModuleNum = table.nums(GConst.MainCityConst.MAIN_MODULE)
if self.curModuleType == totalModuleNum then if self.curModuleType == totalModuleNum then
return nil return nil
end end
@ -167,6 +181,16 @@ function MainComp:initStageFormation()
self.uiMap["main_comp.hero_bg.hero_cell_4"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_CELL), self.uiMap["main_comp.hero_bg.hero_cell_4"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_CELL),
self.uiMap["main_comp.hero_bg.hero_cell_5"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_CELL), self.uiMap["main_comp.hero_bg.hero_cell_5"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_CELL),
} }
self.heroFormation = self.uiMap["main_comp.hero_bg"]
local heroBgPosY = self.heroFormation:fastGetAnchoredPositionY()
local sWidth, sHeight = GFunc.getUIExpandScreenSize()
local hSHeight = sHeight / 2
self.btnPosY = (heroBgPosY + (BOTTOM_HEIGHT / 2 - hSHeight)) / 2
end
function MainComp:setFormationVisible(visible)
self.heroFormation:setVisible(visible)
end end
function MainComp:refresh() function MainComp:refresh()
@ -187,6 +211,11 @@ function MainComp:refreshChallenge()
self.dailyChallengeComp:refreshShow() self.dailyChallengeComp:refreshShow()
end end
function MainComp:refreshDungeon()
self:refreshBtns()
self.dungeonComp:refreshShow()
end
function MainComp:refreshStageFormaion() function MainComp:refreshStageFormaion()
local formation = DataManager.FormationData:getStageFormation() local formation = DataManager.FormationData:getStageFormation()
for i, heroCell in ipairs(self.heroCells) do for i, heroCell in ipairs(self.heroCells) do

View File

@ -15,12 +15,16 @@ function MainCompBaseCell:getEntranceIcon()
return "","" return "",""
end end
function MainCompBaseCell:getEntranceBg()
return "",""
end
function MainCompBaseCell:getShowEntranceRedPoint() function MainCompBaseCell:getShowEntranceRedPoint()
return false return false
end end
function MainCompBaseCell:getHpCost() function MainCompBaseCell:getHpCost()
return 0 return nil-- 默认不显示挑战按钮
end end
function MainCompBaseCell:getTodayRemainCount() function MainCompBaseCell:getTodayRemainCount()

View File

@ -19,8 +19,6 @@ MainCityUI.CLICK_BTN_TYPE = {
[3] = "SHOP", [3] = "SHOP",
} }
local MAIN_COMP_INDEX = 1
function MainCityUI:getUIType() function MainCityUI:getUIType()
return UIManager.UI_TYPE.MAIN return UIManager.UI_TYPE.MAIN
end end
@ -35,7 +33,7 @@ function MainCityUI:getCurrencyParams()
itemIds = {} itemIds = {}
} }
end end
self.selectedIndex = self.selectedIndex or MAIN_COMP_INDEX self.selectedIndex = self.selectedIndex or GConst.MainCityConst.BOTTOM_PAGE.MAIN
self.currencyParams.showType = GConst.CURRENCY_TYPE.HORIZONTAL self.currencyParams.showType = GConst.CURRENCY_TYPE.HORIZONTAL
for k, v in ipairs(self.currencyParams.itemIds) do for k, v in ipairs(self.currencyParams.itemIds) do
table.remove(self.currencyParams.itemIds) table.remove(self.currencyParams.itemIds)
@ -158,18 +156,8 @@ function MainCityUI:_addListeners()
end end
end) end)
self:addEventListener(EventManager.CUSTOM_EVENT.GO_DAILY_CHALLENGE, function() self:addEventListener(EventManager.CUSTOM_EVENT.CHANGE_MAIN_COMP_MODULE, function(module)
if self.selectedIndex ~= GConst.MainCityConst.BOTTOM_PAGE.MAIN then self:switchMainCompModule(module)
return
end
self:refreshBounty()
end)
self:addEventListener(EventManager.CUSTOM_EVENT.GO_CHAPTER, function()
if self.selectedIndex ~= GConst.MainCityConst.BOTTOM_PAGE.MAIN then
return
end
self:refreshBounty()
end) end)
DataManager.MailData:checkNewMail() DataManager.MailData:checkNewMail()
end end
@ -248,6 +236,14 @@ function MainCityUI:_bind()
end end
end end
end) end)
self:bind(DataManager.DungeonData, "isDirty", function()
if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN then
if self.subComps[self.selectedIndex] then
self.subComps[self.selectedIndex]:refreshDungeon()
end
end
end)
end end
function MainCityUI:initBottomUI() function MainCityUI:initBottomUI()
@ -319,7 +315,7 @@ function MainCityUI:refreshBottom(selectedIndex, playAnim)
return return
end end
local oldIndex = self.selectedIndex local oldIndex = self.selectedIndex
self.selectedIndex = selectedIndex and selectedIndex or MAIN_COMP_INDEX self.selectedIndex = selectedIndex and selectedIndex or GConst.MainCityConst.BOTTOM_PAGE.MAIN
self:switchComp() self:switchComp()
if oldIndex ~= selectedIndex then if oldIndex ~= selectedIndex then
@ -703,17 +699,37 @@ function MainCityUI:switchComp(index)
end end
end end
self:updateCurrencyBar() self:updateCurrencyBar()
if self.selectedIndex == MAIN_COMP_INDEX then if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.MAIN then
self:checkMainPop() self:checkMainPop()
self:setTopNodeVisible(true)
self:refreshTopNode() self:refreshTopNode()
self:setSideBarVisible(true) self:switchMainCompModule()
else else
self:setTopNodeVisible(false) self:setTopNodeVisible(false)
self:setSideBarVisible(false) self:setSideBarVisible(false)
end end
end end
-- 切换主界面活动模块
function MainCityUI:switchMainCompModule(moduleKey)
if self.selectedIndex ~= GConst.MainCityConst.BOTTOM_PAGE.MAIN then
return
end
if moduleKey == nil then
moduleKey = self.subComps[self.selectedIndex]:getCurModuleType()
end
if moduleKey == GConst.MainCityConst.MAIN_MODULE.DUNGEON then
-- 活动副本切换刷新
self:setTopNodeVisible(false)
self:setSideBarVisible(false)
else
self:setTopNodeVisible(true)
self:setSideBarVisible(true)
self:refreshBounty()
end
end
function MainCityUI:updateTime() function MainCityUI:updateTime()
if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.SHOP and self.subComps[self.selectedIndex] then if self.selectedIndex == GConst.MainCityConst.BOTTOM_PAGE.SHOP and self.subComps[self.selectedIndex] then
if self.subComps[self.selectedIndex] then if self.subComps[self.selectedIndex] then

View File

@ -113,15 +113,6 @@ function DailyChallengeData:getBuffDesc(buffId)
return I18N:getText("buff_daily_challenge", buffId, "desc") return I18N:getText("buff_daily_challenge", buffId, "desc")
end end
-- 获取今日剩余时间
function DailyChallengeData:getTodaySurplusTime()
local result = Time:getOverOfServerToday() - Time:getServerTime()
if result < 0 then
result = 0
end
return result
end
-- 获取最终boss配置信息 -- 获取最终boss配置信息
function DailyChallengeData:getFinalBossInfo() function DailyChallengeData:getFinalBossInfo()
if not self:isOpen() then if not self:isOpen() then

View File

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

View File

@ -0,0 +1,372 @@
local DungeonData = class("DungeonData", BaseData)
-- 副本展示权重(由上到下排列)
local DUNGEON_SHOW_WEIGHT = {
[1] = ModuleManager.MODULE_KEY.DUNGEON_SHARDS,
[2] = ModuleManager.MODULE_KEY.DUNGEON_GOLD,
}
-- 所有活动副本数据
function DungeonData:ctor()
self.data.isDirty = false
end
function DungeonData:clear()
end
-- 初始化金币副本数据
function DungeonData:initDungeonGold(data)
if data == nil then
return
end
if EDITOR_MODE then
Logger.logHighlight("更新金币副本数据")
Logger.printTable(data)
end
self:initAllDataClass()
self.dataDungeons[ModuleManager.MODULE_KEY.DUNGEON_GOLD]:init(data)
self.data.gold = data
self:setDirty()
end
-- 初始化碎片副本数据
function DungeonData:initDungeonShards(data)
if data == nil then
return
end
if EDITOR_MODE then
Logger.logHighlight("更新碎片副本数据")
Logger.printTable(data)
end
self:initAllDataClass()
self.dataDungeons[ModuleManager.MODULE_KEY.DUNGEON_SHARDS]:init(data)
self.data.shards = data
self:setDirty()
end
-- 初始化所有副本数据类
function DungeonData:initAllDataClass()
if self.dataDungeons == nil then
self.dataDungeons = {}
self.dataDungeons[ModuleManager.MODULE_KEY.DUNGEON_GOLD] = require "app/userdata/dungeon/dungeon_gold_data_comp":create()
self.dataDungeons[ModuleManager.MODULE_KEY.DUNGEON_SHARDS] = require "app/userdata/dungeon/dungeon_shards_data_comp":create()
if EDITOR_MODE then
Logger.logHighlight("星期".. tostring(Time:getWeekByTimeStamp()))
end
end
self.initDay = Time:getBeginningOfServerToday()
end
function DungeonData:getIfCanReset()
return self.initDay < Time:getBeginningOfServerToday()
end
-- 跨天处理
function DungeonData:onDayChange()
self.data.gold.today_challenge_count = 0
self.data.shards.today_challenge_count = 0
if EDITOR_MODE then
Logger.logHighlight("星期".. tostring(Time:getWeekByTimeStamp()))
end
self:initDungeonGold(self.data.gold)
self:initDungeonShards(self.data.shards)
end
-- 客户端处理副本次数+1的情况
function DungeonData:onFightCountReduce(moduleKey)
if moduleKey == ModuleManager.MODULE_KEY.DUNGEON_GOLD then
self.data.gold.today_challenge_count = self.data.gold.today_challenge_count + 1
self:initDungeonGold(self.data.gold)
elseif moduleKey == ModuleManager.MODULE_KEY.DUNGEON_SHARDS then
self.data.shards.today_challenge_count = self.data.shards.today_challenge_count + 1
self:initDungeonShards(self.data.shards)
end
end
function DungeonData:setDirty()
self.data.isDirty = not self.data.isDirty
end
-- 是否开启任意一个副本
function DungeonData:isOpenAnyone()
for key, value in pairs(self.dataDungeons) do
if self:isOpen(key) then
return true
end
end
return false
end
-- 某副本是否已开启
function DungeonData:isOpen(moduleKey)
if not ModuleManager:getIsOpen(moduleKey, true) then
return false
end
return true
end
-- 返回已开启的副本
function DungeonData:getOpenDungeons()
local openDungeons = {}
for idx, moduleKey in pairs(DUNGEON_SHOW_WEIGHT) do
if self:isOpen(moduleKey) then
table.insert(openDungeons, moduleKey)
end
end
if EDITOR_MODE then
Logger.logHighlight("已开启副本:")
Logger.printTable(openDungeons)
end
return table.revert(openDungeons)
end
-- 是否在活动副本时间内
function DungeonData:isActive(moduleKey)
if not self:isOpen(moduleKey) then
return false
end
-- 判断周期
if self:isActiveCycle(moduleKey, Time:getWeekByTimeStamp()) then
return true
else
return false
end
end
-- 判断是否在活跃周期内
function DungeonData:isActiveCycle(moduleKey, checkWeek)
if not self.dataDungeons[moduleKey] then
return false
end
for index, week in ipairs(self.dataDungeons[moduleKey]:getOpenWeekCycle()) do
if week == checkWeek then
return true
end
end
return false
end
-- 是否任意一个副本可以挑战
function DungeonData:isCanChallengeAnyone()
for key, value in pairs(self.dataDungeons) do
if self:isCanChallenge(key) then
return true
end
end
return false
end
-- 副本是否可以挑战
function DungeonData:isCanChallenge(moduleKey)
if not self:isActive(moduleKey) then
return false
end
if not (self:getRemainTimes(moduleKey) > 0) then
return false
end
if not self:isEnoughHp(moduleKey) then
return false
end
return true
end
-- 副本是否可以扫荡
function DungeonData:isCanSweep(moduleKey, id)
if not self:isActive(moduleKey) then
return false
end
if not (self:getRemainTimes(moduleKey) > 0) then
return false
end
if not self:isEnoughHp(moduleKey) then
return false
end
if not self:getPassedMaxId(moduleKey) >= id then
return false
end
return true
end
-- 获取副本挑战总次数
function DungeonData:getTotalCount(moduleKey)
return self.dataDungeons[moduleKey]:getTotalChallengeCount()
end
-- 获取副本今日剩余次数
function DungeonData:getRemainTimes(moduleKey)
if not self:isActive(moduleKey) then
return 0
end
if not self.dataDungeons[moduleKey] then
return 0
end
return self.dataDungeons[moduleKey]:getTodayRemainLimitCount()
end
-- 体力是否足够
function DungeonData:isEnoughHp(moduleKey)
local const = self:getChallengeHpCost(moduleKey)
local constNum = 0
if const then
constNum = GFunc.getRewardNum(const)
end
return constNum <= DataManager.BagData.ItemData:getVit()
end
-- 获取挑战体力消耗
function DungeonData:getChallengeHpCost(moduleKey)
if not self:isActive(moduleKey) then
return 0
end
if not self.dataDungeons[moduleKey] then
return 0
end
return self.dataDungeons[moduleKey]:getChallengeHpCost()
end
-- 获取副本下个状态改变时间
function DungeonData:geNextTime(moduleKey)
if self:isActive(moduleKey) then
return self:getCloseTime(moduleKey)
else
return self:getOpenTime(moduleKey)
end
end
-- 获取副本开启倒计时
function DungeonData:getOpenTime(moduleKey)
if not self.dataDungeons[moduleKey] then
return 0
end
local isClose = true
local count = 0
while isClose do
local checkWeek = Time:getWeekByTimeStamp(Time:getServerTime() + ((count + 1) * 86400))
if self:isActiveCycle(moduleKey, checkWeek) then
isClose = false
else
count = count + 1
end
end
return Time:getTodaySurplusTime() + (count * 86400)
end
-- 获取副本关闭倒计时
function DungeonData:getCloseTime(moduleKey)
if not self.dataDungeons[moduleKey] then
return 0
end
local isActive = true
local count = 0
while isActive do
local checkWeek = Time:getWeekByTimeStamp(Time:getServerTime() + ((count + 1) * 86400))
if not self:isActiveCycle(moduleKey, checkWeek) then
isActive = false
else
count = count + 1
end
end
return Time:getTodaySurplusTime() + (count * 86400)
end
-- 获取看板展示的副本奖励(返回icon)
function DungeonData:getBoardShowRewardIcon(moduleKey)
return self.dataDungeons[moduleKey]:getBoardShowRewardIcon()
end
-- 获取看板展示的副本奖励返回item id list
function DungeonData:getBoardShowRewardId(moduleKey)
return self.dataDungeons[moduleKey]:getBoardShowRewardId()
end
-- 获取展示副本首通奖励个数
function DungeonData:getFirstRewardNum(moduleKey, id)
-- 通关后,不展示首通奖励
return self.dataDungeons[moduleKey]:getFirstRewardNum(id)
end
-- 获取展示副本通关奖励个数
function DungeonData:getPassRewardNum(moduleKey, id)
return self.dataDungeons[moduleKey]:getPassRewardNum(id)
end
--获取副本已解锁最大id
function DungeonData:getUnlockMaxId(moduleKey)
local id = self.dataDungeons[moduleKey]:getPassedMaxId() + 1
if id > self:getConfigMaxId(moduleKey) then
id = id - 1
end
return id
end
-- 获取副本配置的最高关卡
function DungeonData:getConfigMaxId(moduleKey)
return #self.dataDungeons[moduleKey]:getConfig()
end
--获取副本已通关的最高关卡id
function DungeonData:getPassedMaxId(moduleKey)
return self.dataDungeons[moduleKey]:getPassedMaxId()
end
-- 获取副本标题文案
function DungeonData:getTitle(moduleKey)
return self.dataDungeons[moduleKey]:getTitleString()
end
-- 获取副本规则描述
function DungeonData:getRule(moduleKey)
return self.dataDungeons[moduleKey]:getRuleString()
end
-- 获取副本当前关卡buff
function DungeonData:getBossBuff(moduleKey, id)
return self.dataDungeons[moduleKey]:getBossBuff(id)
end
-- 获取副本开启时间描述
function DungeonData:getOpenTimeDesc(moduleKey)
return self.dataDungeons[moduleKey]:getOpenWeekString()
end
-- 获取副本角标图
function DungeonData:getIcon(moduleKey)
return self.dataDungeons[moduleKey]:getIcon()
end
-- 获取副本banner图
function DungeonData:getBanner(moduleKey)
return self.dataDungeons[moduleKey]:getBanner()
end
-- 获取开启时间文本颜色
function DungeonData:getOpenTextColor(moduleKey)
return self.dataDungeons[moduleKey]:getOpenTextColor()
end
function DungeonData:setCurFightChapterId(chapterId)
self.curFightchapterId = chapterId or 1
end
function DungeonData:getCurFightChapterId()
return self.curFightchapterId or 1
end
return DungeonData

View File

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

View File

@ -0,0 +1,117 @@
local DungeonDataBaseComp = class("DungeonDataBaseComp", BaseData)
-- 需要继承重写的部分 ***********************************************************
-- 初始化服务器数据
function DungeonDataBaseComp:init(data)
end
-- 获取副本模块名对应ModuleManager.MODULE_KEY
function DungeonDataBaseComp:getModuleKey()
return nil
end
-- 获取副本开启周期(星期几)
function DungeonDataBaseComp:getOpenWeekCycle()
return nil
end
-- 获取副本配置名称
function DungeonDataBaseComp:getConfigName()
return nil
end
-- 获取副本标题文案
function DungeonDataBaseComp:getTitleString()
return nil
end
-- 获取副本规则描述(金币副本)
function DungeonDataBaseComp:getRuleString()
return nil
end
-- 获取副本boss抗性(碎片副本)
function DungeonDataBaseComp:getBossBuff(id)
return nil
end
-- 获取开始时间描述
function DungeonDataBaseComp:getOpenWeekString()
return nil
end
-- 获取副本角标图
function DungeonDataBaseComp:getIcon()
return nil
end
-- 获取副本banner图
function DungeonDataBaseComp:getBanner()
return nil
end
-- 获取开启时间文本颜色
function DungeonDataBaseComp:getOpenTextColor()
return nil
end
-- 获取总挑战次数
function DungeonDataBaseComp:getTotalChallengeCount()
return nil
end
-- 获取今日已挑战次数
function DungeonDataBaseComp:getTodayChallengeCount()
return nil
end
-- 获取已通关的最大副本id
function DungeonDataBaseComp:getPassedMaxId()
return nil
end
-- 获取挑战体力消耗
function DungeonDataBaseComp:getChallengeHpCost()
return nil
end
-- 获取每日最大挑战次数
function DungeonDataBaseComp:getTodayMaxCount()
return nil
end
-- 获取看板展示的副本奖励(返回icon)
function DungeonDataBaseComp:getBoardShowRewardIcon()
return nil
end
-- 获取看板展示的副本奖励返回id list
function DungeonDataBaseComp:getBoardShowRewardId()
return nil
end
-- 获取首通奖励个数
function DungeonDataBaseComp:getFirstRewardNum()
return nil
end
-- 获取通关奖励个数
function DungeonDataBaseComp:getPassRewardNum()
return nil
end
-- 常规逻辑 *********************************************************************
-- 获取今日剩余挑战次数
function DungeonDataBaseComp:getTodayRemainLimitCount()
return self:getTodayMaxCount() - self:getTodayChallengeCount()
end
-- 获取副本配置
function DungeonDataBaseComp:getConfig()
return ConfigManager:getConfig(self:getConfigName())
end
return DungeonDataBaseComp

View File

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

View File

@ -0,0 +1,80 @@
local DungeonDataBaseComp = require "app/userdata/dungeon/dungeon_data_base_comp"
local DungeonGoldDataComp = class("DungeonGoldDataComp", DungeonDataBaseComp)
-- 金币副本数据
function DungeonGoldDataComp:init(data)
self.totalChallengeCount = data.total_challenge_count
self.todayChallengeCount = data.today_challenge_count
self.maxPassedId = data.max_chapter_gold_id
end
function DungeonGoldDataComp:getTotalChallengeCount()
return self.totalChallengeCount
end
function DungeonGoldDataComp:getTodayChallengeCount()
return self.todayChallengeCount
end
function DungeonGoldDataComp:getPassedMaxId()
return self.maxPassedId
end
function DungeonGoldDataComp:getModuleKey()
return ModuleManager.MODULE_KEY.DUNGEON_GOLD
end
function DungeonGoldDataComp:getOpenWeekCycle()
return {2,4,6,7}
end
function DungeonGoldDataComp:getConfigName()
return "chapter_dungeon_gold"
end
function DungeonGoldDataComp:getTitleString()
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_GOLD_TITLE)
end
function DungeonGoldDataComp:getRuleString()
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_GOLD_HELP)
end
function DungeonGoldDataComp:getOpenWeekString()
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_GOLD_OPEN)
end
function DungeonGoldDataComp:getIcon()
return {GConst.ATLAS_PATH.DUNGEON,"dungeon_dec_1"}
end
function DungeonGoldDataComp:getBanner()
return "assets/arts/textures/background/dungeon/dungeon_bg_1.png"
end
function DungeonGoldDataComp:getOpenTextColor()
return "#FFEDC5"
end
function DungeonGoldDataComp:getChallengeHpCost()
return GFunc.getConstReward("dungeon_gold_cost")
end
function DungeonGoldDataComp:getTodayMaxCount()
return GFunc.getConstIntValue("dungeon_gold_limit")
end
function DungeonGoldDataComp:getBoardShowRewardId()
return 1
end
function DungeonGoldDataComp:getFirstRewardNum(id)
return GFunc.getRewardNum(ConfigManager:getConfig("chapter_dungeon_gold")[id].first_pass_reward)
end
function DungeonGoldDataComp:getPassRewardNum(id)
return GFunc.getRewardNum(ConfigManager:getConfig("chapter_dungeon_gold")[id].percent_reward)
end
return DungeonGoldDataComp

View File

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

View File

@ -0,0 +1,97 @@
local DungeonDataBaseComp = require "app/userdata/dungeon/dungeon_data_base_comp"
local DungeonShardsDataComp = class("DungeonShardsDataComp", DungeonDataBaseComp)
-- 碎片副本数据
function DungeonShardsDataComp:init(data)
self.totalChallengeCount = data.total_challenge_count
self.todayChallengeCount = data.today_challenge_count
self.maxPassedId = data.max_chapter_shards_id
end
function DungeonShardsDataComp:getTotalChallengeCount()
return self.totalChallengeCount
end
function DungeonShardsDataComp:getTodayChallengeCount()
return self.todayChallengeCount
end
function DungeonShardsDataComp:getPassedMaxId()
return self.maxPassedId
end
function DungeonShardsDataComp:getModuleKey()
return ModuleManager.MODULE_KEY.DUNGEON_SHARDS
end
function DungeonShardsDataComp:getOpenWeekCycle()
return {1,3,5,7}
end
function DungeonShardsDataComp:getConfigName()
return "chapter_dungeon_shards"
end
function DungeonShardsDataComp:getTitleString()
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_SHARDS_TITLE)
end
function DungeonShardsDataComp:getRuleString()
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_SHARDS_HELP)
end
function DungeonShardsDataComp:getOpenWeekString()
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_SHARDS_OPEN)
end
function DungeonShardsDataComp:getBossBuff(id)
return self:getConfig()[id].effect[1]
end
function DungeonShardsDataComp:getIcon()
return {GConst.ATLAS_PATH.DUNGEON,"dungeon_dec_2"}
end
function DungeonShardsDataComp:getBanner()
return "assets/arts/textures/background/dungeon/dungeon_bg_2.png"
end
function DungeonShardsDataComp:getOpenTextColor()
return "#E4F5FE"
end
function DungeonShardsDataComp:getChallengeHpCost()
return GFunc.getConstReward("dungeon_shards_cost")
end
function DungeonShardsDataComp:getTodayMaxCount()
return GFunc.getConstIntValue("dungeon_shards_limit")
end
function DungeonShardsDataComp:getBoardShowRewardIcon()
return {GConst.ATLAS_PATH.ICON_ITEM,"20"}
end
function DungeonShardsDataComp:getFirstRewardNum(id)
local count = 0
for index, reward in ipairs(ConfigManager:getConfig("chapter_dungeon_shards")[id].first_pass_reward) do
count = count + GFunc.getRewardNum(reward)
end
return count
end
function DungeonShardsDataComp:getPassRewardNum(id)
local count = 0
local pass = ConfigManager:getConfig("chapter_dungeon_shards")[id].pass_reward
local wave = ConfigManager:getConfig("chapter_dungeon_shards")[id].wave_reward
for index, reward in ipairs(pass) do
count = count + GFunc.getRewardNum(reward)
end
for index, reward in ipairs(wave) do
count = count + GFunc.getRewardNum(reward)
end
return count
end
return DungeonShardsDataComp

View File

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