Skip to content

Commit d174048

Browse files
committed
Fix: 684 - AssistFocus - bot doesn't join party1's combat encounter
Core: PullTargetGoal: While AssistFocus is active the enemy might not target the player but the playerfocus. Core: TargetFocusTargetGoal: When the playerfocus is casting - initiates the pull - the assistant may also engage
1 parent fee9a54 commit d174048

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

Core/Goals/PullTargetGoal.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,12 @@ public PullTargetGoal(ILogger<PullTargetGoal> logger, ConfigurableInput input,
8686
}
8787
}
8888

89-
AddPrecondition(GoapKey.targettargetsus, false);
9089
AddPrecondition(GoapKey.hastarget, true);
9190
AddPrecondition(GoapKey.targetisalive, true);
91+
if (classConfig.Mode != Mode.AssistFocus)
92+
{
93+
AddPrecondition(GoapKey.targettargetsus, false);
94+
}
9295
AddPrecondition(GoapKey.targethostile, true);
9396
AddPrecondition(GoapKey.withinpullrange, true);
9497

Core/Goals/TargetFocusTargetGoal.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ public override bool CanRun()
3535
return false;
3636

3737
return
38-
(bits.FocusTarget_Hostile() && bits.FocusTarget_Combat()) ||
39-
!bits.FocusTarget_Hostile();
38+
!bits.TargetTarget_PlayerOrPet() &&
39+
((bits.FocusTarget_Hostile() && bits.FocusTarget_Combat()) ||
40+
!bits.FocusTarget_Hostile() ||
41+
CanPull());
4042
}
4143

4244
public override void OnEnter()
@@ -47,9 +49,9 @@ public override void OnEnter()
4749

4850
public override void Update()
4951
{
50-
if (bits.FocusTarget_Hostile())
52+
if (bits.FocusTarget_Hostile() || playerReader.IsTargetCasting())
5153
{
52-
if (bits.FocusTarget_Combat())
54+
if (bits.FocusTarget_Combat() || CanPull())
5355
{
5456
input.PressTargetFocus();
5557
input.PressTargetOfTarget();
@@ -73,4 +75,9 @@ public override void OnExit()
7375
wait.Update();
7476
}
7577
}
78+
79+
private bool CanPull()
80+
{
81+
return bits.FocusTarget() && playerReader.IsTargetCasting();
82+
}
7683
}

0 commit comments

Comments
 (0)