diff --git a/reframework/autorun/MHR_Overlay/Buffs/abnormal_statuses.lua b/reframework/autorun/MHR_Overlay/Buffs/abnormal_statuses.lua index af710ec..a5196e1 100644 --- a/reframework/autorun/MHR_Overlay/Buffs/abnormal_statuses.lua +++ b/reframework/autorun/MHR_Overlay/Buffs/abnormal_statuses.lua @@ -184,7 +184,7 @@ function this.update(player, player_data) buffs.update_generic_buff(this.list, ailments_type_name, "roar", this.get_abnormal_status_name, nil, nil, player, ear_duration_timer_field); buffs.update_generic_buff(this.list, ailments_type_name, "webbed", this.get_abnormal_status_name, nil, nil, player, beto_duration_timer_field); buffs.update_generic_buff(this.list, ailments_type_name, "stench", this.get_abnormal_status_name, nil, nil, player, stink_duration_timer_field); - buffs.update_generic_buff(this.list, ailments_type_name, "leeched", this.get_abnormal_status_name, nil, nil, player, blooding_enemy_timer_field, nil, nil, true); + buffs.update_generic_buff(this.list, ailments_type_name, "leeched", this.get_abnormal_status_name, nil, nil, player, blooding_enemy_timer_field, true); buffs.update_generic_buff(this.list, ailments_type_name, "bleeding", this.get_abnormal_status_name, nil, nil, player, bleeding_debuff_timer_field); buffs.update_generic_buff(this.list, ailments_type_name, "frenzy", this.get_abnormal_status_name, nil, nil, player, virus_onset_timer_field); @@ -281,7 +281,7 @@ function this.update_frenzy_infection(player) local timer = frenzy_infected_duration - (virus_accumulator_value + virus_timer / 60); - buffs.update_generic(this.list, ailments_type_name, "frenzy_infection", this.get_abnormal_status_name, 1, timer, frenzy_infected_duration); + buffs.update_generic(this.list, ailments_type_name, "frenzy_infection", this.get_abnormal_status_name, 1, timer); end function this.update_sleep(player) diff --git a/reframework/autorun/MHR_Overlay/Buffs/buffs.lua b/reframework/autorun/MHR_Overlay/Buffs/buffs.lua index a7417a9..b695cbe 100644 --- a/reframework/autorun/MHR_Overlay/Buffs/buffs.lua +++ b/reframework/autorun/MHR_Overlay/Buffs/buffs.lua @@ -52,37 +52,6 @@ local os = os; local ValueType = ValueType; local package = package; ---[[ - TODO: - [x] DONE! Wirebug-related skills - [x] DONE! More Dango skills - [x] DONE! Weapon buffs - [x] DONE! Horn music - [x] DONE! abnormal_statuses: Immunity - [x] DONE! item_buffs: Stinkmink - [x] DONE! rampage skills: Chameleos Soul - [x] DONE! skills: powder mantle - [x] DONE! skills: embolden - [x] DONE! skills: strife - [x] DONE! skills: berserk - [x] DONE! skills: dragon conversion - [x] DONE! abnormal_statuses: Pre-Sleep - [x] DONE! skills: charge master - [x] DONE! endemic_life_buffs: Red, Yellow Lampsquid - [x] DONE! weapon skills - Arc Shot: Affinity, Arc Shot: Brace - [x] DONE! Demon Ammo, Armor Ammo - More otomo skills - Add duration detection to skills - Add duration detection to otomo moves - Add duration detection to dango skills - Add duration detection to rampage skills - Add duration detection to endemic life buffs - - [x] WONT IMPLEMENT! skills: Furious Buildup - [x] WONT IMPLEMENT! skills: frostcraft - [x] COULDNT FIND! skills: defiance -]] - local player_manager_type_def = sdk.find_type_definition("snow.player.PlayerManager"); local get_player_method = player_manager_type_def:get_method("getPlayer"); local find_master_player_method = player_manager_type_def:get_method("findMasterPlayer"); @@ -93,6 +62,7 @@ local get_player_data_method = player_base_type_def:get_method("get_PlayerData") local player_lobby_base_type_def = sdk.find_type_definition("snow.player.PlayerLobbyBase"); local player_base_type_def = sdk.find_type_definition("snow.player.PlayerBase"); +local get_player_skill_list_method = player_base_type_def:get_method("get_PlayerSkillList"); local player_weapon_type_field = player_base_type_def:get_field("_playerWeaponType"); function this.new(type, key, name, level, duration) @@ -154,8 +124,6 @@ function this.init_names() misc_buffs.init_names(); end -local tere = {}; - function this.update() if not config.current_config.buff_UI.enabled then return; @@ -186,6 +154,12 @@ function this.update() return; end + local player_skill_list = get_player_skill_list_method:call(master_player); + if player_skill_list == nil then + error_handler.report("buffs.update", "Failed to access Data: player_skill_list"); + return; + end + local weapon_type = player_weapon_type_field:get_data(master_player); if weapon_type == nil then error_handler.report("skills.update", "Failed to access Data: weapon_type"); @@ -199,36 +173,16 @@ function this.update() rampage_skills.update(master_player_data); if not is_player_lobby_base then - skills.update(master_player, master_player_data, weapon_type); - dango_skills.update(master_player, master_player_data); + skills.update(master_player, master_player_data, weapon_type, player_skill_list); + dango_skills.update(master_player, master_player_data, player_skill_list); endemic_life_buffs.update(master_player, master_player_data); abnormal_statuses.update(master_player, master_player_data); weapon_skills.update(master_player, master_player_data, weapon_type); misc_buffs.update(master_player, master_player_data); end - - -- xy = ""; - - -- local fields = master_player_data:get_type_definition():get_fields(); - - -- for i = 1, 999 do - -- if fields[i] ~= nil then - -- local value = fields[i]:get_data(master_player_data); - -- if value ~= nil then - -- pcall(function() - -- if tere[fields[i]] == nil then - -- tere[fields[i]] = value; - - -- elseif not utils.number.is_equal(value, tere[fields[i]]) then - -- xy = string.format("%s%s: %s\n", xy, fields[i]:get_name(), tostring(value)); - -- end - -- end); - -- end - -- end - -- end end -function this.update_timer(buff, timer, duration) +function this.update_timer(buff, timer) if timer == nil then return; end @@ -237,10 +191,8 @@ function this.update_timer(buff, timer, duration) timer = 0; end - duration = duration or timer; - - if duration > buff.duration then - buff.duration = duration; + if timer > buff.duration then + buff.duration = timer; end local minutes_left = math.floor(timer / 60); @@ -257,7 +209,6 @@ end function this.update_generic_buff(buff_list, buff_type, buff_key, get_name_function, value_owner, value_holder, timer_owner, timer_holder, - duration_owner, duration_holder, is_infinite, minimal_value, level_breakpoints) if timer_owner == nil then timer_owner = value_owner; end @@ -327,36 +278,35 @@ function this.update_generic_buff(buff_list, buff_type, buff_key, get_name_funct end end - local duration = nil; - if duration_holder ~= nil then - if utils.type.is_REField(duration_holder) then - duration = duration_holder:get_data(duration_owner); - else - duration = duration_holder:call(duration_owner); - end + -- local duration = nil; + -- if duration_holder ~= nil then + -- if utils.type.is_REField(duration_holder) then + -- duration = duration_holder:get_data(duration_owner); + -- else + -- duration = duration_holder:call(duration_owner); + -- end - if duration == nil then - error_handler.report("buffs.update_generic_number", string.format("Failed to access Data: %s_duration", buff_key)); - return; - end - end + -- if duration == nil then + -- error_handler.report("buffs.update_generic_number", string.format("Failed to access Data: %s_duration", buff_key)); + -- return; + -- end + -- end - return this.update_generic(buff_list, buff_type, buff_key, get_name_function, level, timer, duration); + return this.update_generic(buff_list, buff_type, buff_key, get_name_function, level, timer); end -function this.update_generic(buff_list, buff_type, buff_key, get_name_function, level, timer, duration) - duration = duration or timer; +function this.update_generic(buff_list, buff_type, buff_key, get_name_function, level, timer) level = level or 1; local buff = buff_list[buff_key]; if buff == nil then local name = get_name_function(buff_key); - buff = this.new(buff_type, buff_key, name, level, duration); + buff = this.new(buff_type, buff_key, name, level, timer); buff_list[buff_key] = buff; else buff.level = level; - this.update_timer(buff, timer, duration); + this.update_timer(buff, timer); end return buff; diff --git a/reframework/autorun/MHR_Overlay/Buffs/dango_skills.lua b/reframework/autorun/MHR_Overlay/Buffs/dango_skills.lua index 809d617..5dc148f 100644 --- a/reframework/autorun/MHR_Overlay/Buffs/dango_skills.lua +++ b/reframework/autorun/MHR_Overlay/Buffs/dango_skills.lua @@ -54,7 +54,7 @@ this.list = { super_recovery_dango = nil }; -local dango_ids = { +local dango_skill_ids = { -- dango_polisher = 1, -- dango_rider = 2, dango_adrenaline = 3, @@ -121,11 +121,7 @@ local previous_super_recovery_dango_timer = 0; local player_manager_type_def = sdk.find_type_definition("snow.player.PlayerManager"); local get_player_data_method = player_manager_type_def:get_method("get_PlayerData"); -local get_player_skill_method = player_manager_type_def:get_method("get_PlayerSkill"); -local get_ref_item_parameter_method = player_manager_type_def:get_method("get_RefItemParameter"); - -local player_user_data_item_parameter_type_def = get_ref_item_parameter_method:get_return_type(); - +local has_anyone_kitchen_skill_in_quest_method = player_manager_type_def:get_method("hasAnyoneKitchenSkillInQuest"); local player_data_type_def = sdk.find_type_definition("snow.player.PlayerData"); @@ -155,9 +151,6 @@ local get_kitchen_skill_surume_regene_timer_method = player_base_type_def:get_me local player_quest_base_type_def = sdk.find_type_definition("snow.player.PlayerQuestBase"); -local player_skill_list_type_def = sdk.find_type_definition("snow.player.PlayerSkillList"); -local has_kitchen_skill_method = player_skill_list_type_def:get_method("hasKitchenSkill"); - local data_shortcut_type_def = sdk.find_type_definition("snow.data.DataShortcut"); local get_name_method = data_shortcut_type_def:get_method("getName(snow.data.DataDef.PlKitchenSkillId)"); @@ -170,10 +163,9 @@ local system_array_type_def = sdk.find_type_definition("System.Array"); local get_length_method = system_array_type_def:get_method("get_Length"); local get_value_method = system_array_type_def:get_method("GetValue(System.Int32)"); -function this.update(player, player_data) - local item_parameter = get_ref_item_parameter_method:call(singletons.player_manager); - if item_parameter == nil then - error_handler.report("dango_skills.update", "Failed to access Data: item_parameter"); +function this.update(player, player_data, player_skill_list) + if singletons.player_manager == nil then + error_handler.report("dango_skills.update", "Failed to access Data: player_manager"); return; end @@ -184,17 +176,10 @@ function this.update(player, player_data) this.update_dango_flyer(player); this.update_super_recovery_dango(player); - buffs.update_generic_buff(this.list, dango_skills_type_name, "dango_defender", this.get_dango_name, - player_data, is_enable_kitchen_skill_048_reduce_method, nil, nil, nil, nil, true); - - buffs.update_generic_buff(this.list, dango_skills_type_name, "dango_booster", this.get_dango_name, - nil, nil, player_data, kitchen_skill_027_timer_field); - - buffs.update_generic_buff(this.list, dango_skills_type_name, "dango_glutton", this.get_dango_name, - nil, nil, player_data, kitchen_skill_045_timer_field); - - buffs.update_generic_buff(this.list, dango_skills_type_name, "dango_connector", this.get_dango_name, - nil, nil, player_data, kitchen_skill_054_timer_field); + buffs.update_generic_buff(this.list, dango_skills_type_name, "dango_booster", this.get_dango_skill_name, nil, nil, player_data, kitchen_skill_027_timer_field); + buffs.update_generic_buff(this.list, dango_skills_type_name, "dango_defender", this.get_dango_skill_name, player_data, is_enable_kitchen_skill_048_reduce_method, nil, nil, true); + buffs.update_generic_buff(this.list, dango_skills_type_name, "dango_glutton", this.get_dango_skill_name, nil, nil, player_data, kitchen_skill_045_timer_field); + buffs.update_generic_buff(this.list, dango_skills_type_name, "dango_connector", this.get_dango_skill_name, nil, nil, player_data, kitchen_skill_054_timer_field); end function this.update_dango_adrenaline() @@ -203,7 +188,7 @@ function this.update_dango_adrenaline() return; end - buffs.update_generic(this.list, dango_skills_type_name, "dango_adrenaline", this.get_dango_name); + buffs.update_generic(this.list, dango_skills_type_name, "dango_adrenaline", this.get_dango_skill_name); end function this.update_dango_insurance() @@ -217,46 +202,7 @@ function this.update_dango_insurance() return; end - local player_skill_list_array = get_player_skill_method:call(singletons.player_manager); - if player_skill_list_array == nil then - error_handler.report("dango_skills.update_dango_insurance", "Failed to access Data: player_skill_list_array"); - return; - end - - local player_skill_list_array_length = get_length_method:call(player_skill_list_array); - if player_skill_list_array_length == nil then - error_handler.report("dango_skills.update_dango_insurance", "Failed to access Data: player_skill_array_list_length"); - return; - end - - local length = player_skill_list_array_length - 1; - - local has_insurance_skill = false; - - for player_id = 0, length do - if players.list[player_id] == nil then - goto continue; - end - - local player_skill_list = get_value_method:call(player_skill_list_array, player_id); - if player_skill_list_array_length == nil then - error_handler.report("dango_skills.update_dango_insurance", "Failed to access Data: player_skill_list No. " .. tostring(player_id)); - goto continue; - end - - local kitchen_skill = has_kitchen_skill_method:call(player_skill_list, dango_ids.dango_insurance); - if kitchen_skill == nil then - error_handler.report("dango_skills.update_dango_insurance", "Failed to access Data: kitchen_skill No. " .. tostring(player_id)); - goto continue; - end - - if kitchen_skill then - has_insurance_skill = true; - break; - end - - ::continue:: - end + local has_insurance_skill = has_anyone_kitchen_skill_in_quest_method:call(singletons.player_manager, dango_skill_ids.dango_insurance); local flag_cat_skill_insurance = flag_cat_skill_insurance_field:get_data(singletons.quest_manager); if flag_cat_skill_insurance == nil then @@ -275,7 +221,7 @@ function this.update_dango_insurance() return; end - buffs.update_generic(this.list, dango_skills_type_name, "dango_insurance", this.get_dango_name, 1); + buffs.update_generic(this.list, dango_skills_type_name, "dango_insurance", this.get_dango_skill_name, 1); end function this.update_dango_insurance_defense_up(player_data) @@ -303,7 +249,7 @@ function this.update_dango_insurance_defense_up(player_data) level = 4; end - buffs.update_generic(this.list, dango_skills_type_name, "dango_insurance_defense_up", this.get_dango_name, level); + buffs.update_generic(this.list, dango_skills_type_name, "dango_insurance_defense_up", this.get_dango_skill_name, level); end function this.update_dango_flyer(player) @@ -331,14 +277,13 @@ function this.update_dango_flyer(player) level = 3; end - buffs.update_generic(this.list, dango_skills_type_name, "dango_flyer", this.get_dango_name, level); + buffs.update_generic(this.list, dango_skills_type_name, "dango_flyer", this.get_dango_skill_name, level); end function this.update_dango_hunter(player_data) - local dango_hunter_buff = buffs.update_generic_buff(this.list, dango_skills_type_name, "dango_hunter", this.get_dango_name, - nil, nil, player_data, kitchen_skill_051_atk_up_timer_field); + local dango_hunter_buff = buffs.update_generic_buff(this.list, dango_skills_type_name, "dango_hunter", this.get_dango_skill_name, nil, nil, player_data, kitchen_skill_051_atk_up_timer_field); - if dango_hunter_buff then + if dango_hunter_buff ~= nil then dango_hunter_buff.level = 4; end end @@ -358,11 +303,12 @@ function this.update_super_recovery_dango(player) previous_super_recovery_dango_timer = kitchen_skill_surume_regene_timer; - buffs.update_generic(this.list, dango_skills_type_name, "super_recovery_dango", this.get_dango_name); + buffs.update_generic(this.list, dango_skills_type_name, "super_recovery_dango", this.get_dango_skill_name); end -function this.get_dango_name(dango_key) - if dango_ids[dango_key] == nil then +function this.get_dango_skill_name(dango_key) + local dango_skill_id = dango_skill_ids[dango_key]; + if dango_skill_id == nil then local dango_skill_name = language.current_language.dango_skills[dango_key]; if dango_skill_name == nil then @@ -372,7 +318,7 @@ function this.get_dango_name(dango_key) return dango_skill_name; end - local dango_skill_name = get_name_method:call(nil, dango_ids[dango_key]); + local dango_skill_name = get_name_method:call(nil, dango_skill_id); if dango_skill_name == nil then error_handler.report("dango_skills.get_dango_name", string.format("Failed to access Data: %s_name", dango_key)); return dango_key; diff --git a/reframework/autorun/MHR_Overlay/Buffs/endemic_life_buffs.lua b/reframework/autorun/MHR_Overlay/Buffs/endemic_life_buffs.lua index ef8f352..34252ef 100644 --- a/reframework/autorun/MHR_Overlay/Buffs/endemic_life_buffs.lua +++ b/reframework/autorun/MHR_Overlay/Buffs/endemic_life_buffs.lua @@ -64,13 +64,6 @@ local butterflame_attack_up = 25; -local player_manager_type_def = sdk.find_type_definition("snow.player.PlayerManager"); -local get_player_data_method = player_manager_type_def:get_method("get_PlayerData"); -local get_ref_item_parameter_method = player_manager_type_def:get_method("get_RefItemParameter"); - -local player_user_data_item_parameter_type_def = get_ref_item_parameter_method:get_return_type(); -local demondrug_atk_up_field = player_user_data_item_parameter_type_def:get_field("_DemondrugAtkUp"); - local player_data_type_def = sdk.find_type_definition("snow.player.PlayerData"); -- Cutterfly local crit_up_ec_second_timer_field = player_data_type_def:get_field("_CritUpEcSecondTimer"); @@ -114,8 +107,6 @@ function this.update(player, player_data, item_parameter) buffs.update_generic_buff(this.list, endemic_life_buffs_type_name, "yellow_lampsquid", this.get_endemic_life_name, nil, nil, player_data, def_up_ec_second_timer_field); - - end function this.update_ruby_and_gold_wirebugs(player, player_data) @@ -156,37 +147,6 @@ function this.update_butterflame(player_data) nil, nil, player_data, atk_up_buff_second_timer_field); end -function this.update_peepersects(player_data) - local stamina_up_buff_second_timer = stamina_up_buff_second_timer_field:get_data(player_data); - if stamina_up_buff_second_timer == nil then - error_handler.report("item_buffs.update_peepersects", "Failed to access Data: stamina_up_buff_second_timer"); - return; - end - - if utils.number.is_equal(stamina_up_buff_second_timer, 0) then - this.list.peepersects = nil; - return; - end - - local timer = stamina_up_buff_second_timer / 60; - local peepersects_buff = this.list.peepersects; - - if peepersects_buff == nil and item_buffs.list.dash_juice ~= nil and timer <= item_buffs.list.dash_juice.timer then - return; - end - - if peepersects_buff == nil - or (peepersects_buff ~= nil and timer > peepersects_buff.timer) then - local timer_percentage = timer / this.peepersects_duration; - if timer_percentage < 0.95 or timer_percentage > 1.05 then - this.list.peepersects = nil; - return; - end - end - - buffs.update_generic(this.list, endemic_life_buffs_type_name, "peepersects", this.get_endemic_life_name, 1, timer, this.peepersects_duration); -end - function this.get_endemic_life_name(endemic_life_buff_key) if singletons.message_manager == nil then error_handler.report("endemic_life_buffs.get_endemic_life_name", "Failed to access Data: message_manager"); diff --git a/reframework/autorun/MHR_Overlay/Buffs/item_buffs.lua b/reframework/autorun/MHR_Overlay/Buffs/item_buffs.lua index 9d5186e..3a57bc8 100644 --- a/reframework/autorun/MHR_Overlay/Buffs/item_buffs.lua +++ b/reframework/autorun/MHR_Overlay/Buffs/item_buffs.lua @@ -65,7 +65,7 @@ local item_ids = { --adamant_seed = 68157924, demon_powder = 68157920, hardshell_powder = 68157925, - immunizer = 68157911, + --immunizer = 68157911, --dash_juice = 68157913, gourmet_fish = 68157909, demon_ammo = 68157595, @@ -86,15 +86,6 @@ local great_demondrug_atk_up_field = player_user_data_item_parameter_type_def:ge local armorskin_def_up_field = player_user_data_item_parameter_type_def:get_field("_ArmorSkinDefUp"); local great_armorskin_def_up_field = player_user_data_item_parameter_type_def:get_field("_GreatArmorSkinDefUp"); -local might_seed_atk_up_field = player_user_data_item_parameter_type_def:get_field("_MightSeedAtkUp"); -local might_seed_timer_field = player_user_data_item_parameter_type_def:get_field("_MightSeedTimer"); - -local adamant_seed_timer_field = player_user_data_item_parameter_type_def:get_field("_AdamantSeedTimer"); -local demondrug_powder_timer_field = player_user_data_item_parameter_type_def:get_field("_DemondrugPowderTimer"); -local armorskin_powder_timer_field = player_user_data_item_parameter_type_def:get_field("_ArmorSkinPowderTimer"); -local vitalizer_timer_const_field = player_user_data_item_parameter_type_def:get_field("_VitalizerTimer"); -local stamina_up_buff_second_field = player_user_data_item_parameter_type_def:get_field("_StaminaUpBuffSecond"); - local player_data_type_def = sdk.find_type_definition("snow.player.PlayerData"); -- Demondrug/Mega Demondrug local atk_up_alive_field = player_data_type_def:get_field("_AtkUpAlive"); @@ -106,8 +97,6 @@ local atk_up_item_second_timer_field = player_data_type_def:get_field("_AtkUpIte -- Hardshell Powder local def_up_item_second_field = player_data_type_def:get_field("_DefUpItemSecond"); local def_up_item_second_timer_field = player_data_type_def:get_field("_DefUpItemSecondTimer"); --- Immunizer -local vitalizer_timer_field = player_data_type_def:get_field("_VitalizerTimer"); -- Gourmet Fish local fish_regene_enable_field = player_data_type_def:get_field("_FishRegeneEnableTimer"); -- Demon Ammo @@ -119,6 +108,11 @@ local data_shortcut_type_def = sdk.find_type_definition("snow.data.DataShortcut" local get_name_method = data_shortcut_type_def:get_method("getName(snow.data.ContentsIdSystem.ItemId)"); function this.update(player_data) + if singletons.player_manager == nil then + error_handler.report("item_buffs.update", "Failed to access Data: player_manager"); + return; + end + local item_parameter = get_ref_item_parameter_method:call(singletons.player_manager); if item_parameter == nil then error_handler.report("item_buffs.update", "Failed to access Data: item_parameter"); @@ -130,22 +124,19 @@ function this.update(player_data) this.update_demondrug(player_data, item_parameter); this.update_armorskin(player_data, item_parameter); - buffs.update_generic_buff(this.list, item_buffs_type_name, "demon_powder", this.get_item_name, - player_data, atk_up_item_second_field, player_data, atk_up_item_second_timer_field, item_parameter, demondrug_powder_timer_field); + buffs.update_generic_buff(this.list, item_buffs_type_name, "demon_powder", this.get_item_buff_name, + player_data, atk_up_item_second_field, player_data, atk_up_item_second_timer_field); - buffs.update_generic_buff(this.list, item_buffs_type_name, "hardshell_powder", this.get_item_name, - player_data, def_up_item_second_field, player_data, def_up_item_second_timer_field, item_parameter, armorskin_powder_timer_field); - - buffs.update_generic_buff(this.list, item_buffs_type_name, "immunizer", this.get_item_name, - nil, nil, player_data, vitalizer_timer_field, item_parameter, vitalizer_timer_const_field); + buffs.update_generic_buff(this.list, item_buffs_type_name, "hardshell_powder", this.get_item_buff_name, + player_data, def_up_item_second_field, player_data, def_up_item_second_timer_field); - buffs.update_generic_buff(this.list, item_buffs_type_name, "gourmet_fish", this.get_item_name, + buffs.update_generic_buff(this.list, item_buffs_type_name, "gourmet_fish", this.get_item_buff_name, nil, nil, player_data, fish_regene_enable_field); - buffs.update_generic_buff(this.list, item_buffs_type_name, "demon_ammo", this.get_item_name, + buffs.update_generic_buff(this.list, item_buffs_type_name, "demon_ammo", this.get_item_buff_name, nil, nil, player_data, kijin_bullet_timer_field); - buffs.update_generic_buff(this.list, item_buffs_type_name, "armor_ammo", this.get_item_name, + buffs.update_generic_buff(this.list, item_buffs_type_name, "armor_ammo", this.get_item_buff_name, nil, nil, player_data, kouka_bullet_timer_field); end @@ -184,7 +175,7 @@ function this.update_demondrug(player_data, item_parameter) this.list.demondrug = nil; end - buffs.update_generic(this.list, item_buffs_type_name, item_key, this.get_item_name); + buffs.update_generic(this.list, item_buffs_type_name, item_key, this.get_item_buff_name); end function this.update_armorskin(player_data, item_parameter) @@ -222,17 +213,17 @@ function this.update_armorskin(player_data, item_parameter) this.list.armorskin = nil; end - buffs.update_generic(this.list, item_buffs_type_name, item_key, this.get_item_name); + buffs.update_generic(this.list, item_buffs_type_name, item_key, this.get_item_buff_name); end -function this.get_item_name(item_key) - local item_name = get_name_method:call(nil, item_ids[item_key]); - if item_name == nil then - error_handler.report("item_buffs.get_item_name", string.format("Failed to access Data: %s_name", item_key)); +function this.get_item_buff_name(item_key) + local item_buff_name = get_name_method:call(nil, item_ids[item_key]); + if item_buff_name == nil then + error_handler.report("item_buffs.get_item_buff_name", string.format("Failed to access Data: %s_name", item_key)); return item_key; end - return item_name; + return item_buff_name; end function this.init_dependencies() diff --git a/reframework/autorun/MHR_Overlay/Buffs/otomo_moves.lua b/reframework/autorun/MHR_Overlay/Buffs/otomo_moves.lua index 6247213..88ed897 100644 --- a/reframework/autorun/MHR_Overlay/Buffs/otomo_moves.lua +++ b/reframework/autorun/MHR_Overlay/Buffs/otomo_moves.lua @@ -52,43 +52,40 @@ this.list = { }; local otomo_moves_ids = { - herbaceous_healing = 1, - felyne_silkbind = 2, - felyne_wyvernblast = 3, + -- herbaceous_healing = 1, + -- felyne_silkbind = 2, + -- felyne_wyvernblast = 3, rousing_roar = 4, - endemic_life_barrage = 5, - health_horn = 6, - healing_bubble = 7, - vase_of_vitality = 8, - furbidden_acorn = 9, - poison_purr_ison = 10, - summeown_endemic_life = 11, - shock_purr_ison = 12, - go_fight_win = 13, - giga_barrel_bombay = 14, - flash_bombay = 15, - anti_monster_mine = 16, - zap_blast_spinner = 17, - furr_ious = 18, + -- endemic_life_barrage = 5, + -- health_horn = 6, + -- healing_bubble = 7, + -- vase_of_vitality = 8, + -- furbidden_acorn = 9, + -- poison_purr_ison = 10, + -- summeown_endemic_life = 11, + -- shock_purr_ison = 12, + -- go_fight_win = 13, + -- giga_barrel_bombay = 14, + -- flash_bombay = 15, + -- anti_monster_mine = 16, + -- zap_blast_spinner = 17, + -- furr_ious = 18, power_drum = 19, - fleet_foot_feat = 20, - whirlwind_assault = 21, - pilfer = 22, - shock_tripper = 23, - mega_boomerang = 24, - camouflage = 25, - healing_clover_bat = 26, - felyne_firewors = 27, - lottery_box = 28, - felyne_powered_up = 29, - ameowzing_mist = 30 + -- fleet_foot_feat = 20, + -- whirlwind_assault = 21, + -- pilfer = 22, + -- shock_tripper = 23, + -- mega_boomerang = 24, + -- camouflage = 25, + -- healing_clover_bat = 26, + -- felyne_firewors = 27, + -- lottery_box = 28, + -- felyne_powered_up = 29, + -- ameowzing_mist = 30 }; local otomo_moves_type_name = "otomo_moves"; -local player_manager_type_def = sdk.find_type_definition("snow.player.PlayerManager"); -local get_player_data_method = player_manager_type_def:get_method("get_PlayerData"); - local player_data_type_def = sdk.find_type_definition("snow.player.PlayerData"); -- Palico: Rousing Roar local beast_roar_otomo_timer_field = player_data_type_def:get_field("_BeastRoarOtomoTimer"); diff --git a/reframework/autorun/MHR_Overlay/Buffs/rampage_skills.lua b/reframework/autorun/MHR_Overlay/Buffs/rampage_skills.lua index 99947a4..422daa7 100644 --- a/reframework/autorun/MHR_Overlay/Buffs/rampage_skills.lua +++ b/reframework/autorun/MHR_Overlay/Buffs/rampage_skills.lua @@ -46,42 +46,8 @@ local ValueType = ValueType; local package = package; this.list = { - burst = nil, kushala_daora_soul = nil, - intrepid_heart = nil, - dereliction = nil, - latent_power = nil, - protective_polish = nil, - wind_mantle = nil, - grinder_s = nil, - counterstrike = nil, - affinity_sliding = nil, - coalescence = nil, - adrenaline_rush = nil, - wall_runner = nil, - offensive_guard = nil, - hellfire_cloak = nil, - agitator = nil, - furious = nil, - status_trigger = nil, - heaven_sent = nil, - heroics = nil, - resuscitate = nil, - maximum_might = nil, - bloodlust = nil, - frenzied_bloodlust = nil, - peak_performance = nil, - dragonheart = nil, - resentment = nil, - bladescale_hone = nil, - spiribirds_call = nil, - embolden = nil, - berserk = nil, - powder_mantle_red = nil, - powder_mantle_blue = nil, - strife = nil, - inspiration = nil, - blood_awakening = nil + chameleos_soul = nil }; local rampage_skills_type_name = "rampage_skills"; @@ -93,12 +59,6 @@ local rampage_skill_ids = { local kushara_daora_soul_breakpoint = 5; -local player_manager_type_def = sdk.find_type_definition("snow.player.PlayerManager"); -local get_player_data_method = player_manager_type_def:get_method("get_PlayerData"); -local get_ref_item_parameter_method = player_manager_type_def:get_method("get_RefItemParameter"); - -local player_user_data_item_parameter_type_def = get_ref_item_parameter_method:get_return_type(); - local player_data_type_def = sdk.find_type_definition("snow.player.PlayerData"); -- Kushala Daora Soul local hyakuryu_dragon_power_up_count_field = player_data_type_def:get_field("_HyakuryuDragonPowerUpCnt"); @@ -110,14 +70,9 @@ local data_shortcut_type_def = sdk.find_type_definition("snow.data.DataShortcut" local get_name_method = data_shortcut_type_def:get_method("getName(snow.data.DataDef.PlHyakuryuSkillId)"); function this.update(player_data) - --local item_parameter = get_ref_item_parameter_method:call(singletons.player_manager); - --if item_parameter == nil then - -- error_handler.report("skills.update", "Failed to access Data: item_parameter"); - -- return; - --end buffs.update_generic_buff(this.list, rampage_skills_type_name, "kushala_daora_soul", this.get_skill_name, - player_data, hyakuryu_dragon_power_up_count_field, player_data, hyakuryu_dragon_power_up_timer_field, nil, nil, false, nil, {kushara_daora_soul_breakpoint}); + player_data, hyakuryu_dragon_power_up_count_field, player_data, hyakuryu_dragon_power_up_timer_field, false, nil, {kushara_daora_soul_breakpoint}); buffs.update_generic_buff(this.list, rampage_skills_type_name, "chameleos_soul", this.get_skill_name, nil, nil, player_data, hyakuryu_onazuti_power_up_interval_field); @@ -132,7 +87,7 @@ end function this.get_skill_name(rampage_skill_key) local rampage_skill_name = get_name_method:call(nil, rampage_skill_ids[rampage_skill_key]); if rampage_skill_name == nil then - error_handler.report("skills.get_skill_name", string.format("Failed to access Data: %s_name", rampage_skill_key)); + error_handler.report("rampage_skills.get_skill_name", string.format("Failed to access Data: %s_name", rampage_skill_key)); return rampage_skill_key; end diff --git a/reframework/autorun/MHR_Overlay/Buffs/skills.lua b/reframework/autorun/MHR_Overlay/Buffs/skills.lua index 4837d15..6a5954f 100644 --- a/reframework/autorun/MHR_Overlay/Buffs/skills.lua +++ b/reframework/autorun/MHR_Overlay/Buffs/skills.lua @@ -177,7 +177,7 @@ local skill_data_list = { -- item_prolonger = { id = 88 }, -- wide_range = { id = 89 }, -- free_meal = { id = 90 }, - heroics = { id = 91, level = 0, is_equipped = false }, + heroics = { id = 91, level = 0, is_equipped = false }, -- fortify = { id = 92 }, -- flinch_free = { id = 93 }, -- jump_master = { id = 94 }, @@ -322,7 +322,6 @@ local equip_skill_232_timer_field = player_data_type_def:get_field("_EquipSkill2 local player_base_type_def = sdk.find_type_definition("snow.player.PlayerBase"); local player_weapon_type_field = player_base_type_def:get_field("_playerWeaponType"); -local get_player_skill_list_method = player_base_type_def:get_method("get_PlayerSkillList"); -- Latent Power local power_freedom_timer_field = player_base_type_def:get_field("_PowerFreedomTimer"); @@ -337,7 +336,7 @@ local equip_skill_229_sum_resist_field = player_base_type_def:get_field("_EquipS -- Resuscitate local is_debuff_state_method = player_base_type_def:get_method("isDebuffState"); -local player_skill_list_type_def = get_player_skill_list_method:get_return_type(); +local player_skill_list_type_def = sdk.find_type_definition("snow.player.PlayerSkillList"); local get_skill_data_method = player_skill_list_type_def:get_method("getSkillData"); local skill_data_type_def = get_skill_data_method:get_return_type(); @@ -374,14 +373,8 @@ local _equip_skill_216_bottle_up_timer_field = bow_type_def:get_field("_EquipSki local data_shortcut_type_def = sdk.find_type_definition("snow.data.DataShortcut"); local get_name_method = data_shortcut_type_def:get_method("getName(snow.data.DataDef.PlEquipSkillId)"); -function this.update(player, player_data, weapon_type) - --local item_parameter = get_ref_item_parameter_method:call(singletons.player_manager); - --if item_parameter == nil then - -- error_handler.report("skills.update", "Failed to access Data: item_parameter"); - -- return; - --end - - this.update_equipped_skill_data(player); +function this.update(player, player_data, weapon_type, player_skill_list) + this.update_equipped_skill_data(player, player_skill_list); this.update_wind_mantle(player, weapon_type); this.update_maximum_might(player_data); @@ -397,13 +390,13 @@ function this.update(player, player_data, weapon_type) this.update_generic_skill("dereliction", player_data, symbiosis_skill_lost_vital_field, - nil, nil, nil, nil, true, nil, dereliction_breakpoints); + nil, nil, true, nil, dereliction_breakpoints); this.update_generic_skill("burst", player_data, rengeki_power_up_count_field, - player_data, rengeki_power_up_timer_field, nil, nil, false, nil, burst_breakpoints); + player_data, rengeki_power_up_timer_field, false, nil, burst_breakpoints); this.update_generic_skill("intrepid_heart", player_data, equip_skill_223_accumulator_field, - nil, nil, nil, nil, true, intrepid_heart_minimal_value); + nil, nil, true, intrepid_heart_minimal_value); this.update_generic_skill("latent_power", nil, nil, player, power_freedom_timer_field); this.update_generic_skill("protective_polish", nil, nil, player, sharpness_gauge_boost_timer_field); @@ -427,33 +420,24 @@ function this.update(player, player_data, weapon_type) this.update_generic_skill("berserk", player, get_is_enable_equip_skill_225_method); this.update_generic_skill("dragon_conversion_elemental_attack_up", player, equip_skill_229_sum_resist_field); this.update_generic_skill("dragon_conversion_elemental_res_up", player, equip_skill_229_use_up_flag_field); - this.update_generic_skill("partbreaker", nil, nil, nil, nil, nil, nil, true); + this.update_generic_skill("partbreaker", nil, nil, nil, nil, true); this.update_generic_skill("strife", player, get_affinity_equip_skill_233_method, - nil, nil, nil, nil, nil, nil, strife_breakpoints[skill_data_list.strife.level]); + nil, nil, nil, nil, strife_breakpoints[skill_data_list.strife.level]); end -function this.update_generic_skill(skill_key, value_owner, value_holder, timer_owner, timer_holder, duration_owner, duration_holder, - is_infinite, minimal_value, level_breakpoints) - +function this.update_generic_skill(skill_key, value_owner, value_holder, timer_owner, timer_holder, is_infinite, minimal_value, level_breakpoints) local skill_data = skill_data_list[skill_key]; if skill_data ~= nil and skill_data.is_equipped ~= nil and not skill_data.is_equipped then this.list[skill_key] = nil; - return; + return nil; end - buffs.update_generic_buff(this.list, skills_type_name, skill_key, this.get_skill_name, - value_owner, value_holder, timer_owner, timer_holder, duration_owner, duration_holder, - is_infinite, minimal_value, level_breakpoints); + return buffs.update_generic_buff(this.list, skills_type_name, skill_key, this.get_skill_name, + value_owner, value_holder, timer_owner, timer_holder, is_infinite, minimal_value, level_breakpoints); end -function this.update_equipped_skill_data(player) - local player_skill_list = get_player_skill_list_method:call(player); - if player_skill_list == nil then - error_handler.report("skills.update_equipped_skill_data", "Failed to access Data: player_skill_list"); - return; - end - +function this.update_equipped_skill_data(player, player_skill_list) for skill_key, skill_data in pairs(skill_data_list) do if skill_data.is_equipped == nil then goto continue; @@ -472,7 +456,6 @@ function this.update_equipped_skill_data(player) goto continue; end - if skill_level <= 0 then skill_data.is_equipped = false; skill_data.level = 0; @@ -522,7 +505,7 @@ function this.update_wind_mantle(player, weapon_type) end end - buffs.update_generic(this.list, skills_type_name, "wind_mantle", this.get_skill_name, level, wind_mantle_duration - (wind_mantle_timer / 60), wind_mantle_duration); + buffs.update_generic(this.list, skills_type_name, "wind_mantle", this.get_skill_name, level, wind_mantle_duration - (wind_mantle_timer / 60)); end function this.update_maximum_might(player_data) @@ -731,12 +714,12 @@ function this.update_spiribirds_call(player_data) local timer = spiribirds_call_duration - (equip_skill_211_timer / 60); - buffs.update_generic(this.list, skills_type_name, "spiribirds_call", this.get_skill_name, 1, timer, spiribirds_call_duration); + buffs.update_generic(this.list, skills_type_name, "spiribirds_call", this.get_skill_name, 1, timer); end function this.update_powder_mantle(player_data) this.update_generic_skill("powder_mantle_blue", player_data, equip_skill_227_state_field, - player_data, equip_skill_227_state_timer_field, nil, nil, nil, 2); + player_data, equip_skill_227_state_timer_field, nil, 2); if this.list.powder_mantle_blue ~= nil then this.list.powder_mantle_red = nil; @@ -744,13 +727,12 @@ function this.update_powder_mantle(player_data) end this.update_generic_skill("powder_mantle_red", player_data, equip_skill_227_state_field, - player_data, equip_skill_227_state_timer_field, nil, nil, nil); + player_data, equip_skill_227_state_timer_field); end function this.update_blood_awakening(player, player_data) this.update_generic_skill("blood_awakening", player, get_equip_skill_232_lv_method, player_data, equip_skill_232_timer_field, - nil, nil, nil, nil, blood_awakening_breakpoints); local blood_awakening = this.list.blood_awakening; diff --git a/reframework/autorun/MHR_Overlay/Buffs/weapon_skills.lua b/reframework/autorun/MHR_Overlay/Buffs/weapon_skills.lua index 389087c..7aad410 100644 --- a/reframework/autorun/MHR_Overlay/Buffs/weapon_skills.lua +++ b/reframework/autorun/MHR_Overlay/Buffs/weapon_skills.lua @@ -471,7 +471,7 @@ end function this.update_great_sword_skills(player) buffs.update_generic_buff(this.list, weapon_skills_type_name, "power_sheathe", this.get_weapon_skill_name, - nil, nil, player, move_wp_off_buff_set_time_field, player, move_wp_off_buff_set_time_field); + nil, nil, player, move_wp_off_buff_set_time_field); end function this.update_switch_axe_skills(player) @@ -482,10 +482,10 @@ function this.update_switch_axe_skills(player) end buffs.update_generic_buff(this.list, weapon_skills_type_name, "amped_state", this.get_weapon_skill_name, - nil, nil, player, get_bottle_awake_duration_timer_method, player, bottle_awake_duration_time_field); + nil, nil, player, get_bottle_awake_duration_timer_method); buffs.update_generic_buff(this.list, weapon_skills_type_name, "switch_charger", this.get_weapon_skill_name, - nil, nil, player, no_use_slash_gauge_timer_field, player_user_data_slash_axe, get_no_user_slash_gauge_time_method); + nil, nil, player, no_use_slash_gauge_timer_field); buffs.update_generic_buff(this.list, weapon_skills_type_name, "axe_heavy_slam", this.get_weapon_skill_name, nil, nil, player, bottle_awake_assist_timer_field); @@ -495,49 +495,12 @@ function this.update_long_sword_skills(player) buffs.update_generic_buff(this.list, weapon_skills_type_name, "spirit_gauge_autofill", this.get_weapon_skill_name, nil, nil, player, get_long_sword_gauge_powerup_time_method); - this.update_spirit_gauge(player); + buffs.update_generic_buff(this.list, weapon_skills_type_name, "spirit_gauge", this.get_weapon_skill_name, + player, get_long_sword_gauge_lv_method, player, get_long_sword_gauge_lv_timer_method, false, nil, spirit_gauge_breakpoints); + this.update_harvest_moon(); end -function this.update_spirit_gauge(player) - local weapon_skill = buffs.update_generic_buff(this.list, weapon_skills_type_name, "spirit_gauge", this.get_weapon_skill_name, - player, get_long_sword_gauge_lv_method, player, get_long_sword_gauge_lv_timer_method, nil, nil, false, nil, spirit_gauge_breakpoints); - - if weapon_skill == nil then - return; - end - - local long_sword_gauge_lv_time_array = long_sword_gauge_lv_time_field:get_data(player); - if long_sword_gauge_lv_time_array == nil then - error_handler.report("weapon_skills.update_spirit_gauge", "Failed to access Data: long_sword_gauge_lv_time_array"); - return; - end - - local long_sword_gauge_lv_time_array_length = get_length_method:call(long_sword_gauge_lv_time_array); - if long_sword_gauge_lv_time_array_length == nil then - error_handler.report("weapon_skills.update_spirit_gauge", "Failed to access Data: long_sword_gauge_lv_time_array_length"); - return; - end - - if weapon_skill.level >= long_sword_gauge_lv_time_array_length then - return; - end - - local long_sword_gauge_lv_time_single_valtype = get_value_method:call(long_sword_gauge_lv_time_array, weapon_skill.level); - if long_sword_gauge_lv_time_single_valtype == nil then - error_handler.report("weapon_skills.update_spirit_gauge", "Failed to access Data: long_sword_gauge_lv_time_single_valtype"); - return; - end - - local long_sword_gauge_lv_time = single_mvalue_field:get_data(long_sword_gauge_lv_time_single_valtype); - if long_sword_gauge_lv_time == nil then - error_handler.report("weapon_skills.update_spirit_gauge", "Failed to access Data: long_sword_gauge_lv_time"); - return; - end - - weapon_skill.duration = long_sword_gauge_lv_time / 60; -end - function this.update_harvest_moon() if singletons.long_sword_shell_manager == nil then error_handler.report("weapon_skills.update_harvest_moon", "Failed to access Data: long_sword_shell_manager"); @@ -606,7 +569,7 @@ end function this.update_heavy_bowgun_skills(player, player_data) buffs.update_generic_buff(this.list, weapon_skills_type_name, "counter_charger", this.get_weapon_skill_name, - nil, nil, player, reduce_charge_timer_field, player, reduce_charge_timer_base_field); + nil, nil, player, reduce_charge_timer_field); buffs.update_generic_buff(this.list, weapon_skills_type_name, "wyvernsnipe_reload", this.get_weapon_skill_name, nil, nil, player_data, heavy_bowgun_wyvern_snipe_timer_field); @@ -747,97 +710,26 @@ function this.update_overheat(player_data) end function this.update_hammer_skills(player) - local player_user_data_hammer = player_user_data_hammer_field:get_data(player); - if player_user_data_hammer == nil then - error_handler.report("weapon_skills.update_hammer_skills", "Failed to access Data: player_user_data_hammer"); - return; - end - buffs.update_generic_buff(this.list, weapon_skills_type_name, "impact_burst", this.get_weapon_skill_name, - nil, nil, player, horn_impact_pulls_timer_field, player_user_data_hammer, hammer_impact_pulls_time_max_field); + nil, nil, player, horn_impact_pulls_timer_field); end function this.update_gunlance_skills(player) - local player_user_data_gunlance = get_player_user_data_gunlance_method:call(player); - if player_user_data_gunlance == nil then - error_handler.report("weapon_skills.update_gunlance_skills", "Failed to access Data: player_user_data_gunlance"); - return; - end - buffs.update_generic_buff(this.list, weapon_skills_type_name, "ground_splitter", this.get_weapon_skill_name, - nil, nil, player, shot_damage_up_duration_timer_field, player_user_data_gunlance, get_player_user_data_gunlance_method); - - this.update_erupting_cannon(player, player_user_data_gunlance); -end - -function this.update_erupting_cannon(player, player_user_data_gunlance) - local shot_type = get_shot_type_method:call(player); - if shot_type == nil then - error_handler.report("weapon_skills.update_erupting_cannon", "Failed to access Data: shot_type"); - return; - end - - local explode_pile_data = heavy_bowgun_shot_type_data_fields[shot_type + 1]:get_data(player_user_data_gunlance); - if explode_pile_data == nil then - error_handler.report("weapon_skills.update_erupting_cannon", "Failed to access Data: explode_pile_data"); - return; - end + nil, nil, player, shot_damage_up_duration_timer_field); buffs.update_generic_buff(this.list, weapon_skills_type_name, "erupting_cannon", this.get_weapon_skill_name, - nil, nil, player, explode_pile_buff_timer_field, explode_pile_data, explode_pile_data_duration_field); + nil, nil, player, explode_pile_buff_timer_field); end function this.update_lance_skills(player) buffs.update_generic_buff(this.list, weapon_skills_type_name, "spiral_thrust", this.get_weapon_skill_name, nil, nil, player, get_ruten_timer_method); - this.update_anchor_rage(player); - this.update_twin_wine(player); -end - -function this.update_anchor_rage(player) - local guard_rage_buff_type = guard_rage_buff_type_field:get_data(player); - if guard_rage_buff_type == nil then - error_handler.report("weapon_skills.update_anchor_rage", "Failed to access Data: guard_rage_buff_type"); - return; - end - - if guard_rage_buff_type == 0 then - this.anchor_rage = nil; - return; - end - - local player_user_data_lance = player_user_data_lance_field:get_data(player); - if player_user_data_lance == nil then - error_handler.report("weapon_skills.update_anchor_rage", "Failed to access Data: player_user_data_lance"); - return; - end - - local guard_rage_timer_array = guard_rage_timer_field:get_data(player_user_data_lance); - if guard_rage_timer_array == nil then - error_handler.report("weapon_skills.update_anchor_rage", "Failed to access Data: guard_rage_timer_array"); - return; - end - - local guard_rage_timer_array_length = get_length_method:call(guard_rage_timer_array); - if guard_rage_timer_array_length == nil then - error_handler.report("weapon_skills.update_anchor_rage", "Failed to access Data: guard_rage_timer_array_length"); - return; - end - - if guard_rage_buff_type >= guard_rage_timer_array_length then - this.anchor_rage = nil; - return; - end - - local guard_rage_duration_valtype = get_value_method:call(guard_rage_timer_array, guard_rage_buff_type); - if guard_rage_duration_valtype == nil then - error_handler.report("weapon_skills.update_anchor_rage", "Failed to access Data: guard_rage_duration_valtype"); - return; - end - buffs.update_generic_buff(this.list, weapon_skills_type_name, "anchor_rage", this.get_weapon_skill_name, - nil, nil, player, get_guard_rage_timer_method, guard_rage_duration_valtype, single_mvalue_field); + nil, nil, player, get_guard_rage_timer_method); + + this.update_twin_wine(player); end function this.update_twin_wine(player) @@ -852,29 +744,15 @@ function this.update_twin_wine(player) end function this.update_sword_and_shield_skills(player) - local player_user_data_short_sword = player_user_data_short_sword_field:get_data(player); - if player_user_data_short_sword == nil then - error_handler.report("weapon_skills.update_sword_and_shield_skills", "Failed to access Data: player_user_data_short_sword"); - return; - end - buffs.update_generic_buff(this.list, weapon_skills_type_name, "destroyer_oil", this.get_weapon_skill_name, - nil, nil, player, get_oil_buff_timer_method, player_user_data_short_sword, oil_buff_time_field); + nil, nil, player, get_oil_buff_timer_method); end function this.update_dual_blades_skills(player) this.update_archdemon_mode(player) - local player_user_data_dual_blades = player_user_data_dual_blades_field:get_data(player); - if player_user_data_dual_blades == nil then - error_handler.report("weapon_skills.update_dual_blades_skills", "Failed to access Data: player_user_data_dual_blades"); - return; - end - buffs.update_generic_buff(this.list, weapon_skills_type_name, "ironshine_silk", this.get_weapon_skill_name, - nil, nil, player, - get_sharpness_recovery_buff_valid_timer_method, - player_user_data_dual_blades, sharpness_recovery_buff_valid_max_timer_field); + nil, nil, player, get_sharpness_recovery_buff_valid_timer_method); end function this.update_archdemon_mode(player) @@ -907,14 +785,8 @@ function this.update_hunting_horn_skills(player) this.update_bead_of_resonance(); this.update_sonic_bloom(player); - local player_user_data_horn = player_user_data_horn_field:get_data(player); - if player_user_data_horn == nil then - error_handler.report("weapon_skills.update_hunting_horn_skills", "Failed to access Data: player_user_data_horn"); - return; - end - buffs.update_generic_buff(this.list, weapon_skills_type_name, "silkbind_shockwave", this.get_weapon_skill_name, - nil, nil, player, horn_impact_pulls_timer_field, player_user_data_horn, horn_impact_pulls_duration_field); + nil, nil, player, horn_impact_pulls_timer_field); end function this.update_bead_of_resonance() @@ -999,75 +871,13 @@ function this.update_sonic_bloom(player) end function this.update_charge_blade_skills(player) - local player_user_data_charge_axe = get_ref_player_user_data_charge_axe_method:call(player); - if player_user_data_charge_axe == nil then - error_handler.report("weapon_skills.update_sonic_bloom", "Failed to access Data: life_timer"); - return; - end + buffs.update_generic_buff(this.list, weapon_skills_type_name, "element_boost", this.get_weapon_skill_name, nil, nil, + player, shield_buff_timer_field); - this.update_element_boost(player, player_user_data_charge_axe); - this.update_sword_boost_mode(player, player_user_data_charge_axe); + buffs.update_generic_buff(this.list, weapon_skills_type_name, "sword_boost_mode", this.get_weapon_skill_name, nil, nil, + player, sword_buff_timer_field); end -function this.update_element_boost(player, player_user_data_charge_axe) - local shield_buff_timer = shield_buff_timer_field:get_data(player); - if shield_buff_timer == nil then - error_handler.report("weapon_skills.update_element_boost", "Failed to access Data: shield_buff_timer"); - return; - end - - if utils.number.is_equal(shield_buff_timer, 0) then - this.list.element_boost = nil; - return; - end - - shield_buff_timer = shield_buff_timer / 60; - - local duration = nil; - if this.list.element_boost == nil then - local shield_buff_time_per_bottle = get_shield_buff_time_per_bottle_method:call(player_user_data_charge_axe); - if shield_buff_time_per_bottle == nil then - error_handler.report("weapon_skills.update_element_boost", "Failed to access Data: shield_buff_time_duration"); - return; - end - - local bottle_num = get_charged_bottle_num_method:call(player); - if bottle_num == nil then - error_handler.report("weapon_skills.update_element_boost", "Failed to access Data: bottle_num"); - return; - end - - if bottle_num ~= 0 then - duration = (bottle_num * shield_buff_time_per_bottle) / 60; - else - duration = shield_buff_timer; - end - end - - buffs.update_generic(this.list, weapon_skills_type_name, "element_boost", this.get_weapon_skill_name, 1, shield_buff_timer, duration); -end - -function this.update_sword_boost_mode(player, player_user_data_charge_axe) - local sword_buff_timer = sword_buff_timer_field:get_data(player); - if sword_buff_timer == nil then - error_handler.report("weapon_skills.update_sword_boost_mode", "Failed to access Data: sword_buff_timer"); - return; - end - - if utils.number.is_equal(sword_buff_timer, 0) then - this.list.sword_boost_mode = nil; - return; - end - - local sword_buff_time_duration = get_sword_buff_time_method:call(player_user_data_charge_axe); - if sword_buff_time_duration == nil then - error_handler.report("weapon_skills.update_sword_boost_mode", "Failed to access Data: sword_buff_time_duration"); - return; - end - - buffs.update_generic(this.list, weapon_skills_type_name, "sword_boost_mode", this.get_weapon_skill_name, 1, - sword_buff_timer / 60, sword_buff_time_duration / 60); -end function this.update_insect_glaive_skills(player) this.update_all_extracts_mix(player); @@ -1079,9 +889,9 @@ function this.update_insect_glaive_skills(player) return; end - this.update_extract(player, "red_extract", get_red_extractive_time_method, red_extractive_max_time_field); - this.update_extract(player, "white_extract", get_white_extractive_time_method, white_extractive_max_time_field); - this.update_extract(player, "orange_extract", get_orange_extractive_time_method, orange_extractive_max_time_field); + this.update_extract(player, "red_extract", get_red_extractive_time_method); + this.update_extract(player, "white_extract", get_white_extractive_time_method); + this.update_extract(player, "orange_extract", get_orange_extractive_time_method); end function this.update_all_extracts_mix(player) @@ -1107,17 +917,11 @@ function this.update_all_extracts_mix(player) return; end - local all_extractive_max_time = all_extractive_max_time_field:get_data(player); - if all_extractive_max_time == nil then - error_handler.report("weapon_skills.update_all_extract", "Failed to access Data: all_extractive_max_time"); - return; - end - buffs.update_generic(this.list, weapon_skills_type_name, "all_extracts_mix", this.get_weapon_skill_name, 1, - red_extractive_time, all_extractive_max_time); + red_extractive_time); end -function this.update_extract(player, extract_key, time_holder, max_time_holder) +function this.update_extract(player, extract_key, time_holder) local extractive_time = time_holder:call(player); if extractive_time == nil then error_handler.report("weapon_skills.update_extract", string.format("Failed to access Data: %s_extractive_time", extract_key)); @@ -1129,77 +933,21 @@ function this.update_extract(player, extract_key, time_holder, max_time_holder) return; end - local duration = nil; - - local extractive_max_time_array = max_time_holder:get_data(player); - if extractive_max_time_array == nil then - error_handler.report("weapon_skills.update_red_extract", string.format("Failed to access Data: %s_extractive_max_time_array", extract_key)); - return; - end - - local extractive_max_time_array_length = get_length_method:call(extractive_max_time_array); - if extractive_max_time_array_length == nil then - error_handler.report("weapon_skills.update_red_extract", string.format("Failed to access Data: %s_extractive_max_time_array_length", extract_key)); - return; - end - - if extractive_max_time_array_length ~= 0 then - local extractive_max_time_int32_valtype = get_value_method:call(extractive_max_time_array, 0); - if extractive_max_time_int32_valtype == nil then - error_handler.report("weapon_skills.update_red_extract", string.format("Failed to access Data: %s_extractive_max_time_int32_valtype", extract_key)); - return; - end - - local extractive_max_time = int32_mvalue_field:get_data(extractive_max_time_int32_valtype); - if extractive_max_time == nil then - error_handler.report("weapon_skills.update_red_extract", string.format("Failed to access Data: %s_extractive_max_time", extract_key)); - return; - end - - duration = extractive_max_time; - end - - buffs.update_generic(this.list, weapon_skills_type_name, extract_key, this.get_weapon_skill_name, 1, extractive_time, duration); + buffs.update_generic(this.list, weapon_skills_type_name, extract_key, this.get_weapon_skill_name, 1, extractive_time); end function this.update_bow_skills(player, player_data) - local player_user_data_bow = get_ref_player_user_data_bow_method:call(player); - if player_user_data_bow == nil then - error_handler.report("weapon_skills.update_extract", "Failed to access Data: player_user_data_bow"); - return; - end + buffs.update_generic_buff(this.list, weapon_skills_type_name, "herculean_draw", this.get_weapon_skill_name, + nil, nil, player, wire_buff_attack_up_timer_field); - this.update_bow_skill(player, "herculean_draw", wire_buff_attack_up_timer_field, player_user_data_bow, get_wire_buff_attack_up_time_method); - this.update_bow_skill(player, "bolt_boost", wire_buff_arrow_up_timer_field, player_user_data_bow, get_arrow_up_time_method); + buffs.update_generic_buff(this.list, weapon_skills_type_name, "bolt_boost", this.get_weapon_skill_name, + nil, nil, player, wire_buff_arrow_up_timer_field); buffs.update_generic_buff(this.list, weapon_skills_type_name, "arc_shot_affinity", this.get_weapon_skill_name, nil, nil, player_data, crit_chance_bow_timer_field); buffs.update_generic_buff(this.list, weapon_skills_type_name, "arc_shot_brace", this.get_weapon_skill_name, nil, nil, player_data, super_armor_item_timer_field); - - -end - -function this.update_bow_skill(player, bow_skill_key, timer_holder, player_user_data_bow, max_time_holder) - local timer = timer_holder:get_data(player); - if timer == nil then - error_handler.report("weapon_skills.update_bow_skill", string.format("Failed to access Data: %s_timer", bow_skill_key)); - return; - end - - if utils.number.is_equal(timer, 0) then - this.list[bow_skill_key] = nil; - return; - end - - local max_time = max_time_holder:call(player_user_data_bow); - if max_time == nil then - error_handler.report("weapon_skills.update_bow_skill", string.format("Failed to access Data: %s_max_time", bow_skill_key)); - return; - end - - buffs.update_generic(this.list, weapon_skills_type_name, bow_skill_key, this.get_weapon_skill_name, 1, timer / 60, max_time / 60); end function this.init_names()