From 5d1c85adbacb647b0d96483ac632b8ecef43f417 Mon Sep 17 00:00:00 2001 From: cyrite <123847593+cyrite@users.noreply.github.com> Date: Tue, 7 Nov 2023 15:24:59 -0600 Subject: [PATCH] Bumping Trust version to 7.0.0 (#52) * 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 * 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 * Automated commit to update trust * Automated commit to update trust --------- Co-authored-by: cyritegamestudios <> --- addons/Trust/Trust.lua | 13 ++- .../battle/skillchains/magic_burst_maker.lua | 23 ++++- addons/Trust/cylibs/battle/spells/buff.lua | 14 --- addons/Trust/cylibs/battle/spells/debuff.lua | 16 +-- addons/Trust/cylibs/entity/jobs/SCH.lua | 14 +++ addons/Trust/cylibs/res/nukes.lua | 99 +++++++++++++------ addons/Trust/cylibs/trust/data/BLM.lua | 2 +- addons/Trust/cylibs/trust/data/RDM.lua | 2 +- addons/Trust/cylibs/trust/data/SCH.lua | 28 +++--- addons/Trust/cylibs/trust/roles/nuker.lua | 12 ++- addons/Trust/cylibs/util/player_util.lua | 3 +- addons/Trust/data/DRK.lua | 3 + addons/Trust/data/RDM.lua | 2 +- addons/Trust/data/SCH.lua | 2 + addons/Trust/data/modes/BLM.lua | 3 +- addons/Trust/ui/TrustHud.lua | 2 +- .../Trust/ui/settings/SongSettingsEditor.lua | 2 + .../ui/settings/pickers/SpellPickerView.lua | 9 +- 18 files changed, 157 insertions(+), 92 deletions(-) diff --git a/addons/Trust/Trust.lua b/addons/Trust/Trust.lua index b875c9f4..8cc2292e 100644 --- a/addons/Trust/Trust.lua +++ b/addons/Trust/Trust.lua @@ -1,7 +1,7 @@ _addon.author = 'Cyrite' _addon.commands = {'Trust','trust'} _addon.name = 'Trust' -_addon.version = '6.2.2' +_addon.version = '7.0.0' require('Trust-Include') @@ -35,6 +35,14 @@ default.logging.logtofile = false settings = config.load(default) addon_enabled = ValueRelay.new(false) +addon_enabled:onValueChanged():addAction(function(_, isEnabled) + if isEnabled then + player.player:monitor() + action_queue:enable() + else + action_queue:disable() + end +end) player = {} @@ -337,13 +345,10 @@ end function handle_start() addon_enabled:setValue(true) - player.player:monitor() - action_queue:enable() end function handle_stop() addon_enabled:setValue(false) - action_queue:disable() end function handle_reload() diff --git a/addons/Trust/cylibs/battle/skillchains/magic_burst_maker.lua b/addons/Trust/cylibs/battle/skillchains/magic_burst_maker.lua index b90ccaa8..23ca2ac2 100644 --- a/addons/Trust/cylibs/battle/skillchains/magic_burst_maker.lua +++ b/addons/Trust/cylibs/battle/skillchains/magic_burst_maker.lua @@ -149,7 +149,28 @@ function MagicBurstMaker:start_monitoring() self.is_monitoring = true self.state_var_change_id = self.state_var:on_state_change():addAction(function(_, new_value) - self:set_auto_nuke(new_value == 'Auto') + nukes.reset() + self:set_auto_nuke(new_value ~= 'Off') + if L{'Earth', 'Lightning', 'Water', 'Fire', 'Ice', 'Wind', 'Light', 'Dark'}:contains(new_value) then + nukes.disable() + if new_value == 'Earth' then + Earth = 0 + elseif new_value == 'Lightning' then + Thunder = 0 + elseif new_value == 'Water' then + Water = 0 + elseif new_value == 'Fire' then + Fire = 0 + elseif new_value == 'Ice' then + Ice = 0 + elseif new_value == 'Wind' then + Wind = 0 + elseif new_value == 'Light' then + Lightness = 0 + elseif new_value == 'Dark' then + Darkness = 0 + end + end end) self.action_events.prerender = windower.register_event('prerender', function() diff --git a/addons/Trust/cylibs/battle/spells/buff.lua b/addons/Trust/cylibs/battle/spells/buff.lua index 12fb3981..ef41bd69 100644 --- a/addons/Trust/cylibs/battle/spells/buff.lua +++ b/addons/Trust/cylibs/battle/spells/buff.lua @@ -46,20 +46,6 @@ function Buff.new(spell_name, job_abilities, job_names, spell_prefix, conditions end end -function Buff.decode(rawSettings) - local buff = Buff.new(rawSettings.spell_name, L(rawSettings.job_abilities), L(rawSettings.job_names), nil, rawSettings.conditions) - return buff -end - -function Buff:encode() - local settings = Spell.encode(self) - - settings.type = Buff.__type - settings.spell_name = self.original_spell_name - - return settings -end - ------- -- Returns whether or not this spell is AOE (e.g. Protectra). -- @treturn Boolean True if the spell is AOE and false otherwise. diff --git a/addons/Trust/cylibs/battle/spells/debuff.lua b/addons/Trust/cylibs/battle/spells/debuff.lua index 8663490b..62d1058b 100644 --- a/addons/Trust/cylibs/battle/spells/debuff.lua +++ b/addons/Trust/cylibs/battle/spells/debuff.lua @@ -33,22 +33,8 @@ function Debuff.new(spell_name, job_abilities, job_names, spell_prefix) end end -function Debuff.decode(rawSettings) - local buff = Debuff.new(rawSettings.spell_name, L(rawSettings.job_abilities), L(rawSettings.job_names)) - return buff -end - -function Debuff:encode() - local settings = Spell.encode(self) - - settings.type = Debuff.__type - settings.spell_name = self.original_spell_name - - return settings -end - function Debuff:serialize() - return "Debuff.new(" .. serializer_util.serialize_args(self.spell_name, self.job_abilities, self.job_names, self.spell_prefix) .. ")" + return "Debuff.new(" .. serializer_util.serialize_args(self.original_spell_name, self.job_abilities, self.job_names, self.spell_prefix) .. ")" end return Debuff \ No newline at end of file diff --git a/addons/Trust/cylibs/entity/jobs/SCH.lua b/addons/Trust/cylibs/entity/jobs/SCH.lua index 9b3840f5..5b21c17b 100644 --- a/addons/Trust/cylibs/entity/jobs/SCH.lua +++ b/addons/Trust/cylibs/entity/jobs/SCH.lua @@ -136,6 +136,13 @@ function Scholar:is_addendum_black_active() return buff_util.is_buff_active(buff_util.buff_id('Addendum: Black')) end +------- +-- Returns the list of job abilities to use while in Light Arts. +-- @treturn list List of job abilities +function Scholar:get_light_arts_job_abilities() + return self.trust_settings.LightArts.JobAbilities or L{ 'Light Arts' } +end + ------- -- Returns the list of buffs to cast on party members while in Light Arts. -- @treturn list List of party buffs @@ -154,6 +161,13 @@ function Scholar:get_light_arts_self_buffs() end end +------- +-- Returns the list of job abilities to use while in Dark Arts. +-- @treturn list List of job abilities +function Scholar:get_dark_arts_job_abilities() + return self.trust_settings.DarkArts.JobAbilities or L{ 'Dark Arts' } +end + ------- -- Returns the list of buffs to cast on party members while in Dark Arts. -- @treturn list List of party buffs diff --git a/addons/Trust/cylibs/res/nukes.lua b/addons/Trust/cylibs/res/nukes.lua index ed77542b..8889b82f 100644 --- a/addons/Trust/cylibs/res/nukes.lua +++ b/addons/Trust/cylibs/res/nukes.lua @@ -17,6 +17,28 @@ Thunder = 0 Darkness = 0 Lightness = 0 +function nukes.reset() + Earth = 0 + Water = 0 + Wind = 0 + Fire = 0 + Ice = 0 + Thunder = 0 + Darkness = 0 + Lightness = 0 +end + +function nukes.disable() + Earth = 1 + Water = 1 + Wind = 1 + Fire = 1 + Ice = 1 + Thunder = 1 + Darkness = 1 + Lightness = 1 +end + function ele.earth() if Earth == 0 then @@ -117,7 +139,9 @@ end -- Nuke Functions function nukes.dark() - + if Darkness == 1 then + return nil + end if (nukes.blm() and (windower.ffxi.get_spell_recasts()[219] * 0.66) < 1) then return "Comet" elseif (nukes.blm() and (windower.ffxi.get_spell_recasts()[881] * 0.66) < 1) then @@ -140,7 +164,9 @@ end function nukes.holy() - + if Lightness == 1 then + return nil + end if nukes.whm() then if (windower.ffxi.get_spell_recasts()[22] * 0.66) < 1 then return "Holy II" @@ -161,7 +187,9 @@ end function nukes.thunder() - + if Thunder == 1 then + return nil + end if (nukes.blm() and (windower.ffxi.get_spell_recasts()[853] * 0.66) < 1) then return "Thunder VI" elseif nukes.blm() or nukes.sch() or nukes.geo() or nukes.rdm() then @@ -194,7 +222,9 @@ end function nukes.blizzard() - + if Ice == 1 then + return nil + end if (nukes.blm() and (windower.ffxi.get_spell_recasts()[850] * 0.66) < 1) then return "Blizzard VI" elseif nukes.blm() or nukes.sch() or nukes.geo() or nukes.rdm() then @@ -227,7 +257,9 @@ end function nukes.fire() - + if Fire == 1 then + return nil + end if (nukes.blm() and (windower.ffxi.get_spell_recasts()[849] * 0.66) < 1) then return "Fire VI" elseif nukes.blm() or nukes.sch() or nukes.geo() or nukes.rdm() then @@ -260,7 +292,9 @@ end function nukes.aero() - + if Wind == 1 then + return nil + end if (nukes.blm() and (windower.ffxi.get_spell_recasts()[851] * 0.66) < 1) then return "Aero VI" elseif nukes.blm() or nukes.sch() or nukes.geo() or nukes.rdm() then @@ -293,7 +327,9 @@ end function nukes.water() - + if Water == 1 then + return nil + end if (nukes.blm() and (windower.ffxi.get_spell_recasts()[854] * 0.66) < 1) then return "Water VI" elseif nukes.blm() or nukes.sch() or nukes.geo() or nukes.rdm() then @@ -326,7 +362,9 @@ end function nukes.stone() - + if Earth == 1 then + return nil + end if (nukes.blm() and (windower.ffxi.get_spell_recasts()[852] * 0.66) < 1) then return "Stone VI" elseif nukes.blm() or nukes.sch() or nukes.geo() or nukes.rdm() then @@ -403,16 +441,16 @@ end function nukes.fusion() - if (nukes.blm() and (windower.ffxi.get_spell_recasts()[849] * 0.67) < 1) then + if (nukes.blm() and (windower.ffxi.get_spell_recasts()[849] * 0.67) < 1) and Fire == 0 then return "Fire VI" elseif nukes.blm() or nukes.sch() or nukes.geo() or nukes.rdm() then - if ((windower.ffxi.get_spell_recasts()[148] * 0.66) < 1) then + if ((windower.ffxi.get_spell_recasts()[148] * 0.66) < 1) and Fire == 0 then return "Fire V" - elseif ((windower.ffxi.get_spell_recasts()[147] * 0.66) < 1) then + elseif ((windower.ffxi.get_spell_recasts()[147] * 0.66) < 1) and Fire == 0 then return "Fire IV" - elseif ((windower.ffxi.get_spell_recasts()[146] * 0.66) < 1) then + elseif ((windower.ffxi.get_spell_recasts()[146] * 0.66) < 1) and Fire == 0 then return "Fire III" - elseif ((windower.ffxi.get_spell_recasts()[145] * 0.66) < 1) then + elseif ((windower.ffxi.get_spell_recasts()[145] * 0.66) < 1) and Fire == 0 then return "Fire II" else return nil @@ -420,11 +458,11 @@ function nukes.fusion() end if nukes.nin() then - if ((windower.ffxi.get_spell_recasts()[321] * 0.25) < 1) then + if ((windower.ffxi.get_spell_recasts()[321] * 0.25) < 1) and Fire == 0 then return "Katon: Ni" - elseif ((windower.ffxi.get_spell_recasts()[322] * 0.25) < 1) then + elseif ((windower.ffxi.get_spell_recasts()[322] * 0.25) < 1) and Fire == 0 then return "Katon: San" - elseif ((windower.ffxi.get_spell_recasts()[320] * 0.25) < 1) then + elseif ((windower.ffxi.get_spell_recasts()[320] * 0.25) < 1) and Fire == 0 then return "Katon: Ichi" else return nil @@ -481,7 +519,7 @@ function nukes.disto() end if nukes.smn() then - if (windower.ffxi.get_ability_recasts()[173] < 1) then + if (windower.ffxi.get_ability_recasts()[173] < 1) and Ice == 0 then return "Heavenly Strike" else return nil @@ -495,16 +533,16 @@ function nukes.grav() if (nukes.blm() and (windower.ffxi.get_spell_recasts()[219] * 0.66) < 1) and Darkness == 0 then return "Comet" - elseif (nukes.blm() and (windower.ffxi.get_spell_recasts()[852] * 0.66) < 1) then + elseif (nukes.blm() and (windower.ffxi.get_spell_recasts()[852] * 0.66) < 1) and Earth == 0 then return "Stone VI" elseif nukes.blm() or nukes.sch() or nukes.geo() or nukes.rdm() then - if ((windower.ffxi.get_spell_recasts()[163] * 0.66) < 1) then + if ((windower.ffxi.get_spell_recasts()[163] * 0.66) < 1) and Earth == 0 then return "Stone V" - elseif ((windower.ffxi.get_spell_recasts()[162] * 0.66) < 1) then + elseif ((windower.ffxi.get_spell_recasts()[162] * 0.66) < 1) and Earth == 0 then return "Stone IV" - elseif ((windower.ffxi.get_spell_recasts()[161] * 0.66) < 1) then + elseif ((windower.ffxi.get_spell_recasts()[161] * 0.66) < 1) and Earth == 0 then return "Stone III" - elseif ((windower.ffxi.get_spell_recasts()[160] * 0.66) < 1) then + elseif ((windower.ffxi.get_spell_recasts()[160] * 0.66) < 1) and Earth == 0 then return "Stone II" else return nil @@ -512,11 +550,11 @@ function nukes.grav() end if nukes.nin() then - if ((windower.ffxi.get_spell_recasts()[330] * 0.25) < 1) then + if ((windower.ffxi.get_spell_recasts()[330] * 0.25) < 1) and Earth == 0 then return "Doton: Ni" - elseif ((windower.ffxi.get_spell_recasts()[331] * 0.25) < 1) then + elseif ((windower.ffxi.get_spell_recasts()[331] * 0.25) < 1) and Earth == 0 then return "Doton: San" - elseif ((windower.ffxi.get_spell_recasts()[329] * 0.25) < 1) then + elseif ((windower.ffxi.get_spell_recasts()[329] * 0.25) < 1) and Earth == 0 then return "Doton: Ichi" else return nil @@ -560,7 +598,7 @@ function nukes.frag() return nil end elseif nukes.smn() then - if (windower.ffxi.get_ability_recasts()[173] < 1) then + if (windower.ffxi.get_ability_recasts()[173] < 1) and Thunder == 0 then return "Thunderstorm" else return nil @@ -589,7 +627,6 @@ end function nukes.light() - if (nukes.blm() and (windower.ffxi.get_spell_recasts()[853] * 0.66) < 1) and Thunder == 0 then return "Thunder VI" elseif (nukes.blm() and (windower.ffxi.get_spell_recasts()[849] * 0.66) < 1) and Fire == 0 then @@ -625,15 +662,15 @@ function nukes.light() return nil end elseif nukes.whm() then - if ((windower.ffxi.get_spell_recasts()[23] * 0.66) < 1) then + if ((windower.ffxi.get_spell_recasts()[23] * 0.66) < 1) and Lightness == 0 then return "Holy II" - elseif ((windower.ffxi.get_spell_recasts()[22] * 0.66) < 1) then + elseif ((windower.ffxi.get_spell_recasts()[22] * 0.66) < 1) and Lightness == 0 then return "Holy" else return nil end elseif nukes.smn() then - if (windower.ffxi.get_ability_recasts()[173] < 1) then + if (windower.ffxi.get_ability_recasts()[173] < 1) and Fire == 0 then return "Meteor Strike" else return nil @@ -732,7 +769,7 @@ function nukes.darkness() end if nukes.smn() then - if (windower.ffxi.get_ability_recasts()[173] < 1) then + if (windower.ffxi.get_ability_recasts()[173] < 1) and Ice == 0 then return "Heavenly Strike" else return nil diff --git a/addons/Trust/cylibs/trust/data/BLM.lua b/addons/Trust/cylibs/trust/data/BLM.lua index 8b04d710..288cc38b 100644 --- a/addons/Trust/cylibs/trust/data/BLM.lua +++ b/addons/Trust/cylibs/trust/data/BLM.lua @@ -20,7 +20,7 @@ function BlackMageTrust.new(settings, action_queue, battle_settings, trust_setti ManaRestorer.new(action_queue, L{'Myrkr', 'Spirit Taker', 'Moonlight'}, 40), Nuker.new(action_queue), Puller.new(action_queue, battle_settings.targets, 'Burn', nil), - Sleeper.new(action_queue, L{ Spell.new('Sleepga'), Spell.new('Sleepga II') }) + Sleeper.new(action_queue, L{ Spell.new('Sleepga'), Spell.new('Sleepga II') }, 4) } local self = setmetatable(Trust.new(action_queue, roles, trust_settings), BlackMageTrust) diff --git a/addons/Trust/cylibs/trust/data/RDM.lua b/addons/Trust/cylibs/trust/data/RDM.lua index 65c9f601..714d4f24 100644 --- a/addons/Trust/cylibs/trust/data/RDM.lua +++ b/addons/Trust/cylibs/trust/data/RDM.lua @@ -39,7 +39,7 @@ function RedMageTrust.new(settings, action_queue, battle_settings, trust_setting Dispeler.new(action_queue, L{ Spell.new('Dispel') }), Healer.new(action_queue, job), Raiser.new(action_queue, job), - Puller.new(action_queue, battle_settings.targets, Debuff.new('Dia'):get_spell().name, nil), + Puller.new(action_queue, battle_settings.targets, Debuff.new('Dia') and Debuff.new('Dia'):get_spell().name, nil), } local self = setmetatable(Trust.new(action_queue, roles, trust_settings, job), RedMageTrust) diff --git a/addons/Trust/cylibs/trust/data/SCH.lua b/addons/Trust/cylibs/trust/data/SCH.lua index 2496165f..82dca009 100644 --- a/addons/Trust/cylibs/trust/data/SCH.lua +++ b/addons/Trust/cylibs/trust/data/SCH.lua @@ -1,19 +1,17 @@ -require('tables') -require('lists') -require('logger') - local Trust = require('cylibs/trust/trust') local ScholarTrust = setmetatable({}, {__index = Trust }) ScholarTrust.__index = ScholarTrust local Scholar = require('cylibs/entity/jobs/SCH') +local Buffer = require('cylibs/trust/roles/buffer') local Debuffer = require('cylibs/trust/roles/debuffer') local Dispeler = require('cylibs/trust/roles/dispeler') +local DisposeBag = require('cylibs/events/dispose_bag') local Healer = require('cylibs/trust/roles/healer') local ManaRestorer = require('cylibs/trust/roles/mana_restorer') local Nuker = require('cylibs/trust/roles/nuker') -local Buffer = require('cylibs/trust/roles/buffer') +local Puller = require('cylibs/trust/roles/puller') local Skillchainer = require('cylibs/trust/roles/skillchainer') local StatusRemover = require('cylibs/trust/roles/status_remover') @@ -27,6 +25,7 @@ function ScholarTrust.new(settings, action_queue, battle_settings, trust_setting self.action_queue = action_queue self.current_arts_mode = 'Off' self.arts_roles = S{} + self.dispose_bag = DisposeBag.new() if state.AutoArtsMode.value ~= 'Off' then self:switch_arts(state.AutoArtsMode.value) @@ -38,17 +37,15 @@ end function ScholarTrust:destroy() Role.destroy(self) - if self.auto_arts_mode_id then - state.AutoArtsMode:on_state_change():removeAction(self.auto_arts_mode_id) - end + self.dispose_bag:destroy() end function ScholarTrust:on_init() Trust.on_init(self) - self.auto_arts_mode_id = state.AutoArtsMode:on_state_change():addAction(function(_, new_value) + self.dispose_bag:add(state.AutoArtsMode:on_state_change():addAction(function(_, new_value) self:switch_arts(new_value) - end) + end), state.AutoArtsMode:on_state_change()) self:on_trust_settings_changed():addAction(function(_, new_trust_settings) self:get_job():set_trust_settings(new_trust_settings) @@ -104,23 +101,22 @@ function ScholarTrust:update_for_arts(new_arts_mode) if new_arts_mode == 'LightArts' then self.arts_roles = S{ - Buffer.new(self.action_queue, S{'Light Arts'}, self:get_job():get_light_arts_self_buffs(), self:get_job():get_light_arts_party_buffs()), + Buffer.new(self.action_queue, self:get_job():get_light_arts_job_abilities(), self:get_job():get_light_arts_self_buffs(), self:get_job():get_light_arts_party_buffs()), Debuffer.new(self.action_queue), Healer.new(self.action_queue, self:get_job()), ManaRestorer.new(self.action_queue, L{'Myrkr', 'Spirit Taker'}, 40), StatusRemover.new(self.action_queue, self:get_job()), - Skillchainer.new(self.action_queue, L{'auto', 'prefer'}, self:get_trust_settings().Skillchains), - --Puller.new(self.action_queue, self.battle_settings.targets, 'Dia II', nil) + Skillchainer.new(self.action_queue, L{}, self:get_trust_settings().Skillchains), } elseif new_arts_mode == 'DarkArts' then self.arts_roles = S{ - Buffer.new(self.action_queue, S{'Dark Arts'}, self:get_job():get_dark_arts_self_buffs(), self:get_job():get_dark_arts_party_buffs()), + Buffer.new(self.action_queue, self:get_job():get_dark_arts_job_abilities(), self:get_job():get_dark_arts_self_buffs(), self:get_job():get_dark_arts_party_buffs()), Debuffer.new(self.action_queue), Dispeler.new(self.action_queue, L{ Spell.new('Dispel') }, L{'Addendum: Black'}), ManaRestorer.new(self.action_queue, L{'Myrkr', 'Spirit Taker'}, 40), Nuker.new(self.action_queue), - Skillchainer.new(self.action_queue, L{'auto', 'prefer'}, self:get_trust_settings().Skillchains), - --Puller.new(self.action_queue, self.battle_settings.targets, 'Dia II', nil) + Skillchainer.new(self.action_queue, L{}, self:get_trust_settings().Skillchains), + Puller.new(self.action_queue, self.battle_settings.targets, 'Stone', nil), } end diff --git a/addons/Trust/cylibs/trust/roles/nuker.lua b/addons/Trust/cylibs/trust/roles/nuker.lua index 49bdffc2..69852bf8 100644 --- a/addons/Trust/cylibs/trust/roles/nuker.lua +++ b/addons/Trust/cylibs/trust/roles/nuker.lua @@ -4,8 +4,16 @@ Nuker.__index = Nuker local MagicBurstMaker = require('cylibs/battle/skillchains/magic_burst_maker') local Nukes = require('cylibs/res/nukes') -state.AutoMagicBurstMode = M{['description'] = 'Auto Magic Burst Mode', 'Off', 'Auto'} +state.AutoMagicBurstMode = M{['description'] = 'Auto Magic Burst Mode', 'Off', 'Auto', 'Earth', 'Lightning', 'Water', 'Fire', 'Ice', 'Wind', 'Light', 'Dark'} state.AutoMagicBurstMode:set_description('Auto', "Okay, if you make skillchains I'll try to magic burst.") +state.AutoMagicBurstMode:set_description('Earth', "Okay, I'll only magic burst with earth spells.") +state.AutoMagicBurstMode:set_description('Lightning', "Okay, I'll only magic burst with lightning spells.") +state.AutoMagicBurstMode:set_description('Water', "Okay, I'll only magic burst with water spells.") +state.AutoMagicBurstMode:set_description('Fire', "Okay, I'll only magic burst with fire spells.") +state.AutoMagicBurstMode:set_description('Ice', "Okay, I'll only magic burst with ice spells.") +state.AutoMagicBurstMode:set_description('Wind', "Okay, I'll only magic burst with wind spells.") +state.AutoMagicBurstMode:set_description('Light', "Okay, I'll only magic burst with light spells.") +state.AutoMagicBurstMode:set_description('Dark', "Okay, I'll only magic burst with dark spells.") state.AutoNukeMode = M{['description'] = 'Auto Nuke Mode', 'Off', 'Earth', 'Lightning', 'Water', 'Fire', 'Ice', 'Wind', 'Light', 'Dark'} state.AutoNukeMode:set_description('Earth', "Okay, I'll free nuke with earth spells.") @@ -42,7 +50,7 @@ function Nuker:on_add() self.magic_burst_maker = MagicBurstMaker.new(state.AutoMagicBurstMode) self.magic_burst_maker:start_monitoring() self.magic_burst_maker:on_perform_next_nuke():addAction(function(_, spell_name) - if state.AutoMagicBurstMode.value == 'Auto' then + if state.AutoMagicBurstMode.value ~= 'Off' then local spell = res.spells:with('name', spell_name) if spell then self:cast_spell(spell, true) diff --git a/addons/Trust/cylibs/util/player_util.lua b/addons/Trust/cylibs/util/player_util.lua index e7f9603b..69bda4a3 100644 --- a/addons/Trust/cylibs/util/player_util.lua +++ b/addons/Trust/cylibs/util/player_util.lua @@ -199,8 +199,7 @@ function player_util.get_job_ability_recast(job_ability_name) end function player_util.get_current_strategem_count() - if not (buff_util.is_buff_active(buff_util.buff_id('Light Arts')) - or buff_util.is_buff_active(buff_util.buff_id('Dark Arts'))) then + if not buff_util.is_any_buff_active(L{ buff_util.buff_id('Light Arts'), buff_util.buff_id('Addendum: White'), buff_util.buff_id('Dark Arts'), buff_util.buff_id('Addendum: Black') }) then return 0 end diff --git a/addons/Trust/data/DRK.lua b/addons/Trust/data/DRK.lua index 756974f9..1142d450 100644 --- a/addons/Trust/data/DRK.lua +++ b/addons/Trust/data/DRK.lua @@ -45,6 +45,9 @@ return { JobAbilities = L{ "Last Resort", "Scarlet Delirium" + }, + Debuffs = L { + } } } \ No newline at end of file diff --git a/addons/Trust/data/RDM.lua b/addons/Trust/data/RDM.lua index c4a8a92d..60886109 100644 --- a/addons/Trust/data/RDM.lua +++ b/addons/Trust/data/RDM.lua @@ -64,7 +64,7 @@ return { } }, Debuffs = L{ - Debuff.new("Distract III", L{}) + Debuff.new("Distract", L{}) } } } \ No newline at end of file diff --git a/addons/Trust/data/SCH.lua b/addons/Trust/data/SCH.lua index 571b6b8f..d585625f 100644 --- a/addons/Trust/data/SCH.lua +++ b/addons/Trust/data/SCH.lua @@ -2,6 +2,7 @@ return { Default = { LightArts = { + JobAbilities = L{ 'Light Arts' }, PartyBuffs = L{ Spell.new("Adloquium", L{}, L{"WAR", "PUP"}, nil, L{}) }, @@ -54,6 +55,7 @@ return { } }, DarkArts = { + JobAbilities = L{ 'Dark Arts' }, PartyBuffs = L{ }, diff --git a/addons/Trust/data/modes/BLM.lua b/addons/Trust/data/modes/BLM.lua index e450d8e6..fea516f3 100644 --- a/addons/Trust/data/modes/BLM.lua +++ b/addons/Trust/data/modes/BLM.lua @@ -22,6 +22,7 @@ return { ["autofoodmode"]="Off", ["combatmode"]="Off", ["autotrustsmode"]="Off", - ["autoenmityreductionmode"]="Off" + ["autoenmityreductionmode"]="Off", + ["autosleepmode"]="Off", } } \ No newline at end of file diff --git a/addons/Trust/ui/TrustHud.lua b/addons/Trust/ui/TrustHud.lua index 46664ae1..ee841846 100644 --- a/addons/Trust/ui/TrustHud.lua +++ b/addons/Trust/ui/TrustHud.lua @@ -520,7 +520,7 @@ function TrustHud:getSettingsMenuItem(trust, trustSettings, trustSettingsMode, j end):map(function(spell) return spell.name end) local chooseSongsView = setupView(SongPickerView.new(trustSettings, songs, allSongs, args['validator']), viewSize) - chooseSongsView:setTitle("Choose songs.") + chooseSongsView:setTitle(args['help_text']) chooseSongsView:setShouldRequestFocus(false) return chooseSongsView end) diff --git a/addons/Trust/ui/settings/SongSettingsEditor.lua b/addons/Trust/ui/settings/SongSettingsEditor.lua index 2986d7b1..0160551d 100644 --- a/addons/Trust/ui/settings/SongSettingsEditor.lua +++ b/addons/Trust/ui/settings/SongSettingsEditor.lua @@ -77,6 +77,7 @@ function SongSettingsEditor:onSelectMenuItemAtIndexPath(textItem, indexPath) if selectedIndexPaths:length() > 0 then local indexPath = selectedIndexPaths[1] if indexPath.section == 1 then + self.menuArgs['help_text'] = "Choose 3 dummy songs." self.menuArgs['songs'] = self.dummySongs self.menuArgs['validator'] = function(songNames) local buffsForDummySongs = S(songNames:map(function(songName) @@ -93,6 +94,7 @@ function SongSettingsEditor:onSelectMenuItemAtIndexPath(textItem, indexPath) return nil end elseif indexPath.section == 2 then + self.menuArgs['help_text'] = "Choose 5 songs." self.menuArgs['songs'] = self.songs self.menuArgs['validator'] = function(songNames) if songNames:length() ~= 5 then diff --git a/addons/Trust/ui/settings/pickers/SpellPickerView.lua b/addons/Trust/ui/settings/pickers/SpellPickerView.lua index 22d3115b..c1daa4c0 100644 --- a/addons/Trust/ui/settings/pickers/SpellPickerView.lua +++ b/addons/Trust/ui/settings/pickers/SpellPickerView.lua @@ -1,4 +1,5 @@ local Buff = require('cylibs/battle/spells/buff') +local Debuff = require('cylibs/battle/spells/debuff') local PickerView = require('cylibs/ui/picker/picker_view') local Spell = require('cylibs/battle/spell') local spell_util = require('cylibs/util/spell_util') @@ -25,8 +26,12 @@ function SpellPickerView:onSelectMenuItemAtIndexPath(textItem, _) if item then local spell = res.spells:with('name', item:getText()) if spell then - if spell.status then - self.spells:append(Buff.new(spell_util.base_spell_name(item:getText()))) + if spell.status and not L{ 40, 41, 42 }:contains(spell.skill) then + if spell.targets:contains('Enemy') then + self.spells:append(Debuff.new(spell_util.base_spell_name(item:getText()))) + else + self.spells:append(Buff.new(spell_util.base_spell_name(item:getText()))) + end else self.spells:append(Spell.new(item:getText(), L{}, L{})) end