diff --git a/lua/app/common/bi_report.lua b/lua/app/common/bi_report.lua index 687299f5..1b5c1072 100644 --- a/lua/app/common/bi_report.lua +++ b/lua/app/common/bi_report.lua @@ -119,7 +119,9 @@ BIReport.ITEM_GET_TYPE = { UPGRADE_HERO = "UpgradeHero", CHAPTER_FIGHT_START = "ChapterFightStart", CHAPTER_FIGHT_END = "ChapterFightEnd", - CHAPTER_BOX = "ChapterBox" + CHAPTER_BOX = "ChapterBox", + CROSS_DAY = "CrossDay", + RECOVERY_TIME = "RecoveryTime", } BIReport.ADS_CLICK_TYPE = { diff --git a/lua/app/config/buff.lua b/lua/app/config/buff.lua index 7c6bfd14..9fc5fd72 100644 --- a/lua/app/config/buff.lua +++ b/lua/app/config/buff.lua @@ -180,13 +180,16 @@ local buff = { ["buff_type"]=8, ["icon"]="stun", ["fx_continued"]={ - 4001 + 13 } }, [34]={ ["name"]="shield", ["buff_type"]=2, - ["icon"]="shield" + ["icon"]="shield", + ["fx_continued"]={ + 11 + } }, [35]={ ["name"]="atkp_add", @@ -197,7 +200,7 @@ local buff = { ["buff_type"]=1, ["icon"]="normal_attack_dec", ["fx_continued"]={ - 4001 + 12 } }, [37]={ @@ -239,7 +242,10 @@ local buff = { [34]={ ["name"]="shield_rebound_200", ["buff_type"]=2, - ["icon"]="shield" + ["icon"]="shield", + ["fx_continued"]={ + 11 + } } } local keys = { diff --git a/lua/app/config/chapter.lua b/lua/app/config/chapter.lua index 7eefbfc3..4afe21ee 100644 --- a/lua/app/config/chapter.lua +++ b/lua/app/config/chapter.lua @@ -3,6 +3,7 @@ local chapter = { ["next_chapter"]=2, ["icon"]="chapter_1", ["scene"]="bg_1", + ["block_icon"]="battle_hinder_1", ["board"]={ 1 }, @@ -77,6 +78,7 @@ local chapter = { ["next_chapter"]=3, ["icon"]="chapter_2", ["scene"]="bg_2", + ["block_icon"]="battle_hinder_1", ["board"]={ 2, 3 @@ -178,6 +180,7 @@ local chapter = { ["next_chapter"]=4, ["icon"]="chapter_3", ["scene"]="bg_3", + ["block_icon"]="battle_hinder_1", ["board"]={ 4, 5, @@ -274,6 +277,7 @@ local chapter = { ["next_chapter"]=5, ["icon"]="chapter_4", ["scene"]="bg_4", + ["block_icon"]="battle_hinder_1", ["board"]={ 7, 8, @@ -403,6 +407,7 @@ local chapter = { ["next_chapter"]=6, ["icon"]="chapter_5", ["scene"]="bg_5", + ["block_icon"]="battle_hinder_1", ["board"]={ 11, 12, @@ -532,6 +537,7 @@ local chapter = { ["next_chapter"]=7, ["icon"]="chapter_6", ["scene"]="bg_5", + ["block_icon"]="battle_hinder_1", ["board"]={ 15, 16, @@ -661,6 +667,7 @@ local chapter = { ["next_chapter"]=8, ["icon"]="chapter_7", ["scene"]="bg_6", + ["block_icon"]="battle_hinder_1", ["board"]={ 19, 20, @@ -790,6 +797,7 @@ local chapter = { ["next_chapter"]=9, ["icon"]="chapter_8", ["scene"]="bg_6", + ["block_icon"]="battle_hinder_1", ["board"]={ 23, 24, @@ -927,6 +935,7 @@ local chapter = { ["next_chapter"]=10, ["icon"]="chapter_9", ["scene"]="bg_7", + ["block_icon"]="battle_hinder_1", ["board"]={ 27, 28, @@ -1063,6 +1072,7 @@ local chapter = { ["before_chapter"]=9, ["icon"]="chapter_10", ["scene"]="bg_7", + ["block_icon"]="battle_hinder_1", ["board"]={ 31, 32, diff --git a/lua/app/config/const.lua b/lua/app/config/const.lua index 967fcdec..5d73b562 100644 --- a/lua/app/config/const.lua +++ b/lua/app/config/const.lua @@ -26,9 +26,12 @@ local const = { }, ["shield_rebound_value"]={ ["value"]=200 + }, + ["crit_dmg"]={ + ["value"]=1500 } } local config = { -data=const,count=7 +data=const,count=8 } return config \ No newline at end of file diff --git a/lua/app/config/fx.lua b/lua/app/config/fx.lua index e95d15c2..92f49660 100644 --- a/lua/app/config/fx.lua +++ b/lua/app/config/fx.lua @@ -39,6 +39,21 @@ local fx = { ["res"]="sfx_common_hit_zi_b02", ["bind"]="root" }, + [11]={ + ["res"]="sfx_common_dun_b01", + ["loop"]=1, + ["bind"]="root" + }, + [12]={ + ["res"]="sfx_common_ice_b01", + ["loop"]=1, + ["bind"]="root" + }, + [13]={ + ["res"]="sfx_common_xy_b01", + ["loop"]=1, + ["bind"]="root" + }, [100000]={ ["res"]="sfx_m10001_b01", ["bind"]="root" @@ -413,6 +428,6 @@ local fx = { } } local config = { -data=fx,count=103 +data=fx,count=106 } return config \ No newline at end of file diff --git a/lua/app/config/localization/localization_global_const.lua b/lua/app/config/localization/localization_global_const.lua index 73cb3161..1141448a 100644 --- a/lua/app/config/localization/localization_global_const.lua +++ b/lua/app/config/localization/localization_global_const.lua @@ -42,6 +42,16 @@ local LocalizationGlobalConst = BATTLE_DESC_8 = "BATTLE_DESC_8", MAIN_BTN_2 = "MAIN_BTN_2", MAIN_DESC_1 = "MAIN_DESC_1", + TIME_STR_DHM = "TIME_STR_DHM", + TIME_STR_M = "TIME_STR_M", + TIME_STR_MS = "TIME_STR_MS", + TIME_STR_S = "TIME_STR_S", + TIME_STR_DH = "TIME_STR_DH", + TIME_STR_HMS = "TIME_STR_HMS", + TIME_STR_HM = "TIME_STR_HM", + TIME_STR_D = "TIME_STR_D", + TIME_MS = "TIME_MS", + TIME_HMS = "TIME_HMS", } return LocalizationGlobalConst \ No newline at end of file diff --git a/lua/app/config/monster_chapter.lua b/lua/app/config/monster_chapter.lua index 395a35e7..4ddd26a0 100644 --- a/lua/app/config/monster_chapter.lua +++ b/lua/app/config/monster_chapter.lua @@ -13,7 +13,7 @@ local monster_chapter = { }, [201]={ ["monster_base"]=10004, - ["hp"]=4000000, + ["hp"]=5000000, ["atk"]=200000, ["atk_times"]=2, ["hurt_skill"]={ @@ -25,7 +25,7 @@ local monster_chapter = { }, [301]={ ["monster_base"]=10002, - ["hp"]=9500000, + ["hp"]=12000000, ["atk"]=200000, ["atk_times"]=2, ["hurt_skill"]={ @@ -37,7 +37,7 @@ local monster_chapter = { }, [401]={ ["monster_base"]=10006, - ["hp"]=6000000, + ["hp"]=13000000, ["atk"]=200000, ["atk_times"]=2, ["hurt_skill"]={ @@ -50,7 +50,7 @@ local monster_chapter = { [501]={ ["monster_base"]=20004, ["is_boss"]=2, - ["hp"]=14000000, + ["hp"]=18000000, ["atk"]=250000, ["atk_times"]=3, ["hurt_skill"]={ @@ -101,7 +101,7 @@ local monster_chapter = { }, [901]={ ["monster_base"]=10001, - ["hp"]=10000000, + ["hp"]=12000000, ["atk"]=280000, ["atk_times"]=2, ["hurt_skill"]={ @@ -114,7 +114,7 @@ local monster_chapter = { [1001]={ ["monster_base"]=20004, ["is_boss"]=1, - ["hp"]=16000000, + ["hp"]=20000000, ["atk"]=340000, ["atk_times"]=3, ["hurt_skill"]={ @@ -129,8 +129,8 @@ local monster_chapter = { }, [1101]={ ["monster_base"]=10002, - ["hp"]=12000000, - ["atk"]=290000, + ["hp"]=15000000, + ["atk"]=300000, ["atk_times"]=2, ["hurt_skill"]={ 10001, @@ -141,8 +141,8 @@ local monster_chapter = { }, [1201]={ ["monster_base"]=10010, - ["hp"]=15000000, - ["atk"]=300000, + ["hp"]=17000000, + ["atk"]=310000, ["atk_times"]=2, ["hurt_skill"]={ 10007, @@ -153,8 +153,8 @@ local monster_chapter = { }, [1301]={ ["monster_base"]=10008, - ["hp"]=17000000, - ["atk"]=310000, + ["hp"]=20000000, + ["atk"]=320000, ["atk_times"]=2, ["hurt_skill"]={ 10018, @@ -165,8 +165,8 @@ local monster_chapter = { }, [1401]={ ["monster_base"]=10004, - ["hp"]=19000000, - ["atk"]=320000, + ["hp"]=22000000, + ["atk"]=330000, ["atk_times"]=2, ["hurt_skill"]={ 10001, @@ -178,8 +178,8 @@ local monster_chapter = { [1501]={ ["monster_base"]=20012, ["is_boss"]=2, - ["hp"]=32000000, - ["atk"]=350000, + ["hp"]=36000000, + ["atk"]=380000, ["atk_times"]=3, ["hurt_skill"]={ 10079, @@ -193,7 +193,7 @@ local monster_chapter = { }, [1601]={ ["monster_base"]=10009, - ["hp"]=4000000, + ["hp"]=6000000, ["atk"]=250000, ["atk_times"]=3, ["hurt_skill"]={ @@ -205,7 +205,7 @@ local monster_chapter = { }, [1701]={ ["monster_base"]=10007, - ["hp"]=6000000, + ["hp"]=8000000, ["atk"]=250000, ["atk_times"]=3, ["hurt_skill"]={ @@ -217,7 +217,7 @@ local monster_chapter = { }, [1801]={ ["monster_base"]=10008, - ["hp"]=8000000, + ["hp"]=11000000, ["atk"]=250000, ["atk_times"]=3, ["hurt_skill"]={ @@ -229,7 +229,7 @@ local monster_chapter = { }, [1901]={ ["monster_base"]=10010, - ["hp"]=10000000, + ["hp"]=14000000, ["atk"]=280000, ["atk_times"]=3, ["hurt_skill"]={ @@ -269,7 +269,7 @@ local monster_chapter = { }, [2201]={ ["monster_base"]=10010, - ["hp"]=17000000, + ["hp"]=18000000, ["atk"]=310000, ["atk_times"]=3, ["hurt_skill"]={ @@ -281,7 +281,7 @@ local monster_chapter = { }, [2301]={ ["monster_base"]=10007, - ["hp"]=19000000, + ["hp"]=20000000, ["atk"]=320000, ["atk_times"]=3, ["hurt_skill"]={ @@ -293,8 +293,8 @@ local monster_chapter = { }, [2401]={ ["monster_base"]=10011, - ["hp"]=21000000, - ["atk"]=330000, + ["hp"]=22000000, + ["atk"]=340000, ["atk_times"]=3, ["hurt_skill"]={ 10010, @@ -306,8 +306,8 @@ local monster_chapter = { [2501]={ ["monster_base"]=20010, ["is_boss"]=1, - ["hp"]=36000000, - ["atk"]=380000, + ["hp"]=39000000, + ["atk"]=390000, ["atk_times"]=4, ["hurt_skill"]={ 10069, @@ -324,8 +324,8 @@ local monster_chapter = { }, [2601]={ ["monster_base"]=10010, - ["hp"]=21000000, - ["atk"]=340000, + ["hp"]=23000000, + ["atk"]=350000, ["atk_times"]=3, ["hurt_skill"]={ 10007, @@ -336,8 +336,8 @@ local monster_chapter = { }, [2701]={ ["monster_base"]=10009, - ["hp"]=23000000, - ["atk"]=350000, + ["hp"]=25000000, + ["atk"]=360000, ["atk_times"]=3, ["hurt_skill"]={ 10018, @@ -348,8 +348,8 @@ local monster_chapter = { }, [2801]={ ["monster_base"]=10011, - ["hp"]=26000000, - ["atk"]=360000, + ["hp"]=28000000, + ["atk"]=370000, ["atk_times"]=3, ["hurt_skill"]={ 10010, @@ -360,8 +360,8 @@ local monster_chapter = { }, [2901]={ ["monster_base"]=10003, - ["hp"]=29000000, - ["atk"]=370000, + ["hp"]=31000000, + ["atk"]=380000, ["atk_times"]=3, ["hurt_skill"]={ 10001, @@ -373,8 +373,8 @@ local monster_chapter = { [3001]={ ["monster_base"]=20011, ["is_boss"]=2, - ["hp"]=45000000, - ["atk"]=430000, + ["hp"]=48000000, + ["atk"]=450000, ["atk_times"]=4, ["hurt_skill"]={ 10074, @@ -426,7 +426,7 @@ local monster_chapter = { }, [3401]={ ["monster_base"]=10005, - ["hp"]=13000000, + ["hp"]=15000000, ["atk"]=310000, ["atk_times"]=3, ["hurt_skill"]={ @@ -439,7 +439,7 @@ local monster_chapter = { [3501]={ ["monster_base"]=20009, ["is_boss"]=1, - ["hp"]=21000000, + ["hp"]=23000000, ["atk"]=370000, ["atk_times"]=4, ["hurt_skill"]={ @@ -457,7 +457,7 @@ local monster_chapter = { }, [3601]={ ["monster_base"]=10005, - ["hp"]=13000000, + ["hp"]=15000000, ["atk"]=310000, ["atk_times"]=3, ["hurt_skill"]={ @@ -469,7 +469,7 @@ local monster_chapter = { }, [3701]={ ["monster_base"]=10012, - ["hp"]=14000000, + ["hp"]=17000000, ["atk"]=330000, ["atk_times"]=3, ["hurt_skill"]={ @@ -480,7 +480,7 @@ local monster_chapter = { }, [3801]={ ["monster_base"]=10006, - ["hp"]=16000000, + ["hp"]=20000000, ["atk"]=330000, ["atk_times"]=3, ["hurt_skill"]={ @@ -492,7 +492,7 @@ local monster_chapter = { }, [3901]={ ["monster_base"]=10016, - ["hp"]=17000000, + ["hp"]=22000000, ["atk"]=350000, ["atk_times"]=3, ["hurt_skill"]={ @@ -505,7 +505,7 @@ local monster_chapter = { [4001]={ ["monster_base"]=20002, ["is_boss"]=1, - ["hp"]=28000000, + ["hp"]=42000000, ["atk"]=400000, ["atk_times"]=4, ["hurt_skill"]={ @@ -522,7 +522,7 @@ local monster_chapter = { }, [4101]={ ["monster_base"]=10005, - ["hp"]=21000000, + ["hp"]=23000000, ["atk"]=350000, ["atk_times"]=3, ["hurt_skill"]={ @@ -534,7 +534,7 @@ local monster_chapter = { }, [4201]={ ["monster_base"]=10012, - ["hp"]=24000000, + ["hp"]=27000000, ["atk"]=370000, ["atk_times"]=3, ["hurt_skill"]={ @@ -545,7 +545,7 @@ local monster_chapter = { }, [4301]={ ["monster_base"]=10016, - ["hp"]=27000000, + ["hp"]=30000000, ["atk"]=390000, ["atk_times"]=3, ["hurt_skill"]={ @@ -557,7 +557,7 @@ local monster_chapter = { }, [4401]={ ["monster_base"]=10006, - ["hp"]=29000000, + ["hp"]=34000000, ["atk"]=410000, ["atk_times"]=3, ["hurt_skill"]={ @@ -570,7 +570,7 @@ local monster_chapter = { [4501]={ ["monster_base"]=20002, ["is_boss"]=1, - ["hp"]=43000000, + ["hp"]=52000000, ["atk"]=640000, ["atk_times"]=4, ["hurt_skill"]={ @@ -587,7 +587,7 @@ local monster_chapter = { }, [4601]={ ["monster_base"]=10012, - ["hp"]=36000000, + ["hp"]=40000000, ["atk"]=430000, ["atk_times"]=3, ["hurt_skill"]={ @@ -598,7 +598,7 @@ local monster_chapter = { }, [4701]={ ["monster_base"]=10006, - ["hp"]=39000000, + ["hp"]=43000000, ["atk"]=450000, ["atk_times"]=3, ["hurt_skill"]={ @@ -610,7 +610,7 @@ local monster_chapter = { }, [4801]={ ["monster_base"]=10016, - ["hp"]=43000000, + ["hp"]=48000000, ["atk"]=470000, ["atk_times"]=3, ["hurt_skill"]={ @@ -622,7 +622,7 @@ local monster_chapter = { }, [4901]={ ["monster_base"]=10005, - ["hp"]=47000000, + ["hp"]=53000000, ["atk"]=490000, ["atk_times"]=3, ["hurt_skill"]={ @@ -635,7 +635,7 @@ local monster_chapter = { [5001]={ ["monster_base"]=20009, ["is_boss"]=2, - ["hp"]=73000000, + ["hp"]=89000000, ["atk"]=550000, ["atk_times"]=4, ["hurt_skill"]={ diff --git a/lua/app/config/skill.lua b/lua/app/config/skill.lua index a0bf0448..9610ebe0 100644 --- a/lua/app/config/skill.lua +++ b/lua/app/config/skill.lua @@ -345,6 +345,7 @@ local skill = { ["sound_hit"]=2200120, ["name_act"]="skill01", ["fx_self"]=300008, + ["fx_self_delay"]=700, ["fx_target"]=4, ["fx_target_delay"]=1100 }, @@ -391,7 +392,9 @@ local skill = { ["sound_hit"]=2200120, ["name_act"]="skill01", ["fx_self"]=300008, - ["fx_target"]=4 + ["fx_self_delay"]=700, + ["fx_target"]=4, + ["fx_target_delay"]=1100 }, [2300110]={ ["position"]=2, @@ -1103,7 +1106,10 @@ local skill = { ["shake_type"]=3, ["sound_hit"]=4300120, ["name_act"]="skill01", - ["fx_self"]=300031 + ["fx_self"]=300031, + ["fx_self_delay"]=100, + ["fx_target"]=300032, + ["fx_target_delay"]=300 }, [4300121]={ ["energy"]=10, @@ -1152,7 +1158,10 @@ local skill = { ["shake_type"]=3, ["sound_hit"]=4300120, ["name_act"]="skill01", - ["fx_self"]=300031 + ["fx_self"]=300031, + ["fx_self_delay"]=100, + ["fx_target"]=300032, + ["fx_target_delay"]=300 }, [5200110]={ ["position"]=5, @@ -1907,7 +1916,7 @@ local skill = { }, ["obj"]=2, ["skill_position"]=1, - ["cd"]=3, + ["cd"]=2, ["cd_start"]=1 }, [10033]={ @@ -2018,7 +2027,7 @@ local skill = { } }, ["obj"]=2, - ["skill_position"]=1, + ["skill_position"]=2, ["shake_time"]=100, ["shake_type"]=1, ["sound_hit"]=10029, @@ -2037,7 +2046,7 @@ local skill = { } }, ["obj"]=2, - ["skill_position"]=1, + ["skill_position"]=2, ["shake_time"]=100, ["shake_type"]=1, ["sound_hit"]=10030, @@ -2056,7 +2065,7 @@ local skill = { } }, ["obj"]=2, - ["skill_position"]=1, + ["skill_position"]=2, ["shake_time"]=100, ["shake_type"]=1, ["sound_hit"]=10031, @@ -2075,8 +2084,8 @@ local skill = { } }, ["obj"]=1, - ["skill_position"]=1, - ["cd"]=3, + ["skill_position"]=2, + ["cd"]=2, ["cd_start"]=1 }, [10042]={ @@ -2089,7 +2098,7 @@ local skill = { ["trigger"]=1, ["obj"]=2, ["skill_position"]=2, - ["cd"]=3, + ["cd"]=2, ["cd_start"]=1, ["sound_hit"]=10042, ["name_act"]="skill01", @@ -2105,7 +2114,7 @@ local skill = { ["trigger"]=1, ["obj"]=2, ["skill_position"]=2, - ["cd"]=3, + ["cd"]=2, ["cd_start"]=1, ["sound_hit"]=10042, ["name_act"]="skill01", @@ -2190,12 +2199,12 @@ local skill = { ["type"]="shield", ["num"]=1000, ["ratio"]=10000, - ["round"]=1 + ["round"]=2 } }, ["obj"]=1, ["skill_position"]=2, - ["cd"]=3, + ["cd"]=2, ["cd_start"]=1, ["sound_hit"]=10048, ["name_act"]="skill01", @@ -2388,7 +2397,7 @@ local skill = { }, ["obj"]=1, ["skill_position"]=2, - ["cd"]=3, + ["cd"]=2, ["cd_start"]=1 }, [10060]={ @@ -2399,16 +2408,16 @@ local skill = { ["type"]="shield", ["num"]=1000, ["ratio"]=10000, - ["round"]=1 + ["round"]=2 } }, ["obj"]=1, ["skill_position"]=2, - ["cd"]=3, + ["cd"]=2, ["cd_start"]=1, ["sound_hit"]=10048, ["name_act"]="skill01", - ["fx_self"]=200027 + ["fx_self"]=200019 }, [10061]={ ["effect_type"]=2, @@ -2435,7 +2444,8 @@ local skill = { ["obj"]=2, ["skill_position"]=2, ["cd"]=2, - ["cd_start"]=1 + ["cd_start"]=1, + ["name_act"]="skill01" }, [10063]={ ["effect_type"]=1, @@ -2515,7 +2525,7 @@ local skill = { ["effect"]={ { ["type"]="weakness_purple_add", - ["num"]=10000, + ["num"]=5000, ["ratio"]=10000, ["round"]=999 }, @@ -2708,7 +2718,7 @@ local skill = { }, ["obj"]=2, ["skill_position"]=1, - ["cd"]=3, + ["cd"]=2, ["cd_start"]=1, ["shake_time"]=100, ["shake_type"]=4, @@ -2799,7 +2809,7 @@ local skill = { }, ["obj"]=2, ["skill_position"]=1, - ["cd"]=3, + ["cd"]=2, ["cd_start"]=2, ["shake_time"]=100, ["shake_type"]=4, diff --git a/lua/app/config/skill_rogue.lua b/lua/app/config/skill_rogue.lua index b8eeb04b..9fe44cca 100644 --- a/lua/app/config/skill_rogue.lua +++ b/lua/app/config/skill_rogue.lua @@ -390,7 +390,7 @@ local skill_rogue = { ["qlt"]=3, ["type"]=5, ["attr"]={ - ["type"]="weakness_all_add", + ["type"]="dec_dmg_all_add", ["minnum"]=500, ["maxnum"]=500 }, diff --git a/lua/app/config/strings/cn/global.lua b/lua/app/config/strings/cn/global.lua index 01582034..9103f2b6 100644 --- a/lua/app/config/strings/cn/global.lua +++ b/lua/app/config/strings/cn/global.lua @@ -42,6 +42,16 @@ local localization_global = ["BATTLE_DESC_8"] = "还有可上阵英雄", ["MAIN_BTN_2"] = "英雄", ["MAIN_DESC_1"] = "第{0}章", + ["TIME_STR_DHM"] = "{0}天{1}时{2}分", + ["TIME_STR_M"] = "{0}分", + ["TIME_STR_MS"] = "{0}分{1}秒", + ["TIME_STR_S"] = "{0}秒", + ["TIME_STR_DH"] = "{0}天{1}时", + ["TIME_STR_HMS"] = "{0}时{1}分{2}秒", + ["TIME_STR_HM"] = "{0}时{1}分", + ["TIME_STR_D"] = "{0}天", + ["TIME_MS"] = "{0}:{1}", + ["TIME_HMS"] = "{0}:{1}:{2}", } return localization_global \ No newline at end of file diff --git a/lua/app/config/strings/cn/item.lua b/lua/app/config/strings/cn/item.lua index 50914de2..693de2dc 100644 --- a/lua/app/config/strings/cn/item.lua +++ b/lua/app/config/strings/cn/item.lua @@ -25,35 +25,35 @@ local item = { }, [12001]={ ["name"]="洛克西英雄碎片", - ["desc"]="凑齐可解锁或升级。" + ["desc"]="洛克西英雄碎片,凑齐可解锁或升级。" }, [22001]={ ["name"]="卡拉英雄碎片", - ["desc"]="凑齐可解锁或升级。" + ["desc"]="卡拉英雄碎片,凑齐可解锁或升级。" }, [23001]={ ["name"]="巨剑罗伯特英雄碎片", - ["desc"]="凑齐可解锁或升级。" + ["desc"]="巨剑罗伯特英雄碎片,凑齐可解锁或升级。" }, [32001]={ ["name"]="阿斯克英雄碎片", - ["desc"]="凑齐可解锁或升级。" + ["desc"]="阿斯克英雄碎片,凑齐可解锁或升级。" }, [33001]={ ["name"]="艾芙琳英雄碎片", - ["desc"]="凑齐可解锁或升级。" + ["desc"]="艾芙琳英雄碎片,凑齐可解锁或升级。" }, [42001]={ ["name"]="莉莉丝英雄碎片", - ["desc"]="凑齐可解锁或升级。" + ["desc"]="莉莉丝英雄碎片,凑齐可解锁或升级。" }, [43001]={ ["name"]="白发凯瑟琳英雄碎片", - ["desc"]="凑齐可解锁或升级。" + ["desc"]="白发凯瑟琳英雄碎片,凑齐可解锁或升级。" }, [52001]={ ["name"]="艾伦英雄碎片", - ["desc"]="凑齐可解锁或升级。" + ["desc"]="艾伦英雄碎片,凑齐可解锁或升级。" } } local config = { diff --git a/lua/app/config/strings/de/global.lua b/lua/app/config/strings/de/global.lua index 6f037528..39477d58 100644 --- a/lua/app/config/strings/de/global.lua +++ b/lua/app/config/strings/de/global.lua @@ -7,6 +7,16 @@ local localization_global = ["QLT_DESC_4"] = "Episch", ["QLT_DESC_5"] = "Legendär", ["QLT_DESC_6"] = "Mythologisch", + ["TIME_STR_DHM"] = "{0} Tag(e) {1} Stunde(n) {2} Minute(n)", + ["TIME_STR_M"] = "{0} Minute(n)", + ["TIME_STR_MS"] = "{0} Minute(n) {1} Sekunde(n)", + ["TIME_STR_S"] = "{0} Sekunde(n)", + ["TIME_STR_DH"] = "{0} Tag(e) {1} Stunde(n)", + ["TIME_STR_HMS"] = "{0} Stunde(n) {1} Minute(n) {2} Sekunde(n)", + ["TIME_STR_HM"] = "{0} Stunde(n) {1} Minute(n)", + ["TIME_STR_D"] = "{0} Tag(e)", + ["TIME_MS"] = "{0}:{1}", + ["TIME_HMS"] = "{0}:{1}:{2}", } return localization_global \ No newline at end of file diff --git a/lua/app/config/strings/en/global.lua b/lua/app/config/strings/en/global.lua index 0c9efdf0..fd5421cf 100644 --- a/lua/app/config/strings/en/global.lua +++ b/lua/app/config/strings/en/global.lua @@ -7,6 +7,16 @@ local localization_global = ["QLT_DESC_4"] = "Epic", ["QLT_DESC_5"] = "Legendary", ["QLT_DESC_6"] = "Mythic", + ["TIME_STR_DHM"] = "{0} d {1} h {2} min", + ["TIME_STR_M"] = "{0} min", + ["TIME_STR_MS"] = "{0} min {1} sec", + ["TIME_STR_S"] = "{0} sec", + ["TIME_STR_DH"] = "{0} d {1} h", + ["TIME_STR_HMS"] = "{0} h {1} min {2} sec", + ["TIME_STR_HM"] = "{0} h {1} min", + ["TIME_STR_D"] = "{0} d", + ["TIME_MS"] = "{0}:{1}", + ["TIME_HMS"] = "{0}:{1}:{2}", } return localization_global \ No newline at end of file diff --git a/lua/app/config/strings/fr/global.lua b/lua/app/config/strings/fr/global.lua index 59bb4bf7..dd2ee6f7 100644 --- a/lua/app/config/strings/fr/global.lua +++ b/lua/app/config/strings/fr/global.lua @@ -7,6 +7,16 @@ local localization_global = ["QLT_DESC_4"] = "SR", ["QLT_DESC_5"] = "SSR", ["QLT_DESC_6"] = "UR", + ["TIME_STR_DHM"] = "{0} jour(s) {1} h {2} sec", + ["TIME_STR_M"] = "{0} min", + ["TIME_STR_MS"] = "{0} min {1}sec", + ["TIME_STR_S"] = "{0} sec", + ["TIME_STR_DH"] = "{0} jour(s) {1} h", + ["TIME_STR_HMS"] = "{0} h {1} min {2}sec", + ["TIME_STR_HM"] = "{0} h {1} sec", + ["TIME_STR_D"] = "{0} jour(s)", + ["TIME_MS"] = "{0}:{1}", + ["TIME_HMS"] = "{0}:{1}:{2}", } return localization_global \ No newline at end of file diff --git a/lua/app/config/strings/id/global.lua b/lua/app/config/strings/id/global.lua index 854c7967..9d9f7d0d 100644 --- a/lua/app/config/strings/id/global.lua +++ b/lua/app/config/strings/id/global.lua @@ -7,6 +7,16 @@ local localization_global = ["QLT_DESC_4"] = "Epic", ["QLT_DESC_5"] = "Legendary", ["QLT_DESC_6"] = "Myth", + ["TIME_STR_DHM"] = "{0} Hari {1} Jam {2} Menit", + ["TIME_STR_M"] = "{0} Menit", + ["TIME_STR_MS"] = "{0} Menit {1} Detik", + ["TIME_STR_S"] = "{0} Detik", + ["TIME_STR_DH"] = "{0} Hari {1} Jam", + ["TIME_STR_HMS"] = "{0} Jam {1} Menit {2} Detik", + ["TIME_STR_HM"] = "{0} Jam {1} Menit", + ["TIME_STR_D"] = "{0} Hari", + ["TIME_MS"] = "{0}:{1}", + ["TIME_HMS"] = "{0}:{1}:{2}", } return localization_global \ No newline at end of file diff --git a/lua/app/config/strings/ja/global.lua b/lua/app/config/strings/ja/global.lua index 6ff5271c..1963651e 100644 --- a/lua/app/config/strings/ja/global.lua +++ b/lua/app/config/strings/ja/global.lua @@ -7,6 +7,16 @@ local localization_global = ["QLT_DESC_4"] = "エピック", ["QLT_DESC_5"] = "レジェンド", ["QLT_DESC_6"] = "ミシック", + ["TIME_STR_DHM"] = "{0}日{1}時{2}分", + ["TIME_STR_M"] = "{0}分", + ["TIME_STR_MS"] = "{0}分{1}秒", + ["TIME_STR_S"] = "{0}秒", + ["TIME_STR_DH"] = "{0}日{1}時", + ["TIME_STR_HMS"] = "{0}時{1}分{2}秒", + ["TIME_STR_HM"] = "{0}時{1}分", + ["TIME_STR_D"] = "{0}日", + ["TIME_MS"] = "{0}:{1}", + ["TIME_HMS"] = "{0}:{1}:{2}", } return localization_global \ No newline at end of file diff --git a/lua/app/config/strings/ko/global.lua b/lua/app/config/strings/ko/global.lua index 3b3d2512..e9e65213 100644 --- a/lua/app/config/strings/ko/global.lua +++ b/lua/app/config/strings/ko/global.lua @@ -7,6 +7,16 @@ local localization_global = ["QLT_DESC_4"] = "에픽", ["QLT_DESC_5"] = "전설", ["QLT_DESC_6"] = "신화", + ["TIME_STR_DHM"] = "{0}일 {1}시 {2}분", + ["TIME_STR_M"] = "{0}분", + ["TIME_STR_MS"] = "{0}분 {1}초", + ["TIME_STR_S"] = "{0}초", + ["TIME_STR_DH"] = "{0}일 {1}시", + ["TIME_STR_HMS"] = "{0}시 {1}분 {2}초", + ["TIME_STR_HM"] = "{0}시 {1}분", + ["TIME_STR_D"] = "{0}일", + ["TIME_MS"] = "{0}:{1}", + ["TIME_HMS"] = "{0}:{1}:{2}", } return localization_global \ No newline at end of file diff --git a/lua/app/config/strings/pt/global.lua b/lua/app/config/strings/pt/global.lua index 44190f69..e9a753bd 100644 --- a/lua/app/config/strings/pt/global.lua +++ b/lua/app/config/strings/pt/global.lua @@ -7,6 +7,16 @@ local localization_global = ["QLT_DESC_4"] = "Épico", ["QLT_DESC_5"] = "Lendário", ["QLT_DESC_6"] = "Místico", + ["TIME_STR_DHM"] = "{0} Dia(s) {1} Hora(s) {2} Minuto(s)", + ["TIME_STR_M"] = "{0} Minuto(s)", + ["TIME_STR_MS"] = "{0} Minuto(s) {1} Segundo(s)", + ["TIME_STR_S"] = "{0} Segundo(s)", + ["TIME_STR_DH"] = "{0} Dia(s) {1} Hora(s)", + ["TIME_STR_HMS"] = "{0} Hora(s) {1} Minuto(s) {2} Segundo(s)", + ["TIME_STR_HM"] = "{0} Hora(s) {1} Minuto(s)", + ["TIME_STR_D"] = "{0} Dia(s)", + ["TIME_MS"] = "{0}:{1}", + ["TIME_HMS"] = "{0}:{1}:{2}", } return localization_global \ No newline at end of file diff --git a/lua/app/config/strings/th/global.lua b/lua/app/config/strings/th/global.lua index 77f5d492..78849943 100644 --- a/lua/app/config/strings/th/global.lua +++ b/lua/app/config/strings/th/global.lua @@ -7,6 +7,16 @@ local localization_global = ["QLT_DESC_4"] = "บทกวีเล่าเรื่อง", ["QLT_DESC_5"] = "มีชื่อเสียงมาก", ["QLT_DESC_6"] = "ตำนาน", + ["TIME_STR_DHM"] = "{0}วัน{1}ชั่วโมง{2}นาที", + ["TIME_STR_M"] = "{0} คะแนน", + ["TIME_STR_MS"] = "{0} นาที {1} วินาที", + ["TIME_STR_S"] = "{0} วินาที", + ["TIME_STR_DH"] = "{0} วัน {1} ชั่วโมง", + ["TIME_STR_HMS"] = "{0}ชั่วโมง{1}นาที{2}วินาที", + ["TIME_STR_HM"] = "{0} ชั่วโมง {1} นาที", + ["TIME_STR_D"] = "{0} วัน", + ["TIME_MS"] = "{0}:{1}", + ["TIME_HMS"] = "{0}:{1}:{2}", } return localization_global \ No newline at end of file diff --git a/lua/app/config/strings/vi/global.lua b/lua/app/config/strings/vi/global.lua index 671d896b..7d142306 100644 --- a/lua/app/config/strings/vi/global.lua +++ b/lua/app/config/strings/vi/global.lua @@ -7,6 +7,16 @@ local localization_global = ["QLT_DESC_4"] = "Sử Thi", ["QLT_DESC_5"] = "Truyền Thuyết", ["QLT_DESC_6"] = "Thần Thoại", + ["TIME_STR_DHM"] = "{0}ngày{1}giờ{2}phút", + ["TIME_STR_M"] = "{0}phút", + ["TIME_STR_MS"] = "{0}phút{1}giây", + ["TIME_STR_S"] = "{0}giây", + ["TIME_STR_DH"] = "{0}ngày{1}giờ", + ["TIME_STR_HMS"] = "{0}giờ{1}phút{2}giây", + ["TIME_STR_HM"] = "{0}giờ{1}phút", + ["TIME_STR_D"] = "{0}ngày", + ["TIME_MS"] = "{0}:{1}", + ["TIME_HMS"] = "{0}:{1}:{2}", } return localization_global \ No newline at end of file diff --git a/lua/app/config/strings/zh/global.lua b/lua/app/config/strings/zh/global.lua index 134630c5..b94ab5fb 100644 --- a/lua/app/config/strings/zh/global.lua +++ b/lua/app/config/strings/zh/global.lua @@ -7,6 +7,16 @@ local localization_global = ["QLT_DESC_4"] = "史詩", ["QLT_DESC_5"] = "傳説", ["QLT_DESC_6"] = "神話", + ["TIME_STR_DHM"] = "{0}天{1}時{2}分", + ["TIME_STR_M"] = "{0}分", + ["TIME_STR_MS"] = "{0}分{1}秒", + ["TIME_STR_S"] = "{0}秒", + ["TIME_STR_DH"] = "{0}天{1}時", + ["TIME_STR_HMS"] = "{0}時{1}分{2}秒", + ["TIME_STR_HM"] = "{0}時{1}分", + ["TIME_STR_D"] = "{0}天", + ["TIME_MS"] = "{0}:{1}", + ["TIME_HMS"] = "{0}:{1}:{2}", } return localization_global \ No newline at end of file diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index 13874ff0..28724165 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -1030,10 +1030,16 @@ end function BattleUnitComp:onSkillTakeEffect(skill) skill:endUse() + if skill:getIsEliminateType() then + self.battleController:generateGridType(skill:getEliminateSkillParameter()) + end local effectList = skill:getEffectList() if effectList == nil then return end + if #effectList == 0 then + return + end local targetType = skill:getTargetType() local target if targetType == 1 then -- 自己 diff --git a/lua/app/server/data/server_item_data.lua b/lua/app/server/data/server_item_data.lua index 0e59aa6d..ea227cb3 100644 --- a/lua/app/server/data/server_item_data.lua +++ b/lua/app/server/data/server_item_data.lua @@ -11,7 +11,7 @@ function ServerItemData:init(data) end self.data.items[idStr] = {cfg_id = id, count = item.count} end - self.data.recoveries = data.recoveries + self.data.recoveries = data.recoveries or {} else self.data.recoveries = {} end diff --git a/lua/app/ui/currency_bar/cell/currency_cell.lua b/lua/app/ui/currency_bar/cell/currency_cell.lua index da89742b..b7b5c1f6 100644 --- a/lua/app/ui/currency_bar/cell/currency_cell.lua +++ b/lua/app/ui/currency_bar/cell/currency_cell.lua @@ -32,20 +32,18 @@ function ResourceCell:show(itemId, hideAddImg) end) self.baseObject:removeClickListener() - - self.timeTx:setVisible(false) + if itemId == GConst.ItemConst.ITEM_ID_VIT then + self.timeTx:setVisible(true) + else + self.timeTx:setVisible(false) + end self.itemId = itemId - -- if itemId == GConst.ItemConst.ITEM_ID_GOLD then - -- self.addImg:setVisible(not hideAddImg) - -- else - -- self.addImg:setVisible(not hideAddImg) - -- end self.addImg:setVisible(false) -- 没有来源,直接隐藏 end function ResourceCell:updateTime() if self.itemId then - local curTime = DataManager.BagData:getTimelyItemRecoveryTime(self.itemId) + local curTime = DataManager.BagData.ItemData:getTimelyItemRecoveryTime(self.itemId) if curTime <= 0 then self.timeTx:setText(GConst.EMPTY_STRING) else diff --git a/lua/app/userdata/bag/bag_data.lua b/lua/app/userdata/bag/bag_data.lua index 91e80a51..d63dd09f 100644 --- a/lua/app/userdata/bag/bag_data.lua +++ b/lua/app/userdata/bag/bag_data.lua @@ -2,8 +2,6 @@ local BagData = class("BagData", BaseData) local ItemConst = require "app/module/item/item_const" -local SECONDS_PRE_DAY = 86400 - BagData.RECOVERY_TYPE = { TIMELY = 1, DAILY = 2, @@ -15,181 +13,14 @@ end function BagData:init(data) if data then - self.ItemData:init(data.ItemData.items) + self.ItemData:init(data.ItemData) else self.ItemData:init() end - - self.recoveries = data.recoveries or {} - -- ts在此处做转换:对每日回复来说,ts指下次回复时间;对时间回复来说,ts仍指上次回复时间 - for i,v in pairs(self.recoveries) do - self.recoveries[i].ts = self.recoveries[i].ts // 1000 - -- local cfg = RecoveryCfg[v.id] - -- if cfg.type == self.RECOVERY_TYPE.DAILY then - -- self.recoveries[i].ts = self.recoveries[i].ts + SECONDS_PRE_DAY - -- end - end - DataManager:registerDataCd("BagData") end function BagData:clear() self.ItemData:clear() - self.recoveries = {} - DataManager:unregisterDataCd("BagData") -end - --- 重置为上次回复的时间 -function BagData:resetItemRecoveryTime(itemId) - for i,v in pairs(self.recoveries) do - if v.id == itemId and self.recoveries[i] then - self.recoveries[i].ts = Time:getServerTime() - end - end -end - -function BagData:getTimelyItemRecoveryTime(itemId) - local data = self.recoveries[itemId] - if not data then - return -1 - end - -- 计算当前值和最大值 - -- local cfg = RecoveryCfg[itemId] - -- local curBigNum = self.ItemData:getItemBigNumById(itemId) - -- local maxBigNum = BigNumOpt.getEmptyBigNum() - -- if itemId == ItemConst.ITEM_ID_MINING_PICK then - -- maxBigNum = DataManager.MiningData:getItemMineLimitNum() - -- else - -- maxBigNum = cfg.limit - -- end - -- -- 如果是最大,则重置上一次时间为当前时间 - -- if BigNumOpt.bigNumCompare(curBigNum, BigNumOpt.num2BigNum(maxBigNum)) == 0 then - -- data.ts = Time:getServerTime() - -- return 1000 -- 需要持续重置,保持时间更新 - -- end - -- -- 计算时间 - -- local intervalTime = cfg.time - -- if itemId == GConst.ItemConst.ITEM_ID_MINING_PICK then - -- intervalTime = DataManager.MiningData:getRecoverIntervalTime() - -- end - -- local remainTime = data.ts + intervalTime - Time:getServerTime() - -- return remainTime -end - -function BagData:getDailyItemRecoveryMaxTime(itemId) - -- if itemId == ItemConst.ITEM_ID_PVP_KEY then - -- if self.ItemData:isPvPKeyMax() then - -- return -1 - -- end - -- elseif itemId == ItemConst.ITEM_ID_MOPPING_UP then - -- if self.ItemData:isMoppingUpMax() then - -- return -1 - -- end - -- end - - local data = self.recoveries[itemId] - if data then - return data.ts - Time:getServerTime() - end - return -1 -end - -function BagData:getTimelyItemRecoveryMaxTime(itemId) - local maxVit = 0 - local vit = 0 - -- if itemId == ItemConst.ITEM_ID_VIT then - -- if self.ItemData:isVitMax() then - -- return -1 - -- end - -- vit = self.ItemData:getVit() - -- maxVit = DataManager.PlayerData:getMaxVit() - -- elseif itemId == ItemConst.ITEM_ID_GUILD_KEY then - -- if self.ItemData:isGuildBossKeyMax() then - -- return -1 - -- end - -- vit = self.ItemData:getGuildBossKey() - -- maxVit = self.ItemData:getMaxGuildBossKey() - -- end - local curTime = self:getTimelyItemRecoveryTime(itemId) - if curTime < 0 then - return -1 - end - - -- local cfg = RecoveryCfg[itemId] - -- if not cfg then - -- return -1 - -- end - -- curTime = curTime + (maxVit - vit - 1)*cfg.time - -- return curTime -end --- 按时间回复的在此回复 -function BagData:recoveryItem(data, maxNum) - -- 计算已经达到上限 - local curBigNum = self.ItemData:getItemNumById(data.id) - if curBigNum >= maxNum then - return - end - -- 计算恢复间隔 - -- local cfg = RecoveryCfg[data.id] - -- local nowTime = Time:getServerTime() - -- local diffTime = nowTime - data.ts -- 上次回复时间,此处计算离线总共回复多少个 - -- if diffTime <= 0 then - -- return - -- end - -- -- 计算增加数量 - -- local recoverTime = cfg.time - -- if data.id == GConst.ItemConst.ITEM_ID_MINING_PICK then -- 挖矿特殊处理,受研究属性影响 - -- recoverTime = DataManager.MiningData:getRecoverIntervalTime() - -- end - -- local addCount = math.floor(diffTime / recoverTime) - -- if addCount <= 0 then - -- return - -- end - -- local addBigNum = BigNumOpt.num2BigNum(addCount) - -- -- 计算此次实际增加数量 - -- local addAfterNum = BigNumOpt.bigNumAdd(curBigNum, addBigNum) - -- if BigNumOpt.bigNumCompare(addAfterNum, maxBigNum) > 0 then - -- addBigNum = BigNumOpt.bigNumSub(maxBigNum, curBigNum) - -- end - -- Logger.logHighlight("实际恢复数量:".. BigNumOpt.bigNum2Num(addBigNum) ) - -- -- 根据实际增加的数量,计算恢复时间 - -- data.ts = data.ts + recoverTime * BigNumOpt.bigNum2Num(addBigNum) - -- self.ItemData:addItemNumById(data.id, addBigNum, BIReport.ITEM_GET_TYPE.UPDATE_TIME) -end --- 每日回复的在此回复 -function BagData:recoveryDailyItem(key, data) - -- local nowTime = Time:getServerTime() - -- if nowTime < self.recoveries[key].ts then - -- return - -- end - -- local itemId = data.id - -- local cfg = RecoveryCfg[data.id] - -- local curBigNum = self.ItemData:getItemBigNumById(itemId) - -- local maxBigNum = cfg.limit - - -- if BigNumOpt.bigNumCompare(curBigNum, maxBigNum) < 0 then - -- self.ItemData:addItemNumById(itemId, BigNumOpt.bigNumSub(maxBigNum, curBigNum), BIReport.ITEM_GET_TYPE.CROSS_DAY) - -- end - -- -- 计算下次回复的时间 - -- self.recoveries[key].ts = self.recoveries[key].ts + SECONDS_PRE_DAY -end - -function BagData:updateCd() - if not self.recoveries then - return - end - for i,v in pairs(self.recoveries) do - -- local cfg = RecoveryCfg[v.id] - -- if cfg.type == self.RECOVERY_TYPE.DAILY then - -- self:recoveryDailyItem(i, v) -- 每日的直接加满 - -- else - -- local limit = cfg.limit - -- if v.id == GConst.ItemConst.ITEM_ID_MINING_PICK then -- 挖矿的上限特殊处理,受属性影响 - -- limit = DataManager.MiningData:getItemMineLimitNum() - -- limit = BigNumOpt.num2BigNum(limit) - -- end - -- self:recoveryItem(v, limit) -- 根据间隔时间增加 - -- end - end end return BagData \ No newline at end of file diff --git a/lua/app/userdata/bag/item_data.lua b/lua/app/userdata/bag/item_data.lua index 1a8716a3..c6cb0aab 100644 --- a/lua/app/userdata/bag/item_data.lua +++ b/lua/app/userdata/bag/item_data.lua @@ -1,8 +1,14 @@ local ItemEntity = require "app/userdata/bag/item_entity" +local ServerGameData = require "app/server/server_game_data" local ItemConst = require "app/module/item/item_const" local ItemData = class("ItemData", BaseData) +local RecoveryCfg = ConfigManager:getConfig("recovery") + +local RECOVERY_TYPE_DAILY = 2 +local SECONDS_PRE_DAY = 86400 + local CACHE_ITEM = { cfg_id = 0, count = 0 @@ -15,20 +21,38 @@ end function ItemData:init(data) self.items = {} data = data or {} - for _, info in pairs(data) do - -- if info.id == GConst.ItemConst.ITEM_ID_GEM then - -- local parmas = {} - -- parmas.gem = BigNumOpt.bigNum2Num(info.count) - -- CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(parmas) - -- elseif info.id == GConst.ItemConst.ITEM_ID_GOLD then - -- local parmas = {} - -- parmas.gold_value = info.count - -- parmas.gold_unit = info.count - -- CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(parmas) - -- end - self:_add(info.cfg_id, info.count) + if data.items then + for _, info in pairs(data.items) do + -- if info.id == GConst.ItemConst.ITEM_ID_GEM then + -- local parmas = {} + -- parmas.gem = BigNumOpt.bigNum2Num(info.count) + -- CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(parmas) + -- elseif info.id == GConst.ItemConst.ITEM_ID_GOLD then + -- local parmas = {} + -- parmas.gold_value = info.count + -- parmas.gold_unit = info.count + -- CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(parmas) + -- end + if info.cfg_id == GConst.ItemConst.ITEM_ID_VIT then + DataManager.PlayerData:setVit(info.count) + end + self:_add(info.cfg_id, info.count) + end + end + self.recoveryList = {} + self.recoveryMap = {} + if data.recoveries then + for k, v in ipairs(data.recoveries) do + local obj = { + cfg_id = v.cfg_id, + ts = v.ts + } + self.recoveryMap[v.cfg_id] = obj + table.insert(self.recoveryList, obj) + end end self.data.dirty = false + DataManager:registerDataCd("ItemData") end function ItemData:_add(id, num) @@ -37,6 +61,7 @@ end function ItemData:clear() self.items = {} + DataManager:unregisterDataCd("ItemData") end -- 根据id获取道具 @@ -161,40 +186,32 @@ function ItemData:addItemNumById(id, num, itemGetType) self:addItem(CACHE_ITEM, itemGetType) end -function ItemData:_addItemNumById(id, bigNum) - if bigNum == nil then +function ItemData:_addItemNumById(id, num) + if num == nil then return end - -- local isFull = false - -- if id == ItemConst.ITEM_ID_VIT then - -- -- isFull = DataManager.BagData.ItemData:isVitMax() - -- local maxVit = DataManager.PlayerData:getMaxVit() - -- isFull = currentCount >= maxVit - -- end - if self.items[id] then - self.items[id]:addNum(bigNum) - else - self:_add(id, bigNum) - end - -- if id == ItemConst.ITEM_ID_VIT and isFull and not DataManager.BagData.ItemData:isVitMax() then - -- if id == ItemConst.ITEM_ID_VIT and isFull then - -- local maxVit = DataManager.PlayerData:getMaxVit() - -- local isNewFull = currentCount >= maxVit - -- if not isNewFull then - -- DataManager.BagData:resetItemRecoveryTime(ItemConst.ITEM_ID_VIT) - -- end - -- end - self:setDirty() -end - -function ItemData:setItemNumById(id, bigNum) - if bigNum == nil then - return + local isFull = false + if id == ItemConst.ITEM_ID_VIT then + -- isFull = DataManager.BagData.ItemData:isVitMax() + local maxVit = DataManager.PlayerData:getMaxVit() + local currentCount = DataManager.PlayerData:getVit() + isFull = currentCount >= maxVit end if self.items[id] then - self.items[id]:setNum(bigNum) + self.items[id]:addNum(num) else - self:_add(id, bigNum) + if id == GConst.ItemConst.ITEM_ID_VIT then + DataManager.PlayerData:setVit(num) + end + self:_add(id, num) + end + if id == ItemConst.ITEM_ID_VIT and isFull then + local maxVit = DataManager.PlayerData:getMaxVit() + local currentCount = DataManager.PlayerData:getVit() + local isNewFull = currentCount >= maxVit + if not isNewFull then + self:resetItemRecoveryTime(ItemConst.ITEM_ID_VIT) + end end self:setDirty() end @@ -203,4 +220,90 @@ function ItemData:setDirty() self.data.dirty = not self.data.dirty end +function ItemData:getTimelyItemRecoveryTime(itemId) + local data = self.recoveryMap[itemId] + if not data then + return -1 + end + -- 计算当前值和最大值 + local cfg = RecoveryCfg[itemId] + local currNum = self:getItemNumById(itemId) + -- 如果是最大,则重置上一次时间为当前时间 + if currNum >= cfg.limit then + return -1 + end + -- 计算时间 + local remainTime = data.ts + cfg.time - Time:getServerTime() + return remainTime +end + +-- 按时间回复的在此回复 +function ItemData:recoveryItem(data, maxNum) + -- 计算已经达到上限 + local itemId = data.cfg_id + local currNum = self.ItemData:getItemById(itemId) + if currNum >= maxNum then + return + end + -- 计算恢复间隔 + local cfg = RecoveryCfg[itemId] + local nowTime = Time:getServerTime() + local diffTime = nowTime - data.ts -- 上次回复时间,此处计算离线总共回复多少个 + if diffTime <= 0 then + return + end + -- 计算增加数量 + local recoverTime = cfg.time + local addCount = math.floor(diffTime / recoverTime) + if addCount <= 0 then + return + end + -- 计算此次实际增加数量 + local addAfterNum = currNum + addCount + if addAfterNum > maxNum then + addCount = maxNum - currNum + end + -- 根据实际增加的数量,计算恢复时间 + data.ts = data.ts + recoverTime * addCount + self:addItemNumById(itemId, addCount, BIReport.ITEM_GET_TYPE.RECOVERY_TIME) +end + +-- 每日回复的在此回复 +function ItemData:recoveryDailyItem(key, data) + local nowTime = Time:getServerTime() + if nowTime < self.recoveryMap[key].ts then + return + end + local itemId = data.cfg_id + local cfg = RecoveryCfg[itemId] + local currNum = self:getItemNumById(itemId) + if currNum < cfg.limit then + self:addItemNumById(itemId, cfg.limit - currNum, BIReport.ITEM_GET_TYPE.CROSS_DAY) + end + -- 计算下次回复的时间 + self.recoveryMap[key].ts = self.recoveryMap[key].ts + SECONDS_PRE_DAY +end + +function ItemData:resetItemRecoveryTime(itemId) + local obj = self.recoveryMap[itemId] + if obj then + obj.ts = Time:getServerTime() + end +end + +function ItemData:updateCd() + if not self.recoveryList then + return + end + for i, v in ipairs(self.recoveryList) do + local cfg = RecoveryCfg[v.id] + if cfg.type == RECOVERY_TYPE_DAILY then + self:recoveryDailyItem(i, v) -- 每日的直接加满 + else + self:recoveryItem(v, cfg.limit) -- 根据间隔时间增加 + end + end + ServerGameData.BagData.ItemData:recoveryItems() +end + return ItemData \ No newline at end of file diff --git a/lua/app/userdata/bag/item_entity.lua b/lua/app/userdata/bag/item_entity.lua index 2058aca8..a954c63f 100644 --- a/lua/app/userdata/bag/item_entity.lua +++ b/lua/app/userdata/bag/item_entity.lua @@ -37,6 +37,9 @@ end -- 加减道具数量 function ItemEntity:addNum(num) self.data.num = self.data.num + num + if self.data.id == GConst.ItemConst.ITEM_ID_VIT then + DataManager.PlayerData:setVit(self.data.num) + end self:setDirty() end diff --git a/lua/app/userdata/battle/skill/battle_skill_entity.lua b/lua/app/userdata/battle/skill/battle_skill_entity.lua index 71bdf75e..75771547 100644 --- a/lua/app/userdata/battle/skill/battle_skill_entity.lua +++ b/lua/app/userdata/battle/skill/battle_skill_entity.lua @@ -23,7 +23,11 @@ function BattleSkillEntity:init() self.cd = 0 end self:initSkillEffect() - self.available = self.skillInfo.effect ~= nil + if self.skillInfo.effect or self.skillInfo.name_act then + self.available = true + else + self.available = false + end self:clearRecordData() end @@ -121,6 +125,16 @@ function BattleSkillEntity:getIsActiveType() return self.skillType == BattleConst.SKILL_TYPE_ACTIVE end +-- 消除类技能 +function BattleSkillEntity:getIsEliminateType() + return self.skillInfo.skill_type == 3 +end + +-- 消除类技能参数 +function BattleSkillEntity:getEliminateSkillParameter() + return self.skillInfo.skill_type_parameter +end + function BattleSkillEntity:changeSkillId(skillId) self.skillId = skillId self:init()