Skip to content

Commit

Permalink
v10.5.2 (#177)
Browse files Browse the repository at this point in the history
* Adding empty GambitSettings

* Fixing issue with stale player index in Conditions

* Fixing Min and MaxTacticalPointsCondition target index

* Nil fix

* Fixing target index issue with HP, MP and TP conditions

* More fixes

* Various fixes

* Fixing SkillchainPropertyCondition serialize

* Fixing more conditions

* Fixing nil issue with HasBuffsCondition

* Displaying friendly descriptions in conditions picker view

* Fixing Puppetmaster trust

* Updating default Gambits for White Mage and Dark Knight trusts

* Changing Gambit ability condtions check to always be player

* Adding support for capitalizing letters in text input view

* Adding Condition target filtering

* Adding Reset button to GambitSettingsMenuItem to reset to Default Gambits

* Adding replacement for AutoControl

* Adding default attachment sets for Puppetmaster Trust

* Bumping Trust version to 10.0.0

* PR feedback

* Fixing nil exception

* Fixing sleeper and adding more monster abilities to ready and finish ability condition

* Bumping Trust version to 10.0.1

* Fixing issue with equipping automaton attachments

* Adding additional delay after removing attachments

* Adding manifest.json

* Bumping Trust version to 10.0.3

* Adding the Trust MSI

* Updating MSI

* Bumping Trust version to 10.0.5

* Bumping manifest version

* Update README.md

* Adding new C# installer

* Update README.md

* Update README.md

* Create README.md

* Adding README and TrustInstaller zip file

* Adding README

* Update README.md

* Updating the TrustInstaller.zip

* Updating TrustInstaller.zip

* Updating the TrustInstaller

* Bumping Trust Version to 10.0.9

* Adding support for Entrust + Indicolure in Gambit picker

* Adding check for extra song instrument while singing dummy songs

* Fixing singer view selection

* Update README.md

* Adding Bard song diagnostics

* Adding tags field to Gambit

* Adding support for no sub job

* Disabling sub job menu item when no sub job is present

* Bumping Trust version to 10.1.0

* PR feedback

* Adding Reactions menu item

* Updating default Red Mage trust settings

* Updating default widget positions

* Fixing false positive in Bard trust diagnostics

* PR feedback

* WIP of speed singing

* Getting rid of extra multiplier on Marcato duration

* Adding StepTracker and HasDazeCondition

* Adding Command Gambit ability

* Adding // trust sc mintp command

* Adding elemental resistances

* Collapsing debuffs section of target widget when there are no debuffs

* Target widget cleanup

* Clean up

* Moving turn to face mob out of action queue

* Adding new actions

* Adding GridLayout

* Showing and disabling spells and job abilities which are unavailable on sub job

* Adding more resistance data to monster families

* Adding shortcuts for menus and widgets

* Adding shortcut for gambits

* Adding shortcut for skillchains menu

* Fixing nil issue

* Fixing nil exception in SongTracker

* Fixing regression with Gambits

* Adding missing __eq function to RunTo and RunAway

* Disabling singing while moving

* Updating default Bard trust settings and fixing song editor to respect current mode

* Fixing nil issue with ConfigEditor

* Fixing more focus issues

* Bumping Trust version to 10.2.0

* PR feedback

* Updating deafult alter egos and pull targets

* Adding more pull targets

* Updating default widget positions

* Updating release notes

* Updating manifest

* Update create_release.yml

* Updating TrustInstaller

* Updating manifest.json

* Update README.md

* Update README.md

* Updating manifest.json

* Fixing singer regressions

* Disabling keyboard shortcuts while chat is open

* Adding rolls viwe

* Adding Geomancy view

* Fixing edge case with Shooter

* Adding separate queue for equipping automaton attachments

* Disabling AutoPetMode while equipping attachments

* Fixing issue where ManeuverMode would be overriden by settings

* Overhauled AutomatonSettingsMenuItem and added abilty to customize maneuvers

* Updating help text for maneuver menu.

* Updating ManeuverMode help text

* Removing res.items dependency on PUP job file

* PR feedback

* Adding TODO

* Fixing regression in SongSettingsMenuItem

* Bumping Trust version to 10.2.1

* Fixing merge issue in manifest.json

* Adding PetStatusWidget

* Adding AutomatonStatusWidget

* Updating PetMode on AutomatonStatusWidget when changing attachments

* Removing debug error

* Bumping Trust version to 10.2.2

* Updating AutomatonStatusWidget text formatting

* Fixing scrolling content offset with section header views

* Adding pet ability in AutomatonStatusWidget

* Updating default position for pet status widget

* Updating default attachment set for LightTank

* Re-enabling AutoFaceMobMode while singing because turn to face mob is no longer in action queue

* Fixing copy on GambitSettingsMenuItem reset button

* Adding Default and Gambits for Rune Fencer

* Adding PathWidget

* Adding TargetNameCondition

* Fixing nil exception in PathRecorder

* Fixing nil exception in PathRecorder

* Adding new IPC messages

* Fixing self targeting weapon skills and nil exception with job abilities

* Updating release notes for 10.3.0

* PR feedback

* Bumping Trust version to 10.3.1

* Adding autocomplete for Trust commands

* Resetting content offset of autocomplete when menu disappears

* Removing ActionBatchingMode

* Adding MigrationManager and migration to move Bard job settings under SongSettings key

* Updating default Bard job settings file

* Adding menu to pick pianissimo songs

* Refactoring commands into GeneralCommands and MenuCommands and adding settings.xml flag to disable autocomplete

* Showing command description in info bar

* PR feedback

* Fixing missing handle_stop issue

* Fixing issue where no pianissimo song is initially selected

* Adding pianissimo songs to SongSettingsEditor

* Updating description for AutoClarionCallMode

* Fixing issue reordering Pianissimo songs

* Adding Soul Voice as a conflicting buff for Marcato

* Updating release notes

* PR feedback

* Adding menu for editing the remote commands whitelist

* Update migration_v1.lua

* Fixing issue where Bard settings migration ran on all jobs

* PR feedback

* Fixing merge issue

* PR feedback

* Fixing issue where EarthSpirit would not be dismissed

* Fixing issue where BloodPactSettings default ability would not appear selected

* Adding Puller role if neither main nor sub job Trust can pull

* Clean up

* Fixing spell, job ability and weapon skill actions for JP players

* Fixing strategem actions for JP players

* PR feedback

* PR feedback

* Updating release notes

* Adding CombatSkillsCondition and updating Hasso to only be used with 2-handed weapons

* Fixing issue where pull distance can't be edited in the UI

* Bumping Trust version to 10.4.5

* Updating default Samurai job settings file

* Adding MagicBurstTrustCommands and NukeTrustCommands

* Adding NukeCommands

* Fixing issue where Scholar menu does not refresh when changing arts

* Bumping Trust version to 10.4.6

* Adding nil check in party mob update packet

* Updating release notes

* Adding MultiPickerConfigItem

* PR feedback

* Edge cases for Truster

* Fixing nil error

* Remove sleep debuff when attacking a monster

* Fixing issue with casting spell on dead enemy

* Adding JobCondition to match multiple jobs

* Fixing PLD Gambits

* Updating default Gambits for Dancer

* Adding Apururu to cylibs/res/trusts.lua

* Bumping Trust version to 10.4.8

* Filtering out Gambit ability targets if job has no abilities for that target type

* Fixing typo in EnemiesNearbyCondition

* Updating manifest.json

* Bumping Trust version to 10.4.9

* Fixing TargetNameCondition

* Bumping Trust version to 10.5.0

* PR feedback

* Adding Phalanx and Phalanx II to blacklist for Buff.new

* Adding more spells to Buff blacklist

* Updating default job settings for Red Mage

* Adding Reset button to Self and Party buff settings

* Updating default Red Mage job settings file

* Adding // trust set and // trust cycle commands to auto complete

* Converting TrustInfoBar to a MarqueeCollectionViewCell

* Cleanup

* Hiding status removal Blacklist for Red Mage

* Truncating skillchains

* Adding AutoCampMode

* Bumping Trust version to 10.5.2

* PR feedback

* Updating HealerSettingsMenuItem to use new ModeConfigEditor

* Adding friendly descriptions for AutoHealMode, AutoStatusRemovalMode and AutoDetectAuraMode

* Migrating modes menus to ModeConfigEditor

* Updating description for AutoGambitMode

* Fixing issue where GambitSettingsEditor reset when getting focus

* Showing full gambit description in info bar

* Bumping Trust version to 10.5.3

* PR feedback
  • Loading branch information
cyrite authored Aug 26, 2024
1 parent b57f2b6 commit 5798757
Show file tree
Hide file tree
Showing 62 changed files with 468 additions and 185 deletions.
32 changes: 26 additions & 6 deletions 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 = '10.5.0'
_addon.version = '10.5.3'
_addon.release_notes = [[
This update introduces new menus for Bard, autocomplete for Trust
commands, new commands and important bug fixes for users running the
Expand Down Expand Up @@ -73,7 +73,7 @@ state.AutoUnloadOnDeathMode = M{['description'] = 'Auto Unload On Death Mode', '
state.AutoUnloadOnDeathMode:set_description('Off', "Okay, I'll pause Trust after getting knocked out but won't unload it. DO NOT USE WHILE AFK!")
state.AutoUnloadOnDeathMode:set_description('Auto', "Okay, I'll automatically unload Trust after getting knocked out.")

state.AutoBuffMode = M{['description'] = 'Auto Buff Mode', 'Off', 'Auto'}
state.AutoBuffMode = M{['description'] = 'Buff Self and Party', 'Off', 'Auto'}
state.AutoBuffMode:set_description('Auto', "Okay, I'll automatically buff myself and the party.")

state.AutoEnmityReductionMode = M{['description'] = 'Auto Enmity Reduction Mode', 'Off', 'Auto'}
Expand Down Expand Up @@ -312,28 +312,48 @@ function load_trust_commands(job_name_short, trust, action_queue, party, main_tr

local FFXIPickerView = require('ui/themes/ffxi/FFXIPickerView')

command_widget = FFXIPickerView.withItems(L{}, L{})
command_widget = FFXIPickerView.withItems(L{}, L{}, false, nil, nil, nil, true)
command_widget:setPosition(16, windower.get_windower_settings().ui_y_res - 233)
command_widget:setShouldRequestFocus(false)
command_widget:setUserInteractionEnabled(false)
command_widget:setVisible(false)

local all_commands = L{}

for command in common_commands:it() do
for text in command:get_all_commands():it() do
all_commands:append(text)
end
end

for state_name, _ in pairs(state) do
local state_var = get_state(state_name)
if state_var then
all_commands:append('// trust cycle '..state_name)
for option in state_var:options():it() do
all_commands:append('// trust set '..state_name..' '..option)
end
end
end

all_commands:sort()

local ChatAutoCompleter = require('cylibs/ui/input/autocomplete/chat_auto_completer')

chat_auto_completer = ChatAutoCompleter.new(common_commands)
chat_auto_completer = ChatAutoCompleter.new(all_commands)
chat_auto_completer:onAutoCompleteListChange():addAction(function(_, terms)
command_widget:getDataSource():removeAllItems()
if not addon_settings:getSettings().autocomplete.visible then
return
end
if terms:length() > 0 then
command_widget:setVisible(true)
command_widget:setItems(terms, L{})
command_widget:setItems(terms:map(function(term) return term:gsub("^// trust ", "") end), L{})
local description
if terms:length() == 1 then
hud.infoBar:setTitle("Commands")
local args = string.split(terms[1], " ")
if args[3] and args[4] and shortcuts[args[3]] then
if args[3] and args[4] and shortcuts[args[3]] and type(shortcuts[args[3]]) ~= 'function' then
description = shortcuts[args[3]]:get_description(args[4])
end
end
Expand Down
1 change: 1 addition & 0 deletions TrustSettings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ function TrustSettings:deleteSettings(setName)
end

function TrustSettings:backupSettings(filePath)
filePath = filePath or self.settingsFolder..self.jobNameShort..'_'..windower.ffxi.get_player().name..'.lua'
local playerSettings = FileIO.new(filePath)
if playerSettings:exists() then
local backupFilePath = self.settingsFolder..self.backupsFolder..self.jobNameShort..'_'..windower.ffxi.get_player().name..'.lua'
Expand Down
22 changes: 15 additions & 7 deletions commands/PullCommands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function PullTrustCommands.new(trust, action_queue)
self:add_command('auto', function(_) return self:handle_toggle_mode('AutoPullMode', 'Auto', 'Off') end, 'Automatically pull mobs for the party')
self:add_command('party', function(_) return self:handle_toggle_mode('AutoPullMode', 'Party', 'Off') end, 'Automatically pull whatever monster the party is fighting')
self:add_command('all', function(_) return self:handle_toggle_mode('AutoPullMode', 'All', 'Off') end, 'Automatically pull whatever monsters are nearby')
self:add_command('camp', self.handle_camp, 'Automatically return to camp after battle')

return self
end
Expand All @@ -21,16 +22,23 @@ function PullTrustCommands:get_command_name()
return 'pull'
end

-- // trust pull [auto, party, all]
function PullTrustCommands:handle_toggle_mode(mode_var_name, on_value, off_value)
local success = true
function PullTrustCommands:get_puller()
return self.trust:role_with_type("puller")
end

-- // trust pull camp
function PullTrustCommands:handle_camp(_)
local success
local message

local mode_var = get_state(mode_var_name)
if mode_var.value == on_value then
handle_set(mode_var_name, off_value)
if state.AutoCampMode.value == 'Off' then
success = false
message = "AutoCampMode must be set to Auto"
else
handle_set(mode_var_name, on_value)
self:get_puller():set_camp_position(ffxi_util.get_mob_position(windower.ffxi.get_player().name))

success = true
message = "Return to the current position after battle"
end

return success, message
Expand Down
6 changes: 5 additions & 1 deletion cylibs/battle/spell.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@ function Spell.new(spell_name, job_abilities, job_names, target, conditions, con
local self = setmetatable({
spell_name = spell_name;
job_abilities = job_abilities or L{};
job_names = job_names or job_util.all_jobs();
job_names = job_names;
target = target;
consumable = consumable;
conditions = conditions or L{};
}, Spell)

if S(res.spells:with('en', spell_name)):contains('Party') then
job_names = job_names or job_util.all_jobs()
end

self:add_condition(SpellRecastReadyCondition.new(res.spells:with('en', spell_name).id))

local strategem_count = self.job_abilities:filter(function(job_ability_name)
Expand Down
2 changes: 1 addition & 1 deletion cylibs/battle/spells/debuff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function Debuff.new(spell_name, job_abilities, job_names, spell_prefix)
end

function Debuff:serialize()
return "Debuff.new(" .. serializer_util.serialize_args(self.original_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, L{}, self.spell_prefix) .. ")"
end

return Debuff
1 change: 1 addition & 0 deletions cylibs/conditions/condition.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ function Condition.defaultSerializableConditionClasses()
SkillchainPropertyCondition.__class,
HasDazeCondition.__class,
CombatSkillsCondition.__class,
NotCondition.__class,
}
end

Expand Down
5 changes: 5 additions & 0 deletions cylibs/conditions/job.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-- @class module
-- @name JobCondition
local MultiPickerConfigItem = require('ui/settings/editors/config/MultiPickerConfigItem')
local list_ext = require('cylibs/util/extensions/lists')
local serializer_util = require('cylibs/util/serializer_util')

local Condition = require('cylibs/conditions/condition')
Expand Down Expand Up @@ -42,6 +43,10 @@ function JobCondition:tostring()
if self.job_name_shorts:equals(job_util.all_jobs()) then
return "Target job is any job"
else
if self.job_name_shorts:length() > 15 then
local excluded_job_name_shorts = list.diff(self.job_name_shorts, job_util.all_jobs())
return "Target is any job except "..localization_util.commas(excluded_job_name_shorts, 'or')
end
return "Target job is "..localization_util.commas(self.job_name_shorts, 'or')
end
end
Expand Down
2 changes: 1 addition & 1 deletion cylibs/messages/ipc/ipc_relay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ local IpcRelay = {}
IpcRelay.__index = IpcRelay
IpcRelay.__class = "IpcRelay"

state.IpcMode = M{['description'] = 'Ipc Mode', 'All', 'Off', 'Send', 'Receive'}
state.IpcMode = M{['description'] = 'Send IPC Messages', 'All', 'Off', 'Send', 'Receive'}
state.IpcMode:set_description('All', "Okay, I'll send and receive IPC messages.")
state.IpcMode:set_description('Send', "Okay, I'll only send IPC messages.")
state.IpcMode:set_description('Receive', "Okay, I'll only receive IPC messages.")
Expand Down
8 changes: 4 additions & 4 deletions cylibs/trust/data/BRD.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ local Puller = require('cylibs/trust/roles/puller')
local Singer = require('cylibs/trust/roles/singer')
local Sleeper = require('cylibs/trust/roles/sleeper')

state.AutoSongMode = M{['description'] = 'Auto Song Mode', 'Off', 'Auto', 'Dummy'}
state.AutoSongMode = M{['description'] = 'Sing Songs', 'Off', 'Auto', 'Dummy'}
state.AutoSongMode:set_description('Auto', "Okay, I'll keep songs on the party.")
state.AutoSongMode:set_description('Dummy', "Okay, I'll only sing dummy songs.")

state.AutoPianissimoMode = M{['description'] = 'Auto Pianissimo Mode', 'Merged', 'Override'}
state.AutoPianissimoMode = M{['description'] = 'Pianissimo Type', 'Merged', 'Override'}
state.AutoPianissimoMode:set_description('Merged', "Okay, I'll make sure to keep all songs on everyone.")
state.AutoPianissimoMode:set_description('Override', "Okay, I'll only focus on Pianissimo songs.")

state.AutoNitroMode = M{['description'] = 'Auto Nitro Mode', 'Auto', 'Off'}
state.AutoNitroMode = M{['description'] = 'Use Nitro', 'Auto', 'Off'}
state.AutoNitroMode:set_description('Auto', "Okay, I'll use Nightingale and Troubadour before singing songs.")

state.AutoClarionCallMode = M{['description'] = 'Auto Clarion Call Mode', 'Off', 'Auto'}
state.AutoClarionCallMode = M{['description'] = 'Use Clarion Call', 'Off', 'Auto'}
state.AutoClarionCallMode:set_description('Auto', "Okay, I'll use Clarion Call before Nightingale and Troubadour.")

function BardTrust.new(settings, action_queue, battle_settings, trust_settings)
Expand Down
17 changes: 12 additions & 5 deletions cylibs/trust/data/PUP.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,17 @@ Automaton = require('cylibs/entity/automaton')
local Dispeler = require('cylibs/trust/roles/dispeler')
local Buffer = require('cylibs/trust/roles/buffer')

state.AutoAssaultMode = M{['description'] = 'Auto Assault Mode', 'Off', 'Auto'}
state.AutoManeuverMode = M{['description'] = 'Auto Maneuver Mode', 'Off', 'Auto'}
state.AutoPetMode = M{['description'] = 'Auto Pet Mode', 'Off', 'Auto'}
state.AutoRepairMode = M{['description'] = 'Auto Repair Mode', 'Auto', 'Off'}
state.AutoAssaultMode = M{['description'] = 'Deploy Pet in Battle', 'Off', 'Auto'}
state.AutoAssaultMode:set_description('Auto', "Okay, my pet will fight with me!")

state.AutoManeuverMode = M{['description'] = 'Use Maneuvers', 'Off', 'Auto'}
state.AutoManeuverMode:set_description('Auto', "Okay, I'll automatically use maneuvers.")

state.AutoPetMode = M{['description'] = 'Call Pet', 'Off', 'Auto'}
state.AutoPetMode:set_description('Auto', "Okay, I'll automatically call a pet.")

state.AutoRepairMode = M{['description'] = 'Use Repair', 'Auto', 'Off'}
state.AutoRepairMode:set_description('Auto', "Okay, I'll use repair when my automaton's HP is low.")

function PuppetmasterTrust.new(settings, action_queue, battle_settings, trust_settings)
local roles = S{
Expand All @@ -40,7 +47,7 @@ function PuppetmasterTrust.new(settings, action_queue, battle_settings, trust_se
local mode_names = T(T(trust_settings.AutomatonSettings.ManeuverSettings.Default):keyset()):map(function(m)
return m
end)
state.ManeuverMode = M{['description'] = 'Maneuver Mode', mode_names}
state.ManeuverMode = M{['description'] = 'Maneuver Set', mode_names}
for mode_name in mode_names:it() do
state.ManeuverMode:set_description(mode_name, 'Maneuver set for '..mode_name..' pet type.')
end
Expand Down
7 changes: 6 additions & 1 deletion cylibs/trust/roles/buffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ function Buffer:conditions_check(spell, target)
return true
end

function Buffer:job_names_check(spell, party_member)
local job_names = spell:get_job_names() or L{}
return job_names:length() == 0 or spell:get_job_names():contains(party_member:get_main_job_short())
end

function Buffer:check_buffs()
local player_buff_ids = L(windower.ffxi.get_player().buffs)

Expand Down Expand Up @@ -144,7 +149,7 @@ function Buffer:check_buffs()
local buff = buff_util.buff_for_spell(spell:get_spell().id)
if buff and not (party_member:has_buff(buff.id) or (party_member:is_trust() and self.buff_tracker:has_buff(party_member:get_mob().id, buff.id)))
and not (buff_util.conflicts_with_buffs(buff.id, party_member:get_buff_ids()))
and spell:get_job_names():contains(party_member:get_main_job_short()) and spell_util.can_cast_spell(spell:get_spell().id) then
and self:job_names_check(spell, party_member) and spell_util.can_cast_spell(spell:get_spell().id) then
local target = party_member:get_mob()
if target and self:conditions_check(spell, target) then
if self:cast_spell(spell, target.index) then
Expand Down
4 changes: 2 additions & 2 deletions cylibs/trust/roles/debuffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ local Debuffer = setmetatable({}, {__index = Role })
Debuffer.__index = Debuffer
Debuffer.__class = "Debuffer"

state.AutoDebuffMode = M{['description'] = 'Auto Debuff Mode', 'Off', 'Auto'}
state.AutoDebuffMode = M{['description'] = 'Debuff Enemies', 'Off', 'Auto'}
state.AutoDebuffMode:set_description('Auto', "Okay, I'll debuff the monster.")

state.AutoSilenceMode = M{['description'] = 'Auto Silence Mode', 'Off', 'Auto'}
state.AutoSilenceMode = M{['description'] = 'Silence Casters', 'Off', 'Auto'}
state.AutoSilenceMode:set_description('Auto', "Okay, I'll try to silence monsters that cast spells.")

function Debuffer.new(action_queue, debuff_spells)
Expand Down
2 changes: 1 addition & 1 deletion cylibs/trust/roles/follower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ local SequenceAction = require('cylibs/actions/sequence')
local WaitAction = require('cylibs/actions/wait')
local zone_util = require('cylibs/util/zone_util')

state.AutoFollowMode = M{['description'] = 'Auto Follow Mode', 'Off', 'Always'}
state.AutoFollowMode = M{['description'] = 'Follow', 'Off', 'Always'}
state.AutoFollowMode:set_description('Off', "Okay, I'll no longer follow anyone.")
state.AutoFollowMode:set_description('Always', "Okay, I'll follow when not in battle.")

Expand Down
2 changes: 1 addition & 1 deletion cylibs/trust/roles/gambiter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local Gambiter = setmetatable({}, {__index = Role })
Gambiter.__index = Gambiter
Gambiter.__class = "Gambiter"

state.AutoGambitMode = M{['description'] = 'Auto Gambit Mode', 'Auto', 'Off'}
state.AutoGambitMode = M{['description'] = 'Use Gambits', 'Auto', 'Off'}
state.AutoGambitMode:set_description('Off', "Okay, I'll ignore any gambits you've set.")
state.AutoGambitMode:set_description('Auto', "Okay, I'll customize my battle plan with gambits.")

Expand Down
2 changes: 1 addition & 1 deletion cylibs/trust/roles/healer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local Healer = setmetatable({}, {__index = Role })
Healer.__index = Healer
Healer.__class = "Healer"

state.AutoHealMode = M{['description'] = 'Auto Heal Mode', 'Auto', 'Emergency', 'Off'}
state.AutoHealMode = M{['description'] = 'Heal Player and Party', 'Auto', 'Emergency', 'Off'}
state.AutoHealMode:set_description('Auto', "You can count on me to heal the party.")
state.AutoHealMode:set_description('Emergency', "Okay, I'll only heal when you're in a pinch.")

Expand Down
4 changes: 2 additions & 2 deletions cylibs/trust/roles/magic_burster.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local Renderer = require('cylibs/ui/views/render')
local skillchain_util = require('cylibs/util/skillchain_util')
local spell_util = require('cylibs/util/spell_util')

state.AutoMagicBurstMode = M{['description'] = 'Auto Magic Burst Mode', 'Off', 'Auto', 'Earth', 'Lightning', 'Water', 'Fire', 'Ice', 'Wind', 'Light', 'Dark'}
state.AutoMagicBurstMode = M{['description'] = 'Magic Burst', '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.")
Expand All @@ -21,7 +21,7 @@ state.AutoMagicBurstMode:set_description('Wind', "Okay, I'll only magic burst wi
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.MagicBurstTargetMode = M{['description'] = 'Magic Burst Target Mode', 'Single', 'All'}
state.MagicBurstTargetMode = M{['description'] = 'Magic Burst Target Type', 'Single', 'All'}
state.MagicBurstTargetMode:set_description('Single', "Okay, I'll only magic burst with single target spells.")
state.MagicBurstTargetMode:set_description('All', "Okay, I'll magic burst with both single target and AOE spells.")

Expand Down
2 changes: 1 addition & 1 deletion cylibs/trust/roles/nuker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local DisposeBag = require('cylibs/events/dispose_bag')
local skillchain_util = require('cylibs/util/skillchain_util')
local spell_util = require('cylibs/util/spell_util')

state.AutoNukeMode = M{['description'] = 'Auto Nuke Mode', 'Off', 'Earth', 'Lightning', 'Water', 'Fire', 'Ice', 'Wind', 'Light', 'Dark', 'Cleave'}
state.AutoNukeMode = M{['description'] = 'Free Nuke', 'Off', 'Earth', 'Lightning', 'Water', 'Fire', 'Ice', 'Wind', 'Light', 'Dark', 'Cleave'}
state.AutoNukeMode:set_description('Earth', "Okay, I'll free nuke with earth spells.")
state.AutoNukeMode:set_description('Lightning', "Okay, I'll free nuke with lightning spells.")
state.AutoNukeMode:set_description('Water', "Okay, I'll free nuke with water spells.")
Expand Down
35 changes: 33 additions & 2 deletions cylibs/trust/roles/puller.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@ local Approach = require('cylibs/battle/approach')
local ClaimedCondition = require('cylibs/conditions/claimed')
local DisposeBag = require('cylibs/events/dispose_bag')
local ffxi_util = require('cylibs/util/ffxi_util')
local RunToLocationAction = require('cylibs/actions/runtolocation')
local SwitchTargetAction = require('cylibs/actions/switch_target')

local Puller = setmetatable({}, {__index = Role })
Puller.__index = Puller
Puller.__class = "Puller"

state.AutoPullMode = M{['description'] = 'Auto Pull Mode', 'Off', 'Auto','Party','All'}
state.AutoPullMode = M{['description'] = 'Pull Monsters to Fight', 'Off', 'Auto','Party','All'}
state.AutoPullMode:set_description('Off', "Okay, I won't pull monsters for the party.")
state.AutoPullMode:set_description('Auto', "Okay, I'll automatically pull monsters for the party.")
state.AutoPullMode:set_description('Party', "Okay, I'll pull monsters the party is fighting.")
state.AutoPullMode:set_description('All', "Okay, I'll pull any monster that's nearby.")

state.ApproachPullMode = M{['description'] = 'Approach Pull Mode', 'Off', 'Auto'}
state.AutoCampMode = M{['description'] = 'Return to Camp after Battle', 'Off', 'Auto'}
state.AutoCampMode:set_description('Off', "Okay, I won't return to camp after battle.")
state.AutoCampMode:set_description('Auto', "Okay, I'll return to camp after battle (set camp with // trust pull camp).")

state.ApproachPullMode = M{['description'] = 'Force Pull with Approach', 'Off', 'Auto'}
state.ApproachPullMode:set_description('Auto', "Okay, I'll pull by engaging and approaching instead.")


Expand Down Expand Up @@ -65,10 +70,28 @@ function Puller:on_add()
self.dispose_bag:add(WindowerEvents.MobKO:addAction(function(mob_id, mob_name)
if self:get_pull_target() and self:get_pull_target():get_id() == mob_id then
self:set_pull_target(nil)
self:return_to_camp()
end
end), WindowerEvents.MobKO)
end

function Puller:return_to_camp()
if state.AutoCampMode.value == 'Off' or self:get_camp_position() == nil then
return
end

if ffxi_util.distance(ffxi_util.get_mob_position(windower.ffxi.get_player().name), self:get_camp_position()) > 40 then
self:set_camp_position(nil)
self:get_party():add_to_chat(self:get_party():get_player(), "I'm too far from camp to go back now.")
return
end

local return_to_camp_action = RunToLocationAction.new(self:get_camp_position()[1], self:get_camp_position()[2], self:get_camp_position()[3], 2.0)
return_to_camp_action.identifier = "Return to camp"

self.action_queue:push_action(return_to_camp_action, true)
end

function Puller:target_change(target_index)
Role.target_change(self, target_index)

Expand Down Expand Up @@ -253,6 +276,14 @@ function Puller:get_target_names()
return self.target_names
end

function Puller:set_camp_position(position)
self.camp_position = position
end

function Puller:get_camp_position()
return self.camp_position
end

function Puller:allows_duplicates()
return false
end
Expand Down
Loading

0 comments on commit 5798757

Please sign in to comment.