Skip to content

Commit

Permalink
v10.3.0 (#161)
Browse files Browse the repository at this point in the history
* PR feedback

* Automatically clearing assist target when setting AutoTargetMode to anything but Off

* Adding Nuker and MagicBurster roles to Paladin and updating default job settings file

* Disengaging when targeting self but engaged

* Adding friendly descriptions for config editors

* Adding GroupConfigItem and HasBuffsCondition editor

* Adding ZoneCondition to conditions editor

* Fixing text for Min/Max HPP condition editor

* Fixed issue where conditions weren't serializing for Buffs

* Adding Gambit base code

* Adding Gambits

* Popping to parent menu item when adding a gambit or condition to gambit

* Adding more buffs to HasBuffCondition and HasBuffsCondition

* Filtering AlterEgos out of Gambit action picker

* Adding more buffs to HasBuffsCondition and HasBuffCondition

* Adding Modes to Gambit menu

* Filtering out Approach and Ranged Attack for Self and Ally Gambit targets

* Adding NotCondition to Gambit conditions

* Adding MaxManaPointsPercentCondition and updating default Paladin job settings file with Gambits

* Adding ModeCondition

* Adding Sentinel to Paladin default job settings

* Fixing issue where Unbridled Learning Blue Magic spells show up in picker

* Reloading Blue Mage Trust buffs when spells change

* Adding check for sjobdata when Blue Mage is set to sub job

* Bumping Trust version to 9.6.0

* Adding Party support for MinMP and MinMPP conditions

* Adding Party member support for MinTP condition

* Fixing issue with duplicate buff names or ability names

* Adding ReadyAbilityCondition

* Cleanup

* Consolidating Gambit editor

* Updating MaxManaPointsPercentCondition to work with parties

* Fixing GambitSettingsEditor issues

* Fixing more Gambit bugs

* Fixing Gambit compatibility with WeaponSkills that have no skillchain property

* Tracking weapon skill debuffs for Full Break, Armor Break and Shell Crusher

* Face target after pull

* Adding Copy button to GambitSettingsMenuItem

* Checking monster debuffs in HasBuffCondition

* Changing text selection color of PickerCollectionViewCell

* Deselecting custom items in GambitSettingsEditor

* Fixing Copy Gambit

* Fixing issue with HasBuffsCondition

* Fixing Gambit copy and extending buff ids

* Fixing HasBuffsCondition

* Short circuiting Gambit checks on tic when one succeeds

* Fixing nil exception in Gambiter

* Adding MaxTacticalPointsCondition

* Fixing nil exception in CombatMode

* Adding HasDebuffCondition

* Adding Move Up and Move Down menu items to GambitSettingsMenuItem

* Fixing Copy Gambit

* Auto selecting newly created Gambit

* Adding TurnAround and TurnToFace

* Adding FinishAbilityCondition and TurnAround ability

* Sorting spells and abilities in gambit picker

* Adding fast cycle to config editor

* Disabling editing of gambits and conditions when list is empty

* Adding descriptions for conditions

* Adding friendly descriptions for conditions

* Capitalizing buff names

* Fixing more copy

* Adding HasRunesCondition

* Fixing copy

* Fixing issue with HasBuffCondition

* Adding operator to EnemiesNearbyCondition config editor

* Adding RunTo and RunAway Gambit actions

* Adding deep copy of Gambit conditions

* Fixing Move Up and Move Down to not reset GambitSettingsMenuItem

* Clean up

* Fixing MinTacticalPointsCondition

* Adding the ability to toggle Gambits on and off temporarily

* Adding ConfigItem dependencies to reload dependencies when another item changes

* Fixing nil exception in ConfigEditor

* Adding default Gambits for Sholar trust and TrustSettings migration

* Adding menu to view default job gambits

* Adding default Samurai trust Gambits

* Cleanup of Samurai

* Fixing nil exception

* Safe Rolling for COR (#139)

* Safe Rolling for COR

* Update cylibs/entity/jobs/COR.lua

* Fixing MaxTacticalPointsCondition

* Refactoring default Corsair trust behavior into Gambits

* Refactoring BattleStatTracker to use MeleeAccuracyCondition

* Cleanup

* Allowing both main job trust and sub job trust to have Gambiter role and moving Dark Knight trust drain logic to Gambits

* Updating default DRK trust settings

* Guarding for nil case in Gambiter

* Fixing regression in PickerView

* Adding PetHitPointsPercentageCondition and moving base Dragoon trust logic to Gambits

* Adding NumResistsCondition and refactoring base Puppetmaster Trust logic into Gambits

* Moving base Red Mage Trust behavior to Gambits

* 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

---------

Co-authored-by: furiex-ffxi <[email protected]>
  • Loading branch information
cyrite and furiex-ffxi committed Aug 8, 2024
1 parent e36803c commit 7b501bd
Show file tree
Hide file tree
Showing 30 changed files with 644 additions and 113 deletions.
1 change: 1 addition & 0 deletions Trust-Cylibs-Include.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ ReadyAbilityCondition = require('cylibs/conditions/ready_ability')
SkillchainPropertyCondition = require('cylibs/conditions/skillchain_property')
SpellRecastReadyCondition = require('cylibs/conditions/spell_recast_ready')
StrategemCountCondition = require('cylibs/conditions/strategem_count')
TargetNameCondition = require('cylibs/conditions/target_name')
ValidTargetCondition = require('cylibs/conditions/valid_target')
ZoneCondition = require('cylibs/conditions/zone')

Expand Down
55 changes: 22 additions & 33 deletions Trust.lua
Original file line number Diff line number Diff line change
@@ -1,40 +1,29 @@
_addon.author = 'Cyrite'
_addon.commands = {'Trust','trust'}
_addon.name = 'Trust'
_addon.version = '10.2.2'
_addon.version = '10.3.0'
_addon.release_notes = [[
This update introduces significant improvements to Bard and Dancer,
adds elemental resistances to the target widget, new conditions,
menu keyboard shortcuts and more!
• Bard
• Singing speed has been significantly improved (37s → 23s
for default nitro + pianissimo songs).
• Time spent singing on Alter Egos has been reduced.
• Dancer
• Added step tracking for Quick Step, Box Step and Stutter Step.
• Added ability to apply a specific level daze to an enemy
using Gambits (see "Has daze" condition).
• Target Widget
• Elemental resistances are now shown for select enemies.
• Visibility can be configured under Config > Widgets > Target
by toggling "Show Detailed View" and selecting "Save".
• Menu Shortcuts
• Keyboard shortcuts have been added to directly navigate to
the Modes (Shift + M), Skillchains (Shift + S) and
Gambits (Shift + G) menus.
• To enable keyboard shortcuts, select "Shortcuts" on the
respective menu, set "Keyboard Shortcut" to "On" and
select "Save".
This update introduces a new widget for Puppetmaster, improves
tanking logic for Rune Fencer, and simplifies the process of
recording and replaying paths.
• Puppetmaster
• Added widget to display HP, MP, TP and actions performed
by your Automaton.
• Added button on widget to open the Automaton settings
menu directly.
• Rune Fencer
• Added Gambits for Valiance, Vallation and Vivacious Pulse.
• UI
• Added path widget for recording and replaying paths.
• Bug Fixes
• Fixed issue where song editor would incorrectly override
the Default set.
• Fixed issue where `CombatMode` `Mirror` would not mirror
movements until the target was claimed.
• Fixed issue where self targeting weaponskills would sometimes
target enemies.
• Fixed issue where Bard and Corsair would not face the enemy
while singing and rolling.
• Press escape or enter to exit.
Expand Down Expand Up @@ -285,7 +274,7 @@ function load_trust_commands(job_name_short, trust, action_queue, party)
LoggingCommands.new(trust, action_queue),
PathCommands.new(trust, action_queue),
PullCommands.new(trust, action_queue),
ScenarioCommands.new(trust, action_queue, party),
ScenarioCommands.new(trust, action_queue, party, addon_settings),
SendAllCommands.new(trust, action_queue),
SendCommands.new(trust, action_queue),
SkillchainCommands.new(trust, weapon_skill_settings, action_queue),
Expand Down Expand Up @@ -416,7 +405,7 @@ function check_version()

local Frame = require('cylibs/ui/views/frame')

local updateView = TrustMessageView.new("Version ".._addon.version, "What's new", _addon.release_notes, "Click here for full release notes.", Frame.new(0, 0, 500, 625))
local updateView = TrustMessageView.new("Version ".._addon.version, "What's new", _addon.release_notes, "Click here for full release notes.", Frame.new(0, 0, 500, 600))

updateView:getDelegate():didSelectItemAtIndexPath():addAction(function(indexPath)
updateView:getDelegate():deselectItemAtIndexPath(indexPath)
Expand Down
14 changes: 12 additions & 2 deletions commands/ScenarioCommands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ local ScenarioTrustCommands = setmetatable({}, {__index = TrustCommands })
ScenarioTrustCommands.__index = ScenarioTrustCommands
ScenarioTrustCommands.__class = "ScenarioTrustCommands"

function ScenarioTrustCommands.new(trust, action_queue, party)
function ScenarioTrustCommands.new(trust, action_queue, party, addon_settings)
local self = setmetatable(TrustCommands.new(), ScenarioTrustCommands)

self.trust = trust
self.action_queue = action_queue
self.scenarios = TrustScenarios.new(action_queue, party, trust)
self.addon_settings = addon_settings
self.scenarios = TrustScenarios.new(action_queue, addon_settings, party, trust)

self:add_command('start', self.handle_start_scenario, 'Start a scenario')
self:add_command('restart', self.handle_restart_scenario, 'Restart a scenario')
self:add_command('stop', self.handle_stop_scenario, 'Stop an active scenario')

return self
Expand Down Expand Up @@ -43,6 +45,14 @@ function ScenarioTrustCommands:handle_start_scenario(_, scenario_name)
return success, message
end

-- // trust scenario restart scenario_name
function ScenarioTrustCommands:handle_restart_scenario(_, scenario_name)
local success, message = self:handle_stop_scenario(_, scenario_name)
success, message = self:handle_start_scenario(_, scenario_name)

return success, message
end

-- // trust scenario stop scenario_name
function ScenarioTrustCommands:handle_stop_scenario(_, scenario_name)
local success = true
Expand Down
4 changes: 4 additions & 0 deletions cylibs/actions/weapon_skill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ function WeaponSkillAction.new(weapon_skill_name, target_index)

self.weapon_skill_name = weapon_skill_name

if res.weapon_skills:with('en', weapon_skill_name).targets:contains('Self') then
target_index = windower.ffxi.get_player().index
end

if target_index ~= windower.ffxi.get_player().index then
self:add_condition(MaxDistanceCondition.new(battle_util.get_weapon_skill_distance(weapon_skill_name, target_index), target_index))
end
Expand Down
52 changes: 52 additions & 0 deletions cylibs/conditions/target_name.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---------------------------
-- Condition checking the target's name.
-- @class module
-- @name TargetNameCondition
local serializer_util = require('cylibs/util/serializer_util')
local TextInputConfigItem = require('ui/settings/editors/config/TextInputConfigItem')

local Condition = require('cylibs/conditions/condition')
local TargetNameCondition = setmetatable({}, { __index = Condition })
TargetNameCondition.__index = TargetNameCondition
TargetNameCondition.__class = "TargetNameCondition"
TargetNameCondition.__type = "TargetNameCondition"

function TargetNameCondition.new(name)
local self = setmetatable(Condition.new(), TargetNameCondition)
self.name = name or "Spiny Spipi"
return self
end

function TargetNameCondition:is_satisfied(target_index)
local target = windower.ffxi.get_mob_by_index(target_index)
if target and target.name == name then
return true
end
return false
end

function TargetNameCondition:get_config_items()
return L{ TextInputConfigItem.new('name', self.name, 'Target Name', function(_) return true end) }
end

function TargetNameCondition:tostring()
return "Target is "..self.name.."."
end

function TargetNameCondition.description()
return "Targeting a specific enemy."
end

function TargetNameCondition.valid_targets()
return S{ Condition.TargetType.Enemy }
end

function TargetNameCondition:serialize()
return "TargetNameCondition.new(" .. serializer_util.serialize_args(self.name) .. ")"
end

return TargetNameCondition




3 changes: 3 additions & 0 deletions cylibs/messages/ipc/ipc_relay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local Event = require('cylibs/events/Luvent')
local GainBuffMessage = require('cylibs/messages/gain_buff_message')
local IpcConnection = require('cylibs/messages/ipc/ipc_connection')
local IpcMessage = require('cylibs/messages/ipc_message')
local LampUpdateMessage = require('cylibs/messages/lamp_update_message')
local logger = require('cylibs/logger/logger')
local LoseBuffMessage = require('cylibs/messages/lose_buff_message')
local MobUpdateMessage = require('cylibs/messages/mob_update_message')
Expand Down Expand Up @@ -54,6 +55,8 @@ function IpcRelay.new()
self:on_message_received():trigger(CommandMessage.deserialize(message))
elseif message_type == 'equipment_changed' then
self:on_message_received():trigger(EquipmentChangedMessage.deserialize(message))
elseif message_type == 'lamp_update' then
self:on_message_received():trigger(LampUpdateMessage.deserialize(message))
end
end
end
Expand Down
50 changes: 50 additions & 0 deletions cylibs/messages/lamp_update_message.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
local IpcMessage = require('cylibs/messages/ipc_message')

local LampUpdateMessage = setmetatable({}, {__index = IpcMessage })
LampUpdateMessage.__index = LampUpdateMessage
LampUpdateMessage.__class = "LampUpdateMessage"

function LampUpdateMessage.new(lamp_index, lamp_id, order_id)
local self = setmetatable(IpcMessage.new(), LampUpdateMessage)

self.lamp_index = lamp_index
self.lamp_id = lamp_id
self.order_id = order_id

return self
end

function LampUpdateMessage:get_command()
return "lamp_update"
end

function LampUpdateMessage:get_lamp_index()
return self.lamp_index
end

function LampUpdateMessage:get_lamp_id()
return self.lamp_id
end

function LampUpdateMessage:get_order_id()
return self.order_id
end

function LampUpdateMessage:serialize()
return "%s %f %f %f":format(self:get_command(), self:get_lamp_index(), self:get_lamp_id(), self:get_order_id())
end

function LampUpdateMessage.deserialize(message)
local ipc_message = IpcMessage.new(message)

return LampUpdateMessage.new(tonumber(ipc_message:get_args()[2]), tonumber(ipc_message:get_args()[3]), tonumber(ipc_message:get_args()[4]))
end

function LampUpdateMessage:tostring()
return "LampUpdateMessage %s":format(self:get_message())
end

return LampUpdateMessage



20 changes: 20 additions & 0 deletions cylibs/paths/path_recorder.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local DisposeBag = require('cylibs/events/dispose_bag')
local Event = require('cylibs/events/Luvent')
local FileIO = require('files')
local Path = require('cylibs/paths/path')
local serializer_util = require('cylibs/util/serializer_util')
Expand All @@ -8,19 +9,34 @@ local PathRecorder = {}
PathRecorder.__index = PathRecorder
PathRecorder.__class = "PathRecorder"

-- Event called when path recording starts.
function PathRecorder:on_path_record_start()
return self.path_record_start
end

-- Event called when path recording stops
function PathRecorder:on_path_record_stop()
return self.path_record_stop
end

function PathRecorder.new(output_folder, mob_id)
local self = setmetatable({}, PathRecorder)

self.output_folder = output_folder
self.mob_id = mob_id or windower.ffxi.get_player().id
self.recording = false
self.actions = L{}
self.path_record_start = Event.newEvent()
self.path_record_stop = Event.newEvent()
self.dispose_bag = DisposeBag.new()

return self
end

function PathRecorder:destroy()
self.path_record_start:removeAllActions()
self.path_record_stop:removeAllActions()

self.dispose_bag:destroy()
end

Expand All @@ -34,6 +50,8 @@ function PathRecorder:start_recording()
end
self.recording = true

self:on_path_record_start():trigger(self)

self.dispose_bag:add(WindowerEvents.PositionChanged:addAction(function(mob_id, x, y, z)
if mob_id == self.mob_id then
self:add_point(x, y, z)
Expand All @@ -49,6 +67,8 @@ function PathRecorder:stop_recording(path_name, discard)
end
self.recording = false

self:on_path_record_stop():trigger(self, path_name, discard)

if discard then
self:clear()
return nil
Expand Down
1 change: 1 addition & 0 deletions cylibs/trust/data/PUP.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function PuppetmasterTrust.new(settings, action_queue, battle_settings, trust_se
self.action_queue = action_queue
self.maneuver_last_used = os.time()
self.economizer_last_used = os.time()
self.target_change_time = os.time()
self.dispose_bag = DisposeBag.new()

local mode_names = T(T(trust_settings.AutomatonSettings.ManeuverSettings.Default):keyset()):map(function(m)
Expand Down
1 change: 0 additions & 1 deletion cylibs/trust/data/modes/BRD.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ return {
["autoraisemode"]="Off",
["autobuffmode"]="Off",
["autodebuffmode"]="Off",
["autofacemobmode"]="Off",
["autosilencemode"]="Off",
["autopullmode"]="Off",
["autohealmode"]="Emergency",
Expand Down
1 change: 0 additions & 1 deletion cylibs/trust/data/modes/COR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ return {
["Rolling"]={
["autodispelmode"]="Off",
["autodebuffmode"]="Off",
["autofacemobmode"]="Off",
["autopullmode"]="Off",
["autobuffmode"]="Off",
["autoskillchainmode"]="Off",
Expand Down
Loading

0 comments on commit 7b501bd

Please sign in to comment.