Implement Buff Customization by Type

This commit is contained in:
GreenComfyTea
2023-09-30 11:03:25 +03:00
parent 17b89d3d7f
commit 423635400c
14 changed files with 1167 additions and 122 deletions

View File

@@ -372,9 +372,15 @@ function this.update_sleep(player)
this.update_abnormal_status("sleep", nil, nil, player, sleep_duration_timer_field);
end
function this.init_all_UI()
for abnormal_status_key, abnormal_status in pairs(this.list) do
buffs.init_UI(abnormal_status);
end
end
function this.init_names()
for abnormal_status_key, debuff in pairs(this.list) do
debuff.name = this.get_abnormal_status_name(abnormal_status_key);
for abnormal_status_key, abnormal_status in pairs(this.list) do
abnormal_status.name = this.get_abnormal_status_name(abnormal_status_key);
end
end

View File

@@ -111,15 +111,34 @@ function this.init_buffs()
this.list = {};
end
function this.init_all_UI()
abnormal_statuses.init_all_UI();
item_buffs.init_all_UI();
endemic_life_buffs.init_all_UI();
melody_effects.init_all_UI();
dango_skills.init_all_UI();
rampage_skills.init_all_UI();
skills.init_all_UI();
weapon_skills.init_all_UI();
otomo_moves.init_all_UI();
misc_buffs.init_all_UI();
end
function this.init_UI(buff)
local cached_config = config.current_config.buff_UI;
local cached_config = config.current_config.buff_UI[buff.type];
buff.buff_UI = buff_UI_entity.new(cached_config.bar, cached_config.name_label, cached_config.timer_label);
end
function this.init_names()
abnormal_statuses.init_names();
item_buffs.init_names();
endemic_life_buffs.init_names();
melody_effects.init_names();
dango_skills.init_names();
rampage_skills.init_names();
skills.init_names();
weapon_skills.init_names();
otomo_moves.init_names();
misc_buffs.init_names();
end

View File

@@ -344,6 +344,18 @@ function this.update_super_recovery_dango(player)
this.update_generic("super_recovery_dango");
end
function this.init_all_UI()
for dango_skill_key, dango_skill in pairs(this.list) do
buffs.init_UI(dango_skill);
end
end
function this.init_names()
for dango_skill_key, dango_skill in pairs(this.list) do
dango_skill.name = this.get_dango_skill_name(dango_skill_key);
end
end
function this.get_dango_skill_name(key)
local dango_skill_id = dango_skill_ids[key];
if dango_skill_id == nil then

View File

@@ -179,6 +179,18 @@ function this.update_butterflame(player_data)
this.update_endemic_life_buff("butterflame", nil, nil, player_data, atk_up_buff_second_timer_field);
end
function this.init_all_UI()
for endemic_life_key, endemic_life in pairs(this.list) do
buffs.init_UI(endemic_life);
end
end
function this.init_names()
for endemic_life_key, endemic_life in pairs(this.list) do
endemic_life.name = this.get_endemic_life_name(endemic_life_key);
end
end
function this.get_endemic_life_name(key)
if singletons.message_manager == nil then
error_handler.report("endemic_life_buffs.get_endemic_life_name", "Failed to access Data: message_manager");

View File

@@ -282,6 +282,18 @@ function this.update_might_seed(player_data, item_parameter)
this.update_item_buff("might_seed", nil, nil, player_data, atk_up_buff_second_timer_field);
end
function this.init_all_UI()
for item_buff_key, item_buff in pairs(this.list) do
buffs.init_UI(item_buff);
end
end
function this.init_names()
for item_buff_key, item_buff in pairs(this.list) do
item_buff.name = this.get_item_buff_name(item_buff_key);
end
end
function this.get_item_buff_name(key)
local item_buff_name = get_name_method:call(nil, item_ids[key]);
if item_buff_name == nil then

View File

@@ -215,6 +215,18 @@ function this.apply_filter(key, lua_index)
return true;
end
function this.init_all_UI()
for melody_effect_id, melody_effect in pairs(this.list) do
buffs.init_UI(melody_effect);
end
end
function this.init_names()
for melody_effect_id, melody_effect in pairs(this.list) do
melody_effect.name = this.get_melody_effect_name(melody_effect_id - 1);
end
end
function this.get_melody_effect_name(id)
local melody_effect_name = get_name_method:call(nil, id);
if melody_effect_name == nil then

View File

@@ -148,9 +148,15 @@ function this.update_attack_up(player_data, item_parameter)
this.update_misc_buff("attack_up", nil, nil, player_data, atk_up_buff_second_timer_field);
end
function this.init_all_UI()
for misc_buff_key, misc_buff in pairs(this.list) do
buffs.init_UI(misc_buff);
end
end
function this.init_names()
for misc_buff_key, dango in pairs(this.list) do
dango.name = this.get_misc_buff_name(misc_buff_key);
for misc_buff_key, misc_buff in pairs(this.list) do
misc_buff.name = this.get_misc_buff_name(misc_buff_key);
end
end

View File

@@ -119,6 +119,18 @@ function this.apply_filter(key)
return buffs.apply_filter(this.list, config.current_config.buff_UI.filter.otomo_moves, key);
end
function this.init_all_UI()
for otomo_move_key, otomo_move in pairs(this.list) do
buffs.init_UI(otomo_move);
end
end
function this.init_names()
for otomo_move_key, otomo_move in pairs(this.list) do
otomo_move.name = this.get_otomo_move_name(otomo_move_key);
end
end
function this.get_otomo_move_name(key)
local otomo_move_name = get_name_method:call(nil, otomo_moves_ids[key]);
if otomo_move_name == nil then

View File

@@ -91,9 +91,15 @@ function this.apply_filter(key)
return this.apply_filter(this.list, config.current_config.buff_UI.filter.rampage_skills, key);
end
function this.init_all_UI()
for rampage_skill_key, rampage_skill in pairs(this.list) do
buffs.init_UI(rampage_skill);
end
end
function this.init_names()
for rampage_skill_key, skill in pairs(this.list) do
skill.name = this.get_rampage_skill_name(rampage_skill_key);
for rampage_skill_key, rampage_skill in pairs(this.list) do
rampage_skill.name = this.get_rampage_skill_name(rampage_skill_key);
end
end

View File

@@ -837,6 +837,12 @@ function this.update_blood_awakening(player, player_data)
this.update_skill("blood_awakening", player, get_equip_skill_232_lv_method, player_data, equip_skill_232_timer_field, nil, nil, blood_awakening_breakpoints);
end
function this.init_all_UI()
for skill_key, skill in pairs(this.list) do
buffs.init_UI(skill);
end
end
function this.init_names()
for skill_key, skill in pairs(this.list) do
skill.name = this.get_skill_name(skill_key);

View File

@@ -1044,6 +1044,12 @@ function this.update_bow_skills(player, player_data)
this.update_weapon_skill("arc_shot_brace", bow_type_name, nil, nil, player_data, super_armor_item_timer_field);
end
function this.init_all_UI()
for weapon_skill_key, weapon_skill in pairs(this.list) do
buffs.init_UI(weapon_skill);
end
end
function this.init_names()
for weapon_skill_key, weapon_skill in pairs(this.list) do
weapon_skill.name = this.get_weapon_skill_name(weapon_skill_key);