Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1491 from Taurenkey/ast
Browse files Browse the repository at this point in the history
Ast
  • Loading branch information
Taurenkey authored Jul 11, 2024
2 parents f61f16d + 72a68ff commit aa28fbf
Show file tree
Hide file tree
Showing 12 changed files with 220 additions and 170 deletions.
57 changes: 20 additions & 37 deletions XIVSlothCombo/Combos/CustomComboPreset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public enum CustomComboPreset

[ReplaceSkill(AST.Gravity, AST.Gravity2)]
[ParentCombo(AST_ST_DPS)]
[CustomComboInfo("AoE DPS Feature", "Every option below (Lucid/AutoDraws/Astrodyne/etc) will also be added to Gravity", AST.JobID, 1, "", "")]
[CustomComboInfo("AoE DPS Option", "Every option below (Lucid/AutoDraws/etc) will also be added to Gravity", AST.JobID, 1, "", "")]
AST_AoE_DPS = 1013,

[ParentCombo(AST_ST_DPS)]
Expand All @@ -202,33 +202,25 @@ public enum CustomComboPreset
AST_DPS_Divination = 1016,

[ParentCombo(AST_ST_DPS)]
[CustomComboInfo("Card Draw Weave Option", "Draws your card", AST.JobID, 5, "", "")]
[CustomComboInfo("Card Draw Weave Option", "Draws your cards", AST.JobID, 5, "", "")]
AST_DPS_AutoDraw = 1011,

[ParentCombo(AST_ST_DPS)]
[CustomComboInfo("Card Play Weave Option", "Weaves your card (best used with Quick Target Cards)", AST.JobID, 6)]
[CustomComboInfo("Card Play Weave Option", "Weaves your Balance or Arrow card (best used with Quick Target Cards)", AST.JobID, 6)]
AST_DPS_AutoPlay = 1037,

[ParentCombo(AST_ST_DPS)]
[CustomComboInfo("Redraw Option", "Weaves Redraw if you pull a card with a seal you already have and you can use Redraw.", AST.JobID, 7)]
AST_DPS_AutoPlay_Redraw = 1038,

[ParentCombo(AST_ST_DPS)]
[CustomComboInfo("Astrodyne Weave Option", "Adds Astrodyne when you have 3 seals", AST.JobID, 8, "", "")]
AST_DPS_Astrodyne = 1009,

[ParentCombo(AST_ST_DPS)]
[CustomComboInfo("Minor Arcana Weave Option", "Adds Minor Arcana", AST.JobID, 9, "", "")]
AST_DPS_AutoCrownDraw = 1012,

[ParentCombo(AST_ST_DPS)]
[CustomComboInfo("Lord of Crowns Weave Option", "Adds Lord Of Crowns", AST.JobID, 10, "", "")]
AST_DPS_LazyLord = 1014,

[ParentCombo(AST_ST_DPS)]
[CustomComboInfo("Oracle Option", "Adds Oracle after Divination", AST.JobID)]
AST_DPS_Oracle = 1015,
#endregion

#region Healing
[ReplaceSkill(AST.Benefic2)]
[CustomComboInfo("Simple Heals (Single Target)", "", AST.JobID, 2)]
[CustomComboInfo("Simple Heals (Single Target)", "Replaces Benefic II with a one button healing replacement.", AST.JobID, 2)]
AST_ST_SimpleHeals = 1023,

[ParentCombo(AST_ST_SimpleHeals)]
Expand All @@ -248,11 +240,19 @@ public enum CustomComboPreset
AST_ST_SimpleHeals_Esuna = 1039,

[ParentCombo(AST_ST_SimpleHeals)]
[CustomComboInfo("Exaltation Feature", "Adds Exaltation.", AST.JobID)]
[CustomComboInfo("Exaltation Option", "Adds Exaltation.", AST.JobID)]
AST_ST_SimpleHeals_Exaltation = 1028,

[ParentCombo(AST_ST_SimpleHeals)]
[CustomComboInfo("The Spire Option", "Adds The Spire when the card has been drawn", AST.JobID)]
AST_ST_SimpleHeals_Spire = 1030,

[ParentCombo(AST_ST_SimpleHeals)]
[CustomComboInfo("The Ewer Option", "Adds The Ewer when the card has been drawn", AST.JobID)]
AST_ST_SimpleHeals_Ewer = 1032,

