Skip to content

Commit

Permalink
Execution/lasso now cannot be activated if the pawn is stunned.
Browse files Browse the repository at this point in the history
  • Loading branch information
Epicguru committed Feb 14, 2024
1 parent b859420 commit 0e9fe60
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Languages/English/Keyed/Keys.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@

<AM.Error.Grapple.Dead>{Grappler} is dead</AM.Error.Grapple.Dead>
<AM.Error.Exec.Dead>{Exec} is dead</AM.Error.Exec.Dead>
<AM.Error.Grapple.Stunned>{Grappler} is stunned</AM.Error.Grapple.Stunned>
<AM.Error.Exec.Stunned>{Exec} is stunned</AM.Error.Exec.Stunned>
<AM.Error.Exec.NoWalk>{Target} is not adjacent to {Exec}, and cannot be lassoed or walked to.</AM.Error.Exec.NoWalk>
<AM.Error.Exec.NoWalk.Short>{Target} cannot be reached</AM.Error.Exec.NoWalk.Short>
<AM.Error.Grapple.DeadTarget>{Target} is dead</AM.Error.Grapple.DeadTarget>
Expand Down
11 changes: 11 additions & 0 deletions Source/ThingGenerator/Controller/ActionController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public GrappleAttemptReport GetGrappleReport(in GrappleAttemptRequest req)
if (req.Grappler.Downed)
return new GrappleAttemptReport(req, "Downed");

// Stunned.
if (req.Grappler.stances?.stunner.Stunned ?? false)
return new GrappleAttemptReport(req, "Stunned");

// Check if grappler is in an animation.
if (req.Grappler.IsInAnimation())
return new GrappleAttemptReport(req, "SelfInAnimation");
Expand Down Expand Up @@ -227,6 +231,13 @@ public IEnumerable<ExecutionAttemptReport> GetExecutionReport(ExecutionAttemptRe
yield break;
}

// Check stunned.
if (req.Executioner.stances?.stunner.Stunned ?? false)
{
yield return new ExecutionAttemptReport(req, "Stunned");
yield break;
}

// Check if grappler is in an animation.
if (req.Executioner.IsInAnimation())
{
Expand Down

0 comments on commit 0e9fe60

Please sign in to comment.