From bb298b968c006f2a76298c1e697c6a774852d3d0 Mon Sep 17 00:00:00 2001 From: cyrite <123847593+cyrite@users.noreply.github.com> Date: Mon, 29 Jan 2024 13:20:26 -0600 Subject: [PATCH] v8.5.2 (#84) * Adding workflows files * Automated commit to update trust * Re-adding README.md * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Update weapon_skill.lua * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Automated commit to update trust * Update README.md * Automated commit to update trust * Automated commit to update trust * Update README.md * Automated commit to update trust * Automated commit to update trust --------- Co-authored-by: cyritegamestudios <> --- Trust.lua | 3 ++- cylibs/actions/action_queue.lua | 2 +- cylibs/actions/spell.lua | 6 +++++- cylibs/actions/ui/action_hud.lua | 2 +- cylibs/battle/aura_tracker.lua | 9 +++++---- cylibs/res/skills.lua | 2 ++ cylibs/trust/roles/skillchainer.lua | 18 ++++++++++++++++-- cylibs/trust/trust.lua | 2 +- settings/skillchains/CombatSkillSettings.lua | 3 ++- ui/TrustHud.lua | 4 +++- 10 files changed, 38 insertions(+), 13 deletions(-) diff --git a/Trust.lua b/Trust.lua index 8a2b2f46..b14c3084 100644 --- a/Trust.lua +++ b/Trust.lua @@ -1,7 +1,7 @@ _addon.author = 'Cyrite' _addon.commands = {'Trust','trust'} _addon.name = 'Trust' -_addon.version = '8.5.1' +_addon.version = '8.5.2' _addon.release_notes = [[ Trusts now come fully equipped with a skillchain calculator and can make powerful skillchains of their own without any configuration! @@ -56,6 +56,7 @@ default.hud = {} default.hud.position = {} default.hud.position.x = 0 default.hud.position.y = 0 +default.hud.auto_hide = true default.logging = {} default.logging.enabled = false default.logging.logtofile = false diff --git a/cylibs/actions/action_queue.lua b/cylibs/actions/action_queue.lua index 82448cd4..c61e98cc 100644 --- a/cylibs/actions/action_queue.lua +++ b/cylibs/actions/action_queue.lua @@ -89,7 +89,7 @@ function ActionQueue:perform_next_action() end self.current_action = next_action if self.verbose then - self:on_action_start():trigger(self, next_action:tostring()) + self:on_action_start():trigger(self, next_action) end --print(tostring(self.identifier)..' '..next_action:gettype()..' '..(next_action:getidentifier() or 'nil')..' start') diff --git a/cylibs/actions/spell.lua b/cylibs/actions/spell.lua index a34f2b11..cbdf0669 100644 --- a/cylibs/actions/spell.lua +++ b/cylibs/actions/spell.lua @@ -87,7 +87,11 @@ function SpellAction:perform() local target = windower.ffxi.get_mob_by_index(self.target_index) local spell = res.spells[self.spell_id] - windower.chat.input("/ma %s ":format(spell.en)..target.id) + if windower.ffxi.get_info().language:lower() == 'japanese' then + windower.chat.input("/ma %s ":format(spell.en)..target.id) + else + windower.chat.input('/ma "%s"':format(spell.en)..target.id) + end end function SpellAction:getspellid() diff --git a/cylibs/actions/ui/action_hud.lua b/cylibs/actions/ui/action_hud.lua index 4c6234fb..1414fa2b 100644 --- a/cylibs/actions/ui/action_hud.lua +++ b/cylibs/actions/ui/action_hud.lua @@ -26,7 +26,7 @@ function ActionHud.new(actionQueue, hideBackground) self.actionQueue = actionQueue self:getDisposeBag():add(actionQueue:on_action_start():addAction(function(_, s) - self:setTitle(s or '') + self:setTitle(s:tostring() or '') end), actionQueue:on_action_start()) self:getDisposeBag():add(actionQueue:on_action_end():addAction(function(_, s) self:setTitle('') diff --git a/cylibs/battle/aura_tracker.lua b/cylibs/battle/aura_tracker.lua index 04e4f3cb..e16e5bf2 100644 --- a/cylibs/battle/aura_tracker.lua +++ b/cylibs/battle/aura_tracker.lua @@ -9,6 +9,7 @@ require('logger') local AuraTracker = {} AuraTracker.__index = AuraTracker +AuraTracker.__class = "AuraTracker" ------- -- Default initializer for a new damage memory tracker. @@ -42,7 +43,7 @@ end function AuraTracker:tic(_, _) for target_id, target_record in pairs(self.status_effect_history) do for debuff_id, _ in pairs(target_record) do - print('checking '..debuff_id..' on '..target_id) + logger.notice(self.__class, 'tic', debuff_id, target_id) local party_member = self.party:get_party_member(target_id) if party_member and party_member:has_debuff(debuff_id) then self:increment_aura_probability(debuff_id) @@ -87,7 +88,7 @@ function AuraTracker:record_status_effect_removal(spell_id, target_id, debuff_id self.status_effect_history[target_id] = target_record - print('recording '..debuff_id..' on '..target_id) + logger.notice(self.__class, 'record_status_effect_removal', debuff_id, target_id) end end @@ -99,7 +100,7 @@ function AuraTracker:increment_aura_probability(debuff_id) self.aura_probabilities[debuff_id] = math.min(current_probabilty + 25, 100) - print('current aura chance of '..debuff_id.. ' is '..self.aura_probabilities[debuff_id]) + logger.notice(self.__class, 'increment_aura_probability', debuff_id, self.aura_probabilities[debuff_id]) end ------- @@ -110,7 +111,7 @@ function AuraTracker:decrement_aura_probability(debuff_id) self.aura_probabilities[debuff_id] = math.max(current_probabilty - 25, 0) - print('current aura chance of '..debuff_id.. ' is '..self.aura_probabilities[debuff_id]) + logger.notice(self.__class, 'decrement_aura_probability', debuff_id, self.aura_probabilities[debuff_id]) end ------- diff --git a/cylibs/res/skills.lua b/cylibs/res/skills.lua index 88742219..d54949f8 100644 --- a/cylibs/res/skills.lua +++ b/cylibs/res/skills.lua @@ -44,6 +44,7 @@ skills.weapon_skills = { [44] = {en='Death Blossom',skillchain={'Fragmentation','Distortion'}}, [45] = {en='Atonement',skillchain={'Fusion','Reverberation'}}, [46] = {en='Expiacion',skillchain={'Distortion','Scission'}}, + [47] = {en="Sanguine Blade",skillchain={}}, [48] = {en='Hard Slash',skillchain={'Scission'}}, [49] = {en='Power Slash',skillchain={'Transfixion'}}, [50] = {en='Frostbite',skillchain={'Induration'}}, @@ -163,6 +164,7 @@ skills.weapon_skills = { [180] = {en='Sunburst',skillchain={'Compression','Reverberation'}}, [181] = {en='Shell Crusher',skillchain={'Detonation'}}, [182] = {en='Full Swing',skillchain={'Liquefaction','Impaction'}}, + [183] = {en="Spirit Taker",skillchain={}}, [184] = {en='Retribution',skillchain={'Gravitation','Reverberation'}}, [185] = {en='Gate of Tartarus',skillchain={'Darkness','Distortion'}}, [186] = {en='Vidohunir',skillchain={'Fragmentation','Distortion'}}, diff --git a/cylibs/trust/roles/skillchainer.lua b/cylibs/trust/roles/skillchainer.lua index c4bde56d..5f8aeba0 100644 --- a/cylibs/trust/roles/skillchainer.lua +++ b/cylibs/trust/roles/skillchainer.lua @@ -87,6 +87,12 @@ function Skillchainer:on_add() self:update_abilities() + self.dispose_bag:add(self.action_queue:on_action_start():addAction(function(_, a) + if a:getidentifier() == self.action_identifier then + self.is_performing_ability = true + end + end), self.action_queue:on_action_start()) + self.dispose_bag:add(self.action_queue:on_action_end():addAction(function(a, success) if a:getidentifier() == self.action_identifier then self.is_performing_ability = false @@ -184,6 +190,12 @@ function Skillchainer:on_skillchain_mode_changed(_, new_value) end end +function Skillchainer:target_change(target_index) + Role.target_change(self, target_index) + + self.is_performing_ability = false +end + function Skillchainer:check_skillchain() if state.AutoSkillchainMode.value == 'Off' or self.is_performing_ability or not self.enabled or not self:get_player():is_engaged() or os.time() - self.last_check_skillchain_time < 1 then @@ -193,6 +205,7 @@ function Skillchainer:check_skillchain() local target = self:get_target() if target == nil then + logger.notice(self.__class, 'check_skillchain', 'target is nil') return end @@ -291,17 +304,18 @@ end function Skillchainer:perform_ability(ability) local target = self:get_target() if not self.action_queue.is_enabled or target == nil then + logger.notice(self.__class, 'perform_ability', ability:get_name(), not self.action_queue.is_enabled, target ~= nil) return false end local ability_action = ability:to_action(target:get_mob().index, self:get_player()) if ability_action then - self.is_performing_ability = true - ability_action.identifier = self.action_identifier ability_action.max_duration = 10 ability_action.priority = ActionPriority.highest + logger.notice(self.__class, 'perform_ability', ability:get_name(), 'push_action') + self.action_queue:push_action(ability_action, true) end end diff --git a/cylibs/trust/trust.lua b/cylibs/trust/trust.lua index b552817d..44ca9f80 100644 --- a/cylibs/trust/trust.lua +++ b/cylibs/trust/trust.lua @@ -46,7 +46,7 @@ function Trust:init() -- TODO: prune invalid actions instead of clear --self.action_queue:clear() self.target_index = new_target_index - self:job_target_change(new_target_index) + self:job_target_change(new_target_index, old_target_index) end) end diff --git a/settings/skillchains/CombatSkillSettings.lua b/settings/skillchains/CombatSkillSettings.lua index 8aa7de1c..5f065ddc 100644 --- a/settings/skillchains/CombatSkillSettings.lua +++ b/settings/skillchains/CombatSkillSettings.lua @@ -12,6 +12,7 @@ function CombatSkillSettings.new(combatSkillName, blacklist, defaultWeaponSkillN self.combatSkillName = combatSkillName self.combatSkillId = res.skills:with('en', self.combatSkillName).id self.blacklist = blacklist + self.defaultWeaponSkillName = defaultWeaponSkillName self.defaultWeaponSkillId = job_util.weapon_skill_id(defaultWeaponSkillName) return self end @@ -65,7 +66,7 @@ function CombatSkillSettings:get_name() end function CombatSkillSettings:serialize() - return "CombatSkillSettings.new(" .. serializer_util.serialize_args(self.combatSkillName, self.blacklist) .. ")" + return "CombatSkillSettings.new(" .. serializer_util.serialize_args(self.combatSkillName, self.blacklist, self.defaultWeaponSkillName) .. ")" end return CombatSkillSettings \ No newline at end of file diff --git a/ui/TrustHud.lua b/ui/TrustHud.lua index 696f69f7..019866b7 100644 --- a/ui/TrustHud.lua +++ b/ui/TrustHud.lua @@ -206,7 +206,9 @@ function TrustHud.new(player, action_queue, addon_enabled, menu_width, menu_heig self:getDisposeBag():add(self.gameInfo:onMenuChange():addAction(function(_, isMenuOpen) if isMenuOpen then - self.trustMenu:closeAll() + if settings.hud.auto_hide then + self.trustMenu:closeAll() + end end end), self.gameInfo:onMenuChange())