Skip to content

Commit edce8b0

Browse files
authored
Merge pull request #8 from Kaeris-Tempest/newfunctions
[Functions] New Functions
2 parents c555c45 + 5351a87 commit edce8b0

File tree

4 files changed

+34
-11
lines changed

4 files changed

+34
-11
lines changed

XIVSlothCombo/Combos/PvE/ALL.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public const uint
2020
Provoke = 7533,
2121
Shirk = 7537,
2222
Reprisal = 7535,
23+
ArmsLength = 7548,
2324
Esuna = 7568,
2425
Rescue = 7571,
2526
SolidReason = 232,
@@ -45,12 +46,14 @@ public static class Buffs
4546
{
4647
public const ushort
4748
Weakness = 43,
49+
WellFed = 48,
4850
Medicated = 49,
4951
Bloodbath = 84,
5052
Swiftcast = 167,
5153
Rampart = 1191,
5254
Peloton = 1199,
5355
LucidDreaming = 1204,
56+
ArmsLength = 1209,
5457
TrueNorth = 1250,
5558
Sprint = 50;
5659
}

XIVSlothCombo/CustomCombo/Functions/Party.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@ namespace XIVSlothCombo.CustomComboNS.Functions
88
{
99
internal abstract partial class CustomComboFunctions
1010
{
11-
/// <summary> Checks if player is in a party </summary>
12-
public static bool IsInParty() => (Svc.Party.PartyId > 0);
11+
/// <summary> Checks if the player is in a party. Optionally, refine by minimum party size. </summary>
12+
/// <param name="partySize"> The minimum amount of party members required. </param>
13+
public static bool IsInParty(int? partySize = null)
14+
{
15+
if (Svc.Party.PartyId > 0) return partySize == null || Svc.Party.Length >= partySize;
16+
17+
else return false;
18+
}
1319

1420
/// <summary> Gets the party list </summary>
1521
/// <returns> Current party list. </returns>

XIVSlothCombo/CustomCombo/Functions/PlayerCharacter.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ internal abstract partial class CustomComboFunctions
2121
/// <returns> A value indicating whether the player is in combat. </returns>
2222
public static bool InCombat() => Svc.Condition[ConditionFlag.InCombat];
2323

24+
/// <summary> Find if the player is bound by duty. </summary>
25+
/// <returns> A value indicating whether the player is bound by duty. </returns>
26+
public static bool InDuty() => Svc.Condition[ConditionFlag.BoundByDuty] || Svc.Condition[ConditionFlag.BoundByDuty56] || Svc.Condition[ConditionFlag.BoundByDuty95];
27+
2428
/// <summary> Find if the player has a pet present. </summary>
2529
/// <returns> A value indicating whether the player has a pet (fairy/carbuncle) present. </returns>
2630
public static bool HasPetPresent() => Svc.Buddies.PetBuddy != null;

XIVSlothCombo/CustomCombo/Functions/Target.cs

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,28 @@ public static bool HasFriendlyTarget(IGameObject? OurTarget = null)
148148
return healTarget;
149149
}
150150

151-
/// <summary> Determines if the enemy can be interrupted if they are currently casting. </summary>
151+
/// <summary> Determines if the enemy is casting an action. Optionally, limit by total cast time. </summary>
152+
/// <param name="minTotalCast"> The minimum total cast time required, in seconds. </param>
153+
/// <returns> Bool indicating whether they are casting an action or not. </returns>
154+
public static bool TargetIsCasting(float? minTotalCast = null)
155+
{
156+
if (CurrentTarget is null || CurrentTarget is not IBattleChara chara) return false;
157+
158+
if (chara.IsCasting) return minTotalCast == null || chara.TotalCastTime >= minTotalCast;
159+
160+
else return false;
161+
}
162+
163+
/// <summary> Determines if the enemy is casting an action that can be interrupted. Optionally, limit by current cast time. </summary>
164+
/// <param name="minCurrentCast"> The minimum current cast time required, in seconds. </param>
152165
/// <returns> Bool indicating whether they can be interrupted or not. </returns>
153-
public static bool CanInterruptEnemy()
166+
public static bool CanInterruptEnemy(float? minCurrentCast = null)
154167
{
155-
if (CurrentTarget is null)
156-
return false;
157-
if (CurrentTarget is not IBattleChara chara)
158-
return false;
159-
if (chara.IsCasting)
160-
return chara.IsCastInterruptible;
168+
if (CurrentTarget is null || CurrentTarget is not IBattleChara chara) return false;
161169

162-
return false;
170+
if (chara.IsCasting && chara.IsCastInterruptible) return minCurrentCast == null || chara.CurrentCastTime >= minCurrentCast;
171+
172+
else return false;
163173
}
164174

165175
/// <summary> Sets the player's target. </summary>

0 commit comments

Comments
 (0)