Skills: Add more skills

+ Latent Power, Protective Polish, Wind Mantle, Heaven-Sent, Grinder (S), Counterstrike, Affinity Sliding, Coalescence, Adrenaline Rush, Wall Runner, Offensive Guard, Hellfire Cloak, Agitator, Furious.
This commit is contained in:
GreenComfyTea
2023-08-09 16:11:53 +03:00
parent 7f38532026
commit 3e66b920ef
8 changed files with 324 additions and 103 deletions

View File

@@ -47,8 +47,37 @@ this.list = {
kushala_daora_soul = nil,
intrepid_heart = nil,
dereliction = nil,
latent_power = 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
};
local burst_breakpoint = 5;
local kushara_daora_soul_breakpoint = 5;
local intrepid_heart_minimal_value = 400;
local dereliction_breakpoints = {100, 50};
local wind_mantle_duration = 15;
local wind_mantle_breakpoints = { 20, 10 }; -- Sword & Shield, Lance, Hammer, Switch Axe, Insect Glaive, Long Sword, Hunting Horn
local wind_mantle_special_breakpoints = {
[0] = { 10, 5 }, -- Great Sword
[3] = { 60, 30 }, -- Light Bowgun
[4] = { 60, 30 }, -- Heavy Bowgun
[6] = { 30, 15 }, -- Gunlance
[9] = { 40, 20 }, -- Dual Blades
[11] = { 30, 15 }, -- Charge Blade
[13] = { 60, 30 }, -- Bow
}
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");
@@ -67,115 +96,135 @@ local hyakuryu_dragon_power_up_timer_field = player_data_type_def:get_field("_Hy
local equip_skill_223_accumulator_field = player_data_type_def:get_field("_EquipSkill223Accumulator");
-- Derelection
local symbiosis_skill_lost_vital_field = player_data_type_def:get_field("_SymbiosisSkillLostVital");
-- Grinder (S)
local brand_new_sharpness_adjust_up_timer_field = player_data_type_def:get_field("_BrandNewSharpnessAdjustUpTimer");
-- Counterstrike
local counterattack_powerup_timer_field = player_data_type_def:get_field("_CounterattackPowerupTimer");
-- Affinity Sliding
local sliding_powerup_timer_field = player_data_type_def:get_field("_SlidingPowerupTimer");
-- Coalescence
local disaster_turn_powerup_timer_field = player_data_type_def:get_field("_DisasterTurnPowerUpTimer");
-- Adrenaline Rush
local equip_skill_208_atk_up_field = player_data_type_def:get_field("_EquipSkill208_AtkUpTimer");
-- Wall Runner
local wall_run_powerup_timer_field = player_data_type_def:get_field("_WallRunPowerupTimer");
-- Offensive Guard
local equip_skill_036_timer_field = player_data_type_def:get_field("_EquipSkill_036_Timer");
-- Hellfire Cloak
local onibi_powerup_timer_field = player_data_type_def:get_field("_OnibiPowerUpTiemr");
-- Agitator
local challenge_timer_field = player_data_type_def:get_field("_ChallengeTimer");
-- Furious
local furious_skill_stamina_buff_second_timer_field = player_data_type_def:get_field("_FuriousSkillStaminaBuffSecondTimer");
local player_base_type_def = sdk.find_type_definition("snow.player.PlayerBase");
local player_weapon_type_field = player_base_type_def:get_field("_playerWeaponType");
-- Latent Power
local power_freedom_timer_field = player_base_type_def:get_field("_PowerFreedomTimer");
-- Protective Polish
local sharpness_gauge_boost_timer_field = player_base_type_def:get_field("_SharpnessGaugeBoostTimer");
local player_quest_base_type_def = sdk.find_type_definition("snow.player.PlayerQuestBase");
-- Wind Mantle
local equip_skill_226_attack_count_field = player_quest_base_type_def:get_field("_EquipSkill226AttackCount");
local equip_skill_226_attack_off_timer_field = player_quest_base_type_def:get_field("_EquipSkill226AttackOffTimer");
-- Heaven-Sent
local is_active_equip_skill_230_method = player_quest_base_type_def:get_method("isActiveEquipSkill230");
local system_array_type_def = sdk.find_type_definition("System.Array");
local 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_data)
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("skills.update", "Failed to access Data: item_parameter");
return;
end
this.update_burst(player_data);
this.update_kushala_daora_soul(player_data);
this.update_intrepid_heart(player_data);
this.update_dereliction(player_data);
this.update_wind_mantle(player);
this.update_heaven_sent(player);
--xy = string.format("%s\n%s", player_data._Attack, player_data._SymbiosisSkillLostVital);
this.update_generic("burst", player_data, rengeki_power_up_count_field, rengeki_power_up_timer_field, nil, burst_breakpoint);
this.update_generic("kushala_daora_soul", player_data,
hyakuryu_dragon_power_up_count_field, hyakuryu_dragon_power_up_timer_field, nil, kushara_daora_soul_breakpoint);
this.update_generic("intrepid_heart", player_data, equip_skill_223_accumulator_field, nil, intrepid_heart_minimal_value, nil, true);
this.update_generic("latent_power", player, nil, power_freedom_timer_field);
this.update_generic("protective_polish", player, nil, sharpness_gauge_boost_timer_field);
this.update_generic("grinder_s", player_data, nil, brand_new_sharpness_adjust_up_timer_field);
this.update_generic("counterstrike", player_data, nil, counterattack_powerup_timer_field);
this.update_generic("affinity_sliding", player_data, nil, sliding_powerup_timer_field);
this.update_generic("coalescence", player_data, nil, disaster_turn_powerup_timer_field);
this.update_generic("adrenaline_rush", player_data, nil, equip_skill_208_atk_up_field);
this.update_generic("wall_runner", player_data, nil, wall_run_powerup_timer_field);
this.update_generic("offensive_guard", player_data, nil, equip_skill_036_timer_field);
this.update_generic("hellfire_cloak", player_data, nil, onibi_powerup_timer_field);
this.update_generic("agitator", player_data, nil, challenge_timer_field, nil, nil, true);
this.update_generic("furious", player_data, nil, furious_skill_stamina_buff_second_timer_field);
end
function this.update_burst(player_data)
local burst_value = rengeki_power_up_count_field:get_data(player_data);
if burst_value == nil then
error_handler.report("skills.update_burst", "Failed to access Data: burst_value");
return;
function this.update_generic(skill_key, timer_owner, value_field, timer_field, minimal_value, breakpoint, is_infinite)
minimal_value = minimal_value or 1;
breakpoint = breakpoint or 1000000;
if is_infinite == nil then is_infinite = false; end
local level = 1;
if value_field ~= nil then
local value = value_field:get_data(timer_owner);
if value == nil then
error_handler.report("skills.update_generic", string.format("Failed to access Data: %s_value", skill_key));
return;
end
if value < minimal_value then
this.list[skill_key] = nil;
return;
end
if value >= breakpoint then
level = 2;
end
end
if burst_value == 0 then
this.list.burst = nil;
return;
local timer;
if timer_field ~= nil then
timer = timer_field:get_data(timer_owner);
if timer == nil then
error_handler.report("skills.update_generic", string.format("Failed to access Data: %s_timer", skill_key));
return;
end
if value_field == nil and timer == 0 then
this.list[skill_key] = nil;
return;
end
timer = timer / 60;
end
local burst_timer = rengeki_power_up_timer_field:get_data(player_data);
if burst_timer == nil then
error_handler.report("skills.update_burst", "Failed to access Data: burst_timer");
return;
end
local skill = this.list[skill_key];
if skill == nil then
local name = language.current_language.skills[skill_key];
local skill_level = 1;
if burst_value >= 5 then
skill_level = 2;
end
if is_infinite then
timer = nil;
end
local buff = this.list.burst;
if buff == nil then
local name = language.current_language.skills.burst;
buff = buffs.new(buffs.types.skill, "burst", name, skill_level, burst_timer / 60);
this.list.burst = buff;
skill = buffs.new(buffs.types.skill, skill_key, name, level, timer);
this.list[skill_key] = skill;
else
buff.level = skill_level;
buffs.update_timer(buff, burst_timer / 60);
end
end
skill.level = level;
function this.update_kushala_daora_soul(player_data)
local kushala_daora_soul_value = hyakuryu_dragon_power_up_count_field:get_data(player_data);
if kushala_daora_soul_value == nil then
error_handler.report("skills.update_kushala_daora_soul", "Failed to access Data: kushala_daora_soul_value");
return;
end
if kushala_daora_soul_value == 0 then
this.list.kushala_daora_soul = nil;
this.list.kushala_daora_soul_2 = nil;
return;
end
local kushala_daora_soul_timer = hyakuryu_dragon_power_up_timer_field:get_data(player_data);
if kushala_daora_soul_timer == nil then
error_handler.report("skills.update_kushala_daora_soul", "Failed to access Data: kushala_daora_soul_timer");
return;
end
local skill_level = 1;
if kushala_daora_soul_value >= 5 then
skill_level = 2;
end
local buff = this.list.kushala_daora_soul;
if buff == nil then
local name = language.current_language.skills.kushala_daora_soul;
buff = buffs.new(buffs.types.skill, "kushala_daora_soul", name, skill_level, kushala_daora_soul_timer / 60);
this.list.kushala_daora_soul = buff;
else
buff.level = skill_level;
buffs.update_timer(buff, kushala_daora_soul_timer / 60);
end
end
function this.update_intrepid_heart(player_data)
local intrepid_heart_value = equip_skill_223_accumulator_field:get_data(player_data);
if intrepid_heart_value == nil then
error_handler.report("skills.update_intrepid_heart", "Failed to access Data: intrepid_heart_value");
return;
end
if intrepid_heart_value < 400 then
this.list.intrepid_heart = nil;
return;
end
local buff = this.list.intrepid_heart;
if buff == nil then
local name = language.current_language.skills.intrepid_heart;
buff = buffs.new(buffs.types.skill, "intrepid_heart", name, 1);
this.list.intrepid_heart = buff;
if not is_infinite then
buffs.update_timer(skill, timer);
end
end
end
@@ -191,21 +240,95 @@ function this.update_dereliction(player_data)
return;
end
local skill_level = 1;
if dereliction_value >= 100 then
skill_level = 3;
elseif dereliction_value >= 50 then
skill_level = 2;
local level = 1;
for index, breakpoint in ipairs(dereliction_breakpoints) do
if dereliction_value >= breakpoint then
level = 4 - index;
break;
end
end
local buff = this.list.dereliction;
if buff == nil then
local skill = this.list.dereliction;
if skill == nil then
local name = language.current_language.skills.dereliction;
buff = buffs.new(buffs.types.skill, "dereliction", name, skill_level);
this.list.dereliction = buff;
skill = buffs.new(buffs.types.skill, "dereliction", name, level);
this.list.dereliction = skill;
else
buff.level = skill_level;
skill.level = level;
end
end
function this.update_wind_mantle(player)
local wind_mantle_timer = equip_skill_226_attack_off_timer_field:get_data(player);
if wind_mantle_timer == nil then
error_handler.report("skills.update_wind_mantle", "Failed to access Data: wind_mantle_timer");
return;
end
if wind_mantle_timer == 0 then
this.list.wind_mantle = nil;
return;
end
local wind_mantle_value = equip_skill_226_attack_count_field:get_data(player);
if wind_mantle_value == nil then
error_handler.report("skills.update_wind_mantle", "Failed to access Data: wind_mantle_value");
return;
end
local weapon_type = player_weapon_type_field:get_data(player);
if player == nil then
error_handler.report("skills.update_wind_mantle", "Failed to access Data: weapon_type");
return;
end
local breakpoints = wind_mantle_breakpoints;
for weapon_type_index, special_breakpoints in pairs(wind_mantle_special_breakpoints) do
if weapon_type == weapon_type_index then
breakpoints = special_breakpoints;
break;
end
end
local level = 1;
for index, breakpoint in ipairs(breakpoints) do
if wind_mantle_value >= breakpoint then
level = 4 - index;
break;
end
end
local buff = this.list.wind_mantle;
if buff == nil then
local name = language.current_language.skills.wind_mantle;
buff = buffs.new(buffs.types.skill, "wind_mantle", name, level, wind_mantle_duration);
this.list.wind_mantle = buff;
else
buff.level = level;
buffs.update_timer(buff, wind_mantle_duration - (wind_mantle_timer / 60));
end
end
function this.update_heaven_sent(player)
local is_heaven_sent_active = is_active_equip_skill_230_method:call(player);
if is_heaven_sent_active == nil then
error_handler.report("skills.update_heaven_sent", "Failed to access Data: is_heaven_sent_active");
return;
end
if not is_heaven_sent_active then
this.list.heaven_sent = nil;
return;
end
local buff = this.list.heaven_sent;
if buff == nil then
local name = language.current_language.skills.heaven_sent;
buff = buffs.new(buffs.types.skill, "heaven_sent", name, 1);
this.list.heaven_sent = buff;
end
end

