Skip to content

Commit

Permalink
Overhaul of settings system
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Jan 15, 2024
1 parent 59c1f9a commit c644784
Show file tree
Hide file tree
Showing 18 changed files with 180 additions and 177 deletions.
4 changes: 2 additions & 2 deletions class_configs/ber_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ return {
name = "Phantom",
type = "Disc",
cond = function(self, discSpell)
return RGMercUtils.PCDiscReady(discSpell) and RGMercConfig:GetSettings().DoPet
return RGMercUtils.PCDiscReady(discSpell) and RGMercUtils.GetSetting('DoPet')
end,
},
{
Expand Down Expand Up @@ -664,7 +664,7 @@ return {
name = "Alliance",
type = "Spell",
cond = function(self, spell)
return RGMercConfig:GetSettings().DoAlliance and RGMercUtils.CanAlliance() and not RGMercUtils.TargetHasBuff(spell)
return RGMercUtils.GetSetting('DoAlliance') and RGMercUtils.CanAlliance() and not RGMercUtils.TargetHasBuff(spell)
end,
},
{
Expand Down
4 changes: 2 additions & 2 deletions class_configs/bst_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ return {
name = 'LightHealPoint',
state = 1,
steps = 1,
cond = function(self, target) return (target.PctHPs() or 999) < RGMercConfig:GetSettings().LightHealPoint end,
cond = function(self, target) return (target.PctHPs() or 999) < RGMercUtils.GetSetting('LightHealPoint') end,
},
},
['HealRotations'] = {
Expand Down Expand Up @@ -1104,7 +1104,7 @@ return {
cond = function(self, aaName, target)
local slowProc = self.ResolvedActionMap['PetSlowProc']
return RGMercUtils.GetSetting('DoSnare') and (slowProc() and mq.TLO.Me.PetBuff(slowProc.RankName()) == nil) and
mq.TLO.Me.PetBuff(mq.TLO.Me.AltAbility(aaName).Spell.RankName())() == nil
mq.TLO.Me.PetBuff(mq.TLO.Me.AltAbility(aaName).Spell.RankName.Name())() == nil
end,
},
{
Expand Down
32 changes: 16 additions & 16 deletions class_configs/clr_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ local _ClassConfig = {
['HelperFunctions'] = {
-- helper function for advanced logic to see if we want to use Dark Lord's Unity
DoRez = function(self, corpseId)
if RGMercConfig:GetSettings().DoBattleRez or RGMercUtils.DoBuffCheck() then
if RGMercUtils.GetSetting('DoBattleRez') or RGMercUtils.DoBuffCheck() then
RGMercUtils.SetTarget(corpseId)

local target = mq.TLO.Target
Expand Down Expand Up @@ -685,19 +685,19 @@ local _ClassConfig = {
name = 'BigHealPoint',
state = 1,
steps = 1,
cond = function(self, target) return (target.PctHPs() or 999) < RGMercConfig:GetSettings().BigHealPoint end,
cond = function(self, target) return (target.PctHPs() or 999) < RGMercUtils.GetSetting('BigHealPoint') end,
},
{
name = 'GroupHealPoint',
state = 1,
steps = 1,
cond = function(self, target) return mq.TLO.Group.Injured(RGMercConfig:GetSettings().GroupHealPoint)() > RGMercConfig:GetSettings().GroupInjureCnt end,
cond = function(self, target) return mq.TLO.Group.Injured(RGMercUtils.GetSetting('GroupHealPoint'))() > RGMercUtils.GetSetting('GroupInjureCnt') end,
},
{
name = 'MainHealPoint',
state = 1,
steps = 1,
cond = function(self, target) return (target.PctHPs() or 999) < RGMercConfig:GetSettings().MainHealPoint end,
cond = function(self, target) return (target.PctHPs() or 999) < RGMercUtils.GetSetting('MainHealPoint') end,
},
}, -- end HealRotationOrder
['HealRotations'] = {
Expand All @@ -717,24 +717,24 @@ local _ClassConfig = {
name = "Celestial Regeneration",
type = "AA",
cond = function(self, spell)
return RGMercUtils.GetMainAssistPctHPs() <= RGMercConfig:GetSettings().GroupHealPoint and RGMercUtils.GetSetting('DoHOT') and spell.StacksTarget() and
not RGMercUtils.TargetHasBuff(spell) and mq.TLO.Group.Injured(RGMercConfig:GetSettings().GroupHealPoint)() > RGMercConfig:GetSettings().GroupInjureCnt
return RGMercUtils.GetMainAssistPctHPs() <= RGMercUtils.GetSetting('GroupHealPoint') and RGMercUtils.GetSetting('DoHOT') and spell.StacksTarget() and
not RGMercUtils.TargetHasBuff(spell) and mq.TLO.Group.Injured(RGMercUtils.GetSetting('GroupHealPoint'))() > RGMercUtils.GetSetting('GroupInjureCnt')
end,
},
{
name = "Exquisite Benediction",
type = "AA",
cond = function(self, aaName) -- note: Is aaName the correct arg here? or should be 'spell'?
return RGMercUtils.GetMainAssistPctHPs() <= RGMercConfig:GetSettings().GroupHealPoint and RGMercUtils.GetSetting('DoHOT') and aaName.StacksTarget() and
not RGMercUtils.TargetHasBuff(aaName) and mq.TLO.Group.Injured(RGMercConfig:GetSettings().GroupHealPoint)() > RGMercConfig:GetSettings().GroupInjureCnt
return RGMercUtils.GetMainAssistPctHPs() <= RGMercUtils.GetSetting('GroupHealPoint') and RGMercUtils.GetSetting('DoHOT') and aaName.StacksTarget() and
not RGMercUtils.TargetHasBuff(aaName) and mq.TLO.Group.Injured(RGMercUtils.GetSetting('GroupHealPoint'))() > RGMercUtils.GetSetting('GroupInjureCnt')
end,
},
{
name = "groupheal",
type = "spell",
cond = function(self, spell)
return RGMercUtils.GetMainAssistPctHPs() <= RGMercConfig:GetSettings().GroupHealPoint and RGMercUtils.GetSetting('DoHOT') and spell.StacksTarget() and
not RGMercUtils.TargetHasBuff(spell) and mq.TLO.Group.Injured(RGMercConfig:GetSettings().GroupHealPoint)() > RGMercConfig:GetSettings().GroupInjureCnt
return RGMercUtils.GetMainAssistPctHPs() <= RGMercUtils.GetSetting('GroupHealPoint') and RGMercUtils.GetSetting('DoHOT') and spell.StacksTarget() and
not RGMercUtils.TargetHasBuff(spell) and mq.TLO.Group.Injured(RGMercUtils.GetSetting('GroupHealPoint'))() > RGMercUtils.GetSetting('GroupInjureCnt')
end,
},
{
Expand All @@ -761,8 +761,8 @@ local _ClassConfig = {
name = "wardspell",
type = "spell",
cond = function(self, spell)
return RGMercUtils.GetMainAssistPctHPs() <= RGMercConfig:GetSettings().GroupHealPoint and RGMercUtils.GetSetting('DoHOT') and spell.StacksTarget() and
not RGMercUtils.TargetHasBuff(spell) and mq.TLO.Group.Injured(RGMercConfig:GetSettings().GroupHealPoint)() > RGMercConfig:GetSettings().GroupInjureCnt
return RGMercUtils.GetMainAssistPctHPs() <= RGMercUtils.GetSetting('GroupHealPoint') and RGMercUtils.GetSetting('DoHOT') and spell.StacksTarget() and
not RGMercUtils.TargetHasBuff(spell) and mq.TLO.Group.Injured(RGMercUtils.GetSetting('GroupHealPoint'))() > RGMercUtils.GetSetting('GroupInjureCnt')
end,
},
},
Expand Down Expand Up @@ -845,7 +845,7 @@ local _ClassConfig = {
name = "Focused Celestial Regeneration",
type = "AA",
cond = function(self, aaName, target)
return RGMercUtils.AAReady(aaName) and (RGMercUtils.GetTargetDistance() < RGMercConfig:GetSettings().AssistRange)
return RGMercUtils.AAReady(aaName) and (RGMercUtils.GetTargetDistance() < RGMercUtils.GetSetting('AssistRange'))
end,
},
{
Expand Down Expand Up @@ -971,21 +971,21 @@ local _ClassConfig = {
name = "Spire of the Vicar",
type = "AA",
cond = function(self, aaName)
return RGMercUtils.AAReady(aaName) and RGMercConfig:GetSettings().DoMelee and mq.TLO.Me.Combat()
return RGMercUtils.AAReady(aaName) and RGMercUtils.GetSetting('DoMelee') and mq.TLO.Me.Combat()
end,
},
{
name = "Divine Avatar",
type = "AA",
cond = function(self, aaName)
return RGMercUtils.AAReady(aaName) and RGMercConfig:GetSettings().DoMelee and mq.TLO.Me.Combat()
return RGMercUtils.AAReady(aaName) and RGMercUtils.GetSetting('DoMelee') and mq.TLO.Me.Combat()
end,
},
{
name = "Divine Retribution",
type = "AA",
cond = function(self, aaName)
return RGMercUtils.AAReady(aaName) and RGMercConfig:GetSettings().DoMelee and mq.TLO.Me.Combat()
return RGMercUtils.AAReady(aaName) and RGMercUtils.GetSetting('DoMelee') and mq.TLO.Me.Combat()
end,
},
},
Expand Down
8 changes: 4 additions & 4 deletions class_configs/enc_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1204,14 +1204,14 @@ local _ClassConfig = {
name = "NukeSpell1",
type = "Spell",
cond = function(self, spell)
return mq.TLO.Me.PctMana() >= RGMercConfig:GetSettings().ManaToNuke
return mq.TLO.Me.PctMana() >= RGMercUtils.GetSetting('ManaToNuke')
end,
},
{
name = "NukeSpell2",
type = "Spell",
cond = function(self, spell)
return mq.TLO.Me.PctMana() >= RGMercConfig:GetSettings().ManaToNuke
return mq.TLO.Me.PctMana() >= RGMercUtils.GetSetting('ManaToNuke')
end,
},
{
Expand Down Expand Up @@ -1296,7 +1296,7 @@ local _ClassConfig = {
cond = function(self, aaName)
if mq.TLO.Target.ID() <= 0 then return false end
return RGMercUtils.GetSetting('DoSlow') and RGMercUtils.DetAACheck(mq.TLO.Me.AltAbility(aaName).ID()) and RGMercUtils.GetXTHaterCount() > 2 and
mq.TLO.Target.Slowed() == nil
mq.TLO.Target.Slowed() == nil
end,
},
{
Expand Down Expand Up @@ -1424,7 +1424,7 @@ local _ClassConfig = {
gem = 13,
cond = function(self, gem) return mq.TLO.Me.NumGems() >= gem end,
spells = {
{ name = "AllianceSpell", cond = function(self) return RGMercConfig:GetSettings().DoAlliance end, },
{ name = "AllianceSpell", cond = function(self) return RGMercUtils.GetSetting('DoAlliance') end, },
{ name = "ManaDrainSpell", cond = function(self) return true end, },
},
},
Expand Down
12 changes: 6 additions & 6 deletions class_configs/mag_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ _ClassConfig = {
end,
cond = function(self)
if self.TempSettings.PocketPet == nil then self.TempSettings.PocketPet = false end
return mq.TLO.Me.Pet.ID() == 0 and RGMercConfig:GetSettings().DoPet and (self.TempSettings.PocketPet or RGMercUtils.GetXTHaterCount() == 0)
return mq.TLO.Me.Pet.ID() == 0 and RGMercUtils.GetSetting('DoPet') and (self.TempSettings.PocketPet or RGMercUtils.GetXTHaterCount() == 0)
end,
custom_func = function(self) return self.ClassConfig.HelperFunctions.summon_pet(self) end,
},
Expand Down Expand Up @@ -1275,7 +1275,7 @@ _ClassConfig = {
type = "Item",
active_cond = function(self)
local item = mq.TLO.Me.Inventory("Chest")
return item() and mq.TLO.Me.Song(item.Spell.RankName())() ~= nil
return item() and mq.TLO.Me.Song(item.Spell.RankName.Name())() ~= nil
end,
cond = function(self)
local item = mq.TLO.Me.Inventory("Chest")
Expand All @@ -1287,7 +1287,7 @@ _ClassConfig = {
type = "Spell",
cond = function(self, spell)
return RGMercUtils.IsNamed(mq.TLO.Target) and not RGMercUtils.TargetHasBuffByName(self.ResolvedActionMap['AllianceBuff']) and
RGMercConfig:GetSettings().DoAlliance and RGMercUtils.CanAlliance()
RGMercUtils.GetSetting('DoAlliance') and RGMercUtils.CanAlliance()
end,
},
{
Expand Down Expand Up @@ -1550,7 +1550,7 @@ _ClassConfig = {
type = "Spell",
cond = function(self, spell)
return RGMercUtils.IsNamed(mq.TLO.Target) and not RGMercUtils.TargetHasBuffByName(spell.RankName()) and
RGMercConfig:GetSettings().DoAlliance and RGMercUtils.CanAlliance()
RGMercUtils.GetSetting('DoAlliance') and RGMercUtils.CanAlliance()
end,
},

Expand Down Expand Up @@ -2057,14 +2057,14 @@ _ClassConfig = {
{
name = "AllianceBuff",
cond = function(self)
return RGMercConfig:GetSettings().DoAlliance and mq.TLO.Me.Level() >= 75 and
return RGMercUtils.GetSetting('DoAlliance') and mq.TLO.Me.Level() >= 75 and
((mq.TLO.Me.AltAbility("Malaise").ID() or 0) > 0 or not RGMercUtils.GetSetting('DoMalo'))
end,
},
{
name = "FireOrbSummon",
cond = function(self)
return not RGMercConfig:GetSettings().DoAlliance and mq.TLO.Me.Level() >= 75 and
return not RGMercUtils.GetSetting('DoAlliance') and mq.TLO.Me.Level() >= 75 and
((mq.TLO.Me.AltAbility("Malaise").ID() or 0) > 0 or not RGMercUtils.GetSetting('DoMalo'))
end,
},
Expand Down
2 changes: 1 addition & 1 deletion class_configs/mnk_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ local _ClassConfig = {
name = "Alliance",
type = "Disc",
cond = function(self, aaName)
return RGMercConfig:GetSettings().DoAlliance and RGMercUtils.CanAlliance() and not RGMercUtils.TargetHasBuffByName("Firewalker's Covenant Trigger") and
return RGMercUtils.GetSetting('DoAlliance') and RGMercUtils.CanAlliance() and not RGMercUtils.TargetHasBuffByName("Firewalker's Covenant Trigger") and
not RGMercUtils.TargetHasBuffByName("Doomwalker's Alliance Trigger")
end,
},
Expand Down
12 changes: 6 additions & 6 deletions class_configs/rog_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ return {
type = "Item",
active_cond = function(self)
local item = mq.TLO.Me.Inventory("Chest")
return item() and mq.TLO.Me.Song(item.Spell.RankName())() ~= nil
return item() and mq.TLO.Me.Song(item.Spell.RankName.Name())() ~= nil
end,
cond = function(self)
local item = mq.TLO.Me.Inventory("Chest")
Expand All @@ -296,35 +296,35 @@ return {
name = "Frenzied",
type = "Disc",
cond = function(self, discSpell)
return (RGMercConfig:GetSettings().BurnAuto or RGMercUtils:BigBurn()) and not mq.TLO.Me.ActiveDisc.ID() and mq.TLO.Me.CombatAbilityReady(discSpell)
return (RGMercUtils.GetSetting('BurnAuto') or RGMercUtils:BigBurn()) and not mq.TLO.Me.ActiveDisc.ID() and mq.TLO.Me.CombatAbilityReady(discSpell)
end,
},
{
name = "Twisted",
type = "Disc",
cond = function(self, discSpell)
return (RGMercConfig:GetSettings().BurnAuto or RGMercUtils:BigBurn()) and not mq.TLO.Me.ActiveDisc.ID() and mq.TLO.Me.CombatAbilityReady(discSpell)
return (RGMercUtils.GetSetting('BurnAuto') or RGMercUtils:BigBurn()) and not mq.TLO.Me.ActiveDisc.ID() and mq.TLO.Me.CombatAbilityReady(discSpell)
end,
},
{
name = "AimDisc",
type = "Disc",
cond = function(self, discSpell)
return (RGMercConfig:GetSettings().BurnAuto or RGMercUtils:BigBurn()) and not mq.TLO.Me.ActiveDisc.ID()
return (RGMercUtils.GetSetting('BurnAuto') or RGMercUtils:BigBurn()) and not mq.TLO.Me.ActiveDisc.ID()
end,
},
{
name = "Executioner",
type = "Disc",
cond = function(self, discSpell)
return (RGMercConfig:GetSettings().BurnAuto or RGMercUtils:BigBurn()) and not mq.TLO.Me.ActiveDisc.ID()
return (RGMercUtils.GetSetting('BurnAuto') or RGMercUtils:BigBurn()) and not mq.TLO.Me.ActiveDisc.ID()
end,
},
{
name = "Executioner2",
type = "Disc",
cond = function(self, discSpell)
return (RGMercConfig:GetSettings().BurnAuto or RGMercUtils:BigBurn()) and not mq.TLO.Me.ActiveDisc.ID()
return (RGMercUtils.GetSetting('BurnAuto') or RGMercUtils:BigBurn()) and not mq.TLO.Me.ActiveDisc.ID()
end,
},
{
Expand Down
6 changes: 3 additions & 3 deletions class_configs/shd_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ local _ClassConfig = {
tooltip = Tooltips.DLUA,
active_cond = function(self, aaName) return RGMercUtils.BuffActiveByID(mq.TLO.Me.AltAbility(aaName).Spell.Trigger(1).ID() or 0) end,
cond = function(self, aaName)
return self.ClassConfig.HelperFunctions.castDLU(self) and not RGMercUtils.BuffActiveByName(mq.TLO.Me.AltAbility(aaName).Spell.Trigger(1).RankName())
return self.ClassConfig.HelperFunctions.castDLU(self) and not RGMercUtils.BuffActiveByName(mq.TLO.Me.AltAbility(aaName).Spell.Trigger(1).RankName.Name())
end,
},
{
Expand Down Expand Up @@ -741,7 +741,7 @@ local _ClassConfig = {
active_cond = function(self, spell) return mq.TLO.Me.Pet.ID() > 0 end,
cond = function(
self, spell)
return mq.TLO.Me.Pet.ID() == 0 and RGMercConfig:GetSettings().DoPet and RGMercUtils.ReagentCheck(spell)
return mq.TLO.Me.Pet.ID() == 0 and RGMercUtils.GetSetting('DoPet') and RGMercUtils.ReagentCheck(spell)
end,
},
{
Expand Down Expand Up @@ -784,7 +784,7 @@ local _ClassConfig = {
type = "AA",
tooltip = Tooltips.HarmTouch,
cond = function(self, _)
return (RGMercConfig:GetSettings().BurnAuto and RGMercUtils.IsNamed(mq.TLO.Target)) or
return (RGMercUtils.GetSetting('BurnAuto') and RGMercUtils.IsNamed(mq.TLO.Target)) or
RGMercUtils.BigBurn()
end,
},
Expand Down

0 comments on commit c644784

Please sign in to comment.