[ReplaceSkill(AST.AspectedHelios)]
[CustomComboInfo("Aspected Helios Feature", "Replaces Aspected Helios whenever you are under Aspected Helios regen with Helios", AST.JobID, 3, "", "")]
[CustomComboInfo("Simple Heals (AoE)", "Replaces Aspected Helios with a one button healing replacement.", AST.JobID, 3, "", "")]
AST_AoE_SimpleHeals_AspectedHelios = 1010,

[ParentCombo(AST_AoE_SimpleHeals_AspectedHelios)]
Expand All @@ -270,6 +270,7 @@ public enum CustomComboPreset
[ReplaceSkill(AST.Benefic2)]
[CustomComboInfo("Benefic 2 Downgrade", "Changes Benefic 2 to Benefic when Benefic 2 is not unlocked or available.", AST.JobID, 4, "", "")]
AST_Benefic = 1002,

#endregion

#region Utility
Expand All @@ -291,25 +292,7 @@ public enum CustomComboPreset
#endregion

#region Cards
[ReplaceSkill(AST.Play)]
[CustomComboInfo("Draw on Play", "Play turns into Draw when no card is drawn, as well as the usual Play behavior.", AST.JobID, 6, "", "")]
AST_Cards_DrawOnPlay = 1000,

[ParentCombo(AST_Cards_DrawOnPlay)]
[CustomComboInfo("Redraw Feature", "Sets Play to Redraw if you pull a card with a seal you already have and you can use Redraw.", AST.JobID)]
AST_Cards_Redraw = 1032,

[ReplaceSkill(AST.Draw)]
[CustomComboInfo("Redraw on Draw", "Sets Draw to Redraw if you have the Clarifying Draw buff.", AST.JobID)]
AST_Cards_RedrawStandalone = 1040,

[ReplaceSkill(AST.Play)]
//Works With AST_Cards_DrawOnPlay as a feature, or by itself if AST_Cards_DrawOnPlay is disabled.
//Do not do ConflictingCombos with AST_Cards_DrawOnPlay
[CustomComboInfo("Astrodyne on Play", "Play becomes Astrodyne when you have 3 seals.", AST.JobID, 18, "", "")]
AST_Cards_AstrodyneOnPlay = 1015,

[CustomComboInfo("Quick Target Cards", "Grabs a suitable target from the party list when you draw a card and targets them for you.", AST.JobID)]
[CustomComboInfo("Quick Target Damage Cards", "When you play the Balance or Spear, this will automatically apply the buff to a party member. It will look at DPS that suit the card first, if none found or they have buffs already, will look at the other DPS instead.", AST.JobID)]
AST_Cards_QuickTargetCards = 1029,

[ParentCombo(AST_Cards_QuickTargetCards)]
Expand Down
44 changes: 25 additions & 19 deletions XIVSlothCombo/Combos/JobHelpers/AST.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Dalamud.Game.ClientState.JobGauge.Enums;
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Plugin.Services;
using ECommons.DalamudServices;
using System.Collections.Generic;
using System.Linq;
using XIVSlothCombo.CustomComboNS.Functions;
Expand Down Expand Up @@ -50,6 +51,7 @@ public static void Invoke()
if (SelectedRandomMember is null || SelectedRandomMember.IsDead)
{
SetTarget();
Svc.Log.Debug($"Set card to {SelectedRandomMember.Name}");
}
}
else
Expand All @@ -68,21 +70,16 @@ private static bool SetTarget()
if (GetPartySlot(i) is not IBattleChara member) continue;
if (member is null) continue; //Skip nulls/disconnected people
if (member.IsDead) continue;
if (OutOfRange(Bole, member)) continue;
if (OutOfRange(Balance, member)) continue;

if (FindEffectOnMember(Buffs.BalanceDamage, member) is not null) continue;
if (FindEffectOnMember(Buffs.ArrowDamage, member) is not null) continue;
if (FindEffectOnMember(Buffs.BoleDamage, member) is not null) continue;
if (FindEffectOnMember(Buffs.EwerDamage, member) is not null) continue;
if (FindEffectOnMember(Buffs.SpireDamage, member) is not null) continue;
if (FindEffectOnMember(Buffs.SpearDamage, member) is not null) continue;
if (FindEffectOnMember(Buffs.BalanceBuff, member) is not null) continue;
if (FindEffectOnMember(Buffs.SpearBuff, member) is not null) continue;

