Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added anti knockback abilities #264

Merged
merged 4 commits into from
Feb 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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