Skip to content

Commit

Permalink
Bumping Trust version to 7.0.0 (#52)
Browse files Browse the repository at this point in the history
* 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 <>
  • Loading branch information
cyrite committed Nov 7, 2023
1 parent 25f185b commit 5d1c85a
Show file tree
Hide file tree
Showing 18 changed files with 157 additions and 92 deletions.
13 changes: 9 additions & 4 deletions addons/Trust/Trust.lua
Original file line number Diff line number Diff line change
@@ -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')

Expand Down Expand Up @@ -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 = {}

Expand Down Expand Up @@ -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()
Expand Down
23 changes: 22 additions & 1 deletion addons/Trust/cylibs/battle/skillchains/magic_burst_maker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
14 changes: 0 additions & 14 deletions addons/Trust/cylibs/battle/spells/buff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 1 addition & 15 deletions addons/Trust/cylibs/battle/spells/debuff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 14 additions & 0 deletions addons/Trust/cylibs/entity/jobs/SCH.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
99 changes: 68 additions & 31 deletions addons/Trust/cylibs/res/nukes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -403,28 +441,28 @@ 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
end
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
Expand Down Expand Up @@ -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
Expand All @@ -495,28 +533,28 @@ 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
end
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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion addons/Trust/cylibs/trust/data/BLM.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading

0 comments on commit 5d1c85a

Please sign in to comment.