if (Config.AST_QuickTarget_SkipDamageDown && TargetHasDamageDown(member)) continue;
if (Config.AST_QuickTarget_SkipRezWeakness && TargetHasRezWeakness(member)) continue;

PartyTargets.Add(member);
}

//The inevitable "0 targets found" because of debuffs
if (PartyTargets.Count == 0)
{
Expand All @@ -91,14 +88,10 @@ private static bool SetTarget()
if (GetPartySlot(i) is not IBattleChara member) continue;
if (member is null) continue; //Skip nulls/disconnected people
if (member.IsDead) continue;
if (OutOfRange(Bole, member)) continue;
if (OutOfRange(Balance, member)) continue;

if (FindEffectOnMember(Buffs.BalanceDamage, member) is not null) continue;
if (FindEffectOnMember(Buffs.ArrowDamage, member) is not null) continue;
if (FindEffectOnMember(Buffs.BoleDamage, member) is not null) continue;
if (FindEffectOnMember(Buffs.EwerDamage, member) is not null) continue;
if (FindEffectOnMember(Buffs.SpireDamage, member) is not null) continue;
if (FindEffectOnMember(Buffs.SpearDamage, member) is not null) continue;
if (FindEffectOnMember(Buffs.BalanceBuff, member) is not null) continue;
if (FindEffectOnMember(Buffs.SpearBuff, member) is not null) continue;

PartyTargets.Add(member);
}
Expand All @@ -121,22 +114,35 @@ private static bool SetTarget()
for (int i = 0; i <= PartyTargets.Count - 1; i++)
{
byte job = PartyTargets[i] is IBattleChara ? (byte)(PartyTargets[i] as IBattleChara).ClassJob.Id : (byte)0;
if (((cardDrawn is CardType.BALANCE or CardType.ARROW or CardType.SPEAR) && JobIDs.Melee.Contains(job)) ||
((cardDrawn is CardType.BOLE or CardType.EWER or CardType.SPIRE) && JobIDs.Ranged.Contains(job)))
if (((cardDrawn is CardType.BALANCE) && JobIDs.Melee.Contains(job)) ||
((cardDrawn is CardType.SPEAR) && JobIDs.Ranged.Contains(job)))
{
//TargetObject(PartyTargets[i]);
SelectedRandomMember = PartyTargets[i];
return true;
}
}
//Give card to unsuitable DPS next
for (int i = 0; i <= PartyTargets.Count - 1; i++)
{
byte job = PartyTargets[i] is IBattleChara ? (byte)(PartyTargets[i] as IBattleChara).ClassJob.Id : (byte)0;
if (((cardDrawn is CardType.BALANCE) && JobIDs.Ranged.Contains(job)) ||
((cardDrawn is CardType.SPEAR) && JobIDs.Melee.Contains(job)))
{
//TargetObject(PartyTargets[i]);
SelectedRandomMember = PartyTargets[i];
return true;
}
}

//Give cards to healers/tanks if backup is turned on
if (IsEnabled(CustomComboPreset.AST_Cards_QuickTargetCards_TargetExtra))
{
for (int i = 0; i <= PartyTargets.Count - 1; i++)
{
byte job = PartyTargets[i] is IBattleChara ? (byte)(PartyTargets[i] as IBattleChara).ClassJob.Id : (byte)0;
if ((cardDrawn is CardType.BALANCE or CardType.ARROW or CardType.SPEAR && JobIDs.Tank.Contains(job)) ||
(cardDrawn is CardType.BOLE or CardType.EWER or CardType.SPIRE && JobIDs.Healer.Contains(job)))
if ((cardDrawn is CardType.BALANCE && JobIDs.Tank.Contains(job)) ||
(cardDrawn is CardType.SPEAR && JobIDs.Healer.Contains(job)))
{
//TargetObject(PartyTargets[i]);
SelectedRandomMember = PartyTargets[i];
Expand Down
Loading

0 comments on commit aa28fbf

Please sign in to comment.