View File

@@ -239,7 +239,21 @@ this.default_language = {
burst = "Burst",
kushala_daora_soul = "Kushala Daora Soul",
intrepid_heart = "Intrepid Heart",
dereliction = "Dereliction"
dereliction = "Dereliction",
latent_power = "Latent Power",
protective_polish = "Protective Polish",
wind_mantle = "Wind Mantle",
heaven_sent = "Heaven-Sent",
grinder_s = "Grinder (S)",
counterstrike = "Counterstrike",
affinity_sliding = "Affinity Sliding",
coalescence = "Coalescence",
adrenaline_rush = "Adrenaline Rush",
wall_runner = "Wall Runner",
offensive_guard = "Offensive Guard",
hellfire_cloak = "Hellfire Cloak",
agitator = "Agitator",
furious = "Furious"
},
dangos = {

View File

@@ -444,10 +444,24 @@
"wings": "Wings"
},
"skills": {
"adrenaline_rush": "Adrenaline Rush",
"affinity_sliding": "Affinity Sliding",
"agitator": "Agitator",
"burst": "Burst",
"coalescence": "Coalescence",
"counterstrike": "Counterstrike",
"dereliction": "Dereliction",
"furious": "Furious",
"grinder_s": "Grinder (S)",
"heaven_sent": "Heaven-Sent",
"hellfire_cloak": "Hellfire Cloak",
"intrepid_heart": "Intrepid Heart",
"kushala_daora_soul": "Kushala Daora Soul"
"kushala_daora_soul": "Kushala Daora Soul",
"latent_power": "Latent Power",
"offensive_guard": "Offensive Guard",
"protective_polish": "Protective Polish",
"wall_runner": "Wall Runner",
"wind_mantle": "Wind Mantle"
},
"unicode_glyph_ranges": [
0

View File

@@ -444,10 +444,24 @@
"wings": "翼"
},
"skills": {
"adrenaline_rush": "Adrenaline Rush",
"affinity_sliding": "Affinity Sliding",
"agitator": "Agitator",
"burst": "Burst",
"coalescence": "Coalescence",
"counterstrike": "Counterstrike",
"dereliction": "Dereliction",
"furious": "Furious",
"grinder_s": "Grinder (S)",
"heaven_sent": "Heaven-Sent",
"hellfire_cloak": "Hellfire Cloak",
"intrepid_heart": "Intrepid Heart",
"kushala_daora_soul": "Kushala Daora Soul"
"kushala_daora_soul": "Kushala Daora Soul",
"latent_power": "Latent Power",
"offensive_guard": "Offensive Guard",
"protective_polish": "Protective Polish",
"wall_runner": "Wall Runner",
"wind_mantle": "Wind Mantle"
},
"unicode_glyph_ranges": [
32,

View File

@@ -445,10 +445,24 @@
"wings": "날개"
},
"skills": {
"adrenaline_rush": "Adrenaline Rush",
"affinity_sliding": "Affinity Sliding",
"agitator": "Agitator",
"burst": "Burst",
"coalescence": "Coalescence",
"counterstrike": "Counterstrike",
"dereliction": "Dereliction",
"furious": "Furious",
"grinder_s": "Grinder (S)",
"heaven_sent": "Heaven-Sent",
"hellfire_cloak": "Hellfire Cloak",
"intrepid_heart": "Intrepid Heart",
"kushala_daora_soul": "Kushala Daora Soul"
"kushala_daora_soul": "Kushala Daora Soul",
"latent_power": "Latent Power",
"offensive_guard": "Offensive Guard",
"protective_polish": "Protective Polish",
"wall_runner": "Wall Runner",
"wind_mantle": "Wind Mantle"
},
"unicode_glyph_ranges": [
32,

View File

@@ -445,10 +445,24 @@
"wings": "Крылья"
},
"skills": {
"adrenaline_rush": "Adrenaline Rush",
"affinity_sliding": "Affinity Sliding",
"agitator": "Agitator",
"burst": "Burst",
"coalescence": "Coalescence",
"counterstrike": "Counterstrike",
"dereliction": "Dereliction",
"furious": "Furious",
"grinder_s": "Grinder (S)",
"heaven_sent": "Heaven-Sent",
"hellfire_cloak": "Hellfire Cloak",
"intrepid_heart": "Intrepid Heart",
"kushala_daora_soul": "Kushala Daora Soul"
"kushala_daora_soul": "Kushala Daora Soul",
"latent_power": "Latent Power",
"offensive_guard": "Offensive Guard",
"protective_polish": "Protective Polish",
"wall_runner": "Wall Runner",
"wind_mantle": "Wind Mantle"
},
"unicode_glyph_ranges": [
32,

View File

@@ -445,10 +445,24 @@
"wings": "翼"
},
"skills": {
"adrenaline_rush": "Adrenaline Rush",
"affinity_sliding": "Affinity Sliding",
"agitator": "Agitator",
"burst": "Burst",
"coalescence": "Coalescence",
"counterstrike": "Counterstrike",
"dereliction": "Dereliction",
"furious": "Furious",
"grinder_s": "Grinder (S)",
"heaven_sent": "Heaven-Sent",
"hellfire_cloak": "Hellfire Cloak",
"intrepid_heart": "Intrepid Heart",
"kushala_daora_soul": "Kushala Daora Soul"
"kushala_daora_soul": "Kushala Daora Soul",
"latent_power": "Latent Power",
"offensive_guard": "Offensive Guard",
"protective_polish": "Protective Polish",
"wall_runner": "Wall Runner",
"wind_mantle": "Wind Mantle"
},
"unicode_glyph_ranges": [
32,

View File

@@ -445,10 +445,24 @@
"wings": "翅膀"
},
"skills": {
"adrenaline_rush": "Adrenaline Rush",
"affinity_sliding": "Affinity Sliding",
"agitator": "Agitator",
"burst": "Burst",
"coalescence": "Coalescence",
"counterstrike": "Counterstrike",
"dereliction": "Dereliction",
"furious": "Furious",
"grinder_s": "Grinder (S)",
"heaven_sent": "Heaven-Sent",
"hellfire_cloak": "Hellfire Cloak",
"intrepid_heart": "Intrepid Heart",
"kushala_daora_soul": "Kushala Daora Soul"
"kushala_daora_soul": "Kushala Daora Soul",
"latent_power": "Latent Power",
"offensive_guard": "Offensive Guard",
"protective_polish": "Protective Polish",
"wall_runner": "Wall Runner",
"wind_mantle": "Wind Mantle"
},
"unicode_glyph_ranges": [
32,