一些数据和更新配置

This commit is contained in:
xiekaidong 2023-05-25 17:15:36 +08:00 committed by Fang
parent 55983ad95a
commit 5c1307ad0d
26 changed files with 692 additions and 22 deletions

View File

@ -87,6 +87,8 @@ BIReport.ITEM_GET_TYPE = {
LEVEL_FUND = "LevelFund",
SEVEN_DAY_TASK = "SevenDayTask",
SEVEN_DAY_STEP_REWARD = "SevenDayStepReward",
DAILY_CHALLENGE = "DailyChallenge",
DAILY_CHALLENGE_END = "DailyChallengeEnd",
}
BIReport.ADS_CLICK_TYPE = {

View File

@ -60,6 +60,21 @@ function ConfigManager:getConfigWithOtherKey(configName, keyName)
return config.keys[keyName]
end
function ConfigManager:getMainKeyWithOtherKey(configName, keyName, keyValue)
local config = self.configs[configName]
if config == nil then
config = self:_getConfig(configName)
end
if config.keys == nil then
return nil
end
local kv = config.keys[keyName]
if kv[keyValue] then
return kv[keyValue]._id
end
return nil
end
function ConfigManager:reloadAllConfig()
for configName, v in pairs(self.configs) do
self:reloadConfig(configName)

View File

@ -117,7 +117,7 @@ function DataManager:initWithServerData(data)
self.todayFirstLogin = data.today_first_login
self.PlayerData:init(data)
self.ChapterData:init(data.chapter)
self.DailyChallengeData:init(data.daily_challenge)
self.DailyChallengeData:init(data.chapter_daily_challenge)
self.HeroData:init(data.bag.heroes)
self.BagData:init(data.bag)
self.FormationData:init(data.fight_info)

View File

@ -362,6 +362,11 @@ function I18N:getText(configName, index, key, ...)
return str
end
function I18N:getTextWithOtherKey(configName, otherKey, otherKeyValue, key, ...)
local index = ConfigManager:getMainKeyWithOtherKey(configName, otherKey, otherKeyValue)
return self:getText(configName, index, key, ...)
end
function I18N:getFallbackLanguage()
if not self.fallbackLanguage then
local languageInfo = CS.BF.BFPlatform.GetCurrentLanguageInfo()

View File

@ -24,7 +24,7 @@ local MODULE_PATHS = {
-- 主线关卡
ChapterManager = "app/module/chapter/chapter_manager",
-- 每日挑战
DailyChallengeManager = "app/module/daily_challenge/daily_challenge",
DailyChallengeManager = "app/module/daily_challenge/daily_challenge_manager",
-- 挂机
IdleManager = "app/module/idle/idle_manager",
-- 七天乐

View File

@ -1,20 +1,26 @@
local attr = {
[1]={
["_id"]=1,
["name"]="hp"
},
[2]={
["_id"]=2,
["name"]="atk_red"
},
[3]={
["_id"]=3,
["name"]="atk_yellow"
},
[4]={
["_id"]=4,
["name"]="atk_green"
},
[5]={
["_id"]=5,
["name"]="atk_blue"
},
[6]={
["_id"]=6,
["name"]="atk_purple"
}
}

View File

@ -1,11 +1,13 @@
local buff = {
[1]={
["_id"]=1,
["name"]="hurt",
["buff_type"]=3,
["decr"]=3,
["formula"]=1
},
[2]={
["_id"]=2,
["name"]="hurt_red",
["buff_type"]=3,
["position"]=1,
@ -13,6 +15,7 @@ local buff = {
["formula"]=1
},
[3]={
["_id"]=3,
["name"]="hurt_yellow",
["buff_type"]=3,
["position"]=2,
@ -20,6 +23,7 @@ local buff = {
["formula"]=1
},
[4]={
["_id"]=4,
["name"]="hurt_green",
["buff_type"]=3,
["position"]=3,
@ -27,6 +31,7 @@ local buff = {
["formula"]=1
},
[5]={
["_id"]=5,
["name"]="hurt_blue",
["buff_type"]=3,
["position"]=4,
@ -34,6 +39,7 @@ local buff = {
["formula"]=1
},
[6]={
["_id"]=6,
["name"]="hurt_purple",
["buff_type"]=3,
["position"]=5,
@ -41,6 +47,7 @@ local buff = {
["formula"]=1
},
[7]={
["_id"]=7,
["name"]="dec_dmg_red_add",
["buff_type"]=1,
["stack"]=2,
@ -49,6 +56,7 @@ local buff = {
["icon"]="dec_dmg_red_add"
},
[8]={
["_id"]=8,
["name"]="dec_dmg_yellow_add",
["buff_type"]=1,
["stack"]=2,
@ -57,6 +65,7 @@ local buff = {
["icon"]="dec_dmg_yellow_add"
},
[9]={
["_id"]=9,
["name"]="dec_dmg_green_add",
["buff_type"]=1,
["stack"]=2,
@ -65,6 +74,7 @@ local buff = {
["icon"]="dec_dmg_green_add"
},
[10]={
["_id"]=10,
["name"]="dec_dmg_blue_add",
["buff_type"]=1,
["stack"]=2,
@ -73,6 +83,7 @@ local buff = {
["icon"]="dec_dmg_blue_add"
},
[11]={
["_id"]=11,
["name"]="dec_dmg_purple_add",
["buff_type"]=1,
["stack"]=2,
@ -81,6 +92,7 @@ local buff = {
["icon"]="dec_dmg_purple_add"
},
[12]={
["_id"]=12,
["name"]="dec_dmg_all_add",
["buff_type"]=1,
["stack"]=2,
@ -88,6 +100,7 @@ local buff = {
["icon"]="dec_dmg_all_add"
},
[13]={
["_id"]=13,
["name"]="weakness_red_add",
["buff_type"]=1,
["stack"]=2,
@ -95,6 +108,7 @@ local buff = {
["decr"]=2
},
[14]={
["_id"]=14,
["name"]="weakness_yellow_add",
["buff_type"]=1,
["stack"]=2,
@ -102,6 +116,7 @@ local buff = {
["decr"]=2
},
[15]={
["_id"]=15,
["name"]="weakness_green_add",
["buff_type"]=1,
["stack"]=2,
@ -109,6 +124,7 @@ local buff = {
["decr"]=2
},
[16]={
["_id"]=16,
["name"]="weakness_blue_add",
["buff_type"]=1,
["stack"]=2,
@ -116,6 +132,7 @@ local buff = {
["decr"]=2
},
[17]={
["_id"]=17,
["name"]="weakness_purple_add",
["buff_type"]=1,
["stack"]=2,
@ -123,12 +140,14 @@ local buff = {
["decr"]=2
},
[18]={
["_id"]=18,
["name"]="weakness_all_add",
["buff_type"]=1,
["stack"]=2,
["decr"]=2
},
[19]={
["_id"]=19,
["name"]="dmg_addition_red_add",
["buff_type"]=1,
["stack"]=2,
@ -136,6 +155,7 @@ local buff = {
["decr"]=1
},
[20]={
["_id"]=20,
["name"]="dmg_addition_yellow_add",
["buff_type"]=1,
["stack"]=2,
@ -143,6 +163,7 @@ local buff = {
["decr"]=1
},
[21]={
["_id"]=21,
["name"]="dmg_addition_green_add",
["buff_type"]=1,
["stack"]=2,
@ -150,6 +171,7 @@ local buff = {
["decr"]=1
},
[22]={
["_id"]=22,
["name"]="dmg_addition_blue_add",
["buff_type"]=1,
["stack"]=2,
@ -157,6 +179,7 @@ local buff = {
["decr"]=1
},
[23]={
["_id"]=23,
["name"]="dmg_addition_purple_add",
["buff_type"]=1,
["stack"]=2,
@ -164,18 +187,21 @@ local buff = {
["decr"]=1
},
[24]={
["_id"]=24,
["name"]="dmg_addition_all_add",
["buff_type"]=1,
["stack"]=2,
["decr"]=1
},
[25]={
["_id"]=25,
["name"]="atkp_color_add",
["buff_type"]=1,
["stack"]=2,
["decr"]=1
},
[26]={
["_id"]=26,
["name"]="atkp_red_add",
["buff_type"]=1,
["stack"]=2,
@ -183,6 +209,7 @@ local buff = {
["decr"]=1
},
[27]={
["_id"]=27,
["name"]="atkp_yellow_add",
["buff_type"]=1,
["stack"]=2,
@ -190,6 +217,7 @@ local buff = {
["decr"]=1
},
[28]={
["_id"]=28,
["name"]="atkp_green_add",
["buff_type"]=1,
["stack"]=2,
@ -197,6 +225,7 @@ local buff = {
["decr"]=1
},
[29]={
["_id"]=29,
["name"]="atkp_blue_add",
["buff_type"]=1,
["stack"]=2,
@ -204,6 +233,7 @@ local buff = {
["decr"]=1
},
[30]={
["_id"]=30,
["name"]="atkp_purple_add",
["buff_type"]=1,
["stack"]=2,
@ -211,6 +241,7 @@ local buff = {
["decr"]=1
},
[31]={
["_id"]=31,
["name"]="wavehealp",
["buff_type"]=5,
["stack"]=2,
@ -218,6 +249,7 @@ local buff = {
["formula"]=2
},
[32]={
["_id"]=32,
["name"]="heal",
["buff_type"]=5,
["stack"]=2,
@ -228,6 +260,7 @@ local buff = {
}
},
[33]={
["_id"]=33,
["name"]="stun",
["buff_type"]=8,
["decr"]=2,
@ -238,6 +271,7 @@ local buff = {
}
},
[34]={
["_id"]=34,
["name"]="shield",
["buff_type"]=2,
["decr"]=3,
@ -250,12 +284,14 @@ local buff = {
}
},
[35]={
["_id"]=35,
["name"]="atkp_add",
["buff_type"]=1,
["stack"]=2,
["decr"]=1
},
[36]={
["_id"]=36,
["name"]="normal_attack_dec",
["buff_type"]=1,
["decr"]=2,
@ -265,6 +301,7 @@ local buff = {
}
},
[37]={
["_id"]=37,
["name"]="normal_attack_add",
["buff_type"]=1,
["stack"]=2,
@ -272,60 +309,70 @@ local buff = {
["icon"]="normal_attack_dec"
},
[38]={
["_id"]=38,
["name"]="block",
["buff_type"]=1,
["stack"]=2,
["decr"]=1
},
[39]={
["_id"]=39,
["name"]="hpp_add",
["buff_type"]=1,
["stack"]=2,
["decr"]=1
},
[40]={
["_id"]=40,
["name"]="crit_add",
["buff_type"]=1,
["stack"]=2,
["decr"]=1
},
[41]={
["_id"]=41,
["name"]="crit_time_add",
["buff_type"]=1,
["stack"]=2,
["decr"]=1
},
[42]={
["_id"]=42,
["name"]="exp_time_add",
["buff_type"]=7,
["stack"]=2,
["decr"]=1
},
[43]={
["_id"]=43,
["name"]="cured_add",
["buff_type"]=1,
["stack"]=2,
["decr"]=1
},
[44]={
["_id"]=44,
["name"]="cured_dec",
["buff_type"]=1,
["stack"]=2,
["decr"]=2
},
[45]={
["_id"]=45,
["name"]="add_skill",
["buff_type"]=7,
["stack"]=2,
["decr"]=3
},
[46]={
["_id"]=46,
["name"]="skill_fire_times",
["buff_type"]=7,
["stack"]=2,
["decr"]=3
},
[47]={
["_id"]=47,
["name"]="shield_rebound_200",
["buff_type"]=2,
["decr"]=3,
@ -338,6 +385,7 @@ local buff = {
}
},
[48]={
["_id"]=48,
["name"]="burn",
["buff_type"]=4,
["stack"]=1,
@ -346,12 +394,14 @@ local buff = {
["icon"]="shield"
},
[49]={
["_id"]=49,
["name"]="vulnerable",
["buff_type"]=1,
["decr"]=2,
["icon"]="shield"
},
[50]={
["_id"]=50,
["name"]="frozen",
["buff_type"]=7,
["decr"]=2,
@ -359,6 +409,7 @@ local buff = {
["control_priority"]=1
},
[51]={
["_id"]=51,
["name"]="poison",
["buff_type"]=4,
["stack"]=2,
@ -367,6 +418,7 @@ local buff = {
["icon"]="shield"
},
[52]={
["_id"]=52,
["name"]="imprison",
["buff_type"]=7,
["decr"]=2,
@ -374,12 +426,14 @@ local buff = {
["control_priority"]=4
},
[53]={
["_id"]=53,
["name"]="corrupt",
["buff_type"]=1,
["decr"]=2,
["icon"]="shield"
},
[54]={
["_id"]=54,
["name"]="bleed",
["buff_type"]=7,
["decr"]=2,
@ -387,12 +441,14 @@ local buff = {
["icon"]="shield"
},
[55]={
["_id"]=55,
["name"]="weaken",
["buff_type"]=1,
["decr"]=2,
["icon"]="shield"
},
[56]={
["_id"]=56,
["name"]="lethargy",
["buff_type"]=8,
["stack"]=1,
@ -401,36 +457,42 @@ local buff = {
["control_priority"]=3
},
[57]={
["_id"]=57,
["name"]="curse",
["buff_type"]=1,
["decr"]=2,
["icon"]="shield"
},
[58]={
["_id"]=58,
["name"]="lock",
["buff_type"]=7,
["decr"]=2,
["icon"]="shield"
},
[59]={
["_id"]=59,
["name"]="first_hand",
["buff_type"]=1,
["decr"]=1,
["icon"]="shield"
},
[60]={
["_id"]=60,
["name"]="skill_hurt_add",
["buff_type"]=1,
["stack"]=2,
["decr"]=1
},
[61]={
["_id"]=61,
["name"]="undead",
["buff_type"]=7,
["decr"]=1,
["icon"]="shield"
},
[62]={
["_id"]=62,
["name"]="counterattack",
["buff_type"]=1,
["stack"]=1,
@ -438,12 +500,14 @@ local buff = {
["icon"]="shield"
},
[63]={
["_id"]=63,
["name"]="thorns",
["buff_type"]=1,
["decr"]=1,
["icon"]="shield"
},
[64]={
["_id"]=64,
["name"]="dmg_dec_red_add",
["buff_type"]=1,
["stack"]=2,
@ -451,6 +515,7 @@ local buff = {
["decr"]=2
},
[65]={
["_id"]=65,
["name"]="dmg_dec_yellow_add",
["buff_type"]=1,
["stack"]=2,
@ -458,6 +523,7 @@ local buff = {
["decr"]=2
},
[66]={
["_id"]=66,
["name"]="dmg_dec_green_add",
["buff_type"]=1,
["stack"]=2,
@ -465,6 +531,7 @@ local buff = {
["decr"]=2
},
[67]={
["_id"]=67,
["name"]="dmg_dec_blue_add",
["buff_type"]=1,
["stack"]=2,
@ -472,6 +539,7 @@ local buff = {
["decr"]=2
},
[68]={
["_id"]=68,
["name"]="dmg_dec_purple_add",
["buff_type"]=1,
["stack"]=2,
@ -479,27 +547,32 @@ local buff = {
["decr"]=2
},
[69]={
["_id"]=69,
["name"]="dmg_dec_all_add",
["buff_type"]=1,
["stack"]=2,
["decr"]=2
},
[70]={
["_id"]=70,
["name"]="be_sucked",
["buff_type"]=1,
["decr"]=2
},
[71]={
["_id"]=71,
["name"]="be_dmg_to_heal",
["buff_type"]=1,
["decr"]=2
},
[72]={
["_id"]=72,
["name"]="death_summon",
["buff_type"]=1,
["decr"]=3
},
[73]={
["_id"]=73,
["name"]="shield_rebound_400",
["buff_type"]=2,
["decr"]=3,
@ -512,6 +585,7 @@ local buff = {
}
},
[74]={
["_id"]=74,
["name"]="shield_ice",
["buff_type"]=2,
["decr"]=3,
@ -524,6 +598,7 @@ local buff = {
}
},
[75]={
["_id"]=75,
["name"]="shield_ice_rebound_400",
["buff_type"]=2,
["decr"]=3,

View File

@ -19,12 +19,12 @@ local hero = {
["rouge_skill_7"]=1200107,
["begin_lv"]=1,
["hp"]={
2000000000,
2400000000,
2000000,
2400000,
2800000,
3220000,
3660000000,
4120000000,
3660000,
4120000,
4620000,
5160000,
5760000,
@ -40,7 +40,7 @@ local hero = {
1200000,
1400000,
1610000,
18300000,
1830000,
2060000,
2310000,
2580000,

View File

@ -1,117 +1,146 @@
local buff = {
[7]={
["_id"]=7,
["desc"]="红色抗性:受到红色元素英雄的伤害降低{0}。",
["name"]="dec_dmg_red_add"
},
[8]={
["_id"]=8,
["desc"]="黄色抗性:受到黄色元素英雄的伤害降低{0}。",
["name"]="dec_dmg_yellow_add"
},
[9]={
["_id"]=9,
["desc"]="绿色抗性:受到绿色元素英雄的伤害降低{0}。",
["name"]="dec_dmg_green_add"
},
[10]={
["_id"]=10,
["desc"]="蓝色抗性:受到蓝色元素英雄的伤害降低{0}。",
["name"]="dec_dmg_blue_add"
},
[11]={
["_id"]=11,
["desc"]="紫色抗性:受到紫色元素英雄的伤害降低{0}。",
["name"]="dec_dmg_purple_add"
},
[12]={
["_id"]=12,
["desc"]="极致抗性:受到所有英雄的伤害降低{0}。",
["name"]="dec_dmg_all_add"
},
[33]={
["_id"]=33,
["desc"]="眩晕:本回合无法行动。",
["name"]="stun"
},
[34]={
["_id"]=34,
["desc"]="护盾:可承受最大生命值{0}的伤害。",
["name"]="shield"
},
[36]={
["_id"]=36,
["desc"]="冰霜:普攻次数-{0}。",
["name"]="normal_attack_dec"
},
[37]={
["_id"]=37,
["desc"]="亢奋:普攻次数+{0}。",
["name"]="normal_attack_add"
},
[47]={
["_id"]=47,
["desc"]="反伤护盾:可承受最大生命值{0}的伤害反弹200%对方伤害。",
["name"]="shield_rebound_200"
},
[48]={
["_id"]=48,
["desc"]="灼烧:回合结束时造成释放者攻击力{0}的伤害。",
["name"]="burn"
},
[49]={
["_id"]=49,
["desc"]="易伤:受到所有伤害提升{0}。",
["name"]="vulnerable"
},
[50]={
["_id"]=50,
["desc"]="冻结:本回合无法行动,且增益效果不生效。",
["name"]="frozen"
},
[51]={
["_id"]=51,
["desc"]="中毒:回合结束时造成释放者攻击力{0}的伤害。",
["name"]="poison"
},
[52]={
["_id"]=52,
["desc"]="禁锢:本回合只可使用普攻。",
["name"]="imprison"
},
[53]={
["_id"]=53,
["desc"]="腐败:生命恢复效果降低{0}。",
["name"]="corrupt"
},
[54]={
["_id"]=54,
["desc"]="流血:受击时恢复攻击者生命,回合结束时造成释放者攻击力{0}的伤害。",
["name"]="bleed"
},
[55]={
["_id"]=55,
["desc"]="虚弱:造成的伤害降低{0}。",
["name"]="weaken"
},
[56]={
["_id"]=56,
["desc"]="昏睡:本回合无法行动,受击会移除效果。",
["name"]="lethargy"
},
[57]={
["_id"]=57,
["desc"]="诅咒:攻击不会造成伤害,而是治疗对方。",
["name"]="curse"
},
[58]={
["_id"]=58,
["desc"]="锁定:随机锁定棋盘上的一种颜色,无法选中。",
["name"]="lock"
},
[59]={
["_id"]=59,
["desc"]="先手:每回合都率先出手。",
["name"]="first_hand"
},
[61]={
["_id"]=61,
["desc"]="不死:受到致命伤害不会死亡。",
["name"]="undead"
},
[62]={
["_id"]=62,
["desc"]="反击:受到直接时有{0}的概率进行反击。",
["name"]="counterattack"
},
[63]={
["_id"]=63,
["desc"]="反伤:反弹{0}对方伤害。",
["name"]="thorns"
},
[73]={
["_id"]=73,
["desc"]="反伤护盾:可承受最大生命值{0}的伤害反弹400%对方伤害。",
["name"]="shield_rebound_400"
},
[74]={
["_id"]=74,
["desc"]="冰霜护盾:可承受最大生命值{0}的伤害。",
["name"]="shield_ice"
},
[75]={
["_id"]=75,
["desc"]="冰霜护盾:可承受最大生命值{0}的伤害反弹400%对方伤害。",
["name"]="shield_ice_rebound_400"
}

View File

@ -1,89 +1,118 @@
local buff = {
[7]={
["_id"]=7,
["name"]="dec_dmg_red_add"
},
[8]={
["_id"]=8,
["name"]="dec_dmg_yellow_add"
},
[9]={
["_id"]=9,
["name"]="dec_dmg_green_add"
},
[10]={
["_id"]=10,
["name"]="dec_dmg_blue_add"
},
[11]={
["_id"]=11,
["name"]="dec_dmg_purple_add"
},
[12]={
["_id"]=12,
["name"]="dec_dmg_all_add"
},
[33]={
["_id"]=33,
["name"]="stun"
},
[34]={
["_id"]=34,
["name"]="shield"
},
[36]={
["_id"]=36,
["name"]="normal_attack_dec"
},
[37]={
["_id"]=37,
["name"]="normal_attack_add"
},
[47]={
["_id"]=47,
["name"]="shield_rebound_200"
},
[48]={
["_id"]=48,
["name"]="burn"
},
[49]={
["_id"]=49,
["name"]="vulnerable"
},
[50]={
["_id"]=50,
["name"]="frozen"
},
[51]={
["_id"]=51,
["name"]="poison"
},
[52]={
["_id"]=52,
["name"]="imprison"
},
[53]={
["_id"]=53,
["name"]="corrupt"
},
[54]={
["_id"]=54,
["name"]="bleed"
},
[55]={
["_id"]=55,
["name"]="weaken"
},
[56]={
["_id"]=56,
["name"]="lethargy"
},
[57]={
["_id"]=57,
["name"]="curse"
},
[58]={
["_id"]=58,
["name"]="lock"
},
[59]={
["_id"]=59,
["name"]="first_hand"
},
[61]={
["_id"]=61,
["name"]="undead"
},
[62]={
["_id"]=62,
["name"]="counterattack"
},
[63]={
["_id"]=63,
["name"]="thorns"
},
[73]={
["_id"]=73,
["name"]="shield_rebound_400"
},
[74]={
["_id"]=74,
["name"]="shield_ice"
},
[75]={
["_id"]=75,
["name"]="shield_ice_rebound_400"
}
}

View File

@ -1,89 +1,118 @@
local buff = {
[7]={
["_id"]=7,
["name"]="dec_dmg_red_add"
},
[8]={
["_id"]=8,
["name"]="dec_dmg_yellow_add"
},
[9]={
["_id"]=9,
["name"]="dec_dmg_green_add"
},
[10]={
["_id"]=10,
["name"]="dec_dmg_blue_add"
},
[11]={
["_id"]=11,
["name"]="dec_dmg_purple_add"
},
[12]={
["_id"]=12,
["name"]="dec_dmg_all_add"
},
[33]={
["_id"]=33,
["name"]="stun"
},
[34]={
["_id"]=34,
["name"]="shield"
},
[36]={
["_id"]=36,
["name"]="normal_attack_dec"
},
[37]={
["_id"]=37,
["name"]="normal_attack_add"
},
[47]={
["_id"]=47,
["name"]="shield_rebound_200"
},
[48]={
["_id"]=48,
["name"]="burn"
},
[49]={
["_id"]=49,
["name"]="vulnerable"
},
[50]={
["_id"]=50,
["name"]="frozen"
},
[51]={
["_id"]=51,
["name"]="poison"
},
[52]={
["_id"]=52,
["name"]="imprison"
},
[53]={
["_id"]=53,
["name"]="corrupt"
},
[54]={
["_id"]=54,
["name"]="bleed"
},
[55]={
["_id"]=55,
["name"]="weaken"
},
[56]={
["_id"]=56,
["name"]="lethargy"
},
[57]={
["_id"]=57,
["name"]="curse"
},
[58]={
["_id"]=58,
["name"]="lock"
},
[59]={
["_id"]=59,
["name"]="first_hand"
},
[61]={
["_id"]=61,
["name"]="undead"
},
[62]={
["_id"]=62,
["name"]="counterattack"
},
[63]={
["_id"]=63,
["name"]="thorns"
},
[73]={
["_id"]=73,
["name"]="shield_rebound_400"
},
[74]={
["_id"]=74,
["name"]="shield_ice"
},
[75]={
["_id"]=75,
["name"]="shield_ice_rebound_400"
}
}

View File

@ -1,89 +1,118 @@
local buff = {
[7]={
["_id"]=7,
["name"]="dec_dmg_red_add"
},
[8]={
["_id"]=8,
["name"]="dec_dmg_yellow_add"
},
[9]={
["_id"]=9,
["name"]="dec_dmg_green_add"
},
[10]={
["_id"]=10,
["name"]="dec_dmg_blue_add"
},
[11]={
["_id"]=11,
["name"]="dec_dmg_purple_add"
},
[12]={
["_id"]=12,
["name"]="dec_dmg_all_add"
},
[33]={
["_id"]=33,
["name"]="stun"
},
[34]={
["_id"]=34,
["name"]="shield"
},
[36]={
["_id"]=36,
["name"]="normal_attack_dec"
},
[37]={
["_id"]=37,
["name"]="normal_attack_add"
},
[47]={
["_id"]=47,
["name"]="shield_rebound_200"
},
[48]={
["_id"]=48,
["name"]="burn"
},
[49]={
["_id"]=49,
["name"]="vulnerable"
},
[50]={
["_id"]=50,
["name"]="frozen"
},
[51]={
["_id"]=51,
["name"]="poison"
},
[52]={
["_id"]=52,
["name"]="imprison"
},
[53]={
["_id"]=53,
["name"]="corrupt"
},
[54]={
["_id"]=54,
["name"]="bleed"
},
[55]={
["_id"]=55,
["name"]="weaken"
},
[56]={
["_id"]=56,
["name"]="lethargy"
},
[57]={
["_id"]=57,
["name"]="curse"
},
[58]={
["_id"]=58,
["name"]="lock"
},
[59]={
["_id"]=59,
["name"]="first_hand"
},
[61]={
["_id"]=61,
["name"]="undead"
},
[62]={
["_id"]=62,
["name"]="counterattack"
},
[63]={
["_id"]=63,
["name"]="thorns"
},
[73]={
["_id"]=73,
["name"]="shield_rebound_400"
},
[74]={
["_id"]=74,
["name"]="shield_ice"
},
[75]={
["_id"]=75,
["name"]="shield_ice_rebound_400"
}
}

View File

@ -1,89 +1,118 @@
local buff = {
[7]={
["_id"]=7,
["name"]="dec_dmg_red_add"
},
[8]={
["_id"]=8,
["name"]="dec_dmg_yellow_add"
},
[9]={
["_id"]=9,
["name"]="dec_dmg_green_add"
},
[10]={
["_id"]=10,
["name"]="dec_dmg_blue_add"
},
[11]={
["_id"]=11,
["name"]="dec_dmg_purple_add"
},
[12]={
["_id"]=12,
["name"]="dec_dmg_all_add"
},
[33]={
["_id"]=33,
["name"]="stun"
},
[34]={
["_id"]=34,
["name"]="shield"
},
[36]={
["_id"]=36,
["name"]="normal_attack_dec"
},
[37]={
["_id"]=37,
["name"]="normal_attack_add"
},
[47]={
["_id"]=47,
["name"]="shield_rebound_200"
},
[48]={
["_id"]=48,
["name"]="burn"
},
[49]={
["_id"]=49,
["name"]="vulnerable"
},
[50]={
["_id"]=50,
["name"]="frozen"
},
[51]={
["_id"]=51,
["name"]="poison"
},
[52]={
["_id"]=52,
["name"]="imprison"
},
[53]={
["_id"]=53,
["name"]="corrupt"
},
[54]={
["_id"]=54,
["name"]="bleed"
},
[55]={
["_id"]=55,
["name"]="weaken"
},
[56]={
["_id"]=56,
["name"]="lethargy"
},
[57]={
["_id"]=57,
["name"]="curse"
},
[58]={
["_id"]=58,
["name"]="lock"
},
[59]={
["_id"]=59,
["name"]="first_hand"
},
[61]={
["_id"]=61,
["name"]="undead"
},
[62]={
["_id"]=62,
["name"]="counterattack"
},
[63]={
["_id"]=63,
["name"]="thorns"
},
[73]={
["_id"]=73,
["name"]="shield_rebound_400"
},
[74]={
["_id"]=74,
["name"]="shield_ice"
},
[75]={
["_id"]=75,
["name"]="shield_ice_rebound_400"
}
}

View File

@ -1,89 +1,118 @@
local buff = {
[7]={
["_id"]=7,
["name"]="dec_dmg_red_add"
},
[8]={
["_id"]=8,
["name"]="dec_dmg_yellow_add"
},
[9]={
["_id"]=9,
["name"]="dec_dmg_green_add"
},
[10]={
["_id"]=10,
["name"]="dec_dmg_blue_add"
},
[11]={
["_id"]=11,
["name"]="dec_dmg_purple_add"
},
[12]={
["_id"]=12,
["name"]="dec_dmg_all_add"
},
[33]={
["_id"]=33,
["name"]="stun"
},
[34]={
["_id"]=34,
["name"]="shield"
},
[36]={
["_id"]=36,
["name"]="normal_attack_dec"
},
[37]={
["_id"]=37,
["name"]="normal_attack_add"
},
[47]={
["_id"]=47,
["name"]="shield_rebound_200"
},
[48]={
["_id"]=48,
["name"]="burn"
},
[49]={
["_id"]=49,
["name"]="vulnerable"
},
[50]={
["_id"]=50,
["name"]="frozen"
},
[51]={
["_id"]=51,
["name"]="poison"
},
[52]={
["_id"]=52,
["name"]="imprison"
},
[53]={
["_id"]=53,
["name"]="corrupt"
},
[54]={
["_id"]=54,
["name"]="bleed"
},
[55]={
["_id"]=55,
["name"]="weaken"
},
[56]={
["_id"]=56,
["name"]="lethargy"
},
[57]={
["_id"]=57,
["name"]="curse"
},
[58]={
["_id"]=58,
["name"]="lock"
},
[59]={
["_id"]=59,
["name"]="first_hand"
},
[61]={
["_id"]=61,
["name"]="undead"
},
[62]={
["_id"]=62,
["name"]="counterattack"
},
[63]={
["_id"]=63,
["name"]="thorns"
},
[73]={
["_id"]=73,
["name"]="shield_rebound_400"
},
[74]={
["_id"]=74,
["name"]="shield_ice"
},
[75]={
["_id"]=75,
["name"]="shield_ice_rebound_400"
}
}

View File

@ -1,89 +1,118 @@
local buff = {
[7]={
["_id"]=7,
["name"]="dec_dmg_red_add"
},
[8]={
["_id"]=8,
["name"]="dec_dmg_yellow_add"
},
[9]={
["_id"]=9,
["name"]="dec_dmg_green_add"
},
[10]={
["_id"]=10,
["name"]="dec_dmg_blue_add"
},
[11]={
["_id"]=11,
["name"]="dec_dmg_purple_add"
},
[12]={
["_id"]=12,
["name"]="dec_dmg_all_add"
},
[33]={
["_id"]=33,
["name"]="stun"
},
[34]={
["_id"]=34,
["name"]="shield"
},
[36]={
["_id"]=36,
["name"]="normal_attack_dec"
},
[37]={
["_id"]=37,
["name"]="normal_attack_add"
},
[47]={
["_id"]=47,
["name"]="shield_rebound_200"
},
[48]={
["_id"]=48,
["name"]="burn"
},
[49]={
["_id"]=49,
["name"]="vulnerable"
},
[50]={
["_id"]=50,
["name"]="frozen"
},
[51]={
["_id"]=51,
["name"]="poison"
},
[52]={
["_id"]=52,
["name"]="imprison"
},
[53]={
["_id"]=53,
["name"]="corrupt"
},
[54]={
["_id"]=54,
["name"]="bleed"
},
[55]={
["_id"]=55,
["name"]="weaken"
},
[56]={
["_id"]=56,
["name"]="lethargy"
},
[57]={
["_id"]=57,
["name"]="curse"
},
[58]={
["_id"]=58,
["name"]="lock"
},
[59]={
["_id"]=59,
["name"]="first_hand"
},
[61]={
["_id"]=61,
["name"]="undead"
},
[62]={
["_id"]=62,
["name"]="counterattack"
},
[63]={
["_id"]=63,
["name"]="thorns"
},
[73]={
["_id"]=73,
["name"]="shield_rebound_400"
},
[74]={
["_id"]=74,
["name"]="shield_ice"
},
[75]={
["_id"]=75,
["name"]="shield_ice_rebound_400"
}
}

View File

@ -1,89 +1,118 @@
local buff = {
[7]={
["_id"]=7,
["name"]="dec_dmg_red_add"
},
[8]={
["_id"]=8,
["name"]="dec_dmg_yellow_add"
},
[9]={
["_id"]=9,
["name"]="dec_dmg_green_add"
},
[10]={
["_id"]=10,
["name"]="dec_dmg_blue_add"
},
[11]={
["_id"]=11,
["name"]="dec_dmg_purple_add"
},
[12]={
["_id"]=12,
["name"]="dec_dmg_all_add"
},
[33]={
["_id"]=33,
["name"]="stun"
},
[34]={
["_id"]=34,
["name"]="shield"
},
[36]={
["_id"]=36,
["name"]="normal_attack_dec"
},
[37]={
["_id"]=37,
["name"]="normal_attack_add"
},
[47]={
["_id"]=47,
["name"]="shield_rebound_200"
},
[48]={
["_id"]=48,
["name"]="burn"
},
[49]={
["_id"]=49,
["name"]="vulnerable"
},
[50]={
["_id"]=50,
["name"]="frozen"
},
[51]={
["_id"]=51,
["name"]="poison"
},
[52]={
["_id"]=52,
["name"]="imprison"
},
[53]={
["_id"]=53,
["name"]="corrupt"
},
[54]={
["_id"]=54,
["name"]="bleed"
},
[55]={
["_id"]=55,
["name"]="weaken"
},
[56]={
["_id"]=56,
["name"]="lethargy"
},
[57]={
["_id"]=57,
["name"]="curse"
},
[58]={
["_id"]=58,
["name"]="lock"
},
[59]={
["_id"]=59,
["name"]="first_hand"
},
[61]={
["_id"]=61,
["name"]="undead"
},
[62]={
["_id"]=62,
["name"]="counterattack"
},
[63]={
["_id"]=63,
["name"]="thorns"
},
[73]={
["_id"]=73,
["name"]="shield_rebound_400"
},
[74]={
["_id"]=74,
["name"]="shield_ice"
},
[75]={
["_id"]=75,
["name"]="shield_ice_rebound_400"
}
}

View File

@ -1,89 +1,118 @@
local buff = {
[7]={
["_id"]=7,
["name"]="dec_dmg_red_add"
},
[8]={
["_id"]=8,
["name"]="dec_dmg_yellow_add"
},
[9]={
["_id"]=9,
["name"]="dec_dmg_green_add"
},
[10]={
["_id"]=10,
["name"]="dec_dmg_blue_add"
},
[11]={
["_id"]=11,
["name"]="dec_dmg_purple_add"
},
[12]={
["_id"]=12,
["name"]="dec_dmg_all_add"
},
[33]={
["_id"]=33,
["name"]="stun"
},
[34]={
["_id"]=34,
["name"]="shield"
},
[36]={
["_id"]=36,
["name"]="normal_attack_dec"
},
[37]={
["_id"]=37,
["name"]="normal_attack_add"
},
[47]={
["_id"]=47,
["name"]="shield_rebound_200"
},
[48]={
["_id"]=48,
["name"]="burn"
},
[49]={
["_id"]=49,
["name"]="vulnerable"
},
[50]={
["_id"]=50,
["name"]="frozen"
},
[51]={
["_id"]=51,
["name"]="poison"
},
[52]={
["_id"]=52,
["name"]="imprison"
},
[53]={
["_id"]=53,
["name"]="corrupt"
},
[54]={
["_id"]=54,
["name"]="bleed"
},
[55]={
["_id"]=55,
["name"]="weaken"
},
[56]={
["_id"]=56,
["name"]="lethargy"
},
[57]={
["_id"]=57,
["name"]="curse"
},
[58]={
["_id"]=58,
["name"]="lock"
},
[59]={
["_id"]=59,
["name"]="first_hand"
},
[61]={
["_id"]=61,
["name"]="undead"
},
[62]={
["_id"]=62,
["name"]="counterattack"
},
[63]={
["_id"]=63,
["name"]="thorns"
},
[73]={
["_id"]=73,
["name"]="shield_rebound_400"
},
[74]={
["_id"]=74,
["name"]="shield_ice"
},
[75]={
["_id"]=75,
["name"]="shield_ice_rebound_400"
}
}

View File

@ -1,89 +1,118 @@
local buff = {
[7]={
["_id"]=7,
["name"]="dec_dmg_red_add"
},
[8]={
["_id"]=8,
["name"]="dec_dmg_yellow_add"
},
[9]={
["_id"]=9,
["name"]="dec_dmg_green_add"
},
[10]={
["_id"]=10,
["name"]="dec_dmg_blue_add"
},
[11]={
["_id"]=11,
["name"]="dec_dmg_purple_add"
},
[12]={
["_id"]=12,
["name"]="dec_dmg_all_add"
},
[33]={
["_id"]=33,
["name"]="stun"
},
[34]={
["_id"]=34,
["name"]="shield"
},
[36]={
["_id"]=36,
["name"]="normal_attack_dec"
},
[37]={
["_id"]=37,
["name"]="normal_attack_add"
},
[47]={
["_id"]=47,
["name"]="shield_rebound_200"
},
[48]={
["_id"]=48,
["name"]="burn"
},
[49]={
["_id"]=49,
["name"]="vulnerable"
},
[50]={
["_id"]=50,
["name"]="frozen"
},
[51]={
["_id"]=51,
["name"]="poison"
},
[52]={
["_id"]=52,
["name"]="imprison"
},
[53]={
["_id"]=53,
["name"]="corrupt"
},
[54]={
["_id"]=54,
["name"]="bleed"
},
[55]={
["_id"]=55,
["name"]="weaken"
},
[56]={
["_id"]=56,
["name"]="lethargy"
},
[57]={
["_id"]=57,
["name"]="curse"
},
[58]={
["_id"]=58,
["name"]="lock"
},
[59]={
["_id"]=59,
["name"]="first_hand"
},
[61]={
["_id"]=61,
["name"]="undead"
},
[62]={
["_id"]=62,
["name"]="counterattack"
},
[63]={
["_id"]=63,
["name"]="thorns"
},
[73]={
["_id"]=73,
["name"]="shield_rebound_400"
},
[74]={
["_id"]=74,
["name"]="shield_ice"
},
[75]={
["_id"]=75,
["name"]="shield_ice_rebound_400"
}
}

View File

@ -1,89 +1,118 @@
local buff = {
[7]={
["_id"]=7,
["name"]="dec_dmg_red_add"
},
[8]={
["_id"]=8,
["name"]="dec_dmg_yellow_add"
},
[9]={
["_id"]=9,
["name"]="dec_dmg_green_add"
},
[10]={
["_id"]=10,
["name"]="dec_dmg_blue_add"
},
[11]={
["_id"]=11,
["name"]="dec_dmg_purple_add"
},
[12]={
["_id"]=12,
["name"]="dec_dmg_all_add"
},
[33]={
["_id"]=33,
["name"]="stun"
},
[34]={
["_id"]=34,
["name"]="shield"
},
[36]={
["_id"]=36,
["name"]="normal_attack_dec"
},
[37]={
["_id"]=37,
["name"]="normal_attack_add"
},
[47]={
["_id"]=47,
["name"]="shield_rebound_200"
},
[48]={
["_id"]=48,
["name"]="burn"
},
[49]={
["_id"]=49,
["name"]="vulnerable"
},
[50]={
["_id"]=50,
["name"]="frozen"
},
[51]={
["_id"]=51,
["name"]="poison"
},
[52]={
["_id"]=52,
["name"]="imprison"
},
[53]={
["_id"]=53,
["name"]="corrupt"
},
[54]={
["_id"]=54,
["name"]="bleed"
},
[55]={
["_id"]=55,
["name"]="weaken"
},
[56]={
["_id"]=56,
["name"]="lethargy"
},
[57]={
["_id"]=57,
["name"]="curse"
},
[58]={
["_id"]=58,
["name"]="lock"
},
[59]={
["_id"]=59,
["name"]="first_hand"
},
[61]={
["_id"]=61,
["name"]="undead"
},
[62]={
["_id"]=62,
["name"]="counterattack"
},
[63]={
["_id"]=63,
["name"]="thorns"
},
[73]={
["_id"]=73,
["name"]="shield_rebound_400"
},
[74]={
["_id"]=74,
["name"]="shield_ice"
},
[75]={
["_id"]=75,
["name"]="shield_ice_rebound_400"
}
}

View File

@ -1,89 +1,118 @@
local buff = {
[7]={
["_id"]=7,
["name"]="dec_dmg_red_add"
},
[8]={
["_id"]=8,
["name"]="dec_dmg_yellow_add"
},
[9]={
["_id"]=9,
["name"]="dec_dmg_green_add"
},
[10]={
["_id"]=10,
["name"]="dec_dmg_blue_add"
},
[11]={
["_id"]=11,
["name"]="dec_dmg_purple_add"
},
[12]={
["_id"]=12,
["name"]="dec_dmg_all_add"
},
[33]={
["_id"]=33,
["name"]="stun"
},
[34]={
["_id"]=34,
["name"]="shield"
},
[36]={
["_id"]=36,
["name"]="normal_attack_dec"
},
[37]={
["_id"]=37,
["name"]="normal_attack_add"
},
[47]={
["_id"]=47,
["name"]="shield_rebound_200"
},
[48]={
["_id"]=48,
["name"]="burn"
},
[49]={
["_id"]=49,
["name"]="vulnerable"
},
[50]={
["_id"]=50,
["name"]="frozen"
},
[51]={
["_id"]=51,
["name"]="poison"
},
[52]={
["_id"]=52,
["name"]="imprison"
},
[53]={
["_id"]=53,
["name"]="corrupt"
},
[54]={
["_id"]=54,
["name"]="bleed"
},
[55]={
["_id"]=55,
["name"]="weaken"
},
[56]={
["_id"]=56,
["name"]="lethargy"
},
[57]={
["_id"]=57,
["name"]="curse"
},
[58]={
["_id"]=58,
["name"]="lock"
},
[59]={
["_id"]=59,
["name"]="first_hand"
},
[61]={
["_id"]=61,
["name"]="undead"
},
[62]={
["_id"]=62,
["name"]="counterattack"
},
[63]={
["_id"]=63,
["name"]="thorns"
},
[73]={
["_id"]=73,
["name"]="shield_rebound_400"
},
[74]={
["_id"]=74,
["name"]="shield_ice"
},
[75]={
["_id"]=75,
["name"]="shield_ice_rebound_400"
}
}

View File

@ -418,6 +418,11 @@ function GFunc.getPerStr(key, str)
return str
end
function GFunc.getBuffDesc(buffName, effectNum)
effectNum = GFunc.getPerStr(buffName, effectNum)
return I18N:getTextWithOtherKey("buff", "name", buffName, "desc", effectNum)
end
function GFunc.getAttrName(key)
return I18N:getText("attr", key, "name")
end

View File

@ -5,7 +5,7 @@ local CHAPTER_CFG = ConfigManager:getConfig("chapter_daily_challenge")
local BattleBuffEntity = require "app/userdata/battle/skill/battle_buff_entity"
function BattleControllerDailyChallenge:getChapterId()
return 1 -- 临时
return DataManager.DailyChallengeData:getChapterDailyId()
end
function BattleControllerDailyChallenge:getMaxWave()
@ -32,7 +32,8 @@ function BattleControllerDailyChallenge:getBuffs()
end
function BattleControllerDailyChallenge:initOther()
local cfg = ConfigManager:getConfig("chapter")[2] -- 临时
local ChapterId = DataManager.DailyChallengeData:getFixedChapterId()
local cfg = ConfigManager:getConfig("chapter")[ChapterId]
self.monsterAtkAddition = 0
self.monsterHpAddition = 0
if cfg and cfg.daily_challenge_difficulty then
@ -199,19 +200,23 @@ function BattleControllerDailyChallenge:controllBattleEnd()
local atkReport = {}
local teamEntity = DataManager.BattleData:getAtkTeam()
local members = teamEntity:getAllMembers()
local heroInfo = {}
for k, v in pairs(members) do
local report = {
heroId = v:getId(),
dmg = v:getDamageCount(),
}
table.insert(atkReport, report)
heroInfo[v:getId()] = {
skill_cast = v:getActiveSkillRealeseCount(),
Damage = v:getDamageCount(),
}
end
self.combatReport.atkReport = atkReport
if not self.victory then
self.combatReport.wave = self.combatReport.wave - 1
end
Logger.logHighlight("BattleControllerDailyChallenge fight over")
-- ModuleManager.ChapterManager:endFight(self.chapterId, self.combatReport, self.gotMysteryBoxIndexs, self.taskProgress)
ModuleManager.DailyChallengeManager:endFight(self.chapterId, self.combatReport, self.taskProgress, heroInfo)
end
function BattleControllerDailyChallenge:postWaveOver(atkDead, isQuit)
@ -232,7 +237,7 @@ function BattleControllerDailyChallenge:postWaveOver(atkDead, isQuit)
local duration = Time:getServerTime() - self.waveStartTime
local totalTime = Time:getServerTime() - self.battleStartTime
local startTimes = 1 -- TODO
local startTimes = DataManager.DailyChallengeData:getTotalFightCount()
local isFirstWin = false -- TODO
local isFianlStep = self.waveIndex >= self.maxWaveIndex
@ -241,8 +246,7 @@ function BattleControllerDailyChallenge:postWaveOver(atkDead, isQuit)
end
function BattleControllerDailyChallenge:postFightStart()
local unlockMaxChapter = DataManager.ChapterData:getNewChapterId()
BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE, self.waveIndex, self.chapterId, unlockMaxChapter, 1)
BIReport:postFightBegin(GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE, self.waveIndex, self.chapterId, nil, 1)
end
return BattleControllerDailyChallenge

View File

@ -6,12 +6,66 @@ end
-- 开始挑战
function DailyChallengeManager:startChallenge()
-- body
if not DataManager.DailyChallengeData:isEnoughChallengeTime() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.DAILY_CHALLENGE_DESC_1))
return
end
if not DataManager.DailyChallengeData:isMeetChallenge() then
return
end
if not ModuleManager.FormationManager:formationIsFull() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_8))
return
end
local cost = DataManager.DailyChallengeData:getFightCost()
local vitCostNum = 0
if cost then
vitCostNum = GFunc.getRewardNum(cost)
end
if vitCostNum > DataManager.BagData.ItemData:getVit() then -- 体力不足
GFunc.showItemNotEnough(GConst.ItemConst.ITEM_ID_VIT)
ModuleManager.CommerceManager:showBuyVitUI()
return
end
local parmas = {}
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterDailyChallengeStartReq, parmas, {}, self.rspStartChallenge, BIReport.ITEM_GET_TYPE.DAILY_CHALLENGE)
end
function DailyChallengeManager:rspStartChallenge(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.DailyChallengeData:setFixedChapterId(result.today_fixed_chapter_id)
ModuleManager.BattleManager:playBattle(GConst.BattleConst.BATTLE_TYPE.DAILY_CHALLENGE)
end
end
-- 挑战结束
function DailyChallengeManager:endChallenge()
-- 挑战完成固定会给战斗奖励
function DailyChallengeManager:endChallenge(chapterId, combatReport, taskProgress, heroInfo)
local parmas = {
win = combatReport.victory,
chapter_id = chapterId,
pass_wave = combatReport.wave,
hero_info = heroInfo,
combatReport = combatReport,
}
for fieldName, value in pairs(taskProgress) do
parmas[fieldName] = value
end
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterSettlementReq, parmas, {}, self.endChallengeFinish, BIReport.ITEM_GET_TYPE.DAILY_CHALLENGE_END)
end
function DailyChallengeManager:endChallengeFinish(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
local reqData = result.reqData
local rewards = result.rewards
ModuleManager.BattleManager:showBattleResultUI(rewards, reqData.combatReport)
-- todo
ModuleManager.TaskManager:addFightTaskProgress(reqData)
end
end
-- 获取波次(战斗)奖励

View File

@ -12,7 +12,7 @@ local MODULE_DATA = {
return nil
end,
["clickFunc"] = function()-- 点击回调
Logger.logHighlight("点击每日挑战")
ModuleManager.DailyChallengeManager:startChallenge()
end
},
[2] = {

View File

@ -152,7 +152,7 @@ function BattleUnitEntity:getAssistingSkill()
return self.assistingSkill
end
function BattleUnitEntity:getActiveSkillRealeseCount()
function BattleUnitEntity:getActiveSkillCount()
return #self.activeSkills
end

View File

@ -1,7 +1,44 @@
local DailyChallengeData = class("DailyChallengeData", BaseData)
local TASK_CFG = ConfigManager:getConfig("task_daily_challenge")
function DailyChallengeData:init(data)
data = data or {}
data = { -- 临时数据
max_wave = 1,
today_fixed_chapter_id = 1,
rand_chapter_daily_id = 1,
tasks = {
{
task_id = 1,
param = 0,
progress = 0,
claimed = false
},
{
task_id = 3,
param = 0,
progress = 0,
claimed = false
},
{
task_id = 8,
param = 12001,
progress = 0,
claimed = false
}
},
buff_id = {1, 11},
totalFightCount = 0,
today_challenge_count = 0,
}
-- 服务器的初始数据
self.maxWave = data.max_wave or 0
self.fixedChapterId = data.today_fixed_chapter_id or 1
self.chapterDailyId = data.rand_chapter_daily_id or 1
self.tasks = data.tasks or {}
self.buffId = data.buff_id or {}
self.totalFightCount = data.totalFightCount or 0
self.todayFightCount = data.today_challenge_count or 0
end
function DailyChallengeData:clear()
@ -18,7 +55,7 @@ end
-- 次数是否足够
function DailyChallengeData:isEnoughChallengeTime()
return true
return self:getTodayRemainLimitCount() > 0
end
-- 体力是否足够
@ -60,8 +97,127 @@ function DailyChallengeData:getBossData(bossId)
end
-- 任务是否完成
function DailyChallengeData:isTaskFinish(taskId)
-- body
function DailyChallengeData:isTaskFinish(index)
if not self.tasks[index] then
return false
end
return self.tasks[index].claim
end
function DailyChallengeData:getTaskById(taskId)
for index, taskInfo in ipairs(self.tasks) do
if taskInfo.task_id == taskId then
return taskInfo
end
end
return
end
function DailyChallengeData:canClaimTask(index)
if not self.tasks[index] then
return false
end
if self.tasks[index].claim then
return false
end
local cfg = self:getTaskCfgInfo(self.tasks[index].taskId)
if not cfg then
return false
end
return cfg.number <= self.tasks[index].progress
end
function DailyChallengeData:getTaskProgresss(index)
if not self.tasks[index] then
return 0
end
return self.tasks[index].progress
end
function DailyChallengeData:getTaskCfgInfo(taskId)
return TASK_CFG[taskId]
end
function DailyChallengeData:getTaskTotalNumber(taskId)
if self:getTaskCfgInfo(taskId) then
return self:getTaskCfgInfo(taskId).number
else
return 1 -- 容错,防止报错
end
end
function DailyChallengeData:getTaskRewards(taskId)
if self:getTaskCfgInfo(taskId) then
return self:getTaskCfgInfo(taskId).reward
end
return nil
end
function DailyChallengeData:getTaskDesc(taskId, needProgress, customProgress)
local desc = GConst.EMPTY_STRING
if not I18N:getConfig("task_daily_challenge")[taskId] then
return desc
end
local taskNum = self:getTaskTotalNumber(taskId)
if taskId == 7 or taskId == 8 then
taskNum = taskNum * 100 // GConst.DEFAULT_FACTOR
end
desc = I18N:getText("task_daily_challenge", taskId, "desc", taskNum)
if needProgress then
local progress = customProgress
if not progress then
progress = 0
local taskInfo = self:getTaskById(taskId)
if taskInfo then
progress = taskInfo.progress or 0
end
end
if taskId == 7 or taskId == 8 then
progress = progress * 100 // GConst.DEFAULT_FACTOR
end
local progressStr = string.format("<color=#5FFF53>(%s%%/%s%%)</color>", progress, taskNum)
desc = desc + progressStr
end
return desc
end
function DailyChallengeData:getFightCost()
return GFunc.getConstReward("daily_challenge_cost")
end
function DailyChallengeData:getFightLimitCount()
return GFunc.getConstIntValue("daily_challenge_limit")
end
function DailyChallengeData:getTodayRemainLimitCount()
local count = self:getFightLimitCount() - self.todayFightCount
if count < 0 then
count = 0
end
return count
end
function DailyChallengeData:getFixedChapterId()
return self.fixedChapterId
end
function DailyChallengeData:getChapterDailyId()
return self.chapterDailyId
end
function DailyChallengeData:setFixedChapterId(id)
self.fixedChapterId = id
end
function DailyChallengeData:getTotalFightCount()
return self.totalFightCount
end
function DailyChallengeData:dealTask(taskProgressInfo)
end
return DailyChallengeData