Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Dec 31, 2023
1 parent 5a65d08 commit 7e22d6d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
13 changes: 6 additions & 7 deletions modules/shd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local shdClassConfig = require("rgmercs.class_configs.shd_class_config")

local Module = { _version = '0.1a', name = "ShadowKnight", author = 'Derple' }
Module.__index = Module
Module.Tanking = false
Module.LastPetCmd = 0
Module.SpellLoadOut = {}
Module.ResolvedActionMap = {}
Expand Down Expand Up @@ -85,7 +84,7 @@ end
function Module:setCombatMode(mode)
RGMercsLogger.log_debug("\aySettings Combat Mode to: \am%s", mode)
if mode == "Tank" then
Module.Tanking = true
RGMercConfig.Globals.IsTanking = true
if self.settings.TLP then
Module.ResolvedActionMap, Module.SpellLoadOut = RGMercUtils.SetLoadOut(self,
shdClassConfig.Rotations.TLP_Tank.Spells, shdClassConfig.ItemSets, shdClassConfig.AbilitySets)
Expand All @@ -95,7 +94,7 @@ function Module:setCombatMode(mode)
shdClassConfig.ItemSets, shdClassConfig.AbilitySets)
end
elseif mode == "DPS" then
Module.Tanking = false
RGMercConfig.Globals.IsTanking = false
if self.settings.TLP then
Module.ResolvedActionMap, Module.SpellLoadOut = RGMercUtils.SetLoadOut(self,
shdClassConfig.Rotations.TLP_DPS.Spells, shdClassConfig.ItemSets, shdClassConfig.AbilitySets)
Expand Down Expand Up @@ -177,19 +176,19 @@ function Module:GiveTime(combat_state)

-- Downtime totaiton will just run a full rotation to completion
if self.CombatState == "Downtime" then
if Module.Tanking and self.settings.TLP then
if RGMercConfig.Globals.IsTanking and self.settings.TLP then
RGMercUtils.RunRotation(self, shdClassConfig.Rotations.TLP_Tank.Rotation.Downtime, Module.ResolvedActionMap)
elseif not Module.Tanking and self.settings.TLP then
elseif not RGMercConfig.Globals.IsTanking and self.settings.TLP then
RGMercUtils.RunRotation(self, shdClassConfig.Rotations.TLP_DPS.Rotation.Downtime, Module.ResolvedActionMap)
elseif Module.Tanking then
elseif RGMercConfig.Globals.IsTanking then
RGMercUtils.RunRotation(self, shdClassConfig.Rotations.Tank.Rotation.Downtime, Module.ResolvedActionMap)
else
RGMercUtils.RunRotation(self, shdClassConfig.Rotations.DPS.Rotation.Downtime, Module.ResolvedActionMap)
end

if not self.settings.BurnAuto then self.settings.BurnSize = 0 end
else
if Module.Tanking and ((os.clock() - Module.LastPetCmd) > 2) then
if RGMercConfig.Globals.IsTanking and ((os.clock() - Module.LastPetCmd) > 2) then
Module.LastPetCmd = os.clock()
RGMercUtils.PetAttack(self.settings, mq.TLO.Target)
end
Expand Down
1 change: 1 addition & 0 deletions utils/rgmercs_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Config.Globals.PauseMain = false
Config.Globals.LastMove = nil
Config.Globals.BackOffFlag = false
Config.Globals.IsHealing = false
Config.Globals.IsTanking = false
Config.Globals.InMedState = false
Config.Globals.IsMezzing = false
Config.Globals.CurLoadedChar = mq.TLO.Me.CleanName()
Expand Down
6 changes: 3 additions & 3 deletions utils/rgmercs_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ function Utils.MATargetScan(radius, zradius)
-- Check for lack of aggro and make sure we get the ones we haven't aggro'd. We can't
-- get aggro data from the spawn data type.
if Utils.HaveExpansion("EXPANSION_LEVEL_ROF") then
if xtSpawn.PctAggro() < 100 and RGMercConfig:GetSettings().DoTanking then
if xtSpawn.PctAggro() < 100 and RGMercConfig.Globals.IsTanking then
-- Coarse check to determine if a mob is _not_ mezzed. No point in waking a mezzed mob if we don't need to.
if RGMercConfig.Constants.RGMezAnims:contains(xtSpawn.Animation()) then
RGMercsLogger.log_debug("Have not fully aggro'd %s -- returning %s [%d]", xtSpawn.CleanName(), xtSpawn.CleanName(), xtSpawn.ID())
Expand Down Expand Up @@ -870,7 +870,7 @@ function Utils.FindTargetCheck()
return (Utils.GetXTHaterCount() > 0 or Utils.IAmMA() or config.FollowMarkTarget) and not RGMercConfig.Globals.LastMove
end

function Utils.OkToEngage(autoTargetId, isTanking)
function Utils.OkToEngage(autoTargetId)
local config = RGMercConfig:GetSettings()

if not config.DoAutoEngage then return false end
Expand All @@ -892,7 +892,7 @@ function Utils.OkToEngage(autoTargetId, isTanking)
end

if Utils.GetXTHaterCount() > 0 then -- TODO: or KillTargetID and !BackOffFlag
if target.Distance() < config.AssistRange and (target.PctHPs() < config.AutoAssistAt or isTanking or assistId == mq.TLO.Me.ID()) then
if target.Distance() < config.AssistRange and (target.PctHPs() < config.AutoAssistAt or RGMercConfig.Globals.IsTanking or assistId == mq.TLO.Me.ID()) then
if not mq.TLO.Me.Combat() then
RGMercsLogger.log_debug("\ay%d < %d and %d < %d or Tanking or %d == %d --> \agOK To Engage!",
target.Distance(), config.AssistRange, target.PctHPs(), config.AutoAssistAt, assistId, mq.TLO.Me.ID())
Expand Down

0 comments on commit 7e22d6d

Please sign in to comment.