Skip to content

Commit

Permalink
Merge pull request #264 from CarnifexOptimus/slave_knockbackinvulns
Browse files Browse the repository at this point in the history
added anti knockback abilities
  • Loading branch information
awgil authored Feb 13, 2024
2 parents 76761a1 + 722e3d2 commit 14d0ea7
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions BossMod/Components/Knockback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ public record struct Source(

protected struct PlayerImmuneState
{
public DateTime ArmsLengthSurecastExpire; // 0 if not active
public DateTime InnerStrengthExpire; // 0 if not active
public DateTime RoleBuffExpire; // 0 if not active
public DateTime JobBuffExpire; // 0 if not active
public DateTime DutyBuffExpire; // 0 if not active

public bool ImmuneAt(DateTime time) => ArmsLengthSurecastExpire > time || InnerStrengthExpire > time;
public bool ImmuneAt(DateTime time) => RoleBuffExpire > time || JobBuffExpire > time || DutyBuffExpire > time;
}

public bool IgnoreImmunes { get; private init; }
Expand Down Expand Up @@ -81,16 +82,23 @@ public override void OnStatusGain(BossModule module, Actor actor, ActorStatus st
{
switch (status.ID)
{
case 3054: //Guard in PVP
case (uint)WHM.SID.Surecast:
case (uint)WAR.SID.ArmsLength:
var slot1 = module.Raid.FindSlot(actor.InstanceID);
if (slot1 >= 0)
PlayerImmunes[slot1].ArmsLengthSurecastExpire = status.ExpireAt;
PlayerImmunes[slot1].RoleBuffExpire = status.ExpireAt;
break;
case 1722: //Bluemage Diamondback
case (uint)WAR.SID.InnerStrength:
var slot2 = module.Raid.FindSlot(actor.InstanceID);
if (slot2 >= 0)
PlayerImmunes[slot2].InnerStrengthExpire = status.ExpireAt;
PlayerImmunes[slot2].JobBuffExpire = status.ExpireAt;
break;
case 2345: //Lost Manawall in Bozja
var slot3 = module.Raid.FindSlot(actor.InstanceID);
if (slot3 >= 0)
PlayerImmunes[slot3].DutyBuffExpire = status.ExpireAt;
break;
}
}
Expand All @@ -99,16 +107,23 @@ public override void OnStatusLose(BossModule module, Actor actor, ActorStatus st
{
switch (status.ID)
{
case 3054: //Guard in PVP
case (uint)WHM.SID.Surecast:
case (uint)WAR.SID.ArmsLength:
var slot1 = module.Raid.FindSlot(actor.InstanceID);
if (slot1 >= 0)
PlayerImmunes[slot1].ArmsLengthSurecastExpire = new();
PlayerImmunes[slot1].RoleBuffExpire = new();
break;
case 1722: //Bluemage Diamondback
case (uint)WAR.SID.InnerStrength:
var slot2 = module.Raid.FindSlot(actor.InstanceID);
if (slot2 >= 0)
PlayerImmunes[slot2].InnerStrengthExpire = new();
PlayerImmunes[slot2].JobBuffExpire = new();
break;
case 2345: //Lost Manawall in Bozja
var slot3 = module.Raid.FindSlot(actor.InstanceID);
if (slot3 >= 0)
PlayerImmunes[slot3].DutyBuffExpire = new();
break;
}
}
Expand Down

0 comments on commit 14d0ea7

Please sign in to comment.